From 49effa6c35fab2e4572b00321a9c7e9e779a1d3e Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Tue, 14 Dec 2021 15:13:39 +0100
Subject: [PATCH] Built motion from commit 0f96ec74.|2.5.41
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.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 +-
.../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 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/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/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/safe-template.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1159 files changed, 1159 insertions(+), 1159 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 87ad68f..5c8e994 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-14T13:22:39.007Z",
+ "time": "2021-12-14T13:48:37.451Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 5bc990f..2385087 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-14T13:22:39.007Z",
+ "time": "2021-12-14T13:48:37.451Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 84444df..4da71bc 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 _0xcec0=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','jscripty','urlForward','browser','script'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xcec0,0x99));var _0x0cec=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xcec0[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0cec('0x0'));module['exports']={'name':{'type':Sequelize[_0x0cec('0x1')],'get':function(_0x26f03c){return this[_0x0cec('0x2')](_0x0cec('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x0cec('0x4'),'motionbar',_0x0cec('0x5'),_0x0cec('0x6'),_0x0cec('0x7'),'bot',_0x0cec('0x8')]],'msg':_0x0cec('0x9')}},'comment':_0x0cec('0x9')},'data1':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comment':_0x0cec('0xb')},'data2':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comment':_0x0cec('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x0cec('0xd')},'data5':{'type':Sequelize[_0x0cec('0xa')](0x1000),'comments':_0x0cec('0xe')},'data6':{'type':Sequelize[_0x0cec('0xa')],'comments':_0x0cec('0xf')},'data7':{'type':Sequelize[_0x0cec('0x10')],'comments':_0x0cec('0x11')}};
\ No newline at end of file
+var _0x1ed0=['jscripty','urlForward','browser','bot','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[body]','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar'];(function(_0x2b430b,_0x2bf0d1){var _0xe9b5ff=function(_0x52e4ac){while(--_0x52e4ac){_0x2b430b['push'](_0x2b430b['shift']());}};_0xe9b5ff(++_0x2bf0d1);}(_0x1ed0,0x1d6));var _0x01ed=function(_0x2cde51,_0x41b85c){_0x2cde51=_0x2cde51-0x0;var _0x37177e=_0x1ed0[_0x2cde51];return _0x37177e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01ed('0x0')],'get':function(_0x27ad33){return this[_0x01ed('0x1')]('action');}},'action':{'type':Sequelize[_0x01ed('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x01ed('0x3'),_0x01ed('0x4'),_0x01ed('0x5'),_0x01ed('0x6'),_0x01ed('0x7'),_0x01ed('0x8'),_0x01ed('0x9'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x01ed('0xa')},'data1':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xb')},'data2':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xc')},'data3':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comment':_0x01ed('0xd')},'data4':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comments':_0x01ed('0xe')},'data5':{'type':Sequelize[_0x01ed('0x2')](0x1000),'comments':_0x01ed('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x01ed('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 4706e14..009ac9c 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 _0xb63c=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x40c200,_0x36e661){var _0x46be98=function(_0x20d1b9){while(--_0x20d1b9){_0x40c200['push'](_0x40c200['shift']());}};_0x46be98(++_0x36e661);}(_0xb63c,0xe1));var _0xcb63=function(_0x40b323,_0x14d4e3){_0x40b323=_0x40b323-0x0;var _0x5d77c9=_0xb63c[_0x40b323];return _0x5d77c9;};'use strict';var emlformat=require(_0xcb63('0x0'));var rimraf=require(_0xcb63('0x1'));var zipdir=require(_0xcb63('0x2'));var jsonpatch=require(_0xcb63('0x3'));var rp=require(_0xcb63('0x4'));var moment=require(_0xcb63('0x5'));var BPromise=require(_0xcb63('0x6'));var Mustache=require(_0xcb63('0x7'));var util=require(_0xcb63('0x8'));var path=require(_0xcb63('0x9'));var sox=require(_0xcb63('0xa'));var csv=require(_0xcb63('0xb'));var ejs=require(_0xcb63('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb63('0xd'));var squel=require(_0xcb63('0xe'));var crypto=require(_0xcb63('0xf'));var jsforce=require(_0xcb63('0x10'));var deskjs=require(_0xcb63('0x11'));var toCsv=require(_0xcb63('0xb'));var querystring=require(_0xcb63('0x12'));var Papa=require(_0xcb63('0x13'));var Redis=require('ioredis');var authService=require(_0xcb63('0x14'));var qs=require(_0xcb63('0x15'));var as=require(_0xcb63('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb63('0x17'))(_0xcb63('0x18'));var utils=require(_0xcb63('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xcb63('0x1a'));var db=require(_0xcb63('0x1b'))['db'];function respondWithStatusCode(_0x261f68,_0x35fc47){_0x35fc47=_0x35fc47||0xcc;return function(_0x486538){if(_0x486538){return _0x261f68['sendStatus'](_0x35fc47);}return _0x261f68[_0xcb63('0x1c')](_0x35fc47)[_0xcb63('0x1d')]();};}function respondWithResult(_0x44326b,_0x502bcc){_0x502bcc=_0x502bcc||0xc8;return function(_0x14b905){if(_0x14b905){return _0x44326b['status'](_0x502bcc)['json'](_0x14b905);}};}function respondWithFilteredResult(_0x2bebdb,_0x9fb8bc){return function(_0x5ea2c7){if(_0x5ea2c7){var _0x21aab8=typeof _0x9fb8bc['offset']==='undefined'&&typeof _0x9fb8bc[_0xcb63('0x1e')]===_0xcb63('0x1f');var _0x4bbdf8=_0x5ea2c7[_0xcb63('0x20')];var _0x238b85=_0x21aab8?0x0:_0x9fb8bc[_0xcb63('0x21')];var _0x44f78f=_0x21aab8?_0x5ea2c7[_0xcb63('0x20')]:_0x9fb8bc[_0xcb63('0x21')]+_0x9fb8bc[_0xcb63('0x1e')];var _0x491443;if(_0x44f78f>=_0x4bbdf8){_0x44f78f=_0x4bbdf8;_0x491443=0xc8;}else{_0x491443=0xce;}_0x2bebdb[_0xcb63('0x1c')](_0x491443);return _0x2bebdb['set']('Content-Range',_0x238b85+'-'+_0x44f78f+'/'+_0x4bbdf8)['json'](_0x5ea2c7);}return null;};}function patchUpdates(_0x286c2c){return function(_0x30a22d){try{jsonpatch['apply'](_0x30a22d,_0x286c2c,!![]);}catch(_0x128e22){return BPromise[_0xcb63('0x22')](_0x128e22);}return _0x30a22d[_0xcb63('0x23')]();};}function saveUpdates(_0x41dc77,_0x58246e){return function(_0x30fb6f){if(_0x30fb6f){return _0x30fb6f[_0xcb63('0x24')](_0x41dc77)[_0xcb63('0x25')](function(_0x452231){return _0x452231;});}return null;};}function removeEntity(_0x5f5b,_0x5a7e0a){return function(_0x1c2269){if(_0x1c2269){return _0x1c2269[_0xcb63('0x26')]()[_0xcb63('0x25')](function(){_0x5f5b[_0xcb63('0x1c')](0xcc)[_0xcb63('0x1d')]();});}};}function handleEntityNotFound(_0x98baf6,_0x38ebfc){return function(_0x4ec113){if(!_0x4ec113){_0x98baf6[_0xcb63('0x27')](0x194);}return _0x4ec113;};}function handleError(_0x465c00,_0x1a4aa5){_0x1a4aa5=_0x1a4aa5||0x1f4;return function(_0x57c524){logger[_0xcb63('0x28')](_0x57c524[_0xcb63('0x29')]);if(_0x57c524[_0xcb63('0x2a')]){delete _0x57c524[_0xcb63('0x2a')];}_0x465c00[_0xcb63('0x1c')](_0x1a4aa5)[_0xcb63('0x2b')](_0x57c524);};}exports[_0xcb63('0x24')]=function(_0x1fea19,_0x3adc27){if(_0x1fea19[_0xcb63('0x2c')]['id']){delete _0x1fea19[_0xcb63('0x2c')]['id'];}return db[_0xcb63('0x2d')][_0xcb63('0x2e')]({'where':{'id':_0x1fea19['params']['id']}})['then'](handleEntityNotFound(_0x3adc27,null))['then'](saveUpdates(_0x1fea19[_0xcb63('0x2c')],null))[_0xcb63('0x25')](respondWithResult(_0x3adc27,null))['catch'](handleError(_0x3adc27,null));};exports['destroy']=function(_0x183b82,_0x4d6ac8){return db[_0xcb63('0x2d')]['find']({'where':{'id':_0x183b82['params']['id']}})[_0xcb63('0x25')](handleEntityNotFound(_0x4d6ac8,null))[_0xcb63('0x25')](removeEntity(_0x4d6ac8,null))[_0xcb63('0x2f')](handleError(_0x4d6ac8,null));};
\ No newline at end of file
+var _0xed32=['fs-extra','lodash','jsforce','desk.js','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','stack','name','send','update','body','Action','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x55a26f,_0x16f9bd){var _0x32590e=function(_0x52c912){while(--_0x52c912){_0x55a26f['push'](_0x55a26f['shift']());}};_0x32590e(++_0x16f9bd);}(_0xed32,0x1ba));var _0x2ed3=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xed32[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x2ed3('0x0'));var rimraf=require(_0x2ed3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ed3('0x2'));var rp=require('request-promise');var moment=require(_0x2ed3('0x3'));var BPromise=require(_0x2ed3('0x4'));var Mustache=require('mustache');var util=require(_0x2ed3('0x5'));var path=require('path');var sox=require(_0x2ed3('0x6'));var csv=require(_0x2ed3('0x7'));var ejs=require(_0x2ed3('0x8'));var fs=require('fs');var fs_extra=require(_0x2ed3('0x9'));var _=require(_0x2ed3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2ed3('0xb'));var deskjs=require(_0x2ed3('0xc'));var toCsv=require(_0x2ed3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ed3('0xd'));var logger=require(_0x2ed3('0xe'))('api');var utils=require(_0x2ed3('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x2ed3('0x10'));var db=require(_0x2ed3('0x11'))['db'];function respondWithStatusCode(_0x983ecc,_0x442ff0){_0x442ff0=_0x442ff0||0xcc;return function(_0x556b4a){if(_0x556b4a){return _0x983ecc[_0x2ed3('0x12')](_0x442ff0);}return _0x983ecc[_0x2ed3('0x13')](_0x442ff0)[_0x2ed3('0x14')]();};}function respondWithResult(_0x3d845f,_0x633979){_0x633979=_0x633979||0xc8;return function(_0x2f12b5){if(_0x2f12b5){return _0x3d845f['status'](_0x633979)[_0x2ed3('0x15')](_0x2f12b5);}};}function respondWithFilteredResult(_0x14700b,_0x139c21){return function(_0x19a320){if(_0x19a320){var _0x18d548=typeof _0x139c21['offset']==='undefined'&&typeof _0x139c21[_0x2ed3('0x16')]===_0x2ed3('0x17');var _0x1853f2=_0x19a320[_0x2ed3('0x18')];var _0x30d83a=_0x18d548?0x0:_0x139c21[_0x2ed3('0x19')];var _0xa77875=_0x18d548?_0x19a320[_0x2ed3('0x18')]:_0x139c21['offset']+_0x139c21[_0x2ed3('0x16')];var _0x25acde;if(_0xa77875>=_0x1853f2){_0xa77875=_0x1853f2;_0x25acde=0xc8;}else{_0x25acde=0xce;}_0x14700b[_0x2ed3('0x13')](_0x25acde);return _0x14700b[_0x2ed3('0x1a')](_0x2ed3('0x1b'),_0x30d83a+'-'+_0xa77875+'/'+_0x1853f2)[_0x2ed3('0x15')](_0x19a320);}return null;};}function patchUpdates(_0x1a2565){return function(_0x3e7968){try{jsonpatch[_0x2ed3('0x1c')](_0x3e7968,_0x1a2565,!![]);}catch(_0x1756a2){return BPromise[_0x2ed3('0x1d')](_0x1756a2);}return _0x3e7968['save']();};}function saveUpdates(_0x4ea73f,_0x3be596){return function(_0x427647){if(_0x427647){return _0x427647['update'](_0x4ea73f)['then'](function(_0xebf2c4){return _0xebf2c4;});}return null;};}function removeEntity(_0x486f10,_0x3cb086){return function(_0x410fb1){if(_0x410fb1){return _0x410fb1['destroy']()[_0x2ed3('0x1e')](function(){_0x486f10[_0x2ed3('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1a33,_0x127e33){return function(_0x1d1041){if(!_0x1d1041){_0x5e1a33[_0x2ed3('0x12')](0x194);}return _0x1d1041;};}function handleError(_0x16454d,_0x319715){_0x319715=_0x319715||0x1f4;return function(_0x5c666e){logger['error'](_0x5c666e[_0x2ed3('0x1f')]);if(_0x5c666e[_0x2ed3('0x20')]){delete _0x5c666e[_0x2ed3('0x20')];}_0x16454d[_0x2ed3('0x13')](_0x319715)[_0x2ed3('0x21')](_0x5c666e);};}exports[_0x2ed3('0x22')]=function(_0x1e4ac7,_0x584fdb){if(_0x1e4ac7[_0x2ed3('0x23')]['id']){delete _0x1e4ac7[_0x2ed3('0x23')]['id'];}return db[_0x2ed3('0x24')][_0x2ed3('0x25')]({'where':{'id':_0x1e4ac7[_0x2ed3('0x26')]['id']}})[_0x2ed3('0x1e')](handleEntityNotFound(_0x584fdb,null))[_0x2ed3('0x1e')](saveUpdates(_0x1e4ac7[_0x2ed3('0x23')],null))['then'](respondWithResult(_0x584fdb,null))[_0x2ed3('0x27')](handleError(_0x584fdb,null));};exports[_0x2ed3('0x28')]=function(_0x21dd29,_0x58c55a){return db['Action'][_0x2ed3('0x25')]({'where':{'id':_0x21dd29[_0x2ed3('0x26')]['id']}})['then'](handleEntityNotFound(_0x58c55a,null))[_0x2ed3('0x1e')](removeEntity(_0x58c55a,null))[_0x2ed3('0x27')](handleError(_0x58c55a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c08091f..e6cf951 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 _0xa57c=['rimraf','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','path'];(function(_0x2c7de4,_0x57370c){var _0x5dc96d=function(_0x498b89){while(--_0x498b89){_0x2c7de4['push'](_0x2c7de4['shift']());}};_0x5dc96d(++_0x57370c);}(_0xa57c,0x1aa));var _0xca57=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa57c[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xca57('0x0'));var logger=require(_0xca57('0x1'))('api');var moment=require(_0xca57('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca57('0x3'));var rimraf=require(_0xca57('0x4'));var config=require('../../config/environment');var attributes=require(_0xca57('0x5'));module[_0xca57('0x6')]=function(_0x53ba60,_0x53ee3c){return _0x53ba60[_0xca57('0x7')](_0xca57('0x8'),attributes,{'tableName':_0xca57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf002=['api','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xf002,0xa6));var _0x2f00=function(_0x5e4aaf,_0x4d38e2){_0x5e4aaf=_0x5e4aaf-0x0;var _0x2b4fcc=_0xf002[_0x5e4aaf];return _0x2b4fcc;};'use strict';var _=require(_0x2f00('0x0'));var util=require(_0x2f00('0x1'));var logger=require(_0x2f00('0x2'))(_0x2f00('0x3'));var moment=require('moment');var BPromise=require(_0x2f00('0x4'));var rp=require(_0x2f00('0x5'));var fs=require('fs');var path=require(_0x2f00('0x6'));var rimraf=require('rimraf');var config=require(_0x2f00('0x7'));var attributes=require(_0x2f00('0x8'));module[_0x2f00('0x9')]=function(_0x581ca8,_0x7fd3e7){return _0x581ca8[_0x2f00('0xa')](_0x2f00('0xb'),attributes,{'tableName':_0x2f00('0xc'),'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 03340c7..5f948c3 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x53ec,0x192));var _0xc53e=function(_0xf937d7,_0x59d955){_0xf937d7=_0xf937d7-0x0;var _0x39edc8=_0x53ec[_0xf937d7];return _0x39edc8;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x814b,0x1a2));var _0xb814=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x814b[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2443e3b..d6c322a 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 _0x4832=['fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4832,0x1a7));var _0x2483=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x4832[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require(_0x2483('0x0'));var util=require(_0x2483('0x1'));var path=require(_0x2483('0x2'));var timeout=require(_0x2483('0x3'));var express=require(_0x2483('0x4'));var router=express[_0x2483('0x5')]();var fs_extra=require(_0x2483('0x6'));var auth=require(_0x2483('0x7'));var interaction=require(_0x2483('0x8'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x2483('0x9')](_0x2483('0xa'),auth[_0x2483('0xb')](),controller[_0x2483('0xc')]);router['delete'](_0x2483('0xa'),auth[_0x2483('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x1f2b=['put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x517f64,_0xf28929){var _0x4327ff=function(_0x4fcfa0){while(--_0x4fcfa0){_0x517f64['push'](_0x517f64['shift']());}};_0x4327ff(++_0xf28929);}(_0x1f2b,0xe7));var _0xb1f2=function(_0x36ef70,_0x3e0f69){_0x36ef70=_0x36ef70-0x0;var _0x10d75b=_0x1f2b[_0x36ef70];return _0x10d75b;};'use strict';var multer=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var path=require(_0xb1f2('0x2'));var timeout=require(_0xb1f2('0x3'));var express=require(_0xb1f2('0x4'));var router=express['Router']();var fs_extra=require(_0xb1f2('0x5'));var auth=require(_0xb1f2('0x6'));var interaction=require(_0xb1f2('0x7'));var config=require('../../config/environment');var controller=require(_0xb1f2('0x8'));router[_0xb1f2('0x9')](_0xb1f2('0xa'),auth[_0xb1f2('0xb')](),controller[_0xb1f2('0xc')]);router[_0xb1f2('0xd')](_0xb1f2('0xa'),auth['isAuthenticated'](),controller[_0xb1f2('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d0bbd1e..c816724 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x2adfd4,_0x3fb08c){var _0x3532b6=function(_0x2d525f){while(--_0x2d525f){_0x2adfd4['push'](_0x2adfd4['shift']());}};_0x3532b6(++_0x3fb08c);}(_0x7217,0x19e));var _0x7721=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x7217[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0xbe0d54,_0x5c3362){var _0x13e619=function(_0xfa3e7f){while(--_0xfa3e7f){_0xbe0d54['push'](_0xbe0d54['shift']());}};_0x13e619(++_0x5c3362);}(_0x2eb2,0x19f));var _0x22eb=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2eb2[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index be6e57d..b538443 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 _0x2c38=['options','includeAll','include','rows','params','rawAttributes','length','find','catch','body','user','role','Reports','autoAssociation','create','CustomReports','update','preview','join','left_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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','alias','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','then','destroy','get','error','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0xe33b12,_0x2a9761){var _0x30699d=function(_0x209952){while(--_0x209952){_0xe33b12['push'](_0xe33b12['shift']());}};_0x30699d(++_0x2a9761);}(_0x2c38,0x109));var _0x82c3=function(_0x5e941f,_0x41d741){_0x5e941f=_0x5e941f-0x0;var _0x5b52c4=_0x2c38[_0x5e941f];return _0x5b52c4;};'use strict';var emlformat=require(_0x82c3('0x0'));var rimraf=require(_0x82c3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82c3('0x2'));var moment=require(_0x82c3('0x3'));var BPromise=require(_0x82c3('0x4'));var Mustache=require('mustache');var util=require(_0x82c3('0x5'));var path=require(_0x82c3('0x6'));var sox=require(_0x82c3('0x7'));var csv=require(_0x82c3('0x8'));var ejs=require(_0x82c3('0x9'));var fs=require('fs');var fs_extra=require(_0x82c3('0xa'));var _=require('lodash');var squel=require(_0x82c3('0xb'));var crypto=require(_0x82c3('0xc'));var jsforce=require(_0x82c3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x82c3('0x8'));var querystring=require('querystring');var Papa=require(_0x82c3('0xe'));var Redis=require(_0x82c3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x82c3('0x10'));var hardwareService=require(_0x82c3('0x11'));var logger=require(_0x82c3('0x12'))(_0x82c3('0x13'));var utils=require(_0x82c3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x82c3('0x15'));var db=require(_0x82c3('0x16'))['db'];var dbH=require(_0x82c3('0x16'))[_0x82c3('0x17')];function respondWithStatusCode(_0x4f29b0,_0x2e0955){_0x2e0955=_0x2e0955||0xcc;return function(_0x44b214){if(_0x44b214){return _0x4f29b0[_0x82c3('0x18')](_0x2e0955);}return _0x4f29b0['status'](_0x2e0955)[_0x82c3('0x19')]();};}function respondWithResult(_0x144f2d,_0x25afe1){_0x25afe1=_0x25afe1||0xc8;return function(_0x582966){if(_0x582966){return _0x144f2d[_0x82c3('0x1a')](_0x25afe1)[_0x82c3('0x1b')](_0x582966);}};}function respondWithFilteredResult(_0x16ddbd,_0x56bdc9){return function(_0x29ce2c){if(_0x29ce2c){var _0x1aab92=typeof _0x56bdc9[_0x82c3('0x1c')]===_0x82c3('0x1d')&&typeof _0x56bdc9[_0x82c3('0x1e')]===_0x82c3('0x1d');var _0xa2ca3=_0x29ce2c[_0x82c3('0x1f')];var _0x2ac318=_0x1aab92?0x0:_0x56bdc9['offset'];var _0x4ce0b8=_0x1aab92?_0x29ce2c[_0x82c3('0x1f')]:_0x56bdc9[_0x82c3('0x1c')]+_0x56bdc9[_0x82c3('0x1e')];var _0x2c457f;if(_0x4ce0b8>=_0xa2ca3){_0x4ce0b8=_0xa2ca3;_0x2c457f=0xc8;}else{_0x2c457f=0xce;}_0x16ddbd[_0x82c3('0x1a')](_0x2c457f);return _0x16ddbd[_0x82c3('0x20')]('Content-Range',_0x2ac318+'-'+_0x4ce0b8+'/'+_0xa2ca3)[_0x82c3('0x1b')](_0x29ce2c);}return null;};}function patchUpdates(_0x271a74){return function(_0x4f44e3){try{jsonpatch['apply'](_0x4f44e3,_0x271a74,!![]);}catch(_0x478739){return BPromise[_0x82c3('0x21')](_0x478739);}return _0x4f44e3['save']();};}function saveUpdates(_0x446f96,_0x5d68a8){return function(_0x5f3c1d){if(_0x5f3c1d){return _0x5f3c1d['update'](_0x446f96)[_0x82c3('0x22')](function(_0x1ab11e){return _0x1ab11e;});}return null;};}function removeEntity(_0x3e0908,_0x2edb8d){return function(_0x162616){if(_0x162616){return _0x162616[_0x82c3('0x23')]()[_0x82c3('0x22')](function(){var _0x25e4ec=_0x162616[_0x82c3('0x24')]({'plain':!![]});var _0x4e7e06='CustomReports';return db['UserProfileResource'][_0x82c3('0x23')]({'where':{'type':_0x4e7e06,'resourceId':_0x25e4ec['id']}})['then'](function(){return _0x162616;});})['then'](function(){_0x3e0908[_0x82c3('0x1a')](0xcc)[_0x82c3('0x19')]();});}};}function handleEntityNotFound(_0xa06a0b,_0x447185){return function(_0x34c4bd){if(!_0x34c4bd){_0xa06a0b['sendStatus'](0x194);}return _0x34c4bd;};}function handleError(_0x414f4c,_0x4692f4){_0x4692f4=_0x4692f4||0x1f4;return function(_0x472941){logger[_0x82c3('0x25')](_0x472941[_0x82c3('0x26')]);if(_0x472941[_0x82c3('0x27')]){delete _0x472941[_0x82c3('0x27')];}_0x414f4c[_0x82c3('0x1a')](_0x4692f4)['send'](_0x472941);};}exports[_0x82c3('0x28')]=function(_0x157c1c,_0x4d08ff){var _0x4e7739={},_0x4f3978={},_0xdc2711={'count':0x0,'rows':[]};var _0xc944bf=_[_0x82c3('0x29')](db[_0x82c3('0x2a')]['rawAttributes'],function(_0xa84d02){return{'name':_0xa84d02[_0x82c3('0x2b')],'type':_0xa84d02[_0x82c3('0x2c')][_0x82c3('0x2d')]};});_0x4f3978[_0x82c3('0x2e')]=_[_0x82c3('0x29')](_0xc944bf,_0x82c3('0x27'));_0x4f3978[_0x82c3('0x2f')]=_[_0x82c3('0x30')](_0x157c1c['query']);_0x4f3978[_0x82c3('0x31')]=_[_0x82c3('0x32')](_0x4f3978[_0x82c3('0x2e')],_0x4f3978['query']);_0x4e7739[_0x82c3('0x33')]=_[_0x82c3('0x32')](_0x4f3978[_0x82c3('0x2e')],qs[_0x82c3('0x34')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x34')]));_0x4e7739[_0x82c3('0x33')]=_0x4e7739[_0x82c3('0x33')]['length']?_0x4e7739['attributes']:_0x4f3978[_0x82c3('0x2e')];if(!_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x35')](_0x82c3('0x36'))){_0x4e7739[_0x82c3('0x1e')]=qs['limit'](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x1e')]);_0x4e7739[_0x82c3('0x1c')]=qs[_0x82c3('0x1c')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x1c')]);}_0x4e7739[_0x82c3('0x37')]=qs[_0x82c3('0x38')](_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x38')]);_0x4e7739[_0x82c3('0x39')]=qs[_0x82c3('0x31')](_[_0x82c3('0x3a')](_0x157c1c[_0x82c3('0x2f')],_0x4f3978[_0x82c3('0x31')]),_0xc944bf);if(_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3b')]){_0x4e7739[_0x82c3('0x39')]=_[_0x82c3('0x3c')](_0x4e7739[_0x82c3('0x39')],{'$or':_['map'](_0xc944bf,function(_0x46b934){if(_0x46b934[_0x82c3('0x2c')]!=='VIRTUAL'){var _0x2093c2={};_0x2093c2[_0x46b934['name']]={'$like':'%'+_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3b')]+'%'};return _0x2093c2;}})});}_0x4e7739=_['merge']({},_0x4e7739,_0x157c1c[_0x82c3('0x3d')]);var _0x5697a0={'where':_0x4e7739['where']};return db[_0x82c3('0x2a')][_0x82c3('0x1f')](_0x5697a0)[_0x82c3('0x22')](function(_0x341aa6){_0xdc2711[_0x82c3('0x1f')]=_0x341aa6;if(_0x157c1c[_0x82c3('0x2f')][_0x82c3('0x3e')]){_0x4e7739[_0x82c3('0x3f')]=[{'all':!![]}];}return db[_0x82c3('0x2a')]['findAll'](_0x4e7739);})[_0x82c3('0x22')](function(_0x3f4bc5){_0xdc2711[_0x82c3('0x40')]=_0x3f4bc5;return _0xdc2711;})['then'](respondWithFilteredResult(_0x4d08ff,_0x4e7739))['catch'](handleError(_0x4d08ff,null));};exports['show']=function(_0x1aaea4,_0x2013f8){var _0x5a26d7={'raw':![],'where':{'id':_0x1aaea4[_0x82c3('0x41')]['id']}},_0x59543c={};_0x59543c[_0x82c3('0x2e')]=_[_0x82c3('0x30')](db[_0x82c3('0x2a')][_0x82c3('0x42')]);_0x59543c[_0x82c3('0x2f')]=_[_0x82c3('0x30')](_0x1aaea4[_0x82c3('0x2f')]);_0x59543c[_0x82c3('0x31')]=_[_0x82c3('0x32')](_0x59543c['model'],_0x59543c[_0x82c3('0x2f')]);_0x5a26d7[_0x82c3('0x33')]=_[_0x82c3('0x32')](_0x59543c[_0x82c3('0x2e')],qs[_0x82c3('0x34')](_0x1aaea4[_0x82c3('0x2f')][_0x82c3('0x34')]));_0x5a26d7[_0x82c3('0x33')]=_0x5a26d7[_0x82c3('0x33')][_0x82c3('0x43')]?_0x5a26d7[_0x82c3('0x33')]:_0x59543c['model'];if(_0x1aaea4[_0x82c3('0x2f')][_0x82c3('0x3e')]){_0x5a26d7['include']=[{'all':!![]}];}_0x5a26d7=_[_0x82c3('0x3c')]({},_0x5a26d7,_0x1aaea4['options']);return db[_0x82c3('0x2a')][_0x82c3('0x44')](_0x5a26d7)[_0x82c3('0x22')](handleEntityNotFound(_0x2013f8,null))['then'](respondWithResult(_0x2013f8,null))[_0x82c3('0x45')](handleError(_0x2013f8,null));};exports['create']=function(_0x5aa83a,_0x31bbc2){return db[_0x82c3('0x2a')]['create'](_0x5aa83a[_0x82c3('0x46')],{})[_0x82c3('0x22')](function(_0x36ac00){var _0x5b148d=_0x5aa83a[_0x82c3('0x47')][_0x82c3('0x24')]({'plain':!![]});if(!_0x5b148d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b148d[_0x82c3('0x48')]===_0x82c3('0x47')){var _0x2bf3e5=_0x36ac00[_0x82c3('0x24')]({'plain':!![]});var _0x495102=_0x82c3('0x49');return db['UserProfileSection'][_0x82c3('0x44')]({'where':{'name':_0x495102,'userProfileId':_0x5b148d['userProfileId']},'raw':!![]})['then'](function(_0x5e2f63){if(_0x5e2f63&&_0x5e2f63[_0x82c3('0x4a')]===0x0){return db['UserProfileResource'][_0x82c3('0x4b')]({'name':_0x2bf3e5[_0x82c3('0x27')],'resourceId':_0x2bf3e5['id'],'type':_0x82c3('0x4c'),'sectionId':_0x5e2f63['id']},{})[_0x82c3('0x22')](function(){return _0x36ac00;});}else{return _0x36ac00;}})[_0x82c3('0x45')](function(_0x28e709){logger[_0x82c3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28e709);throw _0x28e709;});}return _0x36ac00;})['then'](respondWithResult(_0x31bbc2,0xc9))[_0x82c3('0x45')](handleError(_0x31bbc2,null));};exports[_0x82c3('0x4d')]=function(_0xc5ffbf,_0x2db356){if(_0xc5ffbf[_0x82c3('0x46')]['id']){delete _0xc5ffbf['body']['id'];}return db[_0x82c3('0x2a')][_0x82c3('0x44')]({'where':{'id':_0xc5ffbf[_0x82c3('0x41')]['id']}})[_0x82c3('0x22')](handleEntityNotFound(_0x2db356,null))[_0x82c3('0x22')](saveUpdates(_0xc5ffbf['body'],null))[_0x82c3('0x22')](respondWithResult(_0x2db356,null))['catch'](handleError(_0x2db356,null));};exports[_0x82c3('0x23')]=function(_0x17da71,_0x501362){return db[_0x82c3('0x2a')]['find']({'where':{'id':_0x17da71[_0x82c3('0x41')]['id']}})[_0x82c3('0x22')](handleEntityNotFound(_0x501362,null))['then'](removeEntity(_0x501362,null))['catch'](handleError(_0x501362,null));};exports[_0x82c3('0x4e')]=function(_0x58de2e,_0x534dd1){var _0x16186d=0xa;var _0x2018c6=[_0x82c3('0x4f'),_0x82c3('0x50'),'right_join',_0x82c3('0x51')];var _0x1914e1={'SUM':_0x82c3('0x52'),'COUNT':_0x82c3('0x53'),'COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':_0x82c3('0x56'),'AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':_0x82c3('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a124e={'SEC_TO_TIME':_0x82c3('0x5a'),'DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x12d58a=function(_0x5c36b2){return!_[_0x82c3('0x5e')]([_0x82c3('0x5f'),_0x82c3('0x60'),_0x82c3('0x61'),_0x82c3('0x62')],_0x5c36b2);};var _0x5b3b1d=function(_0x3db486){if(!_0x3db486||!_0x3db486[_0x82c3('0x63')][_0x82c3('0x43')]){return'';}for(var _0x4c23a2='(',_0x36ae91=0x0;_0x36ae91<_0x3db486[_0x82c3('0x63')][_0x82c3('0x43')];_0x36ae91+=0x1){_0x36ae91>0x0&&(_0x4c23a2+='\x20'+_0x3db486[_0x82c3('0x64')]+'\x20');_0x4c23a2+=_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x65')]?_0x5b3b1d(_0x3db486[_0x82c3('0x63')][_0x36ae91]['group']):_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x66')]+'\x20'+_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x67')]+(_0x12d58a(_0x3db486[_0x82c3('0x63')][_0x36ae91][_0x82c3('0x67')])?'\x20'+_0x3db486[_0x82c3('0x63')][_0x36ae91]['value']:'');}return _0x4c23a2+')';};var _0x1ff156={'where':{'id':_0x58de2e[_0x82c3('0x41')]['id']}},_0x49d332,_0x4da49a,_0x5ba2d1,_0x2ec994,_0x16c764;_0x1ff156=_[_0x82c3('0x3c')]({},_0x1ff156,_0x58de2e['options']);return db[_0x82c3('0x2a')][_0x82c3('0x44')](_0x1ff156)[_0x82c3('0x22')](function(_0x523fa7){if(_0x523fa7){_0x49d332=_0x523fa7;return _0x523fa7[_0x82c3('0x68')]();}return null;})[_0x82c3('0x22')](function(_0x55ba85){if(_0x55ba85){if(!_0x55ba85[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))][(_0x82c3('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4da49a=_0x55ba85;return db['AnalyticMetric'][_0x82c3('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x406cc8){if(_0x406cc8){_0x5ba2d1=_[_0x82c3('0x6c')](_0x406cc8,'id');var _0x35f35a;var _0x1dced4=squel[_0x82c3('0x6d')]();_0x1dced4[_0x82c3('0x6e')](_0x49d332[_0x82c3('0x6f')]);for(var _0x13ef6d=0x0;_0x13ef6d<_0x4da49a['length'];_0x13ef6d+=0x1){_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x70')]?_0x5ba2d1[_0x4da49a[_0x13ef6d]['MetricId']]['metric']:_0x4da49a[_0x13ef6d][_0x82c3('0x66')];_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x71')]?_['replace'](_0x1914e1[_0x4da49a[_0x13ef6d][_0x82c3('0x71')]],'%s',_0x35f35a):_0x35f35a;_0x35f35a=_0x4da49a[_0x13ef6d][_0x82c3('0x72')]?_[_0x82c3('0x73')](_0x1a124e[_0x4da49a[_0x13ef6d]['format']],'%s',_0x35f35a):_0x35f35a;if(_0x4da49a[_0x13ef6d][_0x82c3('0x74')]){_0x1dced4[_0x82c3('0x65')](_0x35f35a);}_0x4da49a[_0x13ef6d][_0x82c3('0x75')]&&_0x1dced4['order'](_0x35f35a,_0x4da49a[_0x13ef6d][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x1dced4[_0x82c3('0x66')](_0x35f35a,_0x4da49a[_0x13ef6d]['alias']||_0x35f35a);}if(_0x49d332[_0x82c3('0x77')]){_0x49d332[_0x82c3('0x77')]=JSON['parse'](_0x49d332[_0x82c3('0x77')]);for(var _0x111e1f=0x0;_0x111e1f<_0x49d332[_0x82c3('0x77')][_0x82c3('0x43')];_0x111e1f+=0x1){if(_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x2c')]&&_['includes'](_0x2018c6,_0x49d332[_0x82c3('0x77')][_0x111e1f]['type'])&&_0x49d332[_0x82c3('0x77')][_0x111e1f]['parentKey']&&_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignTable']&&_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x78')]){_0x1dced4[_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x2c')]](_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x79')],null,util['format'](_0x82c3('0x7a'),_0x49d332[_0x82c3('0x6f')],_0x49d332[_0x82c3('0x77')][_0x111e1f][_0x82c3('0x7b')],_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignTable'],_0x49d332[_0x82c3('0x77')][_0x111e1f]['foreignKey']));}}}if(_0x49d332[_0x82c3('0x7c')]){_0x49d332[_0x82c3('0x7c')]=JSON[_0x82c3('0x7d')](_0x49d332[_0x82c3('0x7c')]);_0x1dced4[_0x82c3('0x39')](_0x5b3b1d(_0x49d332[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x16c764=_0x1dced4[_0x82c3('0x7e')]();_0x1dced4[_0x82c3('0x1e')](_0x16186d);_0x1dced4['offset'](0x0);logger[_0x82c3('0x7f')](_0x82c3('0x80'),_0x1dced4[_0x82c3('0x81')]());return dbH[_0x82c3('0x82')]['query'](_0x1dced4[_0x82c3('0x81')](),{'type':dbH['sequelize'][_0x82c3('0x83')][_0x82c3('0x84')]});}})['then'](respondWithResult(_0x534dd1,null))['catch'](handleError(_0x534dd1,null));};function runReport(_0x29b890,_0x412960,_0x1a2d90){var _0x11da75=_0x412960['name'];var _0x2458f1=0xa;var _0x5ea75d=[_0x82c3('0x4f'),_0x82c3('0x50'),_0x82c3('0x85'),_0x82c3('0x51')];var _0x52ae3d={'SUM':_0x82c3('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':'MIN(%s)','AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x82c3('0x86')};var _0x34fdfb={'SEC_TO_TIME':_0x82c3('0x5a'),'DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':_0x82c3('0x87')};var _0x1d3745=function(_0x151232){return!_[_0x82c3('0x5e')]([_0x82c3('0x5f'),_0x82c3('0x60'),_0x82c3('0x61'),'IS\x20NOT\x20EMPTY'],_0x151232);};var _0x103a2e=function(_0x4c494d){if(!_0x4c494d||!_0x4c494d[_0x82c3('0x63')]['length']){return'';}for(var _0x1381ee='(',_0x1cfd58=0x0;_0x1cfd58<_0x4c494d['rules'][_0x82c3('0x43')];_0x1cfd58+=0x1){_0x1cfd58>0x0&&(_0x1381ee+='\x20'+_0x4c494d['operator']+'\x20');_0x1381ee+=_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x65')]?_0x103a2e(_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x65')]):_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x66')]+'\x20'+_0x4c494d[_0x82c3('0x63')][_0x1cfd58]['condition']+(_0x1d3745(_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x67')])?'\x20'+_0x4c494d[_0x82c3('0x63')][_0x1cfd58][_0x82c3('0x88')]:'');}return _0x1381ee+')';};var _0x322984={'where':{'id':_0x29b890['id']}},_0x4a33ed,_0x1b83ae,_0x1356f3,_0x4ad8fa,_0x4767ea;_0x322984=_['merge']({},_0x322984,_0x1a2d90);return db['AnalyticCustomReport'][_0x82c3('0x44')](_0x322984)['then'](function(_0x492ccf){if(_0x492ccf){_0x4a33ed=_0x492ccf;return _0x492ccf['getFields']();}return null;})['then'](function(_0x66ceb9){if(_0x66ceb9){if(!_0x66ceb9[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))][(_0x82c3('0x6a'))](_0x82c3('0x89'),0x193);}_0x1b83ae=_0x66ceb9;return db[_0x82c3('0x8a')]['findAll']({'raw':!![]});}return null;})[_0x82c3('0x22')](function(_0x5f4fff){if(_0x5f4fff){_0x1356f3=_[_0x82c3('0x6c')](_0x5f4fff,'id');var _0x53e377;var _0x22a060=squel[_0x82c3('0x6d')]();_0x22a060[_0x82c3('0x6e')](_0x4a33ed['table']);for(var _0xa79212=0x0;_0xa79212<_0x1b83ae[_0x82c3('0x43')];_0xa79212+=0x1){_0x53e377=_0x1b83ae[_0xa79212]['MetricId']?_0x1356f3[_0x1b83ae[_0xa79212]['MetricId']][_0x82c3('0x8b')]:_0x1b83ae[_0xa79212]['field'];_0x53e377=_0x1b83ae[_0xa79212][_0x82c3('0x71')]?_[_0x82c3('0x73')](_0x52ae3d[_0x1b83ae[_0xa79212][_0x82c3('0x71')]],'%s',_0x53e377):_0x53e377;_0x53e377=_0x1b83ae[_0xa79212]['format']?_[_0x82c3('0x73')](_0x34fdfb[_0x1b83ae[_0xa79212][_0x82c3('0x72')]],'%s',_0x53e377):_0x53e377;if(_0x1b83ae[_0xa79212][_0x82c3('0x74')]){_0x22a060['group'](_0x53e377);}_0x1b83ae[_0xa79212][_0x82c3('0x75')]&&_0x22a060[_0x82c3('0x37')](_0x53e377,_0x1b83ae[_0xa79212][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x22a060[_0x82c3('0x66')](_0x53e377,_0x1b83ae[_0xa79212][_0x82c3('0x8c')]||_0x53e377);}if(_0x4a33ed[_0x82c3('0x77')]){_0x4a33ed[_0x82c3('0x77')]=JSON[_0x82c3('0x7d')](_0x4a33ed[_0x82c3('0x77')]);for(var _0x42b254=0x0;_0x42b254<_0x4a33ed[_0x82c3('0x77')]['length'];_0x42b254+=0x1){if(_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')]&&_['includes'](_0x5ea75d,_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')])&&_0x4a33ed['joins'][_0x42b254][_0x82c3('0x7b')]&&_0x4a33ed[_0x82c3('0x77')][_0x42b254]['foreignTable']&&_0x4a33ed['joins'][_0x42b254]['foreignKey']){_0x22a060[_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x2c')]](_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x79')],null,util[_0x82c3('0x72')](_0x82c3('0x7a'),_0x4a33ed[_0x82c3('0x6f')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x7b')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x79')],_0x4a33ed[_0x82c3('0x77')][_0x42b254][_0x82c3('0x78')]));}}}if(_0x4a33ed['conditions']){_0x4a33ed['conditions']=JSON['parse'](_0x4a33ed[_0x82c3('0x7c')]);_0x22a060[_0x82c3('0x39')](_0x103a2e(_0x4a33ed[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x4767ea=_0x22a060[_0x82c3('0x7e')]();_0x22a060[_0x82c3('0x1e')](_0x2458f1);_0x22a060['offset'](0x0);return;}})[_0x82c3('0x22')](function(){if(_0x412960[_0x82c3('0x8d')]==='web'){return null;}var _0x3099b7=_[_0x82c3('0x3c')](_0x412960,{'name':_0x412960[_0x82c3('0x8e')]||_0x412960[_0x82c3('0x27')]||_0x4a33ed[_0x82c3('0x27')],'basename':_0x11da75,'savename':util[_0x82c3('0x72')](_0x82c3('0x8f'),_0x412960[_0x82c3('0x27')]||_0x4a33ed['name'],require('randomstring')[_0x82c3('0x90')](0x4),_0x412960[_0x82c3('0x8d')]||_0x82c3('0x91')),'reportId':_0x4a33ed['id'],'reportType':_0x82c3('0x92')});return db[_0x82c3('0x93')][_0x82c3('0x4b')](_0x3099b7,{'raw':!![]});})[_0x82c3('0x22')](function(_0x45f76d){if(_0x4a33ed[_0x82c3('0x6f')]===_0x82c3('0x94')){_0x4767ea[_0x82c3('0x39')](_0x4a33ed[_0x82c3('0x6f')]+_0x82c3('0x95'),_0x412960['startDate'],_0x412960[_0x82c3('0x96')]);}else{_0x4767ea['where'](_0x4a33ed[_0x82c3('0x6f')]+_0x82c3('0x97'),_0x412960[_0x82c3('0x98')],_0x412960['endDate']);}if(_0x45f76d){logger[_0x82c3('0x99')]('Run\x20Query:',_0x4767ea['toString']());require(_0x82c3('0x9a'))[_0x82c3('0x9b')](path['join'](__dirname,_0x82c3('0x9c'),_0x45f76d[_0x82c3('0x8d')]),[_0x45f76d['id'],_0x4767ea[_0x82c3('0x81')](),path[_0x82c3('0x4f')](__dirname,_0x82c3('0x9d'),_0x45f76d[_0x82c3('0x9e')]),_0x11da75]);return _0x45f76d;}else{var _0x78c50e=squel[_0x82c3('0x6d')]();_0x78c50e[_0x82c3('0x6e')]('('+_0x4767ea[_0x82c3('0x81')]()+')',_0x82c3('0x9f'));_0x78c50e[_0x82c3('0x66')](_0x82c3('0xa0'),_0x82c3('0x1f'));_0x4767ea['limit'](_0x412960['limit']||_0x2458f1);_0x4767ea[_0x82c3('0x1c')](_0x412960[_0x82c3('0x1c')]||0x0);return dbH[_0x82c3('0x82')]['query'](_0x78c50e[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]})[_0x82c3('0x22')](function(_0x1d4710){if(!_0x1d4710[_0x82c3('0x43')]){_0x4ad8fa=0x0;}else{_0x4ad8fa=_0x1d4710[0x0][_0x82c3('0x1f')]||0x0;}return dbH['sequelize'][_0x82c3('0x2f')](_0x4767ea[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]});})[_0x82c3('0x22')](function(_0x2dac7d){return{'rows':_0x2dac7d||[],'count':_0x4ad8fa};});}});}exports[_0x82c3('0xa1')]=function(_0x444390,_0x1c877b){return runReport(_0x444390[_0x82c3('0x41')],_0x444390['query'],_0x444390['options'])[_0x82c3('0x22')](respondWithResult(_0x1c877b,null))[_0x82c3('0x45')](handleError(_0x1c877b,null));};exports[_0x82c3('0xa2')]=runReport;exports[_0x82c3('0x2f')]=function(_0x3f6f53,_0x7d4111){var _0x4cc07d=0xa;var _0x11fa8c=[_0x82c3('0x4f'),'left_join','right_join',_0x82c3('0x51')];var _0x137ee1={'SUM':_0x82c3('0x52'),'COUNT':_0x82c3('0x53'),'COUNT DISTINCT':_0x82c3('0x54'),'MAX':_0x82c3('0x55'),'MIN':_0x82c3('0x56'),'AVG':_0x82c3('0x57'),'GROUP_CONCAT':_0x82c3('0x58'),'GROUP_CONCAT ASC':_0x82c3('0x59'),'GROUP_CONCAT DESC':_0x82c3('0x86')};var _0x1b172a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x82c3('0x5b'),'HOUR':_0x82c3('0x5c'),'ROUND':_0x82c3('0x5d'),'UNIX_TIMESTAMP':_0x82c3('0x87')};var _0x540991=function(_0x3a5c45){return!_[_0x82c3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3a5c45);};var _0x51a02b=function(_0x4f8326){if(!_0x4f8326||!_0x4f8326[_0x82c3('0x63')][_0x82c3('0x43')]){return'';}for(var _0x11201f='(',_0x345fc7=0x0;_0x345fc7<_0x4f8326[_0x82c3('0x63')]['length'];_0x345fc7+=0x1){_0x345fc7>0x0&&(_0x11201f+='\x20'+_0x4f8326['operator']+'\x20');_0x11201f+=_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x65')]?_0x51a02b(_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x65')]):_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x66')]+'\x20'+_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x67')]+(_0x540991(_0x4f8326[_0x82c3('0x63')][_0x345fc7][_0x82c3('0x67')])?'\x20'+_0x4f8326['rules'][_0x345fc7][_0x82c3('0x88')]:'');}return _0x11201f+')';};var _0x11c749={'where':{'id':_0x3f6f53['params']['id']}},_0x27626b,_0x168c7a,_0x1a574d,_0x20a5ba,_0x36081b;_0x11c749=_['merge']({},_0x11c749,_0x3f6f53[_0x82c3('0x3d')]);return db['AnalyticCustomReport'][_0x82c3('0x44')](_0x11c749)[_0x82c3('0x22')](function(_0x30ab9e){if(_0x30ab9e){_0x27626b=_0x30ab9e;return _0x30ab9e[_0x82c3('0x68')]();}return null;})['then'](function(_0x133bc8){if(_0x133bc8){if(!_0x133bc8[_0x82c3('0x43')]){throw new db[(_0x82c3('0x69'))]['ValidationErrorItem'](_0x82c3('0x89'),0x193);}_0x168c7a=_0x133bc8;return db['AnalyticMetric'][_0x82c3('0x6b')]({'raw':!![]});}return null;})[_0x82c3('0x22')](function(_0x2648a5){if(_0x2648a5){_0x1a574d=_[_0x82c3('0x6c')](_0x2648a5,'id');var _0x2f52a0;var _0x26a832=squel[_0x82c3('0x6d')]();_0x26a832[_0x82c3('0x6e')](_0x27626b[_0x82c3('0x6f')]);for(var _0x184018=0x0;_0x184018<_0x168c7a['length'];_0x184018+=0x1){_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x70')]?_0x1a574d[_0x168c7a[_0x184018][_0x82c3('0x70')]]['metric']:_0x168c7a[_0x184018][_0x82c3('0x66')];_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x71')]?_[_0x82c3('0x73')](_0x137ee1[_0x168c7a[_0x184018][_0x82c3('0x71')]],'%s',_0x2f52a0):_0x2f52a0;_0x2f52a0=_0x168c7a[_0x184018][_0x82c3('0x72')]?_[_0x82c3('0x73')](_0x1b172a[_0x168c7a[_0x184018][_0x82c3('0x72')]],'%s',_0x2f52a0):_0x2f52a0;if(_0x168c7a[_0x184018]['groupBy']){_0x26a832['group'](_0x2f52a0);}_0x168c7a[_0x184018]['orderBy']&&_0x26a832['order'](_0x2f52a0,_0x168c7a[_0x184018][_0x82c3('0x75')]===_0x82c3('0x76')?![]:!![]);_0x26a832[_0x82c3('0x66')](_0x2f52a0,_0x168c7a[_0x184018]['alias']||_0x2f52a0);}if(_0x27626b[_0x82c3('0x77')]){_0x27626b[_0x82c3('0x77')]=JSON[_0x82c3('0x7d')](_0x27626b['joins']);for(var _0x5beec4=0x0;_0x5beec4<_0x27626b['joins']['length'];_0x5beec4+=0x1){if(_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')]&&_[_0x82c3('0x5e')](_0x11fa8c,_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')])&&_0x27626b[_0x82c3('0x77')][_0x5beec4]['parentKey']&&_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x79')]&&_0x27626b['joins'][_0x5beec4][_0x82c3('0x78')]){_0x26a832[_0x27626b[_0x82c3('0x77')][_0x5beec4][_0x82c3('0x2c')]](_0x27626b['joins'][_0x5beec4][_0x82c3('0x79')],null,util[_0x82c3('0x72')](_0x82c3('0x7a'),_0x27626b[_0x82c3('0x6f')],_0x27626b['joins'][_0x5beec4][_0x82c3('0x7b')],_0x27626b[_0x82c3('0x77')][_0x5beec4]['foreignTable'],_0x27626b[_0x82c3('0x77')][_0x5beec4]['foreignKey']));}}}if(_0x27626b['conditions']){_0x27626b['conditions']=JSON[_0x82c3('0x7d')](_0x27626b['conditions']);_0x26a832['where'](_0x51a02b(_0x27626b[_0x82c3('0x7c')][_0x82c3('0x65')]));}_0x36081b=_0x26a832['clone']();_0x26a832[_0x82c3('0x1e')](_0x4cc07d);_0x26a832[_0x82c3('0x1c')](0x0);logger[_0x82c3('0x7f')](_0x82c3('0x80'),_0x26a832[_0x82c3('0x81')]());return dbH['sequelize'][_0x82c3('0x2f')](_0x26a832[_0x82c3('0x81')](),{'type':dbH[_0x82c3('0x82')][_0x82c3('0x83')][_0x82c3('0x84')]});}})['then'](function(){return{'sql':_0x36081b['toString']()};})[_0x82c3('0x22')](respondWithResult(_0x7d4111,null))[_0x82c3('0x45')](handleError(_0x7d4111,null));};
\ No newline at end of file
+var _0xfdbf=['group','field','condition','value','getFields','Sequelize','AnalyticMetric','keyBy','select','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','alias','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','output','../../files/reports','savename','countTable','COUNT(*)','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator'];(function(_0x29e8c3,_0x41b386){var _0x5a7ee9=function(_0x108b00){while(--_0x108b00){_0x29e8c3['push'](_0x29e8c3['shift']());}};_0x5a7ee9(++_0x41b386);}(_0xfdbf,0xe1));var _0xffdb=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xfdbf[_0x480bc8];return _0x28c245;};'use strict';var emlformat=require(_0xffdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffdb('0x1'));var jsonpatch=require(_0xffdb('0x2'));var rp=require(_0xffdb('0x3'));var moment=require(_0xffdb('0x4'));var BPromise=require(_0xffdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xffdb('0x6'));var sox=require(_0xffdb('0x7'));var csv=require(_0xffdb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffdb('0x9'));var _=require(_0xffdb('0xa'));var squel=require(_0xffdb('0xb'));var crypto=require(_0xffdb('0xc'));var jsforce=require(_0xffdb('0xd'));var deskjs=require(_0xffdb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xffdb('0xf'));var Papa=require(_0xffdb('0x10'));var Redis=require(_0xffdb('0x11'));var authService=require(_0xffdb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xffdb('0x13'));var hardwareService=require(_0xffdb('0x14'));var logger=require(_0xffdb('0x15'))('api');var utils=require(_0xffdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xffdb('0x17'));var db=require(_0xffdb('0x18'))['db'];var dbH=require(_0xffdb('0x18'))[_0xffdb('0x19')];function respondWithStatusCode(_0x4ce2b2,_0x64dc27){_0x64dc27=_0x64dc27||0xcc;return function(_0x1b5607){if(_0x1b5607){return _0x4ce2b2['sendStatus'](_0x64dc27);}return _0x4ce2b2[_0xffdb('0x1a')](_0x64dc27)[_0xffdb('0x1b')]();};}function respondWithResult(_0x101f71,_0x2ff189){_0x2ff189=_0x2ff189||0xc8;return function(_0x10539c){if(_0x10539c){return _0x101f71[_0xffdb('0x1a')](_0x2ff189)['json'](_0x10539c);}};}function respondWithFilteredResult(_0x14d1a4,_0x40830b){return function(_0x1c2ec8){if(_0x1c2ec8){var _0x3bc9bf=typeof _0x40830b[_0xffdb('0x1c')]===_0xffdb('0x1d')&&typeof _0x40830b[_0xffdb('0x1e')]==='undefined';var _0x237986=_0x1c2ec8[_0xffdb('0x1f')];var _0x3cbad6=_0x3bc9bf?0x0:_0x40830b[_0xffdb('0x1c')];var _0x2e388e=_0x3bc9bf?_0x1c2ec8[_0xffdb('0x1f')]:_0x40830b[_0xffdb('0x1c')]+_0x40830b[_0xffdb('0x1e')];var _0x5478a7;if(_0x2e388e>=_0x237986){_0x2e388e=_0x237986;_0x5478a7=0xc8;}else{_0x5478a7=0xce;}_0x14d1a4['status'](_0x5478a7);return _0x14d1a4[_0xffdb('0x20')](_0xffdb('0x21'),_0x3cbad6+'-'+_0x2e388e+'/'+_0x237986)[_0xffdb('0x22')](_0x1c2ec8);}return null;};}function patchUpdates(_0x1be0de){return function(_0x401d62){try{jsonpatch['apply'](_0x401d62,_0x1be0de,!![]);}catch(_0x43382e){return BPromise['reject'](_0x43382e);}return _0x401d62[_0xffdb('0x23')]();};}function saveUpdates(_0xd3f171,_0x535bb1){return function(_0x478d30){if(_0x478d30){return _0x478d30[_0xffdb('0x24')](_0xd3f171)[_0xffdb('0x25')](function(_0x33fb22){return _0x33fb22;});}return null;};}function removeEntity(_0x2ada72,_0x44be87){return function(_0x487790){if(_0x487790){return _0x487790['destroy']()[_0xffdb('0x25')](function(){var _0x1aaa72=_0x487790[_0xffdb('0x26')]({'plain':!![]});var _0x25dd7c=_0xffdb('0x27');return db[_0xffdb('0x28')][_0xffdb('0x29')]({'where':{'type':_0x25dd7c,'resourceId':_0x1aaa72['id']}})[_0xffdb('0x25')](function(){return _0x487790;});})['then'](function(){_0x2ada72[_0xffdb('0x1a')](0xcc)[_0xffdb('0x1b')]();});}};}function handleEntityNotFound(_0x1d1ff7,_0x5bfe76){return function(_0x5f030e){if(!_0x5f030e){_0x1d1ff7[_0xffdb('0x2a')](0x194);}return _0x5f030e;};}function handleError(_0x423a47,_0x101ebf){_0x101ebf=_0x101ebf||0x1f4;return function(_0x4a45f1){logger[_0xffdb('0x2b')](_0x4a45f1[_0xffdb('0x2c')]);if(_0x4a45f1[_0xffdb('0x2d')]){delete _0x4a45f1[_0xffdb('0x2d')];}_0x423a47['status'](_0x101ebf)[_0xffdb('0x2e')](_0x4a45f1);};}exports['index']=function(_0x57610c,_0x2e5ea7){var _0xccd801={},_0x41a2c1={},_0x3c1f12={'count':0x0,'rows':[]};var _0x47cba5=_[_0xffdb('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5407d1){return{'name':_0x5407d1['fieldName'],'type':_0x5407d1[_0xffdb('0x30')]['key']};});_0x41a2c1[_0xffdb('0x31')]=_[_0xffdb('0x2f')](_0x47cba5,'name');_0x41a2c1[_0xffdb('0x32')]=_[_0xffdb('0x33')](_0x57610c['query']);_0x41a2c1[_0xffdb('0x34')]=_[_0xffdb('0x35')](_0x41a2c1[_0xffdb('0x31')],_0x41a2c1[_0xffdb('0x32')]);_0xccd801['attributes']=_['intersection'](_0x41a2c1[_0xffdb('0x31')],qs[_0xffdb('0x36')](_0x57610c['query'][_0xffdb('0x36')]));_0xccd801[_0xffdb('0x37')]=_0xccd801[_0xffdb('0x37')][_0xffdb('0x38')]?_0xccd801['attributes']:_0x41a2c1['model'];if(!_0x57610c[_0xffdb('0x32')][_0xffdb('0x39')](_0xffdb('0x3a'))){_0xccd801['limit']=qs[_0xffdb('0x1e')](_0x57610c['query']['limit']);_0xccd801['offset']=qs[_0xffdb('0x1c')](_0x57610c[_0xffdb('0x32')][_0xffdb('0x1c')]);}_0xccd801[_0xffdb('0x3b')]=qs[_0xffdb('0x3c')](_0x57610c[_0xffdb('0x32')][_0xffdb('0x3c')]);_0xccd801[_0xffdb('0x3d')]=qs[_0xffdb('0x34')](_[_0xffdb('0x3e')](_0x57610c['query'],_0x41a2c1['filters']),_0x47cba5);if(_0x57610c[_0xffdb('0x32')][_0xffdb('0x3f')]){_0xccd801[_0xffdb('0x3d')]=_[_0xffdb('0x40')](_0xccd801[_0xffdb('0x3d')],{'$or':_[_0xffdb('0x2f')](_0x47cba5,function(_0x3eb3c0){if(_0x3eb3c0[_0xffdb('0x30')]!=='VIRTUAL'){var _0x56c588={};_0x56c588[_0x3eb3c0['name']]={'$like':'%'+_0x57610c[_0xffdb('0x32')][_0xffdb('0x3f')]+'%'};return _0x56c588;}})});}_0xccd801=_[_0xffdb('0x40')]({},_0xccd801,_0x57610c[_0xffdb('0x41')]);var _0x2ec878={'where':_0xccd801[_0xffdb('0x3d')]};return db[_0xffdb('0x42')][_0xffdb('0x1f')](_0x2ec878)['then'](function(_0x3d1333){_0x3c1f12[_0xffdb('0x1f')]=_0x3d1333;if(_0x57610c[_0xffdb('0x32')][_0xffdb('0x43')]){_0xccd801[_0xffdb('0x44')]=[{'all':!![]}];}return db[_0xffdb('0x42')][_0xffdb('0x45')](_0xccd801);})[_0xffdb('0x25')](function(_0x568308){_0x3c1f12['rows']=_0x568308;return _0x3c1f12;})[_0xffdb('0x25')](respondWithFilteredResult(_0x2e5ea7,_0xccd801))[_0xffdb('0x46')](handleError(_0x2e5ea7,null));};exports[_0xffdb('0x47')]=function(_0x212264,_0x2c92cc){var _0x47dfd7={'raw':![],'where':{'id':_0x212264[_0xffdb('0x48')]['id']}},_0x64e9cb={};_0x64e9cb[_0xffdb('0x31')]=_[_0xffdb('0x33')](db['AnalyticCustomReport'][_0xffdb('0x49')]);_0x64e9cb['query']=_['keys'](_0x212264[_0xffdb('0x32')]);_0x64e9cb[_0xffdb('0x34')]=_[_0xffdb('0x35')](_0x64e9cb[_0xffdb('0x31')],_0x64e9cb[_0xffdb('0x32')]);_0x47dfd7[_0xffdb('0x37')]=_[_0xffdb('0x35')](_0x64e9cb[_0xffdb('0x31')],qs[_0xffdb('0x36')](_0x212264[_0xffdb('0x32')][_0xffdb('0x36')]));_0x47dfd7[_0xffdb('0x37')]=_0x47dfd7[_0xffdb('0x37')][_0xffdb('0x38')]?_0x47dfd7[_0xffdb('0x37')]:_0x64e9cb[_0xffdb('0x31')];if(_0x212264[_0xffdb('0x32')][_0xffdb('0x43')]){_0x47dfd7[_0xffdb('0x44')]=[{'all':!![]}];}_0x47dfd7=_[_0xffdb('0x40')]({},_0x47dfd7,_0x212264['options']);return db[_0xffdb('0x42')][_0xffdb('0x4a')](_0x47dfd7)['then'](handleEntityNotFound(_0x2c92cc,null))['then'](respondWithResult(_0x2c92cc,null))[_0xffdb('0x46')](handleError(_0x2c92cc,null));};exports[_0xffdb('0x4b')]=function(_0x4bae17,_0x18370f){return db[_0xffdb('0x42')][_0xffdb('0x4b')](_0x4bae17[_0xffdb('0x4c')],{})['then'](function(_0xdd8ddc){var _0x31df8f=_0x4bae17[_0xffdb('0x4d')][_0xffdb('0x26')]({'plain':!![]});if(!_0x31df8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31df8f[_0xffdb('0x4e')]===_0xffdb('0x4d')){var _0x1e34ac=_0xdd8ddc[_0xffdb('0x26')]({'plain':!![]});var _0x201993='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x201993,'userProfileId':_0x31df8f[_0xffdb('0x4f')]},'raw':!![]})[_0xffdb('0x25')](function(_0x33d382){if(_0x33d382&&_0x33d382[_0xffdb('0x50')]===0x0){return db[_0xffdb('0x28')]['create']({'name':_0x1e34ac['name'],'resourceId':_0x1e34ac['id'],'type':_0xffdb('0x27'),'sectionId':_0x33d382['id']},{})[_0xffdb('0x25')](function(){return _0xdd8ddc;});}else{return _0xdd8ddc;}})[_0xffdb('0x46')](function(_0x3aa232){logger[_0xffdb('0x2b')](_0xffdb('0x51'),_0x3aa232);throw _0x3aa232;});}return _0xdd8ddc;})[_0xffdb('0x25')](respondWithResult(_0x18370f,0xc9))[_0xffdb('0x46')](handleError(_0x18370f,null));};exports[_0xffdb('0x24')]=function(_0x113cbc,_0x24824d){if(_0x113cbc['body']['id']){delete _0x113cbc[_0xffdb('0x4c')]['id'];}return db[_0xffdb('0x42')][_0xffdb('0x4a')]({'where':{'id':_0x113cbc[_0xffdb('0x48')]['id']}})['then'](handleEntityNotFound(_0x24824d,null))[_0xffdb('0x25')](saveUpdates(_0x113cbc['body'],null))[_0xffdb('0x25')](respondWithResult(_0x24824d,null))[_0xffdb('0x46')](handleError(_0x24824d,null));};exports['destroy']=function(_0x16a214,_0x528b20){return db[_0xffdb('0x42')][_0xffdb('0x4a')]({'where':{'id':_0x16a214['params']['id']}})[_0xffdb('0x25')](handleEntityNotFound(_0x528b20,null))[_0xffdb('0x25')](removeEntity(_0x528b20,null))[_0xffdb('0x46')](handleError(_0x528b20,null));};exports[_0xffdb('0x52')]=function(_0xe5cd35,_0x53de75){var _0x59bcba=0xa;var _0x15de8b=[_0xffdb('0x53'),'left_join',_0xffdb('0x54'),_0xffdb('0x55')];var _0x13aa4f={'SUM':_0xffdb('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xffdb('0x57'),'MAX':_0xffdb('0x58'),'MIN':'MIN(%s)','AVG':_0xffdb('0x59'),'GROUP_CONCAT':_0xffdb('0x5a'),'GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1db3dd={'SEC_TO_TIME':_0xffdb('0x5c'),'DATE':_0xffdb('0x5d'),'HOUR':_0xffdb('0x5e'),'ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x145260=function(_0x9ee98c){return!_[_0xffdb('0x60')]([_0xffdb('0x61'),_0xffdb('0x62'),_0xffdb('0x63'),_0xffdb('0x64')],_0x9ee98c);};var _0x2d97a5=function(_0x5a55e4){if(!_0x5a55e4||!_0x5a55e4[_0xffdb('0x65')][_0xffdb('0x38')]){return'';}for(var _0x343266='(',_0x4f6144=0x0;_0x4f6144<_0x5a55e4[_0xffdb('0x65')]['length'];_0x4f6144+=0x1){_0x4f6144>0x0&&(_0x343266+='\x20'+_0x5a55e4[_0xffdb('0x66')]+'\x20');_0x343266+=_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x67')]?_0x2d97a5(_0x5a55e4['rules'][_0x4f6144]['group']):_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x68')]+'\x20'+_0x5a55e4['rules'][_0x4f6144][_0xffdb('0x69')]+(_0x145260(_0x5a55e4['rules'][_0x4f6144][_0xffdb('0x69')])?'\x20'+_0x5a55e4[_0xffdb('0x65')][_0x4f6144][_0xffdb('0x6a')]:'');}return _0x343266+')';};var _0x30f90e={'where':{'id':_0xe5cd35[_0xffdb('0x48')]['id']}},_0x25de9c,_0x33d01f,_0x51342a,_0x326d34,_0x29e444;_0x30f90e=_['merge']({},_0x30f90e,_0xe5cd35[_0xffdb('0x41')]);return db['AnalyticCustomReport'][_0xffdb('0x4a')](_0x30f90e)[_0xffdb('0x25')](function(_0xb61a87){if(_0xb61a87){_0x25de9c=_0xb61a87;return _0xb61a87[_0xffdb('0x6b')]();}return null;})[_0xffdb('0x25')](function(_0x2dc432){if(_0x2dc432){if(!_0x2dc432[_0xffdb('0x38')]){throw new db[(_0xffdb('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x33d01f=_0x2dc432;return db[_0xffdb('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x122918){if(_0x122918){_0x51342a=_[_0xffdb('0x6e')](_0x122918,'id');var _0x551d1e;var _0x56abb1=squel[_0xffdb('0x6f')]();_0x56abb1['from'](_0x25de9c['table']);for(var _0x276f28=0x0;_0x276f28<_0x33d01f[_0xffdb('0x38')];_0x276f28+=0x1){_0x551d1e=_0x33d01f[_0x276f28][_0xffdb('0x70')]?_0x51342a[_0x33d01f[_0x276f28][_0xffdb('0x70')]][_0xffdb('0x71')]:_0x33d01f[_0x276f28]['field'];_0x551d1e=_0x33d01f[_0x276f28]['function']?_[_0xffdb('0x72')](_0x13aa4f[_0x33d01f[_0x276f28][_0xffdb('0x73')]],'%s',_0x551d1e):_0x551d1e;_0x551d1e=_0x33d01f[_0x276f28]['format']?_[_0xffdb('0x72')](_0x1db3dd[_0x33d01f[_0x276f28][_0xffdb('0x74')]],'%s',_0x551d1e):_0x551d1e;if(_0x33d01f[_0x276f28][_0xffdb('0x75')]){_0x56abb1[_0xffdb('0x67')](_0x551d1e);}_0x33d01f[_0x276f28][_0xffdb('0x76')]&&_0x56abb1[_0xffdb('0x3b')](_0x551d1e,_0x33d01f[_0x276f28][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x56abb1['field'](_0x551d1e,_0x33d01f[_0x276f28]['alias']||_0x551d1e);}if(_0x25de9c[_0xffdb('0x78')]){_0x25de9c['joins']=JSON[_0xffdb('0x79')](_0x25de9c[_0xffdb('0x78')]);for(var _0x4ccc65=0x0;_0x4ccc65<_0x25de9c[_0xffdb('0x78')][_0xffdb('0x38')];_0x4ccc65+=0x1){if(_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x30')]&&_['includes'](_0x15de8b,_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x30')])&&_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7a')]&&_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x7b')]&&_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7c')]){_0x56abb1[_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x30')]](_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7b')],null,util[_0xffdb('0x74')](_0xffdb('0x7d'),_0x25de9c[_0xffdb('0x7e')],_0x25de9c[_0xffdb('0x78')][_0x4ccc65][_0xffdb('0x7a')],_0x25de9c[_0xffdb('0x78')][_0x4ccc65]['foreignTable'],_0x25de9c['joins'][_0x4ccc65][_0xffdb('0x7c')]));}}}if(_0x25de9c[_0xffdb('0x7f')]){_0x25de9c['conditions']=JSON[_0xffdb('0x79')](_0x25de9c[_0xffdb('0x7f')]);_0x56abb1['where'](_0x2d97a5(_0x25de9c[_0xffdb('0x7f')][_0xffdb('0x67')]));}_0x29e444=_0x56abb1['clone']();_0x56abb1[_0xffdb('0x1e')](_0x59bcba);_0x56abb1[_0xffdb('0x1c')](0x0);logger[_0xffdb('0x80')]('Limited\x20Query:',_0x56abb1[_0xffdb('0x81')]());return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x56abb1[_0xffdb('0x81')](),{'type':dbH['sequelize'][_0xffdb('0x83')][_0xffdb('0x84')]});}})[_0xffdb('0x25')](respondWithResult(_0x53de75,null))['catch'](handleError(_0x53de75,null));};function runReport(_0x4bc298,_0x266bac,_0x2efef4){var _0xdf130d=_0x266bac[_0xffdb('0x2d')];var _0x8b5959=0xa;var _0x32f907=[_0xffdb('0x53'),_0xffdb('0x85'),'right_join','cross_join'];var _0x4260b2={'SUM':_0xffdb('0x56'),'COUNT':_0xffdb('0x86'),'COUNT DISTINCT':_0xffdb('0x57'),'MAX':_0xffdb('0x58'),'MIN':_0xffdb('0x87'),'AVG':_0xffdb('0x59'),'GROUP_CONCAT':_0xffdb('0x5a'),'GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':_0xffdb('0x88')};var _0x16a64b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xffdb('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':_0xffdb('0x89')};var _0x4929ce=function(_0x3b0188){return!_[_0xffdb('0x60')]([_0xffdb('0x61'),_0xffdb('0x62'),_0xffdb('0x63'),_0xffdb('0x64')],_0x3b0188);};var _0x28cbbf=function(_0x31ce59){if(!_0x31ce59||!_0x31ce59[_0xffdb('0x65')][_0xffdb('0x38')]){return'';}for(var _0x32e3a8='(',_0x359fe3=0x0;_0x359fe3<_0x31ce59[_0xffdb('0x65')]['length'];_0x359fe3+=0x1){_0x359fe3>0x0&&(_0x32e3a8+='\x20'+_0x31ce59[_0xffdb('0x66')]+'\x20');_0x32e3a8+=_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x67')]?_0x28cbbf(_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x67')]):_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x68')]+'\x20'+_0x31ce59['rules'][_0x359fe3][_0xffdb('0x69')]+(_0x4929ce(_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x69')])?'\x20'+_0x31ce59[_0xffdb('0x65')][_0x359fe3][_0xffdb('0x6a')]:'');}return _0x32e3a8+')';};var _0x3b471a={'where':{'id':_0x4bc298['id']}},_0x2b985f,_0x2c5c18,_0x19cdb8,_0x1f85ca,_0x11a24b;_0x3b471a=_[_0xffdb('0x40')]({},_0x3b471a,_0x2efef4);return db[_0xffdb('0x42')][_0xffdb('0x4a')](_0x3b471a)[_0xffdb('0x25')](function(_0x4da720){if(_0x4da720){_0x2b985f=_0x4da720;return _0x4da720['getFields']();}return null;})[_0xffdb('0x25')](function(_0x2498d9){if(_0x2498d9){if(!_0x2498d9[_0xffdb('0x38')]){throw new db[(_0xffdb('0x6c'))][(_0xffdb('0x8a'))](_0xffdb('0x8b'),0x193);}_0x2c5c18=_0x2498d9;return db[_0xffdb('0x6d')][_0xffdb('0x45')]({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x1da0b7){if(_0x1da0b7){_0x19cdb8=_[_0xffdb('0x6e')](_0x1da0b7,'id');var _0x583fb1;var _0x431391=squel[_0xffdb('0x6f')]();_0x431391[_0xffdb('0x8c')](_0x2b985f['table']);for(var _0x26db5a=0x0;_0x26db5a<_0x2c5c18[_0xffdb('0x38')];_0x26db5a+=0x1){_0x583fb1=_0x2c5c18[_0x26db5a]['MetricId']?_0x19cdb8[_0x2c5c18[_0x26db5a][_0xffdb('0x70')]]['metric']:_0x2c5c18[_0x26db5a]['field'];_0x583fb1=_0x2c5c18[_0x26db5a][_0xffdb('0x73')]?_[_0xffdb('0x72')](_0x4260b2[_0x2c5c18[_0x26db5a][_0xffdb('0x73')]],'%s',_0x583fb1):_0x583fb1;_0x583fb1=_0x2c5c18[_0x26db5a][_0xffdb('0x74')]?_['replace'](_0x16a64b[_0x2c5c18[_0x26db5a][_0xffdb('0x74')]],'%s',_0x583fb1):_0x583fb1;if(_0x2c5c18[_0x26db5a][_0xffdb('0x75')]){_0x431391[_0xffdb('0x67')](_0x583fb1);}_0x2c5c18[_0x26db5a][_0xffdb('0x76')]&&_0x431391['order'](_0x583fb1,_0x2c5c18[_0x26db5a][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x431391['field'](_0x583fb1,_0x2c5c18[_0x26db5a][_0xffdb('0x8d')]||_0x583fb1);}if(_0x2b985f['joins']){_0x2b985f[_0xffdb('0x78')]=JSON[_0xffdb('0x79')](_0x2b985f[_0xffdb('0x78')]);for(var _0x431527=0x0;_0x431527<_0x2b985f[_0xffdb('0x78')][_0xffdb('0x38')];_0x431527+=0x1){if(_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')]&&_['includes'](_0x32f907,_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')])&&_0x2b985f['joins'][_0x431527]['parentKey']&&_0x2b985f[_0xffdb('0x78')][_0x431527]['foreignTable']&&_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7c')]){_0x431391[_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x30')]](_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7b')],null,util['format'](_0xffdb('0x7d'),_0x2b985f[_0xffdb('0x7e')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7a')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7b')],_0x2b985f[_0xffdb('0x78')][_0x431527][_0xffdb('0x7c')]));}}}if(_0x2b985f[_0xffdb('0x7f')]){_0x2b985f[_0xffdb('0x7f')]=JSON[_0xffdb('0x79')](_0x2b985f[_0xffdb('0x7f')]);_0x431391['where'](_0x28cbbf(_0x2b985f['conditions'][_0xffdb('0x67')]));}_0x11a24b=_0x431391['clone']();_0x431391['limit'](_0x8b5959);_0x431391[_0xffdb('0x1c')](0x0);return;}})[_0xffdb('0x25')](function(){if(_0x266bac['output']===_0xffdb('0x8e')){return null;}var _0xd27cdd=_['merge'](_0x266bac,{'name':_0x266bac[_0xffdb('0x8f')]||_0x266bac['name']||_0x2b985f['name'],'basename':_0xdf130d,'savename':util[_0xffdb('0x74')](_0xffdb('0x90'),_0x266bac[_0xffdb('0x2d')]||_0x2b985f[_0xffdb('0x2d')],require(_0xffdb('0x91'))[_0xffdb('0x92')](0x4),_0x266bac['output']||_0xffdb('0x93')),'reportId':_0x2b985f['id'],'reportType':_0xffdb('0x94')});return db[_0xffdb('0x95')][_0xffdb('0x4b')](_0xd27cdd,{'raw':!![]});})[_0xffdb('0x25')](function(_0x37d720){if(_0x2b985f[_0xffdb('0x7e')]===_0xffdb('0x96')){_0x11a24b[_0xffdb('0x3d')](_0x2b985f['table']+_0xffdb('0x97'),_0x266bac[_0xffdb('0x98')],_0x266bac[_0xffdb('0x99')]);}else{_0x11a24b['where'](_0x2b985f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x266bac[_0xffdb('0x98')],_0x266bac[_0xffdb('0x99')]);}if(_0x37d720){logger[_0xffdb('0x9a')](_0xffdb('0x9b'),_0x11a24b[_0xffdb('0x81')]());require(_0xffdb('0x9c'))[_0xffdb('0x9d')](path[_0xffdb('0x53')](__dirname,'../../components/export/',_0x37d720[_0xffdb('0x9e')]),[_0x37d720['id'],_0x11a24b[_0xffdb('0x81')](),path['join'](__dirname,_0xffdb('0x9f'),_0x37d720[_0xffdb('0xa0')]),_0xdf130d]);return _0x37d720;}else{var _0x49b9bd=squel[_0xffdb('0x6f')]();_0x49b9bd['from']('('+_0x11a24b[_0xffdb('0x81')]()+')',_0xffdb('0xa1'));_0x49b9bd[_0xffdb('0x68')](_0xffdb('0xa2'),_0xffdb('0x1f'));_0x11a24b[_0xffdb('0x1e')](_0x266bac[_0xffdb('0x1e')]||_0x8b5959);_0x11a24b[_0xffdb('0x1c')](_0x266bac[_0xffdb('0x1c')]||0x0);return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x49b9bd['toString'](),{'type':dbH[_0xffdb('0x82')]['QueryTypes'][_0xffdb('0x84')]})[_0xffdb('0x25')](function(_0x4608bd){if(!_0x4608bd[_0xffdb('0x38')]){_0x1f85ca=0x0;}else{_0x1f85ca=_0x4608bd[0x0]['count']||0x0;}return dbH[_0xffdb('0x82')][_0xffdb('0x32')](_0x11a24b[_0xffdb('0x81')](),{'type':dbH[_0xffdb('0x82')]['QueryTypes'][_0xffdb('0x84')]});})['then'](function(_0x3a156a){return{'rows':_0x3a156a||[],'count':_0x1f85ca};});}});}exports['run']=function(_0x2b0620,_0x3bc640){return runReport(_0x2b0620[_0xffdb('0x48')],_0x2b0620[_0xffdb('0x32')],_0x2b0620['options'])['then'](respondWithResult(_0x3bc640,null))[_0xffdb('0x46')](handleError(_0x3bc640,null));};exports['runReport']=runReport;exports[_0xffdb('0x32')]=function(_0x2664c1,_0x52439e){var _0x494782=0xa;var _0x1e4d1c=['join',_0xffdb('0x85'),_0xffdb('0x54'),_0xffdb('0x55')];var _0x266a7a={'SUM':_0xffdb('0x56'),'COUNT':_0xffdb('0x86'),'COUNT DISTINCT':_0xffdb('0x57'),'MAX':'MAX(%s)','MIN':_0xffdb('0x87'),'AVG':_0xffdb('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xffdb('0x5b'),'GROUP_CONCAT DESC':_0xffdb('0x88')};var _0x396e1f={'SEC_TO_TIME':_0xffdb('0x5c'),'DATE':_0xffdb('0x5d'),'HOUR':_0xffdb('0x5e'),'ROUND':_0xffdb('0x5f'),'UNIX_TIMESTAMP':_0xffdb('0x89')};var _0x2c6c78=function(_0x2dd600){return!_[_0xffdb('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xffdb('0x63'),'IS\x20NOT\x20EMPTY'],_0x2dd600);};var _0x5b88be=function(_0x463614){if(!_0x463614||!_0x463614['rules'][_0xffdb('0x38')]){return'';}for(var _0x441f75='(',_0x1479a0=0x0;_0x1479a0<_0x463614[_0xffdb('0x65')][_0xffdb('0x38')];_0x1479a0+=0x1){_0x1479a0>0x0&&(_0x441f75+='\x20'+_0x463614[_0xffdb('0x66')]+'\x20');_0x441f75+=_0x463614[_0xffdb('0x65')][_0x1479a0][_0xffdb('0x67')]?_0x5b88be(_0x463614[_0xffdb('0x65')][_0x1479a0][_0xffdb('0x67')]):_0x463614['rules'][_0x1479a0][_0xffdb('0x68')]+'\x20'+_0x463614['rules'][_0x1479a0]['condition']+(_0x2c6c78(_0x463614['rules'][_0x1479a0]['condition'])?'\x20'+_0x463614[_0xffdb('0x65')][_0x1479a0]['value']:'');}return _0x441f75+')';};var _0xd2c540={'where':{'id':_0x2664c1[_0xffdb('0x48')]['id']}},_0xad0113,_0x46ef35,_0x5d4390,_0x2c327e,_0x4cb1b4;_0xd2c540=_['merge']({},_0xd2c540,_0x2664c1[_0xffdb('0x41')]);return db['AnalyticCustomReport'][_0xffdb('0x4a')](_0xd2c540)['then'](function(_0x421c71){if(_0x421c71){_0xad0113=_0x421c71;return _0x421c71[_0xffdb('0x6b')]();}return null;})[_0xffdb('0x25')](function(_0xa0483c){if(_0xa0483c){if(!_0xa0483c['length']){throw new db[(_0xffdb('0x6c'))][(_0xffdb('0x8a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x46ef35=_0xa0483c;return db[_0xffdb('0x6d')][_0xffdb('0x45')]({'raw':!![]});}return null;})[_0xffdb('0x25')](function(_0x32a75b){if(_0x32a75b){_0x5d4390=_['keyBy'](_0x32a75b,'id');var _0x262e7e;var _0x54f32f=squel[_0xffdb('0x6f')]();_0x54f32f['from'](_0xad0113[_0xffdb('0x7e')]);for(var _0x127de5=0x0;_0x127de5<_0x46ef35[_0xffdb('0x38')];_0x127de5+=0x1){_0x262e7e=_0x46ef35[_0x127de5]['MetricId']?_0x5d4390[_0x46ef35[_0x127de5][_0xffdb('0x70')]][_0xffdb('0x71')]:_0x46ef35[_0x127de5]['field'];_0x262e7e=_0x46ef35[_0x127de5]['function']?_['replace'](_0x266a7a[_0x46ef35[_0x127de5]['function']],'%s',_0x262e7e):_0x262e7e;_0x262e7e=_0x46ef35[_0x127de5][_0xffdb('0x74')]?_[_0xffdb('0x72')](_0x396e1f[_0x46ef35[_0x127de5][_0xffdb('0x74')]],'%s',_0x262e7e):_0x262e7e;if(_0x46ef35[_0x127de5]['groupBy']){_0x54f32f['group'](_0x262e7e);}_0x46ef35[_0x127de5][_0xffdb('0x76')]&&_0x54f32f[_0xffdb('0x3b')](_0x262e7e,_0x46ef35[_0x127de5][_0xffdb('0x76')]===_0xffdb('0x77')?![]:!![]);_0x54f32f[_0xffdb('0x68')](_0x262e7e,_0x46ef35[_0x127de5][_0xffdb('0x8d')]||_0x262e7e);}if(_0xad0113[_0xffdb('0x78')]){_0xad0113[_0xffdb('0x78')]=JSON[_0xffdb('0x79')](_0xad0113[_0xffdb('0x78')]);for(var _0x2db6b6=0x0;_0x2db6b6<_0xad0113[_0xffdb('0x78')][_0xffdb('0x38')];_0x2db6b6+=0x1){if(_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x30')]&&_[_0xffdb('0x60')](_0x1e4d1c,_0xad0113['joins'][_0x2db6b6]['type'])&&_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7a')]&&_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x7b')]&&_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7c')]){_0x54f32f[_0xad0113[_0xffdb('0x78')][_0x2db6b6][_0xffdb('0x30')]](_0xad0113['joins'][_0x2db6b6]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0xad0113[_0xffdb('0x7e')],_0xad0113[_0xffdb('0x78')][_0x2db6b6]['parentKey'],_0xad0113[_0xffdb('0x78')][_0x2db6b6]['foreignTable'],_0xad0113['joins'][_0x2db6b6][_0xffdb('0x7c')]));}}}if(_0xad0113[_0xffdb('0x7f')]){_0xad0113[_0xffdb('0x7f')]=JSON[_0xffdb('0x79')](_0xad0113[_0xffdb('0x7f')]);_0x54f32f[_0xffdb('0x3d')](_0x5b88be(_0xad0113['conditions'][_0xffdb('0x67')]));}_0x4cb1b4=_0x54f32f[_0xffdb('0xa3')]();_0x54f32f[_0xffdb('0x1e')](_0x494782);_0x54f32f[_0xffdb('0x1c')](0x0);logger[_0xffdb('0x80')]('Limited\x20Query:',_0x54f32f[_0xffdb('0x81')]());return dbH['sequelize'][_0xffdb('0x32')](_0x54f32f[_0xffdb('0x81')](),{'type':dbH[_0xffdb('0x82')][_0xffdb('0x83')]['SELECT']});}})['then'](function(){return{'sql':_0x4cb1b4['toString']()};})['then'](respondWithResult(_0x52439e,null))[_0xffdb('0x46')](handleError(_0x52439e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9274514..9226713 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 _0x506f=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport'];(function(_0x673239,_0x31f6ef){var _0x555941=function(_0x55eca9){while(--_0x55eca9){_0x673239['push'](_0x673239['shift']());}};_0x555941(++_0x31f6ef);}(_0x506f,0x145));var _0xf506=function(_0x1290c5,_0x39106e){_0x1290c5=_0x1290c5-0x0;var _0x74284c=_0x506f[_0x1290c5];return _0x74284c;};'use strict';var _=require(_0xf506('0x0'));var util=require(_0xf506('0x1'));var logger=require('../../config/logger')(_0xf506('0x2'));var moment=require(_0xf506('0x3'));var BPromise=require(_0xf506('0x4'));var rp=require(_0xf506('0x5'));var fs=require('fs');var path=require(_0xf506('0x6'));var rimraf=require(_0xf506('0x7'));var config=require(_0xf506('0x8'));var attributes=require(_0xf506('0x9'));module['exports']=function(_0x395c17,_0x318a70){return _0x395c17['define'](_0xf506('0xa'),attributes,{'tableName':_0xf506('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b72=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x5d1134,_0x28ef08){var _0x20e1b4=function(_0xade472){while(--_0xade472){_0x5d1134['push'](_0x5d1134['shift']());}};_0x20e1b4(++_0x28ef08);}(_0x6b72,0xbd));var _0x26b7=function(_0x4f8938,_0x50bcff){_0x4f8938=_0x4f8938-0x0;var _0xdc2e3f=_0x6b72[_0x4f8938];return _0xdc2e3f;};'use strict';var _=require(_0x26b7('0x0'));var util=require(_0x26b7('0x1'));var logger=require(_0x26b7('0x2'))('api');var moment=require(_0x26b7('0x3'));var BPromise=require(_0x26b7('0x4'));var rp=require(_0x26b7('0x5'));var fs=require('fs');var path=require(_0x26b7('0x6'));var rimraf=require(_0x26b7('0x7'));var config=require(_0x26b7('0x8'));var attributes=require(_0x26b7('0x9'));module['exports']=function(_0x2aa80e,_0x55e5a0){return _0x2aa80e['define'](_0x26b7('0xa'),attributes,{'tableName':_0x26b7('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 70a05c9..60b80c2 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 _0xea52=['info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xea52,0x7d));var _0x2ea5=function(_0x2700d5,_0x1b113b){_0x2700d5=_0x2700d5-0x0;var _0xdc3338=_0xea52[_0x2700d5];return _0xdc3338;};'use strict';var _=require(_0x2ea5('0x0'));var util=require('util');var moment=require(_0x2ea5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ea5('0x2'));var db=require(_0x2ea5('0x3'))['db'];var utils=require(_0x2ea5('0x4'));var logger=require(_0x2ea5('0x5'))(_0x2ea5('0x6'));var config=require(_0x2ea5('0x7'));var jayson=require(_0x2ea5('0x8'));var client=jayson[_0x2ea5('0x9')][_0x2ea5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55aaf4,_0x1916b0,_0x282059){return new BPromise(function(_0x8eb0f5,_0x10f2b8){return client[_0x2ea5('0xb')](_0x55aaf4,_0x282059)[_0x2ea5('0xc')](function(_0x4f23e8){logger[_0x2ea5('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1916b0,_0x2ea5('0xe'));logger[_0x2ea5('0xf')](_0x2ea5('0x10'),_0x1916b0,_0x2ea5('0xe'),JSON[_0x2ea5('0x11')](_0x4f23e8));if(_0x4f23e8[_0x2ea5('0x12')]){if(_0x4f23e8[_0x2ea5('0x12')]['code']===0x1f4){logger[_0x2ea5('0x12')](_0x2ea5('0x13'),_0x1916b0,_0x4f23e8[_0x2ea5('0x12')][_0x2ea5('0x14')]);return _0x10f2b8(_0x4f23e8[_0x2ea5('0x12')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1916b0,_0x4f23e8[_0x2ea5('0x12')]['message']);return _0x8eb0f5(_0x4f23e8[_0x2ea5('0x12')]['message']);}else{logger[_0x2ea5('0xd')](_0x2ea5('0x13'),_0x1916b0,'request\x20sent');_0x8eb0f5(_0x4f23e8[_0x2ea5('0x15')]['message']);}})[_0x2ea5('0x16')](function(_0x3e1b96){logger[_0x2ea5('0x12')](_0x2ea5('0x13'),_0x1916b0,_0x3e1b96);_0x10f2b8(_0x3e1b96);});});}
\ No newline at end of file
+var _0x97a5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x436179,_0x3a9480){var _0x4b7f84=function(_0x556ae0){while(--_0x556ae0){_0x436179['push'](_0x436179['shift']());}};_0x4b7f84(++_0x3a9480);}(_0x97a5,0x157));var _0x597a=function(_0x3cf23e,_0x39dfbe){_0x3cf23e=_0x3cf23e-0x0;var _0x1a20e6=_0x97a5[_0x3cf23e];return _0x1a20e6;};'use strict';var _=require(_0x597a('0x0'));var util=require(_0x597a('0x1'));var moment=require(_0x597a('0x2'));var BPromise=require(_0x597a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597a('0x4'));var db=require(_0x597a('0x5'))['db'];var utils=require(_0x597a('0x6'));var logger=require(_0x597a('0x7'))(_0x597a('0x8'));var config=require(_0x597a('0x9'));var jayson=require(_0x597a('0xa'));var client=jayson[_0x597a('0xb')][_0x597a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28989b,_0x4ad340,_0x24fc88){return new BPromise(function(_0xa34d11,_0x267b56){return client[_0x597a('0xd')](_0x28989b,_0x24fc88)[_0x597a('0xe')](function(_0xc1993e){logger[_0x597a('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0x597a('0x10'));logger[_0x597a('0x11')](_0x597a('0x12'),_0x4ad340,_0x597a('0x10'),JSON['stringify'](_0xc1993e));if(_0xc1993e['error']){if(_0xc1993e[_0x597a('0x13')][_0x597a('0x14')]===0x1f4){logger[_0x597a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0xc1993e[_0x597a('0x13')]['message']);return _0x267b56(_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);}logger[_0x597a('0x13')](_0x597a('0x16'),_0x4ad340,_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);return _0xa34d11(_0xc1993e[_0x597a('0x13')][_0x597a('0x15')]);}else{logger[_0x597a('0xf')](_0x597a('0x16'),_0x4ad340,_0x597a('0x10'));_0xa34d11(_0xc1993e[_0x597a('0x17')][_0x597a('0x15')]);}})[_0x597a('0x18')](function(_0x50c209){logger[_0x597a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ad340,_0x50c209);_0x267b56(_0x50c209);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 0a3887c..4517f6b 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 _0x2dd4=['/:id/run','/:id/query','put','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview'];(function(_0x5ad67c,_0x144860){var _0xccce2e=function(_0x2dd95c){while(--_0x2dd95c){_0x5ad67c['push'](_0x5ad67c['shift']());}};_0xccce2e(++_0x144860);}(_0x2dd4,0x101));var _0x42dd=function(_0x16a059,_0x46bc2b){_0x16a059=_0x16a059-0x0;var _0x57f7a6=_0x2dd4[_0x16a059];return _0x57f7a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x42dd('0x0'));var timeout=require('connect-timeout');var express=require(_0x42dd('0x1'));var router=express[_0x42dd('0x2')]();var fs_extra=require(_0x42dd('0x3'));var auth=require(_0x42dd('0x4'));var interaction=require(_0x42dd('0x5'));var config=require(_0x42dd('0x6'));var controller=require(_0x42dd('0x7'));router[_0x42dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x42dd('0x8')](_0x42dd('0x9'),auth[_0x42dd('0xa')](),controller[_0x42dd('0xb')]);router[_0x42dd('0x8')](_0x42dd('0xc'),auth[_0x42dd('0xa')](),controller['preview']);router['get'](_0x42dd('0xd'),auth[_0x42dd('0xa')](),controller['run']);router[_0x42dd('0x8')](_0x42dd('0xe'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x42dd('0xa')](),controller['create']);router[_0x42dd('0xf')](_0x42dd('0x9'),auth[_0x42dd('0xa')](),controller[_0x42dd('0x10')]);router['delete']('/:id',auth[_0x42dd('0xa')](),controller[_0x42dd('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xf30f=['show','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x2251c9,_0x2a2091){var _0x56d17b=function(_0x3fd083){while(--_0x3fd083){_0x2251c9['push'](_0x2251c9['shift']());}};_0x56d17b(++_0x2a2091);}(_0xf30f,0x19c));var _0xff30=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xf30f[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xff30('0x0'));var util=require(_0xff30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xff30('0x2'));var router=express[_0xff30('0x3')]();var fs_extra=require(_0xff30('0x4'));var auth=require(_0xff30('0x5'));var interaction=require(_0xff30('0x6'));var config=require(_0xff30('0x7'));var controller=require(_0xff30('0x8'));router[_0xff30('0x9')]('/',auth[_0xff30('0xa')](),controller[_0xff30('0xb')]);router['get'](_0xff30('0xc'),auth['isAuthenticated'](),controller[_0xff30('0xd')]);router[_0xff30('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xff30('0xe')]);router[_0xff30('0x9')](_0xff30('0xf'),auth[_0xff30('0xa')](),controller[_0xff30('0x10')]);router[_0xff30('0x9')](_0xff30('0x11'),auth[_0xff30('0xa')](),controller[_0xff30('0x12')]);router[_0xff30('0x13')]('/',auth['isAuthenticated'](),controller[_0xff30('0x14')]);router['put'](_0xff30('0xc'),auth[_0xff30('0xa')](),controller[_0xff30('0x15')]);router[_0xff30('0x16')](_0xff30('0xc'),auth[_0xff30('0xa')](),controller[_0xff30('0x17')]);module[_0xff30('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 0f81f61..7ff3029 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0xf44777,_0x419161){var _0x4a38cc=function(_0x190381){while(--_0x190381){_0xf44777['push'](_0xf44777['shift']());}};_0x4a38cc(++_0x419161);}(_0xac9d,0x14d));var _0xdac9=function(_0x3c2863,_0x1b2cee){_0x3c2863=_0x3c2863-0x0;var _0x2c3d27=_0xac9d[_0x3c2863];return _0x2c3d27;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x1532ae,_0xa14bcc){var _0x5c09d1=function(_0x35167a){while(--_0x35167a){_0x1532ae['push'](_0x1532ae['shift']());}};_0x5c09d1(++_0xa14bcc);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x35832e,_0x4a20fe){_0x35832e=_0x35832e-0x0;var _0xa1308d=_0x3eea[_0x35832e];return _0xa1308d;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5af249b..531bb7e 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d38,0x1ef));var _0x86d3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6d38[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
+var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\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\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x200830,_0x36e4e1){var _0xd91b01=function(_0x16ff4a){while(--_0x16ff4a){_0x200830['push'](_0x200830['shift']());}};_0xd91b01(++_0x36e4e1);}(_0x187d,0x93));var _0xd187=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x187d[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a204647..a75f64d 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 _0xb449=['bluebird','request-promise','path','rimraf','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x42c8ec,_0x5e9d39){var _0x2c3932=function(_0x29b1a9){while(--_0x29b1a9){_0x42c8ec['push'](_0x42c8ec['shift']());}};_0x2c3932(++_0x5e9d39);}(_0xb449,0x8b));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require(_0x9b44('0x2'))(_0x9b44('0x3'));var moment=require('moment');var BPromise=require(_0x9b44('0x4'));var rp=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x9b44('0x8')]=function(_0x15cce5,_0x359d9c){return _0x15cce5[_0x9b44('0x9')](_0x9b44('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xced9=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0xb25d31,_0x53c622){var _0x5f070f=function(_0xcecf4){while(--_0xcecf4){_0xb25d31['push'](_0xb25d31['shift']());}};_0x5f070f(++_0x53c622);}(_0xced9,0x11b));var _0x9ced=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xced9[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x9ced('0x0'));var util=require(_0x9ced('0x1'));var logger=require(_0x9ced('0x2'))(_0x9ced('0x3'));var moment=require(_0x9ced('0x4'));var BPromise=require(_0x9ced('0x5'));var rp=require(_0x9ced('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ced('0x7'));var config=require(_0x9ced('0x8'));var attributes=require(_0x9ced('0x9'));module[_0x9ced('0xa')]=function(_0x3414f4,_0x6775ce){return _0x3414f4[_0x9ced('0xb')](_0x9ced('0xc'),attributes,{'tableName':_0x9ced('0xd'),'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 22b57b5..ce3ed4e 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 _0xdf73=['../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a0354,_0x49dcee){var _0x20daba=function(_0x598154){while(--_0x598154){_0x5a0354['push'](_0x5a0354['shift']());}};_0x20daba(++_0x49dcee);}(_0xdf73,0x10b));var _0x3df7=function(_0x3f35a2,_0x3cc674){_0x3f35a2=_0x3f35a2-0x0;var _0x580e49=_0xdf73[_0x3f35a2];return _0x580e49;};'use strict';var _=require(_0x3df7('0x0'));var util=require(_0x3df7('0x1'));var moment=require(_0x3df7('0x2'));var BPromise=require('bluebird');var rs=require(_0x3df7('0x3'));var fs=require('fs');var Redis=require(_0x3df7('0x4'));var db=require(_0x3df7('0x5'))['db'];var utils=require(_0x3df7('0x6'));var logger=require(_0x3df7('0x7'))(_0x3df7('0x8'));var config=require(_0x3df7('0x9'));var jayson=require(_0x3df7('0xa'));var client=jayson['client'][_0x3df7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42cd76,_0x56cff0,_0x227d2a){return new BPromise(function(_0x217601,_0x3f691b){return client[_0x3df7('0xc')](_0x42cd76,_0x227d2a)[_0x3df7('0xd')](function(_0x4188de){logger[_0x3df7('0xe')](_0x3df7('0xf'),_0x56cff0,_0x3df7('0x10'));logger['debug'](_0x3df7('0x11'),_0x56cff0,_0x3df7('0x10'),JSON[_0x3df7('0x12')](_0x4188de));if(_0x4188de[_0x3df7('0x13')]){if(_0x4188de[_0x3df7('0x13')][_0x3df7('0x14')]===0x1f4){logger[_0x3df7('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56cff0,_0x4188de[_0x3df7('0x13')][_0x3df7('0x15')]);return _0x3f691b(_0x4188de['error'][_0x3df7('0x15')]);}logger[_0x3df7('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56cff0,_0x4188de['error']['message']);return _0x217601(_0x4188de[_0x3df7('0x13')][_0x3df7('0x15')]);}else{logger[_0x3df7('0xe')](_0x3df7('0xf'),_0x56cff0,_0x3df7('0x10'));_0x217601(_0x4188de['result'][_0x3df7('0x15')]);}})[_0x3df7('0x16')](function(_0x38ecb9){logger[_0x3df7('0x13')](_0x3df7('0xf'),_0x56cff0,_0x38ecb9);_0x3f691b(_0x38ecb9);});});}
\ No newline at end of file
+var _0xd779=['result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x574a32,_0x4b9abf){var _0x3c1730=function(_0x112aa4){while(--_0x112aa4){_0x574a32['push'](_0x574a32['shift']());}};_0x3c1730(++_0x4b9abf);}(_0xd779,0x106));var _0x9d77=function(_0xd19088,_0x419744){_0xd19088=_0xd19088-0x0;var _0x3b42e5=_0xd779[_0xd19088];return _0x3b42e5;};'use strict';var _=require(_0x9d77('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9d77('0x1'));var rs=require(_0x9d77('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d77('0x3'))['db'];var utils=require(_0x9d77('0x4'));var logger=require(_0x9d77('0x5'))(_0x9d77('0x6'));var config=require(_0x9d77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d77('0x8')][_0x9d77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3352,_0x105367,_0x57f9cb){return new BPromise(function(_0x524e2e,_0xb16b42){return client['request'](_0x9b3352,_0x57f9cb)['then'](function(_0x2435ab){logger[_0x9d77('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x105367,_0x9d77('0xb'));logger[_0x9d77('0xc')](_0x9d77('0xd'),_0x105367,_0x9d77('0xb'),JSON['stringify'](_0x2435ab));if(_0x2435ab[_0x9d77('0xe')]){if(_0x2435ab[_0x9d77('0xe')][_0x9d77('0xf')]===0x1f4){logger[_0x9d77('0xe')](_0x9d77('0x10'),_0x105367,_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);return _0xb16b42(_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);}logger[_0x9d77('0xe')](_0x9d77('0x10'),_0x105367,_0x2435ab['error'][_0x9d77('0x11')]);return _0x524e2e(_0x2435ab[_0x9d77('0xe')][_0x9d77('0x11')]);}else{logger[_0x9d77('0xa')](_0x9d77('0x10'),_0x105367,_0x9d77('0xb'));_0x524e2e(_0x2435ab[_0x9d77('0x12')][_0x9d77('0x11')]);}})[_0x9d77('0x13')](function(_0x1db7a2){logger['error'](_0x9d77('0x10'),_0x105367,_0x1db7a2);_0xb16b42(_0x1db7a2);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 0888808..1049693 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 _0x6659=['preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview'];(function(_0x338ed6,_0xf71072){var _0x297378=function(_0xc9dc4e){while(--_0xc9dc4e){_0x338ed6['push'](_0x338ed6['shift']());}};_0x297378(++_0xf71072);}(_0x6659,0x171));var _0x9665=function(_0x414751,_0x2c1fcc){_0x414751=_0x414751-0x0;var _0x28db10=_0x6659[_0x414751];return _0x28db10;};'use strict';var multer=require('multer');var util=require(_0x9665('0x0'));var path=require(_0x9665('0x1'));var timeout=require(_0x9665('0x2'));var express=require(_0x9665('0x3'));var router=express['Router']();var fs_extra=require(_0x9665('0x4'));var auth=require(_0x9665('0x5'));var interaction=require(_0x9665('0x6'));var config=require(_0x9665('0x7'));var controller=require(_0x9665('0x8'));router[_0x9665('0x9')]('/',auth['isAuthenticated'](),controller[_0x9665('0xa')]);router['get'](_0x9665('0xb'),auth[_0x9665('0xc')](),controller[_0x9665('0xd')]);router[_0x9665('0x9')](_0x9665('0xe'),auth[_0x9665('0xc')](),controller[_0x9665('0xf')]);router['get'](_0x9665('0x10'),auth['isAuthenticated'](),controller[_0x9665('0x11')]);router['get'](_0x9665('0x12'),auth[_0x9665('0xc')](),controller[_0x9665('0x13')]);router[_0x9665('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9665('0x15')](_0x9665('0xb'),auth[_0x9665('0xc')](),controller['update']);router[_0x9665('0x16')]('/:id',auth[_0x9665('0xc')](),controller[_0x9665('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xe55d=['preview','run','query','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview'];(function(_0x26bc36,_0x95e54){var _0x173490=function(_0xc1dacb){while(--_0xc1dacb){_0x26bc36['push'](_0x26bc36['shift']());}};_0x173490(++_0x95e54);}(_0xe55d,0x126));var _0xde55=function(_0x1d63da,_0x3ed35b){_0x1d63da=_0x1d63da-0x0;var _0x1d0e27=_0xe55d[_0x1d63da];return _0x1d0e27;};'use strict';var multer=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var path=require('path');var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var fs_extra=require(_0xde55('0x5'));var auth=require(_0xde55('0x6'));var interaction=require(_0xde55('0x7'));var config=require('../../config/environment');var controller=require(_0xde55('0x8'));router[_0xde55('0x9')]('/',auth[_0xde55('0xa')](),controller['index']);router[_0xde55('0x9')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth['isAuthenticated'](),controller[_0xde55('0xe')]);router[_0xde55('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xde55('0xf')]);router[_0xde55('0x9')]('/:id/query',auth[_0xde55('0xa')](),controller[_0xde55('0x10')]);router['post']('/',auth[_0xde55('0xa')](),controller[_0xde55('0x11')]);router[_0xde55('0x12')]('/:id',auth[_0xde55('0xa')](),controller[_0xde55('0x13')]);router[_0xde55('0x14')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index d0f5888..4d9080a 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 _0x681f=['INTEGER','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled'];(function(_0x1fd615,_0x2b0f2b){var _0x1e1914=function(_0x1dfe46){while(--_0x1dfe46){_0x1fd615['push'](_0x1fd615['shift']());}};_0x1e1914(++_0x2b0f2b);}(_0x681f,0xc7));var _0xf681=function(_0x18a63a,_0x259cec){_0x18a63a=_0x18a63a-0x0;var _0x2cca04=_0x681f[_0x18a63a];return _0x2cca04;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf681('0x0'));module[_0xf681('0x1')]={'name':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf681('0x3')](_0xf681('0x4'),_0xf681('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf681('0x4')},'savename':{'type':Sequelize[_0xf681('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf681('0x6')]},'endDate':{'type':Sequelize[_0xf681('0x6')]},'status':{'type':Sequelize[_0xf681('0x2')],'defaultValue':_0xf681('0x7')},'type':{'type':Sequelize[_0xf681('0x3')](_0xf681('0x8'),_0xf681('0x9')),'allowNull':![],'defaultValue':_0xf681('0x8')},'reportId':{'type':Sequelize[_0xf681('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xf681('0x2')]}};
\ No newline at end of file
+var _0x3e71=['INTEGER','sequelize','moment','STRING','csv','xlsx','DATE','Loading','ENUM','manual'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x3e71,0x123));var _0x13e7=function(_0x52a0c6,_0x244632){_0x52a0c6=_0x52a0c6-0x0;var _0x29d78c=_0x3e71[_0x52a0c6];return _0x29d78c;};'use strict';var Sequelize=require(_0x13e7('0x0'));var moment=require(_0x13e7('0x1'));module['exports']={'name':{'type':Sequelize[_0x13e7('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x13e7('0x3'),'pdf',_0x13e7('0x4')),'allowNull':![],'defaultValue':_0x13e7('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x13e7('0x5')]},'endDate':{'type':Sequelize[_0x13e7('0x5')]},'status':{'type':Sequelize[_0x13e7('0x2')],'defaultValue':_0x13e7('0x6')},'type':{'type':Sequelize[_0x13e7('0x7')](_0x13e7('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x13e7('0x8')},'reportId':{'type':Sequelize[_0x13e7('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x13e7('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 4e45756..9e4c941 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 _0xe4a7=['rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','fields','length','find','user','role','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','basename','output','toLowerCase','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport'];(function(_0x2c2c91,_0x5907e5){var _0x3d9736=function(_0x15573c){while(--_0x15573c){_0x2c2c91['push'](_0x2c2c91['shift']());}};_0x3d9736(++_0x5907e5);}(_0xe4a7,0x14e));var _0x7e4a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe4a7[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x7e4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e4a('0x1'));var rp=require(_0x7e4a('0x2'));var moment=require(_0x7e4a('0x3'));var BPromise=require(_0x7e4a('0x4'));var Mustache=require(_0x7e4a('0x5'));var util=require(_0x7e4a('0x6'));var path=require('path');var sox=require(_0x7e4a('0x7'));var csv=require(_0x7e4a('0x8'));var ejs=require(_0x7e4a('0x9'));var fs=require('fs');var fs_extra=require(_0x7e4a('0xa'));var _=require(_0x7e4a('0xb'));var squel=require(_0x7e4a('0xc'));var crypto=require(_0x7e4a('0xd'));var jsforce=require(_0x7e4a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7e4a('0x8'));var querystring=require(_0x7e4a('0xf'));var Papa=require('papaparse');var Redis=require(_0x7e4a('0x10'));var authService=require(_0x7e4a('0x11'));var qs=require(_0x7e4a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e4a('0x13'));var logger=require(_0x7e4a('0x14'))('api');var utils=require(_0x7e4a('0x15'));var config=require(_0x7e4a('0x16'));var licenseUtil=require(_0x7e4a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x512945,_0x5b4ba3){_0x5b4ba3=_0x5b4ba3||0xcc;return function(_0x3973bc){if(_0x3973bc){return _0x512945[_0x7e4a('0x18')](_0x5b4ba3);}return _0x512945[_0x7e4a('0x19')](_0x5b4ba3)[_0x7e4a('0x1a')]();};}function respondWithResult(_0x56e027,_0x3950d){_0x3950d=_0x3950d||0xc8;return function(_0x50bba5){if(_0x50bba5){return _0x56e027[_0x7e4a('0x19')](_0x3950d)[_0x7e4a('0x1b')](_0x50bba5);}};}function respondWithFilteredResult(_0x3d623c,_0x52b23b){return function(_0x557ea4){if(_0x557ea4){var _0x186fec=typeof _0x52b23b[_0x7e4a('0x1c')]==='undefined'&&typeof _0x52b23b['limit']===_0x7e4a('0x1d');var _0x1b9beb=_0x557ea4[_0x7e4a('0x1e')];var _0x22118e=_0x186fec?0x0:_0x52b23b['offset'];var _0xf71c73=_0x186fec?_0x557ea4['count']:_0x52b23b[_0x7e4a('0x1c')]+_0x52b23b[_0x7e4a('0x1f')];var _0x2ff71a;if(_0xf71c73>=_0x1b9beb){_0xf71c73=_0x1b9beb;_0x2ff71a=0xc8;}else{_0x2ff71a=0xce;}_0x3d623c[_0x7e4a('0x19')](_0x2ff71a);return _0x3d623c[_0x7e4a('0x20')]('Content-Range',_0x22118e+'-'+_0xf71c73+'/'+_0x1b9beb)['json'](_0x557ea4);}return null;};}function patchUpdates(_0x2f3b2f){return function(_0x1570fd){try{jsonpatch['apply'](_0x1570fd,_0x2f3b2f,!![]);}catch(_0xa51720){return BPromise[_0x7e4a('0x21')](_0xa51720);}return _0x1570fd[_0x7e4a('0x22')]();};}function saveUpdates(_0x44dfd4,_0x3c3e6c){return function(_0x18c0a1){if(_0x18c0a1){return _0x18c0a1[_0x7e4a('0x23')](_0x44dfd4)[_0x7e4a('0x24')](function(_0x42525b){return _0x42525b;});}return null;};}function removeEntity(_0x28ad0f,_0x3562bd){return function(_0x2f408b){if(_0x2f408b){return _0x2f408b[_0x7e4a('0x25')]()[_0x7e4a('0x24')](function(){var _0xebfa7e=_0x2f408b['get']({'plain':!![]});var _0x3830e5=_0x7e4a('0x26');return db[_0x7e4a('0x27')]['destroy']({'where':{'type':_0x3830e5,'resourceId':_0xebfa7e['id']}})[_0x7e4a('0x24')](function(){return _0x2f408b;});})['then'](function(){_0x28ad0f[_0x7e4a('0x19')](0xcc)[_0x7e4a('0x1a')]();});}};}function handleEntityNotFound(_0x54ffb6,_0x56c3f3){return function(_0x95402b){if(!_0x95402b){_0x54ffb6[_0x7e4a('0x18')](0x194);}return _0x95402b;};}function handleError(_0x29b5ec,_0x11d7bf){_0x11d7bf=_0x11d7bf||0x1f4;return function(_0x3543e2){logger['error'](_0x3543e2[_0x7e4a('0x28')]);if(_0x3543e2[_0x7e4a('0x29')]){delete _0x3543e2[_0x7e4a('0x29')];}_0x29b5ec[_0x7e4a('0x19')](_0x11d7bf)[_0x7e4a('0x2a')](_0x3543e2);};}exports[_0x7e4a('0x2b')]=function(_0x42b57a,_0xe6b5c){var _0x12ffc1={},_0xc4220={},_0x732c67={'count':0x0,'rows':[]};var _0x1533c6=_[_0x7e4a('0x2c')](db[_0x7e4a('0x2d')][_0x7e4a('0x2e')],function(_0x40aba3){return{'name':_0x40aba3[_0x7e4a('0x2f')],'type':_0x40aba3[_0x7e4a('0x30')][_0x7e4a('0x31')]};});_0xc4220['model']=_[_0x7e4a('0x2c')](_0x1533c6,'name');_0xc4220[_0x7e4a('0x32')]=_[_0x7e4a('0x33')](_0x42b57a[_0x7e4a('0x32')]);_0xc4220[_0x7e4a('0x34')]=_['intersection'](_0xc4220[_0x7e4a('0x35')],_0xc4220['query']);_0x12ffc1['attributes']=_[_0x7e4a('0x36')](_0xc4220[_0x7e4a('0x35')],qs['fields'](_0x42b57a['query']['fields']));_0x12ffc1[_0x7e4a('0x37')]=_0x12ffc1[_0x7e4a('0x37')]['length']?_0x12ffc1[_0x7e4a('0x37')]:_0xc4220[_0x7e4a('0x35')];if(!_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x38')]('nolimit')){_0x12ffc1['limit']=qs['limit'](_0x42b57a['query'][_0x7e4a('0x1f')]);_0x12ffc1[_0x7e4a('0x1c')]=qs[_0x7e4a('0x1c')](_0x42b57a['query'][_0x7e4a('0x1c')]);}_0x12ffc1['order']=qs['sort'](_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x39')]);_0x12ffc1[_0x7e4a('0x3a')]=qs[_0x7e4a('0x34')](_[_0x7e4a('0x3b')](_0x42b57a['query'],_0xc4220[_0x7e4a('0x34')]),_0x1533c6);if(_0x42b57a[_0x7e4a('0x32')]['filter']){_0x12ffc1[_0x7e4a('0x3a')]=_['merge'](_0x12ffc1[_0x7e4a('0x3a')],{'$or':_[_0x7e4a('0x2c')](_0x1533c6,function(_0x55cdbb){if(_0x55cdbb['type']!==_0x7e4a('0x3c')){var _0x3b1844={};_0x3b1844[_0x55cdbb['name']]={'$like':'%'+_0x42b57a['query'][_0x7e4a('0x3d')]+'%'};return _0x3b1844;}})});}_0x12ffc1=_[_0x7e4a('0x3e')]({},_0x12ffc1,_0x42b57a[_0x7e4a('0x3f')]);var _0x43e9ce={'where':_0x12ffc1[_0x7e4a('0x3a')]};return db[_0x7e4a('0x2d')][_0x7e4a('0x1e')](_0x43e9ce)[_0x7e4a('0x24')](function(_0x1b6fa8){_0x732c67['count']=_0x1b6fa8;if(_0x42b57a[_0x7e4a('0x32')][_0x7e4a('0x40')]){_0x12ffc1[_0x7e4a('0x41')]=[{'all':!![]}];}return db[_0x7e4a('0x2d')][_0x7e4a('0x42')](_0x12ffc1);})[_0x7e4a('0x24')](function(_0x1fcf13){_0x732c67[_0x7e4a('0x43')]=_0x1fcf13;return _0x732c67;})[_0x7e4a('0x24')](respondWithFilteredResult(_0xe6b5c,_0x12ffc1))[_0x7e4a('0x44')](handleError(_0xe6b5c,null));};exports['show']=function(_0x330715,_0x5690ed){var _0x4ef707={'raw':!![],'where':{'id':_0x330715['params']['id']}},_0x560cf5={};_0x560cf5[_0x7e4a('0x35')]=_['keys'](db[_0x7e4a('0x2d')][_0x7e4a('0x2e')]);_0x560cf5[_0x7e4a('0x32')]=_[_0x7e4a('0x33')](_0x330715[_0x7e4a('0x32')]);_0x560cf5['filters']=_['intersection'](_0x560cf5[_0x7e4a('0x35')],_0x560cf5[_0x7e4a('0x32')]);_0x4ef707['attributes']=_[_0x7e4a('0x36')](_0x560cf5['model'],qs[_0x7e4a('0x45')](_0x330715[_0x7e4a('0x32')][_0x7e4a('0x45')]));_0x4ef707[_0x7e4a('0x37')]=_0x4ef707[_0x7e4a('0x37')][_0x7e4a('0x46')]?_0x4ef707[_0x7e4a('0x37')]:_0x560cf5[_0x7e4a('0x35')];if(_0x330715[_0x7e4a('0x32')][_0x7e4a('0x40')]){_0x4ef707[_0x7e4a('0x41')]=[{'all':!![]}];}_0x4ef707=_[_0x7e4a('0x3e')]({},_0x4ef707,_0x330715[_0x7e4a('0x3f')]);return db['AnalyticExtractedReport'][_0x7e4a('0x47')](_0x4ef707)[_0x7e4a('0x24')](handleEntityNotFound(_0x5690ed,null))[_0x7e4a('0x24')](respondWithResult(_0x5690ed,null))[_0x7e4a('0x44')](handleError(_0x5690ed,null));};exports['create']=function(_0xc8535,_0x35c70a){return db[_0x7e4a('0x2d')]['create'](_0xc8535['body'],{})[_0x7e4a('0x24')](function(_0x419710){var _0x3b7813=_0xc8535[_0x7e4a('0x48')]['get']({'plain':!![]});if(!_0x3b7813)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b7813[_0x7e4a('0x49')]==='user'){var _0x1d7de0=_0x419710['get']({'plain':!![]});var _0x5096f4=_0x7e4a('0x26');return db[_0x7e4a('0x4a')][_0x7e4a('0x47')]({'where':{'name':_0x5096f4,'userProfileId':_0x3b7813['userProfileId']},'raw':!![]})['then'](function(_0x39fdf0){if(_0x39fdf0&&_0x39fdf0[_0x7e4a('0x4b')]===0x0){return db['UserProfileResource'][_0x7e4a('0x4c')]({'name':_0x1d7de0[_0x7e4a('0x29')],'resourceId':_0x1d7de0['id'],'type':_0x39fdf0[_0x7e4a('0x29')],'sectionId':_0x39fdf0['id']},{})[_0x7e4a('0x24')](function(){return _0x419710;});}else{return _0x419710;}})['catch'](function(_0x45fdab){logger[_0x7e4a('0x4d')](_0x7e4a('0x4e'),_0x45fdab);throw _0x45fdab;});}return _0x419710;})[_0x7e4a('0x24')](respondWithResult(_0x35c70a,0xc9))['catch'](handleError(_0x35c70a,null));};exports[_0x7e4a('0x23')]=function(_0x4c21d5,_0x28ec63){if(_0x4c21d5['body']['id']){delete _0x4c21d5[_0x7e4a('0x4f')]['id'];}return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x4c21d5[_0x7e4a('0x50')]['id']}})[_0x7e4a('0x24')](handleEntityNotFound(_0x28ec63,null))[_0x7e4a('0x24')](saveUpdates(_0x4c21d5[_0x7e4a('0x4f')],null))[_0x7e4a('0x24')](respondWithResult(_0x28ec63,null))[_0x7e4a('0x44')](handleError(_0x28ec63,null));};exports[_0x7e4a('0x25')]=function(_0x6b115a,_0x54f505){return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x6b115a[_0x7e4a('0x50')]['id']}})[_0x7e4a('0x24')](handleEntityNotFound(_0x54f505,null))['then'](removeEntity(_0x54f505,null))[_0x7e4a('0x44')](handleError(_0x54f505,null));};exports[_0x7e4a('0x51')]=function(_0x476e3c,_0x5ce052,_0x10a13a){return db[_0x7e4a('0x2d')][_0x7e4a('0x47')]({'where':{'id':_0x476e3c['params']['id']},'attributes':[_0x7e4a('0x29'),'basename',_0x7e4a('0x52'),'output'],'raw':!![]})[_0x7e4a('0x24')](handleEntityNotFound(_0x5ce052,null))['then'](function(_0x1521d0){if(_0x1521d0){if(!fs[_0x7e4a('0x53')](path[_0x7e4a('0x54')](config['root'],_0x7e4a('0x55'),_0x1521d0[_0x7e4a('0x52')]))){throw new db[(_0x7e4a('0x56'))][(_0x7e4a('0x57'))](_0x7e4a('0x58'));}if(_0x476e3c[_0x7e4a('0x32')][_0x7e4a('0x59')]){return _0x5ce052[_0x7e4a('0x18')](0xc8);}return _0x5ce052[_0x7e4a('0x51')](path[_0x7e4a('0x54')](config[_0x7e4a('0x5a')],_0x7e4a('0x55'),_0x1521d0['savename']),util['format'](_0x7e4a('0x5b'),_0x1521d0[_0x7e4a('0x5c')]||_0x1521d0[_0x7e4a('0x29')],_0x1521d0[_0x7e4a('0x5d')][_0x7e4a('0x5e')]()));}})[_0x7e4a('0x44')](handleError(_0x5ce052,null));};
\ No newline at end of file
+var _0x63cc=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','then','get','ExtractedReports','UserProfileResource','end','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x115aa2,_0x12d812){var _0x5890a5=function(_0x2e5fdb){while(--_0x2e5fdb){_0x115aa2['push'](_0x115aa2['shift']());}};_0x5890a5(++_0x12d812);}(_0x63cc,0x1ec));var _0xc63c=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x63cc[_0x4bb581];return _0x316bf5;};'use strict';var emlformat=require(_0xc63c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc63c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc63c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc63c('0x3'));var util=require(_0xc63c('0x4'));var path=require(_0xc63c('0x5'));var sox=require(_0xc63c('0x6'));var csv=require(_0xc63c('0x7'));var ejs=require(_0xc63c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc63c('0x9'));var squel=require(_0xc63c('0xa'));var crypto=require(_0xc63c('0xb'));var jsforce=require(_0xc63c('0xc'));var deskjs=require(_0xc63c('0xd'));var toCsv=require(_0xc63c('0x7'));var querystring=require(_0xc63c('0xe'));var Papa=require(_0xc63c('0xf'));var Redis=require('ioredis');var authService=require(_0xc63c('0x10'));var qs=require(_0xc63c('0x11'));var as=require(_0xc63c('0x12'));var hardwareService=require(_0xc63c('0x13'));var logger=require(_0xc63c('0x14'))(_0xc63c('0x15'));var utils=require(_0xc63c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc63c('0x17'));var db=require(_0xc63c('0x18'))['db'];function respondWithStatusCode(_0x6c4adf,_0x447245){_0x447245=_0x447245||0xcc;return function(_0x6dfc9f){if(_0x6dfc9f){return _0x6c4adf[_0xc63c('0x19')](_0x447245);}return _0x6c4adf['status'](_0x447245)['end']();};}function respondWithResult(_0x5e405b,_0x2cc3c8){_0x2cc3c8=_0x2cc3c8||0xc8;return function(_0x4366b2){if(_0x4366b2){return _0x5e405b[_0xc63c('0x1a')](_0x2cc3c8)['json'](_0x4366b2);}};}function respondWithFilteredResult(_0x5d3a14,_0x32045b){return function(_0x1c1cdf){if(_0x1c1cdf){var _0x1b1948=typeof _0x32045b[_0xc63c('0x1b')]===_0xc63c('0x1c')&&typeof _0x32045b['limit']==='undefined';var _0x28b577=_0x1c1cdf[_0xc63c('0x1d')];var _0x16c7d2=_0x1b1948?0x0:_0x32045b[_0xc63c('0x1b')];var _0x57c910=_0x1b1948?_0x1c1cdf[_0xc63c('0x1d')]:_0x32045b[_0xc63c('0x1b')]+_0x32045b[_0xc63c('0x1e')];var _0x8eb59;if(_0x57c910>=_0x28b577){_0x57c910=_0x28b577;_0x8eb59=0xc8;}else{_0x8eb59=0xce;}_0x5d3a14[_0xc63c('0x1a')](_0x8eb59);return _0x5d3a14['set'](_0xc63c('0x1f'),_0x16c7d2+'-'+_0x57c910+'/'+_0x28b577)[_0xc63c('0x20')](_0x1c1cdf);}return null;};}function patchUpdates(_0x51791f){return function(_0x3ce58d){try{jsonpatch[_0xc63c('0x21')](_0x3ce58d,_0x51791f,!![]);}catch(_0x3129be){return BPromise['reject'](_0x3129be);}return _0x3ce58d[_0xc63c('0x22')]();};}function saveUpdates(_0x52d823,_0x2226fc){return function(_0x3c4e87){if(_0x3c4e87){return _0x3c4e87[_0xc63c('0x23')](_0x52d823)['then'](function(_0x4de078){return _0x4de078;});}return null;};}function removeEntity(_0x58d118,_0x2f7125){return function(_0x5b4979){if(_0x5b4979){return _0x5b4979[_0xc63c('0x24')]()[_0xc63c('0x25')](function(){var _0x53b1b5=_0x5b4979[_0xc63c('0x26')]({'plain':!![]});var _0x1acc7b=_0xc63c('0x27');return db[_0xc63c('0x28')][_0xc63c('0x24')]({'where':{'type':_0x1acc7b,'resourceId':_0x53b1b5['id']}})[_0xc63c('0x25')](function(){return _0x5b4979;});})[_0xc63c('0x25')](function(){_0x58d118[_0xc63c('0x1a')](0xcc)[_0xc63c('0x29')]();});}};}function handleEntityNotFound(_0x5b94ba,_0x9c1a2b){return function(_0x2a16de){if(!_0x2a16de){_0x5b94ba['sendStatus'](0x194);}return _0x2a16de;};}function handleError(_0x4c0a1f,_0x31e0ab){_0x31e0ab=_0x31e0ab||0x1f4;return function(_0x59170c){logger['error'](_0x59170c['stack']);if(_0x59170c[_0xc63c('0x2a')]){delete _0x59170c[_0xc63c('0x2a')];}_0x4c0a1f[_0xc63c('0x1a')](_0x31e0ab)[_0xc63c('0x2b')](_0x59170c);};}exports['index']=function(_0x56d022,_0x4076c9){var _0x5da78a={},_0x3b28f4={},_0x3894fa={'count':0x0,'rows':[]};var _0x397fdf=_[_0xc63c('0x2c')](db[_0xc63c('0x2d')]['rawAttributes'],function(_0x26f388){return{'name':_0x26f388[_0xc63c('0x2e')],'type':_0x26f388[_0xc63c('0x2f')][_0xc63c('0x30')]};});_0x3b28f4[_0xc63c('0x31')]=_[_0xc63c('0x2c')](_0x397fdf,_0xc63c('0x2a'));_0x3b28f4[_0xc63c('0x32')]=_['keys'](_0x56d022[_0xc63c('0x32')]);_0x3b28f4[_0xc63c('0x33')]=_['intersection'](_0x3b28f4[_0xc63c('0x31')],_0x3b28f4[_0xc63c('0x32')]);_0x5da78a[_0xc63c('0x34')]=_['intersection'](_0x3b28f4['model'],qs['fields'](_0x56d022[_0xc63c('0x32')][_0xc63c('0x35')]));_0x5da78a['attributes']=_0x5da78a['attributes'][_0xc63c('0x36')]?_0x5da78a['attributes']:_0x3b28f4[_0xc63c('0x31')];if(!_0x56d022[_0xc63c('0x32')][_0xc63c('0x37')](_0xc63c('0x38'))){_0x5da78a[_0xc63c('0x1e')]=qs[_0xc63c('0x1e')](_0x56d022['query'][_0xc63c('0x1e')]);_0x5da78a['offset']=qs[_0xc63c('0x1b')](_0x56d022[_0xc63c('0x32')]['offset']);}_0x5da78a[_0xc63c('0x39')]=qs['sort'](_0x56d022[_0xc63c('0x32')][_0xc63c('0x3a')]);_0x5da78a[_0xc63c('0x3b')]=qs[_0xc63c('0x33')](_[_0xc63c('0x3c')](_0x56d022[_0xc63c('0x32')],_0x3b28f4[_0xc63c('0x33')]),_0x397fdf);if(_0x56d022[_0xc63c('0x32')][_0xc63c('0x3d')]){_0x5da78a[_0xc63c('0x3b')]=_[_0xc63c('0x3e')](_0x5da78a['where'],{'$or':_[_0xc63c('0x2c')](_0x397fdf,function(_0x3409e8){if(_0x3409e8[_0xc63c('0x2f')]!=='VIRTUAL'){var _0x540774={};_0x540774[_0x3409e8[_0xc63c('0x2a')]]={'$like':'%'+_0x56d022[_0xc63c('0x32')][_0xc63c('0x3d')]+'%'};return _0x540774;}})});}_0x5da78a=_[_0xc63c('0x3e')]({},_0x5da78a,_0x56d022[_0xc63c('0x3f')]);var _0x390bae={'where':_0x5da78a['where']};return db[_0xc63c('0x2d')][_0xc63c('0x1d')](_0x390bae)[_0xc63c('0x25')](function(_0x248500){_0x3894fa[_0xc63c('0x1d')]=_0x248500;if(_0x56d022['query'][_0xc63c('0x40')]){_0x5da78a[_0xc63c('0x41')]=[{'all':!![]}];}return db[_0xc63c('0x2d')][_0xc63c('0x42')](_0x5da78a);})[_0xc63c('0x25')](function(_0x1a7b9d){_0x3894fa[_0xc63c('0x43')]=_0x1a7b9d;return _0x3894fa;})['then'](respondWithFilteredResult(_0x4076c9,_0x5da78a))[_0xc63c('0x44')](handleError(_0x4076c9,null));};exports['show']=function(_0x437c8a,_0x563ae3){var _0x403b47={'raw':!![],'where':{'id':_0x437c8a[_0xc63c('0x45')]['id']}},_0x59c20c={};_0x59c20c[_0xc63c('0x31')]=_[_0xc63c('0x46')](db[_0xc63c('0x2d')][_0xc63c('0x47')]);_0x59c20c[_0xc63c('0x32')]=_[_0xc63c('0x46')](_0x437c8a[_0xc63c('0x32')]);_0x59c20c[_0xc63c('0x33')]=_[_0xc63c('0x48')](_0x59c20c[_0xc63c('0x31')],_0x59c20c[_0xc63c('0x32')]);_0x403b47[_0xc63c('0x34')]=_[_0xc63c('0x48')](_0x59c20c[_0xc63c('0x31')],qs[_0xc63c('0x35')](_0x437c8a[_0xc63c('0x32')][_0xc63c('0x35')]));_0x403b47[_0xc63c('0x34')]=_0x403b47[_0xc63c('0x34')][_0xc63c('0x36')]?_0x403b47['attributes']:_0x59c20c['model'];if(_0x437c8a[_0xc63c('0x32')]['includeAll']){_0x403b47[_0xc63c('0x41')]=[{'all':!![]}];}_0x403b47=_[_0xc63c('0x3e')]({},_0x403b47,_0x437c8a['options']);return db[_0xc63c('0x2d')][_0xc63c('0x49')](_0x403b47)[_0xc63c('0x25')](handleEntityNotFound(_0x563ae3,null))[_0xc63c('0x25')](respondWithResult(_0x563ae3,null))[_0xc63c('0x44')](handleError(_0x563ae3,null));};exports[_0xc63c('0x4a')]=function(_0x30b084,_0x183f32){return db[_0xc63c('0x2d')]['create'](_0x30b084['body'],{})[_0xc63c('0x25')](function(_0x3cc99c){var _0x12fa18=_0x30b084[_0xc63c('0x4b')]['get']({'plain':!![]});if(!_0x12fa18)throw new Error(_0xc63c('0x4c'));if(_0x12fa18[_0xc63c('0x4d')]===_0xc63c('0x4b')){var _0x32d33d=_0x3cc99c[_0xc63c('0x26')]({'plain':!![]});var _0xfa982a='ExtractedReports';return db[_0xc63c('0x4e')][_0xc63c('0x49')]({'where':{'name':_0xfa982a,'userProfileId':_0x12fa18[_0xc63c('0x4f')]},'raw':!![]})['then'](function(_0xe5a52c){if(_0xe5a52c&&_0xe5a52c[_0xc63c('0x50')]===0x0){return db[_0xc63c('0x28')]['create']({'name':_0x32d33d[_0xc63c('0x2a')],'resourceId':_0x32d33d['id'],'type':_0xe5a52c[_0xc63c('0x2a')],'sectionId':_0xe5a52c['id']},{})['then'](function(){return _0x3cc99c;});}else{return _0x3cc99c;}})['catch'](function(_0x1bcbe1){logger['error'](_0xc63c('0x51'),_0x1bcbe1);throw _0x1bcbe1;});}return _0x3cc99c;})[_0xc63c('0x25')](respondWithResult(_0x183f32,0xc9))[_0xc63c('0x44')](handleError(_0x183f32,null));};exports[_0xc63c('0x23')]=function(_0x5445d5,_0x2b0c7b){if(_0x5445d5[_0xc63c('0x52')]['id']){delete _0x5445d5[_0xc63c('0x52')]['id'];}return db[_0xc63c('0x2d')][_0xc63c('0x49')]({'where':{'id':_0x5445d5['params']['id']}})[_0xc63c('0x25')](handleEntityNotFound(_0x2b0c7b,null))[_0xc63c('0x25')](saveUpdates(_0x5445d5[_0xc63c('0x52')],null))[_0xc63c('0x25')](respondWithResult(_0x2b0c7b,null))[_0xc63c('0x44')](handleError(_0x2b0c7b,null));};exports[_0xc63c('0x24')]=function(_0x2b0dd1,_0xbf56e){return db[_0xc63c('0x2d')][_0xc63c('0x49')]({'where':{'id':_0x2b0dd1[_0xc63c('0x45')]['id']}})[_0xc63c('0x25')](handleEntityNotFound(_0xbf56e,null))[_0xc63c('0x25')](removeEntity(_0xbf56e,null))[_0xc63c('0x44')](handleError(_0xbf56e,null));};exports['download']=function(_0x525bb4,_0x2fcacd,_0x2d6c74){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x525bb4[_0xc63c('0x45')]['id']},'attributes':[_0xc63c('0x2a'),_0xc63c('0x53'),_0xc63c('0x54'),_0xc63c('0x55')],'raw':!![]})[_0xc63c('0x25')](handleEntityNotFound(_0x2fcacd,null))[_0xc63c('0x25')](function(_0x55700c){if(_0x55700c){if(!fs[_0xc63c('0x56')](path[_0xc63c('0x57')](config[_0xc63c('0x58')],_0xc63c('0x59'),_0x55700c[_0xc63c('0x54')]))){throw new db[(_0xc63c('0x5a'))][(_0xc63c('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x525bb4['query'][_0xc63c('0x5c')]){return _0x2fcacd[_0xc63c('0x19')](0xc8);}return _0x2fcacd['download'](path[_0xc63c('0x57')](config[_0xc63c('0x58')],_0xc63c('0x59'),_0x55700c[_0xc63c('0x54')]),util['format'](_0xc63c('0x5d'),_0x55700c[_0xc63c('0x53')]||_0x55700c[_0xc63c('0x2a')],_0x55700c[_0xc63c('0x55')][_0xc63c('0x5e')]()));}})['catch'](handleError(_0x2fcacd,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 069a535..90c5ce7 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 _0xe0d7=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x22afbf,_0x1ce599){var _0x258eb2=function(_0x5a60d9){while(--_0x5a60d9){_0x22afbf['push'](_0x22afbf['shift']());}};_0x258eb2(++_0x1ce599);}(_0xe0d7,0xd1));var _0x7e0d=function(_0x196dad,_0x46c9be){_0x196dad=_0x196dad-0x0;var _0x2a57f9=_0xe0d7[_0x196dad];return _0x2a57f9;};'use strict';var _=require(_0x7e0d('0x0'));var util=require(_0x7e0d('0x1'));var logger=require('../../config/logger')(_0x7e0d('0x2'));var moment=require(_0x7e0d('0x3'));var BPromise=require(_0x7e0d('0x4'));var rp=require(_0x7e0d('0x5'));var fs=require('fs');var path=require(_0x7e0d('0x6'));var rimraf=require(_0x7e0d('0x7'));var config=require(_0x7e0d('0x8'));var attributes=require(_0x7e0d('0x9'));module[_0x7e0d('0xa')]=function(_0x49e20b,_0x478182){return _0x49e20b[_0x7e0d('0xb')](_0x7e0d('0xc'),attributes,{'tableName':_0x7e0d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe266=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xe266,0x1e1));var _0x6e26=function(_0x5d4887,_0xef1c71){_0x5d4887=_0x5d4887-0x0;var _0x255855=_0xe266[_0x5d4887];return _0x255855;};'use strict';var _=require(_0x6e26('0x0'));var util=require('util');var logger=require(_0x6e26('0x1'))(_0x6e26('0x2'));var moment=require(_0x6e26('0x3'));var BPromise=require(_0x6e26('0x4'));var rp=require(_0x6e26('0x5'));var fs=require('fs');var path=require(_0x6e26('0x6'));var rimraf=require(_0x6e26('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e26('0x8'));module[_0x6e26('0x9')]=function(_0x394146,_0x2ffb09){return _0x394146[_0x6e26('0xa')](_0x6e26('0xb'),attributes,{'tableName':_0x6e26('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index a1d5117..d81eddd 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 _0x884c=['request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x445d86,_0x436422){var _0xcc6c76=function(_0x5137df){while(--_0x5137df){_0x445d86['push'](_0x445d86['shift']());}};_0xcc6c76(++_0x436422);}(_0x884c,0x1bd));var _0xc884=function(_0x311907,_0x87dc1d){_0x311907=_0x311907-0x0;var _0x3548e7=_0x884c[_0x311907];return _0x3548e7;};'use strict';var _=require(_0xc884('0x0'));var util=require(_0xc884('0x1'));var moment=require(_0xc884('0x2'));var BPromise=require(_0xc884('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc884('0x4'));var db=require(_0xc884('0x5'))['db'];var utils=require(_0xc884('0x6'));var logger=require(_0xc884('0x7'))(_0xc884('0x8'));var config=require(_0xc884('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc884('0xa')][_0xc884('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28365a,_0x526712,_0x493eff){return new BPromise(function(_0x4ddce5,_0x218fd7){return client[_0xc884('0xc')](_0x28365a,_0x493eff)['then'](function(_0x22f550){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x526712,'request\x20sent');logger[_0xc884('0xd')](_0xc884('0xe'),_0x526712,_0xc884('0xf'),JSON[_0xc884('0x10')](_0x22f550));if(_0x22f550[_0xc884('0x11')]){if(_0x22f550['error'][_0xc884('0x12')]===0x1f4){logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x22f550[_0xc884('0x11')]['message']);return _0x218fd7(_0x22f550[_0xc884('0x11')]['message']);}logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x22f550[_0xc884('0x11')][_0xc884('0x14')]);return _0x4ddce5(_0x22f550['error']['message']);}else{logger['info'](_0xc884('0x13'),_0x526712,_0xc884('0xf'));_0x4ddce5(_0x22f550[_0xc884('0x15')][_0xc884('0x14')]);}})[_0xc884('0x16')](function(_0x127856){logger[_0xc884('0x11')](_0xc884('0x13'),_0x526712,_0x127856);_0x218fd7(_0x127856);});});}
\ No newline at end of file
+var _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x3f9715,_0x431051){_0x3f9715=_0x3f9715-0x0;var _0x2d1e42=_0x6582[_0x3f9715];return _0x2d1e42;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e211569..8a133fe 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 _0x6306=['fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express','Router'];(function(_0xf7fcc2,_0x13a418){var _0xc2d347=function(_0x470250){while(--_0x470250){_0xf7fcc2['push'](_0xf7fcc2['shift']());}};_0xc2d347(++_0x13a418);}(_0x6306,0x188));var _0x6630=function(_0x25b5c1,_0x15f706){_0x25b5c1=_0x25b5c1-0x0;var _0x15cb0d=_0x6306[_0x25b5c1];return _0x15cb0d;};'use strict';var multer=require(_0x6630('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6630('0x1'));var express=require(_0x6630('0x2'));var router=express[_0x6630('0x3')]();var fs_extra=require(_0x6630('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6630('0x5'));var config=require(_0x6630('0x6'));var controller=require(_0x6630('0x7'));router[_0x6630('0x8')]('/',auth['isAuthenticated'](),controller[_0x6630('0x9')]);router[_0x6630('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6630('0xa')]);router[_0x6630('0x8')](_0x6630('0xb'),auth[_0x6630('0xc')](),controller[_0x6630('0xd')]);router[_0x6630('0xe')]('/',auth[_0x6630('0xc')](),controller[_0x6630('0xf')]);router[_0x6630('0x10')]('/:id',auth[_0x6630('0xc')](),controller[_0x6630('0x11')]);router[_0x6630('0x12')](_0x6630('0x13'),auth[_0x6630('0xc')](),controller[_0x6630('0x14')]);module[_0x6630('0x15')]=router;
\ No newline at end of file
+var _0x0762=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','delete','destroy'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0762,0x168));var _0x2076=function(_0x138136,_0x1fbe02){_0x138136=_0x138136-0x0;var _0xad8864=_0x0762[_0x138136];return _0xad8864;};'use strict';var multer=require('multer');var util=require(_0x2076('0x0'));var path=require(_0x2076('0x1'));var timeout=require(_0x2076('0x2'));var express=require('express');var router=express[_0x2076('0x3')]();var fs_extra=require(_0x2076('0x4'));var auth=require(_0x2076('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2076('0x6'));var controller=require(_0x2076('0x7'));router[_0x2076('0x8')]('/',auth[_0x2076('0x9')](),controller['index']);router[_0x2076('0x8')](_0x2076('0xa'),auth[_0x2076('0x9')](),controller[_0x2076('0xb')]);router['get'](_0x2076('0xc'),auth[_0x2076('0x9')](),controller[_0x2076('0xd')]);router[_0x2076('0xe')]('/',auth[_0x2076('0x9')](),controller[_0x2076('0xf')]);router['put'](_0x2076('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2076('0x10')](_0x2076('0xa'),auth[_0x2076('0x9')](),controller[_0x2076('0x11')]);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 dd9644f..dbfeed0 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 _0x8f94=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f94,0xd3));var _0x48f9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f94[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x48f9('0x0'));module[_0x48f9('0x1')]={'field':{'type':Sequelize[_0x48f9('0x2')]},'alias':{'type':Sequelize[_0x48f9('0x3')]},'function':{'type':Sequelize[_0x48f9('0x3')]},'format':{'type':Sequelize[_0x48f9('0x3')]},'groupBy':{'type':Sequelize[_0x48f9('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x48f9('0x3')]},'custom':{'type':Sequelize[_0x48f9('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xd2b2=['BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2b2,0x11b));var _0x2d2b=function(_0x1ccf4f,_0x18ce33){_0x1ccf4f=_0x1ccf4f-0x0;var _0x3f747c=_0xd2b2[_0x1ccf4f];return _0x3f747c;};'use strict';var Sequelize=require(_0x2d2b('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x2d2b('0x1')]},'format':{'type':Sequelize[_0x2d2b('0x1')]},'groupBy':{'type':Sequelize[_0x2d2b('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2d2b('0x1')]},'custom':{'type':Sequelize[_0x2d2b('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index f706ba1..a0794c1 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 _0x9933=['mustache','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','AnalyticFieldReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','bulkCreate','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9933,0xe5));var _0x3993=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9933[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x3993('0x0'));var rimraf=require(_0x3993('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3993('0x2'));var rp=require('request-promise');var moment=require(_0x3993('0x3'));var BPromise=require(_0x3993('0x4'));var Mustache=require(_0x3993('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3993('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3993('0x7'));var _=require(_0x3993('0x8'));var squel=require(_0x3993('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3993('0xa'));var toCsv=require(_0x3993('0x6'));var querystring=require(_0x3993('0xb'));var Papa=require(_0x3993('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3993('0xd'));var as=require(_0x3993('0xe'));var hardwareService=require(_0x3993('0xf'));var logger=require('../../config/logger')(_0x3993('0x10'));var utils=require(_0x3993('0x11'));var config=require(_0x3993('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3993('0x13'))['db'];function respondWithStatusCode(_0x53b36a,_0x2f2550){_0x2f2550=_0x2f2550||0xcc;return function(_0x43f79f){if(_0x43f79f){return _0x53b36a[_0x3993('0x14')](_0x2f2550);}return _0x53b36a[_0x3993('0x15')](_0x2f2550)[_0x3993('0x16')]();};}function respondWithResult(_0x246754,_0x5d72c5){_0x5d72c5=_0x5d72c5||0xc8;return function(_0x323e7e){if(_0x323e7e){return _0x246754[_0x3993('0x15')](_0x5d72c5)['json'](_0x323e7e);}};}function respondWithFilteredResult(_0x3426db,_0x10d64b){return function(_0x35b0a3){if(_0x35b0a3){var _0x5415a4=typeof _0x10d64b[_0x3993('0x17')]===_0x3993('0x18')&&typeof _0x10d64b[_0x3993('0x19')]==='undefined';var _0x3bc0e9=_0x35b0a3[_0x3993('0x1a')];var _0x13569f=_0x5415a4?0x0:_0x10d64b[_0x3993('0x17')];var _0xcfdc67=_0x5415a4?_0x35b0a3[_0x3993('0x1a')]:_0x10d64b[_0x3993('0x17')]+_0x10d64b[_0x3993('0x19')];var _0x919c93;if(_0xcfdc67>=_0x3bc0e9){_0xcfdc67=_0x3bc0e9;_0x919c93=0xc8;}else{_0x919c93=0xce;}_0x3426db[_0x3993('0x15')](_0x919c93);return _0x3426db[_0x3993('0x1b')](_0x3993('0x1c'),_0x13569f+'-'+_0xcfdc67+'/'+_0x3bc0e9)[_0x3993('0x1d')](_0x35b0a3);}return null;};}function patchUpdates(_0x389f01){return function(_0x508a29){try{jsonpatch[_0x3993('0x1e')](_0x508a29,_0x389f01,!![]);}catch(_0x552a8f){return BPromise[_0x3993('0x1f')](_0x552a8f);}return _0x508a29[_0x3993('0x20')]();};}function saveUpdates(_0x215cdc,_0x443405){return function(_0x468150){if(_0x468150){return _0x468150[_0x3993('0x21')](_0x215cdc)[_0x3993('0x22')](function(_0x267db9){return _0x267db9;});}return null;};}function removeEntity(_0x14fbf4,_0x5b528d){return function(_0x3f2305){if(_0x3f2305){return _0x3f2305[_0x3993('0x23')]()['then'](function(){_0x14fbf4[_0x3993('0x15')](0xcc)[_0x3993('0x16')]();});}};}function handleEntityNotFound(_0x54c9bd,_0x43e935){return function(_0x189831){if(!_0x189831){_0x54c9bd[_0x3993('0x14')](0x194);}return _0x189831;};}function handleError(_0x47886c,_0x2d5bb6){_0x2d5bb6=_0x2d5bb6||0x1f4;return function(_0xede592){logger[_0x3993('0x24')](_0xede592[_0x3993('0x25')]);if(_0xede592[_0x3993('0x26')]){delete _0xede592[_0x3993('0x26')];}_0x47886c[_0x3993('0x15')](_0x2d5bb6)[_0x3993('0x27')](_0xede592);};}exports['index']=function(_0x2f52c4,_0x1c7fe9){var _0x32c80c={},_0x4fd8d7={},_0x353ccc={'count':0x0,'rows':[]};var _0x18880a=_['map'](db[_0x3993('0x28')]['rawAttributes'],function(_0x1ca9d7){return{'name':_0x1ca9d7[_0x3993('0x29')],'type':_0x1ca9d7[_0x3993('0x2a')]['key']};});_0x4fd8d7[_0x3993('0x2b')]=_[_0x3993('0x2c')](_0x18880a,_0x3993('0x26'));_0x4fd8d7[_0x3993('0x2d')]=_['keys'](_0x2f52c4['query']);_0x4fd8d7[_0x3993('0x2e')]=_[_0x3993('0x2f')](_0x4fd8d7[_0x3993('0x2b')],_0x4fd8d7[_0x3993('0x2d')]);_0x32c80c[_0x3993('0x30')]=_['intersection'](_0x4fd8d7['model'],qs[_0x3993('0x31')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x31')]));_0x32c80c[_0x3993('0x30')]=_0x32c80c[_0x3993('0x30')][_0x3993('0x32')]?_0x32c80c[_0x3993('0x30')]:_0x4fd8d7[_0x3993('0x2b')];if(!_0x2f52c4[_0x3993('0x2d')][_0x3993('0x33')]('nolimit')){_0x32c80c[_0x3993('0x19')]=qs[_0x3993('0x19')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x19')]);_0x32c80c[_0x3993('0x17')]=qs[_0x3993('0x17')](_0x2f52c4['query']['offset']);}_0x32c80c[_0x3993('0x34')]=qs[_0x3993('0x35')](_0x2f52c4[_0x3993('0x2d')][_0x3993('0x35')]);_0x32c80c[_0x3993('0x36')]=qs[_0x3993('0x2e')](_[_0x3993('0x37')](_0x2f52c4['query'],_0x4fd8d7[_0x3993('0x2e')]),_0x18880a);if(_0x2f52c4[_0x3993('0x2d')][_0x3993('0x38')]){_0x32c80c[_0x3993('0x36')]=_[_0x3993('0x39')](_0x32c80c[_0x3993('0x36')],{'$or':_[_0x3993('0x2c')](_0x18880a,function(_0xcd8a5){if(_0xcd8a5[_0x3993('0x2a')]!==_0x3993('0x3a')){var _0xcc03d7={};_0xcc03d7[_0xcd8a5[_0x3993('0x26')]]={'$like':'%'+_0x2f52c4[_0x3993('0x2d')][_0x3993('0x38')]+'%'};return _0xcc03d7;}})});}_0x32c80c=_[_0x3993('0x39')]({},_0x32c80c,_0x2f52c4[_0x3993('0x3b')]);var _0x5dbbd8={'where':_0x32c80c['where']};return db[_0x3993('0x28')][_0x3993('0x1a')](_0x5dbbd8)[_0x3993('0x22')](function(_0x89e478){_0x353ccc[_0x3993('0x1a')]=_0x89e478;if(_0x2f52c4[_0x3993('0x2d')]['includeAll']){_0x32c80c['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3993('0x3c')](_0x32c80c);})[_0x3993('0x22')](function(_0x575952){_0x353ccc[_0x3993('0x3d')]=_0x575952;return _0x353ccc;})[_0x3993('0x22')](respondWithFilteredResult(_0x1c7fe9,_0x32c80c))[_0x3993('0x3e')](handleError(_0x1c7fe9,null));};exports[_0x3993('0x3f')]=function(_0x48138e,_0x509cb0){var _0x3c7a47={'raw':![],'where':{'id':_0x48138e[_0x3993('0x40')]['id']}},_0x3a5512={};_0x3a5512[_0x3993('0x2b')]=_[_0x3993('0x41')](db['AnalyticFieldReport'][_0x3993('0x42')]);_0x3a5512[_0x3993('0x2d')]=_[_0x3993('0x41')](_0x48138e[_0x3993('0x2d')]);_0x3a5512[_0x3993('0x2e')]=_[_0x3993('0x2f')](_0x3a5512[_0x3993('0x2b')],_0x3a5512[_0x3993('0x2d')]);_0x3c7a47[_0x3993('0x30')]=_[_0x3993('0x2f')](_0x3a5512[_0x3993('0x2b')],qs['fields'](_0x48138e[_0x3993('0x2d')][_0x3993('0x31')]));_0x3c7a47[_0x3993('0x30')]=_0x3c7a47[_0x3993('0x30')][_0x3993('0x32')]?_0x3c7a47['attributes']:_0x3a5512[_0x3993('0x2b')];if(_0x48138e['query']['includeAll']){_0x3c7a47[_0x3993('0x43')]=[{'all':!![]}];}_0x3c7a47=_[_0x3993('0x39')]({},_0x3c7a47,_0x48138e['options']);return db['AnalyticFieldReport'][_0x3993('0x44')](_0x3c7a47)['then'](handleEntityNotFound(_0x509cb0,null))[_0x3993('0x22')](respondWithResult(_0x509cb0,null))['catch'](handleError(_0x509cb0,null));};exports[_0x3993('0x45')]=function(_0x321296,_0x22c169){return db[_0x3993('0x28')][_0x3993('0x45')](_0x321296[_0x3993('0x46')],{})['then'](respondWithResult(_0x22c169,0xc9))['catch'](handleError(_0x22c169,null));};exports[_0x3993('0x47')]=function(_0x1d0cc5,_0x46dc5a){return db[_0x3993('0x28')][_0x3993('0x47')](_0x1d0cc5[_0x3993('0x46')],{'raw':![],'individualHooks':!![]})[_0x3993('0x22')](respondWithResult(_0x46dc5a,0xc9))[_0x3993('0x3e')](handleError(_0x46dc5a,null));};exports[_0x3993('0x21')]=function(_0x18b243,_0x3c8f43){if(_0x18b243['body']['id']){delete _0x18b243[_0x3993('0x46')]['id'];}return db[_0x3993('0x28')]['find']({'where':{'id':_0x18b243[_0x3993('0x40')]['id']}})[_0x3993('0x22')](handleEntityNotFound(_0x3c8f43,null))['then'](saveUpdates(_0x18b243[_0x3993('0x46')],null))[_0x3993('0x22')](respondWithResult(_0x3c8f43,null))[_0x3993('0x3e')](handleError(_0x3c8f43,null));};exports[_0x3993('0x23')]=function(_0x18711a,_0x404931){return db[_0x3993('0x28')][_0x3993('0x44')]({'where':{'id':_0x18711a[_0x3993('0x40')]['id']}})['then'](handleEntityNotFound(_0x404931,null))[_0x3993('0x22')](removeEntity(_0x404931,null))[_0x3993('0x3e')](handleError(_0x404931,null));};exports[_0x3993('0x48')]=function(_0x49099d,_0x39c267){return db[_0x3993('0x28')]['destroy']({'where':{'id':_0x49099d[_0x3993('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x39c267,0xcc))[_0x3993('0x3e')](handleError(_0x39c267,null));};exports[_0x3993('0x49')]=function(_0x4eb387,_0x5ca468,_0x46c78d){return db['AnalyticCustomReport'][_0x3993('0x4a')]({'where':{'id':_0x4eb387[_0x3993('0x40')]['id']}})[_0x3993('0x22')](handleEntityNotFound(_0x5ca468,null))[_0x3993('0x22')](function(_0x1e4095){if(_0x1e4095){return db[_0x3993('0x4b')][_0x3993('0x4c')](function(_0x4840e7){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4eb387[_0x3993('0x40')]['id']},'transaction':_0x4840e7})['then'](function(_0x50be49){var _0x12b9c4=_[_0x3993('0x2c')](_0x4eb387['body'],function(_0x4a8571){delete _0x4a8571['id'];_0x4a8571[_0x3993('0x4d')]=_0x4eb387['params']['id'];return _0x4a8571;});return db[_0x3993('0x28')]['bulkCreate'](_0x12b9c4,{'transaction':_0x4840e7});});})[_0x3993('0x22')](function(){return db[_0x3993('0x28')][_0x3993('0x3c')]({'where':{'CustomReportId':_0x4eb387[_0x3993('0x40')]['id']}});});}})[_0x3993('0x22')](respondWithResult(_0x5ca468,null))[_0x3993('0x3e')](handleError(_0x5ca468,null));};
\ No newline at end of file
+var _0xe387=['AnalyticFieldReport','fieldName','key','model','keys','intersection','fields','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','rawAttributes','filters','length','options','find','create','bulkCreate','update','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe387,0x7e));var _0x7e38=function(_0x2d5ca8,_0x35e491){_0x2d5ca8=_0x2d5ca8-0x0;var _0x2dea00=_0xe387[_0x2d5ca8];return _0x2dea00;};'use strict';var emlformat=require(_0x7e38('0x0'));var rimraf=require(_0x7e38('0x1'));var zipdir=require(_0x7e38('0x2'));var jsonpatch=require(_0x7e38('0x3'));var rp=require('request-promise');var moment=require(_0x7e38('0x4'));var BPromise=require(_0x7e38('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e38('0x6'));var sox=require(_0x7e38('0x7'));var csv=require(_0x7e38('0x8'));var ejs=require(_0x7e38('0x9'));var fs=require('fs');var fs_extra=require(_0x7e38('0xa'));var _=require(_0x7e38('0xb'));var squel=require(_0x7e38('0xc'));var crypto=require(_0x7e38('0xd'));var jsforce=require(_0x7e38('0xe'));var deskjs=require(_0x7e38('0xf'));var toCsv=require(_0x7e38('0x8'));var querystring=require(_0x7e38('0x10'));var Papa=require(_0x7e38('0x11'));var Redis=require(_0x7e38('0x12'));var authService=require(_0x7e38('0x13'));var qs=require(_0x7e38('0x14'));var as=require(_0x7e38('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e38('0x16'))(_0x7e38('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7e38('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5d6d8,_0x36f3dd){_0x36f3dd=_0x36f3dd||0xcc;return function(_0x8e1b68){if(_0x8e1b68){return _0xa5d6d8[_0x7e38('0x19')](_0x36f3dd);}return _0xa5d6d8['status'](_0x36f3dd)[_0x7e38('0x1a')]();};}function respondWithResult(_0x2291fa,_0x11fa90){_0x11fa90=_0x11fa90||0xc8;return function(_0x32ea71){if(_0x32ea71){return _0x2291fa[_0x7e38('0x1b')](_0x11fa90)[_0x7e38('0x1c')](_0x32ea71);}};}function respondWithFilteredResult(_0xa571bb,_0x43b8f4){return function(_0x33b088){if(_0x33b088){var _0x7c48fa=typeof _0x43b8f4[_0x7e38('0x1d')]===_0x7e38('0x1e')&&typeof _0x43b8f4[_0x7e38('0x1f')]==='undefined';var _0xa5a008=_0x33b088['count'];var _0x5d63e9=_0x7c48fa?0x0:_0x43b8f4[_0x7e38('0x1d')];var _0x212d87=_0x7c48fa?_0x33b088[_0x7e38('0x20')]:_0x43b8f4['offset']+_0x43b8f4['limit'];var _0x423d73;if(_0x212d87>=_0xa5a008){_0x212d87=_0xa5a008;_0x423d73=0xc8;}else{_0x423d73=0xce;}_0xa571bb[_0x7e38('0x1b')](_0x423d73);return _0xa571bb[_0x7e38('0x21')](_0x7e38('0x22'),_0x5d63e9+'-'+_0x212d87+'/'+_0xa5a008)[_0x7e38('0x1c')](_0x33b088);}return null;};}function patchUpdates(_0x4ea295){return function(_0x3582d1){try{jsonpatch[_0x7e38('0x23')](_0x3582d1,_0x4ea295,!![]);}catch(_0x115352){return BPromise[_0x7e38('0x24')](_0x115352);}return _0x3582d1[_0x7e38('0x25')]();};}function saveUpdates(_0x2471e6,_0x2764bf){return function(_0x459093){if(_0x459093){return _0x459093['update'](_0x2471e6)[_0x7e38('0x26')](function(_0xcff430){return _0xcff430;});}return null;};}function removeEntity(_0x4b94e5,_0x25b9af){return function(_0x2f6fbe){if(_0x2f6fbe){return _0x2f6fbe[_0x7e38('0x27')]()[_0x7e38('0x26')](function(){_0x4b94e5[_0x7e38('0x1b')](0xcc)[_0x7e38('0x1a')]();});}};}function handleEntityNotFound(_0x4d5812,_0x1dbdda){return function(_0x25008c){if(!_0x25008c){_0x4d5812[_0x7e38('0x19')](0x194);}return _0x25008c;};}function handleError(_0x5c914d,_0x503389){_0x503389=_0x503389||0x1f4;return function(_0x5d8d75){logger[_0x7e38('0x28')](_0x5d8d75[_0x7e38('0x29')]);if(_0x5d8d75[_0x7e38('0x2a')]){delete _0x5d8d75[_0x7e38('0x2a')];}_0x5c914d[_0x7e38('0x1b')](_0x503389)[_0x7e38('0x2b')](_0x5d8d75);};}exports[_0x7e38('0x2c')]=function(_0x302d5e,_0x303561){var _0x32c6c4={},_0x53fc8d={},_0x22f05b={'count':0x0,'rows':[]};var _0x283cc3=_[_0x7e38('0x2d')](db[_0x7e38('0x2e')]['rawAttributes'],function(_0x4fd767){return{'name':_0x4fd767[_0x7e38('0x2f')],'type':_0x4fd767['type'][_0x7e38('0x30')]};});_0x53fc8d[_0x7e38('0x31')]=_[_0x7e38('0x2d')](_0x283cc3,_0x7e38('0x2a'));_0x53fc8d['query']=_[_0x7e38('0x32')](_0x302d5e['query']);_0x53fc8d['filters']=_[_0x7e38('0x33')](_0x53fc8d[_0x7e38('0x31')],_0x53fc8d['query']);_0x32c6c4['attributes']=_[_0x7e38('0x33')](_0x53fc8d[_0x7e38('0x31')],qs[_0x7e38('0x34')](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x34')]));_0x32c6c4[_0x7e38('0x36')]=_0x32c6c4[_0x7e38('0x36')]['length']?_0x32c6c4[_0x7e38('0x36')]:_0x53fc8d[_0x7e38('0x31')];if(!_0x302d5e['query'][_0x7e38('0x37')](_0x7e38('0x38'))){_0x32c6c4[_0x7e38('0x1f')]=qs[_0x7e38('0x1f')](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x1f')]);_0x32c6c4[_0x7e38('0x1d')]=qs[_0x7e38('0x1d')](_0x302d5e[_0x7e38('0x35')]['offset']);}_0x32c6c4[_0x7e38('0x39')]=qs['sort'](_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3a')]);_0x32c6c4[_0x7e38('0x3b')]=qs['filters'](_[_0x7e38('0x3c')](_0x302d5e['query'],_0x53fc8d['filters']),_0x283cc3);if(_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3d')]){_0x32c6c4[_0x7e38('0x3b')]=_[_0x7e38('0x3e')](_0x32c6c4['where'],{'$or':_[_0x7e38('0x2d')](_0x283cc3,function(_0x12caeb){if(_0x12caeb[_0x7e38('0x3f')]!==_0x7e38('0x40')){var _0x330696={};_0x330696[_0x12caeb[_0x7e38('0x2a')]]={'$like':'%'+_0x302d5e[_0x7e38('0x35')][_0x7e38('0x3d')]+'%'};return _0x330696;}})});}_0x32c6c4=_[_0x7e38('0x3e')]({},_0x32c6c4,_0x302d5e['options']);var _0x4e53cf={'where':_0x32c6c4[_0x7e38('0x3b')]};return db[_0x7e38('0x2e')]['count'](_0x4e53cf)[_0x7e38('0x26')](function(_0x1ad7ac){_0x22f05b[_0x7e38('0x20')]=_0x1ad7ac;if(_0x302d5e[_0x7e38('0x35')][_0x7e38('0x41')]){_0x32c6c4[_0x7e38('0x42')]=[{'all':!![]}];}return db[_0x7e38('0x2e')]['findAll'](_0x32c6c4);})[_0x7e38('0x26')](function(_0x238d60){_0x22f05b[_0x7e38('0x43')]=_0x238d60;return _0x22f05b;})[_0x7e38('0x26')](respondWithFilteredResult(_0x303561,_0x32c6c4))[_0x7e38('0x44')](handleError(_0x303561,null));};exports['show']=function(_0x374fef,_0x7417c2){var _0x44e1d3={'raw':![],'where':{'id':_0x374fef['params']['id']}},_0x31189c={};_0x31189c['model']=_[_0x7e38('0x32')](db[_0x7e38('0x2e')][_0x7e38('0x45')]);_0x31189c['query']=_[_0x7e38('0x32')](_0x374fef[_0x7e38('0x35')]);_0x31189c[_0x7e38('0x46')]=_['intersection'](_0x31189c[_0x7e38('0x31')],_0x31189c[_0x7e38('0x35')]);_0x44e1d3[_0x7e38('0x36')]=_[_0x7e38('0x33')](_0x31189c[_0x7e38('0x31')],qs[_0x7e38('0x34')](_0x374fef[_0x7e38('0x35')][_0x7e38('0x34')]));_0x44e1d3[_0x7e38('0x36')]=_0x44e1d3[_0x7e38('0x36')][_0x7e38('0x47')]?_0x44e1d3[_0x7e38('0x36')]:_0x31189c[_0x7e38('0x31')];if(_0x374fef[_0x7e38('0x35')][_0x7e38('0x41')]){_0x44e1d3['include']=[{'all':!![]}];}_0x44e1d3=_[_0x7e38('0x3e')]({},_0x44e1d3,_0x374fef[_0x7e38('0x48')]);return db['AnalyticFieldReport'][_0x7e38('0x49')](_0x44e1d3)[_0x7e38('0x26')](handleEntityNotFound(_0x7417c2,null))[_0x7e38('0x26')](respondWithResult(_0x7417c2,null))[_0x7e38('0x44')](handleError(_0x7417c2,null));};exports[_0x7e38('0x4a')]=function(_0x3691c8,_0x556e86){return db[_0x7e38('0x2e')][_0x7e38('0x4a')](_0x3691c8['body'],{})[_0x7e38('0x26')](respondWithResult(_0x556e86,0xc9))['catch'](handleError(_0x556e86,null));};exports[_0x7e38('0x4b')]=function(_0x10466d,_0x587081){return db[_0x7e38('0x2e')][_0x7e38('0x4b')](_0x10466d['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x587081,0xc9))[_0x7e38('0x44')](handleError(_0x587081,null));};exports[_0x7e38('0x4c')]=function(_0x46bd24,_0x136af8){if(_0x46bd24[_0x7e38('0x4d')]['id']){delete _0x46bd24[_0x7e38('0x4d')]['id'];}return db[_0x7e38('0x2e')][_0x7e38('0x49')]({'where':{'id':_0x46bd24['params']['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x136af8,null))['then'](saveUpdates(_0x46bd24['body'],null))[_0x7e38('0x26')](respondWithResult(_0x136af8,null))['catch'](handleError(_0x136af8,null));};exports[_0x7e38('0x27')]=function(_0x2dc8e2,_0x29c8d6){return db[_0x7e38('0x2e')]['find']({'where':{'id':_0x2dc8e2[_0x7e38('0x4e')]['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x29c8d6,null))[_0x7e38('0x26')](removeEntity(_0x29c8d6,null))['catch'](handleError(_0x29c8d6,null));};exports[_0x7e38('0x4f')]=function(_0x28476f,_0x1d33da){return db['AnalyticFieldReport'][_0x7e38('0x27')]({'where':{'id':_0x28476f[_0x7e38('0x35')][_0x7e38('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1d33da,0xcc))[_0x7e38('0x44')](handleError(_0x1d33da,null));};exports[_0x7e38('0x51')]=function(_0x2bcffb,_0x3e47ec,_0x1150ac){return db[_0x7e38('0x52')]['findOne']({'where':{'id':_0x2bcffb[_0x7e38('0x4e')]['id']}})[_0x7e38('0x26')](handleEntityNotFound(_0x3e47ec,null))[_0x7e38('0x26')](function(_0x183977){if(_0x183977){return db['sequelize'][_0x7e38('0x53')](function(_0x12e41e){return db[_0x7e38('0x2e')][_0x7e38('0x27')]({'where':{'CustomReportId':_0x2bcffb[_0x7e38('0x4e')]['id']},'transaction':_0x12e41e})[_0x7e38('0x26')](function(_0x126190){var _0xfc652c=_['map'](_0x2bcffb[_0x7e38('0x4d')],function(_0x10c311){delete _0x10c311['id'];_0x10c311[_0x7e38('0x54')]=_0x2bcffb[_0x7e38('0x4e')]['id'];return _0x10c311;});return db['AnalyticFieldReport'][_0x7e38('0x4b')](_0xfc652c,{'transaction':_0x12e41e});});})[_0x7e38('0x26')](function(){return db[_0x7e38('0x2e')][_0x7e38('0x55')]({'where':{'CustomReportId':_0x2bcffb['params']['id']}});});}})[_0x7e38('0x26')](respondWithResult(_0x3e47ec,null))[_0x7e38('0x44')](handleError(_0x3e47ec,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3917ac2..cef031b 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 _0x5144=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x56b030,_0x16defc){var _0x3fecc0=function(_0x3cbef9){while(--_0x3cbef9){_0x56b030['push'](_0x56b030['shift']());}};_0x3fecc0(++_0x16defc);}(_0x5144,0x1d4));var _0x4514=function(_0x54d561,_0x18b976){_0x54d561=_0x54d561-0x0;var _0x508f1e=_0x5144[_0x54d561];return _0x508f1e;};'use strict';var _=require(_0x4514('0x0'));var util=require(_0x4514('0x1'));var logger=require(_0x4514('0x2'))('api');var moment=require(_0x4514('0x3'));var BPromise=require(_0x4514('0x4'));var rp=require(_0x4514('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4514('0x6'));var config=require(_0x4514('0x7'));var attributes=require(_0x4514('0x8'));module[_0x4514('0x9')]=function(_0x3ef01d,_0x403405){return _0x3ef01d[_0x4514('0xa')](_0x4514('0xb'),attributes,{'tableName':_0x4514('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10d5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x10d5,0xc2));var _0x510d=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x10d5[_0xa8883];return _0x479426;};'use strict';var _=require(_0x510d('0x0'));var util=require(_0x510d('0x1'));var logger=require(_0x510d('0x2'))(_0x510d('0x3'));var moment=require(_0x510d('0x4'));var BPromise=require(_0x510d('0x5'));var rp=require(_0x510d('0x6'));var fs=require('fs');var path=require(_0x510d('0x7'));var rimraf=require(_0x510d('0x8'));var config=require(_0x510d('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0x510d('0xa')]=function(_0x476086,_0x56bb97){return _0x476086[_0x510d('0xb')](_0x510d('0xc'),attributes,{'tableName':_0x510d('0xd'),'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 c427e0e..c7a27db 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 _0xa3eb=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa3eb,0x14f));var _0xba3e=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xa3eb[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var moment=require('moment');var BPromise=require(_0xba3e('0x2'));var rs=require(_0xba3e('0x3'));var fs=require('fs');var Redis=require(_0xba3e('0x4'));var db=require(_0xba3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba3e('0x6'))(_0xba3e('0x7'));var config=require(_0xba3e('0x8'));var jayson=require(_0xba3e('0x9'));var client=jayson[_0xba3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15b0dc,_0x30a64b,_0x17b564){return new BPromise(function(_0x50944f,_0x1ef043){return client[_0xba3e('0xb')](_0x15b0dc,_0x17b564)[_0xba3e('0xc')](function(_0x90aa8a){logger['info'](_0xba3e('0xd'),_0x30a64b,_0xba3e('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x30a64b,'request\x20sent',JSON[_0xba3e('0xf')](_0x90aa8a));if(_0x90aa8a[_0xba3e('0x10')]){if(_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x11')]===0x1f4){logger['error'](_0xba3e('0xd'),_0x30a64b,_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x12')]);return _0x1ef043(_0x90aa8a[_0xba3e('0x10')]['message']);}logger[_0xba3e('0x10')](_0xba3e('0xd'),_0x30a64b,_0x90aa8a[_0xba3e('0x10')]['message']);return _0x50944f(_0x90aa8a[_0xba3e('0x10')][_0xba3e('0x12')]);}else{logger['info'](_0xba3e('0xd'),_0x30a64b,_0xba3e('0xe'));_0x50944f(_0x90aa8a[_0xba3e('0x13')]['message']);}})[_0xba3e('0x14')](function(_0xd422e){logger['error'](_0xba3e('0xd'),_0x30a64b,_0xd422e);_0x1ef043(_0xd422e);});});}
\ No newline at end of file
+var _0xce27=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x4bc591,_0x51c82a){var _0x7e5129=function(_0xda5f10){while(--_0xda5f10){_0x4bc591['push'](_0x4bc591['shift']());}};_0x7e5129(++_0x51c82a);}(_0xce27,0x13b));var _0x7ce2=function(_0x11d19a,_0x2f075c){_0x11d19a=_0x11d19a-0x0;var _0xb8b113=_0xce27[_0x11d19a];return _0xb8b113;};'use strict';var _=require(_0x7ce2('0x0'));var util=require(_0x7ce2('0x1'));var moment=require('moment');var BPromise=require(_0x7ce2('0x2'));var rs=require(_0x7ce2('0x3'));var fs=require('fs');var Redis=require(_0x7ce2('0x4'));var db=require(_0x7ce2('0x5'))['db'];var utils=require(_0x7ce2('0x6'));var logger=require('../../config/logger')(_0x7ce2('0x7'));var config=require(_0x7ce2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7ce2('0x9')][_0x7ce2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dcc01,_0x3b1eaa,_0x3bb23a){return new BPromise(function(_0x1400c1,_0xc8f0a1){return client['request'](_0x3dcc01,_0x3bb23a)['then'](function(_0x3f1b08){logger['info'](_0x7ce2('0xb'),_0x3b1eaa,_0x7ce2('0xc'));logger[_0x7ce2('0xd')](_0x7ce2('0xe'),_0x3b1eaa,_0x7ce2('0xc'),JSON[_0x7ce2('0xf')](_0x3f1b08));if(_0x3f1b08[_0x7ce2('0x10')]){if(_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x11')]===0x1f4){logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3f1b08['error'][_0x7ce2('0x12')]);return _0xc8f0a1(_0x3f1b08['error'][_0x7ce2('0x12')]);}logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x12')]);return _0x1400c1(_0x3f1b08[_0x7ce2('0x10')][_0x7ce2('0x12')]);}else{logger[_0x7ce2('0x13')](_0x7ce2('0xb'),_0x3b1eaa,_0x7ce2('0xc'));_0x1400c1(_0x3f1b08['result'][_0x7ce2('0x12')]);}})[_0x7ce2('0x14')](function(_0x3c552b){logger[_0x7ce2('0x10')](_0x7ce2('0xb'),_0x3b1eaa,_0x3c552b);_0xc8f0a1(_0x3c552b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ef74b39..60160c3 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(_0x55281e,_0x5d57c4){var _0x139bd6=function(_0x2684ee){while(--_0x2684ee){_0x55281e['push'](_0x55281e['shift']());}};_0x139bd6(++_0x5d57c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x4375aa,_0x166edf){var _0x120fdf=function(_0x366807){while(--_0x366807){_0x4375aa['push'](_0x4375aa['shift']());}};_0x120fdf(++_0x166edf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 2d4f215..937500a 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 _0xac7f=['STRING','name','sequelize'];(function(_0x100358,_0x1388d4){var _0x22e1d0=function(_0x14bf53){while(--_0x14bf53){_0x100358['push'](_0x100358['shift']());}};_0x22e1d0(++_0x1388d4);}(_0xac7f,0x1e2));var _0xfac7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xac7f[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0xfac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xfac7('0x1')],'allowNull':![],'unique':_0xfac7('0x2')},'table':{'type':Sequelize[_0xfac7('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfac7('0x1')]}};
\ No newline at end of file
+var _0x56bd=['TEXT','exports','STRING','name'];(function(_0x4fcd26,_0x38243d){var _0x4076c6=function(_0x18958f){while(--_0x18958f){_0x4fcd26['push'](_0x4fcd26['shift']());}};_0x4076c6(++_0x38243d);}(_0x56bd,0xe9));var _0xd56b=function(_0x3462f4,_0x151dc1){_0x3462f4=_0x3462f4-0x0;var _0xe06930=_0x56bd[_0x3462f4];return _0xe06930;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'name':{'type':Sequelize[_0xd56b('0x1')],'allowNull':![],'unique':_0xd56b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd56b('0x3')]},'description':{'type':Sequelize[_0xd56b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index db7f31a..6ff8f66 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 _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x5dc9f5,_0x5362c7){var _0x4faea5=function(_0x5e2d0d){while(--_0x5e2d0d){_0x5dc9f5['push'](_0x5dc9f5['shift']());}};_0x4faea5(++_0x5362c7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x140db8,_0x110d14){_0x140db8=_0x140db8-0x0;var _0x123ebf=_0x8d0e[_0x140db8];return _0x123ebf;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d23991b..fd52989 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 _0x9b69=['../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x3bf3d5,_0x16a802){var _0x51dee1=function(_0x36b773){while(--_0x36b773){_0x3bf3d5['push'](_0x3bf3d5['shift']());}};_0x51dee1(++_0x16a802);}(_0x9b69,0xa3));var _0x99b6=function(_0x14f154,_0x327c57){_0x14f154=_0x14f154-0x0;var _0x3fd3c0=_0x9b69[_0x14f154];return _0x3fd3c0;};'use strict';var _=require(_0x99b6('0x0'));var util=require(_0x99b6('0x1'));var logger=require(_0x99b6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x99b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b6('0x4'));var rimraf=require(_0x99b6('0x5'));var config=require(_0x99b6('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x99b6('0x7')]=function(_0x5c4062,_0xbcd357){return _0x5c4062[_0x99b6('0x8')](_0x99b6('0x9'),attributes,{'tableName':_0x99b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2cd0=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','moment','path','rimraf'];(function(_0x130c67,_0x5dcc79){var _0x4e06c7=function(_0x122ea9){while(--_0x122ea9){_0x130c67['push'](_0x130c67['shift']());}};_0x4e06c7(++_0x5dcc79);}(_0x2cd0,0x8a));var _0x02cd=function(_0x30638f,_0x33b6ec){_0x30638f=_0x30638f-0x0;var _0xed4d2=_0x2cd0[_0x30638f];return _0xed4d2;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x02cd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02cd('0x3'));var rimraf=require(_0x02cd('0x4'));var config=require(_0x02cd('0x5'));var attributes=require(_0x02cd('0x6'));module[_0x02cd('0x7')]=function(_0x35144b,_0x222904){return _0x35144b[_0x02cd('0x8')](_0x02cd('0x9'),attributes,{'tableName':_0x02cd('0xa'),'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 ef4b4e6..0daced3 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 _0xb1cc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','lodash','util','moment'];(function(_0x1d6cc1,_0x3b9927){var _0x224ecb=function(_0x5d5c08){while(--_0x5d5c08){_0x1d6cc1['push'](_0x1d6cc1['shift']());}};_0x224ecb(++_0x3b9927);}(_0xb1cc,0x131));var _0xcb1c=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb1cc[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xcb1c('0x0'));var util=require(_0xcb1c('0x1'));var moment=require(_0xcb1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb1c('0x3'));var fs=require('fs');var Redis=require(_0xcb1c('0x4'));var db=require(_0xcb1c('0x5'))['db'];var utils=require(_0xcb1c('0x6'));var logger=require(_0xcb1c('0x7'))(_0xcb1c('0x8'));var config=require(_0xcb1c('0x9'));var jayson=require(_0xcb1c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x541324,_0x382b65,_0x2bfc6a){return new BPromise(function(_0x259ae9,_0x444e5e){return client[_0xcb1c('0xb')](_0x541324,_0x2bfc6a)[_0xcb1c('0xc')](function(_0x3352a0){logger[_0xcb1c('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'));logger[_0xcb1c('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'),JSON[_0xcb1c('0x10')](_0x3352a0));if(_0x3352a0[_0xcb1c('0x11')]){if(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x12')]===0x1f4){logger[_0xcb1c('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);return _0x444e5e(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);}logger['error'](_0xcb1c('0x14'),_0x382b65,_0x3352a0[_0xcb1c('0x11')]['message']);return _0x259ae9(_0x3352a0[_0xcb1c('0x11')][_0xcb1c('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x382b65,_0xcb1c('0xe'));_0x259ae9(_0x3352a0[_0xcb1c('0x15')][_0xcb1c('0x13')]);}})['catch'](function(_0xcd595e){logger[_0xcb1c('0x11')](_0xcb1c('0x14'),_0x382b65,_0xcd595e);_0x444e5e(_0xcd595e);});});}
\ No newline at end of file
+var _0x13f8=['code','message','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x94dd49,_0x2661bc){var _0x44571f=function(_0x397528){while(--_0x397528){_0x94dd49['push'](_0x94dd49['shift']());}};_0x44571f(++_0x2661bc);}(_0x13f8,0x66));var _0x813f=function(_0x4c566d,_0x3c7b50){_0x4c566d=_0x4c566d-0x0;var _0x4b5f8d=_0x13f8[_0x4c566d];return _0x4b5f8d;};'use strict';var _=require(_0x813f('0x0'));var util=require('util');var moment=require(_0x813f('0x1'));var BPromise=require('bluebird');var rs=require(_0x813f('0x2'));var fs=require('fs');var Redis=require(_0x813f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x813f('0x4'))(_0x813f('0x5'));var config=require('../../config/environment');var jayson=require(_0x813f('0x6'));var client=jayson[_0x813f('0x7')][_0x813f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ed54f,_0x401242,_0x2ca373){return new BPromise(function(_0x75b783,_0x1270fa){return client[_0x813f('0x9')](_0x2ed54f,_0x2ca373)[_0x813f('0xa')](function(_0x53d1e1){logger[_0x813f('0xb')](_0x813f('0xc'),_0x401242,_0x813f('0xd'));logger[_0x813f('0xe')](_0x813f('0xf'),_0x401242,_0x813f('0xd'),JSON[_0x813f('0x10')](_0x53d1e1));if(_0x53d1e1[_0x813f('0x11')]){if(_0x53d1e1[_0x813f('0x11')][_0x813f('0x12')]===0x1f4){logger[_0x813f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x401242,_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);return _0x1270fa(_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);}logger[_0x813f('0x11')](_0x813f('0xc'),_0x401242,_0x53d1e1['error'][_0x813f('0x13')]);return _0x75b783(_0x53d1e1[_0x813f('0x11')][_0x813f('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x401242,'request\x20sent');_0x75b783(_0x53d1e1['result'][_0x813f('0x13')]);}})['catch'](function(_0x19c9ca){logger[_0x813f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x401242,_0x19c9ca);_0x1270fa(_0x19c9ca);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 8796683..7a77c73 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 _0x00e0=['put','update','delete','multer','util','path','express','fs-extra','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x1e3));var _0x000e=function(_0x5ac43a,_0x3d47d3){_0x5ac43a=_0x5ac43a-0x0;var _0x55530e=_0x00e0[_0x5ac43a];return _0x55530e;};'use strict';var multer=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var path=require(_0x000e('0x2'));var timeout=require('connect-timeout');var express=require(_0x000e('0x3'));var router=express['Router']();var fs_extra=require(_0x000e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x000e('0x5')]('/',auth[_0x000e('0x6')](),controller['index']);router[_0x000e('0x5')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0x8')]);router['post']('/',auth[_0x000e('0x6')](),controller['create']);router[_0x000e('0x9')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0xa')]);router[_0x000e('0xb')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x63b6=['get','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x273a8b,_0x2c8482){var _0x3264c0=function(_0x3ae50e){while(--_0x3ae50e){_0x273a8b['push'](_0x273a8b['shift']());}};_0x3264c0(++_0x2c8482);}(_0x63b6,0x127));var _0x663b=function(_0x9b24a5,_0x47c37a){_0x9b24a5=_0x9b24a5-0x0;var _0x3f4434=_0x63b6[_0x9b24a5];return _0x3f4434;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require('connect-timeout');var express=require(_0x663b('0x3'));var router=express['Router']();var fs_extra=require(_0x663b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var controller=require(_0x663b('0x7'));router['get']('/',auth[_0x663b('0x8')](),controller['index']);router[_0x663b('0x9')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0x8')](),controller[_0x663b('0xc')]);router[_0x663b('0xd')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xe')]);router[_0x663b('0xf')](_0x663b('0x10'),auth[_0x663b('0x8')](),controller[_0x663b('0x11')]);module[_0x663b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a16c571..265243d 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 _0x783c=['TEXT','sequelize','exports'];(function(_0x50d027,_0x1845f6){var _0x39172d=function(_0x11a428){while(--_0x11a428){_0x50d027['push'](_0x50d027['shift']());}};_0x39172d(++_0x1845f6);}(_0x783c,0x94));var _0xc783=function(_0x56260c,_0x203125){_0x56260c=_0x56260c-0x0;var _0x5e36ce=_0x783c[_0x56260c];return _0x5e36ce;};'use strict';var Sequelize=require(_0xc783('0x0'));module[_0xc783('0x1')]={'tree':{'type':Sequelize[_0xc783('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xe102=['sequelize','exports'];(function(_0x18a4eb,_0x1a6f5c){var _0x4ca102=function(_0x15b047){while(--_0x15b047){_0x18a4eb['push'](_0x18a4eb['shift']());}};_0x4ca102(++_0x1a6f5c);}(_0xe102,0x156));var _0x2e10=function(_0x1079cf,_0x2014d8){_0x1079cf=_0x1079cf-0x0;var _0x564336=_0xe102[_0x1079cf];return _0x564336;};'use strict';var Sequelize=require(_0x2e10('0x0'));module[_0x2e10('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 97695c4..35ac325 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 _0x6a1e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','error','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x369ee0,_0x57a15c){var _0x493a06=function(_0x570aaf){while(--_0x570aaf){_0x369ee0['push'](_0x369ee0['shift']());}};_0x493a06(++_0x57a15c);}(_0x6a1e,0x124));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6a1('0x0'));var rimraf=require(_0xe6a1('0x1'));var zipdir=require(_0xe6a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6a1('0x3'));var moment=require(_0xe6a1('0x4'));var BPromise=require(_0xe6a1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe6a1('0x6'));var sox=require(_0xe6a1('0x7'));var csv=require(_0xe6a1('0x8'));var ejs=require(_0xe6a1('0x9'));var fs=require('fs');var fs_extra=require(_0xe6a1('0xa'));var _=require(_0xe6a1('0xb'));var squel=require(_0xe6a1('0xc'));var crypto=require(_0xe6a1('0xd'));var jsforce=require(_0xe6a1('0xe'));var deskjs=require(_0xe6a1('0xf'));var toCsv=require(_0xe6a1('0x8'));var querystring=require(_0xe6a1('0x10'));var Papa=require(_0xe6a1('0x11'));var Redis=require(_0xe6a1('0x12'));var authService=require(_0xe6a1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe6a1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6a1('0x15'))('api');var utils=require(_0xe6a1('0x16'));var config=require(_0xe6a1('0x17'));var licenseUtil=require(_0xe6a1('0x18'));var db=require(_0xe6a1('0x19'))['db'];function respondWithStatusCode(_0x341081,_0x2a7d98){_0x2a7d98=_0x2a7d98||0xcc;return function(_0x7ec6bf){if(_0x7ec6bf){return _0x341081[_0xe6a1('0x1a')](_0x2a7d98);}return _0x341081[_0xe6a1('0x1b')](_0x2a7d98)['end']();};}function respondWithResult(_0x19b941,_0x3b838d){_0x3b838d=_0x3b838d||0xc8;return function(_0x5dc1ad){if(_0x5dc1ad){return _0x19b941['status'](_0x3b838d)[_0xe6a1('0x1c')](_0x5dc1ad);}};}function respondWithFilteredResult(_0x175c74,_0x1c3468){return function(_0x1977f5){if(_0x1977f5){var _0x49d127=typeof _0x1c3468[_0xe6a1('0x1d')]==='undefined'&&typeof _0x1c3468['limit']===_0xe6a1('0x1e');var _0x53d41b=_0x1977f5[_0xe6a1('0x1f')];var _0x612f4d=_0x49d127?0x0:_0x1c3468[_0xe6a1('0x1d')];var _0x2deebb=_0x49d127?_0x1977f5[_0xe6a1('0x1f')]:_0x1c3468[_0xe6a1('0x1d')]+_0x1c3468['limit'];var _0x1e0c4c;if(_0x2deebb>=_0x53d41b){_0x2deebb=_0x53d41b;_0x1e0c4c=0xc8;}else{_0x1e0c4c=0xce;}_0x175c74[_0xe6a1('0x1b')](_0x1e0c4c);return _0x175c74[_0xe6a1('0x20')](_0xe6a1('0x21'),_0x612f4d+'-'+_0x2deebb+'/'+_0x53d41b)[_0xe6a1('0x1c')](_0x1977f5);}return null;};}function patchUpdates(_0x2df25a){return function(_0x55f538){try{jsonpatch[_0xe6a1('0x22')](_0x55f538,_0x2df25a,!![]);}catch(_0x30ba1d){return BPromise['reject'](_0x30ba1d);}return _0x55f538['save']();};}function saveUpdates(_0x58ec46,_0x3b6081){return function(_0x2d2acf){if(_0x2d2acf){return _0x2d2acf[_0xe6a1('0x23')](_0x58ec46)[_0xe6a1('0x24')](function(_0x5b2198){return _0x5b2198;});}return null;};}function removeEntity(_0x5d3754,_0x282e0b){return function(_0x57b7aa){if(_0x57b7aa){return _0x57b7aa[_0xe6a1('0x25')]()[_0xe6a1('0x24')](function(){_0x5d3754[_0xe6a1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6058,_0xc047a8){return function(_0xe20304){if(!_0xe20304){_0x2f6058[_0xe6a1('0x1a')](0x194);}return _0xe20304;};}function handleError(_0x392c93,_0x28cee5){_0x28cee5=_0x28cee5||0x1f4;return function(_0x463515){logger[_0xe6a1('0x26')](_0x463515['stack']);if(_0x463515['name']){delete _0x463515['name'];}_0x392c93[_0xe6a1('0x1b')](_0x28cee5)[_0xe6a1('0x27')](_0x463515);};}exports[_0xe6a1('0x28')]=function(_0x321e9b,_0x2132f4){var _0x4468c7={},_0x1d74e1={},_0x182cc8={'count':0x0,'rows':[]};var _0x452536=_['map'](db[_0xe6a1('0x29')][_0xe6a1('0x2a')],function(_0x21f434){return{'name':_0x21f434[_0xe6a1('0x2b')],'type':_0x21f434[_0xe6a1('0x2c')][_0xe6a1('0x2d')]};});_0x1d74e1[_0xe6a1('0x2e')]=_[_0xe6a1('0x2f')](_0x452536,_0xe6a1('0x30'));_0x1d74e1['query']=_[_0xe6a1('0x31')](_0x321e9b[_0xe6a1('0x32')]);_0x1d74e1[_0xe6a1('0x33')]=_[_0xe6a1('0x34')](_0x1d74e1['model'],_0x1d74e1['query']);_0x4468c7[_0xe6a1('0x35')]=_[_0xe6a1('0x34')](_0x1d74e1['model'],qs[_0xe6a1('0x36')](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x36')]));_0x4468c7[_0xe6a1('0x35')]=_0x4468c7[_0xe6a1('0x35')][_0xe6a1('0x37')]?_0x4468c7[_0xe6a1('0x35')]:_0x1d74e1['model'];if(!_0x321e9b['query'][_0xe6a1('0x38')](_0xe6a1('0x39'))){_0x4468c7['limit']=qs['limit'](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x3a')]);_0x4468c7['offset']=qs[_0xe6a1('0x1d')](_0x321e9b[_0xe6a1('0x32')][_0xe6a1('0x1d')]);}_0x4468c7[_0xe6a1('0x3b')]=qs[_0xe6a1('0x3c')](_0x321e9b['query']['sort']);_0x4468c7[_0xe6a1('0x3d')]=qs[_0xe6a1('0x33')](_['pick'](_0x321e9b[_0xe6a1('0x32')],_0x1d74e1[_0xe6a1('0x33')]),_0x452536);if(_0x321e9b['query'][_0xe6a1('0x3e')]){_0x4468c7[_0xe6a1('0x3d')]=_[_0xe6a1('0x3f')](_0x4468c7[_0xe6a1('0x3d')],{'$or':_[_0xe6a1('0x2f')](_0x452536,function(_0x43972e){if(_0x43972e[_0xe6a1('0x2c')]!==_0xe6a1('0x40')){var _0x6109f6={};_0x6109f6[_0x43972e[_0xe6a1('0x30')]]={'$like':'%'+_0x321e9b[_0xe6a1('0x32')]['filter']+'%'};return _0x6109f6;}})});}_0x4468c7=_[_0xe6a1('0x3f')]({},_0x4468c7,_0x321e9b[_0xe6a1('0x41')]);var _0x12279a={'where':_0x4468c7[_0xe6a1('0x3d')]};return db['AnalyticTreeReport'][_0xe6a1('0x1f')](_0x12279a)[_0xe6a1('0x24')](function(_0x3bd511){_0x182cc8[_0xe6a1('0x1f')]=_0x3bd511;if(_0x321e9b['query'][_0xe6a1('0x42')]){_0x4468c7[_0xe6a1('0x43')]=[{'all':!![]}];}return db[_0xe6a1('0x29')][_0xe6a1('0x44')](_0x4468c7);})[_0xe6a1('0x24')](function(_0x247502){_0x182cc8[_0xe6a1('0x45')]=_0x247502;return _0x182cc8;})[_0xe6a1('0x24')](respondWithFilteredResult(_0x2132f4,_0x4468c7))['catch'](handleError(_0x2132f4,null));};exports[_0xe6a1('0x46')]=function(_0x6b9409,_0x1d45af){var _0x3cb72d={'raw':!![],'where':{'id':_0x6b9409[_0xe6a1('0x47')]['id']}},_0x25eb10={};_0x25eb10[_0xe6a1('0x2e')]=_[_0xe6a1('0x31')](db['AnalyticTreeReport'][_0xe6a1('0x2a')]);_0x25eb10[_0xe6a1('0x32')]=_[_0xe6a1('0x31')](_0x6b9409['query']);_0x25eb10[_0xe6a1('0x33')]=_[_0xe6a1('0x34')](_0x25eb10[_0xe6a1('0x2e')],_0x25eb10[_0xe6a1('0x32')]);_0x3cb72d[_0xe6a1('0x35')]=_['intersection'](_0x25eb10[_0xe6a1('0x2e')],qs[_0xe6a1('0x36')](_0x6b9409['query'][_0xe6a1('0x36')]));_0x3cb72d[_0xe6a1('0x35')]=_0x3cb72d['attributes'][_0xe6a1('0x37')]?_0x3cb72d['attributes']:_0x25eb10[_0xe6a1('0x2e')];if(_0x6b9409[_0xe6a1('0x32')][_0xe6a1('0x42')]){_0x3cb72d[_0xe6a1('0x43')]=[{'all':!![]}];}_0x3cb72d=_[_0xe6a1('0x3f')]({},_0x3cb72d,_0x6b9409[_0xe6a1('0x41')]);return db[_0xe6a1('0x29')]['find'](_0x3cb72d)[_0xe6a1('0x24')](handleEntityNotFound(_0x1d45af,null))['then'](respondWithResult(_0x1d45af,null))['catch'](handleError(_0x1d45af,null));};exports[_0xe6a1('0x48')]=function(_0x5a27d4,_0x41f8ac){return db[_0xe6a1('0x29')]['create'](_0x5a27d4[_0xe6a1('0x49')],{})[_0xe6a1('0x24')](respondWithResult(_0x41f8ac,0xc9))[_0xe6a1('0x4a')](handleError(_0x41f8ac,null));};exports[_0xe6a1('0x23')]=function(_0x61f24a,_0x14139c){if(_0x61f24a[_0xe6a1('0x49')]['id']){delete _0x61f24a[_0xe6a1('0x49')]['id'];}return db[_0xe6a1('0x29')][_0xe6a1('0x4b')]({'where':{'id':_0x61f24a['params']['id']}})[_0xe6a1('0x24')](handleEntityNotFound(_0x14139c,null))[_0xe6a1('0x24')](saveUpdates(_0x61f24a[_0xe6a1('0x49')],null))[_0xe6a1('0x24')](respondWithResult(_0x14139c,null))[_0xe6a1('0x4a')](handleError(_0x14139c,null));};exports[_0xe6a1('0x25')]=function(_0x3bce91,_0x305a4e){return db[_0xe6a1('0x29')]['find']({'where':{'id':_0x3bce91[_0xe6a1('0x47')]['id']}})[_0xe6a1('0x24')](handleEntityNotFound(_0x305a4e,null))[_0xe6a1('0x24')](removeEntity(_0x305a4e,null))[_0xe6a1('0x4a')](handleError(_0x305a4e,null));};
\ No newline at end of file
+var _0x09b5=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3b0215,_0x5463b3){var _0x135ffa=function(_0x191ee9){while(--_0x191ee9){_0x3b0215['push'](_0x3b0215['shift']());}};_0x135ffa(++_0x5463b3);}(_0x09b5,0x1bc));var _0x509b=function(_0x21a4d4,_0x2f8fe4){_0x21a4d4=_0x21a4d4-0x0;var _0x107024=_0x09b5[_0x21a4d4];return _0x107024;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x509b('0x0'));var zipdir=require(_0x509b('0x1'));var jsonpatch=require(_0x509b('0x2'));var rp=require(_0x509b('0x3'));var moment=require(_0x509b('0x4'));var BPromise=require(_0x509b('0x5'));var Mustache=require(_0x509b('0x6'));var util=require(_0x509b('0x7'));var path=require(_0x509b('0x8'));var sox=require('sox');var csv=require(_0x509b('0x9'));var ejs=require(_0x509b('0xa'));var fs=require('fs');var fs_extra=require(_0x509b('0xb'));var _=require(_0x509b('0xc'));var squel=require(_0x509b('0xd'));var crypto=require(_0x509b('0xe'));var jsforce=require(_0x509b('0xf'));var deskjs=require(_0x509b('0x10'));var toCsv=require(_0x509b('0x9'));var querystring=require(_0x509b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x509b('0x12'));var qs=require(_0x509b('0x13'));var as=require(_0x509b('0x14'));var hardwareService=require(_0x509b('0x15'));var logger=require(_0x509b('0x16'))(_0x509b('0x17'));var utils=require(_0x509b('0x18'));var config=require(_0x509b('0x19'));var licenseUtil=require(_0x509b('0x1a'));var db=require(_0x509b('0x1b'))['db'];function respondWithStatusCode(_0x3ca961,_0x3281ac){_0x3281ac=_0x3281ac||0xcc;return function(_0x5615a4){if(_0x5615a4){return _0x3ca961[_0x509b('0x1c')](_0x3281ac);}return _0x3ca961[_0x509b('0x1d')](_0x3281ac)[_0x509b('0x1e')]();};}function respondWithResult(_0x141fba,_0x101235){_0x101235=_0x101235||0xc8;return function(_0x5e4060){if(_0x5e4060){return _0x141fba['status'](_0x101235)[_0x509b('0x1f')](_0x5e4060);}};}function respondWithFilteredResult(_0x492609,_0x39fe7a){return function(_0x73d3e4){if(_0x73d3e4){var _0x518bed=typeof _0x39fe7a[_0x509b('0x20')]===_0x509b('0x21')&&typeof _0x39fe7a[_0x509b('0x22')]===_0x509b('0x21');var _0x37cb56=_0x73d3e4['count'];var _0x3cf067=_0x518bed?0x0:_0x39fe7a['offset'];var _0x5c6269=_0x518bed?_0x73d3e4[_0x509b('0x23')]:_0x39fe7a[_0x509b('0x20')]+_0x39fe7a[_0x509b('0x22')];var _0x111400;if(_0x5c6269>=_0x37cb56){_0x5c6269=_0x37cb56;_0x111400=0xc8;}else{_0x111400=0xce;}_0x492609[_0x509b('0x1d')](_0x111400);return _0x492609[_0x509b('0x24')](_0x509b('0x25'),_0x3cf067+'-'+_0x5c6269+'/'+_0x37cb56)[_0x509b('0x1f')](_0x73d3e4);}return null;};}function patchUpdates(_0x2cafa7){return function(_0x5bf251){try{jsonpatch['apply'](_0x5bf251,_0x2cafa7,!![]);}catch(_0xd544c2){return BPromise[_0x509b('0x26')](_0xd544c2);}return _0x5bf251[_0x509b('0x27')]();};}function saveUpdates(_0x41b351,_0x3a7b05){return function(_0x3feca9){if(_0x3feca9){return _0x3feca9['update'](_0x41b351)[_0x509b('0x28')](function(_0x2613a9){return _0x2613a9;});}return null;};}function removeEntity(_0x237a79,_0x7db210){return function(_0x4817d8){if(_0x4817d8){return _0x4817d8[_0x509b('0x29')]()[_0x509b('0x28')](function(){_0x237a79[_0x509b('0x1d')](0xcc)[_0x509b('0x1e')]();});}};}function handleEntityNotFound(_0x244d03,_0x4e567f){return function(_0x1200f0){if(!_0x1200f0){_0x244d03[_0x509b('0x1c')](0x194);}return _0x1200f0;};}function handleError(_0xaea86c,_0x541575){_0x541575=_0x541575||0x1f4;return function(_0x2d2a78){logger[_0x509b('0x2a')](_0x2d2a78['stack']);if(_0x2d2a78[_0x509b('0x2b')]){delete _0x2d2a78[_0x509b('0x2b')];}_0xaea86c[_0x509b('0x1d')](_0x541575)[_0x509b('0x2c')](_0x2d2a78);};}exports[_0x509b('0x2d')]=function(_0x155fc7,_0x255a6a){var _0x137767={},_0x5547b9={},_0x5712ad={'count':0x0,'rows':[]};var _0x47d7fb=_[_0x509b('0x2e')](db[_0x509b('0x2f')][_0x509b('0x30')],function(_0x2aecf5){return{'name':_0x2aecf5[_0x509b('0x31')],'type':_0x2aecf5['type'][_0x509b('0x32')]};});_0x5547b9[_0x509b('0x33')]=_[_0x509b('0x2e')](_0x47d7fb,_0x509b('0x2b'));_0x5547b9[_0x509b('0x34')]=_[_0x509b('0x35')](_0x155fc7['query']);_0x5547b9[_0x509b('0x36')]=_[_0x509b('0x37')](_0x5547b9[_0x509b('0x33')],_0x5547b9['query']);_0x137767[_0x509b('0x38')]=_[_0x509b('0x37')](_0x5547b9[_0x509b('0x33')],qs[_0x509b('0x39')](_0x155fc7[_0x509b('0x34')][_0x509b('0x39')]));_0x137767[_0x509b('0x38')]=_0x137767[_0x509b('0x38')][_0x509b('0x3a')]?_0x137767[_0x509b('0x38')]:_0x5547b9['model'];if(!_0x155fc7[_0x509b('0x34')][_0x509b('0x3b')](_0x509b('0x3c'))){_0x137767[_0x509b('0x22')]=qs[_0x509b('0x22')](_0x155fc7[_0x509b('0x34')]['limit']);_0x137767[_0x509b('0x20')]=qs[_0x509b('0x20')](_0x155fc7[_0x509b('0x34')][_0x509b('0x20')]);}_0x137767[_0x509b('0x3d')]=qs['sort'](_0x155fc7[_0x509b('0x34')][_0x509b('0x3e')]);_0x137767[_0x509b('0x3f')]=qs[_0x509b('0x36')](_[_0x509b('0x40')](_0x155fc7[_0x509b('0x34')],_0x5547b9[_0x509b('0x36')]),_0x47d7fb);if(_0x155fc7['query'][_0x509b('0x41')]){_0x137767[_0x509b('0x3f')]=_[_0x509b('0x42')](_0x137767[_0x509b('0x3f')],{'$or':_['map'](_0x47d7fb,function(_0xa33fdc){if(_0xa33fdc['type']!==_0x509b('0x43')){var _0x329542={};_0x329542[_0xa33fdc[_0x509b('0x2b')]]={'$like':'%'+_0x155fc7['query'][_0x509b('0x41')]+'%'};return _0x329542;}})});}_0x137767=_[_0x509b('0x42')]({},_0x137767,_0x155fc7[_0x509b('0x44')]);var _0x487740={'where':_0x137767[_0x509b('0x3f')]};return db['AnalyticTreeReport']['count'](_0x487740)[_0x509b('0x28')](function(_0x176fd3){_0x5712ad[_0x509b('0x23')]=_0x176fd3;if(_0x155fc7['query']['includeAll']){_0x137767[_0x509b('0x45')]=[{'all':!![]}];}return db[_0x509b('0x2f')][_0x509b('0x46')](_0x137767);})[_0x509b('0x28')](function(_0x5d3591){_0x5712ad[_0x509b('0x47')]=_0x5d3591;return _0x5712ad;})['then'](respondWithFilteredResult(_0x255a6a,_0x137767))[_0x509b('0x48')](handleError(_0x255a6a,null));};exports['show']=function(_0x2c8646,_0x3a9b85){var _0x12ea33={'raw':!![],'where':{'id':_0x2c8646[_0x509b('0x49')]['id']}},_0x55d691={};_0x55d691[_0x509b('0x33')]=_[_0x509b('0x35')](db[_0x509b('0x2f')][_0x509b('0x30')]);_0x55d691[_0x509b('0x34')]=_[_0x509b('0x35')](_0x2c8646[_0x509b('0x34')]);_0x55d691[_0x509b('0x36')]=_['intersection'](_0x55d691[_0x509b('0x33')],_0x55d691[_0x509b('0x34')]);_0x12ea33[_0x509b('0x38')]=_[_0x509b('0x37')](_0x55d691[_0x509b('0x33')],qs[_0x509b('0x39')](_0x2c8646[_0x509b('0x34')][_0x509b('0x39')]));_0x12ea33[_0x509b('0x38')]=_0x12ea33[_0x509b('0x38')][_0x509b('0x3a')]?_0x12ea33['attributes']:_0x55d691[_0x509b('0x33')];if(_0x2c8646[_0x509b('0x34')]['includeAll']){_0x12ea33['include']=[{'all':!![]}];}_0x12ea33=_[_0x509b('0x42')]({},_0x12ea33,_0x2c8646[_0x509b('0x44')]);return db['AnalyticTreeReport']['find'](_0x12ea33)[_0x509b('0x28')](handleEntityNotFound(_0x3a9b85,null))[_0x509b('0x28')](respondWithResult(_0x3a9b85,null))[_0x509b('0x48')](handleError(_0x3a9b85,null));};exports[_0x509b('0x4a')]=function(_0x299f68,_0x8685){return db[_0x509b('0x2f')]['create'](_0x299f68[_0x509b('0x4b')],{})[_0x509b('0x28')](respondWithResult(_0x8685,0xc9))[_0x509b('0x48')](handleError(_0x8685,null));};exports[_0x509b('0x4c')]=function(_0x25a6b8,_0x418825){if(_0x25a6b8[_0x509b('0x4b')]['id']){delete _0x25a6b8[_0x509b('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x509b('0x4d')]({'where':{'id':_0x25a6b8['params']['id']}})[_0x509b('0x28')](handleEntityNotFound(_0x418825,null))[_0x509b('0x28')](saveUpdates(_0x25a6b8[_0x509b('0x4b')],null))[_0x509b('0x28')](respondWithResult(_0x418825,null))[_0x509b('0x48')](handleError(_0x418825,null));};exports[_0x509b('0x29')]=function(_0x2dfa94,_0x3b118f){return db['AnalyticTreeReport'][_0x509b('0x4d')]({'where':{'id':_0x2dfa94[_0x509b('0x49')]['id']}})[_0x509b('0x28')](handleEntityNotFound(_0x3b118f,null))['then'](removeEntity(_0x3b118f,null))[_0x509b('0x48')](handleError(_0x3b118f,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9daf013..31d8d8e 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 _0xfab1=['rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0xfab1,0x157));var _0x1fab=function(_0x23dc09,_0x5ab018){_0x23dc09=_0x23dc09-0x0;var _0x2e81ea=_0xfab1[_0x23dc09];return _0x2e81ea;};'use strict';var _=require(_0x1fab('0x0'));var util=require(_0x1fab('0x1'));var logger=require(_0x1fab('0x2'))(_0x1fab('0x3'));var moment=require(_0x1fab('0x4'));var BPromise=require(_0x1fab('0x5'));var rp=require(_0x1fab('0x6'));var fs=require('fs');var path=require(_0x1fab('0x7'));var rimraf=require(_0x1fab('0x8'));var config=require(_0x1fab('0x9'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3ae582,_0x334da6){return _0x3ae582[_0x1fab('0xa')](_0x1fab('0xb'),attributes,{'tableName':_0x1fab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d88=['../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','api','bluebird','request-promise','path'];(function(_0x1e7e77,_0x15fa51){var _0x105fd1=function(_0x28a947){while(--_0x28a947){_0x1e7e77['push'](_0x1e7e77['shift']());}};_0x105fd1(++_0x15fa51);}(_0x3d88,0x91));var _0x83d8=function(_0x13d3c2,_0x5ca5d4){_0x13d3c2=_0x13d3c2-0x0;var _0x2883bb=_0x3d88[_0x13d3c2];return _0x2883bb;};'use strict';var _=require(_0x83d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x83d8('0x1'));var moment=require('moment');var BPromise=require(_0x83d8('0x2'));var rp=require(_0x83d8('0x3'));var fs=require('fs');var path=require(_0x83d8('0x4'));var rimraf=require('rimraf');var config=require(_0x83d8('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0x83d8('0x6')]=function(_0x5f22e7,_0x43c38f){return _0x5f22e7[_0x83d8('0x7')](_0x83d8('0x8'),attributes,{'tableName':_0x83d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index a10ba0a..452ccf3 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x79324e,_0x4af67e){var _0x555666=function(_0x15d9c2){while(--_0x15d9c2){_0x79324e['push'](_0x79324e['shift']());}};_0x555666(++_0x4af67e);}(_0xadb5,0xad));var _0x5adb=function(_0x5122aa,_0x165c78){_0x5122aa=_0x5122aa-0x0;var _0x9c27c7=_0xadb5[_0x5122aa];return _0x9c27c7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e48ef,_0xe216f9){_0x4e48ef=_0x4e48ef-0x0;var _0x580797=_0x7a54[_0x4e48ef];return _0x580797;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 0116f27..d2f78d3 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 _0xd736=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','update','delete'];(function(_0x195918,_0x1ade71){var _0x580e56=function(_0x368751){while(--_0x368751){_0x195918['push'](_0x195918['shift']());}};_0x580e56(++_0x1ade71);}(_0xd736,0x1ca));var _0x6d73=function(_0x332ec2,_0x1bbc56){_0x332ec2=_0x332ec2-0x0;var _0x289be8=_0xd736[_0x332ec2];return _0x289be8;};'use strict';var multer=require(_0x6d73('0x0'));var util=require(_0x6d73('0x1'));var path=require(_0x6d73('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d73('0x3'));var router=express[_0x6d73('0x4')]();var fs_extra=require(_0x6d73('0x5'));var auth=require(_0x6d73('0x6'));var interaction=require(_0x6d73('0x7'));var config=require(_0x6d73('0x8'));var controller=require(_0x6d73('0x9'));router[_0x6d73('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d73('0xb')]);router['get']('/:id',auth[_0x6d73('0xc')](),controller[_0x6d73('0xd')]);router[_0x6d73('0xe')]('/',auth[_0x6d73('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6d73('0xf')]);router[_0x6d73('0x10')]('/:id',auth[_0x6d73('0xc')](),controller[_0x6d73('0x11')]);module[_0x6d73('0x12')]=router;
\ No newline at end of file
+var _0x828c=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x828c,0x13f));var _0xc828=function(_0x29548c,_0x21279f){_0x29548c=_0x29548c-0x0;var _0x3f6b63=_0x828c[_0x29548c];return _0x3f6b63;};'use strict';var multer=require(_0xc828('0x0'));var util=require(_0xc828('0x1'));var path=require(_0xc828('0x2'));var timeout=require(_0xc828('0x3'));var express=require(_0xc828('0x4'));var router=express[_0xc828('0x5')]();var fs_extra=require(_0xc828('0x6'));var auth=require(_0xc828('0x7'));var interaction=require(_0xc828('0x8'));var config=require(_0xc828('0x9'));var controller=require(_0xc828('0xa'));router[_0xc828('0xb')]('/',auth[_0xc828('0xc')](),controller[_0xc828('0xd')]);router[_0xc828('0xb')](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0xf')]);router[_0xc828('0x10')]('/',auth[_0xc828('0xc')](),controller['create']);router[_0xc828('0x11')](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0x12')]);router['delete'](_0xc828('0xe'),auth[_0xc828('0xc')](),controller[_0xc828('0x13')]);module[_0xc828('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6eea736..68ae5da 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 _0xa4ba=['STRING','exports'];(function(_0x16cb9b,_0x5f25a3){var _0xe2cfc=function(_0x5589e4){while(--_0x5589e4){_0x16cb9b['push'](_0x16cb9b['shift']());}};_0xe2cfc(++_0x5f25a3);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa4ba[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'name':{'type':Sequelize[_0xaa4b('0x1')]},'basename':{'type':Sequelize[_0xaa4b('0x1')]},'type':{'type':Sequelize[_0xaa4b('0x1')]}};
\ No newline at end of file
+var _0xb2b3=['exports','STRING','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb2b3,0x71));var _0x3b2b=function(_0x3a5394,_0x1e8e00){_0x3a5394=_0x3a5394-0x0;var _0x3f5227=_0xb2b3[_0x3a5394];return _0x3f5227;};'use strict';var Sequelize=require(_0x3b2b('0x0'));module[_0x3b2b('0x1')]={'name':{'type':Sequelize[_0x3b2b('0x2')]},'basename':{'type':Sequelize[_0x3b2b('0x2')]},'type':{'type':Sequelize[_0x3b2b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8d27ffe..b3ae1ec 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 _0x5075=['get','omit','updatedAt','body','createdAt','file','basename','filename','mimetype','create','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Attachment','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','show','includeAll','options','find','params'];(function(_0x283a75,_0x3cd042){var _0x31b812=function(_0x1c509a){while(--_0x1c509a){_0x283a75['push'](_0x283a75['shift']());}};_0x31b812(++_0x3cd042);}(_0x5075,0x1c9));var _0x5507=function(_0x10b4b8,_0x450fea){_0x10b4b8=_0x10b4b8-0x0;var _0x424293=_0x5075[_0x10b4b8];return _0x424293;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5507('0x1'));var jsonpatch=require(_0x5507('0x2'));var rp=require('request-promise');var moment=require(_0x5507('0x3'));var BPromise=require(_0x5507('0x4'));var Mustache=require(_0x5507('0x5'));var util=require('util');var path=require(_0x5507('0x6'));var sox=require(_0x5507('0x7'));var csv=require(_0x5507('0x8'));var ejs=require(_0x5507('0x9'));var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require(_0x5507('0x13'));var hardwareService=require(_0x5507('0x14'));var logger=require(_0x5507('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5507('0x16'));var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x126393,_0x19efc1){_0x19efc1=_0x19efc1||0xcc;return function(_0x4957ed){if(_0x4957ed){return _0x126393[_0x5507('0x18')](_0x19efc1);}return _0x126393[_0x5507('0x19')](_0x19efc1)[_0x5507('0x1a')]();};}function respondWithResult(_0x457a5c,_0x113dad){_0x113dad=_0x113dad||0xc8;return function(_0x3a110b){if(_0x3a110b){return _0x457a5c[_0x5507('0x19')](_0x113dad)[_0x5507('0x1b')](_0x3a110b);}};}function respondWithFilteredResult(_0x816d2e,_0x4172ce){return function(_0x292ba2){if(_0x292ba2){var _0x49842d=typeof _0x4172ce['offset']===_0x5507('0x1c')&&typeof _0x4172ce[_0x5507('0x1d')]===_0x5507('0x1c');var _0x2e08b2=_0x292ba2[_0x5507('0x1e')];var _0x1e9399=_0x49842d?0x0:_0x4172ce['offset'];var _0x3497b9=_0x49842d?_0x292ba2[_0x5507('0x1e')]:_0x4172ce[_0x5507('0x1f')]+_0x4172ce[_0x5507('0x1d')];var _0x1a3817;if(_0x3497b9>=_0x2e08b2){_0x3497b9=_0x2e08b2;_0x1a3817=0xc8;}else{_0x1a3817=0xce;}_0x816d2e['status'](_0x1a3817);return _0x816d2e['set'](_0x5507('0x20'),_0x1e9399+'-'+_0x3497b9+'/'+_0x2e08b2)[_0x5507('0x1b')](_0x292ba2);}return null;};}function patchUpdates(_0x3f94b9){return function(_0x24610e){try{jsonpatch[_0x5507('0x21')](_0x24610e,_0x3f94b9,!![]);}catch(_0x6ff8b8){return BPromise[_0x5507('0x22')](_0x6ff8b8);}return _0x24610e[_0x5507('0x23')]();};}function saveUpdates(_0x346e6d,_0x84b6c7){return function(_0x57ea8f){if(_0x57ea8f){return _0x57ea8f[_0x5507('0x24')](_0x346e6d)[_0x5507('0x25')](function(_0x45c355){return _0x45c355;});}return null;};}function removeEntity(_0xfb1c1a,_0x24dbde){return function(_0x2d0f6e){if(_0x2d0f6e){return _0x2d0f6e[_0x5507('0x26')]()[_0x5507('0x25')](function(){_0xfb1c1a[_0x5507('0x19')](0xcc)[_0x5507('0x1a')]();});}};}function handleEntityNotFound(_0x698d29,_0x694eb9){return function(_0x4811cf){if(!_0x4811cf){_0x698d29['sendStatus'](0x194);}return _0x4811cf;};}function handleError(_0x1b0fef,_0x4c5906){_0x4c5906=_0x4c5906||0x1f4;return function(_0x3298ec){logger[_0x5507('0x27')](_0x3298ec['stack']);if(_0x3298ec[_0x5507('0x28')]){delete _0x3298ec[_0x5507('0x28')];}_0x1b0fef[_0x5507('0x19')](_0x4c5906)[_0x5507('0x29')](_0x3298ec);};}exports['index']=function(_0x31b54e,_0x323252){var _0x427bdb={},_0x48c92b={},_0x40b752={'count':0x0,'rows':[]};var _0x3105ea=_[_0x5507('0x2a')](db[_0x5507('0x2b')][_0x5507('0x2c')],function(_0x3a9446){return{'name':_0x3a9446['fieldName'],'type':_0x3a9446[_0x5507('0x2d')][_0x5507('0x2e')]};});_0x48c92b[_0x5507('0x2f')]=_['map'](_0x3105ea,_0x5507('0x28'));_0x48c92b['query']=_[_0x5507('0x30')](_0x31b54e['query']);_0x48c92b[_0x5507('0x31')]=_[_0x5507('0x32')](_0x48c92b['model'],_0x48c92b['query']);_0x427bdb[_0x5507('0x33')]=_[_0x5507('0x32')](_0x48c92b[_0x5507('0x2f')],qs[_0x5507('0x34')](_0x31b54e[_0x5507('0x35')]['fields']));_0x427bdb[_0x5507('0x33')]=_0x427bdb['attributes'][_0x5507('0x36')]?_0x427bdb[_0x5507('0x33')]:_0x48c92b['model'];if(!_0x31b54e[_0x5507('0x35')][_0x5507('0x37')]('nolimit')){_0x427bdb[_0x5507('0x1d')]=qs[_0x5507('0x1d')](_0x31b54e[_0x5507('0x35')][_0x5507('0x1d')]);_0x427bdb[_0x5507('0x1f')]=qs[_0x5507('0x1f')](_0x31b54e[_0x5507('0x35')]['offset']);}_0x427bdb[_0x5507('0x38')]=qs[_0x5507('0x39')](_0x31b54e['query'][_0x5507('0x39')]);_0x427bdb[_0x5507('0x3a')]=qs['filters'](_[_0x5507('0x3b')](_0x31b54e[_0x5507('0x35')],_0x48c92b[_0x5507('0x31')]),_0x3105ea);if(_0x31b54e[_0x5507('0x35')]['filter']){_0x427bdb[_0x5507('0x3a')]=_[_0x5507('0x3c')](_0x427bdb[_0x5507('0x3a')],{'$or':_[_0x5507('0x2a')](_0x3105ea,function(_0x374848){if(_0x374848['type']!==_0x5507('0x3d')){var _0x4947aa={};_0x4947aa[_0x374848[_0x5507('0x28')]]={'$like':'%'+_0x31b54e['query'][_0x5507('0x3e')]+'%'};return _0x4947aa;}})});}_0x427bdb=_['merge']({},_0x427bdb,_0x31b54e['options']);var _0x170496={'where':_0x427bdb[_0x5507('0x3a')]};return db[_0x5507('0x2b')][_0x5507('0x1e')](_0x170496)[_0x5507('0x25')](function(_0x555cc4){_0x40b752['count']=_0x555cc4;if(_0x31b54e['query']['includeAll']){_0x427bdb[_0x5507('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x5507('0x40')](_0x427bdb);})[_0x5507('0x25')](function(_0x58918d){_0x40b752['rows']=_0x58918d;return _0x40b752;})['then'](respondWithFilteredResult(_0x323252,_0x427bdb))[_0x5507('0x41')](handleError(_0x323252,null));};exports[_0x5507('0x42')]=function(_0x5c8d84,_0x3daf60){var _0x564df6={'raw':!![],'where':{'id':_0x5c8d84['params']['id']}},_0x4894bb={};_0x4894bb[_0x5507('0x2f')]=_[_0x5507('0x30')](db[_0x5507('0x2b')][_0x5507('0x2c')]);_0x4894bb[_0x5507('0x35')]=_['keys'](_0x5c8d84['query']);_0x4894bb[_0x5507('0x31')]=_[_0x5507('0x32')](_0x4894bb[_0x5507('0x2f')],_0x4894bb[_0x5507('0x35')]);_0x564df6['attributes']=_[_0x5507('0x32')](_0x4894bb[_0x5507('0x2f')],qs['fields'](_0x5c8d84['query']['fields']));_0x564df6[_0x5507('0x33')]=_0x564df6[_0x5507('0x33')][_0x5507('0x36')]?_0x564df6[_0x5507('0x33')]:_0x4894bb['model'];if(_0x5c8d84[_0x5507('0x35')][_0x5507('0x43')]){_0x564df6[_0x5507('0x3f')]=[{'all':!![]}];}_0x564df6=_[_0x5507('0x3c')]({},_0x564df6,_0x5c8d84[_0x5507('0x44')]);return db[_0x5507('0x2b')][_0x5507('0x45')](_0x564df6)[_0x5507('0x25')](handleEntityNotFound(_0x3daf60,null))[_0x5507('0x25')](respondWithResult(_0x3daf60,null))[_0x5507('0x41')](handleError(_0x3daf60,null));};exports['clone']=function(_0x7273ed,_0xe0bdb7){var _0x54b806={'where':{'id':_0x7273ed[_0x5507('0x46')]['id']}},_0x4323f7={};_0x4323f7[_0x5507('0x2f')]=_[_0x5507('0x30')](db[_0x5507('0x2b')][_0x5507('0x2c')]);_0x54b806[_0x5507('0x33')]=_[_0x5507('0x32')](_0x4323f7['model'],qs[_0x5507('0x34')](_0x7273ed[_0x5507('0x35')][_0x5507('0x34')]));_0x54b806[_0x5507('0x33')]=_0x54b806[_0x5507('0x33')][_0x5507('0x36')]?_0x54b806[_0x5507('0x33')]:_0x4323f7[_0x5507('0x2f')];if(_0x7273ed[_0x5507('0x35')][_0x5507('0x43')]){_0x54b806['include']=[{'all':!![]}];}_0x54b806=_[_0x5507('0x3c')]({},_0x54b806,_0x7273ed['options']);return db[_0x5507('0x2b')]['find'](_0x54b806)[_0x5507('0x25')](handleEntityNotFound(_0xe0bdb7,null))[_0x5507('0x25')](function(_0x42a3b3){if(_0x42a3b3){var _0x19d03f=_0x42a3b3[_0x5507('0x47')]({'plain':!![]});_0x19d03f=qs[_0x5507('0x48')](_0x19d03f,['id','createdAt',_0x5507('0x49')]);_0x7273ed[_0x5507('0x4a')]=_[_0x5507('0x48')](_0x7273ed[_0x5507('0x4a')],['id',_0x5507('0x4b'),'updatedAt']);return db['Attachment']['create'](_[_0x5507('0x3c')](_0x19d03f,_0x7273ed[_0x5507('0x4a')]),{'include':_0x7273ed[_0x5507('0x35')][_0x5507('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xe0bdb7,0xc9))[_0x5507('0x41')](handleError(_0xe0bdb7,null));};exports[_0x5507('0x24')]=function(_0x377a97,_0x20d893){if(_0x377a97[_0x5507('0x4a')]['id']){delete _0x377a97[_0x5507('0x4a')]['id'];}return db['Attachment'][_0x5507('0x45')]({'where':{'id':_0x377a97['params']['id']}})[_0x5507('0x25')](handleEntityNotFound(_0x20d893,null))[_0x5507('0x25')](saveUpdates(_0x377a97[_0x5507('0x4a')],null))[_0x5507('0x25')](respondWithResult(_0x20d893,null))[_0x5507('0x41')](handleError(_0x20d893,null));};exports[_0x5507('0x26')]=function(_0xfa5465,_0x507b87){return db[_0x5507('0x2b')][_0x5507('0x45')]({'where':{'id':_0xfa5465['params']['id']}})[_0x5507('0x25')](handleEntityNotFound(_0x507b87,null))[_0x5507('0x25')](removeEntity(_0x507b87,null))[_0x5507('0x41')](handleError(_0x507b87,null));};exports['create']=function(_0x5c16c6,_0x4007d4,_0x2707b4){_0x5c16c6['body'][_0x5507('0x28')]=_0x5c16c6[_0x5507('0x4c')]['originalname'];_0x5c16c6['body'][_0x5507('0x4d')]=_0x5c16c6['file'][_0x5507('0x4e')];_0x5c16c6[_0x5507('0x4a')]['type']=_0x5c16c6[_0x5507('0x4c')][_0x5507('0x4f')];return db[_0x5507('0x2b')][_0x5507('0x50')](_0x5c16c6[_0x5507('0x4a')])['then'](respondWithResult(_0x4007d4,0xc9))[_0x5507('0x41')](handleError(_0x4007d4,null));};exports[_0x5507('0x51')]=function(_0x88e8d1,_0x26ffce,_0x2bd598){return db['Attachment'][_0x5507('0x52')]({'where':{'id':_0x88e8d1['params']['id']},'raw':!![]})[_0x5507('0x25')](handleEntityNotFound(_0x26ffce,null))[_0x5507('0x25')](function(_0x67deb2){if(_0x67deb2){var _0x586460=_0x67deb2[_0x5507('0x53')]!==null;var _0x18da01=path['join'](config[_0x5507('0x54')],_0x5507('0x55'));if(_0x586460){_0x18da01=path[_0x5507('0x56')](_0x18da01,_0x5507('0x57'));}var _0x5c25e3=path[_0x5507('0x56')](_0x18da01,_0x67deb2[_0x5507('0x4d')]);return _0x26ffce[_0x5507('0x51')](_0x5c25e3);}})[_0x5507('0x41')](handleError(_0x26ffce,null));};
\ No newline at end of file
+var _0xd8ea=['findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','Attachment','rows','catch','show','keys','rawAttributes','find','params','get','omit','body','createdAt','create','update','file','originalname','basename','filename','mimetype','download'];(function(_0x46384e,_0xe14bf1){var _0x3a3682=function(_0x3e75a3){while(--_0x3e75a3){_0x46384e['push'](_0x46384e['shift']());}};_0x3a3682(++_0xe14bf1);}(_0xd8ea,0x16c));var _0xad8e=function(_0x2eab12,_0xbc1637){_0x2eab12=_0x2eab12-0x0;var _0x348fb=_0xd8ea[_0x2eab12];return _0x348fb;};'use strict';var emlformat=require(_0xad8e('0x0'));var rimraf=require(_0xad8e('0x1'));var zipdir=require(_0xad8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad8e('0x3'));var moment=require(_0xad8e('0x4'));var BPromise=require(_0xad8e('0x5'));var Mustache=require(_0xad8e('0x6'));var util=require(_0xad8e('0x7'));var path=require(_0xad8e('0x8'));var sox=require(_0xad8e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad8e('0xa'));var _=require(_0xad8e('0xb'));var squel=require(_0xad8e('0xc'));var crypto=require('crypto');var jsforce=require(_0xad8e('0xd'));var deskjs=require(_0xad8e('0xe'));var toCsv=require(_0xad8e('0xf'));var querystring=require(_0xad8e('0x10'));var Papa=require(_0xad8e('0x11'));var Redis=require(_0xad8e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xad8e('0x13'));var as=require(_0xad8e('0x14'));var hardwareService=require(_0xad8e('0x15'));var logger=require(_0xad8e('0x16'))(_0xad8e('0x17'));var utils=require(_0xad8e('0x18'));var config=require(_0xad8e('0x19'));var licenseUtil=require(_0xad8e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f979,_0x1a5b19){_0x1a5b19=_0x1a5b19||0xcc;return function(_0x35e69c){if(_0x35e69c){return _0x26f979[_0xad8e('0x1b')](_0x1a5b19);}return _0x26f979[_0xad8e('0x1c')](_0x1a5b19)[_0xad8e('0x1d')]();};}function respondWithResult(_0x54f9e8,_0x5a0aa5){_0x5a0aa5=_0x5a0aa5||0xc8;return function(_0x13e701){if(_0x13e701){return _0x54f9e8['status'](_0x5a0aa5)[_0xad8e('0x1e')](_0x13e701);}};}function respondWithFilteredResult(_0x1c52d7,_0x4489cd){return function(_0x2992c3){if(_0x2992c3){var _0x5aeda2=typeof _0x4489cd[_0xad8e('0x1f')]===_0xad8e('0x20')&&typeof _0x4489cd[_0xad8e('0x21')]==='undefined';var _0x2f969f=_0x2992c3['count'];var _0x504a5b=_0x5aeda2?0x0:_0x4489cd[_0xad8e('0x1f')];var _0x3f7c40=_0x5aeda2?_0x2992c3[_0xad8e('0x22')]:_0x4489cd[_0xad8e('0x1f')]+_0x4489cd[_0xad8e('0x21')];var _0x15c8ba;if(_0x3f7c40>=_0x2f969f){_0x3f7c40=_0x2f969f;_0x15c8ba=0xc8;}else{_0x15c8ba=0xce;}_0x1c52d7[_0xad8e('0x1c')](_0x15c8ba);return _0x1c52d7['set'](_0xad8e('0x23'),_0x504a5b+'-'+_0x3f7c40+'/'+_0x2f969f)[_0xad8e('0x1e')](_0x2992c3);}return null;};}function patchUpdates(_0x1af6f1){return function(_0x7492b){try{jsonpatch[_0xad8e('0x24')](_0x7492b,_0x1af6f1,!![]);}catch(_0x9b59c2){return BPromise[_0xad8e('0x25')](_0x9b59c2);}return _0x7492b[_0xad8e('0x26')]();};}function saveUpdates(_0x57979e,_0x1bc534){return function(_0x2c888f){if(_0x2c888f){return _0x2c888f['update'](_0x57979e)[_0xad8e('0x27')](function(_0x374ddc){return _0x374ddc;});}return null;};}function removeEntity(_0x2eab22,_0x3612ac){return function(_0x5c9126){if(_0x5c9126){return _0x5c9126[_0xad8e('0x28')]()['then'](function(){_0x2eab22[_0xad8e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330ef0,_0x166f4d){return function(_0xfb2d8a){if(!_0xfb2d8a){_0x330ef0[_0xad8e('0x1b')](0x194);}return _0xfb2d8a;};}function handleError(_0xd27a9d,_0x503e64){_0x503e64=_0x503e64||0x1f4;return function(_0x586561){logger[_0xad8e('0x29')](_0x586561[_0xad8e('0x2a')]);if(_0x586561[_0xad8e('0x2b')]){delete _0x586561[_0xad8e('0x2b')];}_0xd27a9d[_0xad8e('0x1c')](_0x503e64)['send'](_0x586561);};}exports[_0xad8e('0x2c')]=function(_0x37aa19,_0x59d40a){var _0x16824d={},_0x78c90={},_0x3e7049={'count':0x0,'rows':[]};var _0x1aab10=_[_0xad8e('0x2d')](db['Attachment']['rawAttributes'],function(_0x218cb1){return{'name':_0x218cb1['fieldName'],'type':_0x218cb1[_0xad8e('0x2e')][_0xad8e('0x2f')]};});_0x78c90[_0xad8e('0x30')]=_[_0xad8e('0x2d')](_0x1aab10,_0xad8e('0x2b'));_0x78c90['query']=_['keys'](_0x37aa19[_0xad8e('0x31')]);_0x78c90['filters']=_[_0xad8e('0x32')](_0x78c90['model'],_0x78c90['query']);_0x16824d[_0xad8e('0x33')]=_[_0xad8e('0x32')](_0x78c90[_0xad8e('0x30')],qs[_0xad8e('0x34')](_0x37aa19[_0xad8e('0x31')]['fields']));_0x16824d[_0xad8e('0x33')]=_0x16824d['attributes'][_0xad8e('0x35')]?_0x16824d[_0xad8e('0x33')]:_0x78c90[_0xad8e('0x30')];if(!_0x37aa19[_0xad8e('0x31')][_0xad8e('0x36')](_0xad8e('0x37'))){_0x16824d[_0xad8e('0x21')]=qs['limit'](_0x37aa19[_0xad8e('0x31')][_0xad8e('0x21')]);_0x16824d[_0xad8e('0x1f')]=qs['offset'](_0x37aa19['query'][_0xad8e('0x1f')]);}_0x16824d[_0xad8e('0x38')]=qs['sort'](_0x37aa19[_0xad8e('0x31')]['sort']);_0x16824d[_0xad8e('0x39')]=qs[_0xad8e('0x3a')](_[_0xad8e('0x3b')](_0x37aa19[_0xad8e('0x31')],_0x78c90[_0xad8e('0x3a')]),_0x1aab10);if(_0x37aa19[_0xad8e('0x31')][_0xad8e('0x3c')]){_0x16824d[_0xad8e('0x39')]=_[_0xad8e('0x3d')](_0x16824d[_0xad8e('0x39')],{'$or':_[_0xad8e('0x2d')](_0x1aab10,function(_0x54fdce){if(_0x54fdce[_0xad8e('0x2e')]!==_0xad8e('0x3e')){var _0xb6e6cc={};_0xb6e6cc[_0x54fdce[_0xad8e('0x2b')]]={'$like':'%'+_0x37aa19[_0xad8e('0x31')][_0xad8e('0x3c')]+'%'};return _0xb6e6cc;}})});}_0x16824d=_[_0xad8e('0x3d')]({},_0x16824d,_0x37aa19[_0xad8e('0x3f')]);var _0x378ef9={'where':_0x16824d['where']};return db['Attachment']['count'](_0x378ef9)[_0xad8e('0x27')](function(_0x415005){_0x3e7049[_0xad8e('0x22')]=_0x415005;if(_0x37aa19['query'][_0xad8e('0x40')]){_0x16824d[_0xad8e('0x41')]=[{'all':!![]}];}return db[_0xad8e('0x42')]['findAll'](_0x16824d);})[_0xad8e('0x27')](function(_0x5610c5){_0x3e7049[_0xad8e('0x43')]=_0x5610c5;return _0x3e7049;})[_0xad8e('0x27')](respondWithFilteredResult(_0x59d40a,_0x16824d))[_0xad8e('0x44')](handleError(_0x59d40a,null));};exports[_0xad8e('0x45')]=function(_0x28a0d3,_0x387147){var _0x4a2895={'raw':!![],'where':{'id':_0x28a0d3['params']['id']}},_0x49b70f={};_0x49b70f[_0xad8e('0x30')]=_[_0xad8e('0x46')](db[_0xad8e('0x42')][_0xad8e('0x47')]);_0x49b70f[_0xad8e('0x31')]=_['keys'](_0x28a0d3[_0xad8e('0x31')]);_0x49b70f[_0xad8e('0x3a')]=_[_0xad8e('0x32')](_0x49b70f['model'],_0x49b70f[_0xad8e('0x31')]);_0x4a2895[_0xad8e('0x33')]=_[_0xad8e('0x32')](_0x49b70f['model'],qs[_0xad8e('0x34')](_0x28a0d3[_0xad8e('0x31')][_0xad8e('0x34')]));_0x4a2895['attributes']=_0x4a2895[_0xad8e('0x33')][_0xad8e('0x35')]?_0x4a2895[_0xad8e('0x33')]:_0x49b70f[_0xad8e('0x30')];if(_0x28a0d3[_0xad8e('0x31')][_0xad8e('0x40')]){_0x4a2895[_0xad8e('0x41')]=[{'all':!![]}];}_0x4a2895=_['merge']({},_0x4a2895,_0x28a0d3[_0xad8e('0x3f')]);return db['Attachment'][_0xad8e('0x48')](_0x4a2895)[_0xad8e('0x27')](handleEntityNotFound(_0x387147,null))['then'](respondWithResult(_0x387147,null))[_0xad8e('0x44')](handleError(_0x387147,null));};exports['clone']=function(_0x3019c6,_0x52fcab){var _0x3e8334={'where':{'id':_0x3019c6[_0xad8e('0x49')]['id']}},_0x9912eb={};_0x9912eb['model']=_[_0xad8e('0x46')](db[_0xad8e('0x42')][_0xad8e('0x47')]);_0x3e8334[_0xad8e('0x33')]=_['intersection'](_0x9912eb['model'],qs[_0xad8e('0x34')](_0x3019c6['query'][_0xad8e('0x34')]));_0x3e8334['attributes']=_0x3e8334[_0xad8e('0x33')][_0xad8e('0x35')]?_0x3e8334[_0xad8e('0x33')]:_0x9912eb[_0xad8e('0x30')];if(_0x3019c6[_0xad8e('0x31')][_0xad8e('0x40')]){_0x3e8334[_0xad8e('0x41')]=[{'all':!![]}];}_0x3e8334=_[_0xad8e('0x3d')]({},_0x3e8334,_0x3019c6[_0xad8e('0x3f')]);return db[_0xad8e('0x42')][_0xad8e('0x48')](_0x3e8334)[_0xad8e('0x27')](handleEntityNotFound(_0x52fcab,null))[_0xad8e('0x27')](function(_0xc9f465){if(_0xc9f465){var _0x52acb0=_0xc9f465[_0xad8e('0x4a')]({'plain':!![]});_0x52acb0=qs[_0xad8e('0x4b')](_0x52acb0,['id','createdAt','updatedAt']);_0x3019c6[_0xad8e('0x4c')]=_[_0xad8e('0x4b')](_0x3019c6['body'],['id',_0xad8e('0x4d'),'updatedAt']);return db[_0xad8e('0x42')][_0xad8e('0x4e')](_[_0xad8e('0x3d')](_0x52acb0,_0x3019c6['body']),{'include':_0x3019c6[_0xad8e('0x31')][_0xad8e('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x52fcab,0xc9))[_0xad8e('0x44')](handleError(_0x52fcab,null));};exports[_0xad8e('0x4f')]=function(_0x5a6c64,_0x3cff4a){if(_0x5a6c64[_0xad8e('0x4c')]['id']){delete _0x5a6c64[_0xad8e('0x4c')]['id'];}return db[_0xad8e('0x42')][_0xad8e('0x48')]({'where':{'id':_0x5a6c64[_0xad8e('0x49')]['id']}})[_0xad8e('0x27')](handleEntityNotFound(_0x3cff4a,null))[_0xad8e('0x27')](saveUpdates(_0x5a6c64['body'],null))[_0xad8e('0x27')](respondWithResult(_0x3cff4a,null))[_0xad8e('0x44')](handleError(_0x3cff4a,null));};exports['destroy']=function(_0x16657e,_0x54a715){return db[_0xad8e('0x42')][_0xad8e('0x48')]({'where':{'id':_0x16657e[_0xad8e('0x49')]['id']}})['then'](handleEntityNotFound(_0x54a715,null))[_0xad8e('0x27')](removeEntity(_0x54a715,null))[_0xad8e('0x44')](handleError(_0x54a715,null));};exports['create']=function(_0x36b2c6,_0x3a7002,_0x24245d){_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x2b')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x51')];_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x52')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x53')];_0x36b2c6[_0xad8e('0x4c')][_0xad8e('0x2e')]=_0x36b2c6[_0xad8e('0x50')][_0xad8e('0x54')];return db[_0xad8e('0x42')][_0xad8e('0x4e')](_0x36b2c6['body'])[_0xad8e('0x27')](respondWithResult(_0x3a7002,0xc9))[_0xad8e('0x44')](handleError(_0x3a7002,null));};exports[_0xad8e('0x55')]=function(_0x168c56,_0x40134a,_0x545593){return db[_0xad8e('0x42')][_0xad8e('0x56')]({'where':{'id':_0x168c56[_0xad8e('0x49')]['id']},'raw':!![]})[_0xad8e('0x27')](handleEntityNotFound(_0x40134a,null))[_0xad8e('0x27')](function(_0x4045f2){if(_0x4045f2){var _0xc04688=_0x4045f2[_0xad8e('0x57')]!==null;var _0x58a419=path[_0xad8e('0x58')](config['root'],_0xad8e('0x59'));if(_0xc04688){_0x58a419=path[_0xad8e('0x58')](_0x58a419,'offline-chat/');}var _0x3213a9=path['join'](_0x58a419,_0x4045f2[_0xad8e('0x52')]);return _0x40134a[_0xad8e('0x55')](_0x3213a9);}})['catch'](handleError(_0x40134a,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index c006818..1dc40c5 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 _0x24c9=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x24c9,0xfe));var _0x924c=function(_0x44ca95,_0x1756fd){_0x44ca95=_0x44ca95-0x0;var _0x42fd3e=_0x24c9[_0x44ca95];return _0x42fd3e;};'use strict';var _=require(_0x924c('0x0'));var util=require(_0x924c('0x1'));var logger=require(_0x924c('0x2'))(_0x924c('0x3'));var moment=require('moment');var BPromise=require(_0x924c('0x4'));var rp=require(_0x924c('0x5'));var fs=require('fs');var path=require(_0x924c('0x6'));var rimraf=require('rimraf');var config=require(_0x924c('0x7'));var attributes=require(_0x924c('0x8'));module[_0x924c('0x9')]=function(_0x213efa,_0x48e852){return _0x213efa[_0x924c('0xa')](_0x924c('0xb'),attributes,{'tableName':_0x924c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce77=['../../config/logger','api','moment','request-promise','./attachment.attributes','define','attachments','util'];(function(_0x538102,_0x1ee338){var _0x4758e2=function(_0x1df6bf){while(--_0x1df6bf){_0x538102['push'](_0x538102['shift']());}};_0x4758e2(++_0x1ee338);}(_0xce77,0x87));var _0x7ce7=function(_0x219336,_0x430668){_0x219336=_0x219336-0x0;var _0x5c7f22=_0xce77[_0x219336];return _0x5c7f22;};'use strict';var _=require('lodash');var util=require(_0x7ce7('0x0'));var logger=require(_0x7ce7('0x1'))(_0x7ce7('0x2'));var moment=require(_0x7ce7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ce7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7ce7('0x5'));module['exports']=function(_0x44736f,_0x31d939){return _0x44736f[_0x7ce7('0x6')]('Attachment',attributes,{'tableName':_0x7ce7('0x7'),'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 ce19478..f9ebf85 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 _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x4f726a,_0x3425c3){var _0x1a512c=function(_0x30b775){while(--_0x30b775){_0x4f726a['push'](_0x4f726a['shift']());}};_0x1a512c(++_0x3425c3);}(_0xb201,0x1b1));var _0x1b20=function(_0x7eba85,_0x59df95){_0x7eba85=_0x7eba85-0x0;var _0x1d117a=_0xb201[_0x7eba85];return _0x1d117a;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});};
\ No newline at end of file
+var _0xa902=['raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','create','body','options'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa902,0x8d));var _0x2a90=function(_0x2891c3,_0x4caed3){_0x2891c3=_0x2891c3-0x0;var _0x17690a=_0xa902[_0x2891c3];return _0x17690a;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('Attachment,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('Attachment,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['Attachment'][_0x2a90('0x18')](_0x5c3e4b[_0x2a90('0x19')],{'raw':_0x5c3e4b[_0x2a90('0x1a')]?_0x5c3e4b[_0x2a90('0x1a')][_0x2a90('0x1b')]===undefined?!![]:![]:!![]})[_0x2a90('0xc')](function(_0x312cd5){logger[_0x2a90('0xd')](_0x2a90('0x17'),_0x5c3e4b);logger[_0x2a90('0xf')](_0x2a90('0x17'),_0x5c3e4b,JSON[_0x2a90('0x12')](_0x312cd5));_0x1d9a28(_0x312cd5);})['catch'](function(_0x3da7d0){logger[_0x2a90('0x13')](_0x2a90('0x17'),_0x3da7d0[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3da7d0[_0x2a90('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1c3b354..33e871a 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x6badde,_0x3355c7){_0x6badde=_0x6badde-0x0;var _0x2c5ad0=_0xdb28[_0x6badde];return _0x2c5ad0;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 7ee24b8..d4dff82 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 _0xe8a1=['../../config/logger','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','online','name','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','login','signToken','use','ad-login','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x395007,_0x225eeb){var _0x34e1d0=function(_0x4eab12){while(--_0x4eab12){_0x395007['push'](_0x395007['shift']());}};_0x34e1d0(++_0x225eeb);}(_0xe8a1,0xf8));var _0x1e8a=function(_0x54f1ef,_0x3afe49){_0x54f1ef=_0x54f1ef-0x0;var _0x766919=_0xe8a1[_0x54f1ef];return _0x766919;};'use strict';var passport=require(_0x1e8a('0x0'));var LocalStrategy=require(_0x1e8a('0x1'))[_0x1e8a('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x1e8a('0x3'));var BPromise=require(_0x1e8a('0x4'));var util=require(_0x1e8a('0x5'));var db=require(_0x1e8a('0x6'))['db'];var authService=require(_0x1e8a('0x7'));var utils=require(_0x1e8a('0x8'));var config=require(_0x1e8a('0x9'));var logger=require(_0x1e8a('0xa'))('api');function isActiveDirectoryConfigured(_0x21821f){var _0x4efec5=![];if(typeof _0x21821f[_0x1e8a('0xb')]!==_0x1e8a('0xc')){_0x4efec5=_0x21821f[_0x1e8a('0xb')]['baseDN']&&_0x21821f[_0x1e8a('0xb')][_0x1e8a('0xd')]&&_0x21821f[_0x1e8a('0xb')][_0x1e8a('0xe')];}return _0x4efec5;}function adAuthenticate(_0x26ae1e,_0x125931,_0x1a2eb1){return new BPromise(function(_0x4aa92b,_0x3d762f){try{var _0x98f189=new ActiveDirectory(_0x26ae1e);_0x98f189[_0x1e8a('0xf')](_0x125931,_0x1a2eb1,function(_0x472d9b,_0x58f70d){if(_0x472d9b){logger[_0x1e8a('0x10')](_0x1e8a('0x11'),_0x125931,util[_0x1e8a('0x12')](_0x472d9b,{'showHidden':![],'depth':null}));_0x3d762f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x58f70d){logger[_0x1e8a('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x125931);_0x3d762f(_0x1e8a('0x13'));}else{_0x4aa92b(_0x58f70d);}});}catch(_0xca77d6){_0x3d762f(_0xca77d6);}});}function ActiveDirectoryAuthenticate(_0x3a7f3e,_0xe0aecb,_0x8b6084,_0x5b3fac){var _0x561342,_0x5c9507;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xe0aecb);return _0x5b3fac(null,![],{'message':_0x1e8a('0x13')});}return db[_0x1e8a('0x14')][_0x1e8a('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1e8a('0x16')],'raw':!![]})[_0x1e8a('0x17')](function(_0x5971c7){_0x561342=_0x5971c7;if(!_0x561342[_0x1e8a('0x18')]){logger[_0x1e8a('0x10')](_0x1e8a('0x19'),_0xe0aecb);throw new Error(_0x1e8a('0x13'));}return _0x3a7f3e[_0x1e8a('0x15')]({'logging':!![],'attributes':['id','name',_0x1e8a('0x1a'),_0x1e8a('0x1b'),_0x1e8a('0x1c'),'disabled',_0x1e8a('0x1d'),'blockedAt',_0x1e8a('0x1e')],'where':{'name':_0xe0aecb,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})[_0x1e8a('0x17')](function(_0x12ac18){if(!_0x12ac18||_0x12ac18&&_0x12ac18[_0x1e8a('0x1f')]!==_0xe0aecb){throw new Error(_0x1e8a('0x13'));}_0x5c9507=_0x12ac18;var _0x594c5c=_0x5c9507[_0x1e8a('0x1f')]+'@'+config[_0x1e8a('0xb')][_0x1e8a('0xe')];return adAuthenticate(config[_0x1e8a('0xb')],_0x594c5c,_0x8b6084);})[_0x1e8a('0x17')](function(_0x50986f){if(_0x5c9507['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x561342[_0x1e8a('0x16')]>0x0){if(_0x5c9507[_0x1e8a('0x1d')]){if(moment(_0x5c9507[_0x1e8a('0x20')])[_0x1e8a('0x21')](_0x561342['blockDuration'],_0x1e8a('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x1e8a('0x23')](_0x5c9507,0x0,![],null)[_0x1e8a('0x17')](function(){return utils[_0x1e8a('0x24')](_0x5c9507);})[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}else{return utils['getLicense'](_0x5c9507)[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}}else{return utils[_0x1e8a('0x24')](_0x5c9507)[_0x1e8a('0x17')](function(){return _0x5b3fac(null,_0x5c9507);});}})[_0x1e8a('0x25')](function(_0x16b4ef){return _0x5b3fac(null,![],_0x16b4ef);});}function handleError(_0x55a55b,_0x5eace6,_0x353bb2){return _0x55a55b[_0x1e8a('0x26')](_0x5eace6||0x1f4)['send']({'message':_0x353bb2?_0x353bb2['message']||_0x353bb2:''});}exports[_0x1e8a('0x27')]=function(_0xd85fc6,_0x5b1d6d,_0x7e0013){passport['authenticate']('ad-login',function(_0x4e304c,_0x2b39a3,_0x99dc23){var _0x5bdd31=_0x4e304c||_0x99dc23;if(_0x5bdd31){return handleError(_0x5b1d6d,0x191,_0x5bdd31);}if(!_0x2b39a3){return handleError(_0x5b1d6d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3063ca={'payload':{'id':_0x2b39a3['id'],'role':_0x2b39a3[_0x1e8a('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x1e8a('0x28')](_0x3063ca)[_0x1e8a('0x17')](function(_0x15dfe4){_0x5b1d6d['json']({'id':_0x2b39a3['id'],'token':_0x15dfe4,'statusCall':'','isAlreadyLogged':_0x2b39a3['online']});});}})(_0xd85fc6,_0x5b1d6d,_0x7e0013);};passport[_0x1e8a('0x29')](_0x1e8a('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x1e8a('0x1a')},function(_0x55b98b,_0x2b40f0,_0x1a8a6c){return ActiveDirectoryAuthenticate(db['User'],_0x55b98b,_0x2b40f0,_0x1a8a6c);}));
\ No newline at end of file
+var _0x22c4=['activedirectory','baseDN','url','domain','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','Setting','findOne','adSsoEnabled','then','password','role','disabled','online','admin','user','agent','name','blockDuration','blocked','blockedAt','minutes','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','ad-login','User','passport','Strategy','moment','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined'];(function(_0x5d184b,_0x1b04c5){var _0x5cee64=function(_0x393f88){while(--_0x393f88){_0x5d184b['push'](_0x5d184b['shift']());}};_0x5cee64(++_0x1b04c5);}(_0x22c4,0xb5));var _0x422c=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x22c4[_0x53ddab];return _0x5819ac;};'use strict';var passport=require(_0x422c('0x0'));var LocalStrategy=require('passport-local')[_0x422c('0x1')];var moment=require(_0x422c('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x422c('0x3'));var db=require(_0x422c('0x4'))['db'];var authService=require(_0x422c('0x5'));var utils=require(_0x422c('0x6'));var config=require(_0x422c('0x7'));var logger=require(_0x422c('0x8'))(_0x422c('0x9'));function isActiveDirectoryConfigured(_0xf9062){var _0x5de0b6=![];if(typeof _0xf9062['activedirectory']!==_0x422c('0xa')){_0x5de0b6=_0xf9062[_0x422c('0xb')][_0x422c('0xc')]&&_0xf9062[_0x422c('0xb')][_0x422c('0xd')]&&_0xf9062[_0x422c('0xb')][_0x422c('0xe')];}return _0x5de0b6;}function adAuthenticate(_0x3339be,_0x80b3a9,_0x162922){return new BPromise(function(_0xc5036b,_0x1abeae){try{var _0x2acd58=new ActiveDirectory(_0x3339be);_0x2acd58[_0x422c('0xf')](_0x80b3a9,_0x162922,function(_0x336bd0,_0x308469){if(_0x336bd0){logger[_0x422c('0x10')](_0x422c('0x11'),_0x80b3a9,util[_0x422c('0x12')](_0x336bd0,{'showHidden':![],'depth':null}));_0x1abeae(_0x422c('0x13'));}else if(!_0x308469){logger[_0x422c('0x10')](_0x422c('0x14'),_0x80b3a9);_0x1abeae(_0x422c('0x13'));}else{_0xc5036b(_0x308469);}});}catch(_0x2a56e9){_0x1abeae(_0x2a56e9);}});}function ActiveDirectoryAuthenticate(_0x48eb42,_0x5c5ad4,_0x222342,_0xe1878e){var _0x3ad3c7,_0x3b327a;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5c5ad4);return _0xe1878e(null,![],{'message':_0x422c('0x13')});}return db[_0x422c('0x15')][_0x422c('0x16')]({'where':{'id':0x1},'attributes':[_0x422c('0x17'),'blockDuration'],'raw':!![]})[_0x422c('0x18')](function(_0x5cb684){_0x3ad3c7=_0x5cb684;if(!_0x3ad3c7['adSsoEnabled']){logger[_0x422c('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5c5ad4);throw new Error(_0x422c('0x13'));}return _0x48eb42[_0x422c('0x16')]({'logging':!![],'attributes':['id','name',_0x422c('0x19'),'salt',_0x422c('0x1a'),_0x422c('0x1b'),'blocked','blockedAt',_0x422c('0x1c')],'where':{'name':_0x5c5ad4,'role':{'$or':[_0x422c('0x1d'),_0x422c('0x1e'),_0x422c('0x1f')]},'adSsoEnabled':!![]}});})[_0x422c('0x18')](function(_0x89cd8e){if(!_0x89cd8e||_0x89cd8e&&_0x89cd8e[_0x422c('0x20')]!==_0x5c5ad4){throw new Error(_0x422c('0x13'));}_0x3b327a=_0x89cd8e;var _0x87a916=_0x3b327a['name']+'@'+config[_0x422c('0xb')][_0x422c('0xe')];return adAuthenticate(config[_0x422c('0xb')],_0x87a916,_0x222342);})['then'](function(_0x29ee62){if(_0x3b327a['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3ad3c7[_0x422c('0x21')]>0x0){if(_0x3b327a[_0x422c('0x22')]){if(moment(_0x3b327a[_0x422c('0x23')])['add'](_0x3ad3c7[_0x422c('0x21')],_0x422c('0x24'))>moment()){throw new Error(_0x422c('0x13'));}return utils['clearBlockUser'](_0x3b327a,0x0,![],null)[_0x422c('0x18')](function(){return utils[_0x422c('0x25')](_0x3b327a);})['then'](function(){return _0xe1878e(null,_0x3b327a);});}else{return utils['getLicense'](_0x3b327a)['then'](function(){return _0xe1878e(null,_0x3b327a);});}}else{return utils['getLicense'](_0x3b327a)[_0x422c('0x18')](function(){return _0xe1878e(null,_0x3b327a);});}})[_0x422c('0x26')](function(_0x560a5d){return _0xe1878e(null,![],_0x560a5d);});}function handleError(_0x3a56be,_0x183059,_0x15718){return _0x3a56be[_0x422c('0x27')](_0x183059||0x1f4)[_0x422c('0x28')]({'message':_0x15718?_0x15718[_0x422c('0x29')]||_0x15718:''});}exports[_0x422c('0x2a')]=function(_0xd1dcfe,_0x33f026,_0x298a1e){passport['authenticate']('ad-login',function(_0x36b848,_0x1e2051,_0x16ec82){var _0x1a0398=_0x36b848||_0x16ec82;if(_0x1a0398){return handleError(_0x33f026,0x191,_0x1a0398);}if(!_0x1e2051){return handleError(_0x33f026,0x194,{'message':_0x422c('0x2b')});}else{var _0xaf5f01={'payload':{'id':_0x1e2051['id'],'role':_0x1e2051[_0x422c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x422c('0x2c')](_0xaf5f01)['then'](function(_0x3ed568){_0x33f026['json']({'id':_0x1e2051['id'],'token':_0x3ed568,'statusCall':'','isAlreadyLogged':_0x1e2051[_0x422c('0x1c')]});});}})(_0xd1dcfe,_0x33f026,_0x298a1e);};passport[_0x422c('0x2d')](_0x422c('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x5df5b0,_0x461fc2,_0x14a699){return ActiveDirectoryAuthenticate(db[_0x422c('0x2f')],_0x5df5b0,_0x461fc2,_0x14a699);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 555e8f5..93d78bb 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 _0xa846=['Router','post','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa846,0x17c));var _0x6a84=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xa846[_0xb725be];return _0x2f2424;};'use strict';var express=require(_0x6a84('0x0'));var router=express[_0x6a84('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x6a84('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0xc974=['post','login','express','Router'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0xc974,0xb6));var _0x4c97=function(_0x220d8b,_0x31412f){_0x220d8b=_0x220d8b-0x0;var _0x4afcc5=_0xc974[_0x220d8b];return _0x4afcc5;};'use strict';var express=require(_0x4c97('0x0'));var router=express[_0x4c97('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x4c97('0x2')]('/',controller[_0x4c97('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 712ab6a..4e96d1e 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 _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(_0x4648fe,_0x4b9f0d){var _0x48ee97=function(_0x2be78a){while(--_0x2be78a){_0x4648fe['push'](_0x4648fe['shift']());}};_0x48ee97(++_0x4b9f0d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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
+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(_0x222ae4,_0x261760){var _0x4f0a2c=function(_0x1ed50d){while(--_0x1ed50d){_0x222ae4['push'](_0x222ae4['shift']());}};_0x4f0a2c(++_0x261760);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 8f19fa7..31a35a9 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 _0x34f8=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','setTokenCookie'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x34f8,0xbc));var _0x834f=function(_0xaccdae,_0x445e78){_0xaccdae=_0xaccdae-0x0;var _0x545e40=_0x34f8[_0xaccdae];return _0x545e40;};'use strict';var express=require(_0x834f('0x0'));var passport=require(_0x834f('0x1'));var router=express['Router']();var controller=require(_0x834f('0x2'));var userController=require(_0x834f('0x3'));var authService=require(_0x834f('0x4'));router['get']('/',controller[_0x834f('0x5')]);router[_0x834f('0x6')](_0x834f('0x7'),controller[_0x834f('0x8')],authService['isMiddleware'],userController[_0x834f('0x5')],authService[_0x834f('0x9')]);module[_0x834f('0xa')]=router;
\ No newline at end of file
+var _0x80b9=['isMiddleware','setTokenCookie','exports','Router','../../components/auth/service','get','login','/callback','callback'];(function(_0x3c94d1,_0x222960){var _0x50f3cd=function(_0x559c2e){while(--_0x559c2e){_0x3c94d1['push'](_0x3c94d1['shift']());}};_0x50f3cd(++_0x222960);}(_0x80b9,0x123));var _0x980b=function(_0x4e2300,_0x1c050b){_0x4e2300=_0x4e2300-0x0;var _0x5028ab=_0x80b9[_0x4e2300];return _0x5028ab;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x980b('0x0')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x980b('0x1'));router[_0x980b('0x2')]('/',controller[_0x980b('0x3')]);router[_0x980b('0x2')](_0x980b('0x4'),controller[_0x980b('0x5')],authService[_0x980b('0x6')],userController[_0x980b('0x3')],authService[_0x980b('0x7')]);module[_0x980b('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index ef99ab0..71a3045 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 _0x9e45=['service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','resetPasswordExpires','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','blockDuration','then','findOne','name','password','salt','role','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x131dbb,_0x11ca7d){var _0x32ca78=function(_0x2decb1){while(--_0x2decb1){_0x131dbb['push'](_0x131dbb['shift']());}};_0x32ca78(++_0x11ca7d);}(_0x9e45,0x1ee));var _0x59e4=function(_0x50748b,_0x599d6d){_0x50748b=_0x50748b-0x0;var _0x5688d7=_0x9e45[_0x50748b];return _0x5688d7;};'use strict';var util=require(_0x59e4('0x0'));var passport=require(_0x59e4('0x1'));var LocalStrategy=require(_0x59e4('0x2'))['Strategy'];var jayson=require(_0x59e4('0x3'));var _=require(_0x59e4('0x4'));var rs=require(_0x59e4('0x5'));var moment=require(_0x59e4('0x6'));var db=require(_0x59e4('0x7'))['db'];var authService=require(_0x59e4('0x8'));var utils=require(_0x59e4('0x9'));var client=jayson[_0x59e4('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x489219,_0x266cf9,_0x26b551,_0x3d4414){var _0x514d76,_0x2308ea;return db[_0x59e4('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x59e4('0xc')],'raw':!![]})[_0x59e4('0xd')](function(_0x29fe30){_0x514d76=_0x29fe30;return _0x489219[_0x59e4('0xe')]({'attributes':['id',_0x59e4('0xf'),_0x59e4('0x10'),_0x59e4('0x11'),_0x59e4('0x12'),'disabled',_0x59e4('0x13'),'blockedAt',_0x59e4('0x14')],'where':{'name':_0x266cf9,'role':{'$or':[_0x59e4('0x15'),_0x59e4('0x16'),_0x59e4('0x17')]}}});})[_0x59e4('0xd')](function(_0x1f2b36){if(!_0x1f2b36||_0x1f2b36&&_0x1f2b36[_0x59e4('0xf')]!==_0x266cf9){throw new Error(_0x59e4('0x18'));}else{_0x2308ea=_0x1f2b36;return _0x2308ea;}})['then'](function(){_0x2308ea[_0x59e4('0x19')](_0x26b551,function(_0x5df651,_0x11e833){var _0xc10b1f=_0x2308ea[_0x59e4('0x14')]+0x1;if(_0x5df651){return _0x3d4414(_0x5df651);}else if(!_0x11e833){if(_0x2308ea[_0x59e4('0x1a')]){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else if(_0x514d76[_0x59e4('0x1b')]>0x0){if(_0x2308ea[_0x59e4('0x13')]){if(_0x514d76[_0x59e4('0xc')]>0x0){if(moment(_0x2308ea[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x514d76[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else{return utils['clearBlockUser'](_0x2308ea,_0xc10b1f,![],null)[_0x59e4('0xd')](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}}else{return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}}else{if(_0xc10b1f>=_0x514d76['allowedLoginAttempts']){return utils[_0x59e4('0x1f')](_0x2308ea,0x0,!![],moment())['then'](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}else{return utils[_0x59e4('0x1f')](_0x2308ea,_0xc10b1f,![],null)[_0x59e4('0xd')](function(){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});});}}}else{return _0x3d4414(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2308ea['disabled']){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else if(_0x514d76[_0x59e4('0x1b')]>0x0){if(_0x2308ea[_0x59e4('0x13')]){if(_0x514d76[_0x59e4('0xc')]>0x0){if(moment(_0x2308ea[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x514d76[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){return _0x3d4414(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x59e4('0x1f')](_0x2308ea,0x0,![],null)[_0x59e4('0xd')](function(){return utils[_0x59e4('0x20')](_0x2308ea);})[_0x59e4('0xd')](function(){return _0x3d4414(null,_0x2308ea);});}}else{return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}}else{return utils[_0x59e4('0x1f')](_0x2308ea,0x0,![],null)[_0x59e4('0xd')](function(){return utils[_0x59e4('0x20')](_0x2308ea);})['then'](function(){return _0x3d4414(null,_0x2308ea);})['catch'](function(_0x2de256){return _0x3d4414(null,![],_0x2de256);});}}else{if(_0x2308ea[_0x59e4('0x13')]){return _0x3d4414(null,![],{'message':_0x59e4('0x18')});}else{return utils['getLicense'](_0x2308ea)[_0x59e4('0xd')](function(){return _0x3d4414(null,_0x2308ea);});}}}});})[_0x59e4('0x21')](function(_0x1995f4){return _0x3d4414(null,![],_0x1995f4);});}function sendServiceMail(_0x1aaf83){return db[_0x59e4('0x22')][_0x59e4('0x23')]({'where':{'service':!![]},'attributes':['id',_0x59e4('0xf'),_0x59e4('0x24')],'include':[{'model':db[_0x59e4('0x25')],'as':_0x59e4('0x26')}]})['then'](function(_0x12f733){if(!_0x12f733){throw new Error(_0x59e4('0x27'));}var _0x6ce3ab={'tls':{'rejectUnauthorized':![]}};if(_0x12f733['Smtp'][_0x59e4('0x28')]){_0x6ce3ab[_0x59e4('0x28')]=_0x12f733['Smtp'][_0x59e4('0x28')];}else{_0x6ce3ab[_0x59e4('0x29')]=_0x12f733[_0x59e4('0x26')][_0x59e4('0x29')];_0x6ce3ab[_0x59e4('0x2a')]=_0x12f733[_0x59e4('0x26')][_0x59e4('0x2a')];_0x6ce3ab[_0x59e4('0x2b')]=_0x12f733['Smtp']['secure'];}if(_0x12f733[_0x59e4('0x26')][_0x59e4('0x2c')]){_0x6ce3ab[_0x59e4('0x2d')]={'user':_0x12f733[_0x59e4('0x26')]['user'],'pass':_0x12f733[_0x59e4('0x26')][_0x59e4('0x2e')]};}var _0x1dba82={'account':_0x6ce3ab,'message':_[_0x59e4('0x2f')]({'from':util[_0x59e4('0x30')](_0x59e4('0x31'),_0x12f733[_0x59e4('0xf')],_0x12f733[_0x59e4('0x24')]||_0x12f733['Smtp'][_0x59e4('0x16')])},_0x1aaf83)};return client[_0x59e4('0x32')](_0x59e4('0x33'),_0x1dba82);})['then'](function(_0x1fa04d){if(_0x1fa04d[_0x59e4('0x34')]){throw new Error(util[_0x59e4('0x30')](_0x59e4('0x35'),_0x1fa04d[_0x59e4('0x34')]['message']||JSON[_0x59e4('0x36')](_0x1fa04d[_0x59e4('0x34')])));}return!![];});}function handleError(_0xba2cd3,_0x15ef50,_0x51daa8){return _0xba2cd3['status'](_0x15ef50||0x1f4)[_0x59e4('0x37')]({'message':_0x51daa8?_0x51daa8[_0x59e4('0x38')]||_0x51daa8:''});}exports[_0x59e4('0x39')]=function(_0x107582,_0x3f312a,_0x446abf){passport[_0x59e4('0x19')]('local-login',function(_0x152553,_0x3a10a2,_0x272476){var _0x1f67a3=_0x152553||_0x272476;if(_0x1f67a3){return handleError(_0x3f312a,0x191,_0x1f67a3);}if(!_0x3a10a2){return handleError(_0x3f312a,0x194,{'message':_0x59e4('0x3a')});}else{var _0x1e4de1={'payload':{'id':_0x3a10a2['id'],'role':_0x3a10a2['role']},'options':{'expiresIn':0x15180}};return authService[_0x59e4('0x3b')](_0x1e4de1)[_0x59e4('0xd')](function(_0x50501a){_0x3f312a[_0x59e4('0x3c')]({'id':_0x3a10a2['id'],'token':_0x50501a,'statusCall':'','isAlreadyLogged':_0x3a10a2[_0x59e4('0x3d')]});});}})(_0x107582,_0x3f312a,_0x446abf);};exports['forgot']=function(_0xaab7f2,_0x286f75,_0xe52ee6){if(!_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]){return handleError(_0x286f75,0x1f4,{'message':_0x59e4('0x3f')});}var _0x1f1ec5=rs[_0x59e4('0x40')]();_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]=_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')][_0x59e4('0x41')]()['toLowerCase']();var _0x1ef0b3;return db[_0x59e4('0xb')][_0x59e4('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x59e4('0xc')],'raw':!![]})[_0x59e4('0xd')](function(_0x5ae684){_0x1ef0b3=_0x5ae684;return db[_0x59e4('0x42')][_0x59e4('0x23')]({'where':{'email':_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')]}});})[_0x59e4('0xd')](function(_0x627251){if(!_0x627251){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x627251['disabled']){throw new Error(_0x59e4('0x43'));}if(_0x627251[_0x59e4('0x13')]){if(moment(_0x627251[_0x59e4('0x1c')])[_0x59e4('0x1d')](_0x1ef0b3[_0x59e4('0xc')],_0x59e4('0x1e'))>moment()){throw new Error(_0x59e4('0x44'));}else{_0x627251[_0x59e4('0x13')]=![];_0x627251[_0x59e4('0x1c')]=null;}}_0x627251[_0x59e4('0x45')]=_0x1f1ec5;_0x627251['resetPasswordExpires']=Date[_0x59e4('0x46')]()+0x36ee80;return _0x627251['save']();})[_0x59e4('0xd')](function(){return sendServiceMail({'to':_0xaab7f2[_0x59e4('0x3e')][_0x59e4('0x24')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x59e4('0x47')+_0x59e4('0x48')+_0x59e4('0x49')+_0xaab7f2['headers']['host']+_0x59e4('0x4a')+_0x1f1ec5+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x59e4('0xd')](function(){_0x286f75[_0x59e4('0x4b')](0xc8)[_0x59e4('0x37')]({'message':'Reset\x20Email\x20sent!'});})[_0x59e4('0x21')](function(_0x7d9702){return handleError(_0x286f75,0x1f4,_0x7d9702);});};exports[_0x59e4('0x4c')]=function(_0x11a22f,_0x347061,_0x45112b){return db[_0x59e4('0x42')][_0x59e4('0x23')]({'where':{'resetPasswordToken':_0x11a22f[_0x59e4('0x4d')][_0x59e4('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x59e4('0x46')]()}}})[_0x59e4('0xd')](function(_0x3ac4c6){if(!_0x3ac4c6){throw new Error(_0x59e4('0x4f'));}return db[_0x59e4('0xb')]['findOne']({'attributes':['id',_0x59e4('0x50'),_0x59e4('0x51'),_0x59e4('0x52')]})[_0x59e4('0xd')](function(_0x259543){if(_0x259543[_0x59e4('0x50')])authService[_0x59e4('0x53')](_0x11a22f[_0x59e4('0x3e')][_0x59e4('0x10')]);if(!_0x259543[_0x59e4('0x51')]||!_0x3ac4c6['previousPasswords'])return _0x3ac4c6;authService['validatePasswordHistory'](_0x11a22f[_0x59e4('0x3e')][_0x59e4('0x10')],_0x3ac4c6['previousPasswords'],_0x259543[_0x59e4('0x52')]);return _0x3ac4c6;})[_0x59e4('0xd')](function(){_0x3ac4c6[_0x59e4('0x10')]=_0x11a22f['body'][_0x59e4('0x10')];_0x3ac4c6['resetPasswordToken']=null;_0x3ac4c6[_0x59e4('0x54')]=null;return _0x3ac4c6[_0x59e4('0x55')]();});})[_0x59e4('0xd')](function(){_0x347061['status'](0xc8)[_0x59e4('0x37')]({'message':_0x59e4('0x56')});})[_0x59e4('0x21')](function(_0x1b4f75){return handleError(_0x347061,0x1f4,_0x1b4f75);});};passport[_0x59e4('0x57')](_0x59e4('0x58'),new LocalStrategy({'usernameField':_0x59e4('0xf'),'passwordField':_0x59e4('0x10')},function(_0x115be8,_0x2ed853,_0x5f4eda){return localAuthenticate(db[_0x59e4('0x42')],_0x115be8,_0x2ed853,_0x5f4eda);}));
\ No newline at end of file
+var _0x55bc=['request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','catch','find','name','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','email'];(function(_0x5d8792,_0x4f5438){var _0x986d0e=function(_0x1d4b83){while(--_0x1d4b83){_0x5d8792['push'](_0x5d8792['shift']());}};_0x986d0e(++_0x4f5438);}(_0x55bc,0x18b));var _0xc55b=function(_0xc696f9,_0x189337){_0xc696f9=_0xc696f9-0x0;var _0x568003=_0x55bc[_0xc696f9];return _0x568003;};'use strict';var util=require(_0xc55b('0x0'));var passport=require(_0xc55b('0x1'));var LocalStrategy=require(_0xc55b('0x2'))[_0xc55b('0x3')];var jayson=require(_0xc55b('0x4'));var _=require(_0xc55b('0x5'));var rs=require('randomstring');var moment=require(_0xc55b('0x6'));var db=require(_0xc55b('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc55b('0x8'));var client=jayson[_0xc55b('0x9')][_0xc55b('0xa')]({'port':0x232b});function localAuthenticate(_0x54ab89,_0x2626f2,_0x13f783,_0x3dfb8b){var _0x487d73,_0xdec0b9;return db[_0xc55b('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xc55b('0xc'),_0xc55b('0xd')],'raw':!![]})[_0xc55b('0xe')](function(_0x1af068){_0x487d73=_0x1af068;return _0x54ab89[_0xc55b('0xf')]({'attributes':['id','name',_0xc55b('0x10'),_0xc55b('0x11'),_0xc55b('0x12'),_0xc55b('0x13'),_0xc55b('0x14'),_0xc55b('0x15'),_0xc55b('0x16')],'where':{'name':_0x2626f2,'role':{'$or':['admin',_0xc55b('0x17'),_0xc55b('0x18')]}}});})[_0xc55b('0xe')](function(_0x432cc2){if(!_0x432cc2||_0x432cc2&&_0x432cc2['name']!==_0x2626f2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xdec0b9=_0x432cc2;return _0xdec0b9;}})[_0xc55b('0xe')](function(){_0xdec0b9['authenticate'](_0x13f783,function(_0x289719,_0x2e24ab){var _0x19c132=_0xdec0b9[_0xc55b('0x16')]+0x1;if(_0x289719){return _0x3dfb8b(_0x289719);}else if(!_0x2e24ab){if(_0xdec0b9['disabled']){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else if(_0x487d73[_0xc55b('0xc')]>0x0){if(_0xdec0b9[_0xc55b('0x14')]){if(_0x487d73[_0xc55b('0xd')]>0x0){if(moment(_0xdec0b9[_0xc55b('0x15')])[_0xc55b('0x1a')](_0x487d73['blockDuration'],'minutes')>moment()){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else{return utils[_0xc55b('0x1b')](_0xdec0b9,_0x19c132,![],null)['then'](function(){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});});}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{if(_0x19c132>=_0x487d73['allowedLoginAttempts']){return utils[_0xc55b('0x1b')](_0xdec0b9,0x0,!![],moment())[_0xc55b('0xe')](function(){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});});}else{return utils[_0xc55b('0x1b')](_0xdec0b9,_0x19c132,![],null)[_0xc55b('0xe')](function(){return _0x3dfb8b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{if(_0xdec0b9['disabled']){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else if(_0x487d73[_0xc55b('0xc')]>0x0){if(_0xdec0b9[_0xc55b('0x14')]){if(_0x487d73[_0xc55b('0xd')]>0x0){if(moment(_0xdec0b9['blockedAt'])[_0xc55b('0x1a')](_0x487d73[_0xc55b('0xd')],_0xc55b('0x1c'))>moment()){return _0x3dfb8b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0xdec0b9,0x0,![],null)[_0xc55b('0xe')](function(){return utils[_0xc55b('0x1d')](_0xdec0b9);})[_0xc55b('0xe')](function(){return _0x3dfb8b(null,_0xdec0b9);});}}else{return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}}else{return utils[_0xc55b('0x1b')](_0xdec0b9,0x0,![],null)[_0xc55b('0xe')](function(){return utils['getLicense'](_0xdec0b9);})['then'](function(){return _0x3dfb8b(null,_0xdec0b9);})[_0xc55b('0x1e')](function(_0x55390c){return _0x3dfb8b(null,![],_0x55390c);});}}else{if(_0xdec0b9[_0xc55b('0x14')]){return _0x3dfb8b(null,![],{'message':_0xc55b('0x19')});}else{return utils['getLicense'](_0xdec0b9)[_0xc55b('0xe')](function(){return _0x3dfb8b(null,_0xdec0b9);});}}}});})[_0xc55b('0x1e')](function(_0xeeb3ac){return _0x3dfb8b(null,![],_0xeeb3ac);});}function sendServiceMail(_0x12a3f8){return db['MailAccount'][_0xc55b('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xc55b('0x20'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xc55b('0x21')}]})[_0xc55b('0xe')](function(_0x2dadaf){if(!_0x2dadaf){throw new Error(_0xc55b('0x22'));}var _0x184f1a={'tls':{'rejectUnauthorized':![]}};if(_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x23')]){_0x184f1a[_0xc55b('0x23')]=_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x23')];}else{_0x184f1a[_0xc55b('0x24')]=_0x2dadaf['Smtp'][_0xc55b('0x24')];_0x184f1a[_0xc55b('0x25')]=_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x25')];_0x184f1a['secure']=_0x2dadaf['Smtp'][_0xc55b('0x26')];}if(_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x27')]){_0x184f1a[_0xc55b('0x28')]={'user':_0x2dadaf[_0xc55b('0x21')]['user'],'pass':_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x29')]};}var _0x514bc8={'account':_0x184f1a,'message':_[_0xc55b('0x2a')]({'from':util[_0xc55b('0x2b')]('\x22%s\x22\x20<%s>',_0x2dadaf[_0xc55b('0x20')],_0x2dadaf[_0xc55b('0x2c')]||_0x2dadaf[_0xc55b('0x21')][_0xc55b('0x17')])},_0x12a3f8)};return client[_0xc55b('0x2d')](_0xc55b('0x2e'),_0x514bc8);})[_0xc55b('0xe')](function(_0x158c47){if(_0x158c47[_0xc55b('0x2f')]){throw new Error(util['format'](_0xc55b('0x30'),_0x158c47[_0xc55b('0x2f')][_0xc55b('0x31')]||JSON['stringify'](_0x158c47[_0xc55b('0x2f')])));}return!![];});}function handleError(_0x3fd670,_0x112e3c,_0x56fef7){return _0x3fd670[_0xc55b('0x32')](_0x112e3c||0x1f4)['send']({'message':_0x56fef7?_0x56fef7[_0xc55b('0x31')]||_0x56fef7:''});}exports[_0xc55b('0x33')]=function(_0x5aa5da,_0x132ea2,_0x215665){passport[_0xc55b('0x34')](_0xc55b('0x35'),function(_0x5f350f,_0x25405e,_0x31935d){var _0x2a783a=_0x5f350f||_0x31935d;if(_0x2a783a){return handleError(_0x132ea2,0x191,_0x2a783a);}if(!_0x25405e){return handleError(_0x132ea2,0x194,{'message':_0xc55b('0x36')});}else{var _0x2d1bba={'payload':{'id':_0x25405e['id'],'role':_0x25405e[_0xc55b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc55b('0x37')](_0x2d1bba)[_0xc55b('0xe')](function(_0x412040){_0x132ea2['json']({'id':_0x25405e['id'],'token':_0x412040,'statusCall':'','isAlreadyLogged':_0x25405e[_0xc55b('0x38')]});});}})(_0x5aa5da,_0x132ea2,_0x215665);};exports[_0xc55b('0x39')]=function(_0x437724,_0x1fc2a3,_0x564371){if(!_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]){return handleError(_0x1fc2a3,0x1f4,{'message':_0xc55b('0x3b')});}var _0x4dec0f=rs[_0xc55b('0x3c')]();_0x437724['body'][_0xc55b('0x2c')]=_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]['trim']()['toLowerCase']();var _0x4d6471;return db[_0xc55b('0xb')][_0xc55b('0xf')]({'where':{'id':0x1},'attributes':[_0xc55b('0xc'),_0xc55b('0xd')],'raw':!![]})[_0xc55b('0xe')](function(_0x34fb5d){_0x4d6471=_0x34fb5d;return db[_0xc55b('0x3d')]['find']({'where':{'email':_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')]}});})[_0xc55b('0xe')](function(_0x3891cd){if(!_0x3891cd){throw new Error(_0xc55b('0x3e'));}if(_0x3891cd[_0xc55b('0x13')]){throw new Error(_0xc55b('0x3f'));}if(_0x3891cd[_0xc55b('0x14')]){if(moment(_0x3891cd['blockedAt'])[_0xc55b('0x1a')](_0x4d6471['blockDuration'],_0xc55b('0x1c'))>moment()){throw new Error(_0xc55b('0x40'));}else{_0x3891cd[_0xc55b('0x14')]=![];_0x3891cd[_0xc55b('0x15')]=null;}}_0x3891cd[_0xc55b('0x41')]=_0x4dec0f;_0x3891cd['resetPasswordExpires']=Date[_0xc55b('0x42')]()+0x36ee80;return _0x3891cd[_0xc55b('0x43')]();})[_0xc55b('0xe')](function(){return sendServiceMail({'to':_0x437724[_0xc55b('0x3a')][_0xc55b('0x2c')],'subject':_0xc55b('0x44'),'text':_0xc55b('0x45')+_0xc55b('0x46')+_0xc55b('0x47')+_0x437724['headers'][_0xc55b('0x24')]+_0xc55b('0x48')+_0x4dec0f+'\x0a\x0a'+_0xc55b('0x49')});})[_0xc55b('0xe')](function(){_0x1fc2a3['status'](0xc8)[_0xc55b('0x4a')]({'message':_0xc55b('0x4b')});})[_0xc55b('0x1e')](function(_0x11c59d){return handleError(_0x1fc2a3,0x1f4,_0x11c59d);});};exports[_0xc55b('0x4c')]=function(_0x5e3282,_0x2c71ea,_0x1deffb){return db[_0xc55b('0x3d')][_0xc55b('0x1f')]({'where':{'resetPasswordToken':_0x5e3282[_0xc55b('0x4d')][_0xc55b('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xc55b('0x42')]()}}})[_0xc55b('0xe')](function(_0x2dcdfc){if(!_0x2dcdfc){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xc55b('0xf')]({'attributes':['id',_0xc55b('0x4f'),'enforcePasswordHistory',_0xc55b('0x50')]})[_0xc55b('0xe')](function(_0x51a114){if(_0x51a114[_0xc55b('0x4f')])authService[_0xc55b('0x51')](_0x5e3282[_0xc55b('0x3a')][_0xc55b('0x10')]);if(!_0x51a114[_0xc55b('0x52')]||!_0x2dcdfc[_0xc55b('0x53')])return _0x2dcdfc;authService[_0xc55b('0x54')](_0x5e3282['body'][_0xc55b('0x10')],_0x2dcdfc[_0xc55b('0x53')],_0x51a114[_0xc55b('0x50')]);return _0x2dcdfc;})[_0xc55b('0xe')](function(){_0x2dcdfc[_0xc55b('0x10')]=_0x5e3282['body'][_0xc55b('0x10')];_0x2dcdfc[_0xc55b('0x41')]=null;_0x2dcdfc[_0xc55b('0x55')]=null;return _0x2dcdfc[_0xc55b('0x43')]();});})[_0xc55b('0xe')](function(){_0x2c71ea[_0xc55b('0x32')](0xc8)['send']({'message':_0xc55b('0x56')});})[_0xc55b('0x1e')](function(_0x1dd8d9){return handleError(_0x2c71ea,0x1f4,_0x1dd8d9);});};passport[_0xc55b('0x57')](_0xc55b('0x35'),new LocalStrategy({'usernameField':_0xc55b('0x20'),'passwordField':_0xc55b('0x10')},function(_0x30ef56,_0x80c5fb,_0x4dd6f1){return localAuthenticate(db[_0xc55b('0x3d')],_0x30ef56,_0x80c5fb,_0x4dd6f1);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 4dd43c3..3dd34ae 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 _0x63e5=['post','login','/forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0xc19320,_0xe54afe){var _0x33a689=function(_0x47e68f){while(--_0x47e68f){_0xc19320['push'](_0xc19320['shift']());}};_0x33a689(++_0xe54afe);}(_0x63e5,0xb5));var _0x563e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x63e5[_0x4d8ed9];return _0x1e2140;};'use strict';var express=require(_0x563e('0x0'));var router=express[_0x563e('0x1')]();var controller=require(_0x563e('0x2'));router[_0x563e('0x3')]('/',controller[_0x563e('0x4')]);router[_0x563e('0x3')](_0x563e('0x5'),controller['forgot']);router[_0x563e('0x3')]('/reset/:token',controller[_0x563e('0x6')]);module[_0x563e('0x7')]=router;
\ No newline at end of file
+var _0x63f7=['login','/forgot','forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x17cb3d,_0x183c94){var _0x5c2c21=function(_0x43e22d){while(--_0x43e22d){_0x17cb3d['push'](_0x17cb3d['shift']());}};_0x5c2c21(++_0x183c94);}(_0x63f7,0x178));var _0x763f=function(_0x4dd1f4,_0x5ea5f9){_0x4dd1f4=_0x4dd1f4-0x0;var _0x467a0a=_0x63f7[_0x4dd1f4];return _0x467a0a;};'use strict';var express=require(_0x763f('0x0'));var router=express[_0x763f('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x763f('0x2')]);router['post'](_0x763f('0x3'),controller[_0x763f('0x4')]);router[_0x763f('0x5')](_0x763f('0x6'),controller[_0x763f('0x7')]);module[_0x763f('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index abe0b7e..71f906a 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 _0x171a=['INTEGER','sequelize','exports','STRING'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x171a,0x119));var _0xa171=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x171a[_0x954b3a];return _0x3a313e;};'use strict';var Sequelize=require(_0xa171('0x0'));module[_0xa171('0x1')]={'name':{'type':Sequelize[_0xa171('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa171('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa171('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x2399=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x3d92b4,_0x53b21f){var _0x397b8f=function(_0x53ef38){while(--_0x53ef38){_0x3d92b4['push'](_0x3d92b4['shift']());}};_0x397b8f(++_0x53b21f);}(_0x2399,0x1aa));var _0x9239=function(_0x833312,_0x532c1c){_0x833312=_0x833312-0x0;var _0x55f830=_0x2399[_0x833312];return _0x55f830;};'use strict';var Sequelize=require(_0x9239('0x0'));module['exports']={'name':{'type':Sequelize[_0x9239('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9239('0x1')]},'status':{'type':Sequelize[_0x9239('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9239('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 6b305d5..089fff8 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 _0xf1df=['attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','catch','create','body','params','addConditions','Condition','ids','omit','findOne','order','getConditions','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','sendStatus','error','stack','name','send','map','Automation','fieldName','type','query','filters','intersection','model','fields'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0xf1df,0x120));var _0xff1d=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xf1df[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xff1d('0x0'));var rimraf=require(_0xff1d('0x1'));var zipdir=require(_0xff1d('0x2'));var jsonpatch=require(_0xff1d('0x3'));var rp=require(_0xff1d('0x4'));var moment=require(_0xff1d('0x5'));var BPromise=require(_0xff1d('0x6'));var Mustache=require('mustache');var util=require(_0xff1d('0x7'));var path=require(_0xff1d('0x8'));var sox=require(_0xff1d('0x9'));var csv=require(_0xff1d('0xa'));var ejs=require(_0xff1d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff1d('0xc'));var squel=require(_0xff1d('0xd'));var crypto=require(_0xff1d('0xe'));var jsforce=require(_0xff1d('0xf'));var deskjs=require(_0xff1d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xff1d('0x11'));var Papa=require(_0xff1d('0x12'));var Redis=require('ioredis');var authService=require(_0xff1d('0x13'));var qs=require(_0xff1d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff1d('0x15'))(_0xff1d('0x16'));var utils=require(_0xff1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff1d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4369bd,_0x580c7d){_0x580c7d=_0x580c7d||0xcc;return function(_0x439223){if(_0x439223){return _0x4369bd['sendStatus'](_0x580c7d);}return _0x4369bd[_0xff1d('0x19')](_0x580c7d)['end']();};}function respondWithResult(_0x280a35,_0x55b5db){_0x55b5db=_0x55b5db||0xc8;return function(_0x453421){if(_0x453421){return _0x280a35[_0xff1d('0x19')](_0x55b5db)[_0xff1d('0x1a')](_0x453421);}};}function respondWithFilteredResult(_0x45db33,_0x590673){return function(_0x14af3d){if(_0x14af3d){var _0x2290ef=typeof _0x590673[_0xff1d('0x1b')]===_0xff1d('0x1c')&&typeof _0x590673[_0xff1d('0x1d')]===_0xff1d('0x1c');var _0x28ae57=_0x14af3d[_0xff1d('0x1e')];var _0x2aa8e6=_0x2290ef?0x0:_0x590673[_0xff1d('0x1b')];var _0x5cea3e=_0x2290ef?_0x14af3d[_0xff1d('0x1e')]:_0x590673[_0xff1d('0x1b')]+_0x590673[_0xff1d('0x1d')];var _0x564483;if(_0x5cea3e>=_0x28ae57){_0x5cea3e=_0x28ae57;_0x564483=0xc8;}else{_0x564483=0xce;}_0x45db33['status'](_0x564483);return _0x45db33[_0xff1d('0x1f')](_0xff1d('0x20'),_0x2aa8e6+'-'+_0x5cea3e+'/'+_0x28ae57)[_0xff1d('0x1a')](_0x14af3d);}return null;};}function patchUpdates(_0x44eaa3){return function(_0x2c7517){try{jsonpatch['apply'](_0x2c7517,_0x44eaa3,!![]);}catch(_0x482aad){return BPromise[_0xff1d('0x21')](_0x482aad);}return _0x2c7517[_0xff1d('0x22')]();};}function saveUpdates(_0x3edf61,_0x5efeff){return function(_0x19f88b){if(_0x19f88b){return _0x19f88b[_0xff1d('0x23')](_0x3edf61)[_0xff1d('0x24')](function(_0x2d5d1e){return _0x2d5d1e;});}return null;};}function removeEntity(_0x16289d,_0x52101a){return function(_0x186a91){if(_0x186a91){return _0x186a91['destroy']()[_0xff1d('0x24')](function(){_0x16289d[_0xff1d('0x19')](0xcc)[_0xff1d('0x25')]();});}};}function handleEntityNotFound(_0x17ad15,_0x583bc1){return function(_0x531970){if(!_0x531970){_0x17ad15[_0xff1d('0x26')](0x194);}return _0x531970;};}function handleError(_0xa533e,_0x35c492){_0x35c492=_0x35c492||0x1f4;return function(_0x1fd7b9){logger[_0xff1d('0x27')](_0x1fd7b9[_0xff1d('0x28')]);if(_0x1fd7b9['name']){delete _0x1fd7b9[_0xff1d('0x29')];}_0xa533e[_0xff1d('0x19')](_0x35c492)[_0xff1d('0x2a')](_0x1fd7b9);};}exports['index']=function(_0x183d7f,_0x376ff9){var _0x2cf683={},_0x25f65d={},_0xab1958={'count':0x0,'rows':[]};var _0x2c7a1e=_[_0xff1d('0x2b')](db[_0xff1d('0x2c')]['rawAttributes'],function(_0x1cc11a){return{'name':_0x1cc11a[_0xff1d('0x2d')],'type':_0x1cc11a[_0xff1d('0x2e')]['key']};});_0x25f65d['model']=_[_0xff1d('0x2b')](_0x2c7a1e,_0xff1d('0x29'));_0x25f65d['query']=_['keys'](_0x183d7f[_0xff1d('0x2f')]);_0x25f65d[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x25f65d[_0xff1d('0x32')],_0x25f65d[_0xff1d('0x2f')]);_0x2cf683['attributes']=_[_0xff1d('0x31')](_0x25f65d[_0xff1d('0x32')],qs[_0xff1d('0x33')](_0x183d7f['query'][_0xff1d('0x33')]));_0x2cf683[_0xff1d('0x34')]=_0x2cf683[_0xff1d('0x34')][_0xff1d('0x35')]?_0x2cf683['attributes']:_0x25f65d[_0xff1d('0x32')];if(!_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x36')]('nolimit')){_0x2cf683['limit']=qs[_0xff1d('0x1d')](_0x183d7f[_0xff1d('0x2f')]['limit']);_0x2cf683[_0xff1d('0x1b')]=qs['offset'](_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x1b')]);}_0x2cf683['order']=qs[_0xff1d('0x37')](_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x37')]);_0x2cf683[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_[_0xff1d('0x39')](_0x183d7f[_0xff1d('0x2f')],_0x25f65d['filters']),_0x2c7a1e);if(_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x3a')]){_0x2cf683[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x2cf683[_0xff1d('0x38')],{'$or':_[_0xff1d('0x2b')](_0x2c7a1e,function(_0x95f3fd){if(_0x95f3fd[_0xff1d('0x2e')]!==_0xff1d('0x3c')){var _0x951d11={};_0x951d11[_0x95f3fd['name']]={'$like':'%'+_0x183d7f[_0xff1d('0x2f')]['filter']+'%'};return _0x951d11;}})});}_0x2cf683=_[_0xff1d('0x3b')]({},_0x2cf683,_0x183d7f['options']);var _0x371e85={'where':_0x2cf683[_0xff1d('0x38')]};return db[_0xff1d('0x2c')][_0xff1d('0x1e')](_0x371e85)[_0xff1d('0x24')](function(_0x9d5090){_0xab1958['count']=_0x9d5090;if(_0x183d7f[_0xff1d('0x2f')][_0xff1d('0x3d')]){_0x2cf683[_0xff1d('0x3e')]=[{'all':!![]}];}return db[_0xff1d('0x2c')][_0xff1d('0x3f')](_0x2cf683);})[_0xff1d('0x24')](function(_0x5e495c){_0xab1958[_0xff1d('0x40')]=_0x5e495c;return _0xab1958;})[_0xff1d('0x24')](respondWithFilteredResult(_0x376ff9,_0x2cf683))['catch'](handleError(_0x376ff9,null));};exports[_0xff1d('0x41')]=function(_0x1c8b22,_0x3166ec){var _0x160c8c={'raw':![],'where':{'id':_0x1c8b22['params']['id']}},_0x4d3212={};_0x4d3212['model']=_[_0xff1d('0x42')](db[_0xff1d('0x2c')][_0xff1d('0x43')]);_0x4d3212['query']=_[_0xff1d('0x42')](_0x1c8b22[_0xff1d('0x2f')]);_0x4d3212[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x4d3212['model'],_0x4d3212[_0xff1d('0x2f')]);_0x160c8c[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x4d3212['model'],qs['fields'](_0x1c8b22[_0xff1d('0x2f')][_0xff1d('0x33')]));_0x160c8c[_0xff1d('0x34')]=_0x160c8c[_0xff1d('0x34')][_0xff1d('0x35')]?_0x160c8c[_0xff1d('0x34')]:_0x4d3212[_0xff1d('0x32')];if(_0x1c8b22[_0xff1d('0x2f')][_0xff1d('0x3d')]){_0x160c8c[_0xff1d('0x3e')]=[{'all':!![]}];}_0x160c8c=_[_0xff1d('0x3b')]({},_0x160c8c,_0x1c8b22[_0xff1d('0x44')]);return db[_0xff1d('0x2c')][_0xff1d('0x45')](_0x160c8c)[_0xff1d('0x24')](handleEntityNotFound(_0x3166ec,null))['then'](respondWithResult(_0x3166ec,null))[_0xff1d('0x46')](handleError(_0x3166ec,null));};exports[_0xff1d('0x47')]=function(_0x4f43bf,_0x482810){return db[_0xff1d('0x2c')][_0xff1d('0x47')](_0x4f43bf[_0xff1d('0x48')],{})[_0xff1d('0x24')](respondWithResult(_0x482810,0xc9))[_0xff1d('0x46')](handleError(_0x482810,null));};exports['update']=function(_0x2dd719,_0x2455dc){if(_0x2dd719['body']['id']){delete _0x2dd719[_0xff1d('0x48')]['id'];}return db[_0xff1d('0x2c')]['find']({'where':{'id':_0x2dd719[_0xff1d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2455dc,null))[_0xff1d('0x24')](saveUpdates(_0x2dd719['body'],null))['then'](respondWithResult(_0x2455dc,null))['catch'](handleError(_0x2455dc,null));};exports['destroy']=function(_0x4972df,_0x455035){return db[_0xff1d('0x2c')][_0xff1d('0x45')]({'where':{'id':_0x4972df[_0xff1d('0x49')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x455035,null))[_0xff1d('0x24')](removeEntity(_0x455035,null))[_0xff1d('0x46')](handleError(_0x455035,null));};exports[_0xff1d('0x4a')]=function(_0x8a0dcc,_0x5ae423,_0x12a775){return db[_0xff1d('0x4b')][_0xff1d('0x45')]({'where':{'id':_0x8a0dcc['params']['id']}})['then'](handleEntityNotFound(_0x5ae423,null))[_0xff1d('0x24')](function(_0x4857a8){if(_0x4857a8){return _0x4857a8['addConditions'](_0x8a0dcc[_0xff1d('0x48')][_0xff1d('0x4c')],_[_0xff1d('0x4d')](_0x8a0dcc[_0xff1d('0x48')],[_0xff1d('0x4c'),'id'])||{});}})[_0xff1d('0x24')](respondWithResult(_0x5ae423,null))['catch'](handleError(_0x5ae423,null));};exports['getConditions']=function(_0x11ee8c,_0x52bd02,_0x1567a2){var _0x2dce28={};var _0x5a86a6={};var _0x58db6f;var _0x452948;return db['Automation'][_0xff1d('0x4e')]({'where':{'id':_0x11ee8c[_0xff1d('0x49')]['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x52bd02,null))[_0xff1d('0x24')](function(_0x30aac7){if(_0x30aac7){_0x58db6f=_0x30aac7;_0x5a86a6[_0xff1d('0x32')]=_['keys'](db[_0xff1d('0x4b')][_0xff1d('0x43')]);_0x5a86a6[_0xff1d('0x2f')]=_[_0xff1d('0x42')](_0x11ee8c[_0xff1d('0x2f')]);_0x5a86a6[_0xff1d('0x30')]=_['intersection'](_0x5a86a6['model'],_0x5a86a6[_0xff1d('0x2f')]);_0x2dce28[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x5a86a6[_0xff1d('0x32')],qs[_0xff1d('0x33')](_0x11ee8c[_0xff1d('0x2f')][_0xff1d('0x33')]));_0x2dce28[_0xff1d('0x34')]=_0x2dce28['attributes']['length']?_0x2dce28[_0xff1d('0x34')]:_0x5a86a6['model'];_0x2dce28[_0xff1d('0x4f')]=qs['sort'](_0x11ee8c['query'][_0xff1d('0x37')]);_0x2dce28[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_[_0xff1d('0x39')](_0x11ee8c[_0xff1d('0x2f')],_0x5a86a6[_0xff1d('0x30')]));if(_0x11ee8c[_0xff1d('0x2f')]['filter']){_0x2dce28[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x2dce28['where'],{'$or':_[_0xff1d('0x2b')](_0x2dce28[_0xff1d('0x34')],function(_0x2670af){var _0x4af003={};_0x4af003[_0x2670af]={'$like':'%'+_0x11ee8c[_0xff1d('0x2f')]['filter']+'%'};return _0x4af003;})});}_0x2dce28=_[_0xff1d('0x3b')]({},_0x2dce28,_0x11ee8c['options']);return _0x58db6f[_0xff1d('0x50')](_0x2dce28);}})['then'](function(_0x4dbf2f){if(_0x4dbf2f){_0x452948=_0x4dbf2f[_0xff1d('0x35')];if(!_0x11ee8c[_0xff1d('0x2f')]['hasOwnProperty'](_0xff1d('0x51'))){_0x2dce28['limit']=qs['limit'](_0x11ee8c[_0xff1d('0x2f')][_0xff1d('0x1d')]);_0x2dce28[_0xff1d('0x1b')]=qs[_0xff1d('0x1b')](_0x11ee8c['query']['offset']);}return _0x58db6f[_0xff1d('0x50')](_0x2dce28);}})[_0xff1d('0x24')](function(_0x4b43e8){if(_0x4b43e8){return _0x4b43e8?{'count':_0x452948,'rows':_0x4b43e8}:null;}})['then'](respondWithResult(_0x52bd02,null))[_0xff1d('0x46')](handleError(_0x52bd02,null));};exports[_0xff1d('0x52')]=function(_0x3e841e,_0x2bc698,_0x11a921){return db[_0xff1d('0x53')][_0xff1d('0x45')]({'where':{'id':_0x3e841e['params']['id']}})[_0xff1d('0x24')](handleEntityNotFound(_0x2bc698,null))['then'](function(_0x24e20f){if(_0x24e20f){return _0x24e20f[_0xff1d('0x52')](_0x3e841e[_0xff1d('0x48')][_0xff1d('0x4c')],_[_0xff1d('0x4d')](_0x3e841e[_0xff1d('0x48')],[_0xff1d('0x4c'),'id'])||{});}})[_0xff1d('0x24')](respondWithResult(_0x2bc698,null))[_0xff1d('0x46')](handleError(_0x2bc698,null));};exports[_0xff1d('0x54')]=function(_0x212135,_0x53a1fe,_0x4f5550){var _0x1f961c={};var _0x36af4d={};var _0x23e081;var _0x4e1398;return db['Automation'][_0xff1d('0x4e')]({'where':{'id':_0x212135['params']['id']}})['then'](handleEntityNotFound(_0x53a1fe,null))['then'](function(_0x4648da){if(_0x4648da){_0x23e081=_0x4648da;_0x36af4d[_0xff1d('0x32')]=_[_0xff1d('0x42')](db[_0xff1d('0x53')][_0xff1d('0x43')]);_0x36af4d[_0xff1d('0x2f')]=_['keys'](_0x212135[_0xff1d('0x2f')]);_0x36af4d[_0xff1d('0x30')]=_[_0xff1d('0x31')](_0x36af4d[_0xff1d('0x32')],_0x36af4d[_0xff1d('0x2f')]);_0x1f961c[_0xff1d('0x34')]=_[_0xff1d('0x31')](_0x36af4d['model'],qs[_0xff1d('0x33')](_0x212135['query']['fields']));_0x1f961c[_0xff1d('0x34')]=_0x1f961c['attributes'][_0xff1d('0x35')]?_0x1f961c['attributes']:_0x36af4d[_0xff1d('0x32')];_0x1f961c[_0xff1d('0x4f')]=qs[_0xff1d('0x37')](_0x212135[_0xff1d('0x2f')]['sort']);_0x1f961c[_0xff1d('0x38')]=qs[_0xff1d('0x30')](_['pick'](_0x212135[_0xff1d('0x2f')],_0x36af4d[_0xff1d('0x30')]));if(_0x212135[_0xff1d('0x2f')][_0xff1d('0x3a')]){_0x1f961c[_0xff1d('0x38')]=_[_0xff1d('0x3b')](_0x1f961c[_0xff1d('0x38')],{'$or':_[_0xff1d('0x2b')](_0x1f961c['attributes'],function(_0x15f37a){var _0x5c9f3f={};_0x5c9f3f[_0x15f37a]={'$like':'%'+_0x212135['query'][_0xff1d('0x3a')]+'%'};return _0x5c9f3f;})});}_0x1f961c=_['merge']({},_0x1f961c,_0x212135[_0xff1d('0x44')]);return _0x23e081[_0xff1d('0x54')](_0x1f961c);}})[_0xff1d('0x24')](function(_0x2d43fa){if(_0x2d43fa){_0x4e1398=_0x2d43fa[_0xff1d('0x35')];if(!_0x212135[_0xff1d('0x2f')][_0xff1d('0x36')](_0xff1d('0x51'))){_0x1f961c['limit']=qs[_0xff1d('0x1d')](_0x212135['query'][_0xff1d('0x1d')]);_0x1f961c[_0xff1d('0x1b')]=qs['offset'](_0x212135['query'][_0xff1d('0x1b')]);}return _0x23e081[_0xff1d('0x54')](_0x1f961c);}})[_0xff1d('0x24')](function(_0x55ded2){if(_0x55ded2){return _0x55ded2?{'count':_0x4e1398,'rows':_0x55ded2}:null;}})[_0xff1d('0x24')](respondWithResult(_0x53a1fe,null))['catch'](handleError(_0x53a1fe,null));};
\ No newline at end of file
+var _0x0e42=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','create','body','find','params','destroy','addConditions','omit','ids','Condition','getConditions','addActions','Action','getActions','findOne','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x13e792,_0x1b23e7){var _0xcf57f7=function(_0x3350d0){while(--_0x3350d0){_0x13e792['push'](_0x13e792['shift']());}};_0xcf57f7(++_0x1b23e7);}(_0x0e42,0xf1));var _0x20e4=function(_0x14a1f6,_0x2b89ab){_0x14a1f6=_0x14a1f6-0x0;var _0x4a8aa7=_0x0e42[_0x14a1f6];return _0x4a8aa7;};'use strict';var emlformat=require(_0x20e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20e4('0x1'));var jsonpatch=require(_0x20e4('0x2'));var rp=require(_0x20e4('0x3'));var moment=require(_0x20e4('0x4'));var BPromise=require(_0x20e4('0x5'));var Mustache=require(_0x20e4('0x6'));var util=require(_0x20e4('0x7'));var path=require(_0x20e4('0x8'));var sox=require(_0x20e4('0x9'));var csv=require(_0x20e4('0xa'));var ejs=require(_0x20e4('0xb'));var fs=require('fs');var fs_extra=require(_0x20e4('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20e4('0xd'));var jsforce=require(_0x20e4('0xe'));var deskjs=require(_0x20e4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x20e4('0x10'));var Papa=require(_0x20e4('0x11'));var Redis=require(_0x20e4('0x12'));var authService=require(_0x20e4('0x13'));var qs=require(_0x20e4('0x14'));var as=require(_0x20e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20e4('0x16'))(_0x20e4('0x17'));var utils=require(_0x20e4('0x18'));var config=require(_0x20e4('0x19'));var licenseUtil=require(_0x20e4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f769,_0x3776a2){_0x3776a2=_0x3776a2||0xcc;return function(_0x2319e4){if(_0x2319e4){return _0x11f769[_0x20e4('0x1b')](_0x3776a2);}return _0x11f769[_0x20e4('0x1c')](_0x3776a2)[_0x20e4('0x1d')]();};}function respondWithResult(_0x5a7820,_0xe82ed2){_0xe82ed2=_0xe82ed2||0xc8;return function(_0x481211){if(_0x481211){return _0x5a7820['status'](_0xe82ed2)['json'](_0x481211);}};}function respondWithFilteredResult(_0x39e658,_0x124135){return function(_0x335421){if(_0x335421){var _0x41b92f=typeof _0x124135['offset']===_0x20e4('0x1e')&&typeof _0x124135['limit']===_0x20e4('0x1e');var _0x22ef4e=_0x335421['count'];var _0x41749e=_0x41b92f?0x0:_0x124135[_0x20e4('0x1f')];var _0x3f3495=_0x41b92f?_0x335421[_0x20e4('0x20')]:_0x124135['offset']+_0x124135[_0x20e4('0x21')];var _0x72d5a9;if(_0x3f3495>=_0x22ef4e){_0x3f3495=_0x22ef4e;_0x72d5a9=0xc8;}else{_0x72d5a9=0xce;}_0x39e658['status'](_0x72d5a9);return _0x39e658[_0x20e4('0x22')](_0x20e4('0x23'),_0x41749e+'-'+_0x3f3495+'/'+_0x22ef4e)[_0x20e4('0x24')](_0x335421);}return null;};}function patchUpdates(_0x1893b3){return function(_0x578fba){try{jsonpatch[_0x20e4('0x25')](_0x578fba,_0x1893b3,!![]);}catch(_0x8721d9){return BPromise[_0x20e4('0x26')](_0x8721d9);}return _0x578fba[_0x20e4('0x27')]();};}function saveUpdates(_0x2e999b,_0x34f790){return function(_0x4a0bd0){if(_0x4a0bd0){return _0x4a0bd0[_0x20e4('0x28')](_0x2e999b)[_0x20e4('0x29')](function(_0x460a81){return _0x460a81;});}return null;};}function removeEntity(_0x203dfc,_0x474497){return function(_0x43e6e9){if(_0x43e6e9){return _0x43e6e9['destroy']()[_0x20e4('0x29')](function(){_0x203dfc[_0x20e4('0x1c')](0xcc)[_0x20e4('0x1d')]();});}};}function handleEntityNotFound(_0x510a21,_0x535be0){return function(_0x34cc38){if(!_0x34cc38){_0x510a21[_0x20e4('0x1b')](0x194);}return _0x34cc38;};}function handleError(_0xda5456,_0x6d7195){_0x6d7195=_0x6d7195||0x1f4;return function(_0x4dc939){logger[_0x20e4('0x2a')](_0x4dc939[_0x20e4('0x2b')]);if(_0x4dc939[_0x20e4('0x2c')]){delete _0x4dc939[_0x20e4('0x2c')];}_0xda5456[_0x20e4('0x1c')](_0x6d7195)['send'](_0x4dc939);};}exports[_0x20e4('0x2d')]=function(_0x38ff66,_0x242b8f){var _0x44bd10={},_0x1f6eed={},_0x582f4c={'count':0x0,'rows':[]};var _0x36c6ee=_[_0x20e4('0x2e')](db[_0x20e4('0x2f')][_0x20e4('0x30')],function(_0x2de529){return{'name':_0x2de529[_0x20e4('0x31')],'type':_0x2de529[_0x20e4('0x32')][_0x20e4('0x33')]};});_0x1f6eed[_0x20e4('0x34')]=_[_0x20e4('0x2e')](_0x36c6ee,_0x20e4('0x2c'));_0x1f6eed[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x38ff66['query']);_0x1f6eed[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x1f6eed[_0x20e4('0x34')],_0x1f6eed['query']);_0x44bd10['attributes']=_[_0x20e4('0x38')](_0x1f6eed[_0x20e4('0x34')],qs[_0x20e4('0x39')](_0x38ff66[_0x20e4('0x35')][_0x20e4('0x39')]));_0x44bd10[_0x20e4('0x3a')]=_0x44bd10[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x44bd10[_0x20e4('0x3a')]:_0x1f6eed[_0x20e4('0x34')];if(!_0x38ff66[_0x20e4('0x35')][_0x20e4('0x3c')](_0x20e4('0x3d'))){_0x44bd10[_0x20e4('0x21')]=qs[_0x20e4('0x21')](_0x38ff66['query'][_0x20e4('0x21')]);_0x44bd10[_0x20e4('0x1f')]=qs[_0x20e4('0x1f')](_0x38ff66[_0x20e4('0x35')][_0x20e4('0x1f')]);}_0x44bd10['order']=qs[_0x20e4('0x3e')](_0x38ff66['query'][_0x20e4('0x3e')]);_0x44bd10[_0x20e4('0x3f')]=qs[_0x20e4('0x37')](_['pick'](_0x38ff66[_0x20e4('0x35')],_0x1f6eed[_0x20e4('0x37')]),_0x36c6ee);if(_0x38ff66[_0x20e4('0x35')][_0x20e4('0x40')]){_0x44bd10[_0x20e4('0x3f')]=_[_0x20e4('0x41')](_0x44bd10['where'],{'$or':_[_0x20e4('0x2e')](_0x36c6ee,function(_0x15d976){if(_0x15d976[_0x20e4('0x32')]!==_0x20e4('0x42')){var _0x23dacf={};_0x23dacf[_0x15d976[_0x20e4('0x2c')]]={'$like':'%'+_0x38ff66[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x23dacf;}})});}_0x44bd10=_[_0x20e4('0x41')]({},_0x44bd10,_0x38ff66['options']);var _0x43efc6={'where':_0x44bd10[_0x20e4('0x3f')]};return db[_0x20e4('0x2f')][_0x20e4('0x20')](_0x43efc6)[_0x20e4('0x29')](function(_0x3b8476){_0x582f4c[_0x20e4('0x20')]=_0x3b8476;if(_0x38ff66['query'][_0x20e4('0x43')]){_0x44bd10[_0x20e4('0x44')]=[{'all':!![]}];}return db[_0x20e4('0x2f')][_0x20e4('0x45')](_0x44bd10);})[_0x20e4('0x29')](function(_0x6df77e){_0x582f4c['rows']=_0x6df77e;return _0x582f4c;})[_0x20e4('0x29')](respondWithFilteredResult(_0x242b8f,_0x44bd10))[_0x20e4('0x46')](handleError(_0x242b8f,null));};exports[_0x20e4('0x47')]=function(_0x2a84bc,_0x532b9f){var _0x158eaf={'raw':![],'where':{'id':_0x2a84bc['params']['id']}},_0x23f8d2={};_0x23f8d2[_0x20e4('0x34')]=_[_0x20e4('0x36')](db[_0x20e4('0x2f')][_0x20e4('0x30')]);_0x23f8d2['query']=_[_0x20e4('0x36')](_0x2a84bc['query']);_0x23f8d2[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x23f8d2[_0x20e4('0x34')],_0x23f8d2[_0x20e4('0x35')]);_0x158eaf['attributes']=_[_0x20e4('0x38')](_0x23f8d2['model'],qs[_0x20e4('0x39')](_0x2a84bc[_0x20e4('0x35')][_0x20e4('0x39')]));_0x158eaf['attributes']=_0x158eaf[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x158eaf[_0x20e4('0x3a')]:_0x23f8d2[_0x20e4('0x34')];if(_0x2a84bc[_0x20e4('0x35')]['includeAll']){_0x158eaf['include']=[{'all':!![]}];}_0x158eaf=_[_0x20e4('0x41')]({},_0x158eaf,_0x2a84bc[_0x20e4('0x48')]);return db['Automation']['find'](_0x158eaf)['then'](handleEntityNotFound(_0x532b9f,null))[_0x20e4('0x29')](respondWithResult(_0x532b9f,null))[_0x20e4('0x46')](handleError(_0x532b9f,null));};exports[_0x20e4('0x49')]=function(_0x2b8463,_0x3050e8){return db[_0x20e4('0x2f')][_0x20e4('0x49')](_0x2b8463['body'],{})[_0x20e4('0x29')](respondWithResult(_0x3050e8,0xc9))['catch'](handleError(_0x3050e8,null));};exports['update']=function(_0x7d1ef8,_0x55ff7c){if(_0x7d1ef8[_0x20e4('0x4a')]['id']){delete _0x7d1ef8[_0x20e4('0x4a')]['id'];}return db[_0x20e4('0x2f')][_0x20e4('0x4b')]({'where':{'id':_0x7d1ef8[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x55ff7c,null))[_0x20e4('0x29')](saveUpdates(_0x7d1ef8[_0x20e4('0x4a')],null))[_0x20e4('0x29')](respondWithResult(_0x55ff7c,null))[_0x20e4('0x46')](handleError(_0x55ff7c,null));};exports[_0x20e4('0x4d')]=function(_0x5eb53,_0x45265b){return db[_0x20e4('0x2f')]['find']({'where':{'id':_0x5eb53[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x45265b,null))[_0x20e4('0x29')](removeEntity(_0x45265b,null))[_0x20e4('0x46')](handleError(_0x45265b,null));};exports[_0x20e4('0x4e')]=function(_0xb0573f,_0x4389d0,_0x39e83d){return db['Condition'][_0x20e4('0x4b')]({'where':{'id':_0xb0573f[_0x20e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4389d0,null))[_0x20e4('0x29')](function(_0x45b447){if(_0x45b447){return _0x45b447[_0x20e4('0x4e')](_0xb0573f[_0x20e4('0x4a')]['ids'],_[_0x20e4('0x4f')](_0xb0573f[_0x20e4('0x4a')],[_0x20e4('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4389d0,null))[_0x20e4('0x46')](handleError(_0x4389d0,null));};exports['getConditions']=function(_0x4414c6,_0x370a18,_0xb7d54e){var _0x179640={};var _0x39faa8={};var _0x223ebf;var _0x132746;return db[_0x20e4('0x2f')]['findOne']({'where':{'id':_0x4414c6['params']['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x370a18,null))[_0x20e4('0x29')](function(_0x343a7b){if(_0x343a7b){_0x223ebf=_0x343a7b;_0x39faa8[_0x20e4('0x34')]=_[_0x20e4('0x36')](db[_0x20e4('0x51')][_0x20e4('0x30')]);_0x39faa8[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x4414c6['query']);_0x39faa8[_0x20e4('0x37')]=_['intersection'](_0x39faa8[_0x20e4('0x34')],_0x39faa8[_0x20e4('0x35')]);_0x179640[_0x20e4('0x3a')]=_[_0x20e4('0x38')](_0x39faa8['model'],qs[_0x20e4('0x39')](_0x4414c6[_0x20e4('0x35')][_0x20e4('0x39')]));_0x179640[_0x20e4('0x3a')]=_0x179640[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x179640[_0x20e4('0x3a')]:_0x39faa8[_0x20e4('0x34')];_0x179640['order']=qs[_0x20e4('0x3e')](_0x4414c6[_0x20e4('0x35')][_0x20e4('0x3e')]);_0x179640[_0x20e4('0x3f')]=qs[_0x20e4('0x37')](_['pick'](_0x4414c6[_0x20e4('0x35')],_0x39faa8[_0x20e4('0x37')]));if(_0x4414c6[_0x20e4('0x35')][_0x20e4('0x40')]){_0x179640[_0x20e4('0x3f')]=_['merge'](_0x179640[_0x20e4('0x3f')],{'$or':_[_0x20e4('0x2e')](_0x179640[_0x20e4('0x3a')],function(_0x287f37){var _0x814bf6={};_0x814bf6[_0x287f37]={'$like':'%'+_0x4414c6[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x814bf6;})});}_0x179640=_['merge']({},_0x179640,_0x4414c6[_0x20e4('0x48')]);return _0x223ebf[_0x20e4('0x52')](_0x179640);}})[_0x20e4('0x29')](function(_0x120e71){if(_0x120e71){_0x132746=_0x120e71[_0x20e4('0x3b')];if(!_0x4414c6[_0x20e4('0x35')][_0x20e4('0x3c')](_0x20e4('0x3d'))){_0x179640[_0x20e4('0x21')]=qs['limit'](_0x4414c6['query']['limit']);_0x179640[_0x20e4('0x1f')]=qs[_0x20e4('0x1f')](_0x4414c6[_0x20e4('0x35')]['offset']);}return _0x223ebf['getConditions'](_0x179640);}})[_0x20e4('0x29')](function(_0x22e11f){if(_0x22e11f){return _0x22e11f?{'count':_0x132746,'rows':_0x22e11f}:null;}})[_0x20e4('0x29')](respondWithResult(_0x370a18,null))[_0x20e4('0x46')](handleError(_0x370a18,null));};exports[_0x20e4('0x53')]=function(_0x11bd98,_0x3418dc,_0x282fcc){return db[_0x20e4('0x54')]['find']({'where':{'id':_0x11bd98[_0x20e4('0x4c')]['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x3418dc,null))[_0x20e4('0x29')](function(_0x7ae5e0){if(_0x7ae5e0){return _0x7ae5e0['addActions'](_0x11bd98['body'][_0x20e4('0x50')],_[_0x20e4('0x4f')](_0x11bd98[_0x20e4('0x4a')],['ids','id'])||{});}})[_0x20e4('0x29')](respondWithResult(_0x3418dc,null))[_0x20e4('0x46')](handleError(_0x3418dc,null));};exports[_0x20e4('0x55')]=function(_0x51f721,_0x49c154,_0x5c96e9){var _0x4d9a49={};var _0x353bf0={};var _0x916124;var _0x67bb36;return db[_0x20e4('0x2f')][_0x20e4('0x56')]({'where':{'id':_0x51f721['params']['id']}})[_0x20e4('0x29')](handleEntityNotFound(_0x49c154,null))[_0x20e4('0x29')](function(_0x168c88){if(_0x168c88){_0x916124=_0x168c88;_0x353bf0[_0x20e4('0x34')]=_['keys'](db[_0x20e4('0x54')][_0x20e4('0x30')]);_0x353bf0[_0x20e4('0x35')]=_[_0x20e4('0x36')](_0x51f721[_0x20e4('0x35')]);_0x353bf0[_0x20e4('0x37')]=_[_0x20e4('0x38')](_0x353bf0[_0x20e4('0x34')],_0x353bf0['query']);_0x4d9a49[_0x20e4('0x3a')]=_[_0x20e4('0x38')](_0x353bf0[_0x20e4('0x34')],qs[_0x20e4('0x39')](_0x51f721[_0x20e4('0x35')]['fields']));_0x4d9a49[_0x20e4('0x3a')]=_0x4d9a49[_0x20e4('0x3a')][_0x20e4('0x3b')]?_0x4d9a49['attributes']:_0x353bf0['model'];_0x4d9a49[_0x20e4('0x57')]=qs[_0x20e4('0x3e')](_0x51f721[_0x20e4('0x35')]['sort']);_0x4d9a49[_0x20e4('0x3f')]=qs['filters'](_['pick'](_0x51f721['query'],_0x353bf0[_0x20e4('0x37')]));if(_0x51f721[_0x20e4('0x35')][_0x20e4('0x40')]){_0x4d9a49['where']=_['merge'](_0x4d9a49[_0x20e4('0x3f')],{'$or':_[_0x20e4('0x2e')](_0x4d9a49[_0x20e4('0x3a')],function(_0x1b8291){var _0x8175fd={};_0x8175fd[_0x1b8291]={'$like':'%'+_0x51f721[_0x20e4('0x35')][_0x20e4('0x40')]+'%'};return _0x8175fd;})});}_0x4d9a49=_[_0x20e4('0x41')]({},_0x4d9a49,_0x51f721[_0x20e4('0x48')]);return _0x916124[_0x20e4('0x55')](_0x4d9a49);}})[_0x20e4('0x29')](function(_0x364200){if(_0x364200){_0x67bb36=_0x364200[_0x20e4('0x3b')];if(!_0x51f721['query'][_0x20e4('0x3c')]('nolimit')){_0x4d9a49[_0x20e4('0x21')]=qs[_0x20e4('0x21')](_0x51f721[_0x20e4('0x35')][_0x20e4('0x21')]);_0x4d9a49['offset']=qs[_0x20e4('0x1f')](_0x51f721['query'][_0x20e4('0x1f')]);}return _0x916124[_0x20e4('0x55')](_0x4d9a49);}})[_0x20e4('0x29')](function(_0x9f60b0){if(_0x9f60b0){return _0x9f60b0?{'count':_0x67bb36,'rows':_0x9f60b0}:null;}})['then'](respondWithResult(_0x49c154,null))[_0x20e4('0x46')](handleError(_0x49c154,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3d6a7af..24fe615 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 _0xf874=['./automation.attributes','exports','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1eb41e,_0x4f0ee8){var _0x6d8ace=function(_0x5deada){while(--_0x5deada){_0x1eb41e['push'](_0x1eb41e['shift']());}};_0x6d8ace(++_0x4f0ee8);}(_0xf874,0x10b));var _0x4f87=function(_0x44be6e,_0x1c4d3c){_0x44be6e=_0x44be6e-0x0;var _0x8f58ba=_0xf874[_0x44be6e];return _0x8f58ba;};'use strict';var _=require(_0x4f87('0x0'));var util=require(_0x4f87('0x1'));var logger=require(_0x4f87('0x2'))('api');var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var rp=require(_0x4f87('0x5'));var fs=require('fs');var path=require(_0x4f87('0x6'));var rimraf=require(_0x4f87('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f87('0x8'));module[_0x4f87('0x9')]=function(_0x3299de,_0x19ac66){return _0x3299de['define']('Automation',attributes,{'tableName':_0x4f87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd6d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd6d,0x1ce));var _0xdfd6=function(_0xa5f911,_0x4881a0){_0xa5f911=_0xa5f911-0x0;var _0xe3521d=_0xfd6d[_0xa5f911];return _0xe3521d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfd6('0x0'))('api');var moment=require(_0xdfd6('0x1'));var BPromise=require(_0xdfd6('0x2'));var rp=require(_0xdfd6('0x3'));var fs=require('fs');var path=require(_0xdfd6('0x4'));var rimraf=require(_0xdfd6('0x5'));var config=require(_0xdfd6('0x6'));var attributes=require(_0xdfd6('0x7'));module[_0xdfd6('0x8')]=function(_0x10210b,_0x1a630c){return _0x10210b['define'](_0xdfd6('0x9'),attributes,{'tableName':_0xdfd6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 0f98eec..17987c2 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 _0xf277=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf277,0x1e1));var _0x7f27=function(_0x3f1250,_0x4aeaf6){_0x3f1250=_0x3f1250-0x0;var _0xd9eb25=_0xf277[_0x3f1250];return _0xd9eb25;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var moment=require('moment');var BPromise=require(_0x7f27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f27('0x3'));var db=require(_0x7f27('0x4'))['db'];var utils=require(_0x7f27('0x5'));var logger=require(_0x7f27('0x6'))(_0x7f27('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f27('0x8'));var client=jayson['client'][_0x7f27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39dcee,_0x480cd6,_0x23dbcc){return new BPromise(function(_0x25c4dc,_0x5c0dbb){return client[_0x7f27('0xa')](_0x39dcee,_0x23dbcc)[_0x7f27('0xb')](function(_0x8ecc84){logger[_0x7f27('0xc')]('Automation,\x20%s,\x20%s',_0x480cd6,'request\x20sent');logger[_0x7f27('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'),JSON[_0x7f27('0xf')](_0x8ecc84));if(_0x8ecc84[_0x7f27('0x10')]){if(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x11')]===0x1f4){logger[_0x7f27('0x10')]('Automation,\x20%s,\x20%s',_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x5c0dbb(_0x8ecc84['error'][_0x7f27('0x12')]);}logger[_0x7f27('0x10')](_0x7f27('0x13'),_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x25c4dc(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);}else{logger[_0x7f27('0xc')]('Automation,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'));_0x25c4dc(_0x8ecc84[_0x7f27('0x14')]['message']);}})[_0x7f27('0x15')](function(_0x402610){logger['error'](_0x7f27('0x13'),_0x480cd6,_0x402610);_0x5c0dbb(_0x402610);});});}
\ No newline at end of file
+var _0x1d63=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x1d63,0xa4));var _0x31d6=function(_0x1b2697,_0x401cc6){_0x1b2697=_0x1b2697-0x0;var _0x3e56cb=_0x1d63[_0x1b2697];return _0x3e56cb;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rs=require(_0x31d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31d6('0x5'))['db'];var utils=require(_0x31d6('0x6'));var logger=require(_0x31d6('0x7'))(_0x31d6('0x8'));var config=require(_0x31d6('0x9'));var jayson=require(_0x31d6('0xa'));var client=jayson[_0x31d6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36b549,_0x6cc83b,_0x4fee16){return new BPromise(function(_0x34a5e3,_0x2c1b36){return client['request'](_0x36b549,_0x4fee16)['then'](function(_0x4b32f8){logger[_0x31d6('0xc')](_0x31d6('0xd'),_0x6cc83b,_0x31d6('0xe'));logger['debug'](_0x31d6('0xf'),_0x6cc83b,_0x31d6('0xe'),JSON[_0x31d6('0x10')](_0x4b32f8));if(_0x4b32f8[_0x31d6('0x11')]){if(_0x4b32f8[_0x31d6('0x11')]['code']===0x1f4){logger[_0x31d6('0x11')](_0x31d6('0xd'),_0x6cc83b,_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);return _0x2c1b36(_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);}logger['error'](_0x31d6('0xd'),_0x6cc83b,_0x4b32f8[_0x31d6('0x11')][_0x31d6('0x12')]);return _0x34a5e3(_0x4b32f8[_0x31d6('0x11')]['message']);}else{logger[_0x31d6('0xc')]('Automation,\x20%s,\x20%s',_0x6cc83b,_0x31d6('0xe'));_0x34a5e3(_0x4b32f8[_0x31d6('0x13')][_0x31d6('0x12')]);}})[_0x31d6('0x14')](function(_0x189784){logger[_0x31d6('0x11')]('Automation,\x20%s,\x20%s',_0x6cc83b,_0x189784);_0x2c1b36(_0x189784);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 3eb1012..a2ef366 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 _0x10eb=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getConditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','multer','path'];(function(_0x4ee664,_0x4e8df5){var _0x292dcb=function(_0x473f50){while(--_0x473f50){_0x4ee664['push'](_0x4ee664['shift']());}};_0x292dcb(++_0x4e8df5);}(_0x10eb,0x71));var _0xb10e=function(_0x424ecd,_0x3a8667){_0x424ecd=_0x424ecd-0x0;var _0x280e69=_0x10eb[_0x424ecd];return _0x280e69;};'use strict';var multer=require(_0xb10e('0x0'));var util=require('util');var path=require(_0xb10e('0x1'));var timeout=require(_0xb10e('0x2'));var express=require(_0xb10e('0x3'));var router=express[_0xb10e('0x4')]();var fs_extra=require(_0xb10e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb10e('0x6'));var config=require(_0xb10e('0x7'));var controller=require('./automation.controller');router['get']('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x9')]);router[_0xb10e('0xa')](_0xb10e('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0xb10e('0xc')]);router[_0xb10e('0xa')](_0xb10e('0xd'),auth[_0xb10e('0x8')](),controller[_0xb10e('0xe')]);router[_0xb10e('0xf')]('/',auth[_0xb10e('0x8')](),controller[_0xb10e('0x10')]);router[_0xb10e('0xf')]('/:id/conditions',auth[_0xb10e('0x8')](),controller[_0xb10e('0x11')]);router[_0xb10e('0xf')]('/:id/actions',auth[_0xb10e('0x8')](),controller['addActions']);router[_0xb10e('0x12')](_0xb10e('0xb'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x13')]);router[_0xb10e('0x14')](_0xb10e('0xb'),auth[_0xb10e('0x8')](),controller[_0xb10e('0x15')]);module[_0xb10e('0x16')]=router;
\ No newline at end of file
+var _0x4f29=['/:id','isAuthenticated','show','getActions','post','/:id/conditions','addConditions','/:id/actions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0xe58b5,_0x48dec0){var _0x1366c6=function(_0x2df8b2){while(--_0x2df8b2){_0xe58b5['push'](_0xe58b5['shift']());}};_0x1366c6(++_0x48dec0);}(_0x4f29,0xfd));var _0x94f2=function(_0x19b121,_0x4a10a7){_0x19b121=_0x19b121-0x0;var _0x3a8c15=_0x4f29[_0x19b121];return _0x3a8c15;};'use strict';var multer=require('multer');var util=require(_0x94f2('0x0'));var path=require(_0x94f2('0x1'));var timeout=require(_0x94f2('0x2'));var express=require(_0x94f2('0x3'));var router=express[_0x94f2('0x4')]();var fs_extra=require(_0x94f2('0x5'));var auth=require(_0x94f2('0x6'));var interaction=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var controller=require(_0x94f2('0x9'));router[_0x94f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x94f2('0xa')](_0x94f2('0xb'),auth[_0x94f2('0xc')](),controller[_0x94f2('0xd')]);router[_0x94f2('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x94f2('0xa')]('/:id/actions',auth[_0x94f2('0xc')](),controller[_0x94f2('0xe')]);router[_0x94f2('0xf')]('/',auth[_0x94f2('0xc')](),controller['create']);router[_0x94f2('0xf')](_0x94f2('0x10'),auth[_0x94f2('0xc')](),controller[_0x94f2('0x11')]);router[_0x94f2('0xf')](_0x94f2('0x12'),auth[_0x94f2('0xc')](),controller['addActions']);router[_0x94f2('0x13')]('/:id',auth[_0x94f2('0xc')](),controller[_0x94f2('0x14')]);router[_0x94f2('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x94f2('0x16')]);module[_0x94f2('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f4a2c92..e113f62 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 _0x8747=['STRING','name','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Initial\x20Silence','#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','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8747,0x1ba));var _0x7874=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x8747[_0x48e1ec];return _0x3b33eb;};'use strict';var Sequelize=require(_0x7874('0x0'));module[_0x7874('0x1')]={'name':{'type':Sequelize[_0x7874('0x2')],'unique':_0x7874('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7874('0x2')]},'active':{'type':Sequelize[_0x7874('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x7874('0x5')](0x4)[_0x7874('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7874('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7874('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7874('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7874('0x6')],'defaultValue':0x3,'comment':_0x7874('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7874('0xd')},'dialTimezone':{'type':Sequelize[_0x7874('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7874('0x2')],'defaultValue':_0x7874('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7874('0xf'),_0x7874('0x10'),'onlyIfOpen'),'defaultValue':_0x7874('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7874('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7874('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7874('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7874('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7874('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7874('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7874('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7874('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7874('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7874('0x5')](0x9)[_0x7874('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7874('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7874('0x19')](_0x7874('0x1a'),_0x7874('0x1b')),'defaultValue':_0x7874('0x1a')},'dialPrefix':{'type':Sequelize[_0x7874('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7874('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7874('0x1c')},'dialCutDigit':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x7874('0x5')](0x3)[_0x7874('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)[_0x7874('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7874('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7874('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7874('0x24')}};
\ No newline at end of file
+var _0xf161=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','STRING','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x494452,_0x5b9635){var _0x456e08=function(_0xf79cd4){while(--_0xf79cd4){_0x494452['push'](_0x494452['shift']());}};_0x456e08(++_0x5b9635);}(_0xf161,0x1e2));var _0x1f16=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xf161[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require(_0x1f16('0x0'));module[_0x1f16('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1f16('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1f16('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1f16('0x4')]},'active':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1f16('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f16('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1f16('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1f16('0xe')},'dialTimezone':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1f16('0xf'),_0x1f16('0x10'),'onlyIfOpen'),'defaultValue':_0x1f16('0xf')},'dialAMDActive':{'type':Sequelize[_0x1f16('0x5')],'defaultValue':0x0,'comment':_0x1f16('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1f16('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1f16('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f16('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f16('0x6')](0x9)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f16('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f16('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f16('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f16('0x3')](_0x1f16('0x18'),_0x1f16('0x19')),'defaultValue':_0x1f16('0x18')},'dialPrefix':{'type':Sequelize[_0x1f16('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f16('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f16('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1f16('0x6')](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f16('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f16('0x6')](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f16('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f16('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 6214f48..de79d2c 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 _0x79f9=['role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','clone','params','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','nolimit','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','ListId','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','all','removeLists','getBlackLists','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get','IvrCampaigns','stack','name','send','map','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','create','body','user'];(function(_0x5063ad,_0x102ace){var _0x5b48cd=function(_0x29eb8a){while(--_0x29eb8a){_0x5063ad['push'](_0x5063ad['shift']());}};_0x5b48cd(++_0x102ace);}(_0x79f9,0xba));var _0x979f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x79f9[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x979f('0x0'));var rimraf=require(_0x979f('0x1'));var zipdir=require(_0x979f('0x2'));var jsonpatch=require(_0x979f('0x3'));var rp=require(_0x979f('0x4'));var moment=require('moment');var BPromise=require(_0x979f('0x5'));var Mustache=require(_0x979f('0x6'));var util=require(_0x979f('0x7'));var path=require(_0x979f('0x8'));var sox=require('sox');var csv=require(_0x979f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x979f('0xa'));var _=require('lodash');var squel=require(_0x979f('0xb'));var crypto=require('crypto');var jsforce=require(_0x979f('0xc'));var deskjs=require(_0x979f('0xd'));var toCsv=require(_0x979f('0x9'));var querystring=require('querystring');var Papa=require(_0x979f('0xe'));var Redis=require('ioredis');var authService=require(_0x979f('0xf'));var qs=require(_0x979f('0x10'));var as=require(_0x979f('0x11'));var hardwareService=require(_0x979f('0x12'));var logger=require(_0x979f('0x13'))(_0x979f('0x14'));var utils=require(_0x979f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121814,_0x5b20a6){_0x5b20a6=_0x5b20a6||0xcc;return function(_0xd60c0d){if(_0xd60c0d){return _0x121814[_0x979f('0x16')](_0x5b20a6);}return _0x121814[_0x979f('0x17')](_0x5b20a6)[_0x979f('0x18')]();};}function respondWithResult(_0x19f99a,_0xfd2fdb){_0xfd2fdb=_0xfd2fdb||0xc8;return function(_0x47f4ef){if(_0x47f4ef){return _0x19f99a['status'](_0xfd2fdb)[_0x979f('0x19')](_0x47f4ef);}};}function respondWithFilteredResult(_0x462da3,_0x492252){return function(_0x4d69f6){if(_0x4d69f6){var _0x2a6674=typeof _0x492252[_0x979f('0x1a')]===_0x979f('0x1b')&&typeof _0x492252['limit']==='undefined';var _0x5f1887=_0x4d69f6[_0x979f('0x1c')];var _0x147685=_0x2a6674?0x0:_0x492252[_0x979f('0x1a')];var _0x4a9eeb=_0x2a6674?_0x4d69f6[_0x979f('0x1c')]:_0x492252['offset']+_0x492252['limit'];var _0xfb9bf7;if(_0x4a9eeb>=_0x5f1887){_0x4a9eeb=_0x5f1887;_0xfb9bf7=0xc8;}else{_0xfb9bf7=0xce;}_0x462da3[_0x979f('0x17')](_0xfb9bf7);return _0x462da3[_0x979f('0x1d')](_0x979f('0x1e'),_0x147685+'-'+_0x4a9eeb+'/'+_0x5f1887)['json'](_0x4d69f6);}return null;};}function patchUpdates(_0x9dadaf){return function(_0x132c7c){try{jsonpatch[_0x979f('0x1f')](_0x132c7c,_0x9dadaf,!![]);}catch(_0x3922d0){return BPromise[_0x979f('0x20')](_0x3922d0);}return _0x132c7c['save']();};}function saveUpdates(_0x34269d,_0x428d56){return function(_0x57b847){if(_0x57b847){return _0x57b847['update'](_0x34269d)[_0x979f('0x21')](function(_0x44eec8){return _0x44eec8;});}return null;};}function removeEntity(_0x3ebde7,_0x4d4595){return function(_0x4400bb){if(_0x4400bb){return _0x4400bb[_0x979f('0x22')]()['then'](function(){var _0x2bf9b0=_0x4400bb[_0x979f('0x23')]({'plain':!![]});var _0x523061=_0x979f('0x24');return db['UserProfileResource'][_0x979f('0x22')]({'where':{'type':_0x523061,'resourceId':_0x2bf9b0['id']}})[_0x979f('0x21')](function(){return _0x4400bb;});})['then'](function(){_0x3ebde7[_0x979f('0x17')](0xcc)[_0x979f('0x18')]();});}};}function handleEntityNotFound(_0x429320,_0x2bf025){return function(_0x42fc1a){if(!_0x42fc1a){_0x429320[_0x979f('0x16')](0x194);}return _0x42fc1a;};}function handleError(_0x5152d8,_0x55bf0b){_0x55bf0b=_0x55bf0b||0x1f4;return function(_0x2d71bb){logger['error'](_0x2d71bb[_0x979f('0x25')]);if(_0x2d71bb[_0x979f('0x26')]){delete _0x2d71bb[_0x979f('0x26')];}_0x5152d8[_0x979f('0x17')](_0x55bf0b)[_0x979f('0x27')](_0x2d71bb);};}exports['index']=function(_0x4c8bc0,_0x59ed0f){var _0x451b4e={},_0x22bb1a={},_0x19609c={'count':0x0,'rows':[]};var _0x3a381c=_[_0x979f('0x28')](db['Campaign']['rawAttributes'],function(_0x2992e6){return{'name':_0x2992e6[_0x979f('0x29')],'type':_0x2992e6[_0x979f('0x2a')]['key']};});_0x22bb1a[_0x979f('0x2b')]=_['map'](_0x3a381c,_0x979f('0x26'));_0x22bb1a['query']=_['keys'](_0x4c8bc0['query']);_0x22bb1a[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x22bb1a[_0x979f('0x2b')],_0x22bb1a[_0x979f('0x2e')]);_0x451b4e[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x22bb1a['model'],qs[_0x979f('0x30')](_0x4c8bc0['query'][_0x979f('0x30')]));_0x451b4e[_0x979f('0x2f')]=_0x451b4e[_0x979f('0x2f')][_0x979f('0x31')]?_0x451b4e[_0x979f('0x2f')]:_0x22bb1a[_0x979f('0x2b')];if(!_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x32')]('nolimit')){_0x451b4e[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x33')]);_0x451b4e['offset']=qs[_0x979f('0x1a')](_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x1a')]);}_0x451b4e[_0x979f('0x34')]=qs[_0x979f('0x35')](_0x4c8bc0[_0x979f('0x2e')]['sort']);_0x451b4e[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x4c8bc0['query'],_0x22bb1a[_0x979f('0x2c')]),_0x3a381c);if(_0x4c8bc0['query']['filter']){_0x451b4e[_0x979f('0x36')]=_[_0x979f('0x38')](_0x451b4e[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x3a381c,function(_0xf2acb1){if(_0xf2acb1[_0x979f('0x2a')]!==_0x979f('0x39')){var _0x53c7f8={};_0x53c7f8[_0xf2acb1['name']]={'$like':'%'+_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x53c7f8;}})});}_0x451b4e=_[_0x979f('0x38')]({},_0x451b4e,_0x4c8bc0[_0x979f('0x3b')]);var _0x477f2e={'where':_0x451b4e[_0x979f('0x36')]};return db[_0x979f('0x3c')][_0x979f('0x1c')](_0x477f2e)[_0x979f('0x21')](function(_0x28788c){_0x19609c[_0x979f('0x1c')]=_0x28788c;if(_0x4c8bc0[_0x979f('0x2e')][_0x979f('0x3d')]){_0x451b4e[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x3c')][_0x979f('0x3f')](_0x451b4e);})['then'](function(_0x2a9437){_0x19609c[_0x979f('0x40')]=_0x2a9437;return _0x19609c;})['then'](respondWithFilteredResult(_0x59ed0f,_0x451b4e))[_0x979f('0x41')](handleError(_0x59ed0f,null));};exports[_0x979f('0x42')]=function(_0x260a91,_0x4d6907){var _0x40f3c5={'raw':![],'where':{'id':_0x260a91['params']['id']}},_0x282276={};_0x282276['model']=_['keys'](db[_0x979f('0x3c')][_0x979f('0x43')]);_0x282276[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x260a91[_0x979f('0x2e')]);_0x282276[_0x979f('0x2c')]=_['intersection'](_0x282276[_0x979f('0x2b')],_0x282276[_0x979f('0x2e')]);_0x40f3c5[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x282276[_0x979f('0x2b')],qs[_0x979f('0x30')](_0x260a91[_0x979f('0x2e')][_0x979f('0x30')]));_0x40f3c5[_0x979f('0x2f')]=_0x40f3c5[_0x979f('0x2f')][_0x979f('0x31')]?_0x40f3c5[_0x979f('0x2f')]:_0x282276[_0x979f('0x2b')];if(_0x260a91[_0x979f('0x2e')]['includeAll']){_0x40f3c5['include']=[{'all':!![]}];}_0x40f3c5=_[_0x979f('0x38')]({},_0x40f3c5,_0x260a91[_0x979f('0x3b')]);return db[_0x979f('0x3c')]['find'](_0x40f3c5)[_0x979f('0x21')](handleEntityNotFound(_0x4d6907,null))[_0x979f('0x21')](respondWithResult(_0x4d6907,null))[_0x979f('0x41')](handleError(_0x4d6907,null));};exports[_0x979f('0x45')]=function(_0x48297f,_0x347afa){return db[_0x979f('0x3c')][_0x979f('0x45')](_0x48297f[_0x979f('0x46')],{})['then'](function(_0x2ee098){var _0x4853ba=_0x48297f[_0x979f('0x47')][_0x979f('0x23')]({'plain':!![]});if(!_0x4853ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4853ba[_0x979f('0x48')]===_0x979f('0x47')){var _0x1aa4f1=_0x2ee098[_0x979f('0x23')]({'plain':!![]});var _0x46a09e='IvrCampaigns';return db[_0x979f('0x49')][_0x979f('0x4a')]({'where':{'name':_0x46a09e,'userProfileId':_0x4853ba[_0x979f('0x4b')]},'raw':!![]})[_0x979f('0x21')](function(_0x53bbb6){if(_0x53bbb6&&_0x53bbb6[_0x979f('0x4c')]===0x0){return db[_0x979f('0x4d')][_0x979f('0x45')]({'name':_0x1aa4f1[_0x979f('0x26')],'resourceId':_0x1aa4f1['id'],'type':_0x53bbb6[_0x979f('0x26')],'sectionId':_0x53bbb6['id']},{})[_0x979f('0x21')](function(){return _0x2ee098;});}else{return _0x2ee098;}})[_0x979f('0x41')](function(_0x2c1e4d){logger[_0x979f('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c1e4d);throw _0x2c1e4d;});}return _0x2ee098;})['then'](respondWithResult(_0x347afa,0xc9))[_0x979f('0x41')](handleError(_0x347afa,null));};exports[_0x979f('0x4f')]=function(_0xe4cf1a,_0x36e101){var _0x1f4798={'where':{'id':_0xe4cf1a[_0x979f('0x50')]['id']}},_0x4f56e7={};_0x4f56e7[_0x979f('0x2b')]=_[_0x979f('0x44')](db['Campaign'][_0x979f('0x43')]);_0x1f4798[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x4f56e7[_0x979f('0x2b')],qs[_0x979f('0x30')](_0xe4cf1a[_0x979f('0x2e')][_0x979f('0x30')]));_0x1f4798[_0x979f('0x2f')]=_0x1f4798[_0x979f('0x2f')][_0x979f('0x31')]?_0x1f4798[_0x979f('0x2f')]:_0x4f56e7[_0x979f('0x2b')];if(_0xe4cf1a[_0x979f('0x2e')][_0x979f('0x3d')]){_0x1f4798[_0x979f('0x3e')]=[{'all':!![]}];}_0x1f4798=_[_0x979f('0x38')]({},_0x1f4798,_0xe4cf1a['options']);return db['Campaign'][_0x979f('0x4a')](_0x1f4798)[_0x979f('0x21')](handleEntityNotFound(_0x36e101,null))[_0x979f('0x21')](function(_0x489331){if(_0x489331){var _0x4b5be7=_0x489331[_0x979f('0x23')]({'plain':!![]});_0x4b5be7=qs[_0x979f('0x51')](_0x4b5be7,['id',_0x979f('0x52'),_0x979f('0x53')]);_0xe4cf1a[_0x979f('0x46')]=_['omit'](_0xe4cf1a[_0x979f('0x46')],['id',_0x979f('0x52'),_0x979f('0x53')]);return db[_0x979f('0x3c')][_0x979f('0x45')](_[_0x979f('0x38')](_0x4b5be7,_0xe4cf1a[_0x979f('0x46')]),{'include':_0xe4cf1a['query'][_0x979f('0x3d')]?[{'all':!![]}]:undefined})[_0x979f('0x21')](function(_0x142a73){var _0x57e004=_0xe4cf1a['user'][_0x979f('0x23')]({'plain':!![]});if(!_0x57e004)throw new Error(_0x979f('0x54'));if(_0x57e004[_0x979f('0x48')]===_0x979f('0x47')){var _0x446708=_0x142a73['get']({'plain':!![]});var _0x30d305='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x30d305,'userProfileId':_0x57e004[_0x979f('0x4b')]},'raw':!![]})['then'](function(_0x14fa8f){if(_0x14fa8f&&_0x14fa8f[_0x979f('0x4c')]===0x0){return db[_0x979f('0x4d')][_0x979f('0x45')]({'name':_0x446708[_0x979f('0x26')],'resourceId':_0x446708['id'],'type':_0x14fa8f[_0x979f('0x26')],'sectionId':_0x14fa8f['id']},{})[_0x979f('0x21')](function(){return _0x142a73;});}else{return _0x142a73;}})[_0x979f('0x41')](function(_0x2b82ea){logger[_0x979f('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b82ea);throw _0x2b82ea;});}return _0x142a73;});}})[_0x979f('0x21')](respondWithResult(_0x36e101,0xc9))['catch'](handleError(_0x36e101,null));};exports['update']=function(_0x3e3c54,_0x221295){if(_0x3e3c54[_0x979f('0x46')]['id']){delete _0x3e3c54[_0x979f('0x46')]['id'];}return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x3e3c54['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x221295,null))[_0x979f('0x21')](saveUpdates(_0x3e3c54[_0x979f('0x46')],null))[_0x979f('0x21')](respondWithResult(_0x221295,null))['catch'](handleError(_0x221295,null));};exports[_0x979f('0x22')]=function(_0x2cc00d,_0x2b306f){return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x2cc00d['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x2b306f,null))[_0x979f('0x21')](removeEntity(_0x2b306f,null))['catch'](handleError(_0x2b306f,null));};exports[_0x979f('0x55')]=function(_0x29166d,_0x1c3c73,_0x5c2b66){var _0x1580e0={'raw':!![],'where':{}};var _0x3a67cb={};var _0x451981={'count':0x0,'rows':[]};return db[_0x979f('0x3c')]['findOne']({'where':{'id':_0x29166d[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x1c3c73,null))[_0x979f('0x21')](function(_0x3ed354){if(_0x3ed354){_0x3a67cb[_0x979f('0x2b')]=_['keys'](db['CmHopper'][_0x979f('0x43')]);_0x3a67cb[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x29166d[_0x979f('0x2e')]);_0x3a67cb[_0x979f('0x2c')]=_['intersection'](_0x3a67cb['model'],_0x3a67cb[_0x979f('0x2e')]);_0x1580e0[_0x979f('0x2f')]=_['intersection'](_0x3a67cb['model'],qs['fields'](_0x29166d['query']['fields']));_0x1580e0[_0x979f('0x2f')]=_0x1580e0['attributes']['length']?_0x1580e0[_0x979f('0x2f')]:_0x3a67cb[_0x979f('0x2b')];if(!_0x29166d[_0x979f('0x2e')][_0x979f('0x32')]('nolimit')){_0x1580e0[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x29166d[_0x979f('0x2e')][_0x979f('0x33')]);_0x1580e0[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x29166d['query'][_0x979f('0x1a')]);}_0x1580e0['order']=qs['sort'](_0x29166d[_0x979f('0x2e')][_0x979f('0x35')]);_0x1580e0[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x29166d[_0x979f('0x2e')],_0x3a67cb[_0x979f('0x2c')]));_0x1580e0[_0x979f('0x36')]['CampaignId']=_0x3ed354['id'];if(_0x29166d['query'][_0x979f('0x3a')]){_0x1580e0[_0x979f('0x36')]=_[_0x979f('0x38')](_0x1580e0[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x1580e0[_0x979f('0x2f')],function(_0x481b06){var _0x3d0e0a={};_0x3d0e0a[_0x481b06]={'$like':'%'+_0x29166d[_0x979f('0x2e')]['filter']+'%'};return _0x3d0e0a;})});}_0x1580e0=_['merge']({},_0x1580e0,_0x29166d[_0x979f('0x3b')]);return db['CmHopper'][_0x979f('0x1c')]({'where':_0x1580e0[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x520d66){_0x451981['count']=_0x520d66;if(_0x29166d[_0x979f('0x2e')]['includeAll']){_0x1580e0[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x56')][_0x979f('0x3f')](_0x1580e0);})['then'](function(_0x57ace4){_0x451981[_0x979f('0x40')]=_0x57ace4;return _0x451981;});}})[_0x979f('0x21')](respondWithFilteredResult(_0x1c3c73,_0x1580e0))[_0x979f('0x41')](handleError(_0x1c3c73,null));};exports[_0x979f('0x57')]=function(_0xa60531,_0x32d3c5,_0x248716){var _0x134aeb={'raw':!![],'where':{}};var _0x12e182={};var _0x32026f={'count':0x0,'rows':[]};return db['Campaign'][_0x979f('0x58')]({'where':{'id':_0xa60531[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x32d3c5,null))['then'](function(_0x4b6340){if(_0x4b6340){_0x12e182[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x59')][_0x979f('0x43')]);_0x12e182['query']=_[_0x979f('0x44')](_0xa60531['query']);_0x12e182[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x12e182['model'],_0x12e182['query']);_0x134aeb[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x12e182[_0x979f('0x2b')],qs[_0x979f('0x30')](_0xa60531[_0x979f('0x2e')][_0x979f('0x30')]));_0x134aeb[_0x979f('0x2f')]=_0x134aeb[_0x979f('0x2f')][_0x979f('0x31')]?_0x134aeb[_0x979f('0x2f')]:_0x12e182[_0x979f('0x2b')];if(!_0xa60531['query'][_0x979f('0x32')](_0x979f('0x5a'))){_0x134aeb[_0x979f('0x33')]=qs[_0x979f('0x33')](_0xa60531['query'][_0x979f('0x33')]);_0x134aeb['offset']=qs[_0x979f('0x1a')](_0xa60531[_0x979f('0x2e')][_0x979f('0x1a')]);}_0x134aeb['order']=qs['sort'](_0xa60531[_0x979f('0x2e')][_0x979f('0x35')]);_0x134aeb[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0xa60531['query'],_0x12e182[_0x979f('0x2c')]));_0x134aeb['where'][_0x979f('0x5b')]=_0x4b6340['id'];if(_0xa60531[_0x979f('0x2e')]['filter']){_0x134aeb[_0x979f('0x36')]=_[_0x979f('0x38')](_0x134aeb[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x134aeb[_0x979f('0x2f')],function(_0x5d8801){var _0x24cf23={};_0x24cf23[_0x5d8801]={'$like':'%'+_0xa60531[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x24cf23;})});}_0x134aeb=_[_0x979f('0x38')]({},_0x134aeb,_0xa60531[_0x979f('0x3b')]);return db[_0x979f('0x59')][_0x979f('0x1c')]({'where':_0x134aeb[_0x979f('0x36')]})['then'](function(_0x27b03b){_0x32026f[_0x979f('0x1c')]=_0x27b03b;if(_0xa60531[_0x979f('0x2e')][_0x979f('0x3d')]){_0x134aeb['include']=[{'all':!![]}];}return db[_0x979f('0x59')][_0x979f('0x3f')](_0x134aeb);})[_0x979f('0x21')](function(_0x474f21){_0x32026f[_0x979f('0x40')]=_0x474f21;return _0x32026f;});}})[_0x979f('0x21')](respondWithFilteredResult(_0x32d3c5,_0x134aeb))[_0x979f('0x41')](handleError(_0x32d3c5,null));};exports[_0x979f('0x5c')]=function(_0x45f724,_0x51a16e,_0x4cfe86){var _0x1edfb6={'raw':!![],'where':{}};var _0xb35d43={};var _0x3e5e13={'count':0x0,'rows':[]};return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x45f724[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x51a16e,null))[_0x979f('0x21')](function(_0x12adda){if(_0x12adda){_0xb35d43[_0x979f('0x2b')]=_['keys'](db['CmHopperFinal'][_0x979f('0x43')]);_0xb35d43[_0x979f('0x2e')]=_['keys'](_0x45f724[_0x979f('0x2e')]);_0xb35d43['filters']=_[_0x979f('0x2d')](_0xb35d43[_0x979f('0x2b')],_0xb35d43[_0x979f('0x2e')]);_0x1edfb6['attributes']=_['intersection'](_0xb35d43['model'],qs[_0x979f('0x30')](_0x45f724[_0x979f('0x2e')]['fields']));_0x1edfb6['attributes']=_0x1edfb6[_0x979f('0x2f')][_0x979f('0x31')]?_0x1edfb6[_0x979f('0x2f')]:_0xb35d43[_0x979f('0x2b')];if(!_0x45f724[_0x979f('0x2e')][_0x979f('0x32')](_0x979f('0x5a'))){_0x1edfb6['limit']=qs[_0x979f('0x33')](_0x45f724[_0x979f('0x2e')][_0x979f('0x33')]);_0x1edfb6[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x45f724['query']['offset']);}_0x1edfb6[_0x979f('0x34')]=qs[_0x979f('0x35')](_0x45f724['query'][_0x979f('0x35')]);_0x1edfb6['where']=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x45f724[_0x979f('0x2e')],_0xb35d43[_0x979f('0x2c')]));_0x1edfb6[_0x979f('0x36')][_0x979f('0x5b')]=_0x12adda['id'];if(_0x45f724[_0x979f('0x2e')][_0x979f('0x3a')]){_0x1edfb6['where']=_[_0x979f('0x38')](_0x1edfb6['where'],{'$or':_[_0x979f('0x28')](_0x1edfb6['attributes'],function(_0x36dd4){var _0x53db6a={};_0x53db6a[_0x36dd4]={'$like':'%'+_0x45f724[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x53db6a;})});}_0x1edfb6=_['merge']({},_0x1edfb6,_0x45f724[_0x979f('0x3b')]);return db[_0x979f('0x5d')][_0x979f('0x1c')]({'where':_0x1edfb6[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x169ed7){_0x3e5e13['count']=_0x169ed7;if(_0x45f724[_0x979f('0x2e')][_0x979f('0x3d')]){_0x1edfb6[_0x979f('0x3e')]=[{'all':!![]}];}return db[_0x979f('0x5d')][_0x979f('0x3f')](_0x1edfb6);})['then'](function(_0x41d676){_0x3e5e13[_0x979f('0x40')]=_0x41d676;return _0x3e5e13;});}})['then'](respondWithFilteredResult(_0x51a16e,_0x1edfb6))[_0x979f('0x41')](handleError(_0x51a16e,null));};exports['getHopperBlacks']=function(_0x26f04f,_0x426d4b,_0x586ada){var _0x273007={'raw':!![],'where':{}};var _0x154ae4={};var _0xa864a7={'count':0x0,'rows':[]};return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x26f04f[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x426d4b,null))['then'](function(_0x566546){if(_0x566546){_0x154ae4[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x5e')]['rawAttributes']);_0x154ae4[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x26f04f[_0x979f('0x2e')]);_0x154ae4[_0x979f('0x2c')]=_['intersection'](_0x154ae4[_0x979f('0x2b')],_0x154ae4[_0x979f('0x2e')]);_0x273007[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x154ae4[_0x979f('0x2b')],qs['fields'](_0x26f04f[_0x979f('0x2e')][_0x979f('0x30')]));_0x273007[_0x979f('0x2f')]=_0x273007[_0x979f('0x2f')][_0x979f('0x31')]?_0x273007[_0x979f('0x2f')]:_0x154ae4['model'];if(!_0x26f04f[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x273007[_0x979f('0x33')]=qs['limit'](_0x26f04f[_0x979f('0x2e')][_0x979f('0x33')]);_0x273007[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x26f04f['query'][_0x979f('0x1a')]);}_0x273007['order']=qs['sort'](_0x26f04f[_0x979f('0x2e')]['sort']);_0x273007['where']=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x26f04f[_0x979f('0x2e')],_0x154ae4['filters']));_0x273007[_0x979f('0x36')]['CampaignId']=_0x566546['id'];if(_0x26f04f[_0x979f('0x2e')]['filter']){_0x273007[_0x979f('0x36')]=_[_0x979f('0x38')](_0x273007[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x273007[_0x979f('0x2f')],function(_0xc26bd6){var _0x2ff3d1={};_0x2ff3d1[_0xc26bd6]={'$like':'%'+_0x26f04f['query'][_0x979f('0x3a')]+'%'};return _0x2ff3d1;})});}_0x273007=_['merge']({},_0x273007,_0x26f04f[_0x979f('0x3b')]);return db[_0x979f('0x5e')]['count']({'where':_0x273007[_0x979f('0x36')]})[_0x979f('0x21')](function(_0x2b537e){_0xa864a7[_0x979f('0x1c')]=_0x2b537e;if(_0x26f04f[_0x979f('0x2e')][_0x979f('0x3d')]){_0x273007['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x979f('0x3f')](_0x273007);})[_0x979f('0x21')](function(_0x3798f0){_0xa864a7[_0x979f('0x40')]=_0x3798f0;return _0xa864a7;});}})['then'](respondWithFilteredResult(_0x426d4b,_0x273007))[_0x979f('0x41')](handleError(_0x426d4b,null));};exports['getLists']=function(_0x5c996c,_0x5043f2,_0xaeaaef){var _0x12ea8e={};var _0x39cb27={};var _0x280d26;var _0x3d7ec4;return db[_0x979f('0x3c')][_0x979f('0x58')]({'where':{'id':_0x5c996c['params']['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5043f2,null))[_0x979f('0x21')](function(_0xe69a09){if(_0xe69a09){_0x280d26=_0xe69a09;_0x39cb27[_0x979f('0x2b')]=_[_0x979f('0x44')](db[_0x979f('0x5f')][_0x979f('0x43')]);_0x39cb27[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x5c996c[_0x979f('0x2e')]);_0x39cb27[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x39cb27[_0x979f('0x2b')],_0x39cb27[_0x979f('0x2e')]);_0x12ea8e[_0x979f('0x2f')]=_['intersection'](_0x39cb27['model'],qs[_0x979f('0x30')](_0x5c996c[_0x979f('0x2e')]['fields']));_0x12ea8e[_0x979f('0x2f')]=_0x12ea8e['attributes'][_0x979f('0x31')]?_0x12ea8e[_0x979f('0x2f')]:_0x39cb27['model'];_0x12ea8e['order']=qs[_0x979f('0x35')](_0x5c996c[_0x979f('0x2e')][_0x979f('0x35')]);_0x12ea8e[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x5c996c[_0x979f('0x2e')],_0x39cb27[_0x979f('0x2c')]));if(_0x5c996c['query'][_0x979f('0x3a')]){_0x12ea8e['where']=_[_0x979f('0x38')](_0x12ea8e[_0x979f('0x36')],{'$or':_[_0x979f('0x28')](_0x12ea8e[_0x979f('0x2f')],function(_0x462e5e){var _0x55683e={};_0x55683e[_0x462e5e]={'$like':'%'+_0x5c996c[_0x979f('0x2e')][_0x979f('0x3a')]+'%'};return _0x55683e;})});}_0x12ea8e=_[_0x979f('0x38')]({},_0x12ea8e,_0x5c996c[_0x979f('0x3b')]);return _0x280d26[_0x979f('0x60')](_0x12ea8e);}})[_0x979f('0x21')](function(_0xcd4325){if(_0xcd4325){_0x3d7ec4=_0xcd4325[_0x979f('0x31')];if(!_0x5c996c[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x12ea8e[_0x979f('0x33')]=qs[_0x979f('0x33')](_0x5c996c['query'][_0x979f('0x33')]);_0x12ea8e[_0x979f('0x1a')]=qs['offset'](_0x5c996c['query'][_0x979f('0x1a')]);}return _0x280d26['getLists'](_0x12ea8e);}})[_0x979f('0x21')](function(_0x32885d){if(_0x32885d){return _0x32885d?{'count':_0x3d7ec4,'rows':_0x32885d}:null;}})[_0x979f('0x21')](respondWithResult(_0x5043f2,null))[_0x979f('0x41')](handleError(_0x5043f2,null));};exports[_0x979f('0x61')]=function(_0x40d3e5,_0x5a7c70,_0x52cacc){var _0x462124,_0x20e519;return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x40d3e5[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5a7c70,null))[_0x979f('0x21')](function(_0x10976d){if(_0x10976d){_0x20e519=_0x10976d;return _0x10976d[_0x979f('0x61')](_0x40d3e5[_0x979f('0x46')]['ids'],_[_0x979f('0x51')](_0x40d3e5[_0x979f('0x46')],[_0x979f('0x62'),'id'])||{});}return null;})[_0x979f('0x63')](function(_0x46b374){var _0x5c094a;_0x462124=_0x46b374||[];var _0x19df1e=[];if(_0x46b374){for(var _0x557ce9=0x0;_0x557ce9<_0x46b374[_0x979f('0x31')];_0x557ce9+=0x1){var _0x20e4af=_0x46b374[_0x557ce9][_0x979f('0x23')]({'plain':!![]});_0x20e519['dialCheckDuplicateType']=_0x40d3e5[_0x979f('0x46')][_0x979f('0x64')]?_0x40d3e5[_0x979f('0x46')][_0x979f('0x64')]:_0x20e519[_0x979f('0x64')];switch(_0x20e519[_0x979f('0x64')]){case'always':_0x5c094a=squel[_0x979f('0x65')]()[_0x979f('0x66')](_0x979f('0x67'))[_0x979f('0x68')]([_0x979f('0x69'),_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),'createdAt',_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x69'),'phone')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x6a'))['field']('id','ContactId')['field'](_0x20e4af['CmListId']['toString'](),_0x979f('0x6f'))['field'](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),'CampaignId')[_0x979f('0x6d')](_0x979f('0x6e'),'createdAt')['field'](_0x979f('0x6e'),_0x979f('0x53'))[_0x979f('0x71')](_0x979f('0x72'))[_0x979f('0x36')]('deletedAt\x20IS\x20NULL')['where'](_0x979f('0x73'),_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())[_0x979f('0x36')](_0x979f('0x75'))[_0x979f('0x36')](_0x979f('0x76'),squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x77'))[_0x979f('0x71')]('cm_hopper_final')[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]()))[_0x979f('0x36')](_0x979f('0x76'),squel[_0x979f('0x6c')]()['field'](_0x979f('0x79'))[_0x979f('0x71')](_0x979f('0x67'))[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]())))[_0x979f('0x70')]();break;case'onlyIfOpen':_0x5c094a=squel[_0x979f('0x65')]()['into'](_0x979f('0x67'))['fromQuery'](['phone',_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),_0x979f('0x52'),_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')](_0x979f('0x69'),_0x979f('0x69'))[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x6a'))['field']('id',_0x979f('0x6b'))['field'](_0x20e4af[_0x979f('0x74')]['toString'](),_0x979f('0x6f'))[_0x979f('0x6d')](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')]('NOW()','createdAt')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x53'))[_0x979f('0x71')]('cm_contacts')['where'](_0x979f('0x7a'))['where']('ListId\x20=\x20?',_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())[_0x979f('0x36')](_0x979f('0x75'))[_0x979f('0x36')](_0x979f('0x76'),squel['select']()[_0x979f('0x6d')](_0x979f('0x79'))[_0x979f('0x71')](_0x979f('0x67'))[_0x979f('0x36')](_0x979f('0x78'),_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')]())))[_0x979f('0x70')]();break;default:_0x5c094a=squel[_0x979f('0x65')]()[_0x979f('0x66')](_0x979f('0x67'))[_0x979f('0x68')](['phone',_0x979f('0x6a'),_0x979f('0x6b'),'ListId',_0x979f('0x5b'),_0x979f('0x52'),_0x979f('0x53')],squel[_0x979f('0x6c')]()[_0x979f('0x6d')]('phone','phone')['field'](_0x979f('0x6e'),'scheduledAt')[_0x979f('0x6d')]('id','ContactId')['field'](_0x20e4af[_0x979f('0x74')][_0x979f('0x70')](),_0x979f('0x6f'))['field'](_0x40d3e5[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x52'))[_0x979f('0x6d')]('NOW()',_0x979f('0x53'))[_0x979f('0x71')](_0x979f('0x72'))[_0x979f('0x36')](_0x979f('0x7a'))['where']('ListId\x20=\x20?',_0x20e4af[_0x979f('0x74')][_0x979f('0x70')]())['where'](_0x979f('0x75')))[_0x979f('0x70')]();}_0x19df1e['push'](db['sequelize'][_0x979f('0x2e')](_0x5c094a));}return BPromise[_0x979f('0x7b')](_0x19df1e);}})['then'](function(){return _0x462124;})[_0x979f('0x21')](respondWithResult(_0x5a7c70,null))[_0x979f('0x41')](handleError(_0x5a7c70,null));};exports[_0x979f('0x7c')]=function(_0x521e80,_0x2f2f8b,_0x6cbb07){return db[_0x979f('0x3c')][_0x979f('0x4a')]({'where':{'id':_0x521e80[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f2f8b,null))[_0x979f('0x21')](function(_0x29d740){if(_0x29d740){return _0x29d740['removeLists'](_0x521e80[_0x979f('0x2e')][_0x979f('0x62')]);}})[_0x979f('0x21')](function(_0x489c47){if(_0x489c47){return db['CmHopper']['destroy']({'where':{'ListId':_0x521e80['query'][_0x979f('0x62')],'CampaignId':_0x521e80[_0x979f('0x50')]['id']}})['then'](function(){return _0x489c47;});}})[_0x979f('0x21')](respondWithStatusCode(_0x2f2f8b,null))['catch'](handleError(_0x2f2f8b,null));};exports['getBlackLists']=function(_0x55607e,_0x316530,_0x2ae8ed){var _0x504360={};var _0x220f01={};var _0x8500c3;var _0x194c04;return db['Campaign']['findOne']({'where':{'id':_0x55607e[_0x979f('0x50')]['id']}})['then'](handleEntityNotFound(_0x316530,null))[_0x979f('0x21')](function(_0x2653f2){if(_0x2653f2){_0x8500c3=_0x2653f2;_0x220f01['model']=_[_0x979f('0x44')](db['CmList']['rawAttributes']);_0x220f01[_0x979f('0x2e')]=_[_0x979f('0x44')](_0x55607e['query']);_0x220f01[_0x979f('0x2c')]=_[_0x979f('0x2d')](_0x220f01[_0x979f('0x2b')],_0x220f01[_0x979f('0x2e')]);_0x504360[_0x979f('0x2f')]=_[_0x979f('0x2d')](_0x220f01['model'],qs[_0x979f('0x30')](_0x55607e['query'][_0x979f('0x30')]));_0x504360[_0x979f('0x2f')]=_0x504360[_0x979f('0x2f')]['length']?_0x504360[_0x979f('0x2f')]:_0x220f01[_0x979f('0x2b')];_0x504360['order']=qs[_0x979f('0x35')](_0x55607e['query'][_0x979f('0x35')]);_0x504360[_0x979f('0x36')]=qs[_0x979f('0x2c')](_[_0x979f('0x37')](_0x55607e['query'],_0x220f01[_0x979f('0x2c')]));if(_0x55607e['query'][_0x979f('0x3a')]){_0x504360['where']=_[_0x979f('0x38')](_0x504360['where'],{'$or':_['map'](_0x504360['attributes'],function(_0x518b44){var _0x2ae1a7={};_0x2ae1a7[_0x518b44]={'$like':'%'+_0x55607e['query'][_0x979f('0x3a')]+'%'};return _0x2ae1a7;})});}_0x504360=_[_0x979f('0x38')]({},_0x504360,_0x55607e[_0x979f('0x3b')]);return _0x8500c3[_0x979f('0x7d')](_0x504360);}})[_0x979f('0x21')](function(_0x3823e5){if(_0x3823e5){_0x194c04=_0x3823e5[_0x979f('0x31')];if(!_0x55607e[_0x979f('0x2e')]['hasOwnProperty'](_0x979f('0x5a'))){_0x504360['limit']=qs[_0x979f('0x33')](_0x55607e[_0x979f('0x2e')][_0x979f('0x33')]);_0x504360[_0x979f('0x1a')]=qs[_0x979f('0x1a')](_0x55607e[_0x979f('0x2e')]['offset']);}return _0x8500c3[_0x979f('0x7d')](_0x504360);}})[_0x979f('0x21')](function(_0x5982e9){if(_0x5982e9){return _0x5982e9?{'count':_0x194c04,'rows':_0x5982e9}:null;}})[_0x979f('0x21')](respondWithResult(_0x316530,null))[_0x979f('0x41')](handleError(_0x316530,null));};exports[_0x979f('0x7e')]=function(_0x3fdffe,_0x5ae648,_0x4db4a1){var _0x163e34,_0x35dac6;return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x3fdffe[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x5ae648,null))[_0x979f('0x21')](function(_0x199f6d){if(_0x199f6d){_0x35dac6=_0x199f6d;return _0x199f6d['addBlackLists'](_0x3fdffe[_0x979f('0x46')]['ids'],_['omit'](_0x3fdffe[_0x979f('0x46')],[_0x979f('0x62'),'id'])||{});}return null;})[_0x979f('0x63')](function(_0x5013b3){var _0x2cf78a;_0x163e34=_0x5013b3||[];var _0xa7069a=[];if(_0x5013b3){for(var _0x53910a=0x0;_0x53910a<_0x5013b3[_0x979f('0x31')];_0x53910a+=0x1){var _0x133ae5=_0x5013b3[_0x53910a][_0x979f('0x23')]({'plain':!![]});_0x2cf78a=squel[_0x979f('0x65')]()[_0x979f('0x66')]('cm_hopper_black')[_0x979f('0x68')](['phone','ContactId',_0x979f('0x6f'),'CampaignId',_0x979f('0x52'),_0x979f('0x53')],squel['select']()['field'](_0x979f('0x69'),_0x979f('0x69'))['field']('id','ContactId')['field'](_0x133ae5[_0x979f('0x74')][_0x979f('0x70')](),_0x979f('0x6f'))[_0x979f('0x6d')](_0x3fdffe[_0x979f('0x50')]['id'][_0x979f('0x70')](),_0x979f('0x5b'))[_0x979f('0x6d')](_0x979f('0x6e'),'createdAt')[_0x979f('0x6d')](_0x979f('0x6e'),_0x979f('0x53'))['from'](_0x979f('0x72'))[_0x979f('0x36')](_0x979f('0x7a'))['where'](_0x979f('0x73'),_0x133ae5['CmListId'][_0x979f('0x70')]())[_0x979f('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0x979f('0x70')]();_0xa7069a['push'](db[_0x979f('0x7f')][_0x979f('0x2e')](_0x2cf78a));}return BPromise['all'](_0xa7069a);}})[_0x979f('0x21')](function(){return _0x163e34;})['then'](respondWithResult(_0x5ae648,null))['catch'](handleError(_0x5ae648,null));};exports['removeBlackLists']=function(_0x30a3ac,_0x3283ea,_0x568df0){return db['Campaign'][_0x979f('0x4a')]({'where':{'id':_0x30a3ac[_0x979f('0x50')]['id']}})[_0x979f('0x21')](handleEntityNotFound(_0x3283ea,null))[_0x979f('0x21')](function(_0x293e0a){if(_0x293e0a){return _0x293e0a[_0x979f('0x80')](_0x30a3ac['query'][_0x979f('0x62')]);}})[_0x979f('0x21')](function(_0x39b6f4){if(_0x39b6f4){return db[_0x979f('0x5e')][_0x979f('0x22')]({'where':{'ListId':_0x30a3ac['query'][_0x979f('0x62')],'CampaignId':_0x30a3ac[_0x979f('0x50')]['id']}})[_0x979f('0x21')](function(){return _0x39b6f4;});}})[_0x979f('0x21')](respondWithStatusCode(_0x3283ea,null))[_0x979f('0x41')](handleError(_0x3283ea,null));};
\ No newline at end of file
+var _0x2a37=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','IvrCampaigns','UserProfileResource','destroy','end','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Campaign','include','findAll','rows','show','params','find','catch','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','CmHopper','pick','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','rawAttributes','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x438c94,_0x59a291){var _0x43defa=function(_0x207ac5){while(--_0x207ac5){_0x438c94['push'](_0x438c94['shift']());}};_0x43defa(++_0x59a291);}(_0x2a37,0x10b));var _0x72a3=function(_0x2216c2,_0x4b504a){_0x2216c2=_0x2216c2-0x0;var _0xda7f7c=_0x2a37[_0x2216c2];return _0xda7f7c;};'use strict';var emlformat=require(_0x72a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72a3('0x1'));var jsonpatch=require(_0x72a3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x72a3('0x3'));var Mustache=require(_0x72a3('0x4'));var util=require(_0x72a3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x72a3('0x6'));var ejs=require(_0x72a3('0x7'));var fs=require('fs');var fs_extra=require(_0x72a3('0x8'));var _=require(_0x72a3('0x9'));var squel=require(_0x72a3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72a3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x72a3('0xc'));var Papa=require(_0x72a3('0xd'));var Redis=require(_0x72a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x72a3('0xf'));var as=require(_0x72a3('0x10'));var hardwareService=require(_0x72a3('0x11'));var logger=require(_0x72a3('0x12'))(_0x72a3('0x13'));var utils=require(_0x72a3('0x14'));var config=require(_0x72a3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a3('0x16'))['db'];function respondWithStatusCode(_0x571c01,_0x11537b){_0x11537b=_0x11537b||0xcc;return function(_0x3b7c32){if(_0x3b7c32){return _0x571c01[_0x72a3('0x17')](_0x11537b);}return _0x571c01[_0x72a3('0x18')](_0x11537b)['end']();};}function respondWithResult(_0x454cbb,_0xe63f34){_0xe63f34=_0xe63f34||0xc8;return function(_0x2b4660){if(_0x2b4660){return _0x454cbb[_0x72a3('0x18')](_0xe63f34)[_0x72a3('0x19')](_0x2b4660);}};}function respondWithFilteredResult(_0xf595c4,_0x589df6){return function(_0x16d879){if(_0x16d879){var _0x5c17a2=typeof _0x589df6['offset']===_0x72a3('0x1a')&&typeof _0x589df6[_0x72a3('0x1b')]==='undefined';var _0x39e5ce=_0x16d879[_0x72a3('0x1c')];var _0x55bce3=_0x5c17a2?0x0:_0x589df6[_0x72a3('0x1d')];var _0x48c013=_0x5c17a2?_0x16d879[_0x72a3('0x1c')]:_0x589df6['offset']+_0x589df6[_0x72a3('0x1b')];var _0x3223d9;if(_0x48c013>=_0x39e5ce){_0x48c013=_0x39e5ce;_0x3223d9=0xc8;}else{_0x3223d9=0xce;}_0xf595c4['status'](_0x3223d9);return _0xf595c4[_0x72a3('0x1e')](_0x72a3('0x1f'),_0x55bce3+'-'+_0x48c013+'/'+_0x39e5ce)['json'](_0x16d879);}return null;};}function patchUpdates(_0xb01ba9){return function(_0x3af3bf){try{jsonpatch[_0x72a3('0x20')](_0x3af3bf,_0xb01ba9,!![]);}catch(_0x1dbd2f){return BPromise[_0x72a3('0x21')](_0x1dbd2f);}return _0x3af3bf[_0x72a3('0x22')]();};}function saveUpdates(_0x37c7dd,_0x28b658){return function(_0x305a38){if(_0x305a38){return _0x305a38[_0x72a3('0x23')](_0x37c7dd)[_0x72a3('0x24')](function(_0x7eb3fb){return _0x7eb3fb;});}return null;};}function removeEntity(_0x337a8c,_0x5ee479){return function(_0x495458){if(_0x495458){return _0x495458['destroy']()[_0x72a3('0x24')](function(){var _0x3aa42=_0x495458['get']({'plain':!![]});var _0x111f02=_0x72a3('0x25');return db[_0x72a3('0x26')][_0x72a3('0x27')]({'where':{'type':_0x111f02,'resourceId':_0x3aa42['id']}})[_0x72a3('0x24')](function(){return _0x495458;});})[_0x72a3('0x24')](function(){_0x337a8c[_0x72a3('0x18')](0xcc)[_0x72a3('0x28')]();});}};}function handleEntityNotFound(_0x34dbd4,_0x3c5a04){return function(_0x200f25){if(!_0x200f25){_0x34dbd4[_0x72a3('0x17')](0x194);}return _0x200f25;};}function handleError(_0x2532a2,_0x1798f3){_0x1798f3=_0x1798f3||0x1f4;return function(_0x3f18fb){logger[_0x72a3('0x29')](_0x3f18fb[_0x72a3('0x2a')]);if(_0x3f18fb['name']){delete _0x3f18fb[_0x72a3('0x2b')];}_0x2532a2['status'](_0x1798f3)[_0x72a3('0x2c')](_0x3f18fb);};}exports['index']=function(_0x159f21,_0x5ad124){var _0x40a4eb={},_0xbbacda={},_0x111c2d={'count':0x0,'rows':[]};var _0x3c6a8b=_[_0x72a3('0x2d')](db['Campaign']['rawAttributes'],function(_0x4f0b2a){return{'name':_0x4f0b2a[_0x72a3('0x2e')],'type':_0x4f0b2a[_0x72a3('0x2f')][_0x72a3('0x30')]};});_0xbbacda['model']=_[_0x72a3('0x2d')](_0x3c6a8b,'name');_0xbbacda[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x159f21['query']);_0xbbacda[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0xbbacda['model'],_0xbbacda[_0x72a3('0x31')]);_0x40a4eb[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0xbbacda[_0x72a3('0x36')],qs['fields'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x37')]));_0x40a4eb[_0x72a3('0x35')]=_0x40a4eb['attributes'][_0x72a3('0x38')]?_0x40a4eb[_0x72a3('0x35')]:_0xbbacda[_0x72a3('0x36')];if(!_0x159f21[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x40a4eb[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x159f21[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x40a4eb[_0x72a3('0x1d')]=qs['offset'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x1d')]);}_0x40a4eb[_0x72a3('0x3b')]=qs['sort'](_0x159f21[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x40a4eb[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_['pick'](_0x159f21['query'],_0xbbacda[_0x72a3('0x33')]),_0x3c6a8b);if(_0x159f21[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x40a4eb[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x40a4eb[_0x72a3('0x3d')],{'$or':_['map'](_0x3c6a8b,function(_0x315170){if(_0x315170[_0x72a3('0x2f')]!==_0x72a3('0x40')){var _0x45b061={};_0x45b061[_0x315170['name']]={'$like':'%'+_0x159f21[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x45b061;}})});}_0x40a4eb=_[_0x72a3('0x3f')]({},_0x40a4eb,_0x159f21[_0x72a3('0x41')]);var _0x537450={'where':_0x40a4eb[_0x72a3('0x3d')]};return db[_0x72a3('0x42')][_0x72a3('0x1c')](_0x537450)['then'](function(_0x8408f2){_0x111c2d[_0x72a3('0x1c')]=_0x8408f2;if(_0x159f21[_0x72a3('0x31')]['includeAll']){_0x40a4eb[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x42')][_0x72a3('0x44')](_0x40a4eb);})[_0x72a3('0x24')](function(_0x37a7d){_0x111c2d[_0x72a3('0x45')]=_0x37a7d;return _0x111c2d;})[_0x72a3('0x24')](respondWithFilteredResult(_0x5ad124,_0x40a4eb))['catch'](handleError(_0x5ad124,null));};exports[_0x72a3('0x46')]=function(_0x375297,_0x1c3390){var _0x432296={'raw':![],'where':{'id':_0x375297[_0x72a3('0x47')]['id']}},_0x59f1dd={};_0x59f1dd[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x42')]['rawAttributes']);_0x59f1dd[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x375297[_0x72a3('0x31')]);_0x59f1dd['filters']=_[_0x72a3('0x34')](_0x59f1dd[_0x72a3('0x36')],_0x59f1dd[_0x72a3('0x31')]);_0x432296[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x59f1dd['model'],qs[_0x72a3('0x37')](_0x375297[_0x72a3('0x31')][_0x72a3('0x37')]));_0x432296[_0x72a3('0x35')]=_0x432296[_0x72a3('0x35')][_0x72a3('0x38')]?_0x432296[_0x72a3('0x35')]:_0x59f1dd[_0x72a3('0x36')];if(_0x375297[_0x72a3('0x31')]['includeAll']){_0x432296['include']=[{'all':!![]}];}_0x432296=_[_0x72a3('0x3f')]({},_0x432296,_0x375297[_0x72a3('0x41')]);return db[_0x72a3('0x42')][_0x72a3('0x48')](_0x432296)[_0x72a3('0x24')](handleEntityNotFound(_0x1c3390,null))['then'](respondWithResult(_0x1c3390,null))[_0x72a3('0x49')](handleError(_0x1c3390,null));};exports[_0x72a3('0x4a')]=function(_0x1acb0c,_0x674729){return db[_0x72a3('0x42')][_0x72a3('0x4a')](_0x1acb0c[_0x72a3('0x4b')],{})[_0x72a3('0x24')](function(_0x1dcfe7){var _0x550960=_0x1acb0c[_0x72a3('0x4c')][_0x72a3('0x4d')]({'plain':!![]});if(!_0x550960)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x550960[_0x72a3('0x4e')]===_0x72a3('0x4c')){var _0x470bc5=_0x1dcfe7[_0x72a3('0x4d')]({'plain':!![]});var _0x1ef1d1=_0x72a3('0x25');return db[_0x72a3('0x4f')]['find']({'where':{'name':_0x1ef1d1,'userProfileId':_0x550960['userProfileId']},'raw':!![]})[_0x72a3('0x24')](function(_0x4ee1e3){if(_0x4ee1e3&&_0x4ee1e3[_0x72a3('0x50')]===0x0){return db[_0x72a3('0x26')][_0x72a3('0x4a')]({'name':_0x470bc5[_0x72a3('0x2b')],'resourceId':_0x470bc5['id'],'type':_0x4ee1e3[_0x72a3('0x2b')],'sectionId':_0x4ee1e3['id']},{})[_0x72a3('0x24')](function(){return _0x1dcfe7;});}else{return _0x1dcfe7;}})['catch'](function(_0x526f13){logger[_0x72a3('0x29')](_0x72a3('0x51'),_0x526f13);throw _0x526f13;});}return _0x1dcfe7;})[_0x72a3('0x24')](respondWithResult(_0x674729,0xc9))[_0x72a3('0x49')](handleError(_0x674729,null));};exports[_0x72a3('0x52')]=function(_0x1933e5,_0x121532){var _0x59284c={'where':{'id':_0x1933e5[_0x72a3('0x47')]['id']}},_0x3b9be6={};_0x3b9be6[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x42')]['rawAttributes']);_0x59284c['attributes']=_['intersection'](_0x3b9be6[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x1933e5['query']['fields']));_0x59284c[_0x72a3('0x35')]=_0x59284c[_0x72a3('0x35')][_0x72a3('0x38')]?_0x59284c[_0x72a3('0x35')]:_0x3b9be6[_0x72a3('0x36')];if(_0x1933e5[_0x72a3('0x31')][_0x72a3('0x53')]){_0x59284c[_0x72a3('0x43')]=[{'all':!![]}];}_0x59284c=_[_0x72a3('0x3f')]({},_0x59284c,_0x1933e5[_0x72a3('0x41')]);return db[_0x72a3('0x42')][_0x72a3('0x48')](_0x59284c)[_0x72a3('0x24')](handleEntityNotFound(_0x121532,null))[_0x72a3('0x24')](function(_0x5db6d2){if(_0x5db6d2){var _0x3ae15c=_0x5db6d2[_0x72a3('0x4d')]({'plain':!![]});_0x3ae15c=qs[_0x72a3('0x54')](_0x3ae15c,['id',_0x72a3('0x55'),_0x72a3('0x56')]);_0x1933e5[_0x72a3('0x4b')]=_[_0x72a3('0x54')](_0x1933e5[_0x72a3('0x4b')],['id',_0x72a3('0x55'),_0x72a3('0x56')]);return db[_0x72a3('0x42')][_0x72a3('0x4a')](_['merge'](_0x3ae15c,_0x1933e5['body']),{'include':_0x1933e5[_0x72a3('0x31')][_0x72a3('0x53')]?[{'all':!![]}]:undefined})[_0x72a3('0x24')](function(_0xb41289){var _0x33ffb4=_0x1933e5[_0x72a3('0x4c')][_0x72a3('0x4d')]({'plain':!![]});if(!_0x33ffb4)throw new Error(_0x72a3('0x57'));if(_0x33ffb4[_0x72a3('0x4e')]===_0x72a3('0x4c')){var _0x7da0fb=_0xb41289[_0x72a3('0x4d')]({'plain':!![]});var _0x2549e0=_0x72a3('0x25');return db[_0x72a3('0x4f')][_0x72a3('0x48')]({'where':{'name':_0x2549e0,'userProfileId':_0x33ffb4[_0x72a3('0x58')]},'raw':!![]})[_0x72a3('0x24')](function(_0x4778cc){if(_0x4778cc&&_0x4778cc[_0x72a3('0x50')]===0x0){return db['UserProfileResource'][_0x72a3('0x4a')]({'name':_0x7da0fb['name'],'resourceId':_0x7da0fb['id'],'type':_0x4778cc['name'],'sectionId':_0x4778cc['id']},{})[_0x72a3('0x24')](function(){return _0xb41289;});}else{return _0xb41289;}})[_0x72a3('0x49')](function(_0x37df09){logger[_0x72a3('0x29')](_0x72a3('0x51'),_0x37df09);throw _0x37df09;});}return _0xb41289;});}})[_0x72a3('0x24')](respondWithResult(_0x121532,0xc9))[_0x72a3('0x49')](handleError(_0x121532,null));};exports[_0x72a3('0x23')]=function(_0x539d23,_0x3f3a9a){if(_0x539d23[_0x72a3('0x4b')]['id']){delete _0x539d23[_0x72a3('0x4b')]['id'];}return db[_0x72a3('0x42')]['find']({'where':{'id':_0x539d23['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3f3a9a,null))[_0x72a3('0x24')](saveUpdates(_0x539d23['body'],null))[_0x72a3('0x24')](respondWithResult(_0x3f3a9a,null))['catch'](handleError(_0x3f3a9a,null));};exports[_0x72a3('0x27')]=function(_0x5c9c4c,_0x16f70c){return db[_0x72a3('0x42')][_0x72a3('0x48')]({'where':{'id':_0x5c9c4c[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x16f70c,null))[_0x72a3('0x24')](removeEntity(_0x16f70c,null))[_0x72a3('0x49')](handleError(_0x16f70c,null));};exports[_0x72a3('0x59')]=function(_0x2a78ca,_0x4d4fda,_0x415020){var _0x276345={'raw':!![],'where':{}};var _0xf32031={};var _0x26ad58={'count':0x0,'rows':[]};return db[_0x72a3('0x42')]['findOne']({'where':{'id':_0x2a78ca[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x4d4fda,null))['then'](function(_0x9965c1){if(_0x9965c1){_0xf32031[_0x72a3('0x36')]=_['keys'](db[_0x72a3('0x5a')]['rawAttributes']);_0xf32031['query']=_[_0x72a3('0x32')](_0x2a78ca[_0x72a3('0x31')]);_0xf32031[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0xf32031[_0x72a3('0x36')],_0xf32031[_0x72a3('0x31')]);_0x276345['attributes']=_['intersection'](_0xf32031[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x2a78ca[_0x72a3('0x31')]['fields']));_0x276345[_0x72a3('0x35')]=_0x276345['attributes'][_0x72a3('0x38')]?_0x276345[_0x72a3('0x35')]:_0xf32031[_0x72a3('0x36')];if(!_0x2a78ca['query']['hasOwnProperty'](_0x72a3('0x3a'))){_0x276345[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x2a78ca['query'][_0x72a3('0x1b')]);_0x276345[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x2a78ca['query'][_0x72a3('0x1d')]);}_0x276345[_0x72a3('0x3b')]=qs['sort'](_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x276345[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x2a78ca[_0x72a3('0x31')],_0xf32031['filters']));_0x276345['where']['CampaignId']=_0x9965c1['id'];if(_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x276345[_0x72a3('0x3d')]=_['merge'](_0x276345[_0x72a3('0x3d')],{'$or':_['map'](_0x276345[_0x72a3('0x35')],function(_0x361bf1){var _0x2ab955={};_0x2ab955[_0x361bf1]={'$like':'%'+_0x2a78ca[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x2ab955;})});}_0x276345=_[_0x72a3('0x3f')]({},_0x276345,_0x2a78ca[_0x72a3('0x41')]);return db[_0x72a3('0x5a')][_0x72a3('0x1c')]({'where':_0x276345[_0x72a3('0x3d')]})[_0x72a3('0x24')](function(_0x5f8351){_0x26ad58['count']=_0x5f8351;if(_0x2a78ca['query'][_0x72a3('0x53')]){_0x276345['include']=[{'all':!![]}];}return db[_0x72a3('0x5a')]['findAll'](_0x276345);})[_0x72a3('0x24')](function(_0x5c1409){_0x26ad58[_0x72a3('0x45')]=_0x5c1409;return _0x26ad58;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x4d4fda,_0x276345))['catch'](handleError(_0x4d4fda,null));};exports[_0x72a3('0x5c')]=function(_0x28eba1,_0x4eb02a,_0x5836ec){var _0x13c295={'raw':!![],'where':{}};var _0x3cdfbc={};var _0x120d90={'count':0x0,'rows':[]};return db[_0x72a3('0x42')]['findOne']({'where':{'id':_0x28eba1[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x4eb02a,null))[_0x72a3('0x24')](function(_0x3dc3c4){if(_0x3dc3c4){_0x3cdfbc[_0x72a3('0x36')]=_[_0x72a3('0x32')](db['CmHopperHistory']['rawAttributes']);_0x3cdfbc['query']=_['keys'](_0x28eba1['query']);_0x3cdfbc[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x3cdfbc['model'],_0x3cdfbc[_0x72a3('0x31')]);_0x13c295[_0x72a3('0x35')]=_['intersection'](_0x3cdfbc['model'],qs[_0x72a3('0x37')](_0x28eba1['query'][_0x72a3('0x37')]));_0x13c295[_0x72a3('0x35')]=_0x13c295[_0x72a3('0x35')][_0x72a3('0x38')]?_0x13c295[_0x72a3('0x35')]:_0x3cdfbc['model'];if(!_0x28eba1[_0x72a3('0x31')]['hasOwnProperty'](_0x72a3('0x3a'))){_0x13c295[_0x72a3('0x1b')]=qs['limit'](_0x28eba1[_0x72a3('0x31')]['limit']);_0x13c295['offset']=qs[_0x72a3('0x1d')](_0x28eba1[_0x72a3('0x31')][_0x72a3('0x1d')]);}_0x13c295[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x28eba1['query']['sort']);_0x13c295[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x28eba1[_0x72a3('0x31')],_0x3cdfbc[_0x72a3('0x33')]));_0x13c295[_0x72a3('0x3d')][_0x72a3('0x5d')]=_0x3dc3c4['id'];if(_0x28eba1[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x13c295[_0x72a3('0x3d')]=_['merge'](_0x13c295[_0x72a3('0x3d')],{'$or':_[_0x72a3('0x2d')](_0x13c295['attributes'],function(_0x2944f7){var _0x27f68c={};_0x27f68c[_0x2944f7]={'$like':'%'+_0x28eba1[_0x72a3('0x31')]['filter']+'%'};return _0x27f68c;})});}_0x13c295=_[_0x72a3('0x3f')]({},_0x13c295,_0x28eba1[_0x72a3('0x41')]);return db[_0x72a3('0x5e')][_0x72a3('0x1c')]({'where':_0x13c295[_0x72a3('0x3d')]})['then'](function(_0x101f0c){_0x120d90[_0x72a3('0x1c')]=_0x101f0c;if(_0x28eba1[_0x72a3('0x31')][_0x72a3('0x53')]){_0x13c295[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x5e')]['findAll'](_0x13c295);})[_0x72a3('0x24')](function(_0x46cfc4){_0x120d90['rows']=_0x46cfc4;return _0x120d90;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x4eb02a,_0x13c295))['catch'](handleError(_0x4eb02a,null));};exports[_0x72a3('0x5f')]=function(_0x5c9ada,_0x175f59,_0x5b69b8){var _0x78ecf3={'raw':!![],'where':{}};var _0x355892={};var _0x33d14f={'count':0x0,'rows':[]};return db['Campaign'][_0x72a3('0x60')]({'where':{'id':_0x5c9ada['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x175f59,null))[_0x72a3('0x24')](function(_0x1463d8){if(_0x1463d8){_0x355892[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x61')][_0x72a3('0x62')]);_0x355892[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x5c9ada['query']);_0x355892[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x355892[_0x72a3('0x36')],_0x355892['query']);_0x78ecf3[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x355892[_0x72a3('0x36')],qs['fields'](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x37')]));_0x78ecf3[_0x72a3('0x35')]=_0x78ecf3[_0x72a3('0x35')][_0x72a3('0x38')]?_0x78ecf3[_0x72a3('0x35')]:_0x355892['model'];if(!_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x78ecf3[_0x72a3('0x1b')]=qs['limit'](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x78ecf3[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x5c9ada[_0x72a3('0x31')]['offset']);}_0x78ecf3[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x78ecf3[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x5c9ada['query'],_0x355892[_0x72a3('0x33')]));_0x78ecf3[_0x72a3('0x3d')]['CampaignId']=_0x1463d8['id'];if(_0x5c9ada[_0x72a3('0x31')]['filter']){_0x78ecf3[_0x72a3('0x3d')]=_['merge'](_0x78ecf3['where'],{'$or':_['map'](_0x78ecf3[_0x72a3('0x35')],function(_0x3d7d43){var _0x13537b={};_0x13537b[_0x3d7d43]={'$like':'%'+_0x5c9ada['query'][_0x72a3('0x3e')]+'%'};return _0x13537b;})});}_0x78ecf3=_[_0x72a3('0x3f')]({},_0x78ecf3,_0x5c9ada[_0x72a3('0x41')]);return db[_0x72a3('0x61')][_0x72a3('0x1c')]({'where':_0x78ecf3[_0x72a3('0x3d')]})['then'](function(_0x2ea177){_0x33d14f[_0x72a3('0x1c')]=_0x2ea177;if(_0x5c9ada[_0x72a3('0x31')][_0x72a3('0x53')]){_0x78ecf3[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x61')][_0x72a3('0x44')](_0x78ecf3);})[_0x72a3('0x24')](function(_0x1ac67b){_0x33d14f[_0x72a3('0x45')]=_0x1ac67b;return _0x33d14f;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x175f59,_0x78ecf3))[_0x72a3('0x49')](handleError(_0x175f59,null));};exports[_0x72a3('0x63')]=function(_0x59a6f5,_0x32dd3e,_0x10bdfe){var _0x399e10={'raw':!![],'where':{}};var _0x59045f={};var _0x57860f={'count':0x0,'rows':[]};return db['Campaign'][_0x72a3('0x60')]({'where':{'id':_0x59a6f5['params']['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x32dd3e,null))[_0x72a3('0x24')](function(_0x135601){if(_0x135601){_0x59045f[_0x72a3('0x36')]=_[_0x72a3('0x32')](db['CmHopperBlack'][_0x72a3('0x62')]);_0x59045f[_0x72a3('0x31')]=_['keys'](_0x59a6f5[_0x72a3('0x31')]);_0x59045f[_0x72a3('0x33')]=_['intersection'](_0x59045f[_0x72a3('0x36')],_0x59045f['query']);_0x399e10[_0x72a3('0x35')]=_['intersection'](_0x59045f[_0x72a3('0x36')],qs[_0x72a3('0x37')](_0x59a6f5[_0x72a3('0x31')]['fields']));_0x399e10['attributes']=_0x399e10[_0x72a3('0x35')][_0x72a3('0x38')]?_0x399e10[_0x72a3('0x35')]:_0x59045f[_0x72a3('0x36')];if(!_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x399e10[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x399e10['offset']=qs['offset'](_0x59a6f5['query'][_0x72a3('0x1d')]);}_0x399e10[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x59a6f5['query'][_0x72a3('0x3c')]);_0x399e10['where']=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x59a6f5[_0x72a3('0x31')],_0x59045f[_0x72a3('0x33')]));_0x399e10[_0x72a3('0x3d')][_0x72a3('0x5d')]=_0x135601['id'];if(_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x399e10[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x399e10[_0x72a3('0x3d')],{'$or':_['map'](_0x399e10[_0x72a3('0x35')],function(_0x124428){var _0x101eee={};_0x101eee[_0x124428]={'$like':'%'+_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x101eee;})});}_0x399e10=_[_0x72a3('0x3f')]({},_0x399e10,_0x59a6f5[_0x72a3('0x41')]);return db[_0x72a3('0x64')][_0x72a3('0x1c')]({'where':_0x399e10[_0x72a3('0x3d')]})['then'](function(_0x34505e){_0x57860f[_0x72a3('0x1c')]=_0x34505e;if(_0x59a6f5[_0x72a3('0x31')][_0x72a3('0x53')]){_0x399e10[_0x72a3('0x43')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x72a3('0x44')](_0x399e10);})[_0x72a3('0x24')](function(_0x31c9ea){_0x57860f[_0x72a3('0x45')]=_0x31c9ea;return _0x57860f;});}})[_0x72a3('0x24')](respondWithFilteredResult(_0x32dd3e,_0x399e10))['catch'](handleError(_0x32dd3e,null));};exports[_0x72a3('0x65')]=function(_0x3286c3,_0x3a0bc1,_0x39338f){var _0x35f62e={};var _0x13fcc3={};var _0xf144f7;var _0x3d2b2b;return db[_0x72a3('0x42')][_0x72a3('0x60')]({'where':{'id':_0x3286c3[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a0bc1,null))['then'](function(_0x4660a4){if(_0x4660a4){_0xf144f7=_0x4660a4;_0x13fcc3[_0x72a3('0x36')]=_[_0x72a3('0x32')](db[_0x72a3('0x66')]['rawAttributes']);_0x13fcc3['query']=_['keys'](_0x3286c3[_0x72a3('0x31')]);_0x13fcc3[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x13fcc3['model'],_0x13fcc3[_0x72a3('0x31')]);_0x35f62e[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x13fcc3[_0x72a3('0x36')],qs['fields'](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x37')]));_0x35f62e[_0x72a3('0x35')]=_0x35f62e['attributes'][_0x72a3('0x38')]?_0x35f62e[_0x72a3('0x35')]:_0x13fcc3[_0x72a3('0x36')];_0x35f62e[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x35f62e[_0x72a3('0x3d')]=qs[_0x72a3('0x33')](_[_0x72a3('0x5b')](_0x3286c3[_0x72a3('0x31')],_0x13fcc3[_0x72a3('0x33')]));if(_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x35f62e[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x35f62e[_0x72a3('0x3d')],{'$or':_[_0x72a3('0x2d')](_0x35f62e[_0x72a3('0x35')],function(_0x5ecc7c){var _0x6201ed={};_0x6201ed[_0x5ecc7c]={'$like':'%'+_0x3286c3[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x6201ed;})});}_0x35f62e=_[_0x72a3('0x3f')]({},_0x35f62e,_0x3286c3[_0x72a3('0x41')]);return _0xf144f7[_0x72a3('0x65')](_0x35f62e);}})[_0x72a3('0x24')](function(_0x29abc8){if(_0x29abc8){_0x3d2b2b=_0x29abc8[_0x72a3('0x38')];if(!_0x3286c3[_0x72a3('0x31')][_0x72a3('0x39')](_0x72a3('0x3a'))){_0x35f62e[_0x72a3('0x1b')]=qs[_0x72a3('0x1b')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x35f62e['offset']=qs[_0x72a3('0x1d')](_0x3286c3[_0x72a3('0x31')][_0x72a3('0x1d')]);}return _0xf144f7[_0x72a3('0x65')](_0x35f62e);}})['then'](function(_0x84bcf4){if(_0x84bcf4){return _0x84bcf4?{'count':_0x3d2b2b,'rows':_0x84bcf4}:null;}})[_0x72a3('0x24')](respondWithResult(_0x3a0bc1,null))['catch'](handleError(_0x3a0bc1,null));};exports[_0x72a3('0x67')]=function(_0x5e6709,_0x5c3e23,_0x3c22a7){var _0x5c1714,_0x535c70;return db[_0x72a3('0x42')]['find']({'where':{'id':_0x5e6709[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x5c3e23,null))[_0x72a3('0x24')](function(_0x1fa674){if(_0x1fa674){_0x535c70=_0x1fa674;return _0x1fa674[_0x72a3('0x67')](_0x5e6709[_0x72a3('0x4b')][_0x72a3('0x68')],_[_0x72a3('0x54')](_0x5e6709[_0x72a3('0x4b')],[_0x72a3('0x68'),'id'])||{});}return null;})[_0x72a3('0x69')](function(_0x5a6ea5){var _0x3cbd6d;_0x5c1714=_0x5a6ea5||[];var _0x2d1a70=[];if(_0x5a6ea5){for(var _0x233b41=0x0;_0x233b41<_0x5a6ea5[_0x72a3('0x38')];_0x233b41+=0x1){var _0xdcc2f3=_0x5a6ea5[_0x233b41][_0x72a3('0x4d')]({'plain':!![]});_0x535c70[_0x72a3('0x6a')]=_0x5e6709[_0x72a3('0x4b')][_0x72a3('0x6a')]?_0x5e6709['body']['dialCheckDuplicateType']:_0x535c70[_0x72a3('0x6a')];switch(_0x535c70['dialCheckDuplicateType']){case _0x72a3('0x6b'):_0x3cbd6d=squel[_0x72a3('0x6c')]()[_0x72a3('0x6d')](_0x72a3('0x6e'))[_0x72a3('0x6f')]([_0x72a3('0x70'),_0x72a3('0x71'),_0x72a3('0x72'),_0x72a3('0x73'),_0x72a3('0x5d'),'createdAt',_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')]('phone',_0x72a3('0x70'))['field'](_0x72a3('0x76'),_0x72a3('0x71'))['field']('id','ContactId')[_0x72a3('0x75')](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))['field'](_0x5e6709[_0x72a3('0x47')]['id']['toString'](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),'createdAt')[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))[_0x72a3('0x3d')]('deletedAt\x20IS\x20NULL')[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x72a3('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x72a3('0x74')]()['field'](_0x72a3('0x7c'))[_0x72a3('0x79')](_0x72a3('0x7d'))[_0x72a3('0x3d')](_0x72a3('0x7e'),_0x5e6709[_0x72a3('0x47')]['id'][_0x72a3('0x78')]()))[_0x72a3('0x3d')](_0x72a3('0x7f'),squel[_0x72a3('0x74')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x72a3('0x3d')]('CampaignId\x20=\x20?',_0x5e6709[_0x72a3('0x47')]['id']['toString']())))['toString']();break;case _0x72a3('0x80'):_0x3cbd6d=squel[_0x72a3('0x6c')]()['into']('cm_hopper')[_0x72a3('0x6f')]([_0x72a3('0x70'),_0x72a3('0x71'),'ContactId',_0x72a3('0x73'),_0x72a3('0x5d'),_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x70'),_0x72a3('0x70'))[_0x72a3('0x75')]('NOW()',_0x72a3('0x71'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))['field'](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))['field'](_0x5e6709[_0x72a3('0x47')]['id']['toString'](),_0x72a3('0x5d'))['field'](_0x72a3('0x76'),'createdAt')[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))[_0x72a3('0x3d')](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')](_0x72a3('0x82'))[_0x72a3('0x3d')](_0x72a3('0x7f'),squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x83'))[_0x72a3('0x79')](_0x72a3('0x6e'))[_0x72a3('0x3d')](_0x72a3('0x7e'),_0x5e6709['params']['id'][_0x72a3('0x78')]())))[_0x72a3('0x78')]();break;default:_0x3cbd6d=squel[_0x72a3('0x6c')]()['into'](_0x72a3('0x6e'))[_0x72a3('0x6f')]([_0x72a3('0x70'),'scheduledAt',_0x72a3('0x72'),_0x72a3('0x73'),'CampaignId',_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()['field']('phone',_0x72a3('0x70'))['field']('NOW()',_0x72a3('0x71'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))[_0x72a3('0x75')](_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')](),_0x72a3('0x73'))[_0x72a3('0x75')](_0x5e6709[_0x72a3('0x47')]['id'][_0x72a3('0x78')](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x55'))['field']('NOW()',_0x72a3('0x56'))[_0x72a3('0x79')](_0x72a3('0x7a'))['where'](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0xdcc2f3[_0x72a3('0x77')][_0x72a3('0x78')]())[_0x72a3('0x3d')](_0x72a3('0x82')))[_0x72a3('0x78')]();}_0x2d1a70[_0x72a3('0x84')](db[_0x72a3('0x85')][_0x72a3('0x31')](_0x3cbd6d));}return BPromise[_0x72a3('0x86')](_0x2d1a70);}})['then'](function(){return _0x5c1714;})['then'](respondWithResult(_0x5c3e23,null))['catch'](handleError(_0x5c3e23,null));};exports['removeLists']=function(_0x5ee648,_0x33cadc,_0x2521fe){return db['Campaign']['find']({'where':{'id':_0x5ee648[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x33cadc,null))[_0x72a3('0x24')](function(_0x3db49d){if(_0x3db49d){return _0x3db49d['removeLists'](_0x5ee648[_0x72a3('0x31')]['ids']);}})['then'](function(_0x10ad20){if(_0x10ad20){return db['CmHopper'][_0x72a3('0x27')]({'where':{'ListId':_0x5ee648['query']['ids'],'CampaignId':_0x5ee648[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](function(){return _0x10ad20;});}})[_0x72a3('0x24')](respondWithStatusCode(_0x33cadc,null))[_0x72a3('0x49')](handleError(_0x33cadc,null));};exports['getBlackLists']=function(_0x29a96a,_0x3a22af,_0x316e50){var _0x58d8fc={};var _0x7311e4={};var _0x5d2ff5;var _0x4f119b;return db[_0x72a3('0x42')][_0x72a3('0x60')]({'where':{'id':_0x29a96a[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3a22af,null))[_0x72a3('0x24')](function(_0x122e2d){if(_0x122e2d){_0x5d2ff5=_0x122e2d;_0x7311e4['model']=_[_0x72a3('0x32')](db[_0x72a3('0x66')][_0x72a3('0x62')]);_0x7311e4[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x29a96a[_0x72a3('0x31')]);_0x7311e4[_0x72a3('0x33')]=_['intersection'](_0x7311e4[_0x72a3('0x36')],_0x7311e4[_0x72a3('0x31')]);_0x58d8fc[_0x72a3('0x35')]=_[_0x72a3('0x34')](_0x7311e4[_0x72a3('0x36')],qs['fields'](_0x29a96a['query'][_0x72a3('0x37')]));_0x58d8fc[_0x72a3('0x35')]=_0x58d8fc[_0x72a3('0x35')][_0x72a3('0x38')]?_0x58d8fc[_0x72a3('0x35')]:_0x7311e4[_0x72a3('0x36')];_0x58d8fc[_0x72a3('0x3b')]=qs[_0x72a3('0x3c')](_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3c')]);_0x58d8fc[_0x72a3('0x3d')]=qs['filters'](_['pick'](_0x29a96a[_0x72a3('0x31')],_0x7311e4[_0x72a3('0x33')]));if(_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x58d8fc[_0x72a3('0x3d')]=_[_0x72a3('0x3f')](_0x58d8fc[_0x72a3('0x3d')],{'$or':_['map'](_0x58d8fc[_0x72a3('0x35')],function(_0x26e068){var _0x33b449={};_0x33b449[_0x26e068]={'$like':'%'+_0x29a96a[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x33b449;})});}_0x58d8fc=_[_0x72a3('0x3f')]({},_0x58d8fc,_0x29a96a['options']);return _0x5d2ff5[_0x72a3('0x87')](_0x58d8fc);}})[_0x72a3('0x24')](function(_0x1f12ab){if(_0x1f12ab){_0x4f119b=_0x1f12ab['length'];if(!_0x29a96a[_0x72a3('0x31')]['hasOwnProperty']('nolimit')){_0x58d8fc['limit']=qs['limit'](_0x29a96a[_0x72a3('0x31')][_0x72a3('0x1b')]);_0x58d8fc[_0x72a3('0x1d')]=qs[_0x72a3('0x1d')](_0x29a96a['query']['offset']);}return _0x5d2ff5['getBlackLists'](_0x58d8fc);}})['then'](function(_0x462357){if(_0x462357){return _0x462357?{'count':_0x4f119b,'rows':_0x462357}:null;}})['then'](respondWithResult(_0x3a22af,null))[_0x72a3('0x49')](handleError(_0x3a22af,null));};exports[_0x72a3('0x88')]=function(_0x5d536d,_0x3e7b69,_0xf1ad58){var _0x1f75a5,_0x22fdaf;return db[_0x72a3('0x42')]['find']({'where':{'id':_0x5d536d[_0x72a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e7b69,null))[_0x72a3('0x24')](function(_0x543298){if(_0x543298){_0x22fdaf=_0x543298;return _0x543298['addBlackLists'](_0x5d536d['body'][_0x72a3('0x68')],_[_0x72a3('0x54')](_0x5d536d[_0x72a3('0x4b')],[_0x72a3('0x68'),'id'])||{});}return null;})[_0x72a3('0x69')](function(_0x5efff0){var _0x4df3c2;_0x1f75a5=_0x5efff0||[];var _0xc5947e=[];if(_0x5efff0){for(var _0x3e397a=0x0;_0x3e397a<_0x5efff0[_0x72a3('0x38')];_0x3e397a+=0x1){var _0x3c6c5d=_0x5efff0[_0x3e397a][_0x72a3('0x4d')]({'plain':!![]});_0x4df3c2=squel['insert']()['into'](_0x72a3('0x89'))['fromQuery']([_0x72a3('0x70'),_0x72a3('0x72'),_0x72a3('0x73'),_0x72a3('0x5d'),_0x72a3('0x55'),_0x72a3('0x56')],squel[_0x72a3('0x74')]()[_0x72a3('0x75')](_0x72a3('0x70'),_0x72a3('0x70'))[_0x72a3('0x75')]('id',_0x72a3('0x72'))[_0x72a3('0x75')](_0x3c6c5d[_0x72a3('0x77')]['toString'](),_0x72a3('0x73'))[_0x72a3('0x75')](_0x5d536d['params']['id'][_0x72a3('0x78')](),_0x72a3('0x5d'))[_0x72a3('0x75')](_0x72a3('0x76'),_0x72a3('0x55'))[_0x72a3('0x75')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x72a3('0x81'))[_0x72a3('0x3d')](_0x72a3('0x7b'),_0x3c6c5d[_0x72a3('0x77')]['toString']())[_0x72a3('0x3d')](_0x72a3('0x82')))['toString']();_0xc5947e[_0x72a3('0x84')](db['sequelize']['query'](_0x4df3c2));}return BPromise[_0x72a3('0x86')](_0xc5947e);}})[_0x72a3('0x24')](function(){return _0x1f75a5;})[_0x72a3('0x24')](respondWithResult(_0x3e7b69,null))[_0x72a3('0x49')](handleError(_0x3e7b69,null));};exports[_0x72a3('0x8a')]=function(_0x591cb4,_0x3339b8,_0x3b6406){return db[_0x72a3('0x42')][_0x72a3('0x48')]({'where':{'id':_0x591cb4[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](handleEntityNotFound(_0x3339b8,null))[_0x72a3('0x24')](function(_0x202746){if(_0x202746){return _0x202746['removeBlackLists'](_0x591cb4[_0x72a3('0x31')][_0x72a3('0x68')]);}})[_0x72a3('0x24')](function(_0xd00c28){if(_0xd00c28){return db[_0x72a3('0x64')][_0x72a3('0x27')]({'where':{'ListId':_0x591cb4['query'][_0x72a3('0x68')],'CampaignId':_0x591cb4[_0x72a3('0x47')]['id']}})[_0x72a3('0x24')](function(){return _0xd00c28;});}})[_0x72a3('0x24')](respondWithStatusCode(_0x3339b8,null))['catch'](handleError(_0x3339b8,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 4962b80..f4a8e61 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 70a2356..7096599 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 _0x9b83=['raw','where','attributes','include','map','model','then','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options'];(function(_0x55ebd1,_0x19eae0){var _0x4010ce=function(_0x13890c){while(--_0x13890c){_0x55ebd1['push'](_0x55ebd1['shift']());}};_0x4010ce(++_0x19eae0);}(_0x9b83,0x84));var _0x39b8=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x9b83[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var moment=require(_0x39b8('0x2'));var BPromise=require(_0x39b8('0x3'));var rs=require(_0x39b8('0x4'));var fs=require('fs');var Redis=require(_0x39b8('0x5'));var db=require(_0x39b8('0x6'))['db'];var utils=require(_0x39b8('0x7'));var logger=require(_0x39b8('0x8'))(_0x39b8('0x9'));var config=require('../../config/environment');var jayson=require(_0x39b8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4006c2,_0x3eee6d,_0x4be201){return new BPromise(function(_0x20928d,_0x2477b7){return client['request'](_0x4006c2,_0x4be201)['then'](function(_0x480788){logger[_0x39b8('0xb')](_0x39b8('0xc'),_0x3eee6d,_0x39b8('0xd'));logger[_0x39b8('0xe')](_0x39b8('0xf'),_0x3eee6d,_0x39b8('0xd'),JSON[_0x39b8('0x10')](_0x480788));if(_0x480788[_0x39b8('0x11')]){if(_0x480788[_0x39b8('0x11')]['code']===0x1f4){logger[_0x39b8('0x11')]('Campaign,\x20%s,\x20%s',_0x3eee6d,_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);return _0x2477b7(_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);}logger['error'](_0x39b8('0xc'),_0x3eee6d,_0x480788[_0x39b8('0x11')][_0x39b8('0x12')]);return _0x20928d(_0x480788[_0x39b8('0x11')]['message']);}else{logger[_0x39b8('0xb')]('Campaign,\x20%s,\x20%s',_0x3eee6d,_0x39b8('0xd'));_0x20928d(_0x480788[_0x39b8('0x13')][_0x39b8('0x12')]);}})[_0x39b8('0x14')](function(_0x54242e){logger['error'](_0x39b8('0xc'),_0x3eee6d,_0x54242e);_0x2477b7(_0x54242e);});});}exports['GetCampaign']=function(_0x47a309){var _0x5cdb26=this;return new Promise(function(_0x2a66df,_0x5d1dd1){return db[_0x39b8('0x15')]['findAll']({'raw':_0x47a309[_0x39b8('0x16')]?_0x47a309[_0x39b8('0x16')][_0x39b8('0x17')]===undefined?!![]:![]:!![],'where':_0x47a309['options']?_0x47a309[_0x39b8('0x16')][_0x39b8('0x18')]||null:null,'attributes':_0x47a309[_0x39b8('0x16')]?_0x47a309['options'][_0x39b8('0x19')]||null:null,'limit':_0x47a309['options']?_0x47a309[_0x39b8('0x16')]['limit']||null:null,'include':_0x47a309[_0x39b8('0x16')]?_0x47a309[_0x39b8('0x16')][_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x47a309[_0x39b8('0x16')]['include'],function(_0x3235e6){return{'model':db[_0x3235e6['model']],'as':_0x3235e6['as'],'attributes':_0x3235e6[_0x39b8('0x19')],'include':_0x3235e6[_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x3235e6[_0x39b8('0x1a')],function(_0x51aa13){return{'model':db[_0x51aa13[_0x39b8('0x1c')]],'as':_0x51aa13['as'],'attributes':_0x51aa13[_0x39b8('0x19')],'include':_0x51aa13[_0x39b8('0x1a')]?_[_0x39b8('0x1b')](_0x51aa13[_0x39b8('0x1a')],function(_0x28a373){return{'model':db[_0x28a373[_0x39b8('0x1c')]],'as':_0x28a373['as'],'attributes':_0x28a373['attributes']};}):[]};}):[]};}):[]:[]})[_0x39b8('0x1d')](function(_0x5d6a8a){logger[_0x39b8('0xb')]('GetCampaign',_0x47a309);logger[_0x39b8('0xe')](_0x39b8('0x1e'),_0x47a309,JSON[_0x39b8('0x10')](_0x5d6a8a));_0x2a66df(_0x5d6a8a);})[_0x39b8('0x14')](function(_0x2a288c){logger[_0x39b8('0x11')](_0x39b8('0x1e'),_0x2a288c[_0x39b8('0x12')],_0x47a309);_0x5d1dd1(_0x5cdb26['error'](0x1f4,_0x2a288c[_0x39b8('0x12')]));});});};
\ No newline at end of file
+var _0x24cd=['include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit'];(function(_0x465856,_0x335382){var _0x447123=function(_0x1e8210){while(--_0x1e8210){_0x465856['push'](_0x465856['shift']());}};_0x447123(++_0x335382);}(_0x24cd,0x83));var _0xd24c=function(_0xdf754b,_0x34c91d){_0xdf754b=_0xdf754b-0x0;var _0x48148d=_0x24cd[_0xdf754b];return _0x48148d;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var moment=require('moment');var BPromise=require(_0xd24c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd24c('0x3'));var db=require(_0xd24c('0x4'))['db'];var utils=require(_0xd24c('0x5'));var logger=require('../../config/logger')(_0xd24c('0x6'));var config=require(_0xd24c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd24c('0x8')][_0xd24c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a432a,_0x95eb94,_0x3d4d20){return new BPromise(function(_0x411706,_0x3df525){return client[_0xd24c('0xa')](_0x2a432a,_0x3d4d20)['then'](function(_0x4c4455){logger[_0xd24c('0xb')](_0xd24c('0xc'),_0x95eb94,_0xd24c('0xd'));logger[_0xd24c('0xe')](_0xd24c('0xf'),_0x95eb94,_0xd24c('0xd'),JSON[_0xd24c('0x10')](_0x4c4455));if(_0x4c4455[_0xd24c('0x11')]){if(_0x4c4455['error'][_0xd24c('0x12')]===0x1f4){logger[_0xd24c('0x11')]('Campaign,\x20%s,\x20%s',_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x3df525(_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);}logger[_0xd24c('0x11')](_0xd24c('0xc'),_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x411706(_0x4c4455['error'][_0xd24c('0x13')]);}else{logger[_0xd24c('0xb')]('Campaign,\x20%s,\x20%s',_0x95eb94,_0xd24c('0xd'));_0x411706(_0x4c4455[_0xd24c('0x14')][_0xd24c('0x13')]);}})[_0xd24c('0x15')](function(_0x509992){logger['error'](_0xd24c('0xc'),_0x95eb94,_0x509992);_0x3df525(_0x509992);});});}exports[_0xd24c('0x16')]=function(_0x170d59){var _0x524158=this;return new Promise(function(_0x9f2d2d,_0x190fc1){return db[_0xd24c('0x17')][_0xd24c('0x18')]({'raw':_0x170d59['options']?_0x170d59[_0xd24c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1a')]||null:null,'attributes':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1b')]||null:null,'limit':_0x170d59[_0xd24c('0x19')]?_0x170d59[_0xd24c('0x19')][_0xd24c('0x1c')]||null:null,'include':_0x170d59[_0xd24c('0x19')]?_0x170d59['options'][_0xd24c('0x1d')]?_[_0xd24c('0x1e')](_0x170d59[_0xd24c('0x19')]['include'],function(_0x44471f){return{'model':db[_0x44471f[_0xd24c('0x1f')]],'as':_0x44471f['as'],'attributes':_0x44471f[_0xd24c('0x1b')],'include':_0x44471f['include']?_[_0xd24c('0x1e')](_0x44471f[_0xd24c('0x1d')],function(_0x848e0e){return{'model':db[_0x848e0e[_0xd24c('0x1f')]],'as':_0x848e0e['as'],'attributes':_0x848e0e['attributes'],'include':_0x848e0e['include']?_[_0xd24c('0x1e')](_0x848e0e['include'],function(_0x13a9a7){return{'model':db[_0x13a9a7[_0xd24c('0x1f')]],'as':_0x13a9a7['as'],'attributes':_0x13a9a7[_0xd24c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cb1b3){logger[_0xd24c('0xb')](_0xd24c('0x16'),_0x170d59);logger[_0xd24c('0xe')](_0xd24c('0x16'),_0x170d59,JSON[_0xd24c('0x10')](_0x4cb1b3));_0x9f2d2d(_0x4cb1b3);})[_0xd24c('0x15')](function(_0x1be144){logger[_0xd24c('0x11')](_0xd24c('0x16'),_0x1be144[_0xd24c('0x13')],_0x170d59);_0x190fc1(_0x524158[_0xd24c('0x11')](0x1f4,_0x1be144['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 351c490..85f25dc 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 _0x5e3f=['/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/lists','post'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x5e3f,0x110));var _0xf5e3=function(_0x28e3c6,_0x31cf69){_0x28e3c6=_0x28e3c6-0x0;var _0x206c18=_0x5e3f[_0x28e3c6];return _0x206c18;};'use strict';var multer=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var path=require(_0xf5e3('0x2'));var timeout=require(_0xf5e3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf5e3('0x4'));var auth=require(_0xf5e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf5e3('0x6'));var controller=require(_0xf5e3('0x7'));router[_0xf5e3('0x8')]('/',auth[_0xf5e3('0x9')](),controller[_0xf5e3('0xa')]);router[_0xf5e3('0x8')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller['show']);router[_0xf5e3('0x8')](_0xf5e3('0xc'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0xd')]);router['get'](_0xf5e3('0xe'),auth[_0xf5e3('0x9')](),controller['getHopperHistories']);router[_0xf5e3('0x8')](_0xf5e3('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xf5e3('0x9')](),controller['getHopperBlacks']);router[_0xf5e3('0x8')](_0xf5e3('0x10'),auth[_0xf5e3('0x9')](),controller['getLists']);router[_0xf5e3('0x8')]('/:id/blacklists',auth[_0xf5e3('0x9')](),controller['getBlackLists']);router[_0xf5e3('0x11')]('/',auth[_0xf5e3('0x9')](),controller['create']);router[_0xf5e3('0x11')](_0xf5e3('0x12'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x13')]);router[_0xf5e3('0x11')](_0xf5e3('0x10'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x14')]);router[_0xf5e3('0x11')](_0xf5e3('0x15'),auth[_0xf5e3('0x9')](),controller['addBlackLists']);router[_0xf5e3('0x16')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x17')]);router[_0xf5e3('0x18')](_0xf5e3('0xb'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x19')]);router[_0xf5e3('0x18')]('/:id/lists',auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x1a')]);router[_0xf5e3('0x18')](_0xf5e3('0x15'),auth[_0xf5e3('0x9')](),controller[_0xf5e3('0x1b')]);module[_0xf5e3('0x1c')]=router;
\ No newline at end of file
+var _0xcd3a=['getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','/:id/clone','/:id/lists','addLists','addBlackLists','put','destroy','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals'];(function(_0x5c3911,_0x4a0911){var _0x120c8d=function(_0x1ad7fe){while(--_0x1ad7fe){_0x5c3911['push'](_0x5c3911['shift']());}};_0x120c8d(++_0x4a0911);}(_0xcd3a,0xcf));var _0xacd3=function(_0x32db4e,_0x38bc24){_0x32db4e=_0x32db4e-0x0;var _0x21276a=_0xcd3a[_0x32db4e];return _0x21276a;};'use strict';var multer=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var path=require(_0xacd3('0x2'));var timeout=require(_0xacd3('0x3'));var express=require(_0xacd3('0x4'));var router=express[_0xacd3('0x5')]();var fs_extra=require(_0xacd3('0x6'));var auth=require(_0xacd3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xacd3('0x8'));var controller=require(_0xacd3('0x9'));router[_0xacd3('0xa')]('/',auth[_0xacd3('0xb')](),controller['index']);router['get'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xd')]);router['get'](_0xacd3('0xe'),auth[_0xacd3('0xb')](),controller[_0xacd3('0xf')]);router[_0xacd3('0xa')]('/:id/hopper_histories',auth[_0xacd3('0xb')](),controller['getHopperHistories']);router[_0xacd3('0xa')](_0xacd3('0x10'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x11')]);router['get'](_0xacd3('0x12'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x13')]);router['get']('/:id/lists',auth[_0xacd3('0xb')](),controller[_0xacd3('0x14')]);router['get'](_0xacd3('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xacd3('0x16')]('/',auth[_0xacd3('0xb')](),controller['create']);router[_0xacd3('0x16')](_0xacd3('0x17'),auth[_0xacd3('0xb')](),controller['clone']);router[_0xacd3('0x16')](_0xacd3('0x18'),auth['isAuthenticated'](),controller[_0xacd3('0x19')]);router[_0xacd3('0x16')](_0xacd3('0x15'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x1a')]);router[_0xacd3('0x1b')](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller['update']);router['delete'](_0xacd3('0xc'),auth[_0xacd3('0xb')](),controller[_0xacd3('0x1c')]);router[_0xacd3('0x1d')](_0xacd3('0x18'),auth['isAuthenticated'](),controller[_0xacd3('0x1e')]);router[_0xacd3('0x1d')](_0xacd3('0x15'),auth[_0xacd3('0xb')](),controller['removeBlackLists']);module[_0xacd3('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 6d6c118..e03f0e1 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 _0x2227=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0xbf3522,_0x306da0){var _0x47c693=function(_0x18c5c7){while(--_0x18c5c7){_0xbf3522['push'](_0xbf3522['shift']());}};_0x47c693(++_0x306da0);}(_0x2227,0x1a4));var _0x7222=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2227[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x7222('0x0'));module[_0x7222('0x1')]={'key':{'type':Sequelize[_0x7222('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7222('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7222('0x4')],'get':function(){return this[_0x7222('0x5')]('key');}}};
\ No newline at end of file
+var _0xd827=['TEXT','VIRTUAL','exports','STRING'];(function(_0x201bb7,_0xb4ae42){var _0x463e3b=function(_0x4d7920){while(--_0x4d7920){_0x201bb7['push'](_0x201bb7['shift']());}};_0x463e3b(++_0xb4ae42);}(_0xd827,0x1a6));var _0x7d82=function(_0x1afedc,_0x17ee2f){_0x1afedc=_0x1afedc-0x0;var _0x3520db=_0xd827[_0x1afedc];return _0x3520db;};'use strict';var Sequelize=require('sequelize');module[_0x7d82('0x0')]={'key':{'type':Sequelize[_0x7d82('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7d82('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7d82('0x1')]},'name':{'type':Sequelize[_0x7d82('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 15bc83a..f9106b1 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 _0xe86d=['destroy','get','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','include','CannedAnswer','findAll','rows','catch','show','params','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe86d,0x90));var _0xde86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe86d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xde86('0x0'));var rimraf=require(_0xde86('0x1'));var zipdir=require(_0xde86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde86('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xde86('0x4'));var util=require(_0xde86('0x5'));var path=require(_0xde86('0x6'));var sox=require(_0xde86('0x7'));var csv=require('to-csv');var ejs=require(_0xde86('0x8'));var fs=require('fs');var fs_extra=require(_0xde86('0x9'));var _=require(_0xde86('0xa'));var squel=require(_0xde86('0xb'));var crypto=require('crypto');var jsforce=require(_0xde86('0xc'));var deskjs=require(_0xde86('0xd'));var toCsv=require(_0xde86('0xe'));var querystring=require('querystring');var Papa=require(_0xde86('0xf'));var Redis=require(_0xde86('0x10'));var authService=require(_0xde86('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xde86('0x12'));var hardwareService=require(_0xde86('0x13'));var logger=require(_0xde86('0x14'))(_0xde86('0x15'));var utils=require(_0xde86('0x16'));var config=require(_0xde86('0x17'));var licenseUtil=require(_0xde86('0x18'));var db=require(_0xde86('0x19'))['db'];function respondWithStatusCode(_0xd1c2cd,_0x444016){_0x444016=_0x444016||0xcc;return function(_0x6bb311){if(_0x6bb311){return _0xd1c2cd[_0xde86('0x1a')](_0x444016);}return _0xd1c2cd[_0xde86('0x1b')](_0x444016)['end']();};}function respondWithResult(_0x352baf,_0x702339){_0x702339=_0x702339||0xc8;return function(_0x150615){if(_0x150615){return _0x352baf[_0xde86('0x1b')](_0x702339)[_0xde86('0x1c')](_0x150615);}};}function respondWithFilteredResult(_0x529918,_0x21f5aa){return function(_0x31e10d){if(_0x31e10d){var _0x58aa37=typeof _0x21f5aa[_0xde86('0x1d')]===_0xde86('0x1e')&&typeof _0x21f5aa[_0xde86('0x1f')]==='undefined';var _0x3f87a4=_0x31e10d[_0xde86('0x20')];var _0x1c9254=_0x58aa37?0x0:_0x21f5aa[_0xde86('0x1d')];var _0x236654=_0x58aa37?_0x31e10d[_0xde86('0x20')]:_0x21f5aa['offset']+_0x21f5aa['limit'];var _0x2a0cf4;if(_0x236654>=_0x3f87a4){_0x236654=_0x3f87a4;_0x2a0cf4=0xc8;}else{_0x2a0cf4=0xce;}_0x529918[_0xde86('0x1b')](_0x2a0cf4);return _0x529918[_0xde86('0x21')]('Content-Range',_0x1c9254+'-'+_0x236654+'/'+_0x3f87a4)['json'](_0x31e10d);}return null;};}function patchUpdates(_0x1139df){return function(_0x3904e6){try{jsonpatch[_0xde86('0x22')](_0x3904e6,_0x1139df,!![]);}catch(_0x4ad053){return BPromise['reject'](_0x4ad053);}return _0x3904e6[_0xde86('0x23')]();};}function saveUpdates(_0x40d7ee,_0x1122f1){return function(_0x3c44d0){if(_0x3c44d0){return _0x3c44d0[_0xde86('0x24')](_0x40d7ee)[_0xde86('0x25')](function(_0x79a81b){return _0x79a81b;});}return null;};}function removeEntity(_0x1ba777,_0x3ba609){return function(_0x19752d){if(_0x19752d){return _0x19752d[_0xde86('0x26')]()['then'](function(){var _0x10d731=_0x19752d[_0xde86('0x27')]({'plain':!![]});var _0xf6fbc='CannedAnswers';return db['UserProfileResource'][_0xde86('0x26')]({'where':{'type':_0xf6fbc,'resourceId':_0x10d731['id']}})['then'](function(){return _0x19752d;});})['then'](function(){_0x1ba777[_0xde86('0x1b')](0xcc)[_0xde86('0x28')]();});}};}function handleEntityNotFound(_0x120107,_0x4b7d75){return function(_0x4104a9){if(!_0x4104a9){_0x120107['sendStatus'](0x194);}return _0x4104a9;};}function handleError(_0x43b9e3,_0x1d2797){_0x1d2797=_0x1d2797||0x1f4;return function(_0x1afd60){logger[_0xde86('0x29')](_0x1afd60[_0xde86('0x2a')]);if(_0x1afd60['name']){delete _0x1afd60[_0xde86('0x2b')];}_0x43b9e3['status'](_0x1d2797)[_0xde86('0x2c')](_0x1afd60);};}exports['index']=function(_0x3c1d6b,_0x2ad3e7){var _0x33abae={},_0x2efae9={},_0x56d242={'count':0x0,'rows':[]};var _0x2a1aad=_['map'](db['CannedAnswer'][_0xde86('0x2d')],function(_0x40757d){return{'name':_0x40757d[_0xde86('0x2e')],'type':_0x40757d[_0xde86('0x2f')][_0xde86('0x30')]};});_0x2efae9['model']=_[_0xde86('0x31')](_0x2a1aad,_0xde86('0x2b'));_0x2efae9[_0xde86('0x32')]=_[_0xde86('0x33')](_0x3c1d6b[_0xde86('0x32')]);_0x2efae9[_0xde86('0x34')]=_[_0xde86('0x35')](_0x2efae9['model'],_0x2efae9[_0xde86('0x32')]);_0x33abae[_0xde86('0x36')]=_[_0xde86('0x35')](_0x2efae9[_0xde86('0x37')],qs[_0xde86('0x38')](_0x3c1d6b['query']['fields']));_0x33abae[_0xde86('0x36')]=_0x33abae['attributes'][_0xde86('0x39')]?_0x33abae[_0xde86('0x36')]:_0x2efae9['model'];if(!_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3a')](_0xde86('0x3b'))){_0x33abae[_0xde86('0x1f')]=qs['limit'](_0x3c1d6b[_0xde86('0x32')][_0xde86('0x1f')]);_0x33abae['offset']=qs[_0xde86('0x1d')](_0x3c1d6b[_0xde86('0x32')]['offset']);}_0x33abae['order']=qs['sort'](_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3c')]);_0x33abae[_0xde86('0x3d')]=qs[_0xde86('0x34')](_['pick'](_0x3c1d6b[_0xde86('0x32')],_0x2efae9[_0xde86('0x34')]),_0x2a1aad);if(_0x3c1d6b['query']['filter']){_0x33abae['where']=_[_0xde86('0x3e')](_0x33abae[_0xde86('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3c1d6b[_0xde86('0x32')][_0xde86('0x3f')]+'%'}},{'value':{'$like':'%'+_0x3c1d6b[_0xde86('0x32')]['filter']+'%'}}]});}_0x33abae=_[_0xde86('0x3e')]({},_0x33abae,_0x3c1d6b[_0xde86('0x40')]);var _0x3ed5f9={'where':_0x33abae[_0xde86('0x3d')]};return db['CannedAnswer'][_0xde86('0x20')](_0x3ed5f9)[_0xde86('0x25')](function(_0x3f1f33){_0x56d242['count']=_0x3f1f33;if(_0x3c1d6b[_0xde86('0x32')]['includeAll']){_0x33abae[_0xde86('0x41')]=[{'all':!![]}];}return db[_0xde86('0x42')][_0xde86('0x43')](_0x33abae);})[_0xde86('0x25')](function(_0x5ff4a8){_0x56d242[_0xde86('0x44')]=_0x5ff4a8;return _0x56d242;})[_0xde86('0x25')](respondWithFilteredResult(_0x2ad3e7,_0x33abae))[_0xde86('0x45')](handleError(_0x2ad3e7,null));};exports[_0xde86('0x46')]=function(_0x4eba27,_0x19567c){var _0x29ac8f={'raw':!![],'where':{'id':_0x4eba27[_0xde86('0x47')]['id']}},_0x42dfe1={};_0x42dfe1[_0xde86('0x37')]=_[_0xde86('0x33')](db[_0xde86('0x42')]['rawAttributes']);_0x42dfe1['query']=_[_0xde86('0x33')](_0x4eba27[_0xde86('0x32')]);_0x42dfe1['filters']=_[_0xde86('0x35')](_0x42dfe1[_0xde86('0x37')],_0x42dfe1['query']);_0x29ac8f[_0xde86('0x36')]=_['intersection'](_0x42dfe1[_0xde86('0x37')],qs[_0xde86('0x38')](_0x4eba27[_0xde86('0x32')][_0xde86('0x38')]));_0x29ac8f['attributes']=_0x29ac8f[_0xde86('0x36')]['length']?_0x29ac8f[_0xde86('0x36')]:_0x42dfe1[_0xde86('0x37')];if(_0x4eba27['query'][_0xde86('0x48')]){_0x29ac8f[_0xde86('0x41')]=[{'all':!![]}];}_0x29ac8f=_['merge']({},_0x29ac8f,_0x4eba27['options']);return db[_0xde86('0x42')][_0xde86('0x49')](_0x29ac8f)[_0xde86('0x25')](handleEntityNotFound(_0x19567c,null))[_0xde86('0x25')](respondWithResult(_0x19567c,null))['catch'](handleError(_0x19567c,null));};exports[_0xde86('0x24')]=function(_0x21fdb2,_0x2565b9){if(_0x21fdb2[_0xde86('0x4a')]['id']){delete _0x21fdb2[_0xde86('0x4a')]['id'];}return db['CannedAnswer'][_0xde86('0x49')]({'where':{'id':_0x21fdb2[_0xde86('0x47')]['id']}})[_0xde86('0x25')](handleEntityNotFound(_0x2565b9,null))[_0xde86('0x25')](saveUpdates(_0x21fdb2[_0xde86('0x4a')],null))[_0xde86('0x25')](respondWithResult(_0x2565b9,null))[_0xde86('0x45')](handleError(_0x2565b9,null));};exports[_0xde86('0x26')]=function(_0x43b621,_0x6ad368){return db[_0xde86('0x42')]['find']({'where':{'id':_0x43b621[_0xde86('0x47')]['id']}})[_0xde86('0x25')](handleEntityNotFound(_0x6ad368,null))[_0xde86('0x25')](removeEntity(_0x6ad368,null))[_0xde86('0x45')](handleError(_0x6ad368,null));};exports[_0xde86('0x4b')]=function(_0x4e1fb0,_0x2ffe2f){var _0x469a68={'key':_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x30')]};if(_0x4e1fb0['body'][_0xde86('0x4c')]){_0x469a68[_0xde86('0x4c')]=_0x4e1fb0[_0xde86('0x4a')]['MailAccountId'];}else if(_0x4e1fb0[_0xde86('0x4a')]['SmsAccountId']){_0x469a68['SmsAccountId']=_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4d')];}else if(_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4e')]){_0x469a68['OpenchannelAccountId']=_0x4e1fb0[_0xde86('0x4a')][_0xde86('0x4e')];}else if(_0x4e1fb0['body'][_0xde86('0x4f')]){_0x469a68[_0xde86('0x4f')]=_0x4e1fb0[_0xde86('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x469a68})[_0xde86('0x25')](function(_0x369d80){if(_0x369d80){throw new db[(_0xde86('0x50'))][(_0xde86('0x51'))](_0xde86('0x52'));}return db[_0xde86('0x42')][_0xde86('0x4b')](_0x4e1fb0[_0xde86('0x4a')]);})[_0xde86('0x25')](function(_0x141c5d){var _0x5c26a6=_0x4e1fb0[_0xde86('0x53')][_0xde86('0x27')]({'plain':!![]});if(!_0x5c26a6)throw new Error(_0xde86('0x54'));if(_0x5c26a6['role']==='user'){var _0x5ed9d3=_0x141c5d[_0xde86('0x27')]({'plain':!![]});return db[_0xde86('0x55')][_0xde86('0x49')]({'where':{'name':_0xde86('0x56'),'userProfileId':_0x5c26a6[_0xde86('0x57')]},'raw':!![]})['then'](function(_0x3cd7e1){if(_0x3cd7e1&&_0x3cd7e1[_0xde86('0x58')]===0x0){return db[_0xde86('0x59')]['create']({'name':_0x5ed9d3[_0xde86('0x2b')],'resourceId':_0x5ed9d3['id'],'type':_0x3cd7e1[_0xde86('0x2b')],'sectionId':_0x3cd7e1['id']},{})[_0xde86('0x25')](function(){return _0x141c5d;});}else{return _0x141c5d;}})[_0xde86('0x45')](function(_0x4ca7aa){logger['error'](_0xde86('0x5a'),_0x4ca7aa);throw _0x4ca7aa;});}return _0x141c5d;})[_0xde86('0x25')](respondWithResult(_0x2ffe2f,0xc9))[_0xde86('0x45')](handleError(_0x2ffe2f,null));};
\ No newline at end of file
+var _0x5f53=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','reject','update','then','destroy','get','CannedAnswers','end','sendStatus','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','body','create','MailAccountId'];(function(_0x63c9b5,_0x5e9ef1){var _0x4b50fd=function(_0x10a37d){while(--_0x10a37d){_0x63c9b5['push'](_0x63c9b5['shift']());}};_0x4b50fd(++_0x5e9ef1);}(_0x5f53,0x16c));var _0x35f5=function(_0x3fe1ba,_0x1a33c5){_0x3fe1ba=_0x3fe1ba-0x0;var _0x5df1b4=_0x5f53[_0x3fe1ba];return _0x5df1b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x35f5('0x0'));var jsonpatch=require(_0x35f5('0x1'));var rp=require(_0x35f5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35f5('0x3'));var util=require('util');var path=require(_0x35f5('0x4'));var sox=require(_0x35f5('0x5'));var csv=require(_0x35f5('0x6'));var ejs=require(_0x35f5('0x7'));var fs=require('fs');var fs_extra=require(_0x35f5('0x8'));var _=require(_0x35f5('0x9'));var squel=require(_0x35f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x35f5('0xb'));var deskjs=require(_0x35f5('0xc'));var toCsv=require(_0x35f5('0x6'));var querystring=require(_0x35f5('0xd'));var Papa=require(_0x35f5('0xe'));var Redis=require(_0x35f5('0xf'));var authService=require(_0x35f5('0x10'));var qs=require(_0x35f5('0x11'));var as=require(_0x35f5('0x12'));var hardwareService=require(_0x35f5('0x13'));var logger=require(_0x35f5('0x14'))(_0x35f5('0x15'));var utils=require(_0x35f5('0x16'));var config=require(_0x35f5('0x17'));var licenseUtil=require(_0x35f5('0x18'));var db=require(_0x35f5('0x19'))['db'];function respondWithStatusCode(_0x5ec872,_0x234bea){_0x234bea=_0x234bea||0xcc;return function(_0x12ed6c){if(_0x12ed6c){return _0x5ec872['sendStatus'](_0x234bea);}return _0x5ec872[_0x35f5('0x1a')](_0x234bea)['end']();};}function respondWithResult(_0xd386d1,_0xab27bc){_0xab27bc=_0xab27bc||0xc8;return function(_0x50778e){if(_0x50778e){return _0xd386d1['status'](_0xab27bc)['json'](_0x50778e);}};}function respondWithFilteredResult(_0x3ef14e,_0x5e0dc5){return function(_0x1f7193){if(_0x1f7193){var _0x15e7cf=typeof _0x5e0dc5[_0x35f5('0x1b')]===_0x35f5('0x1c')&&typeof _0x5e0dc5[_0x35f5('0x1d')]===_0x35f5('0x1c');var _0x5883f1=_0x1f7193[_0x35f5('0x1e')];var _0x1d8b9b=_0x15e7cf?0x0:_0x5e0dc5[_0x35f5('0x1b')];var _0x5e72c7=_0x15e7cf?_0x1f7193[_0x35f5('0x1e')]:_0x5e0dc5[_0x35f5('0x1b')]+_0x5e0dc5['limit'];var _0x48ce20;if(_0x5e72c7>=_0x5883f1){_0x5e72c7=_0x5883f1;_0x48ce20=0xc8;}else{_0x48ce20=0xce;}_0x3ef14e[_0x35f5('0x1a')](_0x48ce20);return _0x3ef14e['set']('Content-Range',_0x1d8b9b+'-'+_0x5e72c7+'/'+_0x5883f1)[_0x35f5('0x1f')](_0x1f7193);}return null;};}function patchUpdates(_0x5f51c9){return function(_0x1a09dc){try{jsonpatch['apply'](_0x1a09dc,_0x5f51c9,!![]);}catch(_0x34724f){return BPromise[_0x35f5('0x20')](_0x34724f);}return _0x1a09dc['save']();};}function saveUpdates(_0x471b9f,_0x42d87b){return function(_0x24eaed){if(_0x24eaed){return _0x24eaed[_0x35f5('0x21')](_0x471b9f)[_0x35f5('0x22')](function(_0x162e4a){return _0x162e4a;});}return null;};}function removeEntity(_0x54551c,_0x15ba52){return function(_0xd7b6e3){if(_0xd7b6e3){return _0xd7b6e3[_0x35f5('0x23')]()['then'](function(){var _0x15106e=_0xd7b6e3[_0x35f5('0x24')]({'plain':!![]});var _0x363273=_0x35f5('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x363273,'resourceId':_0x15106e['id']}})[_0x35f5('0x22')](function(){return _0xd7b6e3;});})[_0x35f5('0x22')](function(){_0x54551c['status'](0xcc)[_0x35f5('0x26')]();});}};}function handleEntityNotFound(_0xd2e63,_0x546f05){return function(_0x98c737){if(!_0x98c737){_0xd2e63[_0x35f5('0x27')](0x194);}return _0x98c737;};}function handleError(_0x521d54,_0x32fd4f){_0x32fd4f=_0x32fd4f||0x1f4;return function(_0x9fb9f4){logger[_0x35f5('0x28')](_0x9fb9f4[_0x35f5('0x29')]);if(_0x9fb9f4[_0x35f5('0x2a')]){delete _0x9fb9f4['name'];}_0x521d54[_0x35f5('0x1a')](_0x32fd4f)[_0x35f5('0x2b')](_0x9fb9f4);};}exports[_0x35f5('0x2c')]=function(_0xda6f32,_0x198298){var _0x1bc7d0={},_0x4990ed={},_0xfffe2={'count':0x0,'rows':[]};var _0x35a514=_[_0x35f5('0x2d')](db[_0x35f5('0x2e')]['rawAttributes'],function(_0x15eb2f){return{'name':_0x15eb2f[_0x35f5('0x2f')],'type':_0x15eb2f[_0x35f5('0x30')][_0x35f5('0x31')]};});_0x4990ed[_0x35f5('0x32')]=_[_0x35f5('0x2d')](_0x35a514,_0x35f5('0x2a'));_0x4990ed['query']=_['keys'](_0xda6f32[_0x35f5('0x33')]);_0x4990ed[_0x35f5('0x34')]=_[_0x35f5('0x35')](_0x4990ed[_0x35f5('0x32')],_0x4990ed['query']);_0x1bc7d0[_0x35f5('0x36')]=_[_0x35f5('0x35')](_0x4990ed['model'],qs[_0x35f5('0x37')](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x37')]));_0x1bc7d0[_0x35f5('0x36')]=_0x1bc7d0[_0x35f5('0x36')][_0x35f5('0x38')]?_0x1bc7d0[_0x35f5('0x36')]:_0x4990ed[_0x35f5('0x32')];if(!_0xda6f32['query']['hasOwnProperty'](_0x35f5('0x39'))){_0x1bc7d0[_0x35f5('0x1d')]=qs['limit'](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x1d')]);_0x1bc7d0[_0x35f5('0x1b')]=qs[_0x35f5('0x1b')](_0xda6f32[_0x35f5('0x33')][_0x35f5('0x1b')]);}_0x1bc7d0[_0x35f5('0x3a')]=qs[_0x35f5('0x3b')](_0xda6f32['query'][_0x35f5('0x3b')]);_0x1bc7d0[_0x35f5('0x3c')]=qs['filters'](_['pick'](_0xda6f32['query'],_0x4990ed[_0x35f5('0x34')]),_0x35a514);if(_0xda6f32[_0x35f5('0x33')]['filter']){_0x1bc7d0['where']=_[_0x35f5('0x3d')](_0x1bc7d0[_0x35f5('0x3c')],{'$or':[{'key':{'$like':'%'+_0xda6f32['query']['filter']+'%'}},{'value':{'$like':'%'+_0xda6f32[_0x35f5('0x33')][_0x35f5('0x3e')]+'%'}}]});}_0x1bc7d0=_['merge']({},_0x1bc7d0,_0xda6f32[_0x35f5('0x3f')]);var _0x537bc1={'where':_0x1bc7d0[_0x35f5('0x3c')]};return db[_0x35f5('0x2e')]['count'](_0x537bc1)[_0x35f5('0x22')](function(_0x2444b6){_0xfffe2[_0x35f5('0x1e')]=_0x2444b6;if(_0xda6f32[_0x35f5('0x33')][_0x35f5('0x40')]){_0x1bc7d0[_0x35f5('0x41')]=[{'all':!![]}];}return db[_0x35f5('0x2e')][_0x35f5('0x42')](_0x1bc7d0);})[_0x35f5('0x22')](function(_0x17731a){_0xfffe2[_0x35f5('0x43')]=_0x17731a;return _0xfffe2;})[_0x35f5('0x22')](respondWithFilteredResult(_0x198298,_0x1bc7d0))[_0x35f5('0x44')](handleError(_0x198298,null));};exports[_0x35f5('0x45')]=function(_0x2e4c59,_0x7addae){var _0x152803={'raw':!![],'where':{'id':_0x2e4c59[_0x35f5('0x46')]['id']}},_0x4be52a={};_0x4be52a[_0x35f5('0x32')]=_[_0x35f5('0x47')](db[_0x35f5('0x2e')][_0x35f5('0x48')]);_0x4be52a['query']=_['keys'](_0x2e4c59[_0x35f5('0x33')]);_0x4be52a[_0x35f5('0x34')]=_['intersection'](_0x4be52a[_0x35f5('0x32')],_0x4be52a[_0x35f5('0x33')]);_0x152803['attributes']=_[_0x35f5('0x35')](_0x4be52a[_0x35f5('0x32')],qs[_0x35f5('0x37')](_0x2e4c59[_0x35f5('0x33')][_0x35f5('0x37')]));_0x152803[_0x35f5('0x36')]=_0x152803['attributes'][_0x35f5('0x38')]?_0x152803[_0x35f5('0x36')]:_0x4be52a[_0x35f5('0x32')];if(_0x2e4c59['query']['includeAll']){_0x152803['include']=[{'all':!![]}];}_0x152803=_['merge']({},_0x152803,_0x2e4c59[_0x35f5('0x3f')]);return db[_0x35f5('0x2e')]['find'](_0x152803)[_0x35f5('0x22')](handleEntityNotFound(_0x7addae,null))['then'](respondWithResult(_0x7addae,null))[_0x35f5('0x44')](handleError(_0x7addae,null));};exports[_0x35f5('0x21')]=function(_0x4dfc0b,_0x405421){if(_0x4dfc0b['body']['id']){delete _0x4dfc0b[_0x35f5('0x49')]['id'];}return db[_0x35f5('0x2e')]['find']({'where':{'id':_0x4dfc0b[_0x35f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x405421,null))['then'](saveUpdates(_0x4dfc0b[_0x35f5('0x49')],null))[_0x35f5('0x22')](respondWithResult(_0x405421,null))['catch'](handleError(_0x405421,null));};exports[_0x35f5('0x23')]=function(_0x4d539b,_0x4d6ad3){return db[_0x35f5('0x2e')]['find']({'where':{'id':_0x4d539b[_0x35f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d6ad3,null))[_0x35f5('0x22')](removeEntity(_0x4d6ad3,null))[_0x35f5('0x44')](handleError(_0x4d6ad3,null));};exports[_0x35f5('0x4a')]=function(_0x1699a7,_0x55b7f1){var _0x34b87c={'key':_0x1699a7['body'][_0x35f5('0x31')]};if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4b')]){_0x34b87c[_0x35f5('0x4b')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4b')];}else if(_0x1699a7[_0x35f5('0x49')]['SmsAccountId']){_0x34b87c[_0x35f5('0x4c')]=_0x1699a7[_0x35f5('0x49')]['SmsAccountId'];}else if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4d')]){_0x34b87c[_0x35f5('0x4d')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4d')];}else if(_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4e')]){_0x34b87c[_0x35f5('0x4e')]=_0x1699a7[_0x35f5('0x49')][_0x35f5('0x4e')];}return db[_0x35f5('0x2e')][_0x35f5('0x4f')]({'where':_0x34b87c})['then'](function(_0x5ad125){if(_0x5ad125){throw new db[(_0x35f5('0x50'))]['ValidationError'](_0x35f5('0x51'));}return db[_0x35f5('0x2e')]['create'](_0x1699a7['body']);})[_0x35f5('0x22')](function(_0x16c21e){var _0x5647d7=_0x1699a7[_0x35f5('0x52')][_0x35f5('0x24')]({'plain':!![]});if(!_0x5647d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5647d7[_0x35f5('0x53')]===_0x35f5('0x52')){var _0x724e46=_0x16c21e[_0x35f5('0x24')]({'plain':!![]});return db[_0x35f5('0x54')][_0x35f5('0x4f')]({'where':{'name':'CannedAnswers','userProfileId':_0x5647d7['userProfileId']},'raw':!![]})[_0x35f5('0x22')](function(_0x40ddd9){if(_0x40ddd9&&_0x40ddd9[_0x35f5('0x55')]===0x0){return db[_0x35f5('0x56')][_0x35f5('0x4a')]({'name':_0x724e46[_0x35f5('0x2a')],'resourceId':_0x724e46['id'],'type':_0x40ddd9[_0x35f5('0x2a')],'sectionId':_0x40ddd9['id']},{})[_0x35f5('0x22')](function(){return _0x16c21e;});}else{return _0x16c21e;}})[_0x35f5('0x44')](function(_0x5d2e9f){logger[_0x35f5('0x28')](_0x35f5('0x57'),_0x5d2e9f);throw _0x5d2e9f;});}return _0x16c21e;})[_0x35f5('0x22')](respondWithResult(_0x55b7f1,0xc9))[_0x35f5('0x44')](handleError(_0x55b7f1,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 89826a1..573a9a2 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 _0x0f6d=['request-promise','path','rimraf','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x57d9fe,_0x47b607){var _0x2a7839=function(_0xa60873){while(--_0xa60873){_0x57d9fe['push'](_0x57d9fe['shift']());}};_0x2a7839(++_0x47b607);}(_0x0f6d,0xe5));var _0xd0f6=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0x0f6d[_0x1ac6ec];return _0x48a489;};'use strict';var _=require(_0xd0f6('0x0'));var util=require(_0xd0f6('0x1'));var logger=require(_0xd0f6('0x2'))(_0xd0f6('0x3'));var moment=require(_0xd0f6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd0f6('0x5'));var fs=require('fs');var path=require(_0xd0f6('0x6'));var rimraf=require(_0xd0f6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd0f6('0x8'));module['exports']=function(_0x268250,_0x1f8f4e){return _0x268250[_0xd0f6('0x9')](_0xd0f6('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd0f6('0xb'),'collate':_0xd0f6('0xc')});};
\ No newline at end of file
+var _0x48a1=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bb4c7,_0x1a6eae){var _0x134ef1=function(_0x4c3e4c){while(--_0x4c3e4c){_0x3bb4c7['push'](_0x3bb4c7['shift']());}};_0x134ef1(++_0x1a6eae);}(_0x48a1,0xf5));var _0x148a=function(_0x58d17e,_0x2f4fdb){_0x58d17e=_0x58d17e-0x0;var _0x30a6da=_0x48a1[_0x58d17e];return _0x30a6da;};'use strict';var _=require(_0x148a('0x0'));var util=require(_0x148a('0x1'));var logger=require(_0x148a('0x2'))(_0x148a('0x3'));var moment=require(_0x148a('0x4'));var BPromise=require(_0x148a('0x5'));var rp=require(_0x148a('0x6'));var fs=require('fs');var path=require(_0x148a('0x7'));var rimraf=require(_0x148a('0x8'));var config=require(_0x148a('0x9'));var attributes=require(_0x148a('0xa'));module[_0x148a('0xb')]=function(_0x4f3872,_0x3503cc){return _0x4f3872[_0x148a('0xc')]('CannedAnswer',attributes,{'tableName':_0x148a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 a3df853..a6a6c05 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(_0x59ac1d,_0x2b5602){var _0x1f854d=function(_0x46944d){while(--_0x46944d){_0x59ac1d['push'](_0x59ac1d['shift']());}};_0x1f854d(++_0x2b5602);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x19d0c4,_0x22d026){var _0x49d038=function(_0x9dcd35){while(--_0x9dcd35){_0x19d0c4['push'](_0x19d0c4['shift']());}};_0x49d038(++_0x22d026);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 a0de84c..ad949e8 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 _0x4d8d=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','create','put','update','delete','destroy'];(function(_0x5ce313,_0x503c5d){var _0x5c8ea4=function(_0x3c19d3){while(--_0x3c19d3){_0x5ce313['push'](_0x5ce313['shift']());}};_0x5c8ea4(++_0x503c5d);}(_0x4d8d,0x1dc));var _0xd4d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4d8d[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xd4d8('0x0'));var path=require(_0xd4d8('0x1'));var timeout=require(_0xd4d8('0x2'));var express=require(_0xd4d8('0x3'));var router=express[_0xd4d8('0x4')]();var fs_extra=require(_0xd4d8('0x5'));var auth=require(_0xd4d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd4d8('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4d8('0x8')]);router[_0xd4d8('0x9')](_0xd4d8('0xa'),auth[_0xd4d8('0xb')](),controller[_0xd4d8('0xc')]);router['post']('/',auth[_0xd4d8('0xb')](),controller[_0xd4d8('0xd')]);router[_0xd4d8('0xe')](_0xd4d8('0xa'),auth['isAuthenticated'](),controller[_0xd4d8('0xf')]);router[_0xd4d8('0x10')](_0xd4d8('0xa'),auth[_0xd4d8('0xb')](),controller[_0xd4d8('0x11')]);module[_0xd4d8('0x12')]=router;
\ No newline at end of file
+var _0x259c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id','show','create','put','update','delete','isAuthenticated','destroy','exports','util','connect-timeout'];(function(_0x21ac49,_0x1e6c08){var _0x256831=function(_0x4ea219){while(--_0x4ea219){_0x21ac49['push'](_0x21ac49['shift']());}};_0x256831(++_0x1e6c08);}(_0x259c,0x17a));var _0xc259=function(_0x5aa1fc,_0x2f6b2e){_0x5aa1fc=_0x5aa1fc-0x0;var _0x4a2248=_0x259c[_0x5aa1fc];return _0x4a2248;};'use strict';var multer=require('multer');var util=require(_0xc259('0x0'));var path=require('path');var timeout=require(_0xc259('0x1'));var express=require(_0xc259('0x2'));var router=express[_0xc259('0x3')]();var fs_extra=require(_0xc259('0x4'));var auth=require(_0xc259('0x5'));var interaction=require(_0xc259('0x6'));var config=require('../../config/environment');var controller=require(_0xc259('0x7'));router[_0xc259('0x8')]('/',auth['isAuthenticated'](),controller[_0xc259('0x9')]);router[_0xc259('0x8')](_0xc259('0xa'),auth['isAuthenticated'](),controller[_0xc259('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc259('0xc')]);router[_0xc259('0xd')](_0xc259('0xa'),auth['isAuthenticated'](),controller[_0xc259('0xe')]);router[_0xc259('0xf')](_0xc259('0xa'),auth[_0xc259('0x10')](),controller[_0xc259('0x11')]);module[_0xc259('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4148018..a71bb75 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 _0xa101=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x4c9237,_0x5b8622){var _0x374b49=function(_0x18a22c){while(--_0x18a22c){_0x4c9237['push'](_0x4c9237['shift']());}};_0x374b49(++_0x5b8622);}(_0xa101,0x15f));var _0x1a10=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xa101[_0x51cc1d];return _0x2eb9f2;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x1a10('0x2')},'clid':{'type':Sequelize[_0x1a10('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x1a10('0x3')]},'dcontext':{'type':Sequelize[_0x1a10('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x1a10('0x3')]},'lastapp':{'type':Sequelize[_0x1a10('0x3')]},'lastdata':{'type':Sequelize[_0x1a10('0x3')]},'duration':{'type':Sequelize[_0x1a10('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1a10('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1a10('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1a10('0x3')]},'uniqueid':{'type':Sequelize[_0x1a10('0x3')]},'linkedid':{'type':Sequelize[_0x1a10('0x3')]},'sequence':{'type':Sequelize[_0x1a10('0x3')]},'peeraccount':{'type':Sequelize[_0x1a10('0x3')]},'type':{'type':Sequelize[_0x1a10('0x3')]},'tag':{'type':Sequelize[_0x1a10('0x3')]}};
\ No newline at end of file
+var _0x0712=['1970-01-01\x2000:00:01','STRING','INTEGER','DATE'];(function(_0x4dd7c2,_0x5e86af){var _0x48ae97=function(_0x477727){while(--_0x477727){_0x4dd7c2['push'](_0x4dd7c2['shift']());}};_0x48ae97(++_0x5e86af);}(_0x0712,0x147));var _0x2071=function(_0x543b35,_0x4310bf){_0x543b35=_0x543b35-0x0;var _0x32a9df=_0x0712[_0x543b35];return _0x32a9df;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x2071('0x0')],'allowNull':![],'defaultValue':_0x2071('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x2071('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x2071('0x2')]},'channel':{'type':Sequelize[_0x2071('0x2')]},'dstchannel':{'type':Sequelize[_0x2071('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2071('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2071('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2071('0x2')]},'userfield':{'type':Sequelize[_0x2071('0x2')]},'uniqueid':{'type':Sequelize[_0x2071('0x2')]},'linkedid':{'type':Sequelize[_0x2071('0x2')]},'sequence':{'type':Sequelize[_0x2071('0x2')]},'peeraccount':{'type':Sequelize[_0x2071('0x2')]},'type':{'type':Sequelize[_0x2071('0x2')]},'tag':{'type':Sequelize[_0x2071('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 2cfe283..df2cc26 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 _0x31c2=['then','destroy','error','name','send','index','map','Cdr','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0x31c2,0x1e1));var _0x231c=function(_0x3a4105,_0x4386a2){_0x3a4105=_0x3a4105-0x0;var _0x578907=_0x31c2[_0x3a4105];return _0x578907;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require(_0x231c('0x1'));var zipdir=require(_0x231c('0x2'));var jsonpatch=require(_0x231c('0x3'));var rp=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var BPromise=require(_0x231c('0x6'));var Mustache=require(_0x231c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x231c('0x8'));var csv=require(_0x231c('0x9'));var ejs=require(_0x231c('0xa'));var fs=require('fs');var fs_extra=require(_0x231c('0xb'));var _=require('lodash');var squel=require(_0x231c('0xc'));var crypto=require('crypto');var jsforce=require(_0x231c('0xd'));var deskjs=require(_0x231c('0xe'));var toCsv=require(_0x231c('0x9'));var querystring=require('querystring');var Papa=require(_0x231c('0xf'));var Redis=require(_0x231c('0x10'));var authService=require(_0x231c('0x11'));var qs=require(_0x231c('0x12'));var as=require(_0x231c('0x13'));var hardwareService=require(_0x231c('0x14'));var logger=require(_0x231c('0x15'))('api');var utils=require(_0x231c('0x16'));var config=require(_0x231c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x231c('0x18'))['db'];function respondWithStatusCode(_0x43c270,_0x871ed1){_0x871ed1=_0x871ed1||0xcc;return function(_0x1aa3fe){if(_0x1aa3fe){return _0x43c270[_0x231c('0x19')](_0x871ed1);}return _0x43c270[_0x231c('0x1a')](_0x871ed1)[_0x231c('0x1b')]();};}function respondWithResult(_0x3355f6,_0xc09de5){_0xc09de5=_0xc09de5||0xc8;return function(_0x311218){if(_0x311218){return _0x3355f6[_0x231c('0x1a')](_0xc09de5)[_0x231c('0x1c')](_0x311218);}};}function respondWithFilteredResult(_0xe37de8,_0x1f7764){return function(_0x12a6ad){if(_0x12a6ad){var _0x210f2e=typeof _0x1f7764[_0x231c('0x1d')]===_0x231c('0x1e')&&typeof _0x1f7764[_0x231c('0x1f')]===_0x231c('0x1e');var _0x51b8ca=_0x12a6ad[_0x231c('0x20')];var _0x341645=_0x210f2e?0x0:_0x1f7764[_0x231c('0x1d')];var _0xadea80=_0x210f2e?_0x12a6ad[_0x231c('0x20')]:_0x1f7764[_0x231c('0x1d')]+_0x1f7764[_0x231c('0x1f')];var _0x172d50;if(_0xadea80>=_0x51b8ca){_0xadea80=_0x51b8ca;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0xe37de8[_0x231c('0x1a')](_0x172d50);return _0xe37de8[_0x231c('0x21')]('Content-Range',_0x341645+'-'+_0xadea80+'/'+_0x51b8ca)[_0x231c('0x1c')](_0x12a6ad);}return null;};}function patchUpdates(_0x5e8a53){return function(_0x872034){try{jsonpatch['apply'](_0x872034,_0x5e8a53,!![]);}catch(_0x42cca3){return BPromise[_0x231c('0x22')](_0x42cca3);}return _0x872034[_0x231c('0x23')]();};}function saveUpdates(_0x3267f9,_0x255671){return function(_0x309393){if(_0x309393){return _0x309393[_0x231c('0x24')](_0x3267f9)[_0x231c('0x25')](function(_0x54566f){return _0x54566f;});}return null;};}function removeEntity(_0x128112,_0x3336d8){return function(_0x4af49b){if(_0x4af49b){return _0x4af49b[_0x231c('0x26')]()[_0x231c('0x25')](function(){_0x128112['status'](0xcc)[_0x231c('0x1b')]();});}};}function handleEntityNotFound(_0x564939,_0x3ea0cd){return function(_0x454f70){if(!_0x454f70){_0x564939[_0x231c('0x19')](0x194);}return _0x454f70;};}function handleError(_0x2a673c,_0x449d74){_0x449d74=_0x449d74||0x1f4;return function(_0x131cfd){logger[_0x231c('0x27')](_0x131cfd['stack']);if(_0x131cfd[_0x231c('0x28')]){delete _0x131cfd[_0x231c('0x28')];}_0x2a673c['status'](_0x449d74)[_0x231c('0x29')](_0x131cfd);};}exports[_0x231c('0x2a')]=function(_0x45ced8,_0xeeddfc){var _0x271635={},_0x15a9bb={},_0x40f76e={'count':0x0,'rows':[]};var _0x4dfaa3=_[_0x231c('0x2b')](db[_0x231c('0x2c')]['rawAttributes'],function(_0x4be2e2){return{'name':_0x4be2e2['fieldName'],'type':_0x4be2e2[_0x231c('0x2d')]['key']};});_0x15a9bb[_0x231c('0x2e')]=_['map'](_0x4dfaa3,_0x231c('0x28'));_0x15a9bb[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x45ced8[_0x231c('0x2f')]);_0x15a9bb['filters']=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],_0x15a9bb[_0x231c('0x2f')]);_0x271635[_0x231c('0x32')]=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x45ced8[_0x231c('0x2f')]['fields']));_0x271635['attributes']=_0x271635[_0x231c('0x32')][_0x231c('0x34')]?_0x271635[_0x231c('0x32')]:_0x15a9bb[_0x231c('0x2e')];if(!_0x45ced8[_0x231c('0x2f')][_0x231c('0x35')]('nolimit')){_0x271635[_0x231c('0x1f')]=qs[_0x231c('0x1f')](_0x45ced8['query']['limit']);_0x271635[_0x231c('0x1d')]=qs['offset'](_0x45ced8[_0x231c('0x2f')]['offset']);}_0x271635[_0x231c('0x36')]=qs[_0x231c('0x37')](_0x45ced8['query'][_0x231c('0x37')]);_0x271635[_0x231c('0x38')]=qs[_0x231c('0x39')](_['pick'](_0x45ced8[_0x231c('0x2f')],_0x15a9bb[_0x231c('0x39')]),_0x4dfaa3);if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3a')]){_0x271635[_0x231c('0x38')]=_[_0x231c('0x3b')](_0x271635[_0x231c('0x38')],{'$or':_[_0x231c('0x2b')](_0x4dfaa3,function(_0x409b01){if(_0x409b01[_0x231c('0x2d')]!==_0x231c('0x3c')){var _0x2c8033={};_0x2c8033[_0x409b01[_0x231c('0x28')]]={'$like':'%'+_0x45ced8['query'][_0x231c('0x3a')]+'%'};return _0x2c8033;}})});}_0x271635=_[_0x231c('0x3b')]({},_0x271635,_0x45ced8[_0x231c('0x3d')]);var _0x2f763d={'where':_0x271635[_0x231c('0x38')]};return db['Cdr'][_0x231c('0x20')](_0x2f763d)[_0x231c('0x25')](function(_0x229953){_0x40f76e['count']=_0x229953;if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3e')]){_0x271635[_0x231c('0x3f')]=[{'all':!![]}];}return db[_0x231c('0x2c')][_0x231c('0x40')](_0x271635);})[_0x231c('0x25')](function(_0x5d46eb){_0x40f76e[_0x231c('0x41')]=_0x5d46eb;return _0x40f76e;})[_0x231c('0x25')](respondWithFilteredResult(_0xeeddfc,_0x271635))[_0x231c('0x42')](handleError(_0xeeddfc,null));};exports[_0x231c('0x43')]=function(_0x518011,_0x33396b){var _0x523339={'raw':!![],'where':{'id':_0x518011['params']['id']}},_0x26bfd2={};_0x26bfd2[_0x231c('0x2e')]=_[_0x231c('0x30')](db[_0x231c('0x2c')][_0x231c('0x44')]);_0x26bfd2[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x518011['query']);_0x26bfd2[_0x231c('0x39')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],_0x26bfd2['query']);_0x523339[_0x231c('0x32')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x518011['query'][_0x231c('0x33')]));_0x523339['attributes']=_0x523339[_0x231c('0x32')][_0x231c('0x34')]?_0x523339[_0x231c('0x32')]:_0x26bfd2[_0x231c('0x2e')];if(_0x518011[_0x231c('0x2f')][_0x231c('0x3e')]){_0x523339[_0x231c('0x3f')]=[{'all':!![]}];}_0x523339=_[_0x231c('0x3b')]({},_0x523339,_0x518011[_0x231c('0x3d')]);return db[_0x231c('0x2c')][_0x231c('0x45')](_0x523339)[_0x231c('0x25')](handleEntityNotFound(_0x33396b,null))[_0x231c('0x25')](respondWithResult(_0x33396b,null))[_0x231c('0x42')](handleError(_0x33396b,null));};exports['create']=function(_0x18aaca,_0x293de2){return db[_0x231c('0x2c')][_0x231c('0x46')](_0x18aaca[_0x231c('0x47')],{})['then'](respondWithResult(_0x293de2,0xc9))['catch'](handleError(_0x293de2,null));};exports[_0x231c('0x24')]=function(_0x56a885,_0x419f63){if(_0x56a885[_0x231c('0x47')]['id']){delete _0x56a885[_0x231c('0x47')]['id'];}return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x56a885['params']['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x419f63,null))[_0x231c('0x25')](saveUpdates(_0x56a885['body'],null))[_0x231c('0x25')](respondWithResult(_0x419f63,null))[_0x231c('0x42')](handleError(_0x419f63,null));};exports[_0x231c('0x26')]=function(_0x5d2d20,_0x49baac){return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x5d2d20[_0x231c('0x48')]['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x49baac,null))['then'](removeEntity(_0x49baac,null))[_0x231c('0x42')](handleError(_0x49baac,null));};exports[_0x231c('0x49')]=function(_0x4fd60b,_0xf225d0){return db[_0x231c('0x2c')][_0x231c('0x49')]()[_0x231c('0x25')](respondWithResult(_0xf225d0,null))[_0x231c('0x42')](handleError(_0xf225d0,null));};
\ No newline at end of file
+var _0x33c5=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','create','body','catch','find','describe','rimraf','zip-dir','request-promise','moment'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x33c5,0xe6));var _0x533c=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x33c5[_0x1deee5];return _0x1d6c3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c'));_0x38d886[_0x533c('0x34')]=_[_0x533c('0x35')](_0x425f60[_0x533c('0x34')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x34')]);_0x212d1b[_0x533c('0x38')]=_[_0x533c('0x37')](_0x38d886[_0x533c('0x33')],qs['fields'](_0x425f60[_0x533c('0x34')][_0x533c('0x39')]));_0x212d1b[_0x533c('0x38')]=_0x212d1b[_0x533c('0x38')]['length']?_0x212d1b[_0x533c('0x38')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x34')][_0x533c('0x3a')](_0x533c('0x3b'))){_0x212d1b['limit']=qs['limit'](_0x425f60['query']['limit']);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b['order']=qs[_0x533c('0x3c')](_0x425f60[_0x533c('0x34')][_0x533c('0x3c')]);_0x212d1b['where']=qs[_0x533c('0x36')](_[_0x533c('0x3d')](_0x425f60[_0x533c('0x34')],_0x38d886['filters']),_0x2fc7fa);if(_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]){_0x212d1b[_0x533c('0x3f')]=_['merge'](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x2cd02f){if(_0x2cd02f[_0x533c('0x31')]!==_0x533c('0x40')){var _0x4154f9={};_0x4154f9[_0x2cd02f[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x34')][_0x533c('0x3e')]+'%'};return _0x4154f9;}})});}_0x212d1b=_[_0x533c('0x41')]({},_0x212d1b,_0x425f60[_0x533c('0x42')]);var _0x55af6e={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x55af6e)[_0x533c('0x29')](function(_0x29b4c6){_0x3c559b[_0x533c('0x23')]=_0x29b4c6;if(_0x425f60['query'][_0x533c('0x43')]){_0x212d1b[_0x533c('0x44')]=[{'all':!![]}];}return db[_0x533c('0x30')]['findAll'](_0x212d1b);})[_0x533c('0x29')](function(_0x4170e4){_0x3c559b[_0x533c('0x45')]=_0x4170e4;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x4f5e26,_0x22447d){var _0x39034e={'raw':!![],'where':{'id':_0x4f5e26[_0x533c('0x47')]['id']}},_0x55a372={};_0x55a372[_0x533c('0x33')]=_[_0x533c('0x35')](db['Cdr']['rawAttributes']);_0x55a372['query']=_['keys'](_0x4f5e26[_0x533c('0x34')]);_0x55a372['filters']=_[_0x533c('0x37')](_0x55a372['model'],_0x55a372[_0x533c('0x34')]);_0x39034e['attributes']=_[_0x533c('0x37')](_0x55a372[_0x533c('0x33')],qs['fields'](_0x4f5e26[_0x533c('0x34')][_0x533c('0x39')]));_0x39034e[_0x533c('0x38')]=_0x39034e[_0x533c('0x38')][_0x533c('0x48')]?_0x39034e['attributes']:_0x55a372[_0x533c('0x33')];if(_0x4f5e26[_0x533c('0x34')][_0x533c('0x43')]){_0x39034e[_0x533c('0x44')]=[{'all':!![]}];}_0x39034e=_['merge']({},_0x39034e,_0x4f5e26[_0x533c('0x42')]);return db[_0x533c('0x30')]['find'](_0x39034e)['then'](handleEntityNotFound(_0x22447d,null))[_0x533c('0x29')](respondWithResult(_0x22447d,null))['catch'](handleError(_0x22447d,null));};exports[_0x533c('0x49')]=function(_0x2a9186,_0x19878d){return db[_0x533c('0x30')][_0x533c('0x49')](_0x2a9186[_0x533c('0x4a')],{})[_0x533c('0x29')](respondWithResult(_0x19878d,0xc9))[_0x533c('0x4b')](handleError(_0x19878d,null));};exports['update']=function(_0x19ccc0,_0x6b16e1){if(_0x19ccc0[_0x533c('0x4a')]['id']){delete _0x19ccc0['body']['id'];}return db[_0x533c('0x30')][_0x533c('0x4c')]({'where':{'id':_0x19ccc0['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x6b16e1,null))['then'](saveUpdates(_0x19ccc0[_0x533c('0x4a')],null))[_0x533c('0x29')](respondWithResult(_0x6b16e1,null))[_0x533c('0x4b')](handleError(_0x6b16e1,null));};exports[_0x533c('0x2a')]=function(_0x32d110,_0x3c46f3){return db[_0x533c('0x30')]['find']({'where':{'id':_0x32d110[_0x533c('0x47')]['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x3c46f3,null))[_0x533c('0x29')](removeEntity(_0x3c46f3,null))[_0x533c('0x4b')](handleError(_0x3c46f3,null));};exports[_0x533c('0x4d')]=function(_0x1558ef,_0x3eb174){return db['Cdr']['describe']()['then'](respondWithResult(_0x3eb174,null))['catch'](handleError(_0x3eb174,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a6f3266..1b443e5 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x908ae1,_0x41fb27){var _0x4e54af=function(_0x3a1fe8){while(--_0x3a1fe8){_0x908ae1['push'](_0x908ae1['shift']());}};_0x4e54af(++_0x41fb27);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x779d4d,_0x5c0aa0){var _0x1194ec=function(_0x5281a9){while(--_0x5281a9){_0x779d4d['push'](_0x779d4d['shift']());}};_0x1194ec(++_0x5c0aa0);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 3dfd540..afad438 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 _0xcfce=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4d0f11,_0xa2db49){var _0x326505=function(_0x37b941){while(--_0x37b941){_0x4d0f11['push'](_0x4d0f11['shift']());}};_0x326505(++_0xa2db49);}(_0xcfce,0x125));var _0xecfc=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0xcfce[_0x2e14f2];return _0x12cc03;};'use strict';var _=require('lodash');var util=require(_0xecfc('0x0'));var moment=require(_0xecfc('0x1'));var BPromise=require(_0xecfc('0x2'));var rs=require(_0xecfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecfc('0x4'))['db'];var utils=require(_0xecfc('0x5'));var logger=require(_0xecfc('0x6'))('rpc');var config=require(_0xecfc('0x7'));var jayson=require(_0xecfc('0x8'));var client=jayson[_0xecfc('0x9')][_0xecfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x300d59,_0x422f35,_0xd760cd){return new BPromise(function(_0x3ac7eb,_0x2ab697){return client['request'](_0x300d59,_0xd760cd)[_0xecfc('0xb')](function(_0x4d1157){logger[_0xecfc('0xc')](_0xecfc('0xd'),_0x422f35,'request\x20sent');logger[_0xecfc('0xe')](_0xecfc('0xf'),_0x422f35,_0xecfc('0x10'),JSON[_0xecfc('0x11')](_0x4d1157));if(_0x4d1157[_0xecfc('0x12')]){if(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x13')]===0x1f4){logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x4d1157[_0xecfc('0x12')]['message']);return _0x2ab697(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x14')]);}logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x4d1157['error'][_0xecfc('0x14')]);return _0x3ac7eb(_0x4d1157[_0xecfc('0x12')][_0xecfc('0x14')]);}else{logger[_0xecfc('0xc')](_0xecfc('0xd'),_0x422f35,_0xecfc('0x10'));_0x3ac7eb(_0x4d1157[_0xecfc('0x15')][_0xecfc('0x14')]);}})[_0xecfc('0x16')](function(_0x5ab90d){logger[_0xecfc('0x12')](_0xecfc('0xd'),_0x422f35,_0x5ab90d);_0x2ab697(_0x5ab90d);});});}
\ No newline at end of file
+var _0xe6b2=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0xe6b2,0x15a));var _0x2e6b=function(_0x274a03,_0xa661ae){_0x274a03=_0x274a03-0x0;var _0x53b6dc=_0xe6b2[_0x274a03];return _0x53b6dc;};'use strict';var _=require('lodash');var util=require(_0x2e6b('0x0'));var moment=require(_0x2e6b('0x1'));var BPromise=require(_0x2e6b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e6b('0x3'));var db=require(_0x2e6b('0x4'))['db'];var utils=require(_0x2e6b('0x5'));var logger=require(_0x2e6b('0x6'))('rpc');var config=require(_0x2e6b('0x7'));var jayson=require(_0x2e6b('0x8'));var client=jayson[_0x2e6b('0x9')][_0x2e6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d11b,_0x47c6b9,_0x19e15d){return new BPromise(function(_0x2bc51e,_0x58480e){return client[_0x2e6b('0xb')](_0x16d11b,_0x19e15d)[_0x2e6b('0xc')](function(_0x5f26e2){logger[_0x2e6b('0xd')](_0x2e6b('0xe'),_0x47c6b9,_0x2e6b('0xf'));logger[_0x2e6b('0x10')](_0x2e6b('0x11'),_0x47c6b9,'request\x20sent',JSON[_0x2e6b('0x12')](_0x5f26e2));if(_0x5f26e2[_0x2e6b('0x13')]){if(_0x5f26e2[_0x2e6b('0x13')]['code']===0x1f4){logger[_0x2e6b('0x13')](_0x2e6b('0xe'),_0x47c6b9,_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);return _0x58480e(_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);}logger['error'](_0x2e6b('0xe'),_0x47c6b9,_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);return _0x2bc51e(_0x5f26e2[_0x2e6b('0x13')][_0x2e6b('0x14')]);}else{logger[_0x2e6b('0xd')](_0x2e6b('0xe'),_0x47c6b9,'request\x20sent');_0x2bc51e(_0x5f26e2[_0x2e6b('0x15')][_0x2e6b('0x14')]);}})[_0x2e6b('0x16')](function(_0x181571){logger[_0x2e6b('0x13')](_0x2e6b('0xe'),_0x47c6b9,_0x181571);_0x58480e(_0x181571);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e9978a2..21c9259 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x33bf01,_0x1898f9){var _0x1d1cd2=function(_0x21dbc1){while(--_0x21dbc1){_0x33bf01['push'](_0x33bf01['shift']());}};_0x1d1cd2(++_0x1898f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xeb723,_0x404c45){var _0x541575=function(_0x41a16f){while(--_0x41a16f){_0xeb723['push'](_0xeb723['shift']());}};_0x541575(++_0x404c45);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f6037,_0x8e0a90){_0x4f6037=_0x4f6037-0x0;var _0x2542e2=_0xb10b[_0x4f6037];return _0x2542e2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index fe472a2..571c9d2 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 _0x71e1=['sequelize','exports','STRING','noop'];(function(_0x5addef,_0x161e9f){var _0x4078e3=function(_0xc62542){while(--_0xc62542){_0x5addef['push'](_0x5addef['shift']());}};_0x4078e3(++_0x161e9f);}(_0x71e1,0x104));var _0x171e=function(_0x3d6c3e,_0x1e6893){_0x3d6c3e=_0x3d6c3e-0x0;var _0x32eb9b=_0x71e1[_0x3d6c3e];return _0x32eb9b;};'use strict';var Sequelize=require(_0x171e('0x0'));module[_0x171e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x171e('0x2')],'allowNull':![],'defaultValue':_0x171e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x171e('0x2')]},'interval':{'type':Sequelize[_0x171e('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x31a7=['sequelize','exports','STRING','noop','*,*,*,*'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x31a7,0xeb));var _0x731a=function(_0x2ba7e8,_0x3ab3df){_0x2ba7e8=_0x2ba7e8-0x0;var _0x9a646b=_0x31a7[_0x2ba7e8];return _0x9a646b;};'use strict';var Sequelize=require(_0x731a('0x0'));module[_0x731a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x731a('0x2')],'allowNull':![],'defaultValue':_0x731a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x731a('0x2')]},'interval':{'type':Sequelize[_0x731a('0x2')],'defaultValue':_0x731a('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 655e56d..2c079b9 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 _0xd0b5=['send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','update','destroy','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x4acc70,_0x384893){_0x4acc70=_0x4acc70-0x0;var _0x391f31=_0xd0b5[_0x4acc70];return _0x391f31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d0b('0x0'));var jsonpatch=require(_0x5d0b('0x1'));var rp=require('request-promise');var moment=require(_0x5d0b('0x2'));var BPromise=require(_0x5d0b('0x3'));var Mustache=require(_0x5d0b('0x4'));var util=require(_0x5d0b('0x5'));var path=require(_0x5d0b('0x6'));var sox=require(_0x5d0b('0x7'));var csv=require(_0x5d0b('0x8'));var ejs=require(_0x5d0b('0x9'));var fs=require('fs');var fs_extra=require(_0x5d0b('0xa'));var _=require(_0x5d0b('0xb'));var squel=require(_0x5d0b('0xc'));var crypto=require(_0x5d0b('0xd'));var jsforce=require(_0x5d0b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d0b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d0b('0xf'));var authService=require(_0x5d0b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5d0b('0x11'));var hardwareService=require(_0x5d0b('0x12'));var logger=require('../../config/logger')(_0x5d0b('0x13'));var utils=require(_0x5d0b('0x14'));var config=require(_0x5d0b('0x15'));var licenseUtil=require(_0x5d0b('0x16'));var db=require(_0x5d0b('0x17'))['db'];function respondWithStatusCode(_0x1361c9,_0x490886){_0x490886=_0x490886||0xcc;return function(_0x1894d4){if(_0x1894d4){return _0x1361c9[_0x5d0b('0x18')](_0x490886);}return _0x1361c9[_0x5d0b('0x19')](_0x490886)[_0x5d0b('0x1a')]();};}function respondWithResult(_0x5eacb2,_0x13ed44){_0x13ed44=_0x13ed44||0xc8;return function(_0x2c6996){if(_0x2c6996){return _0x5eacb2['status'](_0x13ed44)[_0x5d0b('0x1b')](_0x2c6996);}};}function respondWithFilteredResult(_0x4d5256,_0x4ef01f){return function(_0x2956ef){if(_0x2956ef){var _0x411ed2=typeof _0x4ef01f[_0x5d0b('0x1c')]===_0x5d0b('0x1d')&&typeof _0x4ef01f['limit']===_0x5d0b('0x1d');var _0x4732d8=_0x2956ef[_0x5d0b('0x1e')];var _0x32f522=_0x411ed2?0x0:_0x4ef01f[_0x5d0b('0x1c')];var _0x2299ad=_0x411ed2?_0x2956ef[_0x5d0b('0x1e')]:_0x4ef01f[_0x5d0b('0x1c')]+_0x4ef01f[_0x5d0b('0x1f')];var _0x32cb2d;if(_0x2299ad>=_0x4732d8){_0x2299ad=_0x4732d8;_0x32cb2d=0xc8;}else{_0x32cb2d=0xce;}_0x4d5256[_0x5d0b('0x19')](_0x32cb2d);return _0x4d5256[_0x5d0b('0x20')](_0x5d0b('0x21'),_0x32f522+'-'+_0x2299ad+'/'+_0x4732d8)['json'](_0x2956ef);}return null;};}function patchUpdates(_0x4c6fb2){return function(_0x7d619b){try{jsonpatch[_0x5d0b('0x22')](_0x7d619b,_0x4c6fb2,!![]);}catch(_0x308e85){return BPromise[_0x5d0b('0x23')](_0x308e85);}return _0x7d619b[_0x5d0b('0x24')]();};}function saveUpdates(_0x5975c1,_0xd710a9){return function(_0x41afe3){if(_0x41afe3){return _0x41afe3['update'](_0x5975c1)[_0x5d0b('0x25')](function(_0x24bb6){return _0x24bb6;});}return null;};}function removeEntity(_0x458ae3,_0x2a304c){return function(_0x49a5bb){if(_0x49a5bb){return _0x49a5bb['destroy']()[_0x5d0b('0x25')](function(){_0x458ae3[_0x5d0b('0x19')](0xcc)[_0x5d0b('0x1a')]();});}};}function handleEntityNotFound(_0x2bdf03,_0x2d9d8b){return function(_0x45c97f){if(!_0x45c97f){_0x2bdf03[_0x5d0b('0x18')](0x194);}return _0x45c97f;};}function handleError(_0x482525,_0x3ca47f){_0x3ca47f=_0x3ca47f||0x1f4;return function(_0x5b2adc){logger['error'](_0x5b2adc[_0x5d0b('0x26')]);if(_0x5b2adc[_0x5d0b('0x27')]){delete _0x5b2adc[_0x5d0b('0x27')];}_0x482525['status'](_0x3ca47f)[_0x5d0b('0x28')](_0x5b2adc);};}exports[_0x5d0b('0x29')]=function(_0x4bfcc2,_0x20e28b){var _0x15e418={'raw':!![],'where':{'id':_0x4bfcc2['params']['id']}},_0x2504b8={};_0x2504b8[_0x5d0b('0x2a')]=_[_0x5d0b('0x2b')](db[_0x5d0b('0x2c')][_0x5d0b('0x2d')]);_0x2504b8[_0x5d0b('0x2e')]=_[_0x5d0b('0x2b')](_0x4bfcc2['query']);_0x2504b8[_0x5d0b('0x2f')]=_[_0x5d0b('0x30')](_0x2504b8['model'],_0x2504b8[_0x5d0b('0x2e')]);_0x15e418[_0x5d0b('0x31')]=_[_0x5d0b('0x30')](_0x2504b8[_0x5d0b('0x2a')],qs[_0x5d0b('0x32')](_0x4bfcc2[_0x5d0b('0x2e')]['fields']));_0x15e418[_0x5d0b('0x31')]=_0x15e418[_0x5d0b('0x31')][_0x5d0b('0x33')]?_0x15e418['attributes']:_0x2504b8['model'];if(_0x4bfcc2[_0x5d0b('0x2e')][_0x5d0b('0x34')]){_0x15e418['include']=[{'all':!![]}];}_0x15e418=_[_0x5d0b('0x35')]({},_0x15e418,_0x4bfcc2[_0x5d0b('0x36')]);return db[_0x5d0b('0x2c')][_0x5d0b('0x37')](_0x15e418)[_0x5d0b('0x25')](handleEntityNotFound(_0x20e28b,null))[_0x5d0b('0x25')](respondWithResult(_0x20e28b,null))[_0x5d0b('0x38')](handleError(_0x20e28b,null));};exports[_0x5d0b('0x39')]=function(_0x4bcae6,_0x2f2e34){if(_0x4bcae6['body']['id']){delete _0x4bcae6['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x4bcae6['params']['id']}})[_0x5d0b('0x25')](handleEntityNotFound(_0x2f2e34,null))[_0x5d0b('0x25')](saveUpdates(_0x4bcae6['body'],null))[_0x5d0b('0x25')](respondWithResult(_0x2f2e34,null))[_0x5d0b('0x38')](handleError(_0x2f2e34,null));};exports[_0x5d0b('0x3a')]=function(_0x4fc272,_0x109c61){return db[_0x5d0b('0x2c')][_0x5d0b('0x37')]({'where':{'id':_0x4fc272[_0x5d0b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x109c61,null))[_0x5d0b('0x25')](removeEntity(_0x109c61,null))[_0x5d0b('0x38')](handleError(_0x109c61,null));};
\ No newline at end of file
+var _0x915a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','include','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','sendStatus','error','stack','name','send'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x915a,0x1d2));var _0xa915=function(_0x503e1f,_0x283b79){_0x503e1f=_0x503e1f-0x0;var _0x3d3a87=_0x915a[_0x503e1f];return _0x3d3a87;};'use strict';var emlformat=require(_0xa915('0x0'));var rimraf=require(_0xa915('0x1'));var zipdir=require(_0xa915('0x2'));var jsonpatch=require(_0xa915('0x3'));var rp=require(_0xa915('0x4'));var moment=require('moment');var BPromise=require(_0xa915('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa915('0x6'));var sox=require(_0xa915('0x7'));var csv=require(_0xa915('0x8'));var ejs=require(_0xa915('0x9'));var fs=require('fs');var fs_extra=require(_0xa915('0xa'));var _=require(_0xa915('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa915('0xc'));var deskjs=require(_0xa915('0xd'));var toCsv=require(_0xa915('0x8'));var querystring=require(_0xa915('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa915('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa915('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa915('0x11'))(_0xa915('0x12'));var utils=require(_0xa915('0x13'));var config=require(_0xa915('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3edd93,_0x5d7c09){_0x5d7c09=_0x5d7c09||0xcc;return function(_0x274f4d){if(_0x274f4d){return _0x3edd93['sendStatus'](_0x5d7c09);}return _0x3edd93[_0xa915('0x15')](_0x5d7c09)[_0xa915('0x16')]();};}function respondWithResult(_0x22b588,_0x21d782){_0x21d782=_0x21d782||0xc8;return function(_0x3ecf23){if(_0x3ecf23){return _0x22b588[_0xa915('0x15')](_0x21d782)['json'](_0x3ecf23);}};}function respondWithFilteredResult(_0x23ecd8,_0x19889d){return function(_0xf9f02c){if(_0xf9f02c){var _0x590be6=typeof _0x19889d[_0xa915('0x17')]===_0xa915('0x18')&&typeof _0x19889d[_0xa915('0x19')]===_0xa915('0x18');var _0x3f5aff=_0xf9f02c[_0xa915('0x1a')];var _0x23d0df=_0x590be6?0x0:_0x19889d[_0xa915('0x17')];var _0x339335=_0x590be6?_0xf9f02c[_0xa915('0x1a')]:_0x19889d[_0xa915('0x17')]+_0x19889d['limit'];var _0x24af34;if(_0x339335>=_0x3f5aff){_0x339335=_0x3f5aff;_0x24af34=0xc8;}else{_0x24af34=0xce;}_0x23ecd8['status'](_0x24af34);return _0x23ecd8[_0xa915('0x1b')](_0xa915('0x1c'),_0x23d0df+'-'+_0x339335+'/'+_0x3f5aff)[_0xa915('0x1d')](_0xf9f02c);}return null;};}function patchUpdates(_0x414d36){return function(_0x15c3e0){try{jsonpatch['apply'](_0x15c3e0,_0x414d36,!![]);}catch(_0xa93602){return BPromise[_0xa915('0x1e')](_0xa93602);}return _0x15c3e0[_0xa915('0x1f')]();};}function saveUpdates(_0x3d94d1,_0x12c054){return function(_0x226c30){if(_0x226c30){return _0x226c30['update'](_0x3d94d1)[_0xa915('0x20')](function(_0x3e4726){return _0x3e4726;});}return null;};}function removeEntity(_0x220d66,_0x23515d){return function(_0x5a3eac){if(_0x5a3eac){return _0x5a3eac['destroy']()[_0xa915('0x20')](function(){_0x220d66['status'](0xcc)[_0xa915('0x16')]();});}};}function handleEntityNotFound(_0x3b8cbb,_0x3898cc){return function(_0x462b94){if(!_0x462b94){_0x3b8cbb[_0xa915('0x21')](0x194);}return _0x462b94;};}function handleError(_0x28b71a,_0x116246){_0x116246=_0x116246||0x1f4;return function(_0x525f55){logger[_0xa915('0x22')](_0x525f55[_0xa915('0x23')]);if(_0x525f55['name']){delete _0x525f55[_0xa915('0x24')];}_0x28b71a[_0xa915('0x15')](_0x116246)[_0xa915('0x25')](_0x525f55);};}exports[_0xa915('0x26')]=function(_0x5a62c0,_0x3cca8e){var _0x427742={'raw':!![],'where':{'id':_0x5a62c0[_0xa915('0x27')]['id']}},_0x486ca1={};_0x486ca1[_0xa915('0x28')]=_[_0xa915('0x29')](db[_0xa915('0x2a')][_0xa915('0x2b')]);_0x486ca1[_0xa915('0x2c')]=_['keys'](_0x5a62c0[_0xa915('0x2c')]);_0x486ca1[_0xa915('0x2d')]=_[_0xa915('0x2e')](_0x486ca1['model'],_0x486ca1[_0xa915('0x2c')]);_0x427742[_0xa915('0x2f')]=_[_0xa915('0x2e')](_0x486ca1['model'],qs[_0xa915('0x30')](_0x5a62c0[_0xa915('0x2c')][_0xa915('0x30')]));_0x427742[_0xa915('0x2f')]=_0x427742['attributes']['length']?_0x427742[_0xa915('0x2f')]:_0x486ca1[_0xa915('0x28')];if(_0x5a62c0[_0xa915('0x2c')]['includeAll']){_0x427742[_0xa915('0x31')]=[{'all':!![]}];}_0x427742=_['merge']({},_0x427742,_0x5a62c0[_0xa915('0x32')]);return db[_0xa915('0x2a')][_0xa915('0x33')](_0x427742)[_0xa915('0x20')](handleEntityNotFound(_0x3cca8e,null))[_0xa915('0x20')](respondWithResult(_0x3cca8e,null))[_0xa915('0x34')](handleError(_0x3cca8e,null));};exports[_0xa915('0x35')]=function(_0x4fe01c,_0x252643){if(_0x4fe01c[_0xa915('0x36')]['id']){delete _0x4fe01c[_0xa915('0x36')]['id'];}return db[_0xa915('0x2a')][_0xa915('0x33')]({'where':{'id':_0x4fe01c[_0xa915('0x27')]['id']}})['then'](handleEntityNotFound(_0x252643,null))[_0xa915('0x20')](saveUpdates(_0x4fe01c[_0xa915('0x36')],null))[_0xa915('0x20')](respondWithResult(_0x252643,null))[_0xa915('0x34')](handleError(_0x252643,null));};exports[_0xa915('0x37')]=function(_0x38e3ea,_0x2dccf7){return db['ChatApplication']['find']({'where':{'id':_0x38e3ea['params']['id']}})[_0xa915('0x20')](handleEntityNotFound(_0x2dccf7,null))[_0xa915('0x20')](removeEntity(_0x2dccf7,null))[_0xa915('0x34')](handleError(_0x2dccf7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 8f19192..c72574c 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 _0x4958=['rimraf','../../config/environment','./chatApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path'];(function(_0x47fbdd,_0x487e75){var _0x39172c=function(_0x32d8e2){while(--_0x32d8e2){_0x47fbdd['push'](_0x47fbdd['shift']());}};_0x39172c(++_0x487e75);}(_0x4958,0x192));var _0x8495=function(_0x4004f0,_0x5242ae){_0x4004f0=_0x4004f0-0x0;var _0x1b7347=_0x4958[_0x4004f0];return _0x1b7347;};'use strict';var _=require('lodash');var util=require(_0x8495('0x0'));var logger=require(_0x8495('0x1'))(_0x8495('0x2'));var moment=require(_0x8495('0x3'));var BPromise=require(_0x8495('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8495('0x5'));var rimraf=require(_0x8495('0x6'));var config=require(_0x8495('0x7'));var attributes=require(_0x8495('0x8'));module['exports']=function(_0x25e49b,_0x443681){return _0x25e49b[_0x8495('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8495('0xa'),'collate':_0x8495('0xb')});};
\ No newline at end of file
+var _0x9901=['api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9901,0x15e));var _0x1990=function(_0x2fe85a,_0x28c346){_0x2fe85a=_0x2fe85a-0x0;var _0x468e0f=_0x9901[_0x2fe85a];return _0x468e0f;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var logger=require('../../config/logger')(_0x1990('0x1'));var moment=require(_0x1990('0x2'));var BPromise=require(_0x1990('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1990('0x4'));var rimraf=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var attributes=require(_0x1990('0x7'));module[_0x1990('0x8')]=function(_0x44db1e,_0x29f5fb){return _0x44db1e[_0x1990('0x9')](_0x1990('0xa'),attributes,{'tableName':_0x1990('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1990('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index c6a24cc..ff854b8 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 _0xf0ac=['info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','request\x20sent','debug','stringify','error','code','ChatApplication,\x20%s,\x20%s','message'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xf0ac,0x75));var _0xcf0a=function(_0x2ea913,_0x39c232){_0x2ea913=_0x2ea913-0x0;var _0x40228a=_0xf0ac[_0x2ea913];return _0x40228a;};'use strict';var _=require('lodash');var util=require(_0xcf0a('0x0'));var moment=require(_0xcf0a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf0a('0x2'));var db=require(_0xcf0a('0x3'))['db'];var utils=require(_0xcf0a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf0a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf0a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2ad3,_0x52fd13,_0x4f9244){return new BPromise(function(_0x515593,_0xaa0e6d){return client[_0xcf0a('0x7')](_0x2d2ad3,_0x4f9244)[_0xcf0a('0x8')](function(_0x5c0d0e){logger['info']('ChatApplication,\x20%s,\x20%s',_0x52fd13,_0xcf0a('0x9'));logger[_0xcf0a('0xa')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x52fd13,_0xcf0a('0x9'),JSON[_0xcf0a('0xb')](_0x5c0d0e));if(_0x5c0d0e[_0xcf0a('0xc')]){if(_0x5c0d0e['error'][_0xcf0a('0xd')]===0x1f4){logger['error'](_0xcf0a('0xe'),_0x52fd13,_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);return _0xaa0e6d(_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);}logger[_0xcf0a('0xc')](_0xcf0a('0xe'),_0x52fd13,_0x5c0d0e[_0xcf0a('0xc')][_0xcf0a('0xf')]);return _0x515593(_0x5c0d0e['error']['message']);}else{logger[_0xcf0a('0x10')](_0xcf0a('0xe'),_0x52fd13,'request\x20sent');_0x515593(_0x5c0d0e[_0xcf0a('0x11')][_0xcf0a('0xf')]);}})[_0xcf0a('0x12')](function(_0x10dcc7){logger[_0xcf0a('0xc')](_0xcf0a('0xe'),_0x52fd13,_0x10dcc7);_0xaa0e6d(_0x10dcc7);});});}
\ No newline at end of file
+var _0x307f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27ac32,_0x42771f){var _0x20c811=function(_0x12d837){while(--_0x12d837){_0x27ac32['push'](_0x27ac32['shift']());}};_0x20c811(++_0x42771f);}(_0x307f,0x9b));var _0xf307=function(_0x1f0cda,_0x3ebda9){_0x1f0cda=_0x1f0cda-0x0;var _0xc941fc=_0x307f[_0x1f0cda];return _0xc941fc;};'use strict';var _=require(_0xf307('0x0'));var util=require(_0xf307('0x1'));var moment=require(_0xf307('0x2'));var BPromise=require('bluebird');var rs=require(_0xf307('0x3'));var fs=require('fs');var Redis=require(_0xf307('0x4'));var db=require(_0xf307('0x5'))['db'];var utils=require(_0xf307('0x6'));var logger=require(_0xf307('0x7'))(_0xf307('0x8'));var config=require(_0xf307('0x9'));var jayson=require(_0xf307('0xa'));var client=jayson[_0xf307('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3543f5,_0x1c0233,_0x54026d){return new BPromise(function(_0x11583a,_0xbd71f4){return client[_0xf307('0xc')](_0x3543f5,_0x54026d)[_0xf307('0xd')](function(_0x2267af){logger[_0xf307('0xe')](_0xf307('0xf'),_0x1c0233,'request\x20sent');logger[_0xf307('0x10')](_0xf307('0x11'),_0x1c0233,_0xf307('0x12'),JSON[_0xf307('0x13')](_0x2267af));if(_0x2267af[_0xf307('0x14')]){if(_0x2267af[_0xf307('0x14')][_0xf307('0x15')]===0x1f4){logger[_0xf307('0x14')](_0xf307('0xf'),_0x1c0233,_0x2267af[_0xf307('0x14')][_0xf307('0x16')]);return _0xbd71f4(_0x2267af[_0xf307('0x14')]['message']);}logger[_0xf307('0x14')](_0xf307('0xf'),_0x1c0233,_0x2267af['error'][_0xf307('0x16')]);return _0x11583a(_0x2267af['error'][_0xf307('0x16')]);}else{logger[_0xf307('0xe')](_0xf307('0xf'),_0x1c0233,_0xf307('0x12'));_0x11583a(_0x2267af[_0xf307('0x17')][_0xf307('0x16')]);}})[_0xf307('0x18')](function(_0x3e9ab3){logger['error'](_0xf307('0xf'),_0x1c0233,_0x3e9ab3);_0xbd71f4(_0x3e9ab3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index e4e4115..10d479c 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 _0x95a7=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4e1bf1,_0x1ac344){var _0x28e750=function(_0x37975a){while(--_0x37975a){_0x4e1bf1['push'](_0x4e1bf1['shift']());}};_0x28e750(++_0x1ac344);}(_0x95a7,0x181));var _0x795a=function(_0x4367a3,_0x1d2146){_0x4367a3=_0x4367a3-0x0;var _0x3d52e2=_0x95a7[_0x4367a3];return _0x3d52e2;};'use strict';var multer=require(_0x795a('0x0'));var util=require('util');var path=require(_0x795a('0x1'));var timeout=require(_0x795a('0x2'));var express=require('express');var router=express[_0x795a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x795a('0x4'));var interaction=require(_0x795a('0x5'));var config=require(_0x795a('0x6'));var controller=require(_0x795a('0x7'));router[_0x795a('0x8')](_0x795a('0x9'),auth[_0x795a('0xa')](),controller['show']);router[_0x795a('0xb')](_0x795a('0x9'),auth[_0x795a('0xa')](),controller['update']);router[_0x795a('0xc')]('/:id',auth[_0x795a('0xa')](),controller[_0x795a('0xd')]);module[_0x795a('0xe')]=router;
\ No newline at end of file
+var _0xe068=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x3aa3a6,_0x21740f){var _0x27b78c=function(_0x58719e){while(--_0x58719e){_0x3aa3a6['push'](_0x3aa3a6['shift']());}};_0x27b78c(++_0x21740f);}(_0xe068,0xed));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8e06('0x0'));var util=require(_0x8e06('0x1'));var path=require(_0x8e06('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e06('0x3'));var router=express[_0x8e06('0x4')]();var fs_extra=require(_0x8e06('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e06('0x6'));var config=require(_0x8e06('0x7'));var controller=require(_0x8e06('0x8'));router['get'](_0x8e06('0x9'),auth['isAuthenticated'](),controller[_0x8e06('0xa')]);router[_0x8e06('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e06('0xc')]('/:id',auth[_0x8e06('0xd')](),controller[_0x8e06('0xe')]);module[_0x8e06('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index bacb798..13baf89 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 _0xa7ee=['exports','STRING','sequelize'];(function(_0x2e8b46,_0x1b50a0){var _0x360c07=function(_0x11cd01){while(--_0x11cd01){_0x2e8b46['push'](_0x2e8b46['shift']());}};_0x360c07(++_0x1b50a0);}(_0xa7ee,0x167));var _0xea7e=function(_0x19cf1f,_0x4105e3){_0x19cf1f=_0x19cf1f-0x0;var _0x234028=_0xa7ee[_0x19cf1f];return _0x234028;};'use strict';var Sequelize=require(_0xea7e('0x0'));module[_0xea7e('0x1')]={'name':{'type':Sequelize[_0xea7e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xea7e('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xea7e=['STRING','BOOLEAN','exports'];(function(_0x3a177b,_0x10d9fe){var _0x205959=function(_0x39f5fe){while(--_0x39f5fe){_0x3a177b['push'](_0x3a177b['shift']());}};_0x205959(++_0x10d9fe);}(_0xea7e,0x143));var _0xeea7=function(_0x53acc7,_0x32b7cc){_0x53acc7=_0x53acc7-0x0;var _0x3d5879=_0xea7e[_0x53acc7];return _0x3d5879;};'use strict';var Sequelize=require('sequelize');module[_0xeea7('0x0')]={'name':{'type':Sequelize[_0xeea7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xeea7('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b3a595e..18f9704 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 _0x5ba3=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','end','stack','name','send','index','map','key','query','keys','intersection','model','attributes','fields','length','order','sort','filters','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format'];(function(_0x3028e6,_0x5e03c5){var _0x40dfb4=function(_0x5a3b1e){while(--_0x5a3b1e){_0x3028e6['push'](_0x3028e6['shift']());}};_0x40dfb4(++_0x5e03c5);}(_0x5ba3,0x120));var _0x35ba=function(_0x1435f1,_0x18f762){_0x1435f1=_0x1435f1-0x0;var _0x5c7770=_0x5ba3[_0x1435f1];return _0x5c7770;};'use strict';var emlformat=require(_0x35ba('0x0'));var rimraf=require(_0x35ba('0x1'));var zipdir=require(_0x35ba('0x2'));var jsonpatch=require(_0x35ba('0x3'));var rp=require(_0x35ba('0x4'));var moment=require(_0x35ba('0x5'));var BPromise=require(_0x35ba('0x6'));var Mustache=require(_0x35ba('0x7'));var util=require(_0x35ba('0x8'));var path=require(_0x35ba('0x9'));var sox=require('sox');var csv=require(_0x35ba('0xa'));var ejs=require(_0x35ba('0xb'));var fs=require('fs');var fs_extra=require(_0x35ba('0xc'));var _=require(_0x35ba('0xd'));var squel=require(_0x35ba('0xe'));var crypto=require('crypto');var jsforce=require(_0x35ba('0xf'));var deskjs=require(_0x35ba('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35ba('0x11'));var Redis=require(_0x35ba('0x12'));var authService=require(_0x35ba('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ba('0x14'));var logger=require(_0x35ba('0x15'))(_0x35ba('0x16'));var utils=require(_0x35ba('0x17'));var config=require(_0x35ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x35ba('0x19'))['db'];config[_0x35ba('0x1a')]=_[_0x35ba('0x1b')](config[_0x35ba('0x1a')],{'host':_0x35ba('0x1c'),'port':0x18eb});var socket=require(_0x35ba('0x1d'))(new Redis(config[_0x35ba('0x1a')]));require(_0x35ba('0x1e'))[_0x35ba('0x1f')](socket);function respondWithStatusCode(_0x1545ce,_0x54d2ac){_0x54d2ac=_0x54d2ac||0xcc;return function(_0x4b120c){if(_0x4b120c){return _0x1545ce[_0x35ba('0x20')](_0x54d2ac);}return _0x1545ce['status'](_0x54d2ac)['end']();};}function respondWithResult(_0x5f527a,_0x1fe1da){_0x1fe1da=_0x1fe1da||0xc8;return function(_0x4b4c66){if(_0x4b4c66){return _0x5f527a[_0x35ba('0x21')](_0x1fe1da)[_0x35ba('0x22')](_0x4b4c66);}};}function respondWithFilteredResult(_0x202f5f,_0x4eb190){return function(_0x129257){if(_0x129257){var _0x486680=typeof _0x4eb190[_0x35ba('0x23')]===_0x35ba('0x24')&&typeof _0x4eb190[_0x35ba('0x25')]==='undefined';var _0x526a20=_0x129257[_0x35ba('0x26')];var _0x54ba8a=_0x486680?0x0:_0x4eb190[_0x35ba('0x23')];var _0x51b374=_0x486680?_0x129257[_0x35ba('0x26')]:_0x4eb190[_0x35ba('0x23')]+_0x4eb190['limit'];var _0x413ffa;if(_0x51b374>=_0x526a20){_0x51b374=_0x526a20;_0x413ffa=0xc8;}else{_0x413ffa=0xce;}_0x202f5f[_0x35ba('0x21')](_0x413ffa);return _0x202f5f['set']('Content-Range',_0x54ba8a+'-'+_0x51b374+'/'+_0x526a20)[_0x35ba('0x22')](_0x129257);}return null;};}function patchUpdates(_0x3c7df3){return function(_0x325b73){try{jsonpatch['apply'](_0x325b73,_0x3c7df3,!![]);}catch(_0x4ccad8){return BPromise[_0x35ba('0x27')](_0x4ccad8);}return _0x325b73[_0x35ba('0x28')]();};}function saveUpdates(_0x41c9ad,_0x3505a4){return function(_0x50c40f){if(_0x50c40f){return _0x50c40f[_0x35ba('0x29')](_0x41c9ad)[_0x35ba('0x2a')](function(_0x2d521e){return _0x2d521e;});}return null;};}function removeEntity(_0x39a243,_0x147849){return function(_0x395d38){if(_0x395d38){return _0x395d38[_0x35ba('0x2b')]()[_0x35ba('0x2a')](function(){_0x39a243[_0x35ba('0x21')](0xcc)[_0x35ba('0x2c')]();});}};}function handleEntityNotFound(_0x28aa04,_0x85012d){return function(_0xf18ed0){if(!_0xf18ed0){_0x28aa04[_0x35ba('0x20')](0x194);}return _0xf18ed0;};}function handleError(_0x1d8999,_0x4bc28b){_0x4bc28b=_0x4bc28b||0x1f4;return function(_0x79041f){logger['error'](_0x79041f[_0x35ba('0x2d')]);if(_0x79041f[_0x35ba('0x2e')]){delete _0x79041f[_0x35ba('0x2e')];}_0x1d8999[_0x35ba('0x21')](_0x4bc28b)[_0x35ba('0x2f')](_0x79041f);};}exports[_0x35ba('0x30')]=function(_0x5044ff,_0x39b1b8){var _0x33d2a0={},_0x35feda={},_0x3c5daa={'count':0x0,'rows':[]};var _0x4258b3=_[_0x35ba('0x31')](db['ChatGroup']['rawAttributes'],function(_0x44a050){return{'name':_0x44a050['fieldName'],'type':_0x44a050['type'][_0x35ba('0x32')]};});_0x35feda['model']=_[_0x35ba('0x31')](_0x4258b3,_0x35ba('0x2e'));_0x35feda[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x5044ff[_0x35ba('0x33')]);_0x35feda['filters']=_[_0x35ba('0x35')](_0x35feda[_0x35ba('0x36')],_0x35feda[_0x35ba('0x33')]);_0x33d2a0[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x35feda[_0x35ba('0x36')],qs['fields'](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x38')]));_0x33d2a0[_0x35ba('0x37')]=_0x33d2a0['attributes'][_0x35ba('0x39')]?_0x33d2a0[_0x35ba('0x37')]:_0x35feda[_0x35ba('0x36')];if(!_0x5044ff[_0x35ba('0x33')]['hasOwnProperty']('nolimit')){_0x33d2a0[_0x35ba('0x25')]=qs[_0x35ba('0x25')](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x25')]);_0x33d2a0[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x5044ff[_0x35ba('0x33')]['offset']);}_0x33d2a0[_0x35ba('0x3a')]=qs[_0x35ba('0x3b')](_0x5044ff[_0x35ba('0x33')][_0x35ba('0x3b')]);_0x33d2a0['where']=qs[_0x35ba('0x3c')](_['pick'](_0x5044ff['query'],_0x35feda[_0x35ba('0x3c')]),_0x4258b3);if(_0x5044ff[_0x35ba('0x33')][_0x35ba('0x3d')]){_0x33d2a0[_0x35ba('0x3e')]=_[_0x35ba('0x3f')](_0x33d2a0['where'],{'$or':_[_0x35ba('0x31')](_0x4258b3,function(_0x2497d5){if(_0x2497d5[_0x35ba('0x40')]!==_0x35ba('0x41')){var _0x315e77={};_0x315e77[_0x2497d5[_0x35ba('0x2e')]]={'$like':'%'+_0x5044ff[_0x35ba('0x33')]['filter']+'%'};return _0x315e77;}})});}_0x33d2a0=_[_0x35ba('0x3f')]({},_0x33d2a0,_0x5044ff[_0x35ba('0x42')]);var _0x505a11={'where':_0x33d2a0[_0x35ba('0x3e')]};return db[_0x35ba('0x43')][_0x35ba('0x26')](_0x505a11)[_0x35ba('0x2a')](function(_0x67e16){_0x3c5daa[_0x35ba('0x26')]=_0x67e16;if(_0x5044ff['query'][_0x35ba('0x44')]){_0x33d2a0[_0x35ba('0x45')]=[{'all':!![]}];}return db[_0x35ba('0x43')]['findAll'](_0x33d2a0);})[_0x35ba('0x2a')](function(_0x5aadf0){_0x3c5daa[_0x35ba('0x46')]=_0x5aadf0;return _0x3c5daa;})[_0x35ba('0x2a')](respondWithFilteredResult(_0x39b1b8,_0x33d2a0))[_0x35ba('0x47')](handleError(_0x39b1b8,null));};exports[_0x35ba('0x48')]=function(_0x239993,_0x1b8fbc){var _0x1a6e7e={'raw':!![],'where':{'id':_0x239993[_0x35ba('0x49')]['id']}},_0x2dc72d={};_0x2dc72d[_0x35ba('0x36')]=_[_0x35ba('0x34')](db[_0x35ba('0x43')][_0x35ba('0x4a')]);_0x2dc72d[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x239993[_0x35ba('0x33')]);_0x2dc72d['filters']=_[_0x35ba('0x35')](_0x2dc72d[_0x35ba('0x36')],_0x2dc72d[_0x35ba('0x33')]);_0x1a6e7e[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x2dc72d['model'],qs['fields'](_0x239993[_0x35ba('0x33')]['fields']));_0x1a6e7e[_0x35ba('0x37')]=_0x1a6e7e[_0x35ba('0x37')][_0x35ba('0x39')]?_0x1a6e7e[_0x35ba('0x37')]:_0x2dc72d[_0x35ba('0x36')];if(_0x239993[_0x35ba('0x33')][_0x35ba('0x44')]){_0x1a6e7e[_0x35ba('0x45')]=[{'all':!![]}];}_0x1a6e7e=_[_0x35ba('0x3f')]({},_0x1a6e7e,_0x239993[_0x35ba('0x42')]);return db[_0x35ba('0x43')][_0x35ba('0x4b')](_0x1a6e7e)['then'](handleEntityNotFound(_0x1b8fbc,null))['then'](respondWithResult(_0x1b8fbc,null))[_0x35ba('0x47')](handleError(_0x1b8fbc,null));};exports[_0x35ba('0x4c')]=function(_0x3863e2,_0x58e2bf){return db['ChatGroup'][_0x35ba('0x4c')](_0x3863e2[_0x35ba('0x4d')],{})[_0x35ba('0x2a')](respondWithResult(_0x58e2bf,0xc9))['catch'](handleError(_0x58e2bf,null));};exports[_0x35ba('0x29')]=function(_0x3c86cf,_0x4356f5){if(_0x3c86cf[_0x35ba('0x4d')]['id']){delete _0x3c86cf[_0x35ba('0x4d')]['id'];}return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x3c86cf[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x4356f5,null))[_0x35ba('0x2a')](saveUpdates(_0x3c86cf[_0x35ba('0x4d')],null))['then'](respondWithResult(_0x4356f5,null))[_0x35ba('0x47')](handleError(_0x4356f5,null));};exports[_0x35ba('0x2b')]=function(_0x3facae,_0x46ebd0){return db[_0x35ba('0x43')]['find']({'where':{'id':_0x3facae[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x46ebd0,null))[_0x35ba('0x2a')](removeEntity(_0x46ebd0,null))[_0x35ba('0x47')](handleError(_0x46ebd0,null));};exports[_0x35ba('0x4e')]=function(_0x12ba2b,_0x2d66b7){return db[_0x35ba('0x43')][_0x35ba('0x4e')]()[_0x35ba('0x2a')](respondWithResult(_0x2d66b7,null))[_0x35ba('0x47')](handleError(_0x2d66b7,null));};exports[_0x35ba('0x4f')]=function(_0x304106,_0x219ced,_0x5a4d7f){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x304106[_0x35ba('0x49')]['id'],'ToId':_0x304106[_0x35ba('0x50')]['id'],'read':![]}})[_0x35ba('0x2a')](function(_0x54c67e){return{'id':_[_0x35ba('0x51')](_0x304106['params']['id']),'count':_0x54c67e};})['then'](respondWithResult(_0x219ced,null))[_0x35ba('0x47')](handleError(_0x219ced,null));};exports[_0x35ba('0x52')]=function(_0x2de5d9,_0x48063f,_0x3fd926){return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x2de5d9['params']['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x48063f,null))[_0x35ba('0x2a')](function(_0x5c5774){if(_0x5c5774){return _0x5c5774[_0x35ba('0x52')](_0x2de5d9[_0x35ba('0x4d')][_0x35ba('0x53')],_['omit'](_0x2de5d9['body'],['ids','id'])||{});}})[_0x35ba('0x2a')](respondWithResult(_0x48063f,null))['catch'](handleError(_0x48063f,null));};exports[_0x35ba('0x54')]=function(_0x52b345,_0xf1d833,_0x548866){var _0x1552be={};var _0x5b4bfb={};var _0x4f18b7;var _0x2d83e6;return db[_0x35ba('0x43')][_0x35ba('0x55')]({'where':{'id':_0x52b345[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0xf1d833,null))[_0x35ba('0x2a')](function(_0x10a304){if(_0x10a304){_0x4f18b7=_0x10a304;_0x5b4bfb[_0x35ba('0x36')]=_['keys'](db['User'][_0x35ba('0x4a')]);_0x5b4bfb[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x52b345[_0x35ba('0x33')]);_0x5b4bfb[_0x35ba('0x3c')]=_[_0x35ba('0x35')](_0x5b4bfb['model'],_0x5b4bfb[_0x35ba('0x33')]);_0x1552be['attributes']=_[_0x35ba('0x35')](_0x5b4bfb[_0x35ba('0x36')],qs[_0x35ba('0x38')](_0x52b345['query']['fields']));_0x1552be[_0x35ba('0x37')]=_0x1552be[_0x35ba('0x37')][_0x35ba('0x39')]?_0x1552be[_0x35ba('0x37')]:_0x5b4bfb['model'];_0x1552be[_0x35ba('0x3a')]=qs[_0x35ba('0x3b')](_0x52b345['query'][_0x35ba('0x3b')]);_0x1552be[_0x35ba('0x3e')]=qs[_0x35ba('0x3c')](_[_0x35ba('0x56')](_0x52b345[_0x35ba('0x33')],_0x5b4bfb[_0x35ba('0x3c')]));if(_0x52b345[_0x35ba('0x33')][_0x35ba('0x3d')]){_0x1552be[_0x35ba('0x3e')]=_[_0x35ba('0x3f')](_0x1552be[_0x35ba('0x3e')],{'$or':_[_0x35ba('0x31')](_0x1552be[_0x35ba('0x37')],function(_0x3b996b){var _0x36b875={};_0x36b875[_0x3b996b]={'$like':'%'+_0x52b345[_0x35ba('0x33')][_0x35ba('0x3d')]+'%'};return _0x36b875;})});}_0x1552be=_[_0x35ba('0x3f')]({},_0x1552be,_0x52b345[_0x35ba('0x42')]);return _0x4f18b7[_0x35ba('0x54')](_0x1552be);}})[_0x35ba('0x2a')](function(_0x267df4){if(_0x267df4){_0x2d83e6=_0x267df4[_0x35ba('0x39')];if(!_0x52b345[_0x35ba('0x33')][_0x35ba('0x57')]('nolimit')){_0x1552be[_0x35ba('0x25')]=qs[_0x35ba('0x25')](_0x52b345[_0x35ba('0x33')][_0x35ba('0x25')]);_0x1552be[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x52b345[_0x35ba('0x33')][_0x35ba('0x23')]);}return _0x4f18b7[_0x35ba('0x54')](_0x1552be);}})['then'](function(_0x42bfbc){if(_0x42bfbc){return _0x42bfbc?{'count':_0x2d83e6,'rows':_0x42bfbc}:null;}})[_0x35ba('0x2a')](respondWithResult(_0xf1d833,null))[_0x35ba('0x47')](handleError(_0xf1d833,null));};exports['removeMembers']=function(_0x47077c,_0x484b86,_0x467a14){return db['ChatGroup'][_0x35ba('0x4b')]({'where':{'id':_0x47077c[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x484b86,null))['then'](function(_0x2c3069){if(_0x2c3069){return _0x2c3069[_0x35ba('0x58')](_0x47077c['query']['ids']);}})[_0x35ba('0x2a')](respondWithStatusCode(_0x484b86,null))[_0x35ba('0x47')](handleError(_0x484b86,null));};exports[_0x35ba('0x59')]=function(_0x159e27,_0x503299,_0x548b99){if(_0x159e27[_0x35ba('0x4d')]['id']){delete _0x159e27[_0x35ba('0x4d')]['id'];}return db[_0x35ba('0x43')][_0x35ba('0x4b')]({'where':{'id':_0x159e27[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x503299,null))[_0x35ba('0x2a')](function(_0x4dbbec){if(_0x4dbbec){_0x159e27[_0x35ba('0x4d')][_0x35ba('0x5a')]=_0x4dbbec['id'];return db[_0x35ba('0x5b')]['create'](_0x159e27['body']);}})[_0x35ba('0x2a')](respondWithResult(_0x503299,null))[_0x35ba('0x47')](handleError(_0x503299,null));};exports[_0x35ba('0x5c')]=function(_0x5c37fd,_0x2c7141,_0x169fe2){var _0x3700a8={};var _0x109b01={};var _0x54db90;var _0xbc5fb4;return db[_0x35ba('0x43')][_0x35ba('0x55')]({'where':{'id':_0x5c37fd[_0x35ba('0x49')]['id']}})[_0x35ba('0x2a')](handleEntityNotFound(_0x2c7141,null))[_0x35ba('0x2a')](function(_0x34fbb5){if(_0x34fbb5){_0x54db90=_0x34fbb5;_0x109b01[_0x35ba('0x36')]=_[_0x35ba('0x34')](db[_0x35ba('0x5b')][_0x35ba('0x4a')]);_0x109b01[_0x35ba('0x33')]=_[_0x35ba('0x34')](_0x5c37fd['query']);_0x109b01[_0x35ba('0x3c')]=_['intersection'](_0x109b01['model'],_0x109b01['query']);_0x3700a8[_0x35ba('0x37')]=_[_0x35ba('0x35')](_0x109b01[_0x35ba('0x36')],qs['fields'](_0x5c37fd[_0x35ba('0x33')]['fields']));_0x3700a8['attributes']=_0x3700a8[_0x35ba('0x37')][_0x35ba('0x39')]?_0x3700a8[_0x35ba('0x37')]:_0x109b01[_0x35ba('0x36')];_0x3700a8['order']=qs['sort'](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x3b')]);_0x3700a8['where']=qs['filters'](_[_0x35ba('0x56')](_0x5c37fd[_0x35ba('0x33')],_0x109b01[_0x35ba('0x3c')]));if(_0x5c37fd['query'][_0x35ba('0x3d')]){_0x3700a8[_0x35ba('0x3e')]=_['merge'](_0x3700a8['where'],{'$or':_[_0x35ba('0x31')](_0x3700a8[_0x35ba('0x37')],function(_0x26d3eb){var _0x28695c={};_0x28695c[_0x26d3eb]={'$like':'%'+_0x5c37fd['query'][_0x35ba('0x3d')]+'%'};return _0x28695c;})});}if(_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x5d')]){var _0x5a1c4e=_0x5c37fd[_0x35ba('0x33')]['$gte'][_0x35ba('0x5e')](',');var _0x26d731={};_0x26d731[_0x5a1c4e[0x0]]={'$gte':moment(_0x5a1c4e[0x1])[_0x35ba('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3700a8['where']=_[_0x35ba('0x3f')](_0x3700a8[_0x35ba('0x3e')],_0x26d731);}_0x3700a8=_[_0x35ba('0x3f')]({},_0x3700a8,_0x5c37fd[_0x35ba('0x42')]);return _0x54db90[_0x35ba('0x5c')](_0x3700a8);}})[_0x35ba('0x2a')](function(_0x1cbd30){if(_0x1cbd30){_0xbc5fb4=_0x1cbd30[_0x35ba('0x39')];if(!_0x5c37fd[_0x35ba('0x33')]['hasOwnProperty']('nolimit')){_0x3700a8[_0x35ba('0x25')]=qs['limit'](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x25')]);_0x3700a8[_0x35ba('0x23')]=qs[_0x35ba('0x23')](_0x5c37fd[_0x35ba('0x33')][_0x35ba('0x23')]);}return _0x54db90['getMessages'](_0x3700a8);}})[_0x35ba('0x2a')](function(_0x4d07db){if(_0x4d07db){return _0x4d07db?{'count':_0xbc5fb4,'rows':_0x4d07db}:null;}})[_0x35ba('0x2a')](respondWithResult(_0x2c7141,null))[_0x35ba('0x47')](handleError(_0x2c7141,null));};
\ No newline at end of file
+var _0x0c4b=['undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','ChatGroup','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','nolimit','removeMembers','addMessage','getMessages','findOne','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','limit'];(function(_0x13b746,_0x35da0d){var _0x39e1b4=function(_0x409293){while(--_0x409293){_0x13b746['push'](_0x13b746['shift']());}};_0x39e1b4(++_0x35da0d);}(_0x0c4b,0x14f));var _0xb0c4=function(_0x5a7b40,_0x585230){_0x5a7b40=_0x5a7b40-0x0;var _0x463559=_0x0c4b[_0x5a7b40];return _0x463559;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0c4('0x0'));var zipdir=require(_0xb0c4('0x1'));var jsonpatch=require(_0xb0c4('0x2'));var rp=require(_0xb0c4('0x3'));var moment=require(_0xb0c4('0x4'));var BPromise=require(_0xb0c4('0x5'));var Mustache=require('mustache');var util=require(_0xb0c4('0x6'));var path=require(_0xb0c4('0x7'));var sox=require('sox');var csv=require(_0xb0c4('0x8'));var ejs=require(_0xb0c4('0x9'));var fs=require('fs');var fs_extra=require(_0xb0c4('0xa'));var _=require(_0xb0c4('0xb'));var squel=require(_0xb0c4('0xc'));var crypto=require('crypto');var jsforce=require(_0xb0c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb0c4('0x8'));var querystring=require(_0xb0c4('0xe'));var Papa=require(_0xb0c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb0c4('0x10'));var as=require(_0xb0c4('0x11'));var hardwareService=require(_0xb0c4('0x12'));var logger=require(_0xb0c4('0x13'))(_0xb0c4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0c4('0x15'))['db'];config['redis']=_['defaults'](config[_0xb0c4('0x16')],{'host':_0xb0c4('0x17'),'port':0x18eb});var socket=require(_0xb0c4('0x18'))(new Redis(config[_0xb0c4('0x16')]));require(_0xb0c4('0x19'))[_0xb0c4('0x1a')](socket);function respondWithStatusCode(_0x12f99f,_0x1c81b1){_0x1c81b1=_0x1c81b1||0xcc;return function(_0x5cbf85){if(_0x5cbf85){return _0x12f99f[_0xb0c4('0x1b')](_0x1c81b1);}return _0x12f99f['status'](_0x1c81b1)[_0xb0c4('0x1c')]();};}function respondWithResult(_0x3b4155,_0x2cc6aa){_0x2cc6aa=_0x2cc6aa||0xc8;return function(_0x15a234){if(_0x15a234){return _0x3b4155[_0xb0c4('0x1d')](_0x2cc6aa)[_0xb0c4('0x1e')](_0x15a234);}};}function respondWithFilteredResult(_0x323ad9,_0x2ad0f9){return function(_0x187e15){if(_0x187e15){var _0x343b7c=typeof _0x2ad0f9[_0xb0c4('0x1f')]==='undefined'&&typeof _0x2ad0f9[_0xb0c4('0x20')]===_0xb0c4('0x21');var _0x18b4a1=_0x187e15['count'];var _0x39b1cc=_0x343b7c?0x0:_0x2ad0f9['offset'];var _0x18d497=_0x343b7c?_0x187e15[_0xb0c4('0x22')]:_0x2ad0f9['offset']+_0x2ad0f9[_0xb0c4('0x20')];var _0x187051;if(_0x18d497>=_0x18b4a1){_0x18d497=_0x18b4a1;_0x187051=0xc8;}else{_0x187051=0xce;}_0x323ad9[_0xb0c4('0x1d')](_0x187051);return _0x323ad9[_0xb0c4('0x23')](_0xb0c4('0x24'),_0x39b1cc+'-'+_0x18d497+'/'+_0x18b4a1)[_0xb0c4('0x1e')](_0x187e15);}return null;};}function patchUpdates(_0x1e2734){return function(_0x2e3b56){try{jsonpatch[_0xb0c4('0x25')](_0x2e3b56,_0x1e2734,!![]);}catch(_0x43b6b0){return BPromise['reject'](_0x43b6b0);}return _0x2e3b56[_0xb0c4('0x26')]();};}function saveUpdates(_0x3e80e9,_0x315317){return function(_0x5dcc80){if(_0x5dcc80){return _0x5dcc80[_0xb0c4('0x27')](_0x3e80e9)[_0xb0c4('0x28')](function(_0x348122){return _0x348122;});}return null;};}function removeEntity(_0x1476b3,_0x49101b){return function(_0xf5c4a9){if(_0xf5c4a9){return _0xf5c4a9[_0xb0c4('0x29')]()['then'](function(){_0x1476b3[_0xb0c4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583faa,_0x1e199f){return function(_0x39ab4d){if(!_0x39ab4d){_0x583faa['sendStatus'](0x194);}return _0x39ab4d;};}function handleError(_0x4d6be4,_0x551e8a){_0x551e8a=_0x551e8a||0x1f4;return function(_0x5ec2d8){logger[_0xb0c4('0x2a')](_0x5ec2d8[_0xb0c4('0x2b')]);if(_0x5ec2d8[_0xb0c4('0x2c')]){delete _0x5ec2d8[_0xb0c4('0x2c')];}_0x4d6be4[_0xb0c4('0x1d')](_0x551e8a)[_0xb0c4('0x2d')](_0x5ec2d8);};}exports['index']=function(_0x33077f,_0x440009){var _0x309b59={},_0x29fc13={},_0x4f4f33={'count':0x0,'rows':[]};var _0x18f78e=_[_0xb0c4('0x2e')](db['ChatGroup']['rawAttributes'],function(_0x217e80){return{'name':_0x217e80['fieldName'],'type':_0x217e80[_0xb0c4('0x2f')]['key']};});_0x29fc13[_0xb0c4('0x30')]=_[_0xb0c4('0x2e')](_0x18f78e,_0xb0c4('0x2c'));_0x29fc13[_0xb0c4('0x31')]=_['keys'](_0x33077f['query']);_0x29fc13['filters']=_['intersection'](_0x29fc13[_0xb0c4('0x30')],_0x29fc13[_0xb0c4('0x31')]);_0x309b59['attributes']=_[_0xb0c4('0x32')](_0x29fc13['model'],qs[_0xb0c4('0x33')](_0x33077f[_0xb0c4('0x31')]['fields']));_0x309b59['attributes']=_0x309b59[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x309b59[_0xb0c4('0x34')]:_0x29fc13[_0xb0c4('0x30')];if(!_0x33077f['query'][_0xb0c4('0x36')]('nolimit')){_0x309b59[_0xb0c4('0x20')]=qs[_0xb0c4('0x20')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x309b59[_0xb0c4('0x1f')]=qs[_0xb0c4('0x1f')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x1f')]);}_0x309b59[_0xb0c4('0x37')]=qs[_0xb0c4('0x38')](_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x38')]);_0x309b59[_0xb0c4('0x39')]=qs[_0xb0c4('0x3a')](_[_0xb0c4('0x3b')](_0x33077f['query'],_0x29fc13[_0xb0c4('0x3a')]),_0x18f78e);if(_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x309b59[_0xb0c4('0x39')]=_[_0xb0c4('0x3d')](_0x309b59[_0xb0c4('0x39')],{'$or':_[_0xb0c4('0x2e')](_0x18f78e,function(_0x4549c0){if(_0x4549c0[_0xb0c4('0x2f')]!=='VIRTUAL'){var _0x4194fc={};_0x4194fc[_0x4549c0[_0xb0c4('0x2c')]]={'$like':'%'+_0x33077f[_0xb0c4('0x31')][_0xb0c4('0x3c')]+'%'};return _0x4194fc;}})});}_0x309b59=_['merge']({},_0x309b59,_0x33077f['options']);var _0x1c41ca={'where':_0x309b59[_0xb0c4('0x39')]};return db['ChatGroup']['count'](_0x1c41ca)['then'](function(_0xa2811c){_0x4f4f33[_0xb0c4('0x22')]=_0xa2811c;if(_0x33077f['query'][_0xb0c4('0x3e')]){_0x309b59['include']=[{'all':!![]}];}return db[_0xb0c4('0x3f')][_0xb0c4('0x40')](_0x309b59);})[_0xb0c4('0x28')](function(_0xc7aed6){_0x4f4f33[_0xb0c4('0x41')]=_0xc7aed6;return _0x4f4f33;})[_0xb0c4('0x28')](respondWithFilteredResult(_0x440009,_0x309b59))[_0xb0c4('0x42')](handleError(_0x440009,null));};exports[_0xb0c4('0x43')]=function(_0xc0ccc2,_0x520e95){var _0x8303f0={'raw':!![],'where':{'id':_0xc0ccc2[_0xb0c4('0x44')]['id']}},_0x2c7f29={};_0x2c7f29['model']=_[_0xb0c4('0x45')](db[_0xb0c4('0x3f')][_0xb0c4('0x46')]);_0x2c7f29[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0xc0ccc2['query']);_0x2c7f29[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x2c7f29[_0xb0c4('0x30')],_0x2c7f29['query']);_0x8303f0['attributes']=_[_0xb0c4('0x32')](_0x2c7f29[_0xb0c4('0x30')],qs[_0xb0c4('0x33')](_0xc0ccc2['query'][_0xb0c4('0x33')]));_0x8303f0[_0xb0c4('0x34')]=_0x8303f0[_0xb0c4('0x34')]['length']?_0x8303f0[_0xb0c4('0x34')]:_0x2c7f29[_0xb0c4('0x30')];if(_0xc0ccc2[_0xb0c4('0x31')][_0xb0c4('0x3e')]){_0x8303f0['include']=[{'all':!![]}];}_0x8303f0=_[_0xb0c4('0x3d')]({},_0x8303f0,_0xc0ccc2[_0xb0c4('0x47')]);return db[_0xb0c4('0x3f')][_0xb0c4('0x48')](_0x8303f0)['then'](handleEntityNotFound(_0x520e95,null))['then'](respondWithResult(_0x520e95,null))[_0xb0c4('0x42')](handleError(_0x520e95,null));};exports[_0xb0c4('0x49')]=function(_0x3fb112,_0x264930){return db[_0xb0c4('0x3f')][_0xb0c4('0x49')](_0x3fb112[_0xb0c4('0x4a')],{})[_0xb0c4('0x28')](respondWithResult(_0x264930,0xc9))[_0xb0c4('0x42')](handleError(_0x264930,null));};exports[_0xb0c4('0x27')]=function(_0x551347,_0x1d461c){if(_0x551347[_0xb0c4('0x4a')]['id']){delete _0x551347[_0xb0c4('0x4a')]['id'];}return db[_0xb0c4('0x3f')][_0xb0c4('0x48')]({'where':{'id':_0x551347[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x1d461c,null))[_0xb0c4('0x28')](saveUpdates(_0x551347[_0xb0c4('0x4a')],null))[_0xb0c4('0x28')](respondWithResult(_0x1d461c,null))['catch'](handleError(_0x1d461c,null));};exports['destroy']=function(_0x4cca5c,_0x4de00e){return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x4cca5c['params']['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x4de00e,null))['then'](removeEntity(_0x4de00e,null))[_0xb0c4('0x42')](handleError(_0x4de00e,null));};exports[_0xb0c4('0x4b')]=function(_0x3cd7cf,_0x4b7656){return db[_0xb0c4('0x3f')][_0xb0c4('0x4b')]()[_0xb0c4('0x28')](respondWithResult(_0x4b7656,null))[_0xb0c4('0x42')](handleError(_0x4b7656,null));};exports[_0xb0c4('0x4c')]=function(_0x383f90,_0x5b6d1e,_0x26c520){return db[_0xb0c4('0x4d')][_0xb0c4('0x22')]({'where':{'ChatGroupId':_0x383f90[_0xb0c4('0x44')]['id'],'ToId':_0x383f90[_0xb0c4('0x4e')]['id'],'read':![]}})[_0xb0c4('0x28')](function(_0x1b2c02){return{'id':_[_0xb0c4('0x4f')](_0x383f90['params']['id']),'count':_0x1b2c02};})[_0xb0c4('0x28')](respondWithResult(_0x5b6d1e,null))['catch'](handleError(_0x5b6d1e,null));};exports['addMembers']=function(_0x2725ec,_0x488998,_0x16774a){return db[_0xb0c4('0x3f')]['find']({'where':{'id':_0x2725ec[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x488998,null))[_0xb0c4('0x28')](function(_0x22a254){if(_0x22a254){return _0x22a254[_0xb0c4('0x50')](_0x2725ec[_0xb0c4('0x4a')][_0xb0c4('0x51')],_[_0xb0c4('0x52')](_0x2725ec[_0xb0c4('0x4a')],['ids','id'])||{});}})[_0xb0c4('0x28')](respondWithResult(_0x488998,null))['catch'](handleError(_0x488998,null));};exports[_0xb0c4('0x53')]=function(_0x5610d1,_0x3567ab,_0x4bc908){var _0x5de416={};var _0x5f279f={};var _0x1164c1;var _0x116d65;return db[_0xb0c4('0x3f')]['findOne']({'where':{'id':_0x5610d1[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x3567ab,null))['then'](function(_0xa6f3f4){if(_0xa6f3f4){_0x1164c1=_0xa6f3f4;_0x5f279f[_0xb0c4('0x30')]=_['keys'](db['User'][_0xb0c4('0x46')]);_0x5f279f[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0x5610d1[_0xb0c4('0x31')]);_0x5f279f[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x5f279f[_0xb0c4('0x30')],_0x5f279f['query']);_0x5de416[_0xb0c4('0x34')]=_[_0xb0c4('0x32')](_0x5f279f[_0xb0c4('0x30')],qs['fields'](_0x5610d1[_0xb0c4('0x31')]['fields']));_0x5de416[_0xb0c4('0x34')]=_0x5de416[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x5de416[_0xb0c4('0x34')]:_0x5f279f[_0xb0c4('0x30')];_0x5de416['order']=qs[_0xb0c4('0x38')](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x38')]);_0x5de416[_0xb0c4('0x39')]=qs['filters'](_[_0xb0c4('0x3b')](_0x5610d1[_0xb0c4('0x31')],_0x5f279f[_0xb0c4('0x3a')]));if(_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x5de416[_0xb0c4('0x39')]=_[_0xb0c4('0x3d')](_0x5de416['where'],{'$or':_[_0xb0c4('0x2e')](_0x5de416['attributes'],function(_0x1ffefb){var _0x3802b8={};_0x3802b8[_0x1ffefb]={'$like':'%'+_0x5610d1['query'][_0xb0c4('0x3c')]+'%'};return _0x3802b8;})});}_0x5de416=_['merge']({},_0x5de416,_0x5610d1[_0xb0c4('0x47')]);return _0x1164c1['getMembers'](_0x5de416);}})[_0xb0c4('0x28')](function(_0x136553){if(_0x136553){_0x116d65=_0x136553['length'];if(!_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x36')](_0xb0c4('0x54'))){_0x5de416['limit']=qs[_0xb0c4('0x20')](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x5de416[_0xb0c4('0x1f')]=qs['offset'](_0x5610d1[_0xb0c4('0x31')][_0xb0c4('0x1f')]);}return _0x1164c1[_0xb0c4('0x53')](_0x5de416);}})[_0xb0c4('0x28')](function(_0x55941b){if(_0x55941b){return _0x55941b?{'count':_0x116d65,'rows':_0x55941b}:null;}})[_0xb0c4('0x28')](respondWithResult(_0x3567ab,null))[_0xb0c4('0x42')](handleError(_0x3567ab,null));};exports[_0xb0c4('0x55')]=function(_0x1d674c,_0x5afba5,_0x5f0d70){return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x1d674c[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x5afba5,null))[_0xb0c4('0x28')](function(_0x196417){if(_0x196417){return _0x196417['removeMembers'](_0x1d674c[_0xb0c4('0x31')]['ids']);}})[_0xb0c4('0x28')](respondWithStatusCode(_0x5afba5,null))[_0xb0c4('0x42')](handleError(_0x5afba5,null));};exports[_0xb0c4('0x56')]=function(_0x39f440,_0x74ed1b,_0x1ea5ab){if(_0x39f440['body']['id']){delete _0x39f440['body']['id'];}return db['ChatGroup'][_0xb0c4('0x48')]({'where':{'id':_0x39f440[_0xb0c4('0x44')]['id']}})[_0xb0c4('0x28')](handleEntityNotFound(_0x74ed1b,null))['then'](function(_0x171f42){if(_0x171f42){_0x39f440[_0xb0c4('0x4a')]['ChatGroupId']=_0x171f42['id'];return db[_0xb0c4('0x4d')]['create'](_0x39f440[_0xb0c4('0x4a')]);}})['then'](respondWithResult(_0x74ed1b,null))[_0xb0c4('0x42')](handleError(_0x74ed1b,null));};exports[_0xb0c4('0x57')]=function(_0x573028,_0x57ee03,_0x269305){var _0x5b7306={};var _0x21f542={};var _0x78fe03;var _0x377bab;return db['ChatGroup'][_0xb0c4('0x58')]({'where':{'id':_0x573028[_0xb0c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x57ee03,null))[_0xb0c4('0x28')](function(_0x330d21){if(_0x330d21){_0x78fe03=_0x330d21;_0x21f542['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x21f542[_0xb0c4('0x31')]=_[_0xb0c4('0x45')](_0x573028['query']);_0x21f542[_0xb0c4('0x3a')]=_[_0xb0c4('0x32')](_0x21f542[_0xb0c4('0x30')],_0x21f542['query']);_0x5b7306[_0xb0c4('0x34')]=_['intersection'](_0x21f542[_0xb0c4('0x30')],qs['fields'](_0x573028[_0xb0c4('0x31')][_0xb0c4('0x33')]));_0x5b7306['attributes']=_0x5b7306[_0xb0c4('0x34')][_0xb0c4('0x35')]?_0x5b7306['attributes']:_0x21f542[_0xb0c4('0x30')];_0x5b7306['order']=qs[_0xb0c4('0x38')](_0x573028['query']['sort']);_0x5b7306[_0xb0c4('0x39')]=qs[_0xb0c4('0x3a')](_[_0xb0c4('0x3b')](_0x573028[_0xb0c4('0x31')],_0x21f542[_0xb0c4('0x3a')]));if(_0x573028[_0xb0c4('0x31')][_0xb0c4('0x3c')]){_0x5b7306[_0xb0c4('0x39')]=_['merge'](_0x5b7306['where'],{'$or':_[_0xb0c4('0x2e')](_0x5b7306[_0xb0c4('0x34')],function(_0x1f4a41){var _0x3e3905={};_0x3e3905[_0x1f4a41]={'$like':'%'+_0x573028[_0xb0c4('0x31')][_0xb0c4('0x3c')]+'%'};return _0x3e3905;})});}if(_0x573028[_0xb0c4('0x31')]['$gte']){var _0x12d9cd=_0x573028[_0xb0c4('0x31')][_0xb0c4('0x59')][_0xb0c4('0x5a')](',');var _0x466ae3={};_0x466ae3[_0x12d9cd[0x0]]={'$gte':moment(_0x12d9cd[0x1])[_0xb0c4('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b7306['where']=_[_0xb0c4('0x3d')](_0x5b7306[_0xb0c4('0x39')],_0x466ae3);}_0x5b7306=_['merge']({},_0x5b7306,_0x573028['options']);return _0x78fe03['getMessages'](_0x5b7306);}})['then'](function(_0x678bd0){if(_0x678bd0){_0x377bab=_0x678bd0[_0xb0c4('0x35')];if(!_0x573028[_0xb0c4('0x31')]['hasOwnProperty'](_0xb0c4('0x54'))){_0x5b7306[_0xb0c4('0x20')]=qs['limit'](_0x573028[_0xb0c4('0x31')][_0xb0c4('0x20')]);_0x5b7306[_0xb0c4('0x1f')]=qs[_0xb0c4('0x1f')](_0x573028['query'][_0xb0c4('0x1f')]);}return _0x78fe03[_0xb0c4('0x57')](_0x5b7306);}})['then'](function(_0x30acdc){if(_0x30acdc){return _0x30acdc?{'count':_0x377bab,'rows':_0x30acdc}:null;}})[_0xb0c4('0x28')](respondWithResult(_0x57ee03,null))['catch'](handleError(_0x57ee03,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6311c34..c14d285 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 _0x5226=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x52113f,_0x29d37b){var _0x2575e5=function(_0xcf2aeb){while(--_0xcf2aeb){_0x52113f['push'](_0x52113f['shift']());}};_0x2575e5(++_0x29d37b);}(_0x5226,0x137));var _0x6522=function(_0x3b8251,_0x2e024c){_0x3b8251=_0x3b8251-0x0;var _0x23033a=_0x5226[_0x3b8251];return _0x23033a;};'use strict';var EventEmitter=require(_0x6522('0x0'));var ChatGroup=require(_0x6522('0x1'))['db'][_0x6522('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6522('0x3')](0x0);var events={'afterCreate':_0x6522('0x4'),'afterUpdate':'update','afterDestroy':_0x6522('0x5')};function emitEvent(_0x43f913){return function(_0x12dffe,_0x48d4db,_0x228009){ChatGroupEvents['emit'](_0x43f913+':'+_0x12dffe['id'],_0x12dffe);ChatGroupEvents[_0x6522('0x6')](_0x43f913,_0x12dffe);_0x228009(null);};}for(var e in events){if(events[_0x6522('0x7')](e)){var event=events[e];ChatGroup[_0x6522('0x8')](e,emitEvent(event));}}module[_0x6522('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5cd6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x5cd6,0xfa));var _0x65cd=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x5cd6[_0x23e7c1];return _0x1add43;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65cd('0x0'))['db'][_0x65cd('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65cd('0x2')](0x0);var events={'afterCreate':_0x65cd('0x3'),'afterUpdate':_0x65cd('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdf7a0b){return function(_0x1000cd,_0x21fe79,_0x827479){ChatGroupEvents[_0x65cd('0x5')](_0xdf7a0b+':'+_0x1000cd['id'],_0x1000cd);ChatGroupEvents[_0x65cd('0x5')](_0xdf7a0b,_0x1000cd);_0x827479(null);};}for(var e in events){if(events[_0x65cd('0x6')](e)){var event=events[e];ChatGroup[_0x65cd('0x7')](e,emitEvent(event));}}module[_0x65cd('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 28bdf53..277c0ac 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 _0xdfde=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','../../config/logger'];(function(_0x4bd56c,_0x3f21fb){var _0x12f6a6=function(_0x120a0f){while(--_0x120a0f){_0x4bd56c['push'](_0x4bd56c['shift']());}};_0x12f6a6(++_0x3f21fb);}(_0xdfde,0x1ed));var _0xedfd=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xdfde[_0x328bd3];return _0x458149;};'use strict';var _=require(_0xedfd('0x0'));var util=require('util');var logger=require(_0xedfd('0x1'))(_0xedfd('0x2'));var moment=require(_0xedfd('0x3'));var BPromise=require(_0xedfd('0x4'));var rp=require(_0xedfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedfd('0x6'));var config=require(_0xedfd('0x7'));var attributes=require(_0xedfd('0x8'));module['exports']=function(_0x19fb63,_0x3fbb90){return _0x19fb63['define'](_0xedfd('0x9'),attributes,{'tableName':_0xedfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4265=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x4265,0x15a));var _0x5426=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x4265[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));var logger=require('../../config/logger')(_0x5426('0x2'));var moment=require(_0x5426('0x3'));var BPromise=require(_0x5426('0x4'));var rp=require(_0x5426('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5426('0x6'));var config=require(_0x5426('0x7'));var attributes=require('./chatGroup.attributes');module[_0x5426('0x8')]=function(_0x5ea6ba,_0x4ef7c0){return _0x5ea6ba[_0x5426('0x9')](_0x5426('0xa'),attributes,{'tableName':_0x5426('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index cfd680f..d7fe0fc 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 _0x4422=['socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0xde3f0e,_0x57ab89){var _0x4b1f70=function(_0x11a26a){while(--_0x11a26a){_0xde3f0e['push'](_0xde3f0e['shift']());}};_0x4b1f70(++_0x57ab89);}(_0x4422,0xab));var _0x2442=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4422[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2442('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2442('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2442('0x2'));var db=require(_0x2442('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2442('0x4'));var config=require(_0x2442('0x5'));var jayson=require(_0x2442('0x6'));var client=jayson[_0x2442('0x7')]['http']({'port':0x232a});config[_0x2442('0x8')]=_[_0x2442('0x9')](config[_0x2442('0x8')],{'host':_0x2442('0xa'),'port':0x18eb});var socket=require(_0x2442('0xb'))(new Redis(config[_0x2442('0x8')]));require('./chatGroup.socket')[_0x2442('0xc')](socket);function respondWithRpcPromise(_0x3ca25d,_0x4197c8,_0x1ac048){return new BPromise(function(_0x1cd807,_0x628677){return client[_0x2442('0xd')](_0x3ca25d,_0x1ac048)[_0x2442('0xe')](function(_0x49153c){logger[_0x2442('0xf')](_0x2442('0x10'),_0x4197c8,_0x2442('0x11'));logger[_0x2442('0x12')](_0x2442('0x13'),_0x4197c8,_0x2442('0x11'),JSON[_0x2442('0x14')](_0x49153c));if(_0x49153c['error']){if(_0x49153c[_0x2442('0x15')][_0x2442('0x16')]===0x1f4){logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x49153c['error'][_0x2442('0x17')]);return _0x628677(_0x49153c[_0x2442('0x15')]['message']);}logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x49153c['error'][_0x2442('0x17')]);return _0x1cd807(_0x49153c[_0x2442('0x15')][_0x2442('0x17')]);}else{logger[_0x2442('0xf')](_0x2442('0x10'),_0x4197c8,'request\x20sent');_0x1cd807(_0x49153c[_0x2442('0x18')][_0x2442('0x17')]);}})[_0x2442('0x19')](function(_0x58c725){logger[_0x2442('0x15')](_0x2442('0x10'),_0x4197c8,_0x58c725);_0x628677(_0x58c725);});});}
\ No newline at end of file
+var _0x4812=['register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4812,0x10a));var _0x2481=function(_0x5259a7,_0x48d57c){_0x5259a7=_0x5259a7-0x0;var _0x2b5084=_0x4812[_0x5259a7];return _0x2b5084;};'use strict';var _=require(_0x2481('0x0'));var util=require(_0x2481('0x1'));var moment=require('moment');var BPromise=require(_0x2481('0x2'));var rs=require(_0x2481('0x3'));var fs=require('fs');var Redis=require(_0x2481('0x4'));var db=require(_0x2481('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2481('0x6'))('rpc');var config=require(_0x2481('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2481('0x8')][_0x2481('0x9')]({'port':0x232a});config[_0x2481('0xa')]=_[_0x2481('0xb')](config[_0x2481('0xa')],{'host':_0x2481('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2481('0xd'))[_0x2481('0xe')](socket);function respondWithRpcPromise(_0x1c19dd,_0xf7029f,_0x1a1ee3){return new BPromise(function(_0x5922e5,_0x189f7b){return client[_0x2481('0xf')](_0x1c19dd,_0x1a1ee3)[_0x2481('0x10')](function(_0x197b6d){logger[_0x2481('0x11')](_0x2481('0x12'),_0xf7029f,'request\x20sent');logger[_0x2481('0x13')](_0x2481('0x14'),_0xf7029f,_0x2481('0x15'),JSON[_0x2481('0x16')](_0x197b6d));if(_0x197b6d[_0x2481('0x17')]){if(_0x197b6d[_0x2481('0x17')][_0x2481('0x18')]===0x1f4){logger[_0x2481('0x17')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);return _0x189f7b(_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);}logger[_0x2481('0x17')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x197b6d[_0x2481('0x17')][_0x2481('0x19')]);return _0x5922e5(_0x197b6d[_0x2481('0x17')]['message']);}else{logger[_0x2481('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf7029f,_0x2481('0x15'));_0x5922e5(_0x197b6d[_0x2481('0x1a')][_0x2481('0x19')]);}})[_0x2481('0x1b')](function(_0x186abb){logger[_0x2481('0x17')](_0x2481('0x12'),_0xf7029f,_0x186abb);_0x189f7b(_0x186abb);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ca12b36..834795d 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 _0x6026=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x6026,0x141));var _0x6602=function(_0x3e7689,_0xdf5f7f){_0x3e7689=_0x3e7689-0x0;var _0x4a3008=_0x6026[_0x3e7689];return _0x4a3008;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6602('0x0'),_0x6602('0x1'),_0x6602('0x2')];function createListener(_0xf12504,_0x4b2b12){return function(_0xf2c6c2){_0x4b2b12[_0x6602('0x3')](_0xf12504,_0xf2c6c2);};}function removeListener(_0x2a3b41,_0x7dbcbb){return function(){ChatGroupEvents[_0x6602('0x4')](_0x2a3b41,_0x7dbcbb);};}exports[_0x6602('0x5')]=function(_0x1e5503){for(var _0x206241=0x0,_0x38906=events[_0x6602('0x6')];_0x206241<_0x38906;_0x206241++){var _0x4e6827=events[_0x206241];var _0x14180f=createListener(_0x6602('0x7')+_0x4e6827,_0x1e5503);ChatGroupEvents['on'](_0x4e6827,_0x14180f);}};
\ No newline at end of file
+var _0x5054=['emit','length','./chatGroup.events','update'];(function(_0x4ddb61,_0x37b9b7){var _0x23ba67=function(_0x498e91){while(--_0x498e91){_0x4ddb61['push'](_0x4ddb61['shift']());}};_0x23ba67(++_0x37b9b7);}(_0x5054,0x17a));var _0x4505=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5054[_0x20a584];return _0x4b41a8;};'use strict';var ChatGroupEvents=require(_0x4505('0x0'));var events=['save','remove',_0x4505('0x1')];function createListener(_0x520ddf,_0x5e4154){return function(_0x5402c0){_0x5e4154[_0x4505('0x2')](_0x520ddf,_0x5402c0);};}function removeListener(_0x4b48c3,_0xbc729e){return function(){ChatGroupEvents['removeListener'](_0x4b48c3,_0xbc729e);};}exports['register']=function(_0x44a026){for(var _0x4d1efd=0x0,_0x44ba04=events[_0x4505('0x3')];_0x4d1efd<_0x44ba04;_0x4d1efd++){var _0x226cb1=events[_0x4d1efd];var _0x459ef9=createListener('chatGroup:'+_0x226cb1,_0x44a026);ChatGroupEvents['on'](_0x226cb1,_0x459ef9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 2f5f498..b22b4bb 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 _0xd1e8=['post','addMessage','put','/:id','update','destroy','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x537b95,_0x3a77ea){var _0x5af140=function(_0x223a60){while(--_0x223a60){_0x537b95['push'](_0x537b95['shift']());}};_0x5af140(++_0x3a77ea);}(_0xd1e8,0xd8));var _0x8d1e=function(_0x1f1c17,_0x4ed89e){_0x1f1c17=_0x1f1c17-0x0;var _0x59109b=_0xd1e8[_0x1f1c17];return _0x59109b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d1e('0x0'));var timeout=require(_0x8d1e('0x1'));var express=require('express');var router=express[_0x8d1e('0x2')]();var fs_extra=require(_0x8d1e('0x3'));var auth=require(_0x8d1e('0x4'));var interaction=require(_0x8d1e('0x5'));var config=require(_0x8d1e('0x6'));var controller=require(_0x8d1e('0x7'));router[_0x8d1e('0x8')]('/',auth[_0x8d1e('0x9')](),controller['index']);router[_0x8d1e('0x8')](_0x8d1e('0xa'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0xb')]);router[_0x8d1e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8d1e('0xc')]);router[_0x8d1e('0x8')](_0x8d1e('0xd'),auth['isAuthenticated'](),controller[_0x8d1e('0xe')]);router[_0x8d1e('0x8')](_0x8d1e('0xf'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x10')]);router[_0x8d1e('0x8')](_0x8d1e('0x11'),auth[_0x8d1e('0x9')](),controller['getMessages']);router['post']('/',auth[_0x8d1e('0x9')](),controller['create']);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x8d1e('0x12')](_0x8d1e('0x11'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x13')]);router[_0x8d1e('0x14')](_0x8d1e('0x15'),auth['isAuthenticated'](),controller[_0x8d1e('0x16')]);router['delete'](_0x8d1e('0x15'),auth[_0x8d1e('0x9')](),controller[_0x8d1e('0x17')]);router[_0x8d1e('0x18')](_0x8d1e('0xf'),auth[_0x8d1e('0x9')](),controller['removeMembers']);module[_0x8d1e('0x19')]=router;
\ No newline at end of file
+var _0xf448=['/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show'];(function(_0x5599aa,_0x1b9ffe){var _0x4b0f34=function(_0xbd81f0){while(--_0xbd81f0){_0x5599aa['push'](_0x5599aa['shift']());}};_0x4b0f34(++_0x1b9ffe);}(_0xf448,0x66));var _0x8f44=function(_0x589eab,_0xc40cd1){_0x589eab=_0x589eab-0x0;var _0xe66536=_0xf448[_0x589eab];return _0xe66536;};'use strict';var multer=require(_0x8f44('0x0'));var util=require(_0x8f44('0x1'));var path=require(_0x8f44('0x2'));var timeout=require(_0x8f44('0x3'));var express=require(_0x8f44('0x4'));var router=express['Router']();var fs_extra=require(_0x8f44('0x5'));var auth=require(_0x8f44('0x6'));var interaction=require(_0x8f44('0x7'));var config=require(_0x8f44('0x8'));var controller=require('./chatGroup.controller');router[_0x8f44('0x9')]('/',auth[_0x8f44('0xa')](),controller[_0x8f44('0xb')]);router[_0x8f44('0x9')]('/describe',auth[_0x8f44('0xa')](),controller[_0x8f44('0xc')]);router[_0x8f44('0x9')]('/:id',auth[_0x8f44('0xa')](),controller[_0x8f44('0xd')]);router['get'](_0x8f44('0xe'),auth['isAuthenticated'](),controller[_0x8f44('0xf')]);router[_0x8f44('0x9')](_0x8f44('0x10'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x11')]);router[_0x8f44('0x9')](_0x8f44('0x12'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x13')]);router[_0x8f44('0x14')]('/',auth[_0x8f44('0xa')](),controller[_0x8f44('0x15')]);router['post']('/:id/members',auth[_0x8f44('0xa')](),controller['addMembers']);router['post'](_0x8f44('0x12'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x16')]);router[_0x8f44('0x17')](_0x8f44('0x18'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x19')]);router[_0x8f44('0x1a')](_0x8f44('0x18'),auth['isAuthenticated'](),controller[_0x8f44('0x1b')]);router[_0x8f44('0x1a')](_0x8f44('0x10'),auth[_0x8f44('0xa')](),controller[_0x8f44('0x1c')]);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 46ed441..3e9c3fa 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 _0x352e=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x352e,0x1a6));var _0xe352=function(_0x53d0d5,_0x34f8d4){_0x53d0d5=_0x53d0d5-0x0;var _0x146297=_0x352e[_0x53d0d5];return _0x146297;};'use strict';var Sequelize=require(_0xe352('0x0'));module[_0xe352('0x1')]={'closed':{'type':Sequelize[_0xe352('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe352('0x3')]},'ratingType':{'type':Sequelize[_0xe352('0x4')](_0xe352('0x5'),_0xe352('0x6')),'defaultValue':_0xe352('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe352('0x7')]},'mailTranscript':{'type':Sequelize[_0xe352('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe352('0x8')]},'secondDisposition':{'type':Sequelize[_0xe352('0x8')]},'thirdDisposition':{'type':Sequelize[_0xe352('0x8')]},'note':{'type':Sequelize[_0xe352('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xe352('0x8')]},'osName':{'type':Sequelize[_0xe352('0x8')]},'osVersion':{'type':Sequelize[_0xe352('0x8')]},'deviceModel':{'type':Sequelize[_0xe352('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xe352('0x8')]},'referer':{'type':Sequelize[_0xe352('0x7')]},'customerIp':{'type':Sequelize[_0xe352('0x8')]},'formData':{'type':Sequelize[_0xe352('0x7')](_0xe352('0x9'))},'read1stAt':{'type':Sequelize[_0xe352('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe352('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe352('0x8')]},'customerPort':{'type':Sequelize[_0xe352('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xe352('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xe352('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x757a=['thumb','star','TEXT','STRING','DATE','long','exports','BOOLEAN'];(function(_0x49b465,_0x497bb7){var _0x9a3fea=function(_0x51a5b1){while(--_0x51a5b1){_0x49b465['push'](_0x49b465['shift']());}};_0x9a3fea(++_0x497bb7);}(_0x757a,0xde));var _0xa757=function(_0x58cd5e,_0x4b7fb5){_0x58cd5e=_0x58cd5e-0x0;var _0x4fe64e=_0x757a[_0x58cd5e];return _0x4fe64e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'closed':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0xa757('0x2')),'defaultValue':_0xa757('0x3')},'ratingMessage':{'type':Sequelize[_0xa757('0x4')]},'pathTranscript':{'type':Sequelize[_0xa757('0x4')]},'mailTranscript':{'type':Sequelize[_0xa757('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa757('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa757('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa757('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa757('0x5')]},'browserVersion':{'type':Sequelize[_0xa757('0x5')]},'osName':{'type':Sequelize[_0xa757('0x5')]},'osVersion':{'type':Sequelize[_0xa757('0x5')]},'deviceModel':{'type':Sequelize[_0xa757('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa757('0x5')]},'referer':{'type':Sequelize[_0xa757('0x4')]},'customerIp':{'type':Sequelize[_0xa757('0x5')]},'formData':{'type':Sequelize[_0xa757('0x4')](_0xa757('0x7'))},'read1stAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgAt':{'type':Sequelize[_0xa757('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa757('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4363b94..9062f51 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 _0x9134=['ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','contact','POST','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','abandon','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','offline-chat/','close','mailTranscript','join','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','CmContact','format','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','SendMail','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','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','findAll','addTags','setTags','spread','emit','removeTags','server','files','tmp','attachments','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','osName','referer','customerIp','customerPort','basename','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','sendStatus','stack','name','render','merge','agent','account','Users','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','abandoned','total','closed','UserId','disposition','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','unreadMessages','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9134,0x1b7));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4913('0x0'));var rimraf=require(_0x4913('0x1'));var zipdir=require(_0x4913('0x2'));var jsonpatch=require(_0x4913('0x3'));var rp=require(_0x4913('0x4'));var moment=require(_0x4913('0x5'));var BPromise=require(_0x4913('0x6'));var Mustache=require(_0x4913('0x7'));var util=require('util');var path=require(_0x4913('0x8'));var sox=require(_0x4913('0x9'));var csv=require(_0x4913('0xa'));var ejs=require(_0x4913('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4913('0xc'));var squel=require(_0x4913('0xd'));var crypto=require(_0x4913('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4913('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4913('0x10'));var Redis=require(_0x4913('0x11'));var authService=require(_0x4913('0x12'));var qs=require(_0x4913('0x13'));var as=require(_0x4913('0x14'));var pdf=require(_0x4913('0x15'));var hardwareService=require(_0x4913('0x16'));var logger=require(_0x4913('0x17'))(_0x4913('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4913('0x19'))['db'];config[_0x4913('0x1a')]=_[_0x4913('0x1b')](config[_0x4913('0x1a')],{'host':_0x4913('0x1c'),'port':0x18eb});var socket=require(_0x4913('0x1d'))(new Redis(config[_0x4913('0x1a')]));require(_0x4913('0x1e'))[_0x4913('0x1f')](socket);var jayson=require(_0x4913('0x20'));var client=jayson[_0x4913('0x21')][_0x4913('0x22')]({'port':0x232b});var client9004=jayson[_0x4913('0x21')][_0x4913('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x318a1c,_0x22319a,_0x5a2296,_0x23d05d){return new BPromise(function(_0x4c1945,_0x29f2a1){var _0x45edf1=_0x23d05d||client;return _0x45edf1[_0x4913('0x23')](_0x318a1c,_0x5a2296)['then'](function(_0x4f03ab){logger[_0x4913('0x24')](_0x4913('0x25'),_0x22319a,_0x4913('0x26'));logger['debug'](_0x4913('0x27'),_0x22319a,_0x4913('0x26'),JSON[_0x4913('0x28')](_0x4f03ab));if(_0x4f03ab['error']){if(_0x4f03ab[_0x4913('0x29')][_0x4913('0x2a')]===0x1f4){logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x4f03ab[_0x4913('0x29')]['message']);return _0x29f2a1(_0x4f03ab['error'][_0x4913('0x2b')]);}logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x4f03ab[_0x4913('0x29')][_0x4913('0x2b')]);return _0x4c1945(_0x4f03ab[_0x4913('0x29')]['message']);}else{logger[_0x4913('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x22319a,_0x4913('0x26'));_0x4c1945(_0x4f03ab[_0x4913('0x2c')][_0x4913('0x2b')]);}})['catch'](function(_0x37c158){logger[_0x4913('0x29')](_0x4913('0x25'),_0x22319a,_0x37c158);_0x29f2a1(_0x37c158);});});}function respondWithStatusCode(_0x23cf35,_0x14a526){_0x14a526=_0x14a526||0xcc;return function(_0x413a4a){if(_0x413a4a){return _0x23cf35['sendStatus'](_0x14a526);}return _0x23cf35[_0x4913('0x2d')](_0x14a526)[_0x4913('0x2e')]();};}function respondWithResult(_0x33f540,_0x5dd634){_0x5dd634=_0x5dd634||0xc8;return function(_0x336063){if(_0x336063){return _0x33f540[_0x4913('0x2d')](_0x5dd634)[_0x4913('0x2f')](_0x336063);}};}function respondWithFilteredResult(_0x524605,_0x156ebb){return function(_0x38b8ae){if(_0x38b8ae){var _0x290509=typeof _0x156ebb[_0x4913('0x30')]===_0x4913('0x31')&&typeof _0x156ebb[_0x4913('0x32')]===_0x4913('0x31');var _0x336110=_0x38b8ae['count'];var _0x33c9d0=_0x290509?0x0:_0x156ebb[_0x4913('0x30')];var _0x374907=_0x290509?_0x38b8ae[_0x4913('0x33')]:_0x156ebb[_0x4913('0x30')]+_0x156ebb[_0x4913('0x32')];var _0x3778dc;if(_0x374907>=_0x336110){_0x374907=_0x336110;_0x3778dc=0xc8;}else{_0x3778dc=0xce;}_0x524605[_0x4913('0x2d')](_0x3778dc);return _0x524605[_0x4913('0x34')](_0x4913('0x35'),_0x33c9d0+'-'+_0x374907+'/'+_0x336110)[_0x4913('0x2f')](_0x38b8ae);}return null;};}function patchUpdates(_0x185e6e){return function(_0x40a226){try{jsonpatch[_0x4913('0x36')](_0x40a226,_0x185e6e,!![]);}catch(_0x40f784){return BPromise['reject'](_0x40f784);}return _0x40a226['save']();};}function saveUpdates(_0x205541,_0x2dad0f){return function(_0x223e7b){if(_0x223e7b){return _0x223e7b['update'](_0x205541)['then'](function(_0x276226){return _0x276226;});}return null;};}function removeEntity(_0x5937f5,_0x491cc3){return function(_0x406758){if(_0x406758){return _0x406758['destroy']()[_0x4913('0x37')](function(){_0x5937f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ba82,_0x4cd281){return function(_0x364e58){if(!_0x364e58){_0x56ba82[_0x4913('0x38')](0x194);}return _0x364e58;};}function handleError(_0x2d65c9,_0x78d5eb){_0x78d5eb=_0x78d5eb||0x1f4;return function(_0x4fd35b){logger[_0x4913('0x29')](_0x4fd35b[_0x4913('0x39')]);if(_0x4fd35b['name']){delete _0x4fd35b[_0x4913('0x3a')];}_0x2d65c9['status'](_0x78d5eb)['send'](_0x4fd35b);};}function getMustacheRender(_0x79dbe7,_0x359d9a){return Mustache[_0x4913('0x3b')](_0x79dbe7,_[_0x4913('0x3c')](_0x359d9a['body'],{'contact':_0x359d9a['contact'],'message':_0x359d9a[_0x4913('0x2b')],'agent':_0x359d9a[_0x4913('0x3d')],'interaction':_0x359d9a['interaction'],'account':_0x359d9a[_0x4913('0x3e')]}))||'';}function getInteractionUsers(_0x5d607c,_0x5b5800){return new BPromise(function(_0x3929f1,_0x3c4279){try{if(_0x5b5800[_0x5d607c['id']]){_0x5d607c[_0x4913('0x3f')]=_[_0x4913('0x40')](_0x5b5800[_0x5d607c['id']],function(_0x59075a){return{'id':_0x59075a['id'],'fullname':_0x59075a[_0x4913('0x41')]};});}}catch(_0x4f78a6){_0x3c4279(_0x4f78a6);}_0x3929f1(_0x5d607c);});}function getInteractionTags(_0xbbc8d3,_0x4a2012){return new BPromise(function(_0x446908,_0x35e177){try{if(_0xbbc8d3[_0x4913('0x42')]){_0xbbc8d3[_0x4913('0x43')]=[];_0xbbc8d3[_0x4913('0x42')][_0x4913('0x44')](',')[_0x4913('0x45')](function(_0xaa3ce3){_0xbbc8d3[_0x4913('0x43')]['push'](_0x4a2012[_0xaa3ce3]);});}delete _0xbbc8d3[_0x4913('0x42')];}catch(_0x1cdb58){_0x35e177(_0x1cdb58);}_0x446908(_0xbbc8d3);});}function updateChatInteraction(_0x521acc,_0x3fee7c,_0x16d7ff){return new BPromise(function(_0x54a525,_0x460a8a){return getInteractionUsers(_0x521acc,_0x16d7ff)[_0x4913('0x37')](function(_0x33287d){return getInteractionTags(_0x33287d,_0x3fee7c);})[_0x4913('0x37')](function(_0x43fcaf){return getStateInteraction(_0x43fcaf);})[_0x4913('0x37')](function(_0x2986e5){_0x54a525(_0x2986e5);})[_0x4913('0x46')](function(_0x4e127b){_0x460a8a(_0x4e127b);});});}function getStateInteraction(_0x79f6f7){return new BPromise(function(_0x4fcdb8){_0x79f6f7[_0x4913('0x47')]=0x0;_0x79f6f7[_0x4913('0x48')]=0x0;_0x79f6f7['answered']=0x0;_0x79f6f7[_0x4913('0x49')]=0x0;_0x79f6f7[_0x4913('0x4a')]=0x0;_0x79f6f7[_0x4913('0x4b')]=0x0;if(!_0x79f6f7[_0x4913('0x4c')]&&!_0x79f6f7[_0x4913('0x4d')]){_0x79f6f7[_0x4913('0x47')]+=0x1;}if(!_0x79f6f7[_0x4913('0x4c')]&&_0x79f6f7['UserId']){_0x79f6f7[_0x4913('0x48')]+=0x1;if(_0x79f6f7[_0x4913('0x47')]){_0x79f6f7['waiting']-=0x1;}}if(_0x79f6f7[_0x4913('0x4c')]&&_0x79f6f7[_0x4913('0x4e')]==='abandoned'){_0x79f6f7['abandoned']+=0x1;if(_0x79f6f7['waiting']){_0x79f6f7[_0x4913('0x47')]-=0x1;}}else if(_0x79f6f7['closed']&&!_0x79f6f7[_0x4913('0x4d')]&&_0x79f6f7[_0x4913('0x4e')]){_0x79f6f7[_0x4913('0x49')]+=0x1;if(_0x79f6f7['waiting']){_0x79f6f7[_0x4913('0x47')]-=0x1;}}else if(_0x79f6f7['closed']&&_0x79f6f7[_0x4913('0x4d')]){_0x79f6f7['answered']+=0x1;if(_0x79f6f7[_0x4913('0x48')]){_0x79f6f7[_0x4913('0x48')]-=0x1;}}_0x79f6f7[_0x4913('0x4b')]+=0x1;_0x4fcdb8(_0x79f6f7);});}exports[_0x4913('0x4f')]=function(_0xe0538f,_0x113a0a){var _0x525c7a={},_0x2c20d4={},_0x4526f0={'count':0x0,'rows':[]};var _0x51b03=_['map'](db[_0x4913('0x50')]['rawAttributes'],function(_0x40afc3){return{'name':_0x40afc3[_0x4913('0x51')],'type':_0x40afc3[_0x4913('0x52')][_0x4913('0x53')]};});_0x2c20d4[_0x4913('0x54')]=_[_0x4913('0x40')](_0x51b03,_0x4913('0x3a'));_0x2c20d4[_0x4913('0x55')]=_[_0x4913('0x56')](_0xe0538f[_0x4913('0x55')]);_0x2c20d4[_0x4913('0x57')]=_[_0x4913('0x58')](_0x2c20d4[_0x4913('0x54')],_0x2c20d4[_0x4913('0x55')]);_0x525c7a[_0x4913('0x59')]=_[_0x4913('0x58')](_0x2c20d4[_0x4913('0x54')],qs[_0x4913('0x5a')](_0xe0538f[_0x4913('0x55')][_0x4913('0x5a')]));_0x525c7a[_0x4913('0x59')]=_0x525c7a[_0x4913('0x59')][_0x4913('0x5b')]?_0x525c7a[_0x4913('0x59')]:_0x2c20d4[_0x4913('0x54')];if(!_0xe0538f['query'][_0x4913('0x5c')](_0x4913('0x5d'))){_0x525c7a[_0x4913('0x32')]=qs[_0x4913('0x32')](_0xe0538f['query'][_0x4913('0x32')]);_0x525c7a[_0x4913('0x30')]=qs['offset'](_0xe0538f[_0x4913('0x55')][_0x4913('0x30')]);}_0x525c7a[_0x4913('0x5e')]=qs[_0x4913('0x5f')](_0xe0538f[_0x4913('0x55')][_0x4913('0x5f')]);_0x525c7a[_0x4913('0x60')]=qs['filters'](_[_0x4913('0x61')](_0xe0538f[_0x4913('0x55')],_0x2c20d4[_0x4913('0x57')]),_0x51b03);var _0x174f4a=[];var _0x542226=squel['select']()[_0x4913('0x62')]('id')[_0x4913('0x62')]('name')[_0x4913('0x62')](_0x4913('0x63'))[_0x4913('0x64')](_0x4913('0x65'));var _0x4ff863=squel[_0x4913('0x66')]()[_0x4913('0x62')](_0x4913('0x67'))[_0x4913('0x62')](_0x4913('0x68'))[_0x4913('0x62')]('ui.ChatInteractionId')[_0x4913('0x64')](_0x4913('0x69'),'ui')[_0x4913('0x6a')](_0x4913('0x6b'),'u',_0x4913('0x6c'));var _0x52032f=squel[_0x4913('0x66')]()[_0x4913('0x64')](_0x4913('0x6d'),'i')[_0x4913('0x6a')]('cm_contacts','c',_0x4913('0x6e'))['left_join'](_0x4913('0x6b'),'o',_0x4913('0x6f'))[_0x4913('0x6a')]('chat_websites','a',_0x4913('0x70'))['left_join']('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x4913('0x6a')]('chat_interaction_has_tags','it',_0x4913('0x71'))[_0x4913('0x6a')](_0x4913('0x65'),'t',_0x4913('0x72'));var _0x2d1bb7=squel[_0x4913('0x73')]();var _0xd1a2fb=[];var _0x241292=squel[_0x4913('0x73')]();var _0x393a28;if(_0xe0538f['query'][_0x4913('0x74')]){_0x393a28=as[_0x4913('0x75')](_0xe0538f['query']['search']);var _0xc12de5=_0x393a28[_0x4913('0x76')];for(var _0x42b5cd=0x0;_0x42b5cd<_0x393a28[_0x4913('0x77')][_0x4913('0x5b')];_0x42b5cd++){var _0x162932=_0x393a28[_0x4913('0x77')][_0x42b5cd];var _0x2b6ee2='i';var _0x67a070=_[_0x4913('0x78')](_0x51b03,['name',_0x162932[_0x4913('0x62')]]);if(!_0x67a070){switch(_0x162932[_0x4913('0x62')]){case'unreadMessages':if(_0x162932[_0x4913('0x79')]==0x1){_0x52032f[_0x4913('0x7a')]('`'+_0x162932[_0x4913('0x62')]+_0x4913('0x7b'));}else{_0x52032f[_0x4913('0x7a')]('`'+_0x162932['field']+_0x4913('0x7c'));}break;case'Contact':if(_0x162932[_0x4913('0x7d')]==='$substring'){if(_0x162932[_0x4913('0x79')][_0x4913('0x44')]('\x20')[_0x4913('0x5b')]>0x1){_0x2d1bb7[_0xc12de5](_0x4913('0x7e'),qs['getFullTextValue'](_0x162932['value']),null);}else{var _0x11c4a7='%'+_0x162932[_0x4913('0x79')]+'%';_0x2d1bb7[_0xc12de5](_0x4913('0x7f'),_0x11c4a7,_0x11c4a7,_0x11c4a7);}}else{_0x67a070=_[_0x4913('0x78')](_0x51b03,[_0x4913('0x3a'),'ContactId']);_0x162932[_0x4913('0x62')]=_0x4913('0x80');_0x344324=as[_0x4913('0x81')](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}break;case _0x4913('0x84'):var _0x770ac0=_0x162932[_0x4913('0x79')][_0x4913('0x44')](',')[_0x4913('0x40')](function(_0x37c793){return Number(_0x37c793);});_0x770ac0[_0x4913('0x45')](function(_0x2f842d){_0x241292['or'](_0x4913('0x85'),'%,'+_0x2f842d+',%');});_0xd1a2fb=_[_0x4913('0x86')](_0xd1a2fb,_0x770ac0);break;case _0x4913('0x87'):if(_0x162932[_0x4913('0x7d')]===_0x4913('0x88')){_0x2d1bb7[_0xc12de5](_0x4913('0x89'),'%'+_0x162932[_0x4913('0x79')]+'%',null);}else{_0x67a070=_[_0x4913('0x78')](_0x51b03,['name',_0x4913('0x4d')]);_0x162932['field']=_0x4913('0x4d');_0x344324=as['buildExpression'](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')]['start'],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}break;case _0x4913('0x8a'):_0x344324=as[_0x4913('0x81')]('me',null,_0x162932);_0x2d1bb7[_0xc12de5](_0x344324[_0x4913('0x82')],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);break;}}else{var _0x344324=as[_0x4913('0x81')](_0x2b6ee2,_0x67a070[_0x4913('0x52')],_0x162932);_0x2d1bb7[_0xc12de5](_0x344324['text'],_0x344324[_0x4913('0x79')][_0x4913('0x83')],_0x344324[_0x4913('0x79')][_0x4913('0x2e')]);}}}else{var _0x2cc70f=_(_0xe0538f[_0x4913('0x55')])['keys']()['map'](function(_0x17f7ab){return _[_0x4913('0x8b')](_0x51b03,[_0x4913('0x3a'),_0x17f7ab])?_0x17f7ab:undefined;})['compact']()[_0x4913('0x79')]();if(!_['isEmpty'](_0x2cc70f)){_0x2cc70f['forEach'](function(_0x419449){if(_0x419449==='ChatWebsiteId'){_0x52032f[_0x4913('0x60')](_0x4913('0x8c'),[]['concat'](_0xe0538f[_0x4913('0x55')][_0x419449]));}else if(_0x419449===_0x4913('0x8d')){var _0x572d65=JSON[_0x4913('0x8e')](_0xe0538f[_0x4913('0x55')][_0x419449])[_0x4913('0x8f')];var _0x448754=JSON[_0x4913('0x8e')](_0xe0538f[_0x4913('0x55')][_0x419449])[_0x4913('0x90')];_0x52032f[_0x4913('0x60')](_0x4913('0x91'),_0x572d65,_0x448754);}else{if(_0xe0538f[_0x4913('0x55')][_0x419449]===_0x4913('0x92')){_0x52032f['where']('i.'+_0x419449+_0x4913('0x93'));}else{_0x52032f['where']('i.'+_0x419449+_0x4913('0x94'),_0xe0538f[_0x4913('0x55')][_0x419449]);}}});}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x95')]){if(_0xe0538f[_0x4913('0x55')][_0x4913('0x95')]==0x1){_0x52032f[_0x4913('0x7a')](_0x4913('0x96'));}else{_0x52032f[_0x4913('0x7a')]('`unreadMessages`\x20>\x200');}}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x97')]){_0xd1a2fb=_[_0x4913('0x98')](_0xe0538f[_0x4913('0x55')][_0x4913('0x97')])?_0xe0538f['query'][_0x4913('0x97')]:new Array(_0xe0538f[_0x4913('0x55')]['tag']);_0xd1a2fb[_0x4913('0x45')](function(_0x1cb5a3){_0x241292['or'](_0x4913('0x85'),'%,'+_0x1cb5a3+',%');});}if(_0xe0538f[_0x4913('0x55')][_0x4913('0x99')]){var _0x1216b1=_0xe0538f[_0x4913('0x55')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1216b1)){_0x2d1bb7['or'](_0x4913('0x9a'),_0x1216b1+'%');}else{_0x2d1bb7['or'](_0x4913('0x9b'),qs[_0x4913('0x9c')](_0x1216b1))['or'](_0x4913('0x9d'),_0x1216b1+'%');}}}_0x52032f[_0x4913('0x60')](_0x2d1bb7);_0x52032f[_0x4913('0x9e')](_0x4913('0x9f'));var _0x3ae1ce={'type':db[_0x4913('0xa0')]['QueryTypes'][_0x4913('0xa1')],'raw':!![]};var _0x3e5ea0=_0x52032f[_0x4913('0xa2')]();_0x3e5ea0[_0x4913('0x62')](_0x4913('0x9f'));_0x3e5ea0[_0x4913('0x62')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4913('0xa3'));if(_0x525c7a[_0x4913('0x5e')]){_0x525c7a[_0x4913('0x5e')]['forEach'](function(_0x46f21f){var _0x3ba129=_0x46f21f[0x0]==='contactName'?_0x46f21f[0x0]:'i.'+_0x46f21f[0x0];_0x52032f['order'](_0x3ba129,_0x46f21f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xd1a2fb)){_0x52032f[_0x4913('0x7a')](_0x241292);_0x3e5ea0[_0x4913('0x60')](_0x4913('0xa4'),_0xd1a2fb);}BPromise['resolve']()[_0x4913('0x37')](function(){if(!_0x393a28){if(_0xe0538f[_0x4913('0x55')][_0x4913('0xa5')])return;_0x3e5ea0['where'](_0x4913('0xa6'));_0x52032f[_0x4913('0x60')](_0x4913('0xa6'));return;}if(_0xe0538f['user'][_0x4913('0xa7')]!==_0x4913('0x3d'))return;return _0xe0538f[_0x4913('0xa8')][_0x4913('0xa9')]({'attributes':['id'],'raw':!![]})[_0x4913('0x37')](function(_0x2b309e){if(_['isEmpty'](_0x2b309e)){_0x3e5ea0[_0x4913('0x60')](_0x4913('0xaa'));_0x52032f['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3e5ea0['where'](_0x4913('0x8c'),_[_0x4913('0x40')](_0x2b309e,'id'));_0x52032f[_0x4913('0x60')](_0x4913('0x8c'),_[_0x4913('0x40')](_0x2b309e,'id'));}});})['then'](function(){if(_0xe0538f[_0x4913('0xa8')]['role']===_0x4913('0x3d')&&!_0x393a28&&!_0xe0538f[_0x4913('0x55')][_0x4913('0xa5')])return[];return db[_0x4913('0xab')][_0x4913('0x55')](_0x3e5ea0[_0x4913('0xac')](),_0x3ae1ce);})[_0x4913('0x37')](function(_0x4b4c69){_0x4526f0[_0x4913('0x33')]=_0x4b4c69[_0x4913('0x5b')];if(_0x4526f0['count']===0x0)return[];return db['sequelize']['query'](_0x542226[_0x4913('0xac')](),_0x3ae1ce)[_0x4913('0x37')](function(_0x42b719){_0x174f4a=_[_0x4913('0xad')](_0x42b719,'id');_0x3ae1ce=_[_0x4913('0x3c')](_0x3ae1ce,{'model':db[_0x4913('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe0538f['query'][_0x4913('0x5a')]){_0x525c7a[_0x4913('0x59')][_0x4913('0x45')](function(_0x21fc98){_0x52032f[_0x4913('0x62')]('i.'+_0x21fc98);});}else{_0x52032f[_0x4913('0x62')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4913('0xa3'));_0x52032f['field'](_0x4913('0xae'),_0x4913('0xaf'));_0x52032f[_0x4913('0x62')]('a.mandatoryDisposition',_0x4913('0xb0'));_0x52032f['field'](_0x4913('0xb1'),_0x4913('0xb2'));_0x52032f[_0x4913('0x62')](_0x4913('0xb3'));_0x52032f[_0x4913('0x62')]('c.firstName',_0x4913('0xb4'));_0x52032f[_0x4913('0x62')](_0x4913('0xb5'),_0x4913('0xb6'));_0x52032f[_0x4913('0x62')](_0x4913('0xb7'),_0x4913('0xb8'));_0x52032f[_0x4913('0x62')](_0x4913('0xb9'),'Contact.phone');_0x52032f[_0x4913('0x62')](_0x4913('0xba'),_0x4913('0xbb'));_0x52032f[_0x4913('0x62')]('c.fax','Contact.fax');_0x52032f[_0x4913('0x62')](_0x4913('0xbc'),'Owner.fullname');_0x52032f['field'](_0x4913('0xbd'),_0x4913('0xbe'));_0x52032f[_0x4913('0x62')](_0x4913('0xbf'),_0x4913('0x42'));}if(_0x525c7a[_0x4913('0x32')])_0x52032f[_0x4913('0x32')](_0x525c7a[_0x4913('0x32')]);if(_0x525c7a[_0x4913('0x30')])_0x52032f[_0x4913('0x30')](_0x525c7a[_0x4913('0x30')]);return db[_0x4913('0xab')][_0x4913('0x55')](_0x52032f[_0x4913('0xac')](),_0x3ae1ce);})[_0x4913('0x37')](function(_0x2a22cb){if(_0x2a22cb[_0x4913('0x5b')]>0x0)_0x4ff863[_0x4913('0x60')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x2a22cb,'id'));return db[_0x4913('0xab')][_0x4913('0x55')](_0x4ff863['toString'](),_0x3ae1ce)[_0x4913('0x37')](function(_0xd409a6){var _0x3b3c42=_[_0x4913('0xc0')](_0xd409a6,_0x4913('0xc1'));var _0x5a4cd7=[];_0x2a22cb[_0x4913('0x45')](function(_0x3fdc74){_0x5a4cd7[_0x4913('0xc2')](updateChatInteraction(_0x3fdc74,_0x174f4a,_0x3b3c42));});return BPromise[_0x4913('0xc3')](_0x5a4cd7);});});})['then'](function(_0x2345ea){_0x4526f0[_0x4913('0xc4')]=_0x2345ea;return _0x4526f0;})[_0x4913('0x37')](respondWithFilteredResult(_0x113a0a,_0x525c7a))['catch'](handleError(_0x113a0a,null));};exports['show']=function(_0x4dcc47,_0x5d277f){var _0x55aa={'raw':![],'where':{'id':_0x4dcc47[_0x4913('0xc5')]['id']}},_0x5a9f9a={};_0x5a9f9a[_0x4913('0x54')]=_[_0x4913('0x56')](db['ChatInteraction'][_0x4913('0xc6')]);_0x5a9f9a[_0x4913('0x55')]=_[_0x4913('0x56')](_0x4dcc47['query']);_0x5a9f9a['filters']=_['intersection'](_0x5a9f9a[_0x4913('0x54')],_0x5a9f9a[_0x4913('0x55')]);_0x55aa[_0x4913('0x59')]=_[_0x4913('0x58')](_0x5a9f9a[_0x4913('0x54')],qs[_0x4913('0x5a')](_0x4dcc47[_0x4913('0x55')][_0x4913('0x5a')]));_0x55aa[_0x4913('0x59')]=_0x55aa['attributes'][_0x4913('0x5b')]?_0x55aa[_0x4913('0x59')]:_0x5a9f9a['model'];if(_0x4dcc47[_0x4913('0x55')][_0x4913('0xc7')]){_0x55aa[_0x4913('0xc8')]=[{'all':!![]}];}_0x55aa=_['merge']({},_0x55aa,_0x4dcc47[_0x4913('0xc9')]);return db[_0x4913('0x50')][_0x4913('0x78')](_0x55aa)[_0x4913('0x37')](handleEntityNotFound(_0x5d277f,null))['then'](respondWithResult(_0x5d277f,null))[_0x4913('0x46')](handleError(_0x5d277f,null));};exports[_0x4913('0xca')]=function(_0x4e509b,_0x4abf13){return db[_0x4913('0x50')]['create'](_0x4e509b[_0x4913('0x8a')],{})[_0x4913('0x37')](respondWithResult(_0x4abf13,0xc9))['catch'](handleError(_0x4abf13,null));};exports[_0x4913('0xcb')]=function(_0x4c1b01,_0x4942ce){if(_0x4c1b01[_0x4913('0x8a')]['id']){delete _0x4c1b01[_0x4913('0x8a')]['id'];}return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0x4c1b01[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x4942ce,null))[_0x4913('0x37')](saveUpdates(_0x4c1b01['body'],null))['then'](respondWithResult(_0x4942ce,null))[_0x4913('0x46')](handleError(_0x4942ce,null));};exports['destroy']=function(_0xd48421,_0x101732){return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0xd48421[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x101732,null))[_0x4913('0x37')](removeEntity(_0x101732,null))[_0x4913('0x46')](handleError(_0x101732,null));};exports[_0x4913('0xcc')]=function(_0x28a72c,_0x189d11){return db[_0x4913('0x50')][_0x4913('0xcc')]()[_0x4913('0x37')](respondWithResult(_0x189d11,null))[_0x4913('0x46')](handleError(_0x189d11,null));};exports[_0x4913('0xcd')]=function(_0x1ec59e,_0x54a314){var _0x421a81=_0x1ec59e['params']['id'];var _0xd8f459;var _0x7d803a;var _0x30a777;return db[_0x4913('0x50')][_0x4913('0xce')]({'where':{'id':_0x421a81}})[_0x4913('0x37')](function(_0x2bef62){_0xd8f459=_0x2bef62;return db[_0x4913('0xcf')][_0x4913('0xce')]({'where':{'id':_0x2bef62['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x4913('0xd0'),_0x4913('0xd1'),'vidaooNote',_0x4913('0xd2')],'raw':!![]});})['then'](function(_0x2d6bf4){if(_0x2d6bf4&&_0x2d6bf4[_0x4913('0xd3')]&&_0x2d6bf4['vidaooEscalation']){_0x7d803a=_0x2d6bf4;var _0x1d839d={'interaction':{'id':_0x421a81},'agent':{'id':_0x1ec59e['user']['id'],'name':_0x1ec59e['user'][_0x4913('0x3a')],'fullname':_0x1ec59e[_0x4913('0xa8')][_0x4913('0x41')],'email':_0x1ec59e['user']['email']},'contact':_0x1ec59e['body'][_0x4913('0xd4')],'account':_0x1ec59e[_0x4913('0x8a')][_0x4913('0x3e')]};var _0x40b097={'rejectUnauthorized':![],'method':_0x4913('0xd5'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d6bf4[_0x4913('0xd3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ec59e['user']['email']],'buttons':null,'topic':_0x7d803a[_0x4913('0xd1')],'note':_[_0x4913('0xd6')](_0x7d803a[_0x4913('0xd7')])?null:getMustacheRender(_0x7d803a[_0x4913('0xd7')],_0x1d839d),'metadata':null},'redirect':_0x4913('0xd8'),'json':!![]};try{if(!_[_0x4913('0xd6')](_0x7d803a[_0x4913('0xd2')])){var _0x540f3e=getMustacheRender(_0x7d803a[_0x4913('0xd2')],_0x1d839d);var _0x4612af=JSON[_0x4913('0x8e')](_0x540f3e);_0x40b097[_0x4913('0x8a')]['metadata']=_0x4612af;}}catch(_0x2250ee){throw new db[(_0x4913('0xa0'))][(_0x4913('0xd9'))](_0x4913('0xda'));}return rp(_0x40b097);}else{throw new db['Sequelize']['ValidationError'](_0x4913('0xdb'));}})[_0x4913('0x37')](function(_0x33587a){_0x30a777=_0x33587a;if(_0x30a777['id']){var _0x1b3cf5={'body':_0x30a777[_0x4913('0xdc')],'ChatWebsiteId':_0x7d803a['id'],'ChatInteractionId':_0xd8f459['id'],'direction':_0x4913('0xdd'),'UserId':_0x1ec59e[_0x4913('0xa8')]['id']};return db[_0x4913('0xde')][_0x4913('0xca')](_0x1b3cf5,{});}else{throw new db['Sequelize'][(_0x4913('0xd9'))](_0x4913('0xdf'));}})['then'](function(){return _0xd8f459[_0x4913('0xe0')]({'vidaooSessionId':_0x30a777['id']});})['then'](respondWithResult(_0x54a314,null))['catch'](handleError(_0x54a314,null));};exports[_0x4913('0xe1')]=function(_0x3706e7,_0x246226){if(_0x3706e7[_0x4913('0x8a')]['id']){delete _0x3706e7[_0x4913('0x8a')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3706e7[_0x4913('0xc5')]['id']},'include':[{'model':db['CmContact'],'as':_0x4913('0xe2')}]})['then'](handleEntityNotFound(_0x246226,null))[_0x4913('0x37')](saveUpdates(_0x3706e7[_0x4913('0x8a')],null))[_0x4913('0x37')](respondWithResult(_0x246226,null))['catch'](handleError(_0x246226,null));};exports['abandon']=function(_0x4284d8,_0x4fdbb9,_0x13fd9a){if(_0x4284d8[_0x4913('0x8a')]['id']){delete _0x4284d8[_0x4913('0x8a')]['id'];}return db['ChatInteraction'][_0x4913('0x78')]({'where':{'id':_0x4284d8[_0x4913('0xc5')]['id']}})['then'](function(_0x4d329c){if(!_0x4d329c){logger[_0x4913('0x29')](_0x4913('0xe3'),'abandon',0x194,_0x4913('0xe4'));_0x4fdbb9[_0x4913('0x38')](0x194);}else{if(_0x4d329c[_0x4913('0x4d')]){throw new db['Sequelize'][(_0x4913('0xd9'))](_0x4913('0xe5'));}}return _0x4d329c;})[_0x4913('0x37')](function(_0x5b7c16){if(_0x5b7c16){return _0x5b7c16['update']({'closed':_0x4284d8[_0x4913('0x8a')][_0x4913('0x4c')],'disposition':_0x4284d8[_0x4913('0x8a')]['disposition']})[_0x4913('0x37')](function(_0x5aed53){return _0x5aed53;});}})['then'](function(_0x5a3ea8){return respondWithRpcPromise(_0x4913('0xe6'),_0x4913('0xe7'),_0x4284d8[_0x4913('0x8a')],client9004);})[_0x4913('0x37')](respondWithResult(_0x4fdbb9,null))[_0x4913('0x46')](handleError(_0x4fdbb9,null));};exports['attachmentUpload']=function(_0x3c95a7,_0x1f2ac7,_0x345507){_0x3c95a7[_0x4913('0x8a')][_0x4913('0x3a')]=_0x3c95a7[_0x4913('0xe8')][_0x4913('0xe9')];_0x3c95a7['body']['basename']=_0x3c95a7[_0x4913('0xe8')]['filename'];_0x3c95a7[_0x4913('0x8a')][_0x4913('0x52')]=_0x3c95a7['file'][_0x4913('0xea')];return db[_0x4913('0xeb')][_0x4913('0xca')](_0x3c95a7[_0x4913('0x8a')])['then'](respondWithResult(_0x1f2ac7,0xc9))[_0x4913('0x46')](handleError(_0x1f2ac7,null));};exports[_0x4913('0xec')]=function(_0x5ef5c9,_0x567f38,_0x37a067){return db[_0x4913('0x50')][_0x4913('0xce')]({'where':{'id':_0x5ef5c9[_0x4913('0xc5')]['id']},'raw':!![]})[_0x4913('0x37')](handleEntityNotFound(_0x567f38,null))[_0x4913('0x37')](function(_0xcc799c){if(_0xcc799c){if(_0xcc799c[_0x4913('0x4c')]){return _0x567f38[_0x4913('0x2d')](0x193)[_0x4913('0x2f')]({'status':0x193,'message':_0x4913('0xed')});}return db[_0x4913('0xeb')]['findOne']({'where':{'id':_0x5ef5c9[_0x4913('0x55')][_0x4913('0xee')]},'raw':!![]})['then'](handleEntityNotFound(_0x567f38,null));}})[_0x4913('0x37')](function(_0xd21764){if(_0xd21764){var _0x2d99f5=_0xd21764[_0x4913('0xef')]!==null;var _0x73f110=path['join'](config[_0x4913('0xf0')],'server/files/attachments/');if(_0x2d99f5){_0x73f110=path['join'](_0x73f110,_0x4913('0xf1'));}var _0x59226d=path['join'](_0x73f110,_0xd21764['basename']);return _0x567f38['download'](_0x59226d);}})[_0x4913('0x46')](handleError(_0x567f38,null));};exports[_0x4913('0xf2')]=function(_0x32ccd1,_0x14581d){var _0x10ec32=null;var _0x385972=null;var _0xe0ea68=null;var _0x71f5fd=null;if(_0x32ccd1[_0x4913('0x8a')]['id']){delete _0x32ccd1['body']['id'];}if(_0x32ccd1['body'][_0x4913('0xf3')]){_0x71f5fd=path[_0x4913('0xf4')](config['root'],_0x4913('0xf5'),util['format'](_0x4913('0xf6'),Date[_0x4913('0xf7')]()));_0x32ccd1['body'][_0x4913('0xf8')]=_0x71f5fd;}return db[_0x4913('0x50')]['find']({'where':{'id':_0x32ccd1[_0x4913('0xc5')]['id']},'include':[{'model':db[_0x4913('0xde')],'as':_0x4913('0xf9'),'include':[{'model':db[_0x4913('0x87')],'as':_0x4913('0x87')}]}]})['then'](handleEntityNotFound(_0x14581d,null))['then'](saveUpdates(_0x32ccd1[_0x4913('0x8a')],null))[_0x4913('0x37')](function(_0x15aca2){if(_0x15aca2){_0x10ec32=_0x15aca2;return db[_0x4913('0xcf')]['find']({'where':{'id':_0x10ec32[_0x4913('0xa5')]}});}})[_0x4913('0x37')](function(_0x496b91){if(_0x496b91){_0xe0ea68=_0x496b91;return db[_0x4913('0xfa')]['find']({'where':{'id':_0x10ec32[_0x4913('0x80')]}});}})[_0x4913('0x37')](function(_0x42ee00){if(_0x42ee00){_0x385972=_0x42ee00;if(_0x71f5fd){var _0x36b7fa=null;for(var _0x14436e=0x1;_0x14436e<_0x10ec32[_0x4913('0xf9')][_0x4913('0x5b')];++_0x14436e){_0x36b7fa=_0x10ec32[_0x4913('0xf9')][_0x14436e];var _0x298ca0=_0x36b7fa['UserId']?util[_0x4913('0xfb')](_0x4913('0xfc'),_0xe0ea68[_0x4913('0xfd')],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');var _0x5f00bf=_0x32ccd1[_0x4913('0x8a')][_0x4913('0xff')]||util[_0x4913('0xfb')]('%s%d',_0x4913('0x100'),_0x36b7fa[_0x4913('0x80')]);switch(_0xe0ea68['agentIdentifier']){case _0x4913('0x101'):_0x298ca0=_0x36b7fa['UserId']?util[_0x4913('0xfb')](_0x4913('0xfc'),_0xe0ea68[_0x4913('0xfd')],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');break;case'agent_alias':_0x298ca0=_0x36b7fa[_0x4913('0x4d')]?_0x36b7fa[_0x4913('0x87')][_0x4913('0x102')]||_0x36b7fa[_0x4913('0x87')]['fullname']:_0x4913('0xfe');break;case'agent_fullname':_0x298ca0=_0x36b7fa['UserId']?_0x36b7fa['User']['fullname']:_0x4913('0xfe');break;default:_0x298ca0=_0x36b7fa[_0x4913('0x4d')]?util['format'](_0x4913('0xfc'),_0xe0ea68['agentAlias'],_0x36b7fa[_0x4913('0x4d')]):_0x4913('0xfe');}var _0x4c70a7=util[_0x4913('0xfb')](_0x4913('0x103'),moment(_0x36b7fa[_0x4913('0x8d')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x36b7fa[_0x4913('0x104')]==='in'?_0x5f00bf:_0x298ca0,_0x36b7fa[_0x4913('0x8a')]);if(!_0x36b7fa['secret']){fs[_0x4913('0x105')](_0x71f5fd,_0x4c70a7);}}return db[_0x4913('0x106')][_0x4913('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x4913('0x107')],'as':'Smtp','raw':!![]}]});}}})[_0x4913('0x37')](function(_0xc2898b){if(_0xc2898b&&_0xc2898b[_0x4913('0x108')]&&_0x32ccd1[_0x4913('0x8a')]){var _0xf8676={'tls':{'rejectUnauthorized':![]}};if(_0xc2898b[_0x4913('0x108')][_0x4913('0x109')]){_0xf8676['service']=_0xc2898b['Smtp'][_0x4913('0x109')];}else{_0xf8676['host']=_0xc2898b[_0x4913('0x108')]['host'];_0xf8676[_0x4913('0x10a')]=_0xc2898b[_0x4913('0x108')]['port'];_0xf8676['secure']=_0xc2898b['Smtp'][_0x4913('0x10b')];}if(_0xc2898b[_0x4913('0x108')][_0x4913('0x10c')]){_0xf8676[_0x4913('0x10d')]={'user':_0xc2898b[_0x4913('0x108')][_0x4913('0xa8')],'pass':_0xc2898b['Smtp'][_0x4913('0x10e')]};}return respondWithRpcPromise(_0x4913('0x10f'),_0x4913('0x110'),{'account':_0xf8676,'message':{'from':util['format'](_0x4913('0x111'),_0xc2898b[_0x4913('0x3a')],_0xc2898b[_0x4913('0x112')]||_0xc2898b['Smtp']['user']),'to':_0x32ccd1[_0x4913('0x8a')][_0x4913('0xf3')],'subject':_0x4913('0x113'),'text':util[_0x4913('0xfb')](_0x4913('0x114'),_0x32ccd1[_0x4913('0x8a')]['mailTranscript']),'attachments':[{'path':_0x71f5fd}]}})[_0x4913('0x37')](function(){return _0x10ec32;})[_0x4913('0x46')](function(_0x47f51f){console[_0x4913('0x29')](_0x47f51f);});}else{return _0x10ec32;}})[_0x4913('0x37')](respondWithStatusCode(_0x14581d,0xc8))[_0x4913('0x46')](handleError(_0x14581d,null));};exports[_0x4913('0x115')]=function(_0x63f2e9,_0x1844bc,_0x499252){return db[_0x4913('0xde')][_0x4913('0x78')]({'where':{'id':_0x63f2e9[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x1844bc,null))[_0x4913('0x37')](function(_0x52b70e){if(_0x52b70e){return _0x52b70e[_0x4913('0x115')](_0x63f2e9[_0x4913('0x8a')][_0x4913('0x116')],_['omit'](_0x63f2e9[_0x4913('0x8a')],[_0x4913('0x116'),'id'])||{});}})[_0x4913('0x37')](respondWithResult(_0x1844bc,null))[_0x4913('0x46')](handleError(_0x1844bc,null));};exports['getMessages']=function(_0x338885,_0x58f957,_0xce57e){var _0x1479d2={'raw':![],'where':{}};var _0x17f31d={};var _0x1acf8a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4913('0xce')]({'where':{'id':_0x338885[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x58f957,null))[_0x4913('0x37')](function(_0x26ac42){if(_0x26ac42){_0x17f31d[_0x4913('0x54')]=_[_0x4913('0x56')](db[_0x4913('0xde')][_0x4913('0xc6')]);_0x17f31d[_0x4913('0x55')]=_[_0x4913('0x56')](_0x338885[_0x4913('0x55')]);_0x17f31d[_0x4913('0x57')]=_[_0x4913('0x58')](_0x17f31d['model'],_0x17f31d[_0x4913('0x55')]);_0x1479d2[_0x4913('0x59')]=_[_0x4913('0x58')](_0x17f31d['model'],qs[_0x4913('0x5a')](_0x338885[_0x4913('0x55')][_0x4913('0x5a')]));_0x1479d2[_0x4913('0x59')]=_0x1479d2[_0x4913('0x59')][_0x4913('0x5b')]?_0x1479d2[_0x4913('0x59')]:_0x17f31d[_0x4913('0x54')];if(!_0x338885[_0x4913('0x55')][_0x4913('0x5c')](_0x4913('0x5d'))){_0x1479d2[_0x4913('0x32')]=qs[_0x4913('0x32')](_0x338885[_0x4913('0x55')][_0x4913('0x32')]);_0x1479d2[_0x4913('0x30')]=qs[_0x4913('0x30')](_0x338885[_0x4913('0x55')]['offset']);}_0x1479d2['order']=qs['sort'](_0x338885[_0x4913('0x55')]['sort']);_0x1479d2['where']=qs[_0x4913('0x57')](_[_0x4913('0x61')](_0x338885['query'],_0x17f31d['filters']));_0x1479d2[_0x4913('0x60')][_0x4913('0xc1')]=_0x26ac42['id'];if(_0x338885[_0x4913('0x55')][_0x4913('0x99')]){_0x1479d2[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x1479d2[_0x4913('0x60')],{'$or':_[_0x4913('0x40')](_0x1479d2[_0x4913('0x59')],function(_0x1f082a){var _0x16d7b6={};_0x16d7b6[_0x1f082a]={'$like':'%'+_0x338885[_0x4913('0x55')][_0x4913('0x99')]+'%'};return _0x16d7b6;})});}if(_0x338885[_0x4913('0x55')][_0x4913('0x8f')]){var _0xc8bf57=_0x338885['query'][_0x4913('0x8f')][_0x4913('0x44')](',');var _0x5c3e27={};_0x5c3e27[_0xc8bf57[0x0]]={'$gte':moment(_0xc8bf57[0x1])[_0x4913('0xfb')](_0x4913('0x117'))};_0x1479d2[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x1479d2[_0x4913('0x60')],_0x5c3e27);}_0x1479d2=_[_0x4913('0x3c')]({},_0x1479d2,_0x338885[_0x4913('0xc9')]);return db[_0x4913('0xde')][_0x4913('0x33')]({'where':_0x1479d2[_0x4913('0x60')]})[_0x4913('0x37')](function(_0xba6218){_0x1acf8a[_0x4913('0x33')]=_0xba6218;if(_0x338885[_0x4913('0x55')]['includeAll']){_0x1479d2[_0x4913('0xc8')]=[{'all':!![]}];}return db[_0x4913('0xde')]['findAll'](_0x1479d2);})[_0x4913('0x37')](function(_0x5a6542){_0x1acf8a[_0x4913('0xc4')]=_0x5a6542;return _0x1acf8a;});}})[_0x4913('0x37')](respondWithFilteredResult(_0x58f957,_0x1479d2))['catch'](handleError(_0x58f957,null));};exports[_0x4913('0x118')]=function(_0x30c5fb,_0x4f0fb0,_0x372e6f){var _0x599721={'where':{}},_0x42fd66={},_0x29920={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4913('0xce')]({'where':{'id':_0x30c5fb[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x4f0fb0,null))['then'](function(_0x28e9a6){if(_0x28e9a6){_0x42fd66[_0x4913('0x54')]=_['keys'](db[_0x4913('0xde')][_0x4913('0xc6')]);_0x42fd66[_0x4913('0x55')]=_[_0x4913('0x56')](_0x30c5fb[_0x4913('0x55')]);_0x42fd66['filters']=_[_0x4913('0x58')](_0x42fd66['model'],_0x42fd66['query']);_0x599721[_0x4913('0x59')]=_['intersection'](_0x42fd66[_0x4913('0x54')],qs[_0x4913('0x5a')](_0x30c5fb[_0x4913('0x55')][_0x4913('0x5a')]));_0x599721[_0x4913('0x59')]=_0x599721[_0x4913('0x59')][_0x4913('0x5b')]?_0x599721[_0x4913('0x59')]:_0x42fd66['model'];if(!_0x30c5fb[_0x4913('0x55')][_0x4913('0x5c')](_0x4913('0x5d'))){_0x599721[_0x4913('0x32')]=qs['limit'](_0x30c5fb[_0x4913('0x55')]['limit']);_0x599721[_0x4913('0x30')]=qs['offset'](_0x30c5fb[_0x4913('0x55')]['offset']);}_0x599721['order']=qs[_0x4913('0x5f')](_0x30c5fb[_0x4913('0x55')][_0x4913('0x5f')]);_0x599721[_0x4913('0x60')]=qs[_0x4913('0x57')](_[_0x4913('0x61')](_0x30c5fb['query'],_0x42fd66[_0x4913('0x57')]));_0x599721['where']['ChatInteractionId']=_0x28e9a6['id'];if(_0x30c5fb[_0x4913('0x55')][_0x4913('0x99')]){_0x599721[_0x4913('0x60')]=_[_0x4913('0x3c')](_0x599721[_0x4913('0x60')],{'$or':_['map'](_0x599721['attributes'],function(_0x34a444){var _0x1e855c={};_0x1e855c[_0x34a444]={'$like':'%'+_0x30c5fb[_0x4913('0x55')]['filter']+'%'};return _0x1e855c;})});}_0x599721[_0x4913('0x60')][_0x4913('0x119')]=![];if(_0x30c5fb['query']['id']){_0x599721[_0x4913('0x60')]['id']={'$gt':_0x30c5fb['query']['id']};}_0x599721=_[_0x4913('0x3c')]({},_0x599721,_0x30c5fb[_0x4913('0xc9')]);return db['ChatMessage'][_0x4913('0x33')]({'where':_0x599721[_0x4913('0x60')]})[_0x4913('0x37')](function(_0x18399c){_0x29920[_0x4913('0x33')]=_0x18399c;_0x599721[_0x4913('0xc8')]=[];if(_0x30c5fb['query']['includeAgent']){_0x599721[_0x4913('0xc8')][_0x4913('0xc2')]({'model':db[_0x4913('0x87')],'as':_0x4913('0x87'),'attributes':['id',_0x4913('0x41'),'alias']});}if(_0x30c5fb[_0x4913('0x55')][_0x4913('0xc7')]){_0x599721[_0x4913('0xc8')]=[{'all':!![]}];}return db[_0x4913('0xde')][_0x4913('0x11a')](_0x599721);})[_0x4913('0x37')](function(_0xaa71b0){_0x29920[_0x4913('0xc4')]=_0xaa71b0;return _0x29920;});}})[_0x4913('0x37')](respondWithFilteredResult(_0x4f0fb0,_0x599721))['catch'](handleError(_0x4f0fb0,null));};exports[_0x4913('0x11b')]=function(_0x59b430,_0x47b483,_0x264fcc){return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x59b430['params']['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x47b483,null))[_0x4913('0x37')](function(_0x246d80){if(_0x246d80){return _0x246d80[_0x4913('0x11c')](_0x59b430[_0x4913('0x8a')][_0x4913('0x116')],_['omit'](_0x59b430[_0x4913('0x8a')],['ids','id'])||{})[_0x4913('0x11d')](function(){return db['Tag'][_0x4913('0x11a')]({'attributes':['id',_0x4913('0x3a'),_0x4913('0x63')],'where':{'id':_0x59b430[_0x4913('0x8a')][_0x4913('0x116')]}});})['then'](function(_0x5a9659){socket[_0x4913('0x11e')]('chatInteractionTags:save',{'id':Number(_0x59b430[_0x4913('0xc5')]['id']),'tags':_0x5a9659||[]});return{'id':Number(_0x59b430['params']['id']),'tags':_0x5a9659||[]};});}})[_0x4913('0x37')](respondWithResult(_0x47b483,null))['catch'](handleError(_0x47b483,null));};exports[_0x4913('0x11f')]=function(_0x3b7881,_0x5b541c,_0x35ec7a){return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x3b7881[_0x4913('0xc5')]['id']}})[_0x4913('0x37')](handleEntityNotFound(_0x5b541c,null))[_0x4913('0x37')](function(_0x49a556){if(_0x49a556){return _0x49a556['removeTags'](_0x3b7881[_0x4913('0x55')][_0x4913('0x116')]);}})[_0x4913('0x37')](respondWithStatusCode(_0x5b541c,null))[_0x4913('0x46')](handleError(_0x5b541c,null));};exports['download']=function(_0x558e18,_0x3c4d9d){var _0x3fac0f=moment()['unix']()[_0x4913('0xac')]();var _0xcf17a4=path[_0x4913('0xf4')](config[_0x4913('0xf0')],_0x4913('0x120'),_0x4913('0x121'),_0x4913('0x122'));var _0x52d7af=path[_0x4913('0xf4')](config['root'],'server','files',_0x4913('0x123'));var _0x1042f5=path[_0x4913('0xf4')](_0xcf17a4,_0x3fac0f);var _0x5d5600=util[_0x4913('0xfb')]('transcript-%d-%s.zip',_0x558e18['params']['id'],_0x3fac0f);var _0x190c93=path[_0x4913('0xf4')](_0xcf17a4,_0x5d5600);var _0x53d554=[];_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0x87')],'as':_0x4913('0x87'),'attributes':['id',_0x4913('0x41')],'raw':!![]});_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0xfa')],'as':_0x4913('0xe2'),'attributes':['id',_0x4913('0x124'),_0x4913('0x125')],'raw':!![]});if(_0x558e18['query']['attachments']){_0x53d554[_0x4913('0xc2')]({'model':db[_0x4913('0xeb')],'as':_0x4913('0xeb'),'raw':!![]});}var _0x2d44a4=[{'model':db[_0x4913('0xde')],'as':'Messages','attributes':['id',_0x4913('0x8a'),_0x4913('0x8d'),_0x4913('0x104'),_0x4913('0x119'),_0x4913('0x95')],'include':_0x53d554}];_0x2d44a4['push']({'model':db['ChatWebsite'],'as':_0x4913('0x126'),'attributes':['id',_0x4913('0x3a')]});_0x2d44a4['push']({'model':db[_0x4913('0x87')],'as':_0x4913('0x127'),'attributes':['id','fullname']});return db[_0x4913('0x50')][_0x4913('0x78')]({'where':{'id':_0x558e18[_0x4913('0xc5')]['id']},'include':_0x2d44a4})[_0x4913('0x37')](handleEntityNotFound(_0x3c4d9d,null))[_0x4913('0x37')](function(_0x428f39){if(_0x428f39){var _0x58168c=_0x428f39[_0x4913('0x128')]({'plain':!![]});fs[_0x4913('0x129')](_0x1042f5);var _0x18d7ad={'channel':_0x4913('0x12a'),'account':_0x58168c[_0x4913('0x126')][_0x4913('0x3a')],'agent':_0x58168c[_0x4913('0x127')]?_0x58168c[_0x4913('0x127')][_0x4913('0x41')]:_0x4913('0x12b'),'createdAt':moment(_0x58168c['createdAt'])[_0x4913('0xfb')](_0x4913('0x117'))[_0x4913('0xac')](),'closedAt':_0x58168c[_0x4913('0x4c')]?moment(_0x58168c['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4913('0xac')]():'','disposition':_0x58168c['disposition'],'chatInfo':{'browser':_0x58168c['browserName'],'os':_0x58168c[_0x4913('0x12c')],'referer':_0x58168c[_0x4913('0x12d')],'customerIp':_0x58168c[_0x4913('0x12e')],'customerPort':_0x58168c[_0x4913('0x12f')]?_0x58168c[_0x4913('0x12f')]:_0x4913('0x12b')},'messages':_(_0x58168c[_0x4913('0xf9')])['tail']()[_0x4913('0x99')]({'secret':![]})[_0x4913('0x40')](function(_0x4eae42){if(_0x4eae42[_0x4913('0xeb')]){var _0xdf8f8a=path[_0x4913('0xf4')](_0x52d7af,_0x4eae42[_0x4913('0xeb')][_0x4913('0x130')]);if(fs[_0x4913('0x131')](_0xdf8f8a)){fs[_0x4913('0x132')](_0xdf8f8a)[_0x4913('0x133')](fs[_0x4913('0x134')](path[_0x4913('0xf4')](_0x1042f5,_0x4eae42[_0x4913('0xeb')][_0x4913('0x130')])));}}return{'date':moment(_0x4eae42[_0x4913('0x8d')])[_0x4913('0xfb')](_0x4913('0x117'))[_0x4913('0xac')](),'sender':_0x4eae42[_0x4913('0x104')]===_0x4913('0xdd')?_0x4eae42[_0x4913('0x87')]?_0x4eae42[_0x4913('0x87')]['fullname']:_0x4913('0xfe'):_0x4eae42['Contact'][_0x4913('0x124')]+(_0x4eae42[_0x4913('0xe2')][_0x4913('0x125')]?'\x20'+_0x4eae42[_0x4913('0xe2')][_0x4913('0x125')]:''),'body':_0x4eae42['Attachment']?_0x4eae42[_0x4913('0xeb')]['basename']:_0x4eae42['body'],'direction':_0x4eae42[_0x4913('0x104')]===_0x4913('0xdd')?'A':'C','secret':_0x4eae42[_0x4913('0x119')],'read':_0x4eae42[_0x4913('0x95')],'attachment':_0x4eae42['Attachment']};})[_0x4913('0x79')]()};return ejs[_0x4913('0x135')](path[_0x4913('0xf4')](config[_0x4913('0xf0')],_0x4913('0x120'),_0x4913('0x136'),'downloadInteraction.ejs'),{'interaction':_0x18d7ad})[_0x4913('0x37')](function(_0x502246){var _0x386131=path[_0x4913('0xf4')](_0x1042f5,'transcript-'+_0x58168c['id']+'-'+_0x3fac0f+_0x4913('0x137'));var _0x3a519f={'path':_0x386131,'channel':_0x4913('0x12a'),'interactionId':_0x58168c['id']};return pdf[_0x4913('0x138')](_0x502246,_0x3a519f);})['then'](function(){return new BPromise(function(_0x35fa8a,_0x38f9df){zipdir(_0x1042f5,{'saveTo':_0x190c93},function(_0x2fab25,_0x5eb475){if(_0x2fab25)return _0x38f9df(_0x2fab25);return _0x35fa8a(_0x5eb475);});})[_0x4913('0x37')](function(){return new BPromise(function(_0xc09ed4,_0x48184c){rimraf(_0x1042f5,function(_0x1a4ec4){if(_0x1a4ec4)_0x48184c(_0x1a4ec4);return _0xc09ed4();});});})[_0x4913('0x37')](function(){return _0x3c4d9d[_0x4913('0x139')](_0x190c93,_0x5d5600,function(_0x10543d){if(_0x10543d){console['log'](_0x4913('0x13a'),_0x10543d);}else{fs[_0x4913('0x13b')](_0x190c93);}});});});}else{return _0x3c4d9d[_0x4913('0x38')](0xc8);}})['catch'](handleError(_0x3c4d9d,null));};
\ No newline at end of file
+var _0x9980=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','sendStatus','stack','name','send','render','merge','body','contact','agent','account','fullname','TagIds','Tags','split','forEach','push','waiting','abandoned','total','closed','UserId','talking','disposition','answered','index','map','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','$substring','text','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','isNull','vidaooNote','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','AbandonInteraction','file','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','format','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','ids','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','addTags','setTags','omit','spread','color','emit','removeTags','unix','server','files','tmp','firstName','lastName','Account','Owner','get','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash'];(function(_0x54d8bc,_0x18e265){var _0x4bb5e4=function(_0x50ed03){while(--_0x50ed03){_0x54d8bc['push'](_0x54d8bc['shift']());}};_0x4bb5e4(++_0x18e265);}(_0x9980,0x125));var _0x0998=function(_0x552b9f,_0x544356){_0x552b9f=_0x552b9f-0x0;var _0x23ddef=_0x9980[_0x552b9f];return _0x23ddef;};'use strict';var emlformat=require(_0x0998('0x0'));var rimraf=require(_0x0998('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0998('0x2'));var rp=require(_0x0998('0x3'));var moment=require(_0x0998('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0998('0x5'));var path=require(_0x0998('0x6'));var sox=require(_0x0998('0x7'));var csv=require(_0x0998('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0998('0x9'));var squel=require(_0x0998('0xa'));var crypto=require(_0x0998('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0998('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0998('0xd'));var Papa=require(_0x0998('0xe'));var Redis=require(_0x0998('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0998('0x10'));var as=require(_0x0998('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0998('0x12'))(_0x0998('0x13'));var utils=require(_0x0998('0x14'));var config=require(_0x0998('0x15'));var licenseUtil=require(_0x0998('0x16'));var db=require(_0x0998('0x17'))['db'];config[_0x0998('0x18')]=_['defaults'](config[_0x0998('0x18')],{'host':_0x0998('0x19'),'port':0x18eb});var socket=require(_0x0998('0x1a'))(new Redis(config[_0x0998('0x18')]));require(_0x0998('0x1b'))['register'](socket);var jayson=require(_0x0998('0x1c'));var client=jayson[_0x0998('0x1d')]['http']({'port':0x232b});var client9004=jayson['client'][_0x0998('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x23c7ab,_0x3c5958,_0x57c28b,_0x2e6ea8){return new BPromise(function(_0x4329e0,_0xb97bfd){var _0x23b7d2=_0x2e6ea8||client;return _0x23b7d2['request'](_0x23c7ab,_0x57c28b)[_0x0998('0x1f')](function(_0x8f8832){logger['info'](_0x0998('0x20'),_0x3c5958,_0x0998('0x21'));logger[_0x0998('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3c5958,_0x0998('0x21'),JSON[_0x0998('0x23')](_0x8f8832));if(_0x8f8832[_0x0998('0x24')]){if(_0x8f8832[_0x0998('0x24')][_0x0998('0x25')]===0x1f4){logger['error'](_0x0998('0x20'),_0x3c5958,_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);return _0xb97bfd(_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);}logger[_0x0998('0x24')](_0x0998('0x20'),_0x3c5958,_0x8f8832['error'][_0x0998('0x26')]);return _0x4329e0(_0x8f8832[_0x0998('0x24')][_0x0998('0x26')]);}else{logger[_0x0998('0x27')](_0x0998('0x20'),_0x3c5958,'request\x20sent');_0x4329e0(_0x8f8832[_0x0998('0x28')][_0x0998('0x26')]);}})[_0x0998('0x29')](function(_0xaa3ac0){logger[_0x0998('0x24')](_0x0998('0x20'),_0x3c5958,_0xaa3ac0);_0xb97bfd(_0xaa3ac0);});});}function respondWithStatusCode(_0x5ae698,_0x2dee11){_0x2dee11=_0x2dee11||0xcc;return function(_0x5320ac){if(_0x5320ac){return _0x5ae698['sendStatus'](_0x2dee11);}return _0x5ae698[_0x0998('0x2a')](_0x2dee11)[_0x0998('0x2b')]();};}function respondWithResult(_0x14bef1,_0xa2e7fc){_0xa2e7fc=_0xa2e7fc||0xc8;return function(_0x15591e){if(_0x15591e){return _0x14bef1[_0x0998('0x2a')](_0xa2e7fc)[_0x0998('0x2c')](_0x15591e);}};}function respondWithFilteredResult(_0x2ece55,_0x5e207b){return function(_0x507d8e){if(_0x507d8e){var _0x10464a=typeof _0x5e207b[_0x0998('0x2d')]===_0x0998('0x2e')&&typeof _0x5e207b['limit']===_0x0998('0x2e');var _0x561897=_0x507d8e['count'];var _0x4eecbf=_0x10464a?0x0:_0x5e207b[_0x0998('0x2d')];var _0x2225d3=_0x10464a?_0x507d8e[_0x0998('0x2f')]:_0x5e207b[_0x0998('0x2d')]+_0x5e207b[_0x0998('0x30')];var _0x3b1f71;if(_0x2225d3>=_0x561897){_0x2225d3=_0x561897;_0x3b1f71=0xc8;}else{_0x3b1f71=0xce;}_0x2ece55[_0x0998('0x2a')](_0x3b1f71);return _0x2ece55['set']('Content-Range',_0x4eecbf+'-'+_0x2225d3+'/'+_0x561897)['json'](_0x507d8e);}return null;};}function patchUpdates(_0x424186){return function(_0x1ead2c){try{jsonpatch[_0x0998('0x31')](_0x1ead2c,_0x424186,!![]);}catch(_0x43e069){return BPromise[_0x0998('0x32')](_0x43e069);}return _0x1ead2c[_0x0998('0x33')]();};}function saveUpdates(_0x222c37,_0x2b5b52){return function(_0x68c5ef){if(_0x68c5ef){return _0x68c5ef[_0x0998('0x34')](_0x222c37)[_0x0998('0x1f')](function(_0x3f51e0){return _0x3f51e0;});}return null;};}function removeEntity(_0x349c21,_0x146b17){return function(_0x4ce0b9){if(_0x4ce0b9){return _0x4ce0b9[_0x0998('0x35')]()[_0x0998('0x1f')](function(){_0x349c21[_0x0998('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5d8f,_0x2b2232){return function(_0x167ade){if(!_0x167ade){_0x4b5d8f[_0x0998('0x36')](0x194);}return _0x167ade;};}function handleError(_0x422da2,_0xab90db){_0xab90db=_0xab90db||0x1f4;return function(_0x50afc7){logger['error'](_0x50afc7[_0x0998('0x37')]);if(_0x50afc7[_0x0998('0x38')]){delete _0x50afc7['name'];}_0x422da2['status'](_0xab90db)[_0x0998('0x39')](_0x50afc7);};}function getMustacheRender(_0x576111,_0x326cda){return Mustache[_0x0998('0x3a')](_0x576111,_[_0x0998('0x3b')](_0x326cda[_0x0998('0x3c')],{'contact':_0x326cda[_0x0998('0x3d')],'message':_0x326cda[_0x0998('0x26')],'agent':_0x326cda[_0x0998('0x3e')],'interaction':_0x326cda['interaction'],'account':_0x326cda[_0x0998('0x3f')]}))||'';}function getInteractionUsers(_0xbbfb3,_0x47d9f7){return new BPromise(function(_0x4ec41f,_0x17414e){try{if(_0x47d9f7[_0xbbfb3['id']]){_0xbbfb3['Users']=_['map'](_0x47d9f7[_0xbbfb3['id']],function(_0x1055e7){return{'id':_0x1055e7['id'],'fullname':_0x1055e7[_0x0998('0x40')]};});}}catch(_0x5ba3e6){_0x17414e(_0x5ba3e6);}_0x4ec41f(_0xbbfb3);});}function getInteractionTags(_0x20adc9,_0x1fb89a){return new BPromise(function(_0x1d4f68,_0x174419){try{if(_0x20adc9[_0x0998('0x41')]){_0x20adc9[_0x0998('0x42')]=[];_0x20adc9[_0x0998('0x41')][_0x0998('0x43')](',')[_0x0998('0x44')](function(_0x58349e){_0x20adc9[_0x0998('0x42')][_0x0998('0x45')](_0x1fb89a[_0x58349e]);});}delete _0x20adc9['TagIds'];}catch(_0x174b2b){_0x174419(_0x174b2b);}_0x1d4f68(_0x20adc9);});}function updateChatInteraction(_0x27f35e,_0x143754,_0x49d206){return new BPromise(function(_0x5a623e,_0x1346b0){return getInteractionUsers(_0x27f35e,_0x49d206)['then'](function(_0x235212){return getInteractionTags(_0x235212,_0x143754);})[_0x0998('0x1f')](function(_0x22bea4){return getStateInteraction(_0x22bea4);})[_0x0998('0x1f')](function(_0x389641){_0x5a623e(_0x389641);})['catch'](function(_0x313625){_0x1346b0(_0x313625);});});}function getStateInteraction(_0x59b41c){return new BPromise(function(_0x48b27d){_0x59b41c[_0x0998('0x46')]=0x0;_0x59b41c['talking']=0x0;_0x59b41c['answered']=0x0;_0x59b41c['unmanaged']=0x0;_0x59b41c[_0x0998('0x47')]=0x0;_0x59b41c[_0x0998('0x48')]=0x0;if(!_0x59b41c[_0x0998('0x49')]&&!_0x59b41c[_0x0998('0x4a')]){_0x59b41c[_0x0998('0x46')]+=0x1;}if(!_0x59b41c['closed']&&_0x59b41c[_0x0998('0x4a')]){_0x59b41c[_0x0998('0x4b')]+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}if(_0x59b41c['closed']&&_0x59b41c['disposition']==='abandoned'){_0x59b41c[_0x0998('0x47')]+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}else if(_0x59b41c['closed']&&!_0x59b41c[_0x0998('0x4a')]&&_0x59b41c[_0x0998('0x4c')]){_0x59b41c['unmanaged']+=0x1;if(_0x59b41c[_0x0998('0x46')]){_0x59b41c['waiting']-=0x1;}}else if(_0x59b41c[_0x0998('0x49')]&&_0x59b41c['UserId']){_0x59b41c[_0x0998('0x4d')]+=0x1;if(_0x59b41c[_0x0998('0x4b')]){_0x59b41c[_0x0998('0x4b')]-=0x1;}}_0x59b41c['total']+=0x1;_0x48b27d(_0x59b41c);});}exports[_0x0998('0x4e')]=function(_0x6402dd,_0x3eefe4){var _0x2c83c8={},_0x3ae478={},_0x28b1bd={'count':0x0,'rows':[]};var _0x3a87e1=_[_0x0998('0x4f')](db[_0x0998('0x50')]['rawAttributes'],function(_0x29d233){return{'name':_0x29d233[_0x0998('0x51')],'type':_0x29d233[_0x0998('0x52')][_0x0998('0x53')]};});_0x3ae478[_0x0998('0x54')]=_[_0x0998('0x4f')](_0x3a87e1,_0x0998('0x38'));_0x3ae478[_0x0998('0x55')]=_[_0x0998('0x56')](_0x6402dd[_0x0998('0x55')]);_0x3ae478[_0x0998('0x57')]=_[_0x0998('0x58')](_0x3ae478[_0x0998('0x54')],_0x3ae478[_0x0998('0x55')]);_0x2c83c8[_0x0998('0x59')]=_[_0x0998('0x58')](_0x3ae478[_0x0998('0x54')],qs[_0x0998('0x5a')](_0x6402dd[_0x0998('0x55')]['fields']));_0x2c83c8[_0x0998('0x59')]=_0x2c83c8[_0x0998('0x59')][_0x0998('0x5b')]?_0x2c83c8[_0x0998('0x59')]:_0x3ae478[_0x0998('0x54')];if(!_0x6402dd[_0x0998('0x55')][_0x0998('0x5c')](_0x0998('0x5d'))){_0x2c83c8[_0x0998('0x30')]=qs[_0x0998('0x30')](_0x6402dd[_0x0998('0x55')][_0x0998('0x30')]);_0x2c83c8[_0x0998('0x2d')]=qs[_0x0998('0x2d')](_0x6402dd[_0x0998('0x55')][_0x0998('0x2d')]);}_0x2c83c8[_0x0998('0x5e')]=qs[_0x0998('0x5f')](_0x6402dd['query'][_0x0998('0x5f')]);_0x2c83c8[_0x0998('0x60')]=qs[_0x0998('0x57')](_[_0x0998('0x61')](_0x6402dd[_0x0998('0x55')],_0x3ae478[_0x0998('0x57')]),_0x3a87e1);var _0x5ecddb=[];var _0x5e92f3=squel[_0x0998('0x62')]()[_0x0998('0x63')]('id')[_0x0998('0x63')](_0x0998('0x38'))['field']('color')[_0x0998('0x64')](_0x0998('0x65'));var _0x2ca200=squel[_0x0998('0x62')]()['field'](_0x0998('0x66'))[_0x0998('0x63')](_0x0998('0x67'))[_0x0998('0x63')](_0x0998('0x68'))[_0x0998('0x64')]('user_has_chat_interactions','ui')[_0x0998('0x69')](_0x0998('0x6a'),'u',_0x0998('0x6b'));var _0x2d6044=squel[_0x0998('0x62')]()[_0x0998('0x64')](_0x0998('0x6c'),'i')['left_join'](_0x0998('0x6d'),'c',_0x0998('0x6e'))[_0x0998('0x69')](_0x0998('0x6a'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0x0998('0x6f'))[_0x0998('0x69')](_0x0998('0x70'),'me',_0x0998('0x71'))[_0x0998('0x69')]('chat_interaction_has_tags','it',_0x0998('0x72'))[_0x0998('0x69')]('tools_tags','t',_0x0998('0x73'));var _0x45a4cb=squel[_0x0998('0x74')]();var _0x29164b=[];var _0x32b878=squel[_0x0998('0x74')]();var _0x5435e9;if(_0x6402dd['query'][_0x0998('0x75')]){_0x5435e9=as[_0x0998('0x76')](_0x6402dd[_0x0998('0x55')][_0x0998('0x75')]);var _0x26e8af=_0x5435e9['sqlOperator'];for(var _0x1caaa6=0x0;_0x1caaa6<_0x5435e9['conditions'][_0x0998('0x5b')];_0x1caaa6++){var _0x56afa6=_0x5435e9['conditions'][_0x1caaa6];var _0x2b115c='i';var _0x44497d=_[_0x0998('0x77')](_0x3a87e1,[_0x0998('0x38'),_0x56afa6[_0x0998('0x63')]]);if(!_0x44497d){switch(_0x56afa6[_0x0998('0x63')]){case _0x0998('0x78'):if(_0x56afa6[_0x0998('0x79')]==0x1){_0x2d6044['having']('`'+_0x56afa6[_0x0998('0x63')]+_0x0998('0x7a'));}else{_0x2d6044[_0x0998('0x7b')]('`'+_0x56afa6[_0x0998('0x63')]+_0x0998('0x7c'));}break;case _0x0998('0x7d'):if(_0x56afa6[_0x0998('0x7e')]==='$substring'){if(_0x56afa6[_0x0998('0x79')]['split']('\x20')[_0x0998('0x5b')]>0x1){_0x45a4cb[_0x26e8af](_0x0998('0x7f'),qs[_0x0998('0x80')](_0x56afa6[_0x0998('0x79')]),null);}else{var _0x18771b='%'+_0x56afa6['value']+'%';_0x45a4cb[_0x26e8af](_0x0998('0x81'),_0x18771b,_0x18771b,_0x18771b);}}else{_0x44497d=_[_0x0998('0x77')](_0x3a87e1,['name','ContactId']);_0x56afa6['field']=_0x0998('0x82');_0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3['text'],_0x51c7c3[_0x0998('0x79')][_0x0998('0x84')],_0x51c7c3[_0x0998('0x79')][_0x0998('0x2b')]);}break;case _0x0998('0x85'):var _0x33a186=_0x56afa6[_0x0998('0x79')][_0x0998('0x43')](',')[_0x0998('0x4f')](function(_0x578ccf){return Number(_0x578ccf);});_0x33a186['forEach'](function(_0x265ad3){_0x32b878['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x265ad3+',%');});_0x29164b=_['union'](_0x29164b,_0x33a186);break;case'User':if(_0x56afa6['operator']===_0x0998('0x86')){_0x45a4cb[_0x26e8af]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x56afa6[_0x0998('0x79')]+'%',null);}else{_0x44497d=_['find'](_0x3a87e1,[_0x0998('0x38'),_0x0998('0x4a')]);_0x56afa6[_0x0998('0x63')]=_0x0998('0x4a');_0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3[_0x0998('0x79')]['start'],_0x51c7c3[_0x0998('0x79')]['end']);}break;case'body':_0x51c7c3=as[_0x0998('0x83')]('me',null,_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3[_0x0998('0x79')]['start'],_0x51c7c3[_0x0998('0x79')][_0x0998('0x2b')]);break;}}else{var _0x51c7c3=as[_0x0998('0x83')](_0x2b115c,_0x44497d[_0x0998('0x52')],_0x56afa6);_0x45a4cb[_0x26e8af](_0x51c7c3[_0x0998('0x87')],_0x51c7c3['value'][_0x0998('0x84')],_0x51c7c3['value'][_0x0998('0x2b')]);}}}else{var _0x92b5b4=_(_0x6402dd[_0x0998('0x55')])[_0x0998('0x56')]()[_0x0998('0x4f')](function(_0x1749cf){return _[_0x0998('0x88')](_0x3a87e1,['name',_0x1749cf])?_0x1749cf:undefined;})[_0x0998('0x89')]()[_0x0998('0x79')]();if(!_[_0x0998('0x8a')](_0x92b5b4)){_0x92b5b4['forEach'](function(_0x305347){if(_0x305347==='ChatWebsiteId'){_0x2d6044['where'](_0x0998('0x8b'),[][_0x0998('0x8c')](_0x6402dd[_0x0998('0x55')][_0x305347]));}else if(_0x305347===_0x0998('0x8d')){var _0x19b259=JSON[_0x0998('0x8e')](_0x6402dd[_0x0998('0x55')][_0x305347])['$gte'];var _0x4fcc5b=JSON[_0x0998('0x8e')](_0x6402dd['query'][_0x305347])['$lte'];_0x2d6044[_0x0998('0x60')](_0x0998('0x8f'),_0x19b259,_0x4fcc5b);}else{if(_0x6402dd[_0x0998('0x55')][_0x305347]===_0x0998('0x90')){_0x2d6044[_0x0998('0x60')]('i.'+_0x305347+_0x0998('0x91'));}else{_0x2d6044[_0x0998('0x60')]('i.'+_0x305347+_0x0998('0x92'),_0x6402dd[_0x0998('0x55')][_0x305347]);}}});}if(_0x6402dd[_0x0998('0x55')][_0x0998('0x93')]){if(_0x6402dd[_0x0998('0x55')][_0x0998('0x93')]==0x1){_0x2d6044[_0x0998('0x7b')]('`unreadMessages`\x20=\x200');}else{_0x2d6044['having'](_0x0998('0x94'));}}if(_0x6402dd[_0x0998('0x55')][_0x0998('0x95')]){_0x29164b=_['isArray'](_0x6402dd['query'][_0x0998('0x95')])?_0x6402dd['query'][_0x0998('0x95')]:new Array(_0x6402dd[_0x0998('0x55')][_0x0998('0x95')]);_0x29164b[_0x0998('0x44')](function(_0x19887d){_0x32b878['or'](_0x0998('0x96'),'%,'+_0x19887d+',%');});}if(_0x6402dd['query'][_0x0998('0x97')]){var _0x162b38=_0x6402dd[_0x0998('0x55')][_0x0998('0x97')][_0x0998('0x98')]('\x5c','\x5c\x5c')[_0x0998('0x98')](/'/g,'\x27\x27');if(qs[_0x0998('0x99')](_0x162b38)){_0x45a4cb['or'](_0x0998('0x9a'),_0x162b38+'%');}else{_0x45a4cb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0998('0x80')](_0x162b38))['or'](_0x0998('0x9b'),_0x162b38+'%');}}}_0x2d6044['where'](_0x45a4cb);_0x2d6044[_0x0998('0x9c')](_0x0998('0x9d'));var _0x335498={'type':db[_0x0998('0x9e')][_0x0998('0x9f')][_0x0998('0xa0')],'raw':!![]};var _0x5eac63=_0x2d6044[_0x0998('0xa1')]();_0x5eac63[_0x0998('0x63')](_0x0998('0x9d'));_0x5eac63[_0x0998('0x63')](_0x0998('0xa2'),'unreadMessages');if(_0x2c83c8[_0x0998('0x5e')]){_0x2c83c8[_0x0998('0x5e')][_0x0998('0x44')](function(_0x5e6cce){var _0x283df8=_0x5e6cce[0x0]===_0x0998('0xa3')?_0x5e6cce[0x0]:'i.'+_0x5e6cce[0x0];_0x2d6044['order'](_0x283df8,_0x5e6cce[0x1]===_0x0998('0xa4')?![]:!![]);});}if(!_['isEmpty'](_0x29164b)){_0x2d6044[_0x0998('0x7b')](_0x32b878);_0x5eac63[_0x0998('0x60')]('t.id\x20IN\x20?',_0x29164b);}BPromise['resolve']()[_0x0998('0x1f')](function(){if(!_0x5435e9){if(_0x6402dd[_0x0998('0x55')][_0x0998('0xa5')])return;_0x5eac63[_0x0998('0x60')](_0x0998('0xa6'));_0x2d6044[_0x0998('0x60')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x6402dd[_0x0998('0xa7')]['role']!==_0x0998('0x3e'))return;return _0x6402dd[_0x0998('0xa7')][_0x0998('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9f662e){if(_[_0x0998('0x8a')](_0x9f662e)){_0x5eac63[_0x0998('0x60')](_0x0998('0xa9'));_0x2d6044[_0x0998('0x60')](_0x0998('0xa9'));}else{_0x5eac63['where'](_0x0998('0x8b'),_[_0x0998('0x4f')](_0x9f662e,'id'));_0x2d6044['where'](_0x0998('0x8b'),_[_0x0998('0x4f')](_0x9f662e,'id'));}});})[_0x0998('0x1f')](function(){if(_0x6402dd[_0x0998('0xa7')][_0x0998('0xaa')]==='agent'&&!_0x5435e9&&!_0x6402dd[_0x0998('0x55')][_0x0998('0xa5')])return[];return db[_0x0998('0xab')]['query'](_0x5eac63[_0x0998('0xac')](),_0x335498);})['then'](function(_0x1bcdb7){_0x28b1bd[_0x0998('0x2f')]=_0x1bcdb7[_0x0998('0x5b')];if(_0x28b1bd[_0x0998('0x2f')]===0x0)return[];return db[_0x0998('0xab')][_0x0998('0x55')](_0x5e92f3['toString'](),_0x335498)[_0x0998('0x1f')](function(_0x3ee33f){_0x5ecddb=_[_0x0998('0xad')](_0x3ee33f,'id');_0x335498=_[_0x0998('0x3b')](_0x335498,{'model':db[_0x0998('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6402dd[_0x0998('0x55')]['fields']){_0x2c83c8[_0x0998('0x59')][_0x0998('0x44')](function(_0x393aad){_0x2d6044[_0x0998('0x63')]('i.'+_0x393aad);});}else{_0x2d6044[_0x0998('0x63')](_0x0998('0xa2'),_0x0998('0x78'));_0x2d6044[_0x0998('0x63')]('a.key','Account.key');_0x2d6044[_0x0998('0x63')]('a.mandatoryDisposition',_0x0998('0xae'));_0x2d6044[_0x0998('0x63')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2d6044[_0x0998('0x63')]('i.*');_0x2d6044[_0x0998('0x63')](_0x0998('0xaf'),_0x0998('0xb0'));_0x2d6044[_0x0998('0x63')](_0x0998('0xb1'),'Contact.lastName');_0x2d6044['field']('c.email','Contact.email');_0x2d6044[_0x0998('0x63')](_0x0998('0xb2'),'Contact.phone');_0x2d6044['field'](_0x0998('0xb3'),_0x0998('0xb4'));_0x2d6044[_0x0998('0x63')]('c.fax',_0x0998('0xb5'));_0x2d6044[_0x0998('0x63')]('o.fullname','Owner.fullname');_0x2d6044[_0x0998('0x63')](_0x0998('0xb6'),_0x0998('0xb7'));_0x2d6044[_0x0998('0x63')](_0x0998('0xb8'),_0x0998('0x41'));}if(_0x2c83c8['limit'])_0x2d6044['limit'](_0x2c83c8[_0x0998('0x30')]);if(_0x2c83c8[_0x0998('0x2d')])_0x2d6044[_0x0998('0x2d')](_0x2c83c8[_0x0998('0x2d')]);return db[_0x0998('0xab')]['query'](_0x2d6044[_0x0998('0xac')](),_0x335498);})[_0x0998('0x1f')](function(_0xc18718){if(_0xc18718[_0x0998('0x5b')]>0x0)_0x2ca200[_0x0998('0x60')](_0x0998('0xb9'),_['map'](_0xc18718,'id'));return db[_0x0998('0xab')][_0x0998('0x55')](_0x2ca200[_0x0998('0xac')](),_0x335498)[_0x0998('0x1f')](function(_0x21ed99){var _0x26036c=_[_0x0998('0xba')](_0x21ed99,'ChatInteractionId');var _0x2e03b4=[];_0xc18718[_0x0998('0x44')](function(_0x4e4800){_0x2e03b4[_0x0998('0x45')](updateChatInteraction(_0x4e4800,_0x5ecddb,_0x26036c));});return BPromise[_0x0998('0xbb')](_0x2e03b4);});});})[_0x0998('0x1f')](function(_0x5a19bf){_0x28b1bd[_0x0998('0xbc')]=_0x5a19bf;return _0x28b1bd;})['then'](respondWithFilteredResult(_0x3eefe4,_0x2c83c8))[_0x0998('0x29')](handleError(_0x3eefe4,null));};exports['show']=function(_0x4bd3ac,_0x5378a6){var _0x20457={'raw':![],'where':{'id':_0x4bd3ac[_0x0998('0xbd')]['id']}},_0x5cbd8b={};_0x5cbd8b[_0x0998('0x54')]=_[_0x0998('0x56')](db[_0x0998('0x50')][_0x0998('0xbe')]);_0x5cbd8b[_0x0998('0x55')]=_['keys'](_0x4bd3ac['query']);_0x5cbd8b[_0x0998('0x57')]=_[_0x0998('0x58')](_0x5cbd8b[_0x0998('0x54')],_0x5cbd8b['query']);_0x20457[_0x0998('0x59')]=_['intersection'](_0x5cbd8b['model'],qs[_0x0998('0x5a')](_0x4bd3ac[_0x0998('0x55')]['fields']));_0x20457[_0x0998('0x59')]=_0x20457[_0x0998('0x59')][_0x0998('0x5b')]?_0x20457['attributes']:_0x5cbd8b[_0x0998('0x54')];if(_0x4bd3ac[_0x0998('0x55')][_0x0998('0xbf')]){_0x20457[_0x0998('0xc0')]=[{'all':!![]}];}_0x20457=_[_0x0998('0x3b')]({},_0x20457,_0x4bd3ac[_0x0998('0xc1')]);return db['ChatInteraction'][_0x0998('0x77')](_0x20457)[_0x0998('0x1f')](handleEntityNotFound(_0x5378a6,null))[_0x0998('0x1f')](respondWithResult(_0x5378a6,null))[_0x0998('0x29')](handleError(_0x5378a6,null));};exports[_0x0998('0xc2')]=function(_0x2a3a84,_0x3460a4){return db['ChatInteraction'][_0x0998('0xc2')](_0x2a3a84[_0x0998('0x3c')],{})[_0x0998('0x1f')](respondWithResult(_0x3460a4,0xc9))[_0x0998('0x29')](handleError(_0x3460a4,null));};exports[_0x0998('0x34')]=function(_0x1fc2ca,_0x5e1eb8){if(_0x1fc2ca[_0x0998('0x3c')]['id']){delete _0x1fc2ca[_0x0998('0x3c')]['id'];}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x1fc2ca[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x5e1eb8,null))[_0x0998('0x1f')](saveUpdates(_0x1fc2ca[_0x0998('0x3c')],null))['then'](respondWithResult(_0x5e1eb8,null))[_0x0998('0x29')](handleError(_0x5e1eb8,null));};exports[_0x0998('0x35')]=function(_0x1531d9,_0x338230){return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x1531d9[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x338230,null))[_0x0998('0x1f')](removeEntity(_0x338230,null))[_0x0998('0x29')](handleError(_0x338230,null));};exports[_0x0998('0xc3')]=function(_0x222aaf,_0x38e29b){return db[_0x0998('0x50')][_0x0998('0xc3')]()[_0x0998('0x1f')](respondWithResult(_0x38e29b,null))['catch'](handleError(_0x38e29b,null));};exports[_0x0998('0xc4')]=function(_0x5e24b6,_0x254f56){var _0x5b5d6f=_0x5e24b6[_0x0998('0xbd')]['id'];var _0x3d8f33;var _0x4b840f;var _0x5cb847;return db[_0x0998('0x50')]['findOne']({'where':{'id':_0x5b5d6f}})[_0x0998('0x1f')](function(_0x4a1f32){_0x3d8f33=_0x4a1f32;return db[_0x0998('0xc5')][_0x0998('0xc6')]({'where':{'id':_0x4a1f32[_0x0998('0xa5')]},'attributes':['id',_0x0998('0xc7'),_0x0998('0xc8'),_0x0998('0xc9'),'vidaooNote',_0x0998('0xca')],'raw':!![]});})[_0x0998('0x1f')](function(_0x4900e5){if(_0x4900e5&&_0x4900e5[_0x0998('0xc7')]&&_0x4900e5[_0x0998('0xc8')]){_0x4b840f=_0x4900e5;var _0x3d1a3d={'interaction':{'id':_0x5b5d6f},'agent':{'id':_0x5e24b6['user']['id'],'name':_0x5e24b6[_0x0998('0xa7')][_0x0998('0x38')],'fullname':_0x5e24b6[_0x0998('0xa7')][_0x0998('0x40')],'email':_0x5e24b6[_0x0998('0xa7')]['email']},'contact':_0x5e24b6[_0x0998('0x3c')]['contact'],'account':_0x5e24b6[_0x0998('0x3c')]['account']};var _0x5755d7={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4900e5[_0x0998('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e24b6[_0x0998('0xa7')][_0x0998('0xcb')]],'buttons':null,'topic':_0x4b840f[_0x0998('0xc9')],'note':_[_0x0998('0xcc')](_0x4b840f[_0x0998('0xcd')])?null:getMustacheRender(_0x4b840f[_0x0998('0xcd')],_0x3d1a3d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x0998('0xcc')](_0x4b840f[_0x0998('0xca')])){var _0x1c82fe=getMustacheRender(_0x4b840f[_0x0998('0xca')],_0x3d1a3d);var _0x2f0edc=JSON[_0x0998('0x8e')](_0x1c82fe);_0x5755d7[_0x0998('0x3c')][_0x0998('0xce')]=_0x2f0edc;}}catch(_0xcc5524){throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))](_0x0998('0xd0'));}return rp(_0x5755d7);}else{throw new db[(_0x0998('0x9e'))]['ValidationError'](_0x0998('0xd1'));}})[_0x0998('0x1f')](function(_0xc696e7){_0x5cb847=_0xc696e7;if(_0x5cb847['id']){var _0x41228a={'body':_0x5cb847[_0x0998('0xd2')],'ChatWebsiteId':_0x4b840f['id'],'ChatInteractionId':_0x3d8f33['id'],'direction':_0x0998('0xd3'),'UserId':_0x5e24b6[_0x0998('0xa7')]['id']};return db['ChatMessage'][_0x0998('0xc2')](_0x41228a,{});}else{throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))](_0x0998('0xd4'));}})[_0x0998('0x1f')](function(){return _0x3d8f33[_0x0998('0xd5')]({'vidaooSessionId':_0x5cb847['id']});})[_0x0998('0x1f')](respondWithResult(_0x254f56,null))[_0x0998('0x29')](handleError(_0x254f56,null));};exports[_0x0998('0xd6')]=function(_0x561f9a,_0x12a20e){if(_0x561f9a['body']['id']){delete _0x561f9a['body']['id'];}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x561f9a[_0x0998('0xbd')]['id']},'include':[{'model':db[_0x0998('0xd7')],'as':_0x0998('0x7d')}]})[_0x0998('0x1f')](handleEntityNotFound(_0x12a20e,null))[_0x0998('0x1f')](saveUpdates(_0x561f9a['body'],null))[_0x0998('0x1f')](respondWithResult(_0x12a20e,null))[_0x0998('0x29')](handleError(_0x12a20e,null));};exports['abandon']=function(_0x1154db,_0x10c34f,_0x28a815){if(_0x1154db['body']['id']){delete _0x1154db[_0x0998('0x3c')]['id'];}return db['ChatInteraction'][_0x0998('0x77')]({'where':{'id':_0x1154db[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](function(_0x575060){if(!_0x575060){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0998('0xd8'),0x194,_0x0998('0xd9'));_0x10c34f['sendStatus'](0x194);}else{if(_0x575060[_0x0998('0x4a')]){throw new db[(_0x0998('0x9e'))][(_0x0998('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x575060;})[_0x0998('0x1f')](function(_0x4a77ce){if(_0x4a77ce){return _0x4a77ce['update']({'closed':_0x1154db[_0x0998('0x3c')][_0x0998('0x49')],'disposition':_0x1154db[_0x0998('0x3c')][_0x0998('0x4c')]})['then'](function(_0x24057b){return _0x24057b;});}})['then'](function(_0xc9a9e8){return respondWithRpcPromise(_0x0998('0xda'),_0x0998('0xd8'),_0x1154db[_0x0998('0x3c')],client9004);})['then'](respondWithResult(_0x10c34f,null))['catch'](handleError(_0x10c34f,null));};exports['attachmentUpload']=function(_0x4cb800,_0x42940a,_0x135988){_0x4cb800[_0x0998('0x3c')][_0x0998('0x38')]=_0x4cb800[_0x0998('0xdb')]['originalname'];_0x4cb800[_0x0998('0x3c')]['basename']=_0x4cb800[_0x0998('0xdb')]['filename'];_0x4cb800[_0x0998('0x3c')][_0x0998('0x52')]=_0x4cb800['file']['mimetype'];return db[_0x0998('0xdc')]['create'](_0x4cb800[_0x0998('0x3c')])[_0x0998('0x1f')](respondWithResult(_0x42940a,0xc9))[_0x0998('0x29')](handleError(_0x42940a,null));};exports[_0x0998('0xdd')]=function(_0x40fc29,_0x28cde6,_0x285084){return db['ChatInteraction'][_0x0998('0xc6')]({'where':{'id':_0x40fc29[_0x0998('0xbd')]['id']},'raw':!![]})[_0x0998('0x1f')](handleEntityNotFound(_0x28cde6,null))[_0x0998('0x1f')](function(_0x3f455d){if(_0x3f455d){if(_0x3f455d['closed']){return _0x28cde6['status'](0x193)[_0x0998('0x2c')]({'status':0x193,'message':_0x0998('0xde')});}return db[_0x0998('0xdc')][_0x0998('0xc6')]({'where':{'id':_0x40fc29[_0x0998('0x55')]['attachId']},'raw':!![]})[_0x0998('0x1f')](handleEntityNotFound(_0x28cde6,null));}})[_0x0998('0x1f')](function(_0x9ef68d){if(_0x9ef68d){var _0x5883f6=_0x9ef68d[_0x0998('0xdf')]!==null;var _0x3ca49c=path[_0x0998('0xe0')](config[_0x0998('0xe1')],_0x0998('0xe2'));if(_0x5883f6){_0x3ca49c=path[_0x0998('0xe0')](_0x3ca49c,_0x0998('0xe3'));}var _0x56ef7b=path[_0x0998('0xe0')](_0x3ca49c,_0x9ef68d[_0x0998('0xe4')]);return _0x28cde6[_0x0998('0xe5')](_0x56ef7b);}})[_0x0998('0x29')](handleError(_0x28cde6,null));};exports[_0x0998('0xe6')]=function(_0xb0ad12,_0x250e66){var _0x4c370e=null;var _0x13d80a=null;var _0x4c1cd6=null;var _0x7e4e9c=null;if(_0xb0ad12[_0x0998('0x3c')]['id']){delete _0xb0ad12['body']['id'];}if(_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')]){_0x7e4e9c=path[_0x0998('0xe0')](config[_0x0998('0xe1')],_0x0998('0xe8'),util['format'](_0x0998('0xe9'),Date[_0x0998('0xea')]()));_0xb0ad12[_0x0998('0x3c')]['pathTranscript']=_0x7e4e9c;}return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0xb0ad12['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x0998('0xeb'),'include':[{'model':db[_0x0998('0xec')],'as':_0x0998('0xec')}]}]})[_0x0998('0x1f')](handleEntityNotFound(_0x250e66,null))[_0x0998('0x1f')](saveUpdates(_0xb0ad12[_0x0998('0x3c')],null))[_0x0998('0x1f')](function(_0xc61ead){if(_0xc61ead){_0x4c370e=_0xc61ead;return db['ChatWebsite'][_0x0998('0x77')]({'where':{'id':_0x4c370e[_0x0998('0xa5')]}});}})[_0x0998('0x1f')](function(_0x11c519){if(_0x11c519){_0x4c1cd6=_0x11c519;return db[_0x0998('0xd7')][_0x0998('0x77')]({'where':{'id':_0x4c370e['ContactId']}});}})[_0x0998('0x1f')](function(_0xdf447a){if(_0xdf447a){_0x13d80a=_0xdf447a;if(_0x7e4e9c){var _0x25281c=null;for(var _0x4a626f=0x1;_0x4a626f<_0x4c370e[_0x0998('0xeb')][_0x0998('0x5b')];++_0x4a626f){_0x25281c=_0x4c370e['Messages'][_0x4a626f];var _0x125037=_0x25281c[_0x0998('0x4a')]?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6[_0x0998('0xef')],_0x25281c[_0x0998('0x4a')]):_0x0998('0xf0');var _0x3a08a9=_0xb0ad12[_0x0998('0x3c')]['customer']||util[_0x0998('0xed')](_0x0998('0xee'),_0x0998('0xf1'),_0x25281c['ContactId']);switch(_0x4c1cd6[_0x0998('0xf2')]){case _0x0998('0xf3'):_0x125037=_0x25281c[_0x0998('0x4a')]?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6['agentAlias'],_0x25281c['UserId']):_0x0998('0xf0');break;case'agent_alias':_0x125037=_0x25281c[_0x0998('0x4a')]?_0x25281c[_0x0998('0xec')]['alias']||_0x25281c['User'][_0x0998('0x40')]:_0x0998('0xf0');break;case _0x0998('0xf4'):_0x125037=_0x25281c['UserId']?_0x25281c['User']['fullname']:_0x0998('0xf0');break;default:_0x125037=_0x25281c['UserId']?util[_0x0998('0xed')](_0x0998('0xee'),_0x4c1cd6[_0x0998('0xef')],_0x25281c['UserId']):_0x0998('0xf0');}var _0xb711f=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x25281c[_0x0998('0x8d')])[_0x0998('0xed')]('MM/DD/YYYY\x20HH:mm:ss'),_0x25281c[_0x0998('0xf5')]==='in'?_0x3a08a9:_0x125037,_0x25281c[_0x0998('0x3c')]);if(!_0x25281c[_0x0998('0xf6')]){fs[_0x0998('0xf7')](_0x7e4e9c,_0xb711f);}}return db[_0x0998('0xf8')][_0x0998('0xc6')]({'where':{'service':!![]},'include':[{'model':db[_0x0998('0xf9')],'as':_0x0998('0xfa'),'raw':!![]}]});}}})['then'](function(_0x22dad5){if(_0x22dad5&&_0x22dad5['Smtp']&&_0xb0ad12[_0x0998('0x3c')]){var _0x40ed7f={'tls':{'rejectUnauthorized':![]}};if(_0x22dad5[_0x0998('0xfa')][_0x0998('0xfb')]){_0x40ed7f[_0x0998('0xfb')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfb')];}else{_0x40ed7f[_0x0998('0xfc')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfc')];_0x40ed7f['port']=_0x22dad5['Smtp'][_0x0998('0xfd')];_0x40ed7f[_0x0998('0xfe')]=_0x22dad5[_0x0998('0xfa')][_0x0998('0xfe')];}if(_0x22dad5['Smtp'][_0x0998('0xff')]){_0x40ed7f[_0x0998('0x100')]={'user':_0x22dad5[_0x0998('0xfa')][_0x0998('0xa7')],'pass':_0x22dad5['Smtp'][_0x0998('0x101')]};}return respondWithRpcPromise('SendMail',_0x0998('0x102'),{'account':_0x40ed7f,'message':{'from':util[_0x0998('0xed')](_0x0998('0x103'),_0x22dad5['name'],_0x22dad5[_0x0998('0xcb')]||_0x22dad5[_0x0998('0xfa')][_0x0998('0xa7')]),'to':_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')],'subject':_0x0998('0x104'),'text':util[_0x0998('0xed')](_0x0998('0x105'),_0xb0ad12[_0x0998('0x3c')][_0x0998('0xe7')]),'attachments':[{'path':_0x7e4e9c}]}})['then'](function(){return _0x4c370e;})[_0x0998('0x29')](function(_0x56644e){console[_0x0998('0x24')](_0x56644e);});}else{return _0x4c370e;}})[_0x0998('0x1f')](respondWithStatusCode(_0x250e66,0xc8))[_0x0998('0x29')](handleError(_0x250e66,null));};exports['addMessage']=function(_0x238cf0,_0x440379,_0x4f41b3){return db[_0x0998('0x106')][_0x0998('0x77')]({'where':{'id':_0x238cf0[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x440379,null))['then'](function(_0x35abb6){if(_0x35abb6){return _0x35abb6[_0x0998('0x107')](_0x238cf0['body']['ids'],_['omit'](_0x238cf0[_0x0998('0x3c')],[_0x0998('0x108'),'id'])||{});}})[_0x0998('0x1f')](respondWithResult(_0x440379,null))[_0x0998('0x29')](handleError(_0x440379,null));};exports['getMessages']=function(_0x172930,_0x271198,_0x5b3181){var _0x19e704={'raw':![],'where':{}};var _0x23c447={};var _0x209f83={'count':0x0,'rows':[]};return db[_0x0998('0x50')][_0x0998('0xc6')]({'where':{'id':_0x172930[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x271198,null))[_0x0998('0x1f')](function(_0xd68c44){if(_0xd68c44){_0x23c447['model']=_[_0x0998('0x56')](db[_0x0998('0x106')][_0x0998('0xbe')]);_0x23c447[_0x0998('0x55')]=_[_0x0998('0x56')](_0x172930[_0x0998('0x55')]);_0x23c447[_0x0998('0x57')]=_[_0x0998('0x58')](_0x23c447['model'],_0x23c447[_0x0998('0x55')]);_0x19e704[_0x0998('0x59')]=_[_0x0998('0x58')](_0x23c447['model'],qs[_0x0998('0x5a')](_0x172930['query'][_0x0998('0x5a')]));_0x19e704[_0x0998('0x59')]=_0x19e704['attributes'][_0x0998('0x5b')]?_0x19e704['attributes']:_0x23c447[_0x0998('0x54')];if(!_0x172930[_0x0998('0x55')][_0x0998('0x5c')]('nolimit')){_0x19e704[_0x0998('0x30')]=qs['limit'](_0x172930[_0x0998('0x55')][_0x0998('0x30')]);_0x19e704[_0x0998('0x2d')]=qs[_0x0998('0x2d')](_0x172930['query'][_0x0998('0x2d')]);}_0x19e704[_0x0998('0x5e')]=qs[_0x0998('0x5f')](_0x172930['query'][_0x0998('0x5f')]);_0x19e704[_0x0998('0x60')]=qs['filters'](_[_0x0998('0x61')](_0x172930[_0x0998('0x55')],_0x23c447[_0x0998('0x57')]));_0x19e704[_0x0998('0x60')][_0x0998('0x109')]=_0xd68c44['id'];if(_0x172930[_0x0998('0x55')][_0x0998('0x97')]){_0x19e704[_0x0998('0x60')]=_[_0x0998('0x3b')](_0x19e704[_0x0998('0x60')],{'$or':_['map'](_0x19e704['attributes'],function(_0x599044){var _0x5b141e={};_0x5b141e[_0x599044]={'$like':'%'+_0x172930[_0x0998('0x55')][_0x0998('0x97')]+'%'};return _0x5b141e;})});}if(_0x172930['query'][_0x0998('0x10a')]){var _0x34a36a=_0x172930[_0x0998('0x55')][_0x0998('0x10a')][_0x0998('0x43')](',');var _0x440dee={};_0x440dee[_0x34a36a[0x0]]={'$gte':moment(_0x34a36a[0x1])['format'](_0x0998('0x10b'))};_0x19e704[_0x0998('0x60')]=_[_0x0998('0x3b')](_0x19e704[_0x0998('0x60')],_0x440dee);}_0x19e704=_[_0x0998('0x3b')]({},_0x19e704,_0x172930[_0x0998('0xc1')]);return db[_0x0998('0x106')][_0x0998('0x2f')]({'where':_0x19e704[_0x0998('0x60')]})[_0x0998('0x1f')](function(_0xd341ba){_0x209f83[_0x0998('0x2f')]=_0xd341ba;if(_0x172930[_0x0998('0x55')][_0x0998('0xbf')]){_0x19e704[_0x0998('0xc0')]=[{'all':!![]}];}return db[_0x0998('0x106')]['findAll'](_0x19e704);})['then'](function(_0x3466c9){_0x209f83[_0x0998('0xbc')]=_0x3466c9;return _0x209f83;});}})['then'](respondWithFilteredResult(_0x271198,_0x19e704))[_0x0998('0x29')](handleError(_0x271198,null));};exports['getMyMessages']=function(_0x20c3af,_0x2fa70d,_0xff967f){var _0x34f674={'where':{}},_0x2b2d09={},_0x3ed31a={'count':0x0,'rows':[]};return db[_0x0998('0x50')][_0x0998('0xc6')]({'where':{'id':_0x20c3af[_0x0998('0xbd')]['id']}})['then'](handleEntityNotFound(_0x2fa70d,null))[_0x0998('0x1f')](function(_0xdbffd3){if(_0xdbffd3){_0x2b2d09['model']=_['keys'](db[_0x0998('0x106')][_0x0998('0xbe')]);_0x2b2d09[_0x0998('0x55')]=_[_0x0998('0x56')](_0x20c3af[_0x0998('0x55')]);_0x2b2d09[_0x0998('0x57')]=_[_0x0998('0x58')](_0x2b2d09[_0x0998('0x54')],_0x2b2d09[_0x0998('0x55')]);_0x34f674[_0x0998('0x59')]=_[_0x0998('0x58')](_0x2b2d09['model'],qs[_0x0998('0x5a')](_0x20c3af[_0x0998('0x55')]['fields']));_0x34f674['attributes']=_0x34f674[_0x0998('0x59')][_0x0998('0x5b')]?_0x34f674[_0x0998('0x59')]:_0x2b2d09[_0x0998('0x54')];if(!_0x20c3af[_0x0998('0x55')]['hasOwnProperty']('nolimit')){_0x34f674['limit']=qs[_0x0998('0x30')](_0x20c3af[_0x0998('0x55')][_0x0998('0x30')]);_0x34f674[_0x0998('0x2d')]=qs['offset'](_0x20c3af[_0x0998('0x55')][_0x0998('0x2d')]);}_0x34f674[_0x0998('0x5e')]=qs['sort'](_0x20c3af[_0x0998('0x55')][_0x0998('0x5f')]);_0x34f674[_0x0998('0x60')]=qs[_0x0998('0x57')](_[_0x0998('0x61')](_0x20c3af['query'],_0x2b2d09[_0x0998('0x57')]));_0x34f674[_0x0998('0x60')][_0x0998('0x109')]=_0xdbffd3['id'];if(_0x20c3af[_0x0998('0x55')][_0x0998('0x97')]){_0x34f674[_0x0998('0x60')]=_['merge'](_0x34f674[_0x0998('0x60')],{'$or':_['map'](_0x34f674[_0x0998('0x59')],function(_0x29f796){var _0x5039d3={};_0x5039d3[_0x29f796]={'$like':'%'+_0x20c3af[_0x0998('0x55')][_0x0998('0x97')]+'%'};return _0x5039d3;})});}_0x34f674['where'][_0x0998('0xf6')]=![];if(_0x20c3af[_0x0998('0x55')]['id']){_0x34f674[_0x0998('0x60')]['id']={'$gt':_0x20c3af[_0x0998('0x55')]['id']};}_0x34f674=_[_0x0998('0x3b')]({},_0x34f674,_0x20c3af['options']);return db['ChatMessage'][_0x0998('0x2f')]({'where':_0x34f674[_0x0998('0x60')]})['then'](function(_0x23f1ef){_0x3ed31a['count']=_0x23f1ef;_0x34f674[_0x0998('0xc0')]=[];if(_0x20c3af[_0x0998('0x55')][_0x0998('0x10c')]){_0x34f674[_0x0998('0xc0')][_0x0998('0x45')]({'model':db[_0x0998('0xec')],'as':_0x0998('0xec'),'attributes':['id','fullname',_0x0998('0x10d')]});}if(_0x20c3af[_0x0998('0x55')]['includeAll']){_0x34f674[_0x0998('0xc0')]=[{'all':!![]}];}return db[_0x0998('0x106')][_0x0998('0x10e')](_0x34f674);})[_0x0998('0x1f')](function(_0x5e1e41){_0x3ed31a[_0x0998('0xbc')]=_0x5e1e41;return _0x3ed31a;});}})[_0x0998('0x1f')](respondWithFilteredResult(_0x2fa70d,_0x34f674))[_0x0998('0x29')](handleError(_0x2fa70d,null));};exports[_0x0998('0x10f')]=function(_0x33476a,_0x124129,_0x360773){return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x33476a[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x124129,null))['then'](function(_0x271360){if(_0x271360){return _0x271360[_0x0998('0x110')](_0x33476a['body'][_0x0998('0x108')],_[_0x0998('0x111')](_0x33476a[_0x0998('0x3c')],[_0x0998('0x108'),'id'])||{})[_0x0998('0x112')](function(){return db['Tag'][_0x0998('0x10e')]({'attributes':['id',_0x0998('0x38'),_0x0998('0x113')],'where':{'id':_0x33476a[_0x0998('0x3c')]['ids']}});})[_0x0998('0x1f')](function(_0x145e3b){socket[_0x0998('0x114')]('chatInteractionTags:save',{'id':Number(_0x33476a['params']['id']),'tags':_0x145e3b||[]});return{'id':Number(_0x33476a[_0x0998('0xbd')]['id']),'tags':_0x145e3b||[]};});}})[_0x0998('0x1f')](respondWithResult(_0x124129,null))[_0x0998('0x29')](handleError(_0x124129,null));};exports[_0x0998('0x115')]=function(_0x3573c7,_0x321708,_0xd3a4){return db[_0x0998('0x50')]['find']({'where':{'id':_0x3573c7[_0x0998('0xbd')]['id']}})[_0x0998('0x1f')](handleEntityNotFound(_0x321708,null))['then'](function(_0x376566){if(_0x376566){return _0x376566[_0x0998('0x115')](_0x3573c7[_0x0998('0x55')][_0x0998('0x108')]);}})[_0x0998('0x1f')](respondWithStatusCode(_0x321708,null))[_0x0998('0x29')](handleError(_0x321708,null));};exports[_0x0998('0xe5')]=function(_0x2fcea5,_0x3c1f60){var _0x5ad48d=moment()[_0x0998('0x116')]()['toString']();var _0x2fd5a3=path['join'](config[_0x0998('0xe1')],_0x0998('0x117'),_0x0998('0x118'),_0x0998('0x119'));var _0x4ab343=path[_0x0998('0xe0')](config[_0x0998('0xe1')],'server',_0x0998('0x118'),'attachments');var _0x38c323=path['join'](_0x2fd5a3,_0x5ad48d);var _0x6b7242=util[_0x0998('0xed')]('transcript-%d-%s.zip',_0x2fcea5['params']['id'],_0x5ad48d);var _0x341f06=path[_0x0998('0xe0')](_0x2fd5a3,_0x6b7242);var _0x30c149=[];_0x30c149['push']({'model':db[_0x0998('0xec')],'as':'User','attributes':['id',_0x0998('0x40')],'raw':!![]});_0x30c149[_0x0998('0x45')]({'model':db[_0x0998('0xd7')],'as':_0x0998('0x7d'),'attributes':['id',_0x0998('0x11a'),_0x0998('0x11b')],'raw':!![]});if(_0x2fcea5[_0x0998('0x55')]['attachments']){_0x30c149['push']({'model':db[_0x0998('0xdc')],'as':_0x0998('0xdc'),'raw':!![]});}var _0x158154=[{'model':db[_0x0998('0x106')],'as':_0x0998('0xeb'),'attributes':['id','body',_0x0998('0x8d'),'direction',_0x0998('0xf6'),_0x0998('0x93')],'include':_0x30c149}];_0x158154['push']({'model':db[_0x0998('0xc5')],'as':_0x0998('0x11c'),'attributes':['id',_0x0998('0x38')]});_0x158154[_0x0998('0x45')]({'model':db[_0x0998('0xec')],'as':_0x0998('0x11d'),'attributes':['id',_0x0998('0x40')]});return db[_0x0998('0x50')][_0x0998('0x77')]({'where':{'id':_0x2fcea5[_0x0998('0xbd')]['id']},'include':_0x158154})[_0x0998('0x1f')](handleEntityNotFound(_0x3c1f60,null))[_0x0998('0x1f')](function(_0xe68cf5){if(_0xe68cf5){var _0x1dab60=_0xe68cf5[_0x0998('0x11e')]({'plain':!![]});fs['mkdirSync'](_0x38c323);var _0x4270fe={'channel':_0x0998('0x11f'),'account':_0x1dab60[_0x0998('0x11c')][_0x0998('0x38')],'agent':_0x1dab60[_0x0998('0x11d')]?_0x1dab60[_0x0998('0x11d')][_0x0998('0x40')]:_0x0998('0x120'),'createdAt':moment(_0x1dab60[_0x0998('0x8d')])[_0x0998('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0998('0xac')](),'closedAt':_0x1dab60[_0x0998('0x49')]?moment(_0x1dab60[_0x0998('0x121')])[_0x0998('0xed')](_0x0998('0x10b'))['toString']():'','disposition':_0x1dab60['disposition'],'chatInfo':{'browser':_0x1dab60[_0x0998('0x122')],'os':_0x1dab60[_0x0998('0x123')],'referer':_0x1dab60['referer'],'customerIp':_0x1dab60[_0x0998('0x124')],'customerPort':_0x1dab60[_0x0998('0x125')]?_0x1dab60[_0x0998('0x125')]:_0x0998('0x120')},'messages':_(_0x1dab60[_0x0998('0xeb')])[_0x0998('0x126')]()['filter']({'secret':![]})[_0x0998('0x4f')](function(_0x104388){if(_0x104388[_0x0998('0xdc')]){var _0x2d4df4=path[_0x0998('0xe0')](_0x4ab343,_0x104388['Attachment'][_0x0998('0xe4')]);if(fs[_0x0998('0x127')](_0x2d4df4)){fs['createReadStream'](_0x2d4df4)[_0x0998('0x128')](fs['createWriteStream'](path['join'](_0x38c323,_0x104388[_0x0998('0xdc')][_0x0998('0xe4')])));}}return{'date':moment(_0x104388['createdAt'])[_0x0998('0xed')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0998('0xac')](),'sender':_0x104388[_0x0998('0xf5')]==='out'?_0x104388[_0x0998('0xec')]?_0x104388['User']['fullname']:_0x0998('0xf0'):_0x104388['Contact'][_0x0998('0x11a')]+(_0x104388[_0x0998('0x7d')][_0x0998('0x11b')]?'\x20'+_0x104388[_0x0998('0x7d')][_0x0998('0x11b')]:''),'body':_0x104388['Attachment']?_0x104388[_0x0998('0xdc')][_0x0998('0xe4')]:_0x104388[_0x0998('0x3c')],'direction':_0x104388[_0x0998('0xf5')]===_0x0998('0xd3')?'A':'C','secret':_0x104388['secret'],'read':_0x104388['read'],'attachment':_0x104388[_0x0998('0xdc')]};})[_0x0998('0x79')]()};return ejs['renderFile'](path[_0x0998('0xe0')](config['root'],_0x0998('0x117'),_0x0998('0x129'),_0x0998('0x12a')),{'interaction':_0x4270fe})['then'](function(_0x1d0d84){var _0x201a84=path[_0x0998('0xe0')](_0x38c323,'transcript-'+_0x1dab60['id']+'-'+_0x5ad48d+_0x0998('0x12b'));var _0x27ee9e={'path':_0x201a84,'channel':_0x0998('0x11f'),'interactionId':_0x1dab60['id']};return pdf['createPdfFromHTML'](_0x1d0d84,_0x27ee9e);})[_0x0998('0x1f')](function(){return new BPromise(function(_0xd4a2cd,_0x57abaa){zipdir(_0x38c323,{'saveTo':_0x341f06},function(_0x47cff9,_0x4a7c39){if(_0x47cff9)return _0x57abaa(_0x47cff9);return _0xd4a2cd(_0x4a7c39);});})[_0x0998('0x1f')](function(){return new BPromise(function(_0x3bb1b2,_0x1a8c31){rimraf(_0x38c323,function(_0x3a1bc1){if(_0x3a1bc1)_0x1a8c31(_0x3a1bc1);return _0x3bb1b2();});});})['then'](function(){return _0x3c1f60[_0x0998('0xe5')](_0x341f06,_0x6b7242,function(_0x2be0cd){if(_0x2be0cd){console[_0x0998('0x12c')](_0x0998('0x12d'),_0x2be0cd);}else{fs[_0x0998('0x12e')](_0x341f06);}});});});}else{return _0x3c1f60[_0x0998('0x36')](0xc8);}})['catch'](handleError(_0x3c1f60,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 48400b7..75f29a3 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 _0xe65e=['hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','Users','findAll','setDataValue','length','emit','hasOwnProperty'];(function(_0x2da0ce,_0x128df2){var _0x21edc6=function(_0x1a5f09){while(--_0x1a5f09){_0x2da0ce['push'](_0x2da0ce['shift']());}};_0x21edc6(++_0x128df2);}(_0xe65e,0x1e2));var _0xee65=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xe65e[_0x273c39];return _0x46d6b5;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xee65('0x0')];var ChatMessage=require(_0xee65('0x1'))['db'][_0xee65('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xee65('0x3')](0x0);var events={'afterCreate':_0xee65('0x4'),'afterUpdate':'update','afterDestroy':_0xee65('0x5')};function emitEvent(_0xd8be36){return function(_0x30d8d3,_0x185b6d,_0x2ed08a){_0x30d8d3[_0xee65('0x6')]({'attributes':['id'],'raw':!![]})[_0xee65('0x7')](function(_0xfd8451){_0x30d8d3['setDataValue'](_0xee65('0x8'),_0xfd8451['map'](function(_0x4dd9c6){return{'id':_0x4dd9c6['id']};}));return ChatMessage[_0xee65('0x9')]({'where':{'ChatInteractionId':_0x30d8d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xee65('0x7')](function(_0xc9da14){_0x30d8d3[_0xee65('0xa')]('unreadMessages',_0xc9da14[_0xee65('0xb')]);ChatInteractionEvents[_0xee65('0xc')](_0xd8be36+':'+_0x30d8d3['id'],_0x30d8d3);ChatInteractionEvents['emit'](_0xd8be36,_0x30d8d3);_0x2ed08a(null);})['catch'](_0x2ed08a(null));};}for(var e in events){if(events[_0xee65('0xd')](e)){var event=events[e];ChatInteraction[_0xee65('0xe')](e,emitEvent(event));}}module[_0xee65('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd53e=['hasOwnProperty','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53e,0x81));var _0xed53=function(_0x564f26,_0x1a44dc){_0x564f26=_0x564f26-0x0;var _0x5799a1=_0xd53e[_0x564f26];return _0x5799a1;};'use strict';var EventEmitter=require(_0xed53('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xed53('0x1')];var ChatMessage=require(_0xed53('0x2'))['db'][_0xed53('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xed53('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed53('0x5'),'afterDestroy':_0xed53('0x6')};function emitEvent(_0x1f9db3){return function(_0x9b6c78,_0x18c159,_0x49e3c5){_0x9b6c78[_0xed53('0x7')]({'attributes':['id'],'raw':!![]})[_0xed53('0x8')](function(_0x22201b){_0x9b6c78['setDataValue']('Users',_0x22201b[_0xed53('0x9')](function(_0x5e28cb){return{'id':_0x5e28cb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x9b6c78['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed53('0x8')](function(_0x143358){_0x9b6c78[_0xed53('0xa')](_0xed53('0xb'),_0x143358[_0xed53('0xc')]);ChatInteractionEvents[_0xed53('0xd')](_0x1f9db3+':'+_0x9b6c78['id'],_0x9b6c78);ChatInteractionEvents[_0xed53('0xd')](_0x1f9db3,_0x9b6c78);_0x49e3c5(null);})[_0xed53('0xe')](_0x49e3c5(null));};}for(var e in events){if(events[_0xed53('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index f358498..c39c976 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 _0xbd09=['moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1286e5,_0x2b912b){var _0x313a52=function(_0x53a9e2){while(--_0x53a9e2){_0x1286e5['push'](_0x1286e5['shift']());}};_0x313a52(++_0x2b912b);}(_0xbd09,0x75));var _0x9bd0=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xbd09[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x9bd0('0x0'));var util=require(_0x9bd0('0x1'));var logger=require('../../config/logger')(_0x9bd0('0x2'));var moment=require(_0x9bd0('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bd0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bd0('0x5'));var config=require(_0x9bd0('0x6'));var attributes=require(_0x9bd0('0x7'));module['exports']=function(_0x147fe0,_0x7f0bc9){return _0x147fe0[_0x9bd0('0x8')](_0x9bd0('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44fe43,_0x387407,_0x20e916){if(_0x44fe43[_0x9bd0('0xa')](_0x9bd0('0xb'))){_0x44fe43[_0x9bd0('0xc')]=moment()['format'](_0x9bd0('0xd'));}_0x20e916(null,_0x44fe43);}},'charset':'utf8mb4','collate':_0x9bd0('0xe')});};
\ No newline at end of file
+var _0x3946=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3946,0x1ca));var _0x6394=function(_0x5ea7e2,_0x15836c){_0x5ea7e2=_0x5ea7e2-0x0;var _0x1788b4=_0x3946[_0x5ea7e2];return _0x1788b4;};'use strict';var _=require(_0x6394('0x0'));var util=require(_0x6394('0x1'));var logger=require('../../config/logger')(_0x6394('0x2'));var moment=require('moment');var BPromise=require(_0x6394('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6394('0x4'));var rimraf=require(_0x6394('0x5'));var config=require(_0x6394('0x6'));var attributes=require(_0x6394('0x7'));module[_0x6394('0x8')]=function(_0xbaf76b,_0xb891bc){return _0xbaf76b[_0x6394('0x9')](_0x6394('0xa'),attributes,{'tableName':_0x6394('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x389142,_0x1ed24e,_0x1145b0){if(_0x389142['changed'](_0x6394('0xc'))){_0x389142['closedAt']=moment()['format'](_0x6394('0xd'));}_0x1145b0(null,_0x389142);}},'charset':_0x6394('0xe'),'collate':_0x6394('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 29549f0..f5008a7 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 _0x2d3a=['request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2d3a,0x12d));var _0xa2d3=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x2d3a[_0x30f030];return _0xf7614f;};'use strict';var _=require(_0xa2d3('0x0'));var util=require('util');var moment=require(_0xa2d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2d3('0x2'));var fs=require('fs');var Redis=require(_0xa2d3('0x3'));var db=require(_0xa2d3('0x4'))['db'];var utils=require(_0xa2d3('0x5'));var logger=require(_0xa2d3('0x6'))('rpc');var config=require(_0xa2d3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2d3('0x8')][_0xa2d3('0x9')]({'port':0x232a});config[_0xa2d3('0xa')]=_[_0xa2d3('0xb')](config[_0xa2d3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d3('0xc'))(new Redis(config[_0xa2d3('0xa')]));require(_0xa2d3('0xd'))[_0xa2d3('0xe')](socket);function respondWithRpcPromise(_0x218949,_0x2c9b7b,_0x4c5def){return new BPromise(function(_0x318d1b,_0x388c8d){return client['request'](_0x218949,_0x4c5def)[_0xa2d3('0xf')](function(_0xfecfee){logger['info'](_0xa2d3('0x10'),_0x2c9b7b,'request\x20sent');logger[_0xa2d3('0x11')](_0xa2d3('0x12'),_0x2c9b7b,_0xa2d3('0x13'),JSON[_0xa2d3('0x14')](_0xfecfee));if(_0xfecfee[_0xa2d3('0x15')]){if(_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x16')]===0x1f4){logger['error'](_0xa2d3('0x10'),_0x2c9b7b,_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);return _0x388c8d(_0xfecfee['error'][_0xa2d3('0x17')]);}logger['error'](_0xa2d3('0x10'),_0x2c9b7b,_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);return _0x318d1b(_0xfecfee[_0xa2d3('0x15')][_0xa2d3('0x17')]);}else{logger[_0xa2d3('0x18')](_0xa2d3('0x10'),_0x2c9b7b,'request\x20sent');_0x318d1b(_0xfecfee[_0xa2d3('0x19')][_0xa2d3('0x17')]);}})['catch'](function(_0xcc79c5){logger[_0xa2d3('0x15')](_0xa2d3('0x10'),_0x2c9b7b,_0xcc79c5);_0x388c8d(_0xcc79c5);});});}exports[_0xa2d3('0x1a')]=function(_0x5c2c34){var _0x4a4e37=this;return new Promise(function(_0xd2310f,_0x43a778){return db[_0xa2d3('0x1b')]['update'](_0x5c2c34[_0xa2d3('0x1c')],{'raw':_0x5c2c34['options']?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2c34[_0xa2d3('0x1d')]?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x1f')]||null:null,'attributes':_0x5c2c34['options']?_0x5c2c34[_0xa2d3('0x1d')][_0xa2d3('0x20')]||null:null,'limit':_0x5c2c34[_0xa2d3('0x1d')]?_0x5c2c34['options'][_0xa2d3('0x21')]||null:null})[_0xa2d3('0xf')](function(_0x51f71f){logger[_0xa2d3('0x18')](_0xa2d3('0x1a'),_0x5c2c34);logger[_0xa2d3('0x11')](_0xa2d3('0x1a'),_0x5c2c34,JSON[_0xa2d3('0x14')](_0x51f71f));_0xd2310f(_0x51f71f);})[_0xa2d3('0x22')](function(_0xaee19c){logger['error']('UpdateChatInteraction',_0xaee19c[_0xa2d3('0x17')],_0x5c2c34);_0x43a778(_0x4a4e37['error'](0x1f4,_0xaee19c[_0xa2d3('0x17')]));});});};exports[_0xa2d3('0x23')]=function(_0x4f17fb){return new Promise(function(_0x1117f6,_0x201abb){return db[_0xa2d3('0x1b')][_0xa2d3('0x24')]({'where':_0x4f17fb[_0xa2d3('0x1d')]?_0x4f17fb[_0xa2d3('0x1d')][_0xa2d3('0x1f')]||null:null})[_0xa2d3('0xf')](function(_0x48ce74){if(_0x48ce74){return _0x48ce74['addTags'](_0x4f17fb[_0xa2d3('0x1c')][_0xa2d3('0x25')],_[_0xa2d3('0x26')](_0x4f17fb[_0xa2d3('0x1c')],[_0xa2d3('0x25'),'id'])||{});}})['spread'](function(_0xdb53d3){logger['info'](_0xa2d3('0x27'),_0x4f17fb);logger[_0xa2d3('0x11')]('AddTags',_0x4f17fb,JSON['stringify'](_0xdb53d3));_0x1117f6(_0xdb53d3);})['catch'](function(_0x204565){logger[_0xa2d3('0x15')](_0xa2d3('0x27'),_0x204565[_0xa2d3('0x17')],_0x4f17fb);_0x201abb(_this['error'](0x1f4,_0x204565[_0xa2d3('0x17')]));});});};
\ No newline at end of file
+var _0x384a=['omit','ids','spread','AddTags','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','then','debug','find','where','addTags'];(function(_0x229231,_0x24cfb2){var _0x295a4a=function(_0x3f3724){while(--_0x3f3724){_0x229231['push'](_0x229231['shift']());}};_0x295a4a(++_0x24cfb2);}(_0x384a,0x16c));var _0xa384=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x384a[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xa384('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa384('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa384('0x2'))['db'];var utils=require(_0xa384('0x3'));var logger=require(_0xa384('0x4'))(_0xa384('0x5'));var config=require(_0xa384('0x6'));var jayson=require(_0xa384('0x7'));var client=jayson[_0xa384('0x8')]['http']({'port':0x232a});config[_0xa384('0x9')]=_[_0xa384('0xa')](config[_0xa384('0x9')],{'host':_0xa384('0xb'),'port':0x18eb});var socket=require(_0xa384('0xc'))(new Redis(config[_0xa384('0x9')]));require(_0xa384('0xd'))[_0xa384('0xe')](socket);function respondWithRpcPromise(_0xb09b7,_0x5c87f6,_0x777441){return new BPromise(function(_0x35bbd5,_0x41feb1){return client['request'](_0xb09b7,_0x777441)['then'](function(_0x552770){logger[_0xa384('0xf')](_0xa384('0x10'),_0x5c87f6,_0xa384('0x11'));logger['debug'](_0xa384('0x12'),_0x5c87f6,_0xa384('0x11'),JSON[_0xa384('0x13')](_0x552770));if(_0x552770[_0xa384('0x14')]){if(_0x552770[_0xa384('0x14')][_0xa384('0x15')]===0x1f4){logger[_0xa384('0x14')](_0xa384('0x10'),_0x5c87f6,_0x552770['error']['message']);return _0x41feb1(_0x552770['error'][_0xa384('0x16')]);}logger[_0xa384('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0x552770[_0xa384('0x14')][_0xa384('0x16')]);return _0x35bbd5(_0x552770['error']['message']);}else{logger[_0xa384('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0xa384('0x11'));_0x35bbd5(_0x552770[_0xa384('0x17')][_0xa384('0x16')]);}})[_0xa384('0x18')](function(_0x18a835){logger[_0xa384('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5c87f6,_0x18a835);_0x41feb1(_0x18a835);});});}exports[_0xa384('0x19')]=function(_0x10cd9d){var _0x5d7a8c=this;return new Promise(function(_0x20797b,_0x1b92e4){return db[_0xa384('0x1a')][_0xa384('0x1b')](_0x10cd9d[_0xa384('0x1c')],{'raw':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['where']||null:null,'attributes':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')][_0xa384('0x1e')]||null:null,'limit':_0x10cd9d[_0xa384('0x1d')]?_0x10cd9d[_0xa384('0x1d')]['limit']||null:null})[_0xa384('0x1f')](function(_0x32c4fa){logger[_0xa384('0xf')](_0xa384('0x19'),_0x10cd9d);logger[_0xa384('0x20')](_0xa384('0x19'),_0x10cd9d,JSON[_0xa384('0x13')](_0x32c4fa));_0x20797b(_0x32c4fa);})[_0xa384('0x18')](function(_0x463d5b){logger[_0xa384('0x14')](_0xa384('0x19'),_0x463d5b['message'],_0x10cd9d);_0x1b92e4(_0x5d7a8c[_0xa384('0x14')](0x1f4,_0x463d5b[_0xa384('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x1ef238){return new Promise(function(_0x5d65bf,_0x4b56fc){return db[_0xa384('0x1a')][_0xa384('0x21')]({'where':_0x1ef238[_0xa384('0x1d')]?_0x1ef238[_0xa384('0x1d')][_0xa384('0x22')]||null:null})[_0xa384('0x1f')](function(_0x24a9cf){if(_0x24a9cf){return _0x24a9cf[_0xa384('0x23')](_0x1ef238[_0xa384('0x1c')]['ids'],_[_0xa384('0x24')](_0x1ef238[_0xa384('0x1c')],[_0xa384('0x25'),'id'])||{});}})[_0xa384('0x26')](function(_0x121688){logger['info'](_0xa384('0x27'),_0x1ef238);logger[_0xa384('0x20')](_0xa384('0x27'),_0x1ef238,JSON[_0xa384('0x13')](_0x121688));_0x5d65bf(_0x121688);})[_0xa384('0x18')](function(_0x473ff5){logger[_0xa384('0x14')]('AddTags',_0x473ff5[_0xa384('0x16')],_0x1ef238);_0x4b56fc(_this[_0xa384('0x14')](0x1f4,_0x473ff5['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index af14173..a172005 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 _0xf70e=['chatInteraction:','./chatInteraction.events','save','emit','removeListener','register'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf70e,0xd9));var _0xef70=function(_0x563d77,_0x305794){_0x563d77=_0x563d77-0x0;var _0x24cfdf=_0xf70e[_0x563d77];return _0x24cfdf;};'use strict';var ChatInteractionEvents=require(_0xef70('0x0'));var events=[_0xef70('0x1'),'remove','update'];function createListener(_0x4ece88,_0x1d9e28){return function(_0x5877ca){_0x1d9e28[_0xef70('0x2')](_0x4ece88,_0x5877ca);};}function removeListener(_0x179db6,_0x1afc2f){return function(){ChatInteractionEvents[_0xef70('0x3')](_0x179db6,_0x1afc2f);};}exports[_0xef70('0x4')]=function(_0x113fff){for(var _0x1fd1df=0x0,_0x35897b=events['length'];_0x1fd1df<_0x35897b;_0x1fd1df++){var _0x33384c=events[_0x1fd1df];var _0x50927d=createListener(_0xef70('0x5')+_0x33384c,_0x113fff);ChatInteractionEvents['on'](_0x33384c,_0x50927d);}};
\ No newline at end of file
+var _0x69ec=['chatInteraction:','save','remove','update','emit','removeListener','register'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x69ec,0xbe));var _0xc69e=function(_0x124817,_0x1888f2){_0x124817=_0x124817-0x0;var _0x1d80a9=_0x69ec[_0x124817];return _0x1d80a9;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xc69e('0x0'),_0xc69e('0x1'),_0xc69e('0x2')];function createListener(_0xc476b3,_0x3551d5){return function(_0x10e914){_0x3551d5[_0xc69e('0x3')](_0xc476b3,_0x10e914);};}function removeListener(_0xc2512d,_0x416e44){return function(){ChatInteractionEvents[_0xc69e('0x4')](_0xc2512d,_0x416e44);};}exports[_0xc69e('0x5')]=function(_0x4aaf35){for(var _0x573547=0x0,_0x452419=events['length'];_0x573547<_0x452419;_0x573547++){var _0x3c6f32=events[_0x573547];var _0x42c120=createListener(_0xc69e('0x6')+_0x3c6f32,_0x4aaf35);ChatInteractionEvents['on'](_0x3c6f32,_0x42c120);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3797d51..080533a 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 _0xabb7=['format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x22a735,_0x22be08){var _0x25f5b4=function(_0x337cc9){while(--_0x337cc9){_0x22a735['push'](_0x22a735['shift']());}};_0x25f5b4(++_0x22be08);}(_0xabb7,0x8e));var _0x7abb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xabb7[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x7abb('0x0'));var util=require(_0x7abb('0x1'));var path=require(_0x7abb('0x2'));var timeout=require(_0x7abb('0x3'));var express=require(_0x7abb('0x4'));var router=express[_0x7abb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7abb('0x6'));var interaction=require(_0x7abb('0x7'));var config=require(_0x7abb('0x8'));var controller=require(_0x7abb('0x9'));router[_0x7abb('0xa')]('/',auth[_0x7abb('0xb')](),controller[_0x7abb('0xc')]);router[_0x7abb('0xa')]('/describe',auth[_0x7abb('0xb')](),controller[_0x7abb('0xd')]);router[_0x7abb('0xa')](_0x7abb('0xe'),auth[_0x7abb('0xf')](),controller['show']);router[_0x7abb('0xa')](_0x7abb('0x10'),auth[_0x7abb('0xf')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x7abb('0xb')](),controller[_0x7abb('0x11')]);router[_0x7abb('0xa')]('/:id/my_messages',auth[_0x7abb('0xf')](),controller[_0x7abb('0x12')]);router[_0x7abb('0xa')](_0x7abb('0x13'),auth[_0x7abb('0xb')](),controller[_0x7abb('0x14')]);router['post']('/',auth[_0x7abb('0xb')](),controller[_0x7abb('0x15')]);router[_0x7abb('0x16')](_0x7abb('0x17'),auth[_0x7abb('0xb')](),controller[_0x7abb('0x18')]);var upload=multer({'storage':multer[_0x7abb('0x19')]({'destination':function(_0x2f25fb,_0x1dfca8,_0x420716){_0x420716(null,path[_0x7abb('0x1a')](config[_0x7abb('0x1b')],_0x7abb('0x1c')));},'filename':function(_0x579985,_0x4a14cd,_0x48508c){_0x48508c(null,util[_0x7abb('0x1d')](_0x7abb('0x1e'),Date[_0x7abb('0x1f')](),_0x4a14cd[_0x7abb('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7abb('0x21'),upload[_0x7abb('0x22')](_0x7abb('0x23')),controller[_0x7abb('0x24')]);router[_0x7abb('0x16')](_0x7abb('0x25'),auth[_0x7abb('0xf')](),controller[_0x7abb('0x26')]);router['post'](_0x7abb('0x27'),auth[_0x7abb('0xb')](),interaction[_0x7abb('0x28')](_0x7abb('0x29'),_0x7abb('0x2a')),controller[_0x7abb('0x2b')]);router[_0x7abb('0x2c')](_0x7abb('0xe'),auth['isAuthenticated'](),interaction[_0x7abb('0x28')](_0x7abb('0x29'),_0x7abb('0x2d')),controller[_0x7abb('0x2e')]);router['put'](_0x7abb('0x2f'),controller[_0x7abb('0x30')]);router[_0x7abb('0x2c')](_0x7abb('0x31'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put'](_0x7abb('0x32'),controller[_0x7abb('0x33')]);router[_0x7abb('0x34')](_0x7abb('0xe'),auth['isAuthenticated'](),interaction[_0x7abb('0x28')]('chat',_0x7abb('0x35')),controller[_0x7abb('0x36')]);router[_0x7abb('0x34')](_0x7abb('0x27'),auth['isAuthenticated'](),controller[_0x7abb('0x37')]);module[_0x7abb('0x38')]=router;
\ No newline at end of file
+var _0x132c=['download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','get','/:id/attachment_download','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x1cf9d4,_0x5e32b6){var _0x4ed306=function(_0x4c5dcf){while(--_0x4c5dcf){_0x1cf9d4['push'](_0x1cf9d4['shift']());}};_0x4ed306(++_0x5e32b6);}(_0x132c,0x18b));var _0xc132=function(_0x4271b9,_0x12effa){_0x4271b9=_0x4271b9-0x0;var _0x133c0d=_0x132c[_0x4271b9];return _0x133c0d;};'use strict';var multer=require(_0xc132('0x0'));var util=require(_0xc132('0x1'));var path=require(_0xc132('0x2'));var timeout=require(_0xc132('0x3'));var express=require('express');var router=express[_0xc132('0x4')]();var fs_extra=require(_0xc132('0x5'));var auth=require(_0xc132('0x6'));var interaction=require(_0xc132('0x7'));var config=require(_0xc132('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xc132('0x9')](),controller[_0xc132('0xa')]);router['get']('/describe',auth[_0xc132('0x9')](),controller[_0xc132('0xb')]);router['get'](_0xc132('0xc'),auth[_0xc132('0xd')](),controller[_0xc132('0xe')]);router[_0xc132('0xf')](_0xc132('0x10'),auth[_0xc132('0xd')](),controller[_0xc132('0x11')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xc132('0xf')](_0xc132('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xc132('0x13')]);router[_0xc132('0xf')](_0xc132('0x14'),auth[_0xc132('0x9')](),controller[_0xc132('0x15')]);router[_0xc132('0x16')]('/',auth[_0xc132('0x9')](),controller[_0xc132('0x17')]);router['post']('/:id/vidaoo',auth[_0xc132('0x9')](),controller[_0xc132('0x18')]);var upload=multer({'storage':multer[_0xc132('0x19')]({'destination':function(_0x4593ea,_0x1ffc7f,_0x5a8320){_0x5a8320(null,path['join'](config[_0xc132('0x1a')],_0xc132('0x1b')));},'filename':function(_0x3c5683,_0x369e07,_0x5411eb){_0x5411eb(null,util[_0xc132('0x1c')](_0xc132('0x1d'),Date['now'](),_0x369e07[_0xc132('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc132('0x16')](_0xc132('0x1f'),upload[_0xc132('0x20')](_0xc132('0x21')),controller[_0xc132('0x22')]);router['post'](_0xc132('0x23'),auth[_0xc132('0xd')](),controller[_0xc132('0x24')]);router[_0xc132('0x16')]('/:id/tags',auth[_0xc132('0x9')](),interaction[_0xc132('0x25')](_0xc132('0x26'),_0xc132('0x27')),controller[_0xc132('0x28')]);router[_0xc132('0x29')](_0xc132('0xc'),auth[_0xc132('0x9')](),interaction[_0xc132('0x25')](_0xc132('0x26'),_0xc132('0x2a')),controller[_0xc132('0x2b')]);router[_0xc132('0x29')](_0xc132('0x2c'),controller['customUpdate']);router[_0xc132('0x29')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xc132('0x2d')]);router[_0xc132('0x29')](_0xc132('0x2e'),controller['close']);router[_0xc132('0x2f')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xc132('0x26'),'chatinteraction:destroy'),controller[_0xc132('0x30')]);router[_0xc132('0x2f')](_0xc132('0x31'),auth[_0xc132('0x9')](),controller[_0xc132('0x32')]);module[_0xc132('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 060d2d2..3568f49 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 _0xaad4=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x3be47a,_0x20de8a){var _0x195e0b=function(_0x38b88){while(--_0x38b88){_0x3be47a['push'](_0x3be47a['shift']());}};_0x195e0b(++_0x20de8a);}(_0xaad4,0x15e));var _0x4aad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaad4[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4aad('0x0'));module[_0x4aad('0x1')]={'body':{'type':Sequelize[_0x4aad('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4aad('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbf88=['INTEGER','exports','medium','BOOLEAN'];(function(_0x1f5b95,_0x4ffe11){var _0x576970=function(_0x3926ea){while(--_0x3926ea){_0x1f5b95['push'](_0x1f5b95['shift']());}};_0x576970(++_0x4ffe11);}(_0xbf88,0x139));var _0x8bf8=function(_0x408300,_0x33fda2){_0x408300=_0x408300-0x0;var _0x375af0=_0xbf88[_0x408300];return _0x375af0;};'use strict';var Sequelize=require('sequelize');module[_0x8bf8('0x0')]={'body':{'type':Sequelize['TEXT'](_0x8bf8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x8bf8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8bf8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f792295..f5bd813 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 _0x9cc5=['nolimit','sort','pick','merge','where','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','autoAssociation','UserProfileResource','resourceId','push','length','FromId','ToId','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty'];(function(_0xe3aaed,_0x3238b9){var _0x5ecbb6=function(_0x48bc8a){while(--_0x48bc8a){_0xe3aaed['push'](_0xe3aaed['shift']());}};_0x5ecbb6(++_0x3238b9);}(_0x9cc5,0x111));var _0x59cc=function(_0xcd61bc,_0x230d59){_0xcd61bc=_0xcd61bc-0x0;var _0x3221c1=_0x9cc5[_0xcd61bc];return _0x3221c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x59cc('0x0'));var jsonpatch=require(_0x59cc('0x1'));var rp=require(_0x59cc('0x2'));var moment=require(_0x59cc('0x3'));var BPromise=require(_0x59cc('0x4'));var Mustache=require(_0x59cc('0x5'));var util=require(_0x59cc('0x6'));var path=require(_0x59cc('0x7'));var sox=require(_0x59cc('0x8'));var csv=require(_0x59cc('0x9'));var ejs=require(_0x59cc('0xa'));var fs=require('fs');var fs_extra=require(_0x59cc('0xb'));var _=require(_0x59cc('0xc'));var squel=require(_0x59cc('0xd'));var crypto=require(_0x59cc('0xe'));var jsforce=require(_0x59cc('0xf'));var deskjs=require(_0x59cc('0x10'));var toCsv=require(_0x59cc('0x9'));var querystring=require(_0x59cc('0x11'));var Papa=require(_0x59cc('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59cc('0x13'));var as=require(_0x59cc('0x14'));var hardwareService=require(_0x59cc('0x15'));var logger=require(_0x59cc('0x16'))(_0x59cc('0x17'));var utils=require(_0x59cc('0x18'));var config=require(_0x59cc('0x19'));var licenseUtil=require(_0x59cc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x59cc('0x1b')]=_[_0x59cc('0x1c')](config[_0x59cc('0x1b')],{'host':_0x59cc('0x1d'),'port':0x18eb});var socket=require(_0x59cc('0x1e'))(new Redis(config['redis']));require(_0x59cc('0x1f'))['register'](socket);function respondWithStatusCode(_0x39e5e2,_0x53c8e3){_0x53c8e3=_0x53c8e3||0xcc;return function(_0x2dd5d1){if(_0x2dd5d1){return _0x39e5e2['sendStatus'](_0x53c8e3);}return _0x39e5e2[_0x59cc('0x20')](_0x53c8e3)[_0x59cc('0x21')]();};}function respondWithResult(_0x259f66,_0x3bd315){_0x3bd315=_0x3bd315||0xc8;return function(_0x41dfa2){if(_0x41dfa2){return _0x259f66[_0x59cc('0x20')](_0x3bd315)['json'](_0x41dfa2);}};}function respondWithFilteredResult(_0x31018e,_0xc30bd0){return function(_0x5d5540){if(_0x5d5540){var _0x2da55b=typeof _0xc30bd0['offset']===_0x59cc('0x22')&&typeof _0xc30bd0[_0x59cc('0x23')]===_0x59cc('0x22');var _0x3cefa0=_0x5d5540['count'];var _0x1e62cd=_0x2da55b?0x0:_0xc30bd0[_0x59cc('0x24')];var _0x1ca55e=_0x2da55b?_0x5d5540[_0x59cc('0x25')]:_0xc30bd0['offset']+_0xc30bd0[_0x59cc('0x23')];var _0x279099;if(_0x1ca55e>=_0x3cefa0){_0x1ca55e=_0x3cefa0;_0x279099=0xc8;}else{_0x279099=0xce;}_0x31018e['status'](_0x279099);return _0x31018e['set'](_0x59cc('0x26'),_0x1e62cd+'-'+_0x1ca55e+'/'+_0x3cefa0)[_0x59cc('0x27')](_0x5d5540);}return null;};}function patchUpdates(_0xc3476a){return function(_0x27f74d){try{jsonpatch[_0x59cc('0x28')](_0x27f74d,_0xc3476a,!![]);}catch(_0x40f087){return BPromise[_0x59cc('0x29')](_0x40f087);}return _0x27f74d['save']();};}function saveUpdates(_0xcfacc0,_0x5315f4){return function(_0x3d3bee){if(_0x3d3bee){return _0x3d3bee[_0x59cc('0x2a')](_0xcfacc0)['then'](function(_0x33e265){return _0x33e265;});}return null;};}function removeEntity(_0x3532fd,_0x3c509a){return function(_0x115615){if(_0x115615){return _0x115615[_0x59cc('0x2b')]()[_0x59cc('0x2c')](function(){_0x3532fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5826d5,_0x543ecc){return function(_0x16efa5){if(!_0x16efa5){_0x5826d5['sendStatus'](0x194);}return _0x16efa5;};}function handleError(_0x3c19d3,_0x3b4e74){_0x3b4e74=_0x3b4e74||0x1f4;return function(_0x1699b3){logger[_0x59cc('0x2d')](_0x1699b3[_0x59cc('0x2e')]);if(_0x1699b3[_0x59cc('0x2f')]){delete _0x1699b3[_0x59cc('0x2f')];}_0x3c19d3[_0x59cc('0x20')](_0x3b4e74)[_0x59cc('0x30')](_0x1699b3);};}exports['index']=function(_0x326022,_0x1abc48){var _0x40c46b={},_0xc65fd7={},_0x22cb04={'count':0x0,'rows':[]};var _0x10e5f6=_[_0x59cc('0x31')](db[_0x59cc('0x32')][_0x59cc('0x33')],function(_0x2df545){return{'name':_0x2df545[_0x59cc('0x34')],'type':_0x2df545[_0x59cc('0x35')][_0x59cc('0x36')]};});_0xc65fd7['model']=_[_0x59cc('0x31')](_0x10e5f6,_0x59cc('0x2f'));_0xc65fd7[_0x59cc('0x37')]=_[_0x59cc('0x38')](_0x326022[_0x59cc('0x37')]);_0xc65fd7[_0x59cc('0x39')]=_['intersection'](_0xc65fd7[_0x59cc('0x3a')],_0xc65fd7[_0x59cc('0x37')]);_0x40c46b[_0x59cc('0x3b')]=_[_0x59cc('0x3c')](_0xc65fd7[_0x59cc('0x3a')],qs[_0x59cc('0x3d')](_0x326022[_0x59cc('0x37')][_0x59cc('0x3d')]));_0x40c46b['attributes']=_0x40c46b[_0x59cc('0x3b')]['length']?_0x40c46b['attributes']:_0xc65fd7['model'];if(!_0x326022[_0x59cc('0x37')][_0x59cc('0x3e')](_0x59cc('0x3f'))){_0x40c46b['limit']=qs[_0x59cc('0x23')](_0x326022['query'][_0x59cc('0x23')]);_0x40c46b[_0x59cc('0x24')]=qs[_0x59cc('0x24')](_0x326022[_0x59cc('0x37')][_0x59cc('0x24')]);}_0x40c46b['order']=qs[_0x59cc('0x40')](_0x326022['query']['sort']);_0x40c46b['where']=qs[_0x59cc('0x39')](_[_0x59cc('0x41')](_0x326022['query'],_0xc65fd7['filters']),_0x10e5f6);if(_0x326022['query']['filter']){_0x40c46b['where']=_[_0x59cc('0x42')](_0x40c46b[_0x59cc('0x43')],{'$or':_['map'](_0x10e5f6,function(_0x410ef2){if(_0x410ef2['type']!=='VIRTUAL'){var _0x2700f7={};_0x2700f7[_0x410ef2[_0x59cc('0x2f')]]={'$like':'%'+_0x326022[_0x59cc('0x37')][_0x59cc('0x44')]+'%'};return _0x2700f7;}})});}_0x40c46b=_[_0x59cc('0x42')]({},_0x40c46b,_0x326022[_0x59cc('0x45')]);var _0x2019c8={'where':_0x40c46b[_0x59cc('0x43')]};return db['ChatInternalMessage'][_0x59cc('0x25')](_0x2019c8)[_0x59cc('0x2c')](function(_0x3f26ef){_0x22cb04[_0x59cc('0x25')]=_0x3f26ef;if(_0x326022[_0x59cc('0x37')][_0x59cc('0x46')]){_0x40c46b[_0x59cc('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x59cc('0x48')](_0x40c46b);})[_0x59cc('0x2c')](function(_0x2e11c0){_0x22cb04['rows']=_0x2e11c0;return _0x22cb04;})[_0x59cc('0x2c')](respondWithFilteredResult(_0x1abc48,_0x40c46b))[_0x59cc('0x49')](handleError(_0x1abc48,null));};exports[_0x59cc('0x4a')]=function(_0xd5c8aa,_0x1e2e2c){var _0x321c56={'raw':!![],'where':{'id':_0xd5c8aa[_0x59cc('0x4b')]['id']}},_0x4bb3de={};_0x4bb3de[_0x59cc('0x3a')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x4bb3de['query']=_['keys'](_0xd5c8aa[_0x59cc('0x37')]);_0x4bb3de[_0x59cc('0x39')]=_[_0x59cc('0x3c')](_0x4bb3de[_0x59cc('0x3a')],_0x4bb3de[_0x59cc('0x37')]);_0x321c56['attributes']=_[_0x59cc('0x3c')](_0x4bb3de['model'],qs[_0x59cc('0x3d')](_0xd5c8aa[_0x59cc('0x37')][_0x59cc('0x3d')]));_0x321c56[_0x59cc('0x3b')]=_0x321c56['attributes']['length']?_0x321c56['attributes']:_0x4bb3de['model'];if(_0xd5c8aa[_0x59cc('0x37')][_0x59cc('0x46')]){_0x321c56[_0x59cc('0x47')]=[{'all':!![]}];}_0x321c56=_[_0x59cc('0x42')]({},_0x321c56,_0xd5c8aa[_0x59cc('0x45')]);return db[_0x59cc('0x32')][_0x59cc('0x4c')](_0x321c56)['then'](handleEntityNotFound(_0x1e2e2c,null))[_0x59cc('0x2c')](respondWithResult(_0x1e2e2c,null))[_0x59cc('0x49')](handleError(_0x1e2e2c,null));};exports['create']=function(_0x3c72db,_0x43c22d){return db['ChatInternalMessage'][_0x59cc('0x4d')](_0x3c72db[_0x59cc('0x4e')],{})['then'](respondWithResult(_0x43c22d,0xc9))['catch'](handleError(_0x43c22d,null));};exports[_0x59cc('0x2a')]=function(_0x48211e,_0xe1840){if(_0x48211e['body']['id']){delete _0x48211e[_0x59cc('0x4e')]['id'];}return db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'id':_0x48211e['params']['id']}})[_0x59cc('0x2c')](handleEntityNotFound(_0xe1840,null))[_0x59cc('0x2c')](saveUpdates(_0x48211e[_0x59cc('0x4e')],null))['then'](respondWithResult(_0xe1840,null))['catch'](handleError(_0xe1840,null));};exports['destroy']=function(_0x3680e8,_0x529c3f){return db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'id':_0x3680e8['params']['id']}})[_0x59cc('0x2c')](handleEntityNotFound(_0x529c3f,null))[_0x59cc('0x2c')](removeEntity(_0x529c3f,null))[_0x59cc('0x49')](handleError(_0x529c3f,null));};exports[_0x59cc('0x4f')]=function(_0xf2e5dd,_0x1ff51e){return db[_0x59cc('0x32')]['describe']()[_0x59cc('0x2c')](respondWithResult(_0x1ff51e,null))[_0x59cc('0x49')](handleError(_0x1ff51e,null));};function wrapUser(_0x5ea3d2){return function(_0x5d72ae){var _0x4618d4=_0x5ea3d2[_0x59cc('0x50')]({'plain':!![]});_0x4618d4[_0x59cc('0x51')]=[];if(_0x5d72ae){_0x4618d4[_0x59cc('0x52')]=_0x5d72ae['createdAt'];_0x4618d4[_0x59cc('0x53')]=_0x5d72ae;}else{_0x4618d4[_0x59cc('0x52')]=moment(0x0)[_0x59cc('0x54')](_0x59cc('0x55'));_0x4618d4[_0x59cc('0x53')]={};}return _0x4618d4;};}exports[_0x59cc('0x56')]=function(_0x595018,_0xe07234,_0x1c7141){var _0x1ce1bf=[];return db[_0x59cc('0x57')][_0x59cc('0x48')]({'where':{'role':[_0x59cc('0x58'),_0x59cc('0x59'),'user']},'attributes':['id',_0x59cc('0x5a'),_0x59cc('0x2f'),'role',_0x59cc('0x5b'),_0x59cc('0x5c'),_0x59cc('0x5d'),_0x59cc('0x5e'),'allowmessenger',_0x59cc('0x5f')],'order':qs[_0x59cc('0x40')](_0x59cc('0x60')),'include':[{'model':db[_0x59cc('0x61')],'as':_0x59cc('0x62'),'attributes':['id','name',_0x59cc('0x35')],'through':{'attributes':[]}}]})[_0x59cc('0x2c')](function(_0x2078f6){if(_0x2078f6){var _0x5e2f23=_0x595018[_0x59cc('0x63')][_0x59cc('0x50')]({'plain':!![]});if(!_0x5e2f23)throw new Error(_0x59cc('0x64'));if(_0x5e2f23[_0x59cc('0x65')]===_0x59cc('0x63')){return db['UserProfileSection'][_0x59cc('0x4c')]({'where':{'name':_0x59cc('0x66'),'userProfileId':_0x5e2f23['userProfileId']},'raw':!![]})['then'](function(_0x3f1d9c){if(_0x3f1d9c){if(_0x3f1d9c[_0x59cc('0x67')]===0x0){return db[_0x59cc('0x68')][_0x59cc('0x48')]({'where':{'sectionId':_0x3f1d9c['id']},'raw':!![]})[_0x59cc('0x2c')](function(_0x4d0ee3){var _0x1544f1=[];if(_['isEmpty'](_0x4d0ee3)){_0x1544f1=_[_0x59cc('0x44')](_0x2078f6,function(_0x5dc7ed){if(_0x5dc7ed[_0x59cc('0x65')]!=='agent'){return _0x5dc7ed;}});return _0x1544f1;}else{for(var _0x233060=0x0;_0x233060<_0x2078f6['length'];_0x233060++){var _0x4abd51=_0x2078f6[_0x233060];if(_0x4abd51['role']===_0x59cc('0x58')){var _0x5c3881=_[_0x59cc('0x4c')](_0x4d0ee3,function(_0xdb29d8){return _0xdb29d8[_0x59cc('0x69')]===_0x4abd51['id'];});if(_0x5c3881)_0x1544f1['push'](_0x4abd51);}else{_0x1544f1[_0x59cc('0x6a')](_0x4abd51);}}return _0x1544f1;}});}else{return _0x2078f6;}}else{var _0x1f6b10=_[_0x59cc('0x44')](_0x2078f6,function(_0x56146a){if(_0x56146a[_0x59cc('0x65')]!==_0x59cc('0x58')){return _0x56146a;}});return _0x1f6b10;}});}else{return _0x2078f6;}}})[_0x59cc('0x2c')](function(_0x20c18d){var _0x1b451b=[];if(_0x20c18d){_0x1ce1bf=_0x20c18d;for(var _0x41508b=0x0;_0x41508b<_0x20c18d[_0x59cc('0x6b')];_0x41508b+=0x1){_0x1ce1bf[_0x41508b][_0x59cc('0x51')]=[];_0x1b451b[_0x59cc('0x6a')](db[_0x59cc('0x32')][_0x59cc('0x4c')]({'where':{'FromId':[_0x595018[_0x59cc('0x63')]['id'],_0x20c18d[_0x41508b]['id']],'ToId':[_0x595018[_0x59cc('0x63')]['id'],_0x20c18d[_0x41508b]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x59cc('0x6c'),_0x59cc('0x6d'),'read','body'],'order':qs['sort'](_0x59cc('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x20c18d[_0x41508b])));}return BPromise[_0x59cc('0x6f')](_0x1b451b);}return[];})['then'](function(_0x4eb0fc){return{'rows':_0x4eb0fc,'count':_0x4eb0fc[_0x59cc('0x6b')]};})['then'](respondWithResult(_0xe07234,null))[_0x59cc('0x49')](handleError(_0xe07234,null));};
\ No newline at end of file
+var _0xbab8=['api','../../config/utils','../../config/environment','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','catch','includeAll','options','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','length','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xbab8,0x1a9));var _0x8bab=function(_0x2afadf,_0x57fb00){_0x2afadf=_0x2afadf-0x0;var _0x3f0571=_0xbab8[_0x2afadf];return _0x3f0571;};'use strict';var emlformat=require(_0x8bab('0x0'));var rimraf=require(_0x8bab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bab('0x2'));var rp=require(_0x8bab('0x3'));var moment=require(_0x8bab('0x4'));var BPromise=require(_0x8bab('0x5'));var Mustache=require(_0x8bab('0x6'));var util=require(_0x8bab('0x7'));var path=require(_0x8bab('0x8'));var sox=require(_0x8bab('0x9'));var csv=require(_0x8bab('0xa'));var ejs=require(_0x8bab('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bab('0xc'));var squel=require('squel');var crypto=require(_0x8bab('0xd'));var jsforce=require(_0x8bab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8bab('0xa'));var querystring=require(_0x8bab('0xf'));var Papa=require(_0x8bab('0x10'));var Redis=require(_0x8bab('0x11'));var authService=require(_0x8bab('0x12'));var qs=require(_0x8bab('0x13'));var as=require(_0x8bab('0x14'));var hardwareService=require(_0x8bab('0x15'));var logger=require(_0x8bab('0x16'))(_0x8bab('0x17'));var utils=require(_0x8bab('0x18'));var config=require(_0x8bab('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8bab('0x1a')]=_['defaults'](config[_0x8bab('0x1a')],{'host':_0x8bab('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bab('0x1a')]));require(_0x8bab('0x1c'))[_0x8bab('0x1d')](socket);function respondWithStatusCode(_0x56f461,_0xf2996e){_0xf2996e=_0xf2996e||0xcc;return function(_0x57d8bf){if(_0x57d8bf){return _0x56f461[_0x8bab('0x1e')](_0xf2996e);}return _0x56f461['status'](_0xf2996e)[_0x8bab('0x1f')]();};}function respondWithResult(_0x51a431,_0x2a674c){_0x2a674c=_0x2a674c||0xc8;return function(_0x1b6937){if(_0x1b6937){return _0x51a431['status'](_0x2a674c)[_0x8bab('0x20')](_0x1b6937);}};}function respondWithFilteredResult(_0x155dad,_0x3088b9){return function(_0x3ec238){if(_0x3ec238){var _0x2f407b=typeof _0x3088b9[_0x8bab('0x21')]===_0x8bab('0x22')&&typeof _0x3088b9[_0x8bab('0x23')]==='undefined';var _0x445b26=_0x3ec238['count'];var _0x511ad4=_0x2f407b?0x0:_0x3088b9[_0x8bab('0x21')];var _0x5cf245=_0x2f407b?_0x3ec238[_0x8bab('0x24')]:_0x3088b9[_0x8bab('0x21')]+_0x3088b9[_0x8bab('0x23')];var _0x5a60cd;if(_0x5cf245>=_0x445b26){_0x5cf245=_0x445b26;_0x5a60cd=0xc8;}else{_0x5a60cd=0xce;}_0x155dad[_0x8bab('0x25')](_0x5a60cd);return _0x155dad[_0x8bab('0x26')](_0x8bab('0x27'),_0x511ad4+'-'+_0x5cf245+'/'+_0x445b26)[_0x8bab('0x20')](_0x3ec238);}return null;};}function patchUpdates(_0x28e208){return function(_0x43b35c){try{jsonpatch[_0x8bab('0x28')](_0x43b35c,_0x28e208,!![]);}catch(_0x3719d0){return BPromise['reject'](_0x3719d0);}return _0x43b35c[_0x8bab('0x29')]();};}function saveUpdates(_0x6dfe4a,_0x5ab9da){return function(_0x48e5e4){if(_0x48e5e4){return _0x48e5e4[_0x8bab('0x2a')](_0x6dfe4a)[_0x8bab('0x2b')](function(_0x4e3780){return _0x4e3780;});}return null;};}function removeEntity(_0x3d9090,_0x2bc8db){return function(_0x2108e9){if(_0x2108e9){return _0x2108e9[_0x8bab('0x2c')]()[_0x8bab('0x2b')](function(){_0x3d9090['status'](0xcc)[_0x8bab('0x1f')]();});}};}function handleEntityNotFound(_0x2a657d,_0x592e4e){return function(_0x401902){if(!_0x401902){_0x2a657d[_0x8bab('0x1e')](0x194);}return _0x401902;};}function handleError(_0x337ef6,_0x3c436e){_0x3c436e=_0x3c436e||0x1f4;return function(_0x28fa1a){logger[_0x8bab('0x2d')](_0x28fa1a['stack']);if(_0x28fa1a[_0x8bab('0x2e')]){delete _0x28fa1a[_0x8bab('0x2e')];}_0x337ef6['status'](_0x3c436e)[_0x8bab('0x2f')](_0x28fa1a);};}exports['index']=function(_0x55dff0,_0x10b031){var _0x490f79={},_0x7713d2={},_0x3b8f9d={'count':0x0,'rows':[]};var _0x37c510=_[_0x8bab('0x30')](db[_0x8bab('0x31')][_0x8bab('0x32')],function(_0x3cc735){return{'name':_0x3cc735[_0x8bab('0x33')],'type':_0x3cc735[_0x8bab('0x34')][_0x8bab('0x35')]};});_0x7713d2[_0x8bab('0x36')]=_['map'](_0x37c510,'name');_0x7713d2[_0x8bab('0x37')]=_[_0x8bab('0x38')](_0x55dff0[_0x8bab('0x37')]);_0x7713d2[_0x8bab('0x39')]=_['intersection'](_0x7713d2[_0x8bab('0x36')],_0x7713d2[_0x8bab('0x37')]);_0x490f79[_0x8bab('0x3a')]=_[_0x8bab('0x3b')](_0x7713d2[_0x8bab('0x36')],qs['fields'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3c')]));_0x490f79[_0x8bab('0x3a')]=_0x490f79[_0x8bab('0x3a')]['length']?_0x490f79[_0x8bab('0x3a')]:_0x7713d2[_0x8bab('0x36')];if(!_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3d')]('nolimit')){_0x490f79[_0x8bab('0x23')]=qs['limit'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x23')]);_0x490f79[_0x8bab('0x21')]=qs[_0x8bab('0x21')](_0x55dff0['query']['offset']);}_0x490f79[_0x8bab('0x3e')]=qs['sort'](_0x55dff0[_0x8bab('0x37')][_0x8bab('0x3f')]);_0x490f79[_0x8bab('0x40')]=qs[_0x8bab('0x39')](_[_0x8bab('0x41')](_0x55dff0[_0x8bab('0x37')],_0x7713d2[_0x8bab('0x39')]),_0x37c510);if(_0x55dff0['query']['filter']){_0x490f79[_0x8bab('0x40')]=_[_0x8bab('0x42')](_0x490f79[_0x8bab('0x40')],{'$or':_[_0x8bab('0x30')](_0x37c510,function(_0x345498){if(_0x345498[_0x8bab('0x34')]!==_0x8bab('0x43')){var _0x1d2387={};_0x1d2387[_0x345498[_0x8bab('0x2e')]]={'$like':'%'+_0x55dff0['query'][_0x8bab('0x44')]+'%'};return _0x1d2387;}})});}_0x490f79=_[_0x8bab('0x42')]({},_0x490f79,_0x55dff0['options']);var _0xa4ee8d={'where':_0x490f79[_0x8bab('0x40')]};return db[_0x8bab('0x31')][_0x8bab('0x24')](_0xa4ee8d)[_0x8bab('0x2b')](function(_0x3a3850){_0x3b8f9d[_0x8bab('0x24')]=_0x3a3850;if(_0x55dff0[_0x8bab('0x37')]['includeAll']){_0x490f79[_0x8bab('0x45')]=[{'all':!![]}];}return db[_0x8bab('0x31')][_0x8bab('0x46')](_0x490f79);})[_0x8bab('0x2b')](function(_0x265282){_0x3b8f9d['rows']=_0x265282;return _0x3b8f9d;})[_0x8bab('0x2b')](respondWithFilteredResult(_0x10b031,_0x490f79))[_0x8bab('0x47')](handleError(_0x10b031,null));};exports['show']=function(_0x5bfefc,_0x1aec2f){var _0xae76f2={'raw':!![],'where':{'id':_0x5bfefc['params']['id']}},_0x461770={};_0x461770['model']=_[_0x8bab('0x38')](db[_0x8bab('0x31')][_0x8bab('0x32')]);_0x461770['query']=_[_0x8bab('0x38')](_0x5bfefc['query']);_0x461770[_0x8bab('0x39')]=_[_0x8bab('0x3b')](_0x461770[_0x8bab('0x36')],_0x461770['query']);_0xae76f2[_0x8bab('0x3a')]=_[_0x8bab('0x3b')](_0x461770[_0x8bab('0x36')],qs[_0x8bab('0x3c')](_0x5bfefc[_0x8bab('0x37')][_0x8bab('0x3c')]));_0xae76f2[_0x8bab('0x3a')]=_0xae76f2[_0x8bab('0x3a')]['length']?_0xae76f2[_0x8bab('0x3a')]:_0x461770[_0x8bab('0x36')];if(_0x5bfefc[_0x8bab('0x37')][_0x8bab('0x48')]){_0xae76f2['include']=[{'all':!![]}];}_0xae76f2=_['merge']({},_0xae76f2,_0x5bfefc[_0x8bab('0x49')]);return db[_0x8bab('0x31')][_0x8bab('0x4a')](_0xae76f2)[_0x8bab('0x2b')](handleEntityNotFound(_0x1aec2f,null))[_0x8bab('0x2b')](respondWithResult(_0x1aec2f,null))[_0x8bab('0x47')](handleError(_0x1aec2f,null));};exports[_0x8bab('0x4b')]=function(_0x54de49,_0x2d7b04){return db['ChatInternalMessage'][_0x8bab('0x4b')](_0x54de49[_0x8bab('0x4c')],{})[_0x8bab('0x2b')](respondWithResult(_0x2d7b04,0xc9))[_0x8bab('0x47')](handleError(_0x2d7b04,null));};exports['update']=function(_0x145c69,_0x4ed244){if(_0x145c69[_0x8bab('0x4c')]['id']){delete _0x145c69[_0x8bab('0x4c')]['id'];}return db['ChatInternalMessage'][_0x8bab('0x4a')]({'where':{'id':_0x145c69[_0x8bab('0x4d')]['id']}})[_0x8bab('0x2b')](handleEntityNotFound(_0x4ed244,null))['then'](saveUpdates(_0x145c69[_0x8bab('0x4c')],null))[_0x8bab('0x2b')](respondWithResult(_0x4ed244,null))[_0x8bab('0x47')](handleError(_0x4ed244,null));};exports['destroy']=function(_0x982fa3,_0x308aa2){return db['ChatInternalMessage'][_0x8bab('0x4a')]({'where':{'id':_0x982fa3[_0x8bab('0x4d')]['id']}})[_0x8bab('0x2b')](handleEntityNotFound(_0x308aa2,null))[_0x8bab('0x2b')](removeEntity(_0x308aa2,null))[_0x8bab('0x47')](handleError(_0x308aa2,null));};exports[_0x8bab('0x4e')]=function(_0x30c108,_0x2e694c){return db[_0x8bab('0x31')]['describe']()[_0x8bab('0x2b')](respondWithResult(_0x2e694c,null))[_0x8bab('0x47')](handleError(_0x2e694c,null));};function wrapUser(_0x1fda55){return function(_0x1766e3){var _0x3b7e8b=_0x1fda55[_0x8bab('0x4f')]({'plain':!![]});_0x3b7e8b[_0x8bab('0x50')]=[];if(_0x1766e3){_0x3b7e8b[_0x8bab('0x51')]=_0x1766e3['createdAt'];_0x3b7e8b[_0x8bab('0x52')]=_0x1766e3;}else{_0x3b7e8b['lastMessageAt']=moment(0x0)[_0x8bab('0x53')](_0x8bab('0x54'));_0x3b7e8b[_0x8bab('0x52')]={};}return _0x3b7e8b;};}exports[_0x8bab('0x55')]=function(_0x8534ad,_0x1a459a,_0xf45e8c){var _0x130dee=[];return db[_0x8bab('0x56')]['findAll']({'where':{'role':[_0x8bab('0x57'),_0x8bab('0x58'),_0x8bab('0x59')]},'attributes':['id','fullname',_0x8bab('0x2e'),_0x8bab('0x5a'),_0x8bab('0x5b'),_0x8bab('0x5c'),_0x8bab('0x5d'),_0x8bab('0x5e'),_0x8bab('0x5f'),_0x8bab('0x60')],'order':qs[_0x8bab('0x3f')](_0x8bab('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x8bab('0x62'),'attributes':['id','name',_0x8bab('0x34')],'through':{'attributes':[]}}]})[_0x8bab('0x2b')](function(_0x16f828){if(_0x16f828){var _0x5f01c1=_0x8534ad['user']['get']({'plain':!![]});if(!_0x5f01c1)throw new Error(_0x8bab('0x63'));if(_0x5f01c1[_0x8bab('0x5a')]===_0x8bab('0x59')){return db[_0x8bab('0x64')][_0x8bab('0x4a')]({'where':{'name':_0x8bab('0x65'),'userProfileId':_0x5f01c1[_0x8bab('0x66')]},'raw':!![]})[_0x8bab('0x2b')](function(_0x523c35){if(_0x523c35){if(_0x523c35[_0x8bab('0x67')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x523c35['id']},'raw':!![]})[_0x8bab('0x2b')](function(_0x44dfa9){var _0x72bb33=[];if(_[_0x8bab('0x68')](_0x44dfa9)){_0x72bb33=_['filter'](_0x16f828,function(_0x51dff6){if(_0x51dff6[_0x8bab('0x5a')]!==_0x8bab('0x57')){return _0x51dff6;}});return _0x72bb33;}else{for(var _0x32046d=0x0;_0x32046d<_0x16f828[_0x8bab('0x69')];_0x32046d++){var _0x684f16=_0x16f828[_0x32046d];if(_0x684f16['role']===_0x8bab('0x57')){var _0x3ecd68=_[_0x8bab('0x4a')](_0x44dfa9,function(_0x24e595){return _0x24e595[_0x8bab('0x6a')]===_0x684f16['id'];});if(_0x3ecd68)_0x72bb33[_0x8bab('0x6b')](_0x684f16);}else{_0x72bb33[_0x8bab('0x6b')](_0x684f16);}}return _0x72bb33;}});}else{return _0x16f828;}}else{var _0x3028ef=_['filter'](_0x16f828,function(_0xf009e0){if(_0xf009e0[_0x8bab('0x5a')]!==_0x8bab('0x57')){return _0xf009e0;}});return _0x3028ef;}});}else{return _0x16f828;}}})[_0x8bab('0x2b')](function(_0x322bad){var _0x4c0507=[];if(_0x322bad){_0x130dee=_0x322bad;for(var _0x5525f0=0x0;_0x5525f0<_0x322bad[_0x8bab('0x69')];_0x5525f0+=0x1){_0x130dee[_0x5525f0][_0x8bab('0x50')]=[];_0x4c0507[_0x8bab('0x6b')](db[_0x8bab('0x31')]['find']({'where':{'FromId':[_0x8534ad[_0x8bab('0x59')]['id'],_0x322bad[_0x5525f0]['id']],'ToId':[_0x8534ad[_0x8bab('0x59')]['id'],_0x322bad[_0x5525f0]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x8bab('0x6c'),_0x8bab('0x6d'),'body'],'order':qs['sort'](_0x8bab('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bab('0x2b')](wrapUser(_0x322bad[_0x5525f0])));}return BPromise[_0x8bab('0x6f')](_0x4c0507);}return[];})[_0x8bab('0x2b')](function(_0x489722){return{'rows':_0x489722,'count':_0x489722[_0x8bab('0x69')]};})['then'](respondWithResult(_0x1a459a,null))[_0x8bab('0x47')](handleError(_0x1a459a,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 3808b1c..e6cc384 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 _0x1833=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1833,0x1c5));var _0x3183=function(_0x255a85,_0x43ea4c){_0x255a85=_0x255a85-0x0;var _0x5ee089=_0x1833[_0x255a85];return _0x5ee089;};'use strict';var EventEmitter=require(_0x3183('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x3183('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3183('0x2')](0x0);var events={'afterCreate':_0x3183('0x3'),'afterUpdate':_0x3183('0x4'),'afterDestroy':_0x3183('0x5')};function emitEvent(_0xa85c8e){return function(_0x2c7562,_0x3490fe,_0x41278b){ChatInternalMessageEvents[_0x3183('0x6')](_0xa85c8e+':'+_0x2c7562['id'],_0x2c7562);ChatInternalMessageEvents['emit'](_0xa85c8e,_0x2c7562);_0x41278b(null);};}for(var e in events){if(events[_0x3183('0x7')](e)){var event=events[e];ChatInternalMessage[_0x3183('0x8')](e,emitEvent(event));}}module[_0x3183('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xca31=['hasOwnProperty','hook','events','ChatInternalMessage','save','update','remove','emit'];(function(_0x593f71,_0x5a1195){var _0x16496d=function(_0x5ecae7){while(--_0x5ecae7){_0x593f71['push'](_0x593f71['shift']());}};_0x16496d(++_0x5a1195);}(_0xca31,0x18a));var _0x1ca3=function(_0x4b8fc7,_0x5022fc){_0x4b8fc7=_0x4b8fc7-0x0;var _0x249f4a=_0xca31[_0x4b8fc7];return _0x249f4a;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1ca3('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ca3('0x2'),'afterUpdate':_0x1ca3('0x3'),'afterDestroy':_0x1ca3('0x4')};function emitEvent(_0x291c3c){return function(_0x437ff8,_0x3810a8,_0x178368){ChatInternalMessageEvents[_0x1ca3('0x5')](_0x291c3c+':'+_0x437ff8['id'],_0x437ff8);ChatInternalMessageEvents[_0x1ca3('0x5')](_0x291c3c,_0x437ff8);_0x178368(null);};}for(var e in events){if(events[_0x1ca3('0x6')](e)){var event=events[e];ChatInternalMessage[_0x1ca3('0x7')](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 c8e5580..56028bc 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 _0x9220=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','utf8mb4_unicode_ci'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x9220,0x168));var _0x0922=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x9220[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x0922('0x0'));var util=require('util');var logger=require(_0x0922('0x1'))(_0x0922('0x2'));var moment=require(_0x0922('0x3'));var BPromise=require('bluebird');var rp=require(_0x0922('0x4'));var fs=require('fs');var path=require(_0x0922('0x5'));var rimraf=require('rimraf');var config=require(_0x0922('0x6'));var attributes=require(_0x0922('0x7'));module['exports']=function(_0x938df5,_0xf6992e){return _0x938df5['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0922('0x8')});};
\ No newline at end of file
+var _0xca9d=['ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment','path','./chatInternalMessage.attributes','exports','define'];(function(_0x586b29,_0xd64934){var _0x21ed04=function(_0xe0c5e3){while(--_0xe0c5e3){_0x586b29['push'](_0x586b29['shift']());}};_0x21ed04(++_0xd64934);}(_0xca9d,0x1e3));var _0xdca9=function(_0x225a00,_0x5b9f00){_0x225a00=_0x225a00-0x0;var _0x5f446f=_0xca9d[_0x225a00];return _0x5f446f;};'use strict';var _=require(_0xdca9('0x0'));var util=require(_0xdca9('0x1'));var logger=require(_0xdca9('0x2'))(_0xdca9('0x3'));var moment=require(_0xdca9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdca9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdca9('0x6'));module[_0xdca9('0x7')]=function(_0xf119f0,_0x285b4e){return _0xf119f0[_0xdca9('0x8')](_0xdca9('0x9'),attributes,{'tableName':_0xdca9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdca9('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 62dd7c1..1831067 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 _0x1c73=['stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x17616c,_0x164437){var _0x98b3b9=function(_0x5d153b){while(--_0x5d153b){_0x17616c['push'](_0x17616c['shift']());}};_0x98b3b9(++_0x164437);}(_0x1c73,0x76));var _0x31c7=function(_0x752093,_0x2e2670){_0x752093=_0x752093-0x0;var _0x3a6ab5=_0x1c73[_0x752093];return _0x3a6ab5;};'use strict';var _=require('lodash');var util=require(_0x31c7('0x0'));var moment=require(_0x31c7('0x1'));var BPromise=require('bluebird');var rs=require(_0x31c7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31c7('0x3'))['db'];var utils=require(_0x31c7('0x4'));var logger=require(_0x31c7('0x5'))(_0x31c7('0x6'));var config=require(_0x31c7('0x7'));var jayson=require(_0x31c7('0x8'));var client=jayson[_0x31c7('0x9')][_0x31c7('0xa')]({'port':0x232a});config[_0x31c7('0xb')]=_[_0x31c7('0xc')](config['redis'],{'host':_0x31c7('0xd'),'port':0x18eb});var socket=require(_0x31c7('0xe'))(new Redis(config[_0x31c7('0xb')]));require('./chatInternalMessage.socket')[_0x31c7('0xf')](socket);function respondWithRpcPromise(_0x4fcecc,_0x3adf59,_0x24a6fd){return new BPromise(function(_0x21da54,_0x39cb12){return client['request'](_0x4fcecc,_0x24a6fd)[_0x31c7('0x10')](function(_0x52de0d){logger[_0x31c7('0x11')](_0x31c7('0x12'),_0x3adf59,_0x31c7('0x13'));logger[_0x31c7('0x14')](_0x31c7('0x15'),_0x3adf59,_0x31c7('0x13'),JSON[_0x31c7('0x16')](_0x52de0d));if(_0x52de0d[_0x31c7('0x17')]){if(_0x52de0d[_0x31c7('0x17')][_0x31c7('0x18')]===0x1f4){logger[_0x31c7('0x17')](_0x31c7('0x12'),_0x3adf59,_0x52de0d[_0x31c7('0x17')]['message']);return _0x39cb12(_0x52de0d[_0x31c7('0x17')]['message']);}logger[_0x31c7('0x17')](_0x31c7('0x12'),_0x3adf59,_0x52de0d[_0x31c7('0x17')][_0x31c7('0x19')]);return _0x21da54(_0x52de0d['error'][_0x31c7('0x19')]);}else{logger[_0x31c7('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x3adf59,_0x31c7('0x13'));_0x21da54(_0x52de0d[_0x31c7('0x1a')][_0x31c7('0x19')]);}})[_0x31c7('0x1b')](function(_0x1510c5){logger[_0x31c7('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3adf59,_0x1510c5);_0x39cb12(_0x1510c5);});});}
\ No newline at end of file
+var _0x0c0d=['rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatInternalMessage,\x20%s,\x20%s','info','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21b57f,_0x9ba5fb){var _0x3dac6f=function(_0x449042){while(--_0x449042){_0x21b57f['push'](_0x21b57f['shift']());}};_0x3dac6f(++_0x9ba5fb);}(_0x0c0d,0x1b4));var _0xd0c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0c0d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd0c0('0x0'));var util=require(_0xd0c0('0x1'));var moment=require(_0xd0c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0c0('0x3'))['db'];var utils=require(_0xd0c0('0x4'));var logger=require(_0xd0c0('0x5'))(_0xd0c0('0x6'));var config=require(_0xd0c0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0c0('0x8')][_0xd0c0('0x9')]({'port':0x232a});config['redis']=_[_0xd0c0('0xa')](config[_0xd0c0('0xb')],{'host':_0xd0c0('0xc'),'port':0x18eb});var socket=require(_0xd0c0('0xd'))(new Redis(config[_0xd0c0('0xb')]));require(_0xd0c0('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c379b,_0x328e84,_0x2ab98e){return new BPromise(function(_0x43cf7f,_0x2a5d3d){return client[_0xd0c0('0xf')](_0x2c379b,_0x2ab98e)[_0xd0c0('0x10')](function(_0x10b009){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0xd0c0('0x11'));logger[_0xd0c0('0x12')](_0xd0c0('0x13'),_0x328e84,_0xd0c0('0x11'),JSON['stringify'](_0x10b009));if(_0x10b009[_0xd0c0('0x14')]){if(_0x10b009['error'][_0xd0c0('0x15')]===0x1f4){logger[_0xd0c0('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0x10b009[_0xd0c0('0x14')][_0xd0c0('0x16')]);return _0x2a5d3d(_0x10b009[_0xd0c0('0x14')][_0xd0c0('0x16')]);}logger['error'](_0xd0c0('0x17'),_0x328e84,_0x10b009[_0xd0c0('0x14')]['message']);return _0x43cf7f(_0x10b009['error']['message']);}else{logger[_0xd0c0('0x18')](_0xd0c0('0x17'),_0x328e84,_0xd0c0('0x11'));_0x43cf7f(_0x10b009[_0xd0c0('0x19')][_0xd0c0('0x16')]);}})['catch'](function(_0x44b068){logger[_0xd0c0('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x328e84,_0x44b068);_0x2a5d3d(_0x44b068);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 255202b..3a09daa 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 _0x0471=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x581c55,_0x5b74d7){var _0x57b8a9=function(_0xc9efc4){while(--_0xc9efc4){_0x581c55['push'](_0x581c55['shift']());}};_0x57b8a9(++_0x5b74d7);}(_0x0471,0x1c6));var _0x1047=function(_0x56fa66,_0x574504){_0x56fa66=_0x56fa66-0x0;var _0x1ba609=_0x0471[_0x56fa66];return _0x1ba609;};'use strict';var ChatInternalMessageEvents=require(_0x1047('0x0'));var events=[_0x1047('0x1'),_0x1047('0x2'),_0x1047('0x3')];function createListener(_0x513545,_0x56ba73){return function(_0x64c078){_0x56ba73[_0x1047('0x4')](_0x513545,_0x64c078);};}function removeListener(_0xe2d334,_0x1e2823){return function(){ChatInternalMessageEvents[_0x1047('0x5')](_0xe2d334,_0x1e2823);};}exports[_0x1047('0x6')]=function(_0x51489a){for(var _0x2a973c=0x0,_0x160369=events[_0x1047('0x7')];_0x2a973c<_0x160369;_0x2a973c++){var _0x450d0e=events[_0x2a973c];var _0x8b1da0=createListener('chatInternalMessage:'+_0x450d0e,_0x51489a);ChatInternalMessageEvents['on'](_0x450d0e,_0x8b1da0);}};
\ No newline at end of file
+var _0x22d4=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x22d4,0x19a));var _0x422d=function(_0x268e0c,_0x1ef7d1){_0x268e0c=_0x268e0c-0x0;var _0x97a5fb=_0x22d4[_0x268e0c];return _0x97a5fb;};'use strict';var ChatInternalMessageEvents=require(_0x422d('0x0'));var events=[_0x422d('0x1'),_0x422d('0x2'),_0x422d('0x3')];function createListener(_0x2753b3,_0x51fbf0){return function(_0x504930){_0x51fbf0[_0x422d('0x4')](_0x2753b3,_0x504930);};}function removeListener(_0x55708f,_0x4fc65e){return function(){ChatInternalMessageEvents[_0x422d('0x5')](_0x55708f,_0x4fc65e);};}exports[_0x422d('0x6')]=function(_0x5794c6){for(var _0x41e833=0x0,_0x6bda32=events[_0x422d('0x7')];_0x41e833<_0x6bda32;_0x41e833++){var _0x142212=events[_0x41e833];var _0x3b311f=createListener(_0x422d('0x8')+_0x142212,_0x5794c6);ChatInternalMessageEvents['on'](_0x142212,_0x3b311f);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e6ee395..7b23f11 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 _0x4a04=['post','put','/:id','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','/describe','getUsers','show'];(function(_0x52f0d2,_0x4e3071){var _0x23f388=function(_0x238fac){while(--_0x238fac){_0x52f0d2['push'](_0x52f0d2['shift']());}};_0x23f388(++_0x4e3071);}(_0x4a04,0x18c));var _0x44a0=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x4a04[_0x5ac0f0];return _0x4aceec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x44a0('0x0'));var timeout=require(_0x44a0('0x1'));var express=require(_0x44a0('0x2'));var router=express[_0x44a0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x44a0('0x4'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x44a0('0x5')]('/',auth[_0x44a0('0x6')](),controller['index']);router['get'](_0x44a0('0x7'),auth[_0x44a0('0x6')](),controller['describe']);router['get']('/users',auth[_0x44a0('0x6')](),controller[_0x44a0('0x8')]);router[_0x44a0('0x5')]('/:id',auth[_0x44a0('0x6')](),controller[_0x44a0('0x9')]);router[_0x44a0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44a0('0xb')](_0x44a0('0xc'),controller['update']);router['delete'](_0x44a0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x44a0('0xd')]=router;
\ No newline at end of file
+var _0xda26=['/:id','show','post','create','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','getUsers'];(function(_0x1311ff,_0x3989de){var _0x33e544=function(_0x3666f1){while(--_0x3666f1){_0x1311ff['push'](_0x1311ff['shift']());}};_0x33e544(++_0x3989de);}(_0xda26,0xf4));var _0x6da2=function(_0x2301b4,_0x3c0cdf){_0x2301b4=_0x2301b4-0x0;var _0x2bd394=_0xda26[_0x2301b4];return _0x2bd394;};'use strict';var multer=require('multer');var util=require(_0x6da2('0x0'));var path=require(_0x6da2('0x1'));var timeout=require(_0x6da2('0x2'));var express=require(_0x6da2('0x3'));var router=express[_0x6da2('0x4')]();var fs_extra=require(_0x6da2('0x5'));var auth=require(_0x6da2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x6da2('0x7')](),controller['index']);router[_0x6da2('0x8')](_0x6da2('0x9'),auth[_0x6da2('0x7')](),controller['describe']);router[_0x6da2('0x8')]('/users',auth[_0x6da2('0x7')](),controller[_0x6da2('0xa')]);router[_0x6da2('0x8')](_0x6da2('0xb'),auth[_0x6da2('0x7')](),controller[_0x6da2('0xc')]);router[_0x6da2('0xd')]('/',auth[_0x6da2('0x7')](),controller[_0x6da2('0xe')]);router['put']('/:id',controller['update']);router[_0x6da2('0xf')](_0x6da2('0xb'),auth[_0x6da2('0x7')](),controller['destroy']);module[_0x6da2('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ef8e534..34fcbf5 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 _0x7269=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x7269,0x76));var _0x9726=function(_0x40fac1,_0x3eb487){_0x40fac1=_0x40fac1-0x0;var _0x19f481=_0x7269[_0x40fac1];return _0x19f481;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'body':{'type':Sequelize[_0x9726('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9726('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9726('0x4')]('in','out'),'defaultValue':_0x9726('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9726('0x6')]},'providerName':{'type':Sequelize[_0x9726('0x7')]},'providerResponse':{'type':Sequelize[_0x9726('0x2')]}};
\ No newline at end of file
+var _0x9c32=['STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x23ff18,_0x24a203){var _0x37f748=function(_0x5b25e5){while(--_0x5b25e5){_0x23ff18['push'](_0x23ff18['shift']());}};_0x37f748(++_0x24a203);}(_0x9c32,0x15d));var _0x29c3=function(_0x3bb0cf,_0x1d2000){_0x3bb0cf=_0x3bb0cf-0x0;var _0x4d88f7=_0x9c32[_0x3bb0cf];return _0x4d88f7;};'use strict';var Sequelize=require(_0x29c3('0x0'));module[_0x29c3('0x1')]={'body':{'type':Sequelize[_0x29c3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x29c3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x29c3('0x4')),'defaultValue':_0x29c3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x29c3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 87ba5fd..81fbe2c 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 _0x60f7=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','params','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','acceptmessage','parse','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x60f7,0xf2));var _0x760f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x60f7[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x760f('0x0'));var rimraf=require(_0x760f('0x1'));var zipdir=require(_0x760f('0x2'));var jsonpatch=require(_0x760f('0x3'));var rp=require('request-promise');var moment=require(_0x760f('0x4'));var BPromise=require(_0x760f('0x5'));var Mustache=require('mustache');var util=require(_0x760f('0x6'));var path=require(_0x760f('0x7'));var sox=require(_0x760f('0x8'));var csv=require(_0x760f('0x9'));var ejs=require(_0x760f('0xa'));var fs=require('fs');var fs_extra=require(_0x760f('0xb'));var _=require(_0x760f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x760f('0xd'));var deskjs=require(_0x760f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x760f('0xf'));var Papa=require(_0x760f('0x10'));var Redis=require(_0x760f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x760f('0x12'));var as=require(_0x760f('0x13'));var hardwareService=require(_0x760f('0x14'));var logger=require(_0x760f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x760f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x760f('0x17'))['db'];config[_0x760f('0x18')]=_[_0x760f('0x19')](config[_0x760f('0x18')],{'host':_0x760f('0x1a'),'port':0x18eb});var socket=require(_0x760f('0x1b'))(new Redis(config[_0x760f('0x18')]));require(_0x760f('0x1c'))[_0x760f('0x1d')](socket);var jayson=require(_0x760f('0x1e'));var client=jayson[_0x760f('0x1f')][_0x760f('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x760f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x19e9a4,_0x36cfb2,_0x2a76f8,_0x5094c9){return new BPromise(function(_0x32a834,_0x4f4285){var _0x4acf38=_0x5094c9||client;return _0x4acf38[_0x760f('0x21')](_0x19e9a4,_0x2a76f8)[_0x760f('0x22')](function(_0x48431c){logger[_0x760f('0x23')]('ChatMessage,\x20%s,\x20%s',_0x36cfb2,_0x760f('0x24'));logger[_0x760f('0x25')](_0x760f('0x26'),_0x36cfb2,_0x760f('0x24'),JSON[_0x760f('0x27')](_0x48431c));if(_0x48431c[_0x760f('0x28')]){if(_0x48431c[_0x760f('0x28')]['code']===0x1f4){logger[_0x760f('0x28')](_0x760f('0x29'),_0x36cfb2,_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);return _0x4f4285(_0x48431c['error'][_0x760f('0x2a')]);}logger['error'](_0x760f('0x29'),_0x36cfb2,_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);return _0x32a834(_0x48431c[_0x760f('0x28')][_0x760f('0x2a')]);}else{logger['info'](_0x760f('0x29'),_0x36cfb2,_0x760f('0x24'));_0x32a834(_0x48431c[_0x760f('0x2b')][_0x760f('0x2a')]);}})[_0x760f('0x2c')](function(_0x58bfae){logger[_0x760f('0x28')](_0x760f('0x29'),_0x36cfb2,_0x58bfae);_0x4f4285(_0x58bfae);});});}function respondWithStatusCode(_0x4d9e05,_0x4e05f1){_0x4e05f1=_0x4e05f1||0xcc;return function(_0x59ba6f){if(_0x59ba6f){return _0x4d9e05[_0x760f('0x2d')](_0x4e05f1);}return _0x4d9e05[_0x760f('0x2e')](_0x4e05f1)[_0x760f('0x2f')]();};}function respondWithResult(_0xdf26a3,_0x181d37){_0x181d37=_0x181d37||0xc8;return function(_0x264b70){if(_0x264b70){return _0xdf26a3[_0x760f('0x2e')](_0x181d37)[_0x760f('0x30')](_0x264b70);}};}function respondWithFilteredResult(_0x51cb09,_0x70e253){return function(_0x4f3f8c){if(_0x4f3f8c){var _0x1c18bd=typeof _0x70e253[_0x760f('0x31')]==='undefined'&&typeof _0x70e253[_0x760f('0x32')]===_0x760f('0x33');var _0x5a7b34=_0x4f3f8c[_0x760f('0x34')];var _0x138aac=_0x1c18bd?0x0:_0x70e253['offset'];var _0x4e0ac6=_0x1c18bd?_0x4f3f8c[_0x760f('0x34')]:_0x70e253[_0x760f('0x31')]+_0x70e253[_0x760f('0x32')];var _0x51dd99;if(_0x4e0ac6>=_0x5a7b34){_0x4e0ac6=_0x5a7b34;_0x51dd99=0xc8;}else{_0x51dd99=0xce;}_0x51cb09['status'](_0x51dd99);return _0x51cb09[_0x760f('0x35')](_0x760f('0x36'),_0x138aac+'-'+_0x4e0ac6+'/'+_0x5a7b34)[_0x760f('0x30')](_0x4f3f8c);}return null;};}function patchUpdates(_0x174390){return function(_0x58b96a){try{jsonpatch[_0x760f('0x37')](_0x58b96a,_0x174390,!![]);}catch(_0x332b1d){return BPromise[_0x760f('0x38')](_0x332b1d);}return _0x58b96a[_0x760f('0x39')]();};}function saveUpdates(_0x5de0a3,_0x2b9130){return function(_0x125f0c){if(_0x125f0c){return _0x125f0c[_0x760f('0x3a')](_0x5de0a3)[_0x760f('0x22')](function(_0x375513){return _0x375513;});}return null;};}function removeEntity(_0x433c47,_0x47af39){return function(_0x268886){if(_0x268886){return _0x268886[_0x760f('0x3b')]()[_0x760f('0x22')](function(){_0x433c47['status'](0xcc)[_0x760f('0x2f')]();});}};}function handleEntityNotFound(_0x4fd517,_0x1e5be2){return function(_0x30e137){if(!_0x30e137){_0x4fd517[_0x760f('0x2d')](0x194);}return _0x30e137;};}function handleError(_0x3a1b3f,_0x479a37){_0x479a37=_0x479a37||0x1f4;return function(_0xf2a649){logger[_0x760f('0x28')](_0xf2a649[_0x760f('0x3c')]);if(_0xf2a649[_0x760f('0x3d')]){delete _0xf2a649[_0x760f('0x3d')];}_0x3a1b3f['status'](_0x479a37)[_0x760f('0x3e')](_0xf2a649);};}exports[_0x760f('0x3f')]=function(_0x5b371b,_0x1b0548){var _0x357a4c={},_0x5a9314={},_0xa63e3c={'count':0x0,'rows':[]};var _0x2e9999=_[_0x760f('0x40')](db[_0x760f('0x41')][_0x760f('0x42')],function(_0x53d087){return{'name':_0x53d087['fieldName'],'type':_0x53d087[_0x760f('0x43')][_0x760f('0x44')]};});_0x5a9314[_0x760f('0x45')]=_[_0x760f('0x40')](_0x2e9999,_0x760f('0x3d'));_0x5a9314[_0x760f('0x46')]=_[_0x760f('0x47')](_0x5b371b[_0x760f('0x46')]);_0x5a9314[_0x760f('0x48')]=_[_0x760f('0x49')](_0x5a9314['model'],_0x5a9314[_0x760f('0x46')]);_0x357a4c[_0x760f('0x4a')]=_['intersection'](_0x5a9314[_0x760f('0x45')],qs[_0x760f('0x4b')](_0x5b371b['query']['fields']));_0x357a4c['attributes']=_0x357a4c['attributes'][_0x760f('0x4c')]?_0x357a4c[_0x760f('0x4a')]:_0x5a9314[_0x760f('0x45')];if(!_0x5b371b[_0x760f('0x46')]['hasOwnProperty']('nolimit')){_0x357a4c[_0x760f('0x32')]=qs['limit'](_0x5b371b[_0x760f('0x46')][_0x760f('0x32')]);_0x357a4c['offset']=qs[_0x760f('0x31')](_0x5b371b[_0x760f('0x46')]['offset']);}_0x357a4c['order']=qs[_0x760f('0x4d')](_0x5b371b[_0x760f('0x46')]['sort']);_0x357a4c['where']=qs['filters'](_['pick'](_0x5b371b[_0x760f('0x46')],_0x5a9314['filters']),_0x2e9999);if(_0x5b371b[_0x760f('0x46')][_0x760f('0x4e')]){_0x357a4c['where']=_[_0x760f('0x4f')](_0x357a4c[_0x760f('0x50')],{'$or':_[_0x760f('0x40')](_0x2e9999,function(_0x2a348f){if(_0x2a348f[_0x760f('0x43')]!==_0x760f('0x51')){var _0x382c50={};_0x382c50[_0x2a348f[_0x760f('0x3d')]]={'$like':'%'+_0x5b371b[_0x760f('0x46')]['filter']+'%'};return _0x382c50;}})});}_0x357a4c=_[_0x760f('0x4f')]({},_0x357a4c,_0x5b371b[_0x760f('0x52')]);var _0x579dd4={'where':_0x357a4c['where']};return db[_0x760f('0x41')][_0x760f('0x34')](_0x579dd4)[_0x760f('0x22')](function(_0x1c9581){_0xa63e3c[_0x760f('0x34')]=_0x1c9581;if(_0x5b371b['query'][_0x760f('0x53')]){_0x357a4c[_0x760f('0x54')]=[{'all':!![]}];}return db[_0x760f('0x41')][_0x760f('0x55')](_0x357a4c);})[_0x760f('0x22')](function(_0x9ae91){_0xa63e3c[_0x760f('0x56')]=_0x9ae91;return _0xa63e3c;})[_0x760f('0x22')](respondWithFilteredResult(_0x1b0548,_0x357a4c))[_0x760f('0x2c')](handleError(_0x1b0548,null));};exports['show']=function(_0x4c303f,_0x46aac2){var _0x15e3bc={'raw':!![],'where':{'id':_0x4c303f['params']['id']}},_0xda4dc8={};_0xda4dc8[_0x760f('0x45')]=_[_0x760f('0x47')](db[_0x760f('0x41')][_0x760f('0x42')]);_0xda4dc8[_0x760f('0x46')]=_[_0x760f('0x47')](_0x4c303f['query']);_0xda4dc8[_0x760f('0x48')]=_[_0x760f('0x49')](_0xda4dc8['model'],_0xda4dc8[_0x760f('0x46')]);_0x15e3bc[_0x760f('0x4a')]=_[_0x760f('0x49')](_0xda4dc8[_0x760f('0x45')],qs[_0x760f('0x4b')](_0x4c303f[_0x760f('0x46')][_0x760f('0x4b')]));_0x15e3bc[_0x760f('0x4a')]=_0x15e3bc['attributes'][_0x760f('0x4c')]?_0x15e3bc[_0x760f('0x4a')]:_0xda4dc8[_0x760f('0x45')];if(_0x4c303f[_0x760f('0x46')][_0x760f('0x53')]){_0x15e3bc['include']=[{'all':!![]}];}_0x15e3bc=_[_0x760f('0x4f')]({},_0x15e3bc,_0x4c303f['options']);return db[_0x760f('0x41')][_0x760f('0x57')](_0x15e3bc)['then'](handleEntityNotFound(_0x46aac2,null))[_0x760f('0x22')](respondWithResult(_0x46aac2,null))[_0x760f('0x2c')](handleError(_0x46aac2,null));};exports[_0x760f('0x58')]=function(_0x189996,_0x2e6365){return db['ChatMessage'][_0x760f('0x58')](_0x189996[_0x760f('0x59')],{})[_0x760f('0x22')](respondWithResult(_0x2e6365,0xc9))[_0x760f('0x2c')](handleError(_0x2e6365,null));};exports[_0x760f('0x3a')]=function(_0x234875,_0x4c9383){if(_0x234875[_0x760f('0x59')]['id']){delete _0x234875[_0x760f('0x59')]['id'];}return db[_0x760f('0x41')]['find']({'where':{'id':_0x234875[_0x760f('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c9383,null))[_0x760f('0x22')](saveUpdates(_0x234875[_0x760f('0x59')],null))[_0x760f('0x22')](respondWithResult(_0x4c9383,null))[_0x760f('0x2c')](handleError(_0x4c9383,null));};exports[_0x760f('0x3b')]=function(_0x1fecec,_0x32122f){return db['ChatMessage'][_0x760f('0x57')]({'where':{'id':_0x1fecec[_0x760f('0x5a')]['id']}})[_0x760f('0x22')](handleEntityNotFound(_0x32122f,null))[_0x760f('0x22')](removeEntity(_0x32122f,null))[_0x760f('0x2c')](handleError(_0x32122f,null));};exports['describe']=function(_0x1fbcc8,_0x3e983c){return db[_0x760f('0x41')]['describe']()[_0x760f('0x22')](respondWithResult(_0x3e983c,null))[_0x760f('0x2c')](handleError(_0x3e983c,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x56d984,_0xab966,_0x1c01c7){var _0x561b4b={'agent':{},'channel':_0x760f('0x5b')};if(_0x56d984[_0x760f('0x59')]['id']){delete _0x56d984[_0x760f('0x59')]['id'];}_0x56d984[_0x760f('0x59')][_0x760f('0x5c')]=!![];_0x56d984[_0x760f('0x59')][_0x760f('0x5d')]=moment()['format'](_0x760f('0x5e'));_0x56d984[_0x760f('0x59')][_0x760f('0x5f')]=_0x56d984[_0x760f('0x59')][_0x760f('0x5f')]||_0x56d984[_0x760f('0x60')]['id'];_0x561b4b['agent']['id']=_0x56d984[_0x760f('0x59')][_0x760f('0x5f')];return db[_0x760f('0x41')][_0x760f('0x57')]({'where':{'id':_0x56d984[_0x760f('0x5a')]['id'],'UserId':null}})[_0x760f('0x22')](handleEntityNotFound(_0xab966,null))[_0x760f('0x22')](saveUpdates(_0x56d984[_0x760f('0x59')],null))[_0x760f('0x22')](function(_0x4a0723){if(_0x4a0723){_0x561b4b[_0x760f('0x2a')]=_0x4a0723['get']({'plain':!![]});return db[_0x760f('0x61')][_0x760f('0x57')]({'where':{'id':_0x4a0723[_0x760f('0x62')]}});}return null;})['then'](handleEntityNotFound(_0xab966,null))[_0x760f('0x22')](function(_0x513f1d){if(_0x513f1d){return _0x513f1d[_0x760f('0x3a')]({'UserId':_0x56d984['body'][_0x760f('0x5f')],'read1stAt':_[_0x760f('0x63')](_0x513f1d[_0x760f('0x64')])?moment()[_0x760f('0x65')](_0x760f('0x5e')):undefined});}return null;})[_0x760f('0x22')](function(_0x3d6db1){if(_0x3d6db1){_0x561b4b[_0x760f('0x66')]=_0x3d6db1['get']({'plain':!![]});interaction_log[_0x760f('0x23')](_0x760f('0x67'),_0x56d984[_0x760f('0x60')]['id'],_0x56d984[_0x760f('0x60')][_0x760f('0x3d')],_0x56d984[_0x760f('0x60')][_0x760f('0x68')],_0x561b4b['interaction']['id'],_0x56d984[_0x760f('0x59')]?JSON[_0x760f('0x27')](_0x56d984[_0x760f('0x59')]):_0x760f('0x69'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x561b4b);}return null;})['then'](function(_0x424c52){var _0x3453aa=_0x760f('0x6a')+_0x424c52['message'][_0x760f('0x6b')];return db[_0x760f('0x6c')][_0x760f('0x46')](_0x3453aa,{'type':db[_0x760f('0x6d')][_0x760f('0x6e')][_0x760f('0x6f')],'raw':!![]})[_0x760f('0x22')](function(_0x4495b6){return _0x4495b6;});})[_0x760f('0x22')](function(_0x21fd20){if(_0x21fd20){_0x561b4b[_0x760f('0x2a')][_0x760f('0x70')]=_0x21fd20[0x0];if(!_0x56d984[_0x760f('0x59')]['UserId'])return;return db[_0x760f('0x71')][_0x760f('0x57')]({'where':{'id':_0x56d984['body'][_0x760f('0x5f')],'role':_0x760f('0x72')},'attributes':['id','name',_0x760f('0x73'),_0x760f('0x74'),'internal'],'raw':!![]});}return null;})[_0x760f('0x22')](function(_0x4a173d){if(!_0x4a173d)return null;_0x561b4b[_0x760f('0x2a')][_0x760f('0x72')]=_0x4a173d;return _0x561b4b;})[_0x760f('0x22')](function(_0x1237ad){if(_0x1237ad){if(_0x56d984[_0x760f('0x59')][_0x760f('0x75')]){_0x561b4b[_0x760f('0x2a')][_0x760f('0x76')]=util[_0x760f('0x65')](_0x760f('0x77'),_0x56d984['user'][_0x760f('0x3d')]);_0x561b4b[_0x760f('0x2a')][_0x760f('0x78')]=_0x561b4b[_0x760f('0x78')];_0x561b4b[_0x760f('0x2a')][_0x760f('0x79')]=_0x561b4b[_0x760f('0x78')];_0x561b4b[_0x760f('0x2a')][_0x760f('0x7a')]=_0x760f('0x7b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x760f('0x7c'),'message':_[_0x760f('0x4f')](_0x561b4b[_0x760f('0x2a')],JSON[_0x760f('0x7d')](_0x561b4b[_0x760f('0x66')]['formData']))},client9002)['then'](function(){return _0x561b4b;});}return _0x561b4b;}return null;})[_0x760f('0x22')](respondWithResult(_0xab966,null))[_0x760f('0x2c')](handleError(_0xab966,null));};var interaction_log=require(_0x760f('0x15'))(_0x760f('0x7e'));exports['reject']=function(_0x54ca1b,_0x3d66c5,_0xd9bbff){var _0x2048e6={'agent':{},'channel':_0x760f('0x5b')};if(_0x54ca1b[_0x760f('0x59')]['id']){delete _0x54ca1b[_0x760f('0x59')]['id'];}_0x54ca1b['body'][_0x760f('0x5f')]=_0x54ca1b[_0x760f('0x59')]['UserId']||_0x54ca1b[_0x760f('0x60')]['id'];_0x2048e6[_0x760f('0x72')]['id']=_0x54ca1b[_0x760f('0x59')][_0x760f('0x5f')];return db[_0x760f('0x41')][_0x760f('0x57')]({'where':{'id':_0x54ca1b[_0x760f('0x5a')]['id'],'UserId':null}})[_0x760f('0x22')](handleEntityNotFound(_0x3d66c5,null))[_0x760f('0x22')](function(_0x410d39){if(_0x410d39){_0x2048e6[_0x760f('0x2a')]=_0x410d39[_0x760f('0x7f')]({'plain':!![]});return db[_0x760f('0x61')]['find']({'where':{'id':_0x410d39['ChatInteractionId']}});}return null;})[_0x760f('0x22')](handleEntityNotFound(_0x3d66c5,null))['then'](function(_0x27d8dc){if(_0x27d8dc){_0x2048e6[_0x760f('0x66')]=_0x27d8dc['get']({'plain':!![]});interaction_log[_0x760f('0x23')](_0x760f('0x80'),_0x54ca1b['user']['id'],_0x54ca1b['user'][_0x760f('0x3d')],_0x54ca1b[_0x760f('0x60')][_0x760f('0x68')],_0x2048e6['interaction']['id'],_0x54ca1b[_0x760f('0x59')]?JSON['stringify'](_0x54ca1b[_0x760f('0x59')]):_0x760f('0x69'));return respondWithRpcPromise(_0x760f('0x81'),_0x760f('0x82'),_0x2048e6);}return null;})[_0x760f('0x22')](function(_0x511eeb){var _0x26a20e=_0x760f('0x6a')+_0x511eeb[_0x760f('0x2a')][_0x760f('0x6b')];return db[_0x760f('0x6c')]['query'](_0x26a20e,{'type':db[_0x760f('0x6d')][_0x760f('0x6e')][_0x760f('0x6f')],'raw':!![]})[_0x760f('0x22')](function(_0x2da5ef){return _0x2da5ef;});})[_0x760f('0x22')](function(_0x6b2d56){if(_0x6b2d56){_0x2048e6['message']['contact']=_0x6b2d56[0x0];if(!_0x54ca1b['body'][_0x760f('0x5f')])return;return db[_0x760f('0x71')][_0x760f('0x57')]({'where':{'id':_0x54ca1b[_0x760f('0x59')]['UserId'],'role':_0x760f('0x72')},'attributes':['id',_0x760f('0x3d'),_0x760f('0x73'),_0x760f('0x74'),'internal'],'raw':!![]});}return null;})[_0x760f('0x22')](function(_0x35562f){if(!_0x35562f)return null;_0x2048e6[_0x760f('0x2a')]['agent']=_0x35562f;return _0x2048e6;})[_0x760f('0x22')](function(_0x34d7d7){if(_0x34d7d7){_0x34d7d7[_0x760f('0x2a')][_0x760f('0x76')]=util[_0x760f('0x65')](_0x760f('0x77'),_0x54ca1b[_0x760f('0x60')][_0x760f('0x3d')]);_0x34d7d7['message'][_0x760f('0x78')]=_0x2048e6[_0x760f('0x78')];_0x34d7d7[_0x760f('0x2a')]['motionChannel']=_0x2048e6[_0x760f('0x78')];_0x34d7d7[_0x760f('0x2a')]['event']=_0x760f('0x38');respondWithRpcPromise(_0x760f('0x83'),_0x760f('0x83'),{'event':_0x760f('0x84'),'message':_[_0x760f('0x4f')](_0x2048e6[_0x760f('0x2a')],JSON[_0x760f('0x7d')](_0x2048e6[_0x760f('0x66')]['formData']))},client9002);return _0x2048e6;}return null;})['then'](respondWithResult(_0x3d66c5,null))[_0x760f('0x2c')](handleError(_0x3d66c5,null));};
\ No newline at end of file
+var _0x9328=['create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','RejectMessage','rejectMessage','contact','interface','reject','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9328,0x132));var _0x8932=function(_0x4619e0,_0x1a3451){_0x4619e0=_0x4619e0-0x0;var _0x47fe6e=_0x9328[_0x4619e0];return _0x47fe6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8932('0x0'));var zipdir=require(_0x8932('0x1'));var jsonpatch=require(_0x8932('0x2'));var rp=require(_0x8932('0x3'));var moment=require('moment');var BPromise=require(_0x8932('0x4'));var Mustache=require(_0x8932('0x5'));var util=require(_0x8932('0x6'));var path=require(_0x8932('0x7'));var sox=require('sox');var csv=require(_0x8932('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8932('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8932('0xa'));var jsforce=require(_0x8932('0xb'));var deskjs=require(_0x8932('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8932('0xd'));var Redis=require(_0x8932('0xe'));var authService=require(_0x8932('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8932('0x10'));var logger=require(_0x8932('0x11'))(_0x8932('0x12'));var utils=require(_0x8932('0x13'));var config=require(_0x8932('0x14'));var licenseUtil=require(_0x8932('0x15'));var db=require(_0x8932('0x16'))['db'];config['redis']=_['defaults'](config[_0x8932('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8932('0x18'))(new Redis(config[_0x8932('0x17')]));require('./chatMessage.socket')[_0x8932('0x19')](socket);var jayson=require(_0x8932('0x1a'));var client=jayson[_0x8932('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x8932('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4075,_0x275a4a,_0x549a29,_0x49e8c3){return new BPromise(function(_0x32799b,_0x95a154){var _0xda5ae1=_0x49e8c3||client;return _0xda5ae1[_0x8932('0x1c')](_0x1b4075,_0x549a29)[_0x8932('0x1d')](function(_0x321b14){logger[_0x8932('0x1e')](_0x8932('0x1f'),_0x275a4a,_0x8932('0x20'));logger['debug'](_0x8932('0x21'),_0x275a4a,'request\x20sent',JSON['stringify'](_0x321b14));if(_0x321b14[_0x8932('0x22')]){if(_0x321b14[_0x8932('0x22')][_0x8932('0x23')]===0x1f4){logger['error'](_0x8932('0x1f'),_0x275a4a,_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);return _0x95a154(_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);}logger[_0x8932('0x22')](_0x8932('0x1f'),_0x275a4a,_0x321b14[_0x8932('0x22')][_0x8932('0x24')]);return _0x32799b(_0x321b14[_0x8932('0x22')]['message']);}else{logger[_0x8932('0x1e')](_0x8932('0x1f'),_0x275a4a,'request\x20sent');_0x32799b(_0x321b14['result'][_0x8932('0x24')]);}})[_0x8932('0x25')](function(_0x59b5d5){logger[_0x8932('0x22')](_0x8932('0x1f'),_0x275a4a,_0x59b5d5);_0x95a154(_0x59b5d5);});});}function respondWithStatusCode(_0x4e579f,_0x49b2e5){_0x49b2e5=_0x49b2e5||0xcc;return function(_0x56d750){if(_0x56d750){return _0x4e579f[_0x8932('0x26')](_0x49b2e5);}return _0x4e579f[_0x8932('0x27')](_0x49b2e5)[_0x8932('0x28')]();};}function respondWithResult(_0x2203b4,_0x216126){_0x216126=_0x216126||0xc8;return function(_0x21dcfc){if(_0x21dcfc){return _0x2203b4['status'](_0x216126)[_0x8932('0x29')](_0x21dcfc);}};}function respondWithFilteredResult(_0x1f1242,_0x91d35c){return function(_0x5df794){if(_0x5df794){var _0x32e0ea=typeof _0x91d35c['offset']===_0x8932('0x2a')&&typeof _0x91d35c[_0x8932('0x2b')]===_0x8932('0x2a');var _0x14c77d=_0x5df794[_0x8932('0x2c')];var _0x396ec6=_0x32e0ea?0x0:_0x91d35c['offset'];var _0x4a702c=_0x32e0ea?_0x5df794[_0x8932('0x2c')]:_0x91d35c[_0x8932('0x2d')]+_0x91d35c[_0x8932('0x2b')];var _0x2cf174;if(_0x4a702c>=_0x14c77d){_0x4a702c=_0x14c77d;_0x2cf174=0xc8;}else{_0x2cf174=0xce;}_0x1f1242[_0x8932('0x27')](_0x2cf174);return _0x1f1242[_0x8932('0x2e')](_0x8932('0x2f'),_0x396ec6+'-'+_0x4a702c+'/'+_0x14c77d)['json'](_0x5df794);}return null;};}function patchUpdates(_0x1bed0f){return function(_0x38a2ed){try{jsonpatch[_0x8932('0x30')](_0x38a2ed,_0x1bed0f,!![]);}catch(_0x4ed93c){return BPromise['reject'](_0x4ed93c);}return _0x38a2ed[_0x8932('0x31')]();};}function saveUpdates(_0x39a9fd,_0x49fc89){return function(_0x10a24b){if(_0x10a24b){return _0x10a24b[_0x8932('0x32')](_0x39a9fd)[_0x8932('0x1d')](function(_0x39f30c){return _0x39f30c;});}return null;};}function removeEntity(_0x472cf7,_0x29df97){return function(_0x560694){if(_0x560694){return _0x560694[_0x8932('0x33')]()['then'](function(){_0x472cf7[_0x8932('0x27')](0xcc)[_0x8932('0x28')]();});}};}function handleEntityNotFound(_0x41f2d9,_0x1f1893){return function(_0x52e3a8){if(!_0x52e3a8){_0x41f2d9[_0x8932('0x26')](0x194);}return _0x52e3a8;};}function handleError(_0x5f1c5d,_0x5aef9e){_0x5aef9e=_0x5aef9e||0x1f4;return function(_0x47ab1d){logger[_0x8932('0x22')](_0x47ab1d[_0x8932('0x34')]);if(_0x47ab1d['name']){delete _0x47ab1d['name'];}_0x5f1c5d[_0x8932('0x27')](_0x5aef9e)['send'](_0x47ab1d);};}exports[_0x8932('0x35')]=function(_0x5d620a,_0x586564){var _0x1c2c40={},_0x304f7d={},_0x334701={'count':0x0,'rows':[]};var _0x5de2c9=_[_0x8932('0x36')](db[_0x8932('0x37')][_0x8932('0x38')],function(_0x25e0ea){return{'name':_0x25e0ea[_0x8932('0x39')],'type':_0x25e0ea[_0x8932('0x3a')][_0x8932('0x3b')]};});_0x304f7d[_0x8932('0x3c')]=_['map'](_0x5de2c9,_0x8932('0x3d'));_0x304f7d[_0x8932('0x3e')]=_[_0x8932('0x3f')](_0x5d620a[_0x8932('0x3e')]);_0x304f7d[_0x8932('0x40')]=_[_0x8932('0x41')](_0x304f7d['model'],_0x304f7d[_0x8932('0x3e')]);_0x1c2c40[_0x8932('0x42')]=_['intersection'](_0x304f7d['model'],qs[_0x8932('0x43')](_0x5d620a[_0x8932('0x3e')][_0x8932('0x43')]));_0x1c2c40['attributes']=_0x1c2c40[_0x8932('0x42')][_0x8932('0x44')]?_0x1c2c40[_0x8932('0x42')]:_0x304f7d[_0x8932('0x3c')];if(!_0x5d620a['query'][_0x8932('0x45')](_0x8932('0x46'))){_0x1c2c40[_0x8932('0x2b')]=qs[_0x8932('0x2b')](_0x5d620a[_0x8932('0x3e')][_0x8932('0x2b')]);_0x1c2c40['offset']=qs[_0x8932('0x2d')](_0x5d620a[_0x8932('0x3e')]['offset']);}_0x1c2c40['order']=qs[_0x8932('0x47')](_0x5d620a[_0x8932('0x3e')]['sort']);_0x1c2c40[_0x8932('0x48')]=qs['filters'](_[_0x8932('0x49')](_0x5d620a[_0x8932('0x3e')],_0x304f7d[_0x8932('0x40')]),_0x5de2c9);if(_0x5d620a[_0x8932('0x3e')][_0x8932('0x4a')]){_0x1c2c40[_0x8932('0x48')]=_[_0x8932('0x4b')](_0x1c2c40['where'],{'$or':_[_0x8932('0x36')](_0x5de2c9,function(_0x19df57){if(_0x19df57[_0x8932('0x3a')]!==_0x8932('0x4c')){var _0x46bb42={};_0x46bb42[_0x19df57['name']]={'$like':'%'+_0x5d620a[_0x8932('0x3e')]['filter']+'%'};return _0x46bb42;}})});}_0x1c2c40=_[_0x8932('0x4b')]({},_0x1c2c40,_0x5d620a[_0x8932('0x4d')]);var _0x2b8105={'where':_0x1c2c40[_0x8932('0x48')]};return db['ChatMessage']['count'](_0x2b8105)[_0x8932('0x1d')](function(_0x59f875){_0x334701[_0x8932('0x2c')]=_0x59f875;if(_0x5d620a[_0x8932('0x3e')][_0x8932('0x4e')]){_0x1c2c40[_0x8932('0x4f')]=[{'all':!![]}];}return db[_0x8932('0x37')][_0x8932('0x50')](_0x1c2c40);})['then'](function(_0x249f83){_0x334701['rows']=_0x249f83;return _0x334701;})[_0x8932('0x1d')](respondWithFilteredResult(_0x586564,_0x1c2c40))['catch'](handleError(_0x586564,null));};exports[_0x8932('0x51')]=function(_0xda7ddf,_0x2c0d00){var _0x4caedf={'raw':!![],'where':{'id':_0xda7ddf[_0x8932('0x52')]['id']}},_0x453292={};_0x453292['model']=_[_0x8932('0x3f')](db[_0x8932('0x37')][_0x8932('0x38')]);_0x453292['query']=_[_0x8932('0x3f')](_0xda7ddf[_0x8932('0x3e')]);_0x453292[_0x8932('0x40')]=_[_0x8932('0x41')](_0x453292[_0x8932('0x3c')],_0x453292[_0x8932('0x3e')]);_0x4caedf[_0x8932('0x42')]=_[_0x8932('0x41')](_0x453292['model'],qs[_0x8932('0x43')](_0xda7ddf[_0x8932('0x3e')][_0x8932('0x43')]));_0x4caedf[_0x8932('0x42')]=_0x4caedf[_0x8932('0x42')]['length']?_0x4caedf[_0x8932('0x42')]:_0x453292[_0x8932('0x3c')];if(_0xda7ddf[_0x8932('0x3e')][_0x8932('0x4e')]){_0x4caedf[_0x8932('0x4f')]=[{'all':!![]}];}_0x4caedf=_['merge']({},_0x4caedf,_0xda7ddf[_0x8932('0x4d')]);return db['ChatMessage'][_0x8932('0x53')](_0x4caedf)[_0x8932('0x1d')](handleEntityNotFound(_0x2c0d00,null))[_0x8932('0x1d')](respondWithResult(_0x2c0d00,null))['catch'](handleError(_0x2c0d00,null));};exports[_0x8932('0x54')]=function(_0x3f3318,_0x1ddc01){return db[_0x8932('0x37')][_0x8932('0x54')](_0x3f3318[_0x8932('0x55')],{})[_0x8932('0x1d')](respondWithResult(_0x1ddc01,0xc9))['catch'](handleError(_0x1ddc01,null));};exports[_0x8932('0x32')]=function(_0x183718,_0x4a90dd){if(_0x183718[_0x8932('0x55')]['id']){delete _0x183718[_0x8932('0x55')]['id'];}return db[_0x8932('0x37')][_0x8932('0x53')]({'where':{'id':_0x183718['params']['id']}})[_0x8932('0x1d')](handleEntityNotFound(_0x4a90dd,null))[_0x8932('0x1d')](saveUpdates(_0x183718[_0x8932('0x55')],null))[_0x8932('0x1d')](respondWithResult(_0x4a90dd,null))[_0x8932('0x25')](handleError(_0x4a90dd,null));};exports[_0x8932('0x33')]=function(_0x57af6c,_0x49b9c4){return db['ChatMessage']['find']({'where':{'id':_0x57af6c[_0x8932('0x52')]['id']}})[_0x8932('0x1d')](handleEntityNotFound(_0x49b9c4,null))[_0x8932('0x1d')](removeEntity(_0x49b9c4,null))[_0x8932('0x25')](handleError(_0x49b9c4,null));};exports[_0x8932('0x56')]=function(_0x5a47dc,_0x4296dd){return db[_0x8932('0x37')][_0x8932('0x56')]()['then'](respondWithResult(_0x4296dd,null))['catch'](handleError(_0x4296dd,null));};var interaction_log=require(_0x8932('0x11'))(_0x8932('0x57'));exports[_0x8932('0x58')]=function(_0x5cd1ab,_0x4d2654,_0xa12ca){var _0x292faf={'agent':{},'channel':_0x8932('0x59')};if(_0x5cd1ab[_0x8932('0x55')]['id']){delete _0x5cd1ab[_0x8932('0x55')]['id'];}_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5a')]=!![];_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5b')]=moment()[_0x8932('0x5c')](_0x8932('0x5d'));_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')]=_0x5cd1ab['body'][_0x8932('0x5e')]||_0x5cd1ab[_0x8932('0x5f')]['id'];_0x292faf['agent']['id']=_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')];return db[_0x8932('0x37')]['find']({'where':{'id':_0x5cd1ab[_0x8932('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d2654,null))[_0x8932('0x1d')](saveUpdates(_0x5cd1ab[_0x8932('0x55')],null))['then'](function(_0x167b85){if(_0x167b85){_0x292faf[_0x8932('0x24')]=_0x167b85[_0x8932('0x60')]({'plain':!![]});return db[_0x8932('0x61')][_0x8932('0x53')]({'where':{'id':_0x167b85[_0x8932('0x62')]}});}return null;})[_0x8932('0x1d')](handleEntityNotFound(_0x4d2654,null))['then'](function(_0x1f55fd){if(_0x1f55fd){return _0x1f55fd[_0x8932('0x32')]({'UserId':_0x5cd1ab['body'][_0x8932('0x5e')],'read1stAt':_[_0x8932('0x63')](_0x1f55fd[_0x8932('0x64')])?moment()[_0x8932('0x5c')](_0x8932('0x5d')):undefined});}return null;})[_0x8932('0x1d')](function(_0x182ef4){if(_0x182ef4){_0x292faf[_0x8932('0x65')]=_0x182ef4[_0x8932('0x60')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cd1ab[_0x8932('0x5f')]['id'],_0x5cd1ab[_0x8932('0x5f')][_0x8932('0x3d')],_0x5cd1ab[_0x8932('0x5f')][_0x8932('0x66')],_0x292faf['interaction']['id'],_0x5cd1ab[_0x8932('0x55')]?JSON['stringify'](_0x5cd1ab[_0x8932('0x55')]):_0x8932('0x67'));return respondWithRpcPromise(_0x8932('0x68'),'acceptMessage',_0x292faf);}return null;})[_0x8932('0x1d')](function(_0x1c6408){var _0x352d7a=_0x8932('0x69')+_0x1c6408[_0x8932('0x24')][_0x8932('0x6a')];return db[_0x8932('0x6b')][_0x8932('0x3e')](_0x352d7a,{'type':db[_0x8932('0x6c')][_0x8932('0x6d')][_0x8932('0x6e')],'raw':!![]})[_0x8932('0x1d')](function(_0x2940e5){return _0x2940e5;});})[_0x8932('0x1d')](function(_0x2309ae){if(_0x2309ae){_0x292faf[_0x8932('0x24')]['contact']=_0x2309ae[0x0];if(!_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')])return;return db[_0x8932('0x6f')][_0x8932('0x53')]({'where':{'id':_0x5cd1ab[_0x8932('0x55')][_0x8932('0x5e')],'role':_0x8932('0x70')},'attributes':['id',_0x8932('0x3d'),_0x8932('0x71'),_0x8932('0x72'),_0x8932('0x73')],'raw':!![]});}return null;})[_0x8932('0x1d')](function(_0x4f5584){if(!_0x4f5584)return null;_0x292faf[_0x8932('0x24')][_0x8932('0x70')]=_0x4f5584;return _0x292faf;})[_0x8932('0x1d')](function(_0x1066ac){if(_0x1066ac){if(_0x5cd1ab['body'][_0x8932('0x74')]){_0x292faf[_0x8932('0x24')]['interface']=util[_0x8932('0x5c')](_0x8932('0x75'),_0x5cd1ab['user'][_0x8932('0x3d')]);_0x292faf[_0x8932('0x24')][_0x8932('0x76')]=_0x292faf[_0x8932('0x76')];_0x292faf[_0x8932('0x24')]['motionChannel']=_0x292faf[_0x8932('0x76')];_0x292faf[_0x8932('0x24')][_0x8932('0x77')]=_0x8932('0x58');return respondWithRpcPromise('EventManager',_0x8932('0x78'),{'event':_0x8932('0x79'),'message':_[_0x8932('0x4b')](_0x292faf[_0x8932('0x24')],JSON[_0x8932('0x7a')](_0x292faf['interaction'][_0x8932('0x7b')]))},client9002)['then'](function(){return _0x292faf;});}return _0x292faf;}return null;})['then'](respondWithResult(_0x4d2654,null))[_0x8932('0x25')](handleError(_0x4d2654,null));};var interaction_log=require(_0x8932('0x11'))(_0x8932('0x57'));exports['reject']=function(_0x530551,_0x45c9f1,_0x6399f5){var _0x1b0ec9={'agent':{},'channel':_0x8932('0x59')};if(_0x530551[_0x8932('0x55')]['id']){delete _0x530551['body']['id'];}_0x530551[_0x8932('0x55')][_0x8932('0x5e')]=_0x530551[_0x8932('0x55')][_0x8932('0x5e')]||_0x530551['user']['id'];_0x1b0ec9['agent']['id']=_0x530551[_0x8932('0x55')]['UserId'];return db[_0x8932('0x37')]['find']({'where':{'id':_0x530551[_0x8932('0x52')]['id'],'UserId':null}})[_0x8932('0x1d')](handleEntityNotFound(_0x45c9f1,null))[_0x8932('0x1d')](function(_0x862868){if(_0x862868){_0x1b0ec9['message']=_0x862868['get']({'plain':!![]});return db[_0x8932('0x61')][_0x8932('0x53')]({'where':{'id':_0x862868[_0x8932('0x62')]}});}return null;})[_0x8932('0x1d')](handleEntityNotFound(_0x45c9f1,null))['then'](function(_0x63e50d){if(_0x63e50d){_0x1b0ec9[_0x8932('0x65')]=_0x63e50d['get']({'plain':!![]});interaction_log[_0x8932('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x530551[_0x8932('0x5f')]['id'],_0x530551[_0x8932('0x5f')][_0x8932('0x3d')],_0x530551[_0x8932('0x5f')]['role'],_0x1b0ec9[_0x8932('0x65')]['id'],_0x530551[_0x8932('0x55')]?JSON['stringify'](_0x530551['body']):'null');return respondWithRpcPromise(_0x8932('0x7c'),_0x8932('0x7d'),_0x1b0ec9);}return null;})['then'](function(_0x30c847){var _0x1a5027='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30c847[_0x8932('0x24')][_0x8932('0x6a')];return db[_0x8932('0x6b')][_0x8932('0x3e')](_0x1a5027,{'type':db[_0x8932('0x6c')][_0x8932('0x6d')][_0x8932('0x6e')],'raw':!![]})[_0x8932('0x1d')](function(_0x42de10){return _0x42de10;});})['then'](function(_0x162b36){if(_0x162b36){_0x1b0ec9[_0x8932('0x24')][_0x8932('0x7e')]=_0x162b36[0x0];if(!_0x530551[_0x8932('0x55')][_0x8932('0x5e')])return;return db[_0x8932('0x6f')]['find']({'where':{'id':_0x530551['body'][_0x8932('0x5e')],'role':_0x8932('0x70')},'attributes':['id',_0x8932('0x3d'),_0x8932('0x71'),_0x8932('0x72'),_0x8932('0x73')],'raw':!![]});}return null;})[_0x8932('0x1d')](function(_0x28e520){if(!_0x28e520)return null;_0x1b0ec9[_0x8932('0x24')][_0x8932('0x70')]=_0x28e520;return _0x1b0ec9;})['then'](function(_0x570fe7){if(_0x570fe7){_0x570fe7['message'][_0x8932('0x7f')]=util[_0x8932('0x5c')]('SIP/%s',_0x530551[_0x8932('0x5f')][_0x8932('0x3d')]);_0x570fe7[_0x8932('0x24')][_0x8932('0x76')]=_0x1b0ec9[_0x8932('0x76')];_0x570fe7['message']['motionChannel']=_0x1b0ec9[_0x8932('0x76')];_0x570fe7['message'][_0x8932('0x77')]=_0x8932('0x80');respondWithRpcPromise('EventManager',_0x8932('0x78'),{'event':_0x8932('0x81'),'message':_[_0x8932('0x4b')](_0x1b0ec9[_0x8932('0x24')],JSON[_0x8932('0x7a')](_0x1b0ec9['interaction'][_0x8932('0x7b')]))},client9002);return _0x1b0ec9;}return null;})['then'](respondWithResult(_0x45c9f1,null))[_0x8932('0x25')](handleError(_0x45c9f1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5228969..63a9440 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 _0x26b4=['../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0xbf9116,_0x1cb5b9){var _0x2dac1a=function(_0x1094f9){while(--_0x1094f9){_0xbf9116['push'](_0xbf9116['shift']());}};_0x2dac1a(++_0x1cb5b9);}(_0x26b4,0x1c6));var _0x426b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x26b4[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0x426b('0x0'));var ChatMessage=require(_0x426b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x426b('0x2')](0x0);var events={'afterCreate':_0x426b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x14fb08){return function(_0x438327,_0x1f7ee0,_0x55be5c){ChatMessageEvents[_0x426b('0x4')](_0x14fb08+':'+_0x438327['id'],_0x438327);ChatMessageEvents['emit'](_0x14fb08,_0x438327);_0x55be5c(null);};}for(var e in events){if(events[_0x426b('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x426b('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x0305=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x141e24,_0x371df2){var _0x4ca264=function(_0x1ca374){while(--_0x1ca374){_0x141e24['push'](_0x141e24['shift']());}};_0x4ca264(++_0x371df2);}(_0x0305,0x1c2));var _0x5030=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x0305[_0x186376];return _0x2dbdd9;};'use strict';var EventEmitter=require(_0x5030('0x0'));var ChatMessage=require(_0x5030('0x1'))['db'][_0x5030('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5030('0x3')](0x0);var events={'afterCreate':_0x5030('0x4'),'afterUpdate':'update','afterDestroy':_0x5030('0x5')};function emitEvent(_0x549538){return function(_0x2be260,_0x5902b7,_0x57916e){ChatMessageEvents[_0x5030('0x6')](_0x549538+':'+_0x2be260['id'],_0x2be260);ChatMessageEvents['emit'](_0x549538,_0x2be260);_0x57916e(null);};}for(var e in events){if(events[_0x5030('0x7')](e)){var event=events[e];ChatMessage[_0x5030('0x8')](e,emitEvent(event));}}module[_0x5030('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 c9714ef..0438cdc 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 _0x677b=['define','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0x677b,0xc8));var _0xb677=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x677b[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xb677('0x0'));var util=require(_0xb677('0x1'));var logger=require(_0xb677('0x2'))(_0xb677('0x3'));var moment=require('moment');var BPromise=require(_0xb677('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb677('0x5'));var config=require(_0xb677('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1810ec,_0x1cb5f9){return _0x1810ec[_0xb677('0x7')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb677('0x8'),'fields':[_0xb677('0x9')],'type':_0xb677('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42b7db,_0x5e0a78,_0x178ea7){var _0x1449fd=_0x1810ec[_0xb677('0xb')];var _0x3dba01=_0x42b7db['get']({'plain':!![]});if(_0x3dba01['direction'][_0xb677('0xc')]()==='in'||_0x3dba01[_0xb677('0xd')]['toLowerCase']()==='out'&&!_0x3dba01[_0xb677('0xe')]&&!_[_0xb677('0xf')](_0x3dba01[_0xb677('0x10')])){_0x1449fd[_0xb677('0x11')][_0xb677('0x12')]({'where':{'id':_0x3dba01['ChatInteractionId']}})[_0xb677('0x13')](function(_0x6c1dc1){if(_0x6c1dc1){_0x6c1dc1[_0xb677('0x14')]({'lastMsgAt':_0x3dba01[_0xb677('0x15')],'lastMsgDirection':_0x3dba01[_0xb677('0xd')]['toLowerCase']()});}})[_0xb677('0x16')](function(_0xe0ba6a){console['error'](_0xe0ba6a);});}_0x178ea7();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf418=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','get','direction','toLowerCase','out'];(function(_0x407398,_0x4555b0){var _0x5f2b5a=function(_0x38f13c){while(--_0x38f13c){_0x407398['push'](_0x407398['shift']());}};_0x5f2b5a(++_0x4555b0);}(_0xf418,0x1e3));var _0x8f41=function(_0x367800,_0x250785){_0x367800=_0x367800-0x0;var _0x30be0c=_0xf418[_0x367800];return _0x30be0c;};'use strict';var _=require(_0x8f41('0x0'));var util=require('util');var logger=require(_0x8f41('0x1'))('api');var moment=require(_0x8f41('0x2'));var BPromise=require(_0x8f41('0x3'));var rp=require(_0x8f41('0x4'));var fs=require('fs');var path=require(_0x8f41('0x5'));var rimraf=require('rimraf');var config=require(_0x8f41('0x6'));var attributes=require(_0x8f41('0x7'));module[_0x8f41('0x8')]=function(_0x133c9f,_0x54eff0){return _0x133c9f[_0x8f41('0x9')](_0x8f41('0xa'),attributes,{'tableName':_0x8f41('0xb'),'paranoid':![],'indexes':[{'name':_0x8f41('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x558f03,_0x27e0ce,_0x117ff8){var _0x2f625f=_0x133c9f['models'];var _0x33b888=_0x558f03[_0x8f41('0xd')]({'plain':!![]});if(_0x33b888[_0x8f41('0xe')]['toLowerCase']()==='in'||_0x33b888[_0x8f41('0xe')][_0x8f41('0xf')]()===_0x8f41('0x10')&&!_0x33b888['secret']&&!_[_0x8f41('0x11')](_0x33b888[_0x8f41('0x12')])){_0x2f625f[_0x8f41('0x13')][_0x8f41('0x14')]({'where':{'id':_0x33b888[_0x8f41('0x15')]}})['then'](function(_0x4be780){if(_0x4be780){_0x4be780['update']({'lastMsgAt':_0x33b888['createdAt'],'lastMsgDirection':_0x33b888[_0x8f41('0xe')][_0x8f41('0xf')]()});}})[_0x8f41('0x16')](function(_0x26a231){console['error'](_0x26a231);});}_0x117ff8();}},'charset':_0x8f41('0x17'),'collate':_0x8f41('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 0ea6030..96c6917 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 _0x41e0=['debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','request\x20sent'];(function(_0x6c006e,_0x68c984){var _0x15b66e=function(_0x5e98d9){while(--_0x5e98d9){_0x6c006e['push'](_0x6c006e['shift']());}};_0x15b66e(++_0x68c984);}(_0x41e0,0x1ef));var _0x041e=function(_0x2733f9,_0x54b7dc){_0x2733f9=_0x2733f9-0x0;var _0x53b12b=_0x41e0[_0x2733f9];return _0x53b12b;};'use strict';var _=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var moment=require(_0x041e('0x2'));var BPromise=require(_0x041e('0x3'));var rs=require(_0x041e('0x4'));var fs=require('fs');var Redis=require(_0x041e('0x5'));var db=require(_0x041e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x041e('0x7'))(_0x041e('0x8'));var config=require(_0x041e('0x9'));var jayson=require(_0x041e('0xa'));var client=jayson[_0x041e('0xb')][_0x041e('0xc')]({'port':0x232a});config['redis']=_[_0x041e('0xd')](config['redis'],{'host':_0x041e('0xe'),'port':0x18eb});var socket=require(_0x041e('0xf'))(new Redis(config[_0x041e('0x10')]));require(_0x041e('0x11'))[_0x041e('0x12')](socket);function respondWithRpcPromise(_0x1f2509,_0x4f3b45,_0x1c400f){return new BPromise(function(_0x49f284,_0x1b2385){return client[_0x041e('0x13')](_0x1f2509,_0x1c400f)[_0x041e('0x14')](function(_0xb129f4){logger[_0x041e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x4f3b45,_0x041e('0x16'));logger[_0x041e('0x17')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4f3b45,_0x041e('0x16'),JSON[_0x041e('0x18')](_0xb129f4));if(_0xb129f4[_0x041e('0x19')]){if(_0xb129f4[_0x041e('0x19')][_0x041e('0x1a')]===0x1f4){logger[_0x041e('0x19')](_0x041e('0x1b'),_0x4f3b45,_0xb129f4[_0x041e('0x19')][_0x041e('0x1c')]);return _0x1b2385(_0xb129f4['error'][_0x041e('0x1c')]);}logger[_0x041e('0x19')](_0x041e('0x1b'),_0x4f3b45,_0xb129f4[_0x041e('0x19')][_0x041e('0x1c')]);return _0x49f284(_0xb129f4[_0x041e('0x19')]['message']);}else{logger[_0x041e('0x15')](_0x041e('0x1b'),_0x4f3b45,_0x041e('0x16'));_0x49f284(_0xb129f4[_0x041e('0x1d')][_0x041e('0x1c')]);}})[_0x041e('0x1e')](function(_0x16d516){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4f3b45,_0x16d516);_0x1b2385(_0x16d516);});});}exports[_0x041e('0x1f')]=function(_0x3bae93){var _0x4f00bb=this;return new Promise(function(_0xd49b2,_0x2ca92){return db[_0x041e('0x20')][_0x041e('0x21')](_0x3bae93[_0x041e('0x22')],{'raw':_0x3bae93[_0x041e('0x23')]?_0x3bae93[_0x041e('0x23')][_0x041e('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x58a652){logger[_0x041e('0x15')]('CreateChatMessage',_0x3bae93);logger[_0x041e('0x17')](_0x041e('0x1f'),_0x3bae93,JSON[_0x041e('0x18')](_0x58a652));_0xd49b2(_0x58a652);})['catch'](function(_0x20ec38){logger['error'](_0x041e('0x1f'),_0x20ec38[_0x041e('0x1c')],_0x3bae93);_0x2ca92(_0x4f00bb[_0x041e('0x19')](0x1f4,_0x20ec38[_0x041e('0x1c')]));});});};
\ No newline at end of file
+var _0x6662=['ChatMessage,\x20%s,\x20%s','CreateChatMessage','create','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6662,0xec));var _0x2666=function(_0x5c7055,_0x550d42){_0x5c7055=_0x5c7055-0x0;var _0x20d196=_0x6662[_0x5c7055];return _0x20d196;};'use strict';var _=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var moment=require(_0x2666('0x2'));var BPromise=require(_0x2666('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2666('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2666('0x5'));var logger=require(_0x2666('0x6'))(_0x2666('0x7'));var config=require(_0x2666('0x8'));var jayson=require(_0x2666('0x9'));var client=jayson[_0x2666('0xa')]['http']({'port':0x232a});config[_0x2666('0xb')]=_[_0x2666('0xc')](config['redis'],{'host':_0x2666('0xd'),'port':0x18eb});var socket=require(_0x2666('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x2666('0xf')](socket);function respondWithRpcPromise(_0x271489,_0x55ad65,_0x446542){return new BPromise(function(_0x12180b,_0x366123){return client[_0x2666('0x10')](_0x271489,_0x446542)[_0x2666('0x11')](function(_0x1eab37){logger[_0x2666('0x12')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));logger[_0x2666('0x14')](_0x2666('0x15'),_0x55ad65,_0x2666('0x13'),JSON[_0x2666('0x16')](_0x1eab37));if(_0x1eab37['error']){if(_0x1eab37[_0x2666('0x17')][_0x2666('0x18')]===0x1f4){logger[_0x2666('0x17')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x1eab37['error']['message']);return _0x366123(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);return _0x12180b(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}else{logger[_0x2666('0x12')]('ChatMessage,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));_0x12180b(_0x1eab37[_0x2666('0x1a')][_0x2666('0x19')]);}})[_0x2666('0x1b')](function(_0x572edd){logger[_0x2666('0x17')](_0x2666('0x1c'),_0x55ad65,_0x572edd);_0x366123(_0x572edd);});});}exports[_0x2666('0x1d')]=function(_0x16510e){var _0x4f459d=this;return new Promise(function(_0x4d9b8f,_0x3a596e){return db['ChatMessage'][_0x2666('0x1e')](_0x16510e['body'],{'raw':_0x16510e[_0x2666('0x1f')]?_0x16510e['options'][_0x2666('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x52f3d6){logger[_0x2666('0x12')]('CreateChatMessage',_0x16510e);logger[_0x2666('0x14')](_0x2666('0x1d'),_0x16510e,JSON[_0x2666('0x16')](_0x52f3d6));_0x4d9b8f(_0x52f3d6);})['catch'](function(_0x3bbe46){logger[_0x2666('0x17')](_0x2666('0x1d'),_0x3bbe46['message'],_0x16510e);_0x3a596e(_0x4f459d[_0x2666('0x17')](0x1f4,_0x3bbe46[_0x2666('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 77a90ef..6a17846 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 _0x5a93=['save','update','emit','register','length','chatMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a93,0xf6));var _0x35a9=function(_0x22f70d,_0x7aa1a6){_0x22f70d=_0x22f70d-0x0;var _0x4da4c4=_0x5a93[_0x22f70d];return _0x4da4c4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x35a9('0x0'),'remove',_0x35a9('0x1')];function createListener(_0x9383e7,_0x55853a){return function(_0x55782b){_0x55853a[_0x35a9('0x2')](_0x9383e7,_0x55782b);};}function removeListener(_0xf10dcf,_0x3a23d6){return function(){ChatMessageEvents['removeListener'](_0xf10dcf,_0x3a23d6);};}exports[_0x35a9('0x3')]=function(_0x27ed9f){for(var _0x2e8a14=0x0,_0x354490=events[_0x35a9('0x4')];_0x2e8a14<_0x354490;_0x2e8a14++){var _0x45e6f7=events[_0x2e8a14];var _0x71d143=createListener(_0x35a9('0x5')+_0x45e6f7,_0x27ed9f);ChatMessageEvents['on'](_0x45e6f7,_0x71d143);}};
\ No newline at end of file
+var _0xd9ef=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x1ef32b,_0x20d139){var _0x546174=function(_0x35f7db){while(--_0x35f7db){_0x1ef32b['push'](_0x1ef32b['shift']());}};_0x546174(++_0x20d139);}(_0xd9ef,0x95));var _0xfd9e=function(_0x528406,_0x36c49b){_0x528406=_0x528406-0x0;var _0x30b0be=_0xd9ef[_0x528406];return _0x30b0be;};'use strict';var ChatMessageEvents=require(_0xfd9e('0x0'));var events=[_0xfd9e('0x1'),'remove',_0xfd9e('0x2')];function createListener(_0x55d1e2,_0x57c743){return function(_0x505f7f){_0x57c743[_0xfd9e('0x3')](_0x55d1e2,_0x505f7f);};}function removeListener(_0x28cfac,_0xe6990b){return function(){ChatMessageEvents[_0xfd9e('0x4')](_0x28cfac,_0xe6990b);};}exports[_0xfd9e('0x5')]=function(_0x178ceb){for(var _0x2d549f=0x0,_0x3c3dec=events[_0xfd9e('0x6')];_0x2d549f<_0x3c3dec;_0x2d549f++){var _0x302795=events[_0x2d549f];var _0xb61585=createListener(_0xfd9e('0x7')+_0x302795,_0x178ceb);ChatMessageEvents['on'](_0x302795,_0xb61585);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6e92036..a6d8253 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 _0xc557=['tracked','chat','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show'];(function(_0x275b6b,_0x15141a){var _0x47eaeb=function(_0x375eda){while(--_0x375eda){_0x275b6b['push'](_0x275b6b['shift']());}};_0x47eaeb(++_0x15141a);}(_0xc557,0x1c4));var _0x7c55=function(_0x1119c8,_0x87303e){_0x1119c8=_0x1119c8-0x0;var _0x3f3071=_0xc557[_0x1119c8];return _0x3f3071;};'use strict';var multer=require(_0x7c55('0x0'));var util=require(_0x7c55('0x1'));var path=require('path');var timeout=require(_0x7c55('0x2'));var express=require(_0x7c55('0x3'));var router=express['Router']();var fs_extra=require(_0x7c55('0x4'));var auth=require(_0x7c55('0x5'));var interaction=require(_0x7c55('0x6'));var config=require(_0x7c55('0x7'));var controller=require(_0x7c55('0x8'));router[_0x7c55('0x9')]('/',auth['isAuthenticated'](),controller[_0x7c55('0xa')]);router[_0x7c55('0x9')](_0x7c55('0xb'),auth['isAuthenticated'](),controller[_0x7c55('0xc')]);router[_0x7c55('0x9')](_0x7c55('0xd'),auth[_0x7c55('0xe')](),controller[_0x7c55('0xf')]);router['post']('/',auth[_0x7c55('0xe')](),interaction[_0x7c55('0x10')](_0x7c55('0x11'),_0x7c55('0x12')),controller['create']);router[_0x7c55('0x13')](_0x7c55('0xd'),controller[_0x7c55('0x14')]);router[_0x7c55('0x13')]('/:id/accept',auth[_0x7c55('0xe')](),controller[_0x7c55('0x15')]);router[_0x7c55('0x13')](_0x7c55('0x16'),auth['isAuthenticated'](),controller[_0x7c55('0x17')]);router[_0x7c55('0x18')]('/:id',auth[_0x7c55('0xe')](),controller[_0x7c55('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x7fd7=['isAuthenticated','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x1b68b3,_0x33a458){var _0x58705b=function(_0x2360db){while(--_0x2360db){_0x1b68b3['push'](_0x1b68b3['shift']());}};_0x58705b(++_0x33a458);}(_0x7fd7,0x99));var _0x77fd=function(_0x5b860f,_0x1be637){_0x5b860f=_0x5b860f-0x0;var _0x5bc5f9=_0x7fd7[_0x5b860f];return _0x5bc5f9;};'use strict';var multer=require(_0x77fd('0x0'));var util=require(_0x77fd('0x1'));var path=require(_0x77fd('0x2'));var timeout=require(_0x77fd('0x3'));var express=require(_0x77fd('0x4'));var router=express['Router']();var fs_extra=require(_0x77fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77fd('0x6'));var config=require(_0x77fd('0x7'));var controller=require(_0x77fd('0x8'));router['get']('/',auth[_0x77fd('0x9')](),controller['index']);router[_0x77fd('0xa')](_0x77fd('0xb'),auth[_0x77fd('0x9')](),controller[_0x77fd('0xc')]);router[_0x77fd('0xa')](_0x77fd('0xd'),auth[_0x77fd('0x9')](),controller[_0x77fd('0xe')]);router[_0x77fd('0xf')]('/',auth[_0x77fd('0x9')](),interaction[_0x77fd('0x10')](_0x77fd('0x11'),_0x77fd('0x12')),controller[_0x77fd('0x13')]);router[_0x77fd('0x14')](_0x77fd('0xd'),controller[_0x77fd('0x15')]);router[_0x77fd('0x14')](_0x77fd('0x16'),auth[_0x77fd('0x9')](),controller[_0x77fd('0x17')]);router[_0x77fd('0x14')](_0x77fd('0x18'),auth[_0x77fd('0x9')](),controller[_0x77fd('0x19')]);router[_0x77fd('0x1a')]('/:id',auth[_0x77fd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 9945ca3..91d493e 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 _0x26df=['medium','sequelize','exports'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x26df,0xa0));var _0xf26d=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x26df[_0x5f0501];return _0x3c2c45;};'use strict';var Sequelize=require(_0xf26d('0x0'));module[_0xf26d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf26d('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xcbf7=['medium','sequelize','exports','TEXT'];(function(_0x4871fc,_0x3e071c){var _0x5f0f75=function(_0xe5adca){while(--_0xe5adca){_0x4871fc['push'](_0x4871fc['shift']());}};_0x5f0f75(++_0x3e071c);}(_0xcbf7,0xf9));var _0x7cbf=function(_0x5bf099,_0x24f8c4){_0x5bf099=_0x5bf099-0x0;var _0x20da7d=_0xcbf7[_0x5bf099];return _0x20da7d;};'use strict';var Sequelize=require(_0x7cbf('0x0'));module[_0x7cbf('0x1')]={'body':{'type':Sequelize[_0x7cbf('0x2')](_0x7cbf('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2ae1022..63d881d 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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x29e705,_0x3ce3e4){_0x29e705=_0x29e705-0x0;var _0x97dc3a=_0x7a54[_0x29e705];return _0x97dc3a;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x59b47c,_0x551060){var _0x90abf2=function(_0x5bbe3d){while(--_0x5bbe3d){_0x59b47c['push'](_0x59b47c['shift']());}};_0x90abf2(++_0x551060);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index af2c8eb..4e1be8d 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 _0xd931=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x508ac9,_0x768b50){var _0x1bfc3f=function(_0x5ded16){while(--_0x5ded16){_0x508ac9['push'](_0x508ac9['shift']());}};_0x1bfc3f(++_0x768b50);}(_0xd931,0xa4));var _0x1d93=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0xd931[_0x1314d4];return _0x584ba5;};'use strict';var EventEmitter=require(_0x1d93('0x0'));var ChatOfflineMessage=require(_0x1d93('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1d93('0x2')](0x0);var events={'afterCreate':_0x1d93('0x3'),'afterUpdate':_0x1d93('0x4'),'afterDestroy':_0x1d93('0x5')};function emitEvent(_0x2f2d5b){return function(_0x4ddf9c,_0x4fed5e,_0x4b01a2){ChatOfflineMessageEvents[_0x1d93('0x6')](_0x2f2d5b+':'+_0x4ddf9c['id'],_0x4ddf9c);ChatOfflineMessageEvents[_0x1d93('0x6')](_0x2f2d5b,_0x4ddf9c);_0x4b01a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x1d93('0x7')](e,emitEvent(event));}}module[_0x1d93('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa949=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0xa949,0x1ea));var _0x9a94=function(_0x257983,_0x25376f){_0x257983=_0x257983-0x0;var _0x545254=_0xa949[_0x257983];return _0x545254;};'use strict';var EventEmitter=require(_0x9a94('0x0'));var ChatOfflineMessage=require(_0x9a94('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9a94('0x2')](0x0);var events={'afterCreate':_0x9a94('0x3'),'afterUpdate':_0x9a94('0x4'),'afterDestroy':_0x9a94('0x5')};function emitEvent(_0x31af74){return function(_0x201bf6,_0x413848,_0x212569){ChatOfflineMessageEvents[_0x9a94('0x6')](_0x31af74+':'+_0x201bf6['id'],_0x201bf6);ChatOfflineMessageEvents['emit'](_0x31af74,_0x201bf6);_0x212569(null);};}for(var e in events){if(events[_0x9a94('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9a94('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index effd3cc..3d48e6c 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 _0x5f6f=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','models','./chatOfflineMessage.attributes','exports'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x464bdc,_0xb0a019){_0x464bdc=_0x464bdc-0x0;var _0x1b1f84=_0x5f6f[_0x464bdc];return _0x1b1f84;};'use strict';var attributes=require(_0xf5f6('0x0'));module[_0xf5f6('0x1')]=function(_0x32a985){return _0x32a985[_0xf5f6('0x2')](_0xf5f6('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5f6('0x4'),'collate':_0xf5f6('0x5'),'hooks':{'afterCreate':function(_0x2f2e00,_0x58028b,_0x3dd995){var _0x40f59f=_0x32a985[_0xf5f6('0x6')];var _0xfda1c7=_0x2f2e00['get']({'plain':!![]});_0x3dd995();}}});};
\ No newline at end of file
+var _0x9c5a=['chat_offline_messages','utf8mb4','get','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0xb1bf96,_0x3590e8){var _0x3c2603=function(_0x381542){while(--_0x381542){_0xb1bf96['push'](_0xb1bf96['shift']());}};_0x3c2603(++_0x3590e8);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x21f339,_0x29eeac){_0x21f339=_0x21f339-0x0;var _0x39c51b=_0x9c5a[_0x21f339];return _0x39c51b;};'use strict';var attributes=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]=function(_0x5383c0){return _0x5383c0[_0xa9c5('0x2')](_0xa9c5('0x3'),attributes,{'tableName':_0xa9c5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9c5('0x5'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x2acfaf,_0x3051b1,_0x4e9403){var _0x1e3c83=_0x5383c0['models'];var _0x394d84=_0x2acfaf[_0xa9c5('0x6')]({'plain':!![]});_0x4e9403();}}});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f81a1ce..2fe11fe 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 _0xc918=['../../config/utils','rpc','client','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x467be0,_0x310857){var _0x5ae6a3=function(_0xfefd1b){while(--_0xfefd1b){_0x467be0['push'](_0x467be0['shift']());}};_0x5ae6a3(++_0x310857);}(_0xc918,0xb9));var _0x8c91=function(_0x21d912,_0x14f69c){_0x21d912=_0x21d912-0x0;var _0x370def=_0xc918[_0x21d912];return _0x370def;};'use strict';var _=require(_0x8c91('0x0'));var util=require(_0x8c91('0x1'));var moment=require('moment');var BPromise=require(_0x8c91('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c91('0x3'));var db=require(_0x8c91('0x4'))['db'];var utils=require(_0x8c91('0x5'));var logger=require('../../config/logger')(_0x8c91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c91('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d40da,_0x500111,_0x4843ef){return new BPromise(function(_0x5131b1,_0x4926f2){return client['request'](_0x4d40da,_0x4843ef)[_0x8c91('0x8')](function(_0x27976b){logger[_0x8c91('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x500111,'request\x20sent');logger[_0x8c91('0xa')](_0x8c91('0xb'),_0x500111,_0x8c91('0xc'),JSON['stringify'](_0x27976b));if(_0x27976b['error']){if(_0x27976b['error'][_0x8c91('0xd')]===0x1f4){logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x27976b[_0x8c91('0xe')][_0x8c91('0x10')]);return _0x4926f2(_0x27976b[_0x8c91('0xe')]['message']);}logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x27976b[_0x8c91('0xe')]['message']);return _0x5131b1(_0x27976b[_0x8c91('0xe')][_0x8c91('0x10')]);}else{logger[_0x8c91('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x500111,_0x8c91('0xc'));_0x5131b1(_0x27976b[_0x8c91('0x11')][_0x8c91('0x10')]);}})[_0x8c91('0x12')](function(_0x7953d1){logger[_0x8c91('0xe')](_0x8c91('0xf'),_0x500111,_0x7953d1);_0x4926f2(_0x7953d1);});});}
\ No newline at end of file
+var _0x7710=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7710,0x130));var _0x0771=function(_0x52d5d9,_0x24bc67){_0x52d5d9=_0x52d5d9-0x0;var _0x2507c4=_0x7710[_0x52d5d9];return _0x2507c4;};'use strict';var _=require('lodash');var util=require(_0x0771('0x0'));var moment=require('moment');var BPromise=require(_0x0771('0x1'));var rs=require(_0x0771('0x2'));var fs=require('fs');var Redis=require(_0x0771('0x3'));var db=require(_0x0771('0x4'))['db'];var utils=require(_0x0771('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0771('0x6'));var client=jayson[_0x0771('0x7')][_0x0771('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x589f48,_0x457220,_0x498827){return new BPromise(function(_0x2d3745,_0x2e2a90){return client[_0x0771('0x9')](_0x589f48,_0x498827)[_0x0771('0xa')](function(_0x2ac9be){logger['info'](_0x0771('0xb'),_0x457220,_0x0771('0xc'));logger[_0x0771('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x457220,_0x0771('0xc'),JSON[_0x0771('0xe')](_0x2ac9be));if(_0x2ac9be[_0x0771('0xf')]){if(_0x2ac9be[_0x0771('0xf')][_0x0771('0x10')]===0x1f4){logger['error'](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2e2a90(_0x2ac9be['error'][_0x0771('0x11')]);}logger[_0x0771('0xf')](_0x0771('0xb'),_0x457220,_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);return _0x2d3745(_0x2ac9be[_0x0771('0xf')][_0x0771('0x11')]);}else{logger[_0x0771('0x12')](_0x0771('0xb'),_0x457220,_0x0771('0xc'));_0x2d3745(_0x2ac9be[_0x0771('0x13')]['message']);}})[_0x0771('0x14')](function(_0x4dae8a){logger['error'](_0x0771('0xb'),_0x457220,_0x4dae8a);_0x2e2a90(_0x4dae8a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 43fbc66..4859f6d 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 _0xa7b4=['./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5340ad,_0x3d6824){var _0x242191=function(_0x77a68d){while(--_0x77a68d){_0x5340ad['push'](_0x5340ad['shift']());}};_0x242191(++_0x3d6824);}(_0xa7b4,0x1d8));var _0x4a7b=function(_0xdae6b9,_0x370831){_0xdae6b9=_0xdae6b9-0x0;var _0x4f7567=_0xa7b4[_0xdae6b9];return _0x4f7567;};'use strict';var multer=require(_0x4a7b('0x0'));var util=require('util');var path=require(_0x4a7b('0x1'));var timeout=require(_0x4a7b('0x2'));var express=require(_0x4a7b('0x3'));var router=express['Router']();var fs_extra=require(_0x4a7b('0x4'));var auth=require(_0x4a7b('0x5'));var interaction=require(_0x4a7b('0x6'));var config=require(_0x4a7b('0x7'));var controller=require(_0x4a7b('0x8'));router[_0x4a7b('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a7b('0xa')]);router['get']('/describe',auth[_0x4a7b('0xb')](),controller[_0x4a7b('0xc')]);router[_0x4a7b('0x9')](_0x4a7b('0xd'),auth[_0x4a7b('0xb')](),controller[_0x4a7b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a7b('0xf')]);router[_0x4a7b('0x10')](_0x4a7b('0xd'),auth['isAuthenticated'](),controller[_0x4a7b('0x11')]);router[_0x4a7b('0x12')]('/:id',auth[_0x4a7b('0xb')](),controller[_0x4a7b('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7788=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7788,0x17c));var _0x8778=function(_0x30f030,_0xd03b7a){_0x30f030=_0x30f030-0x0;var _0xf7614f=_0x7788[_0x30f030];return _0xf7614f;};'use strict';var multer=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var path=require(_0x8778('0x2'));var timeout=require(_0x8778('0x3'));var express=require(_0x8778('0x4'));var router=express[_0x8778('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8778('0x6'));var interaction=require(_0x8778('0x7'));var config=require(_0x8778('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x8778('0x9')]('/',auth['isAuthenticated'](),controller[_0x8778('0xa')]);router[_0x8778('0x9')](_0x8778('0xb'),auth[_0x8778('0xc')](),controller[_0x8778('0xd')]);router[_0x8778('0x9')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller['show']);router[_0x8778('0xf')]('/',auth[_0x8778('0xc')](),controller[_0x8778('0x10')]);router[_0x8778('0x11')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller['update']);router[_0x8778('0x12')](_0x8778('0xe'),auth[_0x8778('0xc')](),controller[_0x8778('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index fc98d5c..29a56de 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 _0xf37a=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf37a,0x192));var _0xaf37=function(_0x537924,_0x106d71){_0x537924=_0x537924-0x0;var _0x344a0e=_0xf37a[_0x537924];return _0x344a0e;};'use strict';var Sequelize=require(_0xaf37('0x0'));module[_0xaf37('0x1')]={'name':{'type':Sequelize[_0xaf37('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaf37('0x3')](_0xaf37('0x4'),_0xaf37('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaf37('0x6')]}};
\ No newline at end of file
+var _0x81d6=['sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x5884f1,_0x1592d9){var _0x2a08e7=function(_0x14176){while(--_0x14176){_0x5884f1['push'](_0x5884f1['shift']());}};_0x2a08e7(++_0x1592d9);}(_0x81d6,0x1c7));var _0x681d=function(_0x420ed7,_0x20b347){_0x420ed7=_0x420ed7-0x0;var _0x5a3563=_0x81d6[_0x420ed7];return _0x5a3563;};'use strict';var Sequelize=require(_0x681d('0x0'));module['exports']={'name':{'type':Sequelize[_0x681d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x681d('0x2')](_0x681d('0x3'),_0x681d('0x4')),'defaultValue':_0x681d('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 78f31ab..4a2eb54 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 _0x10af=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','then','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','create','update','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x4f45a0,_0x51d2a3){var _0x9f5648=function(_0x7eab4a){while(--_0x7eab4a){_0x4f45a0['push'](_0x4f45a0['shift']());}};_0x9f5648(++_0x51d2a3);}(_0x10af,0xfc));var _0xf10a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x10af[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xf10a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10a('0x1'));var jsonpatch=require(_0xf10a('0x2'));var rp=require(_0xf10a('0x3'));var moment=require(_0xf10a('0x4'));var BPromise=require(_0xf10a('0x5'));var Mustache=require(_0xf10a('0x6'));var util=require(_0xf10a('0x7'));var path=require(_0xf10a('0x8'));var sox=require('sox');var csv=require(_0xf10a('0x9'));var ejs=require(_0xf10a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf10a('0xb'));var crypto=require(_0xf10a('0xc'));var jsforce=require(_0xf10a('0xd'));var deskjs=require(_0xf10a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf10a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf10a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf10a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf10a('0x12'))('api');var utils=require(_0xf10a('0x13'));var config=require(_0xf10a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf10a('0x15'))['db'];function respondWithStatusCode(_0x24632c,_0x4191bb){_0x4191bb=_0x4191bb||0xcc;return function(_0x22ffab){if(_0x22ffab){return _0x24632c[_0xf10a('0x16')](_0x4191bb);}return _0x24632c[_0xf10a('0x17')](_0x4191bb)[_0xf10a('0x18')]();};}function respondWithResult(_0x305767,_0xe03766){_0xe03766=_0xe03766||0xc8;return function(_0x50ba60){if(_0x50ba60){return _0x305767[_0xf10a('0x17')](_0xe03766)['json'](_0x50ba60);}};}function respondWithFilteredResult(_0x5b72ad,_0x26f4a5){return function(_0x3117cd){if(_0x3117cd){var _0x484c3a=typeof _0x26f4a5[_0xf10a('0x19')]===_0xf10a('0x1a')&&typeof _0x26f4a5['limit']===_0xf10a('0x1a');var _0x10ab5=_0x3117cd[_0xf10a('0x1b')];var _0x1deaa1=_0x484c3a?0x0:_0x26f4a5[_0xf10a('0x19')];var _0x20a858=_0x484c3a?_0x3117cd[_0xf10a('0x1b')]:_0x26f4a5[_0xf10a('0x19')]+_0x26f4a5[_0xf10a('0x1c')];var _0x463e75;if(_0x20a858>=_0x10ab5){_0x20a858=_0x10ab5;_0x463e75=0xc8;}else{_0x463e75=0xce;}_0x5b72ad[_0xf10a('0x17')](_0x463e75);return _0x5b72ad['set'](_0xf10a('0x1d'),_0x1deaa1+'-'+_0x20a858+'/'+_0x10ab5)[_0xf10a('0x1e')](_0x3117cd);}return null;};}function patchUpdates(_0xa1614e){return function(_0x4db4b0){try{jsonpatch[_0xf10a('0x1f')](_0x4db4b0,_0xa1614e,!![]);}catch(_0x5c55b0){return BPromise['reject'](_0x5c55b0);}return _0x4db4b0['save']();};}function saveUpdates(_0x135fc0,_0x3b61d8){return function(_0x2dc858){if(_0x2dc858){return _0x2dc858['update'](_0x135fc0)[_0xf10a('0x20')](function(_0x429a75){return _0x429a75;});}return null;};}function removeEntity(_0x569bb5,_0xc760e8){return function(_0x439e48){if(_0x439e48){return _0x439e48['destroy']()[_0xf10a('0x20')](function(){_0x569bb5[_0xf10a('0x17')](0xcc)[_0xf10a('0x18')]();});}};}function handleEntityNotFound(_0x4defdf,_0x33866c){return function(_0x4834b5){if(!_0x4834b5){_0x4defdf[_0xf10a('0x16')](0x194);}return _0x4834b5;};}function handleError(_0x1ef7f3,_0x1550b4){_0x1550b4=_0x1550b4||0x1f4;return function(_0x547bb7){logger['error'](_0x547bb7['stack']);if(_0x547bb7[_0xf10a('0x21')]){delete _0x547bb7['name'];}_0x1ef7f3['status'](_0x1550b4)[_0xf10a('0x22')](_0x547bb7);};}exports[_0xf10a('0x23')]=function(_0x3cf00d,_0x47d800){var _0x39b99b={'raw':!![],'where':{'id':_0x3cf00d[_0xf10a('0x24')]['id']}},_0x265a74={};_0x265a74[_0xf10a('0x25')]=_[_0xf10a('0x26')](db[_0xf10a('0x27')][_0xf10a('0x28')]);_0x265a74['query']=_[_0xf10a('0x26')](_0x3cf00d[_0xf10a('0x29')]);_0x265a74['filters']=_[_0xf10a('0x2a')](_0x265a74[_0xf10a('0x25')],_0x265a74[_0xf10a('0x29')]);_0x39b99b[_0xf10a('0x2b')]=_['intersection'](_0x265a74['model'],qs['fields'](_0x3cf00d[_0xf10a('0x29')][_0xf10a('0x2c')]));_0x39b99b[_0xf10a('0x2b')]=_0x39b99b[_0xf10a('0x2b')][_0xf10a('0x2d')]?_0x39b99b[_0xf10a('0x2b')]:_0x265a74[_0xf10a('0x25')];if(_0x3cf00d['query'][_0xf10a('0x2e')]){_0x39b99b['include']=[{'all':!![]}];}_0x39b99b=_[_0xf10a('0x2f')]({},_0x39b99b,_0x3cf00d['options']);return db[_0xf10a('0x27')][_0xf10a('0x30')](_0x39b99b)[_0xf10a('0x20')](handleEntityNotFound(_0x47d800,null))['then'](respondWithResult(_0x47d800,null))[_0xf10a('0x31')](handleError(_0x47d800,null));};exports['create']=function(_0x580b4d,_0x24551e){return db['ChatProactiveAction'][_0xf10a('0x32')](_0x580b4d['body'],{})[_0xf10a('0x20')](respondWithResult(_0x24551e,0xc9))[_0xf10a('0x31')](handleError(_0x24551e,null));};exports[_0xf10a('0x33')]=function(_0x37611f,_0x32f102){if(_0x37611f[_0xf10a('0x34')]['id']){delete _0x37611f['body']['id'];}return db['ChatProactiveAction'][_0xf10a('0x30')]({'where':{'id':_0x37611f[_0xf10a('0x24')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x32f102,null))[_0xf10a('0x20')](saveUpdates(_0x37611f[_0xf10a('0x34')],null))[_0xf10a('0x20')](respondWithResult(_0x32f102,null))['catch'](handleError(_0x32f102,null));};exports[_0xf10a('0x35')]=function(_0x52f63,_0x2ad05b){return db[_0xf10a('0x27')]['find']({'where':{'id':_0x52f63[_0xf10a('0x24')]['id']}})[_0xf10a('0x20')](handleEntityNotFound(_0x2ad05b,null))[_0xf10a('0x20')](removeEntity(_0x2ad05b,null))[_0xf10a('0x31')](handleError(_0x2ad05b,null));};
\ No newline at end of file
+var _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x5243,0x71));var _0x3524=function(_0x2471a9,_0x17f7c5){_0x2471a9=_0x2471a9-0x0;var _0x453c32=_0x5243[_0x2471a9];return _0x453c32;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 194a382..5957c42 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 _0x7d5c=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x56111e,_0x3809a8){var _0x45e40d=function(_0x31ee1e){while(--_0x31ee1e){_0x56111e['push'](_0x56111e['shift']());}};_0x45e40d(++_0x3809a8);}(_0x7d5c,0x1cc));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc7d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc7d5('0x1'));var moment=require('moment');var BPromise=require(_0xc7d5('0x2'));var rp=require(_0xc7d5('0x3'));var fs=require('fs');var path=require(_0xc7d5('0x4'));var rimraf=require(_0xc7d5('0x5'));var config=require(_0xc7d5('0x6'));var attributes=require(_0xc7d5('0x7'));module[_0xc7d5('0x8')]=function(_0x5eccf1,_0x1460c6){return _0x5eccf1[_0xc7d5('0x9')](_0xc7d5('0xa'),attributes,{'tableName':_0xc7d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd81e=['path','rimraf','../../config/environment','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd81e,0x73));var _0xed81=function(_0x4c2574,_0x4f699f){_0x4c2574=_0x4c2574-0x0;var _0x439b8c=_0xd81e[_0x4c2574];return _0x439b8c;};'use strict';var _=require(_0xed81('0x0'));var util=require(_0xed81('0x1'));var logger=require(_0xed81('0x2'))(_0xed81('0x3'));var moment=require(_0xed81('0x4'));var BPromise=require(_0xed81('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed81('0x6'));var rimraf=require(_0xed81('0x7'));var config=require(_0xed81('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xed81('0x9')]=function(_0x488888,_0x14a2af){return _0x488888['define'](_0xed81('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 86403fa..fa12bb4 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 _0x013d=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x013d,0x1a6));var _0xd013=function(_0x451f88,_0x5c061a){_0x451f88=_0x451f88-0x0;var _0x2cc2b7=_0x013d[_0x451f88];return _0x2cc2b7;};'use strict';var _=require(_0xd013('0x0'));var util=require(_0xd013('0x1'));var moment=require(_0xd013('0x2'));var BPromise=require(_0xd013('0x3'));var rs=require(_0xd013('0x4'));var fs=require('fs');var Redis=require(_0xd013('0x5'));var db=require(_0xd013('0x6'))['db'];var utils=require(_0xd013('0x7'));var logger=require(_0xd013('0x8'))(_0xd013('0x9'));var config=require(_0xd013('0xa'));var jayson=require(_0xd013('0xb'));var client=jayson[_0xd013('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47bd49,_0x261455,_0x7ab462){return new BPromise(function(_0x458223,_0x457258){return client[_0xd013('0xd')](_0x47bd49,_0x7ab462)[_0xd013('0xe')](function(_0x3cce7a){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x261455,_0xd013('0xf'));logger[_0xd013('0x10')](_0xd013('0x11'),_0x261455,_0xd013('0xf'),JSON['stringify'](_0x3cce7a));if(_0x3cce7a[_0xd013('0x12')]){if(_0x3cce7a[_0xd013('0x12')][_0xd013('0x13')]===0x1f4){logger[_0xd013('0x12')](_0xd013('0x14'),_0x261455,_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);return _0x457258(_0x3cce7a['error']['message']);}logger['error'](_0xd013('0x14'),_0x261455,_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);return _0x458223(_0x3cce7a[_0xd013('0x12')][_0xd013('0x15')]);}else{logger['info'](_0xd013('0x14'),_0x261455,_0xd013('0xf'));_0x458223(_0x3cce7a[_0xd013('0x16')][_0xd013('0x15')]);}})[_0xd013('0x17')](function(_0x25c96f){logger[_0xd013('0x12')](_0xd013('0x14'),_0x261455,_0x25c96f);_0x457258(_0x25c96f);});});}
\ No newline at end of file
+var _0xabd8=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xabd8,0x142));var _0x8abd=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xabd8[_0x1406ae];return _0x23a076;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8abd('0x0'));var rs=require(_0x8abd('0x1'));var fs=require('fs');var Redis=require(_0x8abd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abd('0x3'));var logger=require(_0x8abd('0x4'))(_0x8abd('0x5'));var config=require(_0x8abd('0x6'));var jayson=require(_0x8abd('0x7'));var client=jayson[_0x8abd('0x8')][_0x8abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7e8824,_0x38ff7d,_0x399d52){return new BPromise(function(_0x14c8c5,_0x7c4bd0){return client[_0x8abd('0xa')](_0x7e8824,_0x399d52)['then'](function(_0x30d682){logger[_0x8abd('0xb')](_0x8abd('0xc'),_0x38ff7d,_0x8abd('0xd'));logger[_0x8abd('0xe')](_0x8abd('0xf'),_0x38ff7d,_0x8abd('0xd'),JSON[_0x8abd('0x10')](_0x30d682));if(_0x30d682[_0x8abd('0x11')]){if(_0x30d682[_0x8abd('0x11')]['code']===0x1f4){logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x30d682[_0x8abd('0x11')]['message']);return _0x7c4bd0(_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);}logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);return _0x14c8c5(_0x30d682[_0x8abd('0x11')][_0x8abd('0x12')]);}else{logger['info'](_0x8abd('0xc'),_0x38ff7d,_0x8abd('0xd'));_0x14c8c5(_0x30d682[_0x8abd('0x13')][_0x8abd('0x12')]);}})[_0x8abd('0x14')](function(_0x29b1e1){logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x38ff7d,_0x29b1e1);_0x7c4bd0(_0x29b1e1);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8ac6cb9..6d2fc70 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x5e3521,_0x290718){var _0xd780a4=function(_0xded1f4){while(--_0xded1f4){_0x5e3521['push'](_0x5e3521['shift']());}};_0xd780a4(++_0x290718);}(_0xeda8,0x104));var _0x8eda=function(_0x42d4a7,_0x4b1dbe){_0x42d4a7=_0x42d4a7-0x0;var _0x8d7ec8=_0xeda8[_0x42d4a7];return _0x8d7ec8;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41caa5,_0x1f6d8b){var _0x4cab93=function(_0x2d271a){while(--_0x2d271a){_0x41caa5['push'](_0x41caa5['shift']());}};_0x4cab93(++_0x1f6d8b);}(_0x326f,0xd1));var _0xf326=function(_0x3c2b38,_0x1cc6d4){_0x3c2b38=_0x3c2b38-0x0;var _0x5eec52=_0x326f[_0x3c2b38];return _0x5eec52;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('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 f4b5bb6..9c1d4a0 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 _0x9252=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x129a61,_0x5848a1){var _0x39b8db=function(_0x319ec1){while(--_0x319ec1){_0x129a61['push'](_0x129a61['shift']());}};_0x39b8db(++_0x5848a1);}(_0x9252,0x169));var _0x2925=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x9252[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0x2925('0x0'));module[_0x2925('0x1')]={'name':{'type':Sequelize[_0x2925('0x2')],'unique':_0x2925('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2925('0x2')]},'timeout':{'type':Sequelize[_0x2925('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2925('0x5')](_0x2925('0x6'),'beepall',_0x2925('0x7'))}};
\ No newline at end of file
+var _0x08fc=['exports','STRING','name','ENUM','rrmemory','sequelize'];(function(_0x1d949e,_0x37e295){var _0x5af2dc=function(_0x130e93){while(--_0x130e93){_0x1d949e['push'](_0x1d949e['shift']());}};_0x5af2dc(++_0x37e295);}(_0x08fc,0x7d));var _0xc08f=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x08fc[_0x31c19c];return _0x1a87f7;};'use strict';var Sequelize=require(_0xc08f('0x0'));module[_0xc08f('0x1')]={'name':{'type':Sequelize[_0xc08f('0x2')],'unique':_0xc08f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc08f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc08f('0x4')](_0xc08f('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index cd0662e..0b2022d 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 _0x2005=['message','info','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','intersection','length','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','UserId','agent','chatPause','createdAt','format','SIP','getTeams','addTeams','Agents','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','compact','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s'];(function(_0xb77404,_0x2987e8){var _0xa12c19=function(_0x55b759){while(--_0x55b759){_0xb77404['push'](_0xb77404['shift']());}};_0xa12c19(++_0x2987e8);}(_0x2005,0xfb));var _0x5200=function(_0x2880d8,_0x284ded){_0x2880d8=_0x2880d8-0x0;var _0x51f5a9=_0x2005[_0x2880d8];return _0x51f5a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5200('0x0'));var zipdir=require(_0x5200('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5200('0x2'));var moment=require(_0x5200('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5200('0x4'));var util=require(_0x5200('0x5'));var path=require('path');var sox=require(_0x5200('0x6'));var csv=require(_0x5200('0x7'));var ejs=require(_0x5200('0x8'));var fs=require('fs');var fs_extra=require(_0x5200('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5200('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5200('0xb'));var toCsv=require(_0x5200('0x7'));var querystring=require(_0x5200('0xc'));var Papa=require(_0x5200('0xd'));var Redis=require(_0x5200('0xe'));var authService=require(_0x5200('0xf'));var qs=require(_0x5200('0x10'));var as=require(_0x5200('0x11'));var hardwareService=require(_0x5200('0x12'));var logger=require('../../config/logger')(_0x5200('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5200('0x14'));var db=require('../../mysqldb')['db'];config[_0x5200('0x15')]=_[_0x5200('0x16')](config[_0x5200('0x15')],{'host':_0x5200('0x17'),'port':0x18eb});var socket=require(_0x5200('0x18'))(new Redis(config['redis']));require(_0x5200('0x19'))[_0x5200('0x1a')](socket);var jayson=require(_0x5200('0x1b'));var client=jayson[_0x5200('0x1c')][_0x5200('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xef92a3,_0x55a845,_0x2046c0,_0x493902){return new BPromise(function(_0x36157e,_0x14c4d6){var _0x3e6629=_0x493902||client;return _0x3e6629['request'](_0xef92a3,_0x2046c0)[_0x5200('0x1e')](function(_0xec07f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'),JSON[_0x5200('0x20')](_0xec07f));if(_0xec07f[_0x5200('0x21')]){if(_0xec07f['error']['code']===0x1f4){logger[_0x5200('0x21')](_0x5200('0x22'),_0x55a845,_0xec07f[_0x5200('0x21')][_0x5200('0x23')]);return _0x14c4d6(_0xec07f['error'][_0x5200('0x23')]);}logger['error'](_0x5200('0x22'),_0x55a845,_0xec07f[_0x5200('0x21')]['message']);return _0x36157e(_0xec07f[_0x5200('0x21')]['message']);}else{logger[_0x5200('0x24')]('ChatQueue,\x20%s,\x20%s',_0x55a845,_0x5200('0x1f'));_0x36157e(_0xec07f[_0x5200('0x25')]['message']);}})['catch'](function(_0x40af71){logger[_0x5200('0x21')](_0x5200('0x22'),_0x55a845,_0x40af71);_0x14c4d6(_0x40af71);});});}function respondWithStatusCode(_0xde5321,_0x141bfe){_0x141bfe=_0x141bfe||0xcc;return function(_0x54c2da){if(_0x54c2da){return _0xde5321[_0x5200('0x26')](_0x141bfe);}return _0xde5321[_0x5200('0x27')](_0x141bfe)[_0x5200('0x28')]();};}function respondWithResult(_0x1a8e6f,_0x661523){_0x661523=_0x661523||0xc8;return function(_0x5bedd){if(_0x5bedd){return _0x1a8e6f['status'](_0x661523)['json'](_0x5bedd);}};}function respondWithFilteredResult(_0x51c418,_0x2a1f60){return function(_0x5521fe){if(_0x5521fe){var _0x1c6c24=typeof _0x2a1f60[_0x5200('0x29')]===_0x5200('0x2a')&&typeof _0x2a1f60[_0x5200('0x2b')]===_0x5200('0x2a');var _0x3d40a1=_0x5521fe[_0x5200('0x2c')];var _0x59e4ba=_0x1c6c24?0x0:_0x2a1f60[_0x5200('0x29')];var _0x4938ce=_0x1c6c24?_0x5521fe[_0x5200('0x2c')]:_0x2a1f60['offset']+_0x2a1f60[_0x5200('0x2b')];var _0x17e999;if(_0x4938ce>=_0x3d40a1){_0x4938ce=_0x3d40a1;_0x17e999=0xc8;}else{_0x17e999=0xce;}_0x51c418[_0x5200('0x27')](_0x17e999);return _0x51c418[_0x5200('0x2d')](_0x5200('0x2e'),_0x59e4ba+'-'+_0x4938ce+'/'+_0x3d40a1)[_0x5200('0x2f')](_0x5521fe);}return null;};}function patchUpdates(_0x22e271){return function(_0x108070){try{jsonpatch[_0x5200('0x30')](_0x108070,_0x22e271,!![]);}catch(_0x40cd28){return BPromise[_0x5200('0x31')](_0x40cd28);}return _0x108070[_0x5200('0x32')]();};}function saveUpdates(_0x4d0beb,_0x34978b){return function(_0x28b9dd){if(_0x28b9dd){return _0x28b9dd[_0x5200('0x33')](_0x4d0beb)['then'](function(_0x288033){return _0x288033;});}return null;};}function removeEntity(_0x5bbe2d,_0x1cedb6){return function(_0x5e1bdf){if(_0x5e1bdf){return _0x5e1bdf[_0x5200('0x34')]()['then'](function(){var _0x1ca13e=_0x5e1bdf['get']({'plain':!![]});var _0x369893=_0x5200('0x35');return db[_0x5200('0x36')]['destroy']({'where':{'type':_0x369893,'resourceId':_0x1ca13e['id']}})['then'](function(){return _0x5e1bdf;});})['then'](function(){_0x5bbe2d[_0x5200('0x27')](0xcc)[_0x5200('0x28')]();});}};}function handleEntityNotFound(_0x50b8d6,_0x2ec51f){return function(_0x3552c4){if(!_0x3552c4){_0x50b8d6['sendStatus'](0x194);}return _0x3552c4;};}function handleError(_0x510823,_0x18173e){_0x18173e=_0x18173e||0x1f4;return function(_0x184f9f){logger[_0x5200('0x21')](_0x184f9f[_0x5200('0x37')]);if(_0x184f9f[_0x5200('0x38')]){delete _0x184f9f[_0x5200('0x38')];}_0x510823[_0x5200('0x27')](_0x18173e)[_0x5200('0x39')](_0x184f9f);};}exports[_0x5200('0x3a')]=function(_0x250b13,_0x328f0d){var _0x4e4ab6={},_0x190c9f={},_0x4f2341={'count':0x0,'rows':[]};var _0x5e920f=_[_0x5200('0x3b')](db[_0x5200('0x3c')][_0x5200('0x3d')],function(_0x53ca93){return{'name':_0x53ca93['fieldName'],'type':_0x53ca93[_0x5200('0x3e')][_0x5200('0x3f')]};});_0x190c9f[_0x5200('0x40')]=_[_0x5200('0x3b')](_0x5e920f,_0x5200('0x38'));_0x190c9f['query']=_['keys'](_0x250b13[_0x5200('0x41')]);_0x190c9f[_0x5200('0x42')]=_['intersection'](_0x190c9f[_0x5200('0x40')],_0x190c9f[_0x5200('0x41')]);_0x4e4ab6[_0x5200('0x43')]=_['intersection'](_0x190c9f[_0x5200('0x40')],qs[_0x5200('0x44')](_0x250b13[_0x5200('0x41')][_0x5200('0x44')]));_0x4e4ab6[_0x5200('0x43')]=_0x4e4ab6[_0x5200('0x43')]['length']?_0x4e4ab6[_0x5200('0x43')]:_0x190c9f[_0x5200('0x40')];if(!_0x250b13[_0x5200('0x41')]['hasOwnProperty'](_0x5200('0x45'))){_0x4e4ab6[_0x5200('0x2b')]=qs['limit'](_0x250b13[_0x5200('0x41')]['limit']);_0x4e4ab6[_0x5200('0x29')]=qs[_0x5200('0x29')](_0x250b13[_0x5200('0x41')][_0x5200('0x29')]);}_0x4e4ab6[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x250b13['query'][_0x5200('0x47')]);_0x4e4ab6[_0x5200('0x48')]=qs['filters'](_[_0x5200('0x49')](_0x250b13[_0x5200('0x41')],_0x190c9f[_0x5200('0x42')]),_0x5e920f);if(_0x250b13[_0x5200('0x41')][_0x5200('0x4a')]){_0x4e4ab6[_0x5200('0x48')]=_[_0x5200('0x4b')](_0x4e4ab6[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x5e920f,function(_0x588234){if(_0x588234[_0x5200('0x3e')]!==_0x5200('0x4c')){var _0x22b9f1={};_0x22b9f1[_0x588234[_0x5200('0x38')]]={'$like':'%'+_0x250b13[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x22b9f1;}})});}_0x4e4ab6=_['merge']({},_0x4e4ab6,_0x250b13[_0x5200('0x4d')]);var _0x35be5f={'where':_0x4e4ab6['where']};return db[_0x5200('0x3c')][_0x5200('0x2c')](_0x35be5f)[_0x5200('0x1e')](function(_0x141396){_0x4f2341[_0x5200('0x2c')]=_0x141396;if(_0x250b13[_0x5200('0x41')]['includeAll']){_0x4e4ab6['include']=[{'all':!![]}];}return db[_0x5200('0x3c')][_0x5200('0x4e')](_0x4e4ab6);})['then'](function(_0x1b31e4){_0x4f2341[_0x5200('0x4f')]=_0x1b31e4;return _0x4f2341;})['then'](respondWithFilteredResult(_0x328f0d,_0x4e4ab6))[_0x5200('0x50')](handleError(_0x328f0d,null));};exports[_0x5200('0x51')]=function(_0x1177a9,_0x16fef1){var _0x31d922={'raw':!![],'where':{'id':_0x1177a9[_0x5200('0x52')]['id']}},_0x5df57b={};_0x5df57b[_0x5200('0x40')]=_[_0x5200('0x53')](db['ChatQueue'][_0x5200('0x3d')]);_0x5df57b['query']=_['keys'](_0x1177a9['query']);_0x5df57b[_0x5200('0x42')]=_[_0x5200('0x54')](_0x5df57b[_0x5200('0x40')],_0x5df57b[_0x5200('0x41')]);_0x31d922[_0x5200('0x43')]=_['intersection'](_0x5df57b['model'],qs[_0x5200('0x44')](_0x1177a9[_0x5200('0x41')][_0x5200('0x44')]));_0x31d922['attributes']=_0x31d922[_0x5200('0x43')][_0x5200('0x55')]?_0x31d922[_0x5200('0x43')]:_0x5df57b[_0x5200('0x40')];if(_0x1177a9[_0x5200('0x41')][_0x5200('0x56')]){_0x31d922[_0x5200('0x57')]=[{'all':!![]}];}_0x31d922=_[_0x5200('0x4b')]({},_0x31d922,_0x1177a9[_0x5200('0x4d')]);return db[_0x5200('0x3c')][_0x5200('0x58')](_0x31d922)[_0x5200('0x1e')](handleEntityNotFound(_0x16fef1,null))[_0x5200('0x1e')](respondWithResult(_0x16fef1,null))['catch'](handleError(_0x16fef1,null));};exports[_0x5200('0x59')]=function(_0x3a370c,_0x51f04b){return db[_0x5200('0x3c')]['create'](_0x3a370c[_0x5200('0x5a')],{})[_0x5200('0x1e')](function(_0x2b9a8d){var _0x3f853f=_0x3a370c['user'][_0x5200('0x5b')]({'plain':!![]});if(!_0x3f853f)throw new Error(_0x5200('0x5c'));if(_0x3f853f['role']===_0x5200('0x5d')){var _0x3bd191=_0x2b9a8d[_0x5200('0x5b')]({'plain':!![]});var _0x416c1f='ChatQueues';return db[_0x5200('0x5e')][_0x5200('0x58')]({'where':{'name':_0x416c1f,'userProfileId':_0x3f853f[_0x5200('0x5f')]},'raw':!![]})[_0x5200('0x1e')](function(_0x4c586d){if(_0x4c586d&&_0x4c586d[_0x5200('0x60')]===0x0){return db[_0x5200('0x36')][_0x5200('0x59')]({'name':_0x3bd191[_0x5200('0x38')],'resourceId':_0x3bd191['id'],'type':_0x4c586d[_0x5200('0x38')],'sectionId':_0x4c586d['id']},{})['then'](function(){return _0x2b9a8d;});}else{return _0x2b9a8d;}})[_0x5200('0x50')](function(_0x4f99a4){logger['error'](_0x5200('0x61'),_0x4f99a4);throw _0x4f99a4;});}return _0x2b9a8d;})[_0x5200('0x1e')](respondWithResult(_0x51f04b,0xc9))[_0x5200('0x50')](handleError(_0x51f04b,null));};exports[_0x5200('0x33')]=function(_0x1c47a1,_0x53dcd6){if(_0x1c47a1['body']['id']){delete _0x1c47a1[_0x5200('0x5a')]['id'];}return db[_0x5200('0x3c')]['find']({'where':{'id':_0x1c47a1[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x53dcd6,null))['then'](saveUpdates(_0x1c47a1[_0x5200('0x5a')],null))[_0x5200('0x1e')](respondWithResult(_0x53dcd6,null))[_0x5200('0x50')](handleError(_0x53dcd6,null));};exports[_0x5200('0x34')]=function(_0x1ec7f2,_0x2eb685){return db[_0x5200('0x3c')]['find']({'where':{'id':_0x1ec7f2[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x2eb685,null))['then'](removeEntity(_0x2eb685,null))['catch'](handleError(_0x2eb685,null));};exports[_0x5200('0x62')]=function(_0x2b2dd9,_0x7c3ce7){return db['ChatQueue'][_0x5200('0x62')]()['then'](respondWithResult(_0x7c3ce7,null))[_0x5200('0x50')](handleError(_0x7c3ce7,null));};exports[_0x5200('0x63')]=function(_0x4897ea,_0x5556a9,_0x2c49be){var _0x3f9489={'raw':!![],'where':{}},_0x388a65={},_0x3ef5a7;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x4897ea[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5556a9,null))['then'](function(_0x2916c9){if(_0x2916c9){_0x3ef5a7=_0x2916c9[_0x5200('0x5b')]({'plain':!![]});_0x388a65[_0x5200('0x40')]=_[_0x5200('0x53')](db[_0x5200('0x65')]['rawAttributes']);_0x388a65[_0x5200('0x41')]=_['keys'](_0x4897ea['query']);_0x388a65[_0x5200('0x42')]=_[_0x5200('0x54')](_0x388a65[_0x5200('0x40')],_0x388a65[_0x5200('0x41')]);_0x3f9489[_0x5200('0x43')]=_[_0x5200('0x54')](_0x388a65[_0x5200('0x40')],qs[_0x5200('0x44')](_0x4897ea[_0x5200('0x41')][_0x5200('0x44')]));_0x3f9489[_0x5200('0x43')]=_0x3f9489[_0x5200('0x43')]['length']?_0x3f9489[_0x5200('0x43')]:_0x388a65[_0x5200('0x40')];if(!_0x4897ea[_0x5200('0x41')][_0x5200('0x66')](_0x5200('0x45'))){_0x3f9489[_0x5200('0x2b')]=qs[_0x5200('0x2b')](_0x4897ea[_0x5200('0x41')][_0x5200('0x2b')]);_0x3f9489[_0x5200('0x29')]=qs['offset'](_0x4897ea['query'][_0x5200('0x29')]);}_0x3f9489[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x4897ea[_0x5200('0x41')][_0x5200('0x47')]);_0x3f9489[_0x5200('0x48')]=qs['filters'](_['pick'](_0x4897ea[_0x5200('0x41')],_0x388a65[_0x5200('0x42')]));_0x3f9489['where'][_0x5200('0x67')]=_0x2916c9['id'];if(_0x4897ea['query']['filter']){_0x3f9489['where']=_['merge'](_0x3f9489[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x3f9489[_0x5200('0x43')],function(_0x143be1){var _0x1bdf60={};_0x1bdf60[_0x143be1]={'$like':'%'+_0x4897ea[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x1bdf60;})});}_0x3f9489=_[_0x5200('0x4b')]({},_0x3f9489,_0x4897ea[_0x5200('0x4d')]);return db[_0x5200('0x65')]['findAll'](_0x3f9489);}})[_0x5200('0x1e')](function(_0x6970a7){if(_0x6970a7){return db[_0x5200('0x68')]['findAndCountAll']({'where':{'id':_[_0x5200('0x3b')](_0x6970a7,_0x5200('0x69')),'role':_0x5200('0x6a')},'attributes':['id',_0x5200('0x38'),_0x5200('0x6b'),'updatedAt',_0x5200('0x6c')]});}})[_0x5200('0x1e')](function(_0x48fb79){if(_0x48fb79){return{'count':_0x48fb79[_0x5200('0x2c')],'rows':_['map'](_0x48fb79[_0x5200('0x4f')],function(_0x27c62a){return{'membername':_0x27c62a[_0x5200('0x38')],'UserId':_0x27c62a['id'],'queue_name':_0x3ef5a7[_0x5200('0x38')],'ChatQueueId':_0x3ef5a7['id'],'interface':util[_0x5200('0x6d')]('%s/%s',_0x5200('0x6e'),_0x27c62a['name']),'penalty':0x0,'paused':_0x27c62a['chatPause'],'createdAt':_0x27c62a[_0x5200('0x6c')],'updatedAt':_0x27c62a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5200('0x1e')](respondWithFilteredResult(_0x5556a9,_0x3f9489))['catch'](handleError(_0x5556a9,null));};exports[_0x5200('0x6f')]=function(_0x3482ac,_0x5812be,_0x5d995e){var _0x9b945e={};var _0x397f9c={};var _0x300b67;var _0x22f515;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x3482ac[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5812be,null))[_0x5200('0x1e')](function(_0x389f5d){if(_0x389f5d){_0x300b67=_0x389f5d;_0x397f9c[_0x5200('0x40')]=_[_0x5200('0x53')](db['Team']['rawAttributes']);_0x397f9c[_0x5200('0x41')]=_[_0x5200('0x53')](_0x3482ac[_0x5200('0x41')]);_0x397f9c[_0x5200('0x42')]=_['intersection'](_0x397f9c[_0x5200('0x40')],_0x397f9c[_0x5200('0x41')]);_0x9b945e[_0x5200('0x43')]=_[_0x5200('0x54')](_0x397f9c[_0x5200('0x40')],qs[_0x5200('0x44')](_0x3482ac['query'][_0x5200('0x44')]));_0x9b945e[_0x5200('0x43')]=_0x9b945e[_0x5200('0x43')][_0x5200('0x55')]?_0x9b945e['attributes']:_0x397f9c[_0x5200('0x40')];_0x9b945e['order']=qs['sort'](_0x3482ac[_0x5200('0x41')][_0x5200('0x47')]);_0x9b945e[_0x5200('0x48')]=qs[_0x5200('0x42')](_[_0x5200('0x49')](_0x3482ac[_0x5200('0x41')],_0x397f9c[_0x5200('0x42')]));if(_0x3482ac[_0x5200('0x41')]['filter']){_0x9b945e[_0x5200('0x48')]=_['merge'](_0x9b945e[_0x5200('0x48')],{'$or':_['map'](_0x9b945e['attributes'],function(_0x1f46d7){var _0x3894ab={};_0x3894ab[_0x1f46d7]={'$like':'%'+_0x3482ac[_0x5200('0x41')][_0x5200('0x4a')]+'%'};return _0x3894ab;})});}_0x9b945e=_['merge']({},_0x9b945e,_0x3482ac[_0x5200('0x4d')]);return _0x300b67['getTeams'](_0x9b945e);}})[_0x5200('0x1e')](function(_0x29e6f4){if(_0x29e6f4){_0x22f515=_0x29e6f4['length'];if(!_0x3482ac['query'][_0x5200('0x66')]('nolimit')){_0x9b945e[_0x5200('0x2b')]=qs[_0x5200('0x2b')](_0x3482ac[_0x5200('0x41')][_0x5200('0x2b')]);_0x9b945e['offset']=qs[_0x5200('0x29')](_0x3482ac[_0x5200('0x41')][_0x5200('0x29')]);}return _0x300b67[_0x5200('0x6f')](_0x9b945e);}})['then'](function(_0x508a31){if(_0x508a31){return _0x508a31?{'count':_0x22f515,'rows':_0x508a31}:null;}})[_0x5200('0x1e')](respondWithResult(_0x5812be,null))[_0x5200('0x50')](handleError(_0x5812be,null));};exports[_0x5200('0x70')]=function(_0x1923d9,_0x368329,_0xe0b38b){var _0x2de69f=_0x1923d9[_0x5200('0x5a')]['ids'];return db['Team'][_0x5200('0x4e')]({'where':{'id':_0x2de69f},'attributes':['id'],'include':[{'model':db[_0x5200('0x68')],'as':_0x5200('0x71'),'attributes':['id',_0x5200('0x38'),'online','voicePause','interface'],'raw':!![]}]})[_0x5200('0x1e')](function(_0x5b6816){if(_0x5b6816){var _0x412d2f=_[_0x5200('0x72')](_0x5b6816,function(_0x55b972){var _0x477946=_0x55b972[_0x5200('0x5b')]({'plain':!![]});return _0x477946['Agents'];});return db['ChatQueue'][_0x5200('0x58')]({'where':{'id':_0x1923d9['params']['id']}})[_0x5200('0x1e')](function(_0x2ab2c8){return db[_0x5200('0x73')][_0x5200('0x74')](function(_0x57ba4f){return _0x2ab2c8[_0x5200('0x70')](_0x2de69f,{'transaction':_0x57ba4f})['then'](function(){return BPromise[_0x5200('0x75')](_0x412d2f,function(_0x48f742){return db[_0x5200('0x65')][_0x5200('0x76')]({'where':{'UserId':_0x48f742['id'],'ChatQueueId':_0x1923d9[_0x5200('0x52')]['id']},'transaction':_0x57ba4f});});})[_0x5200('0x1e')](function(){_0x412d2f[_0x5200('0x77')](function(_0x3d49de){socket[_0x5200('0x78')](_0x5200('0x79'),{'UserId':_0x3d49de['id'],'ChatQueueId':_0x2ab2c8['id']});});});});});}})['then'](respondWithStatusCode(_0x368329,null))[_0x5200('0x50')](handleError(_0x368329,null));};exports[_0x5200('0x7a')]=function(_0x2972cb,_0x4ca58f,_0x478515){return db['Team'][_0x5200('0x4e')]({'where':{'id':_0x2972cb[_0x5200('0x41')][_0x5200('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x5200('0x68')],'as':_0x5200('0x71'),'attributes':['id'],'raw':!![]}]})[_0x5200('0x1e')](handleEntityNotFound(_0x4ca58f,null))[_0x5200('0x1e')](function(_0x6be7ec){var _0x1a8518=_['map'](_0x6be7ec,'id');var _0xea16d2=[];var _0x51c28b=[];var _0x40bfdd=squel[_0x5200('0x7c')]();_0x40bfdd[_0x5200('0x7d')](_0x5200('0x7e'))['from'](_0x5200('0x7f'),'tq')['join'](_0x5200('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5200('0x48')]('ChatQueueId\x20=\x20?',_0x2972cb[_0x5200('0x52')]['id']);for(var _0x5b879d=0x0;_0x5b879d<_0x6be7ec['length'];_0x5b879d+=0x1){let _0x58afd0=_0x6be7ec[_0x5b879d];for(var _0x393feb=0x0;_0x393feb<_0x58afd0[_0x5200('0x71')][_0x5200('0x55')];_0x393feb+=0x1){let _0x31dff7=_0x58afd0[_0x5200('0x71')][_0x393feb];var _0x14e65d=_0x40bfdd['clone']();_0x14e65d[_0x5200('0x48')](_0x5200('0x81'),_0x31dff7['id']);_0x51c28b['push'](db[_0x5200('0x73')][_0x5200('0x41')](_0x14e65d[_0x5200('0x82')](),{'type':db[_0x5200('0x73')]['QueryTypes'][_0x5200('0x83')]})[_0x5200('0x1e')](function(_0xd3314b){if(_0xd3314b['length']===0x1){return _0x31dff7['id'];}else{var _0x295107=_[_0x5200('0x84')](_['map'](_0xd3314b,_0x5200('0x85')),function(_0x28aed8){return _[_0x5200('0x86')](_0x1a8518,_0x28aed8);});if(_0x295107){return _0x31dff7['id'];}}}));}}return BPromise[_0x5200('0x87')](_0x51c28b)['then'](function(_0xb1fae7){_0xea16d2=_(_0xea16d2)['union'](_0xb1fae7)[_0x5200('0x88')]()['value']();return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x2972cb['params']['id']}})['then'](function(_0x43262b){return db[_0x5200('0x73')]['transaction'](function(_0x328ec3){return _0x43262b[_0x5200('0x7a')](_0x2972cb['query'][_0x5200('0x7b')],{'transaction':_0x328ec3})[_0x5200('0x1e')](function(){if(!_['isEmpty'](_0xea16d2)){return _0x43262b[_0x5200('0x89')](_0xea16d2,{'transaction':_0x328ec3});}})[_0x5200('0x1e')](function(){_0xea16d2[_0x5200('0x77')](function(_0x1e1c5d){socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':_0x1e1c5d,'ChatQueueId':_0x43262b['id']});});});});});});})[_0x5200('0x1e')](respondWithStatusCode(_0x4ca58f,null))['catch'](handleError(_0x4ca58f,null));};exports[_0x5200('0x8b')]=function(_0x585e87,_0x24c9e8,_0x323817){return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x585e87['params']['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x24c9e8,null))[_0x5200('0x1e')](function(_0x3d703e){if(_0x3d703e){return _0x3d703e[_0x5200('0x8b')](_0x585e87[_0x5200('0x5a')]['ids'],_['omit'](_0x585e87[_0x5200('0x5a')],['ids','id'])||{})[_0x5200('0x8c')](function(_0x2016ab){for(var _0x23f5d0=0x0;_0x23f5d0<_0x585e87[_0x5200('0x5a')][_0x5200('0x7b')][_0x5200('0x55')];_0x23f5d0+=0x1){socket[_0x5200('0x78')](_0x5200('0x79'),{'UserId':Number(_0x585e87[_0x5200('0x5a')]['ids'][_0x23f5d0]),'ChatQueueId':Number(_0x585e87[_0x5200('0x52')]['id'])});}return _0x2016ab;});}})[_0x5200('0x1e')](respondWithResult(_0x24c9e8,null))[_0x5200('0x50')](handleError(_0x24c9e8,null));};exports[_0x5200('0x89')]=function(_0x1a801a,_0x5cd3c6,_0x2510e1){return db[_0x5200('0x3c')][_0x5200('0x58')]({'where':{'id':_0x1a801a[_0x5200('0x52')]['id']}})[_0x5200('0x1e')](handleEntityNotFound(_0x5cd3c6,null))[_0x5200('0x1e')](function(_0x2a4d04){if(_0x2a4d04){return _0x2a4d04[_0x5200('0x89')](_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')])['then'](function(){if(_[_0x5200('0x8d')](_0x1a801a[_0x5200('0x41')]['ids'])){for(var _0x3f5f84=0x0;_0x3f5f84<_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')][_0x5200('0x55')];_0x3f5f84+=0x1){socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':Number(_0x1a801a[_0x5200('0x41')][_0x5200('0x7b')][_0x3f5f84]),'ChatQueueId':Number(_0x1a801a[_0x5200('0x52')]['id'])});}}else{socket[_0x5200('0x78')](_0x5200('0x8a'),{'UserId':Number(_0x1a801a['query'][_0x5200('0x7b')]),'ChatQueueId':Number(_0x1a801a[_0x5200('0x52')]['id'])});}});}})[_0x5200('0x1e')](respondWithStatusCode(_0x5cd3c6,null))['catch'](handleError(_0x5cd3c6,null));};exports[_0x5200('0x8e')]=function(_0x298863,_0xbf4b69,_0x4a823c){var _0x405cfb={};var _0xd3d7ce={};var _0x1017f9;var _0x85adcd;return db[_0x5200('0x3c')][_0x5200('0x64')]({'where':{'id':_0x298863[_0x5200('0x52')]['id']}})['then'](handleEntityNotFound(_0xbf4b69,null))[_0x5200('0x1e')](function(_0x4878bf){if(_0x4878bf){_0x1017f9=_0x4878bf;_0xd3d7ce['model']=_[_0x5200('0x53')](db[_0x5200('0x68')][_0x5200('0x3d')]);_0xd3d7ce['query']=_[_0x5200('0x53')](_0x298863[_0x5200('0x41')]);_0xd3d7ce[_0x5200('0x42')]=_[_0x5200('0x54')](_0xd3d7ce[_0x5200('0x40')],_0xd3d7ce[_0x5200('0x41')]);_0x405cfb[_0x5200('0x43')]=_[_0x5200('0x54')](_0xd3d7ce['model'],qs[_0x5200('0x44')](_0x298863[_0x5200('0x41')][_0x5200('0x44')]));_0x405cfb[_0x5200('0x43')]=_0x405cfb[_0x5200('0x43')][_0x5200('0x55')]?_0x405cfb[_0x5200('0x43')]:_0xd3d7ce[_0x5200('0x40')];_0x405cfb[_0x5200('0x46')]=qs[_0x5200('0x47')](_0x298863[_0x5200('0x41')]['sort']);_0x405cfb[_0x5200('0x48')]=qs[_0x5200('0x42')](_[_0x5200('0x49')](_0x298863['query'],_0xd3d7ce['filters']));if(_0x298863[_0x5200('0x41')][_0x5200('0x4a')]){_0x405cfb[_0x5200('0x48')]=_['merge'](_0x405cfb[_0x5200('0x48')],{'$or':_[_0x5200('0x3b')](_0x405cfb[_0x5200('0x43')],function(_0x14a066){var _0x4322d5={};_0x4322d5[_0x14a066]={'$like':'%'+_0x298863['query'][_0x5200('0x4a')]+'%'};return _0x4322d5;})});}_0x405cfb=_[_0x5200('0x4b')]({},_0x405cfb,_0x298863[_0x5200('0x4d')]);return _0x1017f9[_0x5200('0x8e')](_0x405cfb);}})['then'](function(_0x4ae854){if(_0x4ae854){_0x85adcd=_0x4ae854[_0x5200('0x55')];if(!_0x298863[_0x5200('0x41')]['hasOwnProperty']('nolimit')){_0x405cfb['limit']=qs[_0x5200('0x2b')](_0x298863['query'][_0x5200('0x2b')]);_0x405cfb[_0x5200('0x29')]=qs[_0x5200('0x29')](_0x298863[_0x5200('0x41')]['offset']);}return _0x1017f9[_0x5200('0x8e')](_0x405cfb);}})[_0x5200('0x1e')](function(_0x3ae976){if(_0x3ae976){return _0x3ae976?{'count':_0x85adcd,'rows':_0x3ae976}:null;}})[_0x5200('0x1e')](respondWithResult(_0xbf4b69,null))['catch'](handleError(_0xbf4b69,null));};
\ No newline at end of file
+var _0x13d5=['show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','removeTeams','ids','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','limit','count','Content-Range','json','save','update','then','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x13d5,0x182));var _0x513d=function(_0x3948b4,_0x398699){_0x3948b4=_0x3948b4-0x0;var _0x32a452=_0x13d5[_0x3948b4];return _0x32a452;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x513d('0x0'));var zipdir=require(_0x513d('0x1'));var jsonpatch=require(_0x513d('0x2'));var rp=require('request-promise');var moment=require(_0x513d('0x3'));var BPromise=require(_0x513d('0x4'));var Mustache=require(_0x513d('0x5'));var util=require(_0x513d('0x6'));var path=require(_0x513d('0x7'));var sox=require(_0x513d('0x8'));var csv=require(_0x513d('0x9'));var ejs=require(_0x513d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x513d('0xb'));var squel=require(_0x513d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x513d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x513d('0xe'));var Papa=require('papaparse');var Redis=require(_0x513d('0xf'));var authService=require(_0x513d('0x10'));var qs=require(_0x513d('0x11'));var as=require(_0x513d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x513d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x513d('0x14'));var licenseUtil=require(_0x513d('0x15'));var db=require(_0x513d('0x16'))['db'];config[_0x513d('0x17')]=_[_0x513d('0x18')](config[_0x513d('0x17')],{'host':_0x513d('0x19'),'port':0x18eb});var socket=require(_0x513d('0x1a'))(new Redis(config[_0x513d('0x17')]));require(_0x513d('0x1b'))['register'](socket);var jayson=require(_0x513d('0x1c'));var client=jayson[_0x513d('0x1d')][_0x513d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3c95eb,_0x14129d,_0x51e664,_0x480509){return new BPromise(function(_0x4ccace,_0x125019){var _0xfadd6f=_0x480509||client;return _0xfadd6f[_0x513d('0x1f')](_0x3c95eb,_0x51e664)['then'](function(_0x109fa5){logger['info'](_0x513d('0x20'),_0x14129d,'request\x20sent');logger[_0x513d('0x21')](_0x513d('0x22'),_0x14129d,_0x513d('0x23'),JSON[_0x513d('0x24')](_0x109fa5));if(_0x109fa5[_0x513d('0x25')]){if(_0x109fa5[_0x513d('0x25')][_0x513d('0x26')]===0x1f4){logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);return _0x125019(_0x109fa5['error']['message']);}logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);return _0x4ccace(_0x109fa5[_0x513d('0x25')][_0x513d('0x27')]);}else{logger[_0x513d('0x28')](_0x513d('0x20'),_0x14129d,_0x513d('0x23'));_0x4ccace(_0x109fa5[_0x513d('0x29')][_0x513d('0x27')]);}})['catch'](function(_0x553166){logger[_0x513d('0x25')](_0x513d('0x20'),_0x14129d,_0x553166);_0x125019(_0x553166);});});}function respondWithStatusCode(_0x49c9e3,_0x2dc610){_0x2dc610=_0x2dc610||0xcc;return function(_0x355e8c){if(_0x355e8c){return _0x49c9e3[_0x513d('0x2a')](_0x2dc610);}return _0x49c9e3[_0x513d('0x2b')](_0x2dc610)['end']();};}function respondWithResult(_0x3ea667,_0xa04b61){_0xa04b61=_0xa04b61||0xc8;return function(_0x1e64ad){if(_0x1e64ad){return _0x3ea667['status'](_0xa04b61)['json'](_0x1e64ad);}};}function respondWithFilteredResult(_0x3a1147,_0x4f43b8){return function(_0x2337ac){if(_0x2337ac){var _0x53865a=typeof _0x4f43b8[_0x513d('0x2c')]===_0x513d('0x2d')&&typeof _0x4f43b8[_0x513d('0x2e')]===_0x513d('0x2d');var _0x954072=_0x2337ac[_0x513d('0x2f')];var _0x20771b=_0x53865a?0x0:_0x4f43b8[_0x513d('0x2c')];var _0x3c4487=_0x53865a?_0x2337ac[_0x513d('0x2f')]:_0x4f43b8[_0x513d('0x2c')]+_0x4f43b8[_0x513d('0x2e')];var _0x45c9b1;if(_0x3c4487>=_0x954072){_0x3c4487=_0x954072;_0x45c9b1=0xc8;}else{_0x45c9b1=0xce;}_0x3a1147['status'](_0x45c9b1);return _0x3a1147['set'](_0x513d('0x30'),_0x20771b+'-'+_0x3c4487+'/'+_0x954072)[_0x513d('0x31')](_0x2337ac);}return null;};}function patchUpdates(_0x4ac904){return function(_0x195f7e){try{jsonpatch['apply'](_0x195f7e,_0x4ac904,!![]);}catch(_0x204c3c){return BPromise['reject'](_0x204c3c);}return _0x195f7e[_0x513d('0x32')]();};}function saveUpdates(_0x527029,_0x40f697){return function(_0xfdd438){if(_0xfdd438){return _0xfdd438[_0x513d('0x33')](_0x527029)[_0x513d('0x34')](function(_0xf1c37d){return _0xf1c37d;});}return null;};}function removeEntity(_0x2a5cc0,_0x317dc3){return function(_0x3a3173){if(_0x3a3173){return _0x3a3173['destroy']()[_0x513d('0x34')](function(){var _0xa6b15c=_0x3a3173[_0x513d('0x35')]({'plain':!![]});var _0x4629ea=_0x513d('0x36');return db[_0x513d('0x37')]['destroy']({'where':{'type':_0x4629ea,'resourceId':_0xa6b15c['id']}})[_0x513d('0x34')](function(){return _0x3a3173;});})[_0x513d('0x34')](function(){_0x2a5cc0[_0x513d('0x2b')](0xcc)[_0x513d('0x38')]();});}};}function handleEntityNotFound(_0x246346,_0x5ce53e){return function(_0x487b8e){if(!_0x487b8e){_0x246346['sendStatus'](0x194);}return _0x487b8e;};}function handleError(_0x54c5ec,_0x46efe7){_0x46efe7=_0x46efe7||0x1f4;return function(_0x55247d){logger[_0x513d('0x25')](_0x55247d['stack']);if(_0x55247d[_0x513d('0x39')]){delete _0x55247d[_0x513d('0x39')];}_0x54c5ec['status'](_0x46efe7)[_0x513d('0x3a')](_0x55247d);};}exports[_0x513d('0x3b')]=function(_0xf79bd,_0x44d669){var _0x31615f={},_0x6d772d={},_0x4cb7eb={'count':0x0,'rows':[]};var _0x54e195=_['map'](db[_0x513d('0x3c')][_0x513d('0x3d')],function(_0x422276){return{'name':_0x422276[_0x513d('0x3e')],'type':_0x422276[_0x513d('0x3f')][_0x513d('0x40')]};});_0x6d772d[_0x513d('0x41')]=_[_0x513d('0x42')](_0x54e195,_0x513d('0x39'));_0x6d772d[_0x513d('0x43')]=_[_0x513d('0x44')](_0xf79bd[_0x513d('0x43')]);_0x6d772d[_0x513d('0x45')]=_['intersection'](_0x6d772d[_0x513d('0x41')],_0x6d772d['query']);_0x31615f['attributes']=_[_0x513d('0x46')](_0x6d772d['model'],qs[_0x513d('0x47')](_0xf79bd[_0x513d('0x43')][_0x513d('0x47')]));_0x31615f['attributes']=_0x31615f[_0x513d('0x48')][_0x513d('0x49')]?_0x31615f['attributes']:_0x6d772d['model'];if(!_0xf79bd[_0x513d('0x43')]['hasOwnProperty'](_0x513d('0x4a'))){_0x31615f[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0xf79bd[_0x513d('0x43')]['limit']);_0x31615f[_0x513d('0x2c')]=qs['offset'](_0xf79bd['query']['offset']);}_0x31615f[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0xf79bd[_0x513d('0x43')][_0x513d('0x4c')]);_0x31615f[_0x513d('0x4d')]=qs['filters'](_[_0x513d('0x4e')](_0xf79bd[_0x513d('0x43')],_0x6d772d[_0x513d('0x45')]),_0x54e195);if(_0xf79bd['query'][_0x513d('0x4f')]){_0x31615f[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x31615f[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x54e195,function(_0xb04503){if(_0xb04503[_0x513d('0x3f')]!==_0x513d('0x51')){var _0x1aaea8={};_0x1aaea8[_0xb04503[_0x513d('0x39')]]={'$like':'%'+_0xf79bd['query'][_0x513d('0x4f')]+'%'};return _0x1aaea8;}})});}_0x31615f=_[_0x513d('0x50')]({},_0x31615f,_0xf79bd[_0x513d('0x52')]);var _0x57c14e={'where':_0x31615f[_0x513d('0x4d')]};return db[_0x513d('0x3c')][_0x513d('0x2f')](_0x57c14e)[_0x513d('0x34')](function(_0x416932){_0x4cb7eb[_0x513d('0x2f')]=_0x416932;if(_0xf79bd['query'][_0x513d('0x53')]){_0x31615f[_0x513d('0x54')]=[{'all':!![]}];}return db[_0x513d('0x3c')]['findAll'](_0x31615f);})[_0x513d('0x34')](function(_0x1029a2){_0x4cb7eb['rows']=_0x1029a2;return _0x4cb7eb;})[_0x513d('0x34')](respondWithFilteredResult(_0x44d669,_0x31615f))['catch'](handleError(_0x44d669,null));};exports[_0x513d('0x55')]=function(_0x204bcd,_0x4c99ad){var _0x8b7c9f={'raw':!![],'where':{'id':_0x204bcd[_0x513d('0x56')]['id']}},_0x1e6338={};_0x1e6338[_0x513d('0x41')]=_[_0x513d('0x44')](db['ChatQueue']['rawAttributes']);_0x1e6338['query']=_[_0x513d('0x44')](_0x204bcd[_0x513d('0x43')]);_0x1e6338[_0x513d('0x45')]=_['intersection'](_0x1e6338[_0x513d('0x41')],_0x1e6338[_0x513d('0x43')]);_0x8b7c9f[_0x513d('0x48')]=_[_0x513d('0x46')](_0x1e6338['model'],qs[_0x513d('0x47')](_0x204bcd[_0x513d('0x43')][_0x513d('0x47')]));_0x8b7c9f[_0x513d('0x48')]=_0x8b7c9f['attributes']['length']?_0x8b7c9f['attributes']:_0x1e6338['model'];if(_0x204bcd['query'][_0x513d('0x53')]){_0x8b7c9f[_0x513d('0x54')]=[{'all':!![]}];}_0x8b7c9f=_['merge']({},_0x8b7c9f,_0x204bcd[_0x513d('0x52')]);return db[_0x513d('0x3c')][_0x513d('0x57')](_0x8b7c9f)[_0x513d('0x34')](handleEntityNotFound(_0x4c99ad,null))[_0x513d('0x34')](respondWithResult(_0x4c99ad,null))[_0x513d('0x58')](handleError(_0x4c99ad,null));};exports[_0x513d('0x59')]=function(_0x2aa86a,_0x496fe6){return db[_0x513d('0x3c')][_0x513d('0x59')](_0x2aa86a['body'],{})[_0x513d('0x34')](function(_0x2a5de2){var _0x41f507=_0x2aa86a[_0x513d('0x5a')][_0x513d('0x35')]({'plain':!![]});if(!_0x41f507)throw new Error(_0x513d('0x5b'));if(_0x41f507[_0x513d('0x5c')]===_0x513d('0x5a')){var _0x13712c=_0x2a5de2[_0x513d('0x35')]({'plain':!![]});var _0x22b017='ChatQueues';return db[_0x513d('0x5d')][_0x513d('0x57')]({'where':{'name':_0x22b017,'userProfileId':_0x41f507[_0x513d('0x5e')]},'raw':!![]})[_0x513d('0x34')](function(_0x5f1b16){if(_0x5f1b16&&_0x5f1b16[_0x513d('0x5f')]===0x0){return db[_0x513d('0x37')]['create']({'name':_0x13712c[_0x513d('0x39')],'resourceId':_0x13712c['id'],'type':_0x5f1b16[_0x513d('0x39')],'sectionId':_0x5f1b16['id']},{})[_0x513d('0x34')](function(){return _0x2a5de2;});}else{return _0x2a5de2;}})[_0x513d('0x58')](function(_0x3e7049){logger['error'](_0x513d('0x60'),_0x3e7049);throw _0x3e7049;});}return _0x2a5de2;})[_0x513d('0x34')](respondWithResult(_0x496fe6,0xc9))[_0x513d('0x58')](handleError(_0x496fe6,null));};exports[_0x513d('0x33')]=function(_0xd8ad8f,_0x1aeaa9){if(_0xd8ad8f[_0x513d('0x61')]['id']){delete _0xd8ad8f[_0x513d('0x61')]['id'];}return db[_0x513d('0x3c')][_0x513d('0x57')]({'where':{'id':_0xd8ad8f[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x1aeaa9,null))[_0x513d('0x34')](saveUpdates(_0xd8ad8f[_0x513d('0x61')],null))[_0x513d('0x34')](respondWithResult(_0x1aeaa9,null))[_0x513d('0x58')](handleError(_0x1aeaa9,null));};exports[_0x513d('0x62')]=function(_0x5078e3,_0x1a4d1a){return db['ChatQueue'][_0x513d('0x57')]({'where':{'id':_0x5078e3[_0x513d('0x56')]['id']}})['then'](handleEntityNotFound(_0x1a4d1a,null))['then'](removeEntity(_0x1a4d1a,null))['catch'](handleError(_0x1a4d1a,null));};exports[_0x513d('0x63')]=function(_0x4c1f77,_0x1c3fbf){return db[_0x513d('0x3c')]['describe']()[_0x513d('0x34')](respondWithResult(_0x1c3fbf,null))['catch'](handleError(_0x1c3fbf,null));};exports[_0x513d('0x64')]=function(_0xb20e68,_0x125a95,_0x35d321){var _0x30e8b0={'raw':!![],'where':{}},_0x40cd12={},_0x40056c;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0xb20e68[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x125a95,null))[_0x513d('0x34')](function(_0x5a3580){if(_0x5a3580){_0x40056c=_0x5a3580[_0x513d('0x35')]({'plain':!![]});_0x40cd12[_0x513d('0x41')]=_[_0x513d('0x44')](db[_0x513d('0x66')]['rawAttributes']);_0x40cd12[_0x513d('0x43')]=_[_0x513d('0x44')](_0xb20e68[_0x513d('0x43')]);_0x40cd12[_0x513d('0x45')]=_[_0x513d('0x46')](_0x40cd12[_0x513d('0x41')],_0x40cd12[_0x513d('0x43')]);_0x30e8b0[_0x513d('0x48')]=_[_0x513d('0x46')](_0x40cd12[_0x513d('0x41')],qs[_0x513d('0x47')](_0xb20e68[_0x513d('0x43')][_0x513d('0x47')]));_0x30e8b0['attributes']=_0x30e8b0[_0x513d('0x48')]['length']?_0x30e8b0['attributes']:_0x40cd12[_0x513d('0x41')];if(!_0xb20e68['query'][_0x513d('0x67')](_0x513d('0x4a'))){_0x30e8b0['limit']=qs['limit'](_0xb20e68[_0x513d('0x43')][_0x513d('0x2e')]);_0x30e8b0[_0x513d('0x2c')]=qs[_0x513d('0x2c')](_0xb20e68[_0x513d('0x43')][_0x513d('0x2c')]);}_0x30e8b0[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0xb20e68[_0x513d('0x43')][_0x513d('0x4c')]);_0x30e8b0['where']=qs[_0x513d('0x45')](_['pick'](_0xb20e68[_0x513d('0x43')],_0x40cd12['filters']));_0x30e8b0['where']['ChatQueueId']=_0x5a3580['id'];if(_0xb20e68[_0x513d('0x43')]['filter']){_0x30e8b0['where']=_[_0x513d('0x50')](_0x30e8b0[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x30e8b0[_0x513d('0x48')],function(_0x3d06a0){var _0x6cabb0={};_0x6cabb0[_0x3d06a0]={'$like':'%'+_0xb20e68[_0x513d('0x43')]['filter']+'%'};return _0x6cabb0;})});}_0x30e8b0=_[_0x513d('0x50')]({},_0x30e8b0,_0xb20e68[_0x513d('0x52')]);return db[_0x513d('0x66')][_0x513d('0x68')](_0x30e8b0);}})[_0x513d('0x34')](function(_0x4da859){if(_0x4da859){return db[_0x513d('0x69')][_0x513d('0x6a')]({'where':{'id':_['map'](_0x4da859,_0x513d('0x6b')),'role':'agent'},'attributes':['id',_0x513d('0x39'),_0x513d('0x6c'),_0x513d('0x6d'),_0x513d('0x6e')]});}})[_0x513d('0x34')](function(_0x3e559c){if(_0x3e559c){return{'count':_0x3e559c[_0x513d('0x2f')],'rows':_[_0x513d('0x42')](_0x3e559c[_0x513d('0x6f')],function(_0x19d890){return{'membername':_0x19d890[_0x513d('0x39')],'UserId':_0x19d890['id'],'queue_name':_0x40056c[_0x513d('0x39')],'ChatQueueId':_0x40056c['id'],'interface':util[_0x513d('0x70')](_0x513d('0x71'),_0x513d('0x72'),_0x19d890[_0x513d('0x39')]),'penalty':0x0,'paused':_0x19d890[_0x513d('0x6c')],'createdAt':_0x19d890['createdAt'],'updatedAt':_0x19d890[_0x513d('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x513d('0x34')](respondWithFilteredResult(_0x125a95,_0x30e8b0))['catch'](handleError(_0x125a95,null));};exports['getTeams']=function(_0x369597,_0x5e8b95,_0x58e467){var _0x528f3f={};var _0x7e0213={};var _0x3bbd27;var _0x5e90d4;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0x369597['params']['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x5e8b95,null))[_0x513d('0x34')](function(_0x3c8273){if(_0x3c8273){_0x3bbd27=_0x3c8273;_0x7e0213[_0x513d('0x41')]=_['keys'](db[_0x513d('0x73')]['rawAttributes']);_0x7e0213[_0x513d('0x43')]=_[_0x513d('0x44')](_0x369597[_0x513d('0x43')]);_0x7e0213['filters']=_[_0x513d('0x46')](_0x7e0213[_0x513d('0x41')],_0x7e0213[_0x513d('0x43')]);_0x528f3f['attributes']=_['intersection'](_0x7e0213[_0x513d('0x41')],qs['fields'](_0x369597[_0x513d('0x43')][_0x513d('0x47')]));_0x528f3f[_0x513d('0x48')]=_0x528f3f['attributes'][_0x513d('0x49')]?_0x528f3f['attributes']:_0x7e0213[_0x513d('0x41')];_0x528f3f[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0x369597[_0x513d('0x43')][_0x513d('0x4c')]);_0x528f3f[_0x513d('0x4d')]=qs[_0x513d('0x45')](_[_0x513d('0x4e')](_0x369597['query'],_0x7e0213[_0x513d('0x45')]));if(_0x369597[_0x513d('0x43')][_0x513d('0x4f')]){_0x528f3f[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x528f3f[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x528f3f[_0x513d('0x48')],function(_0x37c068){var _0x5b21b6={};_0x5b21b6[_0x37c068]={'$like':'%'+_0x369597[_0x513d('0x43')][_0x513d('0x4f')]+'%'};return _0x5b21b6;})});}_0x528f3f=_['merge']({},_0x528f3f,_0x369597[_0x513d('0x52')]);return _0x3bbd27['getTeams'](_0x528f3f);}})[_0x513d('0x34')](function(_0x149a19){if(_0x149a19){_0x5e90d4=_0x149a19[_0x513d('0x49')];if(!_0x369597[_0x513d('0x43')][_0x513d('0x67')](_0x513d('0x4a'))){_0x528f3f[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0x369597[_0x513d('0x43')][_0x513d('0x2e')]);_0x528f3f[_0x513d('0x2c')]=qs[_0x513d('0x2c')](_0x369597[_0x513d('0x43')][_0x513d('0x2c')]);}return _0x3bbd27[_0x513d('0x74')](_0x528f3f);}})[_0x513d('0x34')](function(_0x31d3ed){if(_0x31d3ed){return _0x31d3ed?{'count':_0x5e90d4,'rows':_0x31d3ed}:null;}})[_0x513d('0x34')](respondWithResult(_0x5e8b95,null))[_0x513d('0x58')](handleError(_0x5e8b95,null));};exports[_0x513d('0x75')]=function(_0x1849e0,_0x49dbd4,_0x4bba05){var _0x160ab7=_0x1849e0['body']['ids'];return db[_0x513d('0x73')]['findAll']({'where':{'id':_0x160ab7},'attributes':['id'],'include':[{'model':db[_0x513d('0x69')],'as':_0x513d('0x76'),'attributes':['id',_0x513d('0x39'),_0x513d('0x77'),_0x513d('0x78'),_0x513d('0x79')],'raw':!![]}]})['then'](function(_0x3ee42b){if(_0x3ee42b){var _0x3862c7=_[_0x513d('0x7a')](_0x3ee42b,function(_0x805e93){var _0x23191f=_0x805e93[_0x513d('0x35')]({'plain':!![]});return _0x23191f[_0x513d('0x76')];});return db['ChatQueue'][_0x513d('0x57')]({'where':{'id':_0x1849e0[_0x513d('0x56')]['id']}})['then'](function(_0x3200a8){return db[_0x513d('0x7b')][_0x513d('0x7c')](function(_0x37230a){return _0x3200a8[_0x513d('0x75')](_0x160ab7,{'transaction':_0x37230a})[_0x513d('0x34')](function(){return BPromise[_0x513d('0x7d')](_0x3862c7,function(_0x10b30b){return db[_0x513d('0x66')][_0x513d('0x7e')]({'where':{'UserId':_0x10b30b['id'],'ChatQueueId':_0x1849e0[_0x513d('0x56')]['id']},'transaction':_0x37230a});});})[_0x513d('0x34')](function(){_0x3862c7['forEach'](function(_0x2f26e7){socket['emit']('userChatQueue:save',{'UserId':_0x2f26e7['id'],'ChatQueueId':_0x3200a8['id']});});});});});}})[_0x513d('0x34')](respondWithStatusCode(_0x49dbd4,null))[_0x513d('0x58')](handleError(_0x49dbd4,null));};exports[_0x513d('0x7f')]=function(_0x5bc83e,_0x29a914,_0x211658){return db[_0x513d('0x73')][_0x513d('0x68')]({'where':{'id':_0x5bc83e[_0x513d('0x43')][_0x513d('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x513d('0x34')](handleEntityNotFound(_0x29a914,null))[_0x513d('0x34')](function(_0x2e7e71){var _0x1edff0=_[_0x513d('0x42')](_0x2e7e71,'id');var _0x158e02=[];var _0xcb4469=[];var _0x3ba62e=squel[_0x513d('0x81')]();_0x3ba62e[_0x513d('0x82')](_0x513d('0x83'))['from'](_0x513d('0x84'),'tq')['join'](_0x513d('0x85'),'ut',_0x513d('0x86'))[_0x513d('0x4d')](_0x513d('0x87'),_0x5bc83e[_0x513d('0x56')]['id']);for(var _0xbcbf64=0x0;_0xbcbf64<_0x2e7e71[_0x513d('0x49')];_0xbcbf64+=0x1){let _0x22554a=_0x2e7e71[_0xbcbf64];for(var _0x3eab60=0x0;_0x3eab60<_0x22554a[_0x513d('0x76')][_0x513d('0x49')];_0x3eab60+=0x1){let _0x69f3e6=_0x22554a[_0x513d('0x76')][_0x3eab60];var _0x395681=_0x3ba62e[_0x513d('0x88')]();_0x395681['where'](_0x513d('0x89'),_0x69f3e6['id']);_0xcb4469['push'](db[_0x513d('0x7b')][_0x513d('0x43')](_0x395681['toString'](),{'type':db['sequelize'][_0x513d('0x8a')][_0x513d('0x8b')]})[_0x513d('0x34')](function(_0xb92bf7){if(_0xb92bf7[_0x513d('0x49')]===0x1){return _0x69f3e6['id'];}else{var _0x225e06=_[_0x513d('0x8c')](_[_0x513d('0x42')](_0xb92bf7,_0x513d('0x8d')),function(_0x3a0684){return _[_0x513d('0x8e')](_0x1edff0,_0x3a0684);});if(_0x225e06){return _0x69f3e6['id'];}}}));}}return BPromise[_0x513d('0x8f')](_0xcb4469)['then'](function(_0x1752b4){_0x158e02=_(_0x158e02)[_0x513d('0x90')](_0x1752b4)['compact']()[_0x513d('0x91')]();return db[_0x513d('0x3c')][_0x513d('0x57')]({'where':{'id':_0x5bc83e[_0x513d('0x56')]['id']}})[_0x513d('0x34')](function(_0x25a887){return db[_0x513d('0x7b')][_0x513d('0x7c')](function(_0x61c4af){return _0x25a887[_0x513d('0x7f')](_0x5bc83e[_0x513d('0x43')][_0x513d('0x80')],{'transaction':_0x61c4af})[_0x513d('0x34')](function(){if(!_[_0x513d('0x92')](_0x158e02)){return _0x25a887[_0x513d('0x93')](_0x158e02,{'transaction':_0x61c4af});}})[_0x513d('0x34')](function(){_0x158e02[_0x513d('0x94')](function(_0x54ec23){socket[_0x513d('0x95')](_0x513d('0x96'),{'UserId':_0x54ec23,'ChatQueueId':_0x25a887['id']});});});});});});})[_0x513d('0x34')](respondWithStatusCode(_0x29a914,null))[_0x513d('0x58')](handleError(_0x29a914,null));};exports[_0x513d('0x97')]=function(_0x15e0c5,_0x56a690,_0x23bbe6){return db[_0x513d('0x3c')]['find']({'where':{'id':_0x15e0c5[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x56a690,null))[_0x513d('0x34')](function(_0x5b22dc){if(_0x5b22dc){return _0x5b22dc[_0x513d('0x97')](_0x15e0c5['body'][_0x513d('0x80')],_[_0x513d('0x98')](_0x15e0c5[_0x513d('0x61')],[_0x513d('0x80'),'id'])||{})[_0x513d('0x99')](function(_0x2d706c){for(var _0x2020b0=0x0;_0x2020b0<_0x15e0c5[_0x513d('0x61')]['ids']['length'];_0x2020b0+=0x1){socket[_0x513d('0x95')](_0x513d('0x9a'),{'UserId':Number(_0x15e0c5[_0x513d('0x61')][_0x513d('0x80')][_0x2020b0]),'ChatQueueId':Number(_0x15e0c5[_0x513d('0x56')]['id'])});}return _0x2d706c;});}})[_0x513d('0x34')](respondWithResult(_0x56a690,null))['catch'](handleError(_0x56a690,null));};exports[_0x513d('0x93')]=function(_0x4a5004,_0x868d0d,_0x1089e2){return db[_0x513d('0x3c')]['find']({'where':{'id':_0x4a5004[_0x513d('0x56')]['id']}})[_0x513d('0x34')](handleEntityNotFound(_0x868d0d,null))[_0x513d('0x34')](function(_0xda19b4){if(_0xda19b4){return _0xda19b4[_0x513d('0x93')](_0x4a5004[_0x513d('0x43')][_0x513d('0x80')])[_0x513d('0x34')](function(){if(_[_0x513d('0x9b')](_0x4a5004['query']['ids'])){for(var _0x168022=0x0;_0x168022<_0x4a5004['query']['ids']['length'];_0x168022+=0x1){socket[_0x513d('0x95')]('userChatQueue:remove',{'UserId':Number(_0x4a5004['query']['ids'][_0x168022]),'ChatQueueId':Number(_0x4a5004[_0x513d('0x56')]['id'])});}}else{socket[_0x513d('0x95')](_0x513d('0x96'),{'UserId':Number(_0x4a5004[_0x513d('0x43')][_0x513d('0x80')]),'ChatQueueId':Number(_0x4a5004[_0x513d('0x56')]['id'])});}});}})[_0x513d('0x34')](respondWithStatusCode(_0x868d0d,null))['catch'](handleError(_0x868d0d,null));};exports[_0x513d('0x9c')]=function(_0x3e407c,_0x860c2e,_0x85d548){var _0x5df9be={};var _0x2c0d25={};var _0x182a41;var _0x29c401;return db[_0x513d('0x3c')][_0x513d('0x65')]({'where':{'id':_0x3e407c['params']['id']}})['then'](handleEntityNotFound(_0x860c2e,null))[_0x513d('0x34')](function(_0x1bb9c0){if(_0x1bb9c0){_0x182a41=_0x1bb9c0;_0x2c0d25['model']=_[_0x513d('0x44')](db[_0x513d('0x69')][_0x513d('0x3d')]);_0x2c0d25[_0x513d('0x43')]=_['keys'](_0x3e407c[_0x513d('0x43')]);_0x2c0d25['filters']=_[_0x513d('0x46')](_0x2c0d25[_0x513d('0x41')],_0x2c0d25[_0x513d('0x43')]);_0x5df9be['attributes']=_[_0x513d('0x46')](_0x2c0d25['model'],qs[_0x513d('0x47')](_0x3e407c[_0x513d('0x43')][_0x513d('0x47')]));_0x5df9be['attributes']=_0x5df9be[_0x513d('0x48')][_0x513d('0x49')]?_0x5df9be[_0x513d('0x48')]:_0x2c0d25['model'];_0x5df9be[_0x513d('0x4b')]=qs[_0x513d('0x4c')](_0x3e407c[_0x513d('0x43')][_0x513d('0x4c')]);_0x5df9be[_0x513d('0x4d')]=qs['filters'](_['pick'](_0x3e407c[_0x513d('0x43')],_0x2c0d25[_0x513d('0x45')]));if(_0x3e407c[_0x513d('0x43')][_0x513d('0x4f')]){_0x5df9be[_0x513d('0x4d')]=_[_0x513d('0x50')](_0x5df9be[_0x513d('0x4d')],{'$or':_[_0x513d('0x42')](_0x5df9be[_0x513d('0x48')],function(_0x272dc6){var _0x587c24={};_0x587c24[_0x272dc6]={'$like':'%'+_0x3e407c[_0x513d('0x43')]['filter']+'%'};return _0x587c24;})});}_0x5df9be=_[_0x513d('0x50')]({},_0x5df9be,_0x3e407c[_0x513d('0x52')]);return _0x182a41[_0x513d('0x9c')](_0x5df9be);}})['then'](function(_0x288820){if(_0x288820){_0x29c401=_0x288820[_0x513d('0x49')];if(!_0x3e407c[_0x513d('0x43')][_0x513d('0x67')]('nolimit')){_0x5df9be[_0x513d('0x2e')]=qs[_0x513d('0x2e')](_0x3e407c[_0x513d('0x43')][_0x513d('0x2e')]);_0x5df9be['offset']=qs['offset'](_0x3e407c[_0x513d('0x43')][_0x513d('0x2c')]);}return _0x182a41['getAgents'](_0x5df9be);}})[_0x513d('0x34')](function(_0x3c51aa){if(_0x3c51aa){return _0x3c51aa?{'count':_0x29c401,'rows':_0x3c51aa}:null;}})[_0x513d('0x34')](respondWithResult(_0x860c2e,null))[_0x513d('0x58')](handleError(_0x860c2e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1071701..fa6cd3e 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 _0x7140=['events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7140,0xd8));var _0x0714=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0x7140[_0x146be0];return _0x1bcc25;};'use strict';var EventEmitter=require(_0x0714('0x0'));var ChatQueue=require(_0x0714('0x1'))['db'][_0x0714('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0714('0x3')](0x0);var events={'afterCreate':_0x0714('0x4'),'afterUpdate':'update','afterDestroy':_0x0714('0x5')};function emitEvent(_0x4506b5){return function(_0x5205dc,_0x34e4c4,_0x593f68){ChatQueueEvents['emit'](_0x4506b5+':'+_0x5205dc['id'],_0x5205dc);ChatQueueEvents[_0x0714('0x6')](_0x4506b5,_0x5205dc);_0x593f68(null);};}for(var e in events){if(events[_0x0714('0x7')](e)){var event=events[e];ChatQueue[_0x0714('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x8ff5=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x568aff,_0x160dad){var _0x140c14=function(_0x29aa1e){while(--_0x29aa1e){_0x568aff['push'](_0x568aff['shift']());}};_0x140c14(++_0x160dad);}(_0x8ff5,0x78));var _0x58ff=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8ff5[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x58ff('0x0'));var ChatQueue=require(_0x58ff('0x1'))['db'][_0x58ff('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x58ff('0x3')](0x0);var events={'afterCreate':_0x58ff('0x4'),'afterUpdate':_0x58ff('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1009be){return function(_0x75f931,_0x4d0046,_0x1f5c74){ChatQueueEvents[_0x58ff('0x6')](_0x1009be+':'+_0x75f931['id'],_0x75f931);ChatQueueEvents['emit'](_0x1009be,_0x75f931);_0x1f5c74(null);};}for(var e in events){if(events[_0x58ff('0x7')](e)){var event=events[e];ChatQueue[_0x58ff('0x8')](e,emitEvent(event));}}module[_0x58ff('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 cf5d22f..b9ee20d 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 _0xe32b=['bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','api','moment'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe32b,0xec));var _0xbe32=function(_0x46055f,_0x15e5c6){_0x46055f=_0x46055f-0x0;var _0x4ceef5=_0xe32b[_0x46055f];return _0x4ceef5;};'use strict';var _=require(_0xbe32('0x0'));var util=require(_0xbe32('0x1'));var logger=require('../../config/logger')(_0xbe32('0x2'));var moment=require(_0xbe32('0x3'));var BPromise=require(_0xbe32('0x4'));var rp=require(_0xbe32('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe32('0x6'));var config=require(_0xbe32('0x7'));var attributes=require(_0xbe32('0x8'));module['exports']=function(_0x4c4b51,_0x1a540f){return _0x4c4b51[_0xbe32('0x9')](_0xbe32('0xa'),attributes,{'tableName':_0xbe32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c2d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x551d43,_0x5081eb){var _0x27b4b4=function(_0x58aa6c){while(--_0x58aa6c){_0x551d43['push'](_0x551d43['shift']());}};_0x27b4b4(++_0x5081eb);}(_0x3c2d,0x8f));var _0xd3c2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3c2d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd3c2('0x0'));var util=require(_0xd3c2('0x1'));var logger=require(_0xd3c2('0x2'))(_0xd3c2('0x3'));var moment=require('moment');var BPromise=require(_0xd3c2('0x4'));var rp=require(_0xd3c2('0x5'));var fs=require('fs');var path=require(_0xd3c2('0x6'));var rimraf=require(_0xd3c2('0x7'));var config=require(_0xd3c2('0x8'));var attributes=require(_0xd3c2('0x9'));module[_0xd3c2('0xa')]=function(_0x474d68,_0x208eb1){return _0x474d68[_0xd3c2('0xb')](_0xd3c2('0xc'),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 4f4b411..cfaf127 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 _0x1399=['findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetChatQueue','ChatQueue'];(function(_0x45c1ed,_0x56e8dd){var _0x4dd55a=function(_0xac4822){while(--_0xac4822){_0x45c1ed['push'](_0x45c1ed['shift']());}};_0x4dd55a(++_0x56e8dd);}(_0x1399,0x16c));var _0x9139=function(_0x419aa4,_0x5926a7){_0x419aa4=_0x419aa4-0x0;var _0x557d9b=_0x1399[_0x419aa4];return _0x557d9b;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var moment=require('moment');var BPromise=require(_0x9139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x3'));var db=require(_0x9139('0x4'))['db'];var utils=require(_0x9139('0x5'));var logger=require(_0x9139('0x6'))(_0x9139('0x7'));var config=require(_0x9139('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9139('0x9')]({'port':0x232a});config[_0x9139('0xa')]=_[_0x9139('0xb')](config['redis'],{'host':_0x9139('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9139('0xd'))[_0x9139('0xe')](socket);function respondWithRpcPromise(_0x4830cd,_0x315de8,_0x1bfa6b){return new BPromise(function(_0x5c90eb,_0x4f7f3a){return client[_0x9139('0xf')](_0x4830cd,_0x1bfa6b)[_0x9139('0x10')](function(_0x23357c){logger[_0x9139('0x11')](_0x9139('0x12'),_0x315de8,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'),JSON['stringify'](_0x23357c));if(_0x23357c[_0x9139('0x14')]){if(_0x23357c[_0x9139('0x14')][_0x9139('0x15')]===0x1f4){logger[_0x9139('0x14')]('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x23357c[_0x9139('0x14')]['message']);return _0x4f7f3a(_0x23357c['error']['message']);}logger[_0x9139('0x14')](_0x9139('0x12'),_0x315de8,_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);return _0x5c90eb(_0x23357c[_0x9139('0x14')][_0x9139('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x9139('0x13'));_0x5c90eb(_0x23357c[_0x9139('0x17')]['message']);}})['catch'](function(_0x30a363){logger[_0x9139('0x14')]('ChatQueue,\x20%s,\x20%s',_0x315de8,_0x30a363);_0x4f7f3a(_0x30a363);});});}exports[_0x9139('0x18')]=function(_0x1ef57b){var _0x1a592e=this;return new Promise(function(_0x3c8296,_0xd2eb33){return db[_0x9139('0x19')][_0x9139('0x1a')]({'raw':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1d')]||null:null,'attributes':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1e')]||null:null,'limit':_0x1ef57b[_0x9139('0x1b')]?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x1f')]||null:null,'include':_0x1ef57b['options']?_0x1ef57b[_0x9139('0x1b')][_0x9139('0x20')]?_['map'](_0x1ef57b[_0x9139('0x1b')][_0x9139('0x20')],function(_0x10bfa0){return{'model':db[_0x10bfa0['model']],'as':_0x10bfa0['as'],'attributes':_0x10bfa0[_0x9139('0x1e')],'include':_0x10bfa0[_0x9139('0x20')]?_['map'](_0x10bfa0[_0x9139('0x20')],function(_0x39e8cf){return{'model':db[_0x39e8cf[_0x9139('0x21')]],'as':_0x39e8cf['as'],'attributes':_0x39e8cf['attributes'],'include':_0x39e8cf[_0x9139('0x20')]?_[_0x9139('0x22')](_0x39e8cf[_0x9139('0x20')],function(_0x22994c){return{'model':db[_0x22994c[_0x9139('0x21')]],'as':_0x22994c['as'],'attributes':_0x22994c[_0x9139('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9139('0x10')](function(_0x573a05){logger['info'](_0x9139('0x18'),_0x1ef57b);logger[_0x9139('0x23')](_0x9139('0x18'),_0x1ef57b,JSON['stringify'](_0x573a05));_0x3c8296(_0x573a05);})['catch'](function(_0x24e8d5){logger[_0x9139('0x14')](_0x9139('0x18'),_0x24e8d5[_0x9139('0x16')],_0x1ef57b);_0xd2eb33(_0x1a592e[_0x9139('0x14')](0x1f4,_0x24e8d5['message']));});});};exports['ShowChatQueue']=function(_0x2f26de){var _0x57a6fb=this;return new Promise(function(_0x4de1a2,_0x222429){return db[_0x9139('0x19')]['find']({'raw':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x1d')]||null:null,'attributes':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x1e')]||null:null,'include':_0x2f26de[_0x9139('0x1b')]?_0x2f26de[_0x9139('0x1b')][_0x9139('0x20')]?_[_0x9139('0x22')](_0x2f26de[_0x9139('0x1b')]['include'],function(_0x2f554a){return{'model':db[_0x2f554a[_0x9139('0x21')]],'as':_0x2f554a['as'],'attributes':_0x2f554a['attributes'],'include':_0x2f554a[_0x9139('0x20')]?_[_0x9139('0x22')](_0x2f554a[_0x9139('0x20')],function(_0x47b937){return{'model':db[_0x47b937[_0x9139('0x21')]],'as':_0x47b937['as'],'attributes':_0x47b937[_0x9139('0x1e')],'include':_0x47b937[_0x9139('0x20')]?_[_0x9139('0x22')](_0x47b937[_0x9139('0x20')],function(_0x3ee061){return{'model':db[_0x3ee061[_0x9139('0x21')]],'as':_0x3ee061['as'],'attributes':_0x3ee061[_0x9139('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9139('0x10')](function(_0x22b074){logger['info'](_0x9139('0x24'),_0x2f26de);logger[_0x9139('0x23')](_0x9139('0x24'),_0x2f26de,JSON[_0x9139('0x25')](_0x22b074));_0x4de1a2(_0x22b074);})[_0x9139('0x26')](function(_0x369ab9){logger[_0x9139('0x14')]('ShowChatQueue',_0x369ab9[_0x9139('0x16')],_0x2f26de);_0x222429(_0x57a6fb['error'](0x1f4,_0x369ab9[_0x9139('0x16')]));});});};
\ No newline at end of file
+var _0x88c3=['./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch','options','where','limit','include','map','attributes','model','GetChatQueue','stringify','ShowChatQueue','ChatQueue','find','raw','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x2c294b,_0x37ba09){var _0x5e379f=function(_0x44c2d9){while(--_0x44c2d9){_0x2c294b['push'](_0x2c294b['shift']());}};_0x5e379f(++_0x37ba09);}(_0x88c3,0x1ee));var _0x388c=function(_0x208a7f,_0x9766d8){_0x208a7f=_0x208a7f-0x0;var _0xb13b3b=_0x88c3[_0x208a7f];return _0xb13b3b;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var moment=require(_0x388c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x388c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x388c('0x3'))(_0x388c('0x4'));var config=require(_0x388c('0x5'));var jayson=require(_0x388c('0x6'));var client=jayson[_0x388c('0x7')][_0x388c('0x8')]({'port':0x232a});config['redis']=_[_0x388c('0x9')](config[_0x388c('0xa')],{'host':_0x388c('0xb'),'port':0x18eb});var socket=require(_0x388c('0xc'))(new Redis(config[_0x388c('0xa')]));require(_0x388c('0xd'))[_0x388c('0xe')](socket);function respondWithRpcPromise(_0x31963c,_0x4f1639,_0x39604c){return new BPromise(function(_0x4f0a81,_0x58659e){return client[_0x388c('0xf')](_0x31963c,_0x39604c)[_0x388c('0x10')](function(_0x31b893){logger[_0x388c('0x11')](_0x388c('0x12'),_0x4f1639,_0x388c('0x13'));logger[_0x388c('0x14')](_0x388c('0x15'),_0x4f1639,_0x388c('0x13'),JSON['stringify'](_0x31b893));if(_0x31b893['error']){if(_0x31b893['error'][_0x388c('0x16')]===0x1f4){logger[_0x388c('0x17')]('ChatQueue,\x20%s,\x20%s',_0x4f1639,_0x31b893[_0x388c('0x17')][_0x388c('0x18')]);return _0x58659e(_0x31b893['error']['message']);}logger[_0x388c('0x17')](_0x388c('0x12'),_0x4f1639,_0x31b893[_0x388c('0x17')]['message']);return _0x4f0a81(_0x31b893[_0x388c('0x17')]['message']);}else{logger[_0x388c('0x11')](_0x388c('0x12'),_0x4f1639,'request\x20sent');_0x4f0a81(_0x31b893['result'][_0x388c('0x18')]);}})[_0x388c('0x19')](function(_0x671bb5){logger['error'](_0x388c('0x12'),_0x4f1639,_0x671bb5);_0x58659e(_0x671bb5);});});}exports['GetChatQueue']=function(_0x1f6c2e){var _0x2c9df3=this;return new Promise(function(_0x37a5dd,_0x5b3031){return db['ChatQueue']['findAll']({'raw':_0x1f6c2e['options']?_0x1f6c2e[_0x388c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e['options'][_0x388c('0x1b')]||null:null,'attributes':_0x1f6c2e['options']?_0x1f6c2e[_0x388c('0x1a')]['attributes']||null:null,'limit':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1c')]||null:null,'include':_0x1f6c2e[_0x388c('0x1a')]?_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x1f6c2e[_0x388c('0x1a')][_0x388c('0x1d')],function(_0x522ecd){return{'model':db[_0x522ecd['model']],'as':_0x522ecd['as'],'attributes':_0x522ecd[_0x388c('0x1f')],'include':_0x522ecd['include']?_['map'](_0x522ecd['include'],function(_0x201ecd){return{'model':db[_0x201ecd[_0x388c('0x20')]],'as':_0x201ecd['as'],'attributes':_0x201ecd[_0x388c('0x1f')],'include':_0x201ecd[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x201ecd[_0x388c('0x1d')],function(_0x3032f5){return{'model':db[_0x3032f5[_0x388c('0x20')]],'as':_0x3032f5['as'],'attributes':_0x3032f5[_0x388c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x388c('0x10')](function(_0x43e7fc){logger[_0x388c('0x11')]('GetChatQueue',_0x1f6c2e);logger['debug'](_0x388c('0x21'),_0x1f6c2e,JSON[_0x388c('0x22')](_0x43e7fc));_0x37a5dd(_0x43e7fc);})[_0x388c('0x19')](function(_0x5a647f){logger[_0x388c('0x17')](_0x388c('0x21'),_0x5a647f[_0x388c('0x18')],_0x1f6c2e);_0x5b3031(_0x2c9df3['error'](0x1f4,_0x5a647f[_0x388c('0x18')]));});});};exports[_0x388c('0x23')]=function(_0x155863){var _0x540fbb=this;return new Promise(function(_0x5b75fa,_0x54504b){return db[_0x388c('0x24')][_0x388c('0x25')]({'raw':_0x155863['options']?_0x155863[_0x388c('0x1a')][_0x388c('0x26')]===undefined?!![]:![]:!![],'where':_0x155863['options']?_0x155863[_0x388c('0x1a')][_0x388c('0x1b')]||null:null,'attributes':_0x155863[_0x388c('0x1a')]?_0x155863[_0x388c('0x1a')][_0x388c('0x1f')]||null:null,'include':_0x155863[_0x388c('0x1a')]?_0x155863['options'][_0x388c('0x1d')]?_['map'](_0x155863['options']['include'],function(_0x3f8797){return{'model':db[_0x3f8797[_0x388c('0x20')]],'as':_0x3f8797['as'],'attributes':_0x3f8797[_0x388c('0x1f')],'include':_0x3f8797[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x3f8797[_0x388c('0x1d')],function(_0x3259b2){return{'model':db[_0x3259b2['model']],'as':_0x3259b2['as'],'attributes':_0x3259b2['attributes'],'include':_0x3259b2[_0x388c('0x1d')]?_[_0x388c('0x1e')](_0x3259b2[_0x388c('0x1d')],function(_0x279437){return{'model':db[_0x279437[_0x388c('0x20')]],'as':_0x279437['as'],'attributes':_0x279437[_0x388c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x388c('0x10')](function(_0x1db033){logger[_0x388c('0x11')](_0x388c('0x23'),_0x155863);logger[_0x388c('0x14')]('ShowChatQueue',_0x155863,JSON[_0x388c('0x22')](_0x1db033));_0x5b75fa(_0x1db033);})[_0x388c('0x19')](function(_0x543b54){logger[_0x388c('0x17')]('ShowChatQueue',_0x543b54[_0x388c('0x18')],_0x155863);_0x54504b(_0x540fbb[_0x388c('0x17')](0x1f4,_0x543b54[_0x388c('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 199d75f..ad75f8c 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 _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x3225c3,_0x3e09ea){var _0x3fa610=function(_0x3f0027){while(--_0x3f0027){_0x3225c3['push'](_0x3225c3['shift']());}};_0x3fa610(++_0x3e09ea);}(_0xe107,0xb3));var _0x7e10=function(_0x5c1832,_0x299bd1){_0x5c1832=_0x5c1832-0x0;var _0x3d05ff=_0xe107[_0x5c1832];return _0x3d05ff;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
+var _0xd0bb=['chatQueue:','./chatQueue.events','save','remove','emit','register','length'];(function(_0x697d20,_0x51339a){var _0x308725=function(_0xe7d5e4){while(--_0xe7d5e4){_0x697d20['push'](_0x697d20['shift']());}};_0x308725(++_0x51339a);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2b7248,_0x17b24e){_0x2b7248=_0x2b7248-0x0;var _0x418838=_0xd0bb[_0x2b7248];return _0x418838;};'use strict';var ChatQueueEvents=require(_0xbd0b('0x0'));var events=[_0xbd0b('0x1'),_0xbd0b('0x2'),'update'];function createListener(_0x68ea36,_0x4ab08f){return function(_0x39b03a){_0x4ab08f[_0xbd0b('0x3')](_0x68ea36,_0x39b03a);};}function removeListener(_0x53e6ce,_0x432acf){return function(){ChatQueueEvents['removeListener'](_0x53e6ce,_0x432acf);};}exports[_0xbd0b('0x4')]=function(_0x1b2499){for(var _0x158b5c=0x0,_0x37c205=events[_0xbd0b('0x5')];_0x158b5c<_0x37c205;_0x158b5c++){var _0x5eb975=events[_0x158b5c];var _0x2a4075=createListener(_0xbd0b('0x6')+_0x5eb975,_0x1b2499);ChatQueueEvents['on'](_0x5eb975,_0x2a4075);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c87561d..c27b711 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 _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(_0x576693,_0x568dfb){var _0x55c349=function(_0x5ac215){while(--_0x5ac215){_0x576693['push'](_0x576693['shift']());}};_0x55c349(++_0x568dfb);}(_0x008c,0x188));var _0xc008=function(_0x404b9a,_0xca0480){_0x404b9a=_0x404b9a-0x0;var _0x30ba61=_0x008c[_0x404b9a];return _0x30ba61;};'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
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x373096,_0x4d37aa){_0x373096=_0x373096-0x0;var _0x14a6d0=_0x5fc3[_0x373096];return _0x14a6d0;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 2de475b..7a017a1 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 _0x9e6b=['STRING','moment','sequelize'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9e6b,0x76));var _0xb9e6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9e6b[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0xb9e6('0x0'));var Sequelize=require(_0xb9e6('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9e6('0x2')]}};
\ No newline at end of file
+var _0x4d39=['DATE','exports','STRING'];(function(_0x2fc0d9,_0x464716){var _0x5a2012=function(_0x19089a){while(--_0x19089a){_0x2fc0d9['push'](_0x2fc0d9['shift']());}};_0x5a2012(++_0x464716);}(_0x4d39,0xb2));var _0x94d3=function(_0x153077,_0x2d1a73){_0x153077=_0x153077-0x0;var _0x23a4e2=_0x4d39[_0x153077];return _0x23a4e2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x94d3('0x0')]={'uniqueid':{'type':Sequelize[_0x94d3('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x94d3('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x94d3('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 7638fd9..56426df 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 _0x3dba=['reject','save','update','then','destroy','end','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','filters','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x1e399a,_0x351c59){var _0x539897=function(_0x2986fa){while(--_0x2986fa){_0x1e399a['push'](_0x1e399a['shift']());}};_0x539897(++_0x351c59);}(_0x3dba,0x73));var _0xa3db=function(_0x119b4b,_0x322a87){_0x119b4b=_0x119b4b-0x0;var _0x2ca4d5=_0x3dba[_0x119b4b];return _0x2ca4d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa3db('0x0'));var rp=require(_0xa3db('0x1'));var moment=require('moment');var BPromise=require(_0xa3db('0x2'));var Mustache=require(_0xa3db('0x3'));var util=require(_0xa3db('0x4'));var path=require(_0xa3db('0x5'));var sox=require(_0xa3db('0x6'));var csv=require(_0xa3db('0x7'));var ejs=require(_0xa3db('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa3db('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa3db('0xa'));var Redis=require(_0xa3db('0xb'));var authService=require(_0xa3db('0xc'));var qs=require(_0xa3db('0xd'));var as=require(_0xa3db('0xe'));var hardwareService=require(_0xa3db('0xf'));var logger=require(_0xa3db('0x10'))(_0xa3db('0x11'));var utils=require(_0xa3db('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa3db('0x13'));var db=require(_0xa3db('0x14'))['db'];function respondWithStatusCode(_0x56c636,_0x20f91f){_0x20f91f=_0x20f91f||0xcc;return function(_0x42f8e0){if(_0x42f8e0){return _0x56c636[_0xa3db('0x15')](_0x20f91f);}return _0x56c636['status'](_0x20f91f)['end']();};}function respondWithResult(_0x221695,_0x302c34){_0x302c34=_0x302c34||0xc8;return function(_0x4f323b){if(_0x4f323b){return _0x221695[_0xa3db('0x16')](_0x302c34)[_0xa3db('0x17')](_0x4f323b);}};}function respondWithFilteredResult(_0xb75bcc,_0x1d07c5){return function(_0xaa5756){if(_0xaa5756){var _0xd53611=typeof _0x1d07c5[_0xa3db('0x18')]===_0xa3db('0x19')&&typeof _0x1d07c5[_0xa3db('0x1a')]==='undefined';var _0x558581=_0xaa5756[_0xa3db('0x1b')];var _0x278c2a=_0xd53611?0x0:_0x1d07c5[_0xa3db('0x18')];var _0x3f5e3e=_0xd53611?_0xaa5756['count']:_0x1d07c5[_0xa3db('0x18')]+_0x1d07c5[_0xa3db('0x1a')];var _0x356f63;if(_0x3f5e3e>=_0x558581){_0x3f5e3e=_0x558581;_0x356f63=0xc8;}else{_0x356f63=0xce;}_0xb75bcc[_0xa3db('0x16')](_0x356f63);return _0xb75bcc[_0xa3db('0x1c')](_0xa3db('0x1d'),_0x278c2a+'-'+_0x3f5e3e+'/'+_0x558581)[_0xa3db('0x17')](_0xaa5756);}return null;};}function patchUpdates(_0x2c817c){return function(_0x1eee9e){try{jsonpatch[_0xa3db('0x1e')](_0x1eee9e,_0x2c817c,!![]);}catch(_0x2581e2){return BPromise[_0xa3db('0x1f')](_0x2581e2);}return _0x1eee9e[_0xa3db('0x20')]();};}function saveUpdates(_0x5de05c,_0x195f57){return function(_0x16bc03){if(_0x16bc03){return _0x16bc03[_0xa3db('0x21')](_0x5de05c)[_0xa3db('0x22')](function(_0x989eed){return _0x989eed;});}return null;};}function removeEntity(_0x55a7cf,_0x3eab0c){return function(_0x49bc1b){if(_0x49bc1b){return _0x49bc1b[_0xa3db('0x23')]()[_0xa3db('0x22')](function(){_0x55a7cf['status'](0xcc)[_0xa3db('0x24')]();});}};}function handleEntityNotFound(_0xe0be83,_0x415d61){return function(_0x5e71f2){if(!_0x5e71f2){_0xe0be83[_0xa3db('0x15')](0x194);}return _0x5e71f2;};}function handleError(_0x374d03,_0x34f314){_0x34f314=_0x34f314||0x1f4;return function(_0x1f0d0e){logger[_0xa3db('0x25')](_0x1f0d0e['stack']);if(_0x1f0d0e[_0xa3db('0x26')]){delete _0x1f0d0e[_0xa3db('0x26')];}_0x374d03[_0xa3db('0x16')](_0x34f314)[_0xa3db('0x27')](_0x1f0d0e);};}exports[_0xa3db('0x28')]=function(_0x2f8602,_0x2f08da){var _0x3416bc={},_0x19a858={},_0x2ecde3={'count':0x0,'rows':[]};var _0x52578a=_[_0xa3db('0x29')](db[_0xa3db('0x2a')][_0xa3db('0x2b')],function(_0x551010){return{'name':_0x551010[_0xa3db('0x2c')],'type':_0x551010[_0xa3db('0x2d')]['key']};});_0x19a858[_0xa3db('0x2e')]=_[_0xa3db('0x29')](_0x52578a,_0xa3db('0x26'));_0x19a858['query']=_[_0xa3db('0x2f')](_0x2f8602[_0xa3db('0x30')]);_0x19a858['filters']=_['intersection'](_0x19a858[_0xa3db('0x2e')],_0x19a858[_0xa3db('0x30')]);_0x3416bc[_0xa3db('0x31')]=_[_0xa3db('0x32')](_0x19a858[_0xa3db('0x2e')],qs[_0xa3db('0x33')](_0x2f8602[_0xa3db('0x30')][_0xa3db('0x33')]));_0x3416bc['attributes']=_0x3416bc[_0xa3db('0x31')]['length']?_0x3416bc[_0xa3db('0x31')]:_0x19a858[_0xa3db('0x2e')];if(!_0x2f8602[_0xa3db('0x30')][_0xa3db('0x34')](_0xa3db('0x35'))){_0x3416bc[_0xa3db('0x1a')]=qs[_0xa3db('0x1a')](_0x2f8602[_0xa3db('0x30')]['limit']);_0x3416bc[_0xa3db('0x18')]=qs[_0xa3db('0x18')](_0x2f8602[_0xa3db('0x30')]['offset']);}_0x3416bc[_0xa3db('0x36')]=qs[_0xa3db('0x37')](_0x2f8602[_0xa3db('0x30')][_0xa3db('0x37')]);_0x3416bc[_0xa3db('0x38')]=qs['filters'](_[_0xa3db('0x39')](_0x2f8602['query'],_0x19a858['filters']),_0x52578a);if(_0x2f8602[_0xa3db('0x30')][_0xa3db('0x3a')]){_0x3416bc[_0xa3db('0x38')]=_[_0xa3db('0x3b')](_0x3416bc[_0xa3db('0x38')],{'$or':_[_0xa3db('0x29')](_0x52578a,function(_0xa3b488){if(_0xa3b488[_0xa3db('0x2d')]!==_0xa3db('0x3c')){var _0x23c94b={};_0x23c94b[_0xa3b488[_0xa3db('0x26')]]={'$like':'%'+_0x2f8602[_0xa3db('0x30')]['filter']+'%'};return _0x23c94b;}})});}_0x3416bc=_[_0xa3db('0x3b')]({},_0x3416bc,_0x2f8602[_0xa3db('0x3d')]);var _0xe24bd1={'where':_0x3416bc[_0xa3db('0x38')]};return db[_0xa3db('0x2a')]['count'](_0xe24bd1)['then'](function(_0x414745){_0x2ecde3[_0xa3db('0x1b')]=_0x414745;if(_0x2f8602[_0xa3db('0x30')][_0xa3db('0x3e')]){_0x3416bc[_0xa3db('0x3f')]=[{'all':!![]}];}return db[_0xa3db('0x2a')][_0xa3db('0x40')](_0x3416bc);})[_0xa3db('0x22')](function(_0x57350f){_0x2ecde3['rows']=_0x57350f;return _0x2ecde3;})[_0xa3db('0x22')](respondWithFilteredResult(_0x2f08da,_0x3416bc))[_0xa3db('0x41')](handleError(_0x2f08da,null));};exports[_0xa3db('0x42')]=function(_0x4ef9d1,_0x4cf5e8){var _0x3d612d={'raw':!![],'where':{'id':_0x4ef9d1[_0xa3db('0x43')]['id']}},_0x47e625={};_0x47e625['model']=_[_0xa3db('0x2f')](db[_0xa3db('0x2a')][_0xa3db('0x2b')]);_0x47e625[_0xa3db('0x30')]=_[_0xa3db('0x2f')](_0x4ef9d1[_0xa3db('0x30')]);_0x47e625[_0xa3db('0x44')]=_['intersection'](_0x47e625[_0xa3db('0x2e')],_0x47e625[_0xa3db('0x30')]);_0x3d612d[_0xa3db('0x31')]=_[_0xa3db('0x32')](_0x47e625['model'],qs[_0xa3db('0x33')](_0x4ef9d1['query'][_0xa3db('0x33')]));_0x3d612d[_0xa3db('0x31')]=_0x3d612d['attributes']['length']?_0x3d612d[_0xa3db('0x31')]:_0x47e625['model'];if(_0x4ef9d1[_0xa3db('0x30')][_0xa3db('0x3e')]){_0x3d612d[_0xa3db('0x3f')]=[{'all':!![]}];}_0x3d612d=_[_0xa3db('0x3b')]({},_0x3d612d,_0x4ef9d1['options']);return db[_0xa3db('0x2a')][_0xa3db('0x45')](_0x3d612d)[_0xa3db('0x22')](handleEntityNotFound(_0x4cf5e8,null))[_0xa3db('0x22')](respondWithResult(_0x4cf5e8,null))[_0xa3db('0x41')](handleError(_0x4cf5e8,null));};exports[_0xa3db('0x46')]=function(_0x572bbf,_0x3cb6c0){return db[_0xa3db('0x2a')]['create'](_0x572bbf[_0xa3db('0x47')],{})['then'](respondWithResult(_0x3cb6c0,0xc9))[_0xa3db('0x41')](handleError(_0x3cb6c0,null));};exports[_0xa3db('0x21')]=function(_0x2207e9,_0x4b55a9){if(_0x2207e9[_0xa3db('0x47')]['id']){delete _0x2207e9[_0xa3db('0x47')]['id'];}return db[_0xa3db('0x2a')][_0xa3db('0x45')]({'where':{'id':_0x2207e9['params']['id']}})[_0xa3db('0x22')](handleEntityNotFound(_0x4b55a9,null))[_0xa3db('0x22')](saveUpdates(_0x2207e9[_0xa3db('0x47')],null))[_0xa3db('0x22')](respondWithResult(_0x4b55a9,null))[_0xa3db('0x41')](handleError(_0x4b55a9,null));};exports[_0xa3db('0x23')]=function(_0x40a45b,_0x3f2463){return db['ChatQueueReport']['find']({'where':{'id':_0x40a45b[_0xa3db('0x43')]['id']}})[_0xa3db('0x22')](handleEntityNotFound(_0x3f2463,null))[_0xa3db('0x22')](removeEntity(_0x3f2463,null))[_0xa3db('0x41')](handleError(_0x3f2463,null));};exports['describe']=function(_0x8d54e9,_0x40c6cd){return db[_0xa3db('0x2a')][_0xa3db('0x48')]()[_0xa3db('0x22')](respondWithResult(_0x40c6cd,null))['catch'](handleError(_0x40c6cd,null));};
\ No newline at end of file
+var _0xb0e5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs'];(function(_0x56d3cb,_0x2c77c1){var _0x4ecbce=function(_0x346555){while(--_0x346555){_0x56d3cb['push'](_0x56d3cb['shift']());}};_0x4ecbce(++_0x2c77c1);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0xe0aa03,_0x2cfd1d){_0xe0aa03=_0xe0aa03-0x0;var _0x521c13=_0xb0e5[_0xe0aa03];return _0x521c13;};'use strict';var emlformat=require(_0x5b0e('0x0'));var rimraf=require(_0x5b0e('0x1'));var zipdir=require(_0x5b0e('0x2'));var jsonpatch=require(_0x5b0e('0x3'));var rp=require(_0x5b0e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b0e('0x5'));var util=require('util');var path=require(_0x5b0e('0x6'));var sox=require('sox');var csv=require(_0x5b0e('0x7'));var ejs=require(_0x5b0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0e('0x9'));var crypto=require(_0x5b0e('0xa'));var jsforce=require(_0x5b0e('0xb'));var deskjs=require(_0x5b0e('0xc'));var toCsv=require(_0x5b0e('0x7'));var querystring=require(_0x5b0e('0xd'));var Papa=require(_0x5b0e('0xe'));var Redis=require(_0x5b0e('0xf'));var authService=require(_0x5b0e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b0e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b0e('0x12'));var utils=require(_0x5b0e('0x13'));var config=require(_0x5b0e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b0e('0x15'))['db'];function respondWithStatusCode(_0x47ee76,_0x4e37dd){_0x4e37dd=_0x4e37dd||0xcc;return function(_0x1e20b8){if(_0x1e20b8){return _0x47ee76[_0x5b0e('0x16')](_0x4e37dd);}return _0x47ee76[_0x5b0e('0x17')](_0x4e37dd)[_0x5b0e('0x18')]();};}function respondWithResult(_0x3aa726,_0x3a6fcf){_0x3a6fcf=_0x3a6fcf||0xc8;return function(_0x3d2606){if(_0x3d2606){return _0x3aa726[_0x5b0e('0x17')](_0x3a6fcf)[_0x5b0e('0x19')](_0x3d2606);}};}function respondWithFilteredResult(_0x2893f8,_0x1f8ced){return function(_0xb8e854){if(_0xb8e854){var _0x3fe6cc=typeof _0x1f8ced[_0x5b0e('0x1a')]===_0x5b0e('0x1b')&&typeof _0x1f8ced[_0x5b0e('0x1c')]===_0x5b0e('0x1b');var _0x22036a=_0xb8e854[_0x5b0e('0x1d')];var _0x3c876a=_0x3fe6cc?0x0:_0x1f8ced[_0x5b0e('0x1a')];var _0x17ac8f=_0x3fe6cc?_0xb8e854['count']:_0x1f8ced['offset']+_0x1f8ced[_0x5b0e('0x1c')];var _0x211053;if(_0x17ac8f>=_0x22036a){_0x17ac8f=_0x22036a;_0x211053=0xc8;}else{_0x211053=0xce;}_0x2893f8[_0x5b0e('0x17')](_0x211053);return _0x2893f8['set']('Content-Range',_0x3c876a+'-'+_0x17ac8f+'/'+_0x22036a)[_0x5b0e('0x19')](_0xb8e854);}return null;};}function patchUpdates(_0x570a09){return function(_0x1a145e){try{jsonpatch[_0x5b0e('0x1e')](_0x1a145e,_0x570a09,!![]);}catch(_0x10cc05){return BPromise[_0x5b0e('0x1f')](_0x10cc05);}return _0x1a145e['save']();};}function saveUpdates(_0x4e3941,_0x48c484){return function(_0x497aa2){if(_0x497aa2){return _0x497aa2[_0x5b0e('0x20')](_0x4e3941)[_0x5b0e('0x21')](function(_0x3662fc){return _0x3662fc;});}return null;};}function removeEntity(_0x46fb47,_0x80c8f9){return function(_0x496624){if(_0x496624){return _0x496624[_0x5b0e('0x22')]()['then'](function(){_0x46fb47[_0x5b0e('0x17')](0xcc)[_0x5b0e('0x18')]();});}};}function handleEntityNotFound(_0x22f0fd,_0x4a2abf){return function(_0x341476){if(!_0x341476){_0x22f0fd[_0x5b0e('0x16')](0x194);}return _0x341476;};}function handleError(_0x1fc287,_0x1e8221){_0x1e8221=_0x1e8221||0x1f4;return function(_0x3b9321){logger[_0x5b0e('0x23')](_0x3b9321[_0x5b0e('0x24')]);if(_0x3b9321[_0x5b0e('0x25')]){delete _0x3b9321[_0x5b0e('0x25')];}_0x1fc287[_0x5b0e('0x17')](_0x1e8221)[_0x5b0e('0x26')](_0x3b9321);};}exports[_0x5b0e('0x27')]=function(_0x17a648,_0xeb84a8){var _0x20cabc={},_0x333786={},_0x54d2e4={'count':0x0,'rows':[]};var _0x3a6e13=_[_0x5b0e('0x28')](db[_0x5b0e('0x29')][_0x5b0e('0x2a')],function(_0x322f22){return{'name':_0x322f22['fieldName'],'type':_0x322f22[_0x5b0e('0x2b')][_0x5b0e('0x2c')]};});_0x333786[_0x5b0e('0x2d')]=_[_0x5b0e('0x28')](_0x3a6e13,_0x5b0e('0x25'));_0x333786[_0x5b0e('0x2e')]=_[_0x5b0e('0x2f')](_0x17a648['query']);_0x333786[_0x5b0e('0x30')]=_[_0x5b0e('0x31')](_0x333786['model'],_0x333786[_0x5b0e('0x2e')]);_0x20cabc[_0x5b0e('0x32')]=_[_0x5b0e('0x31')](_0x333786[_0x5b0e('0x2d')],qs[_0x5b0e('0x33')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x33')]));_0x20cabc[_0x5b0e('0x32')]=_0x20cabc[_0x5b0e('0x32')][_0x5b0e('0x34')]?_0x20cabc[_0x5b0e('0x32')]:_0x333786['model'];if(!_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x35')](_0x5b0e('0x36'))){_0x20cabc[_0x5b0e('0x1c')]=qs[_0x5b0e('0x1c')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x1c')]);_0x20cabc[_0x5b0e('0x1a')]=qs[_0x5b0e('0x1a')](_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x1a')]);}_0x20cabc['order']=qs[_0x5b0e('0x37')](_0x17a648['query'][_0x5b0e('0x37')]);_0x20cabc[_0x5b0e('0x38')]=qs['filters'](_[_0x5b0e('0x39')](_0x17a648[_0x5b0e('0x2e')],_0x333786[_0x5b0e('0x30')]),_0x3a6e13);if(_0x17a648[_0x5b0e('0x2e')]['filter']){_0x20cabc[_0x5b0e('0x38')]=_[_0x5b0e('0x3a')](_0x20cabc[_0x5b0e('0x38')],{'$or':_[_0x5b0e('0x28')](_0x3a6e13,function(_0x39d88f){if(_0x39d88f[_0x5b0e('0x2b')]!==_0x5b0e('0x3b')){var _0x4f274f={};_0x4f274f[_0x39d88f[_0x5b0e('0x25')]]={'$like':'%'+_0x17a648['query'][_0x5b0e('0x3c')]+'%'};return _0x4f274f;}})});}_0x20cabc=_[_0x5b0e('0x3a')]({},_0x20cabc,_0x17a648[_0x5b0e('0x3d')]);var _0x2addf3={'where':_0x20cabc[_0x5b0e('0x38')]};return db[_0x5b0e('0x29')][_0x5b0e('0x1d')](_0x2addf3)[_0x5b0e('0x21')](function(_0x43122a){_0x54d2e4['count']=_0x43122a;if(_0x17a648[_0x5b0e('0x2e')][_0x5b0e('0x3e')]){_0x20cabc[_0x5b0e('0x3f')]=[{'all':!![]}];}return db[_0x5b0e('0x29')][_0x5b0e('0x40')](_0x20cabc);})['then'](function(_0x56f2be){_0x54d2e4[_0x5b0e('0x41')]=_0x56f2be;return _0x54d2e4;})[_0x5b0e('0x21')](respondWithFilteredResult(_0xeb84a8,_0x20cabc))[_0x5b0e('0x42')](handleError(_0xeb84a8,null));};exports[_0x5b0e('0x43')]=function(_0x494951,_0x17e4a7){var _0x333db7={'raw':!![],'where':{'id':_0x494951[_0x5b0e('0x44')]['id']}},_0x5c8836={};_0x5c8836[_0x5b0e('0x2d')]=_[_0x5b0e('0x2f')](db['ChatQueueReport'][_0x5b0e('0x2a')]);_0x5c8836[_0x5b0e('0x2e')]=_[_0x5b0e('0x2f')](_0x494951['query']);_0x5c8836[_0x5b0e('0x30')]=_[_0x5b0e('0x31')](_0x5c8836[_0x5b0e('0x2d')],_0x5c8836['query']);_0x333db7[_0x5b0e('0x32')]=_['intersection'](_0x5c8836[_0x5b0e('0x2d')],qs[_0x5b0e('0x33')](_0x494951[_0x5b0e('0x2e')][_0x5b0e('0x33')]));_0x333db7[_0x5b0e('0x32')]=_0x333db7['attributes']['length']?_0x333db7[_0x5b0e('0x32')]:_0x5c8836[_0x5b0e('0x2d')];if(_0x494951['query']['includeAll']){_0x333db7[_0x5b0e('0x3f')]=[{'all':!![]}];}_0x333db7=_[_0x5b0e('0x3a')]({},_0x333db7,_0x494951['options']);return db[_0x5b0e('0x29')][_0x5b0e('0x45')](_0x333db7)[_0x5b0e('0x21')](handleEntityNotFound(_0x17e4a7,null))['then'](respondWithResult(_0x17e4a7,null))[_0x5b0e('0x42')](handleError(_0x17e4a7,null));};exports['create']=function(_0xbe7994,_0x2dee5c){return db[_0x5b0e('0x29')][_0x5b0e('0x46')](_0xbe7994['body'],{})['then'](respondWithResult(_0x2dee5c,0xc9))[_0x5b0e('0x42')](handleError(_0x2dee5c,null));};exports['update']=function(_0xff8263,_0x560b1e){if(_0xff8263[_0x5b0e('0x47')]['id']){delete _0xff8263[_0x5b0e('0x47')]['id'];}return db[_0x5b0e('0x29')][_0x5b0e('0x45')]({'where':{'id':_0xff8263[_0x5b0e('0x44')]['id']}})[_0x5b0e('0x21')](handleEntityNotFound(_0x560b1e,null))[_0x5b0e('0x21')](saveUpdates(_0xff8263['body'],null))[_0x5b0e('0x21')](respondWithResult(_0x560b1e,null))[_0x5b0e('0x42')](handleError(_0x560b1e,null));};exports[_0x5b0e('0x22')]=function(_0x7b402,_0x19a91){return db[_0x5b0e('0x29')][_0x5b0e('0x45')]({'where':{'id':_0x7b402['params']['id']}})[_0x5b0e('0x21')](handleEntityNotFound(_0x19a91,null))[_0x5b0e('0x21')](removeEntity(_0x19a91,null))[_0x5b0e('0x42')](handleError(_0x19a91,null));};exports[_0x5b0e('0x48')]=function(_0x12529d,_0x9d1f7d){return db['ChatQueueReport']['describe']()[_0x5b0e('0x21')](respondWithResult(_0x9d1f7d,null))[_0x5b0e('0x42')](handleError(_0x9d1f7d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 574d4ba..c5308ed 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45cf25,_0x3586e0){var _0x51a766=function(_0x516664){while(--_0x516664){_0x45cf25['push'](_0x45cf25['shift']());}};_0x51a766(++_0x3586e0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x40b6b1,_0x598d7b){var _0x4dc921=function(_0x406ce2){while(--_0x406ce2){_0x40b6b1['push'](_0x40b6b1['shift']());}};_0x4dc921(++_0x598d7b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b922091..7ebb717 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 _0xb974=['../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xb974,0x123));var _0x4b97=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb974[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x4b97('0x0'));var util=require(_0x4b97('0x1'));var moment=require(_0x4b97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b97('0x3'))['db'];var utils=require(_0x4b97('0x4'));var logger=require(_0x4b97('0x5'))('rpc');var config=require(_0x4b97('0x6'));var jayson=require(_0x4b97('0x7'));var client=jayson[_0x4b97('0x8')][_0x4b97('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f26bb,_0x51fb65,_0x24b9e2){return new BPromise(function(_0x48bc10,_0xec4d1a){return client[_0x4b97('0xa')](_0x3f26bb,_0x24b9e2)[_0x4b97('0xb')](function(_0x677aa1){logger[_0x4b97('0xc')](_0x4b97('0xd'),_0x51fb65,'request\x20sent');logger[_0x4b97('0xe')](_0x4b97('0xf'),_0x51fb65,'request\x20sent',JSON['stringify'](_0x677aa1));if(_0x677aa1[_0x4b97('0x10')]){if(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x11')]===0x1f4){logger[_0x4b97('0x10')](_0x4b97('0xd'),_0x51fb65,_0x677aa1[_0x4b97('0x10')]['message']);return _0xec4d1a(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);}logger[_0x4b97('0x10')](_0x4b97('0xd'),_0x51fb65,_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);return _0x48bc10(_0x677aa1[_0x4b97('0x10')][_0x4b97('0x12')]);}else{logger[_0x4b97('0xc')](_0x4b97('0xd'),_0x51fb65,_0x4b97('0x13'));_0x48bc10(_0x677aa1[_0x4b97('0x14')][_0x4b97('0x12')]);}})['catch'](function(_0x32d51e){logger['error'](_0x4b97('0xd'),_0x51fb65,_0x32d51e);_0xec4d1a(_0x32d51e);});});}exports[_0x4b97('0x15')]=function(_0x5df007){var _0x55a0ac=this;return new Promise(function(_0x276794,_0x59debf){return db[_0x4b97('0x16')][_0x4b97('0x17')](_0x5df007[_0x4b97('0x18')],{'raw':_0x5df007[_0x4b97('0x19')]?_0x5df007[_0x4b97('0x19')][_0x4b97('0x1a')]===undefined?!![]:![]:!![]})[_0x4b97('0xb')](function(_0x4e0284){logger[_0x4b97('0xc')](_0x4b97('0x15'),_0x5df007);logger[_0x4b97('0xe')](_0x4b97('0x15'),_0x5df007,JSON[_0x4b97('0x1b')](_0x4e0284));_0x276794(_0x4e0284);})[_0x4b97('0x1c')](function(_0x52c351){logger[_0x4b97('0x10')](_0x4b97('0x15'),_0x52c351[_0x4b97('0x12')],_0x5df007);_0x59debf(_0x55a0ac[_0x4b97('0x10')](0x1f4,_0x52c351[_0x4b97('0x12')]));});});};exports[_0x4b97('0x1d')]=function(_0x19ca05){var _0x4ea25c=this;return new Promise(function(_0xd7849a,_0x576075){return db[_0x4b97('0x16')][_0x4b97('0x1e')](_0x19ca05[_0x4b97('0x18')],{'raw':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x1f')]||null:null,'attributes':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')][_0x4b97('0x20')]||null:null,'limit':_0x19ca05[_0x4b97('0x19')]?_0x19ca05[_0x4b97('0x19')]['limit']||null:null})['then'](function(_0x342fe8){logger[_0x4b97('0xc')](_0x4b97('0x1d'),_0x19ca05);logger['debug'](_0x4b97('0x1d'),_0x19ca05,JSON['stringify'](_0x342fe8));_0xd7849a(_0x342fe8);})[_0x4b97('0x1c')](function(_0x3a642f){logger[_0x4b97('0x10')](_0x4b97('0x1d'),_0x3a642f[_0x4b97('0x12')],_0x19ca05);_0x576075(_0x4ea25c[_0x4b97('0x10')](0x1f4,_0x3a642f[_0x4b97('0x12')]));});});};
\ No newline at end of file
+var _0xb2d8=['http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','ChatQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb2d8,0x188));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b2d('0x0'));var BPromise=require(_0x8b2d('0x1'));var rs=require(_0x8b2d('0x2'));var fs=require('fs');var Redis=require(_0x8b2d('0x3'));var db=require(_0x8b2d('0x4'))['db'];var utils=require(_0x8b2d('0x5'));var logger=require(_0x8b2d('0x6'))(_0x8b2d('0x7'));var config=require(_0x8b2d('0x8'));var jayson=require(_0x8b2d('0x9'));var client=jayson[_0x8b2d('0xa')][_0x8b2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1261fe,_0x50ac88,_0x3d32bd){return new BPromise(function(_0x4002fa,_0x199a96){return client[_0x8b2d('0xc')](_0x1261fe,_0x3d32bd)['then'](function(_0x17a370){logger[_0x8b2d('0xd')](_0x8b2d('0xe'),_0x50ac88,_0x8b2d('0xf'));logger[_0x8b2d('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x50ac88,_0x8b2d('0xf'),JSON[_0x8b2d('0x11')](_0x17a370));if(_0x17a370[_0x8b2d('0x12')]){if(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x13')]===0x1f4){logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);return _0x199a96(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);}logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);return _0x4002fa(_0x17a370[_0x8b2d('0x12')][_0x8b2d('0x14')]);}else{logger[_0x8b2d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x50ac88,_0x8b2d('0xf'));_0x4002fa(_0x17a370[_0x8b2d('0x15')][_0x8b2d('0x14')]);}})[_0x8b2d('0x16')](function(_0x77975c){logger[_0x8b2d('0x12')](_0x8b2d('0xe'),_0x50ac88,_0x77975c);_0x199a96(_0x77975c);});});}exports[_0x8b2d('0x17')]=function(_0x427b61){var _0x38ff25=this;return new Promise(function(_0x5cf1e2,_0x24b417){return db['ChatQueueReport'][_0x8b2d('0x18')](_0x427b61[_0x8b2d('0x19')],{'raw':_0x427b61[_0x8b2d('0x1a')]?_0x427b61['options'][_0x8b2d('0x1b')]===undefined?!![]:![]:!![]})[_0x8b2d('0x1c')](function(_0x19c76f){logger['info'](_0x8b2d('0x17'),_0x427b61);logger[_0x8b2d('0x10')](_0x8b2d('0x17'),_0x427b61,JSON[_0x8b2d('0x11')](_0x19c76f));_0x5cf1e2(_0x19c76f);})[_0x8b2d('0x16')](function(_0x8b6c0b){logger[_0x8b2d('0x12')](_0x8b2d('0x17'),_0x8b6c0b['message'],_0x427b61);_0x24b417(_0x38ff25[_0x8b2d('0x12')](0x1f4,_0x8b6c0b[_0x8b2d('0x14')]));});});};exports[_0x8b2d('0x1d')]=function(_0x19dd66){var _0x736175=this;return new Promise(function(_0x3db31d,_0x377e57){return db[_0x8b2d('0x1e')]['update'](_0x19dd66[_0x8b2d('0x19')],{'raw':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66[_0x8b2d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19dd66['options']?_0x19dd66[_0x8b2d('0x1a')]['where']||null:null,'attributes':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66['options']['attributes']||null:null,'limit':_0x19dd66[_0x8b2d('0x1a')]?_0x19dd66[_0x8b2d('0x1a')]['limit']||null:null})[_0x8b2d('0x1c')](function(_0x2372bf){logger[_0x8b2d('0xd')](_0x8b2d('0x1d'),_0x19dd66);logger[_0x8b2d('0x10')](_0x8b2d('0x1d'),_0x19dd66,JSON['stringify'](_0x2372bf));_0x3db31d(_0x2372bf);})['catch'](function(_0x4fde3c){logger[_0x8b2d('0x12')]('UpdateChatQueueReport',_0x4fde3c[_0x8b2d('0x14')],_0x19dd66);_0x377e57(_0x736175[_0x8b2d('0x12')](0x1f4,_0x4fde3c[_0x8b2d('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3f7c31e..2e2a8db 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 _0xcc9b=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0xcc9b,0x152));var _0xbcc9=function(_0x6d0012,_0x6ce00e){_0x6d0012=_0x6d0012-0x0;var _0x34286c=_0xcc9b[_0x6d0012];return _0x34286c;};'use strict';var multer=require(_0xbcc9('0x0'));var util=require(_0xbcc9('0x1'));var path=require(_0xbcc9('0x2'));var timeout=require(_0xbcc9('0x3'));var express=require(_0xbcc9('0x4'));var router=express[_0xbcc9('0x5')]();var fs_extra=require(_0xbcc9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbcc9('0x7'));var config=require('../../config/environment');var controller=require(_0xbcc9('0x8'));router['get']('/',auth[_0xbcc9('0x9')](),controller['index']);router[_0xbcc9('0xa')]('/describe',auth[_0xbcc9('0x9')](),controller[_0xbcc9('0xb')]);router[_0xbcc9('0xa')](_0xbcc9('0xc'),auth['isAuthenticated'](),controller[_0xbcc9('0xd')]);router['post']('/',auth[_0xbcc9('0x9')](),controller[_0xbcc9('0xe')]);router[_0xbcc9('0xf')](_0xbcc9('0xc'),auth[_0xbcc9('0x9')](),controller[_0xbcc9('0x10')]);router[_0xbcc9('0x11')](_0xbcc9('0xc'),auth[_0xbcc9('0x9')](),controller[_0xbcc9('0x12')]);module[_0xbcc9('0x13')]=router;
\ No newline at end of file
+var _0xd8bf=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy'];(function(_0x24f625,_0x132f17){var _0x40d9cb=function(_0x5b5d8a){while(--_0x5b5d8a){_0x24f625['push'](_0x24f625['shift']());}};_0x40d9cb(++_0x132f17);}(_0xd8bf,0x130));var _0xfd8b=function(_0x21f5b6,_0x3074d2){_0x21f5b6=_0x21f5b6-0x0;var _0x216a9c=_0xd8bf[_0x21f5b6];return _0x216a9c;};'use strict';var multer=require(_0xfd8b('0x0'));var util=require(_0xfd8b('0x1'));var path=require(_0xfd8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd8b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfd8b('0x4'));var interaction=require(_0xfd8b('0x5'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xfd8b('0x6')](),controller['index']);router[_0xfd8b('0x7')](_0xfd8b('0x8'),auth[_0xfd8b('0x6')](),controller[_0xfd8b('0x9')]);router[_0xfd8b('0x7')](_0xfd8b('0xa'),auth['isAuthenticated'](),controller[_0xfd8b('0xb')]);router[_0xfd8b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfd8b('0xd')]('/:id',auth[_0xfd8b('0x6')](),controller[_0xfd8b('0xe')]);router['delete'](_0xfd8b('0xa'),auth[_0xfd8b('0x6')](),controller[_0xfd8b('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 8d1a3c6..76a7072 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5846b6,_0x299729){var _0x5b4ba4=function(_0x50357f){while(--_0x50357f){_0x5846b6['push'](_0x5846b6['shift']());}};_0x5b4ba4(++_0x299729);}(_0x008c,0x188));var _0xc008=function(_0x3168e1,_0xa046e0){_0x3168e1=_0x3168e1-0x0;var _0x13ad69=_0x008c[_0x3168e1];return _0x13ad69;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x9f4205,_0x3fcdb4){var _0x4ae15b=function(_0x279a8f){while(--_0x279a8f){_0x9f4205['push'](_0x9f4205['shift']());}};_0x4ae15b(++_0x3fcdb4);}(_0x70e0,0x17b));var _0x070e=function(_0x2c5031,_0x66e416){_0x2c5031=_0x2c5031-0x0;var _0x3317d5=_0x70e0[_0x2c5031];return _0x3317d5;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index acf879d..6181bfe 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 _0xdafc=['send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','then','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdafc,0x71));var _0xcdaf=function(_0x381608,_0x8b3166){_0x381608=_0x381608-0x0;var _0xb273a5=_0xdafc[_0x381608];return _0xb273a5;};'use strict';var emlformat=require(_0xcdaf('0x0'));var rimraf=require(_0xcdaf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcdaf('0x2'));var rp=require(_0xcdaf('0x3'));var moment=require('moment');var BPromise=require(_0xcdaf('0x4'));var Mustache=require(_0xcdaf('0x5'));var util=require('util');var path=require(_0xcdaf('0x6'));var sox=require(_0xcdaf('0x7'));var csv=require(_0xcdaf('0x8'));var ejs=require(_0xcdaf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdaf('0xa'));var squel=require(_0xcdaf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcdaf('0xc'));var toCsv=require(_0xcdaf('0x8'));var querystring=require(_0xcdaf('0xd'));var Papa=require(_0xcdaf('0xe'));var Redis=require(_0xcdaf('0xf'));var authService=require(_0xcdaf('0x10'));var qs=require(_0xcdaf('0x11'));var as=require(_0xcdaf('0x12'));var hardwareService=require(_0xcdaf('0x13'));var logger=require(_0xcdaf('0x14'))(_0xcdaf('0x15'));var utils=require('../../config/utils');var config=require(_0xcdaf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdaf('0x17'))['db'];function respondWithStatusCode(_0x4121e7,_0x228f70){_0x228f70=_0x228f70||0xcc;return function(_0xd42ca1){if(_0xd42ca1){return _0x4121e7[_0xcdaf('0x18')](_0x228f70);}return _0x4121e7[_0xcdaf('0x19')](_0x228f70)[_0xcdaf('0x1a')]();};}function respondWithResult(_0x568de2,_0x31f445){_0x31f445=_0x31f445||0xc8;return function(_0x3eb602){if(_0x3eb602){return _0x568de2[_0xcdaf('0x19')](_0x31f445)[_0xcdaf('0x1b')](_0x3eb602);}};}function respondWithFilteredResult(_0x1e23ba,_0x196d43){return function(_0x1fd4a5){if(_0x1fd4a5){var _0x3ed249=typeof _0x196d43[_0xcdaf('0x1c')]===_0xcdaf('0x1d')&&typeof _0x196d43[_0xcdaf('0x1e')]===_0xcdaf('0x1d');var _0x50f6ff=_0x1fd4a5['count'];var _0x18b2b5=_0x3ed249?0x0:_0x196d43[_0xcdaf('0x1c')];var _0x18baed=_0x3ed249?_0x1fd4a5[_0xcdaf('0x1f')]:_0x196d43[_0xcdaf('0x1c')]+_0x196d43[_0xcdaf('0x1e')];var _0x42256e;if(_0x18baed>=_0x50f6ff){_0x18baed=_0x50f6ff;_0x42256e=0xc8;}else{_0x42256e=0xce;}_0x1e23ba['status'](_0x42256e);return _0x1e23ba[_0xcdaf('0x20')](_0xcdaf('0x21'),_0x18b2b5+'-'+_0x18baed+'/'+_0x50f6ff)[_0xcdaf('0x1b')](_0x1fd4a5);}return null;};}function patchUpdates(_0x48d870){return function(_0x18015b){try{jsonpatch[_0xcdaf('0x22')](_0x18015b,_0x48d870,!![]);}catch(_0x2fb1e1){return BPromise[_0xcdaf('0x23')](_0x2fb1e1);}return _0x18015b[_0xcdaf('0x24')]();};}function saveUpdates(_0x130d89,_0x271cf6){return function(_0x40423d){if(_0x40423d){return _0x40423d[_0xcdaf('0x25')](_0x130d89)['then'](function(_0x2682bc){return _0x2682bc;});}return null;};}function removeEntity(_0x20b0e6,_0x16795b){return function(_0x2500fb){if(_0x2500fb){return _0x2500fb[_0xcdaf('0x26')]()['then'](function(){_0x20b0e6[_0xcdaf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe32a45,_0x3dbeea){return function(_0x4549ee){if(!_0x4549ee){_0xe32a45[_0xcdaf('0x18')](0x194);}return _0x4549ee;};}function handleError(_0x2f7d52,_0x22ca5e){_0x22ca5e=_0x22ca5e||0x1f4;return function(_0x508a1d){logger['error'](_0x508a1d[_0xcdaf('0x27')]);if(_0x508a1d[_0xcdaf('0x28')]){delete _0x508a1d['name'];}_0x2f7d52[_0xcdaf('0x19')](_0x22ca5e)[_0xcdaf('0x29')](_0x508a1d);};}exports[_0xcdaf('0x2a')]=function(_0x44d1ee,_0x470c9c){var _0x7fb0b9={},_0x1b626f={},_0x5498ac={'count':0x0,'rows':[]};var _0xbd1627=_[_0xcdaf('0x2b')](db[_0xcdaf('0x2c')][_0xcdaf('0x2d')],function(_0x2ebcb1){return{'name':_0x2ebcb1[_0xcdaf('0x2e')],'type':_0x2ebcb1[_0xcdaf('0x2f')][_0xcdaf('0x30')]};});_0x1b626f[_0xcdaf('0x31')]=_['map'](_0xbd1627,_0xcdaf('0x28'));_0x1b626f[_0xcdaf('0x32')]=_[_0xcdaf('0x33')](_0x44d1ee[_0xcdaf('0x32')]);_0x1b626f[_0xcdaf('0x34')]=_['intersection'](_0x1b626f[_0xcdaf('0x31')],_0x1b626f[_0xcdaf('0x32')]);_0x7fb0b9[_0xcdaf('0x35')]=_[_0xcdaf('0x36')](_0x1b626f[_0xcdaf('0x31')],qs[_0xcdaf('0x37')](_0x44d1ee[_0xcdaf('0x32')][_0xcdaf('0x37')]));_0x7fb0b9[_0xcdaf('0x35')]=_0x7fb0b9[_0xcdaf('0x35')]['length']?_0x7fb0b9[_0xcdaf('0x35')]:_0x1b626f['model'];if(!_0x44d1ee[_0xcdaf('0x32')][_0xcdaf('0x38')](_0xcdaf('0x39'))){_0x7fb0b9['limit']=qs[_0xcdaf('0x1e')](_0x44d1ee[_0xcdaf('0x32')]['limit']);_0x7fb0b9[_0xcdaf('0x1c')]=qs[_0xcdaf('0x1c')](_0x44d1ee[_0xcdaf('0x32')]['offset']);}_0x7fb0b9[_0xcdaf('0x3a')]=qs[_0xcdaf('0x3b')](_0x44d1ee[_0xcdaf('0x32')]['sort']);_0x7fb0b9[_0xcdaf('0x3c')]=qs['filters'](_[_0xcdaf('0x3d')](_0x44d1ee['query'],_0x1b626f['filters']),_0xbd1627);if(_0x44d1ee['query']['filter']){_0x7fb0b9['where']=_[_0xcdaf('0x3e')](_0x7fb0b9[_0xcdaf('0x3c')],{'$or':_[_0xcdaf('0x2b')](_0xbd1627,function(_0x50bfc3){if(_0x50bfc3[_0xcdaf('0x2f')]!=='VIRTUAL'){var _0x3e2ca4={};_0x3e2ca4[_0x50bfc3[_0xcdaf('0x28')]]={'$like':'%'+_0x44d1ee['query']['filter']+'%'};return _0x3e2ca4;}})});}_0x7fb0b9=_[_0xcdaf('0x3e')]({},_0x7fb0b9,_0x44d1ee['options']);var _0x5836db={'where':_0x7fb0b9[_0xcdaf('0x3c')]};return db[_0xcdaf('0x2c')]['count'](_0x5836db)[_0xcdaf('0x3f')](function(_0x5d041e){_0x5498ac['count']=_0x5d041e;if(_0x44d1ee['query'][_0xcdaf('0x40')]){_0x7fb0b9[_0xcdaf('0x41')]=[{'all':!![]}];}return db[_0xcdaf('0x2c')][_0xcdaf('0x42')](_0x7fb0b9);})[_0xcdaf('0x3f')](function(_0x2015fd){_0x5498ac[_0xcdaf('0x43')]=_0x2015fd;return _0x5498ac;})[_0xcdaf('0x3f')](respondWithFilteredResult(_0x470c9c,_0x7fb0b9))[_0xcdaf('0x44')](handleError(_0x470c9c,null));};exports[_0xcdaf('0x45')]=function(_0x85018c,_0x3972ce){var _0x11108d={'raw':!![],'where':{'id':_0x85018c[_0xcdaf('0x46')]['id']}},_0x16e215={};_0x16e215['model']=_[_0xcdaf('0x33')](db['ChatTransferReport'][_0xcdaf('0x2d')]);_0x16e215[_0xcdaf('0x32')]=_['keys'](_0x85018c['query']);_0x16e215['filters']=_['intersection'](_0x16e215['model'],_0x16e215[_0xcdaf('0x32')]);_0x11108d['attributes']=_['intersection'](_0x16e215[_0xcdaf('0x31')],qs[_0xcdaf('0x37')](_0x85018c[_0xcdaf('0x32')][_0xcdaf('0x37')]));_0x11108d[_0xcdaf('0x35')]=_0x11108d[_0xcdaf('0x35')][_0xcdaf('0x47')]?_0x11108d[_0xcdaf('0x35')]:_0x16e215['model'];if(_0x85018c[_0xcdaf('0x32')][_0xcdaf('0x40')]){_0x11108d[_0xcdaf('0x41')]=[{'all':!![]}];}_0x11108d=_[_0xcdaf('0x3e')]({},_0x11108d,_0x85018c[_0xcdaf('0x48')]);return db[_0xcdaf('0x2c')][_0xcdaf('0x49')](_0x11108d)[_0xcdaf('0x3f')](handleEntityNotFound(_0x3972ce,null))[_0xcdaf('0x3f')](respondWithResult(_0x3972ce,null))['catch'](handleError(_0x3972ce,null));};exports[_0xcdaf('0x4a')]=function(_0x450bcd,_0x42f292){return db[_0xcdaf('0x2c')][_0xcdaf('0x4a')](_0x450bcd['body'],{})['then'](respondWithResult(_0x42f292,0xc9))[_0xcdaf('0x44')](handleError(_0x42f292,null));};exports[_0xcdaf('0x25')]=function(_0x3ed849,_0x305228){if(_0x3ed849[_0xcdaf('0x4b')]['id']){delete _0x3ed849[_0xcdaf('0x4b')]['id'];}return db[_0xcdaf('0x2c')][_0xcdaf('0x49')]({'where':{'id':_0x3ed849[_0xcdaf('0x46')]['id']}})[_0xcdaf('0x3f')](handleEntityNotFound(_0x305228,null))[_0xcdaf('0x3f')](saveUpdates(_0x3ed849[_0xcdaf('0x4b')],null))[_0xcdaf('0x3f')](respondWithResult(_0x305228,null))[_0xcdaf('0x44')](handleError(_0x305228,null));};exports['destroy']=function(_0x11d8b7,_0x50f744){return db[_0xcdaf('0x2c')][_0xcdaf('0x49')]({'where':{'id':_0x11d8b7['params']['id']}})['then'](handleEntityNotFound(_0x50f744,null))[_0xcdaf('0x3f')](removeEntity(_0x50f744,null))[_0xcdaf('0x44')](handleError(_0x50f744,null));};exports[_0xcdaf('0x4c')]=function(_0x1c401c,_0x24dff4){return db[_0xcdaf('0x2c')][_0xcdaf('0x4c')]()[_0xcdaf('0x3f')](respondWithResult(_0x24dff4,null))[_0xcdaf('0x44')](handleError(_0x24dff4,null));};
\ No newline at end of file
+var _0x524c=['find','create','body','destroy','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','error','name','send','ChatTransferReport','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','count','includeAll','findAll','catch','show','params','options'];(function(_0x4a2707,_0x56a7aa){var _0x2eb468=function(_0x5ef08d){while(--_0x5ef08d){_0x4a2707['push'](_0x4a2707['shift']());}};_0x2eb468(++_0x56a7aa);}(_0x524c,0xe0));var _0xc524=function(_0x484025,_0x470843){_0x484025=_0x484025-0x0;var _0x5d1768=_0x524c[_0x484025];return _0x5d1768;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc524('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc524('0x1'));var moment=require(_0xc524('0x2'));var BPromise=require(_0xc524('0x3'));var Mustache=require(_0xc524('0x4'));var util=require(_0xc524('0x5'));var path=require(_0xc524('0x6'));var sox=require(_0xc524('0x7'));var csv=require(_0xc524('0x8'));var ejs=require(_0xc524('0x9'));var fs=require('fs');var fs_extra=require(_0xc524('0xa'));var _=require(_0xc524('0xb'));var squel=require(_0xc524('0xc'));var crypto=require(_0xc524('0xd'));var jsforce=require(_0xc524('0xe'));var deskjs=require(_0xc524('0xf'));var toCsv=require(_0xc524('0x8'));var querystring=require(_0xc524('0x10'));var Papa=require('papaparse');var Redis=require(_0xc524('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc524('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc524('0x13'));var logger=require(_0xc524('0x14'))('api');var utils=require(_0xc524('0x15'));var config=require(_0xc524('0x16'));var licenseUtil=require(_0xc524('0x17'));var db=require(_0xc524('0x18'))['db'];function respondWithStatusCode(_0x1914ad,_0x597ce6){_0x597ce6=_0x597ce6||0xcc;return function(_0x229713){if(_0x229713){return _0x1914ad['sendStatus'](_0x597ce6);}return _0x1914ad['status'](_0x597ce6)[_0xc524('0x19')]();};}function respondWithResult(_0x1c5c06,_0x4d58b5){_0x4d58b5=_0x4d58b5||0xc8;return function(_0x2148ce){if(_0x2148ce){return _0x1c5c06[_0xc524('0x1a')](_0x4d58b5)[_0xc524('0x1b')](_0x2148ce);}};}function respondWithFilteredResult(_0x3aa097,_0x507155){return function(_0x255faf){if(_0x255faf){var _0x229250=typeof _0x507155[_0xc524('0x1c')]===_0xc524('0x1d')&&typeof _0x507155[_0xc524('0x1e')]===_0xc524('0x1d');var _0x3884bd=_0x255faf['count'];var _0x5a7094=_0x229250?0x0:_0x507155[_0xc524('0x1c')];var _0x4d464f=_0x229250?_0x255faf['count']:_0x507155[_0xc524('0x1c')]+_0x507155[_0xc524('0x1e')];var _0x217400;if(_0x4d464f>=_0x3884bd){_0x4d464f=_0x3884bd;_0x217400=0xc8;}else{_0x217400=0xce;}_0x3aa097[_0xc524('0x1a')](_0x217400);return _0x3aa097['set'](_0xc524('0x1f'),_0x5a7094+'-'+_0x4d464f+'/'+_0x3884bd)['json'](_0x255faf);}return null;};}function patchUpdates(_0xaacff9){return function(_0x37d620){try{jsonpatch[_0xc524('0x20')](_0x37d620,_0xaacff9,!![]);}catch(_0x265319){return BPromise['reject'](_0x265319);}return _0x37d620[_0xc524('0x21')]();};}function saveUpdates(_0x34b25c,_0x3540c8){return function(_0x1ad93c){if(_0x1ad93c){return _0x1ad93c[_0xc524('0x22')](_0x34b25c)[_0xc524('0x23')](function(_0xde3e27){return _0xde3e27;});}return null;};}function removeEntity(_0x3cfb56,_0x34aa09){return function(_0x4a275f){if(_0x4a275f){return _0x4a275f['destroy']()[_0xc524('0x23')](function(){_0x3cfb56[_0xc524('0x1a')](0xcc)[_0xc524('0x19')]();});}};}function handleEntityNotFound(_0x18f344,_0x5b6784){return function(_0xb6034b){if(!_0xb6034b){_0x18f344['sendStatus'](0x194);}return _0xb6034b;};}function handleError(_0x498376,_0x3bfcdf){_0x3bfcdf=_0x3bfcdf||0x1f4;return function(_0x2e4093){logger[_0xc524('0x24')](_0x2e4093['stack']);if(_0x2e4093[_0xc524('0x25')]){delete _0x2e4093[_0xc524('0x25')];}_0x498376[_0xc524('0x1a')](_0x3bfcdf)[_0xc524('0x26')](_0x2e4093);};}exports['index']=function(_0x4af084,_0x3c8149){var _0x254e88={},_0x110ece={},_0x43e675={'count':0x0,'rows':[]};var _0x4c4499=_['map'](db[_0xc524('0x27')][_0xc524('0x28')],function(_0x35abae){return{'name':_0x35abae[_0xc524('0x29')],'type':_0x35abae['type']['key']};});_0x110ece[_0xc524('0x2a')]=_[_0xc524('0x2b')](_0x4c4499,_0xc524('0x25'));_0x110ece['query']=_[_0xc524('0x2c')](_0x4af084[_0xc524('0x2d')]);_0x110ece[_0xc524('0x2e')]=_['intersection'](_0x110ece[_0xc524('0x2a')],_0x110ece['query']);_0x254e88[_0xc524('0x2f')]=_[_0xc524('0x30')](_0x110ece[_0xc524('0x2a')],qs[_0xc524('0x31')](_0x4af084[_0xc524('0x2d')][_0xc524('0x31')]));_0x254e88[_0xc524('0x2f')]=_0x254e88[_0xc524('0x2f')][_0xc524('0x32')]?_0x254e88[_0xc524('0x2f')]:_0x110ece[_0xc524('0x2a')];if(!_0x4af084[_0xc524('0x2d')][_0xc524('0x33')](_0xc524('0x34'))){_0x254e88[_0xc524('0x1e')]=qs['limit'](_0x4af084['query'][_0xc524('0x1e')]);_0x254e88[_0xc524('0x1c')]=qs[_0xc524('0x1c')](_0x4af084[_0xc524('0x2d')][_0xc524('0x1c')]);}_0x254e88[_0xc524('0x35')]=qs['sort'](_0x4af084[_0xc524('0x2d')][_0xc524('0x36')]);_0x254e88['where']=qs[_0xc524('0x2e')](_[_0xc524('0x37')](_0x4af084[_0xc524('0x2d')],_0x110ece['filters']),_0x4c4499);if(_0x4af084['query'][_0xc524('0x38')]){_0x254e88['where']=_[_0xc524('0x39')](_0x254e88[_0xc524('0x3a')],{'$or':_[_0xc524('0x2b')](_0x4c4499,function(_0x11a52a){if(_0x11a52a[_0xc524('0x3b')]!==_0xc524('0x3c')){var _0x1db9c7={};_0x1db9c7[_0x11a52a[_0xc524('0x25')]]={'$like':'%'+_0x4af084['query'][_0xc524('0x38')]+'%'};return _0x1db9c7;}})});}_0x254e88=_[_0xc524('0x39')]({},_0x254e88,_0x4af084['options']);var _0x4a2815={'where':_0x254e88[_0xc524('0x3a')]};return db[_0xc524('0x27')]['count'](_0x4a2815)[_0xc524('0x23')](function(_0x32c2a2){_0x43e675[_0xc524('0x3d')]=_0x32c2a2;if(_0x4af084['query'][_0xc524('0x3e')]){_0x254e88['include']=[{'all':!![]}];}return db[_0xc524('0x27')][_0xc524('0x3f')](_0x254e88);})[_0xc524('0x23')](function(_0x5686fc){_0x43e675['rows']=_0x5686fc;return _0x43e675;})['then'](respondWithFilteredResult(_0x3c8149,_0x254e88))[_0xc524('0x40')](handleError(_0x3c8149,null));};exports[_0xc524('0x41')]=function(_0x4e201a,_0x68caed){var _0x235d76={'raw':!![],'where':{'id':_0x4e201a[_0xc524('0x42')]['id']}},_0x316f5c={};_0x316f5c['model']=_[_0xc524('0x2c')](db[_0xc524('0x27')][_0xc524('0x28')]);_0x316f5c['query']=_[_0xc524('0x2c')](_0x4e201a[_0xc524('0x2d')]);_0x316f5c[_0xc524('0x2e')]=_[_0xc524('0x30')](_0x316f5c[_0xc524('0x2a')],_0x316f5c['query']);_0x235d76[_0xc524('0x2f')]=_[_0xc524('0x30')](_0x316f5c[_0xc524('0x2a')],qs[_0xc524('0x31')](_0x4e201a[_0xc524('0x2d')][_0xc524('0x31')]));_0x235d76['attributes']=_0x235d76[_0xc524('0x2f')]['length']?_0x235d76[_0xc524('0x2f')]:_0x316f5c[_0xc524('0x2a')];if(_0x4e201a[_0xc524('0x2d')][_0xc524('0x3e')]){_0x235d76['include']=[{'all':!![]}];}_0x235d76=_['merge']({},_0x235d76,_0x4e201a[_0xc524('0x43')]);return db[_0xc524('0x27')][_0xc524('0x44')](_0x235d76)[_0xc524('0x23')](handleEntityNotFound(_0x68caed,null))[_0xc524('0x23')](respondWithResult(_0x68caed,null))['catch'](handleError(_0x68caed,null));};exports[_0xc524('0x45')]=function(_0x12b8bd,_0x478fbe){return db[_0xc524('0x27')][_0xc524('0x45')](_0x12b8bd[_0xc524('0x46')],{})[_0xc524('0x23')](respondWithResult(_0x478fbe,0xc9))[_0xc524('0x40')](handleError(_0x478fbe,null));};exports[_0xc524('0x22')]=function(_0x3656b6,_0x59298c){if(_0x3656b6['body']['id']){delete _0x3656b6[_0xc524('0x46')]['id'];}return db[_0xc524('0x27')][_0xc524('0x44')]({'where':{'id':_0x3656b6['params']['id']}})[_0xc524('0x23')](handleEntityNotFound(_0x59298c,null))['then'](saveUpdates(_0x3656b6['body'],null))[_0xc524('0x23')](respondWithResult(_0x59298c,null))['catch'](handleError(_0x59298c,null));};exports[_0xc524('0x47')]=function(_0x1df8d2,_0x408198){return db[_0xc524('0x27')][_0xc524('0x44')]({'where':{'id':_0x1df8d2[_0xc524('0x42')]['id']}})['then'](handleEntityNotFound(_0x408198,null))[_0xc524('0x23')](removeEntity(_0x408198,null))[_0xc524('0x40')](handleError(_0x408198,null));};exports[_0xc524('0x48')]=function(_0x394151,_0x24847f){return db[_0xc524('0x27')][_0xc524('0x48')]()['then'](respondWithResult(_0x24847f,null))[_0xc524('0x40')](handleError(_0x24847f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2110520..d0c2541 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 _0x33cd=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash','util','api','bluebird','path','rimraf'];(function(_0x58f6c0,_0x210594){var _0x2431a0=function(_0x159c8b){while(--_0x159c8b){_0x58f6c0['push'](_0x58f6c0['shift']());}};_0x2431a0(++_0x210594);}(_0x33cd,0x1a7));var _0xd33c=function(_0x1f4719,_0x58a021){_0x1f4719=_0x1f4719-0x0;var _0x320527=_0x33cd[_0x1f4719];return _0x320527;};'use strict';var _=require(_0xd33c('0x0'));var util=require(_0xd33c('0x1'));var logger=require('../../config/logger')(_0xd33c('0x2'));var moment=require('moment');var BPromise=require(_0xd33c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd33c('0x4'));var rimraf=require(_0xd33c('0x5'));var config=require(_0xd33c('0x6'));var attributes=require(_0xd33c('0x7'));module[_0xd33c('0x8')]=function(_0x21cf67,_0x48f5dc){return _0x21cf67['define'](_0xd33c('0x9'),attributes,{'tableName':_0xd33c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x45a9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x45a9,0x192));var _0x945a=function(_0x3a0856,_0x508d57){_0x3a0856=_0x3a0856-0x0;var _0x18cf7e=_0x45a9[_0x3a0856];return _0x18cf7e;};'use strict';var _=require(_0x945a('0x0'));var util=require('util');var logger=require(_0x945a('0x1'))(_0x945a('0x2'));var moment=require(_0x945a('0x3'));var BPromise=require(_0x945a('0x4'));var rp=require(_0x945a('0x5'));var fs=require('fs');var path=require(_0x945a('0x6'));var rimraf=require(_0x945a('0x7'));var config=require(_0x945a('0x8'));var attributes=require(_0x945a('0x9'));module[_0x945a('0xa')]=function(_0x58a71d,_0x12ebad){return _0x58a71d[_0x945a('0xb')](_0x945a('0xc'),attributes,{'tableName':_0x945a('0xd'),'paranoid':![],'indexes':[{'name':_0x945a('0xe'),'fields':[_0x945a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 59804ec..8213666 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 _0x442a=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x442a,0xaf));var _0xa442=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x442a[_0x28d18d];return _0x470640;};'use strict';var _=require('lodash');var util=require(_0xa442('0x0'));var moment=require(_0xa442('0x1'));var BPromise=require('bluebird');var rs=require(_0xa442('0x2'));var fs=require('fs');var Redis=require(_0xa442('0x3'));var db=require(_0xa442('0x4'))['db'];var utils=require(_0xa442('0x5'));var logger=require('../../config/logger')(_0xa442('0x6'));var config=require(_0xa442('0x7'));var jayson=require(_0xa442('0x8'));var client=jayson['client'][_0xa442('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af5b3,_0x16ff3d,_0x1e4e79){return new BPromise(function(_0xdec22e,_0x1f6af0){return client[_0xa442('0xa')](_0x2af5b3,_0x1e4e79)['then'](function(_0x37f50c){logger[_0xa442('0xb')](_0xa442('0xc'),_0x16ff3d,_0xa442('0xd'));logger['debug'](_0xa442('0xe'),_0x16ff3d,_0xa442('0xd'),JSON['stringify'](_0x37f50c));if(_0x37f50c[_0xa442('0xf')]){if(_0x37f50c[_0xa442('0xf')][_0xa442('0x10')]===0x1f4){logger[_0xa442('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x16ff3d,_0x37f50c[_0xa442('0xf')][_0xa442('0x11')]);return _0x1f6af0(_0x37f50c[_0xa442('0xf')][_0xa442('0x11')]);}logger[_0xa442('0xf')](_0xa442('0xc'),_0x16ff3d,_0x37f50c[_0xa442('0xf')]['message']);return _0xdec22e(_0x37f50c[_0xa442('0xf')]['message']);}else{logger[_0xa442('0xb')](_0xa442('0xc'),_0x16ff3d,_0xa442('0xd'));_0xdec22e(_0x37f50c[_0xa442('0x12')][_0xa442('0x11')]);}})[_0xa442('0x13')](function(_0x487380){logger['error'](_0xa442('0xc'),_0x16ff3d,_0x487380);_0x1f6af0(_0x487380);});});}
\ No newline at end of file
+var _0xa03d=['result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info'];(function(_0x5742d6,_0x41b7db){var _0x536b75=function(_0x2b3161){while(--_0x2b3161){_0x5742d6['push'](_0x5742d6['shift']());}};_0x536b75(++_0x41b7db);}(_0xa03d,0xa2));var _0xda03=function(_0x477889,_0x1d514d){_0x477889=_0x477889-0x0;var _0x460d7a=_0xa03d[_0x477889];return _0x460d7a;};'use strict';var _=require(_0xda03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda03('0x1'));var fs=require('fs');var Redis=require(_0xda03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xda03('0x3'));var logger=require(_0xda03('0x4'))('rpc');var config=require(_0xda03('0x5'));var jayson=require(_0xda03('0x6'));var client=jayson[_0xda03('0x7')][_0xda03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4079f3,_0x466b62,_0x16634d){return new BPromise(function(_0x4d1b62,_0x2b23b8){return client['request'](_0x4079f3,_0x16634d)[_0xda03('0x9')](function(_0x506c7b){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x466b62,_0xda03('0xa'));logger['debug'](_0xda03('0xb'),_0x466b62,_0xda03('0xa'),JSON[_0xda03('0xc')](_0x506c7b));if(_0x506c7b[_0xda03('0xd')]){if(_0x506c7b[_0xda03('0xd')][_0xda03('0xe')]===0x1f4){logger[_0xda03('0xd')](_0xda03('0xf'),_0x466b62,_0x506c7b['error'][_0xda03('0x10')]);return _0x2b23b8(_0x506c7b['error'][_0xda03('0x10')]);}logger[_0xda03('0xd')](_0xda03('0xf'),_0x466b62,_0x506c7b['error'][_0xda03('0x10')]);return _0x4d1b62(_0x506c7b[_0xda03('0xd')][_0xda03('0x10')]);}else{logger[_0xda03('0x11')](_0xda03('0xf'),_0x466b62,_0xda03('0xa'));_0x4d1b62(_0x506c7b[_0xda03('0x12')]['message']);}})[_0xda03('0x13')](function(_0x617730){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x466b62,_0x617730);_0x2b23b8(_0x617730);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index be09645..1350255 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 _0xb609=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x4d0a8e,_0x338a7b){var _0x55d9ee=function(_0xa9b558){while(--_0xa9b558){_0x4d0a8e['push'](_0x4d0a8e['shift']());}};_0x55d9ee(++_0x338a7b);}(_0xb609,0xd5));var _0x9b60=function(_0x1cc0b5,_0x384d5f){_0x1cc0b5=_0x1cc0b5-0x0;var _0x45b6f3=_0xb609[_0x1cc0b5];return _0x45b6f3;};'use strict';var multer=require(_0x9b60('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b60('0x1'));var router=express[_0x9b60('0x2')]();var fs_extra=require(_0x9b60('0x3'));var auth=require(_0x9b60('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9b60('0x5'));var controller=require(_0x9b60('0x6'));router[_0x9b60('0x7')]('/',auth[_0x9b60('0x8')](),controller[_0x9b60('0x9')]);router[_0x9b60('0x7')](_0x9b60('0xa'),auth[_0x9b60('0x8')](),controller['describe']);router['get'](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0xc')]);router[_0x9b60('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b60('0xe')]);router[_0x9b60('0xf')](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0x10')]);router[_0x9b60('0x11')](_0x9b60('0xb'),auth[_0x9b60('0x8')](),controller[_0x9b60('0x12')]);module[_0x9b60('0x13')]=router;
\ No newline at end of file
+var _0x3318=['put','update','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3318,0xb7));var _0x8331=function(_0x194b5c,_0x3e4893){_0x194b5c=_0x194b5c-0x0;var _0x2badf6=_0x3318[_0x194b5c];return _0x2badf6;};'use strict';var multer=require('multer');var util=require(_0x8331('0x0'));var path=require(_0x8331('0x1'));var timeout=require('connect-timeout');var express=require(_0x8331('0x2'));var router=express[_0x8331('0x3')]();var fs_extra=require(_0x8331('0x4'));var auth=require(_0x8331('0x5'));var interaction=require(_0x8331('0x6'));var config=require(_0x8331('0x7'));var controller=require(_0x8331('0x8'));router[_0x8331('0x9')]('/',auth[_0x8331('0xa')](),controller[_0x8331('0xb')]);router[_0x8331('0x9')]('/describe',auth[_0x8331('0xa')](),controller['describe']);router['get'](_0x8331('0xc'),auth[_0x8331('0xa')](),controller['show']);router[_0x8331('0xd')]('/',auth[_0x8331('0xa')](),controller[_0x8331('0xe')]);router[_0x8331('0xf')](_0x8331('0xc'),auth[_0x8331('0xa')](),controller[_0x8331('0x10')]);router[_0x8331('0x11')](_0x8331('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 32afbed..26ba327 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 _0x2891=['Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2891,0x159));var _0x1289=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2891[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x1289('0x0'));var rs=require(_0x1289('0x1'));module['exports']={'name':{'type':Sequelize[_0x1289('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1289('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x4')},'mapKeyOffline':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x1289('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x5')},'customerAlias':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1289('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1289('0x2')]},'animation':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1289('0xa')](_0x1289('0xb'),_0x1289('0xc')),'defaultValue':_0x1289('0xb')},'header_online':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0xe')},'header_offline':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xf')},'download_transcript':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1289('0x11')]},'closingQuestion':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x14')},'noteTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x16')},'closingMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0xe')},'skipMessageButton':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x17')},'conditionAgreement':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x18')},'ratingType':{'type':Sequelize[_0x1289('0xa')](_0x1289('0x19'),_0x1289('0x1a')),'defaultValue':_0x1289('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return JSON[_0x1289('0x1b')]({'items':[{'type':_0x1289('0x1c'),'variable':null,'config':{'placeholder':_0x1289('0x1d'),'type':_0x1289('0x1e'),'required':!![]},'props':{'title':_0x1289('0x1d'),'helpText':''}},{'type':_0x1289('0x1c'),'props':{'title':_0x1289('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1289('0x4'),'type':_0x1289('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1289('0x1f')](_0x1289('0x20'))?JSON[_0x1289('0x21')](this['getDataValue'](_0x1289('0x20'))):{};},'set':function(_0x24ae7b){return this[_0x1289('0x22')](_0x1289('0x20'),JSON[_0x1289('0x1b')](_0x24ae7b));}},'offlineForm':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return JSON[_0x1289('0x1b')]({'items':[{'type':_0x1289('0x1c'),'props':{'title':_0x1289('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x1289('0x4'),'type':'email'},'variable':null},{'type':_0x1289('0x23'),'config':{'placeholder':_0x1289('0x24')},'props':{'title':_0x1289('0x24'),'helpText':_0x1289('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x1289('0x1f')](_0x1289('0x26'))?JSON[_0x1289('0x21')](this['getDataValue'](_0x1289('0x26'))):{};},'set':function(_0x3268e2){return this[_0x1289('0x22')]('offlineForm',JSON[_0x1289('0x1b')](_0x3268e2));}},'token':{'type':Sequelize[_0x1289('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1289('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1289('0x2')]},'waitingTitle':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1289('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1289('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1289('0x11')],'defaultValue':function(){return _0x1289('0x2a');}},'notificationSound':{'type':Sequelize[_0x1289('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1289('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2b')},'verticalAlignment':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2c')},'messagesAlignment':{'type':Sequelize[_0x1289('0x2')],'defaultValue':_0x1289('0x2d')},'defaultTitle':{'type':Sequelize[_0x1289('0x2')]},'customerAvatar':{'type':Sequelize[_0x1289('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1289('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1289('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1289('0x2f')},'systemAvatar':{'type':Sequelize[_0x1289('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1289('0x8')],'comment':_0x1289('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![],'comment':_0x1289('0x31'),'set':function(_0x3deeea){if(!_0x3deeea)this[_0x1289('0x22')]('mandatoryDispositionPauseId',null);this[_0x1289('0x22')](_0x1289('0x32'),_0x3deeea);}},'vidaooEscalation':{'type':Sequelize[_0x1289('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1289('0x2')]},'vidaooTopic':{'type':Sequelize[_0x1289('0x2')],'allowNull':![],'defaultValue':_0x1289('0x33')},'vidaooNote':{'type':Sequelize[_0x1289('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xc4eb=['Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','rounded','squared','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note'];(function(_0xe91fe7,_0x5682c8){var _0x5674db=function(_0x254b1b){while(--_0x254b1b){_0xe91fe7['push'](_0xe91fe7['shift']());}};_0x5674db(++_0x5682c8);}(_0xc4eb,0x1f4));var _0xbc4e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc4eb[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xbc4e('0x0'));var rs=require(_0xbc4e('0x1'));module[_0xbc4e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'unique':_0xbc4e('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x5')},'key':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbc4e('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xbc4e('0x9'),_0xbc4e('0xa')),'defaultValue':_0xbc4e('0x9')},'header_online':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xb')},'offline_chat_button':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0xd')},'download_transcript':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbc4e('0xf')]},'closingQuestion':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x13')},'placeholderMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'skipMessageButton':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x14')},'conditionAgreement':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x15')},'ratingType':{'type':Sequelize[_0xbc4e('0x16')](_0xbc4e('0x17'),_0xbc4e('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':function(){return JSON[_0xbc4e('0x19')]({'items':[{'type':_0xbc4e('0x1a'),'variable':null,'config':{'placeholder':_0xbc4e('0x1b'),'type':'text','required':!![]},'props':{'title':_0xbc4e('0x1b'),'helpText':''}},{'type':_0xbc4e('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbc4e('0x5'),'type':_0xbc4e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbc4e('0x1c')](_0xbc4e('0x1d'))?JSON[_0xbc4e('0x1e')](this[_0xbc4e('0x1c')](_0xbc4e('0x1d'))):{};},'set':function(_0x117b32){return this[_0xbc4e('0x1f')]('onlineForm',JSON['stringify'](_0x117b32));}},'offlineForm':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':function(){return JSON[_0xbc4e('0x19')]({'items':[{'type':'input','props':{'title':_0xbc4e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xbc4e('0x5'),'type':_0xbc4e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xbc4e('0x20')},'props':{'title':'Comments','helpText':_0xbc4e('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xbc4e('0x22'))?JSON[_0xbc4e('0x1e')](this[_0xbc4e('0x1c')](_0xbc4e('0x22'))):{};},'set':function(_0x55839b){return this['setDataValue']('offlineForm',JSON[_0xbc4e('0x19')](_0x55839b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbc4e('0x23')]();}},'autoclose':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbc4e('0x3')]},'forwardOffline':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbc4e('0x3')]},'waitingTitle':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x24')},'waitingMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x26')},'offlineMessageBody':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x28')},'skipUnmanaged':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbc4e('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbc4e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbc4e('0x29');}},'notificationSound':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2b')},'verticalAlignment':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':_0xbc4e('0x2d')},'defaultTitle':{'type':Sequelize[_0xbc4e('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbc4e('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc4e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbc4e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbc4e('0x8')],'comment':_0xbc4e('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![],'comment':_0xbc4e('0x30'),'set':function(_0xc0a351){if(!_0xc0a351)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xbc4e('0x1f')](_0xbc4e('0x31'),_0xc0a351);}},'vidaooEscalation':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbc4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbc4e('0x3')],'allowNull':![],'defaultValue':_0xbc4e('0x32')},'vidaooNote':{'type':Sequelize[_0xbc4e('0x3')],'defaultValue':function(){return _0xbc4e('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xbc4e('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbc4e('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbc4e('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ad2bdf4..be2df28 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 _0xff12=['server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','mapKey','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','bulkCreate','Smtp','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','color','tag','getSnippet','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','Intervals','all','some','remote','connection','replace','alignment','verticalAlignment','labelText','color_button','backgroundColor','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','get','ChatWebsites','UserProfileResource','destroy','then','end','name','send','index','Pause','map','ChatWebsite','rawAttributes','type','query','attributes','model','fields','length','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','show','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xff12,0xa8));var _0x2ff1=function(_0x3316d0,_0x357e55){_0x3316d0=_0x3316d0-0x0;var _0x252405=_0xff12[_0x3316d0];return _0x252405;};'use strict';var BPromise=require(_0x2ff1('0x0'));var Mustache=require(_0x2ff1('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ff1('0x2'));var _=require(_0x2ff1('0x3'));var querystring=require(_0x2ff1('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2ff1('0x5'))(_0x2ff1('0x6'));var config=require('../../config/environment');var db=require(_0x2ff1('0x7'))['db'];config['redis']=_[_0x2ff1('0x8')](config['redis'],{'host':_0x2ff1('0x9'),'port':0x18eb});var socket=require(_0x2ff1('0xa'))(new Redis(config[_0x2ff1('0xb')]));require('./chatWebsite.socket')[_0x2ff1('0xc')](socket);var jayson=require(_0x2ff1('0xd'));var client=jayson[_0x2ff1('0xe')][_0x2ff1('0xf')]({'port':0x232c});var client9002=jayson['client'][_0x2ff1('0xf')]({'port':0x232a});var client9003=jayson[_0x2ff1('0xe')][_0x2ff1('0xf')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x47d960,_0x4ea7ec,_0x522d49,_0x4fce4c){return new BPromise(function(_0x2a8c73,_0x47bee4){var _0x12129d=_0x4fce4c||client;return _0x12129d[_0x2ff1('0x10')](_0x47d960,_0x522d49)['then'](function(_0x599b6e){logger[_0x2ff1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ea7ec,'request\x20sent');logger[_0x2ff1('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ea7ec,_0x2ff1('0x13'),JSON['stringify'](_0x599b6e));if(_0x599b6e[_0x2ff1('0x14')]){if(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x15')]===0x1f4){logger[_0x2ff1('0x14')](_0x2ff1('0x16'),_0x4ea7ec,_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);return _0x47bee4(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);}logger['error'](_0x2ff1('0x16'),_0x4ea7ec,_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);return _0x2a8c73(_0x599b6e[_0x2ff1('0x14')][_0x2ff1('0x17')]);}else{logger[_0x2ff1('0x11')](_0x2ff1('0x16'),_0x4ea7ec,_0x2ff1('0x13'));_0x2a8c73(_0x599b6e[_0x2ff1('0x18')][_0x2ff1('0x17')]);}})[_0x2ff1('0x19')](function(_0x3dd42d){logger[_0x2ff1('0x14')](_0x2ff1('0x16'),_0x4ea7ec,_0x3dd42d);_0x47bee4(_0x3dd42d);});});}function respondWithStatusCode(_0x393e76,_0x16b875){_0x16b875=_0x16b875||0xcc;return function(_0x10cf11){if(_0x10cf11){return _0x393e76['sendStatus'](_0x16b875);}return _0x393e76[_0x2ff1('0x1a')](_0x16b875)['end']();};}function respondWithResult(_0x5eaad1,_0x2d2390){_0x2d2390=_0x2d2390||0xc8;return function(_0x29a5e9){if(_0x29a5e9){return _0x5eaad1[_0x2ff1('0x1a')](_0x2d2390)['json'](_0x29a5e9);}};}function respondWithFilteredResult(_0x56bcdc,_0x1961c9){return function(_0x1f588d){if(_0x1f588d){var _0x31e1e7=typeof _0x1961c9[_0x2ff1('0x1b')]==='undefined'&&typeof _0x1961c9[_0x2ff1('0x1c')]===_0x2ff1('0x1d');var _0x183956=_0x1f588d[_0x2ff1('0x1e')];var _0x397e59=_0x31e1e7?0x0:_0x1961c9[_0x2ff1('0x1b')];var _0x3b39c0=_0x31e1e7?_0x1f588d[_0x2ff1('0x1e')]:_0x1961c9['offset']+_0x1961c9[_0x2ff1('0x1c')];var _0x3b7c97;if(_0x3b39c0>=_0x183956){_0x3b39c0=_0x183956;_0x3b7c97=0xc8;}else{_0x3b7c97=0xce;}_0x56bcdc[_0x2ff1('0x1a')](_0x3b7c97);return _0x56bcdc[_0x2ff1('0x1f')](_0x2ff1('0x20'),_0x397e59+'-'+_0x3b39c0+'/'+_0x183956)[_0x2ff1('0x21')](_0x1f588d);}return null;};}function saveUpdates(_0x1da355){return function(_0x37ec33){if(_0x37ec33){return _0x37ec33[_0x2ff1('0x22')](_0x1da355)['then'](function(_0x3aa2b8){return _0x3aa2b8;});}return null;};}function removeEntity(_0x23cb85){return function(_0x408ad0){if(_0x408ad0){return _0x408ad0['destroy']()['then'](function(){var _0xe3cffb=_0x408ad0[_0x2ff1('0x23')]({'plain':!![]});var _0x14c5f1=_0x2ff1('0x24');return db[_0x2ff1('0x25')][_0x2ff1('0x26')]({'where':{'type':_0x14c5f1,'resourceId':_0xe3cffb['id']}})[_0x2ff1('0x27')](function(){return _0x408ad0;});})[_0x2ff1('0x27')](function(){_0x23cb85[_0x2ff1('0x1a')](0xcc)[_0x2ff1('0x28')]();});}};}function handleEntityNotFound(_0x364a25){return function(_0x50315f){if(!_0x50315f){_0x364a25['sendStatus'](0x194);}return _0x50315f;};}function handleError(_0x4b5400,_0x55999b){_0x55999b=_0x55999b||0x1f4;return function(_0x471e25){logger[_0x2ff1('0x14')](_0x471e25['stack']);if(_0x471e25[_0x2ff1('0x29')]){delete _0x471e25['name'];}_0x4b5400['status'](_0x55999b)[_0x2ff1('0x2a')](_0x471e25);};}exports[_0x2ff1('0x2b')]=function(_0x360cfb,_0x35f45a){var _0x393ee5={'include':[{'model':db[_0x2ff1('0x2c')],'as':'mandatoryDispositionPause'}]},_0x55e0bf={},_0x44f5e3={'count':0x0,'rows':[]};var _0x1378d7=_[_0x2ff1('0x2d')](db[_0x2ff1('0x2e')][_0x2ff1('0x2f')],function(_0x1f6df6){return{'name':_0x1f6df6['fieldName'],'type':_0x1f6df6[_0x2ff1('0x30')]['key']};});_0x55e0bf['model']=_['map'](_0x1378d7,_0x2ff1('0x29'));_0x55e0bf[_0x2ff1('0x31')]=_['keys'](_0x360cfb['query']);_0x55e0bf['filters']=_['intersection'](_0x55e0bf['model'],_0x55e0bf[_0x2ff1('0x31')]);_0x393ee5[_0x2ff1('0x32')]=_['intersection'](_0x55e0bf[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x393ee5['attributes']=_0x393ee5[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x393ee5[_0x2ff1('0x32')]:_0x55e0bf[_0x2ff1('0x33')];if(!_0x360cfb[_0x2ff1('0x31')]['hasOwnProperty']('nolimit')){_0x393ee5[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x393ee5[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x393ee5['order']=qs[_0x2ff1('0x36')](_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x393ee5['where']=qs['filters'](_[_0x2ff1('0x37')](_0x360cfb[_0x2ff1('0x31')],_0x55e0bf[_0x2ff1('0x38')]),_0x1378d7);if(_0x360cfb['query'][_0x2ff1('0x39')]){_0x393ee5[_0x2ff1('0x3a')]=_['merge'](_0x393ee5[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x1378d7,function(_0xfb1776){if(_0xfb1776[_0x2ff1('0x30')]!=='VIRTUAL'){var _0xcc97={};_0xcc97[_0xfb1776[_0x2ff1('0x29')]]={'$like':'%'+_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0xcc97;}})});}_0x393ee5=_[_0x2ff1('0x3b')]({},_0x393ee5,_0x360cfb[_0x2ff1('0x3c')]);var _0x4c3e6c={'where':_0x393ee5[_0x2ff1('0x3a')]};return db[_0x2ff1('0x2e')]['count'](_0x4c3e6c)[_0x2ff1('0x27')](function(_0x447bac){_0x44f5e3[_0x2ff1('0x1e')]=_0x447bac;if(_0x360cfb[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x393ee5[_0x2ff1('0x3e')]=[{'all':!![]}];}return db[_0x2ff1('0x2e')][_0x2ff1('0x3f')](_0x393ee5);})['then'](function(_0x1cccbc){_0x44f5e3['rows']=_0x1cccbc;return _0x44f5e3;})[_0x2ff1('0x27')](respondWithFilteredResult(_0x35f45a,_0x393ee5))[_0x2ff1('0x19')](handleError(_0x35f45a,null));};exports[_0x2ff1('0x40')]=function(_0x28604,_0x45d3fe){var _0x4f4412={'raw':![],'where':{'id':_0x28604['params']['id']},'include':[{'model':db[_0x2ff1('0x2c')],'as':'mandatoryDispositionPause'}]},_0x10dffc={};_0x10dffc[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db['ChatWebsite']['rawAttributes']);_0x10dffc[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x28604['query']);_0x10dffc[_0x2ff1('0x38')]=_['intersection'](_0x10dffc[_0x2ff1('0x33')],_0x10dffc[_0x2ff1('0x31')]);_0x4f4412[_0x2ff1('0x32')]=_[_0x2ff1('0x42')](_0x10dffc['model'],qs[_0x2ff1('0x34')](_0x28604[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x4f4412[_0x2ff1('0x32')]=_0x4f4412[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x4f4412[_0x2ff1('0x32')]:_0x10dffc[_0x2ff1('0x33')];if(_0x28604[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x4f4412[_0x2ff1('0x3e')]=[{'all':!![]}];}_0x4f4412=_[_0x2ff1('0x3b')]({},_0x4f4412,_0x28604[_0x2ff1('0x3c')]);return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x4f4412)[_0x2ff1('0x27')](handleEntityNotFound(_0x45d3fe,null))[_0x2ff1('0x27')](respondWithResult(_0x45d3fe,null))[_0x2ff1('0x19')](handleError(_0x45d3fe,null));};exports[_0x2ff1('0x44')]=function(_0x139ee9,_0x28491b){return db['ChatWebsite'][_0x2ff1('0x44')](_0x139ee9['body'],{})['then'](function(_0x12a512){var _0x316e4c=_0x139ee9[_0x2ff1('0x45')]['get']({'plain':!![]});if(!_0x316e4c)throw new Error(_0x2ff1('0x46'));if(_0x316e4c[_0x2ff1('0x47')]===_0x2ff1('0x45')){var _0x8d757c=_0x12a512[_0x2ff1('0x23')]({'plain':!![]});var _0x256f9d='ChatWebsites';return db[_0x2ff1('0x48')]['find']({'where':{'name':_0x256f9d,'userProfileId':_0x316e4c['userProfileId']},'raw':!![]})[_0x2ff1('0x27')](function(_0x37356d){if(_0x37356d&&_0x37356d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x8d757c[_0x2ff1('0x29')],'resourceId':_0x8d757c['id'],'type':_0x37356d[_0x2ff1('0x29')],'sectionId':_0x37356d['id']},{})[_0x2ff1('0x27')](function(){return _0x12a512;});}else{return _0x12a512;}})[_0x2ff1('0x19')](function(_0x4c2364){logger[_0x2ff1('0x14')](_0x2ff1('0x49'),_0x4c2364);throw _0x4c2364;});}return _0x12a512;})[_0x2ff1('0x27')](respondWithResult(_0x28491b,0xc9))[_0x2ff1('0x19')](handleError(_0x28491b,null));};exports[_0x2ff1('0x22')]=function(_0x484c69,_0x430e3a){if(_0x484c69[_0x2ff1('0x4a')]['id']){delete _0x484c69[_0x2ff1('0x4a')]['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x484c69[_0x2ff1('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x2ff1('0x4c')}]})[_0x2ff1('0x27')](handleEntityNotFound(_0x430e3a,null))[_0x2ff1('0x27')](saveUpdates(_0x484c69[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x430e3a,null))[_0x2ff1('0x19')](handleError(_0x430e3a,null));};exports['destroy']=function(_0x52c7a5,_0x4bc0d5){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0x52c7a5[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x4bc0d5,null))[_0x2ff1('0x27')](removeEntity(_0x4bc0d5,null))['catch'](handleError(_0x4bc0d5,null));};exports['describe']=function(_0x10970d,_0xc8bdde){return db[_0x2ff1('0x2e')][_0x2ff1('0x4d')]()[_0x2ff1('0x27')](respondWithResult(_0xc8bdde,null))['catch'](handleError(_0xc8bdde,null));};exports[_0x2ff1('0x4e')]=function(_0x2ecf54,_0x30cf30){if(_0x2ecf54['body']['id']){delete _0x2ecf54['body']['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x2ecf54[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x30cf30,null))[_0x2ff1('0x27')](function(_0x227462){if(_0x227462){_0x2ecf54[_0x2ff1('0x4a')]['ChatWebsiteId']=_0x227462['id'];return db[_0x2ff1('0x4f')][_0x2ff1('0x44')](_0x2ecf54[_0x2ff1('0x4a')]);}})[_0x2ff1('0x27')](respondWithResult(_0x30cf30,null))['catch'](handleError(_0x30cf30,null));};exports[_0x2ff1('0x50')]=function(_0x397a54,_0x2552b8){var _0x1acdc1={'raw':![],'where':{}};var _0x49ddd9={};var _0x54c701={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0x397a54[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2552b8,null))[_0x2ff1('0x27')](function(_0x200e27){if(_0x200e27){_0x49ddd9[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x4f')][_0x2ff1('0x2f')]);_0x49ddd9[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x397a54[_0x2ff1('0x31')]);_0x49ddd9[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x49ddd9[_0x2ff1('0x33')],_0x49ddd9[_0x2ff1('0x31')]);_0x1acdc1['attributes']=_[_0x2ff1('0x42')](_0x49ddd9[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x1acdc1[_0x2ff1('0x32')]=_0x1acdc1['attributes'][_0x2ff1('0x35')]?_0x1acdc1['attributes']:_0x49ddd9[_0x2ff1('0x33')];if(!_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x1acdc1[_0x2ff1('0x1c')]=qs['limit'](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x1acdc1[_0x2ff1('0x1b')]=qs['offset'](_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x1acdc1[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x397a54[_0x2ff1('0x31')]['sort']);_0x1acdc1[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x397a54[_0x2ff1('0x31')],_0x49ddd9[_0x2ff1('0x38')]));_0x1acdc1[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x200e27['id'];if(_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x39')]){_0x1acdc1[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x1acdc1['where'],{'$or':_[_0x2ff1('0x2d')](_0x1acdc1[_0x2ff1('0x32')],function(_0x37802e){var _0x11f346={};_0x11f346[_0x37802e]={'$like':'%'+_0x397a54['query'][_0x2ff1('0x39')]+'%'};return _0x11f346;})});}_0x1acdc1=_[_0x2ff1('0x3b')]({},_0x1acdc1,_0x397a54[_0x2ff1('0x3c')]);return db[_0x2ff1('0x4f')]['count']({'where':_0x1acdc1['where']})[_0x2ff1('0x27')](function(_0x2cba05){_0x54c701[_0x2ff1('0x1e')]=_0x2cba05;if(_0x397a54[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x1acdc1[_0x2ff1('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x2ff1('0x3f')](_0x1acdc1);})[_0x2ff1('0x27')](function(_0x2662f6){_0x54c701[_0x2ff1('0x56')]=_0x2662f6;return _0x54c701;});}})[_0x2ff1('0x27')](respondWithFilteredResult(_0x2552b8,_0x1acdc1))[_0x2ff1('0x19')](handleError(_0x2552b8,null));};exports[_0x2ff1('0x57')]=function(_0xc64060,_0xafe319){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0xc64060[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0xafe319,null))['then'](function(_0x54a89f){if(_0x54a89f){return _0x54a89f[_0x2ff1('0x57')](_0xc64060['query'][_0x2ff1('0x58')]);}})[_0x2ff1('0x27')](respondWithStatusCode(_0xafe319,null))[_0x2ff1('0x19')](handleError(_0xafe319,null));};exports[_0x2ff1('0x59')]=function(_0x239fb3,_0x85a3c3){if(_0x239fb3['body']['id']){delete _0x239fb3[_0x2ff1('0x4a')]['id'];}return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x239fb3[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x85a3c3,null))[_0x2ff1('0x27')](function(_0x1312df){if(_0x1312df){_0x239fb3[_0x2ff1('0x4a')][_0x2ff1('0x55')]=_0x1312df['id'];return db['CannedAnswer']['create'](_0x239fb3[_0x2ff1('0x4a')]);}})[_0x2ff1('0x27')](respondWithResult(_0x85a3c3,null))['catch'](handleError(_0x85a3c3,null));};exports[_0x2ff1('0x5a')]=function(_0xbe8188,_0x41396a){var _0x3dd5eb={'raw':![],'where':{}};var _0x37ca3a={};var _0x47133a={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0xbe8188[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41396a,null))['then'](function(_0x385c11){if(_0x385c11){_0x37ca3a[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x5b')][_0x2ff1('0x2f')]);_0x37ca3a[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0xbe8188[_0x2ff1('0x31')]);_0x37ca3a[_0x2ff1('0x38')]=_['intersection'](_0x37ca3a['model'],_0x37ca3a[_0x2ff1('0x31')]);_0x3dd5eb[_0x2ff1('0x32')]=_['intersection'](_0x37ca3a[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x3dd5eb[_0x2ff1('0x32')]=_0x3dd5eb['attributes'][_0x2ff1('0x35')]?_0x3dd5eb['attributes']:_0x37ca3a['model'];if(!_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x3dd5eb[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0xbe8188['query'][_0x2ff1('0x1c')]);_0x3dd5eb['offset']=qs[_0x2ff1('0x1b')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}_0x3dd5eb[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x3dd5eb['where']=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0xbe8188[_0x2ff1('0x31')],_0x37ca3a[_0x2ff1('0x38')]));_0x3dd5eb[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x385c11['id'];if(_0xbe8188['query'][_0x2ff1('0x39')]){_0x3dd5eb[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x3dd5eb[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x3dd5eb[_0x2ff1('0x32')],function(_0x34c0af){var _0x5ee22d={};_0x5ee22d[_0x34c0af]={'$like':'%'+_0xbe8188['query'][_0x2ff1('0x39')]+'%'};return _0x5ee22d;})});}_0x3dd5eb=_['merge']({},_0x3dd5eb,_0xbe8188[_0x2ff1('0x3c')]);return db[_0x2ff1('0x5b')][_0x2ff1('0x1e')]({'where':_0x3dd5eb['where']})[_0x2ff1('0x27')](function(_0x1b653c){_0x47133a['count']=_0x1b653c;if(_0xbe8188[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x3dd5eb[_0x2ff1('0x3e')]=[{'all':!![]}];}return db[_0x2ff1('0x5b')][_0x2ff1('0x3f')](_0x3dd5eb);})[_0x2ff1('0x27')](function(_0x24647e){_0x47133a[_0x2ff1('0x56')]=_0x24647e;return _0x47133a;});}})['then'](respondWithFilteredResult(_0x41396a,_0x3dd5eb))[_0x2ff1('0x19')](handleError(_0x41396a,null));};exports[_0x2ff1('0x5c')]=function(_0x4e62ec,_0x42f9bc){return db[_0x2ff1('0x2e')]['find']({'where':{'id':_0x4e62ec[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x42f9bc,null))['then'](function(_0x3bdbbc){if(_0x3bdbbc){return _0x3bdbbc['removeAnswers'](_0x4e62ec['query'][_0x2ff1('0x58')]);}})[_0x2ff1('0x27')](respondWithStatusCode(_0x42f9bc,null))['catch'](handleError(_0x42f9bc,null));};exports[_0x2ff1('0x5d')]=function(_0x31e1f0,_0x4596d5){_0x31e1f0[_0x2ff1('0x4a')]['sitepic']=_0x31e1f0['file'][_0x2ff1('0x5e')];return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x31e1f0[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4596d5,null))[_0x2ff1('0x27')](saveUpdates(_0x31e1f0[_0x2ff1('0x4a')],null))['then'](respondWithResult(_0x4596d5,null))['catch'](handleError(_0x4596d5,null));};exports[_0x2ff1('0x5f')]=function(_0x5e2bcf,_0x1dc8ec){_0x5e2bcf['body'][_0x2ff1('0x60')]=_0x5e2bcf[_0x2ff1('0x61')][_0x2ff1('0x5e')];return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x5e2bcf[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x1dc8ec,null))[_0x2ff1('0x27')](saveUpdates(_0x5e2bcf[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x1dc8ec,null))[_0x2ff1('0x19')](handleError(_0x1dc8ec,null));};exports[_0x2ff1('0x62')]=function(_0x2e0d80,_0x508232){_0x2e0d80[_0x2ff1('0x4a')][_0x2ff1('0x63')]=_0x2e0d80[_0x2ff1('0x61')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2e0d80[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x508232,null))[_0x2ff1('0x27')](saveUpdates(_0x2e0d80['body'],null))[_0x2ff1('0x27')](respondWithResult(_0x508232,null))[_0x2ff1('0x19')](handleError(_0x508232,null));};exports['addSystemAvatar']=function(_0x211ec7,_0x27192f){_0x211ec7['body'][_0x2ff1('0x64')]=_0x211ec7['file'][_0x2ff1('0x5e')];return db['ChatWebsite']['find']({'where':{'id':_0x211ec7[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x27192f,null))['then'](saveUpdates(_0x211ec7[_0x2ff1('0x4a')],null))[_0x2ff1('0x27')](respondWithResult(_0x27192f,null))[_0x2ff1('0x19')](handleError(_0x27192f,null));};exports[_0x2ff1('0x65')]=function(_0x1f1094,_0x97bfc8){var _0xb20b6c=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x68'));var _0x483851={'where':{'id':_0x1f1094[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x69')],'raw':!![]};var _0x261e5e=![];return require(_0x2ff1('0x6a'))[_0x2ff1('0x6b')]()[_0x2ff1('0x27')](function(_0x5d8325){if(_0x5d8325){_0x261e5e=_0x5d8325[_0x2ff1('0x6c')];}})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0x2e')]['find'](_0x483851);})['then'](handleEntityNotFound(_0x97bfc8,null))[_0x2ff1('0x27')](function(_0x3a0b0a){if(_0x3a0b0a){if(!_[_0x2ff1('0x6d')](_0x3a0b0a['sitepic'])){if(fs['existsSync'](path[_0x2ff1('0x66')](config['root'],_0x2ff1('0x6e'),_0x3a0b0a[_0x2ff1('0x69')]))&&_0x261e5e){_0xb20b6c=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x6e'),_0x3a0b0a[_0x2ff1('0x69')]);}}return _0x97bfc8['download'](_0xb20b6c);}})[_0x2ff1('0x19')](handleError(_0x97bfc8,null));};exports[_0x2ff1('0x6f')]=function(_0x1ca9b1,_0x1f6ccd){var _0x43866d=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x70'));var _0x1ab94f={'where':{'id':_0x1ca9b1[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x60')],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x1ab94f)[_0x2ff1('0x27')](handleEntityNotFound(_0x1f6ccd,null))[_0x2ff1('0x27')](function(_0x4366ec){if(_0x4366ec){if(!_[_0x2ff1('0x6d')](_0x4366ec['agentAvatar'])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x4366ec['agentAvatar']))){_0x43866d=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x4366ec[_0x2ff1('0x60')]);}}return _0x1f6ccd[_0x2ff1('0x73')](_0x43866d);}})[_0x2ff1('0x19')](handleError(_0x1f6ccd,null));};exports['getCustomerAvatar']=function(_0x294c25,_0x33e5ba){var _0x322fbd=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x74'));var _0x1c5016={'where':{'id':_0x294c25[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x63'),'showCustomerAvatar'],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x1c5016)[_0x2ff1('0x27')](handleEntityNotFound(_0x33e5ba,null))[_0x2ff1('0x27')](function(_0x2f8a05){if(_0x2f8a05){if(!_[_0x2ff1('0x6d')](_0x2f8a05[_0x2ff1('0x63')])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x2f8a05[_0x2ff1('0x63')]))&&_0x2f8a05['showCustomerAvatar']){_0x322fbd=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x2f8a05[_0x2ff1('0x63')]);}}return _0x33e5ba[_0x2ff1('0x73')](_0x322fbd);}})[_0x2ff1('0x19')](handleError(_0x33e5ba,null));};exports['getSystemAvatar']=function(_0x370946,_0xc0f4f9){var _0x145199=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x75'));var _0x2ee3db={'where':{'id':_0x370946[_0x2ff1('0x4b')]['id']},'attributes':['id',_0x2ff1('0x64')],'raw':!![]};return db[_0x2ff1('0x2e')][_0x2ff1('0x43')](_0x2ee3db)[_0x2ff1('0x27')](handleEntityNotFound(_0xc0f4f9,null))['then'](function(_0x552ac6){if(_0x552ac6){if(!_[_0x2ff1('0x6d')](_0x552ac6['systemAvatar'])){if(fs[_0x2ff1('0x71')](path[_0x2ff1('0x66')](config['root'],_0x2ff1('0x72'),_0x552ac6['systemAvatar']))){_0x145199=path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],_0x2ff1('0x72'),_0x552ac6[_0x2ff1('0x64')]);}}return _0xc0f4f9[_0x2ff1('0x73')](_0x145199);}})[_0x2ff1('0x19')](handleError(_0xc0f4f9,null));};exports[_0x2ff1('0x76')]=function(_0x7968e7,_0x2241b8){var _0x289f27=require(_0x2ff1('0x77'));var _0x601964=new _0x289f27();var _0x4846e2=_0x601964[_0x2ff1('0x78')](_0x7968e7[_0x2ff1('0x79')]['user-agent'])[_0x2ff1('0x7a')]();var _0x3f948f={'body':_0x7968e7[_0x2ff1('0x4a')],'channel':_0x2ff1('0x7b')};var _0x4b3d91=[];var _0x1dc61d=[];var _0x278e4a={};var _0x2d2067=![];return db[_0x2ff1('0x7c')][_0x2ff1('0x4d')]()['then'](function(_0x32ea2e){if(!_0x32ea2e){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))](_0x2ff1('0x7f'));}_0x4b3d91=_[_0x2ff1('0x80')](_[_0x2ff1('0x41')](_0x32ea2e),[_0x2ff1('0x81'),_0x2ff1('0x82')]);_0x1dc61d=_[_0x2ff1('0x80')](_['keys'](_0x32ea2e),[_0x2ff1('0x81'),'updatedAt',_0x2ff1('0x83'),_0x2ff1('0x84')]);if(_0x7968e7['body']['id']){delete _0x7968e7[_0x2ff1('0x4a')]['id'];}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')])){throw new db[(_0x2ff1('0x7d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')]['body'])||_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x4a')]===''){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2ff1('0x6d')](_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x86')])){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dc61d);}if(!_[_0x2ff1('0x87')](_0x1dc61d,_0x7968e7[_0x2ff1('0x4a')]['mapKey'])){throw new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dc61d);}_0x278e4a[_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x86')]]=_0x7968e7[_0x2ff1('0x4a')]['from'];})[_0x2ff1('0x27')](function(){return db['ChatWebsite'][_0x2ff1('0x43')]({'where':{'id':_0x7968e7[_0x2ff1('0x4b')]['id']},'include':[{'model':db[_0x2ff1('0x88')],'as':_0x2ff1('0x89'),'include':[{'model':db[_0x2ff1('0x7c')],'as':_0x2ff1('0x8a'),'where':_0x278e4a,'limit':0x1,'order':[[_0x2ff1('0x82'),_0x2ff1('0x8b')]]}]},{'model':db[_0x2ff1('0x8c')],'as':_0x2ff1('0x8d')}]});})[_0x2ff1('0x27')](handleEntityNotFound(_0x2241b8,null))[_0x2ff1('0x27')](function(_0xdc181e){if(_0xdc181e&&_0xdc181e[_0x2ff1('0x89')]){_0x3f948f[_0x2ff1('0x8e')]=_0xdc181e;_0x3f948f[_0x2ff1('0x8f')]=_0xdc181e[_0x2ff1('0x8d')];_0x3f948f[_0x2ff1('0x90')]=_0xdc181e['List'];_0x3f948f[_0x2ff1('0x8f')]=_['orderBy'](_0x3f948f[_0x2ff1('0x8f')],[_0x2ff1('0x91')],['asc']);if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x8d')]){delete _0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x8d')];}if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')]&&_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')][_0x2ff1('0x8a')][_0x2ff1('0x35')]){return _0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0x89')][_0x2ff1('0x8a')][0x0];}var _0x1ff4e8=_['defaults'](_0x7968e7[_0x2ff1('0x4a')],{'firstName':_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')],'ListId':_0xdc181e['ListId']});_0x1ff4e8[_0x7968e7['body'][_0x2ff1('0x86')]]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x85')];return db[_0x2ff1('0x7c')]['create'](_0x1ff4e8,{'fields':_0x4b3d91,'raw':!![]});}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2241b8,null))[_0x2ff1('0x27')](function(_0x2c9a00){_0x3f948f[_0x2ff1('0x92')]=_0x2c9a00;var _0x312d65=_0x7968e7['body'][_0x2ff1('0x93')];if(_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x94')]){_0x312d65=_0x7968e7[_0x2ff1('0x79')]['cf-connecting-ip'];}else if(_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x95')]){_0x312d65=_[_0x2ff1('0x96')](_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x95')][_0x2ff1('0x97')](','));}if(_0x2c9a00){var _0x4dcc46={'ContactId':_0x2c9a00['id'],'ChatWebsiteId':_0x7968e7[_0x2ff1('0x4b')]['id'],'from':(_0x2c9a00[_0x2ff1('0x98')]||'')+'\x20'+(_0x2c9a00[_0x2ff1('0x99')]||''),'customerIp':_0x312d65,'customerPort':_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x9a')]?_0x7968e7[_0x2ff1('0x79')][_0x2ff1('0x9a')]:null,'referer':_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0x9b')],'browserName':_0x4846e2['browser'][_0x2ff1('0x29')]&&_0x4846e2['browser'][_0x2ff1('0x9c')]?util['format'](_0x2ff1('0x9d'),_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x29')],_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x9c')]):'unknown','browserVersion':_0x4846e2[_0x2ff1('0x9e')][_0x2ff1('0x9c')]||_0x2ff1('0x9f'),'osName':util[_0x2ff1('0xa0')](_0x2ff1('0x9d'),_0x4846e2['os'][_0x2ff1('0x29')],_0x4846e2['os'][_0x2ff1('0x9c')]),'osVersion':_0x4846e2['os'][_0x2ff1('0x9c')],'deviceModel':_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0x33')]&&_0x4846e2['device'][_0x2ff1('0xa2')]?util[_0x2ff1('0xa0')](_0x2ff1('0xa3'),_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0x33')],_0x4846e2[_0x2ff1('0xa1')][_0x2ff1('0xa2')],_0x4846e2['device'][_0x2ff1('0x30')]):null,'deviceVendor':_0x4846e2['device'][_0x2ff1('0xa2')],'deviceType':_0x4846e2[_0x2ff1('0xa1')]['type'],'formData':JSON[_0x2ff1('0xa4')](_0x7968e7[_0x2ff1('0x4a')])};var _0x5396e9={'ChatWebsiteId':_0x7968e7['params']['id'],'closed':![]};if(_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')]){_0x5396e9[_0x2ff1('0xa5')]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')];return db['ChatInteraction'][_0x2ff1('0x43')]({'where':_0x5396e9})[_0x2ff1('0x27')](function(_0xee8850){if(_0xee8850){return[_0xee8850,![]];}_0x4dcc46['threadId']=_0x7968e7['body']['threadId'];_0x4dcc46['externalUrl']=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa6')];return db[_0x2ff1('0xa7')][_0x2ff1('0x44')](_0x4dcc46)[_0x2ff1('0x27')](function(_0xca340f){return[_0xca340f,!![]];});});}_0x5396e9['ContactId']=_0x2c9a00['id'];if(_0x7968e7[_0x2ff1('0x4a')]['interaction']&&_0x7968e7['body']['interaction']['id']){_0x5396e9['id']=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa8')]['id'];return db[_0x2ff1('0xa7')][_0x2ff1('0x43')]({'where':_0x5396e9})[_0x2ff1('0x27')](function(_0x24079b){if(_0x24079b){return[_0x24079b,![]];}return db['ChatInteraction'][_0x2ff1('0x44')](_0x4dcc46)[_0x2ff1('0x27')](function(_0x1f53da){return[_0x1f53da,!![]];});});}return db[_0x2ff1('0xa7')][_0x2ff1('0x44')](_0x4dcc46)['then'](function(_0x5a77e1){return[_0x5a77e1,!![]];});}})[_0x2ff1('0xa9')](function(_0x4b4fd6,_0x2c035a){if(_0x4b4fd6){_0x2d2067=_0x2c035a;if(!_0x2c035a){var _0x3a7521={'from':(_0x3f948f[_0x2ff1('0x92')][_0x2ff1('0x98')]||'')+'\x20'+(_0x3f948f[_0x2ff1('0x92')][_0x2ff1('0x99')]||'')};if(_0x7968e7[_0x2ff1('0x4a')]['threadId']&&_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')]&&_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xa5')]!=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')]){_0x3a7521[_0x2ff1('0xa5')]=_0x7968e7[_0x2ff1('0x4a')][_0x2ff1('0xaa')];}return _0x4b4fd6['update'](_0x3a7521);}else{return _0x4b4fd6;}}})[_0x2ff1('0x27')](function(_0x1d59b7){_0x3f948f[_0x2ff1('0xa8')]=_0x1d59b7[_0x2ff1('0x23')]({'plain':!![]});_0x3f948f['interaction'][_0x2ff1('0xab')]=_0x2d2067;if(_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xab')]){if(_0x3f948f[_0x2ff1('0x8e')][_0x2ff1('0xac')]){_0x3f948f[_0x2ff1('0x8f')][_0x2ff1('0xad')]({'id':0x0,'priority':_0x3f948f[_0x2ff1('0x8f')][_0x2ff1('0x35')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x2ff1('0xae')});}}return db[_0x2ff1('0xaf')][_0x2ff1('0x44')]({'body':_0x7968e7[_0x2ff1('0x4a')]['body'],'ChatWebsiteId':_0x7968e7[_0x2ff1('0x4b')]['id'],'ChatInteractionId':_0x1d59b7['id'],'direction':'in','ContactId':_0x3f948f[_0x2ff1('0x92')]['id'],'AttachmentId':_0x7968e7[_0x2ff1('0x4a')]['AttachmentId']});})['then'](function(_0x5cd7c5){_0x3f948f[_0x2ff1('0x17')]=_0x5cd7c5;if(_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xb0')]){return db[_0x2ff1('0xb1')]['find']({'attributes':['id',_0x2ff1('0x29')],'where':{'id':_0x3f948f[_0x2ff1('0xa8')][_0x2ff1('0xb0')]}})[_0x2ff1('0x27')](function(_0x29fa3f){if(_0x29fa3f){_0x3f948f['applications'][_0x2ff1('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x29fa3f[_0x2ff1('0x29')]+','+(_0x3f948f['account'][_0x2ff1('0xb3')]||0xa),'interval':'*,*,*,*'});_0x3f948f[_0x2ff1('0xb4')]=!![];}return respondWithRpcPromise(_0x2ff1('0xb5'),_0x2ff1('0xb6'),_0x3f948f);});}return respondWithRpcPromise(_0x2ff1('0xb5'),_0x2ff1('0xb6'),_0x3f948f);})[_0x2ff1('0x27')](function(_0x52aed6){respondWithRpcPromise(_0x2ff1('0xb7'),_0x2ff1('0xb7'),{'event':_0x2ff1('0x76'),'message':_0x52aed6},client9002);return _0x52aed6;})['then'](respondWithResult(_0x2241b8,null))[_0x2ff1('0x19')](handleError(_0x2241b8,null));};exports[_0x2ff1('0xb8')]=function(_0x3c62c0,_0x5b6518){var _0x3817eb,_0x5a9f24,_0x384e4c;var _0x298d1f=[];var _0x4b9a1a={};var _0x4fdfbd=_0x3c62c0[_0x2ff1('0xb9')]||[];var _0x3e3d2a=[];var _0x2db80e;return db['CmContact'][_0x2ff1('0x4d')]()['then'](function(_0x5241e8){if(!_0x5241e8){throw new db['Sequelize'][(_0x2ff1('0x7e'))]('no\x20available\x20attributes');}_0x298d1f=_[_0x2ff1('0x80')](_[_0x2ff1('0x41')](_0x5241e8),[_0x2ff1('0x81'),_0x2ff1('0x82'),_0x2ff1('0x83'),'ListId']);if(_0x3c62c0[_0x2ff1('0x4a')]['id']){delete _0x3c62c0[_0x2ff1('0x4a')]['id'];}if(_['isNil'](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')])){throw _0x5b6518['status'](0x1f4)[_0x2ff1('0x2a')](new db[(_0x2ff1('0x7d'))]['ValidationError'](_0x2ff1('0xba')));}if(_[_0x2ff1('0x6d')](_0x3c62c0['body'][_0x2ff1('0x4a')])||_0x3c62c0['body']['body']===''){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)[_0x2ff1('0x2a')](new db[(_0x2ff1('0x7d'))][(_0x2ff1('0x7e'))](_0x2ff1('0xbb')));}if(_['isNil'](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0xbc')])){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)['send'](new db['Sequelize'][(_0x2ff1('0x7e'))](_0x2ff1('0xbd')+_0x298d1f));}if(!_[_0x2ff1('0x87')](_0x298d1f,_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0xbc')])){throw _0x5b6518[_0x2ff1('0x1a')](0x1f4)['send'](new db[(_0x2ff1('0x7d'))]['ValidationError'](_0x2ff1('0xbe')+_0x298d1f));}_0x4b9a1a[_0x3c62c0['body'][_0x2ff1('0xbc')]]=_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')];})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x3c62c0[_0x2ff1('0x4b')]['id']},'include':[{'model':db[_0x2ff1('0x88')],'as':_0x2ff1('0x89')},{'model':db[_0x2ff1('0xbf')],'as':_0x2ff1('0xbf')}]});})['then'](handleEntityNotFound(_0x5b6518,null))[_0x2ff1('0x27')](function(_0xe89be0){if(_0xe89be0&&_0xe89be0[_0x2ff1('0x89')]){_0x5a9f24=_0xe89be0;var _0x5a8ba8=_[_0x2ff1('0x8')](_0x3c62c0[_0x2ff1('0x4a')],{'firstName':_0x3c62c0['body'][_0x2ff1('0x85')],'phone':_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')],'ListId':_0xe89be0[_0x2ff1('0x84')]});_0x5a8ba8[_0x3c62c0['body']['mapKeyOffline']]=_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x85')];return db['CmContact']['findOrCreate']({'where':_0x4b9a1a,'defaults':_0x5a8ba8});}})['spread'](function(_0x42a743){if(_0x42a743){_0x384e4c=_0x42a743;var _0x1d3323=fs[_0x2ff1('0xc0')](path['join'](config[_0x2ff1('0x67')],_0x2ff1('0xc1')),_0x2ff1('0xc2'));var _0x555b27=ejs[_0x2ff1('0xc3')](_0x1d3323,{'body':_[_0x2ff1('0xc4')](_0x3c62c0[_0x2ff1('0x4a')][_0x2ff1('0x4a')]),'bodyTitle':_0x5a9f24['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2ff1('0x44')]({'body':_0x555b27,'ContactId':_0x42a743['id'],'ChatWebsiteId':_0x5a9f24['id']});}})[_0x2ff1('0x27')](function(_0x4ae16b){_0x2db80e=_0x4ae16b;if(_0x4fdfbd[_0x2ff1('0x35')]){var _0x61dc07=_0x4fdfbd['map'](function(_0x32a488){return{'name':_0x32a488[_0x2ff1('0xc5')],'basename':_0x32a488[_0x2ff1('0x5e')],'type':_0x32a488[_0x2ff1('0xc6')],'ChatOfflineMessageId':_0x4ae16b['id']};});_0x3e3d2a=_0x61dc07['map'](_0xf0ea91=>{var _0x3d31cd={'filename':_0xf0ea91[_0x2ff1('0x29')],'path':path['join'](config[_0x2ff1('0x67')],_0x2ff1('0xc7'),_0x2ff1('0xb9'),_0x2ff1('0xc8'),_0x2ff1('0xc9'),_0xf0ea91[_0x2ff1('0xca')])};return _0x3d31cd;});if(!_0x5a9f24[_0x2ff1('0xcb')]){return db['sequelize']['transaction'](function(_0x18c940){return db['Attachment'][_0x2ff1('0xcc')](_0x61dc07,{'transaction':_0x18c940});});}}})['then'](function(){if(_0x2db80e){_0x3817eb=_0x2db80e;return db[_0x2ff1('0xbf')][_0x2ff1('0x51')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2ff1('0xcd'),'raw':!![]}]});}})['then'](function(_0x14bb2b){if(_0x14bb2b&&_0x14bb2b[_0x2ff1('0xcd')]&&_0x5a9f24['forwardOffline']&&_0x5a9f24['forwardOfflineAddress']){var _0xb35cd4={'tls':{'rejectUnauthorized':![]}};if(_0x14bb2b[_0x2ff1('0xcd')]['service']){_0xb35cd4['service']=_0x14bb2b[_0x2ff1('0xcd')]['service'];}else{_0xb35cd4['host']=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xce')];_0xb35cd4[_0x2ff1('0xcf')]=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xcf')];_0xb35cd4['secure']=_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0xd0')];}if(_0x14bb2b[_0x2ff1('0xcd')]['authentication']){_0xb35cd4[_0x2ff1('0xd1')]={'user':_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0x45')],'pass':_0x14bb2b['Smtp'][_0x2ff1('0xd2')]};}return respondWithRpcPromise('SendMail',_0x2ff1('0xd3'),{'account':_0xb35cd4,'message':{'from':util[_0x2ff1('0xa0')](_0x2ff1('0xd4'),_0x14bb2b[_0x2ff1('0x29')],_0x14bb2b['email']||_0x14bb2b[_0x2ff1('0xcd')][_0x2ff1('0x45')]),'to':_0x5a9f24[_0x2ff1('0xd5')],'subject':_0x5a9f24[_0x2ff1('0xd6')],'html':_0x3817eb[_0x2ff1('0x4a')],'attachments':_0x3e3d2a}},client9003)[_0x2ff1('0x27')](function(){return _0x3817eb;})[_0x2ff1('0x19')](function(_0x382f52){console[_0x2ff1('0x14')](_0x382f52);});}})[_0x2ff1('0x27')](function(){if(_0x5a9f24&&_0x5a9f24[_0x2ff1('0xcb')]&&_0x5a9f24[_0x2ff1('0xd7')]){var _0x1cc3b2=[];if(_0x4fdfbd['length']){_0x1cc3b2=_0x4fdfbd[_0x2ff1('0x2d')](function(_0x5c3e40){return{'name':_0x5c3e40[_0x2ff1('0xc5')],'basename':_0x5c3e40['filename'],'type':_0x5c3e40[_0x2ff1('0xc6')],'ChatOfflineMessageId':_0x2db80e['id']};});}var _0x304a16;if(!_['isNil'](_0x5a9f24['subjectOffline'])){var _0x296f57=_[_0x2ff1('0x2d')](_0x3c62c0[_0x2ff1('0x4a')],function(_0x471663){return _0x471663;});var _0x2d0614=_[_0x2ff1('0xd8')](_0x296f57)[0x0];var _0x570805=_[_0x2ff1('0xd9')](_0x2d0614,function(_0x202f72){return _0x202f72;});_0x304a16=_0x570805[0x1][_0x5a9f24[_0x2ff1('0xda')]];}var _0x5ec63f={'from':_0x384e4c['email'],'firstName':_0x384e4c[_0x2ff1('0x98')],'lastName':_0x384e4c[_0x2ff1('0x99')],'mapKey':_0x2ff1('0xdb'),'message':{'from':_0x384e4c[_0x2ff1('0xdb')],'to':_0x5a9f24['MailAccount'][_0x2ff1('0xdb')],'cc':'','subject':_['isNil'](_0x304a16)?_0x5a9f24[_0x2ff1('0xd6')]:_0x304a16,'messageId':'','sentAt':new Date(),'attach':_0x1cc3b2[_0x2ff1('0x35')],'attachments':_0x1cc3b2,'originChannel':_0x2ff1('0xdc'),'ChatWebsiteId':_0x5a9f24['id'],'ChatOfflineMessageId':_0x3817eb['id'],'originTo':_0x5a9f24[_0x2ff1('0xbf')]['email']},'body':_0x3817eb[_0x2ff1('0x4a')]};var _0x202552={'account':{'id':_0x5a9f24[_0x2ff1('0xd7')]},'body':_0x5ec63f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2ff1('0xdd'),_0x2ff1('0xde'),_0x202552,client9001)['then'](function(){return _0x3817eb;})[_0x2ff1('0x19')](function(_0x4d3bce){console[_0x2ff1('0x14')](_0x4d3bce);});}return;})[_0x2ff1('0x27')](function(){if(_0x3817eb){return _0x3817eb;}})[_0x2ff1('0x27')](respondWithResult(_0x5b6518,null))[_0x2ff1('0x19')](function(_0x332133){console[_0x2ff1('0x14')](_0x2ff1('0x19'),_0x332133);for(var _0x40e306 of _0x4fdfbd){var _0x5a6a60=path[_0x2ff1('0x66')](config['root'],_0x2ff1('0xc7'),_0x2ff1('0xb9'),_0x2ff1('0xc8'),'offline-chat',_0x40e306['filename']);fs_extra[_0x2ff1('0xdf')](_0x5a6a60)[_0x2ff1('0x19')](function(_0x22cf24){console[_0x2ff1('0x14')](_0x2ff1('0xe0'),_0x5a6a60,_0x22cf24);});}});};exports['addInteraction']=function(_0x3a8931,_0x352426){return db['ChatInteraction'][_0x2ff1('0x43')]({'where':{'id':_0x3a8931['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x352426,null))[_0x2ff1('0x27')](function(_0x45d1a9){if(_0x45d1a9){return _0x45d1a9[_0x2ff1('0xe1')](_0x3a8931[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x3a8931[_0x2ff1('0x4a')],['ids','id'])||{});}})[_0x2ff1('0x27')](respondWithResult(_0x352426,null))['catch'](handleError(_0x352426,null));};exports[_0x2ff1('0xe3')]=function(_0x14027d,_0x129cc3){var _0x40b5d2={'raw':![],'where':{}};var _0x282517={};var _0x1db306={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x14027d[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x129cc3,null))['then'](function(_0x3aee78){if(_0x3aee78){_0x282517[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0xa7')][_0x2ff1('0x2f')]);_0x282517['query']=_[_0x2ff1('0x41')](_0x14027d[_0x2ff1('0x31')]);_0x282517[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x282517[_0x2ff1('0x33')],_0x282517['query']);_0x40b5d2[_0x2ff1('0x32')]=_['intersection'](_0x282517['model'],qs[_0x2ff1('0x34')](_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x34')]));_0x40b5d2[_0x2ff1('0x32')]=_0x40b5d2[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x40b5d2['attributes']:_0x282517[_0x2ff1('0x33')];if(!_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x40b5d2[_0x2ff1('0x1c')]=qs['limit'](_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x40b5d2[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x14027d[_0x2ff1('0x31')]['offset']);}_0x40b5d2[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x14027d['query'][_0x2ff1('0x36')]);_0x40b5d2['where']=qs['filters'](_[_0x2ff1('0x37')](_0x14027d['query'],_0x282517['filters']));_0x40b5d2[_0x2ff1('0x3a')][_0x2ff1('0x55')]=_0x3aee78['id'];if(_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x39')]){_0x40b5d2['where']=_[_0x2ff1('0x3b')](_0x40b5d2[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x40b5d2[_0x2ff1('0x32')],function(_0x494780){var _0x3f2f6c={};_0x3f2f6c[_0x494780]={'$like':'%'+_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0x3f2f6c;})});}_0x40b5d2=_['merge']({},_0x40b5d2,_0x14027d[_0x2ff1('0x3c')]);return db[_0x2ff1('0xa7')][_0x2ff1('0x1e')]({'where':_0x40b5d2['where']})[_0x2ff1('0x27')](function(_0xf4bc38){_0x1db306[_0x2ff1('0x1e')]=_0xf4bc38;if(_0x14027d[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x40b5d2['include']=[{'model':db[_0x2ff1('0x7c')],'as':_0x2ff1('0xe4'),'required':![]},{'model':db[_0x2ff1('0xb1')],'as':_0x2ff1('0xe5'),'attributes':[_0x2ff1('0x29'),_0x2ff1('0xe6'),'internal'],'required':![]},{'model':db[_0x2ff1('0xe7')],'as':'Tags','attributes':['id','name',_0x2ff1('0xe8')],'where':_0x14027d['query'][_0x2ff1('0xe9')]?{'id':_0x14027d[_0x2ff1('0x31')][_0x2ff1('0xe9')]}:undefined,'required':_0x14027d['query'][_0x2ff1('0xe9')]?!![]:![]}];}return db[_0x2ff1('0xa7')][_0x2ff1('0x3f')](_0x40b5d2);})[_0x2ff1('0x27')](function(_0x5f3136){_0x1db306['rows']=_0x5f3136;return _0x1db306;});}})['then'](respondWithFilteredResult(_0x129cc3,_0x40b5d2))['catch'](handleError(_0x129cc3,null));};function iftimePromise(_0x1c6d7c,_0x16dfa5){return respondWithRpcPromise('Command',_0x2ff1('0xea'),{'command':_0x16dfa5[_0x2ff1('0xeb')]?util[_0x2ff1('0xa0')]('iftime\x20%s,%s',_0x1c6d7c['interval'],_0x16dfa5['timezone']):util[_0x2ff1('0xa0')](_0x2ff1('0xec'),_0x1c6d7c[_0x2ff1('0xed')])},client9002)[_0x2ff1('0x27')](function(_0x60d2c0){var _0x14091b=_0x60d2c0&&_0x60d2c0[_0x2ff1('0xee')]('true')>=0x0?!![]:![];logger[_0x2ff1('0x11')](_0x2ff1('0xef'),_0x16dfa5['id'],_0x1c6d7c['id'],_0x1c6d7c[_0x2ff1('0xed')],_0x14091b?_0x2ff1('0xf0'):_0x2ff1('0xf1'),_0x16dfa5[_0x2ff1('0xeb')]?_0x16dfa5[_0x2ff1('0xeb')]:_0x2ff1('0xf2'));return _0x14091b;})[_0x2ff1('0x19')](function(_0x44549a){logger[_0x2ff1('0x14')](_0x2ff1('0xef'),_0x16dfa5['id'],_0x1c6d7c['id'],_0x1c6d7c['interval'],util['inspect'](_0x44549a,{'showHidden':![],'depth':null}),_0x16dfa5[_0x2ff1('0xeb')]?_0x16dfa5[_0x2ff1('0xeb')]:_0x2ff1('0xf2'));return![];});}exports[_0x2ff1('0xea')]=function(_0x20c406,_0x1461b7){var _0x1442a8=0x0;var _0x330693=0x0;var _0x4ec8b0=![];var _0x254efc;var _0x59c9aa;return db['ChatWebsite']['find']({'where':{'id':_0x20c406[_0x2ff1('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0x2ff1('0xf3'),'include':[{'model':db[_0x2ff1('0xf3')],'as':'Intervals','attributes':['id',_0x2ff1('0xed')],'raw':!![]}]}]})[_0x2ff1('0x27')](handleEntityNotFound(_0x1461b7,null))[_0x2ff1('0x27')](function(_0x4c8a29){if(_0x4c8a29){_0x254efc=_0x4c8a29;return _0x4c8a29[_0x2ff1('0xf4')]({'raw':!![]});}})[_0x2ff1('0x27')](function(_0x53e344){if(_0x254efc){if(_0x53e344){_0x59c9aa=_0x53e344;}}return require(_0x2ff1('0x6a'))[_0x2ff1('0x6b')]();})['then'](function(_0x1b0422){if(_0x1b0422){_0x330693=_0x1b0422[_0x2ff1('0xf5')];_0x4ec8b0=_0x1b0422['custom'];}})[_0x2ff1('0x27')](function(){return db[_0x2ff1('0xa7')]['count']({'where':{'closed':![]}});})['then'](function(_0x504480){_0x1442a8=_0x504480;if(_0x330693&&_0x504480>_0x330693){return db[_0x2ff1('0xf6')][_0x2ff1('0x51')]({'where':{'id':0x1}})[_0x2ff1('0x27')](function(_0x576aeb){if(_0x576aeb){_0x576aeb[_0x2ff1('0xf7')]('chatLicenseExceeded');}});}})[_0x2ff1('0x27')](function(){if(_0x254efc[_0x2ff1('0xf3')]&&_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')]){var _0x2b5c7e=[];for(var _0x5e3ddb=0x0;_0x5e3ddb<_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')][_0x2ff1('0x35')];_0x5e3ddb++){var _0x2a1062=_0x254efc[_0x2ff1('0xf3')][_0x2ff1('0xf8')][_0x5e3ddb][_0x2ff1('0x23')]({'plain':!![]});_0x2b5c7e[_0x2ff1('0xad')](iftimePromise(_0x2a1062,_0x254efc));}return BPromise[_0x2ff1('0xf9')](_0x2b5c7e)[_0x2ff1('0x27')](function(_0x2dfd1f){return _[_0x2ff1('0xfa')](_0x2dfd1f);});}else{return!![];}})['then'](function(_0x545e7c){var _0x90fba3=fs[_0x2ff1('0xc0')](path[_0x2ff1('0x66')](config[_0x2ff1('0x67')],'server/files/chat/iframe.ejs'),_0x2ff1('0xc2'));var _0x4a3d89={'remote':_0x254efc[_0x2ff1('0xfb')],'query':querystring[_0x2ff1('0xa4')](_[_0x2ff1('0x3b')](_0x254efc[_0x2ff1('0x23')]({'plain':!![]}),{'customerIp':_0x20c406[_0x2ff1('0x79')][_0x2ff1('0x95')]||_0x20c406[_0x2ff1('0x79')]['x-real-ip']||_0x20c406[_0x2ff1('0xfc')]['remoteAddress']||_0x20c406['ip'],'referer':_0x20c406[_0x2ff1('0x79')]['referer'],'openedInteractions':_0x1442a8,'maxInteractions':_0x330693,'virtual':_0x4ec8b0[_0x2ff1('0xf5')],'online':_0x545e7c,'custom':_0x4ec8b0}))[_0x2ff1('0xfd')](/'/g,'\x5c\x27')};_0x1461b7['send'](ejs[_0x2ff1('0xc3')](Mustache[_0x2ff1('0xc3')](_0x90fba3,_0x4a3d89),{'proactiveActions':_0x59c9aa,'alignment':_0x254efc[_0x2ff1('0xfe')],'verticalAlignment':_0x254efc[_0x2ff1('0xff')],'div_color':_0x254efc['color'],'labelText':_0x254efc[_0x2ff1('0x100')],'text_color':_0x254efc['textColor'],'button_color':_0x254efc[_0x2ff1('0x101')],'background_color':_0x254efc[_0x2ff1('0x102')]}));})['catch'](handleError(_0x1461b7,null));};exports[_0x2ff1('0x103')]=function(_0x5db472,_0x34d08b){var _0x3307eb=_0x5db472[_0x2ff1('0x4b')]['id'];var _0x5bc44e=_0x5db472[_0x2ff1('0x4a')];var _0xf21af5=0xc8;var _0x2c5fd1=null;return db['sequelize'][_0x2ff1('0x104')]({'isolationLevel':db[_0x2ff1('0x105')]['Transaction'][_0x2ff1('0x106')][_0x2ff1('0x107')]},function(_0x5b9073){return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x3307eb},'transaction':_0x5b9073})['then'](function(_0x32512a){if(_0x32512a){return db['ChatApplication'][_0x2ff1('0x26')]({'where':{'ChatWebsiteId':_0x3307eb},'transaction':_0x5b9073})['then'](function(){var _0x29fb71=_[_0x2ff1('0x2d')](_0x5bc44e,function(_0x5c313e){_0x5c313e[_0x2ff1('0x55')]=_0x3307eb;return _0x5c313e;});return db[_0x2ff1('0x8c')][_0x2ff1('0xcc')](_0x29fb71,{'transaction':_0x5b9073});});}else{_0xf21af5=0x194;_0x2c5fd1=[];}});})[_0x2ff1('0x27')](function(){if(_0xf21af5!==0x194){return db[_0x2ff1('0x8c')][_0x2ff1('0x108')]({'where':{'ChatWebsiteId':_0x3307eb},'order':_0x2ff1('0x91')})['then'](function(_0x332d8c){_0x2c5fd1=_0x332d8c;});}})[_0x2ff1('0x19')](function(_0x543c41){_0xf21af5=0x1f4;logger['error'](_0x543c41[_0x2ff1('0x109')]);if(_0x543c41[_0x2ff1('0x29')]){delete _0x543c41['name'];}_0x2c5fd1=_0x543c41;})[_0x2ff1('0x10a')](function(){if(_0x2c5fd1===null){_0x34d08b[_0x2ff1('0x10b')](_0xf21af5);}else{if(_0xf21af5===0x1f4){_0x34d08b[_0x2ff1('0x1a')](_0xf21af5)[_0x2ff1('0x2a')](_0x2c5fd1);}else{_0x34d08b[_0x2ff1('0x1a')](_0xf21af5)[_0x2ff1('0x21')](_0x2c5fd1);}}});};exports[_0x2ff1('0x10c')]=function(_0x5834f6,_0x2859ca){var _0x416832={};var _0x26110e={};var _0x5f2b4b;var _0x359983;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x5834f6['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x2859ca,null))['then'](function(_0x471870){if(_0x471870){_0x5f2b4b=_0x471870;_0x26110e[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x8c')][_0x2ff1('0x2f')]);_0x26110e[_0x2ff1('0x31')]=_['keys'](_0x5834f6[_0x2ff1('0x31')]);_0x26110e['filters']=_['intersection'](_0x26110e['model'],_0x26110e['query']);_0x416832['attributes']=_['intersection'](_0x26110e[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x5834f6['query']['fields']));_0x416832[_0x2ff1('0x32')]=_0x416832[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x416832[_0x2ff1('0x32')]:_0x26110e[_0x2ff1('0x33')];_0x416832['order']=qs['sort'](_0x5834f6[_0x2ff1('0x31')]['sort']);_0x416832[_0x2ff1('0x3a')]=qs['filters'](_[_0x2ff1('0x37')](_0x5834f6[_0x2ff1('0x31')],_0x26110e[_0x2ff1('0x38')]));if(_0x5834f6['query']['filter']){_0x416832[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x416832[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x416832[_0x2ff1('0x32')],function(_0x18146a){var _0x2b428a={};_0x2b428a[_0x18146a]={'$like':'%'+_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0x2b428a;})});}_0x416832=_['merge']({},_0x416832,_0x5834f6[_0x2ff1('0x3c')]);return _0x5f2b4b[_0x2ff1('0x10c')](_0x416832);}})[_0x2ff1('0x27')](function(_0x1c87ee){if(_0x1c87ee){_0x359983=_0x1c87ee[_0x2ff1('0x35')];if(!_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x416832[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x416832['offset']=qs[_0x2ff1('0x1b')](_0x5834f6[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x5f2b4b[_0x2ff1('0x10c')](_0x416832);}})[_0x2ff1('0x27')](function(_0xb5a105){if(_0xb5a105){return _0xb5a105?{'count':_0x359983,'rows':_0xb5a105}:null;}})['then'](respondWithResult(_0x2859ca,null))[_0x2ff1('0x19')](handleError(_0x2859ca,null));};exports[_0x2ff1('0x10d')]=function(_0x2422e0,_0x77737a){return db[_0x2ff1('0x10e')]['find']({'where':{'id':_0x2422e0[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x77737a,null))[_0x2ff1('0x27')](function(_0x338fb2){if(_0x338fb2){return _0x338fb2[_0x2ff1('0x10d')](_0x2422e0[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x2422e0[_0x2ff1('0x4a')],['ids','id'])||{});}})[_0x2ff1('0x27')](respondWithResult(_0x77737a,null))[_0x2ff1('0x19')](handleError(_0x77737a,null));};exports[_0x2ff1('0xf4')]=function(_0x6af13,_0x4bc0b7){var _0x554661={};var _0x2f6259={};var _0x2e35d9;var _0x54a73a;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x6af13['params']['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x4bc0b7,null))[_0x2ff1('0x27')](function(_0x28d52a){if(_0x28d52a){_0x2e35d9=_0x28d52a;_0x2f6259[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db['ChatProactiveAction'][_0x2ff1('0x2f')]);_0x2f6259['query']=_[_0x2ff1('0x41')](_0x6af13['query']);_0x2f6259['filters']=_['intersection'](_0x2f6259[_0x2ff1('0x33')],_0x2f6259[_0x2ff1('0x31')]);_0x554661['attributes']=_[_0x2ff1('0x42')](_0x2f6259['model'],qs['fields'](_0x6af13[_0x2ff1('0x31')]['fields']));_0x554661[_0x2ff1('0x32')]=_0x554661[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x554661[_0x2ff1('0x32')]:_0x2f6259[_0x2ff1('0x33')];_0x554661[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x6af13['query'][_0x2ff1('0x36')]);_0x554661[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x6af13[_0x2ff1('0x31')],_0x2f6259[_0x2ff1('0x38')]));if(_0x6af13['query'][_0x2ff1('0x39')]){_0x554661[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x554661[_0x2ff1('0x3a')],{'$or':_[_0x2ff1('0x2d')](_0x554661[_0x2ff1('0x32')],function(_0x2fd065){var _0x5b5962={};_0x5b5962[_0x2fd065]={'$like':'%'+_0x6af13['query'][_0x2ff1('0x39')]+'%'};return _0x5b5962;})});}_0x554661=_[_0x2ff1('0x3b')]({},_0x554661,_0x6af13['options']);return _0x2e35d9[_0x2ff1('0xf4')](_0x554661);}})[_0x2ff1('0x27')](function(_0x3f1d38){if(_0x3f1d38){_0x54a73a=_0x3f1d38[_0x2ff1('0x35')];if(!_0x6af13[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x554661[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x6af13['query'][_0x2ff1('0x1c')]);_0x554661[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x6af13[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x2e35d9[_0x2ff1('0xf4')](_0x554661);}})[_0x2ff1('0x27')](function(_0x50cd42){if(_0x50cd42){return _0x50cd42?{'count':_0x54a73a,'rows':_0x50cd42}:null;}})[_0x2ff1('0x27')](respondWithResult(_0x4bc0b7,null))[_0x2ff1('0x19')](handleError(_0x4bc0b7,null));};exports[_0x2ff1('0x10f')]=function(_0x14acff,_0x77225e){var _0x1886e1=_0x14acff[_0x2ff1('0x31')]['online']===_0x2ff1('0x110')?_0x2ff1('0x111'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x1886e1],'where':{'id':_0x14acff[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x77225e,null))[_0x2ff1('0x27')](function(_0x30ba77){if(_0x30ba77){var _0x3e8095=_0x30ba77[_0x1886e1];var _0x244882=_0x3e8095&&_0x3e8095['items']?_0x3e8095[_0x2ff1('0x112')]:[];_0x77225e['send']({'fromKey':_[_0x2ff1('0x6d')](_0x3e8095[_0x2ff1('0x113')])?undefined:_0x3e8095[_0x2ff1('0x113')],'count':_0x244882[_0x2ff1('0x35')],'rows':_0x244882});}})['catch'](handleError(_0x77225e,null));};exports[_0x2ff1('0x114')]=function(_0x1764f4,_0xe71487){var _0x28c1c4={'raw':![],'where':{}};var _0x361f9b={};var _0x4b311f={'count':0x0,'rows':[]};return db[_0x2ff1('0x2e')][_0x2ff1('0x51')]({'where':{'id':_0x1764f4[_0x2ff1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe71487,null))[_0x2ff1('0x27')](function(_0x4172c8){if(_0x4172c8){_0x361f9b[_0x2ff1('0x33')]=_[_0x2ff1('0x41')](db[_0x2ff1('0x115')][_0x2ff1('0x2f')]);_0x361f9b[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x1764f4['query']);_0x361f9b[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x361f9b['model'],_0x361f9b[_0x2ff1('0x31')]);_0x28c1c4[_0x2ff1('0x32')]=_[_0x2ff1('0x42')](_0x361f9b[_0x2ff1('0x33')],qs[_0x2ff1('0x34')](_0x1764f4['query'][_0x2ff1('0x34')]));_0x28c1c4['attributes']=_0x28c1c4[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x28c1c4[_0x2ff1('0x32')]:_0x361f9b[_0x2ff1('0x33')];if(!_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x28c1c4[_0x2ff1('0x1c')]=qs[_0x2ff1('0x1c')](_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x28c1c4[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x1764f4['query'][_0x2ff1('0x1b')]);}_0x28c1c4[_0x2ff1('0x54')]=qs['sort'](_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x36')]);_0x28c1c4['where']=qs['filters'](_[_0x2ff1('0x37')](_0x1764f4[_0x2ff1('0x31')],_0x361f9b[_0x2ff1('0x38')]));_0x28c1c4['where'][_0x2ff1('0x55')]=_0x4172c8['id'];if(_0x1764f4['query']['filter']){_0x28c1c4[_0x2ff1('0x3a')]=_[_0x2ff1('0x3b')](_0x28c1c4['where'],{'$or':_[_0x2ff1('0x2d')](_0x28c1c4['attributes'],function(_0x163a67){var _0xf2f6fb={};_0xf2f6fb[_0x163a67]={'$like':'%'+_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x39')]+'%'};return _0xf2f6fb;})});}_0x28c1c4=_[_0x2ff1('0x3b')]({},_0x28c1c4,_0x1764f4[_0x2ff1('0x3c')]);return db[_0x2ff1('0x115')][_0x2ff1('0x1e')]({'where':_0x28c1c4[_0x2ff1('0x3a')]})['then'](function(_0x550bdc){_0x4b311f[_0x2ff1('0x1e')]=_0x550bdc;if(_0x1764f4[_0x2ff1('0x31')][_0x2ff1('0x3d')]){_0x28c1c4[_0x2ff1('0x3e')]=[{'all':!![]}];}else{_0x28c1c4[_0x2ff1('0x3e')]=[{'model':db['CmContact'],'as':_0x2ff1('0xe4'),'required':![]},{'model':db['Attachment'],'as':_0x2ff1('0x116'),'required':![]}];}return db['ChatOfflineMessage'][_0x2ff1('0x3f')](_0x28c1c4);})[_0x2ff1('0x27')](function(_0x35f8e3){_0x4b311f['rows']=_0x35f8e3;return _0x4b311f;});}})[_0x2ff1('0x27')](respondWithFilteredResult(_0xe71487,_0x28c1c4))[_0x2ff1('0x19')](handleError(_0xe71487,null));};exports['addAgents']=function(_0x18221d,_0xc5f5ea){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x18221d[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0xc5f5ea,null))['then'](function(_0x16e50a){if(_0x16e50a){return _0x16e50a[_0x2ff1('0x117')](_0x18221d[_0x2ff1('0x4a')][_0x2ff1('0x58')],_[_0x2ff1('0xe2')](_0x18221d[_0x2ff1('0x4a')],[_0x2ff1('0x58'),'id'])||{})[_0x2ff1('0xa9')](function(_0x3fb7d7){for(var _0x424023=0x0;_0x424023<_0x18221d['body']['ids'][_0x2ff1('0x35')];_0x424023+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x18221d[_0x2ff1('0x4a')][_0x2ff1('0x58')][_0x424023]),'ChatWebsiteId':Number(_0x18221d[_0x2ff1('0x4b')]['id'])});}return _0x3fb7d7;});}})['then'](respondWithResult(_0xc5f5ea,null))[_0x2ff1('0x19')](handleError(_0xc5f5ea,null));};exports['removeAgents']=function(_0x1515f2,_0x39f127){return db[_0x2ff1('0x2e')][_0x2ff1('0x43')]({'where':{'id':_0x1515f2[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x39f127,null))[_0x2ff1('0x27')](function(_0x3fc7ee){if(_0x3fc7ee){return _0x3fc7ee[_0x2ff1('0x118')](_0x1515f2['query'][_0x2ff1('0x58')])[_0x2ff1('0x27')](function(){if(_[_0x2ff1('0x119')](_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')])){for(var _0x320887=0x0;_0x320887<_0x1515f2[_0x2ff1('0x31')]['ids'][_0x2ff1('0x35')];_0x320887+=0x1){socket[_0x2ff1('0x11a')](_0x2ff1('0x11b'),{'UserId':Number(_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')][_0x320887]),'ChatWebsiteId':Number(_0x1515f2[_0x2ff1('0x4b')]['id'])});}}else{socket['emit'](_0x2ff1('0x11b'),{'UserId':Number(_0x1515f2[_0x2ff1('0x31')][_0x2ff1('0x58')]),'ChatWebsiteId':Number(_0x1515f2['params']['id'])});}});}})[_0x2ff1('0x27')](respondWithStatusCode(_0x39f127,null))[_0x2ff1('0x19')](handleError(_0x39f127,null));};exports[_0x2ff1('0x11c')]=function(_0x13f30b,_0x46f356){var _0x4a7abf={};var _0x5d26b5={};var _0x3672e7;var _0x501224;return db['ChatWebsite'][_0x2ff1('0x51')]({'where':{'id':_0x13f30b[_0x2ff1('0x4b')]['id']}})[_0x2ff1('0x27')](handleEntityNotFound(_0x46f356,null))[_0x2ff1('0x27')](function(_0x3d4850){if(_0x3d4850){_0x3672e7=_0x3d4850;_0x5d26b5[_0x2ff1('0x33')]=_['keys'](db[_0x2ff1('0xb1')][_0x2ff1('0x2f')]);_0x5d26b5[_0x2ff1('0x31')]=_[_0x2ff1('0x41')](_0x13f30b[_0x2ff1('0x31')]);_0x5d26b5[_0x2ff1('0x38')]=_[_0x2ff1('0x42')](_0x5d26b5['model'],_0x5d26b5[_0x2ff1('0x31')]);_0x4a7abf[_0x2ff1('0x32')]=_['intersection'](_0x5d26b5['model'],qs[_0x2ff1('0x34')](_0x13f30b[_0x2ff1('0x31')]['fields']));_0x4a7abf[_0x2ff1('0x32')]=_0x4a7abf[_0x2ff1('0x32')][_0x2ff1('0x35')]?_0x4a7abf[_0x2ff1('0x32')]:_0x5d26b5['model'];_0x4a7abf[_0x2ff1('0x54')]=qs[_0x2ff1('0x36')](_0x13f30b['query'][_0x2ff1('0x36')]);_0x4a7abf[_0x2ff1('0x3a')]=qs[_0x2ff1('0x38')](_[_0x2ff1('0x37')](_0x13f30b[_0x2ff1('0x31')],_0x5d26b5[_0x2ff1('0x38')]));if(_0x13f30b[_0x2ff1('0x31')]['filter']){_0x4a7abf[_0x2ff1('0x3a')]=_['merge'](_0x4a7abf['where'],{'$or':_[_0x2ff1('0x2d')](_0x4a7abf['attributes'],function(_0x4f852b){var _0x59bacd={};_0x59bacd[_0x4f852b]={'$like':'%'+_0x13f30b['query'][_0x2ff1('0x39')]+'%'};return _0x59bacd;})});}_0x4a7abf=_[_0x2ff1('0x3b')]({},_0x4a7abf,_0x13f30b[_0x2ff1('0x3c')]);return _0x3672e7[_0x2ff1('0x11c')](_0x4a7abf);}})[_0x2ff1('0x27')](function(_0x55a471){if(_0x55a471){_0x501224=_0x55a471[_0x2ff1('0x35')];if(!_0x13f30b['query'][_0x2ff1('0x52')](_0x2ff1('0x53'))){_0x4a7abf[_0x2ff1('0x1c')]=qs['limit'](_0x13f30b[_0x2ff1('0x31')][_0x2ff1('0x1c')]);_0x4a7abf[_0x2ff1('0x1b')]=qs[_0x2ff1('0x1b')](_0x13f30b[_0x2ff1('0x31')][_0x2ff1('0x1b')]);}return _0x3672e7[_0x2ff1('0x11c')](_0x4a7abf);}})[_0x2ff1('0x27')](function(_0x7baf22){if(_0x7baf22){return _0x7baf22?{'count':_0x501224,'rows':_0x7baf22}:null;}})[_0x2ff1('0x27')](respondWithResult(_0x46f356,null))[_0x2ff1('0x19')](handleError(_0x46f356,null));};
\ No newline at end of file
+var _0xf874=['where','filters','filter','merge','options','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','Applications','orderBy','asc','account','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','interaction','messageId','created','push','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','sendMail','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','nolimit','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','all','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','color','labelText','textColor','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','priority','stack','finally','getApplications','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','undefined','limit','count','offset','set','update','then','destroy','ChatWebsites','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','intersection','attributes','fields','query','length','hasOwnProperty','order','sort'];(function(_0x1da42a,_0x2f4a8b){var _0x189a3d=function(_0x56e376){while(--_0x56e376){_0x1da42a['push'](_0x1da42a['shift']());}};_0x189a3d(++_0x2f4a8b);}(_0xf874,0xed));var _0x4f87=function(_0x1ec443,_0x100928){_0x1ec443=_0x1ec443-0x0;var _0x149857=_0xf874[_0x1ec443];return _0x149857;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f87('0x0'));var path=require(_0x4f87('0x1'));var ejs=require(_0x4f87('0x2'));var fs=require('fs');var fs_extra=require(_0x4f87('0x3'));var _=require(_0x4f87('0x4'));var querystring=require(_0x4f87('0x5'));var Redis=require('ioredis');var qs=require(_0x4f87('0x6'));var logger=require(_0x4f87('0x7'))(_0x4f87('0x8'));var config=require(_0x4f87('0x9'));var db=require(_0x4f87('0xa'))['db'];config[_0x4f87('0xb')]=_['defaults'](config[_0x4f87('0xb')],{'host':_0x4f87('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f87('0xb')]));require(_0x4f87('0xd'))['register'](socket);var jayson=require(_0x4f87('0xe'));var client=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232c});var client9002=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232a});var client9003=jayson[_0x4f87('0xf')][_0x4f87('0x10')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x1b5c2c,_0x285481,_0x107d98,_0x5e6d04){return new BPromise(function(_0x4ebb6a,_0x1cfc27){var _0x430bc4=_0x5e6d04||client;return _0x430bc4[_0x4f87('0x11')](_0x1b5c2c,_0x107d98)['then'](function(_0x2f11d2){logger['info'](_0x4f87('0x12'),_0x285481,_0x4f87('0x13'));logger['debug'](_0x4f87('0x14'),_0x285481,_0x4f87('0x13'),JSON[_0x4f87('0x15')](_0x2f11d2));if(_0x2f11d2[_0x4f87('0x16')]){if(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x17')]===0x1f4){logger['error'](_0x4f87('0x12'),_0x285481,_0x2f11d2['error'][_0x4f87('0x18')]);return _0x1cfc27(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);}logger[_0x4f87('0x16')](_0x4f87('0x12'),_0x285481,_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);return _0x4ebb6a(_0x2f11d2[_0x4f87('0x16')][_0x4f87('0x18')]);}else{logger[_0x4f87('0x19')](_0x4f87('0x12'),_0x285481,_0x4f87('0x13'));_0x4ebb6a(_0x2f11d2[_0x4f87('0x1a')]['message']);}})['catch'](function(_0x3cb630){logger[_0x4f87('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x285481,_0x3cb630);_0x1cfc27(_0x3cb630);});});}function respondWithStatusCode(_0x592edd,_0x30636d){_0x30636d=_0x30636d||0xcc;return function(_0x5d1e62){if(_0x5d1e62){return _0x592edd['sendStatus'](_0x30636d);}return _0x592edd[_0x4f87('0x1b')](_0x30636d)[_0x4f87('0x1c')]();};}function respondWithResult(_0x2a382c,_0x3cf180){_0x3cf180=_0x3cf180||0xc8;return function(_0x17bdbd){if(_0x17bdbd){return _0x2a382c[_0x4f87('0x1b')](_0x3cf180)[_0x4f87('0x1d')](_0x17bdbd);}};}function respondWithFilteredResult(_0x5c5861,_0x234106){return function(_0x11eb83){if(_0x11eb83){var _0x207988=typeof _0x234106['offset']===_0x4f87('0x1e')&&typeof _0x234106[_0x4f87('0x1f')]==='undefined';var _0x19e3ba=_0x11eb83[_0x4f87('0x20')];var _0x3eab48=_0x207988?0x0:_0x234106[_0x4f87('0x21')];var _0x4b4daf=_0x207988?_0x11eb83['count']:_0x234106[_0x4f87('0x21')]+_0x234106[_0x4f87('0x1f')];var _0xeaaf08;if(_0x4b4daf>=_0x19e3ba){_0x4b4daf=_0x19e3ba;_0xeaaf08=0xc8;}else{_0xeaaf08=0xce;}_0x5c5861[_0x4f87('0x1b')](_0xeaaf08);return _0x5c5861[_0x4f87('0x22')]('Content-Range',_0x3eab48+'-'+_0x4b4daf+'/'+_0x19e3ba)[_0x4f87('0x1d')](_0x11eb83);}return null;};}function saveUpdates(_0x4ca7c2){return function(_0x33c93e){if(_0x33c93e){return _0x33c93e[_0x4f87('0x23')](_0x4ca7c2)[_0x4f87('0x24')](function(_0x430cf9){return _0x430cf9;});}return null;};}function removeEntity(_0x3e04ce){return function(_0x23e54a){if(_0x23e54a){return _0x23e54a[_0x4f87('0x25')]()['then'](function(){var _0x22ccac=_0x23e54a['get']({'plain':!![]});var _0x1d3bec=_0x4f87('0x26');return db[_0x4f87('0x27')][_0x4f87('0x25')]({'where':{'type':_0x1d3bec,'resourceId':_0x22ccac['id']}})[_0x4f87('0x24')](function(){return _0x23e54a;});})[_0x4f87('0x24')](function(){_0x3e04ce[_0x4f87('0x1b')](0xcc)[_0x4f87('0x1c')]();});}};}function handleEntityNotFound(_0xddddfb){return function(_0xd8d3c0){if(!_0xd8d3c0){_0xddddfb[_0x4f87('0x28')](0x194);}return _0xd8d3c0;};}function handleError(_0x112ffd,_0x4ded68){_0x4ded68=_0x4ded68||0x1f4;return function(_0x386ffc){logger[_0x4f87('0x16')](_0x386ffc['stack']);if(_0x386ffc[_0x4f87('0x29')]){delete _0x386ffc[_0x4f87('0x29')];}_0x112ffd[_0x4f87('0x1b')](_0x4ded68)['send'](_0x386ffc);};}exports[_0x4f87('0x2a')]=function(_0x6669a5,_0x50a387){var _0x237265={'include':[{'model':db[_0x4f87('0x2b')],'as':_0x4f87('0x2c')}]},_0x588bc2={},_0x139ec3={'count':0x0,'rows':[]};var _0x49f7d0=_[_0x4f87('0x2d')](db['ChatWebsite']['rawAttributes'],function(_0x45651a){return{'name':_0x45651a[_0x4f87('0x2e')],'type':_0x45651a['type'][_0x4f87('0x2f')]};});_0x588bc2[_0x4f87('0x30')]=_[_0x4f87('0x2d')](_0x49f7d0,_0x4f87('0x29'));_0x588bc2['query']=_['keys'](_0x6669a5['query']);_0x588bc2['filters']=_[_0x4f87('0x31')](_0x588bc2[_0x4f87('0x30')],_0x588bc2['query']);_0x237265[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x588bc2[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x33')]));_0x237265['attributes']=_0x237265[_0x4f87('0x32')][_0x4f87('0x35')]?_0x237265['attributes']:_0x588bc2[_0x4f87('0x30')];if(!_0x6669a5[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x237265[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x6669a5['query'][_0x4f87('0x1f')]);_0x237265[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x21')]);}_0x237265[_0x4f87('0x37')]=qs['sort'](_0x6669a5[_0x4f87('0x34')][_0x4f87('0x38')]);_0x237265[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_['pick'](_0x6669a5[_0x4f87('0x34')],_0x588bc2['filters']),_0x49f7d0);if(_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x237265[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x237265['where'],{'$or':_['map'](_0x49f7d0,function(_0x5b6bf4){if(_0x5b6bf4['type']!=='VIRTUAL'){var _0x51bd2e={};_0x51bd2e[_0x5b6bf4[_0x4f87('0x29')]]={'$like':'%'+_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x51bd2e;}})});}_0x237265=_[_0x4f87('0x3c')]({},_0x237265,_0x6669a5[_0x4f87('0x3d')]);var _0x1232c4={'where':_0x237265[_0x4f87('0x39')]};return db[_0x4f87('0x3e')]['count'](_0x1232c4)[_0x4f87('0x24')](function(_0x3bb587){_0x139ec3[_0x4f87('0x20')]=_0x3bb587;if(_0x6669a5[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x237265[_0x4f87('0x40')]=[{'all':!![]}];}return db[_0x4f87('0x3e')][_0x4f87('0x41')](_0x237265);})[_0x4f87('0x24')](function(_0x2f22f2){_0x139ec3[_0x4f87('0x42')]=_0x2f22f2;return _0x139ec3;})[_0x4f87('0x24')](respondWithFilteredResult(_0x50a387,_0x237265))[_0x4f87('0x43')](handleError(_0x50a387,null));};exports[_0x4f87('0x44')]=function(_0x11e6fb,_0x3b6e13){var _0x8ed232={'raw':![],'where':{'id':_0x11e6fb[_0x4f87('0x45')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4f8886={};_0x4f8886[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x3e')][_0x4f87('0x47')]);_0x4f8886[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x11e6fb[_0x4f87('0x34')]);_0x4f8886[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0x4f8886[_0x4f87('0x30')],_0x4f8886['query']);_0x8ed232['attributes']=_[_0x4f87('0x31')](_0x4f8886[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x11e6fb['query']['fields']));_0x8ed232[_0x4f87('0x32')]=_0x8ed232[_0x4f87('0x32')][_0x4f87('0x35')]?_0x8ed232[_0x4f87('0x32')]:_0x4f8886[_0x4f87('0x30')];if(_0x11e6fb[_0x4f87('0x34')]['includeAll']){_0x8ed232[_0x4f87('0x40')]=[{'all':!![]}];}_0x8ed232=_['merge']({},_0x8ed232,_0x11e6fb[_0x4f87('0x3d')]);return db['ChatWebsite'][_0x4f87('0x48')](_0x8ed232)[_0x4f87('0x24')](handleEntityNotFound(_0x3b6e13,null))[_0x4f87('0x24')](respondWithResult(_0x3b6e13,null))[_0x4f87('0x43')](handleError(_0x3b6e13,null));};exports[_0x4f87('0x49')]=function(_0x27fa0b,_0x22c389){return db['ChatWebsite'][_0x4f87('0x49')](_0x27fa0b[_0x4f87('0x4a')],{})[_0x4f87('0x24')](function(_0x59a0d5){var _0x2e718b=_0x27fa0b['user'][_0x4f87('0x4b')]({'plain':!![]});if(!_0x2e718b)throw new Error(_0x4f87('0x4c'));if(_0x2e718b[_0x4f87('0x4d')]===_0x4f87('0x4e')){var _0x20cab1=_0x59a0d5['get']({'plain':!![]});var _0x16e323=_0x4f87('0x26');return db['UserProfileSection'][_0x4f87('0x48')]({'where':{'name':_0x16e323,'userProfileId':_0x2e718b[_0x4f87('0x4f')]},'raw':!![]})[_0x4f87('0x24')](function(_0x24c024){if(_0x24c024&&_0x24c024[_0x4f87('0x50')]===0x0){return db[_0x4f87('0x27')][_0x4f87('0x49')]({'name':_0x20cab1[_0x4f87('0x29')],'resourceId':_0x20cab1['id'],'type':_0x24c024[_0x4f87('0x29')],'sectionId':_0x24c024['id']},{})[_0x4f87('0x24')](function(){return _0x59a0d5;});}else{return _0x59a0d5;}})[_0x4f87('0x43')](function(_0x365b33){logger[_0x4f87('0x16')](_0x4f87('0x51'),_0x365b33);throw _0x365b33;});}return _0x59a0d5;})[_0x4f87('0x24')](respondWithResult(_0x22c389,0xc9))[_0x4f87('0x43')](handleError(_0x22c389,null));};exports[_0x4f87('0x23')]=function(_0x3e3871,_0x4080b3){if(_0x3e3871[_0x4f87('0x4a')]['id']){delete _0x3e3871[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x3e3871[_0x4f87('0x45')]['id']},'include':[{'model':db[_0x4f87('0x2b')],'as':_0x4f87('0x2c')}]})[_0x4f87('0x24')](handleEntityNotFound(_0x4080b3,null))[_0x4f87('0x24')](saveUpdates(_0x3e3871[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x4080b3,null))[_0x4f87('0x43')](handleError(_0x4080b3,null));};exports[_0x4f87('0x25')]=function(_0x46b9bc,_0xa63692){return db['ChatWebsite']['find']({'where':{'id':_0x46b9bc[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0xa63692,null))[_0x4f87('0x24')](removeEntity(_0xa63692,null))['catch'](handleError(_0xa63692,null));};exports[_0x4f87('0x52')]=function(_0xdb7fe7,_0x4f9828){return db['ChatWebsite'][_0x4f87('0x52')]()[_0x4f87('0x24')](respondWithResult(_0x4f9828,null))[_0x4f87('0x43')](handleError(_0x4f9828,null));};exports['addDisposition']=function(_0x3475fa,_0x341617){if(_0x3475fa[_0x4f87('0x4a')]['id']){delete _0x3475fa[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x3475fa['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x341617,null))[_0x4f87('0x24')](function(_0x46e86f){if(_0x46e86f){_0x3475fa['body'][_0x4f87('0x53')]=_0x46e86f['id'];return db[_0x4f87('0x54')][_0x4f87('0x49')](_0x3475fa['body']);}})[_0x4f87('0x24')](respondWithResult(_0x341617,null))[_0x4f87('0x43')](handleError(_0x341617,null));};exports[_0x4f87('0x55')]=function(_0x4f52b4,_0x7c5884){var _0x211417={'raw':![],'where':{}};var _0x4fb630={};var _0x825496={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x4f52b4[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x7c5884,null))[_0x4f87('0x24')](function(_0x44aea0){if(_0x44aea0){_0x4fb630[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x54')][_0x4f87('0x47')]);_0x4fb630[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x4f52b4[_0x4f87('0x34')]);_0x4fb630[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0x4fb630['model'],_0x4fb630[_0x4f87('0x34')]);_0x211417[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x4fb630[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x4f52b4[_0x4f87('0x34')][_0x4f87('0x33')]));_0x211417['attributes']=_0x211417[_0x4f87('0x32')][_0x4f87('0x35')]?_0x211417[_0x4f87('0x32')]:_0x4fb630[_0x4f87('0x30')];if(!_0x4f52b4[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x211417[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x4f52b4[_0x4f87('0x34')]['limit']);_0x211417[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x4f52b4['query']['offset']);}_0x211417[_0x4f87('0x37')]=qs['sort'](_0x4f52b4[_0x4f87('0x34')]['sort']);_0x211417[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_['pick'](_0x4f52b4['query'],_0x4fb630[_0x4f87('0x3a')]));_0x211417[_0x4f87('0x39')][_0x4f87('0x53')]=_0x44aea0['id'];if(_0x4f52b4['query']['filter']){_0x211417[_0x4f87('0x39')]=_['merge'](_0x211417[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x211417[_0x4f87('0x32')],function(_0x3885f6){var _0x66ce79={};_0x66ce79[_0x3885f6]={'$like':'%'+_0x4f52b4[_0x4f87('0x34')]['filter']+'%'};return _0x66ce79;})});}_0x211417=_[_0x4f87('0x3c')]({},_0x211417,_0x4f52b4[_0x4f87('0x3d')]);return db[_0x4f87('0x54')]['count']({'where':_0x211417[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x437642){_0x825496['count']=_0x437642;if(_0x4f52b4[_0x4f87('0x34')]['includeAll']){_0x211417[_0x4f87('0x40')]=[{'all':!![]}];}return db[_0x4f87('0x54')][_0x4f87('0x41')](_0x211417);})['then'](function(_0x41879f){_0x825496['rows']=_0x41879f;return _0x825496;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x7c5884,_0x211417))[_0x4f87('0x43')](handleError(_0x7c5884,null));};exports[_0x4f87('0x57')]=function(_0x3a52d2,_0x2b0e50){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x3a52d2[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x2b0e50,null))[_0x4f87('0x24')](function(_0x12f372){if(_0x12f372){return _0x12f372[_0x4f87('0x57')](_0x3a52d2[_0x4f87('0x34')]['ids']);}})[_0x4f87('0x24')](respondWithStatusCode(_0x2b0e50,null))['catch'](handleError(_0x2b0e50,null));};exports[_0x4f87('0x58')]=function(_0x4b8e39,_0x49bcb1){if(_0x4b8e39['body']['id']){delete _0x4b8e39[_0x4f87('0x4a')]['id'];}return db[_0x4f87('0x3e')]['find']({'where':{'id':_0x4b8e39['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x49bcb1,null))[_0x4f87('0x24')](function(_0x5e7bf0){if(_0x5e7bf0){_0x4b8e39[_0x4f87('0x4a')][_0x4f87('0x53')]=_0x5e7bf0['id'];return db[_0x4f87('0x59')][_0x4f87('0x49')](_0x4b8e39[_0x4f87('0x4a')]);}})[_0x4f87('0x24')](respondWithResult(_0x49bcb1,null))[_0x4f87('0x43')](handleError(_0x49bcb1,null));};exports[_0x4f87('0x5a')]=function(_0x54b994,_0x473028){var _0x415914={'raw':![],'where':{}};var _0x576565={};var _0x555945={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x54b994[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x473028,null))[_0x4f87('0x24')](function(_0x9250d2){if(_0x9250d2){_0x576565[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x59')]['rawAttributes']);_0x576565[_0x4f87('0x34')]=_['keys'](_0x54b994[_0x4f87('0x34')]);_0x576565['filters']=_[_0x4f87('0x31')](_0x576565[_0x4f87('0x30')],_0x576565[_0x4f87('0x34')]);_0x415914[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x576565[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x54b994[_0x4f87('0x34')]['fields']));_0x415914[_0x4f87('0x32')]=_0x415914[_0x4f87('0x32')][_0x4f87('0x35')]?_0x415914['attributes']:_0x576565[_0x4f87('0x30')];if(!_0x54b994[_0x4f87('0x34')]['hasOwnProperty']('nolimit')){_0x415914[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x54b994['query'][_0x4f87('0x1f')]);_0x415914[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x54b994[_0x4f87('0x34')][_0x4f87('0x21')]);}_0x415914['order']=qs[_0x4f87('0x38')](_0x54b994['query'][_0x4f87('0x38')]);_0x415914[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x54b994[_0x4f87('0x34')],_0x576565[_0x4f87('0x3a')]));_0x415914[_0x4f87('0x39')][_0x4f87('0x53')]=_0x9250d2['id'];if(_0x54b994[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x415914[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x415914['where'],{'$or':_[_0x4f87('0x2d')](_0x415914[_0x4f87('0x32')],function(_0xa018bb){var _0x34c9b5={};_0x34c9b5[_0xa018bb]={'$like':'%'+_0x54b994[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x34c9b5;})});}_0x415914=_['merge']({},_0x415914,_0x54b994['options']);return db[_0x4f87('0x59')][_0x4f87('0x20')]({'where':_0x415914[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x46929b){_0x555945[_0x4f87('0x20')]=_0x46929b;if(_0x54b994[_0x4f87('0x34')]['includeAll']){_0x415914['include']=[{'all':!![]}];}return db[_0x4f87('0x59')]['findAll'](_0x415914);})[_0x4f87('0x24')](function(_0x30b099){_0x555945[_0x4f87('0x42')]=_0x30b099;return _0x555945;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x473028,_0x415914))[_0x4f87('0x43')](handleError(_0x473028,null));};exports['removeAnswers']=function(_0xc7da8a,_0x1bff99){return db[_0x4f87('0x3e')]['find']({'where':{'id':_0xc7da8a[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bff99,null))['then'](function(_0x3699b3){if(_0x3699b3){return _0x3699b3['removeAnswers'](_0xc7da8a[_0x4f87('0x34')][_0x4f87('0x5c')]);}})[_0x4f87('0x24')](respondWithStatusCode(_0x1bff99,null))[_0x4f87('0x43')](handleError(_0x1bff99,null));};exports[_0x4f87('0x5d')]=function(_0x1e11df,_0x50de0a){_0x1e11df[_0x4f87('0x4a')][_0x4f87('0x5e')]=_0x1e11df[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1e11df[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x50de0a,null))['then'](saveUpdates(_0x1e11df[_0x4f87('0x4a')],null))['then'](respondWithResult(_0x50de0a,null))[_0x4f87('0x43')](handleError(_0x50de0a,null));};exports[_0x4f87('0x61')]=function(_0x107bbc,_0x2078be){_0x107bbc[_0x4f87('0x4a')][_0x4f87('0x62')]=_0x107bbc[_0x4f87('0x5f')][_0x4f87('0x60')];return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x107bbc[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x2078be,null))[_0x4f87('0x24')](saveUpdates(_0x107bbc['body'],null))[_0x4f87('0x24')](respondWithResult(_0x2078be,null))[_0x4f87('0x43')](handleError(_0x2078be,null));};exports[_0x4f87('0x63')]=function(_0x2f3dd2,_0x146f3e){_0x2f3dd2[_0x4f87('0x4a')][_0x4f87('0x64')]=_0x2f3dd2[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x2f3dd2['params']['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x146f3e,null))[_0x4f87('0x24')](saveUpdates(_0x2f3dd2[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x146f3e,null))[_0x4f87('0x43')](handleError(_0x146f3e,null));};exports[_0x4f87('0x65')]=function(_0xc3e8fc,_0x35e798){_0xc3e8fc['body'][_0x4f87('0x66')]=_0xc3e8fc[_0x4f87('0x5f')][_0x4f87('0x60')];return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0xc3e8fc['params']['id']}})['then'](handleEntityNotFound(_0x35e798,null))[_0x4f87('0x24')](saveUpdates(_0xc3e8fc[_0x4f87('0x4a')],null))[_0x4f87('0x24')](respondWithResult(_0x35e798,null))[_0x4f87('0x43')](handleError(_0x35e798,null));};exports[_0x4f87('0x67')]=function(_0x30fca2,_0xf82bad){var _0x291aa9=path[_0x4f87('0x68')](config['root'],_0x4f87('0x69'));var _0x5e7d48={'where':{'id':_0x30fca2[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x5e')],'raw':!![]};var _0x1b184a=![];return require(_0x4f87('0x6a'))[_0x4f87('0x6b')]()['then'](function(_0x52345a){if(_0x52345a){_0x1b184a=_0x52345a[_0x4f87('0x6c')];}})[_0x4f87('0x24')](function(){return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x5e7d48);})[_0x4f87('0x24')](handleEntityNotFound(_0xf82bad,null))[_0x4f87('0x24')](function(_0x3dd003){if(_0x3dd003){if(!_[_0x4f87('0x6d')](_0x3dd003[_0x4f87('0x5e')])){if(fs[_0x4f87('0x6e')](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],'server/files/images/logos/',_0x3dd003[_0x4f87('0x5e')]))&&_0x1b184a){_0x291aa9=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x70'),_0x3dd003['sitepic']);}}return _0xf82bad[_0x4f87('0x71')](_0x291aa9);}})[_0x4f87('0x43')](handleError(_0xf82bad,null));};exports[_0x4f87('0x72')]=function(_0x3a3865,_0x4da978){var _0x5137bd=path['join'](config['root'],_0x4f87('0x73'));var _0x2f178a={'where':{'id':_0x3a3865[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x62')],'raw':!![]};return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x2f178a)[_0x4f87('0x24')](handleEntityNotFound(_0x4da978,null))['then'](function(_0x1b01b1){if(_0x1b01b1){if(!_[_0x4f87('0x6d')](_0x1b01b1['agentAvatar'])){if(fs['existsSync'](path[_0x4f87('0x68')](config['root'],'server/files/images/avatars/',_0x1b01b1[_0x4f87('0x62')]))){_0x5137bd=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x1b01b1['agentAvatar']);}}return _0x4da978[_0x4f87('0x71')](_0x5137bd);}})[_0x4f87('0x43')](handleError(_0x4da978,null));};exports[_0x4f87('0x75')]=function(_0x1efa7c,_0x46274d){var _0x5ba9ae=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x76'));var _0x2593e1={'where':{'id':_0x1efa7c[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x64'),_0x4f87('0x77')],'raw':!![]};return db[_0x4f87('0x3e')][_0x4f87('0x48')](_0x2593e1)[_0x4f87('0x24')](handleEntityNotFound(_0x46274d,null))[_0x4f87('0x24')](function(_0x2fe1a7){if(_0x2fe1a7){if(!_[_0x4f87('0x6d')](_0x2fe1a7[_0x4f87('0x64')])){if(fs[_0x4f87('0x6e')](path['join'](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x2fe1a7[_0x4f87('0x64')]))&&_0x2fe1a7[_0x4f87('0x77')]){_0x5ba9ae=path['join'](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x2fe1a7[_0x4f87('0x64')]);}}return _0x46274d[_0x4f87('0x71')](_0x5ba9ae);}})[_0x4f87('0x43')](handleError(_0x46274d,null));};exports[_0x4f87('0x78')]=function(_0x90dca9,_0x38505f){var _0x509796=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x79'));var _0x238e91={'where':{'id':_0x90dca9[_0x4f87('0x45')]['id']},'attributes':['id',_0x4f87('0x66')],'raw':!![]};return db['ChatWebsite'][_0x4f87('0x48')](_0x238e91)[_0x4f87('0x24')](handleEntityNotFound(_0x38505f,null))[_0x4f87('0x24')](function(_0x4c78a5){if(_0x4c78a5){if(!_[_0x4f87('0x6d')](_0x4c78a5['systemAvatar'])){if(fs['existsSync'](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],'server/files/images/avatars/',_0x4c78a5[_0x4f87('0x66')]))){_0x509796=path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0x74'),_0x4c78a5[_0x4f87('0x66')]);}}return _0x38505f[_0x4f87('0x71')](_0x509796);}})[_0x4f87('0x43')](handleError(_0x38505f,null));};exports[_0x4f87('0x7a')]=function(_0x18b018,_0x178fa9){var _0x5bb7ff=require(_0x4f87('0x7b'));var _0x1a93f9=new _0x5bb7ff();var _0x362e17=_0x1a93f9[_0x4f87('0x7c')](_0x18b018['headers'][_0x4f87('0x7d')])['getResult']();var _0x1bb08d={'body':_0x18b018[_0x4f87('0x4a')],'channel':'chat'};var _0x1a1061=[];var _0x1ff904=[];var _0x3be33e={};var _0x466f1d=![];return db[_0x4f87('0x7e')][_0x4f87('0x52')]()[_0x4f87('0x24')](function(_0x5db2e5){if(!_0x5db2e5){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x81'));}_0x1a1061=_['difference'](_[_0x4f87('0x46')](_0x5db2e5),['createdAt',_0x4f87('0x82')]);_0x1ff904=_[_0x4f87('0x83')](_['keys'](_0x5db2e5),[_0x4f87('0x84'),_0x4f87('0x82'),_0x4f87('0x85'),_0x4f87('0x86')]);if(_0x18b018['body']['id']){delete _0x18b018['body']['id'];}if(_['isNil'](_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x88'));}if(_['isNil'](_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')])||_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')]===''){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x89'));}if(_[_0x4f87('0x6d')](_0x18b018['body']['mapKey'])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x8a')+_0x1ff904);}if(!_[_0x4f87('0x8b')](_0x1ff904,_0x18b018[_0x4f87('0x4a')][_0x4f87('0x8c')])){throw new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x8d')+_0x1ff904);}_0x3be33e[_0x18b018[_0x4f87('0x4a')][_0x4f87('0x8c')]]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')];})[_0x4f87('0x24')](function(){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x18b018[_0x4f87('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0x4f87('0x8e'),'include':[{'model':db['CmContact'],'as':_0x4f87('0x8f'),'where':_0x3be33e,'limit':0x1,'order':[[_0x4f87('0x82'),_0x4f87('0x90')]]}]},{'model':db[_0x4f87('0x91')],'as':'Applications'}]});})[_0x4f87('0x24')](handleEntityNotFound(_0x178fa9,null))[_0x4f87('0x24')](function(_0x5d26ad){if(_0x5d26ad&&_0x5d26ad[_0x4f87('0x8e')]){_0x1bb08d['account']=_0x5d26ad;_0x1bb08d[_0x4f87('0x92')]=_0x5d26ad[_0x4f87('0x93')];_0x1bb08d['list']=_0x5d26ad[_0x4f87('0x8e')];_0x1bb08d[_0x4f87('0x92')]=_[_0x4f87('0x94')](_0x1bb08d[_0x4f87('0x92')],['priority'],[_0x4f87('0x95')]);if(_0x1bb08d[_0x4f87('0x96')]['Applications']){delete _0x1bb08d[_0x4f87('0x96')][_0x4f87('0x93')];}if(_0x1bb08d['account'][_0x4f87('0x8e')]&&_0x1bb08d[_0x4f87('0x96')]['List'][_0x4f87('0x8f')][_0x4f87('0x35')]){return _0x1bb08d[_0x4f87('0x96')][_0x4f87('0x8e')][_0x4f87('0x8f')][0x0];}var _0xa84886=_['defaults'](_0x18b018['body'],{'firstName':_0x18b018[_0x4f87('0x4a')]['from'],'ListId':_0x5d26ad['ListId']});_0xa84886[_0x18b018[_0x4f87('0x4a')]['mapKey']]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x87')];return db[_0x4f87('0x7e')][_0x4f87('0x49')](_0xa84886,{'fields':_0x1a1061,'raw':!![]});}})['then'](handleEntityNotFound(_0x178fa9,null))[_0x4f87('0x24')](function(_0x16a89c){_0x1bb08d[_0x4f87('0x97')]=_0x16a89c;var _0x1685f6=_0x18b018[_0x4f87('0x4a')][_0x4f87('0x98')];if(_0x18b018[_0x4f87('0x99')][_0x4f87('0x9a')]){_0x1685f6=_0x18b018['headers'][_0x4f87('0x9a')];}else if(_0x18b018[_0x4f87('0x99')]['x-forwarded-for']){_0x1685f6=_[_0x4f87('0x9b')](_0x18b018[_0x4f87('0x99')][_0x4f87('0x9c')][_0x4f87('0x9d')](','));}if(_0x16a89c){var _0xa40668={'ContactId':_0x16a89c['id'],'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'from':(_0x16a89c[_0x4f87('0x9e')]||'')+'\x20'+(_0x16a89c[_0x4f87('0x9f')]||''),'customerIp':_0x1685f6,'customerPort':_0x18b018[_0x4f87('0x99')][_0x4f87('0xa0')]?_0x18b018[_0x4f87('0x99')][_0x4f87('0xa0')]:null,'referer':_0x18b018['body'][_0x4f87('0xa1')],'browserName':_0x362e17[_0x4f87('0xa2')][_0x4f87('0x29')]&&_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]?util['format']('%s\x20%s',_0x362e17['browser'][_0x4f87('0x29')],_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]):'unknown','browserVersion':_0x362e17[_0x4f87('0xa2')][_0x4f87('0xa3')]||_0x4f87('0xa4'),'osName':util[_0x4f87('0xa5')](_0x4f87('0xa6'),_0x362e17['os'][_0x4f87('0x29')],_0x362e17['os'][_0x4f87('0xa3')]),'osVersion':_0x362e17['os']['version'],'deviceModel':_0x362e17[_0x4f87('0xa7')]['model']&&_0x362e17[_0x4f87('0xa7')][_0x4f87('0xa8')]?util[_0x4f87('0xa5')](_0x4f87('0xa9'),_0x362e17[_0x4f87('0xa7')][_0x4f87('0x30')],_0x362e17['device']['vendor'],_0x362e17['device']['type']):null,'deviceVendor':_0x362e17['device']['vendor'],'deviceType':_0x362e17[_0x4f87('0xa7')][_0x4f87('0xaa')],'formData':JSON[_0x4f87('0x15')](_0x18b018[_0x4f87('0x4a')])};var _0x527ede={'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'closed':![]};if(_0x18b018[_0x4f87('0x4a')][_0x4f87('0xab')]){_0x527ede[_0x4f87('0xab')]=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xab')];return db[_0x4f87('0xac')]['find']({'where':_0x527ede})['then'](function(_0x5637f5){if(_0x5637f5){return[_0x5637f5,![]];}_0xa40668['threadId']=_0x18b018[_0x4f87('0x4a')]['threadId'];_0xa40668[_0x4f87('0xad')]=_0x18b018['body'][_0x4f87('0xad')];return db['ChatInteraction']['create'](_0xa40668)[_0x4f87('0x24')](function(_0x19b662){return[_0x19b662,!![]];});});}_0x527ede['ContactId']=_0x16a89c['id'];if(_0x18b018[_0x4f87('0x4a')]['interaction']&&_0x18b018[_0x4f87('0x4a')][_0x4f87('0xae')]['id']){_0x527ede['id']=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xae')]['id'];return db[_0x4f87('0xac')][_0x4f87('0x48')]({'where':_0x527ede})[_0x4f87('0x24')](function(_0xfe546c){if(_0xfe546c){return[_0xfe546c,![]];}return db[_0x4f87('0xac')][_0x4f87('0x49')](_0xa40668)[_0x4f87('0x24')](function(_0x43b201){return[_0x43b201,!![]];});});}return db[_0x4f87('0xac')][_0x4f87('0x49')](_0xa40668)[_0x4f87('0x24')](function(_0x439fc7){return[_0x439fc7,!![]];});}})['spread'](function(_0x1319f8,_0x306f69){if(_0x1319f8){_0x466f1d=_0x306f69;if(!_0x306f69){var _0x35baeb={'from':(_0x1bb08d[_0x4f87('0x97')][_0x4f87('0x9e')]||'')+'\x20'+(_0x1bb08d[_0x4f87('0x97')][_0x4f87('0x9f')]||'')};if(_0x18b018['body'][_0x4f87('0xab')]&&_0x18b018[_0x4f87('0x4a')][_0x4f87('0xaf')]&&_0x18b018['body'][_0x4f87('0xab')]!=_0x18b018[_0x4f87('0x4a')]['messageId']){_0x35baeb['threadId']=_0x18b018[_0x4f87('0x4a')][_0x4f87('0xaf')];}return _0x1319f8[_0x4f87('0x23')](_0x35baeb);}else{return _0x1319f8;}}})[_0x4f87('0x24')](function(_0x59aabb){_0x1bb08d[_0x4f87('0xae')]=_0x59aabb[_0x4f87('0x4b')]({'plain':!![]});_0x1bb08d[_0x4f87('0xae')]['created']=_0x466f1d;if(_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb0')]){if(_0x1bb08d[_0x4f87('0x96')]['autoclose']){_0x1bb08d[_0x4f87('0x92')][_0x4f87('0xb1')]({'id':0x0,'priority':_0x1bb08d[_0x4f87('0x92')][_0x4f87('0x35')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x4f87('0xb2')][_0x4f87('0x49')]({'body':_0x18b018[_0x4f87('0x4a')][_0x4f87('0x4a')],'ChatWebsiteId':_0x18b018[_0x4f87('0x45')]['id'],'ChatInteractionId':_0x59aabb['id'],'direction':'in','ContactId':_0x1bb08d[_0x4f87('0x97')]['id'],'AttachmentId':_0x18b018[_0x4f87('0x4a')][_0x4f87('0xb3')]});})[_0x4f87('0x24')](function(_0xf0c23c){_0x1bb08d['message']=_0xf0c23c;if(_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb4')]){return db[_0x4f87('0xb5')][_0x4f87('0x48')]({'attributes':['id','name'],'where':{'id':_0x1bb08d[_0x4f87('0xae')][_0x4f87('0xb4')]}})[_0x4f87('0x24')](function(_0x476ab1){if(_0x476ab1){_0x1bb08d[_0x4f87('0x92')][_0x4f87('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x476ab1[_0x4f87('0x29')]+','+(_0x1bb08d[_0x4f87('0x96')][_0x4f87('0xb7')]||0xa),'interval':_0x4f87('0xb8')});_0x1bb08d[_0x4f87('0xb9')]=!![];}return respondWithRpcPromise(_0x4f87('0xba'),'startRouting',_0x1bb08d);});}return respondWithRpcPromise('Start',_0x4f87('0xbb'),_0x1bb08d);})[_0x4f87('0x24')](function(_0x35e380){respondWithRpcPromise(_0x4f87('0xbc'),_0x4f87('0xbc'),{'event':'notify','message':_0x35e380},client9002);return _0x35e380;})[_0x4f87('0x24')](respondWithResult(_0x178fa9,null))['catch'](handleError(_0x178fa9,null));};exports[_0x4f87('0xbd')]=function(_0x34c94f,_0x520406){var _0x562ec8,_0x241873,_0x964e89;var _0x47c175=[];var _0x20fce4={};var _0x290074=_0x34c94f[_0x4f87('0xbe')]||[];var _0x4de4b5=[];var _0x5742c1;return db['CmContact'][_0x4f87('0x52')]()[_0x4f87('0x24')](function(_0x33aa12){if(!_0x33aa12){throw new db[(_0x4f87('0x7f'))]['ValidationError'](_0x4f87('0x81'));}_0x47c175=_['difference'](_[_0x4f87('0x46')](_0x33aa12),['createdAt',_0x4f87('0x82'),_0x4f87('0x85'),_0x4f87('0x86')]);if(_0x34c94f[_0x4f87('0x4a')]['id']){delete _0x34c94f[_0x4f87('0x4a')]['id'];}if(_[_0x4f87('0x6d')](_0x34c94f['body'][_0x4f87('0x87')])){throw _0x520406[_0x4f87('0x1b')](0x1f4)['send'](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0x88')));}if(_[_0x4f87('0x6d')](_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x4a')])||_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x4a')]===''){throw _0x520406[_0x4f87('0x1b')](0x1f4)[_0x4f87('0xbf')](new db['Sequelize'][(_0x4f87('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4f87('0x6d')](_0x34c94f[_0x4f87('0x4a')]['mapKeyOffline'])){throw _0x520406[_0x4f87('0x1b')](0x1f4)['send'](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0xc0')+_0x47c175));}if(!_[_0x4f87('0x8b')](_0x47c175,_0x34c94f[_0x4f87('0x4a')][_0x4f87('0xc1')])){throw _0x520406[_0x4f87('0x1b')](0x1f4)[_0x4f87('0xbf')](new db[(_0x4f87('0x7f'))][(_0x4f87('0x80'))](_0x4f87('0xc2')+_0x47c175));}_0x20fce4[_0x34c94f[_0x4f87('0x4a')]['mapKeyOffline']]=_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')];})[_0x4f87('0x24')](function(){return db['ChatWebsite'][_0x4f87('0x48')]({'where':{'id':_0x34c94f[_0x4f87('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0x4f87('0x8e')},{'model':db[_0x4f87('0xc3')],'as':_0x4f87('0xc3')}]});})[_0x4f87('0x24')](handleEntityNotFound(_0x520406,null))['then'](function(_0x14d3e5){if(_0x14d3e5&&_0x14d3e5[_0x4f87('0x8e')]){_0x241873=_0x14d3e5;var _0x3064a9=_['defaults'](_0x34c94f[_0x4f87('0x4a')],{'firstName':_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')],'phone':_0x34c94f['body'][_0x4f87('0x87')],'ListId':_0x14d3e5[_0x4f87('0x86')]});_0x3064a9[_0x34c94f[_0x4f87('0x4a')][_0x4f87('0xc1')]]=_0x34c94f[_0x4f87('0x4a')][_0x4f87('0x87')];return db[_0x4f87('0x7e')][_0x4f87('0xc4')]({'where':_0x20fce4,'defaults':_0x3064a9});}})[_0x4f87('0xc5')](function(_0x12949b){if(_0x12949b){_0x964e89=_0x12949b;var _0x3dc252=fs[_0x4f87('0xc6')](path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0xc7')),'utf8');var _0x389a97=ejs[_0x4f87('0xc8')](_0x3dc252,{'body':_['toPairs'](_0x34c94f['body'][_0x4f87('0x4a')]),'bodyTitle':_0x241873[_0x4f87('0xc9')]});return db[_0x4f87('0xca')]['create']({'body':_0x389a97,'ContactId':_0x12949b['id'],'ChatWebsiteId':_0x241873['id']});}})[_0x4f87('0x24')](function(_0x4583b9){_0x5742c1=_0x4583b9;if(_0x290074[_0x4f87('0x35')]){var _0x845e7=_0x290074['map'](function(_0x1d22b4){return{'name':_0x1d22b4[_0x4f87('0xcb')],'basename':_0x1d22b4[_0x4f87('0x60')],'type':_0x1d22b4['mimetype'],'ChatOfflineMessageId':_0x4583b9['id']};});_0x4de4b5=_0x845e7[_0x4f87('0x2d')](_0x19a017=>{var _0x4c8200={'filename':_0x19a017[_0x4f87('0x29')],'path':path[_0x4f87('0x68')](config[_0x4f87('0x6f')],_0x4f87('0xcc'),_0x4f87('0xbe'),_0x4f87('0xcd'),'offline-chat',_0x19a017[_0x4f87('0xce')])};return _0x4c8200;});if(!_0x241873[_0x4f87('0xcf')]){return db[_0x4f87('0xd0')][_0x4f87('0xd1')](function(_0x18bf00){return db[_0x4f87('0xd2')]['bulkCreate'](_0x845e7,{'transaction':_0x18bf00});});}}})['then'](function(){if(_0x5742c1){_0x562ec8=_0x5742c1;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x4f87('0x24')](function(_0xb69fde){if(_0xb69fde&&_0xb69fde[_0x4f87('0xd3')]&&_0x241873[_0x4f87('0xd4')]&&_0x241873[_0x4f87('0xd5')]){var _0x207431={'tls':{'rejectUnauthorized':![]}};if(_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd6')]){_0x207431[_0x4f87('0xd6')]=_0xb69fde[_0x4f87('0xd3')]['service'];}else{_0x207431[_0x4f87('0xd7')]=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd7')];_0x207431['port']=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd8')];_0x207431['secure']=_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xd9')];}if(_0xb69fde[_0x4f87('0xd3')]['authentication']){_0x207431[_0x4f87('0xda')]={'user':_0xb69fde[_0x4f87('0xd3')][_0x4f87('0x4e')],'pass':_0xb69fde[_0x4f87('0xd3')][_0x4f87('0xdb')]};}return respondWithRpcPromise('SendMail',_0x4f87('0xdc'),{'account':_0x207431,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xb69fde[_0x4f87('0x29')],_0xb69fde['email']||_0xb69fde['Smtp']['user']),'to':_0x241873['forwardOfflineAddress'],'subject':_0x241873['offlineMessageSubject'],'html':_0x562ec8[_0x4f87('0x4a')],'attachments':_0x4de4b5}},client9003)['then'](function(){return _0x562ec8;})[_0x4f87('0x43')](function(_0x4d92c0){console[_0x4f87('0x16')](_0x4d92c0);});}})['then'](function(){if(_0x241873&&_0x241873['openNewInteraction']&&_0x241873[_0x4f87('0xdd')]){var _0x1ea453=[];if(_0x290074['length']){_0x1ea453=_0x290074[_0x4f87('0x2d')](function(_0x2c2077){return{'name':_0x2c2077[_0x4f87('0xcb')],'basename':_0x2c2077[_0x4f87('0x60')],'type':_0x2c2077[_0x4f87('0xde')],'ChatOfflineMessageId':_0x5742c1['id']};});}var _0xb6217b;if(!_['isNil'](_0x241873[_0x4f87('0xdf')])){var _0x398acb=_[_0x4f87('0x2d')](_0x34c94f[_0x4f87('0x4a')],function(_0x24cf30){return _0x24cf30;});var _0x16d3f2=_[_0x4f87('0xe0')](_0x398acb)[0x0];var _0x63e061=_[_0x4f87('0xe1')](_0x16d3f2,function(_0x1d0838){return _0x1d0838;});_0xb6217b=_0x63e061[0x1][_0x241873[_0x4f87('0xdf')]];}var _0x487008={'from':_0x964e89[_0x4f87('0xe2')],'firstName':_0x964e89[_0x4f87('0x9e')],'lastName':_0x964e89[_0x4f87('0x9f')],'mapKey':_0x4f87('0xe2'),'message':{'from':_0x964e89[_0x4f87('0xe2')],'to':_0x241873['MailAccount'][_0x4f87('0xe2')],'cc':'','subject':_['isNil'](_0xb6217b)?_0x241873[_0x4f87('0xe3')]:_0xb6217b,'messageId':'','sentAt':new Date(),'attach':_0x1ea453[_0x4f87('0x35')],'attachments':_0x1ea453,'originChannel':_0x4f87('0xe4'),'ChatWebsiteId':_0x241873['id'],'ChatOfflineMessageId':_0x562ec8['id'],'originTo':_0x241873['MailAccount'][_0x4f87('0xe2')]},'body':_0x562ec8[_0x4f87('0x4a')]};var _0x55a909={'account':{'id':_0x241873['MailAccountId']},'body':_0x487008,'log':_0x4f87('0xe5')};return respondWithRpcPromise(_0x4f87('0xe5'),_0x4f87('0xe6'),_0x55a909,client9001)[_0x4f87('0x24')](function(){return _0x562ec8;})['catch'](function(_0x3e53fc){console[_0x4f87('0x16')](_0x3e53fc);});}return;})[_0x4f87('0x24')](function(){if(_0x562ec8){return _0x562ec8;}})[_0x4f87('0x24')](respondWithResult(_0x520406,null))['catch'](function(_0x128225){console[_0x4f87('0x16')](_0x4f87('0x43'),_0x128225);for(var _0x2adf07 of _0x290074){var _0x4a7620=path[_0x4f87('0x68')](config['root'],_0x4f87('0xcc'),'files','attachments','offline-chat',_0x2adf07[_0x4f87('0x60')]);fs_extra[_0x4f87('0xe7')](_0x4a7620)[_0x4f87('0x43')](function(_0x23f6e2){console[_0x4f87('0x16')](_0x4f87('0xe8'),_0x4a7620,_0x23f6e2);});}});};exports[_0x4f87('0xe9')]=function(_0x1b75e5,_0x1b3977){return db[_0x4f87('0xac')][_0x4f87('0x48')]({'where':{'id':_0x1b75e5[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x1b3977,null))['then'](function(_0x409b08){if(_0x409b08){return _0x409b08['addInteraction'](_0x1b75e5[_0x4f87('0x4a')]['ids'],_[_0x4f87('0xea')](_0x1b75e5[_0x4f87('0x4a')],['ids','id'])||{});}})[_0x4f87('0x24')](respondWithResult(_0x1b3977,null))[_0x4f87('0x43')](handleError(_0x1b3977,null));};exports[_0x4f87('0xeb')]=function(_0x147bc9,_0x56de83){var _0x2d9fc7={'raw':![],'where':{}};var _0x87d5c={};var _0x541c73={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4f87('0x56')]({'where':{'id':_0x147bc9[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x56de83,null))[_0x4f87('0x24')](function(_0xf46968){if(_0xf46968){_0x87d5c[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0xac')][_0x4f87('0x47')]);_0x87d5c[_0x4f87('0x34')]=_['keys'](_0x147bc9[_0x4f87('0x34')]);_0x87d5c['filters']=_[_0x4f87('0x31')](_0x87d5c['model'],_0x87d5c[_0x4f87('0x34')]);_0x2d9fc7[_0x4f87('0x32')]=_['intersection'](_0x87d5c['model'],qs['fields'](_0x147bc9[_0x4f87('0x34')][_0x4f87('0x33')]));_0x2d9fc7[_0x4f87('0x32')]=_0x2d9fc7['attributes'][_0x4f87('0x35')]?_0x2d9fc7[_0x4f87('0x32')]:_0x87d5c[_0x4f87('0x30')];if(!_0x147bc9['query']['hasOwnProperty'](_0x4f87('0xec'))){_0x2d9fc7[_0x4f87('0x1f')]=qs['limit'](_0x147bc9[_0x4f87('0x34')]['limit']);_0x2d9fc7['offset']=qs['offset'](_0x147bc9['query'][_0x4f87('0x21')]);}_0x2d9fc7[_0x4f87('0x37')]=qs[_0x4f87('0x38')](_0x147bc9[_0x4f87('0x34')][_0x4f87('0x38')]);_0x2d9fc7[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_[_0x4f87('0x5b')](_0x147bc9['query'],_0x87d5c['filters']));_0x2d9fc7[_0x4f87('0x39')][_0x4f87('0x53')]=_0xf46968['id'];if(_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x2d9fc7[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x2d9fc7[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x2d9fc7['attributes'],function(_0x4da842){var _0x43bc7e={};_0x43bc7e[_0x4da842]={'$like':'%'+_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x43bc7e;})});}_0x2d9fc7=_[_0x4f87('0x3c')]({},_0x2d9fc7,_0x147bc9[_0x4f87('0x3d')]);return db[_0x4f87('0xac')][_0x4f87('0x20')]({'where':_0x2d9fc7['where']})[_0x4f87('0x24')](function(_0x42e8c9){_0x541c73[_0x4f87('0x20')]=_0x42e8c9;if(_0x147bc9[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x2d9fc7[_0x4f87('0x40')]=[{'model':db[_0x4f87('0x7e')],'as':'Contact','required':![]},{'model':db[_0x4f87('0xb5')],'as':_0x4f87('0xed'),'attributes':[_0x4f87('0x29'),'fullname',_0x4f87('0xee')],'required':![]},{'model':db[_0x4f87('0xef')],'as':_0x4f87('0xf0'),'attributes':['id',_0x4f87('0x29'),'color'],'where':_0x147bc9[_0x4f87('0x34')][_0x4f87('0xf1')]?{'id':_0x147bc9['query']['tag']}:undefined,'required':_0x147bc9[_0x4f87('0x34')][_0x4f87('0xf1')]?!![]:![]}];}return db[_0x4f87('0xac')][_0x4f87('0x41')](_0x2d9fc7);})[_0x4f87('0x24')](function(_0x1c5bdc){_0x541c73[_0x4f87('0x42')]=_0x1c5bdc;return _0x541c73;});}})[_0x4f87('0x24')](respondWithFilteredResult(_0x56de83,_0x2d9fc7))[_0x4f87('0x43')](handleError(_0x56de83,null));};function iftimePromise(_0x40158f,_0x5015f7){return respondWithRpcPromise(_0x4f87('0xf2'),_0x4f87('0xf3'),{'command':_0x5015f7[_0x4f87('0xf4')]?util[_0x4f87('0xa5')](_0x4f87('0xf5'),_0x40158f[_0x4f87('0xf6')],_0x5015f7[_0x4f87('0xf4')]):util['format'](_0x4f87('0xf7'),_0x40158f[_0x4f87('0xf6')])},client9002)[_0x4f87('0x24')](function(_0xd3ab28){var _0x5a0fa1=_0xd3ab28&&_0xd3ab28[_0x4f87('0xf8')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5015f7['id'],_0x40158f['id'],_0x40158f[_0x4f87('0xf6')],_0x5a0fa1?_0x4f87('0xf9'):'OFFLINE',_0x5015f7[_0x4f87('0xf4')]?_0x5015f7[_0x4f87('0xf4')]:_0x4f87('0xfa'));return _0x5a0fa1;})[_0x4f87('0x43')](function(_0x54a2f4){logger[_0x4f87('0x16')](_0x4f87('0xfb'),_0x5015f7['id'],_0x40158f['id'],_0x40158f[_0x4f87('0xf6')],util[_0x4f87('0xfc')](_0x54a2f4,{'showHidden':![],'depth':null}),_0x5015f7['timezone']?_0x5015f7[_0x4f87('0xf4')]:_0x4f87('0xfa'));return![];});}exports[_0x4f87('0xf3')]=function(_0x1a8752,_0x1b479d){var _0x549396=0x0;var _0x36a416=0x0;var _0x382a9e=![];var _0x2c6b8a;var _0x4e4b38;return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1a8752[_0x4f87('0x45')]['id']},'include':[{'model':db['Interval'],'as':_0x4f87('0xfd'),'include':[{'model':db[_0x4f87('0xfd')],'as':_0x4f87('0xfe'),'attributes':['id',_0x4f87('0xf6')],'raw':!![]}]}]})[_0x4f87('0x24')](handleEntityNotFound(_0x1b479d,null))[_0x4f87('0x24')](function(_0x1ff285){if(_0x1ff285){_0x2c6b8a=_0x1ff285;return _0x1ff285[_0x4f87('0xff')]({'raw':!![]});}})[_0x4f87('0x24')](function(_0x5a8165){if(_0x2c6b8a){if(_0x5a8165){_0x4e4b38=_0x5a8165;}}return require(_0x4f87('0x6a'))[_0x4f87('0x6b')]();})[_0x4f87('0x24')](function(_0x40bdf8){if(_0x40bdf8){_0x36a416=_0x40bdf8['virtual'];_0x382a9e=_0x40bdf8['custom'];}})['then'](function(){return db[_0x4f87('0xac')]['count']({'where':{'closed':![]}});})[_0x4f87('0x24')](function(_0x38bfe0){_0x549396=_0x38bfe0;if(_0x36a416&&_0x38bfe0>_0x36a416){return db[_0x4f87('0x100')][_0x4f87('0x56')]({'where':{'id':0x1}})[_0x4f87('0x24')](function(_0x40f578){if(_0x40f578){_0x40f578['increment']('chatLicenseExceeded');}});}})[_0x4f87('0x24')](function(){if(_0x2c6b8a[_0x4f87('0xfd')]&&_0x2c6b8a[_0x4f87('0xfd')][_0x4f87('0xfe')]){var _0x5add89=[];for(var _0x9e06d4=0x0;_0x9e06d4<_0x2c6b8a[_0x4f87('0xfd')][_0x4f87('0xfe')]['length'];_0x9e06d4++){var _0x62646a=_0x2c6b8a['Interval'][_0x4f87('0xfe')][_0x9e06d4][_0x4f87('0x4b')]({'plain':!![]});_0x5add89[_0x4f87('0xb1')](iftimePromise(_0x62646a,_0x2c6b8a));}return BPromise[_0x4f87('0x101')](_0x5add89)[_0x4f87('0x24')](function(_0x4a74e3){return _['some'](_0x4a74e3);});}else{return!![];}})[_0x4f87('0x24')](function(_0x10f7ee){var _0x1e6b03=fs[_0x4f87('0xc6')](path[_0x4f87('0x68')](config['root'],_0x4f87('0x102')),_0x4f87('0x103'));var _0x2bd875={'remote':_0x2c6b8a['remote'],'query':querystring[_0x4f87('0x15')](_[_0x4f87('0x3c')](_0x2c6b8a[_0x4f87('0x4b')]({'plain':!![]}),{'customerIp':_0x1a8752[_0x4f87('0x99')][_0x4f87('0x9c')]||_0x1a8752[_0x4f87('0x99')][_0x4f87('0x104')]||_0x1a8752[_0x4f87('0x105')][_0x4f87('0x106')]||_0x1a8752['ip'],'referer':_0x1a8752[_0x4f87('0x99')][_0x4f87('0xa1')],'openedInteractions':_0x549396,'maxInteractions':_0x36a416,'virtual':_0x382a9e[_0x4f87('0x107')],'online':_0x10f7ee,'custom':_0x382a9e}))[_0x4f87('0x108')](/'/g,'\x5c\x27')};_0x1b479d['send'](ejs['render'](Mustache[_0x4f87('0xc8')](_0x1e6b03,_0x2bd875),{'proactiveActions':_0x4e4b38,'alignment':_0x2c6b8a['alignment'],'verticalAlignment':_0x2c6b8a[_0x4f87('0x109')],'div_color':_0x2c6b8a[_0x4f87('0x10a')],'labelText':_0x2c6b8a[_0x4f87('0x10b')],'text_color':_0x2c6b8a[_0x4f87('0x10c')],'button_color':_0x2c6b8a[_0x4f87('0x10d')],'background_color':_0x2c6b8a[_0x4f87('0x10e')]}));})[_0x4f87('0x43')](handleError(_0x1b479d,null));};exports[_0x4f87('0x10f')]=function(_0x3cc692,_0x26d04a){var _0x32d95b=_0x3cc692['params']['id'];var _0x34ab80=_0x3cc692['body'];var _0x406938=0xc8;var _0x458bc6=null;return db[_0x4f87('0xd0')][_0x4f87('0xd1')]({'isolationLevel':db['sequelize']['Transaction'][_0x4f87('0x110')][_0x4f87('0x111')]},function(_0x33f66c){return db[_0x4f87('0x3e')]['findOne']({'where':{'id':_0x32d95b},'transaction':_0x33f66c})['then'](function(_0xebae92){if(_0xebae92){return db[_0x4f87('0x91')][_0x4f87('0x25')]({'where':{'ChatWebsiteId':_0x32d95b},'transaction':_0x33f66c})[_0x4f87('0x24')](function(){var _0x26f10c=_[_0x4f87('0x2d')](_0x34ab80,function(_0x3ae17b){_0x3ae17b['ChatWebsiteId']=_0x32d95b;return _0x3ae17b;});return db[_0x4f87('0x91')]['bulkCreate'](_0x26f10c,{'transaction':_0x33f66c});});}else{_0x406938=0x194;_0x458bc6=[];}});})['then'](function(){if(_0x406938!==0x194){return db[_0x4f87('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x32d95b},'order':_0x4f87('0x112')})[_0x4f87('0x24')](function(_0x26f0ab){_0x458bc6=_0x26f0ab;});}})[_0x4f87('0x43')](function(_0x406137){_0x406938=0x1f4;logger[_0x4f87('0x16')](_0x406137[_0x4f87('0x113')]);if(_0x406137[_0x4f87('0x29')]){delete _0x406137[_0x4f87('0x29')];}_0x458bc6=_0x406137;})[_0x4f87('0x114')](function(){if(_0x458bc6===null){_0x26d04a[_0x4f87('0x28')](_0x406938);}else{if(_0x406938===0x1f4){_0x26d04a['status'](_0x406938)['send'](_0x458bc6);}else{_0x26d04a['status'](_0x406938)[_0x4f87('0x1d')](_0x458bc6);}}});};exports['getApplications']=function(_0x248d5f,_0x57cafc){var _0x310a04={};var _0x279913={};var _0xb3d7ef;var _0x2095c1;return db['ChatWebsite'][_0x4f87('0x56')]({'where':{'id':_0x248d5f[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x57cafc,null))['then'](function(_0x1ece40){if(_0x1ece40){_0xb3d7ef=_0x1ece40;_0x279913[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x91')]['rawAttributes']);_0x279913[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x248d5f[_0x4f87('0x34')]);_0x279913['filters']=_[_0x4f87('0x31')](_0x279913[_0x4f87('0x30')],_0x279913[_0x4f87('0x34')]);_0x310a04[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x279913['model'],qs[_0x4f87('0x33')](_0x248d5f[_0x4f87('0x34')][_0x4f87('0x33')]));_0x310a04[_0x4f87('0x32')]=_0x310a04['attributes']['length']?_0x310a04[_0x4f87('0x32')]:_0x279913[_0x4f87('0x30')];_0x310a04[_0x4f87('0x37')]=qs[_0x4f87('0x38')](_0x248d5f[_0x4f87('0x34')][_0x4f87('0x38')]);_0x310a04['where']=qs['filters'](_[_0x4f87('0x5b')](_0x248d5f['query'],_0x279913[_0x4f87('0x3a')]));if(_0x248d5f[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x310a04[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x310a04[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x310a04[_0x4f87('0x32')],function(_0x2a3d3d){var _0x25e468={};_0x25e468[_0x2a3d3d]={'$like':'%'+_0x248d5f['query'][_0x4f87('0x3b')]+'%'};return _0x25e468;})});}_0x310a04=_['merge']({},_0x310a04,_0x248d5f['options']);return _0xb3d7ef['getApplications'](_0x310a04);}})[_0x4f87('0x24')](function(_0x2a29c3){if(_0x2a29c3){_0x2095c1=_0x2a29c3[_0x4f87('0x35')];if(!_0x248d5f[_0x4f87('0x34')][_0x4f87('0x36')](_0x4f87('0xec'))){_0x310a04[_0x4f87('0x1f')]=qs[_0x4f87('0x1f')](_0x248d5f[_0x4f87('0x34')]['limit']);_0x310a04[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x248d5f['query'][_0x4f87('0x21')]);}return _0xb3d7ef[_0x4f87('0x115')](_0x310a04);}})[_0x4f87('0x24')](function(_0x5a10df){if(_0x5a10df){return _0x5a10df?{'count':_0x2095c1,'rows':_0x5a10df}:null;}})['then'](respondWithResult(_0x57cafc,null))[_0x4f87('0x43')](handleError(_0x57cafc,null));};exports['addProactiveActions']=function(_0x905302,_0x319eab){return db[_0x4f87('0x116')]['find']({'where':{'id':_0x905302[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x319eab,null))['then'](function(_0x264f9b){if(_0x264f9b){return _0x264f9b['addProactiveActions'](_0x905302[_0x4f87('0x4a')][_0x4f87('0x5c')],_[_0x4f87('0xea')](_0x905302[_0x4f87('0x4a')],[_0x4f87('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x319eab,null))['catch'](handleError(_0x319eab,null));};exports[_0x4f87('0xff')]=function(_0x850f22,_0x183a8c){var _0x3e6437={};var _0x23c19b={};var _0x20cfd2;var _0x482a83;return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x850f22[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x183a8c,null))[_0x4f87('0x24')](function(_0x1b4668){if(_0x1b4668){_0x20cfd2=_0x1b4668;_0x23c19b[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0x117')]['rawAttributes']);_0x23c19b[_0x4f87('0x34')]=_['keys'](_0x850f22['query']);_0x23c19b['filters']=_[_0x4f87('0x31')](_0x23c19b['model'],_0x23c19b[_0x4f87('0x34')]);_0x3e6437[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x23c19b[_0x4f87('0x30')],qs['fields'](_0x850f22[_0x4f87('0x34')][_0x4f87('0x33')]));_0x3e6437[_0x4f87('0x32')]=_0x3e6437[_0x4f87('0x32')]['length']?_0x3e6437[_0x4f87('0x32')]:_0x23c19b[_0x4f87('0x30')];_0x3e6437[_0x4f87('0x37')]=qs['sort'](_0x850f22['query'][_0x4f87('0x38')]);_0x3e6437[_0x4f87('0x39')]=qs[_0x4f87('0x3a')](_[_0x4f87('0x5b')](_0x850f22[_0x4f87('0x34')],_0x23c19b['filters']));if(_0x850f22[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x3e6437[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x3e6437[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x3e6437[_0x4f87('0x32')],function(_0x5a4d19){var _0x38521b={};_0x38521b[_0x5a4d19]={'$like':'%'+_0x850f22[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x38521b;})});}_0x3e6437=_[_0x4f87('0x3c')]({},_0x3e6437,_0x850f22[_0x4f87('0x3d')]);return _0x20cfd2['getProactiveActions'](_0x3e6437);}})[_0x4f87('0x24')](function(_0x365056){if(_0x365056){_0x482a83=_0x365056[_0x4f87('0x35')];if(!_0x850f22[_0x4f87('0x34')][_0x4f87('0x36')](_0x4f87('0xec'))){_0x3e6437['limit']=qs[_0x4f87('0x1f')](_0x850f22['query'][_0x4f87('0x1f')]);_0x3e6437[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x850f22[_0x4f87('0x34')][_0x4f87('0x21')]);}return _0x20cfd2[_0x4f87('0xff')](_0x3e6437);}})['then'](function(_0x34ab19){if(_0x34ab19){return _0x34ab19?{'count':_0x482a83,'rows':_0x34ab19}:null;}})[_0x4f87('0x24')](respondWithResult(_0x183a8c,null))[_0x4f87('0x43')](handleError(_0x183a8c,null));};exports['getFields']=function(_0x3f38ca,_0x14757c){var _0x925473=_0x3f38ca[_0x4f87('0x34')][_0x4f87('0x118')]===_0x4f87('0x119')?_0x4f87('0x11a'):_0x4f87('0x11b');return db[_0x4f87('0x3e')]['find']({'attributes':['id',_0x925473],'where':{'id':_0x3f38ca[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x14757c,null))['then'](function(_0x3ab47d){if(_0x3ab47d){var _0x481c97=_0x3ab47d[_0x925473];var _0x22b34d=_0x481c97&&_0x481c97[_0x4f87('0x11c')]?_0x481c97[_0x4f87('0x11c')]:[];_0x14757c['send']({'fromKey':_[_0x4f87('0x6d')](_0x481c97['fromKey'])?undefined:_0x481c97[_0x4f87('0x11d')],'count':_0x22b34d[_0x4f87('0x35')],'rows':_0x22b34d});}})['catch'](handleError(_0x14757c,null));};exports['getOfflineMessages']=function(_0x27d6ec,_0x1e1b5d){var _0x884e73={'raw':![],'where':{}};var _0x190b94={};var _0x32879a={'count':0x0,'rows':[]};return db[_0x4f87('0x3e')][_0x4f87('0x56')]({'where':{'id':_0x27d6ec[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x1e1b5d,null))[_0x4f87('0x24')](function(_0x107b30){if(_0x107b30){_0x190b94['model']=_[_0x4f87('0x46')](db[_0x4f87('0xca')][_0x4f87('0x47')]);_0x190b94[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x27d6ec[_0x4f87('0x34')]);_0x190b94[_0x4f87('0x3a')]=_['intersection'](_0x190b94[_0x4f87('0x30')],_0x190b94['query']);_0x884e73[_0x4f87('0x32')]=_[_0x4f87('0x31')](_0x190b94[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x33')]));_0x884e73[_0x4f87('0x32')]=_0x884e73[_0x4f87('0x32')][_0x4f87('0x35')]?_0x884e73['attributes']:_0x190b94[_0x4f87('0x30')];if(!_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x36')]('nolimit')){_0x884e73[_0x4f87('0x1f')]=qs['limit'](_0x27d6ec[_0x4f87('0x34')]['limit']);_0x884e73[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x27d6ec['query']['offset']);}_0x884e73[_0x4f87('0x37')]=qs['sort'](_0x27d6ec['query'][_0x4f87('0x38')]);_0x884e73[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x27d6ec['query'],_0x190b94['filters']));_0x884e73[_0x4f87('0x39')]['ChatWebsiteId']=_0x107b30['id'];if(_0x27d6ec['query']['filter']){_0x884e73[_0x4f87('0x39')]=_['merge'](_0x884e73['where'],{'$or':_[_0x4f87('0x2d')](_0x884e73[_0x4f87('0x32')],function(_0x5ba688){var _0x4859da={};_0x4859da[_0x5ba688]={'$like':'%'+_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x4859da;})});}_0x884e73=_[_0x4f87('0x3c')]({},_0x884e73,_0x27d6ec[_0x4f87('0x3d')]);return db[_0x4f87('0xca')][_0x4f87('0x20')]({'where':_0x884e73[_0x4f87('0x39')]})[_0x4f87('0x24')](function(_0x58bb3d){_0x32879a[_0x4f87('0x20')]=_0x58bb3d;if(_0x27d6ec[_0x4f87('0x34')][_0x4f87('0x3f')]){_0x884e73[_0x4f87('0x40')]=[{'all':!![]}];}else{_0x884e73['include']=[{'model':db['CmContact'],'as':_0x4f87('0x11e'),'required':![]},{'model':db[_0x4f87('0xd2')],'as':_0x4f87('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0x4f87('0x41')](_0x884e73);})[_0x4f87('0x24')](function(_0x4e7fc7){_0x32879a[_0x4f87('0x42')]=_0x4e7fc7;return _0x32879a;});}})['then'](respondWithFilteredResult(_0x1e1b5d,_0x884e73))[_0x4f87('0x43')](handleError(_0x1e1b5d,null));};exports['addAgents']=function(_0x1df1c6,_0x85f22a){return db[_0x4f87('0x3e')][_0x4f87('0x48')]({'where':{'id':_0x1df1c6[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x85f22a,null))[_0x4f87('0x24')](function(_0x9897a1){if(_0x9897a1){return _0x9897a1['addAgents'](_0x1df1c6[_0x4f87('0x4a')][_0x4f87('0x5c')],_['omit'](_0x1df1c6[_0x4f87('0x4a')],[_0x4f87('0x5c'),'id'])||{})[_0x4f87('0xc5')](function(_0x2dba45){for(var _0x39da50=0x0;_0x39da50<_0x1df1c6['body'][_0x4f87('0x5c')][_0x4f87('0x35')];_0x39da50+=0x1){socket[_0x4f87('0x120')](_0x4f87('0x121'),{'UserId':Number(_0x1df1c6[_0x4f87('0x4a')][_0x4f87('0x5c')][_0x39da50]),'ChatWebsiteId':Number(_0x1df1c6[_0x4f87('0x45')]['id'])});}return _0x2dba45;});}})['then'](respondWithResult(_0x85f22a,null))[_0x4f87('0x43')](handleError(_0x85f22a,null));};exports['removeAgents']=function(_0x48b2a3,_0x779ec2){return db[_0x4f87('0x3e')]['find']({'where':{'id':_0x48b2a3[_0x4f87('0x45')]['id']}})['then'](handleEntityNotFound(_0x779ec2,null))[_0x4f87('0x24')](function(_0x332e7c){if(_0x332e7c){return _0x332e7c[_0x4f87('0x122')](_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')])[_0x4f87('0x24')](function(){if(_[_0x4f87('0x123')](_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')])){for(var _0x43cb75=0x0;_0x43cb75<_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')][_0x4f87('0x35')];_0x43cb75+=0x1){socket[_0x4f87('0x120')](_0x4f87('0x124'),{'UserId':Number(_0x48b2a3[_0x4f87('0x34')][_0x4f87('0x5c')][_0x43cb75]),'ChatWebsiteId':Number(_0x48b2a3[_0x4f87('0x45')]['id'])});}}else{socket[_0x4f87('0x120')](_0x4f87('0x124'),{'UserId':Number(_0x48b2a3['query']['ids']),'ChatWebsiteId':Number(_0x48b2a3[_0x4f87('0x45')]['id'])});}});}})[_0x4f87('0x24')](respondWithStatusCode(_0x779ec2,null))[_0x4f87('0x43')](handleError(_0x779ec2,null));};exports['getAgents']=function(_0x12dea3,_0x451c9e){var _0x4a4df5={};var _0xa64e84={};var _0x5924c5;var _0x5f0eb1;return db[_0x4f87('0x3e')]['findOne']({'where':{'id':_0x12dea3[_0x4f87('0x45')]['id']}})[_0x4f87('0x24')](handleEntityNotFound(_0x451c9e,null))[_0x4f87('0x24')](function(_0x528a6f){if(_0x528a6f){_0x5924c5=_0x528a6f;_0xa64e84[_0x4f87('0x30')]=_[_0x4f87('0x46')](db[_0x4f87('0xb5')][_0x4f87('0x47')]);_0xa64e84[_0x4f87('0x34')]=_[_0x4f87('0x46')](_0x12dea3[_0x4f87('0x34')]);_0xa64e84[_0x4f87('0x3a')]=_[_0x4f87('0x31')](_0xa64e84[_0x4f87('0x30')],_0xa64e84['query']);_0x4a4df5[_0x4f87('0x32')]=_['intersection'](_0xa64e84[_0x4f87('0x30')],qs[_0x4f87('0x33')](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x33')]));_0x4a4df5[_0x4f87('0x32')]=_0x4a4df5[_0x4f87('0x32')]['length']?_0x4a4df5[_0x4f87('0x32')]:_0xa64e84[_0x4f87('0x30')];_0x4a4df5['order']=qs[_0x4f87('0x38')](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x38')]);_0x4a4df5[_0x4f87('0x39')]=qs['filters'](_[_0x4f87('0x5b')](_0x12dea3[_0x4f87('0x34')],_0xa64e84[_0x4f87('0x3a')]));if(_0x12dea3[_0x4f87('0x34')][_0x4f87('0x3b')]){_0x4a4df5[_0x4f87('0x39')]=_[_0x4f87('0x3c')](_0x4a4df5[_0x4f87('0x39')],{'$or':_[_0x4f87('0x2d')](_0x4a4df5[_0x4f87('0x32')],function(_0x9356bf){var _0x3fb5b6={};_0x3fb5b6[_0x9356bf]={'$like':'%'+_0x12dea3[_0x4f87('0x34')][_0x4f87('0x3b')]+'%'};return _0x3fb5b6;})});}_0x4a4df5=_[_0x4f87('0x3c')]({},_0x4a4df5,_0x12dea3[_0x4f87('0x3d')]);return _0x5924c5[_0x4f87('0x125')](_0x4a4df5);}})[_0x4f87('0x24')](function(_0x2255a1){if(_0x2255a1){_0x5f0eb1=_0x2255a1[_0x4f87('0x35')];if(!_0x12dea3[_0x4f87('0x34')]['hasOwnProperty'](_0x4f87('0xec'))){_0x4a4df5['limit']=qs['limit'](_0x12dea3[_0x4f87('0x34')][_0x4f87('0x1f')]);_0x4a4df5[_0x4f87('0x21')]=qs[_0x4f87('0x21')](_0x12dea3['query'][_0x4f87('0x21')]);}return _0x5924c5['getAgents'](_0x4a4df5);}})['then'](function(_0x49169c){if(_0x49169c){return _0x49169c?{'count':_0x5f0eb1,'rows':_0x49169c}:null;}})[_0x4f87('0x24')](respondWithResult(_0x451c9e,null))[_0x4f87('0x43')](handleError(_0x451c9e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 41c1a3a..f25068a 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 _0x1cc7=['emit','hook','exports','events','../../mysqldb','ChatWebsite','remove'];(function(_0x142210,_0x47a448){var _0x27c4b1=function(_0x561d67){while(--_0x561d67){_0x142210['push'](_0x142210['shift']());}};_0x27c4b1(++_0x47a448);}(_0x1cc7,0x15a));var _0x71cc=function(_0x303c7e,_0x619dd1){_0x303c7e=_0x303c7e-0x0;var _0x3b0e85=_0x1cc7[_0x303c7e];return _0x3b0e85;};'use strict';var EventEmitter=require(_0x71cc('0x0'));var ChatWebsite=require(_0x71cc('0x1'))['db'][_0x71cc('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x71cc('0x3')};function emitEvent(_0x1fac93){return function(_0x402191,_0x5431e1,_0x5dfed9){ChatWebsiteEvents['emit'](_0x1fac93+':'+_0x402191['id'],_0x402191);ChatWebsiteEvents[_0x71cc('0x4')](_0x1fac93,_0x402191);_0x5dfed9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x71cc('0x5')](e,emitEvent(event));}}module[_0x71cc('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1af3=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5519e0,_0xec8f68){var _0x14dfb2=function(_0x46b753){while(--_0x46b753){_0x5519e0['push'](_0x5519e0['shift']());}};_0x14dfb2(++_0xec8f68);}(_0x1af3,0x1ca));var _0x31af=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x1af3[_0x191154];return _0x3dcd73;};'use strict';var EventEmitter=require(_0x31af('0x0'));var ChatWebsite=require(_0x31af('0x1'))['db'][_0x31af('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31af('0x3')](0x0);var events={'afterCreate':_0x31af('0x4'),'afterUpdate':_0x31af('0x5'),'afterDestroy':_0x31af('0x6')};function emitEvent(_0x1a6ea6){return function(_0x3d64ae,_0xc098ee,_0x4f989c){ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6+':'+_0x3d64ae['id'],_0x3d64ae);ChatWebsiteEvents[_0x31af('0x7')](_0x1a6ea6,_0x3d64ae);_0x4f989c(null);};}for(var e in events){if(events[_0x31af('0x8')](e)){var event=events[e];ChatWebsite[_0x31af('0x9')](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 86d2a79..5f62fac 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 _0x0a4a=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3a412f,_0x1634db){var _0x41ddbf=function(_0x1a8737){while(--_0x1a8737){_0x3a412f['push'](_0x3a412f['shift']());}};_0x41ddbf(++_0x1634db);}(_0x0a4a,0x1ab));var _0xa0a4=function(_0x1bacb2,_0x3362fc){_0x1bacb2=_0x1bacb2-0x0;var _0x80294b=_0x0a4a[_0x1bacb2];return _0x80294b;};'use strict';var _=require(_0xa0a4('0x0'));var util=require(_0xa0a4('0x1'));var logger=require(_0xa0a4('0x2'))('api');var moment=require(_0xa0a4('0x3'));var BPromise=require(_0xa0a4('0x4'));var rp=require(_0xa0a4('0x5'));var fs=require('fs');var path=require(_0xa0a4('0x6'));var rimraf=require('rimraf');var config=require(_0xa0a4('0x7'));var attributes=require(_0xa0a4('0x8'));module[_0xa0a4('0x9')]=function(_0x1d01f6,_0x584e64){return _0x1d01f6[_0xa0a4('0xa')]('ChatWebsite',attributes,{'tableName':_0xa0a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43c9=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x43c9,0x128));var _0x943c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x943c('0x0'));var util=require(_0x943c('0x1'));var logger=require(_0x943c('0x2'))(_0x943c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x943c('0x4'));var fs=require('fs');var path=require(_0x943c('0x5'));var rimraf=require('rimraf');var config=require(_0x943c('0x6'));var attributes=require(_0x943c('0x7'));module[_0x943c('0x8')]=function(_0x17906f,_0x25b4a1){return _0x17906f[_0x943c('0x9')](_0x943c('0xa'),attributes,{'tableName':_0x943c('0xb'),'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 65ec288..b7fc6c3 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 _0x670a=['localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0xf8ef96,_0x5f0b18){var _0x36cb2b=function(_0x57b796){while(--_0x57b796){_0xf8ef96['push'](_0xf8ef96['shift']());}};_0x36cb2b(++_0x5f0b18);}(_0x670a,0x15e));var _0xa670=function(_0x1c3a19,_0x1ea1da){_0x1c3a19=_0x1c3a19-0x0;var _0xf36c1=_0x670a[_0x1c3a19];return _0xf36c1;};'use strict';var _=require(_0xa670('0x0'));var util=require(_0xa670('0x1'));var moment=require(_0xa670('0x2'));var BPromise=require(_0xa670('0x3'));var rs=require(_0xa670('0x4'));var fs=require('fs');var Redis=require(_0xa670('0x5'));var db=require(_0xa670('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa670('0x7'));var config=require(_0xa670('0x8'));var jayson=require(_0xa670('0x9'));var client=jayson[_0xa670('0xa')][_0xa670('0xb')]({'port':0x232a});config[_0xa670('0xc')]=_[_0xa670('0xd')](config[_0xa670('0xc')],{'host':_0xa670('0xe'),'port':0x18eb});var socket=require(_0xa670('0xf'))(new Redis(config[_0xa670('0xc')]));require(_0xa670('0x10'))['register'](socket);function respondWithRpcPromise(_0x39fb87,_0x13f19e,_0x562c6e){return new BPromise(function(_0x121bee,_0x46798a){return client[_0xa670('0x11')](_0x39fb87,_0x562c6e)[_0xa670('0x12')](function(_0x4d61ae){logger[_0xa670('0x13')](_0xa670('0x14'),_0x13f19e,_0xa670('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x13f19e,_0xa670('0x15'),JSON[_0xa670('0x16')](_0x4d61ae));if(_0x4d61ae['error']){if(_0x4d61ae['error'][_0xa670('0x17')]===0x1f4){logger[_0xa670('0x18')](_0xa670('0x14'),_0x13f19e,_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);return _0x46798a(_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);}logger['error'](_0xa670('0x14'),_0x13f19e,_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);return _0x121bee(_0x4d61ae[_0xa670('0x18')][_0xa670('0x19')]);}else{logger['info'](_0xa670('0x14'),_0x13f19e,'request\x20sent');_0x121bee(_0x4d61ae[_0xa670('0x1a')][_0xa670('0x19')]);}})[_0xa670('0x1b')](function(_0x54b5fb){logger[_0xa670('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x13f19e,_0x54b5fb);_0x46798a(_0x54b5fb);});});}
\ No newline at end of file
+var _0xe000=['then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x114463,_0xbe6dd9){var _0x138c9a=function(_0x487413){while(--_0x487413){_0x114463['push'](_0x114463['shift']());}};_0x138c9a(++_0xbe6dd9);}(_0xe000,0xcf));var _0x0e00=function(_0x57a35a,_0x7eb9b1){_0x57a35a=_0x57a35a-0x0;var _0x4abe87=_0xe000[_0x57a35a];return _0x4abe87;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e00('0x0'));var BPromise=require(_0x0e00('0x1'));var rs=require(_0x0e00('0x2'));var fs=require('fs');var Redis=require(_0x0e00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e00('0x4'));var logger=require(_0x0e00('0x5'))(_0x0e00('0x6'));var config=require(_0x0e00('0x7'));var jayson=require(_0x0e00('0x8'));var client=jayson['client'][_0x0e00('0x9')]({'port':0x232a});config['redis']=_[_0x0e00('0xa')](config[_0x0e00('0xb')],{'host':_0x0e00('0xc'),'port':0x18eb});var socket=require(_0x0e00('0xd'))(new Redis(config[_0x0e00('0xb')]));require(_0x0e00('0xe'))[_0x0e00('0xf')](socket);function respondWithRpcPromise(_0x3ae47b,_0x17a66c,_0x313991){return new BPromise(function(_0x1f687b,_0x495f09){return client[_0x0e00('0x10')](_0x3ae47b,_0x313991)[_0x0e00('0x11')](function(_0x26f776){logger['info'](_0x0e00('0x12'),_0x17a66c,_0x0e00('0x13'));logger[_0x0e00('0x14')](_0x0e00('0x15'),_0x17a66c,_0x0e00('0x13'),JSON[_0x0e00('0x16')](_0x26f776));if(_0x26f776[_0x0e00('0x17')]){if(_0x26f776['error']['code']===0x1f4){logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);return _0x495f09(_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);}logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);return _0x1f687b(_0x26f776[_0x0e00('0x17')][_0x0e00('0x18')]);}else{logger[_0x0e00('0x19')](_0x0e00('0x12'),_0x17a66c,_0x0e00('0x13'));_0x1f687b(_0x26f776[_0x0e00('0x1a')][_0x0e00('0x18')]);}})[_0x0e00('0x1b')](function(_0x82a407){logger[_0x0e00('0x17')](_0x0e00('0x12'),_0x17a66c,_0x82a407);_0x495f09(_0x82a407);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 1304874..d7c602c 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 _0xe9e9=['update','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x529d21,_0x192e46){var _0x5dd275=function(_0x16b59a){while(--_0x16b59a){_0x529d21['push'](_0x529d21['shift']());}};_0x5dd275(++_0x192e46);}(_0xe9e9,0x1d2));var _0x9e9e=function(_0x490515,_0x180324){_0x490515=_0x490515-0x0;var _0x45a918=_0xe9e9[_0x490515];return _0x45a918;};'use strict';var ChatWebsiteEvents=require(_0x9e9e('0x0'));var events=[_0x9e9e('0x1'),_0x9e9e('0x2'),_0x9e9e('0x3')];function createListener(_0x418718,_0x29ed10){return function(_0xaff2bc){_0x29ed10['emit'](_0x418718,_0xaff2bc);};}function removeListener(_0x528439,_0xa4ef7){return function(){ChatWebsiteEvents['removeListener'](_0x528439,_0xa4ef7);};}exports[_0x9e9e('0x4')]=function(_0x223a6c){for(var _0x44b4f2=0x0,_0x18880a=events[_0x9e9e('0x5')];_0x44b4f2<_0x18880a;_0x44b4f2++){var _0x54bc0c=events[_0x44b4f2];var _0x171897=createListener(_0x9e9e('0x6')+_0x54bc0c,_0x223a6c);ChatWebsiteEvents['on'](_0x54bc0c,_0x171897);}};
\ No newline at end of file
+var _0x0c06=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x2cf887,_0x3ff497){var _0x197ecc=function(_0x113de6){while(--_0x113de6){_0x2cf887['push'](_0x2cf887['shift']());}};_0x197ecc(++_0x3ff497);}(_0x0c06,0xbb));var _0x60c0=function(_0x1c2c64,_0x267d8e){_0x1c2c64=_0x1c2c64-0x0;var _0x23a68c=_0x0c06[_0x1c2c64];return _0x23a68c;};'use strict';var ChatWebsiteEvents=require(_0x60c0('0x0'));var events=[_0x60c0('0x1'),_0x60c0('0x2'),_0x60c0('0x3')];function createListener(_0x4a17c5,_0x10a1c2){return function(_0x1d4ebd){_0x10a1c2['emit'](_0x4a17c5,_0x1d4ebd);};}function removeListener(_0x5f5ccd,_0x50b4a6){return function(){ChatWebsiteEvents[_0x60c0('0x4')](_0x5f5ccd,_0x50b4a6);};}exports[_0x60c0('0x5')]=function(_0x566015){for(var _0x32de75=0x0,_0x4e449f=events[_0x60c0('0x6')];_0x32de75<_0x4e449f;_0x32de75++){var _0x1ea3b7=events[_0x32de75];var _0x2c4355=createListener(_0x60c0('0x7')+_0x1ea3b7,_0x566015);ChatWebsiteEvents['on'](_0x1ea3b7,_0x2c4355);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9760045..fe44320 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 _0x574e=['/:id/applications','getApplications','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','file','addLogo','join','format','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet'];(function(_0xde59d0,_0x2c0517){var _0x759330=function(_0x2922ad){while(--_0x2922ad){_0xde59d0['push'](_0xde59d0['shift']());}};_0x759330(++_0x2c0517);}(_0x574e,0x1db));var _0xe574=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x574e[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xe574('0x0'));var util=require(_0xe574('0x1'));var path=require(_0xe574('0x2'));var timeout=require(_0xe574('0x3'));var express=require(_0xe574('0x4'));var router=express['Router']();var fs_extra=require(_0xe574('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe574('0x6'));var config=require(_0xe574('0x7'));var controller=require(_0xe574('0x8'));router['get']('/',auth[_0xe574('0x9')](),controller[_0xe574('0xa')]);router[_0xe574('0xb')](_0xe574('0xc'),auth[_0xe574('0x9')](),controller[_0xe574('0xd')]);router[_0xe574('0xb')](_0xe574('0xe'),auth['isAuthenticated'](),controller[_0xe574('0xf')]);router[_0xe574('0xb')](_0xe574('0x10'),auth[_0xe574('0x9')](),controller[_0xe574('0x11')]);router[_0xe574('0xb')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x13')]);router['get'](_0xe574('0x14'),controller[_0xe574('0x15')]);router[_0xe574('0xb')](_0xe574('0x16'),controller[_0xe574('0x17')]);router[_0xe574('0xb')](_0xe574('0x18'),controller['getCustomerAvatar']);router[_0xe574('0xb')]('/:id/system_avatar',controller[_0xe574('0x19')]);router[_0xe574('0xb')](_0xe574('0x1a'),auth[_0xe574('0x9')](),controller[_0xe574('0x1b')]);router['get']('/:id/snippet',controller[_0xe574('0x1c')]);router[_0xe574('0xb')](_0xe574('0x1d'),auth[_0xe574('0x9')](),controller[_0xe574('0x1e')]);router[_0xe574('0xb')]('/:id/proactive_actions',auth[_0xe574('0x9')](),controller['getProactiveActions']);router[_0xe574('0xb')](_0xe574('0x1f'),controller[_0xe574('0x20')]);router[_0xe574('0xb')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xe574('0xb')](_0xe574('0x21'),auth[_0xe574('0x9')](),controller[_0xe574('0x22')]);router[_0xe574('0x23')]('/',auth[_0xe574('0x9')](),controller[_0xe574('0x24')]);router['post'](_0xe574('0x10'),auth['isAuthenticated'](),controller[_0xe574('0x25')]);router[_0xe574('0x23')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x26')]);var upload=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x2bb26c,_0x2db9e1,_0x397632){_0x397632(null,path['join'](config[_0xe574('0x28')],'server/files/images/logos/'));},'filename':function(_0x3f12f1,_0x3fce26,_0x1e3909){_0x1e3909(null,util['format'](_0xe574('0x29'),Date[_0xe574('0x2a')](),_0x3fce26[_0xe574('0x2b')]));}})});router[_0xe574('0x23')]('/:id/logo',upload['single'](_0xe574('0x2c')),controller[_0xe574('0x2d')]);var upload=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x1ca1d0,_0x461bff,_0x28aa2a){_0x28aa2a(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],'server/files/images/avatars/'));},'filename':function(_0x57458f,_0x1a6909,_0x550602){_0x550602(null,util[_0xe574('0x2f')]('%s-%s',Date[_0xe574('0x2a')](),_0x1a6909['originalname']));}})});router[_0xe574('0x23')](_0xe574('0x16'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5261dc,_0x3755f3,_0x439ea2){_0x439ea2(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],_0xe574('0x32')));},'filename':function(_0x41bcb2,_0x458c3e,_0x418e4a){_0x418e4a(null,util[_0xe574('0x2f')](_0xe574('0x29'),Date[_0xe574('0x2a')](),_0x458c3e['originalname']));}})});router[_0xe574('0x23')](_0xe574('0x18'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42347c,_0x12079f,_0x57d016){_0x57d016(null,path[_0xe574('0x2e')](config[_0xe574('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3f69fe,_0x425a46,_0x4b45a2){_0x4b45a2(null,util[_0xe574('0x2f')]('%s-%s',Date[_0xe574('0x2a')](),_0x425a46[_0xe574('0x2b')]));}})});router[_0xe574('0x23')](_0xe574('0x34'),upload[_0xe574('0x30')](_0xe574('0x2c')),controller[_0xe574('0x35')]);router[_0xe574('0x23')](_0xe574('0x36'),controller[_0xe574('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xe574('0x27')]({'destination':function(_0x3f280f,_0x4fb14f,_0x47fd83){const _0x33c1f5=path[_0xe574('0x2e')](config[_0xe574('0x28')],_0xe574('0x38'),'attachments',_0xe574('0x39'));fs_extra['ensureDir'](_0x33c1f5,function(){_0x47fd83(null,_0x33c1f5);});},'filename':function(_0x4ee541,_0x3c1ab8,_0x280e4c){const _0x2933b4=_0x3c1ab8['originalname'][_0xe574('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e5ddc=path['extname'](_0x2933b4);const _0xdff715=Date[_0xe574('0x2a')]()+'-'+_0x2933b4['replace'](_0x2e5ddc,'')+_0x2e5ddc;_0x280e4c(null,_0xdff715);}})});router['post'](_0xe574('0x3b'),offlineUploadMulter[_0xe574('0x3c')](),controller[_0xe574('0x3d')]);router[_0xe574('0x23')](_0xe574('0x1a'),auth[_0xe574('0x9')](),controller[_0xe574('0x3e')]);router[_0xe574('0x23')]('/:id/applications',auth[_0xe574('0x9')](),controller[_0xe574('0x3f')]);router[_0xe574('0x23')](_0xe574('0x40'),auth[_0xe574('0x9')](),controller['addProactiveActions']);router[_0xe574('0x23')](_0xe574('0x21'),auth[_0xe574('0x9')](),controller[_0xe574('0x41')]);router[_0xe574('0x42')](_0xe574('0xe'),auth['isAuthenticated'](),controller[_0xe574('0x43')]);router[_0xe574('0x44')](_0xe574('0xe'),auth[_0xe574('0x9')](),controller['destroy']);router[_0xe574('0x44')](_0xe574('0x10'),auth[_0xe574('0x9')](),controller[_0xe574('0x45')]);router[_0xe574('0x44')](_0xe574('0x12'),auth[_0xe574('0x9')](),controller[_0xe574('0x46')]);router[_0xe574('0x44')]('/:id/users',auth[_0xe574('0x9')](),controller[_0xe574('0x47')]);module['exports']=router;
\ No newline at end of file
+var _0x3813=['put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','create','post','addDisposition','diskStorage','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','join','server/files/images/avatars/','format','now','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','/:id/users'];(function(_0x15b78c,_0x364a98){var _0x46804e=function(_0x15b153){while(--_0x15b153){_0x15b78c['push'](_0x15b78c['shift']());}};_0x46804e(++_0x364a98);}(_0x3813,0xe3));var _0x3381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3813[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3381('0x0'));var util=require('util');var path=require(_0x3381('0x1'));var timeout=require(_0x3381('0x2'));var express=require(_0x3381('0x3'));var router=express[_0x3381('0x4')]();var fs_extra=require(_0x3381('0x5'));var auth=require(_0x3381('0x6'));var interaction=require(_0x3381('0x7'));var config=require(_0x3381('0x8'));var controller=require('./chatWebsite.controller');router[_0x3381('0x9')]('/',auth[_0x3381('0xa')](),controller[_0x3381('0xb')]);router['get'](_0x3381('0xc'),auth['isAuthenticated'](),controller[_0x3381('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3381('0xe')]);router['get'](_0x3381('0xf'),auth[_0x3381('0xa')](),controller[_0x3381('0x10')]);router[_0x3381('0x9')](_0x3381('0x11'),auth['isAuthenticated'](),controller[_0x3381('0x12')]);router['get'](_0x3381('0x13'),controller[_0x3381('0x14')]);router[_0x3381('0x9')]('/:id/avatar',controller[_0x3381('0x15')]);router['get'](_0x3381('0x16'),controller[_0x3381('0x17')]);router[_0x3381('0x9')](_0x3381('0x18'),controller[_0x3381('0x19')]);router[_0x3381('0x9')](_0x3381('0x1a'),auth['isAuthenticated'](),controller[_0x3381('0x1b')]);router[_0x3381('0x9')](_0x3381('0x1c'),controller[_0x3381('0x1d')]);router['get'](_0x3381('0x1e'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3381('0x9')](_0x3381('0x1f'),auth['isAuthenticated'](),controller[_0x3381('0x20')]);router[_0x3381('0x9')](_0x3381('0x21'),controller['getFields']);router[_0x3381('0x9')]('/:id/offline_messages',auth[_0x3381('0xa')](),controller[_0x3381('0x22')]);router['get']('/:id/users',auth[_0x3381('0xa')](),controller[_0x3381('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3381('0x24')]);router[_0x3381('0x25')](_0x3381('0xf'),auth[_0x3381('0xa')](),controller[_0x3381('0x26')]);router[_0x3381('0x25')]('/:id/canned_answers',auth[_0x3381('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x327aed,_0x2ebef0,_0x45f47b){_0x45f47b(null,path['join'](config[_0x3381('0x28')],_0x3381('0x29')));},'filename':function(_0x3fb94d,_0x19633e,_0x27da98){_0x27da98(null,util['format'](_0x3381('0x2a'),Date['now'](),_0x19633e[_0x3381('0x2b')]));}})});router['post']('/:id/logo',upload[_0x3381('0x2c')](_0x3381('0x2d')),controller[_0x3381('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1944eb,_0x269677,_0x1ec20d){_0x1ec20d(null,path[_0x3381('0x2f')](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x4fbc74,_0x142110,_0x3708b8){_0x3708b8(null,util[_0x3381('0x31')]('%s-%s',Date[_0x3381('0x32')](),_0x142110[_0x3381('0x2b')]));}})});router['post'](_0x3381('0x33'),upload[_0x3381('0x2c')]('file'),controller[_0x3381('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51fa7d,_0x1d1b01,_0x57fd0e){_0x57fd0e(null,path[_0x3381('0x2f')](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x1b0c68,_0xce7641,_0x580d95){_0x580d95(null,util[_0x3381('0x31')](_0x3381('0x2a'),Date['now'](),_0xce7641[_0x3381('0x2b')]));}})});router[_0x3381('0x25')]('/:id/customer_avatar',upload[_0x3381('0x2c')](_0x3381('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x15ab31,_0x343201,_0x2461c8){_0x2461c8(null,path['join'](config[_0x3381('0x28')],_0x3381('0x30')));},'filename':function(_0x38cb4b,_0x36fe4f,_0x4f077e){_0x4f077e(null,util[_0x3381('0x31')](_0x3381('0x2a'),Date[_0x3381('0x32')](),_0x36fe4f[_0x3381('0x2b')]));}})});router['post'](_0x3381('0x18'),upload[_0x3381('0x2c')](_0x3381('0x2d')),controller[_0x3381('0x35')]);router['post'](_0x3381('0x36'),controller[_0x3381('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x3381('0x27')]({'destination':function(_0x2ec737,_0x553ac9,_0x515266){const _0x4f3a7c=path[_0x3381('0x2f')](config[_0x3381('0x28')],'server/files',_0x3381('0x38'),_0x3381('0x39'));fs_extra[_0x3381('0x3a')](_0x4f3a7c,function(){_0x515266(null,_0x4f3a7c);});},'filename':function(_0x303705,_0x5e9cd7,_0x25c157){const _0x18b42c=_0x5e9cd7['originalname'][_0x3381('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5d6112=path['extname'](_0x18b42c);const _0x54ca8f=Date[_0x3381('0x32')]()+'-'+_0x18b42c[_0x3381('0x3b')](_0x5d6112,'')+_0x5d6112;_0x25c157(null,_0x54ca8f);}})});router[_0x3381('0x25')](_0x3381('0x3c'),offlineUploadMulter['any'](),controller[_0x3381('0x3d')]);router[_0x3381('0x25')](_0x3381('0x1a'),auth[_0x3381('0xa')](),controller['addInteraction']);router[_0x3381('0x25')](_0x3381('0x1e'),auth['isAuthenticated'](),controller[_0x3381('0x3e')]);router[_0x3381('0x25')](_0x3381('0x1f'),auth['isAuthenticated'](),controller[_0x3381('0x3f')]);router[_0x3381('0x25')](_0x3381('0x40'),auth[_0x3381('0xa')](),controller['addAgents']);router[_0x3381('0x41')](_0x3381('0x42'),auth[_0x3381('0xa')](),controller[_0x3381('0x43')]);router[_0x3381('0x44')]('/:id',auth[_0x3381('0xa')](),controller[_0x3381('0x45')]);router[_0x3381('0x44')]('/:id/dispositions',auth[_0x3381('0xa')](),controller[_0x3381('0x46')]);router[_0x3381('0x44')](_0x3381('0x11'),auth[_0x3381('0xa')](),controller['removeAnswers']);router[_0x3381('0x44')](_0x3381('0x40'),auth[_0x3381('0xa')](),controller[_0x3381('0x47')]);module[_0x3381('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f7d7f37..5a0eab3 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 _0xa002=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xca909d,_0x389ce3){var _0x3f5682=function(_0x2e5e06){while(--_0x2e5e06){_0xca909d['push'](_0xca909d['shift']());}};_0x3f5682(++_0x389ce3);}(_0xa002,0xc8));var _0x2a00=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa002[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x2a00('0x0'));module[_0x2a00('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2a00('0x2')](_0x2a00('0x3'),'Google',_0x2a00('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a00('0x2')](_0x2a00('0x5'),_0x2a00('0x6'))},'data1':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0x9')},'data4':{'type':Sequelize[_0x2a00('0x7')],'comment':_0x2a00('0xa')},'data5':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xc')},'data6':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xd')},'data7':{'type':Sequelize[_0x2a00('0xb')],'comment':_0x2a00('0xe')}};
\ No newline at end of file
+var _0xa311=['MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','exports','STRING','ENUM','Google'];(function(_0x5c5366,_0x57f3d8){var _0x28db22=function(_0x4fa327){while(--_0x4fa327){_0x5c5366['push'](_0x5c5366['shift']());}};_0x28db22(++_0x57f3d8);}(_0xa311,0x8c));var _0x1a31=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0xa311[_0x401676];return _0x4f13fe;};'use strict';var Sequelize=require('sequelize');module[_0x1a31('0x0')]={'name':{'type':Sequelize[_0x1a31('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1a31('0x2')]('AmazonAWS',_0x1a31('0x3'),_0x1a31('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1a31('0x2')](_0x1a31('0x5'),_0x1a31('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x1a31('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x1a31('0x8')},'data3':{'type':Sequelize[_0x1a31('0x1')],'comment':_0x1a31('0x9')},'data4':{'type':Sequelize[_0x1a31('0x1')],'comment':_0x1a31('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x1a31('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x1a31('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index de16ca2..fcbe849 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 _0xde31=['query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','keys','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','update','destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','error','stack','name','send','index','CloudProvider','type','key'];(function(_0x5afcbc,_0x98df37){var _0x469714=function(_0xc519fb){while(--_0xc519fb){_0x5afcbc['push'](_0x5afcbc['shift']());}};_0x469714(++_0x98df37);}(_0xde31,0x103));var _0x1de3=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xde31[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x1de3('0x0'));var Redis=require(_0x1de3('0x1'));var qs=require(_0x1de3('0x2'));var encryptor=require(_0x1de3('0x3'));var config=require(_0x1de3('0x4'));var logger=require(_0x1de3('0x5'))(_0x1de3('0x6'));var db=require(_0x1de3('0x7'))['db'];var oauth=require(_0x1de3('0x8'));config[_0x1de3('0x9')]=_[_0x1de3('0xa')](config[_0x1de3('0x9')],{'host':_0x1de3('0xb'),'port':0x18eb});var socket=require(_0x1de3('0xc'))(new Redis(config['redis']));var redis=new Redis(config[_0x1de3('0x9')]);function respondWithStatusCode(_0x172a02,_0x94af5d){_0x94af5d=_0x94af5d||0xcc;return function(_0x10d33d){if(_0x10d33d){return _0x172a02[_0x1de3('0xd')](_0x94af5d);}return _0x172a02[_0x1de3('0xe')](_0x94af5d)[_0x1de3('0xf')]();};}function respondWithResult(_0x36fb97,_0x53bf71){_0x53bf71=_0x53bf71||0xc8;return function(_0x1e8a40){if(_0x1e8a40){return _0x36fb97[_0x1de3('0xe')](_0x53bf71)[_0x1de3('0x10')](_0x1e8a40);}};}function respondWithFilteredResult(_0x53964c,_0x185fc1){return function(_0x1f2fe5){if(_0x1f2fe5){var _0x13c915=typeof _0x185fc1[_0x1de3('0x11')]===_0x1de3('0x12')&&typeof _0x185fc1[_0x1de3('0x13')]==='undefined';var _0x46cae2=_0x1f2fe5['count'];var _0x2ac503=_0x13c915?0x0:_0x185fc1['offset'];var _0x42baa0=_0x13c915?_0x1f2fe5[_0x1de3('0x14')]:_0x185fc1[_0x1de3('0x11')]+_0x185fc1[_0x1de3('0x13')];var _0x17965b;if(_0x42baa0>=_0x46cae2){_0x42baa0=_0x46cae2;_0x17965b=0xc8;}else{_0x17965b=0xce;}_0x53964c[_0x1de3('0xe')](_0x17965b);return _0x53964c[_0x1de3('0x15')](_0x1de3('0x16'),_0x2ac503+'-'+_0x42baa0+'/'+_0x46cae2)[_0x1de3('0x10')](_0x1f2fe5);}return null;};}function saveUpdates(_0xdd1967){return function(_0x14374a){if(_0x14374a){return _0x14374a['update'](_0xdd1967)[_0x1de3('0x17')](function(_0x462acf){return _0x462acf;});}return null;};}function removeEntity(_0x4609c7){return function(_0x9fbbc2){if(_0x9fbbc2){return _0x9fbbc2['destroy']()[_0x1de3('0x17')](function(){_0x4609c7[_0x1de3('0xe')](0xcc)[_0x1de3('0xf')]();});}};}function handleEntityNotFound(_0x52db9e){return function(_0x4aab3e){if(!_0x4aab3e){_0x52db9e['sendStatus'](0x194);}return _0x4aab3e;};}function handleError(_0x25ae6b,_0x4cb6f1){_0x4cb6f1=_0x4cb6f1||0x1f4;return function(_0x204b89){logger[_0x1de3('0x18')](_0x204b89[_0x1de3('0x19')]);if(_0x204b89[_0x1de3('0x1a')]){delete _0x204b89[_0x1de3('0x1a')];}_0x25ae6b[_0x1de3('0xe')](_0x4cb6f1)[_0x1de3('0x1b')](_0x204b89);};}function maskClientSecret(_0x332802){return _['padEnd'](_0x332802['slice'](0x0,0x3),0x14,'*');}exports[_0x1de3('0x1c')]=function(_0x542b5c,_0x54b847){var _0x58c563={},_0x58272e={},_0x4c9875={'count':0x0,'rows':[]};var _0x39c159=_['map'](db[_0x1de3('0x1d')]['rawAttributes'],function(_0xbb0ff1){return{'name':_0xbb0ff1['fieldName'],'type':_0xbb0ff1[_0x1de3('0x1e')][_0x1de3('0x1f')]};});_0x58272e['model']=_['map'](_0x39c159,'name');_0x58272e[_0x1de3('0x20')]=_['keys'](_0x542b5c[_0x1de3('0x20')]);_0x58272e['filters']=_[_0x1de3('0x21')](_0x58272e[_0x1de3('0x22')],_0x58272e[_0x1de3('0x20')]);_0x58c563['attributes']=_[_0x1de3('0x21')](_0x58272e[_0x1de3('0x22')],qs['fields'](_0x542b5c[_0x1de3('0x20')][_0x1de3('0x23')]));_0x58c563[_0x1de3('0x24')]=_0x58c563[_0x1de3('0x24')][_0x1de3('0x25')]?_0x58c563[_0x1de3('0x24')]:_0x58272e['model'];if(!_0x542b5c['query'][_0x1de3('0x26')](_0x1de3('0x27'))){_0x58c563['limit']=qs[_0x1de3('0x13')](_0x542b5c[_0x1de3('0x20')][_0x1de3('0x13')]);_0x58c563[_0x1de3('0x11')]=qs[_0x1de3('0x11')](_0x542b5c['query']['offset']);}_0x58c563[_0x1de3('0x28')]=qs[_0x1de3('0x29')](_0x542b5c['query'][_0x1de3('0x29')]);_0x58c563[_0x1de3('0x2a')]=qs[_0x1de3('0x2b')](_[_0x1de3('0x2c')](_0x542b5c['query'],_0x58272e[_0x1de3('0x2b')]),_0x39c159);if(_0x542b5c[_0x1de3('0x20')][_0x1de3('0x2d')]){_0x58c563['where']=_[_0x1de3('0x2e')](_0x58c563[_0x1de3('0x2a')],{'$or':_[_0x1de3('0x2f')](_0x39c159,function(_0x49d13c){if(_0x49d13c[_0x1de3('0x1e')]!==_0x1de3('0x30')){var _0x4430bf={};_0x4430bf[_0x49d13c[_0x1de3('0x1a')]]={'$like':'%'+_0x542b5c[_0x1de3('0x20')][_0x1de3('0x2d')]+'%'};return _0x4430bf;}})});}_0x58c563=_['merge']({},_0x58c563,_0x542b5c[_0x1de3('0x31')]);var _0x492086={'where':_0x58c563[_0x1de3('0x2a')]};return db[_0x1de3('0x1d')][_0x1de3('0x14')](_0x492086)[_0x1de3('0x17')](function(_0x1995f5){_0x4c9875[_0x1de3('0x14')]=_0x1995f5;if(_0x542b5c[_0x1de3('0x20')][_0x1de3('0x32')]){_0x58c563[_0x1de3('0x33')]=[{'all':!![]}];}return db[_0x1de3('0x1d')][_0x1de3('0x34')](_0x58c563);})[_0x1de3('0x17')](function(_0x1fac7c){_0x4c9875[_0x1de3('0x35')]=_['map'](_0x1fac7c,function(_0x13109b){if(_0x13109b[_0x1de3('0x36')]===_0x1de3('0x37')){var _0x1bcae9=encryptor[_0x1de3('0x38')](_0x13109b[_0x1de3('0x39')]);_0x13109b[_0x1de3('0x39')]=maskClientSecret(_0x1bcae9);}return _0x13109b;});return _0x4c9875;})[_0x1de3('0x17')](respondWithFilteredResult(_0x54b847,_0x58c563))['catch'](handleError(_0x54b847,null));};exports[_0x1de3('0x3a')]=function(_0x27d179,_0x5467ac){var _0x3a12de={'raw':!![],'where':{'id':_0x27d179[_0x1de3('0x3b')]['id']}},_0x542d7e={};_0x542d7e['model']=_['keys'](db[_0x1de3('0x1d')][_0x1de3('0x3c')]);_0x542d7e['query']=_[_0x1de3('0x3d')](_0x27d179[_0x1de3('0x20')]);_0x542d7e['filters']=_[_0x1de3('0x21')](_0x542d7e['model'],_0x542d7e[_0x1de3('0x20')]);_0x3a12de['attributes']=_[_0x1de3('0x21')](_0x542d7e['model'],qs[_0x1de3('0x23')](_0x27d179[_0x1de3('0x20')][_0x1de3('0x23')]));_0x3a12de[_0x1de3('0x24')]=_0x3a12de[_0x1de3('0x24')][_0x1de3('0x25')]?_0x3a12de[_0x1de3('0x24')]:_0x542d7e[_0x1de3('0x22')];if(_0x27d179[_0x1de3('0x20')]['includeAll']){_0x3a12de[_0x1de3('0x33')]=[{'all':!![]}];}_0x3a12de=_[_0x1de3('0x2e')]({},_0x3a12de,_0x27d179[_0x1de3('0x31')]);return db[_0x1de3('0x1d')][_0x1de3('0x3e')](_0x3a12de)['then'](handleEntityNotFound(_0x5467ac,null))['then'](function(_0x5722d5){if(_0x5722d5[_0x1de3('0x36')]===_0x1de3('0x37')){var _0x143165=encryptor[_0x1de3('0x38')](_0x5722d5['data3']);_0x5722d5[_0x1de3('0x39')]=maskClientSecret(_0x143165);}return _0x5722d5;})[_0x1de3('0x17')](respondWithResult(_0x5467ac,null))['catch'](handleError(_0x5467ac,null));};exports[_0x1de3('0x3f')]=function(_0x334487,_0x4bbe65){if(!_0x334487[_0x1de3('0x40')][_0x1de3('0x1a')])throw new Error(_0x1de3('0x41'));if(!_0x334487[_0x1de3('0x40')][_0x1de3('0x36')])throw new Error(_0x1de3('0x42'));var _0x234828=db[_0x1de3('0x1d')][_0x1de3('0x3c')][_0x1de3('0x36')][_0x1de3('0x43')];if(!_0x234828[_0x1de3('0x44')](_0x334487[_0x1de3('0x40')][_0x1de3('0x36')]))throw new Error(_0x1de3('0x45')+_0x234828[_0x1de3('0x46')](',\x20'));if(_0x334487[_0x1de3('0x40')]['service']===_0x1de3('0x37')&&_0x334487[_0x1de3('0x40')]['data3']){_0x334487[_0x1de3('0x40')][_0x1de3('0x39')]=encryptor[_0x1de3('0x47')](_0x334487[_0x1de3('0x40')]['data3']);}return db[_0x1de3('0x1d')][_0x1de3('0x3f')](_0x334487[_0x1de3('0x40')],{})['then'](respondWithResult(_0x4bbe65,0xc9))[_0x1de3('0x48')](handleError(_0x4bbe65,null));};exports[_0x1de3('0x49')]=function(_0x3e0e56,_0x3c0958){if(_0x3e0e56[_0x1de3('0x40')]['id']){delete _0x3e0e56[_0x1de3('0x40')]['id'];}return db[_0x1de3('0x1d')][_0x1de3('0x3e')]({'where':{'id':_0x3e0e56[_0x1de3('0x3b')]['id']}})[_0x1de3('0x17')](handleEntityNotFound(_0x3c0958,null))[_0x1de3('0x17')](function(_0x1f0a5d){if(_0x1f0a5d[_0x1de3('0x36')]==='MicrosoftAzure'&&_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]){_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]=encryptor[_0x1de3('0x47')](_0x3e0e56[_0x1de3('0x40')][_0x1de3('0x39')]);}return _0x1f0a5d;})[_0x1de3('0x17')](saveUpdates(_0x3e0e56[_0x1de3('0x40')],null))[_0x1de3('0x17')](respondWithResult(_0x3c0958,null))['catch'](handleError(_0x3c0958,null));};exports[_0x1de3('0x4a')]=function(_0x5641a2,_0x4aa392){return db['CloudProvider'][_0x1de3('0x3e')]({'where':{'id':_0x5641a2[_0x1de3('0x3b')]['id']}})[_0x1de3('0x17')](handleEntityNotFound(_0x4aa392,null))[_0x1de3('0x17')](removeEntity(_0x4aa392,null))['catch'](handleError(_0x4aa392,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50389a,_0x11c2d9){return db[_0x1de3('0x1d')]['findOne']({'where':{'id':_0x50389a[_0x1de3('0x3b')]['id']},'raw':!![]})[_0x1de3('0x17')](function(_0xdbf886){if(!_0xdbf886)return _0x11c2d9[_0x1de3('0xd')](0x194);return{'url':oauth[_0x1de3('0x4b')](_0xdbf886,_0x50389a[_0x1de3('0x4c')]['id'])};})[_0x1de3('0x17')](respondWithResult(_0x11c2d9,null))[_0x1de3('0x48')](handleError(_0x11c2d9,null));};exports[_0x1de3('0x4d')]=function(_0x47f2a6,_0x575a27){var _0x47f31b=_0x47f2a6['body'];var _0x1b5fad;var _0x2f17cb;if(_0x47f31b[_0x1de3('0x18')])throw _0x47f31b;redis['get'](_0x47f31b[_0x1de3('0x4e')])[_0x1de3('0x17')](function(_0x1f766f){if(!_0x1f766f)throw new Error(_0x1de3('0x4f'));_0x1b5fad=JSON[_0x1de3('0x50')](_0x1f766f);var _0x214d4f=Buffer[_0x1de3('0x51')](_0x47f31b['state'],_0x1de3('0x52'))[_0x1de3('0x53')](_0x1de3('0x54'));_0x2f17cb=JSON[_0x1de3('0x50')](_0x214d4f);if(!oauth['isValidIdToken'](_0x47f31b[_0x1de3('0x55')],_0x1b5fad['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x1de3('0x56')](_0x47f31b[_0x1de3('0x4e')]);return oauth[_0x1de3('0x57')](_0x47f31b['code'],_0x1b5fad);})[_0x1de3('0x17')](function(_0x1ffe19){_0x1b5fad['data5']=_0x1ffe19[_0x1de3('0x58')];_0x1b5fad[_0x1de3('0x59')]=_0x1ffe19[_0x1de3('0x5a')];return db['CloudProvider'][_0x1de3('0x49')]({'data5':_0x1b5fad['data5'],'data6':_0x1b5fad['data6']},{'where':{'id':_0x1b5fad['id']}});})['then'](function(){oauth[_0x1de3('0x5b')](_0x1b5fad);socket[_0x1de3('0x5c')](_0x1de3('0x5d'),{'id':_0x2f17cb['id']});return;})[_0x1de3('0x17')](respondWithStatusCode(_0x575a27,null))[_0x1de3('0x48')](function(_0x5a083c){if(_0x2f17cb){socket[_0x1de3('0x5c')]('microsoftAuthorization:error',{'id':_0x2f17cb['id']});}if(!_0x1b5fad){logger[_0x1de3('0x18')](_0x1de3('0x5e'),_0x5a083c);return _0x575a27[_0x1de3('0xe')](0x1f4)['send'](_0x5a083c[_0x1de3('0x5f')]);}logger[_0x1de3('0x18')](_0x1de3('0x60'),_0x1b5fad['id'],_0x5a083c);});};
\ No newline at end of file
+var _0xe868=['pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','destroy','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','set','Content-Range','json','update','then','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters'];(function(_0x35c4b6,_0x3f462e){var _0x444f74=function(_0xee09cb){while(--_0xee09cb){_0x35c4b6['push'](_0x35c4b6['shift']());}};_0x444f74(++_0x3f462e);}(_0xe868,0xf8));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e86('0x0'));var Redis=require(_0x8e86('0x1'));var qs=require(_0x8e86('0x2'));var encryptor=require(_0x8e86('0x3'));var config=require(_0x8e86('0x4'));var logger=require(_0x8e86('0x5'))(_0x8e86('0x6'));var db=require(_0x8e86('0x7'))['db'];var oauth=require(_0x8e86('0x8'));config['redis']=_[_0x8e86('0x9')](config[_0x8e86('0xa')],{'host':_0x8e86('0xb'),'port':0x18eb});var socket=require(_0x8e86('0xc'))(new Redis(config['redis']));var redis=new Redis(config[_0x8e86('0xa')]);function respondWithStatusCode(_0x573cb0,_0x2f6628){_0x2f6628=_0x2f6628||0xcc;return function(_0x585f61){if(_0x585f61){return _0x573cb0[_0x8e86('0xd')](_0x2f6628);}return _0x573cb0[_0x8e86('0xe')](_0x2f6628)['end']();};}function respondWithResult(_0x2cb7e2,_0x510386){_0x510386=_0x510386||0xc8;return function(_0x5ea43f){if(_0x5ea43f){return _0x2cb7e2[_0x8e86('0xe')](_0x510386)['json'](_0x5ea43f);}};}function respondWithFilteredResult(_0x8edb88,_0x26459d){return function(_0x98f41f){if(_0x98f41f){var _0x3645d4=typeof _0x26459d[_0x8e86('0xf')]===_0x8e86('0x10')&&typeof _0x26459d[_0x8e86('0x11')]===_0x8e86('0x10');var _0x172716=_0x98f41f['count'];var _0x4af768=_0x3645d4?0x0:_0x26459d[_0x8e86('0xf')];var _0x1ebd9d=_0x3645d4?_0x98f41f['count']:_0x26459d[_0x8e86('0xf')]+_0x26459d[_0x8e86('0x11')];var _0x556e78;if(_0x1ebd9d>=_0x172716){_0x1ebd9d=_0x172716;_0x556e78=0xc8;}else{_0x556e78=0xce;}_0x8edb88['status'](_0x556e78);return _0x8edb88[_0x8e86('0x12')](_0x8e86('0x13'),_0x4af768+'-'+_0x1ebd9d+'/'+_0x172716)[_0x8e86('0x14')](_0x98f41f);}return null;};}function saveUpdates(_0x5e457f){return function(_0x2d5b02){if(_0x2d5b02){return _0x2d5b02[_0x8e86('0x15')](_0x5e457f)[_0x8e86('0x16')](function(_0x426f45){return _0x426f45;});}return null;};}function removeEntity(_0x24ef18){return function(_0x5d7609){if(_0x5d7609){return _0x5d7609['destroy']()[_0x8e86('0x16')](function(){_0x24ef18[_0x8e86('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445ed3){return function(_0xa9c06d){if(!_0xa9c06d){_0x445ed3[_0x8e86('0xd')](0x194);}return _0xa9c06d;};}function handleError(_0x30b46b,_0x212c4a){_0x212c4a=_0x212c4a||0x1f4;return function(_0x4ff1c7){logger['error'](_0x4ff1c7['stack']);if(_0x4ff1c7[_0x8e86('0x17')]){delete _0x4ff1c7[_0x8e86('0x17')];}_0x30b46b[_0x8e86('0xe')](_0x212c4a)['send'](_0x4ff1c7);};}function maskClientSecret(_0x14f0f4){return _['padEnd'](_0x14f0f4[_0x8e86('0x18')](0x0,0x3),0x14,'*');}exports[_0x8e86('0x19')]=function(_0x44e222,_0x35a70e){var _0x4631d0={},_0x8e2ad5={},_0x1b4777={'count':0x0,'rows':[]};var _0x107eb0=_[_0x8e86('0x1a')](db[_0x8e86('0x1b')][_0x8e86('0x1c')],function(_0x13ff2d){return{'name':_0x13ff2d[_0x8e86('0x1d')],'type':_0x13ff2d[_0x8e86('0x1e')][_0x8e86('0x1f')]};});_0x8e2ad5[_0x8e86('0x20')]=_[_0x8e86('0x1a')](_0x107eb0,_0x8e86('0x17'));_0x8e2ad5[_0x8e86('0x21')]=_[_0x8e86('0x22')](_0x44e222[_0x8e86('0x21')]);_0x8e2ad5['filters']=_['intersection'](_0x8e2ad5['model'],_0x8e2ad5['query']);_0x4631d0[_0x8e86('0x23')]=_[_0x8e86('0x24')](_0x8e2ad5['model'],qs['fields'](_0x44e222[_0x8e86('0x21')][_0x8e86('0x25')]));_0x4631d0[_0x8e86('0x23')]=_0x4631d0[_0x8e86('0x23')][_0x8e86('0x26')]?_0x4631d0[_0x8e86('0x23')]:_0x8e2ad5[_0x8e86('0x20')];if(!_0x44e222[_0x8e86('0x21')][_0x8e86('0x27')]('nolimit')){_0x4631d0[_0x8e86('0x11')]=qs[_0x8e86('0x11')](_0x44e222[_0x8e86('0x21')][_0x8e86('0x11')]);_0x4631d0[_0x8e86('0xf')]=qs[_0x8e86('0xf')](_0x44e222[_0x8e86('0x21')][_0x8e86('0xf')]);}_0x4631d0[_0x8e86('0x28')]=qs['sort'](_0x44e222['query']['sort']);_0x4631d0[_0x8e86('0x29')]=qs[_0x8e86('0x2a')](_[_0x8e86('0x2b')](_0x44e222[_0x8e86('0x21')],_0x8e2ad5[_0x8e86('0x2a')]),_0x107eb0);if(_0x44e222[_0x8e86('0x21')][_0x8e86('0x2c')]){_0x4631d0[_0x8e86('0x29')]=_[_0x8e86('0x2d')](_0x4631d0['where'],{'$or':_[_0x8e86('0x1a')](_0x107eb0,function(_0x3e2383){if(_0x3e2383[_0x8e86('0x1e')]!==_0x8e86('0x2e')){var _0x509797={};_0x509797[_0x3e2383[_0x8e86('0x17')]]={'$like':'%'+_0x44e222[_0x8e86('0x21')][_0x8e86('0x2c')]+'%'};return _0x509797;}})});}_0x4631d0=_[_0x8e86('0x2d')]({},_0x4631d0,_0x44e222['options']);var _0x517dfa={'where':_0x4631d0['where']};return db[_0x8e86('0x1b')][_0x8e86('0x2f')](_0x517dfa)[_0x8e86('0x16')](function(_0x15f4de){_0x1b4777[_0x8e86('0x2f')]=_0x15f4de;if(_0x44e222[_0x8e86('0x21')][_0x8e86('0x30')]){_0x4631d0[_0x8e86('0x31')]=[{'all':!![]}];}return db[_0x8e86('0x1b')][_0x8e86('0x32')](_0x4631d0);})['then'](function(_0x1edc24){_0x1b4777[_0x8e86('0x33')]=_['map'](_0x1edc24,function(_0x2f8575){if(_0x2f8575['service']===_0x8e86('0x34')){var _0x1bea74=encryptor[_0x8e86('0x35')](_0x2f8575['data3']);_0x2f8575[_0x8e86('0x36')]=maskClientSecret(_0x1bea74);}return _0x2f8575;});return _0x1b4777;})[_0x8e86('0x16')](respondWithFilteredResult(_0x35a70e,_0x4631d0))[_0x8e86('0x37')](handleError(_0x35a70e,null));};exports[_0x8e86('0x38')]=function(_0x57490a,_0x492ba1){var _0xbe1179={'raw':!![],'where':{'id':_0x57490a[_0x8e86('0x39')]['id']}},_0x53aa76={};_0x53aa76[_0x8e86('0x20')]=_[_0x8e86('0x22')](db[_0x8e86('0x1b')][_0x8e86('0x1c')]);_0x53aa76[_0x8e86('0x21')]=_['keys'](_0x57490a[_0x8e86('0x21')]);_0x53aa76['filters']=_[_0x8e86('0x24')](_0x53aa76[_0x8e86('0x20')],_0x53aa76[_0x8e86('0x21')]);_0xbe1179[_0x8e86('0x23')]=_['intersection'](_0x53aa76[_0x8e86('0x20')],qs['fields'](_0x57490a[_0x8e86('0x21')][_0x8e86('0x25')]));_0xbe1179[_0x8e86('0x23')]=_0xbe1179[_0x8e86('0x23')]['length']?_0xbe1179[_0x8e86('0x23')]:_0x53aa76[_0x8e86('0x20')];if(_0x57490a[_0x8e86('0x21')]['includeAll']){_0xbe1179[_0x8e86('0x31')]=[{'all':!![]}];}_0xbe1179=_[_0x8e86('0x2d')]({},_0xbe1179,_0x57490a[_0x8e86('0x3a')]);return db[_0x8e86('0x1b')][_0x8e86('0x3b')](_0xbe1179)['then'](handleEntityNotFound(_0x492ba1,null))['then'](function(_0x993dae){if(_0x993dae['service']===_0x8e86('0x34')){var _0x5528db=encryptor[_0x8e86('0x35')](_0x993dae[_0x8e86('0x36')]);_0x993dae['data3']=maskClientSecret(_0x5528db);}return _0x993dae;})[_0x8e86('0x16')](respondWithResult(_0x492ba1,null))[_0x8e86('0x37')](handleError(_0x492ba1,null));};exports[_0x8e86('0x3c')]=function(_0x549467,_0x5a09a4){if(!_0x549467['body'][_0x8e86('0x17')])throw new Error(_0x8e86('0x3d'));if(!_0x549467['body'][_0x8e86('0x3e')])throw new Error(_0x8e86('0x3f'));var _0x438541=db[_0x8e86('0x1b')][_0x8e86('0x1c')][_0x8e86('0x3e')][_0x8e86('0x40')];if(!_0x438541[_0x8e86('0x41')](_0x549467[_0x8e86('0x42')]['service']))throw new Error(_0x8e86('0x43')+_0x438541['join'](',\x20'));if(_0x549467[_0x8e86('0x42')]['service']===_0x8e86('0x34')&&_0x549467[_0x8e86('0x42')][_0x8e86('0x36')]){_0x549467['body']['data3']=encryptor[_0x8e86('0x44')](_0x549467[_0x8e86('0x42')][_0x8e86('0x36')]);}return db[_0x8e86('0x1b')][_0x8e86('0x3c')](_0x549467[_0x8e86('0x42')],{})[_0x8e86('0x16')](respondWithResult(_0x5a09a4,0xc9))['catch'](handleError(_0x5a09a4,null));};exports[_0x8e86('0x15')]=function(_0x33cb84,_0x515b09){if(_0x33cb84[_0x8e86('0x42')]['id']){delete _0x33cb84['body']['id'];}return db['CloudProvider'][_0x8e86('0x3b')]({'where':{'id':_0x33cb84[_0x8e86('0x39')]['id']}})['then'](handleEntityNotFound(_0x515b09,null))['then'](function(_0x52c8b2){if(_0x52c8b2[_0x8e86('0x3e')]==='MicrosoftAzure'&&_0x33cb84[_0x8e86('0x42')][_0x8e86('0x36')]){_0x33cb84[_0x8e86('0x42')]['data3']=encryptor[_0x8e86('0x44')](_0x33cb84[_0x8e86('0x42')]['data3']);}return _0x52c8b2;})['then'](saveUpdates(_0x33cb84[_0x8e86('0x42')],null))[_0x8e86('0x16')](respondWithResult(_0x515b09,null))[_0x8e86('0x37')](handleError(_0x515b09,null));};exports[_0x8e86('0x45')]=function(_0x1bb0f4,_0x4ca417){return db[_0x8e86('0x1b')][_0x8e86('0x3b')]({'where':{'id':_0x1bb0f4['params']['id']}})[_0x8e86('0x16')](handleEntityNotFound(_0x4ca417,null))[_0x8e86('0x16')](removeEntity(_0x4ca417,null))[_0x8e86('0x37')](handleError(_0x4ca417,null));};exports['oauth2MicrosoftAuthorize']=function(_0x7990d3,_0x3a97b1){return db['CloudProvider']['findOne']({'where':{'id':_0x7990d3[_0x8e86('0x39')]['id']},'raw':!![]})[_0x8e86('0x16')](function(_0x1404c4){if(!_0x1404c4)return _0x3a97b1[_0x8e86('0xd')](0x194);return{'url':oauth[_0x8e86('0x46')](_0x1404c4,_0x7990d3[_0x8e86('0x47')]['id'])};})[_0x8e86('0x16')](respondWithResult(_0x3a97b1,null))['catch'](handleError(_0x3a97b1,null));};exports[_0x8e86('0x48')]=function(_0x40b1cb,_0x2131e1){var _0x56fa30=_0x40b1cb[_0x8e86('0x42')];var _0x5b94bf;var _0x44c85c;if(_0x56fa30[_0x8e86('0x49')])throw _0x56fa30;redis[_0x8e86('0x4a')](_0x56fa30[_0x8e86('0x4b')])[_0x8e86('0x16')](function(_0x36ef3b){if(!_0x36ef3b)throw new Error(_0x8e86('0x4c'));_0x5b94bf=JSON['parse'](_0x36ef3b);var _0x518925=Buffer[_0x8e86('0x4d')](_0x56fa30[_0x8e86('0x4b')],_0x8e86('0x4e'))[_0x8e86('0x4f')]('ascii');_0x44c85c=JSON[_0x8e86('0x50')](_0x518925);if(!oauth[_0x8e86('0x51')](_0x56fa30[_0x8e86('0x52')],_0x5b94bf[_0x8e86('0x53')]))throw new Error(_0x8e86('0x54'));redis[_0x8e86('0x55')](_0x56fa30['state']);return oauth[_0x8e86('0x56')](_0x56fa30[_0x8e86('0x57')],_0x5b94bf);})[_0x8e86('0x16')](function(_0x716818){_0x5b94bf['data5']=_0x716818[_0x8e86('0x58')];_0x5b94bf[_0x8e86('0x59')]=_0x716818[_0x8e86('0x5a')];return db['CloudProvider']['update']({'data5':_0x5b94bf['data5'],'data6':_0x5b94bf[_0x8e86('0x59')]},{'where':{'id':_0x5b94bf['id']}});})['then'](function(){oauth[_0x8e86('0x5b')](_0x5b94bf);socket[_0x8e86('0x5c')]('microsoftAuthorization:success',{'id':_0x44c85c['id']});return;})[_0x8e86('0x16')](respondWithStatusCode(_0x2131e1,null))['catch'](function(_0x5020f4){if(_0x44c85c){socket[_0x8e86('0x5c')](_0x8e86('0x5d'),{'id':_0x44c85c['id']});}if(!_0x5b94bf){logger[_0x8e86('0x49')](_0x8e86('0x5e'),_0x5020f4);return _0x2131e1[_0x8e86('0xe')](0x1f4)[_0x8e86('0x5f')](_0x5020f4[_0x8e86('0x60')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s',_0x5b94bf['id'],_0x5020f4);});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5fa7e33..8718e07 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 _0x9a82=['request-promise','path','rimraf','../../config/environment','define','CloudProvider','lodash','util','api','moment'];(function(_0x1506fc,_0x5ed6a2){var _0x4b6b57=function(_0x4ae156){while(--_0x4ae156){_0x1506fc['push'](_0x1506fc['shift']());}};_0x4b6b57(++_0x5ed6a2);}(_0x9a82,0x178));var _0x29a8=function(_0x3c600b,_0x2fba6b){_0x3c600b=_0x3c600b-0x0;var _0xaf7ffd=_0x9a82[_0x3c600b];return _0xaf7ffd;};'use strict';var _=require(_0x29a8('0x0'));var util=require(_0x29a8('0x1'));var logger=require('../../config/logger')(_0x29a8('0x2'));var moment=require(_0x29a8('0x3'));var BPromise=require('bluebird');var rp=require(_0x29a8('0x4'));var fs=require('fs');var path=require(_0x29a8('0x5'));var rimraf=require(_0x29a8('0x6'));var config=require(_0x29a8('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x15f956,_0x28719e){return _0x15f956[_0x29a8('0x8')](_0x29a8('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb531=['../../config/logger','api','moment','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util'];(function(_0x4ac266,_0x197dab){var _0x3c8fe3=function(_0x500837){while(--_0x500837){_0x4ac266['push'](_0x4ac266['shift']());}};_0x3c8fe3(++_0x197dab);}(_0xb531,0x112));var _0x1b53=function(_0x7cdfb5,_0x530cbb){_0x7cdfb5=_0x7cdfb5-0x0;var _0xb1ba04=_0xb531[_0x7cdfb5];return _0xb1ba04;};'use strict';var _=require(_0x1b53('0x0'));var util=require(_0x1b53('0x1'));var logger=require(_0x1b53('0x2'))(_0x1b53('0x3'));var moment=require(_0x1b53('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b53('0x5'));var rimraf=require(_0x1b53('0x6'));var config=require(_0x1b53('0x7'));var attributes=require(_0x1b53('0x8'));module[_0x1b53('0x9')]=function(_0x5c46cf,_0x4e402e){return _0x5c46cf['define'](_0x1b53('0xa'),attributes,{'tableName':_0x1b53('0xb'),'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 958725e..a79ccf9 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 _0x324f=['redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','value','oauth2Claims','replace','oauth2/','set','decode','payload','issuer','aud','isAfter','unix','resolve','then','data6','findOne','decryptString','data3','POST','data5','access_token','refresh_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','crypto','jsonwebtoken','request-promise','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider'];(function(_0x54124c,_0x393bee){var _0x44aab2=function(_0x5aa5fa){while(--_0x5aa5fa){_0x54124c['push'](_0x54124c['shift']());}};_0x44aab2(++_0x393bee);}(_0x324f,0x94));var _0xf324=function(_0x21c460,_0x12b0f7){_0x21c460=_0x21c460-0x0;var _0x10c857=_0x324f[_0x21c460];return _0x10c857;};'use strict';var _=require(_0xf324('0x0'));var crypto=require(_0xf324('0x1'));var jwt=require(_0xf324('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xf324('0x3'));var util=require('util');var encryptor=require(_0xf324('0x4'));var config=require(_0xf324('0x5'));var logger=require('../../config/logger')(_0xf324('0x6'));var schedule=require(_0xf324('0x7'));var db=require('../../mysqldb')['db'];config[_0xf324('0x8')]=_[_0xf324('0x9')](config[_0xf324('0x8')],{'host':_0xf324('0xa'),'port':0x18eb});var redis=new Redis(config[_0xf324('0x8')]);var MICROSOFT_AUTH_URL=_0xf324('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf324('0xc'),_0xf324('0xd'),_0xf324('0xe'),'offline_access',_0xf324('0xf'),_0xf324('0x10'),_0xf324('0x11')],'Dynamics365':[_0xf324('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf324('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xf324('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x229d23){var _0x295e0e=_[_0xf324('0x14')](AZURE_AUTH_SCOPES[_0x229d23[_0xf324('0x15')]]);if(_0x229d23[_0xf324('0x15')]===_0xf324('0x16'))_0x295e0e[_0xf324('0x17')](_0x229d23[_0xf324('0x18')]+'/.default');return _0x295e0e['join']('\x20');}function getAccessTokenScope(_0x52c645){if(_0x52c645['type']===_0xf324('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x52c645[_0xf324('0x15')]==='Dynamics365')return _0x52c645[_0xf324('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x29a123,_0x3aa231){var _0x1121bc=MICROSOFT_AUTH_URL['replace'](_0xf324('0x1a'),_0x29a123[_0xf324('0x1b')]);var _0x39ca8e=[_0xf324('0x1c'),_0xf324('0x1d')];var _0x89bcbd=Buffer[_0xf324('0x1e')](JSON[_0xf324('0x1f')]({'id':_0x3aa231}))[_0xf324('0x20')](_0xf324('0x21'));var _0x32ee7a=crypto[_0xf324('0x22')](0x10)['toString'](_0xf324('0x23'));var _0xe5afd8=getAuthorizationScopes(_0x29a123);var _0x5b6c90=[{'key':'client_id','value':_0x29a123[_0xf324('0x24')]},{'key':_0xf324('0x25'),'value':encodeURIComponent(_0x39ca8e[_0xf324('0x26')]('\x20'))},{'key':_0xf324('0x27'),'value':_0x29a123[_0xf324('0x28')]},{'key':_0xf324('0x29'),'value':_0xf324('0x2a')},{'key':_0xf324('0x2b'),'value':encodeURIComponent(_0xe5afd8)},{'key':'state','value':_0x89bcbd},{'key':_0xf324('0x2c'),'value':_0x32ee7a},{'key':_0xf324('0x2d'),'value':'login'}];var _0x4420b9=_0x1121bc+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf324('0x14')](_0x5b6c90,function(_0x89d969){return _0x89d969['key']+'='+_0x89d969[_0xf324('0x2e')];})[_0xf324('0x26')]('&');_0x29a123[_0xf324('0x2f')]={'issuer':_0x1121bc[_0xf324('0x30')](_0xf324('0x31'),''),'audience':_0x29a123[_0xf324('0x24')],'state':_0x89bcbd,'nonce':_0x32ee7a};redis[_0xf324('0x32')](_0x89bcbd,JSON[_0xf324('0x1f')](_0x29a123));return _0x4420b9;}function isValidIdToken(_0x16ddac,_0x391476){try{var _0x298f92=jwt[_0xf324('0x33')](_0x16ddac,{'complete':!![]});var _0x2c45bc=_0x298f92[_0xf324('0x34')];if(_0x2c45bc['iss']!==_0x391476[_0xf324('0x35')])return![];if(_0x2c45bc[_0xf324('0x36')]!==_0x391476['audience'])return![];if(_0x2c45bc[_0xf324('0x2c')]!==_0x391476[_0xf324('0x2c')])return![];if(moment()[_0xf324('0x37')](moment[_0xf324('0x38')](_0x2c45bc['exp'])))return![];return!![];}catch(_0x2992bb){throw _0x2992bb;}}function refreshOauth2MicrosoftAccessToken(_0x5175d3){return Promise[_0xf324('0x39')]()[_0xf324('0x3a')](function(){if(_0x5175d3[_0xf324('0x3b')])return _0x5175d3;return db['CloudProvider'][_0xf324('0x3c')]({'where':{'id':_0x5175d3['id']},'raw':!![]});})[_0xf324('0x3a')](function(_0x4a5e40){var _0x347ee2={'grant_type':'refresh_token','refresh_token':_0x4a5e40[_0xf324('0x3b')],'scope':getAccessTokenScope(_0x4a5e40),'redirect_uri':_0x4a5e40[_0xf324('0x28')],'client_id':_0x4a5e40['data1'],'client_secret':encryptor[_0xf324('0x3d')](_0x4a5e40[_0xf324('0x3e')])};var _0x2ee0c4={'method':_0xf324('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf324('0x30')]('{TENANT_ID}',_0x4a5e40[_0xf324('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x347ee2,'json':!![]};return rp(_0x2ee0c4);})[_0xf324('0x3a')](function(_0x1bb177){_0x5175d3[_0xf324('0x40')]=_0x1bb177[_0xf324('0x41')];_0x5175d3[_0xf324('0x3b')]=_0x1bb177[_0xf324('0x42')];return db[_0xf324('0x43')][_0xf324('0x44')]({'data5':_0x5175d3[_0xf324('0x40')],'data6':_0x5175d3[_0xf324('0x3b')]},{'where':{'id':_0x5175d3['id']}});})[_0xf324('0x3a')](function(){return _0x5175d3;})[_0xf324('0x45')](function(_0x4d3eaf){logger[_0xf324('0x46')](_0xf324('0x47'),_0x5175d3['id'],_0x4d3eaf);});}function getOauth2MicrosoftAccessToken(_0x128aa6,_0x2fa6b2){var _0x4116a8={'grant_type':_0xf324('0x48'),'code':_0x128aa6,'scope':getAccessTokenScope(_0x2fa6b2),'redirect_uri':_0x2fa6b2[_0xf324('0x28')],'client_id':_0x2fa6b2['data1'],'client_secret':encryptor[_0xf324('0x3d')](_0x2fa6b2[_0xf324('0x3e')])};var _0x52f39c={'method':_0xf324('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xf324('0x30')](_0xf324('0x1a'),_0x2fa6b2[_0xf324('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4116a8,'json':!![]};return rp(_0x52f39c);}function startRefreshInterval(_0x413bfa){var _0x4ea2bb=schedule[_0xf324('0x49')];if(_0x4ea2bb[_0x413bfa['id']])clearInterval(_0x4ea2bb[_0x413bfa['id']]);_0x4ea2bb[_0x413bfa['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x413bfa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf324('0x49')]=_0x4ea2bb;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xf324('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf324('0x3a')](function(_0x5f29de){var _0x4f10d1=_0x5f29de[_0xf324('0x14')](function(_0x1c01a1){return refreshOauth2MicrosoftAccessToken(_0x1c01a1)[_0xf324('0x3a')](function(_0x5937a5){startRefreshInterval(_0x5937a5);});});return Promise[_0xf324('0x4b')](_0x4f10d1);})[_0xf324('0x45')](function(_0x3c950c){var _0x2165e0=_0x3c950c?util['inspect'](_0x3c950c,{'showHidden':![],'depth':null}):'';logger[_0xf324('0x46')](_0xf324('0x4c'),_0x2165e0);});}module[_0xf324('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x851a=['intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2Claims','data1','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data6','CloudProvider','findOne','refresh_token','decryptString','data3','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','bind'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x851a,0x19b));var _0xa851=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x851a[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xa851('0x0'));var crypto=require('crypto');var jwt=require(_0xa851('0x1'));var moment=require(_0xa851('0x2'));var Redis=require(_0xa851('0x3'));var rp=require(_0xa851('0x4'));var util=require(_0xa851('0x5'));var encryptor=require(_0xa851('0x6'));var config=require(_0xa851('0x7'));var logger=require(_0xa851('0x8'))('api');var schedule=require(_0xa851('0x9'));var db=require('../../mysqldb')['db'];config[_0xa851('0xa')]=_[_0xa851('0xb')](config[_0xa851('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa851('0xa')]);var MICROSOFT_AUTH_URL=_0xa851('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa851('0xd'),_0xa851('0xe'),'email',_0xa851('0xf'),_0xa851('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xa851('0x11')],'Dynamics365':[_0xa851('0xd'),_0xa851('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xa851('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xa851('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3316aa){var _0x18059e=_[_0xa851('0x14')](AZURE_AUTH_SCOPES[_0x3316aa[_0xa851('0x15')]]);if(_0x3316aa[_0xa851('0x15')]===_0xa851('0x16'))_0x18059e[_0xa851('0x17')](_0x3316aa[_0xa851('0x18')]+_0xa851('0x19'));return _0x18059e[_0xa851('0x1a')]('\x20');}function getAccessTokenScope(_0x2ad4b2){if(_0x2ad4b2[_0xa851('0x15')]===_0xa851('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2ad4b2[_0xa851('0x15')]===_0xa851('0x16'))return _0x2ad4b2[_0xa851('0x18')]+_0xa851('0x19');}function generateMicrosoftAuthorizationUrl(_0x5be85d,_0x905e2a){var _0x1f38da=MICROSOFT_AUTH_URL[_0xa851('0x1c')](_0xa851('0x1d'),_0x5be85d[_0xa851('0x1e')]);var _0x51ebac=[_0xa851('0x1f'),'id_token'];var _0x23d32d=Buffer[_0xa851('0x20')](JSON[_0xa851('0x21')]({'id':_0x905e2a}))[_0xa851('0x22')](_0xa851('0x23'));var _0x1fd056=crypto[_0xa851('0x24')](0x10)[_0xa851('0x22')](_0xa851('0x25'));var _0x5bfe0e=getAuthorizationScopes(_0x5be85d);var _0x394f7d=[{'key':_0xa851('0x26'),'value':_0x5be85d['data1']},{'key':_0xa851('0x27'),'value':encodeURIComponent(_0x51ebac[_0xa851('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x5be85d[_0xa851('0x28')]},{'key':_0xa851('0x29'),'value':_0xa851('0x2a')},{'key':_0xa851('0x2b'),'value':encodeURIComponent(_0x5bfe0e)},{'key':_0xa851('0x2c'),'value':_0x23d32d},{'key':_0xa851('0x2d'),'value':_0x1fd056},{'key':_0xa851('0x2e'),'value':_0xa851('0x2f')}];var _0x10d602=_0x1f38da+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa851('0x14')](_0x394f7d,function(_0x23c3ef){return _0x23c3ef[_0xa851('0x30')]+'='+_0x23c3ef['value'];})[_0xa851('0x1a')]('&');_0x5be85d[_0xa851('0x31')]={'issuer':_0x1f38da[_0xa851('0x1c')]('oauth2/',''),'audience':_0x5be85d[_0xa851('0x32')],'state':_0x23d32d,'nonce':_0x1fd056};redis['set'](_0x23d32d,JSON[_0xa851('0x21')](_0x5be85d));return _0x10d602;}function isValidIdToken(_0x4f49fe,_0x10935d){try{var _0x455f93=jwt['decode'](_0x4f49fe,{'complete':!![]});var _0x40457c=_0x455f93[_0xa851('0x33')];if(_0x40457c[_0xa851('0x34')]!==_0x10935d[_0xa851('0x35')])return![];if(_0x40457c[_0xa851('0x36')]!==_0x10935d[_0xa851('0x37')])return![];if(_0x40457c['nonce']!==_0x10935d[_0xa851('0x2d')])return![];if(moment()[_0xa851('0x38')](moment[_0xa851('0x39')](_0x40457c['exp'])))return![];return!![];}catch(_0x1788a6){throw _0x1788a6;}}function refreshOauth2MicrosoftAccessToken(_0x126e37){return Promise[_0xa851('0x3a')]()[_0xa851('0x3b')](function(){if(_0x126e37[_0xa851('0x3c')])return _0x126e37;return db[_0xa851('0x3d')][_0xa851('0x3e')]({'where':{'id':_0x126e37['id']},'raw':!![]});})[_0xa851('0x3b')](function(_0xfbb23a){var _0x2cc9bc={'grant_type':_0xa851('0x3f'),'refresh_token':_0xfbb23a[_0xa851('0x3c')],'scope':getAccessTokenScope(_0xfbb23a),'redirect_uri':_0xfbb23a['data4'],'client_id':_0xfbb23a[_0xa851('0x32')],'client_secret':encryptor[_0xa851('0x40')](_0xfbb23a[_0xa851('0x41')])};var _0x17f3fe={'method':_0xa851('0x42'),'uri':MICROSOFT_AUTH_URL[_0xa851('0x1c')]('{TENANT_ID}',_0xfbb23a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cc9bc,'json':!![]};return rp(_0x17f3fe);})[_0xa851('0x3b')](function(_0x37c8b3){_0x126e37['data5']=_0x37c8b3[_0xa851('0x43')];_0x126e37[_0xa851('0x3c')]=_0x37c8b3[_0xa851('0x3f')];return db[_0xa851('0x3d')][_0xa851('0x44')]({'data5':_0x126e37[_0xa851('0x45')],'data6':_0x126e37[_0xa851('0x3c')]},{'where':{'id':_0x126e37['id']}});})[_0xa851('0x3b')](function(){return _0x126e37;})[_0xa851('0x46')](function(_0x49ab4c){logger[_0xa851('0x47')](_0xa851('0x48'),_0x126e37['id'],_0x49ab4c);});}function getOauth2MicrosoftAccessToken(_0x284a1f,_0x394230){var _0x1a0425={'grant_type':_0xa851('0x49'),'code':_0x284a1f,'scope':getAccessTokenScope(_0x394230),'redirect_uri':_0x394230['data4'],'client_id':_0x394230[_0xa851('0x32')],'client_secret':encryptor[_0xa851('0x40')](_0x394230['data3'])};var _0x39dce0={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa851('0x1c')](_0xa851('0x1d'),_0x394230[_0xa851('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a0425,'json':!![]};return rp(_0x39dce0);}function startRefreshInterval(_0x50f3a3){var _0x3bcde2=schedule['intervals'];if(_0x3bcde2[_0x50f3a3['id']])clearInterval(_0x3bcde2[_0x50f3a3['id']]);_0x3bcde2[_0x50f3a3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa851('0x4a')](this,{'id':_0x50f3a3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa851('0x4b')]=_0x3bcde2;}function startAllRefreshIntervals(){return db[_0xa851('0x3d')][_0xa851('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa851('0x3b')](function(_0x10d51b){var _0x3d8588=_0x10d51b[_0xa851('0x14')](function(_0x272568){return refreshOauth2MicrosoftAccessToken(_0x272568)[_0xa851('0x3b')](function(_0x16fa69){startRefreshInterval(_0x16fa69);});});return Promise[_0xa851('0x4d')](_0x3d8588);})[_0xa851('0x46')](function(_0x3597e1){var _0x3de1a4=_0x3597e1?util[_0xa851('0x4e')](_0x3597e1,{'showHidden':![],'depth':null}):'';logger[_0xa851('0x47')](_0xa851('0x4f'),_0x3de1a4);});}module[_0xa851('0x50')]={'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 5919e09..e5f827c 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 _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x753c,0x96));var _0xc753=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x753c[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});}
\ No newline at end of file
+var _0x07fa=['../../config/utils','../../config/logger','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x580c7f,_0x22bd0f){var _0x27b5e9=function(_0x3636f7){while(--_0x3636f7){_0x580c7f['push'](_0x580c7f['shift']());}};_0x27b5e9(++_0x22bd0f);}(_0x07fa,0x177));var _0xa07f=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x07fa[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));var BPromise=require(_0xa07f('0x2'));var rs=require(_0xa07f('0x3'));var fs=require('fs');var Redis=require(_0xa07f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa07f('0x5'));var logger=require(_0xa07f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa07f('0x7')][_0xa07f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x509d7a,_0x2ad2ff,_0x575be1){return new BPromise(function(_0x4eea76,_0x5d82e9){return client['request'](_0x509d7a,_0x575be1)[_0xa07f('0x9')](function(_0x288476){logger['info'](_0xa07f('0xa'),_0x2ad2ff,_0xa07f('0xb'));logger[_0xa07f('0xc')](_0xa07f('0xd'),_0x2ad2ff,_0xa07f('0xb'),JSON[_0xa07f('0xe')](_0x288476));if(_0x288476[_0xa07f('0xf')]){if(_0x288476[_0xa07f('0xf')]['code']===0x1f4){logger[_0xa07f('0xf')](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x5d82e9(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x4eea76(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}else{logger[_0xa07f('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2ad2ff,_0xa07f('0xb'));_0x4eea76(_0x288476[_0xa07f('0x12')][_0xa07f('0x10')]);}})[_0xa07f('0x13')](function(_0x4090a1){logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x4090a1);_0x5d82e9(_0x4090a1);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e34ccfa..7ad59d5 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b1a74,_0x431559){_0x3b1a74=_0x3b1a74-0x0;var _0x58b051=_0x5f2f[_0x3b1a74];return _0x58b051;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x1261,0x144));var _0x1126=function(_0x1b640f,_0x215390){_0x1b640f=_0x1b640f-0x0;var _0x560770=_0x1261[_0x1b640f];return _0x560770;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 7333768..dc38b20 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 _0x1e65=['STRING','sequelize','exports','name'];(function(_0x3a3daf,_0x379493){var _0x19eabe=function(_0x16b63d){while(--_0x16b63d){_0x3a3daf['push'](_0x3a3daf['shift']());}};_0x19eabe(++_0x379493);}(_0x1e65,0xed));var _0x51e6=function(_0xfc7786,_0x3fc5e9){_0xfc7786=_0xfc7786-0x0;var _0x2d5f07=_0x1e65[_0xfc7786];return _0x2d5f07;};'use strict';var Sequelize=require(_0x51e6('0x0'));module[_0x51e6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x51e6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x51e6('0x3')]},'companyId':{'type':Sequelize[_0x51e6('0x3')]},'website':{'type':Sequelize[_0x51e6('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x51e6('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x51e6('0x3')]},'city':{'type':Sequelize[_0x51e6('0x3')]},'country':{'type':Sequelize[_0x51e6('0x3')]},'email':{'type':Sequelize[_0x51e6('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x51e6('0x3')]},'sStreet':{'type':Sequelize[_0x51e6('0x3')]},'sPostalCode':{'type':Sequelize[_0x51e6('0x3')]},'sCity':{'type':Sequelize[_0x51e6('0x3')]},'sCountry':{'type':Sequelize[_0x51e6('0x3')]},'description':{'type':Sequelize[_0x51e6('0x3')]}};
\ No newline at end of file
+var _0x3600=['name','sequelize','STRING'];(function(_0x46553d,_0x12a55d){var _0x43b6cf=function(_0x253742){while(--_0x253742){_0x46553d['push'](_0x46553d['shift']());}};_0x43b6cf(++_0x12a55d);}(_0x3600,0x13f));var _0x0360=function(_0x10970e,_0x474896){_0x10970e=_0x10970e-0x0;var _0x2ac428=_0x3600[_0x10970e];return _0x2ac428;};'use strict';var Sequelize=require(_0x0360('0x0'));module['exports']={'name':{'type':Sequelize[_0x0360('0x1')],'unique':_0x0360('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0360('0x1')]},'companyId':{'type':Sequelize[_0x0360('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0360('0x1')]},'fax':{'type':Sequelize[_0x0360('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0360('0x1')]},'postalCode':{'type':Sequelize[_0x0360('0x1')]},'city':{'type':Sequelize[_0x0360('0x1')]},'country':{'type':Sequelize[_0x0360('0x1')]},'email':{'type':Sequelize[_0x0360('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x0360('0x1')]},'sPostalCode':{'type':Sequelize[_0x0360('0x1')]},'sCity':{'type':Sequelize[_0x0360('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0360('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e345332..743ace8 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 _0x75a3=['Companies','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','CmCompany','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x5c5bf2,_0x1dfb92){var _0x28780f=function(_0x23d779){while(--_0x23d779){_0x5c5bf2['push'](_0x5c5bf2['shift']());}};_0x28780f(++_0x1dfb92);}(_0x75a3,0x6d));var _0x375a=function(_0x296b3d,_0x404cce){_0x296b3d=_0x296b3d-0x0;var _0x44a4cd=_0x75a3[_0x296b3d];return _0x44a4cd;};'use strict';var emlformat=require(_0x375a('0x0'));var rimraf=require(_0x375a('0x1'));var zipdir=require(_0x375a('0x2'));var jsonpatch=require(_0x375a('0x3'));var rp=require(_0x375a('0x4'));var moment=require(_0x375a('0x5'));var BPromise=require(_0x375a('0x6'));var Mustache=require(_0x375a('0x7'));var util=require(_0x375a('0x8'));var path=require(_0x375a('0x9'));var sox=require(_0x375a('0xa'));var csv=require(_0x375a('0xb'));var ejs=require(_0x375a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x375a('0xd'));var squel=require(_0x375a('0xe'));var crypto=require(_0x375a('0xf'));var jsforce=require(_0x375a('0x10'));var deskjs=require(_0x375a('0x11'));var toCsv=require(_0x375a('0xb'));var querystring=require(_0x375a('0x12'));var Papa=require(_0x375a('0x13'));var Redis=require(_0x375a('0x14'));var authService=require(_0x375a('0x15'));var qs=require(_0x375a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x375a('0x17'));var logger=require('../../config/logger')(_0x375a('0x18'));var utils=require(_0x375a('0x19'));var config=require(_0x375a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x375a('0x1b'))['db'];function respondWithStatusCode(_0xede579,_0x371a08){_0x371a08=_0x371a08||0xcc;return function(_0x4c1926){if(_0x4c1926){return _0xede579[_0x375a('0x1c')](_0x371a08);}return _0xede579[_0x375a('0x1d')](_0x371a08)['end']();};}function respondWithResult(_0x1dd9a9,_0x26002f){_0x26002f=_0x26002f||0xc8;return function(_0x5185ba){if(_0x5185ba){return _0x1dd9a9[_0x375a('0x1d')](_0x26002f)[_0x375a('0x1e')](_0x5185ba);}};}function respondWithFilteredResult(_0x32add6,_0x4a556f){return function(_0xed2d7f){if(_0xed2d7f){var _0x2d8982=typeof _0x4a556f[_0x375a('0x1f')]===_0x375a('0x20')&&typeof _0x4a556f[_0x375a('0x21')]===_0x375a('0x20');var _0x12cdab=_0xed2d7f['count'];var _0x2ce6ec=_0x2d8982?0x0:_0x4a556f[_0x375a('0x1f')];var _0x1cc674=_0x2d8982?_0xed2d7f[_0x375a('0x22')]:_0x4a556f[_0x375a('0x1f')]+_0x4a556f[_0x375a('0x21')];var _0x59123b;if(_0x1cc674>=_0x12cdab){_0x1cc674=_0x12cdab;_0x59123b=0xc8;}else{_0x59123b=0xce;}_0x32add6[_0x375a('0x1d')](_0x59123b);return _0x32add6[_0x375a('0x23')](_0x375a('0x24'),_0x2ce6ec+'-'+_0x1cc674+'/'+_0x12cdab)['json'](_0xed2d7f);}return null;};}function patchUpdates(_0x5b7dca){return function(_0xa27aa){try{jsonpatch[_0x375a('0x25')](_0xa27aa,_0x5b7dca,!![]);}catch(_0x47d38d){return BPromise['reject'](_0x47d38d);}return _0xa27aa[_0x375a('0x26')]();};}function saveUpdates(_0x484932,_0x3f362d){return function(_0xd590b4){if(_0xd590b4){return _0xd590b4[_0x375a('0x27')](_0x484932)[_0x375a('0x28')](function(_0x301ce9){return _0x301ce9;});}return null;};}function removeEntity(_0x8b48e,_0xe0d868){return function(_0x599eae){if(_0x599eae){return _0x599eae[_0x375a('0x29')]()[_0x375a('0x28')](function(){var _0x3c666f=_0x599eae[_0x375a('0x2a')]({'plain':!![]});var _0x1185e2='Companies';return db[_0x375a('0x2b')][_0x375a('0x29')]({'where':{'type':_0x1185e2,'resourceId':_0x3c666f['id']}})['then'](function(){return _0x599eae;});})['then'](function(){_0x8b48e[_0x375a('0x1d')](0xcc)[_0x375a('0x2c')]();});}};}function handleEntityNotFound(_0x15fda2,_0x3d567c){return function(_0x307efb){if(!_0x307efb){_0x15fda2[_0x375a('0x1c')](0x194);}return _0x307efb;};}function handleError(_0x3fb9c1,_0x40184e){_0x40184e=_0x40184e||0x1f4;return function(_0x50fe35){logger['error'](_0x50fe35[_0x375a('0x2d')]);if(_0x50fe35['name']){delete _0x50fe35[_0x375a('0x2e')];}_0x3fb9c1[_0x375a('0x1d')](_0x40184e)[_0x375a('0x2f')](_0x50fe35);};}exports[_0x375a('0x30')]=function(_0x1df059,_0xe3cd51){var _0x361f30={},_0x1de132={},_0x278d75={'count':0x0,'rows':[]};return db[_0x375a('0x31')]['describe']()[_0x375a('0x28')](function(_0x475f1b){_0x1de132['model']=_['keys'](_0x475f1b);_0x1de132[_0x375a('0x32')]=_[_0x375a('0x33')](_0x1df059[_0x375a('0x32')]);_0x1de132['filters']=_[_0x375a('0x34')](_0x1de132[_0x375a('0x35')],_0x1de132[_0x375a('0x32')]);_0x361f30['attributes']=_['intersection'](_0x1de132[_0x375a('0x35')],qs[_0x375a('0x36')](_0x1df059[_0x375a('0x32')][_0x375a('0x36')]));_0x361f30[_0x375a('0x37')]=_0x361f30[_0x375a('0x37')][_0x375a('0x38')]?_0x361f30[_0x375a('0x37')]:_0x1de132['model'];if(!_0x1df059['query'][_0x375a('0x39')](_0x375a('0x3a'))){_0x361f30['limit']=qs[_0x375a('0x21')](_0x1df059[_0x375a('0x32')][_0x375a('0x21')]);_0x361f30[_0x375a('0x1f')]=qs[_0x375a('0x1f')](_0x1df059[_0x375a('0x32')][_0x375a('0x1f')]);}_0x361f30[_0x375a('0x3b')]=qs['sort'](_0x1df059[_0x375a('0x32')][_0x375a('0x3c')]);_0x361f30[_0x375a('0x3d')]=qs[_0x375a('0x3e')](_[_0x375a('0x3f')](_0x1df059[_0x375a('0x32')],_0x1de132[_0x375a('0x3e')]),_0x475f1b);if(_0x1df059[_0x375a('0x32')][_0x375a('0x40')]){_0x361f30[_0x375a('0x3d')]=_[_0x375a('0x41')](_0x361f30[_0x375a('0x3d')],{'$or':_[_0x375a('0x42')](_0x361f30[_0x375a('0x37')],function(_0x4cb727){var _0x2520ad={};_0x2520ad[_0x4cb727]={'$like':'%'+_0x1df059['query']['filter']+'%'};return _0x2520ad;})});}_0x361f30=_['merge']({},_0x361f30,_0x1df059[_0x375a('0x43')]);var _0x64fa53={'where':_0x361f30[_0x375a('0x3d')]};return db['CmCompany']['count'](_0x64fa53)[_0x375a('0x28')](function(_0x21ee25){_0x278d75[_0x375a('0x22')]=_0x21ee25;if(_0x1df059[_0x375a('0x32')][_0x375a('0x44')]){_0x361f30[_0x375a('0x45')]=[{'all':!![]}];}return db[_0x375a('0x31')][_0x375a('0x46')](_0x361f30);})[_0x375a('0x28')](function(_0xeb0123){_0x278d75[_0x375a('0x47')]=_0xeb0123;return _0x278d75;})[_0x375a('0x28')](respondWithFilteredResult(_0xe3cd51,_0x361f30))['catch'](handleError(_0xe3cd51,null));})[_0x375a('0x48')](handleError(_0xe3cd51,null));};exports[_0x375a('0x49')]=function(_0x1f37c4,_0xfe202c){var _0x5adbb1={'raw':![],'where':{'id':_0x1f37c4[_0x375a('0x4a')]['id']}},_0x23460e={};_0x23460e[_0x375a('0x35')]=_[_0x375a('0x33')](db[_0x375a('0x31')]['rawAttributes']);_0x23460e[_0x375a('0x32')]=_[_0x375a('0x33')](_0x1f37c4[_0x375a('0x32')]);_0x23460e['filters']=_[_0x375a('0x34')](_0x23460e[_0x375a('0x35')],_0x23460e['query']);_0x5adbb1[_0x375a('0x37')]=_[_0x375a('0x34')](_0x23460e[_0x375a('0x35')],qs[_0x375a('0x36')](_0x1f37c4[_0x375a('0x32')][_0x375a('0x36')]));_0x5adbb1[_0x375a('0x37')]=_0x5adbb1[_0x375a('0x37')]['length']?_0x5adbb1[_0x375a('0x37')]:_0x23460e['model'];if(_0x1f37c4[_0x375a('0x32')][_0x375a('0x44')]){_0x5adbb1['include']=[{'all':!![]}];}_0x5adbb1=_[_0x375a('0x41')]({},_0x5adbb1,_0x1f37c4['options']);return db['CmCompany']['find'](_0x5adbb1)[_0x375a('0x28')](handleEntityNotFound(_0xfe202c,null))[_0x375a('0x28')](respondWithResult(_0xfe202c,null))['catch'](handleError(_0xfe202c,null));};exports['create']=function(_0x5b16c0,_0x55651d){return db[_0x375a('0x31')][_0x375a('0x4b')](_0x5b16c0[_0x375a('0x4c')],{})[_0x375a('0x28')](function(_0x3c2da3){var _0x45e4de=_0x5b16c0['user'][_0x375a('0x2a')]({'plain':!![]});if(!_0x45e4de)throw new Error(_0x375a('0x4d'));if(_0x45e4de['role']===_0x375a('0x4e')){var _0x2c558b=_0x3c2da3[_0x375a('0x2a')]({'plain':!![]});var _0x538a5a=_0x375a('0x4f');return db[_0x375a('0x50')]['find']({'where':{'name':_0x538a5a,'userProfileId':_0x45e4de[_0x375a('0x51')]},'raw':!![]})['then'](function(_0x3611d6){if(_0x3611d6&&_0x3611d6[_0x375a('0x52')]===0x0){return db[_0x375a('0x2b')][_0x375a('0x4b')]({'name':_0x2c558b[_0x375a('0x2e')],'resourceId':_0x2c558b['id'],'type':_0x3611d6['name'],'sectionId':_0x3611d6['id']},{})[_0x375a('0x28')](function(){return _0x3c2da3;});}else{return _0x3c2da3;}})[_0x375a('0x48')](function(_0x5db899){logger[_0x375a('0x53')](_0x375a('0x54'),_0x5db899);throw _0x5db899;});}return _0x3c2da3;})[_0x375a('0x28')](respondWithResult(_0x55651d,0xc9))['catch'](handleError(_0x55651d,null));};exports['update']=function(_0x2bfb02,_0x4c7e76){if(_0x2bfb02[_0x375a('0x4c')]['id']){delete _0x2bfb02[_0x375a('0x4c')]['id'];}return db[_0x375a('0x31')][_0x375a('0x55')]({'where':{'id':_0x2bfb02[_0x375a('0x4a')]['id']}})[_0x375a('0x28')](handleEntityNotFound(_0x4c7e76,null))[_0x375a('0x28')](saveUpdates(_0x2bfb02[_0x375a('0x4c')],null))[_0x375a('0x28')](respondWithResult(_0x4c7e76,null))[_0x375a('0x48')](handleError(_0x4c7e76,null));};exports[_0x375a('0x29')]=function(_0x58171d,_0x2bb4fa){return db['CmCompany'][_0x375a('0x55')]({'where':{'id':_0x58171d[_0x375a('0x4a')]['id']}})[_0x375a('0x28')](handleEntityNotFound(_0x2bb4fa,null))[_0x375a('0x28')](removeEntity(_0x2bb4fa,null))[_0x375a('0x48')](handleError(_0x2bb4fa,null));};exports['describe']=function(_0x43341c,_0x5cdd2f){return db[_0x375a('0x31')][_0x375a('0x56')]()['then'](respondWithResult(_0x5cdd2f,null))[_0x375a('0x48')](handleError(_0x5cdd2f,null));};exports[_0x375a('0x57')]=function(_0x7aa24b,_0x390648,_0x663ab0){return db['CmContact']['find']({'where':{'id':_0x7aa24b['params']['id']}})['then'](handleEntityNotFound(_0x390648,null))[_0x375a('0x28')](function(_0xecee74){if(_0xecee74){return _0xecee74[_0x375a('0x57')](_0x7aa24b[_0x375a('0x4c')][_0x375a('0x58')],_[_0x375a('0x59')](_0x7aa24b[_0x375a('0x4c')],[_0x375a('0x58'),'id'])||{});}})[_0x375a('0x28')](respondWithResult(_0x390648,null))[_0x375a('0x48')](handleError(_0x390648,null));};exports[_0x375a('0x5a')]=function(_0xf0112a,_0x20419f,_0x3ee3b1){var _0x565979={};var _0x63382e={};var _0x36b6ad;var _0x186c4d;return db[_0x375a('0x31')][_0x375a('0x5b')]({'where':{'id':_0xf0112a[_0x375a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20419f,null))['then'](function(_0x499138){if(_0x499138){_0x36b6ad=_0x499138;_0x63382e['model']=_[_0x375a('0x33')](db[_0x375a('0x5c')][_0x375a('0x5d')]);_0x63382e[_0x375a('0x32')]=_[_0x375a('0x33')](_0xf0112a[_0x375a('0x32')]);_0x63382e[_0x375a('0x3e')]=_[_0x375a('0x34')](_0x63382e[_0x375a('0x35')],_0x63382e[_0x375a('0x32')]);_0x565979[_0x375a('0x37')]=_['intersection'](_0x63382e[_0x375a('0x35')],qs[_0x375a('0x36')](_0xf0112a[_0x375a('0x32')]['fields']));_0x565979[_0x375a('0x37')]=_0x565979[_0x375a('0x37')]['length']?_0x565979['attributes']:_0x63382e[_0x375a('0x35')];_0x565979[_0x375a('0x3b')]=qs[_0x375a('0x3c')](_0xf0112a[_0x375a('0x32')][_0x375a('0x3c')]);_0x565979[_0x375a('0x3d')]=qs[_0x375a('0x3e')](_[_0x375a('0x3f')](_0xf0112a[_0x375a('0x32')],_0x63382e[_0x375a('0x3e')]));if(_0xf0112a[_0x375a('0x32')][_0x375a('0x40')]){_0x565979[_0x375a('0x3d')]=_['merge'](_0x565979[_0x375a('0x3d')],{'$or':_[_0x375a('0x42')](_0x565979[_0x375a('0x37')],function(_0x406970){var _0x49de0c={};_0x49de0c[_0x406970]={'$like':'%'+_0xf0112a[_0x375a('0x32')][_0x375a('0x40')]+'%'};return _0x49de0c;})});}_0x565979=_[_0x375a('0x41')]({},_0x565979,_0xf0112a[_0x375a('0x43')]);return _0x36b6ad['getContacts'](_0x565979);}})[_0x375a('0x28')](function(_0x292815){if(_0x292815){_0x186c4d=_0x292815['length'];if(!_0xf0112a[_0x375a('0x32')]['hasOwnProperty']('nolimit')){_0x565979['limit']=qs[_0x375a('0x21')](_0xf0112a[_0x375a('0x32')][_0x375a('0x21')]);_0x565979[_0x375a('0x1f')]=qs['offset'](_0xf0112a['query'][_0x375a('0x1f')]);}return _0x36b6ad[_0x375a('0x5a')](_0x565979);}})[_0x375a('0x28')](function(_0x42580d){if(_0x42580d){return _0x42580d?{'count':_0x186c4d,'rows':_0x42580d}:null;}})[_0x375a('0x28')](respondWithResult(_0x20419f,null))[_0x375a('0x48')](handleError(_0x20419f,null));};
\ No newline at end of file
+var _0x7504=['keys','rawAttributes','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','omit','getContacts','pick','filter','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','save','destroy','get','Companies','UserProfileResource','then','sendStatus','error','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','options','findAll','rows','catch','show','params'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0x7504,0x119));var _0x4750=function(_0x58f345,_0x1ca759){_0x58f345=_0x58f345-0x0;var _0x273825=_0x7504[_0x58f345];return _0x273825;};'use strict';var emlformat=require(_0x4750('0x0'));var rimraf=require(_0x4750('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4750('0x2'));var rp=require('request-promise');var moment=require(_0x4750('0x3'));var BPromise=require(_0x4750('0x4'));var Mustache=require(_0x4750('0x5'));var util=require('util');var path=require(_0x4750('0x6'));var sox=require(_0x4750('0x7'));var csv=require(_0x4750('0x8'));var ejs=require(_0x4750('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4750('0xa'));var squel=require(_0x4750('0xb'));var crypto=require(_0x4750('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4750('0xd'));var Papa=require(_0x4750('0xe'));var Redis=require(_0x4750('0xf'));var authService=require(_0x4750('0x10'));var qs=require(_0x4750('0x11'));var as=require(_0x4750('0x12'));var hardwareService=require(_0x4750('0x13'));var logger=require(_0x4750('0x14'))('api');var utils=require(_0x4750('0x15'));var config=require(_0x4750('0x16'));var licenseUtil=require(_0x4750('0x17'));var db=require(_0x4750('0x18'))['db'];function respondWithStatusCode(_0x4cb885,_0x4be216){_0x4be216=_0x4be216||0xcc;return function(_0xbe024){if(_0xbe024){return _0x4cb885['sendStatus'](_0x4be216);}return _0x4cb885[_0x4750('0x19')](_0x4be216)[_0x4750('0x1a')]();};}function respondWithResult(_0x5f0992,_0x3adf3c){_0x3adf3c=_0x3adf3c||0xc8;return function(_0x456be2){if(_0x456be2){return _0x5f0992[_0x4750('0x19')](_0x3adf3c)['json'](_0x456be2);}};}function respondWithFilteredResult(_0x1ea736,_0x520433){return function(_0x50e9bc){if(_0x50e9bc){var _0x2f9032=typeof _0x520433[_0x4750('0x1b')]===_0x4750('0x1c')&&typeof _0x520433['limit']===_0x4750('0x1c');var _0xd67d55=_0x50e9bc['count'];var _0x42743f=_0x2f9032?0x0:_0x520433[_0x4750('0x1b')];var _0x35df59=_0x2f9032?_0x50e9bc[_0x4750('0x1d')]:_0x520433[_0x4750('0x1b')]+_0x520433['limit'];var _0xed3cd4;if(_0x35df59>=_0xd67d55){_0x35df59=_0xd67d55;_0xed3cd4=0xc8;}else{_0xed3cd4=0xce;}_0x1ea736[_0x4750('0x19')](_0xed3cd4);return _0x1ea736[_0x4750('0x1e')](_0x4750('0x1f'),_0x42743f+'-'+_0x35df59+'/'+_0xd67d55)['json'](_0x50e9bc);}return null;};}function patchUpdates(_0x37be60){return function(_0x468175){try{jsonpatch[_0x4750('0x20')](_0x468175,_0x37be60,!![]);}catch(_0x12b12c){return BPromise['reject'](_0x12b12c);}return _0x468175[_0x4750('0x21')]();};}function saveUpdates(_0x5d6284,_0x5613ac){return function(_0x7e2d){if(_0x7e2d){return _0x7e2d['update'](_0x5d6284)['then'](function(_0x5699c5){return _0x5699c5;});}return null;};}function removeEntity(_0xbf53af,_0x59b9ac){return function(_0x570c41){if(_0x570c41){return _0x570c41[_0x4750('0x22')]()['then'](function(){var _0x203287=_0x570c41[_0x4750('0x23')]({'plain':!![]});var _0x5e1dd7=_0x4750('0x24');return db[_0x4750('0x25')]['destroy']({'where':{'type':_0x5e1dd7,'resourceId':_0x203287['id']}})['then'](function(){return _0x570c41;});})[_0x4750('0x26')](function(){_0xbf53af['status'](0xcc)[_0x4750('0x1a')]();});}};}function handleEntityNotFound(_0x596b86,_0x1ffe7f){return function(_0x4dec51){if(!_0x4dec51){_0x596b86[_0x4750('0x27')](0x194);}return _0x4dec51;};}function handleError(_0x154991,_0x184431){_0x184431=_0x184431||0x1f4;return function(_0x42fb36){logger[_0x4750('0x28')](_0x42fb36[_0x4750('0x29')]);if(_0x42fb36[_0x4750('0x2a')]){delete _0x42fb36[_0x4750('0x2a')];}_0x154991['status'](_0x184431)[_0x4750('0x2b')](_0x42fb36);};}exports[_0x4750('0x2c')]=function(_0x1e7435,_0xd68080){var _0x1db08f={},_0x4ec871={},_0x2deb28={'count':0x0,'rows':[]};return db[_0x4750('0x2d')][_0x4750('0x2e')]()['then'](function(_0x2bccf3){_0x4ec871[_0x4750('0x2f')]=_['keys'](_0x2bccf3);_0x4ec871[_0x4750('0x30')]=_['keys'](_0x1e7435[_0x4750('0x30')]);_0x4ec871[_0x4750('0x31')]=_[_0x4750('0x32')](_0x4ec871[_0x4750('0x2f')],_0x4ec871[_0x4750('0x30')]);_0x1db08f[_0x4750('0x33')]=_[_0x4750('0x32')](_0x4ec871['model'],qs[_0x4750('0x34')](_0x1e7435[_0x4750('0x30')][_0x4750('0x34')]));_0x1db08f[_0x4750('0x33')]=_0x1db08f[_0x4750('0x33')]['length']?_0x1db08f['attributes']:_0x4ec871[_0x4750('0x2f')];if(!_0x1e7435[_0x4750('0x30')][_0x4750('0x35')](_0x4750('0x36'))){_0x1db08f[_0x4750('0x37')]=qs['limit'](_0x1e7435['query'][_0x4750('0x37')]);_0x1db08f[_0x4750('0x1b')]=qs[_0x4750('0x1b')](_0x1e7435['query'][_0x4750('0x1b')]);}_0x1db08f[_0x4750('0x38')]=qs['sort'](_0x1e7435[_0x4750('0x30')][_0x4750('0x39')]);_0x1db08f['where']=qs[_0x4750('0x31')](_['pick'](_0x1e7435[_0x4750('0x30')],_0x4ec871[_0x4750('0x31')]),_0x2bccf3);if(_0x1e7435[_0x4750('0x30')]['filter']){_0x1db08f[_0x4750('0x3a')]=_[_0x4750('0x3b')](_0x1db08f[_0x4750('0x3a')],{'$or':_[_0x4750('0x3c')](_0x1db08f[_0x4750('0x33')],function(_0x2872d3){var _0x360d7b={};_0x360d7b[_0x2872d3]={'$like':'%'+_0x1e7435[_0x4750('0x30')]['filter']+'%'};return _0x360d7b;})});}_0x1db08f=_[_0x4750('0x3b')]({},_0x1db08f,_0x1e7435[_0x4750('0x3d')]);var _0x376dda={'where':_0x1db08f[_0x4750('0x3a')]};return db[_0x4750('0x2d')][_0x4750('0x1d')](_0x376dda)[_0x4750('0x26')](function(_0x544091){_0x2deb28[_0x4750('0x1d')]=_0x544091;if(_0x1e7435[_0x4750('0x30')]['includeAll']){_0x1db08f['include']=[{'all':!![]}];}return db[_0x4750('0x2d')][_0x4750('0x3e')](_0x1db08f);})[_0x4750('0x26')](function(_0x4bf157){_0x2deb28[_0x4750('0x3f')]=_0x4bf157;return _0x2deb28;})['then'](respondWithFilteredResult(_0xd68080,_0x1db08f))['catch'](handleError(_0xd68080,null));})[_0x4750('0x40')](handleError(_0xd68080,null));};exports[_0x4750('0x41')]=function(_0x30cf4d,_0x51d131){var _0x5ce9ec={'raw':![],'where':{'id':_0x30cf4d[_0x4750('0x42')]['id']}},_0x5cda03={};_0x5cda03[_0x4750('0x2f')]=_[_0x4750('0x43')](db['CmCompany'][_0x4750('0x44')]);_0x5cda03[_0x4750('0x30')]=_[_0x4750('0x43')](_0x30cf4d[_0x4750('0x30')]);_0x5cda03[_0x4750('0x31')]=_[_0x4750('0x32')](_0x5cda03[_0x4750('0x2f')],_0x5cda03[_0x4750('0x30')]);_0x5ce9ec['attributes']=_[_0x4750('0x32')](_0x5cda03[_0x4750('0x2f')],qs[_0x4750('0x34')](_0x30cf4d['query'][_0x4750('0x34')]));_0x5ce9ec[_0x4750('0x33')]=_0x5ce9ec[_0x4750('0x33')][_0x4750('0x45')]?_0x5ce9ec[_0x4750('0x33')]:_0x5cda03[_0x4750('0x2f')];if(_0x30cf4d['query'][_0x4750('0x46')]){_0x5ce9ec[_0x4750('0x47')]=[{'all':!![]}];}_0x5ce9ec=_[_0x4750('0x3b')]({},_0x5ce9ec,_0x30cf4d[_0x4750('0x3d')]);return db[_0x4750('0x2d')]['find'](_0x5ce9ec)['then'](handleEntityNotFound(_0x51d131,null))['then'](respondWithResult(_0x51d131,null))[_0x4750('0x40')](handleError(_0x51d131,null));};exports[_0x4750('0x48')]=function(_0x294fd4,_0x5fb78f){return db['CmCompany']['create'](_0x294fd4['body'],{})['then'](function(_0x29ecc8){var _0x267a3d=_0x294fd4[_0x4750('0x49')][_0x4750('0x23')]({'plain':!![]});if(!_0x267a3d)throw new Error(_0x4750('0x4a'));if(_0x267a3d['role']===_0x4750('0x49')){var _0x457990=_0x29ecc8[_0x4750('0x23')]({'plain':!![]});var _0x4b77fc='Companies';return db[_0x4750('0x4b')][_0x4750('0x4c')]({'where':{'name':_0x4b77fc,'userProfileId':_0x267a3d['userProfileId']},'raw':!![]})[_0x4750('0x26')](function(_0x343a97){if(_0x343a97&&_0x343a97[_0x4750('0x4d')]===0x0){return db[_0x4750('0x25')][_0x4750('0x48')]({'name':_0x457990[_0x4750('0x2a')],'resourceId':_0x457990['id'],'type':_0x343a97['name'],'sectionId':_0x343a97['id']},{})[_0x4750('0x26')](function(){return _0x29ecc8;});}else{return _0x29ecc8;}})[_0x4750('0x40')](function(_0x3e48a4){logger[_0x4750('0x28')](_0x4750('0x4e'),_0x3e48a4);throw _0x3e48a4;});}return _0x29ecc8;})[_0x4750('0x26')](respondWithResult(_0x5fb78f,0xc9))['catch'](handleError(_0x5fb78f,null));};exports[_0x4750('0x4f')]=function(_0x389bbf,_0x1e50c1){if(_0x389bbf[_0x4750('0x50')]['id']){delete _0x389bbf[_0x4750('0x50')]['id'];}return db[_0x4750('0x2d')][_0x4750('0x4c')]({'where':{'id':_0x389bbf[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x1e50c1,null))[_0x4750('0x26')](saveUpdates(_0x389bbf[_0x4750('0x50')],null))[_0x4750('0x26')](respondWithResult(_0x1e50c1,null))[_0x4750('0x40')](handleError(_0x1e50c1,null));};exports[_0x4750('0x22')]=function(_0x587bd6,_0x1e0dc7){return db[_0x4750('0x2d')][_0x4750('0x4c')]({'where':{'id':_0x587bd6[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x1e0dc7,null))[_0x4750('0x26')](removeEntity(_0x1e0dc7,null))[_0x4750('0x40')](handleError(_0x1e0dc7,null));};exports['describe']=function(_0x3cba5b,_0x630488){return db[_0x4750('0x2d')][_0x4750('0x2e')]()['then'](respondWithResult(_0x630488,null))[_0x4750('0x40')](handleError(_0x630488,null));};exports[_0x4750('0x51')]=function(_0x1b257a,_0x307675,_0x5588a5){return db[_0x4750('0x52')]['find']({'where':{'id':_0x1b257a[_0x4750('0x42')]['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x307675,null))[_0x4750('0x26')](function(_0x300a9a){if(_0x300a9a){return _0x300a9a[_0x4750('0x51')](_0x1b257a[_0x4750('0x50')]['ids'],_[_0x4750('0x53')](_0x1b257a['body'],['ids','id'])||{});}})[_0x4750('0x26')](respondWithResult(_0x307675,null))['catch'](handleError(_0x307675,null));};exports[_0x4750('0x54')]=function(_0x463e34,_0x525600,_0x53c20a){var _0x1f20a1={};var _0x174ed9={};var _0x3bf0ce;var _0x3fc3b1;return db[_0x4750('0x2d')]['findOne']({'where':{'id':_0x463e34['params']['id']}})[_0x4750('0x26')](handleEntityNotFound(_0x525600,null))[_0x4750('0x26')](function(_0x373b2b){if(_0x373b2b){_0x3bf0ce=_0x373b2b;_0x174ed9['model']=_[_0x4750('0x43')](db[_0x4750('0x52')][_0x4750('0x44')]);_0x174ed9[_0x4750('0x30')]=_[_0x4750('0x43')](_0x463e34['query']);_0x174ed9[_0x4750('0x31')]=_[_0x4750('0x32')](_0x174ed9['model'],_0x174ed9[_0x4750('0x30')]);_0x1f20a1[_0x4750('0x33')]=_[_0x4750('0x32')](_0x174ed9[_0x4750('0x2f')],qs['fields'](_0x463e34[_0x4750('0x30')][_0x4750('0x34')]));_0x1f20a1[_0x4750('0x33')]=_0x1f20a1[_0x4750('0x33')][_0x4750('0x45')]?_0x1f20a1[_0x4750('0x33')]:_0x174ed9[_0x4750('0x2f')];_0x1f20a1['order']=qs[_0x4750('0x39')](_0x463e34[_0x4750('0x30')][_0x4750('0x39')]);_0x1f20a1[_0x4750('0x3a')]=qs[_0x4750('0x31')](_[_0x4750('0x55')](_0x463e34[_0x4750('0x30')],_0x174ed9['filters']));if(_0x463e34[_0x4750('0x30')]['filter']){_0x1f20a1[_0x4750('0x3a')]=_[_0x4750('0x3b')](_0x1f20a1[_0x4750('0x3a')],{'$or':_[_0x4750('0x3c')](_0x1f20a1[_0x4750('0x33')],function(_0x5d25fe){var _0x530e02={};_0x530e02[_0x5d25fe]={'$like':'%'+_0x463e34[_0x4750('0x30')][_0x4750('0x56')]+'%'};return _0x530e02;})});}_0x1f20a1=_['merge']({},_0x1f20a1,_0x463e34['options']);return _0x3bf0ce[_0x4750('0x54')](_0x1f20a1);}})[_0x4750('0x26')](function(_0x5c6ac3){if(_0x5c6ac3){_0x3fc3b1=_0x5c6ac3[_0x4750('0x45')];if(!_0x463e34['query']['hasOwnProperty'](_0x4750('0x36'))){_0x1f20a1[_0x4750('0x37')]=qs['limit'](_0x463e34[_0x4750('0x30')][_0x4750('0x37')]);_0x1f20a1['offset']=qs['offset'](_0x463e34[_0x4750('0x30')][_0x4750('0x1b')]);}return _0x3bf0ce[_0x4750('0x54')](_0x1f20a1);}})[_0x4750('0x26')](function(_0x1679b1){if(_0x1679b1){return _0x1679b1?{'count':_0x3fc3b1,'rows':_0x1679b1}:null;}})[_0x4750('0x26')](respondWithResult(_0x525600,null))[_0x4750('0x40')](handleError(_0x525600,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8e8ed48..d809c21 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 _0x10f5=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x52ab8e,_0x3fa0b4){var _0x45fad2=function(_0x58a826){while(--_0x58a826){_0x52ab8e['push'](_0x52ab8e['shift']());}};_0x45fad2(++_0x3fa0b4);}(_0x10f5,0x179));var _0x510f=function(_0x3f4574,_0x4f6461){_0x3f4574=_0x3f4574-0x0;var _0x4d139a=_0x10f5[_0x3f4574];return _0x4d139a;};'use strict';var _=require(_0x510f('0x0'));var util=require('util');var logger=require(_0x510f('0x1'))(_0x510f('0x2'));var moment=require(_0x510f('0x3'));var BPromise=require(_0x510f('0x4'));var rp=require(_0x510f('0x5'));var fs=require('fs');var path=require(_0x510f('0x6'));var rimraf=require('rimraf');var config=require(_0x510f('0x7'));var attributes=require(_0x510f('0x8'));module[_0x510f('0x9')]=function(_0x197eca,_0x3a9509){return _0x197eca[_0x510f('0xa')](_0x510f('0xb'),attributes,{'tableName':_0x510f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb601=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api'];(function(_0x40b241,_0x2ce6cc){var _0x22b4b1=function(_0x83fc40){while(--_0x83fc40){_0x40b241['push'](_0x40b241['shift']());}};_0x22b4b1(++_0x2ce6cc);}(_0xb601,0xa6));var _0x1b60=function(_0x1b68ff,_0x5e68a2){_0x1b68ff=_0x1b68ff-0x0;var _0x4b3b07=_0xb601[_0x1b68ff];return _0x4b3b07;};'use strict';var _=require('lodash');var util=require(_0x1b60('0x0'));var logger=require(_0x1b60('0x1'))(_0x1b60('0x2'));var moment=require(_0x1b60('0x3'));var BPromise=require(_0x1b60('0x4'));var rp=require(_0x1b60('0x5'));var fs=require('fs');var path=require(_0x1b60('0x6'));var rimraf=require(_0x1b60('0x7'));var config=require(_0x1b60('0x8'));var attributes=require(_0x1b60('0x9'));module[_0x1b60('0xa')]=function(_0x1779b4,_0x3e085c){return _0x1779b4[_0x1b60('0xb')](_0x1b60('0xc'),attributes,{'tableName':'cm_companies','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 ed2455e..73e82ff 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 _0x87d5=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x1e3a75,_0x2214ab){var _0x343613=function(_0x1ed92e){while(--_0x1ed92e){_0x1e3a75['push'](_0x1e3a75['shift']());}};_0x343613(++_0x2214ab);}(_0x87d5,0x12f));var _0x587d=function(_0x334fa0,_0x36282b){_0x334fa0=_0x334fa0-0x0;var _0x3e5ede=_0x87d5[_0x334fa0];return _0x3e5ede;};'use strict';var _=require(_0x587d('0x0'));var util=require(_0x587d('0x1'));var moment=require(_0x587d('0x2'));var BPromise=require(_0x587d('0x3'));var rs=require(_0x587d('0x4'));var fs=require('fs');var Redis=require(_0x587d('0x5'));var db=require(_0x587d('0x6'))['db'];var utils=require(_0x587d('0x7'));var logger=require(_0x587d('0x8'))('rpc');var config=require(_0x587d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x587d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6a819,_0x21c065,_0x1e8e8b){return new BPromise(function(_0x291c4d,_0x334418){return client[_0x587d('0xb')](_0xa6a819,_0x1e8e8b)[_0x587d('0xc')](function(_0x15c63f){logger[_0x587d('0xd')]('CmCompany,\x20%s,\x20%s',_0x21c065,'request\x20sent');logger[_0x587d('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x21c065,_0x587d('0xf'),JSON[_0x587d('0x10')](_0x15c63f));if(_0x15c63f['error']){if(_0x15c63f[_0x587d('0x11')][_0x587d('0x12')]===0x1f4){logger[_0x587d('0x11')]('CmCompany,\x20%s,\x20%s',_0x21c065,_0x15c63f['error'][_0x587d('0x13')]);return _0x334418(_0x15c63f[_0x587d('0x11')][_0x587d('0x13')]);}logger['error'](_0x587d('0x14'),_0x21c065,_0x15c63f[_0x587d('0x11')]['message']);return _0x291c4d(_0x15c63f[_0x587d('0x11')][_0x587d('0x13')]);}else{logger[_0x587d('0xd')](_0x587d('0x14'),_0x21c065,_0x587d('0xf'));_0x291c4d(_0x15c63f[_0x587d('0x15')][_0x587d('0x13')]);}})[_0x587d('0x16')](function(_0x3ac2e0){logger[_0x587d('0x11')](_0x587d('0x14'),_0x21c065,_0x3ac2e0);_0x334418(_0x3ac2e0);});});}
\ No newline at end of file
+var _0xb07e=['request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmCompany,\x20%s,\x20%s'];(function(_0x108c2f,_0x3fa957){var _0x38f2c8=function(_0x43b7dc){while(--_0x43b7dc){_0x108c2f['push'](_0x108c2f['shift']());}};_0x38f2c8(++_0x3fa957);}(_0xb07e,0x15b));var _0xeb07=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb07e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xeb07('0x0'));var util=require('util');var moment=require(_0xeb07('0x1'));var BPromise=require(_0xeb07('0x2'));var rs=require(_0xeb07('0x3'));var fs=require('fs');var Redis=require(_0xeb07('0x4'));var db=require(_0xeb07('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb07('0x6'))(_0xeb07('0x7'));var config=require(_0xeb07('0x8'));var jayson=require(_0xeb07('0x9'));var client=jayson['client'][_0xeb07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47eed7,_0x1e88a9,_0xe5063c){return new BPromise(function(_0x12a6cf,_0x5f7645){return client[_0xeb07('0xb')](_0x47eed7,_0xe5063c)['then'](function(_0x406895){logger['info'](_0xeb07('0xc'),_0x1e88a9,_0xeb07('0xd'));logger['debug'](_0xeb07('0xe'),_0x1e88a9,'request\x20sent',JSON[_0xeb07('0xf')](_0x406895));if(_0x406895[_0xeb07('0x10')]){if(_0x406895[_0xeb07('0x10')][_0xeb07('0x11')]===0x1f4){logger[_0xeb07('0x10')](_0xeb07('0xc'),_0x1e88a9,_0x406895[_0xeb07('0x10')]['message']);return _0x5f7645(_0x406895[_0xeb07('0x10')]['message']);}logger['error'](_0xeb07('0xc'),_0x1e88a9,_0x406895[_0xeb07('0x10')][_0xeb07('0x12')]);return _0x12a6cf(_0x406895[_0xeb07('0x10')][_0xeb07('0x12')]);}else{logger['info'](_0xeb07('0xc'),_0x1e88a9,_0xeb07('0xd'));_0x12a6cf(_0x406895[_0xeb07('0x13')][_0xeb07('0x12')]);}})['catch'](function(_0x2b04fc){logger[_0xeb07('0x10')]('CmCompany,\x20%s,\x20%s',_0x1e88a9,_0x2b04fc);_0x5f7645(_0x2b04fc);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 9e64c31..cbf62f0 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 _0x769b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','getContacts','post','/:id/contacts','put','update','delete','destroy','exports','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x769b,0x1e3));var _0xb769=function(_0x51c5d3,_0x13e47c){_0x51c5d3=_0x51c5d3-0x0;var _0xf47a28=_0x769b[_0x51c5d3];return _0xf47a28;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb769('0x0'));var timeout=require(_0xb769('0x1'));var express=require(_0xb769('0x2'));var router=express[_0xb769('0x3')]();var fs_extra=require(_0xb769('0x4'));var auth=require(_0xb769('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb769('0x6'));var controller=require(_0xb769('0x7'));router['get']('/',auth[_0xb769('0x8')](),controller[_0xb769('0x9')]);router[_0xb769('0xa')](_0xb769('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb769('0xa')](_0xb769('0xc'),auth['isAuthenticated'](),controller[_0xb769('0xd')]);router[_0xb769('0xa')]('/:id/contacts',auth[_0xb769('0x8')](),controller[_0xb769('0xe')]);router[_0xb769('0xf')]('/',auth[_0xb769('0x8')](),controller['create']);router[_0xb769('0xf')](_0xb769('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb769('0x11')]('/:id',auth[_0xb769('0x8')](),controller[_0xb769('0x12')]);router[_0xb769('0x13')]('/:id',auth[_0xb769('0x8')](),controller[_0xb769('0x14')]);module[_0xb769('0x15')]=router;
\ No newline at end of file
+var _0x4f73=['/:id','/:id/contacts','getContacts','post','create','addContacts','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x4f73,0x168));var _0x34f7=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x4f73[_0x57cb4f];return _0x29bb45;};'use strict';var multer=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var path=require('path');var timeout=require(_0x34f7('0x2'));var express=require(_0x34f7('0x3'));var router=express[_0x34f7('0x4')]();var fs_extra=require(_0x34f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x34f7('0x6'));var config=require(_0x34f7('0x7'));var controller=require(_0x34f7('0x8'));router[_0x34f7('0x9')]('/',auth[_0x34f7('0xa')](),controller[_0x34f7('0xb')]);router[_0x34f7('0x9')](_0x34f7('0xc'),auth[_0x34f7('0xa')](),controller[_0x34f7('0xd')]);router[_0x34f7('0x9')](_0x34f7('0xe'),auth[_0x34f7('0xa')](),controller['show']);router[_0x34f7('0x9')](_0x34f7('0xf'),auth[_0x34f7('0xa')](),controller[_0x34f7('0x10')]);router[_0x34f7('0x11')]('/',auth[_0x34f7('0xa')](),controller[_0x34f7('0x12')]);router['post']('/:id/contacts',auth[_0x34f7('0xa')](),controller[_0x34f7('0x13')]);router['put'](_0x34f7('0xe'),auth['isAuthenticated'](),controller[_0x34f7('0x14')]);router['delete'](_0x34f7('0xe'),auth[_0x34f7('0xa')](),controller['destroy']);module[_0x34f7('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index cef25fe..9a15dc0 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 _0xca35=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x1832db,_0x353897){var _0xbdc485=function(_0x40920d){while(--_0x40920d){_0x1832db['push'](_0x1832db['shift']());}};_0xbdc485(++_0x353897);}(_0xca35,0x1b7));var _0x5ca3=function(_0xab6a2b,_0x403a6b){_0xab6a2b=_0xab6a2b-0x0;var _0x33edba=_0xca35[_0xab6a2b];return _0x33edba;};'use strict';var _=require(_0x5ca3('0x0'));var Sequelize=require(_0x5ca3('0x1'));module[_0x5ca3('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5ca3('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5ca3('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ca3('0x4')]},'phone':{'type':Sequelize[_0x5ca3('0x3')]},'mobile':{'type':Sequelize[_0x5ca3('0x3')]},'fax':{'type':Sequelize[_0x5ca3('0x3')]},'email':{'type':Sequelize[_0x5ca3('0x3')]},'url':{'type':Sequelize[_0x5ca3('0x3')]},'facebook':{'type':Sequelize[_0x5ca3('0x3')]},'fb_data':{'type':Sequelize[_0x5ca3('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x5ca3('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5ca3('0x3')]},'line':{'type':Sequelize[_0x5ca3('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x5ca3('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x5ca3('0x5')](0x2)[_0x5ca3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5ca3('0x7')],'defaultValue':Sequelize[_0x5ca3('0x8')]}};
\ No newline at end of file
+var _0x4606=['INTEGER','DATE','NOW','sequelize','exports','STRING'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x4606,0x81));var _0x6460=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4606[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var Sequelize=require(_0x6460('0x0'));module[_0x6460('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x6460('0x2')]},'street':{'type':Sequelize[_0x6460('0x2')]},'postalCode':{'type':Sequelize[_0x6460('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6460('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6460('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6460('0x2')]},'fax':{'type':Sequelize[_0x6460('0x2')]},'email':{'type':Sequelize[_0x6460('0x2')]},'url':{'type':Sequelize[_0x6460('0x2')]},'facebook':{'type':Sequelize[_0x6460('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x6460('0x2')]},'teams':{'type':Sequelize[_0x6460('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6460('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x6460('0x2')]},'UserId':{'type':Sequelize[_0x6460('0x3')]},'priority':{'type':Sequelize[_0x6460('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6460('0x4')],'defaultValue':Sequelize[_0x6460('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 32e6e73..6be0793 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 _0x4017=['sequelize','toString','fields','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','params','catch','columnName','findAll','alias','custom','values','merge','body','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','get','$and','cf_%d','omit','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','options','nolimit','setTags','findOne','ids','getHoppers','CmHopper','ContactId','includeAll','include','CmHopperHistory','getHopperFinals','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','CompanyId','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','duration','note','userThirdDisposition','UserId','fullname','VoiceCallReport','startCase','Website','Account','closed','disposition','secondDisposition','thirdDisposition','Owner','createdAt','customerPort','osName','ratingMessage','ratingType','ratingValue','mail','subject','substatus','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','parseSearch','search','sqlOperator','conditions','find','Tag','value','map','union','User','and','dateOfBirth','datetime','castTo','text','start','filter','isNil','Contact','push','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','QueryTypes','clone','c.id','DESC','having','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL'];(function(_0x1f67bc,_0x3e86b4){var _0x2959aa=function(_0x472da1){while(--_0x472da1){_0x1f67bc['push'](_0x1f67bc['shift']());}};_0x2959aa(++_0x3e86b4);}(_0x4017,0xa0));var _0x7401=function(_0xe5dd64,_0x73a5ea){_0xe5dd64=_0xe5dd64-0x0;var _0x124d3f=_0x4017[_0xe5dd64];return _0x124d3f;};'use strict';var moment=require('moment');var BPromise=require(_0x7401('0x0'));var util=require(_0x7401('0x1'));var path=require(_0x7401('0x2'));var fs=require('fs');var _=require(_0x7401('0x3'));var squel=require(_0x7401('0x4'));var Papa=require(_0x7401('0x5'));var Redis=require(_0x7401('0x6'));var qs=require(_0x7401('0x7'));var as=require(_0x7401('0x8'));var logger=require(_0x7401('0x9'))('api');var config=require(_0x7401('0xa'));var db=require('../../mysqldb')['db'];config[_0x7401('0xb')]=_[_0x7401('0xc')](config['redis'],{'host':_0x7401('0xd'),'port':0x18eb});var socket=require(_0x7401('0xe'))(new Redis(config[_0x7401('0xb')]));require(_0x7401('0xf'))[_0x7401('0x10')](socket);function respondWithResult(_0x82532,_0x48ff83){_0x48ff83=_0x48ff83||0xc8;return function(_0x444431){if(_0x444431){return _0x82532[_0x7401('0x11')](_0x48ff83)[_0x7401('0x12')](_0x444431);}};}function respondWithFilteredResult(_0x1e948d,_0x34631a){return function(_0x165a14){if(_0x165a14){var _0x56fd36=typeof _0x34631a[_0x7401('0x13')]===_0x7401('0x14')&&typeof _0x34631a[_0x7401('0x15')]==='undefined';var _0x1a3c9c=_0x165a14[_0x7401('0x16')];var _0x363455=_0x56fd36?0x0:_0x34631a[_0x7401('0x13')];var _0xa56308=_0x56fd36?_0x165a14[_0x7401('0x16')]:_0x34631a[_0x7401('0x13')]+_0x34631a[_0x7401('0x15')];var _0x39130d;if(_0xa56308>=_0x1a3c9c){_0xa56308=_0x1a3c9c;_0x39130d=0xc8;}else{_0x39130d=0xce;}_0x1e948d[_0x7401('0x11')](_0x39130d);return _0x1e948d[_0x7401('0x17')](_0x7401('0x18'),_0x363455+'-'+_0xa56308+'/'+_0x1a3c9c)[_0x7401('0x12')](_0x165a14);}return null;};}function saveUpdates(_0x3c4ffc){return function(_0x40dde2){if(_0x40dde2){return _0x40dde2[_0x7401('0x19')](_0x3c4ffc)[_0x7401('0x1a')](function(_0x47ebf0){return _0x47ebf0;});}return null;};}function removeEntity(_0x34c5d){return function(_0x443fc2){if(_0x443fc2){return _0x443fc2[_0x7401('0x1b')]()['then'](function(){_0x34c5d[_0x7401('0x11')](0xcc)[_0x7401('0x1c')]();});}};}function handleEntityNotFound(_0x13acc0){return function(_0x47cf51){if(!_0x47cf51){_0x13acc0['sendStatus'](0x194);}return _0x47cf51;};}function handleError(_0x31443e,_0x185ebb){_0x185ebb=_0x185ebb||0x1f4;return function(_0x3c5f7d){logger[_0x7401('0x1d')](_0x3c5f7d[_0x7401('0x1e')]);if(_0x3c5f7d['name']){delete _0x3c5f7d[_0x7401('0x1f')];}_0x31443e[_0x7401('0x11')](_0x185ebb)[_0x7401('0x20')](_0x3c5f7d);};}exports[_0x7401('0x21')]=function(_0x34a4b6,_0xfa6d9b){var _0xbe16b1={},_0x26c0d9={},_0x368814={'count':0x0,'rows':[]};return db[_0x7401('0x22')][_0x7401('0x23')]()['then'](function(_0x5be95e){var _0x2eebb5=[];for(var _0x2d3521=0x0;_0x2d3521
'];(function(_0xe7ad6,_0x25391c){var _0x5af158=function(_0x3faa68){while(--_0x3faa68){_0xe7ad6['push'](_0xe7ad6['shift']());}};_0x5af158(++_0x25391c);}(_0xf616,0x176));var _0x6f61=function(_0x18ec5c,_0x258212){_0x18ec5c=_0x18ec5c-0x0;var _0x5569e3=_0xf616[_0x18ec5c];return _0x5569e3;};'use strict';var _=require('lodash');var moment=require(_0x6f61('0x0'));var random=require(_0x6f61('0x1'));var fs=require('fs');var path=require(_0x6f61('0x2'));var util=require(_0x6f61('0x3'));var tnef=require(_0x6f61('0x4'));var logger=require(_0x6f61('0x5'))(_0x6f61('0x6'));var config=require(_0x6f61('0x7'));function getAddress(_0x44292e){var _0x63ef8b=_['head'](_0x44292e[_0x6f61('0x8')]);return _0x63ef8b&&_0x63ef8b[_0x6f61('0x9')]?_0x63ef8b['address']:_0x6f61('0xa')+random[_0x6f61('0xb')](0x6)+_0x6f61('0xc');}function getFirstName(_0x242ef6){var _0x527fb6=_['head'](_0x242ef6[_0x6f61('0x8')]);if(_0x527fb6&&_0x527fb6['name']){if(_0x527fb6[_0x6f61('0xd')]==_0x527fb6[_0x6f61('0x9')]){return _0x527fb6[_0x6f61('0xd')][_0x6f61('0xe')](0x0,_0x527fb6['name'][_0x6f61('0xf')]('@'));}var _0x1ea4ff=_0x527fb6[_0x6f61('0xd')]['split'](/\s+/);return _0x1ea4ff[_0x6f61('0x10')]>0x1?_0x1ea4ff[_0x6f61('0x11')](0x0,-0x1)[_0x6f61('0x12')]('\x20'):_0x527fb6['name'];}return'Anonymous';}function getLastName(_0x1cc692){var _0x1f9737=_['head'](_0x1cc692[_0x6f61('0x8')]);if(_0x1f9737&&_0x1f9737[_0x6f61('0xd')]){var _0x3b8b5d=_0x1f9737[_0x6f61('0xd')][_0x6f61('0x13')](/\s+/);return _0x3b8b5d[_0x6f61('0x10')]>0x1?_0x3b8b5d[_0x6f61('0x14')]():'';}return'';}function getMails(_0x4165d0,_0x2063df){var _0x5f2bc4='';for(var _0x1ae315=0x0;_0x1ae315<_0x2063df[_0x6f61('0x8')]['length'];_0x1ae315+=0x1){if(_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]!==_0x4165d0){if(!_['isEmpty'](_0x5f2bc4)){_0x5f2bc4+=',';}_0x5f2bc4+=_0x2063df['value'][_0x1ae315][_0x6f61('0xd')]||_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]||'';_0x5f2bc4+='\x20<';_0x5f2bc4+=_0x2063df['value'][_0x1ae315][_0x6f61('0x9')]?_0x2063df[_0x6f61('0x8')][_0x1ae315][_0x6f61('0x9')]:_0x6f61('0xa')+random['generate'](0x6)+_0x6f61('0xc');_0x5f2bc4+='>';}}return _0x5f2bc4;}function parseEmail(_0x213c86,_0x474f3c,_0x2f57af){if(_0x474f3c[_0x6f61('0x15')]){var _0x3d9421=/