From d0187c2045535a70324fb8af354784ac1c962452 Mon Sep 17 00:00:00 2001
From: Andrea Cuccaro
Date: Thu, 30 Sep 2021 11:53:20 +0200
Subject: [PATCH] Built motion from commit d62f9d50.|2.5.35
---
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 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/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/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 +-
1151 files changed, 1151 insertions(+), 1151 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f54d75d..bb7c429 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-09-30T09:10:30.490Z",
+ "time": "2021-09-30T09:44:15.318Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index fff9a38..e51665b 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-30T09:10:30.490Z",
+ "time": "2021-09-30T09:44:15.318Z",
"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 2256a09..324589a 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 _0xc077=['VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xc077,0x16f));var _0x7c07=function(_0x1613d9,_0x2f583e){_0x1613d9=_0x1613d9-0x0;var _0x1ab5e0=_0xc077[_0x1613d9];return _0x1ab5e0;};'use strict';var Sequelize=require('sequelize');module[_0x7c07('0x0')]={'name':{'type':Sequelize[_0x7c07('0x1')],'get':function(_0x324e08){return this[_0x7c07('0x2')]('action');}},'action':{'type':Sequelize[_0x7c07('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7c07('0x4'),_0x7c07('0x5'),_0x7c07('0x6'),_0x7c07('0x7'),_0x7c07('0x8'),_0x7c07('0x9'),_0x7c07('0xa'),'script']],'msg':_0x7c07('0xb')}},'comment':_0x7c07('0xb')},'data1':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comment':_0x7c07('0xc')},'data2':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comments':_0x7c07('0xd')},'data6':{'type':Sequelize[_0x7c07('0x3')],'comments':_0x7c07('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x7c07('0xf')}};
\ No newline at end of file
+var _0xbc75=['TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbc75,0xad));var _0x5bc7=function(_0x5c5479,_0x3c8617){_0x5c5479=_0x5c5479-0x0;var _0xff9413=_0xbc75[_0x5c5479];return _0xff9413;};'use strict';var Sequelize=require(_0x5bc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bc7('0x1')],'get':function(_0x16a00d){return this[_0x5bc7('0x2')](_0x5bc7('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5bc7('0x4'),_0x5bc7('0x5'),_0x5bc7('0x6'),'urlForward',_0x5bc7('0x7'),_0x5bc7('0x8'),_0x5bc7('0x9')]],'msg':_0x5bc7('0xa')}},'comment':_0x5bc7('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xc')},'data3':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xd')},'data4':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xe')},'data5':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xf')},'data6':{'type':Sequelize[_0x5bc7('0xb')],'comments':_0x5bc7('0x10')},'data7':{'type':Sequelize[_0x5bc7('0x11')],'comments':_0x5bc7('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index fe754e2..33114db 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 _0x3a12=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','send','body','find','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x3a12,0xf6));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x23a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23a1('0x1'));var jsonpatch=require(_0x23a1('0x2'));var rp=require(_0x23a1('0x3'));var moment=require(_0x23a1('0x4'));var BPromise=require(_0x23a1('0x5'));var Mustache=require('mustache');var util=require(_0x23a1('0x6'));var path=require(_0x23a1('0x7'));var sox=require(_0x23a1('0x8'));var csv=require(_0x23a1('0x9'));var ejs=require(_0x23a1('0xa'));var fs=require('fs');var fs_extra=require(_0x23a1('0xb'));var _=require(_0x23a1('0xc'));var squel=require(_0x23a1('0xd'));var crypto=require(_0x23a1('0xe'));var jsforce=require(_0x23a1('0xf'));var deskjs=require(_0x23a1('0x10'));var toCsv=require(_0x23a1('0x9'));var querystring=require(_0x23a1('0x11'));var Papa=require(_0x23a1('0x12'));var Redis=require(_0x23a1('0x13'));var authService=require(_0x23a1('0x14'));var qs=require(_0x23a1('0x15'));var as=require(_0x23a1('0x16'));var hardwareService=require(_0x23a1('0x17'));var logger=require(_0x23a1('0x18'))(_0x23a1('0x19'));var utils=require(_0x23a1('0x1a'));var config=require(_0x23a1('0x1b'));var licenseUtil=require(_0x23a1('0x1c'));var db=require(_0x23a1('0x1d'))['db'];function respondWithStatusCode(_0x35a648,_0x39947a){_0x39947a=_0x39947a||0xcc;return function(_0x4f3f32){if(_0x4f3f32){return _0x35a648['sendStatus'](_0x39947a);}return _0x35a648[_0x23a1('0x1e')](_0x39947a)[_0x23a1('0x1f')]();};}function respondWithResult(_0x2ea8f2,_0x185709){_0x185709=_0x185709||0xc8;return function(_0x4b4dae){if(_0x4b4dae){return _0x2ea8f2[_0x23a1('0x1e')](_0x185709)['json'](_0x4b4dae);}};}function respondWithFilteredResult(_0xd93552,_0x472772){return function(_0x128842){if(_0x128842){var _0x46ba9d=typeof _0x472772[_0x23a1('0x20')]===_0x23a1('0x21')&&typeof _0x472772[_0x23a1('0x22')]===_0x23a1('0x21');var _0x3e5528=_0x128842[_0x23a1('0x23')];var _0x104eed=_0x46ba9d?0x0:_0x472772[_0x23a1('0x20')];var _0x252554=_0x46ba9d?_0x128842[_0x23a1('0x23')]:_0x472772[_0x23a1('0x20')]+_0x472772[_0x23a1('0x22')];var _0x25a1a2;if(_0x252554>=_0x3e5528){_0x252554=_0x3e5528;_0x25a1a2=0xc8;}else{_0x25a1a2=0xce;}_0xd93552['status'](_0x25a1a2);return _0xd93552[_0x23a1('0x24')](_0x23a1('0x25'),_0x104eed+'-'+_0x252554+'/'+_0x3e5528)[_0x23a1('0x26')](_0x128842);}return null;};}function patchUpdates(_0x3a55fe){return function(_0x1f9b2b){try{jsonpatch[_0x23a1('0x27')](_0x1f9b2b,_0x3a55fe,!![]);}catch(_0x35ff42){return BPromise['reject'](_0x35ff42);}return _0x1f9b2b['save']();};}function saveUpdates(_0x5bf48d,_0x3d19b2){return function(_0x2e97af){if(_0x2e97af){return _0x2e97af[_0x23a1('0x28')](_0x5bf48d)[_0x23a1('0x29')](function(_0x334e63){return _0x334e63;});}return null;};}function removeEntity(_0x564d66,_0x17ceb0){return function(_0x16f3f8){if(_0x16f3f8){return _0x16f3f8[_0x23a1('0x2a')]()['then'](function(){_0x564d66[_0x23a1('0x1e')](0xcc)[_0x23a1('0x1f')]();});}};}function handleEntityNotFound(_0x3aa31f,_0xa69c79){return function(_0x58972e){if(!_0x58972e){_0x3aa31f[_0x23a1('0x2b')](0x194);}return _0x58972e;};}function handleError(_0x97728e,_0x4c4645){_0x4c4645=_0x4c4645||0x1f4;return function(_0x109b30){logger[_0x23a1('0x2c')](_0x109b30[_0x23a1('0x2d')]);if(_0x109b30[_0x23a1('0x2e')]){delete _0x109b30[_0x23a1('0x2e')];}_0x97728e[_0x23a1('0x1e')](_0x4c4645)[_0x23a1('0x2f')](_0x109b30);};}exports[_0x23a1('0x28')]=function(_0x572c52,_0xd69d92){if(_0x572c52[_0x23a1('0x30')]['id']){delete _0x572c52[_0x23a1('0x30')]['id'];}return db['Action'][_0x23a1('0x31')]({'where':{'id':_0x572c52['params']['id']}})[_0x23a1('0x29')](handleEntityNotFound(_0xd69d92,null))[_0x23a1('0x29')](saveUpdates(_0x572c52['body'],null))[_0x23a1('0x29')](respondWithResult(_0xd69d92,null))[_0x23a1('0x32')](handleError(_0xd69d92,null));};exports[_0x23a1('0x2a')]=function(_0x333701,_0x427021){return db['Action'][_0x23a1('0x31')]({'where':{'id':_0x333701[_0x23a1('0x33')]['id']}})[_0x23a1('0x29')](handleEntityNotFound(_0x427021,null))[_0x23a1('0x29')](removeEntity(_0x427021,null))[_0x23a1('0x32')](handleError(_0x427021,null));};
\ No newline at end of file
+var _0xac6b=['request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','update','body','Action','find','params','catch','eml-format','zip-dir'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xac6b,0x181));var _0xbac6=function(_0x438f87,_0x545cc6){_0x438f87=_0x438f87-0x0;var _0x13ff7d=_0xac6b[_0x438f87];return _0x13ff7d;};'use strict';var emlformat=require(_0xbac6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbac6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbac6('0x2'));var moment=require(_0xbac6('0x3'));var BPromise=require(_0xbac6('0x4'));var Mustache=require(_0xbac6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbac6('0x6'));var ejs=require(_0xbac6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbac6('0x8'));var crypto=require(_0xbac6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbac6('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbac6('0xb'));var Papa=require(_0xbac6('0xc'));var Redis=require(_0xbac6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbac6('0xe'));var as=require(_0xbac6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbac6('0x10'))(_0xbac6('0x11'));var utils=require('../../config/utils');var config=require(_0xbac6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbac6('0x13'))['db'];function respondWithStatusCode(_0x5e17cf,_0x50de4c){_0x50de4c=_0x50de4c||0xcc;return function(_0x15666b){if(_0x15666b){return _0x5e17cf[_0xbac6('0x14')](_0x50de4c);}return _0x5e17cf[_0xbac6('0x15')](_0x50de4c)['end']();};}function respondWithResult(_0x1c1cef,_0x13ad0){_0x13ad0=_0x13ad0||0xc8;return function(_0xb09d2c){if(_0xb09d2c){return _0x1c1cef[_0xbac6('0x15')](_0x13ad0)['json'](_0xb09d2c);}};}function respondWithFilteredResult(_0x48eabe,_0x5c3739){return function(_0xed785e){if(_0xed785e){var _0xdc357f=typeof _0x5c3739[_0xbac6('0x16')]===_0xbac6('0x17')&&typeof _0x5c3739['limit']==='undefined';var _0x2cb573=_0xed785e[_0xbac6('0x18')];var _0x3fa9ab=_0xdc357f?0x0:_0x5c3739[_0xbac6('0x16')];var _0x3083aa=_0xdc357f?_0xed785e['count']:_0x5c3739[_0xbac6('0x16')]+_0x5c3739[_0xbac6('0x19')];var _0x5e0023;if(_0x3083aa>=_0x2cb573){_0x3083aa=_0x2cb573;_0x5e0023=0xc8;}else{_0x5e0023=0xce;}_0x48eabe['status'](_0x5e0023);return _0x48eabe[_0xbac6('0x1a')](_0xbac6('0x1b'),_0x3fa9ab+'-'+_0x3083aa+'/'+_0x2cb573)['json'](_0xed785e);}return null;};}function patchUpdates(_0x56b427){return function(_0x37f366){try{jsonpatch['apply'](_0x37f366,_0x56b427,!![]);}catch(_0x4b6be4){return BPromise[_0xbac6('0x1c')](_0x4b6be4);}return _0x37f366[_0xbac6('0x1d')]();};}function saveUpdates(_0x1e712d,_0x526382){return function(_0x1c3d84){if(_0x1c3d84){return _0x1c3d84['update'](_0x1e712d)[_0xbac6('0x1e')](function(_0x411622){return _0x411622;});}return null;};}function removeEntity(_0x487d11,_0x43de21){return function(_0x5364d3){if(_0x5364d3){return _0x5364d3[_0xbac6('0x1f')]()[_0xbac6('0x1e')](function(){_0x487d11[_0xbac6('0x15')](0xcc)[_0xbac6('0x20')]();});}};}function handleEntityNotFound(_0x1c4ea2,_0x5e76af){return function(_0x75ebbc){if(!_0x75ebbc){_0x1c4ea2[_0xbac6('0x14')](0x194);}return _0x75ebbc;};}function handleError(_0xecc2ba,_0x20c145){_0x20c145=_0x20c145||0x1f4;return function(_0x5ee747){logger[_0xbac6('0x21')](_0x5ee747[_0xbac6('0x22')]);if(_0x5ee747[_0xbac6('0x23')]){delete _0x5ee747['name'];}_0xecc2ba['status'](_0x20c145)[_0xbac6('0x24')](_0x5ee747);};}exports[_0xbac6('0x25')]=function(_0x1f7be4,_0x560488){if(_0x1f7be4['body']['id']){delete _0x1f7be4[_0xbac6('0x26')]['id'];}return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x1f7be4[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x560488,null))['then'](saveUpdates(_0x1f7be4['body'],null))[_0xbac6('0x1e')](respondWithResult(_0x560488,null))[_0xbac6('0x2a')](handleError(_0x560488,null));};exports[_0xbac6('0x1f')]=function(_0x122969,_0x5ac9bc){return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x122969[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x5ac9bc,null))[_0xbac6('0x1e')](removeEntity(_0x5ac9bc,null))['catch'](handleError(_0x5ac9bc,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 77bcefd..3367ddc 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 _0x3f5c=['Action','lodash','util','../../config/logger','api','moment','bluebird','exports','define'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x3f5c,0x64));var _0xc3f5=function(_0x5de4f7,_0x4faad0){_0x5de4f7=_0x5de4f7-0x0;var _0x2ef6bb=_0x3f5c[_0x5de4f7];return _0x2ef6bb;};'use strict';var _=require(_0xc3f5('0x0'));var util=require(_0xc3f5('0x1'));var logger=require(_0xc3f5('0x2'))(_0xc3f5('0x3'));var moment=require(_0xc3f5('0x4'));var BPromise=require(_0xc3f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xc3f5('0x6')]=function(_0x92a3ce,_0x578972){return _0x92a3ce[_0xc3f5('0x7')](_0xc3f5('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe924=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash'];(function(_0x38ff71,_0x52e0d7){var _0x296aa4=function(_0x141cc3){while(--_0x141cc3){_0x38ff71['push'](_0x38ff71['shift']());}};_0x296aa4(++_0x52e0d7);}(_0xe924,0x141));var _0x4e92=function(_0x6027cd,_0x1b2be5){_0x6027cd=_0x6027cd-0x0;var _0x4718a7=_0xe924[_0x6027cd];return _0x4718a7;};'use strict';var _=require(_0x4e92('0x0'));var util=require(_0x4e92('0x1'));var logger=require(_0x4e92('0x2'))(_0x4e92('0x3'));var moment=require(_0x4e92('0x4'));var BPromise=require(_0x4e92('0x5'));var rp=require(_0x4e92('0x6'));var fs=require('fs');var path=require(_0x4e92('0x7'));var rimraf=require(_0x4e92('0x8'));var config=require(_0x4e92('0x9'));var attributes=require(_0x4e92('0xa'));module['exports']=function(_0x401987,_0x5ebf4b){return _0x401987[_0x4e92('0xb')](_0x4e92('0xc'),attributes,{'tableName':_0x4e92('0xd'),'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 158744c..8018d6f 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 _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(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x814b,0x1a2));var _0xb814=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x814b[_0x173441];return _0x2423a8;};'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
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e78a1,_0xee9752){var _0x39bb49=function(_0x49f71c){while(--_0x49f71c){_0x1e78a1['push'](_0x1e78a1['shift']());}};_0x39bb49(++_0xee9752);}(_0x5fc3,0xa8));var _0x35fc=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x5fc3[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 750bea9..400f2eb 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 _0x9389=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports'];(function(_0x57c79c,_0x54f485){var _0x1b5796=function(_0x5ae43b){while(--_0x5ae43b){_0x57c79c['push'](_0x57c79c['shift']());}};_0x1b5796(++_0x54f485);}(_0x9389,0xcc));var _0x9938=function(_0x488b6e,_0x2036b7){_0x488b6e=_0x488b6e-0x0;var _0x2fbcc7=_0x9389[_0x488b6e];return _0x2fbcc7;};'use strict';var multer=require(_0x9938('0x0'));var util=require(_0x9938('0x1'));var path=require(_0x9938('0x2'));var timeout=require(_0x9938('0x3'));var express=require(_0x9938('0x4'));var router=express[_0x9938('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9938('0x6'));var interaction=require(_0x9938('0x7'));var config=require(_0x9938('0x8'));var controller=require(_0x9938('0x9'));router[_0x9938('0xa')](_0x9938('0xb'),auth['isAuthenticated'](),controller[_0x9938('0xc')]);router[_0x9938('0xd')](_0x9938('0xb'),auth[_0x9938('0xe')](),controller[_0x9938('0xf')]);module[_0x9938('0x10')]=router;
\ No newline at end of file
+var _0x43f0=['isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x43f0,0x14d));var _0x043f=function(_0x490fde,_0x35d48b){_0x490fde=_0x490fde-0x0;var _0x15feb0=_0x43f0[_0x490fde];return _0x15feb0;};'use strict';var multer=require('multer');var util=require(_0x043f('0x0'));var path=require(_0x043f('0x1'));var timeout=require(_0x043f('0x2'));var express=require(_0x043f('0x3'));var router=express[_0x043f('0x4')]();var fs_extra=require(_0x043f('0x5'));var auth=require(_0x043f('0x6'));var interaction=require(_0x043f('0x7'));var config=require(_0x043f('0x8'));var controller=require(_0x043f('0x9'));router[_0x043f('0xa')](_0x043f('0xb'),auth[_0x043f('0xc')](),controller['update']);router['delete'](_0x043f('0xb'),auth['isAuthenticated'](),controller[_0x043f('0xd')]);module[_0x043f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 506dde9..51c416b 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(_0x526291,_0x58e1b8){var _0x5e2bea=function(_0x403231){while(--_0x403231){_0x526291['push'](_0x526291['shift']());}};_0x5e2bea(++_0x58e1b8);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x34b986,_0x122220){_0x34b986=_0x34b986-0x0;var _0x3ba364=_0x8ef6[_0x34b986];return _0x3ba364;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index fc7da72..371c8a7 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 _0x2ffe=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','HOUR(%s)','IS\x20EMPTY','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x546c90,_0x55f520){var _0x486553=function(_0xf00284){while(--_0xf00284){_0x546c90['push'](_0x546c90['shift']());}};_0x486553(++_0x55f520);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x4ef1bc,_0x531d4f){_0x4ef1bc=_0x4ef1bc-0x0;var _0x1cc196=_0x2ffe[_0x4ef1bc];return _0x1cc196;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ff('0x0'));var zipdir=require(_0xe2ff('0x1'));var jsonpatch=require(_0xe2ff('0x2'));var rp=require(_0xe2ff('0x3'));var moment=require(_0xe2ff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ff('0x5'));var util=require(_0xe2ff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe2ff('0x7'));var ejs=require(_0xe2ff('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ff('0x9'));var _=require('lodash');var squel=require(_0xe2ff('0xa'));var crypto=require(_0xe2ff('0xb'));var jsforce=require(_0xe2ff('0xc'));var deskjs=require(_0xe2ff('0xd'));var toCsv=require(_0xe2ff('0x7'));var querystring=require(_0xe2ff('0xe'));var Papa=require(_0xe2ff('0xf'));var Redis=require(_0xe2ff('0x10'));var authService=require(_0xe2ff('0x11'));var qs=require(_0xe2ff('0x12'));var as=require(_0xe2ff('0x13'));var hardwareService=require(_0xe2ff('0x14'));var logger=require(_0xe2ff('0x15'))(_0xe2ff('0x16'));var utils=require(_0xe2ff('0x17'));var config=require(_0xe2ff('0x18'));var licenseUtil=require(_0xe2ff('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe2ff('0x1a'))[_0xe2ff('0x1b')];function respondWithStatusCode(_0x47f1c4,_0x1b2a6a){_0x1b2a6a=_0x1b2a6a||0xcc;return function(_0x3061e2){if(_0x3061e2){return _0x47f1c4[_0xe2ff('0x1c')](_0x1b2a6a);}return _0x47f1c4[_0xe2ff('0x1d')](_0x1b2a6a)[_0xe2ff('0x1e')]();};}function respondWithResult(_0x3203e1,_0x201128){_0x201128=_0x201128||0xc8;return function(_0x96907c){if(_0x96907c){return _0x3203e1[_0xe2ff('0x1d')](_0x201128)[_0xe2ff('0x1f')](_0x96907c);}};}function respondWithFilteredResult(_0x25143e,_0x3b8f1b){return function(_0x336368){if(_0x336368){var _0x31a8a0=typeof _0x3b8f1b[_0xe2ff('0x20')]===_0xe2ff('0x21')&&typeof _0x3b8f1b['limit']===_0xe2ff('0x21');var _0x10c7d6=_0x336368[_0xe2ff('0x22')];var _0x42c589=_0x31a8a0?0x0:_0x3b8f1b['offset'];var _0x1c5673=_0x31a8a0?_0x336368[_0xe2ff('0x22')]:_0x3b8f1b[_0xe2ff('0x20')]+_0x3b8f1b[_0xe2ff('0x23')];var _0x216b30;if(_0x1c5673>=_0x10c7d6){_0x1c5673=_0x10c7d6;_0x216b30=0xc8;}else{_0x216b30=0xce;}_0x25143e[_0xe2ff('0x1d')](_0x216b30);return _0x25143e[_0xe2ff('0x24')]('Content-Range',_0x42c589+'-'+_0x1c5673+'/'+_0x10c7d6)['json'](_0x336368);}return null;};}function patchUpdates(_0x5646ee){return function(_0x5e31f3){try{jsonpatch[_0xe2ff('0x25')](_0x5e31f3,_0x5646ee,!![]);}catch(_0x394aef){return BPromise[_0xe2ff('0x26')](_0x394aef);}return _0x5e31f3[_0xe2ff('0x27')]();};}function saveUpdates(_0x181bd2,_0x3d9d66){return function(_0x335d9c){if(_0x335d9c){return _0x335d9c[_0xe2ff('0x28')](_0x181bd2)[_0xe2ff('0x29')](function(_0x4e2ff7){return _0x4e2ff7;});}return null;};}function removeEntity(_0x71e3da,_0x4a2222){return function(_0xa6ad9){if(_0xa6ad9){return _0xa6ad9[_0xe2ff('0x2a')]()['then'](function(){var _0x3e7ff2=_0xa6ad9['get']({'plain':!![]});var _0x5265b5='CustomReports';return db[_0xe2ff('0x2b')]['destroy']({'where':{'type':_0x5265b5,'resourceId':_0x3e7ff2['id']}})['then'](function(){return _0xa6ad9;});})[_0xe2ff('0x29')](function(){_0x71e3da[_0xe2ff('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2489,_0x3eeba0){return function(_0x41322d){if(!_0x41322d){_0x5b2489[_0xe2ff('0x1c')](0x194);}return _0x41322d;};}function handleError(_0x2733c3,_0x270296){_0x270296=_0x270296||0x1f4;return function(_0x1b827d){logger['error'](_0x1b827d[_0xe2ff('0x2c')]);if(_0x1b827d[_0xe2ff('0x2d')]){delete _0x1b827d[_0xe2ff('0x2d')];}_0x2733c3[_0xe2ff('0x1d')](_0x270296)['send'](_0x1b827d);};}exports[_0xe2ff('0x2e')]=function(_0x1da1c8,_0x5e14d9){var _0x385896={},_0x14f82a={},_0x32a533={'count':0x0,'rows':[]};var _0x4c5570=_[_0xe2ff('0x2f')](db[_0xe2ff('0x30')][_0xe2ff('0x31')],function(_0x95df6b){return{'name':_0x95df6b[_0xe2ff('0x32')],'type':_0x95df6b[_0xe2ff('0x33')][_0xe2ff('0x34')]};});_0x14f82a[_0xe2ff('0x35')]=_['map'](_0x4c5570,_0xe2ff('0x2d'));_0x14f82a[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x1da1c8['query']);_0x14f82a['filters']=_['intersection'](_0x14f82a['model'],_0x14f82a[_0xe2ff('0x36')]);_0x385896[_0xe2ff('0x38')]=_[_0xe2ff('0x39')](_0x14f82a[_0xe2ff('0x35')],qs[_0xe2ff('0x3a')](_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x3a')]));_0x385896['attributes']=_0x385896[_0xe2ff('0x38')][_0xe2ff('0x3b')]?_0x385896['attributes']:_0x14f82a[_0xe2ff('0x35')];if(!_0x1da1c8['query'][_0xe2ff('0x3c')](_0xe2ff('0x3d'))){_0x385896['limit']=qs[_0xe2ff('0x23')](_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x23')]);_0x385896[_0xe2ff('0x20')]=qs['offset'](_0x1da1c8['query'][_0xe2ff('0x20')]);}_0x385896[_0xe2ff('0x3e')]=qs[_0xe2ff('0x3f')](_0x1da1c8['query'][_0xe2ff('0x3f')]);_0x385896[_0xe2ff('0x40')]=qs[_0xe2ff('0x41')](_[_0xe2ff('0x42')](_0x1da1c8[_0xe2ff('0x36')],_0x14f82a[_0xe2ff('0x41')]),_0x4c5570);if(_0x1da1c8['query'][_0xe2ff('0x43')]){_0x385896[_0xe2ff('0x40')]=_[_0xe2ff('0x44')](_0x385896[_0xe2ff('0x40')],{'$or':_[_0xe2ff('0x2f')](_0x4c5570,function(_0x3ceaff){if(_0x3ceaff[_0xe2ff('0x33')]!==_0xe2ff('0x45')){var _0x4cb057={};_0x4cb057[_0x3ceaff[_0xe2ff('0x2d')]]={'$like':'%'+_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x43')]+'%'};return _0x4cb057;}})});}_0x385896=_[_0xe2ff('0x44')]({},_0x385896,_0x1da1c8[_0xe2ff('0x46')]);var _0x916d8c={'where':_0x385896[_0xe2ff('0x40')]};return db['AnalyticCustomReport'][_0xe2ff('0x22')](_0x916d8c)['then'](function(_0x5acd54){_0x32a533['count']=_0x5acd54;if(_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x47')]){_0x385896[_0xe2ff('0x48')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe2ff('0x49')](_0x385896);})[_0xe2ff('0x29')](function(_0x190b49){_0x32a533[_0xe2ff('0x4a')]=_0x190b49;return _0x32a533;})[_0xe2ff('0x29')](respondWithFilteredResult(_0x5e14d9,_0x385896))[_0xe2ff('0x4b')](handleError(_0x5e14d9,null));};exports[_0xe2ff('0x4c')]=function(_0x4a2989,_0x507d04){var _0x19cda4={'raw':![],'where':{'id':_0x4a2989[_0xe2ff('0x4d')]['id']}},_0x1e4c4d={};_0x1e4c4d[_0xe2ff('0x35')]=_[_0xe2ff('0x37')](db[_0xe2ff('0x30')][_0xe2ff('0x31')]);_0x1e4c4d[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x4a2989[_0xe2ff('0x36')]);_0x1e4c4d[_0xe2ff('0x41')]=_[_0xe2ff('0x39')](_0x1e4c4d[_0xe2ff('0x35')],_0x1e4c4d[_0xe2ff('0x36')]);_0x19cda4[_0xe2ff('0x38')]=_['intersection'](_0x1e4c4d[_0xe2ff('0x35')],qs['fields'](_0x4a2989[_0xe2ff('0x36')][_0xe2ff('0x3a')]));_0x19cda4[_0xe2ff('0x38')]=_0x19cda4[_0xe2ff('0x38')]['length']?_0x19cda4[_0xe2ff('0x38')]:_0x1e4c4d[_0xe2ff('0x35')];if(_0x4a2989['query'][_0xe2ff('0x47')]){_0x19cda4['include']=[{'all':!![]}];}_0x19cda4=_[_0xe2ff('0x44')]({},_0x19cda4,_0x4a2989[_0xe2ff('0x46')]);return db['AnalyticCustomReport'][_0xe2ff('0x4e')](_0x19cda4)[_0xe2ff('0x29')](handleEntityNotFound(_0x507d04,null))['then'](respondWithResult(_0x507d04,null))['catch'](handleError(_0x507d04,null));};exports[_0xe2ff('0x4f')]=function(_0x588507,_0x1eeadc){return db[_0xe2ff('0x30')][_0xe2ff('0x4f')](_0x588507[_0xe2ff('0x50')],{})[_0xe2ff('0x29')](function(_0x3b9ebf){var _0x39c869=_0x588507['user'][_0xe2ff('0x51')]({'plain':!![]});if(!_0x39c869)throw new Error(_0xe2ff('0x52'));if(_0x39c869[_0xe2ff('0x53')]===_0xe2ff('0x54')){var _0x53ab67=_0x3b9ebf[_0xe2ff('0x51')]({'plain':!![]});var _0x2fb1f6=_0xe2ff('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x2fb1f6,'userProfileId':_0x39c869[_0xe2ff('0x56')]},'raw':!![]})[_0xe2ff('0x29')](function(_0x53939a){if(_0x53939a&&_0x53939a[_0xe2ff('0x57')]===0x0){return db[_0xe2ff('0x2b')]['create']({'name':_0x53ab67['name'],'resourceId':_0x53ab67['id'],'type':'CustomReports','sectionId':_0x53939a['id']},{})['then'](function(){return _0x3b9ebf;});}else{return _0x3b9ebf;}})[_0xe2ff('0x4b')](function(_0x323acf){logger[_0xe2ff('0x58')](_0xe2ff('0x59'),_0x323acf);throw _0x323acf;});}return _0x3b9ebf;})['then'](respondWithResult(_0x1eeadc,0xc9))['catch'](handleError(_0x1eeadc,null));};exports['update']=function(_0x58e032,_0x5dbdbe){if(_0x58e032['body']['id']){delete _0x58e032[_0xe2ff('0x50')]['id'];}return db['AnalyticCustomReport'][_0xe2ff('0x4e')]({'where':{'id':_0x58e032[_0xe2ff('0x4d')]['id']}})[_0xe2ff('0x29')](handleEntityNotFound(_0x5dbdbe,null))['then'](saveUpdates(_0x58e032[_0xe2ff('0x50')],null))['then'](respondWithResult(_0x5dbdbe,null))['catch'](handleError(_0x5dbdbe,null));};exports['destroy']=function(_0x57a8e1,_0x1518f9){return db['AnalyticCustomReport']['find']({'where':{'id':_0x57a8e1['params']['id']}})['then'](handleEntityNotFound(_0x1518f9,null))[_0xe2ff('0x29')](removeEntity(_0x1518f9,null))[_0xe2ff('0x4b')](handleError(_0x1518f9,null));};exports[_0xe2ff('0x5a')]=function(_0xa60f1c,_0x26f702){var _0xd7abe3=0xa;var _0x1f1cd1=['join',_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x42c268={'SUM':_0xe2ff('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ff('0x5f'),'MAX':_0xe2ff('0x60'),'MIN':_0xe2ff('0x61'),'AVG':_0xe2ff('0x62'),'GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':_0xe2ff('0x65')};var _0x11ef53={'SEC_TO_TIME':_0xe2ff('0x66'),'DATE':_0xe2ff('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':_0xe2ff('0x69')};var _0x13e880=function(_0x45a62f){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),'IS\x20EMPTY',_0xe2ff('0x6d')],_0x45a62f);};var _0x5271eb=function(_0x4bf11e){if(!_0x4bf11e||!_0x4bf11e[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x4e2aef='(',_0x15bef6=0x0;_0x15bef6<_0x4bf11e[_0xe2ff('0x6e')][_0xe2ff('0x3b')];_0x15bef6+=0x1){_0x15bef6>0x0&&(_0x4e2aef+='\x20'+_0x4bf11e[_0xe2ff('0x6f')]+'\x20');_0x4e2aef+=_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6]['group']?_0x5271eb(_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x70')]):_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6]['field']+'\x20'+_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x71')]+(_0x13e880(_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x71')])?'\x20'+_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x72')]:'');}return _0x4e2aef+')';};var _0x14d5a0={'where':{'id':_0xa60f1c[_0xe2ff('0x4d')]['id']}},_0x42e731,_0x54461e,_0x312cab,_0x51f4db,_0x48252f;_0x14d5a0=_[_0xe2ff('0x44')]({},_0x14d5a0,_0xa60f1c[_0xe2ff('0x46')]);return db['AnalyticCustomReport'][_0xe2ff('0x4e')](_0x14d5a0)['then'](function(_0x447131){if(_0x447131){_0x42e731=_0x447131;return _0x447131[_0xe2ff('0x73')]();}return null;})[_0xe2ff('0x29')](function(_0x1fcde0){if(_0x1fcde0){if(!_0x1fcde0[_0xe2ff('0x3b')]){throw new db[(_0xe2ff('0x74'))][(_0xe2ff('0x75'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x54461e=_0x1fcde0;return db[_0xe2ff('0x76')][_0xe2ff('0x49')]({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x208e48){if(_0x208e48){_0x312cab=_[_0xe2ff('0x77')](_0x208e48,'id');var _0x52fb2f;var _0x119acc=squel[_0xe2ff('0x78')]();_0x119acc[_0xe2ff('0x79')](_0x42e731[_0xe2ff('0x7a')]);for(var _0x18f0ce=0x0;_0x18f0ce<_0x54461e['length'];_0x18f0ce+=0x1){_0x52fb2f=_0x54461e[_0x18f0ce][_0xe2ff('0x7b')]?_0x312cab[_0x54461e[_0x18f0ce]['MetricId']][_0xe2ff('0x7c')]:_0x54461e[_0x18f0ce][_0xe2ff('0x7d')];_0x52fb2f=_0x54461e[_0x18f0ce]['function']?_[_0xe2ff('0x7e')](_0x42c268[_0x54461e[_0x18f0ce][_0xe2ff('0x7f')]],'%s',_0x52fb2f):_0x52fb2f;_0x52fb2f=_0x54461e[_0x18f0ce][_0xe2ff('0x80')]?_['replace'](_0x11ef53[_0x54461e[_0x18f0ce][_0xe2ff('0x80')]],'%s',_0x52fb2f):_0x52fb2f;if(_0x54461e[_0x18f0ce][_0xe2ff('0x81')]){_0x119acc['group'](_0x52fb2f);}_0x54461e[_0x18f0ce][_0xe2ff('0x82')]&&_0x119acc[_0xe2ff('0x3e')](_0x52fb2f,_0x54461e[_0x18f0ce]['orderBy']===_0xe2ff('0x83')?![]:!![]);_0x119acc[_0xe2ff('0x7d')](_0x52fb2f,_0x54461e[_0x18f0ce][_0xe2ff('0x84')]||_0x52fb2f);}if(_0x42e731['joins']){_0x42e731[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x42e731[_0xe2ff('0x85')]);for(var _0x340309=0x0;_0x340309<_0x42e731[_0xe2ff('0x85')]['length'];_0x340309+=0x1){if(_0x42e731['joins'][_0x340309][_0xe2ff('0x33')]&&_['includes'](_0x1f1cd1,_0x42e731['joins'][_0x340309][_0xe2ff('0x33')])&&_0x42e731['joins'][_0x340309][_0xe2ff('0x87')]&&_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x88')]&&_0x42e731[_0xe2ff('0x85')][_0x340309]['foreignKey']){_0x119acc[_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x33')]](_0x42e731[_0xe2ff('0x85')][_0x340309]['foreignTable'],null,util[_0xe2ff('0x80')](_0xe2ff('0x89'),_0x42e731[_0xe2ff('0x7a')],_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x87')],_0x42e731['joins'][_0x340309]['foreignTable'],_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x8a')]));}}}if(_0x42e731[_0xe2ff('0x8b')]){_0x42e731['conditions']=JSON[_0xe2ff('0x86')](_0x42e731[_0xe2ff('0x8b')]);_0x119acc[_0xe2ff('0x40')](_0x5271eb(_0x42e731[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x48252f=_0x119acc[_0xe2ff('0x8c')]();_0x119acc['limit'](_0xd7abe3);_0x119acc[_0xe2ff('0x20')](0x0);logger[_0xe2ff('0x8d')](_0xe2ff('0x8e'),_0x119acc['toString']());return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x119acc[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});}})['then'](respondWithResult(_0x26f702,null))[_0xe2ff('0x4b')](handleError(_0x26f702,null));};function runReport(_0xe1827c,_0x583d01,_0x42cd72){var _0x149b82=_0x583d01[_0xe2ff('0x2d')];var _0x2bcb9e=0xa;var _0x424260=[_0xe2ff('0x93'),_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x1bd74f={'SUM':_0xe2ff('0x5e'),'COUNT':_0xe2ff('0x94'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe2ff('0x61'),'AVG':_0xe2ff('0x62'),'GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':_0xe2ff('0x65')};var _0x460d2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x317c0c=function(_0x2c912b){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),'IS\x20EMPTY',_0xe2ff('0x6d')],_0x2c912b);};var _0x29d387=function(_0x587d15){if(!_0x587d15||!_0x587d15[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x3dbb5b='(',_0x44a351=0x0;_0x44a351<_0x587d15[_0xe2ff('0x6e')][_0xe2ff('0x3b')];_0x44a351+=0x1){_0x44a351>0x0&&(_0x3dbb5b+='\x20'+_0x587d15['operator']+'\x20');_0x3dbb5b+=_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x70')]?_0x29d387(_0x587d15['rules'][_0x44a351][_0xe2ff('0x70')]):_0x587d15['rules'][_0x44a351][_0xe2ff('0x7d')]+'\x20'+_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x71')]+(_0x317c0c(_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x71')])?'\x20'+_0x587d15['rules'][_0x44a351]['value']:'');}return _0x3dbb5b+')';};var _0x2e7f6d={'where':{'id':_0xe1827c['id']}},_0x9138ad,_0x3b1394,_0x593236,_0x4da500,_0x437b5b;_0x2e7f6d=_['merge']({},_0x2e7f6d,_0x42cd72);return db[_0xe2ff('0x30')][_0xe2ff('0x4e')](_0x2e7f6d)[_0xe2ff('0x29')](function(_0x2f119f){if(_0x2f119f){_0x9138ad=_0x2f119f;return _0x2f119f['getFields']();}return null;})['then'](function(_0x533d18){if(_0x533d18){if(!_0x533d18['length']){throw new db[(_0xe2ff('0x74'))][(_0xe2ff('0x75'))](_0xe2ff('0x95'),0x193);}_0x3b1394=_0x533d18;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x28c026){if(_0x28c026){_0x593236=_[_0xe2ff('0x77')](_0x28c026,'id');var _0x18270d;var _0x589845=squel['select']();_0x589845['from'](_0x9138ad[_0xe2ff('0x7a')]);for(var _0x4b83bc=0x0;_0x4b83bc<_0x3b1394[_0xe2ff('0x3b')];_0x4b83bc+=0x1){_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x7b')]?_0x593236[_0x3b1394[_0x4b83bc][_0xe2ff('0x7b')]][_0xe2ff('0x7c')]:_0x3b1394[_0x4b83bc]['field'];_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x7f')]?_[_0xe2ff('0x7e')](_0x1bd74f[_0x3b1394[_0x4b83bc][_0xe2ff('0x7f')]],'%s',_0x18270d):_0x18270d;_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x80')]?_['replace'](_0x460d2e[_0x3b1394[_0x4b83bc][_0xe2ff('0x80')]],'%s',_0x18270d):_0x18270d;if(_0x3b1394[_0x4b83bc]['groupBy']){_0x589845[_0xe2ff('0x70')](_0x18270d);}_0x3b1394[_0x4b83bc][_0xe2ff('0x82')]&&_0x589845[_0xe2ff('0x3e')](_0x18270d,_0x3b1394[_0x4b83bc][_0xe2ff('0x82')]===_0xe2ff('0x83')?![]:!![]);_0x589845['field'](_0x18270d,_0x3b1394[_0x4b83bc][_0xe2ff('0x84')]||_0x18270d);}if(_0x9138ad['joins']){_0x9138ad[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x9138ad[_0xe2ff('0x85')]);for(var _0x1ddb99=0x0;_0x1ddb99<_0x9138ad[_0xe2ff('0x85')][_0xe2ff('0x3b')];_0x1ddb99+=0x1){if(_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x33')]&&_['includes'](_0x424260,_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x33')])&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99]['parentKey']&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')]&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x8a')]){_0x589845[_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x33')]](_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')],null,util[_0xe2ff('0x80')](_0xe2ff('0x89'),_0x9138ad['table'],_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x87')],_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')],_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x8a')]));}}}if(_0x9138ad[_0xe2ff('0x8b')]){_0x9138ad[_0xe2ff('0x8b')]=JSON[_0xe2ff('0x86')](_0x9138ad[_0xe2ff('0x8b')]);_0x589845[_0xe2ff('0x40')](_0x29d387(_0x9138ad[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x437b5b=_0x589845[_0xe2ff('0x8c')]();_0x589845[_0xe2ff('0x23')](_0x2bcb9e);_0x589845[_0xe2ff('0x20')](0x0);return;}})[_0xe2ff('0x29')](function(){if(_0x583d01[_0xe2ff('0x96')]===_0xe2ff('0x97')){return null;}var _0x35b885=_['merge'](_0x583d01,{'name':_0x583d01[_0xe2ff('0x98')]||_0x583d01[_0xe2ff('0x2d')]||_0x9138ad[_0xe2ff('0x2d')],'basename':_0x149b82,'savename':util[_0xe2ff('0x80')](_0xe2ff('0x99'),_0x583d01['name']||_0x9138ad[_0xe2ff('0x2d')],require('randomstring')[_0xe2ff('0x9a')](0x4),_0x583d01[_0xe2ff('0x96')]||_0xe2ff('0x9b')),'reportId':_0x9138ad['id'],'reportType':'custom'});return db[_0xe2ff('0x9c')]['create'](_0x35b885,{'raw':!![]});})['then'](function(_0x351dd8){if(_0x9138ad[_0xe2ff('0x7a')]===_0xe2ff('0x9d')){_0x437b5b[_0xe2ff('0x40')](_0x9138ad[_0xe2ff('0x7a')]+_0xe2ff('0x9e'),_0x583d01['startDate'],_0x583d01[_0xe2ff('0x9f')]);}else{_0x437b5b[_0xe2ff('0x40')](_0x9138ad['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x583d01[_0xe2ff('0xa0')],_0x583d01[_0xe2ff('0x9f')]);}if(_0x351dd8){logger[_0xe2ff('0xa1')](_0xe2ff('0xa2'),_0x437b5b['toString']());require(_0xe2ff('0xa3'))[_0xe2ff('0xa4')](path[_0xe2ff('0x93')](__dirname,'../../components/export/',_0x351dd8[_0xe2ff('0x96')]),[_0x351dd8['id'],_0x437b5b[_0xe2ff('0x90')](),path[_0xe2ff('0x93')](__dirname,_0xe2ff('0xa5'),_0x351dd8['savename']),_0x149b82]);return _0x351dd8;}else{var _0x1150f8=squel[_0xe2ff('0x78')]();_0x1150f8[_0xe2ff('0x79')]('('+_0x437b5b[_0xe2ff('0x90')]()+')',_0xe2ff('0xa6'));_0x1150f8[_0xe2ff('0x7d')](_0xe2ff('0xa7'),'count');_0x437b5b[_0xe2ff('0x23')](_0x583d01[_0xe2ff('0x23')]||_0x2bcb9e);_0x437b5b[_0xe2ff('0x20')](_0x583d01[_0xe2ff('0x20')]||0x0);return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x1150f8[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')]['SELECT']})[_0xe2ff('0x29')](function(_0x5d64f9){if(!_0x5d64f9['length']){_0x4da500=0x0;}else{_0x4da500=_0x5d64f9[0x0][_0xe2ff('0x22')]||0x0;}return dbH[_0xe2ff('0x8f')]['query'](_0x437b5b[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});})[_0xe2ff('0x29')](function(_0xea2092){return{'rows':_0xea2092||[],'count':_0x4da500};});}});}exports[_0xe2ff('0xa8')]=function(_0x44d668,_0x140fb6){return runReport(_0x44d668[_0xe2ff('0x4d')],_0x44d668[_0xe2ff('0x36')],_0x44d668[_0xe2ff('0x46')])[_0xe2ff('0x29')](respondWithResult(_0x140fb6,null))[_0xe2ff('0x4b')](handleError(_0x140fb6,null));};exports['runReport']=runReport;exports[_0xe2ff('0x36')]=function(_0x53ac7c,_0x57bac4){var _0x2b183d=0xa;var _0x20ce0a=['join',_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x307084={'SUM':_0xe2ff('0x5e'),'COUNT':_0xe2ff('0x94'),'COUNT DISTINCT':_0xe2ff('0x5f'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x569fe9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xe2ff('0xa9'),'ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':_0xe2ff('0x69')};var _0x47f5bc=function(_0x2f323b){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),_0xe2ff('0xaa'),'IS\x20NOT\x20EMPTY'],_0x2f323b);};var _0x1f94cb=function(_0x135e58){if(!_0x135e58||!_0x135e58[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x28b7ed='(',_0x256505=0x0;_0x256505<_0x135e58[_0xe2ff('0x6e')]['length'];_0x256505+=0x1){_0x256505>0x0&&(_0x28b7ed+='\x20'+_0x135e58['operator']+'\x20');_0x28b7ed+=_0x135e58[_0xe2ff('0x6e')][_0x256505]['group']?_0x1f94cb(_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x70')]):_0x135e58['rules'][_0x256505][_0xe2ff('0x7d')]+'\x20'+_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x71')]+(_0x47f5bc(_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x71')])?'\x20'+_0x135e58['rules'][_0x256505]['value']:'');}return _0x28b7ed+')';};var _0x5854c9={'where':{'id':_0x53ac7c[_0xe2ff('0x4d')]['id']}},_0x409913,_0x367c2e,_0x250905,_0x597e27,_0x5159be;_0x5854c9=_['merge']({},_0x5854c9,_0x53ac7c[_0xe2ff('0x46')]);return db['AnalyticCustomReport']['find'](_0x5854c9)[_0xe2ff('0x29')](function(_0x361da8){if(_0x361da8){_0x409913=_0x361da8;return _0x361da8['getFields']();}return null;})['then'](function(_0x284034){if(_0x284034){if(!_0x284034[_0xe2ff('0x3b')]){throw new db['Sequelize'][(_0xe2ff('0x75'))](_0xe2ff('0x95'),0x193);}_0x367c2e=_0x284034;return db[_0xe2ff('0x76')][_0xe2ff('0x49')]({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x293f8e){if(_0x293f8e){_0x250905=_[_0xe2ff('0x77')](_0x293f8e,'id');var _0x2bc269;var _0x4ee49c=squel[_0xe2ff('0x78')]();_0x4ee49c[_0xe2ff('0x79')](_0x409913['table']);for(var _0x54fc86=0x0;_0x54fc86<_0x367c2e[_0xe2ff('0x3b')];_0x54fc86+=0x1){_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x7b')]?_0x250905[_0x367c2e[_0x54fc86][_0xe2ff('0x7b')]][_0xe2ff('0x7c')]:_0x367c2e[_0x54fc86][_0xe2ff('0x7d')];_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x7f')]?_[_0xe2ff('0x7e')](_0x307084[_0x367c2e[_0x54fc86][_0xe2ff('0x7f')]],'%s',_0x2bc269):_0x2bc269;_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x80')]?_[_0xe2ff('0x7e')](_0x569fe9[_0x367c2e[_0x54fc86][_0xe2ff('0x80')]],'%s',_0x2bc269):_0x2bc269;if(_0x367c2e[_0x54fc86][_0xe2ff('0x81')]){_0x4ee49c[_0xe2ff('0x70')](_0x2bc269);}_0x367c2e[_0x54fc86]['orderBy']&&_0x4ee49c[_0xe2ff('0x3e')](_0x2bc269,_0x367c2e[_0x54fc86][_0xe2ff('0x82')]===_0xe2ff('0x83')?![]:!![]);_0x4ee49c[_0xe2ff('0x7d')](_0x2bc269,_0x367c2e[_0x54fc86]['alias']||_0x2bc269);}if(_0x409913[_0xe2ff('0x85')]){_0x409913[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x409913['joins']);for(var _0x57d15d=0x0;_0x57d15d<_0x409913['joins'][_0xe2ff('0x3b')];_0x57d15d+=0x1){if(_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')]&&_[_0xe2ff('0x6a')](_0x20ce0a,_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')])&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x87')]&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x88')]&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x8a')]){_0x4ee49c[_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')]](_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x88')],null,util[_0xe2ff('0x80')]('%s.%s\x20=\x20%s.%s',_0x409913['table'],_0x409913[_0xe2ff('0x85')][_0x57d15d]['parentKey'],_0x409913[_0xe2ff('0x85')][_0x57d15d]['foreignTable'],_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x8a')]));}}}if(_0x409913[_0xe2ff('0x8b')]){_0x409913['conditions']=JSON[_0xe2ff('0x86')](_0x409913[_0xe2ff('0x8b')]);_0x4ee49c[_0xe2ff('0x40')](_0x1f94cb(_0x409913[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x5159be=_0x4ee49c[_0xe2ff('0x8c')]();_0x4ee49c[_0xe2ff('0x23')](_0x2b183d);_0x4ee49c[_0xe2ff('0x20')](0x0);logger['debug'](_0xe2ff('0x8e'),_0x4ee49c['toString']());return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x4ee49c['toString'](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});}})[_0xe2ff('0x29')](function(){return{'sql':_0x5159be[_0xe2ff('0x90')]()};})[_0xe2ff('0x29')](respondWithResult(_0x57bac4,null))[_0xe2ff('0x4b')](handleError(_0x57bac4,null));};
\ No newline at end of file
+var _0xf117=['type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','MAX(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','foreignKey','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','sequelize','run','runReport','GROUP_CONCAT(%s)','IS\x20NULL','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0xf117,0x122));var _0x7f11=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf117[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f11('0x0'));var zipdir=require(_0x7f11('0x1'));var jsonpatch=require(_0x7f11('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7f11('0x3'));var Mustache=require(_0x7f11('0x4'));var util=require(_0x7f11('0x5'));var path=require(_0x7f11('0x6'));var sox=require(_0x7f11('0x7'));var csv=require(_0x7f11('0x8'));var ejs=require(_0x7f11('0x9'));var fs=require('fs');var fs_extra=require(_0x7f11('0xa'));var _=require(_0x7f11('0xb'));var squel=require(_0x7f11('0xc'));var crypto=require(_0x7f11('0xd'));var jsforce=require(_0x7f11('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f11('0xf'));var Papa=require(_0x7f11('0x10'));var Redis=require(_0x7f11('0x11'));var authService=require(_0x7f11('0x12'));var qs=require(_0x7f11('0x13'));var as=require(_0x7f11('0x14'));var hardwareService=require(_0x7f11('0x15'));var logger=require(_0x7f11('0x16'))('api');var utils=require(_0x7f11('0x17'));var config=require(_0x7f11('0x18'));var licenseUtil=require(_0x7f11('0x19'));var db=require(_0x7f11('0x1a'))['db'];var dbH=require(_0x7f11('0x1a'))[_0x7f11('0x1b')];function respondWithStatusCode(_0x2d9208,_0xe7a0a7){_0xe7a0a7=_0xe7a0a7||0xcc;return function(_0x4ca403){if(_0x4ca403){return _0x2d9208['sendStatus'](_0xe7a0a7);}return _0x2d9208[_0x7f11('0x1c')](_0xe7a0a7)[_0x7f11('0x1d')]();};}function respondWithResult(_0x5c9274,_0x4fbcbc){_0x4fbcbc=_0x4fbcbc||0xc8;return function(_0x1dfa7d){if(_0x1dfa7d){return _0x5c9274[_0x7f11('0x1c')](_0x4fbcbc)[_0x7f11('0x1e')](_0x1dfa7d);}};}function respondWithFilteredResult(_0x1c9d89,_0x294e95){return function(_0x2e4f8f){if(_0x2e4f8f){var _0x50604c=typeof _0x294e95[_0x7f11('0x1f')]===_0x7f11('0x20')&&typeof _0x294e95[_0x7f11('0x21')]===_0x7f11('0x20');var _0x1d89d8=_0x2e4f8f[_0x7f11('0x22')];var _0x2e242a=_0x50604c?0x0:_0x294e95[_0x7f11('0x1f')];var _0x4b8ccb=_0x50604c?_0x2e4f8f['count']:_0x294e95['offset']+_0x294e95[_0x7f11('0x21')];var _0x13c0d9;if(_0x4b8ccb>=_0x1d89d8){_0x4b8ccb=_0x1d89d8;_0x13c0d9=0xc8;}else{_0x13c0d9=0xce;}_0x1c9d89[_0x7f11('0x1c')](_0x13c0d9);return _0x1c9d89[_0x7f11('0x23')](_0x7f11('0x24'),_0x2e242a+'-'+_0x4b8ccb+'/'+_0x1d89d8)[_0x7f11('0x1e')](_0x2e4f8f);}return null;};}function patchUpdates(_0x36eb2c){return function(_0x373895){try{jsonpatch['apply'](_0x373895,_0x36eb2c,!![]);}catch(_0x292454){return BPromise[_0x7f11('0x25')](_0x292454);}return _0x373895[_0x7f11('0x26')]();};}function saveUpdates(_0x39ddc7,_0x1465b8){return function(_0x53e95c){if(_0x53e95c){return _0x53e95c[_0x7f11('0x27')](_0x39ddc7)[_0x7f11('0x28')](function(_0x5b2fd7){return _0x5b2fd7;});}return null;};}function removeEntity(_0x48118a,_0x285115){return function(_0xec5f13){if(_0xec5f13){return _0xec5f13[_0x7f11('0x29')]()[_0x7f11('0x28')](function(){var _0x225aa0=_0xec5f13[_0x7f11('0x2a')]({'plain':!![]});var _0x3b3d4c='CustomReports';return db[_0x7f11('0x2b')]['destroy']({'where':{'type':_0x3b3d4c,'resourceId':_0x225aa0['id']}})[_0x7f11('0x28')](function(){return _0xec5f13;});})[_0x7f11('0x28')](function(){_0x48118a[_0x7f11('0x1c')](0xcc)[_0x7f11('0x1d')]();});}};}function handleEntityNotFound(_0x43362b,_0x14ca42){return function(_0x3b01b6){if(!_0x3b01b6){_0x43362b[_0x7f11('0x2c')](0x194);}return _0x3b01b6;};}function handleError(_0x351bc1,_0x5d7762){_0x5d7762=_0x5d7762||0x1f4;return function(_0x5d24a4){logger['error'](_0x5d24a4[_0x7f11('0x2d')]);if(_0x5d24a4[_0x7f11('0x2e')]){delete _0x5d24a4[_0x7f11('0x2e')];}_0x351bc1[_0x7f11('0x1c')](_0x5d7762)[_0x7f11('0x2f')](_0x5d24a4);};}exports[_0x7f11('0x30')]=function(_0x339bab,_0x4e7c64){var _0x148319={},_0x27a2a3={},_0xcc7ce9={'count':0x0,'rows':[]};var _0x334adc=_[_0x7f11('0x31')](db[_0x7f11('0x32')][_0x7f11('0x33')],function(_0x36a7db){return{'name':_0x36a7db['fieldName'],'type':_0x36a7db[_0x7f11('0x34')][_0x7f11('0x35')]};});_0x27a2a3['model']=_[_0x7f11('0x31')](_0x334adc,'name');_0x27a2a3['query']=_[_0x7f11('0x36')](_0x339bab[_0x7f11('0x37')]);_0x27a2a3['filters']=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],_0x27a2a3[_0x7f11('0x37')]);_0x148319[_0x7f11('0x3a')]=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],qs[_0x7f11('0x3b')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x148319['attributes']=_0x148319['attributes'][_0x7f11('0x3c')]?_0x148319[_0x7f11('0x3a')]:_0x27a2a3[_0x7f11('0x39')];if(!_0x339bab[_0x7f11('0x37')][_0x7f11('0x3d')](_0x7f11('0x3e'))){_0x148319[_0x7f11('0x21')]=qs[_0x7f11('0x21')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x21')]);_0x148319[_0x7f11('0x1f')]=qs['offset'](_0x339bab[_0x7f11('0x37')][_0x7f11('0x1f')]);}_0x148319[_0x7f11('0x3f')]=qs[_0x7f11('0x40')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x40')]);_0x148319['where']=qs['filters'](_[_0x7f11('0x41')](_0x339bab[_0x7f11('0x37')],_0x27a2a3[_0x7f11('0x42')]),_0x334adc);if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x43')]){_0x148319[_0x7f11('0x44')]=_['merge'](_0x148319[_0x7f11('0x44')],{'$or':_[_0x7f11('0x31')](_0x334adc,function(_0x351691){if(_0x351691[_0x7f11('0x34')]!==_0x7f11('0x45')){var _0xbc89d5={};_0xbc89d5[_0x351691[_0x7f11('0x2e')]]={'$like':'%'+_0x339bab['query'][_0x7f11('0x43')]+'%'};return _0xbc89d5;}})});}_0x148319=_[_0x7f11('0x46')]({},_0x148319,_0x339bab['options']);var _0x5c9544={'where':_0x148319[_0x7f11('0x44')]};return db[_0x7f11('0x32')][_0x7f11('0x22')](_0x5c9544)[_0x7f11('0x28')](function(_0xf490d7){_0xcc7ce9[_0x7f11('0x22')]=_0xf490d7;if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x47')]){_0x148319[_0x7f11('0x48')]=[{'all':!![]}];}return db[_0x7f11('0x32')]['findAll'](_0x148319);})[_0x7f11('0x28')](function(_0x1516c5){_0xcc7ce9[_0x7f11('0x49')]=_0x1516c5;return _0xcc7ce9;})[_0x7f11('0x28')](respondWithFilteredResult(_0x4e7c64,_0x148319))[_0x7f11('0x4a')](handleError(_0x4e7c64,null));};exports[_0x7f11('0x4b')]=function(_0x5166fb,_0x22df6b){var _0x3525d3={'raw':![],'where':{'id':_0x5166fb[_0x7f11('0x4c')]['id']}},_0x116cec={};_0x116cec['model']=_[_0x7f11('0x36')](db[_0x7f11('0x32')][_0x7f11('0x33')]);_0x116cec[_0x7f11('0x37')]=_['keys'](_0x5166fb[_0x7f11('0x37')]);_0x116cec[_0x7f11('0x42')]=_[_0x7f11('0x38')](_0x116cec['model'],_0x116cec['query']);_0x3525d3[_0x7f11('0x3a')]=_['intersection'](_0x116cec['model'],qs[_0x7f11('0x3b')](_0x5166fb[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x3525d3[_0x7f11('0x3a')]=_0x3525d3[_0x7f11('0x3a')][_0x7f11('0x3c')]?_0x3525d3[_0x7f11('0x3a')]:_0x116cec[_0x7f11('0x39')];if(_0x5166fb['query']['includeAll']){_0x3525d3[_0x7f11('0x48')]=[{'all':!![]}];}_0x3525d3=_[_0x7f11('0x46')]({},_0x3525d3,_0x5166fb[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x3525d3)[_0x7f11('0x28')](handleEntityNotFound(_0x22df6b,null))[_0x7f11('0x28')](respondWithResult(_0x22df6b,null))[_0x7f11('0x4a')](handleError(_0x22df6b,null));};exports[_0x7f11('0x4f')]=function(_0x595bc0,_0x2c29fa){return db['AnalyticCustomReport']['create'](_0x595bc0[_0x7f11('0x50')],{})['then'](function(_0x4ab82e){var _0x4e6cc7=_0x595bc0['user']['get']({'plain':!![]});if(!_0x4e6cc7)throw new Error(_0x7f11('0x51'));if(_0x4e6cc7[_0x7f11('0x52')]===_0x7f11('0x53')){var _0x42a79e=_0x4ab82e['get']({'plain':!![]});var _0x39fdb1='Reports';return db['UserProfileSection'][_0x7f11('0x4e')]({'where':{'name':_0x39fdb1,'userProfileId':_0x4e6cc7[_0x7f11('0x54')]},'raw':!![]})[_0x7f11('0x28')](function(_0x1fe49f){if(_0x1fe49f&&_0x1fe49f['autoAssociation']===0x0){return db[_0x7f11('0x2b')]['create']({'name':_0x42a79e[_0x7f11('0x2e')],'resourceId':_0x42a79e['id'],'type':_0x7f11('0x55'),'sectionId':_0x1fe49f['id']},{})[_0x7f11('0x28')](function(){return _0x4ab82e;});}else{return _0x4ab82e;}})[_0x7f11('0x4a')](function(_0x51961b){logger['error'](_0x7f11('0x56'),_0x51961b);throw _0x51961b;});}return _0x4ab82e;})[_0x7f11('0x28')](respondWithResult(_0x2c29fa,0xc9))[_0x7f11('0x4a')](handleError(_0x2c29fa,null));};exports[_0x7f11('0x27')]=function(_0xf61e5f,_0x23385c){if(_0xf61e5f['body']['id']){delete _0xf61e5f[_0x7f11('0x50')]['id'];}return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0xf61e5f['params']['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x23385c,null))[_0x7f11('0x28')](saveUpdates(_0xf61e5f[_0x7f11('0x50')],null))[_0x7f11('0x28')](respondWithResult(_0x23385c,null))['catch'](handleError(_0x23385c,null));};exports[_0x7f11('0x29')]=function(_0x2e9307,_0x530e27){return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0x2e9307[_0x7f11('0x4c')]['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x530e27,null))[_0x7f11('0x28')](removeEntity(_0x530e27,null))[_0x7f11('0x4a')](handleError(_0x530e27,null));};exports[_0x7f11('0x57')]=function(_0x1b8900,_0x4278f0){var _0x48dec5=0xa;var _0x2262c3=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2863c5={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':'MAX(%s)','MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x2cce70={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':_0x7f11('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x18a61a=function(_0x32a33e){return!_[_0x7f11('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7f11('0x68')],_0x32a33e);};var _0x452865=function(_0x52ab80){if(!_0x52ab80||!_0x52ab80[_0x7f11('0x69')]['length']){return'';}for(var _0x5031e='(',_0x2263e5=0x0;_0x2263e5<_0x52ab80['rules'][_0x7f11('0x3c')];_0x2263e5+=0x1){_0x2263e5>0x0&&(_0x5031e+='\x20'+_0x52ab80[_0x7f11('0x6a')]+'\x20');_0x5031e+=_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]?_0x452865(_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]):_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6c')]+'\x20'+_0x52ab80[_0x7f11('0x69')][_0x2263e5]['condition']+(_0x18a61a(_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6d')])?'\x20'+_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6e')]:'');}return _0x5031e+')';};var _0x54cce4={'where':{'id':_0x1b8900['params']['id']}},_0x498bfe,_0x5f1555,_0x52dbb3,_0xd7070a,_0x167009;_0x54cce4=_[_0x7f11('0x46')]({},_0x54cce4,_0x1b8900[_0x7f11('0x4d')]);return db['AnalyticCustomReport'][_0x7f11('0x4e')](_0x54cce4)[_0x7f11('0x28')](function(_0x3ce5aa){if(_0x3ce5aa){_0x498bfe=_0x3ce5aa;return _0x3ce5aa[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0x47c4bd){if(_0x47c4bd){if(!_0x47c4bd[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f1555=_0x47c4bd;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x1f95e7){if(_0x1f95e7){_0x52dbb3=_[_0x7f11('0x74')](_0x1f95e7,'id');var _0x3ede7b;var _0x4fd35a=squel[_0x7f11('0x75')]();_0x4fd35a['from'](_0x498bfe[_0x7f11('0x76')]);for(var _0x22d496=0x0;_0x22d496<_0x5f1555[_0x7f11('0x3c')];_0x22d496+=0x1){_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x77')]?_0x52dbb3[_0x5f1555[_0x22d496][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x5f1555[_0x22d496]['field'];_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2863c5[_0x5f1555[_0x22d496][_0x7f11('0x79')]],'%s',_0x3ede7b):_0x3ede7b;_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x2cce70[_0x5f1555[_0x22d496][_0x7f11('0x7b')]],'%s',_0x3ede7b):_0x3ede7b;if(_0x5f1555[_0x22d496][_0x7f11('0x7c')]){_0x4fd35a[_0x7f11('0x6b')](_0x3ede7b);}_0x5f1555[_0x22d496]['orderBy']&&_0x4fd35a[_0x7f11('0x3f')](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x4fd35a['field'](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7f')]||_0x3ede7b);}if(_0x498bfe[_0x7f11('0x80')]){_0x498bfe['joins']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x80')]);for(var _0x323f1c=0x0;_0x323f1c<_0x498bfe[_0x7f11('0x80')][_0x7f11('0x3c')];_0x323f1c+=0x1){if(_0x498bfe[_0x7f11('0x80')][_0x323f1c]['type']&&_[_0x7f11('0x67')](_0x2262c3,_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')])&&_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')]&&_0x498bfe['joins'][_0x323f1c][_0x7f11('0x83')]&&_0x498bfe['joins'][_0x323f1c]['foreignKey']){_0x4fd35a[_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')]](_0x498bfe[_0x7f11('0x80')][_0x323f1c]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x498bfe[_0x7f11('0x76')],_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')],_0x498bfe['joins'][_0x323f1c]['foreignTable'],_0x498bfe['joins'][_0x323f1c]['foreignKey']));}}}if(_0x498bfe[_0x7f11('0x84')]){_0x498bfe['conditions']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x84')]);_0x4fd35a[_0x7f11('0x44')](_0x452865(_0x498bfe['conditions'][_0x7f11('0x6b')]));}_0x167009=_0x4fd35a[_0x7f11('0x85')]();_0x4fd35a[_0x7f11('0x21')](_0x48dec5);_0x4fd35a[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x4fd35a['toString']());return dbH['sequelize']['query'](_0x4fd35a[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](respondWithResult(_0x4278f0,null))[_0x7f11('0x4a')](handleError(_0x4278f0,null));};function runReport(_0x2c6f10,_0x3abc08,_0x5660){var _0x248acd=_0x3abc08[_0x7f11('0x2e')];var _0x5a1377=0xa;var _0x75fc9e=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2a7ec4={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x36db1e={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x5629ac=function(_0x5d7ab){return!_[_0x7f11('0x67')](['IS\x20NULL',_0x7f11('0x8c'),_0x7f11('0x8d'),_0x7f11('0x68')],_0x5d7ab);};var _0x582b9d=function(_0x238d80){if(!_0x238d80||!_0x238d80[_0x7f11('0x69')]['length']){return'';}for(var _0x56e3fc='(',_0x4e1145=0x0;_0x4e1145<_0x238d80['rules']['length'];_0x4e1145+=0x1){_0x4e1145>0x0&&(_0x56e3fc+='\x20'+_0x238d80[_0x7f11('0x6a')]+'\x20');_0x56e3fc+=_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6b')]?_0x582b9d(_0x238d80[_0x7f11('0x69')][_0x4e1145]['group']):_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6c')]+'\x20'+_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6d')]+(_0x5629ac(_0x238d80['rules'][_0x4e1145]['condition'])?'\x20'+_0x238d80['rules'][_0x4e1145][_0x7f11('0x6e')]:'');}return _0x56e3fc+')';};var _0x54c468={'where':{'id':_0x2c6f10['id']}},_0x315f22,_0x2a10cc,_0x20b037,_0x3eec79,_0x2df338;_0x54c468=_['merge']({},_0x54c468,_0x5660);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x54c468)[_0x7f11('0x28')](function(_0x3b2b06){if(_0x3b2b06){_0x315f22=_0x3b2b06;return _0x3b2b06[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0xe5bcd3){if(_0xe5bcd3){if(!_0xe5bcd3[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))]['ValidationErrorItem'](_0x7f11('0x8e'),0x193);}_0x2a10cc=_0xe5bcd3;return db[_0x7f11('0x72')]['findAll']({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x2dbc13){if(_0x2dbc13){_0x20b037=_[_0x7f11('0x74')](_0x2dbc13,'id');var _0xfa5238;var _0x451311=squel[_0x7f11('0x75')]();_0x451311[_0x7f11('0x8f')](_0x315f22[_0x7f11('0x76')]);for(var _0x696d24=0x0;_0x696d24<_0x2a10cc[_0x7f11('0x3c')];_0x696d24+=0x1){_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x77')]?_0x20b037[_0x2a10cc[_0x696d24][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x2a10cc[_0x696d24][_0x7f11('0x6c')];_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2a7ec4[_0x2a10cc[_0x696d24][_0x7f11('0x79')]],'%s',_0xfa5238):_0xfa5238;_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x36db1e[_0x2a10cc[_0x696d24][_0x7f11('0x7b')]],'%s',_0xfa5238):_0xfa5238;if(_0x2a10cc[_0x696d24][_0x7f11('0x7c')]){_0x451311[_0x7f11('0x6b')](_0xfa5238);}_0x2a10cc[_0x696d24]['orderBy']&&_0x451311[_0x7f11('0x3f')](_0xfa5238,_0x2a10cc[_0x696d24][_0x7f11('0x7d')]==='DESC'?![]:!![]);_0x451311[_0x7f11('0x6c')](_0xfa5238,_0x2a10cc[_0x696d24]['alias']||_0xfa5238);}if(_0x315f22[_0x7f11('0x80')]){_0x315f22['joins']=JSON['parse'](_0x315f22[_0x7f11('0x80')]);for(var _0x51cff1=0x0;_0x51cff1<_0x315f22[_0x7f11('0x80')][_0x7f11('0x3c')];_0x51cff1+=0x1){if(_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x75fc9e,_0x315f22['joins'][_0x51cff1]['type'])&&_0x315f22[_0x7f11('0x80')][_0x51cff1]['parentKey']&&_0x315f22['joins'][_0x51cff1]['foreignTable']&&_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x90')]){_0x451311[_0x315f22[_0x7f11('0x80')][_0x51cff1]['type']](_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],null,util[_0x7f11('0x7b')](_0x7f11('0x91'),_0x315f22[_0x7f11('0x76')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x82')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],_0x315f22[_0x7f11('0x80')][_0x51cff1]['foreignKey']));}}}if(_0x315f22[_0x7f11('0x84')]){_0x315f22[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x315f22[_0x7f11('0x84')]);_0x451311[_0x7f11('0x44')](_0x582b9d(_0x315f22[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x2df338=_0x451311[_0x7f11('0x85')]();_0x451311['limit'](_0x5a1377);_0x451311[_0x7f11('0x1f')](0x0);return;}})[_0x7f11('0x28')](function(){if(_0x3abc08[_0x7f11('0x92')]===_0x7f11('0x93')){return null;}var _0x50aab1=_[_0x7f11('0x46')](_0x3abc08,{'name':_0x3abc08[_0x7f11('0x94')]||_0x3abc08[_0x7f11('0x2e')]||_0x315f22['name'],'basename':_0x248acd,'savename':util[_0x7f11('0x7b')](_0x7f11('0x95'),_0x3abc08['name']||_0x315f22['name'],require(_0x7f11('0x96'))[_0x7f11('0x97')](0x4),_0x3abc08[_0x7f11('0x92')]||_0x7f11('0x98')),'reportId':_0x315f22['id'],'reportType':_0x7f11('0x99')});return db[_0x7f11('0x9a')][_0x7f11('0x4f')](_0x50aab1,{'raw':!![]});})['then'](function(_0x439e62){if(_0x315f22[_0x7f11('0x76')]==='cdr'){_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9b'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}else{_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9e'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}if(_0x439e62){logger[_0x7f11('0x9f')](_0x7f11('0xa0'),_0x2df338[_0x7f11('0x88')]());require(_0x7f11('0xa1'))['fork'](path[_0x7f11('0x58')](__dirname,_0x7f11('0xa2'),_0x439e62[_0x7f11('0x92')]),[_0x439e62['id'],_0x2df338[_0x7f11('0x88')](),path['join'](__dirname,'../../files/reports',_0x439e62[_0x7f11('0xa3')]),_0x248acd]);return _0x439e62;}else{var _0x18222c=squel[_0x7f11('0x75')]();_0x18222c[_0x7f11('0x8f')]('('+_0x2df338['toString']()+')',_0x7f11('0xa4'));_0x18222c[_0x7f11('0x6c')](_0x7f11('0xa5'),'count');_0x2df338['limit'](_0x3abc08['limit']||_0x5a1377);_0x2df338[_0x7f11('0x1f')](_0x3abc08['offset']||0x0);return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x18222c[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']})[_0x7f11('0x28')](function(_0x1fb9de){if(!_0x1fb9de['length']){_0x3eec79=0x0;}else{_0x3eec79=_0x1fb9de[0x0][_0x7f11('0x22')]||0x0;}return dbH[_0x7f11('0xa6')]['query'](_0x2df338[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']});})[_0x7f11('0x28')](function(_0x495a95){return{'rows':_0x495a95||[],'count':_0x3eec79};});}});}exports[_0x7f11('0xa7')]=function(_0x4e0873,_0x5963f8){return runReport(_0x4e0873['params'],_0x4e0873[_0x7f11('0x37')],_0x4e0873[_0x7f11('0x4d')])[_0x7f11('0x28')](respondWithResult(_0x5963f8,null))['catch'](handleError(_0x5963f8,null));};exports[_0x7f11('0xa8')]=runReport;exports[_0x7f11('0x37')]=function(_0x2c82e,_0x2de410){var _0x4212ea=0xa;var _0x29e09a=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0xa15263={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':_0x7f11('0xa9'),'GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3623d5={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x531a18=function(_0x3d0174){return!_[_0x7f11('0x67')]([_0x7f11('0xaa'),_0x7f11('0x8c'),_0x7f11('0x8d'),'IS\x20NOT\x20EMPTY'],_0x3d0174);};var _0x45dfa8=function(_0x22e4d7){if(!_0x22e4d7||!_0x22e4d7[_0x7f11('0x69')][_0x7f11('0x3c')]){return'';}for(var _0x4fc2e2='(',_0x190f52=0x0;_0x190f52<_0x22e4d7['rules'][_0x7f11('0x3c')];_0x190f52+=0x1){_0x190f52>0x0&&(_0x4fc2e2+='\x20'+_0x22e4d7['operator']+'\x20');_0x4fc2e2+=_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]?_0x45dfa8(_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]):_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6c')]+'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['condition']+(_0x531a18(_0x22e4d7['rules'][_0x190f52][_0x7f11('0x6d')])?'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['value']:'');}return _0x4fc2e2+')';};var _0x7b4682={'where':{'id':_0x2c82e['params']['id']}},_0x5adcf0,_0x3db2f7,_0x11ae98,_0x3c44a0,_0x132392;_0x7b4682=_[_0x7f11('0x46')]({},_0x7b4682,_0x2c82e[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x7b4682)['then'](function(_0x251da5){if(_0x251da5){_0x5adcf0=_0x251da5;return _0x251da5[_0x7f11('0x6f')]();}return null;})['then'](function(_0x3c055c){if(_0x3c055c){if(!_0x3c055c[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3db2f7=_0x3c055c;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x177fd9){if(_0x177fd9){_0x11ae98=_[_0x7f11('0x74')](_0x177fd9,'id');var _0x392786;var _0x45e0dc=squel[_0x7f11('0x75')]();_0x45e0dc[_0x7f11('0x8f')](_0x5adcf0[_0x7f11('0x76')]);for(var _0x238144=0x0;_0x238144<_0x3db2f7['length'];_0x238144+=0x1){_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x77')]?_0x11ae98[_0x3db2f7[_0x238144][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x3db2f7[_0x238144][_0x7f11('0x6c')];_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0xa15263[_0x3db2f7[_0x238144][_0x7f11('0x79')]],'%s',_0x392786):_0x392786;_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x3623d5[_0x3db2f7[_0x238144]['format']],'%s',_0x392786):_0x392786;if(_0x3db2f7[_0x238144][_0x7f11('0x7c')]){_0x45e0dc[_0x7f11('0x6b')](_0x392786);}_0x3db2f7[_0x238144][_0x7f11('0x7d')]&&_0x45e0dc[_0x7f11('0x3f')](_0x392786,_0x3db2f7[_0x238144][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x45e0dc[_0x7f11('0x6c')](_0x392786,_0x3db2f7[_0x238144]['alias']||_0x392786);}if(_0x5adcf0[_0x7f11('0x80')]){_0x5adcf0[_0x7f11('0x80')]=JSON['parse'](_0x5adcf0[_0x7f11('0x80')]);for(var _0x27e455=0x0;_0x27e455<_0x5adcf0[_0x7f11('0x80')][_0x7f11('0x3c')];_0x27e455+=0x1){if(_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x29e09a,_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')])&&_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x82')]&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignTable']&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignKey']){_0x45e0dc[_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]](_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],null,util[_0x7f11('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5adcf0['table'],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x82')],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x90')]));}}}if(_0x5adcf0['conditions']){_0x5adcf0[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x5adcf0[_0x7f11('0x84')]);_0x45e0dc[_0x7f11('0x44')](_0x45dfa8(_0x5adcf0[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x132392=_0x45e0dc[_0x7f11('0x85')]();_0x45e0dc[_0x7f11('0x21')](_0x4212ea);_0x45e0dc[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x45e0dc[_0x7f11('0x88')]());return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x45e0dc[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](function(){return{'sql':_0x132392['toString']()};})[_0x7f11('0x28')](respondWithResult(_0x2de410,null))[_0x7f11('0x4a')](handleError(_0x2de410,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index c948751..9f0c8fa 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 _0xd78e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xd78e,0x83));var _0xed78=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xd78e[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xed78('0x0'));var util=require(_0xed78('0x1'));var logger=require(_0xed78('0x2'))('api');var moment=require(_0xed78('0x3'));var BPromise=require(_0xed78('0x4'));var rp=require(_0xed78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed78('0x6'));var config=require(_0xed78('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1a6389,_0x16ea14){return _0x1a6389[_0xed78('0x8')](_0xed78('0x9'),attributes,{'tableName':_0xed78('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8ce=['analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x306626,_0x425e93){var _0x466728=function(_0x3b3478){while(--_0x3b3478){_0x306626['push'](_0x306626['shift']());}};_0x466728(++_0x425e93);}(_0xf8ce,0x1da));var _0xef8c=function(_0x41d9a8,_0x386c27){_0x41d9a8=_0x41d9a8-0x0;var _0x146498=_0xf8ce[_0x41d9a8];return _0x146498;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef8c('0x0'))(_0xef8c('0x1'));var moment=require(_0xef8c('0x2'));var BPromise=require(_0xef8c('0x3'));var rp=require(_0xef8c('0x4'));var fs=require('fs');var path=require(_0xef8c('0x5'));var rimraf=require(_0xef8c('0x6'));var config=require(_0xef8c('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xef8c('0x8')]=function(_0x56149c,_0x57e0fd){return _0x56149c[_0xef8c('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xef8c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index c8ab46f..71753d6 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 _0xa1dc=['catch','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x1d2a6c,_0x4523a9){var _0x30e0c9=function(_0x32fb85){while(--_0x32fb85){_0x1d2a6c['push'](_0x1d2a6c['shift']());}};_0x30e0c9(++_0x4523a9);}(_0xa1dc,0xaa));var _0xca1d=function(_0x54dc96,_0x360e0c){_0x54dc96=_0x54dc96-0x0;var _0x3ec0f1=_0xa1dc[_0x54dc96];return _0x3ec0f1;};'use strict';var _=require(_0xca1d('0x0'));var util=require(_0xca1d('0x1'));var moment=require(_0xca1d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca1d('0x3'));var db=require(_0xca1d('0x4'))['db'];var utils=require(_0xca1d('0x5'));var logger=require(_0xca1d('0x6'))(_0xca1d('0x7'));var config=require('../../config/environment');var jayson=require(_0xca1d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0c99,_0x2765d2,_0x486080){return new BPromise(function(_0x261116,_0x4572d9){return client[_0xca1d('0x9')](_0x4a0c99,_0x486080)[_0xca1d('0xa')](function(_0x2d7535){logger[_0xca1d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,'request\x20sent');logger[_0xca1d('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2765d2,_0xca1d('0xd'),JSON[_0xca1d('0xe')](_0x2d7535));if(_0x2d7535[_0xca1d('0xf')]){if(_0x2d7535[_0xca1d('0xf')][_0xca1d('0x10')]===0x1f4){logger[_0xca1d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0x2d7535[_0xca1d('0xf')][_0xca1d('0x11')]);return _0x4572d9(_0x2d7535[_0xca1d('0xf')][_0xca1d('0x11')]);}logger[_0xca1d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0x2d7535[_0xca1d('0xf')]['message']);return _0x261116(_0x2d7535[_0xca1d('0xf')]['message']);}else{logger[_0xca1d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0xca1d('0xd'));_0x261116(_0x2d7535[_0xca1d('0x12')][_0xca1d('0x11')]);}})[_0xca1d('0x13')](function(_0xb24df6){logger[_0xca1d('0xf')](_0xca1d('0x14'),_0x2765d2,_0xb24df6);_0x4572d9(_0xb24df6);});});}
\ No newline at end of file
+var _0x1872=['then','info','request\x20sent','debug','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3a7189,_0x429f51){var _0x47f36b=function(_0x19781b){while(--_0x19781b){_0x3a7189['push'](_0x3a7189['shift']());}};_0x47f36b(++_0x429f51);}(_0x1872,0xa3));var _0x2187=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x1872[_0x3b8ed6];return _0x2e6223;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var moment=require(_0x2187('0x2'));var BPromise=require(_0x2187('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2187('0x4'));var db=require(_0x2187('0x5'))['db'];var utils=require(_0x2187('0x6'));var logger=require(_0x2187('0x7'))(_0x2187('0x8'));var config=require(_0x2187('0x9'));var jayson=require(_0x2187('0xa'));var client=jayson['client'][_0x2187('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec26ed,_0xa25c54,_0x3a9fb6){return new BPromise(function(_0x15d738,_0x400650){return client[_0x2187('0xc')](_0xec26ed,_0x3a9fb6)[_0x2187('0xd')](function(_0x2c7c2b){logger[_0x2187('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'));logger[_0x2187('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'),JSON[_0x2187('0x11')](_0x2c7c2b));if(_0x2c7c2b['error']){if(_0x2c7c2b['error'][_0x2187('0x12')]===0x1f4){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x400650(_0x2c7c2b['error'][_0x2187('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x15d738(_0x2c7c2b[_0x2187('0x13')]['message']);}else{logger[_0x2187('0xe')](_0x2187('0x14'),_0xa25c54,_0x2187('0xf'));_0x15d738(_0x2c7c2b['result']['message']);}})['catch'](function(_0x126e90){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x126e90);_0x400650(_0x126e90);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index b1b5aa7..13ac362 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 _0xeb52=['/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview'];(function(_0xf9a335,_0x2c5784){var _0x8c0ca4=function(_0x388d8a){while(--_0x388d8a){_0xf9a335['push'](_0xf9a335['shift']());}};_0x8c0ca4(++_0x2c5784);}(_0xeb52,0x113));var _0x2eb5=function(_0x30f788,_0x9a4ef5){_0x30f788=_0x30f788-0x0;var _0x39d80c=_0xeb52[_0x30f788];return _0x39d80c;};'use strict';var multer=require(_0x2eb5('0x0'));var util=require('util');var path=require(_0x2eb5('0x1'));var timeout=require(_0x2eb5('0x2'));var express=require(_0x2eb5('0x3'));var router=express[_0x2eb5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2eb5('0x5'));var config=require('../../config/environment');var controller=require(_0x2eb5('0x6'));router[_0x2eb5('0x7')]('/',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x9')]);router['get']('/:id',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0xa')]);router[_0x2eb5('0x7')](_0x2eb5('0xb'),auth['isAuthenticated'](),controller[_0x2eb5('0xc')]);router[_0x2eb5('0x7')](_0x2eb5('0xd'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0xe')]);router['get'](_0x2eb5('0xf'),auth[_0x2eb5('0x8')](),controller['query']);router[_0x2eb5('0x10')]('/',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x11')]);router[_0x2eb5('0x12')](_0x2eb5('0x13'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x14')]);router[_0x2eb5('0x15')](_0x2eb5('0x13'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x16')]);module[_0x2eb5('0x17')]=router;
\ No newline at end of file
+var _0x926a=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','query','post','create','put'];(function(_0x44dce7,_0x32e89e){var _0x4ee56e=function(_0x285afb){while(--_0x285afb){_0x44dce7['push'](_0x44dce7['shift']());}};_0x4ee56e(++_0x32e89e);}(_0x926a,0x146));var _0xa926=function(_0xe06035,_0x22a4f9){_0xe06035=_0xe06035-0x0;var _0x352a58=_0x926a[_0xe06035];return _0x352a58;};'use strict';var multer=require(_0xa926('0x0'));var util=require(_0xa926('0x1'));var path=require(_0xa926('0x2'));var timeout=require('connect-timeout');var express=require(_0xa926('0x3'));var router=express['Router']();var fs_extra=require(_0xa926('0x4'));var auth=require(_0xa926('0x5'));var interaction=require(_0xa926('0x6'));var config=require(_0xa926('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xa926('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa926('0x8')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0xa')]);router['get'](_0xa926('0xb'),auth[_0xa926('0xc')](),controller[_0xa926('0xd')]);router[_0xa926('0x8')](_0xa926('0xe'),auth[_0xa926('0xc')](),controller['run']);router[_0xa926('0x8')]('/:id/query',auth[_0xa926('0xc')](),controller[_0xa926('0xf')]);router[_0xa926('0x10')]('/',auth[_0xa926('0xc')](),controller[_0xa926('0x11')]);router[_0xa926('0x12')](_0xa926('0x9'),auth[_0xa926('0xc')](),controller[_0xa926('0x13')]);router[_0xa926('0x14')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0x15')]);module[_0xa926('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 84dca59..e2053e3 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 _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x89e3b9,_0x37db7f){var _0x5c1b19=function(_0x3c8b52){while(--_0x3c8b52){_0x89e3b9['push'](_0x89e3b9['shift']());}};_0x5c1b19(++_0x37db7f);}(_0x1883,0xab));var _0x3188=function(_0x54e096,_0x2245ac){_0x54e096=_0x54e096-0x0;var _0x386a42=_0x1883[_0x54e096];return _0x386a42;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
+var _0xee14=['STRING','TEXT'];(function(_0x459367,_0x45609c){var _0x7a0561=function(_0x53a812){while(--_0x53a812){_0x459367['push'](_0x459367['shift']());}};_0x7a0561(++_0x45609c);}(_0xee14,0x13a));var _0x4ee1=function(_0x554e00,_0x2d1b2e){_0x554e00=_0x554e00-0x0;var _0x5165f6=_0xee14[_0x554e00];return _0x5165f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a29517c..8fccb2f 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xabce[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x8f123d,_0x232ae9){var _0x54cc18=function(_0x4c24a0){while(--_0x4c24a0){_0x8f123d['push'](_0x8f123d['shift']());}};_0x54cc18(++_0x232ae9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14c9c2,_0x35a467){_0x14c9c2=_0x14c9c2-0x0;var _0x1dc7b4=_0x1cb9[_0x14c9c2];return _0x1dc7b4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index e0b105c..60fcdf5 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 _0x55b2=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x40c1a6,_0x349514){var _0x403f1c=function(_0x4e64b3){while(--_0x4e64b3){_0x40c1a6['push'](_0x40c1a6['shift']());}};_0x403f1c(++_0x349514);}(_0x55b2,0xb2));var _0x255b=function(_0x527c18,_0x5db700){_0x527c18=_0x527c18-0x0;var _0x5ac45c=_0x55b2[_0x527c18];return _0x5ac45c;};'use strict';var _=require(_0x255b('0x0'));var util=require(_0x255b('0x1'));var logger=require('../../config/logger')(_0x255b('0x2'));var moment=require(_0x255b('0x3'));var BPromise=require(_0x255b('0x4'));var rp=require(_0x255b('0x5'));var fs=require('fs');var path=require(_0x255b('0x6'));var rimraf=require(_0x255b('0x7'));var config=require(_0x255b('0x8'));var attributes=require(_0x255b('0x9'));module[_0x255b('0xa')]=function(_0x516adb,_0x3a2c93){return _0x516adb['define'](_0x255b('0xb'),attributes,{'tableName':_0x255b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa51e=['define','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x30433e,_0x37960c){var _0xb59e95=function(_0x58fc82){while(--_0x58fc82){_0x30433e['push'](_0x30433e['shift']());}};_0xb59e95(++_0x37960c);}(_0xa51e,0x176));var _0xea51=function(_0x1439e6,_0x2634b8){_0x1439e6=_0x1439e6-0x0;var _0x1101a9=_0xa51e[_0x1439e6];return _0x1101a9;};'use strict';var _=require('lodash');var util=require(_0xea51('0x0'));var logger=require('../../config/logger')(_0xea51('0x1'));var moment=require(_0xea51('0x2'));var BPromise=require(_0xea51('0x3'));var rp=require(_0xea51('0x4'));var fs=require('fs');var path=require(_0xea51('0x5'));var rimraf=require(_0xea51('0x6'));var config=require(_0xea51('0x7'));var attributes=require(_0xea51('0x8'));module[_0xea51('0x9')]=function(_0x439266,_0xaf9b90){return _0x439266[_0xea51('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xea51('0xb'),'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 4b43a3a..7239c63 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 _0x00d6=['../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x00d6,0x83));var _0x600d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x00d6[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x600d('0x0'));var util=require(_0x600d('0x1'));var moment=require('moment');var BPromise=require(_0x600d('0x2'));var rs=require(_0x600d('0x3'));var fs=require('fs');var Redis=require(_0x600d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x600d('0x5'));var logger=require(_0x600d('0x6'))('rpc');var config=require(_0x600d('0x7'));var jayson=require(_0x600d('0x8'));var client=jayson[_0x600d('0x9')][_0x600d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x361783,_0x4fe72,_0x2cfd01){return new BPromise(function(_0x4b3f00,_0x485ebd){return client[_0x600d('0xb')](_0x361783,_0x2cfd01)[_0x600d('0xc')](function(_0x3bab4c){logger['info'](_0x600d('0xd'),_0x4fe72,_0x600d('0xe'));logger[_0x600d('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fe72,_0x600d('0xe'),JSON[_0x600d('0x10')](_0x3bab4c));if(_0x3bab4c[_0x600d('0x11')]){if(_0x3bab4c[_0x600d('0x11')][_0x600d('0x12')]===0x1f4){logger[_0x600d('0x11')](_0x600d('0xd'),_0x4fe72,_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);return _0x485ebd(_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);}logger[_0x600d('0x11')](_0x600d('0xd'),_0x4fe72,_0x3bab4c[_0x600d('0x11')]['message']);return _0x4b3f00(_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);}else{logger[_0x600d('0x14')](_0x600d('0xd'),_0x4fe72,'request\x20sent');_0x4b3f00(_0x3bab4c[_0x600d('0x15')][_0x600d('0x13')]);}})[_0x600d('0x16')](function(_0x5e3f7a){logger[_0x600d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fe72,_0x5e3f7a);_0x485ebd(_0x5e3f7a);});});}
\ No newline at end of file
+var _0xec38=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xec38,0x15a));var _0x8ec3=function(_0x4ff120,_0x30ee0b){_0x4ff120=_0x4ff120-0x0;var _0x1a8437=_0xec38[_0x4ff120];return _0x1a8437;};'use strict';var _=require(_0x8ec3('0x0'));var util=require('util');var moment=require(_0x8ec3('0x1'));var BPromise=require(_0x8ec3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ec3('0x3'));var db=require(_0x8ec3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ec3('0x5'))(_0x8ec3('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec3('0x7'));var client=jayson[_0x8ec3('0x8')][_0x8ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x180ccf,_0x11ad19,_0x53619f){return new BPromise(function(_0x3cab6b,_0x3cc7c9){return client[_0x8ec3('0xa')](_0x180ccf,_0x53619f)[_0x8ec3('0xb')](function(_0x595c5e){logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,'request\x20sent');logger[_0x8ec3('0xe')](_0x8ec3('0xf'),_0x11ad19,_0x8ec3('0x10'),JSON[_0x8ec3('0x11')](_0x595c5e));if(_0x595c5e[_0x8ec3('0x12')]){if(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x13')]===0x1f4){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x595c5e['error'][_0x8ec3('0x14')]);return _0x3cc7c9(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}logger['error'](_0x8ec3('0xd'),_0x11ad19,_0x595c5e[_0x8ec3('0x12')]['message']);return _0x3cab6b(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}else{logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,_0x8ec3('0x10'));_0x3cab6b(_0x595c5e[_0x8ec3('0x15')][_0x8ec3('0x14')]);}})[_0x8ec3('0x16')](function(_0x11e826){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x11e826);_0x3cc7c9(_0x11e826);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index c62c94f..28d35f3 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 _0xfea2=['/:id/query','query','post','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','run'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xfea2,0x156));var _0x2fea=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xfea2[_0xf97eb0];return _0xea70f4;};'use strict';var multer=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var path=require(_0x2fea('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fea('0x3'));var router=express[_0x2fea('0x4')]();var fs_extra=require(_0x2fea('0x5'));var auth=require(_0x2fea('0x6'));var interaction=require(_0x2fea('0x7'));var config=require(_0x2fea('0x8'));var controller=require(_0x2fea('0x9'));router['get']('/',auth[_0x2fea('0xa')](),controller[_0x2fea('0xb')]);router['get'](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller[_0x2fea('0xd')]);router[_0x2fea('0xe')](_0x2fea('0xf'),auth[_0x2fea('0xa')](),controller[_0x2fea('0x10')]);router[_0x2fea('0xe')]('/:id/run',auth[_0x2fea('0xa')](),controller[_0x2fea('0x11')]);router['get'](_0x2fea('0x12'),auth['isAuthenticated'](),controller[_0x2fea('0x13')]);router[_0x2fea('0x14')]('/',auth[_0x2fea('0xa')](),controller['create']);router['put'](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller[_0x2fea('0x15')]);router[_0x2fea('0x16')](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller['destroy']);module[_0x2fea('0x17')]=router;
\ No newline at end of file
+var _0xf097=['delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put'];(function(_0x47458a,_0x494317){var _0x11955e=function(_0x35acd3){while(--_0x35acd3){_0x47458a['push'](_0x47458a['shift']());}};_0x11955e(++_0x494317);}(_0xf097,0x10c));var _0x7f09=function(_0x45cd76,_0x2e2a5b){_0x45cd76=_0x45cd76-0x0;var _0x55918d=_0xf097[_0x45cd76];return _0x55918d;};'use strict';var multer=require(_0x7f09('0x0'));var util=require('util');var path=require(_0x7f09('0x1'));var timeout=require(_0x7f09('0x2'));var express=require('express');var router=express[_0x7f09('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f09('0x4'));var interaction=require(_0x7f09('0x5'));var config=require(_0x7f09('0x6'));var controller=require(_0x7f09('0x7'));router[_0x7f09('0x8')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0xa')]);router[_0x7f09('0x8')]('/:id',auth[_0x7f09('0x9')](),controller[_0x7f09('0xb')]);router[_0x7f09('0x8')](_0x7f09('0xc'),auth['isAuthenticated'](),controller[_0x7f09('0xd')]);router[_0x7f09('0x8')](_0x7f09('0xe'),auth['isAuthenticated'](),controller[_0x7f09('0xf')]);router[_0x7f09('0x8')](_0x7f09('0x10'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x11')]);router[_0x7f09('0x12')]('/',auth[_0x7f09('0x9')](),controller['create']);router[_0x7f09('0x13')]('/:id',auth[_0x7f09('0x9')](),controller['update']);router[_0x7f09('0x14')](_0x7f09('0x15'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x16')]);module[_0x7f09('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 7327066..03bf9c6 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 _0x5e85=['xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf'];(function(_0x22cb97,_0x57a60b){var _0x7a60cd=function(_0x51be30){while(--_0x51be30){_0x22cb97['push'](_0x22cb97['shift']());}};_0x7a60cd(++_0x57a60b);}(_0x5e85,0x127));var _0x55e8=function(_0x3aac7c,_0x1619d3){_0x3aac7c=_0x3aac7c-0x0;var _0x43d651=_0x5e85[_0x3aac7c];return _0x43d651;};'use strict';var Sequelize=require(_0x55e8('0x0'));var moment=require(_0x55e8('0x1'));module['exports']={'name':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x55e8('0x3')]('csv',_0x55e8('0x4'),_0x55e8('0x5')),'allowNull':![],'defaultValue':_0x55e8('0x6')},'savename':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x55e8('0x7')]},'endDate':{'type':Sequelize[_0x55e8('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x55e8('0x8')},'type':{'type':Sequelize[_0x55e8('0x3')](_0x55e8('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x55e8('0xa')](0xb)[_0x55e8('0xb')]},'reportType':{'type':Sequelize[_0x55e8('0x2')]}};
\ No newline at end of file
+var _0x727d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x727d,0xad));var _0xd727=function(_0x1acb96,_0x108216){_0x1acb96=_0x1acb96-0x0;var _0x5da6cf=_0x727d[_0x1acb96];return _0x5da6cf;};'use strict';var Sequelize=require(_0xd727('0x0'));var moment=require('moment');module[_0xd727('0x1')]={'name':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd727('0x3')]('csv',_0xd727('0x4'),_0xd727('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd727('0x6')]},'endDate':{'type':Sequelize[_0xd727('0x6')]},'status':{'type':Sequelize[_0xd727('0x2')],'defaultValue':_0xd727('0x7')},'type':{'type':Sequelize[_0xd727('0x3')](_0xd727('0x8'),_0xd727('0x9')),'allowNull':![],'defaultValue':_0xd727('0x8')},'reportId':{'type':Sequelize[_0xd727('0xa')](0xb)[_0xd727('0xb')]},'reportType':{'type':Sequelize[_0xd727('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 5bcaf11..5307886 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 _0xa9c3=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','include','findAll','rows','catch','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','server/files/reports','format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x36ea94,_0x6178c4){var _0x2d1fe0=function(_0x2c0dbb){while(--_0x2c0dbb){_0x36ea94['push'](_0x36ea94['shift']());}};_0x2d1fe0(++_0x6178c4);}(_0xa9c3,0xf6));var _0x3a9c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa9c3[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x3a9c('0x0'));var rimraf=require(_0x3a9c('0x1'));var zipdir=require(_0x3a9c('0x2'));var jsonpatch=require(_0x3a9c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a9c('0x4'));var Mustache=require(_0x3a9c('0x5'));var util=require(_0x3a9c('0x6'));var path=require(_0x3a9c('0x7'));var sox=require('sox');var csv=require(_0x3a9c('0x8'));var ejs=require(_0x3a9c('0x9'));var fs=require('fs');var fs_extra=require(_0x3a9c('0xa'));var _=require(_0x3a9c('0xb'));var squel=require(_0x3a9c('0xc'));var crypto=require(_0x3a9c('0xd'));var jsforce=require(_0x3a9c('0xe'));var deskjs=require(_0x3a9c('0xf'));var toCsv=require(_0x3a9c('0x8'));var querystring=require(_0x3a9c('0x10'));var Papa=require(_0x3a9c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a9c('0x12'));var as=require(_0x3a9c('0x13'));var hardwareService=require(_0x3a9c('0x14'));var logger=require(_0x3a9c('0x15'))(_0x3a9c('0x16'));var utils=require(_0x3a9c('0x17'));var config=require(_0x3a9c('0x18'));var licenseUtil=require(_0x3a9c('0x19'));var db=require(_0x3a9c('0x1a'))['db'];function respondWithStatusCode(_0x17746b,_0x5ec258){_0x5ec258=_0x5ec258||0xcc;return function(_0x286422){if(_0x286422){return _0x17746b['sendStatus'](_0x5ec258);}return _0x17746b['status'](_0x5ec258)[_0x3a9c('0x1b')]();};}function respondWithResult(_0x5d21c9,_0x382c7b){_0x382c7b=_0x382c7b||0xc8;return function(_0x4aff3a){if(_0x4aff3a){return _0x5d21c9['status'](_0x382c7b)[_0x3a9c('0x1c')](_0x4aff3a);}};}function respondWithFilteredResult(_0x311f63,_0x1865ae){return function(_0x3f0dad){if(_0x3f0dad){var _0x5762fc=typeof _0x1865ae[_0x3a9c('0x1d')]===_0x3a9c('0x1e')&&typeof _0x1865ae['limit']===_0x3a9c('0x1e');var _0x2c5774=_0x3f0dad[_0x3a9c('0x1f')];var _0x3bf940=_0x5762fc?0x0:_0x1865ae[_0x3a9c('0x1d')];var _0x45f053=_0x5762fc?_0x3f0dad['count']:_0x1865ae[_0x3a9c('0x1d')]+_0x1865ae[_0x3a9c('0x20')];var _0x4d7890;if(_0x45f053>=_0x2c5774){_0x45f053=_0x2c5774;_0x4d7890=0xc8;}else{_0x4d7890=0xce;}_0x311f63[_0x3a9c('0x21')](_0x4d7890);return _0x311f63[_0x3a9c('0x22')](_0x3a9c('0x23'),_0x3bf940+'-'+_0x45f053+'/'+_0x2c5774)['json'](_0x3f0dad);}return null;};}function patchUpdates(_0x596335){return function(_0x1a1e5d){try{jsonpatch[_0x3a9c('0x24')](_0x1a1e5d,_0x596335,!![]);}catch(_0x1e330c){return BPromise[_0x3a9c('0x25')](_0x1e330c);}return _0x1a1e5d[_0x3a9c('0x26')]();};}function saveUpdates(_0x553b27,_0x3702ea){return function(_0x24776e){if(_0x24776e){return _0x24776e['update'](_0x553b27)[_0x3a9c('0x27')](function(_0x5570f7){return _0x5570f7;});}return null;};}function removeEntity(_0x58e87e,_0x27d0a7){return function(_0x2274cf){if(_0x2274cf){return _0x2274cf[_0x3a9c('0x28')]()[_0x3a9c('0x27')](function(){var _0x3792eb=_0x2274cf[_0x3a9c('0x29')]({'plain':!![]});var _0xe585c5=_0x3a9c('0x2a');return db[_0x3a9c('0x2b')][_0x3a9c('0x28')]({'where':{'type':_0xe585c5,'resourceId':_0x3792eb['id']}})[_0x3a9c('0x27')](function(){return _0x2274cf;});})['then'](function(){_0x58e87e[_0x3a9c('0x21')](0xcc)[_0x3a9c('0x1b')]();});}};}function handleEntityNotFound(_0x29f53c,_0x4d1187){return function(_0x4dbe41){if(!_0x4dbe41){_0x29f53c[_0x3a9c('0x2c')](0x194);}return _0x4dbe41;};}function handleError(_0x397104,_0x47e8ab){_0x47e8ab=_0x47e8ab||0x1f4;return function(_0x401cb0){logger['error'](_0x401cb0[_0x3a9c('0x2d')]);if(_0x401cb0['name']){delete _0x401cb0['name'];}_0x397104[_0x3a9c('0x21')](_0x47e8ab)[_0x3a9c('0x2e')](_0x401cb0);};}exports[_0x3a9c('0x2f')]=function(_0x17ffbd,_0x210025){var _0x350e2c={},_0x335131={},_0x3af2e6={'count':0x0,'rows':[]};var _0x58a2b0=_[_0x3a9c('0x30')](db[_0x3a9c('0x31')][_0x3a9c('0x32')],function(_0x51abc5){return{'name':_0x51abc5[_0x3a9c('0x33')],'type':_0x51abc5[_0x3a9c('0x34')]['key']};});_0x335131['model']=_['map'](_0x58a2b0,'name');_0x335131[_0x3a9c('0x35')]=_[_0x3a9c('0x36')](_0x17ffbd[_0x3a9c('0x35')]);_0x335131['filters']=_[_0x3a9c('0x37')](_0x335131[_0x3a9c('0x38')],_0x335131[_0x3a9c('0x35')]);_0x350e2c[_0x3a9c('0x39')]=_[_0x3a9c('0x37')](_0x335131[_0x3a9c('0x38')],qs[_0x3a9c('0x3a')](_0x17ffbd['query']['fields']));_0x350e2c[_0x3a9c('0x39')]=_0x350e2c[_0x3a9c('0x39')][_0x3a9c('0x3b')]?_0x350e2c[_0x3a9c('0x39')]:_0x335131[_0x3a9c('0x38')];if(!_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x3c')](_0x3a9c('0x3d'))){_0x350e2c[_0x3a9c('0x20')]=qs[_0x3a9c('0x20')](_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x20')]);_0x350e2c[_0x3a9c('0x1d')]=qs[_0x3a9c('0x1d')](_0x17ffbd[_0x3a9c('0x35')]['offset']);}_0x350e2c[_0x3a9c('0x3e')]=qs['sort'](_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x3f')]);_0x350e2c[_0x3a9c('0x40')]=qs[_0x3a9c('0x41')](_[_0x3a9c('0x42')](_0x17ffbd[_0x3a9c('0x35')],_0x335131[_0x3a9c('0x41')]),_0x58a2b0);if(_0x17ffbd[_0x3a9c('0x35')]['filter']){_0x350e2c[_0x3a9c('0x40')]=_[_0x3a9c('0x43')](_0x350e2c['where'],{'$or':_[_0x3a9c('0x30')](_0x58a2b0,function(_0x3cfc17){if(_0x3cfc17[_0x3a9c('0x34')]!==_0x3a9c('0x44')){var _0xac4984={};_0xac4984[_0x3cfc17[_0x3a9c('0x45')]]={'$like':'%'+_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x46')]+'%'};return _0xac4984;}})});}_0x350e2c=_[_0x3a9c('0x43')]({},_0x350e2c,_0x17ffbd[_0x3a9c('0x47')]);var _0x2ec9e2={'where':_0x350e2c[_0x3a9c('0x40')]};return db[_0x3a9c('0x31')][_0x3a9c('0x1f')](_0x2ec9e2)[_0x3a9c('0x27')](function(_0x22abd2){_0x3af2e6[_0x3a9c('0x1f')]=_0x22abd2;if(_0x17ffbd['query']['includeAll']){_0x350e2c[_0x3a9c('0x48')]=[{'all':!![]}];}return db[_0x3a9c('0x31')][_0x3a9c('0x49')](_0x350e2c);})[_0x3a9c('0x27')](function(_0x51b29c){_0x3af2e6[_0x3a9c('0x4a')]=_0x51b29c;return _0x3af2e6;})[_0x3a9c('0x27')](respondWithFilteredResult(_0x210025,_0x350e2c))[_0x3a9c('0x4b')](handleError(_0x210025,null));};exports['show']=function(_0x23cd6f,_0x39f1b0){var _0x1a7fdc={'raw':!![],'where':{'id':_0x23cd6f[_0x3a9c('0x4c')]['id']}},_0x431f17={};_0x431f17[_0x3a9c('0x38')]=_[_0x3a9c('0x36')](db[_0x3a9c('0x31')][_0x3a9c('0x32')]);_0x431f17[_0x3a9c('0x35')]=_[_0x3a9c('0x36')](_0x23cd6f[_0x3a9c('0x35')]);_0x431f17[_0x3a9c('0x41')]=_[_0x3a9c('0x37')](_0x431f17['model'],_0x431f17[_0x3a9c('0x35')]);_0x1a7fdc[_0x3a9c('0x39')]=_[_0x3a9c('0x37')](_0x431f17[_0x3a9c('0x38')],qs[_0x3a9c('0x3a')](_0x23cd6f[_0x3a9c('0x35')]['fields']));_0x1a7fdc[_0x3a9c('0x39')]=_0x1a7fdc[_0x3a9c('0x39')][_0x3a9c('0x3b')]?_0x1a7fdc['attributes']:_0x431f17['model'];if(_0x23cd6f[_0x3a9c('0x35')][_0x3a9c('0x4d')]){_0x1a7fdc['include']=[{'all':!![]}];}_0x1a7fdc=_[_0x3a9c('0x43')]({},_0x1a7fdc,_0x23cd6f['options']);return db['AnalyticExtractedReport'][_0x3a9c('0x4e')](_0x1a7fdc)['then'](handleEntityNotFound(_0x39f1b0,null))[_0x3a9c('0x27')](respondWithResult(_0x39f1b0,null))[_0x3a9c('0x4b')](handleError(_0x39f1b0,null));};exports[_0x3a9c('0x4f')]=function(_0x1ab9fc,_0x2a3acb){return db[_0x3a9c('0x31')][_0x3a9c('0x4f')](_0x1ab9fc['body'],{})[_0x3a9c('0x27')](function(_0x37ab6b){var _0x51ab9b=_0x1ab9fc['user'][_0x3a9c('0x29')]({'plain':!![]});if(!_0x51ab9b)throw new Error(_0x3a9c('0x50'));if(_0x51ab9b[_0x3a9c('0x51')]===_0x3a9c('0x52')){var _0x28506e=_0x37ab6b[_0x3a9c('0x29')]({'plain':!![]});var _0x53427a=_0x3a9c('0x2a');return db[_0x3a9c('0x53')][_0x3a9c('0x4e')]({'where':{'name':_0x53427a,'userProfileId':_0x51ab9b[_0x3a9c('0x54')]},'raw':!![]})[_0x3a9c('0x27')](function(_0x4a3a82){if(_0x4a3a82&&_0x4a3a82[_0x3a9c('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x28506e[_0x3a9c('0x45')],'resourceId':_0x28506e['id'],'type':_0x4a3a82[_0x3a9c('0x45')],'sectionId':_0x4a3a82['id']},{})[_0x3a9c('0x27')](function(){return _0x37ab6b;});}else{return _0x37ab6b;}})[_0x3a9c('0x4b')](function(_0x1f84a8){logger[_0x3a9c('0x56')](_0x3a9c('0x57'),_0x1f84a8);throw _0x1f84a8;});}return _0x37ab6b;})[_0x3a9c('0x27')](respondWithResult(_0x2a3acb,0xc9))[_0x3a9c('0x4b')](handleError(_0x2a3acb,null));};exports[_0x3a9c('0x58')]=function(_0x5be893,_0xa695c5){if(_0x5be893[_0x3a9c('0x59')]['id']){delete _0x5be893[_0x3a9c('0x59')]['id'];}return db[_0x3a9c('0x31')]['find']({'where':{'id':_0x5be893[_0x3a9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa695c5,null))['then'](saveUpdates(_0x5be893[_0x3a9c('0x59')],null))[_0x3a9c('0x27')](respondWithResult(_0xa695c5,null))[_0x3a9c('0x4b')](handleError(_0xa695c5,null));};exports[_0x3a9c('0x28')]=function(_0x44387b,_0x599ba7){return db[_0x3a9c('0x31')][_0x3a9c('0x4e')]({'where':{'id':_0x44387b[_0x3a9c('0x4c')]['id']}})[_0x3a9c('0x27')](handleEntityNotFound(_0x599ba7,null))[_0x3a9c('0x27')](removeEntity(_0x599ba7,null))[_0x3a9c('0x4b')](handleError(_0x599ba7,null));};exports[_0x3a9c('0x5a')]=function(_0x13dc43,_0x427e37,_0x452d69){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x13dc43[_0x3a9c('0x4c')]['id']},'attributes':[_0x3a9c('0x45'),_0x3a9c('0x5b'),_0x3a9c('0x5c'),_0x3a9c('0x5d')],'raw':!![]})[_0x3a9c('0x27')](handleEntityNotFound(_0x427e37,null))['then'](function(_0x39d1b1){if(_0x39d1b1){if(!fs[_0x3a9c('0x5e')](path[_0x3a9c('0x5f')](config[_0x3a9c('0x60')],'server/files/reports',_0x39d1b1[_0x3a9c('0x5c')]))){throw new db[(_0x3a9c('0x61'))][(_0x3a9c('0x62'))](_0x3a9c('0x63'));}if(_0x13dc43[_0x3a9c('0x35')]['exists']){return _0x427e37['sendStatus'](0xc8);}return _0x427e37['download'](path[_0x3a9c('0x5f')](config['root'],_0x3a9c('0x64'),_0x39d1b1['savename']),util[_0x3a9c('0x65')]('%s.%s',_0x39d1b1[_0x3a9c('0x5b')]||_0x39d1b1[_0x3a9c('0x45')],_0x39d1b1[_0x3a9c('0x5d')]['toLowerCase']()));}})[_0x3a9c('0x4b')](handleError(_0x427e37,null));};
\ No newline at end of file
+var _0xb544=['bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','keys','rawAttributes','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x350a95,_0x30a22a){var _0x47616d=function(_0x156304){while(--_0x156304){_0x350a95['push'](_0x350a95['shift']());}};_0x47616d(++_0x30a22a);}(_0xb544,0x160));var _0x4b54=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb544[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x4b54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b54('0x1'));var jsonpatch=require(_0x4b54('0x2'));var rp=require('request-promise');var moment=require(_0x4b54('0x3'));var BPromise=require(_0x4b54('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b54('0x5'));var sox=require(_0x4b54('0x6'));var csv=require(_0x4b54('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b54('0x8'));var _=require(_0x4b54('0x9'));var squel=require(_0x4b54('0xa'));var crypto=require(_0x4b54('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b54('0xc'));var toCsv=require(_0x4b54('0x7'));var querystring=require('querystring');var Papa=require(_0x4b54('0xd'));var Redis=require(_0x4b54('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4b54('0xf'));var as=require(_0x4b54('0x10'));var hardwareService=require(_0x4b54('0x11'));var logger=require(_0x4b54('0x12'))(_0x4b54('0x13'));var utils=require(_0x4b54('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b54('0x15'))['db'];function respondWithStatusCode(_0x1894b2,_0x16513d){_0x16513d=_0x16513d||0xcc;return function(_0x2c5cf3){if(_0x2c5cf3){return _0x1894b2[_0x4b54('0x16')](_0x16513d);}return _0x1894b2['status'](_0x16513d)[_0x4b54('0x17')]();};}function respondWithResult(_0x3afcb4,_0x3633f5){_0x3633f5=_0x3633f5||0xc8;return function(_0x1da7b0){if(_0x1da7b0){return _0x3afcb4[_0x4b54('0x18')](_0x3633f5)[_0x4b54('0x19')](_0x1da7b0);}};}function respondWithFilteredResult(_0x2bb23b,_0x7af3b3){return function(_0x11218f){if(_0x11218f){var _0x40eb4c=typeof _0x7af3b3[_0x4b54('0x1a')]===_0x4b54('0x1b')&&typeof _0x7af3b3[_0x4b54('0x1c')]===_0x4b54('0x1b');var _0x59a7ec=_0x11218f[_0x4b54('0x1d')];var _0x1e4c19=_0x40eb4c?0x0:_0x7af3b3[_0x4b54('0x1a')];var _0x1a08e2=_0x40eb4c?_0x11218f[_0x4b54('0x1d')]:_0x7af3b3[_0x4b54('0x1a')]+_0x7af3b3[_0x4b54('0x1c')];var _0x109cbf;if(_0x1a08e2>=_0x59a7ec){_0x1a08e2=_0x59a7ec;_0x109cbf=0xc8;}else{_0x109cbf=0xce;}_0x2bb23b[_0x4b54('0x18')](_0x109cbf);return _0x2bb23b[_0x4b54('0x1e')]('Content-Range',_0x1e4c19+'-'+_0x1a08e2+'/'+_0x59a7ec)['json'](_0x11218f);}return null;};}function patchUpdates(_0x46d0fe){return function(_0x58a9de){try{jsonpatch['apply'](_0x58a9de,_0x46d0fe,!![]);}catch(_0x5bd741){return BPromise[_0x4b54('0x1f')](_0x5bd741);}return _0x58a9de[_0x4b54('0x20')]();};}function saveUpdates(_0x5c1b8b,_0x29b28b){return function(_0x3a0792){if(_0x3a0792){return _0x3a0792[_0x4b54('0x21')](_0x5c1b8b)[_0x4b54('0x22')](function(_0x54a339){return _0x54a339;});}return null;};}function removeEntity(_0x2a16c8,_0x288182){return function(_0x468883){if(_0x468883){return _0x468883['destroy']()['then'](function(){var _0x1f0d15=_0x468883[_0x4b54('0x23')]({'plain':!![]});var _0x45bfa2=_0x4b54('0x24');return db[_0x4b54('0x25')][_0x4b54('0x26')]({'where':{'type':_0x45bfa2,'resourceId':_0x1f0d15['id']}})[_0x4b54('0x22')](function(){return _0x468883;});})[_0x4b54('0x22')](function(){_0x2a16c8[_0x4b54('0x18')](0xcc)[_0x4b54('0x17')]();});}};}function handleEntityNotFound(_0x3d8d4f,_0x2ba4ce){return function(_0x10618e){if(!_0x10618e){_0x3d8d4f[_0x4b54('0x16')](0x194);}return _0x10618e;};}function handleError(_0x2d7ff9,_0x126be0){_0x126be0=_0x126be0||0x1f4;return function(_0x108fec){logger[_0x4b54('0x27')](_0x108fec[_0x4b54('0x28')]);if(_0x108fec[_0x4b54('0x29')]){delete _0x108fec[_0x4b54('0x29')];}_0x2d7ff9[_0x4b54('0x18')](_0x126be0)['send'](_0x108fec);};}exports[_0x4b54('0x2a')]=function(_0x53b8dc,_0x1fc775){var _0x12f210={},_0x274344={},_0x10e10e={'count':0x0,'rows':[]};var _0x3f80b6=_[_0x4b54('0x2b')](db[_0x4b54('0x2c')]['rawAttributes'],function(_0xd98f3a){return{'name':_0xd98f3a[_0x4b54('0x2d')],'type':_0xd98f3a[_0x4b54('0x2e')]['key']};});_0x274344[_0x4b54('0x2f')]=_[_0x4b54('0x2b')](_0x3f80b6,_0x4b54('0x29'));_0x274344[_0x4b54('0x30')]=_['keys'](_0x53b8dc['query']);_0x274344[_0x4b54('0x31')]=_[_0x4b54('0x32')](_0x274344[_0x4b54('0x2f')],_0x274344[_0x4b54('0x30')]);_0x12f210[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x274344['model'],qs['fields'](_0x53b8dc[_0x4b54('0x30')]['fields']));_0x12f210[_0x4b54('0x33')]=_0x12f210[_0x4b54('0x33')]['length']?_0x12f210['attributes']:_0x274344[_0x4b54('0x2f')];if(!_0x53b8dc['query'][_0x4b54('0x34')](_0x4b54('0x35'))){_0x12f210[_0x4b54('0x1c')]=qs[_0x4b54('0x1c')](_0x53b8dc[_0x4b54('0x30')]['limit']);_0x12f210[_0x4b54('0x1a')]=qs['offset'](_0x53b8dc['query']['offset']);}_0x12f210[_0x4b54('0x36')]=qs[_0x4b54('0x37')](_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x37')]);_0x12f210[_0x4b54('0x38')]=qs[_0x4b54('0x31')](_[_0x4b54('0x39')](_0x53b8dc[_0x4b54('0x30')],_0x274344['filters']),_0x3f80b6);if(_0x53b8dc[_0x4b54('0x30')]['filter']){_0x12f210[_0x4b54('0x38')]=_[_0x4b54('0x3a')](_0x12f210[_0x4b54('0x38')],{'$or':_[_0x4b54('0x2b')](_0x3f80b6,function(_0x3e92e5){if(_0x3e92e5[_0x4b54('0x2e')]!==_0x4b54('0x3b')){var _0x554b2a={};_0x554b2a[_0x3e92e5['name']]={'$like':'%'+_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0x554b2a;}})});}_0x12f210=_[_0x4b54('0x3a')]({},_0x12f210,_0x53b8dc[_0x4b54('0x3d')]);var _0x3af63c={'where':_0x12f210['where']};return db[_0x4b54('0x2c')][_0x4b54('0x1d')](_0x3af63c)[_0x4b54('0x22')](function(_0xbecb34){_0x10e10e[_0x4b54('0x1d')]=_0xbecb34;if(_0x53b8dc['query'][_0x4b54('0x3e')]){_0x12f210['include']=[{'all':!![]}];}return db[_0x4b54('0x2c')]['findAll'](_0x12f210);})['then'](function(_0x117bdb){_0x10e10e['rows']=_0x117bdb;return _0x10e10e;})[_0x4b54('0x22')](respondWithFilteredResult(_0x1fc775,_0x12f210))[_0x4b54('0x3f')](handleError(_0x1fc775,null));};exports['show']=function(_0x153315,_0x3bdeb7){var _0x5bfef7={'raw':!![],'where':{'id':_0x153315['params']['id']}},_0x43ce55={};_0x43ce55[_0x4b54('0x2f')]=_[_0x4b54('0x40')](db[_0x4b54('0x2c')][_0x4b54('0x41')]);_0x43ce55[_0x4b54('0x30')]=_[_0x4b54('0x40')](_0x153315['query']);_0x43ce55[_0x4b54('0x31')]=_['intersection'](_0x43ce55[_0x4b54('0x2f')],_0x43ce55[_0x4b54('0x30')]);_0x5bfef7[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x43ce55['model'],qs[_0x4b54('0x42')](_0x153315[_0x4b54('0x30')]['fields']));_0x5bfef7['attributes']=_0x5bfef7['attributes']['length']?_0x5bfef7[_0x4b54('0x33')]:_0x43ce55[_0x4b54('0x2f')];if(_0x153315[_0x4b54('0x30')][_0x4b54('0x3e')]){_0x5bfef7[_0x4b54('0x43')]=[{'all':!![]}];}_0x5bfef7=_[_0x4b54('0x3a')]({},_0x5bfef7,_0x153315[_0x4b54('0x3d')]);return db[_0x4b54('0x2c')][_0x4b54('0x44')](_0x5bfef7)[_0x4b54('0x22')](handleEntityNotFound(_0x3bdeb7,null))[_0x4b54('0x22')](respondWithResult(_0x3bdeb7,null))[_0x4b54('0x3f')](handleError(_0x3bdeb7,null));};exports[_0x4b54('0x45')]=function(_0x29e9b8,_0x43b916){return db[_0x4b54('0x2c')][_0x4b54('0x45')](_0x29e9b8[_0x4b54('0x46')],{})[_0x4b54('0x22')](function(_0x59c4da){var _0x4d1ee5=_0x29e9b8[_0x4b54('0x47')][_0x4b54('0x23')]({'plain':!![]});if(!_0x4d1ee5)throw new Error(_0x4b54('0x48'));if(_0x4d1ee5[_0x4b54('0x49')]===_0x4b54('0x47')){var _0x3160d4=_0x59c4da['get']({'plain':!![]});var _0x28f78c=_0x4b54('0x24');return db[_0x4b54('0x4a')][_0x4b54('0x44')]({'where':{'name':_0x28f78c,'userProfileId':_0x4d1ee5['userProfileId']},'raw':!![]})[_0x4b54('0x22')](function(_0x16da97){if(_0x16da97&&_0x16da97['autoAssociation']===0x0){return db[_0x4b54('0x25')][_0x4b54('0x45')]({'name':_0x3160d4[_0x4b54('0x29')],'resourceId':_0x3160d4['id'],'type':_0x16da97[_0x4b54('0x29')],'sectionId':_0x16da97['id']},{})[_0x4b54('0x22')](function(){return _0x59c4da;});}else{return _0x59c4da;}})[_0x4b54('0x3f')](function(_0x4b431a){logger[_0x4b54('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b431a);throw _0x4b431a;});}return _0x59c4da;})[_0x4b54('0x22')](respondWithResult(_0x43b916,0xc9))[_0x4b54('0x3f')](handleError(_0x43b916,null));};exports['update']=function(_0xe844a6,_0x432fbd){if(_0xe844a6[_0x4b54('0x46')]['id']){delete _0xe844a6[_0x4b54('0x46')]['id'];}return db[_0x4b54('0x2c')][_0x4b54('0x44')]({'where':{'id':_0xe844a6['params']['id']}})[_0x4b54('0x22')](handleEntityNotFound(_0x432fbd,null))['then'](saveUpdates(_0xe844a6[_0x4b54('0x46')],null))[_0x4b54('0x22')](respondWithResult(_0x432fbd,null))[_0x4b54('0x3f')](handleError(_0x432fbd,null));};exports[_0x4b54('0x26')]=function(_0x3e9958,_0x23093b){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x3e9958['params']['id']}})['then'](handleEntityNotFound(_0x23093b,null))['then'](removeEntity(_0x23093b,null))[_0x4b54('0x3f')](handleError(_0x23093b,null));};exports['download']=function(_0x175a18,_0x3894ed,_0x1aa544){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x175a18[_0x4b54('0x4b')]['id']},'attributes':[_0x4b54('0x29'),_0x4b54('0x4c'),_0x4b54('0x4d'),'output'],'raw':!![]})[_0x4b54('0x22')](handleEntityNotFound(_0x3894ed,null))[_0x4b54('0x22')](function(_0x533c3b){if(_0x533c3b){if(!fs[_0x4b54('0x4e')](path[_0x4b54('0x4f')](config['root'],_0x4b54('0x50'),_0x533c3b[_0x4b54('0x4d')]))){throw new db[(_0x4b54('0x51'))][(_0x4b54('0x52'))](_0x4b54('0x53'));}if(_0x175a18['query'][_0x4b54('0x54')]){return _0x3894ed['sendStatus'](0xc8);}return _0x3894ed[_0x4b54('0x55')](path[_0x4b54('0x4f')](config[_0x4b54('0x56')],_0x4b54('0x50'),_0x533c3b['savename']),util['format'](_0x4b54('0x57'),_0x533c3b[_0x4b54('0x4c')]||_0x533c3b[_0x4b54('0x29')],_0x533c3b['output'][_0x4b54('0x58')]()));}})[_0x4b54('0x3f')](handleError(_0x3894ed,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 064709d..0b60943 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 _0x455a=['moment','request-promise','path','rimraf','../../config/environment','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x50a70c,_0x52491f){var _0x5a5813=function(_0x29e851){while(--_0x29e851){_0x50a70c['push'](_0x50a70c['shift']());}};_0x5a5813(++_0x52491f);}(_0x455a,0x104));var _0xa455=function(_0x47c758,_0x10a261){_0x47c758=_0x47c758-0x0;var _0xe0b1e0=_0x455a[_0x47c758];return _0xe0b1e0;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var logger=require(_0xa455('0x2'))(_0xa455('0x3'));var moment=require(_0xa455('0x4'));var BPromise=require('bluebird');var rp=require(_0xa455('0x5'));var fs=require('fs');var path=require(_0xa455('0x6'));var rimraf=require(_0xa455('0x7'));var config=require(_0xa455('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x98eead,_0x6a4fe5){return _0x98eead['define'](_0xa455('0x9'),attributes,{'tableName':_0xa455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed54=['request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed54,0xcc));var _0x4ed5=function(_0x36121d,_0x59afab){_0x36121d=_0x36121d-0x0;var _0x4455ab=_0xed54[_0x36121d];return _0x4455ab;};'use strict';var _=require(_0x4ed5('0x0'));var util=require(_0x4ed5('0x1'));var logger=require(_0x4ed5('0x2'))('api');var moment=require(_0x4ed5('0x3'));var BPromise=require(_0x4ed5('0x4'));var rp=require(_0x4ed5('0x5'));var fs=require('fs');var path=require(_0x4ed5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ed5('0x7'));module[_0x4ed5('0x8')]=function(_0xab49d7,_0x24ee1d){return _0xab49d7[_0x4ed5('0x9')](_0x4ed5('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 45c0b15..6ad91b0 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 _0xbc33=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x43e6d5,_0x1a1d50){var _0x4a9074=function(_0x1c92ae){while(--_0x1c92ae){_0x43e6d5['push'](_0x43e6d5['shift']());}};_0x4a9074(++_0x1a1d50);}(_0xbc33,0xd1));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bc3('0x0'));var util=require(_0x3bc3('0x1'));var moment=require(_0x3bc3('0x2'));var BPromise=require(_0x3bc3('0x3'));var rs=require(_0x3bc3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bc3('0x5'))['db'];var utils=require(_0x3bc3('0x6'));var logger=require(_0x3bc3('0x7'))(_0x3bc3('0x8'));var config=require(_0x3bc3('0x9'));var jayson=require(_0x3bc3('0xa'));var client=jayson[_0x3bc3('0xb')][_0x3bc3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14db1f,_0x5ca5fe,_0x5ef597){return new BPromise(function(_0x106f1d,_0x1e70b4){return client[_0x3bc3('0xd')](_0x14db1f,_0x5ef597)['then'](function(_0x41f981){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca5fe,_0x3bc3('0xe'));logger[_0x3bc3('0xf')](_0x3bc3('0x10'),_0x5ca5fe,_0x3bc3('0xe'),JSON[_0x3bc3('0x11')](_0x41f981));if(_0x41f981[_0x3bc3('0x12')]){if(_0x41f981[_0x3bc3('0x12')][_0x3bc3('0x13')]===0x1f4){logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x41f981[_0x3bc3('0x12')][_0x3bc3('0x15')]);return _0x1e70b4(_0x41f981['error'][_0x3bc3('0x15')]);}logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x41f981['error'][_0x3bc3('0x15')]);return _0x106f1d(_0x41f981[_0x3bc3('0x12')]['message']);}else{logger[_0x3bc3('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca5fe,_0x3bc3('0xe'));_0x106f1d(_0x41f981[_0x3bc3('0x17')][_0x3bc3('0x15')]);}})[_0x3bc3('0x18')](function(_0x2ff9b6){logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x2ff9b6);_0x1e70b4(_0x2ff9b6);});});}
\ No newline at end of file
+var _0xc88f=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x148351,_0x440979){var _0x1852bc=function(_0x50ef94){while(--_0x50ef94){_0x148351['push'](_0x148351['shift']());}};_0x1852bc(++_0x440979);}(_0xc88f,0xed));var _0xfc88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc88f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc88('0x0'));var util=require('util');var moment=require(_0xfc88('0x1'));var BPromise=require(_0xfc88('0x2'));var rs=require(_0xfc88('0x3'));var fs=require('fs');var Redis=require(_0xfc88('0x4'));var db=require(_0xfc88('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc88('0x6'))(_0xfc88('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc88('0x8')][_0xfc88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9c25,_0x3e9000,_0x14052f){return new BPromise(function(_0xeb143,_0x15ffb0){return client[_0xfc88('0xa')](_0x3b9c25,_0x14052f)[_0xfc88('0xb')](function(_0x2eec35){logger['info'](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));logger[_0xfc88('0xe')](_0xfc88('0xf'),_0x3e9000,_0xfc88('0xd'),JSON[_0xfc88('0x10')](_0x2eec35));if(_0x2eec35[_0xfc88('0x11')]){if(_0x2eec35['error']['code']===0x1f4){logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0x15ffb0(_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);}logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0xeb143(_0x2eec35['error'][_0xfc88('0x12')]);}else{logger[_0xfc88('0x13')](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));_0xeb143(_0x2eec35['result'][_0xfc88('0x12')]);}})[_0xfc88('0x14')](function(_0x35e178){logger[_0xfc88('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e9000,_0x35e178);_0x15ffb0(_0x35e178);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 74006b1..406f329 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 _0xe2dd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x9b101,_0x17c8e9){var _0x5d1722=function(_0x280bf7){while(--_0x280bf7){_0x9b101['push'](_0x9b101['shift']());}};_0x5d1722(++_0x17c8e9);}(_0xe2dd,0x18a));var _0xde2d=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xe2dd[_0x49c68e];return _0x33032b;};'use strict';var multer=require(_0xde2d('0x0'));var util=require(_0xde2d('0x1'));var path=require(_0xde2d('0x2'));var timeout=require(_0xde2d('0x3'));var express=require(_0xde2d('0x4'));var router=express['Router']();var fs_extra=require(_0xde2d('0x5'));var auth=require(_0xde2d('0x6'));var interaction=require(_0xde2d('0x7'));var config=require(_0xde2d('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xde2d('0x9')]('/',auth[_0xde2d('0xa')](),controller['index']);router[_0xde2d('0x9')](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0xc')]);router[_0xde2d('0x9')](_0xde2d('0xd'),auth[_0xde2d('0xa')](),controller[_0xde2d('0xe')]);router['post']('/',auth[_0xde2d('0xa')](),controller[_0xde2d('0xf')]);router[_0xde2d('0x10')](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0x11')]);router['delete'](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x76d1=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','put'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x76d1,0xdf));var _0x176d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x76d1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x176d('0x0'));var util=require('util');var path=require(_0x176d('0x1'));var timeout=require(_0x176d('0x2'));var express=require(_0x176d('0x3'));var router=express[_0x176d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x176d('0x5'));var interaction=require(_0x176d('0x6'));var config=require(_0x176d('0x7'));var controller=require(_0x176d('0x8'));router[_0x176d('0x9')]('/',auth[_0x176d('0xa')](),controller[_0x176d('0xb')]);router['get'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller['show']);router[_0x176d('0x9')](_0x176d('0xd'),auth[_0x176d('0xa')](),controller[_0x176d('0xe')]);router[_0x176d('0xf')]('/',auth[_0x176d('0xa')](),controller['create']);router[_0x176d('0x10')]('/:id',auth[_0x176d('0xa')](),controller[_0x176d('0x11')]);router['delete'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller[_0x176d('0x12')]);module[_0x176d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index f40f5a5..bc3350e 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 _0xe824=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x5c4172,_0x1ac4d0){var _0x52eff4=function(_0x227b4a){while(--_0x227b4a){_0x5c4172['push'](_0x5c4172['shift']());}};_0x52eff4(++_0x1ac4d0);}(_0xe824,0xf1));var _0x4e82=function(_0x44b0af,_0xdb6975){_0x44b0af=_0x44b0af-0x0;var _0xafaa74=_0xe824[_0x44b0af];return _0xafaa74;};'use strict';var Sequelize=require(_0x4e82('0x0'));module['exports']={'field':{'type':Sequelize[_0x4e82('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4e82('0x2')]},'format':{'type':Sequelize[_0x4e82('0x2')]},'groupBy':{'type':Sequelize[_0x4e82('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4e82('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb6a6=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb6a6,0x179));var _0x6b6a=function(_0x34683e,_0x46427f){_0x34683e=_0x34683e-0x0;var _0x33c7f8=_0xb6a6[_0x34683e];return _0x33c7f8;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'field':{'type':Sequelize[_0x6b6a('0x2')]},'alias':{'type':Sequelize[_0x6b6a('0x3')]},'function':{'type':Sequelize[_0x6b6a('0x3')]},'format':{'type':Sequelize[_0x6b6a('0x3')]},'groupBy':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6b6a('0x3')]},'custom':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bb4d560..7a20651 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 _0x7785=['destroy','addFields','sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','limit','count','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','index','AnalyticFieldReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','map','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','body','bulkCreate','find','bulkDestroy'];(function(_0x13ce26,_0xba331f){var _0x1fccf4=function(_0x390fea){while(--_0x390fea){_0x13ce26['push'](_0x13ce26['shift']());}};_0x1fccf4(++_0xba331f);}(_0x7785,0xe4));var _0x5778=function(_0x4d7789,_0x4065b5){_0x4d7789=_0x4d7789-0x0;var _0x2952d6=_0x7785[_0x4d7789];return _0x2952d6;};'use strict';var emlformat=require(_0x5778('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5778('0x1'));var jsonpatch=require(_0x5778('0x2'));var rp=require('request-promise');var moment=require(_0x5778('0x3'));var BPromise=require(_0x5778('0x4'));var Mustache=require(_0x5778('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5778('0x6'));var csv=require(_0x5778('0x7'));var ejs=require(_0x5778('0x8'));var fs=require('fs');var fs_extra=require(_0x5778('0x9'));var _=require(_0x5778('0xa'));var squel=require(_0x5778('0xb'));var crypto=require(_0x5778('0xc'));var jsforce=require(_0x5778('0xd'));var deskjs=require(_0x5778('0xe'));var toCsv=require(_0x5778('0x7'));var querystring=require('querystring');var Papa=require(_0x5778('0xf'));var Redis=require(_0x5778('0x10'));var authService=require(_0x5778('0x11'));var qs=require(_0x5778('0x12'));var as=require(_0x5778('0x13'));var hardwareService=require(_0x5778('0x14'));var logger=require(_0x5778('0x15'))(_0x5778('0x16'));var utils=require(_0x5778('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5778('0x18'))['db'];function respondWithStatusCode(_0x593aa9,_0x58a6c5){_0x58a6c5=_0x58a6c5||0xcc;return function(_0x36698e){if(_0x36698e){return _0x593aa9['sendStatus'](_0x58a6c5);}return _0x593aa9[_0x5778('0x19')](_0x58a6c5)[_0x5778('0x1a')]();};}function respondWithResult(_0xba4514,_0x45a6e0){_0x45a6e0=_0x45a6e0||0xc8;return function(_0x545d40){if(_0x545d40){return _0xba4514[_0x5778('0x19')](_0x45a6e0)['json'](_0x545d40);}};}function respondWithFilteredResult(_0x26bde6,_0x41da39){return function(_0x5c1446){if(_0x5c1446){var _0xeac168=typeof _0x41da39['offset']==='undefined'&&typeof _0x41da39[_0x5778('0x1b')]==='undefined';var _0x2d66fd=_0x5c1446['count'];var _0x2d7de9=_0xeac168?0x0:_0x41da39['offset'];var _0x58a814=_0xeac168?_0x5c1446[_0x5778('0x1c')]:_0x41da39['offset']+_0x41da39[_0x5778('0x1b')];var _0x47ea6;if(_0x58a814>=_0x2d66fd){_0x58a814=_0x2d66fd;_0x47ea6=0xc8;}else{_0x47ea6=0xce;}_0x26bde6[_0x5778('0x19')](_0x47ea6);return _0x26bde6['set'](_0x5778('0x1d'),_0x2d7de9+'-'+_0x58a814+'/'+_0x2d66fd)[_0x5778('0x1e')](_0x5c1446);}return null;};}function patchUpdates(_0x116100){return function(_0x196abf){try{jsonpatch[_0x5778('0x1f')](_0x196abf,_0x116100,!![]);}catch(_0x44a206){return BPromise[_0x5778('0x20')](_0x44a206);}return _0x196abf[_0x5778('0x21')]();};}function saveUpdates(_0x48c510,_0x4ab863){return function(_0x5436a1){if(_0x5436a1){return _0x5436a1[_0x5778('0x22')](_0x48c510)[_0x5778('0x23')](function(_0xb480b9){return _0xb480b9;});}return null;};}function removeEntity(_0x14572e,_0xe9588b){return function(_0x513cbc){if(_0x513cbc){return _0x513cbc['destroy']()[_0x5778('0x23')](function(){_0x14572e[_0x5778('0x19')](0xcc)[_0x5778('0x1a')]();});}};}function handleEntityNotFound(_0x989cb6,_0x5e1267){return function(_0x497230){if(!_0x497230){_0x989cb6[_0x5778('0x24')](0x194);}return _0x497230;};}function handleError(_0x6551a3,_0xc4cad8){_0xc4cad8=_0xc4cad8||0x1f4;return function(_0x1d30c6){logger['error'](_0x1d30c6[_0x5778('0x25')]);if(_0x1d30c6[_0x5778('0x26')]){delete _0x1d30c6[_0x5778('0x26')];}_0x6551a3[_0x5778('0x19')](_0xc4cad8)['send'](_0x1d30c6);};}exports[_0x5778('0x27')]=function(_0x459045,_0x2d485b){var _0x5bb221={},_0xcc3d04={},_0x2c5d9d={'count':0x0,'rows':[]};var _0x47bb80=_['map'](db[_0x5778('0x28')]['rawAttributes'],function(_0x53c282){return{'name':_0x53c282[_0x5778('0x29')],'type':_0x53c282['type'][_0x5778('0x2a')]};});_0xcc3d04['model']=_['map'](_0x47bb80,_0x5778('0x26'));_0xcc3d04[_0x5778('0x2b')]=_[_0x5778('0x2c')](_0x459045[_0x5778('0x2b')]);_0xcc3d04[_0x5778('0x2d')]=_[_0x5778('0x2e')](_0xcc3d04[_0x5778('0x2f')],_0xcc3d04[_0x5778('0x2b')]);_0x5bb221[_0x5778('0x30')]=_[_0x5778('0x2e')](_0xcc3d04['model'],qs[_0x5778('0x31')](_0x459045[_0x5778('0x2b')][_0x5778('0x31')]));_0x5bb221[_0x5778('0x30')]=_0x5bb221[_0x5778('0x30')][_0x5778('0x32')]?_0x5bb221[_0x5778('0x30')]:_0xcc3d04[_0x5778('0x2f')];if(!_0x459045['query'][_0x5778('0x33')](_0x5778('0x34'))){_0x5bb221[_0x5778('0x1b')]=qs[_0x5778('0x1b')](_0x459045[_0x5778('0x2b')][_0x5778('0x1b')]);_0x5bb221[_0x5778('0x35')]=qs[_0x5778('0x35')](_0x459045[_0x5778('0x2b')][_0x5778('0x35')]);}_0x5bb221['order']=qs[_0x5778('0x36')](_0x459045['query'][_0x5778('0x36')]);_0x5bb221[_0x5778('0x37')]=qs[_0x5778('0x2d')](_['pick'](_0x459045[_0x5778('0x2b')],_0xcc3d04[_0x5778('0x2d')]),_0x47bb80);if(_0x459045[_0x5778('0x2b')]['filter']){_0x5bb221[_0x5778('0x37')]=_['merge'](_0x5bb221[_0x5778('0x37')],{'$or':_[_0x5778('0x38')](_0x47bb80,function(_0x58b1a0){if(_0x58b1a0['type']!==_0x5778('0x39')){var _0x42b132={};_0x42b132[_0x58b1a0[_0x5778('0x26')]]={'$like':'%'+_0x459045['query'][_0x5778('0x3a')]+'%'};return _0x42b132;}})});}_0x5bb221=_[_0x5778('0x3b')]({},_0x5bb221,_0x459045['options']);var _0x1f2155={'where':_0x5bb221[_0x5778('0x37')]};return db['AnalyticFieldReport'][_0x5778('0x1c')](_0x1f2155)[_0x5778('0x23')](function(_0x2e8478){_0x2c5d9d[_0x5778('0x1c')]=_0x2e8478;if(_0x459045['query'][_0x5778('0x3c')]){_0x5bb221[_0x5778('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5778('0x3e')](_0x5bb221);})[_0x5778('0x23')](function(_0x52c610){_0x2c5d9d['rows']=_0x52c610;return _0x2c5d9d;})[_0x5778('0x23')](respondWithFilteredResult(_0x2d485b,_0x5bb221))[_0x5778('0x3f')](handleError(_0x2d485b,null));};exports[_0x5778('0x40')]=function(_0x56401b,_0x173f53){var _0x253f2a={'raw':![],'where':{'id':_0x56401b[_0x5778('0x41')]['id']}},_0x42d0e0={};_0x42d0e0[_0x5778('0x2f')]=_['keys'](db[_0x5778('0x28')][_0x5778('0x42')]);_0x42d0e0[_0x5778('0x2b')]=_[_0x5778('0x2c')](_0x56401b['query']);_0x42d0e0[_0x5778('0x2d')]=_['intersection'](_0x42d0e0['model'],_0x42d0e0[_0x5778('0x2b')]);_0x253f2a[_0x5778('0x30')]=_[_0x5778('0x2e')](_0x42d0e0[_0x5778('0x2f')],qs[_0x5778('0x31')](_0x56401b['query'][_0x5778('0x31')]));_0x253f2a[_0x5778('0x30')]=_0x253f2a[_0x5778('0x30')]['length']?_0x253f2a[_0x5778('0x30')]:_0x42d0e0[_0x5778('0x2f')];if(_0x56401b['query'][_0x5778('0x3c')]){_0x253f2a['include']=[{'all':!![]}];}_0x253f2a=_[_0x5778('0x3b')]({},_0x253f2a,_0x56401b[_0x5778('0x43')]);return db['AnalyticFieldReport']['find'](_0x253f2a)[_0x5778('0x23')](handleEntityNotFound(_0x173f53,null))[_0x5778('0x23')](respondWithResult(_0x173f53,null))[_0x5778('0x3f')](handleError(_0x173f53,null));};exports['create']=function(_0x4f3835,_0x2aeb2a){return db[_0x5778('0x28')]['create'](_0x4f3835[_0x5778('0x44')],{})['then'](respondWithResult(_0x2aeb2a,0xc9))[_0x5778('0x3f')](handleError(_0x2aeb2a,null));};exports[_0x5778('0x45')]=function(_0x1c0a71,_0x2650c1){return db['AnalyticFieldReport']['bulkCreate'](_0x1c0a71[_0x5778('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2650c1,0xc9))['catch'](handleError(_0x2650c1,null));};exports[_0x5778('0x22')]=function(_0x1fab1a,_0x18e723){if(_0x1fab1a[_0x5778('0x44')]['id']){delete _0x1fab1a[_0x5778('0x44')]['id'];}return db[_0x5778('0x28')]['find']({'where':{'id':_0x1fab1a[_0x5778('0x41')]['id']}})[_0x5778('0x23')](handleEntityNotFound(_0x18e723,null))[_0x5778('0x23')](saveUpdates(_0x1fab1a[_0x5778('0x44')],null))[_0x5778('0x23')](respondWithResult(_0x18e723,null))['catch'](handleError(_0x18e723,null));};exports['destroy']=function(_0x143f18,_0x2ef075){return db[_0x5778('0x28')][_0x5778('0x46')]({'where':{'id':_0x143f18['params']['id']}})['then'](handleEntityNotFound(_0x2ef075,null))[_0x5778('0x23')](removeEntity(_0x2ef075,null))[_0x5778('0x3f')](handleError(_0x2ef075,null));};exports[_0x5778('0x47')]=function(_0x32a613,_0x1794ec){return db[_0x5778('0x28')][_0x5778('0x48')]({'where':{'id':_0x32a613[_0x5778('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x5778('0x23')](respondWithResult(_0x1794ec,0xcc))[_0x5778('0x3f')](handleError(_0x1794ec,null));};exports[_0x5778('0x49')]=function(_0x4670df,_0x52595d,_0x2d2d6e){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4670df[_0x5778('0x41')]['id']}})[_0x5778('0x23')](handleEntityNotFound(_0x52595d,null))[_0x5778('0x23')](function(_0x36e118){if(_0x36e118){return db[_0x5778('0x4a')]['transaction'](function(_0x1f88e8){return db[_0x5778('0x28')][_0x5778('0x48')]({'where':{'CustomReportId':_0x4670df['params']['id']},'transaction':_0x1f88e8})[_0x5778('0x23')](function(_0x31e88f){var _0x564f27=_['map'](_0x4670df['body'],function(_0x128828){delete _0x128828['id'];_0x128828['CustomReportId']=_0x4670df['params']['id'];return _0x128828;});return db[_0x5778('0x28')][_0x5778('0x45')](_0x564f27,{'transaction':_0x1f88e8});});})['then'](function(){return db[_0x5778('0x28')][_0x5778('0x3e')]({'where':{'CustomReportId':_0x4670df['params']['id']}});});}})[_0x5778('0x23')](respondWithResult(_0x52595d,null))['catch'](handleError(_0x52595d,null));};
\ No newline at end of file
+var _0xf419=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x1b2462,_0x6bcef5){var _0x39b174=function(_0x1b1e9e){while(--_0x1b1e9e){_0x1b2462['push'](_0x1b2462['shift']());}};_0x39b174(++_0x6bcef5);}(_0xf419,0x185));var _0x9f41=function(_0x2ea44c,_0x5e145f){_0x2ea44c=_0x2ea44c-0x0;var _0x4e9346=_0xf419[_0x2ea44c];return _0x4e9346;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f41('0x1'));var rp=require('request-promise');var moment=require(_0x9f41('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f41('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x9f41('0x4'));var ejs=require(_0x9f41('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f41('0x6'));var squel=require(_0x9f41('0x7'));var crypto=require(_0x9f41('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9f41('0x9'));var toCsv=require(_0x9f41('0x4'));var querystring=require(_0x9f41('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f41('0xb'));var qs=require(_0x9f41('0xc'));var as=require(_0x9f41('0xd'));var hardwareService=require(_0x9f41('0xe'));var logger=require('../../config/logger')(_0x9f41('0xf'));var utils=require(_0x9f41('0x10'));var config=require(_0x9f41('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f41('0x12'))['db'];function respondWithStatusCode(_0x5bb505,_0x35d0f3){_0x35d0f3=_0x35d0f3||0xcc;return function(_0xf0af6c){if(_0xf0af6c){return _0x5bb505['sendStatus'](_0x35d0f3);}return _0x5bb505['status'](_0x35d0f3)[_0x9f41('0x13')]();};}function respondWithResult(_0x7525a8,_0x14332c){_0x14332c=_0x14332c||0xc8;return function(_0x3119c0){if(_0x3119c0){return _0x7525a8[_0x9f41('0x14')](_0x14332c)[_0x9f41('0x15')](_0x3119c0);}};}function respondWithFilteredResult(_0x1c9db7,_0x51af4b){return function(_0x4ecb76){if(_0x4ecb76){var _0x569a97=typeof _0x51af4b[_0x9f41('0x16')]==='undefined'&&typeof _0x51af4b['limit']==='undefined';var _0x3e4a51=_0x4ecb76['count'];var _0x30c54a=_0x569a97?0x0:_0x51af4b['offset'];var _0x192653=_0x569a97?_0x4ecb76[_0x9f41('0x17')]:_0x51af4b[_0x9f41('0x16')]+_0x51af4b[_0x9f41('0x18')];var _0x24c8f8;if(_0x192653>=_0x3e4a51){_0x192653=_0x3e4a51;_0x24c8f8=0xc8;}else{_0x24c8f8=0xce;}_0x1c9db7[_0x9f41('0x14')](_0x24c8f8);return _0x1c9db7[_0x9f41('0x19')](_0x9f41('0x1a'),_0x30c54a+'-'+_0x192653+'/'+_0x3e4a51)[_0x9f41('0x15')](_0x4ecb76);}return null;};}function patchUpdates(_0x1b89e8){return function(_0x1956be){try{jsonpatch['apply'](_0x1956be,_0x1b89e8,!![]);}catch(_0x3471eb){return BPromise[_0x9f41('0x1b')](_0x3471eb);}return _0x1956be[_0x9f41('0x1c')]();};}function saveUpdates(_0x4a80aa,_0x1db57a){return function(_0x600909){if(_0x600909){return _0x600909[_0x9f41('0x1d')](_0x4a80aa)[_0x9f41('0x1e')](function(_0x4e4313){return _0x4e4313;});}return null;};}function removeEntity(_0xa2d66e,_0x342ef9){return function(_0x34552b){if(_0x34552b){return _0x34552b[_0x9f41('0x1f')]()['then'](function(){_0xa2d66e[_0x9f41('0x14')](0xcc)[_0x9f41('0x13')]();});}};}function handleEntityNotFound(_0x58dc98,_0x47084){return function(_0x4119db){if(!_0x4119db){_0x58dc98[_0x9f41('0x20')](0x194);}return _0x4119db;};}function handleError(_0x4de18f,_0x32bff7){_0x32bff7=_0x32bff7||0x1f4;return function(_0x5b7df6){logger[_0x9f41('0x21')](_0x5b7df6[_0x9f41('0x22')]);if(_0x5b7df6[_0x9f41('0x23')]){delete _0x5b7df6[_0x9f41('0x23')];}_0x4de18f[_0x9f41('0x14')](_0x32bff7)[_0x9f41('0x24')](_0x5b7df6);};}exports[_0x9f41('0x25')]=function(_0x3d7cd5,_0x547b83){var _0x3876a8={},_0x74e721={},_0x546bef={'count':0x0,'rows':[]};var _0xf1048b=_[_0x9f41('0x26')](db[_0x9f41('0x27')]['rawAttributes'],function(_0x15746a){return{'name':_0x15746a[_0x9f41('0x28')],'type':_0x15746a[_0x9f41('0x29')][_0x9f41('0x2a')]};});_0x74e721['model']=_[_0x9f41('0x26')](_0xf1048b,_0x9f41('0x23'));_0x74e721['query']=_[_0x9f41('0x2b')](_0x3d7cd5[_0x9f41('0x2c')]);_0x74e721[_0x9f41('0x2d')]=_['intersection'](_0x74e721[_0x9f41('0x2e')],_0x74e721['query']);_0x3876a8['attributes']=_[_0x9f41('0x2f')](_0x74e721[_0x9f41('0x2e')],qs[_0x9f41('0x30')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x3876a8[_0x9f41('0x31')]=_0x3876a8[_0x9f41('0x31')][_0x9f41('0x32')]?_0x3876a8['attributes']:_0x74e721['model'];if(!_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x33')](_0x9f41('0x34'))){_0x3876a8[_0x9f41('0x18')]=qs['limit'](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x18')]);_0x3876a8[_0x9f41('0x16')]=qs[_0x9f41('0x16')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x16')]);}_0x3876a8[_0x9f41('0x35')]=qs[_0x9f41('0x36')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x36')]);_0x3876a8['where']=qs[_0x9f41('0x2d')](_[_0x9f41('0x37')](_0x3d7cd5['query'],_0x74e721[_0x9f41('0x2d')]),_0xf1048b);if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]){_0x3876a8[_0x9f41('0x39')]=_[_0x9f41('0x3a')](_0x3876a8[_0x9f41('0x39')],{'$or':_['map'](_0xf1048b,function(_0x590a6f){if(_0x590a6f['type']!==_0x9f41('0x3b')){var _0x241e8c={};_0x241e8c[_0x590a6f[_0x9f41('0x23')]]={'$like':'%'+_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]+'%'};return _0x241e8c;}})});}_0x3876a8=_[_0x9f41('0x3a')]({},_0x3876a8,_0x3d7cd5['options']);var _0x2fa0c3={'where':_0x3876a8['where']};return db[_0x9f41('0x27')][_0x9f41('0x17')](_0x2fa0c3)[_0x9f41('0x1e')](function(_0x4c0ddd){_0x546bef[_0x9f41('0x17')]=_0x4c0ddd;if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x3c')]){_0x3876a8[_0x9f41('0x3d')]=[{'all':!![]}];}return db[_0x9f41('0x27')][_0x9f41('0x3e')](_0x3876a8);})['then'](function(_0x3ad523){_0x546bef[_0x9f41('0x3f')]=_0x3ad523;return _0x546bef;})[_0x9f41('0x1e')](respondWithFilteredResult(_0x547b83,_0x3876a8))[_0x9f41('0x40')](handleError(_0x547b83,null));};exports[_0x9f41('0x41')]=function(_0x39ba40,_0x4ad188){var _0x52cf62={'raw':![],'where':{'id':_0x39ba40['params']['id']}},_0x50a8c0={};_0x50a8c0[_0x9f41('0x2e')]=_[_0x9f41('0x2b')](db[_0x9f41('0x27')][_0x9f41('0x42')]);_0x50a8c0['query']=_['keys'](_0x39ba40['query']);_0x50a8c0['filters']=_['intersection'](_0x50a8c0[_0x9f41('0x2e')],_0x50a8c0['query']);_0x52cf62[_0x9f41('0x31')]=_['intersection'](_0x50a8c0['model'],qs[_0x9f41('0x30')](_0x39ba40[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x52cf62[_0x9f41('0x31')]=_0x52cf62[_0x9f41('0x31')][_0x9f41('0x32')]?_0x52cf62[_0x9f41('0x31')]:_0x50a8c0[_0x9f41('0x2e')];if(_0x39ba40['query'][_0x9f41('0x3c')]){_0x52cf62[_0x9f41('0x3d')]=[{'all':!![]}];}_0x52cf62=_[_0x9f41('0x3a')]({},_0x52cf62,_0x39ba40[_0x9f41('0x43')]);return db[_0x9f41('0x27')][_0x9f41('0x44')](_0x52cf62)[_0x9f41('0x1e')](handleEntityNotFound(_0x4ad188,null))[_0x9f41('0x1e')](respondWithResult(_0x4ad188,null))[_0x9f41('0x40')](handleError(_0x4ad188,null));};exports[_0x9f41('0x45')]=function(_0x30d5f7,_0x39ffe9){return db[_0x9f41('0x27')]['create'](_0x30d5f7[_0x9f41('0x46')],{})[_0x9f41('0x1e')](respondWithResult(_0x39ffe9,0xc9))['catch'](handleError(_0x39ffe9,null));};exports['bulkCreate']=function(_0x26a801,_0x1f7ec2){return db[_0x9f41('0x27')][_0x9f41('0x47')](_0x26a801['body'],{'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x1f7ec2,0xc9))['catch'](handleError(_0x1f7ec2,null));};exports[_0x9f41('0x1d')]=function(_0x17d1f6,_0x4b2a28){if(_0x17d1f6[_0x9f41('0x46')]['id']){delete _0x17d1f6['body']['id'];}return db[_0x9f41('0x27')][_0x9f41('0x44')]({'where':{'id':_0x17d1f6[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b2a28,null))[_0x9f41('0x1e')](saveUpdates(_0x17d1f6[_0x9f41('0x46')],null))[_0x9f41('0x1e')](respondWithResult(_0x4b2a28,null))[_0x9f41('0x40')](handleError(_0x4b2a28,null));};exports[_0x9f41('0x1f')]=function(_0x2c83f6,_0x57d64f){return db[_0x9f41('0x27')]['find']({'where':{'id':_0x2c83f6['params']['id']}})[_0x9f41('0x1e')](handleEntityNotFound(_0x57d64f,null))[_0x9f41('0x1e')](removeEntity(_0x57d64f,null))[_0x9f41('0x40')](handleError(_0x57d64f,null));};exports[_0x9f41('0x49')]=function(_0xceac6c,_0x526c96){return db['AnalyticFieldReport'][_0x9f41('0x1f')]({'where':{'id':_0xceac6c[_0x9f41('0x2c')][_0x9f41('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x526c96,0xcc))[_0x9f41('0x40')](handleError(_0x526c96,null));};exports[_0x9f41('0x4b')]=function(_0x2fee9d,_0x3209bc,_0x2bfdeb){return db[_0x9f41('0x4c')][_0x9f41('0x4d')]({'where':{'id':_0x2fee9d[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x3209bc,null))[_0x9f41('0x1e')](function(_0x230d39){if(_0x230d39){return db['sequelize'][_0x9f41('0x4e')](function(_0x54eb3e){return db[_0x9f41('0x27')][_0x9f41('0x1f')]({'where':{'CustomReportId':_0x2fee9d['params']['id']},'transaction':_0x54eb3e})[_0x9f41('0x1e')](function(_0x3ba64c){var _0x33b8af=_['map'](_0x2fee9d['body'],function(_0x11ed40){delete _0x11ed40['id'];_0x11ed40[_0x9f41('0x4f')]=_0x2fee9d[_0x9f41('0x48')]['id'];return _0x11ed40;});return db['AnalyticFieldReport']['bulkCreate'](_0x33b8af,{'transaction':_0x54eb3e});});})[_0x9f41('0x1e')](function(){return db[_0x9f41('0x27')][_0x9f41('0x3e')]({'where':{'CustomReportId':_0x2fee9d[_0x9f41('0x48')]['id']}});});}})['then'](respondWithResult(_0x3209bc,null))[_0x9f41('0x40')](handleError(_0x3209bc,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3507226..cef3202 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 _0x68cd=['../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3f5adc,_0x49b1c6){var _0x49ff79=function(_0x368c7f){while(--_0x368c7f){_0x3f5adc['push'](_0x3f5adc['shift']());}};_0x49ff79(++_0x49b1c6);}(_0x68cd,0x10d));var _0xd68c=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x68cd[_0x3a3758];return _0x1a9234;};'use strict';var _=require(_0xd68c('0x0'));var util=require(_0xd68c('0x1'));var logger=require(_0xd68c('0x2'))('api');var moment=require(_0xd68c('0x3'));var BPromise=require(_0xd68c('0x4'));var rp=require(_0xd68c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd68c('0x6'));var config=require(_0xd68c('0x7'));var attributes=require(_0xd68c('0x8'));module[_0xd68c('0x9')]=function(_0x1acac7,_0xbbef22){return _0x1acac7[_0xd68c('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xd68c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43a3=['moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x36abc8,_0x354a28){var _0x4626ad=function(_0x5c0bfe){while(--_0x5c0bfe){_0x36abc8['push'](_0x36abc8['shift']());}};_0x4626ad(++_0x354a28);}(_0x43a3,0x1c4));var _0x343a=function(_0x40a410,_0x54a561){_0x40a410=_0x40a410-0x0;var _0x4e0d8b=_0x43a3[_0x40a410];return _0x4e0d8b;};'use strict';var _=require('lodash');var util=require(_0x343a('0x0'));var logger=require(_0x343a('0x1'))(_0x343a('0x2'));var moment=require(_0x343a('0x3'));var BPromise=require(_0x343a('0x4'));var rp=require(_0x343a('0x5'));var fs=require('fs');var path=require(_0x343a('0x6'));var rimraf=require(_0x343a('0x7'));var config=require('../../config/environment');var attributes=require(_0x343a('0x8'));module[_0x343a('0x9')]=function(_0x245180,_0x15a6fd){return _0x245180[_0x343a('0xa')](_0x343a('0xb'),attributes,{'tableName':_0x343a('0xc'),'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 611ac35..b558952 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 _0x32d7=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x598622,_0x39985c){var _0x50df2f=function(_0x59ee9e){while(--_0x59ee9e){_0x598622['push'](_0x598622['shift']());}};_0x50df2f(++_0x39985c);}(_0x32d7,0xd0));var _0x732d=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x32d7[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x732d('0x0'));var util=require('util');var moment=require(_0x732d('0x1'));var BPromise=require(_0x732d('0x2'));var rs=require(_0x732d('0x3'));var fs=require('fs');var Redis=require(_0x732d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x732d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x732d('0x6'));var jayson=require(_0x732d('0x7'));var client=jayson[_0x732d('0x8')][_0x732d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d430a,_0x259c51,_0x243a03){return new BPromise(function(_0x3ba72a,_0x58fe13){return client['request'](_0x4d430a,_0x243a03)[_0x732d('0xa')](function(_0x386f83){logger[_0x732d('0xb')](_0x732d('0xc'),_0x259c51,_0x732d('0xd'));logger[_0x732d('0xe')](_0x732d('0xf'),_0x259c51,_0x732d('0xd'),JSON['stringify'](_0x386f83));if(_0x386f83['error']){if(_0x386f83[_0x732d('0x10')]['code']===0x1f4){logger[_0x732d('0x10')](_0x732d('0xc'),_0x259c51,_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);return _0x58fe13(_0x386f83[_0x732d('0x10')]['message']);}logger[_0x732d('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x259c51,_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);return _0x3ba72a(_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);}else{logger[_0x732d('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x259c51,'request\x20sent');_0x3ba72a(_0x386f83[_0x732d('0x12')]['message']);}})[_0x732d('0x13')](function(_0x29ac79){logger[_0x732d('0x10')](_0x732d('0xc'),_0x259c51,_0x29ac79);_0x58fe13(_0x29ac79);});});}
\ No newline at end of file
+var _0x0235=['../../config/logger','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x0235,0x77));var _0x5023=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0235[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x5023('0x0'));var util=require(_0x5023('0x1'));var moment=require(_0x5023('0x2'));var BPromise=require(_0x5023('0x3'));var rs=require(_0x5023('0x4'));var fs=require('fs');var Redis=require(_0x5023('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5023('0x6'));var logger=require(_0x5023('0x7'))('rpc');var config=require(_0x5023('0x8'));var jayson=require(_0x5023('0x9'));var client=jayson['client'][_0x5023('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16fddd,_0x54832a,_0x6a7aef){return new BPromise(function(_0x5079b6,_0x5b1b7c){return client['request'](_0x16fddd,_0x6a7aef)['then'](function(_0x3dc4b9){logger[_0x5023('0xb')](_0x5023('0xc'),_0x54832a,'request\x20sent');logger[_0x5023('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'),JSON[_0x5023('0xf')](_0x3dc4b9));if(_0x3dc4b9[_0x5023('0x10')]){if(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x11')]===0x1f4){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5b1b7c(_0x3dc4b9['error'][_0x5023('0x12')]);}logger[_0x5023('0x10')](_0x5023('0xc'),_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5079b6(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);}else{logger[_0x5023('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'));_0x5079b6(_0x3dc4b9[_0x5023('0x13')][_0x5023('0x12')]);}})[_0x5023('0x14')](function(_0x1c7574){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x1c7574);_0x5b1b7c(_0x1c7574);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 2b2aa97..ccbc85f 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(_0x2a967d,_0x25f4e1){var _0x2295ba=function(_0x465046){while(--_0x465046){_0x2a967d['push'](_0x2a967d['shift']());}};_0x2295ba(++_0x25f4e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x3dd4fc,_0x1f7812){var _0x3e7f83=function(_0x23b249){while(--_0x23b249){_0x3dd4fc['push'](_0x3dd4fc['shift']());}};_0x3e7f83(++_0x1f7812);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 fb418a9..39b14bd 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 _0x99cd=['STRING','name','TEXT','sequelize'];(function(_0x1c0752,_0x3e5a4e){var _0x42bb0b=function(_0x21a1fb){while(--_0x21a1fb){_0x1c0752['push'](_0x1c0752['shift']());}};_0x42bb0b(++_0x3e5a4e);}(_0x99cd,0x1df));var _0xd99c=function(_0x981548,_0xd8b65e){_0x981548=_0x981548-0x0;var _0x142cc8=_0x99cd[_0x981548];return _0x142cc8;};'use strict';var Sequelize=require(_0xd99c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd99c('0x1')],'allowNull':![],'unique':_0xd99c('0x2')},'table':{'type':Sequelize[_0xd99c('0x1')]},'metric':{'type':Sequelize[_0xd99c('0x3')]},'description':{'type':Sequelize[_0xd99c('0x1')]}};
\ No newline at end of file
+var _0x570f=['STRING','TEXT','sequelize','exports'];(function(_0x5ca2fe,_0x20e1fd){var _0x206e0f=function(_0x16b9fa){while(--_0x16b9fa){_0x5ca2fe['push'](_0x5ca2fe['shift']());}};_0x206e0f(++_0x20e1fd);}(_0x570f,0x152));var _0xf570=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0x570f[_0x4e26b8];return _0x10a6f0;};'use strict';var Sequelize=require(_0xf570('0x0'));module[_0xf570('0x1')]={'name':{'type':Sequelize[_0xf570('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf570('0x3')]},'description':{'type':Sequelize[_0xf570('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 10a0ecc..6875a26 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x5e9d2a,_0x3c8d45){var _0x4920f3=function(_0x41e7c5){while(--_0x41e7c5){_0x5e9d2a['push'](_0x5e9d2a['shift']());}};_0x4920f3(++_0x3c8d45);}(_0x5fc3,0xa8));var _0x35fc=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x5fc3[_0x377a6e];return _0x37f751;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
+var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x43d753,_0x3f297d){var _0x1958e9=function(_0xb48c3b){while(--_0xb48c3b){_0x43d753['push'](_0x43d753['shift']());}};_0x1958e9(++_0x3f297d);}(_0x81bd,0x7c));var _0xd81b=function(_0x5617e2,_0x1ffcd7){_0x5617e2=_0x5617e2-0x0;var _0x27b60d=_0x81bd[_0x5617e2];return _0x27b60d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6ea7f10..0dd4a20 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 _0x0f9f=['rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xdd0f2c,_0x47d12a){var _0xeeba3=function(_0x34468a){while(--_0x34468a){_0xdd0f2c['push'](_0xdd0f2c['shift']());}};_0xeeba3(++_0x47d12a);}(_0x0f9f,0xae));var _0xf0f9=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x0f9f[_0x3df871];return _0x570f7b;};'use strict';var _=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var logger=require(_0xf0f9('0x2'))(_0xf0f9('0x3'));var moment=require(_0xf0f9('0x4'));var BPromise=require(_0xf0f9('0x5'));var rp=require(_0xf0f9('0x6'));var fs=require('fs');var path=require(_0xf0f9('0x7'));var rimraf=require(_0xf0f9('0x8'));var config=require(_0xf0f9('0x9'));var attributes=require(_0xf0f9('0xa'));module['exports']=function(_0xcc39d6,_0x4540a2){return _0xcc39d6['define'](_0xf0f9('0xb'),attributes,{'tableName':_0xf0f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbcba=['util','api','moment','bluebird','request-promise','path','rimraf','exports','AnalyticMetric','analytics_metrics','lodash'];(function(_0x5b0c7d,_0x4ad3e2){var _0x42aab8=function(_0x5dce29){while(--_0x5dce29){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x42aab8(++_0x4ad3e2);}(_0xbcba,0x6d));var _0xabcb=function(_0x331f71,_0x5a0cf8){_0x331f71=_0x331f71-0x0;var _0x43e0f5=_0xbcba[_0x331f71];return _0x43e0f5;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var logger=require('../../config/logger')(_0xabcb('0x2'));var moment=require(_0xabcb('0x3'));var BPromise=require(_0xabcb('0x4'));var rp=require(_0xabcb('0x5'));var fs=require('fs');var path=require(_0xabcb('0x6'));var rimraf=require(_0xabcb('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xabcb('0x8')]=function(_0x1290b2,_0x5c706e){return _0x1290b2['define'](_0xabcb('0x9'),attributes,{'tableName':_0xabcb('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 5809d67..aa588b7 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 _0x9bf1=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x2d8390,_0x224bb8){var _0x560b66=function(_0x4a9407){while(--_0x4a9407){_0x2d8390['push'](_0x2d8390['shift']());}};_0x560b66(++_0x224bb8);}(_0x9bf1,0x180));var _0x19bf=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x9bf1[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x19bf('0x0'));var util=require('util');var moment=require(_0x19bf('0x1'));var BPromise=require(_0x19bf('0x2'));var rs=require(_0x19bf('0x3'));var fs=require('fs');var Redis=require(_0x19bf('0x4'));var db=require(_0x19bf('0x5'))['db'];var utils=require(_0x19bf('0x6'));var logger=require(_0x19bf('0x7'))(_0x19bf('0x8'));var config=require('../../config/environment');var jayson=require(_0x19bf('0x9'));var client=jayson[_0x19bf('0xa')][_0x19bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346d51,_0x1a6a39,_0x4f497f){return new BPromise(function(_0x559088,_0x5ac498){return client[_0x19bf('0xc')](_0x346d51,_0x4f497f)[_0x19bf('0xd')](function(_0x307242){logger[_0x19bf('0xe')](_0x19bf('0xf'),_0x1a6a39,_0x19bf('0x10'));logger[_0x19bf('0x11')](_0x19bf('0x12'),_0x1a6a39,_0x19bf('0x10'),JSON[_0x19bf('0x13')](_0x307242));if(_0x307242[_0x19bf('0x14')]){if(_0x307242[_0x19bf('0x14')][_0x19bf('0x15')]===0x1f4){logger[_0x19bf('0x14')](_0x19bf('0xf'),_0x1a6a39,_0x307242['error'][_0x19bf('0x16')]);return _0x5ac498(_0x307242[_0x19bf('0x14')][_0x19bf('0x16')]);}logger['error'](_0x19bf('0xf'),_0x1a6a39,_0x307242[_0x19bf('0x14')]['message']);return _0x559088(_0x307242[_0x19bf('0x14')][_0x19bf('0x16')]);}else{logger['info'](_0x19bf('0xf'),_0x1a6a39,_0x19bf('0x10'));_0x559088(_0x307242[_0x19bf('0x17')][_0x19bf('0x16')]);}})[_0x19bf('0x18')](function(_0x377727){logger[_0x19bf('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x1a6a39,_0x377727);_0x5ac498(_0x377727);});});}
\ No newline at end of file
+var _0x5e24=['code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0x5e24,0x1bd));var _0x45e2=function(_0x47fc6c,_0x2455ce){_0x47fc6c=_0x47fc6c-0x0;var _0x1ec6e6=_0x5e24[_0x47fc6c];return _0x1ec6e6;};'use strict';var _=require(_0x45e2('0x0'));var util=require('util');var moment=require(_0x45e2('0x1'));var BPromise=require(_0x45e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45e2('0x3'));var db=require(_0x45e2('0x4'))['db'];var utils=require(_0x45e2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x45e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45e2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fa93,_0x4d63a5,_0x3873da){return new BPromise(function(_0x143f14,_0x3cf3f8){return client['request'](_0x16fa93,_0x3873da)['then'](function(_0x10ea43){logger[_0x45e2('0x8')](_0x45e2('0x9'),_0x4d63a5,_0x45e2('0xa'));logger[_0x45e2('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'),JSON[_0x45e2('0xc')](_0x10ea43));if(_0x10ea43[_0x45e2('0xd')]){if(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xe')]===0x1f4){logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x3cf3f8(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xf')]);}logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x143f14(_0x10ea43['error'][_0x45e2('0xf')]);}else{logger[_0x45e2('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'));_0x143f14(_0x10ea43['result'][_0x45e2('0xf')]);}})[_0x45e2('0x10')](function(_0x1109c3){logger['error'](_0x45e2('0x9'),_0x4d63a5,_0x1109c3);_0x3cf3f8(_0x1109c3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 42e4828..b324b1d 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 _0x207c=['fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','show','post','isAuthenticated','put','update','delete','util','path','connect-timeout','express','Router'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x207c,0x1e8));var _0xc207=function(_0x62c646,_0xa08641){_0x62c646=_0x62c646-0x0;var _0x2385f3=_0x207c[_0x62c646];return _0x2385f3;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')]('/',auth[_0xc207('0xd')](),controller['create']);router[_0xc207('0xe')](_0xc207('0xa'),auth[_0xc207('0xd')](),controller[_0xc207('0xf')]);router[_0xc207('0x10')](_0xc207('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x34aa=['index','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x402b19,_0x224241){var _0x13da47=function(_0x34cb5b){while(--_0x34cb5b){_0x402b19['push'](_0x402b19['shift']());}};_0x13da47(++_0x224241);}(_0x34aa,0x171));var _0xa34a=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x34aa[_0xa45395];return _0x3c83d2;};'use strict';var multer=require(_0xa34a('0x0'));var util=require('util');var path=require(_0xa34a('0x1'));var timeout=require(_0xa34a('0x2'));var express=require(_0xa34a('0x3'));var router=express[_0xa34a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa34a('0x5'));var interaction=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var controller=require(_0xa34a('0x8'));router[_0xa34a('0x9')]('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xb')]);router[_0xa34a('0x9')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0xd')]);router['post']('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xe')]);router[_0xa34a('0xf')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller['update']);router[_0xa34a('0x10')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0x11')]);module[_0xa34a('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 66a7dbf..f65b0da 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 _0xd2b4=['TEXT','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd2b4,0xd0));var _0x4d2b=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xd2b4[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x4d2b('0x0'));module[_0x4d2b('0x1')]={'tree':{'type':Sequelize[_0x4d2b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8cd9=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cd9,0x186));var _0x98cd=function(_0x4daadc,_0x52e09b){_0x4daadc=_0x4daadc-0x0;var _0x191b4d=_0x8cd9[_0x4daadc];return _0x191b4d;};'use strict';var Sequelize=require(_0x98cd('0x0'));module[_0x98cd('0x1')]={'tree':{'type':Sequelize[_0x98cd('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index aaf3064..84700f1 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 _0x1123=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','error','name','send','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x58dce1,_0x7f97c6){var _0x57c006=function(_0x311b1a){while(--_0x311b1a){_0x58dce1['push'](_0x58dce1['shift']());}};_0x57c006(++_0x7f97c6);}(_0x1123,0x78));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x3112('0x0'));var rimraf=require(_0x3112('0x1'));var zipdir=require(_0x3112('0x2'));var jsonpatch=require(_0x3112('0x3'));var rp=require(_0x3112('0x4'));var moment=require(_0x3112('0x5'));var BPromise=require(_0x3112('0x6'));var Mustache=require(_0x3112('0x7'));var util=require(_0x3112('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3112('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3112('0xa'));var squel=require('squel');var crypto=require(_0x3112('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3112('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3112('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3112('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3112('0xf'));var hardwareService=require(_0x3112('0x10'));var logger=require(_0x3112('0x11'))(_0x3112('0x12'));var utils=require(_0x3112('0x13'));var config=require(_0x3112('0x14'));var licenseUtil=require(_0x3112('0x15'));var db=require(_0x3112('0x16'))['db'];function respondWithStatusCode(_0x46c4b1,_0x29725d){_0x29725d=_0x29725d||0xcc;return function(_0x2e9562){if(_0x2e9562){return _0x46c4b1[_0x3112('0x17')](_0x29725d);}return _0x46c4b1[_0x3112('0x18')](_0x29725d)[_0x3112('0x19')]();};}function respondWithResult(_0x377c52,_0x390258){_0x390258=_0x390258||0xc8;return function(_0x58ed2b){if(_0x58ed2b){return _0x377c52[_0x3112('0x18')](_0x390258)[_0x3112('0x1a')](_0x58ed2b);}};}function respondWithFilteredResult(_0x1d56f8,_0x4c8e3e){return function(_0xfb3240){if(_0xfb3240){var _0x36a7eb=typeof _0x4c8e3e[_0x3112('0x1b')]==='undefined'&&typeof _0x4c8e3e[_0x3112('0x1c')]===_0x3112('0x1d');var _0x4a9b94=_0xfb3240['count'];var _0x3a99c3=_0x36a7eb?0x0:_0x4c8e3e['offset'];var _0x56123b=_0x36a7eb?_0xfb3240[_0x3112('0x1e')]:_0x4c8e3e[_0x3112('0x1b')]+_0x4c8e3e[_0x3112('0x1c')];var _0x2dd0e6;if(_0x56123b>=_0x4a9b94){_0x56123b=_0x4a9b94;_0x2dd0e6=0xc8;}else{_0x2dd0e6=0xce;}_0x1d56f8['status'](_0x2dd0e6);return _0x1d56f8['set']('Content-Range',_0x3a99c3+'-'+_0x56123b+'/'+_0x4a9b94)[_0x3112('0x1a')](_0xfb3240);}return null;};}function patchUpdates(_0xe393b2){return function(_0x594a8c){try{jsonpatch[_0x3112('0x1f')](_0x594a8c,_0xe393b2,!![]);}catch(_0x592890){return BPromise[_0x3112('0x20')](_0x592890);}return _0x594a8c['save']();};}function saveUpdates(_0x52aa2c,_0x4824a8){return function(_0x31ff92){if(_0x31ff92){return _0x31ff92[_0x3112('0x21')](_0x52aa2c)[_0x3112('0x22')](function(_0xcf4f4e){return _0xcf4f4e;});}return null;};}function removeEntity(_0x49270e,_0x56df41){return function(_0x583b8d){if(_0x583b8d){return _0x583b8d[_0x3112('0x23')]()[_0x3112('0x22')](function(){_0x49270e[_0x3112('0x18')](0xcc)[_0x3112('0x19')]();});}};}function handleEntityNotFound(_0x225f40,_0x20429f){return function(_0x3734a6){if(!_0x3734a6){_0x225f40[_0x3112('0x17')](0x194);}return _0x3734a6;};}function handleError(_0x4ae26d,_0x39300c){_0x39300c=_0x39300c||0x1f4;return function(_0x267bf1){logger[_0x3112('0x24')](_0x267bf1['stack']);if(_0x267bf1[_0x3112('0x25')]){delete _0x267bf1[_0x3112('0x25')];}_0x4ae26d[_0x3112('0x18')](_0x39300c)[_0x3112('0x26')](_0x267bf1);};}exports['index']=function(_0x4e4212,_0x5f3f43){var _0x2e5b62={},_0x439c50={},_0x505035={'count':0x0,'rows':[]};var _0x16ea4f=_[_0x3112('0x27')](db[_0x3112('0x28')]['rawAttributes'],function(_0x2d7df3){return{'name':_0x2d7df3[_0x3112('0x29')],'type':_0x2d7df3['type'][_0x3112('0x2a')]};});_0x439c50[_0x3112('0x2b')]=_['map'](_0x16ea4f,'name');_0x439c50[_0x3112('0x2c')]=_['keys'](_0x4e4212['query']);_0x439c50[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x439c50[_0x3112('0x2b')],_0x439c50[_0x3112('0x2c')]);_0x2e5b62[_0x3112('0x2f')]=_[_0x3112('0x2e')](_0x439c50['model'],qs[_0x3112('0x30')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x30')]));_0x2e5b62['attributes']=_0x2e5b62[_0x3112('0x2f')]['length']?_0x2e5b62[_0x3112('0x2f')]:_0x439c50[_0x3112('0x2b')];if(!_0x4e4212[_0x3112('0x2c')]['hasOwnProperty'](_0x3112('0x31'))){_0x2e5b62[_0x3112('0x1c')]=qs[_0x3112('0x1c')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x1c')]);_0x2e5b62[_0x3112('0x1b')]=qs[_0x3112('0x1b')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x1b')]);}_0x2e5b62[_0x3112('0x32')]=qs[_0x3112('0x33')](_0x4e4212['query'][_0x3112('0x33')]);_0x2e5b62['where']=qs[_0x3112('0x2d')](_['pick'](_0x4e4212[_0x3112('0x2c')],_0x439c50[_0x3112('0x2d')]),_0x16ea4f);if(_0x4e4212[_0x3112('0x2c')][_0x3112('0x34')]){_0x2e5b62[_0x3112('0x35')]=_['merge'](_0x2e5b62['where'],{'$or':_[_0x3112('0x27')](_0x16ea4f,function(_0x1aea4f){if(_0x1aea4f['type']!==_0x3112('0x36')){var _0x18d2a2={};_0x18d2a2[_0x1aea4f[_0x3112('0x25')]]={'$like':'%'+_0x4e4212['query'][_0x3112('0x34')]+'%'};return _0x18d2a2;}})});}_0x2e5b62=_[_0x3112('0x37')]({},_0x2e5b62,_0x4e4212[_0x3112('0x38')]);var _0x51aedb={'where':_0x2e5b62['where']};return db['AnalyticTreeReport']['count'](_0x51aedb)[_0x3112('0x22')](function(_0x1ceaf1){_0x505035[_0x3112('0x1e')]=_0x1ceaf1;if(_0x4e4212[_0x3112('0x2c')][_0x3112('0x39')]){_0x2e5b62[_0x3112('0x3a')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3112('0x3b')](_0x2e5b62);})[_0x3112('0x22')](function(_0x28620d){_0x505035[_0x3112('0x3c')]=_0x28620d;return _0x505035;})[_0x3112('0x22')](respondWithFilteredResult(_0x5f3f43,_0x2e5b62))[_0x3112('0x3d')](handleError(_0x5f3f43,null));};exports['show']=function(_0x3aa853,_0x32f848){var _0x216570={'raw':!![],'where':{'id':_0x3aa853[_0x3112('0x3e')]['id']}},_0x4d4b33={};_0x4d4b33['model']=_[_0x3112('0x3f')](db[_0x3112('0x28')][_0x3112('0x40')]);_0x4d4b33[_0x3112('0x2c')]=_[_0x3112('0x3f')](_0x3aa853[_0x3112('0x2c')]);_0x4d4b33[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x4d4b33[_0x3112('0x2b')],_0x4d4b33['query']);_0x216570[_0x3112('0x2f')]=_['intersection'](_0x4d4b33[_0x3112('0x2b')],qs[_0x3112('0x30')](_0x3aa853['query'][_0x3112('0x30')]));_0x216570[_0x3112('0x2f')]=_0x216570[_0x3112('0x2f')]['length']?_0x216570[_0x3112('0x2f')]:_0x4d4b33['model'];if(_0x3aa853['query'][_0x3112('0x39')]){_0x216570[_0x3112('0x3a')]=[{'all':!![]}];}_0x216570=_[_0x3112('0x37')]({},_0x216570,_0x3aa853['options']);return db[_0x3112('0x28')][_0x3112('0x41')](_0x216570)[_0x3112('0x22')](handleEntityNotFound(_0x32f848,null))['then'](respondWithResult(_0x32f848,null))[_0x3112('0x3d')](handleError(_0x32f848,null));};exports['create']=function(_0x36e1ec,_0xb8e513){return db[_0x3112('0x28')][_0x3112('0x42')](_0x36e1ec['body'],{})[_0x3112('0x22')](respondWithResult(_0xb8e513,0xc9))[_0x3112('0x3d')](handleError(_0xb8e513,null));};exports[_0x3112('0x21')]=function(_0x1a3e3c,_0x4aed3c){if(_0x1a3e3c[_0x3112('0x43')]['id']){delete _0x1a3e3c[_0x3112('0x43')]['id'];}return db[_0x3112('0x28')][_0x3112('0x41')]({'where':{'id':_0x1a3e3c['params']['id']}})['then'](handleEntityNotFound(_0x4aed3c,null))[_0x3112('0x22')](saveUpdates(_0x1a3e3c[_0x3112('0x43')],null))[_0x3112('0x22')](respondWithResult(_0x4aed3c,null))['catch'](handleError(_0x4aed3c,null));};exports[_0x3112('0x23')]=function(_0x338337,_0x52aae5){return db['AnalyticTreeReport'][_0x3112('0x41')]({'where':{'id':_0x338337[_0x3112('0x3e')]['id']}})['then'](handleEntityNotFound(_0x52aae5,null))[_0x3112('0x22')](removeEntity(_0x52aae5,null))[_0x3112('0x3d')](handleError(_0x52aae5,null));};
\ No newline at end of file
+var _0x8bc4=['crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','AnalyticTreeReport','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1e9612,_0x5ce781){var _0x3f5f24=function(_0x1de34d){while(--_0x1de34d){_0x1e9612['push'](_0x1e9612['shift']());}};_0x3f5f24(++_0x5ce781);}(_0x8bc4,0xd7));var _0x48bc=function(_0x48791f,_0x1f44eb){_0x48791f=_0x48791f-0x0;var _0x249d1c=_0x8bc4[_0x48791f];return _0x249d1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48bc('0x0'));var zipdir=require(_0x48bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48bc('0x2'));var moment=require(_0x48bc('0x3'));var BPromise=require(_0x48bc('0x4'));var Mustache=require(_0x48bc('0x5'));var util=require('util');var path=require(_0x48bc('0x6'));var sox=require(_0x48bc('0x7'));var csv=require(_0x48bc('0x8'));var ejs=require(_0x48bc('0x9'));var fs=require('fs');var fs_extra=require(_0x48bc('0xa'));var _=require(_0x48bc('0xb'));var squel=require(_0x48bc('0xc'));var crypto=require(_0x48bc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x48bc('0x8'));var querystring=require(_0x48bc('0xe'));var Papa=require('papaparse');var Redis=require(_0x48bc('0xf'));var authService=require(_0x48bc('0x10'));var qs=require(_0x48bc('0x11'));var as=require(_0x48bc('0x12'));var hardwareService=require(_0x48bc('0x13'));var logger=require(_0x48bc('0x14'))(_0x48bc('0x15'));var utils=require(_0x48bc('0x16'));var config=require(_0x48bc('0x17'));var licenseUtil=require(_0x48bc('0x18'));var db=require(_0x48bc('0x19'))['db'];function respondWithStatusCode(_0x327b90,_0xf7e5f){_0xf7e5f=_0xf7e5f||0xcc;return function(_0x53170e){if(_0x53170e){return _0x327b90[_0x48bc('0x1a')](_0xf7e5f);}return _0x327b90[_0x48bc('0x1b')](_0xf7e5f)[_0x48bc('0x1c')]();};}function respondWithResult(_0x3bec05,_0x11b2a6){_0x11b2a6=_0x11b2a6||0xc8;return function(_0x8ca33b){if(_0x8ca33b){return _0x3bec05['status'](_0x11b2a6)[_0x48bc('0x1d')](_0x8ca33b);}};}function respondWithFilteredResult(_0xca3e1e,_0x59f4f0){return function(_0x38eae7){if(_0x38eae7){var _0x52bcc3=typeof _0x59f4f0['offset']==='undefined'&&typeof _0x59f4f0[_0x48bc('0x1e')]===_0x48bc('0x1f');var _0x2aefb1=_0x38eae7[_0x48bc('0x20')];var _0x2a106b=_0x52bcc3?0x0:_0x59f4f0['offset'];var _0x2cd87a=_0x52bcc3?_0x38eae7[_0x48bc('0x20')]:_0x59f4f0[_0x48bc('0x21')]+_0x59f4f0['limit'];var _0x2366cd;if(_0x2cd87a>=_0x2aefb1){_0x2cd87a=_0x2aefb1;_0x2366cd=0xc8;}else{_0x2366cd=0xce;}_0xca3e1e['status'](_0x2366cd);return _0xca3e1e[_0x48bc('0x22')](_0x48bc('0x23'),_0x2a106b+'-'+_0x2cd87a+'/'+_0x2aefb1)[_0x48bc('0x1d')](_0x38eae7);}return null;};}function patchUpdates(_0x509ebb){return function(_0x303b05){try{jsonpatch[_0x48bc('0x24')](_0x303b05,_0x509ebb,!![]);}catch(_0x5b5e07){return BPromise[_0x48bc('0x25')](_0x5b5e07);}return _0x303b05[_0x48bc('0x26')]();};}function saveUpdates(_0x28d91f,_0x4b566e){return function(_0x1cc73c){if(_0x1cc73c){return _0x1cc73c[_0x48bc('0x27')](_0x28d91f)[_0x48bc('0x28')](function(_0x4a5d81){return _0x4a5d81;});}return null;};}function removeEntity(_0x536a06,_0x4d31b9){return function(_0x93572f){if(_0x93572f){return _0x93572f[_0x48bc('0x29')]()['then'](function(){_0x536a06['status'](0xcc)[_0x48bc('0x1c')]();});}};}function handleEntityNotFound(_0x538971,_0x490264){return function(_0x392950){if(!_0x392950){_0x538971[_0x48bc('0x1a')](0x194);}return _0x392950;};}function handleError(_0x57ec83,_0x4a53ed){_0x4a53ed=_0x4a53ed||0x1f4;return function(_0x4c0cbf){logger[_0x48bc('0x2a')](_0x4c0cbf['stack']);if(_0x4c0cbf[_0x48bc('0x2b')]){delete _0x4c0cbf[_0x48bc('0x2b')];}_0x57ec83['status'](_0x4a53ed)['send'](_0x4c0cbf);};}exports[_0x48bc('0x2c')]=function(_0x5df323,_0x5e923b){var _0x52beb5={},_0x299945={},_0x38cdca={'count':0x0,'rows':[]};var _0x1d695e=_[_0x48bc('0x2d')](db[_0x48bc('0x2e')]['rawAttributes'],function(_0x1473e9){return{'name':_0x1473e9[_0x48bc('0x2f')],'type':_0x1473e9['type']['key']};});_0x299945['model']=_['map'](_0x1d695e,_0x48bc('0x2b'));_0x299945[_0x48bc('0x30')]=_[_0x48bc('0x31')](_0x5df323['query']);_0x299945[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x299945['model'],_0x299945[_0x48bc('0x30')]);_0x52beb5[_0x48bc('0x34')]=_[_0x48bc('0x33')](_0x299945[_0x48bc('0x35')],qs[_0x48bc('0x36')](_0x5df323[_0x48bc('0x30')]['fields']));_0x52beb5[_0x48bc('0x34')]=_0x52beb5[_0x48bc('0x34')][_0x48bc('0x37')]?_0x52beb5[_0x48bc('0x34')]:_0x299945[_0x48bc('0x35')];if(!_0x5df323[_0x48bc('0x30')][_0x48bc('0x38')](_0x48bc('0x39'))){_0x52beb5['limit']=qs[_0x48bc('0x1e')](_0x5df323['query'][_0x48bc('0x1e')]);_0x52beb5[_0x48bc('0x21')]=qs['offset'](_0x5df323['query'][_0x48bc('0x21')]);}_0x52beb5[_0x48bc('0x3a')]=qs[_0x48bc('0x3b')](_0x5df323[_0x48bc('0x30')][_0x48bc('0x3b')]);_0x52beb5[_0x48bc('0x3c')]=qs[_0x48bc('0x32')](_['pick'](_0x5df323[_0x48bc('0x30')],_0x299945[_0x48bc('0x32')]),_0x1d695e);if(_0x5df323[_0x48bc('0x30')]['filter']){_0x52beb5[_0x48bc('0x3c')]=_[_0x48bc('0x3d')](_0x52beb5[_0x48bc('0x3c')],{'$or':_[_0x48bc('0x2d')](_0x1d695e,function(_0x2590cf){if(_0x2590cf['type']!==_0x48bc('0x3e')){var _0x5e73bb={};_0x5e73bb[_0x2590cf[_0x48bc('0x2b')]]={'$like':'%'+_0x5df323[_0x48bc('0x30')][_0x48bc('0x3f')]+'%'};return _0x5e73bb;}})});}_0x52beb5=_[_0x48bc('0x3d')]({},_0x52beb5,_0x5df323[_0x48bc('0x40')]);var _0x28aa49={'where':_0x52beb5[_0x48bc('0x3c')]};return db[_0x48bc('0x2e')][_0x48bc('0x20')](_0x28aa49)[_0x48bc('0x28')](function(_0x48b7cc){_0x38cdca[_0x48bc('0x20')]=_0x48b7cc;if(_0x5df323['query'][_0x48bc('0x41')]){_0x52beb5[_0x48bc('0x42')]=[{'all':!![]}];}return db[_0x48bc('0x2e')][_0x48bc('0x43')](_0x52beb5);})['then'](function(_0x35f2fa){_0x38cdca[_0x48bc('0x44')]=_0x35f2fa;return _0x38cdca;})[_0x48bc('0x28')](respondWithFilteredResult(_0x5e923b,_0x52beb5))[_0x48bc('0x45')](handleError(_0x5e923b,null));};exports[_0x48bc('0x46')]=function(_0x2131a2,_0x47df06){var _0x28fde1={'raw':!![],'where':{'id':_0x2131a2[_0x48bc('0x47')]['id']}},_0x43a9b0={};_0x43a9b0['model']=_[_0x48bc('0x31')](db[_0x48bc('0x2e')][_0x48bc('0x48')]);_0x43a9b0[_0x48bc('0x30')]=_['keys'](_0x2131a2['query']);_0x43a9b0[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x43a9b0[_0x48bc('0x35')],_0x43a9b0[_0x48bc('0x30')]);_0x28fde1['attributes']=_['intersection'](_0x43a9b0[_0x48bc('0x35')],qs['fields'](_0x2131a2[_0x48bc('0x30')][_0x48bc('0x36')]));_0x28fde1['attributes']=_0x28fde1[_0x48bc('0x34')][_0x48bc('0x37')]?_0x28fde1[_0x48bc('0x34')]:_0x43a9b0[_0x48bc('0x35')];if(_0x2131a2[_0x48bc('0x30')][_0x48bc('0x41')]){_0x28fde1[_0x48bc('0x42')]=[{'all':!![]}];}_0x28fde1=_[_0x48bc('0x3d')]({},_0x28fde1,_0x2131a2[_0x48bc('0x40')]);return db[_0x48bc('0x2e')][_0x48bc('0x49')](_0x28fde1)[_0x48bc('0x28')](handleEntityNotFound(_0x47df06,null))[_0x48bc('0x28')](respondWithResult(_0x47df06,null))[_0x48bc('0x45')](handleError(_0x47df06,null));};exports['create']=function(_0x43f5d0,_0x53738e){return db[_0x48bc('0x2e')][_0x48bc('0x4a')](_0x43f5d0[_0x48bc('0x4b')],{})[_0x48bc('0x28')](respondWithResult(_0x53738e,0xc9))[_0x48bc('0x45')](handleError(_0x53738e,null));};exports['update']=function(_0x30cf66,_0x14fb93){if(_0x30cf66[_0x48bc('0x4b')]['id']){delete _0x30cf66[_0x48bc('0x4b')]['id'];}return db[_0x48bc('0x2e')][_0x48bc('0x49')]({'where':{'id':_0x30cf66['params']['id']}})[_0x48bc('0x28')](handleEntityNotFound(_0x14fb93,null))[_0x48bc('0x28')](saveUpdates(_0x30cf66['body'],null))[_0x48bc('0x28')](respondWithResult(_0x14fb93,null))[_0x48bc('0x45')](handleError(_0x14fb93,null));};exports['destroy']=function(_0x28f793,_0xd1352){return db['AnalyticTreeReport'][_0x48bc('0x49')]({'where':{'id':_0x28f793[_0x48bc('0x47')]['id']}})['then'](handleEntityNotFound(_0xd1352,null))[_0x48bc('0x28')](removeEntity(_0xd1352,null))['catch'](handleError(_0xd1352,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6c2a176..b853b73 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 _0x3757=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','lodash','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3757,0x18a));var _0x7375=function(_0x48357c,_0x347ed9){_0x48357c=_0x48357c-0x0;var _0x4c51e8=_0x3757[_0x48357c];return _0x4c51e8;};'use strict';var _=require(_0x7375('0x0'));var util=require(_0x7375('0x1'));var logger=require(_0x7375('0x2'))(_0x7375('0x3'));var moment=require(_0x7375('0x4'));var BPromise=require(_0x7375('0x5'));var rp=require(_0x7375('0x6'));var fs=require('fs');var path=require(_0x7375('0x7'));var rimraf=require(_0x7375('0x8'));var config=require('../../config/environment');var attributes=require(_0x7375('0x9'));module[_0x7375('0xa')]=function(_0x31be75,_0x2b4c6c){return _0x31be75[_0x7375('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x858d=['api','moment','path','../../config/environment','exports','define','AnalyticTreeReport','lodash','util','../../config/logger'];(function(_0x382028,_0x37b799){var _0x5ae64c=function(_0x2e1b74){while(--_0x2e1b74){_0x382028['push'](_0x382028['shift']());}};_0x5ae64c(++_0x37b799);}(_0x858d,0x18d));var _0xd858=function(_0x1d50ec,_0x5aef15){_0x1d50ec=_0x1d50ec-0x0;var _0x2e970d=_0x858d[_0x1d50ec];return _0x2e970d;};'use strict';var _=require(_0xd858('0x0'));var util=require(_0xd858('0x1'));var logger=require(_0xd858('0x2'))(_0xd858('0x3'));var moment=require(_0xd858('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd858('0x5'));var rimraf=require('rimraf');var config=require(_0xd858('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xd858('0x7')]=function(_0x39c167,_0x138106){return _0x39c167[_0xd858('0x8')](_0xd858('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index d6a5a06..9ef43b4 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x129954,_0x17b156){var _0x2b40f2=function(_0x5b3ce1){while(--_0x5b3ce1){_0x129954['push'](_0x129954['shift']());}};_0x2b40f2(++_0x17b156);}(_0x2ef3,0xba));var _0x32ef=function(_0x2a85a6,_0x457e78){_0x2a85a6=_0x2a85a6-0x0;var _0xfbe55e=_0x2ef3[_0x2a85a6];return _0xfbe55e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x29fb63,_0xdd2860){var _0x1c8876=function(_0x4042f5){while(--_0x4042f5){_0x29fb63['push'](_0x29fb63['shift']());}};_0x1c8876(++_0xdd2860);}(_0x1261,0x144));var _0x1126=function(_0x5be8ab,_0x4000a6){_0x5be8ab=_0x5be8ab-0x0;var _0x35914d=_0x1261[_0x5be8ab];return _0x35914d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index ff98d5c..50d398e 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 _0xdce0=['put','update','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x5458a6,_0x1688c5){var _0x2669fc=function(_0x54ed83){while(--_0x54ed83){_0x5458a6['push'](_0x5458a6['shift']());}};_0x2669fc(++_0x1688c5);}(_0xdce0,0x15a));var _0x0dce=function(_0x207d61,_0xabddf2){_0x207d61=_0x207d61-0x0;var _0xe25562=_0xdce0[_0x207d61];return _0xe25562;};'use strict';var multer=require('multer');var util=require(_0x0dce('0x0'));var path=require(_0x0dce('0x1'));var timeout=require('connect-timeout');var express=require(_0x0dce('0x2'));var router=express[_0x0dce('0x3')]();var fs_extra=require(_0x0dce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0dce('0x5'));var config=require(_0x0dce('0x6'));var controller=require(_0x0dce('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0dce('0x8')](_0x0dce('0x9'),auth[_0x0dce('0xa')](),controller[_0x0dce('0xb')]);router[_0x0dce('0xc')]('/',auth[_0x0dce('0xa')](),controller[_0x0dce('0xd')]);router[_0x0dce('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0dce('0xf')]);router[_0x0dce('0x10')](_0x0dce('0x9'),auth[_0x0dce('0xa')](),controller['destroy']);module[_0x0dce('0x11')]=router;
\ No newline at end of file
+var _0xb421=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb421,0x6e));var _0x1b42=function(_0x6784a1,_0x2792fb){_0x6784a1=_0x6784a1-0x0;var _0x4a629e=_0xb421[_0x6784a1];return _0x4a629e;};'use strict';var multer=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var path=require(_0x1b42('0x2'));var timeout=require(_0x1b42('0x3'));var express=require(_0x1b42('0x4'));var router=express[_0x1b42('0x5')]();var fs_extra=require(_0x1b42('0x6'));var auth=require(_0x1b42('0x7'));var interaction=require(_0x1b42('0x8'));var config=require(_0x1b42('0x9'));var controller=require(_0x1b42('0xa'));router[_0x1b42('0xb')]('/',auth['isAuthenticated'](),controller[_0x1b42('0xc')]);router['get']('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0xe')]);router[_0x1b42('0xf')]('/',auth[_0x1b42('0xd')](),controller[_0x1b42('0x10')]);router[_0x1b42('0x11')]('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0x12')]);router[_0x1b42('0x13')](_0x1b42('0x14'),auth[_0x1b42('0xd')](),controller[_0x1b42('0x15')]);module[_0x1b42('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b549854..e6ea23b 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 _0x89f7=['sequelize','exports','STRING'];(function(_0x5cfdcf,_0xf1b182){var _0x6cfd17=function(_0x1fd3c2){while(--_0x1fd3c2){_0x5cfdcf['push'](_0x5cfdcf['shift']());}};_0x6cfd17(++_0xf1b182);}(_0x89f7,0x105));var _0x789f=function(_0x178e71,_0x5c6c7d){_0x178e71=_0x178e71-0x0;var _0x3eec6c=_0x89f7[_0x178e71];return _0x3eec6c;};'use strict';var Sequelize=require(_0x789f('0x0'));module[_0x789f('0x1')]={'name':{'type':Sequelize[_0x789f('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x789f('0x2')]}};
\ No newline at end of file
+var _0x6737=['exports','STRING'];(function(_0x513203,_0x53ad55){var _0x5b3c8b=function(_0x275b28){while(--_0x275b28){_0x513203['push'](_0x513203['shift']());}};_0x5b3c8b(++_0x53ad55);}(_0x6737,0xe2));var _0x7673=function(_0x279e17,_0x49f85a){_0x279e17=_0x279e17-0x0;var _0x1f159a=_0x6737[_0x279e17];return _0x1f159a;};'use strict';var Sequelize=require('sequelize');module[_0x7673('0x0')]={'name':{'type':Sequelize[_0x7673('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7673('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c06d84b..7d6b43f 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 _0x6aec=['attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','options','find','include','omit','createdAt','updatedAt','create','body','catch','update','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','offset','undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','Attachment','rawAttributes','key','map','name','query','keys','filters'];(function(_0x10abfe,_0x7a9ad6){var _0x473c1b=function(_0x392758){while(--_0x392758){_0x10abfe['push'](_0x10abfe['shift']());}};_0x473c1b(++_0x7a9ad6);}(_0x6aec,0xd2));var _0xc6ae=function(_0x5c0be6,_0x4f3671){_0x5c0be6=_0x5c0be6-0x0;var _0x3be5ae=_0x6aec[_0x5c0be6];return _0x3be5ae;};'use strict';var emlformat=require(_0xc6ae('0x0'));var rimraf=require(_0xc6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6ae('0x2'));var rp=require(_0xc6ae('0x3'));var moment=require(_0xc6ae('0x4'));var BPromise=require(_0xc6ae('0x5'));var Mustache=require(_0xc6ae('0x6'));var util=require('util');var path=require(_0xc6ae('0x7'));var sox=require('sox');var csv=require(_0xc6ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6ae('0x9'));var _=require(_0xc6ae('0xa'));var squel=require(_0xc6ae('0xb'));var crypto=require(_0xc6ae('0xc'));var jsforce=require(_0xc6ae('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc6ae('0xe'));var authService=require(_0xc6ae('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc6ae('0x10'));var hardwareService=require(_0xc6ae('0x11'));var logger=require(_0xc6ae('0x12'))(_0xc6ae('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc6ae('0x14'));var db=require(_0xc6ae('0x15'))['db'];function respondWithStatusCode(_0x504568,_0x8f712){_0x8f712=_0x8f712||0xcc;return function(_0x48b1a6){if(_0x48b1a6){return _0x504568['sendStatus'](_0x8f712);}return _0x504568['status'](_0x8f712)['end']();};}function respondWithResult(_0x2a7b40,_0x3ec68d){_0x3ec68d=_0x3ec68d||0xc8;return function(_0x2b48a8){if(_0x2b48a8){return _0x2a7b40['status'](_0x3ec68d)['json'](_0x2b48a8);}};}function respondWithFilteredResult(_0x15c9dd,_0x2ed1d7){return function(_0x4a56d1){if(_0x4a56d1){var _0x1d7baf=typeof _0x2ed1d7[_0xc6ae('0x16')]===_0xc6ae('0x17')&&typeof _0x2ed1d7['limit']===_0xc6ae('0x17');var _0x4c981d=_0x4a56d1[_0xc6ae('0x18')];var _0x299f0c=_0x1d7baf?0x0:_0x2ed1d7[_0xc6ae('0x16')];var _0x2711ed=_0x1d7baf?_0x4a56d1[_0xc6ae('0x18')]:_0x2ed1d7['offset']+_0x2ed1d7[_0xc6ae('0x19')];var _0x4e3535;if(_0x2711ed>=_0x4c981d){_0x2711ed=_0x4c981d;_0x4e3535=0xc8;}else{_0x4e3535=0xce;}_0x15c9dd[_0xc6ae('0x1a')](_0x4e3535);return _0x15c9dd['set'](_0xc6ae('0x1b'),_0x299f0c+'-'+_0x2711ed+'/'+_0x4c981d)['json'](_0x4a56d1);}return null;};}function patchUpdates(_0x2489ac){return function(_0x3c2a34){try{jsonpatch[_0xc6ae('0x1c')](_0x3c2a34,_0x2489ac,!![]);}catch(_0x3c4bb6){return BPromise[_0xc6ae('0x1d')](_0x3c4bb6);}return _0x3c2a34[_0xc6ae('0x1e')]();};}function saveUpdates(_0xb80d5b,_0x28268a){return function(_0x2b405b){if(_0x2b405b){return _0x2b405b['update'](_0xb80d5b)[_0xc6ae('0x1f')](function(_0x599299){return _0x599299;});}return null;};}function removeEntity(_0x3a3699,_0x102302){return function(_0x44c73a){if(_0x44c73a){return _0x44c73a[_0xc6ae('0x20')]()[_0xc6ae('0x1f')](function(){_0x3a3699[_0xc6ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1057de,_0x5840bb){return function(_0x381cf2){if(!_0x381cf2){_0x1057de[_0xc6ae('0x21')](0x194);}return _0x381cf2;};}function handleError(_0x5c76be,_0x424379){_0x424379=_0x424379||0x1f4;return function(_0x45a5cb){logger[_0xc6ae('0x22')](_0x45a5cb[_0xc6ae('0x23')]);if(_0x45a5cb['name']){delete _0x45a5cb['name'];}_0x5c76be['status'](_0x424379)[_0xc6ae('0x24')](_0x45a5cb);};}exports['index']=function(_0x12aa92,_0x2bde5c){var _0x2a6f53={},_0x2f7408={},_0x54a78c={'count':0x0,'rows':[]};var _0x253c90=_['map'](db[_0xc6ae('0x25')][_0xc6ae('0x26')],function(_0x1804e7){return{'name':_0x1804e7['fieldName'],'type':_0x1804e7['type'][_0xc6ae('0x27')]};});_0x2f7408['model']=_[_0xc6ae('0x28')](_0x253c90,_0xc6ae('0x29'));_0x2f7408[_0xc6ae('0x2a')]=_[_0xc6ae('0x2b')](_0x12aa92[_0xc6ae('0x2a')]);_0x2f7408[_0xc6ae('0x2c')]=_['intersection'](_0x2f7408['model'],_0x2f7408[_0xc6ae('0x2a')]);_0x2a6f53[_0xc6ae('0x2d')]=_[_0xc6ae('0x2e')](_0x2f7408['model'],qs[_0xc6ae('0x2f')](_0x12aa92[_0xc6ae('0x2a')]['fields']));_0x2a6f53[_0xc6ae('0x2d')]=_0x2a6f53[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x2a6f53[_0xc6ae('0x2d')]:_0x2f7408[_0xc6ae('0x31')];if(!_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x32')](_0xc6ae('0x33'))){_0x2a6f53[_0xc6ae('0x19')]=qs[_0xc6ae('0x19')](_0x12aa92[_0xc6ae('0x2a')]['limit']);_0x2a6f53[_0xc6ae('0x16')]=qs[_0xc6ae('0x16')](_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x16')]);}_0x2a6f53[_0xc6ae('0x34')]=qs[_0xc6ae('0x35')](_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x35')]);_0x2a6f53[_0xc6ae('0x36')]=qs[_0xc6ae('0x2c')](_[_0xc6ae('0x37')](_0x12aa92['query'],_0x2f7408[_0xc6ae('0x2c')]),_0x253c90);if(_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x38')]){_0x2a6f53[_0xc6ae('0x36')]=_[_0xc6ae('0x39')](_0x2a6f53[_0xc6ae('0x36')],{'$or':_['map'](_0x253c90,function(_0x39fb08){if(_0x39fb08[_0xc6ae('0x3a')]!==_0xc6ae('0x3b')){var _0x1d4d7e={};_0x1d4d7e[_0x39fb08[_0xc6ae('0x29')]]={'$like':'%'+_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x38')]+'%'};return _0x1d4d7e;}})});}_0x2a6f53=_[_0xc6ae('0x39')]({},_0x2a6f53,_0x12aa92['options']);var _0x333e7a={'where':_0x2a6f53[_0xc6ae('0x36')]};return db[_0xc6ae('0x25')]['count'](_0x333e7a)[_0xc6ae('0x1f')](function(_0x53c34e){_0x54a78c[_0xc6ae('0x18')]=_0x53c34e;if(_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x3c')]){_0x2a6f53['include']=[{'all':!![]}];}return db[_0xc6ae('0x25')][_0xc6ae('0x3d')](_0x2a6f53);})[_0xc6ae('0x1f')](function(_0x5ab354){_0x54a78c[_0xc6ae('0x3e')]=_0x5ab354;return _0x54a78c;})[_0xc6ae('0x1f')](respondWithFilteredResult(_0x2bde5c,_0x2a6f53))['catch'](handleError(_0x2bde5c,null));};exports[_0xc6ae('0x3f')]=function(_0x3649a0,_0x341b12){var _0x4a5170={'raw':!![],'where':{'id':_0x3649a0[_0xc6ae('0x40')]['id']}},_0x469386={};_0x469386['model']=_[_0xc6ae('0x2b')](db['Attachment'][_0xc6ae('0x26')]);_0x469386[_0xc6ae('0x2a')]=_[_0xc6ae('0x2b')](_0x3649a0[_0xc6ae('0x2a')]);_0x469386['filters']=_['intersection'](_0x469386[_0xc6ae('0x31')],_0x469386[_0xc6ae('0x2a')]);_0x4a5170[_0xc6ae('0x2d')]=_[_0xc6ae('0x2e')](_0x469386[_0xc6ae('0x31')],qs[_0xc6ae('0x2f')](_0x3649a0[_0xc6ae('0x2a')][_0xc6ae('0x2f')]));_0x4a5170[_0xc6ae('0x2d')]=_0x4a5170[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x4a5170['attributes']:_0x469386[_0xc6ae('0x31')];if(_0x3649a0[_0xc6ae('0x2a')][_0xc6ae('0x3c')]){_0x4a5170['include']=[{'all':!![]}];}_0x4a5170=_[_0xc6ae('0x39')]({},_0x4a5170,_0x3649a0[_0xc6ae('0x41')]);return db[_0xc6ae('0x25')][_0xc6ae('0x42')](_0x4a5170)[_0xc6ae('0x1f')](handleEntityNotFound(_0x341b12,null))['then'](respondWithResult(_0x341b12,null))['catch'](handleError(_0x341b12,null));};exports['clone']=function(_0x3ef92c,_0xd25199){var _0x1a92ed={'where':{'id':_0x3ef92c[_0xc6ae('0x40')]['id']}},_0x2c91bc={};_0x2c91bc[_0xc6ae('0x31')]=_[_0xc6ae('0x2b')](db[_0xc6ae('0x25')]['rawAttributes']);_0x1a92ed['attributes']=_[_0xc6ae('0x2e')](_0x2c91bc[_0xc6ae('0x31')],qs[_0xc6ae('0x2f')](_0x3ef92c[_0xc6ae('0x2a')][_0xc6ae('0x2f')]));_0x1a92ed[_0xc6ae('0x2d')]=_0x1a92ed[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x1a92ed[_0xc6ae('0x2d')]:_0x2c91bc[_0xc6ae('0x31')];if(_0x3ef92c['query']['includeAll']){_0x1a92ed[_0xc6ae('0x43')]=[{'all':!![]}];}_0x1a92ed=_['merge']({},_0x1a92ed,_0x3ef92c[_0xc6ae('0x41')]);return db['Attachment']['find'](_0x1a92ed)[_0xc6ae('0x1f')](handleEntityNotFound(_0xd25199,null))[_0xc6ae('0x1f')](function(_0x2be95a){if(_0x2be95a){var _0x4f8e1f=_0x2be95a['get']({'plain':!![]});_0x4f8e1f=qs[_0xc6ae('0x44')](_0x4f8e1f,['id',_0xc6ae('0x45'),_0xc6ae('0x46')]);_0x3ef92c['body']=_[_0xc6ae('0x44')](_0x3ef92c['body'],['id','createdAt',_0xc6ae('0x46')]);return db[_0xc6ae('0x25')][_0xc6ae('0x47')](_[_0xc6ae('0x39')](_0x4f8e1f,_0x3ef92c[_0xc6ae('0x48')]),{'include':_0x3ef92c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc6ae('0x1f')](respondWithResult(_0xd25199,0xc9))[_0xc6ae('0x49')](handleError(_0xd25199,null));};exports[_0xc6ae('0x4a')]=function(_0x5865f8,_0x518e42){if(_0x5865f8[_0xc6ae('0x48')]['id']){delete _0x5865f8[_0xc6ae('0x48')]['id'];}return db[_0xc6ae('0x25')][_0xc6ae('0x42')]({'where':{'id':_0x5865f8['params']['id']}})[_0xc6ae('0x1f')](handleEntityNotFound(_0x518e42,null))[_0xc6ae('0x1f')](saveUpdates(_0x5865f8[_0xc6ae('0x48')],null))[_0xc6ae('0x1f')](respondWithResult(_0x518e42,null))[_0xc6ae('0x49')](handleError(_0x518e42,null));};exports['destroy']=function(_0x1473f8,_0x142d0d){return db[_0xc6ae('0x25')][_0xc6ae('0x42')]({'where':{'id':_0x1473f8[_0xc6ae('0x40')]['id']}})[_0xc6ae('0x1f')](handleEntityNotFound(_0x142d0d,null))['then'](removeEntity(_0x142d0d,null))[_0xc6ae('0x49')](handleError(_0x142d0d,null));};exports[_0xc6ae('0x47')]=function(_0x245f3d,_0x1d9958,_0x49b108){_0x245f3d[_0xc6ae('0x48')][_0xc6ae('0x29')]=_0x245f3d[_0xc6ae('0x4b')][_0xc6ae('0x4c')];_0x245f3d[_0xc6ae('0x48')][_0xc6ae('0x4d')]=_0x245f3d[_0xc6ae('0x4b')][_0xc6ae('0x4e')];_0x245f3d['body'][_0xc6ae('0x3a')]=_0x245f3d['file']['mimetype'];return db[_0xc6ae('0x25')]['create'](_0x245f3d[_0xc6ae('0x48')])[_0xc6ae('0x1f')](respondWithResult(_0x1d9958,0xc9))[_0xc6ae('0x49')](handleError(_0x1d9958,null));};exports[_0xc6ae('0x4f')]=function(_0xf4e69a,_0x58797e,_0x808ce){return db[_0xc6ae('0x25')]['findOne']({'where':{'id':_0xf4e69a[_0xc6ae('0x40')]['id']},'raw':!![]})[_0xc6ae('0x1f')](handleEntityNotFound(_0x58797e,null))[_0xc6ae('0x1f')](function(_0x5c666d){if(_0x5c666d){var _0x39c632=_0x5c666d[_0xc6ae('0x50')]!==null;var _0x2f4928=path[_0xc6ae('0x51')](config[_0xc6ae('0x52')],_0xc6ae('0x53'));if(_0x39c632){_0x2f4928=path['join'](_0x2f4928,_0xc6ae('0x54'));}var _0x2c8678=path[_0xc6ae('0x51')](_0x2f4928,_0x5c666d['basename']);return _0x58797e[_0xc6ae('0x4f')](_0x2c8678);}})[_0xc6ae('0x49')](handleError(_0x58797e,null));};
\ No newline at end of file
+var _0x5d5e=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','update','destroy','error','name','send','map','Attachment','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','get','omit','updatedAt','body','createdAt','create','catch','originalname','basename','file','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format'];(function(_0x416586,_0xbdf0b1){var _0x5cbb10=function(_0x274854){while(--_0x274854){_0x416586['push'](_0x416586['shift']());}};_0x5cbb10(++_0xbdf0b1);}(_0x5d5e,0x104));var _0xe5d5=function(_0x467698,_0x1b7e8f){_0x467698=_0x467698-0x0;var _0x89f21b=_0x5d5e[_0x467698];return _0x89f21b;};'use strict';var emlformat=require(_0xe5d5('0x0'));var rimraf=require(_0xe5d5('0x1'));var zipdir=require(_0xe5d5('0x2'));var jsonpatch=require(_0xe5d5('0x3'));var rp=require('request-promise');var moment=require(_0xe5d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5d5('0x5'));var util=require(_0xe5d5('0x6'));var path=require(_0xe5d5('0x7'));var sox=require(_0xe5d5('0x8'));var csv=require(_0xe5d5('0x9'));var ejs=require(_0xe5d5('0xa'));var fs=require('fs');var fs_extra=require(_0xe5d5('0xb'));var _=require(_0xe5d5('0xc'));var squel=require(_0xe5d5('0xd'));var crypto=require(_0xe5d5('0xe'));var jsforce=require(_0xe5d5('0xf'));var deskjs=require(_0xe5d5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe5d5('0x11'));var Papa=require('papaparse');var Redis=require(_0xe5d5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe5d5('0x13'));var hardwareService=require(_0xe5d5('0x14'));var logger=require('../../config/logger')(_0xe5d5('0x15'));var utils=require(_0xe5d5('0x16'));var config=require(_0xe5d5('0x17'));var licenseUtil=require(_0xe5d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e331d,_0x28cb5d){_0x28cb5d=_0x28cb5d||0xcc;return function(_0x4e1cdf){if(_0x4e1cdf){return _0x4e331d[_0xe5d5('0x19')](_0x28cb5d);}return _0x4e331d[_0xe5d5('0x1a')](_0x28cb5d)[_0xe5d5('0x1b')]();};}function respondWithResult(_0x23df93,_0x248c0f){_0x248c0f=_0x248c0f||0xc8;return function(_0x4ba4fc){if(_0x4ba4fc){return _0x23df93[_0xe5d5('0x1a')](_0x248c0f)[_0xe5d5('0x1c')](_0x4ba4fc);}};}function respondWithFilteredResult(_0xf53458,_0x278411){return function(_0xf5b6bd){if(_0xf5b6bd){var _0x3f4491=typeof _0x278411['offset']===_0xe5d5('0x1d')&&typeof _0x278411['limit']==='undefined';var _0x583a9e=_0xf5b6bd[_0xe5d5('0x1e')];var _0x5bab59=_0x3f4491?0x0:_0x278411[_0xe5d5('0x1f')];var _0xf33c37=_0x3f4491?_0xf5b6bd[_0xe5d5('0x1e')]:_0x278411[_0xe5d5('0x1f')]+_0x278411['limit'];var _0x1d07ab;if(_0xf33c37>=_0x583a9e){_0xf33c37=_0x583a9e;_0x1d07ab=0xc8;}else{_0x1d07ab=0xce;}_0xf53458[_0xe5d5('0x1a')](_0x1d07ab);return _0xf53458[_0xe5d5('0x20')](_0xe5d5('0x21'),_0x5bab59+'-'+_0xf33c37+'/'+_0x583a9e)[_0xe5d5('0x1c')](_0xf5b6bd);}return null;};}function patchUpdates(_0x36dc84){return function(_0x287199){try{jsonpatch['apply'](_0x287199,_0x36dc84,!![]);}catch(_0x5555af){return BPromise['reject'](_0x5555af);}return _0x287199[_0xe5d5('0x22')]();};}function saveUpdates(_0x39be17,_0x1dae40){return function(_0x44dbb9){if(_0x44dbb9){return _0x44dbb9[_0xe5d5('0x23')](_0x39be17)['then'](function(_0x25a906){return _0x25a906;});}return null;};}function removeEntity(_0x55d44f,_0x3f3ec7){return function(_0x1b989e){if(_0x1b989e){return _0x1b989e[_0xe5d5('0x24')]()['then'](function(){_0x55d44f[_0xe5d5('0x1a')](0xcc)[_0xe5d5('0x1b')]();});}};}function handleEntityNotFound(_0x485508,_0x42b7d1){return function(_0x3aaf1b){if(!_0x3aaf1b){_0x485508[_0xe5d5('0x19')](0x194);}return _0x3aaf1b;};}function handleError(_0x8d6fa4,_0x81aab0){_0x81aab0=_0x81aab0||0x1f4;return function(_0x1e0f8f){logger[_0xe5d5('0x25')](_0x1e0f8f['stack']);if(_0x1e0f8f[_0xe5d5('0x26')]){delete _0x1e0f8f[_0xe5d5('0x26')];}_0x8d6fa4[_0xe5d5('0x1a')](_0x81aab0)[_0xe5d5('0x27')](_0x1e0f8f);};}exports['index']=function(_0x570333,_0x11b622){var _0x3b0cb9={},_0x3af9c9={},_0x2b384a={'count':0x0,'rows':[]};var _0x55b978=_[_0xe5d5('0x28')](db[_0xe5d5('0x29')]['rawAttributes'],function(_0xc6830f){return{'name':_0xc6830f[_0xe5d5('0x2a')],'type':_0xc6830f[_0xe5d5('0x2b')][_0xe5d5('0x2c')]};});_0x3af9c9['model']=_[_0xe5d5('0x28')](_0x55b978,_0xe5d5('0x26'));_0x3af9c9['query']=_[_0xe5d5('0x2d')](_0x570333[_0xe5d5('0x2e')]);_0x3af9c9[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],_0x3af9c9[_0xe5d5('0x2e')]);_0x3b0cb9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x33')]));_0x3b0cb9['attributes']=_0x3b0cb9[_0xe5d5('0x32')]['length']?_0x3b0cb9[_0xe5d5('0x32')]:_0x3af9c9['model'];if(!_0x570333['query'][_0xe5d5('0x34')](_0xe5d5('0x35'))){_0x3b0cb9['limit']=qs[_0xe5d5('0x36')](_0x570333['query']['limit']);_0x3b0cb9[_0xe5d5('0x1f')]=qs[_0xe5d5('0x1f')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x1f')]);}_0x3b0cb9[_0xe5d5('0x37')]=qs[_0xe5d5('0x38')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x38')]);_0x3b0cb9[_0xe5d5('0x39')]=qs['filters'](_['pick'](_0x570333[_0xe5d5('0x2e')],_0x3af9c9[_0xe5d5('0x2f')]),_0x55b978);if(_0x570333['query']['filter']){_0x3b0cb9[_0xe5d5('0x39')]=_[_0xe5d5('0x3a')](_0x3b0cb9[_0xe5d5('0x39')],{'$or':_[_0xe5d5('0x28')](_0x55b978,function(_0x465043){if(_0x465043[_0xe5d5('0x2b')]!==_0xe5d5('0x3b')){var _0x108990={};_0x108990[_0x465043['name']]={'$like':'%'+_0x570333[_0xe5d5('0x2e')]['filter']+'%'};return _0x108990;}})});}_0x3b0cb9=_[_0xe5d5('0x3a')]({},_0x3b0cb9,_0x570333[_0xe5d5('0x3c')]);var _0x421940={'where':_0x3b0cb9['where']};return db[_0xe5d5('0x29')][_0xe5d5('0x1e')](_0x421940)[_0xe5d5('0x3d')](function(_0x556c15){_0x2b384a['count']=_0x556c15;if(_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x3e')]){_0x3b0cb9[_0xe5d5('0x3f')]=[{'all':!![]}];}return db[_0xe5d5('0x29')][_0xe5d5('0x40')](_0x3b0cb9);})[_0xe5d5('0x3d')](function(_0x24dd19){_0x2b384a[_0xe5d5('0x41')]=_0x24dd19;return _0x2b384a;})[_0xe5d5('0x3d')](respondWithFilteredResult(_0x11b622,_0x3b0cb9))['catch'](handleError(_0x11b622,null));};exports[_0xe5d5('0x42')]=function(_0x20a46d,_0x22fe09){var _0x2db585={'raw':!![],'where':{'id':_0x20a46d[_0xe5d5('0x43')]['id']}},_0x3a32a2={};_0x3a32a2[_0xe5d5('0x31')]=_['keys'](db[_0xe5d5('0x29')]['rawAttributes']);_0x3a32a2[_0xe5d5('0x2e')]=_['keys'](_0x20a46d[_0xe5d5('0x2e')]);_0x3a32a2[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],_0x3a32a2['query']);_0x2db585[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x20a46d[_0xe5d5('0x2e')]['fields']));_0x2db585['attributes']=_0x2db585['attributes']['length']?_0x2db585['attributes']:_0x3a32a2[_0xe5d5('0x31')];if(_0x20a46d['query'][_0xe5d5('0x3e')]){_0x2db585[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x2db585=_['merge']({},_0x2db585,_0x20a46d[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')]['find'](_0x2db585)[_0xe5d5('0x3d')](handleEntityNotFound(_0x22fe09,null))[_0xe5d5('0x3d')](respondWithResult(_0x22fe09,null))['catch'](handleError(_0x22fe09,null));};exports[_0xe5d5('0x44')]=function(_0x4672e9,_0x2087c2){var _0x3ecdc9={'where':{'id':_0x4672e9[_0xe5d5('0x43')]['id']}},_0x59f872={};_0x59f872[_0xe5d5('0x31')]=_[_0xe5d5('0x2d')](db[_0xe5d5('0x29')][_0xe5d5('0x45')]);_0x3ecdc9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x59f872[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x4672e9['query'][_0xe5d5('0x33')]));_0x3ecdc9[_0xe5d5('0x32')]=_0x3ecdc9['attributes']['length']?_0x3ecdc9[_0xe5d5('0x32')]:_0x59f872[_0xe5d5('0x31')];if(_0x4672e9[_0xe5d5('0x2e')]['includeAll']){_0x3ecdc9[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x3ecdc9=_[_0xe5d5('0x3a')]({},_0x3ecdc9,_0x4672e9[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')][_0xe5d5('0x46')](_0x3ecdc9)[_0xe5d5('0x3d')](handleEntityNotFound(_0x2087c2,null))[_0xe5d5('0x3d')](function(_0x5e982e){if(_0x5e982e){var _0x1dd6f9=_0x5e982e[_0xe5d5('0x47')]({'plain':!![]});_0x1dd6f9=qs[_0xe5d5('0x48')](_0x1dd6f9,['id','createdAt',_0xe5d5('0x49')]);_0x4672e9[_0xe5d5('0x4a')]=_[_0xe5d5('0x48')](_0x4672e9['body'],['id',_0xe5d5('0x4b'),_0xe5d5('0x49')]);return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_[_0xe5d5('0x3a')](_0x1dd6f9,_0x4672e9['body']),{'include':_0x4672e9[_0xe5d5('0x2e')][_0xe5d5('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2087c2,0xc9))[_0xe5d5('0x4d')](handleError(_0x2087c2,null));};exports['update']=function(_0x3caf55,_0x40e159){if(_0x3caf55['body']['id']){delete _0x3caf55[_0xe5d5('0x4a')]['id'];}return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x3caf55['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x40e159,null))[_0xe5d5('0x3d')](saveUpdates(_0x3caf55[_0xe5d5('0x4a')],null))[_0xe5d5('0x3d')](respondWithResult(_0x40e159,null))[_0xe5d5('0x4d')](handleError(_0x40e159,null));};exports[_0xe5d5('0x24')]=function(_0x34315d,_0x42dd12){return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x34315d['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x42dd12,null))[_0xe5d5('0x3d')](removeEntity(_0x42dd12,null))[_0xe5d5('0x4d')](handleError(_0x42dd12,null));};exports[_0xe5d5('0x4c')]=function(_0xdaff12,_0x2f684c,_0x2d3738){_0xdaff12[_0xe5d5('0x4a')]['name']=_0xdaff12['file'][_0xe5d5('0x4e')];_0xdaff12['body'][_0xe5d5('0x4f')]=_0xdaff12[_0xe5d5('0x50')]['filename'];_0xdaff12[_0xe5d5('0x4a')][_0xe5d5('0x2b')]=_0xdaff12['file']['mimetype'];return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_0xdaff12[_0xe5d5('0x4a')])[_0xe5d5('0x3d')](respondWithResult(_0x2f684c,0xc9))[_0xe5d5('0x4d')](handleError(_0x2f684c,null));};exports['download']=function(_0x3aed51,_0x5405a0,_0x348d48){return db[_0xe5d5('0x29')][_0xe5d5('0x51')]({'where':{'id':_0x3aed51[_0xe5d5('0x43')]['id']},'raw':!![]})[_0xe5d5('0x3d')](handleEntityNotFound(_0x5405a0,null))[_0xe5d5('0x3d')](function(_0x5460af){if(_0x5460af){var _0x4026ad=_0x5460af[_0xe5d5('0x52')]!==null;var _0x5d5351=path['join'](config[_0xe5d5('0x53')],_0xe5d5('0x54'));if(_0x4026ad){_0x5d5351=path[_0xe5d5('0x55')](_0x5d5351,_0xe5d5('0x56'));}var _0x8e78e0=path[_0xe5d5('0x55')](_0x5d5351,_0x5460af[_0xe5d5('0x4f')]);return _0x5405a0['download'](_0x8e78e0);}})[_0xe5d5('0x4d')](handleError(_0x5405a0,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 511d869..a1c381f 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 _0x1e51=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x553d1d,_0x456a4d){var _0x3712c9=function(_0x2204ad){while(--_0x2204ad){_0x553d1d['push'](_0x553d1d['shift']());}};_0x3712c9(++_0x456a4d);}(_0x1e51,0x130));var _0x11e5=function(_0x3cff25,_0x1d6be6){_0x3cff25=_0x3cff25-0x0;var _0x322bd6=_0x1e51[_0x3cff25];return _0x322bd6;};'use strict';var _=require(_0x11e5('0x0'));var util=require(_0x11e5('0x1'));var logger=require(_0x11e5('0x2'))(_0x11e5('0x3'));var moment=require(_0x11e5('0x4'));var BPromise=require(_0x11e5('0x5'));var rp=require(_0x11e5('0x6'));var fs=require('fs');var path=require(_0x11e5('0x7'));var rimraf=require(_0x11e5('0x8'));var config=require(_0x11e5('0x9'));var attributes=require(_0x11e5('0xa'));module['exports']=function(_0x451c4e,_0x3efb9d){return _0x451c4e[_0x11e5('0xb')](_0x11e5('0xc'),attributes,{'tableName':_0x11e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72de=['Attachment','attachments','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x72de,0x1e6));var _0xe72d=function(_0x17b203,_0x5a2205){_0x17b203=_0x17b203-0x0;var _0x153741=_0x72de[_0x17b203];return _0x153741;};'use strict';var _=require(_0xe72d('0x0'));var util=require(_0xe72d('0x1'));var logger=require(_0xe72d('0x2'))(_0xe72d('0x3'));var moment=require(_0xe72d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe72d('0x5'));var config=require(_0xe72d('0x6'));var attributes=require(_0xe72d('0x7'));module[_0xe72d('0x8')]=function(_0x30858e,_0x312cdb){return _0x30858e['define'](_0xe72d('0x9'),attributes,{'tableName':_0xe72d('0xa'),'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 c08c157..b482d66 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 _0x99e9=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body','raw','CreateAttachment','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x167d37,_0x53d041){var _0x18b7a4=function(_0x4cf090){while(--_0x4cf090){_0x167d37['push'](_0x167d37['shift']());}};_0x18b7a4(++_0x53d041);}(_0x99e9,0xb4));var _0x999e=function(_0x31f7c5,_0x3bf428){_0x31f7c5=_0x31f7c5-0x0;var _0x19fabc=_0x99e9[_0x31f7c5];return _0x19fabc;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Attachment,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});}exports['CreateAttachment']=function(_0x4fcdfb){var _0x3153ce=this;return new Promise(function(_0x43b09e,_0xc4ef74){return db[_0x999e('0x17')][_0x999e('0x18')](_0x4fcdfb[_0x999e('0x19')],{'raw':_0x4fcdfb['options']?_0x4fcdfb['options'][_0x999e('0x1a')]===undefined?!![]:![]:!![]})[_0x999e('0xb')](function(_0x3b3642){logger['info'](_0x999e('0x1b'),_0x4fcdfb);logger[_0x999e('0xf')](_0x999e('0x1b'),_0x4fcdfb,JSON[_0x999e('0x11')](_0x3b3642));_0x43b09e(_0x3b3642);})[_0x999e('0x16')](function(_0x3750a0){logger[_0x999e('0x12')]('CreateAttachment',_0x3750a0['message'],_0x4fcdfb);_0xc4ef74(_0x3153ce[_0x999e('0x12')](0x1f4,_0x3750a0[_0x999e('0x14')]));});});};
\ No newline at end of file
+var _0xa74f=['then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','body','options','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa74f,0x9a));var _0xfa74=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xa74f[_0x29bf80];return _0x932096;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateAttachment',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateAttachment',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 50d7bbf..eca446b 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5bde33,_0x317aef){var _0x5bffd1=function(_0x5376d5){while(--_0x5376d5){_0x5bde33['push'](_0x5bde33['shift']());}};_0x5bffd1(++_0x317aef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x462ae6,_0x384d3d){_0x462ae6=_0x462ae6-0x0;var _0x38f095=_0x5f2f[_0x462ae6];return _0x38f095;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5e4146,_0x306610){var _0x1b0344=function(_0x4fb8a5){while(--_0x4fb8a5){_0x5e4146['push'](_0x5e4146['shift']());}};_0x1b0344(++_0x306610);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56d776,_0x252211){_0x56d776=_0x56d776-0x0;var _0x2be469=_0x5f2f[_0x56d776];return _0x2be469;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 563717b..5361acc 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 _0x1796=['getLicense','lodash','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','email','callback','google','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','then','User','find','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','blockDuration','minutes'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x1796,0xab));var _0x6179=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1796[_0x543084];return _0x306a57;};'use strict';var _=require(_0x6179('0x0'));var passport=require(_0x6179('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x6179('0x2')];var moment=require(_0x6179('0x3'));var db=require(_0x6179('0x4'))['db'];var config=require(_0x6179('0x5'));var signToken=require(_0x6179('0x6'))[_0x6179('0x7')];var utils=require(_0x6179('0x8'));exports[_0x6179('0x9')]=passport[_0x6179('0xa')]('google',{'failureRedirect':_0x6179('0xb'),'scope':['profile',_0x6179('0xc')],'session':![]});exports[_0x6179('0xd')]=passport[_0x6179('0xa')](_0x6179('0xe'),{'failureRedirect':_0x6179('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x6179('0xe')]?config['google'][_0x6179('0xf')]:'id','clientSecret':config[_0x6179('0xe')]?config['google'][_0x6179('0x10')]:_0x6179('0x11'),'callbackURL':config[_0x6179('0xe')]?config[_0x6179('0xe')]['callbackURL']:''},function(_0x14ec8e,_0x50709c,_0xd30faa,_0x3ef0f7){var _0x4a0feb,_0x5214ea;return db[_0x6179('0x12')][_0x6179('0x13')]({'where':{'id':0x1},'attributes':[_0x6179('0x14'),'blockDuration'],'raw':!![]})[_0x6179('0x15')](function(_0x2497ad){_0x4a0feb=_0x2497ad;return db[_0x6179('0x16')][_0x6179('0x17')]({'where':{'email':_['map'](_0xd30faa[_0x6179('0x18')],'value'),'role':{'$or':[_0x6179('0x19'),_0x6179('0x1a'),_0x6179('0x1b')]}}});})[_0x6179('0x15')](function(_0x2cfd54){_0x5214ea=_0x2cfd54;if(_0x5214ea){if(_0x5214ea['disabled']){return _0x3ef0f7(_0x6179('0x1c'));}else if(_0x4a0feb['blockDuration']>0x0){if(_0x5214ea[_0x6179('0x1d')]){if(moment(_0x5214ea[_0x6179('0x1e')])['add'](_0x4a0feb[_0x6179('0x1f')],_0x6179('0x20'))>moment()){return _0x3ef0f7(_0x6179('0x1c'));}else{return utils['clearBlockUser'](_0x5214ea,0x0,![],null)[_0x6179('0x15')](function(){return utils[_0x6179('0x21')](_0x5214ea);})[_0x6179('0x15')](function(){return _0x3ef0f7(null,_0x5214ea);});}}else{return utils[_0x6179('0x21')](_0x5214ea)[_0x6179('0x15')](function(){return _0x3ef0f7(null,_0x5214ea);});}}else{return utils[_0x6179('0x21')](_0x5214ea)['then'](function(){return _0x3ef0f7(null,_0x5214ea);});}}return _0x3ef0f7(_0x6179('0x1c'));})['catch'](function(_0x220123){_0x3ef0f7(_0x220123);});}));
\ No newline at end of file
+var _0x4ce6=['map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','login','google','profile','callback','authenticate','/login','use','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find'];(function(_0x43f528,_0x3471f2){var _0x309445=function(_0x45b43e){while(--_0x45b43e){_0x43f528['push'](_0x43f528['shift']());}};_0x309445(++_0x3471f2);}(_0x4ce6,0x1be));var _0x64ce=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x4ce6[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var passport=require(_0x64ce('0x0'));var GoogleStrategy=require(_0x64ce('0x1'))['Strategy'];var moment=require(_0x64ce('0x2'));var db=require(_0x64ce('0x3'))['db'];var config=require(_0x64ce('0x4'));var signToken=require(_0x64ce('0x5'))['signToken'];var utils=require('../../config/utils');exports[_0x64ce('0x6')]=passport['authenticate'](_0x64ce('0x7'),{'failureRedirect':'/login','scope':[_0x64ce('0x8'),'email'],'session':![]});exports[_0x64ce('0x9')]=passport[_0x64ce('0xa')]('google',{'failureRedirect':_0x64ce('0xb'),'session':![]});passport[_0x64ce('0xc')](new GoogleStrategy({'clientID':config[_0x64ce('0x7')]?config['google'][_0x64ce('0xd')]:'id','clientSecret':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['clientSecret']:_0x64ce('0xe'),'callbackURL':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['callbackURL']:''},function(_0x417db7,_0x28fc6c,_0x1ce40c,_0x319a58){var _0xbcd998,_0x35bbca;return db[_0x64ce('0xf')][_0x64ce('0x10')]({'where':{'id':0x1},'attributes':[_0x64ce('0x11'),_0x64ce('0x12')],'raw':!![]})[_0x64ce('0x13')](function(_0x334cdb){_0xbcd998=_0x334cdb;return db[_0x64ce('0x14')][_0x64ce('0x15')]({'where':{'email':_[_0x64ce('0x16')](_0x1ce40c[_0x64ce('0x17')],'value'),'role':{'$or':[_0x64ce('0x18'),_0x64ce('0x19'),_0x64ce('0x1a')]}}});})['then'](function(_0x59e85d){_0x35bbca=_0x59e85d;if(_0x35bbca){if(_0x35bbca[_0x64ce('0x1b')]){return _0x319a58(_0x64ce('0x1c'));}else if(_0xbcd998['blockDuration']>0x0){if(_0x35bbca[_0x64ce('0x1d')]){if(moment(_0x35bbca[_0x64ce('0x1e')])[_0x64ce('0x1f')](_0xbcd998[_0x64ce('0x12')],_0x64ce('0x20'))>moment()){return _0x319a58(_0x64ce('0x1c'));}else{return utils[_0x64ce('0x21')](_0x35bbca,0x0,![],null)[_0x64ce('0x13')](function(){return utils[_0x64ce('0x22')](_0x35bbca);})[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils[_0x64ce('0x22')](_0x35bbca)[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils['getLicense'](_0x35bbca)['then'](function(){return _0x319a58(null,_0x35bbca);});}}return _0x319a58(_0x64ce('0x1c'));})[_0x64ce('0x23')](function(_0x501990){_0x319a58(_0x501990);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index beb758d..b2de5fb 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 _0x3f1f=['isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x3f1f,0x1e6));var _0xf3f1=function(_0x59000f,_0x375711){_0x59000f=_0x59000f-0x0;var _0x32da60=_0x3f1f[_0x59000f];return _0x32da60;};'use strict';var express=require('express');var passport=require(_0xf3f1('0x0'));var router=express[_0xf3f1('0x1')]();var controller=require(_0xf3f1('0x2'));var userController=require(_0xf3f1('0x3'));var authService=require(_0xf3f1('0x4'));router['get']('/',controller[_0xf3f1('0x5')]);router[_0xf3f1('0x6')](_0xf3f1('0x7'),controller[_0xf3f1('0x8')],authService[_0xf3f1('0x9')],userController['login'],authService[_0xf3f1('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x7604=['express','passport','Router','./authGoogle.controller','get','login','callback','isMiddleware','setTokenCookie','exports'];(function(_0x39a1cf,_0x42875c){var _0x58a94f=function(_0x16f4b6){while(--_0x16f4b6){_0x39a1cf['push'](_0x39a1cf['shift']());}};_0x58a94f(++_0x42875c);}(_0x7604,0xd2));var _0x4760=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7604[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x4760('0x0'));var passport=require(_0x4760('0x1'));var router=express[_0x4760('0x2')]();var controller=require(_0x4760('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4760('0x4')]('/',controller[_0x4760('0x5')]);router[_0x4760('0x4')]('/callback',controller[_0x4760('0x6')],authService[_0x4760('0x7')],userController['login'],authService[_0x4760('0x8')]);module[_0x4760('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e7781b1..7c27d3b 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 _0x9e2f=['local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','User','params','securePassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login'];(function(_0x48fc4e,_0x15e483){var _0x3569cc=function(_0x3eebc0){while(--_0x3eebc0){_0x48fc4e['push'](_0x48fc4e['shift']());}};_0x3569cc(++_0x15e483);}(_0x9e2f,0xc0));var _0xf9e2=function(_0x587c97,_0x27c3a2){_0x587c97=_0x587c97-0x0;var _0x4ad638=_0x9e2f[_0x587c97];return _0x4ad638;};'use strict';var util=require(_0xf9e2('0x0'));var passport=require(_0xf9e2('0x1'));var LocalStrategy=require('passport-local')[_0xf9e2('0x2')];var jayson=require(_0xf9e2('0x3'));var _=require(_0xf9e2('0x4'));var rs=require(_0xf9e2('0x5'));var moment=require(_0xf9e2('0x6'));var db=require(_0xf9e2('0x7'))['db'];var authService=require(_0xf9e2('0x8'));var utils=require(_0xf9e2('0x9'));var client=jayson[_0xf9e2('0xa')][_0xf9e2('0xb')]({'port':0x232b});function localAuthenticate(_0x2daba9,_0x1e0537,_0x13fac3,_0x23fa61){var _0x379f38,_0x1817ae;return db[_0xf9e2('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0xf9e2('0xd'),_0xf9e2('0xe')],'raw':!![]})['then'](function(_0x376d42){_0x379f38=_0x376d42;return _0x2daba9[_0xf9e2('0xf')]({'attributes':['id',_0xf9e2('0x10'),_0xf9e2('0x11'),_0xf9e2('0x12'),_0xf9e2('0x13'),_0xf9e2('0x14'),_0xf9e2('0x15'),_0xf9e2('0x16'),_0xf9e2('0x17')],'where':{'name':_0x1e0537,'role':{'$or':[_0xf9e2('0x18'),_0xf9e2('0x19'),'agent']}}});})[_0xf9e2('0x1a')](function(_0xb7eeca){if(!_0xb7eeca||_0xb7eeca&&_0xb7eeca['name']!==_0x1e0537){throw new Error(_0xf9e2('0x1b'));}else{_0x1817ae=_0xb7eeca;return _0x1817ae;}})[_0xf9e2('0x1a')](function(){_0x1817ae[_0xf9e2('0x1c')](_0x13fac3,function(_0x66d5d0,_0x3a5e6b){var _0x340d9a=_0x1817ae['loginAttempts']+0x1;if(_0x66d5d0){return _0x23fa61(_0x66d5d0);}else if(!_0x3a5e6b){if(_0x1817ae['disabled']){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}else if(_0x379f38[_0xf9e2('0xd')]>0x0){if(_0x1817ae[_0xf9e2('0x15')]){if(_0x379f38['blockDuration']>0x0){if(moment(_0x1817ae[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0x379f38['blockDuration'],_0xf9e2('0x1e'))>moment()){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}else{return utils[_0xf9e2('0x1f')](_0x1817ae,_0x340d9a,![],null)['then'](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}}else{return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}}else{if(_0x340d9a>=_0x379f38[_0xf9e2('0xd')]){return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,!![],moment())[_0xf9e2('0x1a')](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}else{return utils['clearBlockUser'](_0x1817ae,_0x340d9a,![],null)['then'](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}}}else{return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}}else{if(_0x1817ae[_0xf9e2('0x14')]){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x379f38[_0xf9e2('0xd')]>0x0){if(_0x1817ae[_0xf9e2('0x15')]){if(_0x379f38[_0xf9e2('0xe')]>0x0){if(moment(_0x1817ae[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0x379f38[_0xf9e2('0xe')],_0xf9e2('0x1e'))>moment()){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,![],null)[_0xf9e2('0x1a')](function(){return utils[_0xf9e2('0x20')](_0x1817ae);})['then'](function(){return _0x23fa61(null,_0x1817ae);});}}else{return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,![],null)[_0xf9e2('0x1a')](function(){return utils[_0xf9e2('0x20')](_0x1817ae);})[_0xf9e2('0x1a')](function(){return _0x23fa61(null,_0x1817ae);})[_0xf9e2('0x21')](function(_0x2295df){return _0x23fa61(null,![],_0x2295df);});}}else{if(_0x1817ae[_0xf9e2('0x15')]){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1817ae)[_0xf9e2('0x1a')](function(){return _0x23fa61(null,_0x1817ae);});}}}});})[_0xf9e2('0x21')](function(_0x302985){return _0x23fa61(null,![],_0x302985);});}function sendServiceMail(_0x5c72e4){return db[_0xf9e2('0x22')]['find']({'where':{'service':!![]},'attributes':['id',_0xf9e2('0x10'),'email'],'include':[{'model':db[_0xf9e2('0x23')],'as':_0xf9e2('0x24')}]})['then'](function(_0x97cb98){if(!_0x97cb98){throw new Error(_0xf9e2('0x25'));}var _0x2adc79={'tls':{'rejectUnauthorized':![]}};if(_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x26')]){_0x2adc79[_0xf9e2('0x26')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x26')];}else{_0x2adc79['host']=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x27')];_0x2adc79[_0xf9e2('0x28')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x28')];_0x2adc79[_0xf9e2('0x29')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x29')];}if(_0x97cb98['Smtp'][_0xf9e2('0x2a')]){_0x2adc79[_0xf9e2('0x2b')]={'user':_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x19')],'pass':_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x2c')]};}var _0x336670={'account':_0x2adc79,'message':_['merge']({'from':util[_0xf9e2('0x2d')](_0xf9e2('0x2e'),_0x97cb98[_0xf9e2('0x10')],_0x97cb98[_0xf9e2('0x2f')]||_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x19')])},_0x5c72e4)};return client[_0xf9e2('0x30')](_0xf9e2('0x31'),_0x336670);})[_0xf9e2('0x1a')](function(_0x3f9489){if(_0x3f9489[_0xf9e2('0x32')]){throw new Error(util[_0xf9e2('0x2d')](_0xf9e2('0x33'),_0x3f9489['error'][_0xf9e2('0x34')]||JSON[_0xf9e2('0x35')](_0x3f9489[_0xf9e2('0x32')])));}return!![];});}function handleError(_0x2198fa,_0x5cc420,_0x4820f7){return _0x2198fa[_0xf9e2('0x36')](_0x5cc420||0x1f4)[_0xf9e2('0x37')]({'message':_0x4820f7?_0x4820f7[_0xf9e2('0x34')]||_0x4820f7:''});}exports[_0xf9e2('0x38')]=function(_0x45569e,_0x5843b7,_0x3e042f){passport['authenticate'](_0xf9e2('0x39'),function(_0x1e3cb5,_0xcd05b3,_0x2c07ae){var _0x291f34=_0x1e3cb5||_0x2c07ae;if(_0x291f34){return handleError(_0x5843b7,0x191,_0x291f34);}if(!_0xcd05b3){return handleError(_0x5843b7,0x194,{'message':_0xf9e2('0x3a')});}else{var _0x2e1d31={'payload':{'id':_0xcd05b3['id'],'role':_0xcd05b3[_0xf9e2('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xf9e2('0x3b')](_0x2e1d31)['then'](function(_0x2154c0){_0x5843b7[_0xf9e2('0x3c')]({'id':_0xcd05b3['id'],'token':_0x2154c0,'statusCall':'','isAlreadyLogged':_0xcd05b3['online']});});}})(_0x45569e,_0x5843b7,_0x3e042f);};exports[_0xf9e2('0x3d')]=function(_0x27c662,_0x645453,_0x55fc08){if(!_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')]){return handleError(_0x645453,0x1f4,{'message':_0xf9e2('0x3f')});}var _0x4d98f0=rs[_0xf9e2('0x40')]();_0x27c662['body'][_0xf9e2('0x2f')]=_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')][_0xf9e2('0x41')]()['toLowerCase']();var _0xe11f8d;return db[_0xf9e2('0xc')][_0xf9e2('0xf')]({'where':{'id':0x1},'attributes':[_0xf9e2('0xd'),_0xf9e2('0xe')],'raw':!![]})['then'](function(_0x188e1b){_0xe11f8d=_0x188e1b;return db['User'][_0xf9e2('0x42')]({'where':{'email':_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')]}});})[_0xf9e2('0x1a')](function(_0x2eecd0){if(!_0x2eecd0){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2eecd0[_0xf9e2('0x14')]){throw new Error(_0xf9e2('0x43'));}if(_0x2eecd0[_0xf9e2('0x15')]){if(moment(_0x2eecd0[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0xe11f8d['blockDuration'],_0xf9e2('0x1e'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2eecd0[_0xf9e2('0x15')]=![];_0x2eecd0['blockedAt']=null;}}_0x2eecd0[_0xf9e2('0x44')]=_0x4d98f0;_0x2eecd0['resetPasswordExpires']=Date[_0xf9e2('0x45')]()+0x36ee80;return _0x2eecd0[_0xf9e2('0x46')]();})[_0xf9e2('0x1a')](function(){return sendServiceMail({'to':_0x27c662['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf9e2('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf9e2('0x48')+_0x27c662['headers'][_0xf9e2('0x27')]+_0xf9e2('0x49')+_0x4d98f0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xf9e2('0x1a')](function(){_0x645453[_0xf9e2('0x36')](0xc8)[_0xf9e2('0x37')]({'message':_0xf9e2('0x4a')});})[_0xf9e2('0x21')](function(_0x463a15){return handleError(_0x645453,0x1f4,_0x463a15);});};exports[_0xf9e2('0x4b')]=function(_0x448d61,_0x2ca5e3,_0x30e1bb){return db[_0xf9e2('0x4c')][_0xf9e2('0x42')]({'where':{'resetPasswordToken':_0x448d61[_0xf9e2('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xf9e2('0x45')]()}}})['then'](function(_0x58a4ba){if(!_0x58a4ba){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0xf9e2('0x4e'),'enforcePasswordHistory',_0xf9e2('0x4f')]})[_0xf9e2('0x1a')](function(_0x11c76b){if(_0x11c76b[_0xf9e2('0x4e')])authService['validatePasswordPattern'](_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')]);if(!_0x11c76b['enforcePasswordHistory']||!_0x58a4ba[_0xf9e2('0x50')])return _0x58a4ba;authService[_0xf9e2('0x51')](_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')],_0x58a4ba[_0xf9e2('0x50')],_0x11c76b[_0xf9e2('0x4f')]);return _0x58a4ba;})[_0xf9e2('0x1a')](function(){_0x58a4ba[_0xf9e2('0x11')]=_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')];_0x58a4ba[_0xf9e2('0x44')]=null;_0x58a4ba['resetPasswordExpires']=null;return _0x58a4ba['save']();});})['then'](function(){_0x2ca5e3['status'](0xc8)[_0xf9e2('0x37')]({'message':_0xf9e2('0x52')});})[_0xf9e2('0x21')](function(_0x3eb335){return handleError(_0x2ca5e3,0x1f4,_0x3eb335);});};passport['use'](new LocalStrategy({'usernameField':_0xf9e2('0x10'),'passwordField':_0xf9e2('0x11')},function(_0x2cc132,_0x4ec965,_0x31328d){return localAuthenticate(db[_0xf9e2('0x4c')],_0x2cc132,_0x4ec965,_0x31328d);}));
\ No newline at end of file
+var _0xcd53=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','add','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','error','stringify','status','send','message','authenticate','local','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts'];(function(_0xc97b2e,_0x146ff1){var _0x17f120=function(_0x8638d){while(--_0x8638d){_0xc97b2e['push'](_0xc97b2e['shift']());}};_0x17f120(++_0x146ff1);}(_0xcd53,0x8e));var _0x3cd5=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xcd53[_0x3d5f84];return _0x1981b8;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x3cd5('0x0'))[_0x3cd5('0x1')];var jayson=require(_0x3cd5('0x2'));var _=require(_0x3cd5('0x3'));var rs=require('randomstring');var moment=require(_0x3cd5('0x4'));var db=require(_0x3cd5('0x5'))['db'];var authService=require(_0x3cd5('0x6'));var utils=require(_0x3cd5('0x7'));var client=jayson[_0x3cd5('0x8')][_0x3cd5('0x9')]({'port':0x232b});function localAuthenticate(_0x530022,_0xd2196f,_0x1b9ecd,_0x426cd0){var _0x46f29e,_0xbd200a;return db[_0x3cd5('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3cd5('0xb')](function(_0x4e544c){_0x46f29e=_0x4e544c;return _0x530022['findOne']({'attributes':['id',_0x3cd5('0xc'),_0x3cd5('0xd'),_0x3cd5('0xe'),_0x3cd5('0xf'),_0x3cd5('0x10'),_0x3cd5('0x11'),_0x3cd5('0x12'),_0x3cd5('0x13')],'where':{'name':_0xd2196f,'role':{'$or':[_0x3cd5('0x14'),_0x3cd5('0x15'),_0x3cd5('0x16')]}}});})[_0x3cd5('0xb')](function(_0x5bd98a){if(!_0x5bd98a||_0x5bd98a&&_0x5bd98a[_0x3cd5('0xc')]!==_0xd2196f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xbd200a=_0x5bd98a;return _0xbd200a;}})[_0x3cd5('0xb')](function(){_0xbd200a['authenticate'](_0x1b9ecd,function(_0x3cf624,_0x3def28){var _0x631939=_0xbd200a['loginAttempts']+0x1;if(_0x3cf624){return _0x426cd0(_0x3cf624);}else if(!_0x3def28){if(_0xbd200a['disabled']){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])['add'](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{if(_0x631939>=_0x46f29e[_0x3cd5('0x18')]){return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,!![],moment())['then'](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}}}else{return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xbd200a[_0x3cd5('0x10')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])[_0x3cd5('0x1c')](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})['then'](function(){return _0x426cd0(null,_0xbd200a);})[_0x3cd5('0x1d')](function(_0x43ef9e){return _0x426cd0(null,![],_0x43ef9e);});}}else{if(_0xbd200a[_0x3cd5('0x11')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1e')](_0xbd200a)[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}}});})[_0x3cd5('0x1d')](function(_0x1ffc98){return _0x426cd0(null,![],_0x1ffc98);});}function sendServiceMail(_0x27219f){return db[_0x3cd5('0x1f')][_0x3cd5('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x3cd5('0x21')],'include':[{'model':db[_0x3cd5('0x22')],'as':_0x3cd5('0x23')}]})[_0x3cd5('0xb')](function(_0x3549d0){if(!_0x3549d0){throw new Error(_0x3cd5('0x24'));}var _0x55274f={'tls':{'rejectUnauthorized':![]}};if(_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x25')]){_0x55274f[_0x3cd5('0x25')]=_0x3549d0['Smtp']['service'];}else{_0x55274f['host']=_0x3549d0['Smtp'][_0x3cd5('0x26')];_0x55274f[_0x3cd5('0x27')]=_0x3549d0[_0x3cd5('0x23')]['port'];_0x55274f[_0x3cd5('0x28')]=_0x3549d0['Smtp'][_0x3cd5('0x28')];}if(_0x3549d0['Smtp'][_0x3cd5('0x29')]){_0x55274f[_0x3cd5('0x2a')]={'user':_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')],'pass':_0x3549d0[_0x3cd5('0x23')]['pass']};}var _0xb2538e={'account':_0x55274f,'message':_[_0x3cd5('0x2b')]({'from':util[_0x3cd5('0x2c')](_0x3cd5('0x2d'),_0x3549d0[_0x3cd5('0xc')],_0x3549d0[_0x3cd5('0x21')]||_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')])},_0x27219f)};return client['request']('SendMail',_0xb2538e);})[_0x3cd5('0xb')](function(_0x30d7d7){if(_0x30d7d7[_0x3cd5('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x30d7d7[_0x3cd5('0x2e')]['message']||JSON[_0x3cd5('0x2f')](_0x30d7d7[_0x3cd5('0x2e')])));}return!![];});}function handleError(_0x4666ab,_0x349667,_0x52cb64){return _0x4666ab[_0x3cd5('0x30')](_0x349667||0x1f4)[_0x3cd5('0x31')]({'message':_0x52cb64?_0x52cb64[_0x3cd5('0x32')]||_0x52cb64:''});}exports['login']=function(_0x12ff87,_0x4b3f55,_0x54658f){passport[_0x3cd5('0x33')](_0x3cd5('0x34'),function(_0x43bf03,_0x176bd3,_0x10cea3){var _0x1b16aa=_0x43bf03||_0x10cea3;if(_0x1b16aa){return handleError(_0x4b3f55,0x191,_0x1b16aa);}if(!_0x176bd3){return handleError(_0x4b3f55,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f390c={'payload':{'id':_0x176bd3['id'],'role':_0x176bd3[_0x3cd5('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x3cd5('0x35')](_0x3f390c)[_0x3cd5('0xb')](function(_0x191713){_0x4b3f55[_0x3cd5('0x36')]({'id':_0x176bd3['id'],'token':_0x191713,'statusCall':'','isAlreadyLogged':_0x176bd3['online']});});}})(_0x12ff87,_0x4b3f55,_0x54658f);};exports['forgot']=function(_0x6cbc1a,_0x4cd753,_0x586c09){if(!_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]){return handleError(_0x4cd753,0x1f4,{'message':_0x3cd5('0x38')});}var _0x389094=rs[_0x3cd5('0x39')]();_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]=_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]['trim']()['toLowerCase']();var _0x5ea2fe;return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'where':{'id':0x1},'attributes':[_0x3cd5('0x18'),_0x3cd5('0x19')],'raw':!![]})[_0x3cd5('0xb')](function(_0x537a6f){_0x5ea2fe=_0x537a6f;return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'email':_0x6cbc1a[_0x3cd5('0x37')]['email']}});})[_0x3cd5('0xb')](function(_0x5db986){if(!_0x5db986){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5db986['disabled']){throw new Error(_0x3cd5('0x3c'));}if(_0x5db986[_0x3cd5('0x11')]){if(moment(_0x5db986[_0x3cd5('0x12')])['add'](_0x5ea2fe[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){throw new Error(_0x3cd5('0x3d'));}else{_0x5db986[_0x3cd5('0x11')]=![];_0x5db986[_0x3cd5('0x12')]=null;}}_0x5db986[_0x3cd5('0x3e')]=_0x389094;_0x5db986['resetPasswordExpires']=Date[_0x3cd5('0x3f')]()+0x36ee80;return _0x5db986[_0x3cd5('0x40')]();})[_0x3cd5('0xb')](function(){return sendServiceMail({'to':_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')],'subject':_0x3cd5('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3cd5('0x42')+'https://'+_0x6cbc1a['headers'][_0x3cd5('0x26')]+_0x3cd5('0x43')+_0x389094+'\x0a\x0a'+_0x3cd5('0x44')});})['then'](function(){_0x4cd753[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x45')});})['catch'](function(_0x2ff758){return handleError(_0x4cd753,0x1f4,_0x2ff758);});};exports['reset']=function(_0x136e4f,_0xd13c15,_0x4d8d23){return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'resetPasswordToken':_0x136e4f[_0x3cd5('0x46')][_0x3cd5('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3cd5('0xb')](function(_0xeba605){if(!_0xeba605){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'attributes':['id',_0x3cd5('0x48'),_0x3cd5('0x49'),_0x3cd5('0x4a')]})['then'](function(_0x290c3f){if(_0x290c3f['securePassword'])authService[_0x3cd5('0x4b')](_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')]);if(!_0x290c3f[_0x3cd5('0x49')]||!_0xeba605[_0x3cd5('0x4c')])return _0xeba605;authService[_0x3cd5('0x4d')](_0x136e4f[_0x3cd5('0x37')]['password'],_0xeba605[_0x3cd5('0x4c')],_0x290c3f[_0x3cd5('0x4a')]);return _0xeba605;})[_0x3cd5('0xb')](function(){_0xeba605[_0x3cd5('0xd')]=_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')];_0xeba605['resetPasswordToken']=null;_0xeba605[_0x3cd5('0x4e')]=null;return _0xeba605[_0x3cd5('0x40')]();});})['then'](function(){_0xd13c15[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x4f')});})[_0x3cd5('0x1d')](function(_0x5323a0){return handleError(_0xd13c15,0x1f4,_0x5323a0);});};passport[_0x3cd5('0x50')](new LocalStrategy({'usernameField':_0x3cd5('0xc'),'passwordField':_0x3cd5('0xd')},function(_0x593f81,_0x218226,_0x4e2dab){return localAuthenticate(db[_0x3cd5('0x3b')],_0x593f81,_0x218226,_0x4e2dab);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c00faab..de3f997 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 _0xe244=['forgot','/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0xe244,0xf3));var _0x4e24=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe244[_0x3b380d];return _0x54502b;};'use strict';var express=require('express');var router=express[_0x4e24('0x0')]();var controller=require(_0x4e24('0x1'));router[_0x4e24('0x2')]('/',controller[_0x4e24('0x3')]);router[_0x4e24('0x2')](_0x4e24('0x4'),controller[_0x4e24('0x5')]);router[_0x4e24('0x2')](_0x4e24('0x6'),controller[_0x4e24('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x7e3f=['post','login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x17770f,_0x1cc11b){var _0x4dba75=function(_0x4aa697){while(--_0x4aa697){_0x17770f['push'](_0x17770f['shift']());}};_0x4dba75(++_0x1cc11b);}(_0x7e3f,0x96));var _0xf7e3=function(_0x29bfdc,_0x45b3ba){_0x29bfdc=_0x29bfdc-0x0;var _0x30eb0d=_0x7e3f[_0x29bfdc];return _0x30eb0d;};'use strict';var express=require(_0xf7e3('0x0'));var router=express[_0xf7e3('0x1')]();var controller=require(_0xf7e3('0x2'));router[_0xf7e3('0x3')]('/',controller[_0xf7e3('0x4')]);router[_0xf7e3('0x3')]('/forgot',controller[_0xf7e3('0x5')]);router['post'](_0xf7e3('0x6'),controller[_0xf7e3('0x7')]);module[_0xf7e3('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 fc7c927..a4729db 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 _0x5e3d=['sequelize','exports','STRING','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5e3d,0xd0));var _0xd5e3=function(_0x3b8447,_0x5ba7cd){_0x3b8447=_0x3b8447-0x0;var _0x114837=_0x5e3d[_0x3b8447];return _0x114837;};'use strict';var Sequelize=require(_0xd5e3('0x0'));module[_0xd5e3('0x1')]={'name':{'type':Sequelize[_0xd5e3('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd5e3('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd5e3('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5e5d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2736e4,_0x538134){var _0x46dfc9=function(_0x2f87aa){while(--_0x2f87aa){_0x2736e4['push'](_0x2736e4['shift']());}};_0x46dfc9(++_0x538134);}(_0x5e5d,0x1e0));var _0xd5e5=function(_0x3a3489,_0x39e658){_0x3a3489=_0x3a3489-0x0;var _0x17509f=_0x5e5d[_0x3a3489];return _0x17509f;};'use strict';var Sequelize=require(_0xd5e5('0x0'));module[_0xd5e5('0x1')]={'name':{'type':Sequelize[_0xd5e5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd5e5('0x2')]},'description':{'type':Sequelize[_0xd5e5('0x2')]},'status':{'type':Sequelize[_0xd5e5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 3dc1c73..cbbc532 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 _0x368b=['lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','find','addConditions','omit','ids','findOne','Condition','length','order','pick','filter','getConditions','nolimit','addActions','getActions','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x368b,0x13e));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb368('0x1'));var jsonpatch=require(_0xb368('0x2'));var rp=require(_0xb368('0x3'));var moment=require(_0xb368('0x4'));var BPromise=require(_0xb368('0x5'));var Mustache=require('mustache');var util=require(_0xb368('0x6'));var path=require(_0xb368('0x7'));var sox=require('sox');var csv=require(_0xb368('0x8'));var ejs=require(_0xb368('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb368('0xa'));var squel=require('squel');var crypto=require(_0xb368('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb368('0x8'));var querystring=require('querystring');var Papa=require(_0xb368('0xc'));var Redis=require(_0xb368('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb368('0xe'));var as=require(_0xb368('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb368('0x10'))(_0xb368('0x11'));var utils=require(_0xb368('0x12'));var config=require(_0xb368('0x13'));var licenseUtil=require(_0xb368('0x14'));var db=require(_0xb368('0x15'))['db'];function respondWithStatusCode(_0x271fa3,_0x52d8ab){_0x52d8ab=_0x52d8ab||0xcc;return function(_0x966930){if(_0x966930){return _0x271fa3[_0xb368('0x16')](_0x52d8ab);}return _0x271fa3[_0xb368('0x17')](_0x52d8ab)[_0xb368('0x18')]();};}function respondWithResult(_0x39c292,_0x230c4e){_0x230c4e=_0x230c4e||0xc8;return function(_0x5f1cd7){if(_0x5f1cd7){return _0x39c292[_0xb368('0x17')](_0x230c4e)[_0xb368('0x19')](_0x5f1cd7);}};}function respondWithFilteredResult(_0x2de173,_0x3e49a3){return function(_0x2f5b6b){if(_0x2f5b6b){var _0x3f64b0=typeof _0x3e49a3['offset']===_0xb368('0x1a')&&typeof _0x3e49a3[_0xb368('0x1b')]===_0xb368('0x1a');var _0x5c6aad=_0x2f5b6b[_0xb368('0x1c')];var _0x42167c=_0x3f64b0?0x0:_0x3e49a3[_0xb368('0x1d')];var _0x5439b3=_0x3f64b0?_0x2f5b6b[_0xb368('0x1c')]:_0x3e49a3[_0xb368('0x1d')]+_0x3e49a3[_0xb368('0x1b')];var _0x482c96;if(_0x5439b3>=_0x5c6aad){_0x5439b3=_0x5c6aad;_0x482c96=0xc8;}else{_0x482c96=0xce;}_0x2de173['status'](_0x482c96);return _0x2de173[_0xb368('0x1e')]('Content-Range',_0x42167c+'-'+_0x5439b3+'/'+_0x5c6aad)[_0xb368('0x19')](_0x2f5b6b);}return null;};}function patchUpdates(_0x478512){return function(_0x1b2471){try{jsonpatch['apply'](_0x1b2471,_0x478512,!![]);}catch(_0x30bfa4){return BPromise['reject'](_0x30bfa4);}return _0x1b2471[_0xb368('0x1f')]();};}function saveUpdates(_0x13baca,_0x1e8f60){return function(_0x40b775){if(_0x40b775){return _0x40b775[_0xb368('0x20')](_0x13baca)[_0xb368('0x21')](function(_0x1f0a98){return _0x1f0a98;});}return null;};}function removeEntity(_0x33e9ea,_0x2c3649){return function(_0x363c0b){if(_0x363c0b){return _0x363c0b[_0xb368('0x22')]()[_0xb368('0x21')](function(){_0x33e9ea[_0xb368('0x17')](0xcc)[_0xb368('0x18')]();});}};}function handleEntityNotFound(_0x455999,_0x5548ba){return function(_0x846f44){if(!_0x846f44){_0x455999[_0xb368('0x16')](0x194);}return _0x846f44;};}function handleError(_0x241bc1,_0x58eeca){_0x58eeca=_0x58eeca||0x1f4;return function(_0x5a547b){logger[_0xb368('0x23')](_0x5a547b[_0xb368('0x24')]);if(_0x5a547b['name']){delete _0x5a547b[_0xb368('0x25')];}_0x241bc1[_0xb368('0x17')](_0x58eeca)[_0xb368('0x26')](_0x5a547b);};}exports[_0xb368('0x27')]=function(_0x483b4b,_0x41d847){var _0x1f3784={},_0x23cf43={},_0x18b3a6={'count':0x0,'rows':[]};var _0x5796f5=_[_0xb368('0x28')](db[_0xb368('0x29')][_0xb368('0x2a')],function(_0x499e35){return{'name':_0x499e35[_0xb368('0x2b')],'type':_0x499e35[_0xb368('0x2c')][_0xb368('0x2d')]};});_0x23cf43[_0xb368('0x2e')]=_['map'](_0x5796f5,_0xb368('0x25'));_0x23cf43[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x483b4b[_0xb368('0x2f')]);_0x23cf43['filters']=_['intersection'](_0x23cf43[_0xb368('0x2e')],_0x23cf43[_0xb368('0x2f')]);_0x1f3784[_0xb368('0x31')]=_[_0xb368('0x32')](_0x23cf43[_0xb368('0x2e')],qs[_0xb368('0x33')](_0x483b4b['query']['fields']));_0x1f3784[_0xb368('0x31')]=_0x1f3784['attributes']['length']?_0x1f3784[_0xb368('0x31')]:_0x23cf43[_0xb368('0x2e')];if(!_0x483b4b[_0xb368('0x2f')][_0xb368('0x34')]('nolimit')){_0x1f3784[_0xb368('0x1b')]=qs['limit'](_0x483b4b['query']['limit']);_0x1f3784[_0xb368('0x1d')]=qs['offset'](_0x483b4b['query'][_0xb368('0x1d')]);}_0x1f3784['order']=qs[_0xb368('0x35')](_0x483b4b[_0xb368('0x2f')][_0xb368('0x35')]);_0x1f3784[_0xb368('0x36')]=qs[_0xb368('0x37')](_['pick'](_0x483b4b[_0xb368('0x2f')],_0x23cf43[_0xb368('0x37')]),_0x5796f5);if(_0x483b4b[_0xb368('0x2f')]['filter']){_0x1f3784[_0xb368('0x36')]=_[_0xb368('0x38')](_0x1f3784[_0xb368('0x36')],{'$or':_['map'](_0x5796f5,function(_0xd7f605){if(_0xd7f605['type']!==_0xb368('0x39')){var _0x3ef515={};_0x3ef515[_0xd7f605['name']]={'$like':'%'+_0x483b4b['query']['filter']+'%'};return _0x3ef515;}})});}_0x1f3784=_[_0xb368('0x38')]({},_0x1f3784,_0x483b4b['options']);var _0x22aa13={'where':_0x1f3784[_0xb368('0x36')]};return db[_0xb368('0x29')][_0xb368('0x1c')](_0x22aa13)['then'](function(_0x41ca55){_0x18b3a6[_0xb368('0x1c')]=_0x41ca55;if(_0x483b4b[_0xb368('0x2f')][_0xb368('0x3a')]){_0x1f3784[_0xb368('0x3b')]=[{'all':!![]}];}return db[_0xb368('0x29')][_0xb368('0x3c')](_0x1f3784);})[_0xb368('0x21')](function(_0x4779dc){_0x18b3a6[_0xb368('0x3d')]=_0x4779dc;return _0x18b3a6;})[_0xb368('0x21')](respondWithFilteredResult(_0x41d847,_0x1f3784))[_0xb368('0x3e')](handleError(_0x41d847,null));};exports['show']=function(_0x3e2c5a,_0x44702d){var _0x4c83df={'raw':![],'where':{'id':_0x3e2c5a[_0xb368('0x3f')]['id']}},_0x41c42a={};_0x41c42a['model']=_[_0xb368('0x30')](db[_0xb368('0x29')]['rawAttributes']);_0x41c42a[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x3e2c5a[_0xb368('0x2f')]);_0x41c42a[_0xb368('0x37')]=_[_0xb368('0x32')](_0x41c42a[_0xb368('0x2e')],_0x41c42a['query']);_0x4c83df[_0xb368('0x31')]=_[_0xb368('0x32')](_0x41c42a[_0xb368('0x2e')],qs[_0xb368('0x33')](_0x3e2c5a['query'][_0xb368('0x33')]));_0x4c83df[_0xb368('0x31')]=_0x4c83df[_0xb368('0x31')]['length']?_0x4c83df[_0xb368('0x31')]:_0x41c42a['model'];if(_0x3e2c5a['query'][_0xb368('0x3a')]){_0x4c83df[_0xb368('0x3b')]=[{'all':!![]}];}_0x4c83df=_['merge']({},_0x4c83df,_0x3e2c5a[_0xb368('0x40')]);return db[_0xb368('0x29')]['find'](_0x4c83df)[_0xb368('0x21')](handleEntityNotFound(_0x44702d,null))[_0xb368('0x21')](respondWithResult(_0x44702d,null))[_0xb368('0x3e')](handleError(_0x44702d,null));};exports[_0xb368('0x41')]=function(_0x58486c,_0x337edd){return db['Automation'][_0xb368('0x41')](_0x58486c[_0xb368('0x42')],{})['then'](respondWithResult(_0x337edd,0xc9))[_0xb368('0x3e')](handleError(_0x337edd,null));};exports[_0xb368('0x20')]=function(_0x4d22bc,_0x36395e){if(_0x4d22bc[_0xb368('0x42')]['id']){delete _0x4d22bc[_0xb368('0x42')]['id'];}return db[_0xb368('0x29')][_0xb368('0x43')]({'where':{'id':_0x4d22bc[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36395e,null))[_0xb368('0x21')](saveUpdates(_0x4d22bc[_0xb368('0x42')],null))[_0xb368('0x21')](respondWithResult(_0x36395e,null))[_0xb368('0x3e')](handleError(_0x36395e,null));};exports[_0xb368('0x22')]=function(_0xf181e9,_0x497890){return db[_0xb368('0x29')]['find']({'where':{'id':_0xf181e9[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x497890,null))['then'](removeEntity(_0x497890,null))[_0xb368('0x3e')](handleError(_0x497890,null));};exports[_0xb368('0x44')]=function(_0x59c15d,_0x3fb5bc,_0x31cfd6){return db['Condition'][_0xb368('0x43')]({'where':{'id':_0x59c15d[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x3fb5bc,null))[_0xb368('0x21')](function(_0x278c9b){if(_0x278c9b){return _0x278c9b[_0xb368('0x44')](_0x59c15d[_0xb368('0x42')]['ids'],_[_0xb368('0x45')](_0x59c15d[_0xb368('0x42')],[_0xb368('0x46'),'id'])||{});}})[_0xb368('0x21')](respondWithResult(_0x3fb5bc,null))[_0xb368('0x3e')](handleError(_0x3fb5bc,null));};exports['getConditions']=function(_0x39c005,_0x448a07,_0x3d6f83){var _0x2df1a9={};var _0x303af7={};var _0x3d64fc;var _0x1965bc;return db[_0xb368('0x29')][_0xb368('0x47')]({'where':{'id':_0x39c005[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x448a07,null))['then'](function(_0x4145b6){if(_0x4145b6){_0x3d64fc=_0x4145b6;_0x303af7[_0xb368('0x2e')]=_[_0xb368('0x30')](db[_0xb368('0x48')][_0xb368('0x2a')]);_0x303af7[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x39c005[_0xb368('0x2f')]);_0x303af7[_0xb368('0x37')]=_[_0xb368('0x32')](_0x303af7['model'],_0x303af7[_0xb368('0x2f')]);_0x2df1a9[_0xb368('0x31')]=_['intersection'](_0x303af7['model'],qs[_0xb368('0x33')](_0x39c005[_0xb368('0x2f')][_0xb368('0x33')]));_0x2df1a9[_0xb368('0x31')]=_0x2df1a9[_0xb368('0x31')][_0xb368('0x49')]?_0x2df1a9['attributes']:_0x303af7[_0xb368('0x2e')];_0x2df1a9[_0xb368('0x4a')]=qs[_0xb368('0x35')](_0x39c005['query'][_0xb368('0x35')]);_0x2df1a9[_0xb368('0x36')]=qs[_0xb368('0x37')](_[_0xb368('0x4b')](_0x39c005[_0xb368('0x2f')],_0x303af7[_0xb368('0x37')]));if(_0x39c005[_0xb368('0x2f')][_0xb368('0x4c')]){_0x2df1a9[_0xb368('0x36')]=_[_0xb368('0x38')](_0x2df1a9['where'],{'$or':_[_0xb368('0x28')](_0x2df1a9['attributes'],function(_0x3c7f5b){var _0x560fcd={};_0x560fcd[_0x3c7f5b]={'$like':'%'+_0x39c005[_0xb368('0x2f')]['filter']+'%'};return _0x560fcd;})});}_0x2df1a9=_['merge']({},_0x2df1a9,_0x39c005[_0xb368('0x40')]);return _0x3d64fc[_0xb368('0x4d')](_0x2df1a9);}})['then'](function(_0x1b2ad7){if(_0x1b2ad7){_0x1965bc=_0x1b2ad7[_0xb368('0x49')];if(!_0x39c005[_0xb368('0x2f')][_0xb368('0x34')](_0xb368('0x4e'))){_0x2df1a9[_0xb368('0x1b')]=qs[_0xb368('0x1b')](_0x39c005['query'][_0xb368('0x1b')]);_0x2df1a9[_0xb368('0x1d')]=qs['offset'](_0x39c005[_0xb368('0x2f')][_0xb368('0x1d')]);}return _0x3d64fc[_0xb368('0x4d')](_0x2df1a9);}})['then'](function(_0xf227ef){if(_0xf227ef){return _0xf227ef?{'count':_0x1965bc,'rows':_0xf227ef}:null;}})['then'](respondWithResult(_0x448a07,null))[_0xb368('0x3e')](handleError(_0x448a07,null));};exports[_0xb368('0x4f')]=function(_0xea4030,_0x56322d,_0x173642){return db['Action']['find']({'where':{'id':_0xea4030[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56322d,null))[_0xb368('0x21')](function(_0x2d3116){if(_0x2d3116){return _0x2d3116[_0xb368('0x4f')](_0xea4030[_0xb368('0x42')][_0xb368('0x46')],_['omit'](_0xea4030[_0xb368('0x42')],[_0xb368('0x46'),'id'])||{});}})[_0xb368('0x21')](respondWithResult(_0x56322d,null))[_0xb368('0x3e')](handleError(_0x56322d,null));};exports[_0xb368('0x50')]=function(_0x30d1fb,_0x83f8fd,_0x33f42c){var _0x4657f0={};var _0x193fe5={};var _0x4cca20;var _0x543e2b;return db['Automation'][_0xb368('0x47')]({'where':{'id':_0x30d1fb[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x83f8fd,null))[_0xb368('0x21')](function(_0x186b06){if(_0x186b06){_0x4cca20=_0x186b06;_0x193fe5[_0xb368('0x2e')]=_[_0xb368('0x30')](db[_0xb368('0x51')][_0xb368('0x2a')]);_0x193fe5['query']=_[_0xb368('0x30')](_0x30d1fb['query']);_0x193fe5[_0xb368('0x37')]=_[_0xb368('0x32')](_0x193fe5[_0xb368('0x2e')],_0x193fe5[_0xb368('0x2f')]);_0x4657f0[_0xb368('0x31')]=_[_0xb368('0x32')](_0x193fe5[_0xb368('0x2e')],qs['fields'](_0x30d1fb[_0xb368('0x2f')][_0xb368('0x33')]));_0x4657f0[_0xb368('0x31')]=_0x4657f0['attributes'][_0xb368('0x49')]?_0x4657f0['attributes']:_0x193fe5[_0xb368('0x2e')];_0x4657f0[_0xb368('0x4a')]=qs[_0xb368('0x35')](_0x30d1fb[_0xb368('0x2f')][_0xb368('0x35')]);_0x4657f0[_0xb368('0x36')]=qs[_0xb368('0x37')](_['pick'](_0x30d1fb[_0xb368('0x2f')],_0x193fe5['filters']));if(_0x30d1fb['query'][_0xb368('0x4c')]){_0x4657f0[_0xb368('0x36')]=_[_0xb368('0x38')](_0x4657f0[_0xb368('0x36')],{'$or':_[_0xb368('0x28')](_0x4657f0[_0xb368('0x31')],function(_0x27e1a8){var _0x2d3adf={};_0x2d3adf[_0x27e1a8]={'$like':'%'+_0x30d1fb[_0xb368('0x2f')]['filter']+'%'};return _0x2d3adf;})});}_0x4657f0=_['merge']({},_0x4657f0,_0x30d1fb['options']);return _0x4cca20[_0xb368('0x50')](_0x4657f0);}})[_0xb368('0x21')](function(_0x5a66d5){if(_0x5a66d5){_0x543e2b=_0x5a66d5[_0xb368('0x49')];if(!_0x30d1fb[_0xb368('0x2f')][_0xb368('0x34')](_0xb368('0x4e'))){_0x4657f0[_0xb368('0x1b')]=qs[_0xb368('0x1b')](_0x30d1fb['query'][_0xb368('0x1b')]);_0x4657f0[_0xb368('0x1d')]=qs['offset'](_0x30d1fb[_0xb368('0x2f')]['offset']);}return _0x4cca20[_0xb368('0x50')](_0x4657f0);}})[_0xb368('0x21')](function(_0x5dab9e){if(_0x5dab9e){return _0x5dab9e?{'count':_0x543e2b,'rows':_0x5dab9e}:null;}})['then'](respondWithResult(_0x83f8fd,null))['catch'](handleError(_0x83f8fd,null));};
\ No newline at end of file
+var _0x95d4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','addConditions','Condition','findOne','getConditions','hasOwnProperty','addActions','Action','ids','getActions','eml-format'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x95d4,0x1e5));var _0x495d=function(_0x52dfa5,_0x3908fd){_0x52dfa5=_0x52dfa5-0x0;var _0x1eaf0b=_0x95d4[_0x52dfa5];return _0x1eaf0b;};'use strict';var emlformat=require(_0x495d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x495d('0x1'));var jsonpatch=require(_0x495d('0x2'));var rp=require(_0x495d('0x3'));var moment=require(_0x495d('0x4'));var BPromise=require(_0x495d('0x5'));var Mustache=require(_0x495d('0x6'));var util=require('util');var path=require(_0x495d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x495d('0x8'));var _=require(_0x495d('0x9'));var squel=require(_0x495d('0xa'));var crypto=require(_0x495d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x495d('0xc'));var toCsv=require(_0x495d('0xd'));var querystring=require(_0x495d('0xe'));var Papa=require(_0x495d('0xf'));var Redis=require(_0x495d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x495d('0x11'));var hardwareService=require(_0x495d('0x12'));var logger=require('../../config/logger')(_0x495d('0x13'));var utils=require(_0x495d('0x14'));var config=require(_0x495d('0x15'));var licenseUtil=require(_0x495d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a284d,_0x101459){_0x101459=_0x101459||0xcc;return function(_0x189ac4){if(_0x189ac4){return _0x3a284d['sendStatus'](_0x101459);}return _0x3a284d[_0x495d('0x17')](_0x101459)['end']();};}function respondWithResult(_0x269961,_0x193e0d){_0x193e0d=_0x193e0d||0xc8;return function(_0x5aacb1){if(_0x5aacb1){return _0x269961[_0x495d('0x17')](_0x193e0d)['json'](_0x5aacb1);}};}function respondWithFilteredResult(_0x3f513f,_0x1e81e3){return function(_0x346f84){if(_0x346f84){var _0xdfe913=typeof _0x1e81e3['offset']===_0x495d('0x18')&&typeof _0x1e81e3['limit']==='undefined';var _0xaa335b=_0x346f84[_0x495d('0x19')];var _0x2a524e=_0xdfe913?0x0:_0x1e81e3[_0x495d('0x1a')];var _0x12cd06=_0xdfe913?_0x346f84[_0x495d('0x19')]:_0x1e81e3[_0x495d('0x1a')]+_0x1e81e3['limit'];var _0x4beced;if(_0x12cd06>=_0xaa335b){_0x12cd06=_0xaa335b;_0x4beced=0xc8;}else{_0x4beced=0xce;}_0x3f513f[_0x495d('0x17')](_0x4beced);return _0x3f513f[_0x495d('0x1b')](_0x495d('0x1c'),_0x2a524e+'-'+_0x12cd06+'/'+_0xaa335b)['json'](_0x346f84);}return null;};}function patchUpdates(_0xb69183){return function(_0x1dade7){try{jsonpatch[_0x495d('0x1d')](_0x1dade7,_0xb69183,!![]);}catch(_0x4fc5a3){return BPromise[_0x495d('0x1e')](_0x4fc5a3);}return _0x1dade7[_0x495d('0x1f')]();};}function saveUpdates(_0x294530,_0x36c5ff){return function(_0x31f2a3){if(_0x31f2a3){return _0x31f2a3[_0x495d('0x20')](_0x294530)[_0x495d('0x21')](function(_0x3e3321){return _0x3e3321;});}return null;};}function removeEntity(_0x13d2da,_0x48dfe3){return function(_0x53789e){if(_0x53789e){return _0x53789e[_0x495d('0x22')]()['then'](function(){_0x13d2da[_0x495d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd2e4,_0x344986){return function(_0x153ea6){if(!_0x153ea6){_0x2fd2e4[_0x495d('0x23')](0x194);}return _0x153ea6;};}function handleError(_0x589348,_0x2e3ac4){_0x2e3ac4=_0x2e3ac4||0x1f4;return function(_0xc33034){logger[_0x495d('0x24')](_0xc33034[_0x495d('0x25')]);if(_0xc33034[_0x495d('0x26')]){delete _0xc33034[_0x495d('0x26')];}_0x589348[_0x495d('0x17')](_0x2e3ac4)['send'](_0xc33034);};}exports[_0x495d('0x27')]=function(_0x25e69e,_0x44f25c){var _0x1ea8bf={},_0x34129f={},_0x6d08f5={'count':0x0,'rows':[]};var _0xd94213=_[_0x495d('0x28')](db[_0x495d('0x29')][_0x495d('0x2a')],function(_0x108bc0){return{'name':_0x108bc0['fieldName'],'type':_0x108bc0[_0x495d('0x2b')][_0x495d('0x2c')]};});_0x34129f[_0x495d('0x2d')]=_[_0x495d('0x28')](_0xd94213,_0x495d('0x26'));_0x34129f[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x25e69e[_0x495d('0x2e')]);_0x34129f[_0x495d('0x30')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],_0x34129f[_0x495d('0x2e')]);_0x1ea8bf[_0x495d('0x32')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x25e69e['query']['fields']));_0x1ea8bf[_0x495d('0x32')]=_0x1ea8bf[_0x495d('0x32')]['length']?_0x1ea8bf[_0x495d('0x32')]:_0x34129f['model'];if(!_0x25e69e[_0x495d('0x2e')]['hasOwnProperty'](_0x495d('0x34'))){_0x1ea8bf[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x35')]);_0x1ea8bf[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x25e69e['query']['offset']);}_0x1ea8bf[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x37')]);_0x1ea8bf[_0x495d('0x38')]=qs[_0x495d('0x30')](_[_0x495d('0x39')](_0x25e69e[_0x495d('0x2e')],_0x34129f['filters']),_0xd94213);if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3a')]){_0x1ea8bf[_0x495d('0x38')]=_['merge'](_0x1ea8bf[_0x495d('0x38')],{'$or':_['map'](_0xd94213,function(_0x59c851){if(_0x59c851[_0x495d('0x2b')]!==_0x495d('0x3b')){var _0x36da17={};_0x36da17[_0x59c851[_0x495d('0x26')]]={'$like':'%'+_0x25e69e[_0x495d('0x2e')]['filter']+'%'};return _0x36da17;}})});}_0x1ea8bf=_[_0x495d('0x3c')]({},_0x1ea8bf,_0x25e69e[_0x495d('0x3d')]);var _0x30a790={'where':_0x1ea8bf[_0x495d('0x38')]};return db[_0x495d('0x29')][_0x495d('0x19')](_0x30a790)[_0x495d('0x21')](function(_0x588aae){_0x6d08f5[_0x495d('0x19')]=_0x588aae;if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3e')]){_0x1ea8bf[_0x495d('0x3f')]=[{'all':!![]}];}return db[_0x495d('0x29')]['findAll'](_0x1ea8bf);})[_0x495d('0x21')](function(_0x127c73){_0x6d08f5[_0x495d('0x40')]=_0x127c73;return _0x6d08f5;})[_0x495d('0x21')](respondWithFilteredResult(_0x44f25c,_0x1ea8bf))[_0x495d('0x41')](handleError(_0x44f25c,null));};exports[_0x495d('0x42')]=function(_0x46a8dd,_0x242e0d){var _0x4273b={'raw':![],'where':{'id':_0x46a8dd[_0x495d('0x43')]['id']}},_0x1e0669={};_0x1e0669[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x29')][_0x495d('0x2a')]);_0x1e0669[_0x495d('0x2e')]=_['keys'](_0x46a8dd[_0x495d('0x2e')]);_0x1e0669[_0x495d('0x30')]=_[_0x495d('0x31')](_0x1e0669[_0x495d('0x2d')],_0x1e0669[_0x495d('0x2e')]);_0x4273b[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1e0669['model'],qs[_0x495d('0x33')](_0x46a8dd[_0x495d('0x2e')][_0x495d('0x33')]));_0x4273b['attributes']=_0x4273b[_0x495d('0x32')][_0x495d('0x44')]?_0x4273b[_0x495d('0x32')]:_0x1e0669[_0x495d('0x2d')];if(_0x46a8dd[_0x495d('0x2e')][_0x495d('0x3e')]){_0x4273b[_0x495d('0x3f')]=[{'all':!![]}];}_0x4273b=_[_0x495d('0x3c')]({},_0x4273b,_0x46a8dd['options']);return db[_0x495d('0x29')][_0x495d('0x45')](_0x4273b)[_0x495d('0x21')](handleEntityNotFound(_0x242e0d,null))['then'](respondWithResult(_0x242e0d,null))[_0x495d('0x41')](handleError(_0x242e0d,null));};exports[_0x495d('0x46')]=function(_0x5b60a3,_0x51f6c9){return db[_0x495d('0x29')]['create'](_0x5b60a3[_0x495d('0x47')],{})[_0x495d('0x21')](respondWithResult(_0x51f6c9,0xc9))[_0x495d('0x41')](handleError(_0x51f6c9,null));};exports['update']=function(_0x38c950,_0x43c815){if(_0x38c950[_0x495d('0x47')]['id']){delete _0x38c950[_0x495d('0x47')]['id'];}return db[_0x495d('0x29')]['find']({'where':{'id':_0x38c950[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x43c815,null))[_0x495d('0x21')](saveUpdates(_0x38c950[_0x495d('0x47')],null))[_0x495d('0x21')](respondWithResult(_0x43c815,null))['catch'](handleError(_0x43c815,null));};exports['destroy']=function(_0x272615,_0x29e1ed){return db[_0x495d('0x29')][_0x495d('0x45')]({'where':{'id':_0x272615['params']['id']}})['then'](handleEntityNotFound(_0x29e1ed,null))[_0x495d('0x21')](removeEntity(_0x29e1ed,null))[_0x495d('0x41')](handleError(_0x29e1ed,null));};exports[_0x495d('0x48')]=function(_0x2ca00d,_0x4624b3,_0x43dcc1){return db[_0x495d('0x49')][_0x495d('0x45')]({'where':{'id':_0x2ca00d[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4624b3,null))[_0x495d('0x21')](function(_0x204a0b){if(_0x204a0b){return _0x204a0b[_0x495d('0x48')](_0x2ca00d[_0x495d('0x47')]['ids'],_['omit'](_0x2ca00d[_0x495d('0x47')],['ids','id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x4624b3,null))[_0x495d('0x41')](handleError(_0x4624b3,null));};exports['getConditions']=function(_0x2544e6,_0x40c549,_0x28e756){var _0x5e9f5c={};var _0x5ab855={};var _0x5e1d8b;var _0x217767;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2544e6['params']['id']}})['then'](handleEntityNotFound(_0x40c549,null))[_0x495d('0x21')](function(_0x340158){if(_0x340158){_0x5e1d8b=_0x340158;_0x5ab855[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x49')][_0x495d('0x2a')]);_0x5ab855[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2544e6[_0x495d('0x2e')]);_0x5ab855[_0x495d('0x30')]=_[_0x495d('0x31')](_0x5ab855[_0x495d('0x2d')],_0x5ab855[_0x495d('0x2e')]);_0x5e9f5c[_0x495d('0x32')]=_['intersection'](_0x5ab855['model'],qs['fields'](_0x2544e6[_0x495d('0x2e')][_0x495d('0x33')]));_0x5e9f5c[_0x495d('0x32')]=_0x5e9f5c[_0x495d('0x32')][_0x495d('0x44')]?_0x5e9f5c[_0x495d('0x32')]:_0x5ab855[_0x495d('0x2d')];_0x5e9f5c[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x2544e6['query'][_0x495d('0x37')]);_0x5e9f5c[_0x495d('0x38')]=qs['filters'](_[_0x495d('0x39')](_0x2544e6['query'],_0x5ab855[_0x495d('0x30')]));if(_0x2544e6[_0x495d('0x2e')][_0x495d('0x3a')]){_0x5e9f5c['where']=_['merge'](_0x5e9f5c[_0x495d('0x38')],{'$or':_[_0x495d('0x28')](_0x5e9f5c[_0x495d('0x32')],function(_0x1ed53b){var _0x1851a8={};_0x1851a8[_0x1ed53b]={'$like':'%'+_0x2544e6[_0x495d('0x2e')]['filter']+'%'};return _0x1851a8;})});}_0x5e9f5c=_[_0x495d('0x3c')]({},_0x5e9f5c,_0x2544e6[_0x495d('0x3d')]);return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})[_0x495d('0x21')](function(_0x5dbf7b){if(_0x5dbf7b){_0x217767=_0x5dbf7b[_0x495d('0x44')];if(!_0x2544e6[_0x495d('0x2e')][_0x495d('0x4c')]('nolimit')){_0x5e9f5c[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x35')]);_0x5e9f5c[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x1a')]);}return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})['then'](function(_0x1df59a){if(_0x1df59a){return _0x1df59a?{'count':_0x217767,'rows':_0x1df59a}:null;}})[_0x495d('0x21')](respondWithResult(_0x40c549,null))[_0x495d('0x41')](handleError(_0x40c549,null));};exports[_0x495d('0x4d')]=function(_0x195427,_0x149d46,_0x1cadd2){return db[_0x495d('0x4e')][_0x495d('0x45')]({'where':{'id':_0x195427[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x149d46,null))['then'](function(_0x3cfd4f){if(_0x3cfd4f){return _0x3cfd4f[_0x495d('0x4d')](_0x195427[_0x495d('0x47')]['ids'],_['omit'](_0x195427[_0x495d('0x47')],[_0x495d('0x4f'),'id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x149d46,null))['catch'](handleError(_0x149d46,null));};exports[_0x495d('0x50')]=function(_0x2719e1,_0x4bf044,_0x49fd66){var _0x33d8b1={};var _0x1f25a0={};var _0xa5b976;var _0x4da161;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2719e1[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4bf044,null))[_0x495d('0x21')](function(_0x4a2506){if(_0x4a2506){_0xa5b976=_0x4a2506;_0x1f25a0['model']=_['keys'](db['Action'][_0x495d('0x2a')]);_0x1f25a0[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2719e1[_0x495d('0x2e')]);_0x1f25a0[_0x495d('0x30')]=_['intersection'](_0x1f25a0[_0x495d('0x2d')],_0x1f25a0[_0x495d('0x2e')]);_0x33d8b1[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1f25a0[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x2719e1['query'][_0x495d('0x33')]));_0x33d8b1['attributes']=_0x33d8b1[_0x495d('0x32')]['length']?_0x33d8b1[_0x495d('0x32')]:_0x1f25a0[_0x495d('0x2d')];_0x33d8b1[_0x495d('0x36')]=qs['sort'](_0x2719e1['query'][_0x495d('0x37')]);_0x33d8b1[_0x495d('0x38')]=qs[_0x495d('0x30')](_['pick'](_0x2719e1[_0x495d('0x2e')],_0x1f25a0[_0x495d('0x30')]));if(_0x2719e1[_0x495d('0x2e')][_0x495d('0x3a')]){_0x33d8b1[_0x495d('0x38')]=_[_0x495d('0x3c')](_0x33d8b1['where'],{'$or':_[_0x495d('0x28')](_0x33d8b1[_0x495d('0x32')],function(_0x2835c7){var _0x12cf10={};_0x12cf10[_0x2835c7]={'$like':'%'+_0x2719e1['query'][_0x495d('0x3a')]+'%'};return _0x12cf10;})});}_0x33d8b1=_[_0x495d('0x3c')]({},_0x33d8b1,_0x2719e1[_0x495d('0x3d')]);return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1fcbeb){if(_0x1fcbeb){_0x4da161=_0x1fcbeb['length'];if(!_0x2719e1[_0x495d('0x2e')][_0x495d('0x4c')](_0x495d('0x34'))){_0x33d8b1[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2719e1[_0x495d('0x2e')]['limit']);_0x33d8b1['offset']=qs[_0x495d('0x1a')](_0x2719e1['query']['offset']);}return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1082c3){if(_0x1082c3){return _0x1082c3?{'count':_0x4da161,'rows':_0x1082c3}:null;}})[_0x495d('0x21')](respondWithResult(_0x4bf044,null))[_0x495d('0x41')](handleError(_0x4bf044,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 1c3bbd1..9e27ed5 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 _0x8774=['define','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8774,0x146));var _0x4877=function(_0x59681a,_0x187572){_0x59681a=_0x59681a-0x0;var _0x1e5741=_0x8774[_0x59681a];return _0x1e5741;};'use strict';var _=require(_0x4877('0x0'));var util=require(_0x4877('0x1'));var logger=require(_0x4877('0x2'))('api');var moment=require(_0x4877('0x3'));var BPromise=require(_0x4877('0x4'));var rp=require(_0x4877('0x5'));var fs=require('fs');var path=require(_0x4877('0x6'));var rimraf=require('rimraf');var config=require(_0x4877('0x7'));var attributes=require(_0x4877('0x8'));module[_0x4877('0x9')]=function(_0x4912fa,_0x482d0f){return _0x4912fa[_0x4877('0xa')]('Automation',attributes,{'tableName':_0x4877('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6edc=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2d2a8d,_0x596fd6){var _0x4de305=function(_0x5c3e69){while(--_0x5c3e69){_0x2d2a8d['push'](_0x2d2a8d['shift']());}};_0x4de305(++_0x596fd6);}(_0x6edc,0xbd));var _0xc6ed=function(_0x1340a2,_0x26b995){_0x1340a2=_0x1340a2-0x0;var _0x550fc1=_0x6edc[_0x1340a2];return _0x550fc1;};'use strict';var _=require(_0xc6ed('0x0'));var util=require('util');var logger=require(_0xc6ed('0x1'))(_0xc6ed('0x2'));var moment=require(_0xc6ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6ed('0x4'));var fs=require('fs');var path=require(_0xc6ed('0x5'));var rimraf=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var attributes=require(_0xc6ed('0x8'));module[_0xc6ed('0x9')]=function(_0x1979c8,_0x20030a){return _0x1979c8[_0xc6ed('0xa')](_0xc6ed('0xb'),attributes,{'tableName':_0xc6ed('0xc'),'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 d26fb88..46ac400 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x390d58,_0x9d4593){var _0x5ba088=function(_0x16f153){while(--_0x16f153){_0x390d58['push'](_0x390d58['shift']());}};_0x5ba088(++_0x9d4593);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2c930a,_0x138d04){_0x2c930a=_0x2c930a-0x0;var _0x440a9f=_0xcf2f[_0x2c930a];return _0x440a9f;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});}
\ No newline at end of file
+var _0x72a1=['jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x72a1,0x1ce));var _0x172a=function(_0x19c1ce,_0x15b196){_0x19c1ce=_0x19c1ce-0x0;var _0x3a7f6e=_0x72a1[_0x19c1ce];return _0x3a7f6e;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('Automation,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 77ad82e..b57e9c6 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 _0xd634=['show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xd634,0x151));var _0x4d63=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xd634[_0xa79977];return _0x109f10;};'use strict';var multer=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var path=require(_0x4d63('0x2'));var timeout=require(_0x4d63('0x3'));var express=require(_0x4d63('0x4'));var router=express[_0x4d63('0x5')]();var fs_extra=require(_0x4d63('0x6'));var auth=require(_0x4d63('0x7'));var interaction=require(_0x4d63('0x8'));var config=require(_0x4d63('0x9'));var controller=require('./automation.controller');router[_0x4d63('0xa')]('/',auth[_0x4d63('0xb')](),controller[_0x4d63('0xc')]);router[_0x4d63('0xa')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0xe')]);router[_0x4d63('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x4d63('0xf')]);router['get'](_0x4d63('0x10'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x11')]);router[_0x4d63('0x12')]('/',auth['isAuthenticated'](),controller[_0x4d63('0x13')]);router['post'](_0x4d63('0x14'),auth[_0x4d63('0xb')](),controller['addConditions']);router[_0x4d63('0x12')](_0x4d63('0x10'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x15')]);router[_0x4d63('0x16')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x17')]);router[_0x4d63('0x18')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x19')]);module[_0x4d63('0x1a')]=router;
\ No newline at end of file
+var _0x5cd7=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e1279,_0x3dd8ca){var _0x175c1a=function(_0x109386){while(--_0x109386){_0x1e1279['push'](_0x1e1279['shift']());}};_0x175c1a(++_0x3dd8ca);}(_0x5cd7,0x102));var _0x75cd=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x5cd7[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0x75cd('0x0'));var util=require('util');var path=require(_0x75cd('0x1'));var timeout=require(_0x75cd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x75cd('0x3'));var auth=require(_0x75cd('0x4'));var interaction=require(_0x75cd('0x5'));var config=require(_0x75cd('0x6'));var controller=require(_0x75cd('0x7'));router[_0x75cd('0x8')]('/',auth[_0x75cd('0x9')](),controller[_0x75cd('0xa')]);router[_0x75cd('0x8')]('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0xb')]);router[_0x75cd('0x8')](_0x75cd('0xc'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xd')]);router[_0x75cd('0x8')](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xf')]);router['post']('/',auth[_0x75cd('0x9')](),controller['create']);router[_0x75cd('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x75cd('0x11')]);router['post'](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0x12')]);router['put']('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0x13')]);router[_0x75cd('0x14')](_0x75cd('0x15'),auth['isAuthenticated'](),controller[_0x75cd('0x16')]);module[_0x75cd('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 264e58b..c799d85 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 _0x2a59=['never','onlyIfOpen','always','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x510584,_0x1a901e){var _0x318b4b=function(_0x2939aa){while(--_0x2939aa){_0x510584['push'](_0x510584['shift']());}};_0x318b4b(++_0x1a901e);}(_0x2a59,0x129));var _0x92a5=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x2a59[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0x92a5('0x0'));module[_0x92a5('0x1')]={'name':{'type':Sequelize[_0x92a5('0x2')],'unique':_0x92a5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x92a5('0x4')](_0x92a5('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x92a5('0x2')]},'active':{'type':Sequelize[_0x92a5('0x6')],'defaultValue':0x0,'comment':_0x92a5('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x92a5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x92a5('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'comment':_0x92a5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x92a5('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x92a5('0x2')],'defaultValue':_0x92a5('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x92a5('0x4')]('always',_0x92a5('0x12'),_0x92a5('0x13')),'defaultValue':_0x92a5('0x14')},'dialAMDActive':{'type':Sequelize[_0x92a5('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x92a5('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x92a5('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a5('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x92a5('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x92a5('0xa')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x92a5('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x92a5('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a5('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x92a5('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a5('0x1a')},'dialCutDigit':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a5('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x52a4=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x1bb9e4,_0x15bc58){var _0xe362b1=function(_0xc5c0aa){while(--_0xc5c0aa){_0x1bb9e4['push'](_0x1bb9e4['shift']());}};_0xe362b1(++_0x15bc58);}(_0x52a4,0xe6));var _0x452a=function(_0x1e342f,_0x22bbe5){_0x1e342f=_0x1e342f-0x0;var _0x40551a=_0x52a4[_0x1e342f];return _0x40551a;};'use strict';var Sequelize=require(_0x452a('0x0'));module[_0x452a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x452a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x452a('0x3')),'allowNull':![],'defaultValue':_0x452a('0x3')},'description':{'type':Sequelize[_0x452a('0x4')]},'active':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x452a('0x6')](0x4)[_0x452a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x452a('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'comment':_0x452a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x452a('0xd')},'dialTimezone':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x452a('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x452a('0xe')](_0x452a('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':_0x452a('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x452a('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x452a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x452a('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x452a('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x452a('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x452a('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x452a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x452a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x452a('0xe')](_0x452a('0x18'),_0x452a('0x19')),'defaultValue':_0x452a('0x18')},'dialPrefix':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x452a('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5fdf104..b423845 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 _0x28c6=['cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','nolimit','order','pick','findOne','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','insert','sequelize','all','getBlackLists','addBlackLists'];(function(_0x3de2c7,_0x454dad){var _0x287f21=function(_0x9f97d8){while(--_0x9f97d8){_0x3de2c7['push'](_0x3de2c7['shift']());}};_0x287f21(++_0x454dad);}(_0x28c6,0x111));var _0x628c=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x28c6[_0x56916d];return _0x2b7f1f;};'use strict';var emlformat=require(_0x628c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x628c('0x1'));var jsonpatch=require(_0x628c('0x2'));var rp=require(_0x628c('0x3'));var moment=require(_0x628c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x628c('0x5'));var util=require(_0x628c('0x6'));var path=require('path');var sox=require(_0x628c('0x7'));var csv=require(_0x628c('0x8'));var ejs=require(_0x628c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x628c('0xa'));var crypto=require(_0x628c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x628c('0x8'));var querystring=require(_0x628c('0xc'));var Papa=require(_0x628c('0xd'));var Redis=require(_0x628c('0xe'));var authService=require(_0x628c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x628c('0x10'));var hardwareService=require(_0x628c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x628c('0x12'));var config=require(_0x628c('0x13'));var licenseUtil=require(_0x628c('0x14'));var db=require(_0x628c('0x15'))['db'];function respondWithStatusCode(_0x4900a1,_0x228eff){_0x228eff=_0x228eff||0xcc;return function(_0x5c7cff){if(_0x5c7cff){return _0x4900a1[_0x628c('0x16')](_0x228eff);}return _0x4900a1[_0x628c('0x17')](_0x228eff)[_0x628c('0x18')]();};}function respondWithResult(_0x2152d5,_0x4a22c8){_0x4a22c8=_0x4a22c8||0xc8;return function(_0x16242e){if(_0x16242e){return _0x2152d5[_0x628c('0x17')](_0x4a22c8)[_0x628c('0x19')](_0x16242e);}};}function respondWithFilteredResult(_0x8af00d,_0x3f5845){return function(_0x3c7239){if(_0x3c7239){var _0x5ceb38=typeof _0x3f5845['offset']===_0x628c('0x1a')&&typeof _0x3f5845[_0x628c('0x1b')]===_0x628c('0x1a');var _0x2039fb=_0x3c7239[_0x628c('0x1c')];var _0x2a8a83=_0x5ceb38?0x0:_0x3f5845[_0x628c('0x1d')];var _0x4f1bcc=_0x5ceb38?_0x3c7239[_0x628c('0x1c')]:_0x3f5845['offset']+_0x3f5845[_0x628c('0x1b')];var _0x4f6606;if(_0x4f1bcc>=_0x2039fb){_0x4f1bcc=_0x2039fb;_0x4f6606=0xc8;}else{_0x4f6606=0xce;}_0x8af00d['status'](_0x4f6606);return _0x8af00d[_0x628c('0x1e')](_0x628c('0x1f'),_0x2a8a83+'-'+_0x4f1bcc+'/'+_0x2039fb)['json'](_0x3c7239);}return null;};}function patchUpdates(_0x19cc01){return function(_0x3bad94){try{jsonpatch['apply'](_0x3bad94,_0x19cc01,!![]);}catch(_0x3ae869){return BPromise[_0x628c('0x20')](_0x3ae869);}return _0x3bad94[_0x628c('0x21')]();};}function saveUpdates(_0xeb0091,_0x5f7d13){return function(_0x11eeee){if(_0x11eeee){return _0x11eeee[_0x628c('0x22')](_0xeb0091)['then'](function(_0x67ac7b){return _0x67ac7b;});}return null;};}function removeEntity(_0x52b904,_0x318228){return function(_0x157f24){if(_0x157f24){return _0x157f24[_0x628c('0x23')]()['then'](function(){var _0x44ce7d=_0x157f24[_0x628c('0x24')]({'plain':!![]});var _0x2fa735=_0x628c('0x25');return db[_0x628c('0x26')][_0x628c('0x23')]({'where':{'type':_0x2fa735,'resourceId':_0x44ce7d['id']}})['then'](function(){return _0x157f24;});})[_0x628c('0x27')](function(){_0x52b904['status'](0xcc)[_0x628c('0x18')]();});}};}function handleEntityNotFound(_0x17e7fa,_0x40d114){return function(_0x303fa2){if(!_0x303fa2){_0x17e7fa[_0x628c('0x16')](0x194);}return _0x303fa2;};}function handleError(_0x3d062e,_0x52f267){_0x52f267=_0x52f267||0x1f4;return function(_0x527cc4){logger[_0x628c('0x28')](_0x527cc4[_0x628c('0x29')]);if(_0x527cc4[_0x628c('0x2a')]){delete _0x527cc4[_0x628c('0x2a')];}_0x3d062e[_0x628c('0x17')](_0x52f267)[_0x628c('0x2b')](_0x527cc4);};}exports[_0x628c('0x2c')]=function(_0x3dd49d,_0xf90f05){var _0x4cbc25={},_0x32bf76={},_0x231478={'count':0x0,'rows':[]};var _0x103be2=_[_0x628c('0x2d')](db[_0x628c('0x2e')]['rawAttributes'],function(_0x107842){return{'name':_0x107842[_0x628c('0x2f')],'type':_0x107842[_0x628c('0x30')][_0x628c('0x31')]};});_0x32bf76[_0x628c('0x32')]=_[_0x628c('0x2d')](_0x103be2,_0x628c('0x2a'));_0x32bf76[_0x628c('0x33')]=_[_0x628c('0x34')](_0x3dd49d['query']);_0x32bf76[_0x628c('0x35')]=_[_0x628c('0x36')](_0x32bf76['model'],_0x32bf76[_0x628c('0x33')]);_0x4cbc25[_0x628c('0x37')]=_[_0x628c('0x36')](_0x32bf76[_0x628c('0x32')],qs['fields'](_0x3dd49d[_0x628c('0x33')][_0x628c('0x38')]));_0x4cbc25[_0x628c('0x37')]=_0x4cbc25[_0x628c('0x37')][_0x628c('0x39')]?_0x4cbc25['attributes']:_0x32bf76[_0x628c('0x32')];if(!_0x3dd49d[_0x628c('0x33')][_0x628c('0x3a')]('nolimit')){_0x4cbc25[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x3dd49d[_0x628c('0x33')]['limit']);_0x4cbc25[_0x628c('0x1d')]=qs[_0x628c('0x1d')](_0x3dd49d['query']['offset']);}_0x4cbc25['order']=qs['sort'](_0x3dd49d[_0x628c('0x33')][_0x628c('0x3b')]);_0x4cbc25['where']=qs[_0x628c('0x35')](_['pick'](_0x3dd49d[_0x628c('0x33')],_0x32bf76[_0x628c('0x35')]),_0x103be2);if(_0x3dd49d[_0x628c('0x33')]['filter']){_0x4cbc25[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x4cbc25[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x103be2,function(_0x4b408a){if(_0x4b408a[_0x628c('0x30')]!==_0x628c('0x3e')){var _0x5ee888={};_0x5ee888[_0x4b408a[_0x628c('0x2a')]]={'$like':'%'+_0x3dd49d[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x5ee888;}})});}_0x4cbc25=_[_0x628c('0x3d')]({},_0x4cbc25,_0x3dd49d[_0x628c('0x40')]);var _0xacb97a={'where':_0x4cbc25[_0x628c('0x3c')]};return db[_0x628c('0x2e')][_0x628c('0x1c')](_0xacb97a)[_0x628c('0x27')](function(_0x3cb509){_0x231478[_0x628c('0x1c')]=_0x3cb509;if(_0x3dd49d[_0x628c('0x33')][_0x628c('0x41')]){_0x4cbc25['include']=[{'all':!![]}];}return db[_0x628c('0x2e')][_0x628c('0x42')](_0x4cbc25);})[_0x628c('0x27')](function(_0x987d80){_0x231478[_0x628c('0x43')]=_0x987d80;return _0x231478;})[_0x628c('0x27')](respondWithFilteredResult(_0xf90f05,_0x4cbc25))[_0x628c('0x44')](handleError(_0xf90f05,null));};exports[_0x628c('0x45')]=function(_0x5abe2a,_0x321479){var _0x5a7eea={'raw':![],'where':{'id':_0x5abe2a[_0x628c('0x46')]['id']}},_0x3ea4fe={};_0x3ea4fe[_0x628c('0x32')]=_['keys'](db['Campaign'][_0x628c('0x47')]);_0x3ea4fe[_0x628c('0x33')]=_[_0x628c('0x34')](_0x5abe2a[_0x628c('0x33')]);_0x3ea4fe[_0x628c('0x35')]=_[_0x628c('0x36')](_0x3ea4fe[_0x628c('0x32')],_0x3ea4fe['query']);_0x5a7eea[_0x628c('0x37')]=_[_0x628c('0x36')](_0x3ea4fe['model'],qs[_0x628c('0x38')](_0x5abe2a['query'][_0x628c('0x38')]));_0x5a7eea['attributes']=_0x5a7eea[_0x628c('0x37')][_0x628c('0x39')]?_0x5a7eea[_0x628c('0x37')]:_0x3ea4fe[_0x628c('0x32')];if(_0x5abe2a['query'][_0x628c('0x41')]){_0x5a7eea[_0x628c('0x48')]=[{'all':!![]}];}_0x5a7eea=_[_0x628c('0x3d')]({},_0x5a7eea,_0x5abe2a[_0x628c('0x40')]);return db[_0x628c('0x2e')]['find'](_0x5a7eea)['then'](handleEntityNotFound(_0x321479,null))[_0x628c('0x27')](respondWithResult(_0x321479,null))['catch'](handleError(_0x321479,null));};exports[_0x628c('0x49')]=function(_0x117d14,_0x550e06){return db[_0x628c('0x2e')][_0x628c('0x49')](_0x117d14['body'],{})[_0x628c('0x27')](function(_0x225067){var _0xd4c1db=_0x117d14[_0x628c('0x4a')][_0x628c('0x24')]({'plain':!![]});if(!_0xd4c1db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd4c1db[_0x628c('0x4b')]===_0x628c('0x4a')){var _0x2b25e6=_0x225067['get']({'plain':!![]});var _0x4ce2f4=_0x628c('0x25');return db[_0x628c('0x4c')][_0x628c('0x4d')]({'where':{'name':_0x4ce2f4,'userProfileId':_0xd4c1db[_0x628c('0x4e')]},'raw':!![]})[_0x628c('0x27')](function(_0x3e7909){if(_0x3e7909&&_0x3e7909['autoAssociation']===0x0){return db[_0x628c('0x26')]['create']({'name':_0x2b25e6[_0x628c('0x2a')],'resourceId':_0x2b25e6['id'],'type':_0x3e7909[_0x628c('0x2a')],'sectionId':_0x3e7909['id']},{})[_0x628c('0x27')](function(){return _0x225067;});}else{return _0x225067;}})[_0x628c('0x44')](function(_0x5a8a4c){logger[_0x628c('0x28')](_0x628c('0x4f'),_0x5a8a4c);throw _0x5a8a4c;});}return _0x225067;})[_0x628c('0x27')](respondWithResult(_0x550e06,0xc9))['catch'](handleError(_0x550e06,null));};exports[_0x628c('0x50')]=function(_0x128ff9,_0x42fabf){var _0x5df128={'where':{'id':_0x128ff9[_0x628c('0x46')]['id']}},_0x3914dd={};_0x3914dd[_0x628c('0x32')]=_['keys'](db[_0x628c('0x2e')][_0x628c('0x47')]);_0x5df128[_0x628c('0x37')]=_['intersection'](_0x3914dd[_0x628c('0x32')],qs[_0x628c('0x38')](_0x128ff9[_0x628c('0x33')]['fields']));_0x5df128[_0x628c('0x37')]=_0x5df128['attributes'][_0x628c('0x39')]?_0x5df128[_0x628c('0x37')]:_0x3914dd['model'];if(_0x128ff9[_0x628c('0x33')]['includeAll']){_0x5df128['include']=[{'all':!![]}];}_0x5df128=_[_0x628c('0x3d')]({},_0x5df128,_0x128ff9[_0x628c('0x40')]);return db[_0x628c('0x2e')][_0x628c('0x4d')](_0x5df128)['then'](handleEntityNotFound(_0x42fabf,null))[_0x628c('0x27')](function(_0xc4a2bd){if(_0xc4a2bd){var _0x5f4830=_0xc4a2bd[_0x628c('0x24')]({'plain':!![]});_0x5f4830=qs[_0x628c('0x51')](_0x5f4830,['id',_0x628c('0x52'),_0x628c('0x53')]);_0x128ff9['body']=_['omit'](_0x128ff9[_0x628c('0x54')],['id','createdAt',_0x628c('0x53')]);return db[_0x628c('0x2e')][_0x628c('0x49')](_[_0x628c('0x3d')](_0x5f4830,_0x128ff9['body']),{'include':_0x128ff9['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2acb0d){var _0x3e67e3=_0x128ff9[_0x628c('0x4a')][_0x628c('0x24')]({'plain':!![]});if(!_0x3e67e3)throw new Error(_0x628c('0x55'));if(_0x3e67e3['role']===_0x628c('0x4a')){var _0x1f2b0a=_0x2acb0d[_0x628c('0x24')]({'plain':!![]});var _0x37186e='IvrCampaigns';return db[_0x628c('0x4c')][_0x628c('0x4d')]({'where':{'name':_0x37186e,'userProfileId':_0x3e67e3[_0x628c('0x4e')]},'raw':!![]})[_0x628c('0x27')](function(_0x22d089){if(_0x22d089&&_0x22d089['autoAssociation']===0x0){return db[_0x628c('0x26')][_0x628c('0x49')]({'name':_0x1f2b0a['name'],'resourceId':_0x1f2b0a['id'],'type':_0x22d089['name'],'sectionId':_0x22d089['id']},{})[_0x628c('0x27')](function(){return _0x2acb0d;});}else{return _0x2acb0d;}})[_0x628c('0x44')](function(_0x1acd2a){logger[_0x628c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1acd2a);throw _0x1acd2a;});}return _0x2acb0d;});}})[_0x628c('0x27')](respondWithResult(_0x42fabf,0xc9))[_0x628c('0x44')](handleError(_0x42fabf,null));};exports[_0x628c('0x22')]=function(_0x3d7299,_0x444692){if(_0x3d7299[_0x628c('0x54')]['id']){delete _0x3d7299['body']['id'];}return db['Campaign'][_0x628c('0x4d')]({'where':{'id':_0x3d7299[_0x628c('0x46')]['id']}})['then'](handleEntityNotFound(_0x444692,null))['then'](saveUpdates(_0x3d7299['body'],null))[_0x628c('0x27')](respondWithResult(_0x444692,null))[_0x628c('0x44')](handleError(_0x444692,null));};exports[_0x628c('0x23')]=function(_0x102a49,_0x5f36a0){return db[_0x628c('0x2e')][_0x628c('0x4d')]({'where':{'id':_0x102a49[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x5f36a0,null))[_0x628c('0x27')](removeEntity(_0x5f36a0,null))[_0x628c('0x44')](handleError(_0x5f36a0,null));};exports[_0x628c('0x56')]=function(_0x5a663d,_0x46f15f,_0x32f64a){var _0x341647={'raw':!![],'where':{}};var _0x5f1d7f={};var _0x83ab7f={'count':0x0,'rows':[]};return db[_0x628c('0x2e')]['findOne']({'where':{'id':_0x5a663d['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x46f15f,null))[_0x628c('0x27')](function(_0x417dfe){if(_0x417dfe){_0x5f1d7f[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x57')]['rawAttributes']);_0x5f1d7f[_0x628c('0x33')]=_[_0x628c('0x34')](_0x5a663d['query']);_0x5f1d7f[_0x628c('0x35')]=_[_0x628c('0x36')](_0x5f1d7f[_0x628c('0x32')],_0x5f1d7f[_0x628c('0x33')]);_0x341647[_0x628c('0x37')]=_['intersection'](_0x5f1d7f[_0x628c('0x32')],qs['fields'](_0x5a663d[_0x628c('0x33')][_0x628c('0x38')]));_0x341647['attributes']=_0x341647[_0x628c('0x37')][_0x628c('0x39')]?_0x341647[_0x628c('0x37')]:_0x5f1d7f[_0x628c('0x32')];if(!_0x5a663d[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x341647[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x5a663d[_0x628c('0x33')]['limit']);_0x341647[_0x628c('0x1d')]=qs['offset'](_0x5a663d[_0x628c('0x33')][_0x628c('0x1d')]);}_0x341647[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x5a663d[_0x628c('0x33')][_0x628c('0x3b')]);_0x341647['where']=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x5a663d['query'],_0x5f1d7f[_0x628c('0x35')]));_0x341647[_0x628c('0x3c')]['CampaignId']=_0x417dfe['id'];if(_0x5a663d['query'][_0x628c('0x3f')]){_0x341647[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x341647['where'],{'$or':_[_0x628c('0x2d')](_0x341647[_0x628c('0x37')],function(_0x324ea2){var _0x125074={};_0x125074[_0x324ea2]={'$like':'%'+_0x5a663d[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x125074;})});}_0x341647=_['merge']({},_0x341647,_0x5a663d[_0x628c('0x40')]);return db['CmHopper'][_0x628c('0x1c')]({'where':_0x341647[_0x628c('0x3c')]})[_0x628c('0x27')](function(_0x48fb8e){_0x83ab7f['count']=_0x48fb8e;if(_0x5a663d[_0x628c('0x33')][_0x628c('0x41')]){_0x341647['include']=[{'all':!![]}];}return db[_0x628c('0x57')][_0x628c('0x42')](_0x341647);})[_0x628c('0x27')](function(_0x10ec47){_0x83ab7f[_0x628c('0x43')]=_0x10ec47;return _0x83ab7f;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x46f15f,_0x341647))[_0x628c('0x44')](handleError(_0x46f15f,null));};exports['getHopperHistories']=function(_0x536dd9,_0x3fb658,_0x671c8a){var _0x22885d={'raw':!![],'where':{}};var _0x515af8={};var _0x5f2e89={'count':0x0,'rows':[]};return db['Campaign'][_0x628c('0x5b')]({'where':{'id':_0x536dd9[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x3fb658,null))[_0x628c('0x27')](function(_0x38baaf){if(_0x38baaf){_0x515af8[_0x628c('0x32')]=_[_0x628c('0x34')](db['CmHopperHistory']['rawAttributes']);_0x515af8[_0x628c('0x33')]=_['keys'](_0x536dd9[_0x628c('0x33')]);_0x515af8[_0x628c('0x35')]=_[_0x628c('0x36')](_0x515af8[_0x628c('0x32')],_0x515af8[_0x628c('0x33')]);_0x22885d[_0x628c('0x37')]=_[_0x628c('0x36')](_0x515af8[_0x628c('0x32')],qs['fields'](_0x536dd9[_0x628c('0x33')][_0x628c('0x38')]));_0x22885d[_0x628c('0x37')]=_0x22885d[_0x628c('0x37')]['length']?_0x22885d[_0x628c('0x37')]:_0x515af8['model'];if(!_0x536dd9[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x22885d[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x536dd9[_0x628c('0x33')]['limit']);_0x22885d[_0x628c('0x1d')]=qs['offset'](_0x536dd9[_0x628c('0x33')][_0x628c('0x1d')]);}_0x22885d[_0x628c('0x59')]=qs['sort'](_0x536dd9[_0x628c('0x33')][_0x628c('0x3b')]);_0x22885d[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x536dd9['query'],_0x515af8[_0x628c('0x35')]));_0x22885d[_0x628c('0x3c')][_0x628c('0x5c')]=_0x38baaf['id'];if(_0x536dd9[_0x628c('0x33')][_0x628c('0x3f')]){_0x22885d[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x22885d[_0x628c('0x3c')],{'$or':_['map'](_0x22885d[_0x628c('0x37')],function(_0x19398a){var _0x33d259={};_0x33d259[_0x19398a]={'$like':'%'+_0x536dd9[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x33d259;})});}_0x22885d=_[_0x628c('0x3d')]({},_0x22885d,_0x536dd9[_0x628c('0x40')]);return db[_0x628c('0x5d')][_0x628c('0x1c')]({'where':_0x22885d[_0x628c('0x3c')]})[_0x628c('0x27')](function(_0x30a79c){_0x5f2e89[_0x628c('0x1c')]=_0x30a79c;if(_0x536dd9['query'][_0x628c('0x41')]){_0x22885d[_0x628c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x628c('0x42')](_0x22885d);})[_0x628c('0x27')](function(_0x1088d8){_0x5f2e89[_0x628c('0x43')]=_0x1088d8;return _0x5f2e89;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x3fb658,_0x22885d))['catch'](handleError(_0x3fb658,null));};exports['getHopperFinals']=function(_0xb3dc11,_0x25726e,_0xed7d4a){var _0x2436b0={'raw':!![],'where':{}};var _0x3c4950={};var _0x563291={'count':0x0,'rows':[]};return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0xb3dc11['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x25726e,null))['then'](function(_0x396465){if(_0x396465){_0x3c4950[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x5e')][_0x628c('0x47')]);_0x3c4950[_0x628c('0x33')]=_[_0x628c('0x34')](_0xb3dc11[_0x628c('0x33')]);_0x3c4950[_0x628c('0x35')]=_[_0x628c('0x36')](_0x3c4950[_0x628c('0x32')],_0x3c4950['query']);_0x2436b0[_0x628c('0x37')]=_[_0x628c('0x36')](_0x3c4950[_0x628c('0x32')],qs[_0x628c('0x38')](_0xb3dc11['query'][_0x628c('0x38')]));_0x2436b0[_0x628c('0x37')]=_0x2436b0[_0x628c('0x37')]['length']?_0x2436b0[_0x628c('0x37')]:_0x3c4950[_0x628c('0x32')];if(!_0xb3dc11['query'][_0x628c('0x3a')](_0x628c('0x58'))){_0x2436b0[_0x628c('0x1b')]=qs['limit'](_0xb3dc11[_0x628c('0x33')][_0x628c('0x1b')]);_0x2436b0[_0x628c('0x1d')]=qs['offset'](_0xb3dc11[_0x628c('0x33')][_0x628c('0x1d')]);}_0x2436b0['order']=qs['sort'](_0xb3dc11['query'][_0x628c('0x3b')]);_0x2436b0[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0xb3dc11['query'],_0x3c4950['filters']));_0x2436b0[_0x628c('0x3c')][_0x628c('0x5c')]=_0x396465['id'];if(_0xb3dc11['query'][_0x628c('0x3f')]){_0x2436b0[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x2436b0[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x2436b0['attributes'],function(_0x1b2f1e){var _0x2079ce={};_0x2079ce[_0x1b2f1e]={'$like':'%'+_0xb3dc11['query'][_0x628c('0x3f')]+'%'};return _0x2079ce;})});}_0x2436b0=_[_0x628c('0x3d')]({},_0x2436b0,_0xb3dc11['options']);return db[_0x628c('0x5e')][_0x628c('0x1c')]({'where':_0x2436b0['where']})[_0x628c('0x27')](function(_0xb33f7b){_0x563291[_0x628c('0x1c')]=_0xb33f7b;if(_0xb3dc11[_0x628c('0x33')][_0x628c('0x41')]){_0x2436b0[_0x628c('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x628c('0x42')](_0x2436b0);})[_0x628c('0x27')](function(_0xc75b3a){_0x563291[_0x628c('0x43')]=_0xc75b3a;return _0x563291;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x25726e,_0x2436b0))[_0x628c('0x44')](handleError(_0x25726e,null));};exports[_0x628c('0x5f')]=function(_0x3e556e,_0x139123,_0xa98b8a){var _0x3e33a5={'raw':!![],'where':{}};var _0x20559f={};var _0x284d5a={'count':0x0,'rows':[]};return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0x3e556e[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x139123,null))[_0x628c('0x27')](function(_0x4bc78e){if(_0x4bc78e){_0x20559f[_0x628c('0x32')]=_['keys'](db['CmHopperBlack'][_0x628c('0x47')]);_0x20559f['query']=_[_0x628c('0x34')](_0x3e556e['query']);_0x20559f['filters']=_[_0x628c('0x36')](_0x20559f[_0x628c('0x32')],_0x20559f[_0x628c('0x33')]);_0x3e33a5[_0x628c('0x37')]=_['intersection'](_0x20559f['model'],qs['fields'](_0x3e556e[_0x628c('0x33')]['fields']));_0x3e33a5[_0x628c('0x37')]=_0x3e33a5[_0x628c('0x37')]['length']?_0x3e33a5['attributes']:_0x20559f[_0x628c('0x32')];if(!_0x3e556e[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x3e33a5['limit']=qs[_0x628c('0x1b')](_0x3e556e[_0x628c('0x33')]['limit']);_0x3e33a5[_0x628c('0x1d')]=qs['offset'](_0x3e556e[_0x628c('0x33')][_0x628c('0x1d')]);}_0x3e33a5['order']=qs[_0x628c('0x3b')](_0x3e556e[_0x628c('0x33')][_0x628c('0x3b')]);_0x3e33a5[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x3e556e['query'],_0x20559f[_0x628c('0x35')]));_0x3e33a5['where'][_0x628c('0x5c')]=_0x4bc78e['id'];if(_0x3e556e[_0x628c('0x33')][_0x628c('0x3f')]){_0x3e33a5[_0x628c('0x3c')]=_['merge'](_0x3e33a5[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x3e33a5[_0x628c('0x37')],function(_0x38cb0d){var _0x520f5e={};_0x520f5e[_0x38cb0d]={'$like':'%'+_0x3e556e[_0x628c('0x33')]['filter']+'%'};return _0x520f5e;})});}_0x3e33a5=_[_0x628c('0x3d')]({},_0x3e33a5,_0x3e556e['options']);return db[_0x628c('0x60')]['count']({'where':_0x3e33a5[_0x628c('0x3c')]})['then'](function(_0x448860){_0x284d5a[_0x628c('0x1c')]=_0x448860;if(_0x3e556e[_0x628c('0x33')][_0x628c('0x41')]){_0x3e33a5[_0x628c('0x48')]=[{'all':!![]}];}return db[_0x628c('0x60')]['findAll'](_0x3e33a5);})[_0x628c('0x27')](function(_0x39ddc4){_0x284d5a['rows']=_0x39ddc4;return _0x284d5a;});}})['then'](respondWithFilteredResult(_0x139123,_0x3e33a5))[_0x628c('0x44')](handleError(_0x139123,null));};exports[_0x628c('0x61')]=function(_0x4ea634,_0x4eddb2,_0x46a095){var _0x41e1c0={};var _0x3dac31={};var _0x50a3fa;var _0x3cb02b;return db[_0x628c('0x2e')]['findOne']({'where':{'id':_0x4ea634['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x4eddb2,null))[_0x628c('0x27')](function(_0x5d095c){if(_0x5d095c){_0x50a3fa=_0x5d095c;_0x3dac31[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x62')]['rawAttributes']);_0x3dac31['query']=_['keys'](_0x4ea634['query']);_0x3dac31['filters']=_[_0x628c('0x36')](_0x3dac31[_0x628c('0x32')],_0x3dac31[_0x628c('0x33')]);_0x41e1c0['attributes']=_[_0x628c('0x36')](_0x3dac31[_0x628c('0x32')],qs['fields'](_0x4ea634[_0x628c('0x33')]['fields']));_0x41e1c0[_0x628c('0x37')]=_0x41e1c0[_0x628c('0x37')][_0x628c('0x39')]?_0x41e1c0['attributes']:_0x3dac31['model'];_0x41e1c0[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x4ea634['query'][_0x628c('0x3b')]);_0x41e1c0['where']=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x4ea634['query'],_0x3dac31['filters']));if(_0x4ea634[_0x628c('0x33')][_0x628c('0x3f')]){_0x41e1c0[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x41e1c0[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x41e1c0[_0x628c('0x37')],function(_0x497bb8){var _0xb288a9={};_0xb288a9[_0x497bb8]={'$like':'%'+_0x4ea634[_0x628c('0x33')]['filter']+'%'};return _0xb288a9;})});}_0x41e1c0=_[_0x628c('0x3d')]({},_0x41e1c0,_0x4ea634[_0x628c('0x40')]);return _0x50a3fa[_0x628c('0x61')](_0x41e1c0);}})[_0x628c('0x27')](function(_0x3139fc){if(_0x3139fc){_0x3cb02b=_0x3139fc[_0x628c('0x39')];if(!_0x4ea634[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x41e1c0[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x4ea634['query'][_0x628c('0x1b')]);_0x41e1c0[_0x628c('0x1d')]=qs[_0x628c('0x1d')](_0x4ea634['query']['offset']);}return _0x50a3fa['getLists'](_0x41e1c0);}})['then'](function(_0x155577){if(_0x155577){return _0x155577?{'count':_0x3cb02b,'rows':_0x155577}:null;}})[_0x628c('0x27')](respondWithResult(_0x4eddb2,null))[_0x628c('0x44')](handleError(_0x4eddb2,null));};exports[_0x628c('0x63')]=function(_0x1e5347,_0x34b91b,_0xc3112){var _0xeb9dd1,_0x2c91a8;return db[_0x628c('0x2e')]['find']({'where':{'id':_0x1e5347['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x34b91b,null))[_0x628c('0x27')](function(_0x2bdcec){if(_0x2bdcec){_0x2c91a8=_0x2bdcec;return _0x2bdcec[_0x628c('0x63')](_0x1e5347[_0x628c('0x54')]['ids'],_[_0x628c('0x51')](_0x1e5347[_0x628c('0x54')],[_0x628c('0x64'),'id'])||{});}return null;})[_0x628c('0x65')](function(_0x2f6884){var _0x3a9f49;_0xeb9dd1=_0x2f6884||[];var _0x5e3a2b=[];if(_0x2f6884){for(var _0x58e1e7=0x0;_0x58e1e7<_0x2f6884[_0x628c('0x39')];_0x58e1e7+=0x1){var _0x50ae27=_0x2f6884[_0x58e1e7][_0x628c('0x24')]({'plain':!![]});_0x2c91a8['dialCheckDuplicateType']=_0x1e5347[_0x628c('0x54')][_0x628c('0x66')]?_0x1e5347[_0x628c('0x54')][_0x628c('0x66')]:_0x2c91a8[_0x628c('0x66')];switch(_0x2c91a8[_0x628c('0x66')]){case _0x628c('0x67'):_0x3a9f49=squel['insert']()['into'](_0x628c('0x68'))[_0x628c('0x69')]([_0x628c('0x6a'),_0x628c('0x6b'),_0x628c('0x6c'),_0x628c('0x6d'),'CampaignId',_0x628c('0x52'),_0x628c('0x53')],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),'phone')['field'](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id','ContactId')['field'](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))['field'](_0x628c('0x6f'),_0x628c('0x53'))['from'](_0x628c('0x72'))['where'](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75'))[_0x628c('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x628c('0x76')]()[_0x628c('0x6e')](_0x628c('0x77'))[_0x628c('0x78')](_0x628c('0x79'))[_0x628c('0x3c')](_0x628c('0x7a'),_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')]()))['where'](_0x628c('0x7b'),squel[_0x628c('0x76')]()[_0x628c('0x6e')](_0x628c('0x7c'))[_0x628c('0x78')](_0x628c('0x68'))['where'](_0x628c('0x7a'),_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')]())))[_0x628c('0x71')]();break;case _0x628c('0x7d'):_0x3a9f49=squel['insert']()[_0x628c('0x7e')](_0x628c('0x68'))[_0x628c('0x69')](['phone',_0x628c('0x6b'),_0x628c('0x6c'),_0x628c('0x6d'),_0x628c('0x5c'),_0x628c('0x52'),_0x628c('0x53')],squel[_0x628c('0x76')]()['field'](_0x628c('0x6a'),'phone')['field'](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id',_0x628c('0x6c'))['field'](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),'updatedAt')['from'](_0x628c('0x72'))['where'](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75'))[_0x628c('0x3c')](_0x628c('0x7b'),squel[_0x628c('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0x628c('0x78')](_0x628c('0x68'))['where']('CampaignId\x20=\x20?',_0x1e5347['params']['id'][_0x628c('0x71')]())))['toString']();break;default:_0x3a9f49=squel[_0x628c('0x7f')]()[_0x628c('0x7e')](_0x628c('0x68'))[_0x628c('0x69')]([_0x628c('0x6a'),_0x628c('0x6b'),'ContactId',_0x628c('0x6d'),_0x628c('0x5c'),_0x628c('0x52'),_0x628c('0x53')],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),_0x628c('0x6a'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id','ContactId')[_0x628c('0x6e')](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),'ListId')[_0x628c('0x6e')](_0x1e5347['params']['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x53'))[_0x628c('0x78')](_0x628c('0x72'))[_0x628c('0x3c')]('deletedAt\x20IS\x20NULL')[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75')))[_0x628c('0x71')]();}_0x5e3a2b['push'](db[_0x628c('0x80')][_0x628c('0x33')](_0x3a9f49));}return BPromise[_0x628c('0x81')](_0x5e3a2b);}})[_0x628c('0x27')](function(){return _0xeb9dd1;})['then'](respondWithResult(_0x34b91b,null))[_0x628c('0x44')](handleError(_0x34b91b,null));};exports['removeLists']=function(_0x4767e3,_0x46612c,_0x1a11e9){return db['Campaign']['find']({'where':{'id':_0x4767e3[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x46612c,null))[_0x628c('0x27')](function(_0x5d0e97){if(_0x5d0e97){return _0x5d0e97['removeLists'](_0x4767e3[_0x628c('0x33')]['ids']);}})[_0x628c('0x27')](function(_0x1b2b0d){if(_0x1b2b0d){return db[_0x628c('0x57')][_0x628c('0x23')]({'where':{'ListId':_0x4767e3[_0x628c('0x33')][_0x628c('0x64')],'CampaignId':_0x4767e3['params']['id']}})['then'](function(){return _0x1b2b0d;});}})[_0x628c('0x27')](respondWithStatusCode(_0x46612c,null))[_0x628c('0x44')](handleError(_0x46612c,null));};exports[_0x628c('0x82')]=function(_0x4ef7bf,_0x376e23,_0x1fe6ab){var _0x5cc401={};var _0x57a4ed={};var _0x3dd46a;var _0xf99888;return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0x4ef7bf[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x376e23,null))['then'](function(_0x105627){if(_0x105627){_0x3dd46a=_0x105627;_0x57a4ed['model']=_[_0x628c('0x34')](db[_0x628c('0x62')][_0x628c('0x47')]);_0x57a4ed[_0x628c('0x33')]=_[_0x628c('0x34')](_0x4ef7bf[_0x628c('0x33')]);_0x57a4ed['filters']=_[_0x628c('0x36')](_0x57a4ed['model'],_0x57a4ed[_0x628c('0x33')]);_0x5cc401[_0x628c('0x37')]=_[_0x628c('0x36')](_0x57a4ed[_0x628c('0x32')],qs[_0x628c('0x38')](_0x4ef7bf[_0x628c('0x33')][_0x628c('0x38')]));_0x5cc401[_0x628c('0x37')]=_0x5cc401[_0x628c('0x37')][_0x628c('0x39')]?_0x5cc401[_0x628c('0x37')]:_0x57a4ed[_0x628c('0x32')];_0x5cc401[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3b')]);_0x5cc401[_0x628c('0x3c')]=qs[_0x628c('0x35')](_['pick'](_0x4ef7bf['query'],_0x57a4ed[_0x628c('0x35')]));if(_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3f')]){_0x5cc401[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x5cc401[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x5cc401['attributes'],function(_0xfbc39a){var _0x5f0b23={};_0x5f0b23[_0xfbc39a]={'$like':'%'+_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x5f0b23;})});}_0x5cc401=_[_0x628c('0x3d')]({},_0x5cc401,_0x4ef7bf[_0x628c('0x40')]);return _0x3dd46a['getBlackLists'](_0x5cc401);}})['then'](function(_0x240ffc){if(_0x240ffc){_0xf99888=_0x240ffc['length'];if(!_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3a')]('nolimit')){_0x5cc401[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x4ef7bf[_0x628c('0x33')]['limit']);_0x5cc401['offset']=qs[_0x628c('0x1d')](_0x4ef7bf['query'][_0x628c('0x1d')]);}return _0x3dd46a[_0x628c('0x82')](_0x5cc401);}})[_0x628c('0x27')](function(_0x218ac8){if(_0x218ac8){return _0x218ac8?{'count':_0xf99888,'rows':_0x218ac8}:null;}})[_0x628c('0x27')](respondWithResult(_0x376e23,null))[_0x628c('0x44')](handleError(_0x376e23,null));};exports[_0x628c('0x83')]=function(_0x4577ca,_0x1402b8,_0x591570){var _0x5992cd,_0x43ae89;return db[_0x628c('0x2e')][_0x628c('0x4d')]({'where':{'id':_0x4577ca['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x1402b8,null))[_0x628c('0x27')](function(_0x47756c){if(_0x47756c){_0x43ae89=_0x47756c;return _0x47756c['addBlackLists'](_0x4577ca[_0x628c('0x54')][_0x628c('0x64')],_[_0x628c('0x51')](_0x4577ca['body'],[_0x628c('0x64'),'id'])||{});}return null;})[_0x628c('0x65')](function(_0x169d81){var _0x29c26b;_0x5992cd=_0x169d81||[];var _0x24cb52=[];if(_0x169d81){for(var _0x3f86d8=0x0;_0x3f86d8<_0x169d81[_0x628c('0x39')];_0x3f86d8+=0x1){var _0x53eb3d=_0x169d81[_0x3f86d8][_0x628c('0x24')]({'plain':!![]});_0x29c26b=squel[_0x628c('0x7f')]()['into'](_0x628c('0x84'))['fromQuery']([_0x628c('0x6a'),_0x628c('0x6c'),_0x628c('0x6d'),_0x628c('0x5c'),'createdAt','updatedAt'],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),_0x628c('0x6a'))[_0x628c('0x6e')]('id','ContactId')[_0x628c('0x6e')](_0x53eb3d[_0x628c('0x70')]['toString'](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x4577ca[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x53'))[_0x628c('0x78')](_0x628c('0x72'))[_0x628c('0x3c')](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x53eb3d['CmListId']['toString']())[_0x628c('0x3c')](_0x628c('0x75')))[_0x628c('0x71')]();_0x24cb52[_0x628c('0x85')](db[_0x628c('0x80')]['query'](_0x29c26b));}return BPromise['all'](_0x24cb52);}})[_0x628c('0x27')](function(){return _0x5992cd;})['then'](respondWithResult(_0x1402b8,null))['catch'](handleError(_0x1402b8,null));};exports[_0x628c('0x86')]=function(_0x24be8a,_0xa50278,_0x2e9e30){return db[_0x628c('0x2e')]['find']({'where':{'id':_0x24be8a['params']['id']}})['then'](handleEntityNotFound(_0xa50278,null))[_0x628c('0x27')](function(_0x1c6c4a){if(_0x1c6c4a){return _0x1c6c4a[_0x628c('0x86')](_0x24be8a[_0x628c('0x33')][_0x628c('0x64')]);}})['then'](function(_0xc78467){if(_0xc78467){return db[_0x628c('0x60')][_0x628c('0x23')]({'where':{'ListId':_0x24be8a[_0x628c('0x33')][_0x628c('0x64')],'CampaignId':_0x24be8a[_0x628c('0x46')]['id']}})[_0x628c('0x27')](function(){return _0xc78467;});}})[_0x628c('0x27')](respondWithStatusCode(_0xa50278,null))[_0x628c('0x44')](handleError(_0xa50278,null));};
\ No newline at end of file
+var _0x4e7f=['send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','Campaign','include','findAll','rows','catch','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','merge','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','mustache','path','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4e7f,0x1df));var _0xf4e7=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x4e7f[_0x1591d4];return _0x4c46bb;};'use strict';var emlformat=require(_0xf4e7('0x0'));var rimraf=require(_0xf4e7('0x1'));var zipdir=require(_0xf4e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf4e7('0x3'));var util=require('util');var path=require(_0xf4e7('0x4'));var sox=require('sox');var csv=require(_0xf4e7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4e7('0x6'));var crypto=require(_0xf4e7('0x7'));var jsforce=require(_0xf4e7('0x8'));var deskjs=require(_0xf4e7('0x9'));var toCsv=require(_0xf4e7('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf4e7('0xa'));var authService=require(_0xf4e7('0xb'));var qs=require(_0xf4e7('0xc'));var as=require(_0xf4e7('0xd'));var hardwareService=require(_0xf4e7('0xe'));var logger=require(_0xf4e7('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4e7('0x10'));var db=require(_0xf4e7('0x11'))['db'];function respondWithStatusCode(_0x5b24ef,_0x316652){_0x316652=_0x316652||0xcc;return function(_0x50bb16){if(_0x50bb16){return _0x5b24ef[_0xf4e7('0x12')](_0x316652);}return _0x5b24ef['status'](_0x316652)[_0xf4e7('0x13')]();};}function respondWithResult(_0x5c6378,_0x249357){_0x249357=_0x249357||0xc8;return function(_0x597164){if(_0x597164){return _0x5c6378[_0xf4e7('0x14')](_0x249357)[_0xf4e7('0x15')](_0x597164);}};}function respondWithFilteredResult(_0x3a2ea7,_0xe1a127){return function(_0x198dc0){if(_0x198dc0){var _0x2fc150=typeof _0xe1a127[_0xf4e7('0x16')]===_0xf4e7('0x17')&&typeof _0xe1a127[_0xf4e7('0x18')]===_0xf4e7('0x17');var _0x118885=_0x198dc0[_0xf4e7('0x19')];var _0x118aeb=_0x2fc150?0x0:_0xe1a127[_0xf4e7('0x16')];var _0x529de1=_0x2fc150?_0x198dc0[_0xf4e7('0x19')]:_0xe1a127[_0xf4e7('0x16')]+_0xe1a127['limit'];var _0x3acfe0;if(_0x529de1>=_0x118885){_0x529de1=_0x118885;_0x3acfe0=0xc8;}else{_0x3acfe0=0xce;}_0x3a2ea7[_0xf4e7('0x14')](_0x3acfe0);return _0x3a2ea7[_0xf4e7('0x1a')](_0xf4e7('0x1b'),_0x118aeb+'-'+_0x529de1+'/'+_0x118885)['json'](_0x198dc0);}return null;};}function patchUpdates(_0x456d30){return function(_0x19260b){try{jsonpatch[_0xf4e7('0x1c')](_0x19260b,_0x456d30,!![]);}catch(_0x524a6c){return BPromise['reject'](_0x524a6c);}return _0x19260b[_0xf4e7('0x1d')]();};}function saveUpdates(_0x5efd89,_0x51aae7){return function(_0x1cfd83){if(_0x1cfd83){return _0x1cfd83[_0xf4e7('0x1e')](_0x5efd89)[_0xf4e7('0x1f')](function(_0x145c96){return _0x145c96;});}return null;};}function removeEntity(_0x5b2743,_0x3b7d37){return function(_0x5a53b2){if(_0x5a53b2){return _0x5a53b2[_0xf4e7('0x20')]()[_0xf4e7('0x1f')](function(){var _0x2f9873=_0x5a53b2[_0xf4e7('0x21')]({'plain':!![]});var _0x4badc4=_0xf4e7('0x22');return db[_0xf4e7('0x23')][_0xf4e7('0x20')]({'where':{'type':_0x4badc4,'resourceId':_0x2f9873['id']}})[_0xf4e7('0x1f')](function(){return _0x5a53b2;});})[_0xf4e7('0x1f')](function(){_0x5b2743['status'](0xcc)[_0xf4e7('0x13')]();});}};}function handleEntityNotFound(_0x43cb2d,_0x562866){return function(_0x23f18f){if(!_0x23f18f){_0x43cb2d[_0xf4e7('0x12')](0x194);}return _0x23f18f;};}function handleError(_0x959613,_0x26812c){_0x26812c=_0x26812c||0x1f4;return function(_0x35d74b){logger[_0xf4e7('0x24')](_0x35d74b['stack']);if(_0x35d74b['name']){delete _0x35d74b['name'];}_0x959613[_0xf4e7('0x14')](_0x26812c)[_0xf4e7('0x25')](_0x35d74b);};}exports[_0xf4e7('0x26')]=function(_0x3a94c6,_0x23058c){var _0x38dd7e={},_0x313f0a={},_0x4f4ada={'count':0x0,'rows':[]};var _0x55f592=_[_0xf4e7('0x27')](db['Campaign'][_0xf4e7('0x28')],function(_0x287833){return{'name':_0x287833[_0xf4e7('0x29')],'type':_0x287833[_0xf4e7('0x2a')][_0xf4e7('0x2b')]};});_0x313f0a[_0xf4e7('0x2c')]=_[_0xf4e7('0x27')](_0x55f592,_0xf4e7('0x2d'));_0x313f0a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x3a94c6[_0xf4e7('0x2e')]);_0x313f0a[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x313f0a[_0xf4e7('0x2c')],_0x313f0a['query']);_0x38dd7e['attributes']=_['intersection'](_0x313f0a['model'],qs['fields'](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x38dd7e['attributes']=_0x38dd7e[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x38dd7e['attributes']:_0x313f0a[_0xf4e7('0x2c')];if(!_0x3a94c6['query']['hasOwnProperty'](_0xf4e7('0x35'))){_0x38dd7e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x3a94c6[_0xf4e7('0x2e')]['limit']);_0x38dd7e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x3a94c6['query'][_0xf4e7('0x16')]);}_0x38dd7e['order']=qs[_0xf4e7('0x36')](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x38dd7e[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x3a94c6[_0xf4e7('0x2e')],_0x313f0a[_0xf4e7('0x30')]),_0x55f592);if(_0x3a94c6['query'][_0xf4e7('0x39')]){_0x38dd7e[_0xf4e7('0x37')]=_['merge'](_0x38dd7e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x55f592,function(_0x4ffc97){if(_0x4ffc97[_0xf4e7('0x2a')]!==_0xf4e7('0x3a')){var _0x2161e4={};_0x2161e4[_0x4ffc97['name']]={'$like':'%'+_0x3a94c6['query'][_0xf4e7('0x39')]+'%'};return _0x2161e4;}})});}_0x38dd7e=_['merge']({},_0x38dd7e,_0x3a94c6['options']);var _0x28ad1f={'where':_0x38dd7e[_0xf4e7('0x37')]};return db[_0xf4e7('0x3b')]['count'](_0x28ad1f)[_0xf4e7('0x1f')](function(_0x256ce4){_0x4f4ada[_0xf4e7('0x19')]=_0x256ce4;if(_0x3a94c6[_0xf4e7('0x2e')]['includeAll']){_0x38dd7e[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0xf4e7('0x3d')](_0x38dd7e);})[_0xf4e7('0x1f')](function(_0x551ed3){_0x4f4ada[_0xf4e7('0x3e')]=_0x551ed3;return _0x4f4ada;})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x23058c,_0x38dd7e))[_0xf4e7('0x3f')](handleError(_0x23058c,null));};exports['show']=function(_0x387c00,_0x371af3){var _0x133844={'raw':![],'where':{'id':_0x387c00['params']['id']}},_0x26136b={};_0x26136b[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x26136b[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x387c00[_0xf4e7('0x2e')]);_0x26136b[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],_0x26136b[_0xf4e7('0x2e')]);_0x133844['attributes']=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x387c00['query'][_0xf4e7('0x32')]));_0x133844[_0xf4e7('0x33')]=_0x133844[_0xf4e7('0x33')]['length']?_0x133844['attributes']:_0x26136b['model'];if(_0x387c00[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x133844['include']=[{'all':!![]}];}_0x133844=_['merge']({},_0x133844,_0x387c00[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x133844)[_0xf4e7('0x1f')](handleEntityNotFound(_0x371af3,null))['then'](respondWithResult(_0x371af3,null))[_0xf4e7('0x3f')](handleError(_0x371af3,null));};exports['create']=function(_0x32027a,_0x30814b){return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_0x32027a[_0xf4e7('0x44')],{})[_0xf4e7('0x1f')](function(_0x37a7b3){var _0x4d9248=_0x32027a[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x4d9248)throw new Error(_0xf4e7('0x46'));if(_0x4d9248[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x2cb0fb=_0x37a7b3[_0xf4e7('0x21')]({'plain':!![]});var _0x2381f3=_0xf4e7('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x2381f3,'userProfileId':_0x4d9248[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x4a1c58){if(_0x4a1c58&&_0x4a1c58[_0xf4e7('0x49')]===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x2cb0fb[_0xf4e7('0x2d')],'resourceId':_0x2cb0fb['id'],'type':_0x4a1c58[_0xf4e7('0x2d')],'sectionId':_0x4a1c58['id']},{})[_0xf4e7('0x1f')](function(){return _0x37a7b3;});}else{return _0x37a7b3;}})['catch'](function(_0x14beb1){logger[_0xf4e7('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14beb1);throw _0x14beb1;});}return _0x37a7b3;})['then'](respondWithResult(_0x30814b,0xc9))[_0xf4e7('0x3f')](handleError(_0x30814b,null));};exports['clone']=function(_0x15c76c,_0x3c0d26){var _0x28ee07={'where':{'id':_0x15c76c[_0xf4e7('0x4a')]['id']}},_0x22c0dc={};_0x22c0dc[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x28ee07[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x22c0dc[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x28ee07[_0xf4e7('0x33')]=_0x28ee07[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x28ee07[_0xf4e7('0x33')]:_0x22c0dc[_0xf4e7('0x2c')];if(_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x28ee07[_0xf4e7('0x3c')]=[{'all':!![]}];}_0x28ee07=_[_0xf4e7('0x4b')]({},_0x28ee07,_0x15c76c[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x28ee07)[_0xf4e7('0x1f')](handleEntityNotFound(_0x3c0d26,null))['then'](function(_0x1ba960){if(_0x1ba960){var _0x6660b4=_0x1ba960[_0xf4e7('0x21')]({'plain':!![]});_0x6660b4=qs[_0xf4e7('0x4c')](_0x6660b4,['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);_0x15c76c[_0xf4e7('0x44')]=_[_0xf4e7('0x4c')](_0x15c76c[_0xf4e7('0x44')],['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_[_0xf4e7('0x4b')](_0x6660b4,_0x15c76c['body']),{'include':_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]?[{'all':!![]}]:undefined})[_0xf4e7('0x1f')](function(_0x3a5bd5){var _0x3ffb08=_0x15c76c[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x3ffb08)throw new Error(_0xf4e7('0x46'));if(_0x3ffb08[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x53ba9d=_0x3a5bd5[_0xf4e7('0x21')]({'plain':!![]});var _0x55479e=_0xf4e7('0x22');return db[_0xf4e7('0x4f')][_0xf4e7('0x42')]({'where':{'name':_0x55479e,'userProfileId':_0x3ffb08[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x1c86a){if(_0x1c86a&&_0x1c86a['autoAssociation']===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x53ba9d['name'],'resourceId':_0x53ba9d['id'],'type':_0x1c86a[_0xf4e7('0x2d')],'sectionId':_0x1c86a['id']},{})[_0xf4e7('0x1f')](function(){return _0x3a5bd5;});}else{return _0x3a5bd5;}})[_0xf4e7('0x3f')](function(_0x2e7e7c){logger[_0xf4e7('0x24')](_0xf4e7('0x50'),_0x2e7e7c);throw _0x2e7e7c;});}return _0x3a5bd5;});}})[_0xf4e7('0x1f')](respondWithResult(_0x3c0d26,0xc9))[_0xf4e7('0x3f')](handleError(_0x3c0d26,null));};exports[_0xf4e7('0x1e')]=function(_0x3f5a82,_0x4ac213){if(_0x3f5a82[_0xf4e7('0x44')]['id']){delete _0x3f5a82[_0xf4e7('0x44')]['id'];}return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x3f5a82['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x4ac213,null))[_0xf4e7('0x1f')](saveUpdates(_0x3f5a82['body'],null))[_0xf4e7('0x1f')](respondWithResult(_0x4ac213,null))[_0xf4e7('0x3f')](handleError(_0x4ac213,null));};exports[_0xf4e7('0x20')]=function(_0x4c9249,_0xe53c75){return db['Campaign'][_0xf4e7('0x42')]({'where':{'id':_0x4c9249[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0xe53c75,null))[_0xf4e7('0x1f')](removeEntity(_0xe53c75,null))[_0xf4e7('0x3f')](handleError(_0xe53c75,null));};exports[_0xf4e7('0x51')]=function(_0x45fe2e,_0x282070,_0x1eab05){var _0x553cfc={'raw':!![],'where':{}};var _0x3f0b62={};var _0x2bb2a4={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x45fe2e[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x282070,null))[_0xf4e7('0x1f')](function(_0x39dd04){if(_0x39dd04){_0x3f0b62[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x53')][_0xf4e7('0x28')]);_0x3f0b62[_0xf4e7('0x2e')]=_['keys'](_0x45fe2e[_0xf4e7('0x2e')]);_0x3f0b62[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],_0x3f0b62[_0xf4e7('0x2e')]);_0x553cfc[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x45fe2e['query']['fields']));_0x553cfc[_0xf4e7('0x33')]=_0x553cfc[_0xf4e7('0x33')]['length']?_0x553cfc[_0xf4e7('0x33')]:_0x3f0b62[_0xf4e7('0x2c')];if(!_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x553cfc[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x553cfc[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}_0x553cfc[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x45fe2e[_0xf4e7('0x2e')]['sort']);_0x553cfc[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x45fe2e['query'],_0x3f0b62['filters']));_0x553cfc['where'][_0xf4e7('0x56')]=_0x39dd04['id'];if(_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x553cfc['where']=_[_0xf4e7('0x4b')](_0x553cfc[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x553cfc['attributes'],function(_0x5c5605){var _0x53d3b1={};_0x53d3b1[_0x5c5605]={'$like':'%'+_0x45fe2e['query']['filter']+'%'};return _0x53d3b1;})});}_0x553cfc=_[_0xf4e7('0x4b')]({},_0x553cfc,_0x45fe2e['options']);return db[_0xf4e7('0x53')][_0xf4e7('0x19')]({'where':_0x553cfc['where']})[_0xf4e7('0x1f')](function(_0x386849){_0x2bb2a4[_0xf4e7('0x19')]=_0x386849;if(_0x45fe2e[_0xf4e7('0x2e')]['includeAll']){_0x553cfc[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x53')]['findAll'](_0x553cfc);})['then'](function(_0x93e024){_0x2bb2a4[_0xf4e7('0x3e')]=_0x93e024;return _0x2bb2a4;});}})['then'](respondWithFilteredResult(_0x282070,_0x553cfc))[_0xf4e7('0x3f')](handleError(_0x282070,null));};exports[_0xf4e7('0x57')]=function(_0x4e0829,_0x32d975,_0x1fbed6){var _0x58ccf2={'raw':!![],'where':{}};var _0x29d4ae={};var _0x5517f1={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x4e0829[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32d975,null))['then'](function(_0x4c0c4b){if(_0x4c0c4b){_0x29d4ae['model']=_[_0xf4e7('0x2f')](db[_0xf4e7('0x58')]['rawAttributes']);_0x29d4ae[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x4e0829['query']);_0x29d4ae[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x29d4ae[_0xf4e7('0x2c')],_0x29d4ae[_0xf4e7('0x2e')]);_0x58ccf2[_0xf4e7('0x33')]=_['intersection'](_0x29d4ae[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x58ccf2[_0xf4e7('0x33')]=_0x58ccf2['attributes']['length']?_0x58ccf2[_0xf4e7('0x33')]:_0x29d4ae[_0xf4e7('0x2c')];if(!_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x58ccf2[_0xf4e7('0x18')]=qs['limit'](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x58ccf2[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x4e0829['query'][_0xf4e7('0x16')]);}_0x58ccf2[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x4e0829['query'][_0xf4e7('0x36')]);_0x58ccf2[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x4e0829[_0xf4e7('0x2e')],_0x29d4ae[_0xf4e7('0x30')]));_0x58ccf2[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x4c0c4b['id'];if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x58ccf2[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x58ccf2[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x58ccf2['attributes'],function(_0x4fc67d){var _0x4c44d6={};_0x4c44d6[_0x4fc67d]={'$like':'%'+_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4c44d6;})});}_0x58ccf2=_[_0xf4e7('0x4b')]({},_0x58ccf2,_0x4e0829[_0xf4e7('0x41')]);return db[_0xf4e7('0x58')]['count']({'where':_0x58ccf2[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x5d8caa){_0x5517f1['count']=_0x5d8caa;if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x58ccf2['include']=[{'all':!![]}];}return db[_0xf4e7('0x58')][_0xf4e7('0x3d')](_0x58ccf2);})[_0xf4e7('0x1f')](function(_0x412dfe){_0x5517f1[_0xf4e7('0x3e')]=_0x412dfe;return _0x5517f1;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x32d975,_0x58ccf2))[_0xf4e7('0x3f')](handleError(_0x32d975,null));};exports[_0xf4e7('0x59')]=function(_0x1437b6,_0x52aca0,_0xf76238){var _0x3dcabd={'raw':!![],'where':{}};var _0x3c6c75={};var _0x15d808={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x1437b6[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x52aca0,null))[_0xf4e7('0x1f')](function(_0x54d487){if(_0x54d487){_0x3c6c75['model']=_[_0xf4e7('0x2f')](db['CmHopperFinal'][_0xf4e7('0x28')]);_0x3c6c75[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x1437b6[_0xf4e7('0x2e')]);_0x3c6c75[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3c6c75[_0xf4e7('0x2c')],_0x3c6c75[_0xf4e7('0x2e')]);_0x3dcabd['attributes']=_['intersection'](_0x3c6c75['model'],qs[_0xf4e7('0x32')](_0x1437b6['query'][_0xf4e7('0x32')]));_0x3dcabd[_0xf4e7('0x33')]=_0x3dcabd['attributes'][_0xf4e7('0x34')]?_0x3dcabd[_0xf4e7('0x33')]:_0x3c6c75['model'];if(!_0x1437b6['query']['hasOwnProperty']('nolimit')){_0x3dcabd[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x1437b6['query'][_0xf4e7('0x18')]);_0x3dcabd[_0xf4e7('0x16')]=qs['offset'](_0x1437b6['query'][_0xf4e7('0x16')]);}_0x3dcabd[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x1437b6['query'][_0xf4e7('0x36')]);_0x3dcabd[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x1437b6[_0xf4e7('0x2e')],_0x3c6c75[_0xf4e7('0x30')]));_0x3dcabd[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x54d487['id'];if(_0x1437b6[_0xf4e7('0x2e')]['filter']){_0x3dcabd[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x3dcabd[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x3dcabd['attributes'],function(_0x41bdb4){var _0x4bfe66={};_0x4bfe66[_0x41bdb4]={'$like':'%'+_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4bfe66;})});}_0x3dcabd=_[_0xf4e7('0x4b')]({},_0x3dcabd,_0x1437b6[_0xf4e7('0x41')]);return db['CmHopperFinal'][_0xf4e7('0x19')]({'where':_0x3dcabd[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4516cd){_0x15d808[_0xf4e7('0x19')]=_0x4516cd;if(_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x3dcabd[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x5a')][_0xf4e7('0x3d')](_0x3dcabd);})[_0xf4e7('0x1f')](function(_0x5f2c06){_0x15d808['rows']=_0x5f2c06;return _0x15d808;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x52aca0,_0x3dcabd))[_0xf4e7('0x3f')](handleError(_0x52aca0,null));};exports['getHopperBlacks']=function(_0x2fa7ed,_0x16b2c3,_0x46ab86){var _0x45b883={'raw':!![],'where':{}};var _0xd2548e={};var _0x102ed5={'count':0x0,'rows':[]};return db['Campaign'][_0xf4e7('0x52')]({'where':{'id':_0x2fa7ed[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16b2c3,null))[_0xf4e7('0x1f')](function(_0x45a09a){if(_0x45a09a){_0xd2548e[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db['CmHopperBlack'][_0xf4e7('0x28')]);_0xd2548e[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x2fa7ed[_0xf4e7('0x2e')]);_0xd2548e[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xd2548e['model'],_0xd2548e[_0xf4e7('0x2e')]);_0x45b883['attributes']=_[_0xf4e7('0x31')](_0xd2548e[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x2fa7ed[_0xf4e7('0x2e')]['fields']));_0x45b883[_0xf4e7('0x33')]=_0x45b883[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x45b883[_0xf4e7('0x33')]:_0xd2548e['model'];if(!_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x45b883[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x2fa7ed[_0xf4e7('0x2e')]['limit']);_0x45b883['offset']=qs[_0xf4e7('0x16')](_0x2fa7ed['query'][_0xf4e7('0x16')]);}_0x45b883[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x45b883[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x2fa7ed[_0xf4e7('0x2e')],_0xd2548e[_0xf4e7('0x30')]));_0x45b883[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x45a09a['id'];if(_0x2fa7ed[_0xf4e7('0x2e')]['filter']){_0x45b883[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x45b883['where'],{'$or':_[_0xf4e7('0x27')](_0x45b883['attributes'],function(_0xec097b){var _0x3d49cf={};_0x3d49cf[_0xec097b]={'$like':'%'+_0x2fa7ed['query'][_0xf4e7('0x39')]+'%'};return _0x3d49cf;})});}_0x45b883=_[_0xf4e7('0x4b')]({},_0x45b883,_0x2fa7ed[_0xf4e7('0x41')]);return db[_0xf4e7('0x5b')][_0xf4e7('0x19')]({'where':_0x45b883[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4d682b){_0x102ed5[_0xf4e7('0x19')]=_0x4d682b;if(_0x2fa7ed['query'][_0xf4e7('0x40')]){_0x45b883[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x45b883);})[_0xf4e7('0x1f')](function(_0x48ad82){_0x102ed5[_0xf4e7('0x3e')]=_0x48ad82;return _0x102ed5;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x16b2c3,_0x45b883))[_0xf4e7('0x3f')](handleError(_0x16b2c3,null));};exports[_0xf4e7('0x5c')]=function(_0x35c5d8,_0x28c48c,_0x5bc22d){var _0x47fd8e={};var _0x47c08a={};var _0x3b8170;var _0x57a6dd;return db['Campaign']['findOne']({'where':{'id':_0x35c5d8['params']['id']}})['then'](handleEntityNotFound(_0x28c48c,null))[_0xf4e7('0x1f')](function(_0x23b249){if(_0x23b249){_0x3b8170=_0x23b249;_0x47c08a[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0x47c08a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x35c5d8[_0xf4e7('0x2e')]);_0x47c08a['filters']=_[_0xf4e7('0x31')](_0x47c08a['model'],_0x47c08a[_0xf4e7('0x2e')]);_0x47fd8e['attributes']=_[_0xf4e7('0x31')](_0x47c08a[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x47fd8e[_0xf4e7('0x33')]=_0x47fd8e['attributes'][_0xf4e7('0x34')]?_0x47fd8e[_0xf4e7('0x33')]:_0x47c08a[_0xf4e7('0x2c')];_0x47fd8e[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x47fd8e[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x35c5d8[_0xf4e7('0x2e')],_0x47c08a[_0xf4e7('0x30')]));if(_0x35c5d8['query'][_0xf4e7('0x39')]){_0x47fd8e[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x47fd8e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x47fd8e[_0xf4e7('0x33')],function(_0x27cb64){var _0x650668={};_0x650668[_0x27cb64]={'$like':'%'+_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x650668;})});}_0x47fd8e=_[_0xf4e7('0x4b')]({},_0x47fd8e,_0x35c5d8[_0xf4e7('0x41')]);return _0x3b8170['getLists'](_0x47fd8e);}})['then'](function(_0x1df9ef){if(_0x1df9ef){_0x57a6dd=_0x1df9ef['length'];if(!_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x47fd8e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x35c5d8['query'][_0xf4e7('0x18')]);_0x47fd8e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x35c5d8['query'][_0xf4e7('0x16')]);}return _0x3b8170[_0xf4e7('0x5c')](_0x47fd8e);}})[_0xf4e7('0x1f')](function(_0x27db3d){if(_0x27db3d){return _0x27db3d?{'count':_0x57a6dd,'rows':_0x27db3d}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x28c48c,null))[_0xf4e7('0x3f')](handleError(_0x28c48c,null));};exports[_0xf4e7('0x5e')]=function(_0x298f72,_0x5a5610,_0x4c9d2a){var _0x4b6d7f,_0x3e2421;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x298f72[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a5610,null))[_0xf4e7('0x1f')](function(_0x24fe8a){if(_0x24fe8a){_0x3e2421=_0x24fe8a;return _0x24fe8a[_0xf4e7('0x5e')](_0x298f72[_0xf4e7('0x44')]['ids'],_[_0xf4e7('0x4c')](_0x298f72[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x2114a8){var _0xfe2a56;_0x4b6d7f=_0x2114a8||[];var _0x31e981=[];if(_0x2114a8){for(var _0x50ab11=0x0;_0x50ab11<_0x2114a8[_0xf4e7('0x34')];_0x50ab11+=0x1){var _0x2bba4d=_0x2114a8[_0x50ab11][_0xf4e7('0x21')]({'plain':!![]});_0x3e2421[_0xf4e7('0x61')]=_0x298f72[_0xf4e7('0x44')][_0xf4e7('0x61')]?_0x298f72['body'][_0xf4e7('0x61')]:_0x3e2421[_0xf4e7('0x61')];switch(_0x3e2421[_0xf4e7('0x61')]){case _0xf4e7('0x62'):_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x65'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt',_0xf4e7('0x68'),_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x6c'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))[_0xf4e7('0x37')](_0xf4e7('0x72'))['where'](_0xf4e7('0x73'),_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()['field'](_0xf4e7('0x76'))[_0xf4e7('0x70')](_0xf4e7('0x77'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]()))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')]('COALESCE(phone,\x27\x27)')[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]())))[_0xf4e7('0x6e')]();break;case'onlyIfOpen':_0xfe2a56=squel['insert']()[_0xf4e7('0x64')](_0xf4e7('0x65'))['fromQuery']([_0xf4e7('0x67'),_0xf4e7('0x6c'),_0xf4e7('0x68'),_0xf4e7('0x69'),'CampaignId',_0xf4e7('0x4d'),_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')[_0xf4e7('0x6b')]('id',_0xf4e7('0x68'))[_0xf4e7('0x6b')](_0x2bba4d['CmListId'][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),'CampaignId')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))['where'](_0xf4e7('0x72'))[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))[_0xf4e7('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x79'))[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id']['toString']())))[_0xf4e7('0x6e')]();break;default:_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')]('cm_hopper')[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt','ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),'createdAt',_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')['field']('id',_0xf4e7('0x68'))['field'](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))['field'](_0xf4e7('0x6f'),_0xf4e7('0x4d'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4e'))[_0xf4e7('0x70')]('cm_contacts')[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')]['toString']())[_0xf4e7('0x37')](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();}_0x31e981['push'](db['sequelize'][_0xf4e7('0x2e')](_0xfe2a56));}return BPromise['all'](_0x31e981);}})[_0xf4e7('0x1f')](function(){return _0x4b6d7f;})[_0xf4e7('0x1f')](respondWithResult(_0x5a5610,null))[_0xf4e7('0x3f')](handleError(_0x5a5610,null));};exports['removeLists']=function(_0x5c51a0,_0x5b100b,_0x50cbf3){return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x5c51a0[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5b100b,null))['then'](function(_0x21813a){if(_0x21813a){return _0x21813a[_0xf4e7('0x7a')](_0x5c51a0[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x2342fb){if(_0x2342fb){return db['CmHopper'][_0xf4e7('0x20')]({'where':{'ListId':_0x5c51a0[_0xf4e7('0x2e')]['ids'],'CampaignId':_0x5c51a0['params']['id']}})['then'](function(){return _0x2342fb;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5b100b,null))[_0xf4e7('0x3f')](handleError(_0x5b100b,null));};exports[_0xf4e7('0x7b')]=function(_0x105c66,_0x3ff03a,_0xa1a61e){var _0x2961db={};var _0xc98288={};var _0x549018;var _0x59c2b2;return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x105c66[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x3ff03a,null))[_0xf4e7('0x1f')](function(_0x612d43){if(_0x612d43){_0x549018=_0x612d43;_0xc98288[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0xc98288[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x105c66[_0xf4e7('0x2e')]);_0xc98288[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],_0xc98288[_0xf4e7('0x2e')]);_0x2961db[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x105c66[_0xf4e7('0x2e')]['fields']));_0x2961db['attributes']=_0x2961db['attributes'][_0xf4e7('0x34')]?_0x2961db[_0xf4e7('0x33')]:_0xc98288[_0xf4e7('0x2c')];_0x2961db['order']=qs[_0xf4e7('0x36')](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x2961db[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x105c66[_0xf4e7('0x2e')],_0xc98288[_0xf4e7('0x30')]));if(_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x2961db[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x2961db['where'],{'$or':_[_0xf4e7('0x27')](_0x2961db[_0xf4e7('0x33')],function(_0x530d1b){var _0x1059b6={};_0x1059b6[_0x530d1b]={'$like':'%'+_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x1059b6;})});}_0x2961db=_[_0xf4e7('0x4b')]({},_0x2961db,_0x105c66[_0xf4e7('0x41')]);return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x461957){if(_0x461957){_0x59c2b2=_0x461957['length'];if(!_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x2961db[_0xf4e7('0x18')]=qs['limit'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x2961db[_0xf4e7('0x16')]=qs['offset'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x42082f){if(_0x42082f){return _0x42082f?{'count':_0x59c2b2,'rows':_0x42082f}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x3ff03a,null))[_0xf4e7('0x3f')](handleError(_0x3ff03a,null));};exports[_0xf4e7('0x7c')]=function(_0x2135fb,_0x395d0c,_0x3f1f53){var _0x49970a,_0x5f04f0;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x2135fb[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x395d0c,null))[_0xf4e7('0x1f')](function(_0x5c05f0){if(_0x5c05f0){_0x5f04f0=_0x5c05f0;return _0x5c05f0['addBlackLists'](_0x2135fb['body'][_0xf4e7('0x5f')],_[_0xf4e7('0x4c')](_0x2135fb[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x4c3d4c){var _0xc85f72;_0x49970a=_0x4c3d4c||[];var _0xc0013d=[];if(_0x4c3d4c){for(var _0x5f5109=0x0;_0x5f5109<_0x4c3d4c['length'];_0x5f5109+=0x1){var _0x27c58a=_0x4c3d4c[_0x5f5109][_0xf4e7('0x21')]({'plain':!![]});_0xc85f72=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x7d'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel['select']()['field'](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x27c58a[_0xf4e7('0x6d')]['toString'](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x2135fb[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4d'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))['from'](_0xf4e7('0x71'))[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')](_0xf4e7('0x73'),_0x27c58a[_0xf4e7('0x6d')]['toString']())['where'](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();_0xc0013d[_0xf4e7('0x7e')](db[_0xf4e7('0x7f')][_0xf4e7('0x2e')](_0xc85f72));}return BPromise['all'](_0xc0013d);}})[_0xf4e7('0x1f')](function(){return _0x49970a;})[_0xf4e7('0x1f')](respondWithResult(_0x395d0c,null))[_0xf4e7('0x3f')](handleError(_0x395d0c,null));};exports[_0xf4e7('0x80')]=function(_0x2f9850,_0x5d32c3,_0x487ef5){return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x2f9850['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5d32c3,null))[_0xf4e7('0x1f')](function(_0x44d717){if(_0x44d717){return _0x44d717['removeBlackLists'](_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x285c32){if(_0x285c32){return db[_0xf4e7('0x5b')][_0xf4e7('0x20')]({'where':{'ListId':_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')],'CampaignId':_0x2f9850[_0xf4e7('0x4a')]['id']}})['then'](function(){return _0x285c32;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5d32c3,null))[_0xf4e7('0x3f')](handleError(_0x5d32c3,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 401890d..cf677b2 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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_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':'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 cc8ef8d..81c26b4 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 _0xe189=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe189,0x194));var _0x9e18=function(_0x29cbba,_0x5355bf){_0x29cbba=_0x29cbba-0x0;var _0x411a9e=_0xe189[_0x29cbba];return _0x411a9e;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e18('0x1'));var rs=require(_0x9e18('0x2'));var fs=require('fs');var Redis=require(_0x9e18('0x3'));var db=require(_0x9e18('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e18('0x5'));var config=require(_0x9e18('0x6'));var jayson=require(_0x9e18('0x7'));var client=jayson[_0x9e18('0x8')][_0x9e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6097,_0x3153cf,_0x2e4691){return new BPromise(function(_0x4656a4,_0x50a0ce){return client[_0x9e18('0xa')](_0x5e6097,_0x2e4691)[_0x9e18('0xb')](function(_0x33e9cd){logger['info'](_0x9e18('0xc'),_0x3153cf,_0x9e18('0xd'));logger[_0x9e18('0xe')](_0x9e18('0xf'),_0x3153cf,_0x9e18('0xd'),JSON[_0x9e18('0x10')](_0x33e9cd));if(_0x33e9cd[_0x9e18('0x11')]){if(_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x12')]===0x1f4){logger['error'](_0x9e18('0xc'),_0x3153cf,_0x33e9cd['error'][_0x9e18('0x13')]);return _0x50a0ce(_0x33e9cd[_0x9e18('0x11')]['message']);}logger[_0x9e18('0x11')](_0x9e18('0xc'),_0x3153cf,_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x13')]);return _0x4656a4(_0x33e9cd['error'][_0x9e18('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x3153cf,_0x9e18('0xd'));_0x4656a4(_0x33e9cd['result'][_0x9e18('0x13')]);}})[_0x9e18('0x14')](function(_0x1f71fc){logger[_0x9e18('0x11')]('Campaign,\x20%s,\x20%s',_0x3153cf,_0x1f71fc);_0x50a0ce(_0x1f71fc);});});}exports['GetCampaign']=function(_0x15cf20){var _0x446098=this;return new Promise(function(_0x57cd1f,_0x1aa23f){return db['Campaign'][_0x9e18('0x15')]({'raw':_0x15cf20['options']?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x17')]===undefined?!![]:![]:!![],'where':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x18')]||null:null,'attributes':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x19')]||null:null,'limit':_0x15cf20[_0x9e18('0x16')]?_0x15cf20['options'][_0x9e18('0x1a')]||null:null,'include':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')]['include']?_[_0x9e18('0x1b')](_0x15cf20['options'][_0x9e18('0x1c')],function(_0x50131d){return{'model':db[_0x50131d[_0x9e18('0x1d')]],'as':_0x50131d['as'],'attributes':_0x50131d['attributes'],'include':_0x50131d[_0x9e18('0x1c')]?_[_0x9e18('0x1b')](_0x50131d['include'],function(_0x12f90d){return{'model':db[_0x12f90d['model']],'as':_0x12f90d['as'],'attributes':_0x12f90d['attributes'],'include':_0x12f90d[_0x9e18('0x1c')]?_['map'](_0x12f90d[_0x9e18('0x1c')],function(_0x49a3d6){return{'model':db[_0x49a3d6[_0x9e18('0x1d')]],'as':_0x49a3d6['as'],'attributes':_0x49a3d6[_0x9e18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9e18('0xb')](function(_0xd115f3){logger[_0x9e18('0x1e')](_0x9e18('0x1f'),_0x15cf20);logger[_0x9e18('0xe')](_0x9e18('0x1f'),_0x15cf20,JSON[_0x9e18('0x10')](_0xd115f3));_0x57cd1f(_0xd115f3);})['catch'](function(_0x2ee4da){logger[_0x9e18('0x11')](_0x9e18('0x1f'),_0x2ee4da[_0x9e18('0x13')],_0x15cf20);_0x1aa23f(_0x446098['error'](0x1f4,_0x2ee4da['message']));});});};
\ No newline at end of file
+var _0xf2cb=['code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','then','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xf2cb,0x130));var _0xbf2c=function(_0x1b2978,_0x2bfc85){_0x1b2978=_0x1b2978-0x0;var _0x73cc34=_0xf2cb[_0x1b2978];return _0x73cc34;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['Campaign'][_0xbf2c('0x14')]({'raw':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x16')]===undefined?!![]:![]:!![],'where':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x17')]||null:null,'attributes':_0x1df2ab['options']?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x18')]||null:null,'limit':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['limit']||null:null,'include':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['include']?_[_0xbf2c('0x19')](_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x1a')],function(_0x52ecb4){return{'model':db[_0x52ecb4['model']],'as':_0x52ecb4['as'],'attributes':_0x52ecb4[_0xbf2c('0x18')],'include':_0x52ecb4[_0xbf2c('0x1a')]?_[_0xbf2c('0x19')](_0x52ecb4[_0xbf2c('0x1a')],function(_0x108aa8){return{'model':db[_0x108aa8[_0xbf2c('0x1b')]],'as':_0x108aa8['as'],'attributes':_0x108aa8[_0xbf2c('0x18')],'include':_0x108aa8['include']?_['map'](_0x108aa8[_0xbf2c('0x1a')],function(_0xcbd882){return{'model':db[_0xcbd882[_0xbf2c('0x1b')]],'as':_0xcbd882['as'],'attributes':_0xcbd882[_0xbf2c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbf2c('0x1c')](function(_0x4a0257){logger[_0xbf2c('0x8')](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')]('GetCampaign',_0x1df2ab,JSON[_0xbf2c('0xd')](_0x4a0257));_0x32a44d(_0x4a0257);})['catch'](function(_0x3a9130){logger[_0xbf2c('0xe')](_0xbf2c('0x13'),_0x3a9130[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x3a9130['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 8482611..e86a006 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 _0x73d7=['/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','removeBlackLists','util','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','isAuthenticated','index','/:id','show','getHoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x73d7,0x135));var _0x773d=function(_0x3371f6,_0x4d7264){_0x3371f6=_0x3371f6-0x0;var _0x2a182d=_0x73d7[_0x3371f6];return _0x2a182d;};'use strict';var multer=require('multer');var util=require(_0x773d('0x0'));var path=require('path');var timeout=require(_0x773d('0x1'));var express=require(_0x773d('0x2'));var router=express[_0x773d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x773d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x773d('0x5'));router['get']('/',auth[_0x773d('0x6')](),controller[_0x773d('0x7')]);router['get'](_0x773d('0x8'),auth['isAuthenticated'](),controller[_0x773d('0x9')]);router['get']('/:id/hoppers',auth[_0x773d('0x6')](),controller[_0x773d('0xa')]);router[_0x773d('0xb')](_0x773d('0xc'),auth[_0x773d('0x6')](),controller[_0x773d('0xd')]);router['get'](_0x773d('0xe'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x773d('0xb')](_0x773d('0xf'),auth[_0x773d('0x6')](),controller[_0x773d('0x10')]);router[_0x773d('0xb')](_0x773d('0x11'),auth[_0x773d('0x6')](),controller[_0x773d('0x12')]);router[_0x773d('0x13')]('/',auth[_0x773d('0x6')](),controller[_0x773d('0x14')]);router[_0x773d('0x13')](_0x773d('0x15'),auth[_0x773d('0x6')](),controller[_0x773d('0x16')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0x773d('0x17')]);router['post'](_0x773d('0x11'),auth[_0x773d('0x6')](),controller['addBlackLists']);router[_0x773d('0x18')](_0x773d('0x8'),auth[_0x773d('0x6')](),controller[_0x773d('0x19')]);router[_0x773d('0x1a')](_0x773d('0x8'),auth[_0x773d('0x6')](),controller[_0x773d('0x1b')]);router[_0x773d('0x1a')](_0x773d('0xf'),auth[_0x773d('0x6')](),controller[_0x773d('0x1c')]);router[_0x773d('0x1a')](_0x773d('0x11'),auth[_0x773d('0x6')](),controller[_0x773d('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0xcfd2=['getBlackLists','create','/:id/clone','post','addBlackLists','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xcfd2,0xe9));var _0x2cfd=function(_0x4542d4,_0x4e304b){_0x4542d4=_0x4542d4-0x0;var _0x2f4e1c=_0xcfd2[_0x4542d4];return _0x2f4e1c;};'use strict';var multer=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var path=require(_0x2cfd('0x2'));var timeout=require(_0x2cfd('0x3'));var express=require(_0x2cfd('0x4'));var router=express[_0x2cfd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2cfd('0x6'));var interaction=require(_0x2cfd('0x7'));var config=require(_0x2cfd('0x8'));var controller=require(_0x2cfd('0x9'));router['get']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xb')]);router['get'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller[_0x2cfd('0xd')]);router[_0x2cfd('0xe')]('/:id/hoppers',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xf')]);router[_0x2cfd('0xe')](_0x2cfd('0x10'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x11')]);router[_0x2cfd('0xe')](_0x2cfd('0x12'),auth['isAuthenticated'](),controller[_0x2cfd('0x13')]);router[_0x2cfd('0xe')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x2cfd('0xe')](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x15')]);router['get'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x17')]);router['post']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x18')]);router['post'](_0x2cfd('0x19'),auth[_0x2cfd('0xa')](),controller['clone']);router['post'](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller['addLists']);router[_0x2cfd('0x1a')](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1b')]);router[_0x2cfd('0x1c')](_0x2cfd('0xc'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1d')]);router['delete'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2cfd('0x1e')](_0x2cfd('0x14'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller['removeBlackLists']);module[_0x2cfd('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 e656c30..d8f34ac 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 _0x3833=['exports','TEXT','STRING','getDataValue','sequelize'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x3833,0xef));var _0x3383=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x3833[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require(_0x3383('0x0'));module[_0x3383('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3383('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3383('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3383('0x4')]('key');}}};
\ No newline at end of file
+var _0x01d2=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x3121ee,_0x1fb011){var _0x55b96c=function(_0x1b5a95){while(--_0x1b5a95){_0x3121ee['push'](_0x3121ee['shift']());}};_0x55b96c(++_0x1fb011);}(_0x01d2,0x165));var _0x201d=function(_0x25c2ba,_0x22e11b){_0x25c2ba=_0x25c2ba-0x0;var _0x4e339d=_0x01d2[_0x25c2ba];return _0x4e339d;};'use strict';var Sequelize=require(_0x201d('0x0'));module[_0x201d('0x1')]={'key':{'type':Sequelize[_0x201d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x201d('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x201d('0x2')]},'name':{'type':Sequelize[_0x201d('0x4')],'get':function(){return this[_0x201d('0x5')](_0x201d('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f20ad81..01fbe51 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 _0xa09f=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','length','include','options','find','body','create'];(function(_0x5bd3be,_0x3a08e1){var _0x250d33=function(_0xf69391){while(--_0xf69391){_0x5bd3be['push'](_0x5bd3be['shift']());}};_0x250d33(++_0x3a08e1);}(_0xa09f,0x12a));var _0xfa09=function(_0x10f63f,_0x242991){_0x10f63f=_0x10f63f-0x0;var _0xab57c6=_0xa09f[_0x10f63f];return _0xab57c6;};'use strict';var emlformat=require(_0xfa09('0x0'));var rimraf=require(_0xfa09('0x1'));var zipdir=require(_0xfa09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa09('0x3'));var moment=require(_0xfa09('0x4'));var BPromise=require(_0xfa09('0x5'));var Mustache=require(_0xfa09('0x6'));var util=require(_0xfa09('0x7'));var path=require(_0xfa09('0x8'));var sox=require(_0xfa09('0x9'));var csv=require(_0xfa09('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa09('0xb'));var _=require(_0xfa09('0xc'));var squel=require(_0xfa09('0xd'));var crypto=require('crypto');var jsforce=require(_0xfa09('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa09('0xf'));var Papa=require(_0xfa09('0x10'));var Redis=require(_0xfa09('0x11'));var authService=require(_0xfa09('0x12'));var qs=require(_0xfa09('0x13'));var as=require(_0xfa09('0x14'));var hardwareService=require(_0xfa09('0x15'));var logger=require('../../config/logger')(_0xfa09('0x16'));var utils=require(_0xfa09('0x17'));var config=require(_0xfa09('0x18'));var licenseUtil=require(_0xfa09('0x19'));var db=require(_0xfa09('0x1a'))['db'];function respondWithStatusCode(_0x22eb27,_0x359c96){_0x359c96=_0x359c96||0xcc;return function(_0x3a8010){if(_0x3a8010){return _0x22eb27[_0xfa09('0x1b')](_0x359c96);}return _0x22eb27[_0xfa09('0x1c')](_0x359c96)[_0xfa09('0x1d')]();};}function respondWithResult(_0x2666f2,_0x524bef){_0x524bef=_0x524bef||0xc8;return function(_0x2b59f8){if(_0x2b59f8){return _0x2666f2['status'](_0x524bef)[_0xfa09('0x1e')](_0x2b59f8);}};}function respondWithFilteredResult(_0x4028cb,_0x2d534c){return function(_0x140c6a){if(_0x140c6a){var _0x5e2f39=typeof _0x2d534c['offset']===_0xfa09('0x1f')&&typeof _0x2d534c['limit']==='undefined';var _0x1152d9=_0x140c6a['count'];var _0x54562e=_0x5e2f39?0x0:_0x2d534c[_0xfa09('0x20')];var _0xac2c9f=_0x5e2f39?_0x140c6a[_0xfa09('0x21')]:_0x2d534c['offset']+_0x2d534c['limit'];var _0x1be728;if(_0xac2c9f>=_0x1152d9){_0xac2c9f=_0x1152d9;_0x1be728=0xc8;}else{_0x1be728=0xce;}_0x4028cb[_0xfa09('0x1c')](_0x1be728);return _0x4028cb[_0xfa09('0x22')](_0xfa09('0x23'),_0x54562e+'-'+_0xac2c9f+'/'+_0x1152d9)['json'](_0x140c6a);}return null;};}function patchUpdates(_0x2cbd73){return function(_0x35fa98){try{jsonpatch[_0xfa09('0x24')](_0x35fa98,_0x2cbd73,!![]);}catch(_0x3830d3){return BPromise['reject'](_0x3830d3);}return _0x35fa98[_0xfa09('0x25')]();};}function saveUpdates(_0x59f8d4,_0x37e9f5){return function(_0x54219b){if(_0x54219b){return _0x54219b[_0xfa09('0x26')](_0x59f8d4)['then'](function(_0x381439){return _0x381439;});}return null;};}function removeEntity(_0x30e881,_0x1d4002){return function(_0x18266c){if(_0x18266c){return _0x18266c[_0xfa09('0x27')]()[_0xfa09('0x28')](function(){var _0x2404fd=_0x18266c[_0xfa09('0x29')]({'plain':!![]});var _0x441b76=_0xfa09('0x2a');return db[_0xfa09('0x2b')]['destroy']({'where':{'type':_0x441b76,'resourceId':_0x2404fd['id']}})[_0xfa09('0x28')](function(){return _0x18266c;});})[_0xfa09('0x28')](function(){_0x30e881['status'](0xcc)[_0xfa09('0x1d')]();});}};}function handleEntityNotFound(_0x23caed,_0x173c3b){return function(_0x2cd7ab){if(!_0x2cd7ab){_0x23caed[_0xfa09('0x1b')](0x194);}return _0x2cd7ab;};}function handleError(_0x288146,_0x27ca2f){_0x27ca2f=_0x27ca2f||0x1f4;return function(_0x2bbc6f){logger[_0xfa09('0x2c')](_0x2bbc6f[_0xfa09('0x2d')]);if(_0x2bbc6f[_0xfa09('0x2e')]){delete _0x2bbc6f['name'];}_0x288146[_0xfa09('0x1c')](_0x27ca2f)[_0xfa09('0x2f')](_0x2bbc6f);};}exports[_0xfa09('0x30')]=function(_0x344d02,_0x371853){var _0x17e514={},_0x37fa9e={},_0x4cf5e7={'count':0x0,'rows':[]};var _0x353825=_[_0xfa09('0x31')](db[_0xfa09('0x32')]['rawAttributes'],function(_0x4b7527){return{'name':_0x4b7527[_0xfa09('0x33')],'type':_0x4b7527[_0xfa09('0x34')][_0xfa09('0x35')]};});_0x37fa9e[_0xfa09('0x36')]=_[_0xfa09('0x31')](_0x353825,'name');_0x37fa9e[_0xfa09('0x37')]=_['keys'](_0x344d02[_0xfa09('0x37')]);_0x37fa9e[_0xfa09('0x38')]=_[_0xfa09('0x39')](_0x37fa9e['model'],_0x37fa9e[_0xfa09('0x37')]);_0x17e514['attributes']=_[_0xfa09('0x39')](_0x37fa9e['model'],qs[_0xfa09('0x3a')](_0x344d02[_0xfa09('0x37')][_0xfa09('0x3a')]));_0x17e514[_0xfa09('0x3b')]=_0x17e514[_0xfa09('0x3b')]['length']?_0x17e514[_0xfa09('0x3b')]:_0x37fa9e[_0xfa09('0x36')];if(!_0x344d02[_0xfa09('0x37')][_0xfa09('0x3c')]('nolimit')){_0x17e514[_0xfa09('0x3d')]=qs[_0xfa09('0x3d')](_0x344d02['query'][_0xfa09('0x3d')]);_0x17e514[_0xfa09('0x20')]=qs[_0xfa09('0x20')](_0x344d02['query'][_0xfa09('0x20')]);}_0x17e514[_0xfa09('0x3e')]=qs[_0xfa09('0x3f')](_0x344d02['query'][_0xfa09('0x3f')]);_0x17e514[_0xfa09('0x40')]=qs[_0xfa09('0x38')](_[_0xfa09('0x41')](_0x344d02[_0xfa09('0x37')],_0x37fa9e[_0xfa09('0x38')]),_0x353825);if(_0x344d02['query'][_0xfa09('0x42')]){_0x17e514[_0xfa09('0x40')]=_[_0xfa09('0x43')](_0x17e514[_0xfa09('0x40')],{'$or':[{'key':{'$like':'%'+_0x344d02[_0xfa09('0x37')][_0xfa09('0x42')]+'%'}},{'value':{'$like':'%'+_0x344d02[_0xfa09('0x37')]['filter']+'%'}}]});}_0x17e514=_[_0xfa09('0x43')]({},_0x17e514,_0x344d02['options']);var _0x3195b8={'where':_0x17e514[_0xfa09('0x40')]};return db['CannedAnswer']['count'](_0x3195b8)[_0xfa09('0x28')](function(_0x5489c9){_0x4cf5e7[_0xfa09('0x21')]=_0x5489c9;if(_0x344d02[_0xfa09('0x37')][_0xfa09('0x44')]){_0x17e514['include']=[{'all':!![]}];}return db[_0xfa09('0x32')][_0xfa09('0x45')](_0x17e514);})[_0xfa09('0x28')](function(_0x44e44b){_0x4cf5e7[_0xfa09('0x46')]=_0x44e44b;return _0x4cf5e7;})[_0xfa09('0x28')](respondWithFilteredResult(_0x371853,_0x17e514))[_0xfa09('0x47')](handleError(_0x371853,null));};exports[_0xfa09('0x48')]=function(_0x30176f,_0xfe7a73){var _0x19dc2b={'raw':!![],'where':{'id':_0x30176f[_0xfa09('0x49')]['id']}},_0x3a274e={};_0x3a274e['model']=_['keys'](db[_0xfa09('0x32')][_0xfa09('0x4a')]);_0x3a274e['query']=_[_0xfa09('0x4b')](_0x30176f[_0xfa09('0x37')]);_0x3a274e['filters']=_[_0xfa09('0x39')](_0x3a274e['model'],_0x3a274e[_0xfa09('0x37')]);_0x19dc2b[_0xfa09('0x3b')]=_[_0xfa09('0x39')](_0x3a274e['model'],qs[_0xfa09('0x3a')](_0x30176f[_0xfa09('0x37')]['fields']));_0x19dc2b[_0xfa09('0x3b')]=_0x19dc2b[_0xfa09('0x3b')][_0xfa09('0x4c')]?_0x19dc2b[_0xfa09('0x3b')]:_0x3a274e['model'];if(_0x30176f[_0xfa09('0x37')][_0xfa09('0x44')]){_0x19dc2b[_0xfa09('0x4d')]=[{'all':!![]}];}_0x19dc2b=_[_0xfa09('0x43')]({},_0x19dc2b,_0x30176f[_0xfa09('0x4e')]);return db[_0xfa09('0x32')][_0xfa09('0x4f')](_0x19dc2b)[_0xfa09('0x28')](handleEntityNotFound(_0xfe7a73,null))[_0xfa09('0x28')](respondWithResult(_0xfe7a73,null))['catch'](handleError(_0xfe7a73,null));};exports[_0xfa09('0x26')]=function(_0x388376,_0x8209c2){if(_0x388376[_0xfa09('0x50')]['id']){delete _0x388376[_0xfa09('0x50')]['id'];}return db[_0xfa09('0x32')][_0xfa09('0x4f')]({'where':{'id':_0x388376[_0xfa09('0x49')]['id']}})[_0xfa09('0x28')](handleEntityNotFound(_0x8209c2,null))['then'](saveUpdates(_0x388376[_0xfa09('0x50')],null))[_0xfa09('0x28')](respondWithResult(_0x8209c2,null))[_0xfa09('0x47')](handleError(_0x8209c2,null));};exports['destroy']=function(_0x14235f,_0x264bc7){return db['CannedAnswer'][_0xfa09('0x4f')]({'where':{'id':_0x14235f[_0xfa09('0x49')]['id']}})[_0xfa09('0x28')](handleEntityNotFound(_0x264bc7,null))[_0xfa09('0x28')](removeEntity(_0x264bc7,null))['catch'](handleError(_0x264bc7,null));};exports[_0xfa09('0x51')]=function(_0x41b675,_0x33209d){var _0x1bafb3={'key':_0x41b675[_0xfa09('0x50')]['key']};if(_0x41b675[_0xfa09('0x50')][_0xfa09('0x52')]){_0x1bafb3[_0xfa09('0x52')]=_0x41b675[_0xfa09('0x50')]['MailAccountId'];}else if(_0x41b675[_0xfa09('0x50')]['SmsAccountId']){_0x1bafb3[_0xfa09('0x53')]=_0x41b675['body'][_0xfa09('0x53')];}else if(_0x41b675['body'][_0xfa09('0x54')]){_0x1bafb3[_0xfa09('0x54')]=_0x41b675[_0xfa09('0x50')][_0xfa09('0x54')];}else if(_0x41b675[_0xfa09('0x50')]['ChatWebsiteId']){_0x1bafb3[_0xfa09('0x55')]=_0x41b675[_0xfa09('0x50')][_0xfa09('0x55')];}return db[_0xfa09('0x32')][_0xfa09('0x4f')]({'where':_0x1bafb3})[_0xfa09('0x28')](function(_0x2665b8){if(_0x2665b8){throw new db[(_0xfa09('0x56'))][(_0xfa09('0x57'))](_0xfa09('0x58'));}return db['CannedAnswer'][_0xfa09('0x51')](_0x41b675['body']);})[_0xfa09('0x28')](function(_0x2262c2){var _0xb7f993=_0x41b675[_0xfa09('0x59')][_0xfa09('0x29')]({'plain':!![]});if(!_0xb7f993)throw new Error(_0xfa09('0x5a'));if(_0xb7f993[_0xfa09('0x5b')]===_0xfa09('0x59')){var _0x543c8f=_0x2262c2[_0xfa09('0x29')]({'plain':!![]});return db[_0xfa09('0x5c')][_0xfa09('0x4f')]({'where':{'name':_0xfa09('0x2a'),'userProfileId':_0xb7f993[_0xfa09('0x5d')]},'raw':!![]})[_0xfa09('0x28')](function(_0x583a84){if(_0x583a84&&_0x583a84[_0xfa09('0x5e')]===0x0){return db[_0xfa09('0x2b')][_0xfa09('0x51')]({'name':_0x543c8f[_0xfa09('0x2e')],'resourceId':_0x543c8f['id'],'type':_0x583a84[_0xfa09('0x2e')],'sectionId':_0x583a84['id']},{})[_0xfa09('0x28')](function(){return _0x2262c2;});}else{return _0x2262c2;}})[_0xfa09('0x47')](function(_0x464aa1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x464aa1);throw _0x464aa1;});}return _0x2262c2;})[_0xfa09('0x28')](respondWithResult(_0x33209d,0xc9))[_0xfa09('0x47')](handleError(_0x33209d,null));};
\ No newline at end of file
+var _0x9f72=['ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0x9f72,0xc4));var _0x29f7=function(_0x10f754,_0x51e252){_0x10f754=_0x10f754-0x0;var _0x273708=_0x9f72[_0x10f754];return _0x273708;};'use strict';var emlformat=require(_0x29f7('0x0'));var rimraf=require(_0x29f7('0x1'));var zipdir=require(_0x29f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29f7('0x3'));var moment=require(_0x29f7('0x4'));var BPromise=require(_0x29f7('0x5'));var Mustache=require('mustache');var util=require(_0x29f7('0x6'));var path=require(_0x29f7('0x7'));var sox=require(_0x29f7('0x8'));var csv=require('to-csv');var ejs=require(_0x29f7('0x9'));var fs=require('fs');var fs_extra=require(_0x29f7('0xa'));var _=require(_0x29f7('0xb'));var squel=require('squel');var crypto=require(_0x29f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29f7('0xd'));var toCsv=require(_0x29f7('0xe'));var querystring=require(_0x29f7('0xf'));var Papa=require(_0x29f7('0x10'));var Redis=require(_0x29f7('0x11'));var authService=require(_0x29f7('0x12'));var qs=require(_0x29f7('0x13'));var as=require(_0x29f7('0x14'));var hardwareService=require(_0x29f7('0x15'));var logger=require(_0x29f7('0x16'))('api');var utils=require(_0x29f7('0x17'));var config=require(_0x29f7('0x18'));var licenseUtil=require(_0x29f7('0x19'));var db=require(_0x29f7('0x1a'))['db'];function respondWithStatusCode(_0x1ddad4,_0x139682){_0x139682=_0x139682||0xcc;return function(_0x115002){if(_0x115002){return _0x1ddad4[_0x29f7('0x1b')](_0x139682);}return _0x1ddad4['status'](_0x139682)[_0x29f7('0x1c')]();};}function respondWithResult(_0x2e1c46,_0x7def93){_0x7def93=_0x7def93||0xc8;return function(_0x2050c9){if(_0x2050c9){return _0x2e1c46['status'](_0x7def93)[_0x29f7('0x1d')](_0x2050c9);}};}function respondWithFilteredResult(_0x2e665b,_0x3a882c){return function(_0x1c7dcc){if(_0x1c7dcc){var _0xd12de1=typeof _0x3a882c[_0x29f7('0x1e')]===_0x29f7('0x1f')&&typeof _0x3a882c['limit']==='undefined';var _0x461453=_0x1c7dcc[_0x29f7('0x20')];var _0x435785=_0xd12de1?0x0:_0x3a882c[_0x29f7('0x1e')];var _0x475722=_0xd12de1?_0x1c7dcc[_0x29f7('0x20')]:_0x3a882c[_0x29f7('0x1e')]+_0x3a882c[_0x29f7('0x21')];var _0x17cbf4;if(_0x475722>=_0x461453){_0x475722=_0x461453;_0x17cbf4=0xc8;}else{_0x17cbf4=0xce;}_0x2e665b[_0x29f7('0x22')](_0x17cbf4);return _0x2e665b['set'](_0x29f7('0x23'),_0x435785+'-'+_0x475722+'/'+_0x461453)[_0x29f7('0x1d')](_0x1c7dcc);}return null;};}function patchUpdates(_0x4dc033){return function(_0x2a4423){try{jsonpatch[_0x29f7('0x24')](_0x2a4423,_0x4dc033,!![]);}catch(_0x1c9271){return BPromise[_0x29f7('0x25')](_0x1c9271);}return _0x2a4423[_0x29f7('0x26')]();};}function saveUpdates(_0x30705c,_0x3240db){return function(_0x266085){if(_0x266085){return _0x266085[_0x29f7('0x27')](_0x30705c)['then'](function(_0x4ccda3){return _0x4ccda3;});}return null;};}function removeEntity(_0x160d49,_0x290b77){return function(_0x4294ee){if(_0x4294ee){return _0x4294ee[_0x29f7('0x28')]()['then'](function(){var _0x4490e7=_0x4294ee[_0x29f7('0x29')]({'plain':!![]});var _0x4cae48='CannedAnswers';return db[_0x29f7('0x2a')][_0x29f7('0x28')]({'where':{'type':_0x4cae48,'resourceId':_0x4490e7['id']}})['then'](function(){return _0x4294ee;});})[_0x29f7('0x2b')](function(){_0x160d49[_0x29f7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36950a,_0x2a7b52){return function(_0x4e9a3a){if(!_0x4e9a3a){_0x36950a[_0x29f7('0x1b')](0x194);}return _0x4e9a3a;};}function handleError(_0x2f8655,_0x20506e){_0x20506e=_0x20506e||0x1f4;return function(_0x445ae4){logger['error'](_0x445ae4[_0x29f7('0x2c')]);if(_0x445ae4['name']){delete _0x445ae4[_0x29f7('0x2d')];}_0x2f8655[_0x29f7('0x22')](_0x20506e)[_0x29f7('0x2e')](_0x445ae4);};}exports['index']=function(_0x552cc5,_0x5318db){var _0x56cdc7={},_0x3368b0={},_0x3349c3={'count':0x0,'rows':[]};var _0x2859c8=_['map'](db[_0x29f7('0x2f')]['rawAttributes'],function(_0x3a9028){return{'name':_0x3a9028[_0x29f7('0x30')],'type':_0x3a9028[_0x29f7('0x31')][_0x29f7('0x32')]};});_0x3368b0[_0x29f7('0x33')]=_[_0x29f7('0x34')](_0x2859c8,_0x29f7('0x2d'));_0x3368b0[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x552cc5['query']);_0x3368b0[_0x29f7('0x37')]=_[_0x29f7('0x38')](_0x3368b0['model'],_0x3368b0[_0x29f7('0x35')]);_0x56cdc7[_0x29f7('0x39')]=_['intersection'](_0x3368b0[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x552cc5[_0x29f7('0x35')]['fields']));_0x56cdc7['attributes']=_0x56cdc7[_0x29f7('0x39')]['length']?_0x56cdc7[_0x29f7('0x39')]:_0x3368b0[_0x29f7('0x33')];if(!_0x552cc5['query'][_0x29f7('0x3b')](_0x29f7('0x3c'))){_0x56cdc7[_0x29f7('0x21')]=qs[_0x29f7('0x21')](_0x552cc5[_0x29f7('0x35')]['limit']);_0x56cdc7[_0x29f7('0x1e')]=qs['offset'](_0x552cc5[_0x29f7('0x35')][_0x29f7('0x1e')]);}_0x56cdc7['order']=qs[_0x29f7('0x3d')](_0x552cc5[_0x29f7('0x35')]['sort']);_0x56cdc7['where']=qs[_0x29f7('0x37')](_[_0x29f7('0x3e')](_0x552cc5['query'],_0x3368b0['filters']),_0x2859c8);if(_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]){_0x56cdc7[_0x29f7('0x40')]=_['merge'](_0x56cdc7[_0x29f7('0x40')],{'$or':[{'key':{'$like':'%'+_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]+'%'}},{'value':{'$like':'%'+_0x552cc5['query'][_0x29f7('0x3f')]+'%'}}]});}_0x56cdc7=_[_0x29f7('0x41')]({},_0x56cdc7,_0x552cc5[_0x29f7('0x42')]);var _0x25dd19={'where':_0x56cdc7[_0x29f7('0x40')]};return db[_0x29f7('0x2f')][_0x29f7('0x20')](_0x25dd19)[_0x29f7('0x2b')](function(_0x412719){_0x3349c3[_0x29f7('0x20')]=_0x412719;if(_0x552cc5['query']['includeAll']){_0x56cdc7[_0x29f7('0x43')]=[{'all':!![]}];}return db[_0x29f7('0x2f')][_0x29f7('0x44')](_0x56cdc7);})[_0x29f7('0x2b')](function(_0x16f4c7){_0x3349c3[_0x29f7('0x45')]=_0x16f4c7;return _0x3349c3;})['then'](respondWithFilteredResult(_0x5318db,_0x56cdc7))[_0x29f7('0x46')](handleError(_0x5318db,null));};exports[_0x29f7('0x47')]=function(_0x412388,_0x465199){var _0x967154={'raw':!![],'where':{'id':_0x412388[_0x29f7('0x48')]['id']}},_0x1f4f1={};_0x1f4f1[_0x29f7('0x33')]=_[_0x29f7('0x36')](db['CannedAnswer'][_0x29f7('0x49')]);_0x1f4f1[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x412388['query']);_0x1f4f1['filters']=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],_0x1f4f1[_0x29f7('0x35')]);_0x967154[_0x29f7('0x39')]=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x412388[_0x29f7('0x35')]['fields']));_0x967154[_0x29f7('0x39')]=_0x967154[_0x29f7('0x39')]['length']?_0x967154[_0x29f7('0x39')]:_0x1f4f1[_0x29f7('0x33')];if(_0x412388[_0x29f7('0x35')][_0x29f7('0x4a')]){_0x967154['include']=[{'all':!![]}];}_0x967154=_[_0x29f7('0x41')]({},_0x967154,_0x412388[_0x29f7('0x42')]);return db[_0x29f7('0x2f')][_0x29f7('0x4b')](_0x967154)[_0x29f7('0x2b')](handleEntityNotFound(_0x465199,null))['then'](respondWithResult(_0x465199,null))[_0x29f7('0x46')](handleError(_0x465199,null));};exports[_0x29f7('0x27')]=function(_0x42fada,_0x3a4571){if(_0x42fada[_0x29f7('0x4c')]['id']){delete _0x42fada[_0x29f7('0x4c')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x42fada['params']['id']}})[_0x29f7('0x2b')](handleEntityNotFound(_0x3a4571,null))['then'](saveUpdates(_0x42fada[_0x29f7('0x4c')],null))[_0x29f7('0x2b')](respondWithResult(_0x3a4571,null))[_0x29f7('0x46')](handleError(_0x3a4571,null));};exports['destroy']=function(_0x5aa0a0,_0x43e6f7){return db[_0x29f7('0x2f')]['find']({'where':{'id':_0x5aa0a0[_0x29f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x43e6f7,null))[_0x29f7('0x2b')](removeEntity(_0x43e6f7,null))[_0x29f7('0x46')](handleError(_0x43e6f7,null));};exports['create']=function(_0x294a8d,_0x509e51){var _0x40999c={'key':_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x32')]};if(_0x294a8d[_0x29f7('0x4c')]['MailAccountId']){_0x40999c[_0x29f7('0x4d')]=_0x294a8d[_0x29f7('0x4c')]['MailAccountId'];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')]){_0x40999c[_0x29f7('0x4e')]=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')];}else if(_0x294a8d['body'][_0x29f7('0x4f')]){_0x40999c['OpenchannelAccountId']=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4f')];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x50')]){_0x40999c[_0x29f7('0x50')]=_0x294a8d['body'][_0x29f7('0x50')];}return db[_0x29f7('0x2f')]['find']({'where':_0x40999c})[_0x29f7('0x2b')](function(_0x3e4a05){if(_0x3e4a05){throw new db['Sequelize'][(_0x29f7('0x51'))](_0x29f7('0x52'));}return db[_0x29f7('0x2f')][_0x29f7('0x53')](_0x294a8d[_0x29f7('0x4c')]);})[_0x29f7('0x2b')](function(_0x59fe7c){var _0x21a1b4=_0x294a8d[_0x29f7('0x54')][_0x29f7('0x29')]({'plain':!![]});if(!_0x21a1b4)throw new Error(_0x29f7('0x55'));if(_0x21a1b4[_0x29f7('0x56')]===_0x29f7('0x54')){var _0x71e024=_0x59fe7c['get']({'plain':!![]});return db[_0x29f7('0x57')][_0x29f7('0x4b')]({'where':{'name':_0x29f7('0x58'),'userProfileId':_0x21a1b4[_0x29f7('0x59')]},'raw':!![]})[_0x29f7('0x2b')](function(_0x23e8a9){if(_0x23e8a9&&_0x23e8a9[_0x29f7('0x5a')]===0x0){return db['UserProfileResource'][_0x29f7('0x53')]({'name':_0x71e024[_0x29f7('0x2d')],'resourceId':_0x71e024['id'],'type':_0x23e8a9[_0x29f7('0x2d')],'sectionId':_0x23e8a9['id']},{})[_0x29f7('0x2b')](function(){return _0x59fe7c;});}else{return _0x59fe7c;}})['catch'](function(_0x4fddf9){logger[_0x29f7('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fddf9);throw _0x4fddf9;});}return _0x59fe7c;})[_0x29f7('0x2b')](respondWithResult(_0x509e51,0xc9))[_0x29f7('0x46')](handleError(_0x509e51,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d0269ae..7b1e8be 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 _0x9bea=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x34ae3d,_0x3dab37){var _0x1190d0=function(_0x435e8f){while(--_0x435e8f){_0x34ae3d['push'](_0x34ae3d['shift']());}};_0x1190d0(++_0x3dab37);}(_0x9bea,0x1f3));var _0xa9be=function(_0x360df4,_0x494d1a){_0x360df4=_0x360df4-0x0;var _0x4870c7=_0x9bea[_0x360df4];return _0x4870c7;};'use strict';var _=require(_0xa9be('0x0'));var util=require(_0xa9be('0x1'));var logger=require(_0xa9be('0x2'))(_0xa9be('0x3'));var moment=require(_0xa9be('0x4'));var BPromise=require(_0xa9be('0x5'));var rp=require(_0xa9be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9be('0x7'));var config=require(_0xa9be('0x8'));var attributes=require(_0xa9be('0x9'));module[_0xa9be('0xa')]=function(_0x23beb6,_0x37d7c4){return _0x23beb6[_0xa9be('0xb')](_0xa9be('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9be('0xd'),'collate':_0xa9be('0xe')});};
\ No newline at end of file
+var _0xa647=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa647,0x11a));var _0x7a64=function(_0x481906,_0x24f326){_0x481906=_0x481906-0x0;var _0x41a55d=_0xa647[_0x481906];return _0x41a55d;};'use strict';var _=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var logger=require(_0x7a64('0x2'))(_0x7a64('0x3'));var moment=require(_0x7a64('0x4'));var BPromise=require(_0x7a64('0x5'));var rp=require(_0x7a64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a64('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a64('0x8'));module[_0x7a64('0x9')]=function(_0x5e0e6d,_0x49f987){return _0x5e0e6d[_0x7a64('0xa')](_0x7a64('0xb'),attributes,{'tableName':_0x7a64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7a64('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c73565c..2460dc0 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(_0x548665,_0x285830){var _0x958727=function(_0x4694f9){while(--_0x4694f9){_0x548665['push'](_0x548665['shift']());}};_0x958727(++_0x285830);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x4bf954,_0x4482f8){var _0x2746d0=function(_0x561c7a){while(--_0x561c7a){_0x4bf954['push'](_0x4bf954['shift']());}};_0x2746d0(++_0x4482f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 aeb0eb8..0a00af5 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 _0xd989=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x5e7f6d,_0x2abe5f){var _0x4f9f88=function(_0x23f281){while(--_0x23f281){_0x5e7f6d['push'](_0x5e7f6d['shift']());}};_0x4f9f88(++_0x2abe5f);}(_0xd989,0x166));var _0x9d98=function(_0x560623,_0x5c748a){_0x560623=_0x560623-0x0;var _0x2a9089=_0xd989[_0x560623];return _0x2a9089;};'use strict';var multer=require(_0x9d98('0x0'));var util=require(_0x9d98('0x1'));var path=require(_0x9d98('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d98('0x3'));var router=express[_0x9d98('0x4')]();var fs_extra=require(_0x9d98('0x5'));var auth=require(_0x9d98('0x6'));var interaction=require(_0x9d98('0x7'));var config=require(_0x9d98('0x8'));var controller=require('./cannedAnswer.controller');router[_0x9d98('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9d98('0x9')](_0x9d98('0xa'),auth['isAuthenticated'](),controller[_0x9d98('0xb')]);router[_0x9d98('0xc')]('/',auth['isAuthenticated'](),controller[_0x9d98('0xd')]);router[_0x9d98('0xe')](_0x9d98('0xa'),auth[_0x9d98('0xf')](),controller[_0x9d98('0x10')]);router[_0x9d98('0x11')](_0x9d98('0xa'),auth['isAuthenticated'](),controller[_0x9d98('0x12')]);module[_0x9d98('0x13')]=router;
\ No newline at end of file
+var _0x28e2=['./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12eb43,_0x4254c4){var _0x264af7=function(_0x567d05){while(--_0x567d05){_0x12eb43['push'](_0x12eb43['shift']());}};_0x264af7(++_0x4254c4);}(_0x28e2,0x1e7));var _0x228e=function(_0x4b0427,_0x8650c2){_0x4b0427=_0x4b0427-0x0;var _0x148d32=_0x28e2[_0x4b0427];return _0x148d32;};'use strict';var multer=require(_0x228e('0x0'));var util=require('util');var path=require(_0x228e('0x1'));var timeout=require(_0x228e('0x2'));var express=require(_0x228e('0x3'));var router=express['Router']();var fs_extra=require(_0x228e('0x4'));var auth=require(_0x228e('0x5'));var interaction=require(_0x228e('0x6'));var config=require('../../config/environment');var controller=require(_0x228e('0x7'));router[_0x228e('0x8')]('/',auth['isAuthenticated'](),controller[_0x228e('0x9')]);router[_0x228e('0x8')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0xc')]);router[_0x228e('0xd')]('/',auth[_0x228e('0xb')](),controller[_0x228e('0xe')]);router[_0x228e('0xf')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0x10')]);router[_0x228e('0x11')](_0x228e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x228e('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 a1cf3cc..3b442a7 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 _0xfa2f=['INTEGER','DATE','STRING'];(function(_0x2f7bec,_0x27b9f6){var _0x5d1c2e=function(_0x442b0a){while(--_0x442b0a){_0x2f7bec['push'](_0x2f7bec['shift']());}};_0x5d1c2e(++_0x27b9f6);}(_0xfa2f,0xe8));var _0xffa2=function(_0x31bf7a,_0x2e4d4f){_0x31bf7a=_0x31bf7a-0x0;var _0x389002=_0xfa2f[_0x31bf7a];return _0x389002;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xffa2('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xffa2('0x1')]},'src':{'type':Sequelize[_0xffa2('0x1')]},'dst':{'type':Sequelize[_0xffa2('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xffa2('0x1')]},'dstchannel':{'type':Sequelize[_0xffa2('0x1')]},'lastapp':{'type':Sequelize[_0xffa2('0x1')]},'lastdata':{'type':Sequelize[_0xffa2('0x1')]},'duration':{'type':Sequelize[_0xffa2('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xffa2('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xffa2('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xffa2('0x1')]},'uniqueid':{'type':Sequelize[_0xffa2('0x1')]},'linkedid':{'type':Sequelize[_0xffa2('0x1')]},'sequence':{'type':Sequelize[_0xffa2('0x1')]},'peeraccount':{'type':Sequelize[_0xffa2('0x1')]},'type':{'type':Sequelize[_0xffa2('0x1')]},'tag':{'type':Sequelize[_0xffa2('0x1')]}};
\ No newline at end of file
+var _0xc285=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0xc285,0xd8));var _0x5c28=function(_0x4c9173,_0x54c378){_0x4c9173=_0x4c9173-0x0;var _0x48bf57=_0xc285[_0x4c9173];return _0x48bf57;};'use strict';var Sequelize=require(_0x5c28('0x0'));module[_0x5c28('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5c28('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5c28('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5c28('0x3')]},'channel':{'type':Sequelize[_0x5c28('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5c28('0x3')]},'lastdata':{'type':Sequelize[_0x5c28('0x3')]},'duration':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5c28('0x3')]},'amaflags':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5c28('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5c28('0x3')]},'linkedid':{'type':Sequelize[_0x5c28('0x3')]},'sequence':{'type':Sequelize[_0x5c28('0x3')]},'peeraccount':{'type':Sequelize[_0x5c28('0x3')]},'type':{'type':Sequelize[_0x5c28('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e4b1d91..0fae817 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x250f95,_0x5a5728){var _0x4ada97=function(_0x392edc){while(--_0x392edc){_0x250f95['push'](_0x250f95['shift']());}};_0x4ada97(++_0x5a5728);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2facb4,_0x57ffb4){_0x2facb4=_0x2facb4-0x0;var _0x4aecf4=_0x6b8f[_0x2facb4];return _0x4aecf4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
+var _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x38c4e6,_0x6fe10a){var _0x3af923=function(_0x2f8755){while(--_0x2f8755){_0x38c4e6['push'](_0x38c4e6['shift']());}};_0x3af923(++_0x6fe10a);}(_0xc949,0x181));var _0x9c94=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xc949[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['Cdr'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['Cdr'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['Cdr'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b5f4fa8..9201392 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x44c1cb,_0x14e16c){var _0x393b70=function(_0x1dbde8){while(--_0x1dbde8){_0x44c1cb['push'](_0x44c1cb['shift']());}};_0x393b70(++_0x14e16c);}(_0x7a54,0x106));var _0x47a5=function(_0x5c674e,_0x5dcba2){_0x5c674e=_0x5c674e-0x0;var _0x296e29=_0x7a54[_0x5c674e];return _0x296e29;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x58344f,_0x668799){var _0x14a048=function(_0x48cf5a){while(--_0x48cf5a){_0x58344f['push'](_0x58344f['shift']());}};_0x14a048(++_0x668799);}(_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 eaf842b..6e32b2c 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 _0x6cd1=['rpc','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','../../mysqldb','../../config/utils'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x6cd1,0x85));var _0x16cd=function(_0xb5e37f,_0xc624f1){_0xb5e37f=_0xb5e37f-0x0;var _0x23f431=_0x6cd1[_0xb5e37f];return _0x23f431;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x16cd('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16cd('0x1'))['db'];var utils=require(_0x16cd('0x2'));var logger=require('../../config/logger')(_0x16cd('0x3'));var config=require(_0x16cd('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x16cd('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x241c4e,_0x4bdd82,_0x8f91a8){return new BPromise(function(_0x594207,_0x39231d){return client[_0x16cd('0x6')](_0x241c4e,_0x8f91a8)['then'](function(_0x16a862){logger[_0x16cd('0x7')](_0x16cd('0x8'),_0x4bdd82,'request\x20sent');logger[_0x16cd('0x9')](_0x16cd('0xa'),_0x4bdd82,'request\x20sent',JSON[_0x16cd('0xb')](_0x16a862));if(_0x16a862[_0x16cd('0xc')]){if(_0x16a862[_0x16cd('0xc')][_0x16cd('0xd')]===0x1f4){logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x16a862[_0x16cd('0xc')][_0x16cd('0xe')]);return _0x39231d(_0x16a862['error'][_0x16cd('0xe')]);}logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x16a862[_0x16cd('0xc')][_0x16cd('0xe')]);return _0x594207(_0x16a862[_0x16cd('0xc')]['message']);}else{logger[_0x16cd('0x7')](_0x16cd('0x8'),_0x4bdd82,_0x16cd('0xf'));_0x594207(_0x16a862['result'][_0x16cd('0xe')]);}})[_0x16cd('0x10')](function(_0x3fc127){logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x3fc127);_0x39231d(_0x3fc127);});});}
\ No newline at end of file
+var _0x1c7a=['Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bbd69,_0x25aa38){var _0x12b5f7=function(_0x2c4993){while(--_0x2c4993){_0x2bbd69['push'](_0x2bbd69['shift']());}};_0x12b5f7(++_0x25aa38);}(_0x1c7a,0xb4));var _0xa1c7=function(_0x69862a,_0x3e36a3){_0x69862a=_0x69862a-0x0;var _0xfde71b=_0x1c7a[_0x69862a];return _0xfde71b;};'use strict';var _=require(_0xa1c7('0x0'));var util=require(_0xa1c7('0x1'));var moment=require(_0xa1c7('0x2'));var BPromise=require(_0xa1c7('0x3'));var rs=require(_0xa1c7('0x4'));var fs=require('fs');var Redis=require(_0xa1c7('0x5'));var db=require(_0xa1c7('0x6'))['db'];var utils=require(_0xa1c7('0x7'));var logger=require(_0xa1c7('0x8'))(_0xa1c7('0x9'));var config=require(_0xa1c7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa1c7('0xb')][_0xa1c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f780,_0x51b7af,_0x51d53d){return new BPromise(function(_0x294a9a,_0x51c68f){return client['request'](_0x33f780,_0x51d53d)['then'](function(_0x597e85){logger['info']('Cdr,\x20%s,\x20%s',_0x51b7af,_0xa1c7('0xd'));logger[_0xa1c7('0xe')](_0xa1c7('0xf'),_0x51b7af,'request\x20sent',JSON[_0xa1c7('0x10')](_0x597e85));if(_0x597e85[_0xa1c7('0x11')]){if(_0x597e85['error']['code']===0x1f4){logger['error'](_0xa1c7('0x12'),_0x51b7af,_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);return _0x51c68f(_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);}logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x597e85['error'][_0xa1c7('0x13')]);return _0x294a9a(_0x597e85['error'][_0xa1c7('0x13')]);}else{logger['info'](_0xa1c7('0x12'),_0x51b7af,_0xa1c7('0xd'));_0x294a9a(_0x597e85[_0xa1c7('0x14')][_0xa1c7('0x13')]);}})[_0xa1c7('0x15')](function(_0x5abe81){logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x5abe81);_0x51c68f(_0x5abe81);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 54be85a..0ae06b8 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 5ef9003..6403172 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 _0x1960=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x193aae,_0x5c9cd3){var _0x6a9ced=function(_0x4efde9){while(--_0x4efde9){_0x193aae['push'](_0x193aae['shift']());}};_0x6a9ced(++_0x5c9cd3);}(_0x1960,0x128));var _0x0196=function(_0x23f185,_0x104d9b){_0x23f185=_0x23f185-0x0;var _0x4c1b92=_0x1960[_0x23f185];return _0x4c1b92;};'use strict';var Sequelize=require(_0x0196('0x0'));module[_0x0196('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0196('0x2')],'allowNull':![],'defaultValue':_0x0196('0x3')},'appdata':{'type':Sequelize[_0x0196('0x4')]()},'description':{'type':Sequelize[_0x0196('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0196('0x5')}};
\ No newline at end of file
+var _0xbf96=['INTEGER','STRING','sequelize','exports'];(function(_0x5e649f,_0x16bdb2){var _0x29a25c=function(_0x1cda9d){while(--_0x1cda9d){_0x5e649f['push'](_0x5e649f['shift']());}};_0x29a25c(++_0x16bdb2);}(_0xbf96,0x1e2));var _0x6bf9=function(_0x2a9a45,_0x1eb664){_0x2a9a45=_0x2a9a45-0x0;var _0x4cd571=_0xbf96[_0x2a9a45];return _0x4cd571;};'use strict';var Sequelize=require(_0x6bf9('0x0'));module[_0x6bf9('0x1')]={'priority':{'type':Sequelize[_0x6bf9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6bf9('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6bf9('0x3')]},'interval':{'type':Sequelize[_0x6bf9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 1764590..ca36691 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 _0x65d2=['params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','includeAll','include','merge','options','body','find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','stack','name','send'];(function(_0x102589,_0x476a51){var _0x3e77de=function(_0x11104a){while(--_0x11104a){_0x102589['push'](_0x102589['shift']());}};_0x3e77de(++_0x476a51);}(_0x65d2,0xb8));var _0x265d=function(_0x476cc4,_0x2ee96b){_0x476cc4=_0x476cc4-0x0;var _0x38c45d=_0x65d2[_0x476cc4];return _0x38c45d;};'use strict';var emlformat=require(_0x265d('0x0'));var rimraf=require(_0x265d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x265d('0x2'));var rp=require(_0x265d('0x3'));var moment=require(_0x265d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x265d('0x5'));var util=require(_0x265d('0x6'));var path=require(_0x265d('0x7'));var sox=require('sox');var csv=require(_0x265d('0x8'));var ejs=require(_0x265d('0x9'));var fs=require('fs');var fs_extra=require(_0x265d('0xa'));var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x8'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var Redis=require('ioredis');var authService=require(_0x265d('0x11'));var qs=require(_0x265d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x265d('0x13'));var logger=require(_0x265d('0x14'))(_0x265d('0x15'));var utils=require(_0x265d('0x16'));var config=require(_0x265d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x265d('0x18'))['db'];function respondWithStatusCode(_0x5540fa,_0x4c1ea2){_0x4c1ea2=_0x4c1ea2||0xcc;return function(_0x24cb9d){if(_0x24cb9d){return _0x5540fa[_0x265d('0x19')](_0x4c1ea2);}return _0x5540fa[_0x265d('0x1a')](_0x4c1ea2)[_0x265d('0x1b')]();};}function respondWithResult(_0x181344,_0x5e04f6){_0x5e04f6=_0x5e04f6||0xc8;return function(_0x97bfdf){if(_0x97bfdf){return _0x181344[_0x265d('0x1a')](_0x5e04f6)[_0x265d('0x1c')](_0x97bfdf);}};}function respondWithFilteredResult(_0x34eb0b,_0x21e99b){return function(_0x183f31){if(_0x183f31){var _0x29a163=typeof _0x21e99b[_0x265d('0x1d')]===_0x265d('0x1e')&&typeof _0x21e99b[_0x265d('0x1f')]===_0x265d('0x1e');var _0x74d2e7=_0x183f31[_0x265d('0x20')];var _0x1ab38c=_0x29a163?0x0:_0x21e99b[_0x265d('0x1d')];var _0x3e2dbe=_0x29a163?_0x183f31['count']:_0x21e99b[_0x265d('0x1d')]+_0x21e99b[_0x265d('0x1f')];var _0x2f8932;if(_0x3e2dbe>=_0x74d2e7){_0x3e2dbe=_0x74d2e7;_0x2f8932=0xc8;}else{_0x2f8932=0xce;}_0x34eb0b[_0x265d('0x1a')](_0x2f8932);return _0x34eb0b[_0x265d('0x21')]('Content-Range',_0x1ab38c+'-'+_0x3e2dbe+'/'+_0x74d2e7)['json'](_0x183f31);}return null;};}function patchUpdates(_0x3dc44b){return function(_0x1ff5b6){try{jsonpatch['apply'](_0x1ff5b6,_0x3dc44b,!![]);}catch(_0x408840){return BPromise['reject'](_0x408840);}return _0x1ff5b6['save']();};}function saveUpdates(_0x31be87,_0x24245b){return function(_0x36a480){if(_0x36a480){return _0x36a480[_0x265d('0x22')](_0x31be87)['then'](function(_0x1da376){return _0x1da376;});}return null;};}function removeEntity(_0xc821d2,_0x3304e5){return function(_0xf807aa){if(_0xf807aa){return _0xf807aa[_0x265d('0x23')]()[_0x265d('0x24')](function(){_0xc821d2[_0x265d('0x1a')](0xcc)[_0x265d('0x1b')]();});}};}function handleEntityNotFound(_0x53301f,_0x6916db){return function(_0x1fa6b5){if(!_0x1fa6b5){_0x53301f[_0x265d('0x19')](0x194);}return _0x1fa6b5;};}function handleError(_0x1c830b,_0x2d1c3d){_0x2d1c3d=_0x2d1c3d||0x1f4;return function(_0x3c163a){logger['error'](_0x3c163a[_0x265d('0x25')]);if(_0x3c163a[_0x265d('0x26')]){delete _0x3c163a['name'];}_0x1c830b[_0x265d('0x1a')](_0x2d1c3d)[_0x265d('0x27')](_0x3c163a);};}exports['show']=function(_0x310904,_0x55e69f){var _0x311872={'raw':!![],'where':{'id':_0x310904[_0x265d('0x28')]['id']}},_0x3873c3={};_0x3873c3[_0x265d('0x29')]=_[_0x265d('0x2a')](db[_0x265d('0x2b')][_0x265d('0x2c')]);_0x3873c3[_0x265d('0x2d')]=_[_0x265d('0x2a')](_0x310904['query']);_0x3873c3[_0x265d('0x2e')]=_['intersection'](_0x3873c3[_0x265d('0x29')],_0x3873c3[_0x265d('0x2d')]);_0x311872[_0x265d('0x2f')]=_[_0x265d('0x30')](_0x3873c3[_0x265d('0x29')],qs['fields'](_0x310904[_0x265d('0x2d')]['fields']));_0x311872[_0x265d('0x2f')]=_0x311872[_0x265d('0x2f')]['length']?_0x311872[_0x265d('0x2f')]:_0x3873c3[_0x265d('0x29')];if(_0x310904['query'][_0x265d('0x31')]){_0x311872[_0x265d('0x32')]=[{'all':!![]}];}_0x311872=_[_0x265d('0x33')]({},_0x311872,_0x310904[_0x265d('0x34')]);return db[_0x265d('0x2b')]['find'](_0x311872)['then'](handleEntityNotFound(_0x55e69f,null))[_0x265d('0x24')](respondWithResult(_0x55e69f,null))['catch'](handleError(_0x55e69f,null));};exports[_0x265d('0x22')]=function(_0x10fe7e,_0x1cf68e){if(_0x10fe7e[_0x265d('0x35')]['id']){delete _0x10fe7e[_0x265d('0x35')]['id'];}return db['ChatApplication'][_0x265d('0x36')]({'where':{'id':_0x10fe7e['params']['id']}})[_0x265d('0x24')](handleEntityNotFound(_0x1cf68e,null))[_0x265d('0x24')](saveUpdates(_0x10fe7e[_0x265d('0x35')],null))['then'](respondWithResult(_0x1cf68e,null))[_0x265d('0x37')](handleError(_0x1cf68e,null));};exports[_0x265d('0x23')]=function(_0x10d686,_0x2d8d70){return db[_0x265d('0x2b')]['find']({'where':{'id':_0x10d686['params']['id']}})[_0x265d('0x24')](handleEntityNotFound(_0x2d8d70,null))[_0x265d('0x24')](removeEntity(_0x2d8d70,null))[_0x265d('0x37')](handleError(_0x2d8d70,null));};
\ No newline at end of file
+var _0x22dd=['find','catch','body','ChatApplication','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','update','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd22d('0x0'));var rimraf=require(_0xd22d('0x1'));var zipdir=require(_0xd22d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd22d('0x3'));var BPromise=require(_0xd22d('0x4'));var Mustache=require(_0xd22d('0x5'));var util=require(_0xd22d('0x6'));var path=require(_0xd22d('0x7'));var sox=require(_0xd22d('0x8'));var csv=require(_0xd22d('0x9'));var ejs=require(_0xd22d('0xa'));var fs=require('fs');var fs_extra=require(_0xd22d('0xb'));var _=require(_0xd22d('0xc'));var squel=require('squel');var crypto=require(_0xd22d('0xd'));var jsforce=require(_0xd22d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd22d('0x9'));var querystring=require('querystring');var Papa=require(_0xd22d('0xf'));var Redis=require('ioredis');var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require(_0xd22d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd22d('0x18'))['db'];function respondWithStatusCode(_0x46f164,_0x51a8ea){_0x51a8ea=_0x51a8ea||0xcc;return function(_0x38978b){if(_0x38978b){return _0x46f164[_0xd22d('0x19')](_0x51a8ea);}return _0x46f164['status'](_0x51a8ea)['end']();};}function respondWithResult(_0x5994fe,_0x156546){_0x156546=_0x156546||0xc8;return function(_0x5dc338){if(_0x5dc338){return _0x5994fe[_0xd22d('0x1a')](_0x156546)['json'](_0x5dc338);}};}function respondWithFilteredResult(_0x78d93e,_0x5b91bd){return function(_0x5027d){if(_0x5027d){var _0x377e75=typeof _0x5b91bd['offset']===_0xd22d('0x1b')&&typeof _0x5b91bd[_0xd22d('0x1c')]===_0xd22d('0x1b');var _0x11c410=_0x5027d['count'];var _0x5c516a=_0x377e75?0x0:_0x5b91bd[_0xd22d('0x1d')];var _0x5a0a0b=_0x377e75?_0x5027d['count']:_0x5b91bd['offset']+_0x5b91bd[_0xd22d('0x1c')];var _0x46f8b6;if(_0x5a0a0b>=_0x11c410){_0x5a0a0b=_0x11c410;_0x46f8b6=0xc8;}else{_0x46f8b6=0xce;}_0x78d93e[_0xd22d('0x1a')](_0x46f8b6);return _0x78d93e[_0xd22d('0x1e')](_0xd22d('0x1f'),_0x5c516a+'-'+_0x5a0a0b+'/'+_0x11c410)['json'](_0x5027d);}return null;};}function patchUpdates(_0x2bfc84){return function(_0x4e18f5){try{jsonpatch['apply'](_0x4e18f5,_0x2bfc84,!![]);}catch(_0x478c1f){return BPromise[_0xd22d('0x20')](_0x478c1f);}return _0x4e18f5[_0xd22d('0x21')]();};}function saveUpdates(_0x1ecab6,_0x420836){return function(_0x1be46f){if(_0x1be46f){return _0x1be46f[_0xd22d('0x22')](_0x1ecab6)[_0xd22d('0x23')](function(_0x52039a){return _0x52039a;});}return null;};}function removeEntity(_0x3b07b3,_0x8340e5){return function(_0x55bce9){if(_0x55bce9){return _0x55bce9['destroy']()[_0xd22d('0x23')](function(){_0x3b07b3[_0xd22d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0959,_0x370902){return function(_0xee8f2){if(!_0xee8f2){_0x2b0959[_0xd22d('0x19')](0x194);}return _0xee8f2;};}function handleError(_0x2b47c2,_0x2c7b5a){_0x2c7b5a=_0x2c7b5a||0x1f4;return function(_0x2d45ab){logger[_0xd22d('0x24')](_0x2d45ab[_0xd22d('0x25')]);if(_0x2d45ab['name']){delete _0x2d45ab[_0xd22d('0x26')];}_0x2b47c2[_0xd22d('0x1a')](_0x2c7b5a)['send'](_0x2d45ab);};}exports[_0xd22d('0x27')]=function(_0x5f00f9,_0x5381a8){var _0x2d377d={'raw':!![],'where':{'id':_0x5f00f9[_0xd22d('0x28')]['id']}},_0x96a17e={};_0x96a17e[_0xd22d('0x29')]=_[_0xd22d('0x2a')](db['ChatApplication'][_0xd22d('0x2b')]);_0x96a17e['query']=_[_0xd22d('0x2a')](_0x5f00f9[_0xd22d('0x2c')]);_0x96a17e[_0xd22d('0x2d')]=_[_0xd22d('0x2e')](_0x96a17e[_0xd22d('0x29')],_0x96a17e['query']);_0x2d377d[_0xd22d('0x2f')]=_[_0xd22d('0x2e')](_0x96a17e['model'],qs[_0xd22d('0x30')](_0x5f00f9['query'][_0xd22d('0x30')]));_0x2d377d[_0xd22d('0x2f')]=_0x2d377d['attributes'][_0xd22d('0x31')]?_0x2d377d[_0xd22d('0x2f')]:_0x96a17e[_0xd22d('0x29')];if(_0x5f00f9['query'][_0xd22d('0x32')]){_0x2d377d['include']=[{'all':!![]}];}_0x2d377d=_['merge']({},_0x2d377d,_0x5f00f9[_0xd22d('0x33')]);return db['ChatApplication'][_0xd22d('0x34')](_0x2d377d)['then'](handleEntityNotFound(_0x5381a8,null))[_0xd22d('0x23')](respondWithResult(_0x5381a8,null))[_0xd22d('0x35')](handleError(_0x5381a8,null));};exports['update']=function(_0x5b5516,_0x25554b){if(_0x5b5516[_0xd22d('0x36')]['id']){delete _0x5b5516[_0xd22d('0x36')]['id'];}return db[_0xd22d('0x37')][_0xd22d('0x34')]({'where':{'id':_0x5b5516[_0xd22d('0x28')]['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x25554b,null))['then'](saveUpdates(_0x5b5516['body'],null))[_0xd22d('0x23')](respondWithResult(_0x25554b,null))[_0xd22d('0x35')](handleError(_0x25554b,null));};exports['destroy']=function(_0xfbc831,_0x326507){return db['ChatApplication']['find']({'where':{'id':_0xfbc831['params']['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x326507,null))[_0xd22d('0x23')](removeEntity(_0x326507,null))[_0xd22d('0x35')](handleError(_0x326507,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9729fe8..ae319d8 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 _0x7aad=['chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./chatApplication.attributes','exports'];(function(_0x27afe3,_0x43d95c){var _0x4ff74f=function(_0xda8e58){while(--_0xda8e58){_0x27afe3['push'](_0x27afe3['shift']());}};_0x4ff74f(++_0x43d95c);}(_0x7aad,0x160));var _0xd7aa=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x7aad[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xd7aa('0x0'));var util=require('util');var logger=require(_0xd7aa('0x1'))(_0xd7aa('0x2'));var moment=require('moment');var BPromise=require(_0xd7aa('0x3'));var rp=require(_0xd7aa('0x4'));var fs=require('fs');var path=require(_0xd7aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7aa('0x6'));module[_0xd7aa('0x7')]=function(_0x2fe602,_0xb6d0b2){return _0x2fe602['define']('ChatApplication',attributes,{'tableName':_0xd7aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7aa('0x9')});};
\ No newline at end of file
+var _0x3c70=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x3c70,0x10c));var _0x03c7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3c70[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./chatApplication.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03c7('0xc'),'collate':_0x03c7('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 394ff9a..24cb664 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 _0x34e7=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c6c18,_0x30547b){var _0x4b2b17=function(_0x318dfe){while(--_0x318dfe){_0x5c6c18['push'](_0x5c6c18['shift']());}};_0x4b2b17(++_0x30547b);}(_0x34e7,0x115));var _0x734e=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x34e7[_0x2e689d];return _0x540160;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var moment=require('moment');var BPromise=require(_0x734e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x734e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x734e('0x4'));var config=require(_0x734e('0x5'));var jayson=require(_0x734e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc4ba,_0x5932d3,_0x52b78){return new BPromise(function(_0x282d4c,_0x6321c2){return client[_0x734e('0x7')](_0x1bc4ba,_0x52b78)['then'](function(_0x207803){logger[_0x734e('0x8')](_0x734e('0x9'),_0x5932d3,_0x734e('0xa'));logger[_0x734e('0xb')](_0x734e('0xc'),_0x5932d3,_0x734e('0xa'),JSON['stringify'](_0x207803));if(_0x207803[_0x734e('0xd')]){if(_0x207803[_0x734e('0xd')][_0x734e('0xe')]===0x1f4){logger[_0x734e('0xd')]('ChatApplication,\x20%s,\x20%s',_0x5932d3,_0x207803[_0x734e('0xd')]['message']);return _0x6321c2(_0x207803[_0x734e('0xd')]['message']);}logger[_0x734e('0xd')](_0x734e('0x9'),_0x5932d3,_0x207803['error'][_0x734e('0xf')]);return _0x282d4c(_0x207803[_0x734e('0xd')]['message']);}else{logger['info'](_0x734e('0x9'),_0x5932d3,'request\x20sent');_0x282d4c(_0x207803['result']['message']);}})[_0x734e('0x10')](function(_0x5ae73f){logger[_0x734e('0xd')](_0x734e('0x9'),_0x5932d3,_0x5ae73f);_0x6321c2(_0x5ae73f);});});}
\ No newline at end of file
+var _0x2232=['error','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5bd337,_0x537448){var _0x287f5f=function(_0x6cecde){while(--_0x6cecde){_0x5bd337['push'](_0x5bd337['shift']());}};_0x287f5f(++_0x537448);}(_0x2232,0x1b4));var _0x2223=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2232[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2223('0x0'));var fs=require('fs');var Redis=require(_0x2223('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x2223('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x2223('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2223('0x4')][_0x2223('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5397f3,_0x1d4336,_0x339451){return new BPromise(function(_0x57a6e0,_0x32a106){return client[_0x2223('0x6')](_0x5397f3,_0x339451)[_0x2223('0x7')](function(_0x2aedfd){logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2223('0x9'));logger[_0x2223('0xa')](_0x2223('0xb'),_0x1d4336,_0x2223('0x9'),JSON['stringify'](_0x2aedfd));if(_0x2aedfd[_0x2223('0xc')]){if(_0x2aedfd[_0x2223('0xc')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd['error'][_0x2223('0xd')]);return _0x32a106(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd[_0x2223('0xc')]['message']);return _0x57a6e0(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}else{logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,'request\x20sent');_0x57a6e0(_0x2aedfd[_0x2223('0xe')]['message']);}})[_0x2223('0xf')](function(_0x2157b1){logger[_0x2223('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2157b1);_0x32a106(_0x2157b1);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index e06ff11..1ec576b 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 _0x3276=['Router','fs-extra','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x3ba2a0,_0x5453a5){var _0x575d6c=function(_0x122450){while(--_0x122450){_0x3ba2a0['push'](_0x3ba2a0['shift']());}};_0x575d6c(++_0x5453a5);}(_0x3276,0x1bf));var _0x6327=function(_0x225814,_0x1accbb){_0x225814=_0x225814-0x0;var _0x7368b8=_0x3276[_0x225814];return _0x7368b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6327('0x0'));var timeout=require(_0x6327('0x1'));var express=require(_0x6327('0x2'));var router=express[_0x6327('0x3')]();var fs_extra=require(_0x6327('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6327('0x5'));var controller=require(_0x6327('0x6'));router['get'](_0x6327('0x7'),auth[_0x6327('0x8')](),controller[_0x6327('0x9')]);router[_0x6327('0xa')]('/:id',auth[_0x6327('0x8')](),controller[_0x6327('0xb')]);router[_0x6327('0xc')](_0x6327('0x7'),auth['isAuthenticated'](),controller[_0x6327('0xd')]);module[_0x6327('0xe')]=router;
\ No newline at end of file
+var _0x12a7=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','delete','destroy','multer'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x12a7,0x1db));var _0x712a=function(_0x2d5482,_0x309995){_0x2d5482=_0x2d5482-0x0;var _0x5d0cb1=_0x12a7[_0x2d5482];return _0x5d0cb1;};'use strict';var multer=require(_0x712a('0x0'));var util=require('util');var path=require(_0x712a('0x1'));var timeout=require(_0x712a('0x2'));var express=require(_0x712a('0x3'));var router=express[_0x712a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x712a('0x5'));var config=require(_0x712a('0x6'));var controller=require('./chatApplication.controller');router[_0x712a('0x7')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xa')]);router['put'](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xb')]);router[_0x712a('0xc')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index a6c3c52..e28418a 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 _0x6be2=['exports','STRING'];(function(_0x5e6566,_0x7f24a4){var _0x4abaf9=function(_0x375508){while(--_0x375508){_0x5e6566['push'](_0x5e6566['shift']());}};_0x4abaf9(++_0x7f24a4);}(_0x6be2,0x1cc));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x26be('0x0')]={'name':{'type':Sequelize[_0x26be('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x26be('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfce5=['STRING','sequelize','exports'];(function(_0x38614a,_0x222bc3){var _0x59acf9=function(_0x376734){while(--_0x376734){_0x38614a['push'](_0x38614a['shift']());}};_0x59acf9(++_0x222bc3);}(_0xfce5,0x1d5));var _0x5fce=function(_0x3e7653,_0x414e83){_0x3e7653=_0x3e7653-0x0;var _0x2d518d=_0xfce5[_0x3e7653];return _0x2d518d;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index e3fadb2..63fdbb4 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 _0x5f28=['mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','limit','apply','update','then','destroy','sendStatus','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5478cb,_0x1a3108){var _0x45ae7b=function(_0x34e3c9){while(--_0x34e3c9){_0x5478cb['push'](_0x5478cb['shift']());}};_0x45ae7b(++_0x1a3108);}(_0x5f28,0xb7));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x85f2('0x0'));var rimraf=require(_0x85f2('0x1'));var zipdir=require(_0x85f2('0x2'));var jsonpatch=require(_0x85f2('0x3'));var rp=require(_0x85f2('0x4'));var moment=require(_0x85f2('0x5'));var BPromise=require(_0x85f2('0x6'));var Mustache=require(_0x85f2('0x7'));var util=require(_0x85f2('0x8'));var path=require(_0x85f2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85f2('0xa'));var crypto=require(_0x85f2('0xb'));var jsforce=require(_0x85f2('0xc'));var deskjs=require(_0x85f2('0xd'));var toCsv=require(_0x85f2('0xe'));var querystring=require(_0x85f2('0xf'));var Papa=require(_0x85f2('0x10'));var Redis=require(_0x85f2('0x11'));var authService=require(_0x85f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x85f2('0x13'));var hardwareService=require(_0x85f2('0x14'));var logger=require(_0x85f2('0x15'))(_0x85f2('0x16'));var utils=require('../../config/utils');var config=require(_0x85f2('0x17'));var licenseUtil=require(_0x85f2('0x18'));var db=require(_0x85f2('0x19'))['db'];config[_0x85f2('0x1a')]=_[_0x85f2('0x1b')](config[_0x85f2('0x1a')],{'host':_0x85f2('0x1c'),'port':0x18eb});var socket=require(_0x85f2('0x1d'))(new Redis(config[_0x85f2('0x1a')]));require(_0x85f2('0x1e'))[_0x85f2('0x1f')](socket);function respondWithStatusCode(_0x29ec2c,_0x5893e8){_0x5893e8=_0x5893e8||0xcc;return function(_0x80769a){if(_0x80769a){return _0x29ec2c['sendStatus'](_0x5893e8);}return _0x29ec2c[_0x85f2('0x20')](_0x5893e8)[_0x85f2('0x21')]();};}function respondWithResult(_0x1b5eed,_0x668cc0){_0x668cc0=_0x668cc0||0xc8;return function(_0xc8b24c){if(_0xc8b24c){return _0x1b5eed['status'](_0x668cc0)[_0x85f2('0x22')](_0xc8b24c);}};}function respondWithFilteredResult(_0x45bb1c,_0x3a17bf){return function(_0x4c4cf4){if(_0x4c4cf4){var _0x5b5162=typeof _0x3a17bf['offset']===_0x85f2('0x23')&&typeof _0x3a17bf['limit']===_0x85f2('0x23');var _0x2aa636=_0x4c4cf4[_0x85f2('0x24')];var _0x4e781c=_0x5b5162?0x0:_0x3a17bf['offset'];var _0x10d4af=_0x5b5162?_0x4c4cf4[_0x85f2('0x24')]:_0x3a17bf[_0x85f2('0x25')]+_0x3a17bf[_0x85f2('0x26')];var _0x3739f6;if(_0x10d4af>=_0x2aa636){_0x10d4af=_0x2aa636;_0x3739f6=0xc8;}else{_0x3739f6=0xce;}_0x45bb1c[_0x85f2('0x20')](_0x3739f6);return _0x45bb1c['set']('Content-Range',_0x4e781c+'-'+_0x10d4af+'/'+_0x2aa636)[_0x85f2('0x22')](_0x4c4cf4);}return null;};}function patchUpdates(_0x28636e){return function(_0x2a012f){try{jsonpatch[_0x85f2('0x27')](_0x2a012f,_0x28636e,!![]);}catch(_0x1c7e28){return BPromise['reject'](_0x1c7e28);}return _0x2a012f['save']();};}function saveUpdates(_0x1e3c29,_0x4503e8){return function(_0x45586c){if(_0x45586c){return _0x45586c[_0x85f2('0x28')](_0x1e3c29)[_0x85f2('0x29')](function(_0x5168c1){return _0x5168c1;});}return null;};}function removeEntity(_0x418534,_0x113261){return function(_0x2d261f){if(_0x2d261f){return _0x2d261f[_0x85f2('0x2a')]()[_0x85f2('0x29')](function(){_0x418534[_0x85f2('0x20')](0xcc)[_0x85f2('0x21')]();});}};}function handleEntityNotFound(_0x5e97cb,_0x2ed86a){return function(_0x111530){if(!_0x111530){_0x5e97cb[_0x85f2('0x2b')](0x194);}return _0x111530;};}function handleError(_0x38d2ae,_0x2dc230){_0x2dc230=_0x2dc230||0x1f4;return function(_0x56b89c){logger['error'](_0x56b89c['stack']);if(_0x56b89c[_0x85f2('0x2c')]){delete _0x56b89c['name'];}_0x38d2ae['status'](_0x2dc230)['send'](_0x56b89c);};}exports[_0x85f2('0x2d')]=function(_0x2f6883,_0x158828){var _0x3b4a9d={},_0x15acb9={},_0x4fb39e={'count':0x0,'rows':[]};var _0x3139de=_[_0x85f2('0x2e')](db[_0x85f2('0x2f')][_0x85f2('0x30')],function(_0xde66fe){return{'name':_0xde66fe[_0x85f2('0x31')],'type':_0xde66fe[_0x85f2('0x32')][_0x85f2('0x33')]};});_0x15acb9[_0x85f2('0x34')]=_[_0x85f2('0x2e')](_0x3139de,'name');_0x15acb9[_0x85f2('0x35')]=_['keys'](_0x2f6883[_0x85f2('0x35')]);_0x15acb9[_0x85f2('0x36')]=_['intersection'](_0x15acb9[_0x85f2('0x34')],_0x15acb9[_0x85f2('0x35')]);_0x3b4a9d[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x15acb9[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x2f6883[_0x85f2('0x35')]['fields']));_0x3b4a9d[_0x85f2('0x37')]=_0x3b4a9d[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x3b4a9d[_0x85f2('0x37')]:_0x15acb9[_0x85f2('0x34')];if(!_0x2f6883[_0x85f2('0x35')][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3b4a9d[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x2f6883[_0x85f2('0x35')]['limit']);_0x3b4a9d['offset']=qs[_0x85f2('0x25')](_0x2f6883['query'][_0x85f2('0x25')]);}_0x3b4a9d[_0x85f2('0x3d')]=qs['sort'](_0x2f6883['query'][_0x85f2('0x3e')]);_0x3b4a9d[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x2f6883[_0x85f2('0x35')],_0x15acb9[_0x85f2('0x36')]),_0x3139de);if(_0x2f6883['query']['filter']){_0x3b4a9d[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3b4a9d[_0x85f2('0x3f')],{'$or':_[_0x85f2('0x2e')](_0x3139de,function(_0x14c3a6){if(_0x14c3a6[_0x85f2('0x32')]!==_0x85f2('0x42')){var _0x1b71e4={};_0x1b71e4[_0x14c3a6[_0x85f2('0x2c')]]={'$like':'%'+_0x2f6883[_0x85f2('0x35')][_0x85f2('0x43')]+'%'};return _0x1b71e4;}})});}_0x3b4a9d=_[_0x85f2('0x41')]({},_0x3b4a9d,_0x2f6883[_0x85f2('0x44')]);var _0xa05c8b={'where':_0x3b4a9d['where']};return db[_0x85f2('0x2f')][_0x85f2('0x24')](_0xa05c8b)['then'](function(_0x4c98bb){_0x4fb39e[_0x85f2('0x24')]=_0x4c98bb;if(_0x2f6883[_0x85f2('0x35')][_0x85f2('0x45')]){_0x3b4a9d[_0x85f2('0x46')]=[{'all':!![]}];}return db[_0x85f2('0x2f')][_0x85f2('0x47')](_0x3b4a9d);})[_0x85f2('0x29')](function(_0x159536){_0x4fb39e[_0x85f2('0x48')]=_0x159536;return _0x4fb39e;})[_0x85f2('0x29')](respondWithFilteredResult(_0x158828,_0x3b4a9d))[_0x85f2('0x49')](handleError(_0x158828,null));};exports[_0x85f2('0x4a')]=function(_0x46d647,_0x5428d2){var _0x4a240d={'raw':!![],'where':{'id':_0x46d647[_0x85f2('0x4b')]['id']}},_0x58690a={};_0x58690a[_0x85f2('0x34')]=_[_0x85f2('0x4c')](db[_0x85f2('0x2f')][_0x85f2('0x30')]);_0x58690a[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x46d647[_0x85f2('0x35')]);_0x58690a[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x58690a[_0x85f2('0x34')],_0x58690a[_0x85f2('0x35')]);_0x4a240d[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x58690a[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x46d647['query']['fields']));_0x4a240d[_0x85f2('0x37')]=_0x4a240d[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x4a240d[_0x85f2('0x37')]:_0x58690a['model'];if(_0x46d647[_0x85f2('0x35')][_0x85f2('0x45')]){_0x4a240d[_0x85f2('0x46')]=[{'all':!![]}];}_0x4a240d=_['merge']({},_0x4a240d,_0x46d647['options']);return db[_0x85f2('0x2f')][_0x85f2('0x4d')](_0x4a240d)[_0x85f2('0x29')](handleEntityNotFound(_0x5428d2,null))['then'](respondWithResult(_0x5428d2,null))['catch'](handleError(_0x5428d2,null));};exports['create']=function(_0x44ebd7,_0x563600){return db['ChatGroup'][_0x85f2('0x4e')](_0x44ebd7[_0x85f2('0x4f')],{})['then'](respondWithResult(_0x563600,0xc9))[_0x85f2('0x49')](handleError(_0x563600,null));};exports['update']=function(_0x45f5ba,_0x2ab1eb){if(_0x45f5ba[_0x85f2('0x4f')]['id']){delete _0x45f5ba[_0x85f2('0x4f')]['id'];}return db['ChatGroup'][_0x85f2('0x4d')]({'where':{'id':_0x45f5ba['params']['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2ab1eb,null))[_0x85f2('0x29')](saveUpdates(_0x45f5ba['body'],null))['then'](respondWithResult(_0x2ab1eb,null))[_0x85f2('0x49')](handleError(_0x2ab1eb,null));};exports[_0x85f2('0x2a')]=function(_0x3ff4a0,_0x2d71b7){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x3ff4a0[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2d71b7,null))['then'](removeEntity(_0x2d71b7,null))[_0x85f2('0x49')](handleError(_0x2d71b7,null));};exports['describe']=function(_0xa1e1d2,_0x56bc2b){return db['ChatGroup'][_0x85f2('0x50')]()[_0x85f2('0x29')](respondWithResult(_0x56bc2b,null))['catch'](handleError(_0x56bc2b,null));};exports['getUnread']=function(_0x589e96,_0x5d038a,_0x3979f3){return db[_0x85f2('0x51')]['count']({'where':{'ChatGroupId':_0x589e96[_0x85f2('0x4b')]['id'],'ToId':_0x589e96['user']['id'],'read':![]}})[_0x85f2('0x29')](function(_0x24c2f9){return{'id':_[_0x85f2('0x52')](_0x589e96[_0x85f2('0x4b')]['id']),'count':_0x24c2f9};})[_0x85f2('0x29')](respondWithResult(_0x5d038a,null))[_0x85f2('0x49')](handleError(_0x5d038a,null));};exports[_0x85f2('0x53')]=function(_0x212310,_0x2baf01,_0x83229a){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x212310[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2baf01,null))[_0x85f2('0x29')](function(_0x438eb4){if(_0x438eb4){return _0x438eb4[_0x85f2('0x53')](_0x212310['body'][_0x85f2('0x54')],_[_0x85f2('0x55')](_0x212310['body'],[_0x85f2('0x54'),'id'])||{});}})[_0x85f2('0x29')](respondWithResult(_0x2baf01,null))[_0x85f2('0x49')](handleError(_0x2baf01,null));};exports[_0x85f2('0x56')]=function(_0x230074,_0x42d2f6,_0x4ad8e9){var _0x3e808b={};var _0x563e14={};var _0x50fa3f;var _0x34b905;return db[_0x85f2('0x2f')][_0x85f2('0x57')]({'where':{'id':_0x230074[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x42d2f6,null))[_0x85f2('0x29')](function(_0x517ee7){if(_0x517ee7){_0x50fa3f=_0x517ee7;_0x563e14[_0x85f2('0x34')]=_[_0x85f2('0x4c')](db[_0x85f2('0x58')][_0x85f2('0x30')]);_0x563e14[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x230074[_0x85f2('0x35')]);_0x563e14[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x563e14['model'],_0x563e14[_0x85f2('0x35')]);_0x3e808b[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x563e14['model'],qs['fields'](_0x230074[_0x85f2('0x35')]['fields']));_0x3e808b['attributes']=_0x3e808b['attributes']['length']?_0x3e808b[_0x85f2('0x37')]:_0x563e14[_0x85f2('0x34')];_0x3e808b['order']=qs[_0x85f2('0x3e')](_0x230074[_0x85f2('0x35')][_0x85f2('0x3e')]);_0x3e808b[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x230074[_0x85f2('0x35')],_0x563e14['filters']));if(_0x230074[_0x85f2('0x35')]['filter']){_0x3e808b[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3e808b[_0x85f2('0x3f')],{'$or':_['map'](_0x3e808b[_0x85f2('0x37')],function(_0x78857a){var _0x4699e7={};_0x4699e7[_0x78857a]={'$like':'%'+_0x230074['query'][_0x85f2('0x43')]+'%'};return _0x4699e7;})});}_0x3e808b=_[_0x85f2('0x41')]({},_0x3e808b,_0x230074[_0x85f2('0x44')]);return _0x50fa3f['getMembers'](_0x3e808b);}})[_0x85f2('0x29')](function(_0x508dff){if(_0x508dff){_0x34b905=_0x508dff[_0x85f2('0x3a')];if(!_0x230074['query'][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3e808b[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x230074['query']['limit']);_0x3e808b['offset']=qs[_0x85f2('0x25')](_0x230074['query']['offset']);}return _0x50fa3f['getMembers'](_0x3e808b);}})[_0x85f2('0x29')](function(_0x54ada6){if(_0x54ada6){return _0x54ada6?{'count':_0x34b905,'rows':_0x54ada6}:null;}})[_0x85f2('0x29')](respondWithResult(_0x42d2f6,null))[_0x85f2('0x49')](handleError(_0x42d2f6,null));};exports[_0x85f2('0x59')]=function(_0x10ba1f,_0x1b1d40,_0x189d0c){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x10ba1f[_0x85f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b1d40,null))[_0x85f2('0x29')](function(_0x1b0db9){if(_0x1b0db9){return _0x1b0db9[_0x85f2('0x59')](_0x10ba1f[_0x85f2('0x35')][_0x85f2('0x54')]);}})[_0x85f2('0x29')](respondWithStatusCode(_0x1b1d40,null))[_0x85f2('0x49')](handleError(_0x1b1d40,null));};exports[_0x85f2('0x5a')]=function(_0x4da176,_0x463b97,_0x545f82){if(_0x4da176['body']['id']){delete _0x4da176[_0x85f2('0x4f')]['id'];}return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x4da176['params']['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x463b97,null))[_0x85f2('0x29')](function(_0x4b28fe){if(_0x4b28fe){_0x4da176['body']['ChatGroupId']=_0x4b28fe['id'];return db[_0x85f2('0x51')][_0x85f2('0x4e')](_0x4da176['body']);}})['then'](respondWithResult(_0x463b97,null))[_0x85f2('0x49')](handleError(_0x463b97,null));};exports[_0x85f2('0x5b')]=function(_0x46231,_0x2957e3,_0x28244c){var _0x3e7afa={};var _0x3e283d={};var _0x56d328;var _0x30c600;return db[_0x85f2('0x2f')][_0x85f2('0x57')]({'where':{'id':_0x46231[_0x85f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2957e3,null))['then'](function(_0x1b2a5b){if(_0x1b2a5b){_0x56d328=_0x1b2a5b;_0x3e283d[_0x85f2('0x34')]=_['keys'](db[_0x85f2('0x51')][_0x85f2('0x30')]);_0x3e283d[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x46231[_0x85f2('0x35')]);_0x3e283d[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x3e283d[_0x85f2('0x34')],_0x3e283d[_0x85f2('0x35')]);_0x3e7afa['attributes']=_[_0x85f2('0x38')](_0x3e283d[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x46231[_0x85f2('0x35')][_0x85f2('0x39')]));_0x3e7afa[_0x85f2('0x37')]=_0x3e7afa[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x3e7afa[_0x85f2('0x37')]:_0x3e283d['model'];_0x3e7afa['order']=qs[_0x85f2('0x3e')](_0x46231['query'][_0x85f2('0x3e')]);_0x3e7afa[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x46231['query'],_0x3e283d[_0x85f2('0x36')]));if(_0x46231[_0x85f2('0x35')][_0x85f2('0x43')]){_0x3e7afa[_0x85f2('0x3f')]=_['merge'](_0x3e7afa[_0x85f2('0x3f')],{'$or':_['map'](_0x3e7afa[_0x85f2('0x37')],function(_0x585c89){var _0x25fac8={};_0x25fac8[_0x585c89]={'$like':'%'+_0x46231[_0x85f2('0x35')][_0x85f2('0x43')]+'%'};return _0x25fac8;})});}if(_0x46231[_0x85f2('0x35')][_0x85f2('0x5c')]){var _0x8bea1b=_0x46231['query'][_0x85f2('0x5c')][_0x85f2('0x5d')](',');var _0x14f793={};_0x14f793[_0x8bea1b[0x0]]={'$gte':moment(_0x8bea1b[0x1])[_0x85f2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3e7afa[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3e7afa[_0x85f2('0x3f')],_0x14f793);}_0x3e7afa=_[_0x85f2('0x41')]({},_0x3e7afa,_0x46231['options']);return _0x56d328[_0x85f2('0x5b')](_0x3e7afa);}})[_0x85f2('0x29')](function(_0x36bb4e){if(_0x36bb4e){_0x30c600=_0x36bb4e[_0x85f2('0x3a')];if(!_0x46231['query'][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3e7afa[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x46231['query'][_0x85f2('0x26')]);_0x3e7afa[_0x85f2('0x25')]=qs[_0x85f2('0x25')](_0x46231[_0x85f2('0x35')][_0x85f2('0x25')]);}return _0x56d328[_0x85f2('0x5b')](_0x3e7afa);}})['then'](function(_0xcc388e){if(_0xcc388e){return _0xcc388e?{'count':_0x30c600,'rows':_0xcc388e}:null;}})[_0x85f2('0x29')](respondWithResult(_0x2957e3,null))[_0x85f2('0x49')](handleError(_0x2957e3,null));};
\ No newline at end of file
+var _0xf8ce=['then','destroy','error','stack','name','map','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','ChatGroup','rawAttributes','keys','find','create','body','getUnread','ChatInternalMessage','toInteger','getMembers','findOne','User','options','length','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x321cff,_0x271a66){var _0x331c4=function(_0x3846e8){while(--_0x3846e8){_0x321cff['push'](_0x321cff['shift']());}};_0x331c4(++_0x271a66);}(_0xf8ce,0x190));var _0xef8c=function(_0x2998fd,_0x32f00e){_0x2998fd=_0x2998fd-0x0;var _0x212def=_0xf8ce[_0x2998fd];return _0x212def;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef8c('0x0'));var zipdir=require(_0xef8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef8c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xef8c('0x3'));var sox=require(_0xef8c('0x4'));var csv=require(_0xef8c('0x5'));var ejs=require(_0xef8c('0x6'));var fs=require('fs');var fs_extra=require(_0xef8c('0x7'));var _=require(_0xef8c('0x8'));var squel=require(_0xef8c('0x9'));var crypto=require('crypto');var jsforce=require(_0xef8c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef8c('0x5'));var querystring=require('querystring');var Papa=require(_0xef8c('0xb'));var Redis=require(_0xef8c('0xc'));var authService=require(_0xef8c('0xd'));var qs=require(_0xef8c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef8c('0xf'))(_0xef8c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef8c('0x11'))['db'];config[_0xef8c('0x12')]=_['defaults'](config[_0xef8c('0x12')],{'host':_0xef8c('0x13'),'port':0x18eb});var socket=require(_0xef8c('0x14'))(new Redis(config[_0xef8c('0x12')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x1edd86,_0x526a89){_0x526a89=_0x526a89||0xcc;return function(_0x51f305){if(_0x51f305){return _0x1edd86[_0xef8c('0x15')](_0x526a89);}return _0x1edd86[_0xef8c('0x16')](_0x526a89)[_0xef8c('0x17')]();};}function respondWithResult(_0x3c8fc0,_0x385339){_0x385339=_0x385339||0xc8;return function(_0x35b2ce){if(_0x35b2ce){return _0x3c8fc0[_0xef8c('0x16')](_0x385339)[_0xef8c('0x18')](_0x35b2ce);}};}function respondWithFilteredResult(_0x314f5c,_0x230364){return function(_0x37c5b2){if(_0x37c5b2){var _0x387be3=typeof _0x230364[_0xef8c('0x19')]===_0xef8c('0x1a')&&typeof _0x230364[_0xef8c('0x1b')]===_0xef8c('0x1a');var _0x53e757=_0x37c5b2[_0xef8c('0x1c')];var _0x36e75d=_0x387be3?0x0:_0x230364['offset'];var _0x39205f=_0x387be3?_0x37c5b2[_0xef8c('0x1c')]:_0x230364['offset']+_0x230364[_0xef8c('0x1b')];var _0x94bb1a;if(_0x39205f>=_0x53e757){_0x39205f=_0x53e757;_0x94bb1a=0xc8;}else{_0x94bb1a=0xce;}_0x314f5c[_0xef8c('0x16')](_0x94bb1a);return _0x314f5c[_0xef8c('0x1d')](_0xef8c('0x1e'),_0x36e75d+'-'+_0x39205f+'/'+_0x53e757)['json'](_0x37c5b2);}return null;};}function patchUpdates(_0x1cad71){return function(_0x123c0f){try{jsonpatch[_0xef8c('0x1f')](_0x123c0f,_0x1cad71,!![]);}catch(_0x2d7641){return BPromise[_0xef8c('0x20')](_0x2d7641);}return _0x123c0f[_0xef8c('0x21')]();};}function saveUpdates(_0x3c9055,_0x63e447){return function(_0x27174d){if(_0x27174d){return _0x27174d[_0xef8c('0x22')](_0x3c9055)[_0xef8c('0x23')](function(_0x2ccccd){return _0x2ccccd;});}return null;};}function removeEntity(_0x3a1cd6,_0x3bd602){return function(_0x472358){if(_0x472358){return _0x472358[_0xef8c('0x24')]()[_0xef8c('0x23')](function(){_0x3a1cd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d4b9,_0x6079d4){return function(_0x54f07b){if(!_0x54f07b){_0x16d4b9[_0xef8c('0x15')](0x194);}return _0x54f07b;};}function handleError(_0x40adbf,_0x583698){_0x583698=_0x583698||0x1f4;return function(_0x11994d){logger[_0xef8c('0x25')](_0x11994d[_0xef8c('0x26')]);if(_0x11994d['name']){delete _0x11994d[_0xef8c('0x27')];}_0x40adbf['status'](_0x583698)['send'](_0x11994d);};}exports['index']=function(_0x24cd34,_0x44de5b){var _0x166ac5={},_0x5ece73={},_0x2fbd13={'count':0x0,'rows':[]};var _0x160499=_[_0xef8c('0x28')](db['ChatGroup']['rawAttributes'],function(_0x127d67){return{'name':_0x127d67['fieldName'],'type':_0x127d67['type']['key']};});_0x5ece73[_0xef8c('0x29')]=_[_0xef8c('0x28')](_0x160499,_0xef8c('0x27'));_0x5ece73[_0xef8c('0x2a')]=_['keys'](_0x24cd34[_0xef8c('0x2a')]);_0x5ece73[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],_0x5ece73[_0xef8c('0x2a')]);_0x166ac5[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x166ac5[_0xef8c('0x2d')]=_0x166ac5['attributes']['length']?_0x166ac5['attributes']:_0x5ece73['model'];if(!_0x24cd34['query'][_0xef8c('0x2f')](_0xef8c('0x30'))){_0x166ac5[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x166ac5['offset']=qs[_0xef8c('0x19')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x19')]);}_0x166ac5[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x166ac5[_0xef8c('0x33')]=qs[_0xef8c('0x2b')](_[_0xef8c('0x34')](_0x24cd34[_0xef8c('0x2a')],_0x5ece73['filters']),_0x160499);if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x166ac5[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x166ac5['where'],{'$or':_[_0xef8c('0x28')](_0x160499,function(_0x28fa9c){if(_0x28fa9c[_0xef8c('0x37')]!==_0xef8c('0x38')){var _0x2bdc50={};_0x2bdc50[_0x28fa9c[_0xef8c('0x27')]]={'$like':'%'+_0x24cd34['query'][_0xef8c('0x35')]+'%'};return _0x2bdc50;}})});}_0x166ac5=_['merge']({},_0x166ac5,_0x24cd34['options']);var _0x2869a1={'where':_0x166ac5[_0xef8c('0x33')]};return db['ChatGroup']['count'](_0x2869a1)[_0xef8c('0x23')](function(_0x15936e){_0x2fbd13['count']=_0x15936e;if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x166ac5[_0xef8c('0x3a')]=[{'all':!![]}];}return db['ChatGroup'][_0xef8c('0x3b')](_0x166ac5);})['then'](function(_0x3eaa25){_0x2fbd13[_0xef8c('0x3c')]=_0x3eaa25;return _0x2fbd13;})['then'](respondWithFilteredResult(_0x44de5b,_0x166ac5))[_0xef8c('0x3d')](handleError(_0x44de5b,null));};exports[_0xef8c('0x3e')]=function(_0x81ec7d,_0x138a20){var _0x290a8c={'raw':!![],'where':{'id':_0x81ec7d[_0xef8c('0x3f')]['id']}},_0x202710={};_0x202710['model']=_['keys'](db[_0xef8c('0x40')][_0xef8c('0x41')]);_0x202710[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x81ec7d[_0xef8c('0x2a')]);_0x202710['filters']=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],_0x202710['query']);_0x290a8c[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x81ec7d['query'][_0xef8c('0x2e')]));_0x290a8c[_0xef8c('0x2d')]=_0x290a8c[_0xef8c('0x2d')]['length']?_0x290a8c[_0xef8c('0x2d')]:_0x202710['model'];if(_0x81ec7d[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x290a8c['include']=[{'all':!![]}];}_0x290a8c=_[_0xef8c('0x36')]({},_0x290a8c,_0x81ec7d['options']);return db['ChatGroup'][_0xef8c('0x43')](_0x290a8c)[_0xef8c('0x23')](handleEntityNotFound(_0x138a20,null))[_0xef8c('0x23')](respondWithResult(_0x138a20,null))['catch'](handleError(_0x138a20,null));};exports[_0xef8c('0x44')]=function(_0x15699c,_0x18b1c5){return db[_0xef8c('0x40')][_0xef8c('0x44')](_0x15699c[_0xef8c('0x45')],{})[_0xef8c('0x23')](respondWithResult(_0x18b1c5,0xc9))[_0xef8c('0x3d')](handleError(_0x18b1c5,null));};exports[_0xef8c('0x22')]=function(_0x452ae3,_0x3f3fe9){if(_0x452ae3[_0xef8c('0x45')]['id']){delete _0x452ae3[_0xef8c('0x45')]['id'];}return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x452ae3['params']['id']}})['then'](handleEntityNotFound(_0x3f3fe9,null))['then'](saveUpdates(_0x452ae3['body'],null))[_0xef8c('0x23')](respondWithResult(_0x3f3fe9,null))['catch'](handleError(_0x3f3fe9,null));};exports['destroy']=function(_0x31bf65,_0x473104){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x31bf65[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x473104,null))['then'](removeEntity(_0x473104,null))[_0xef8c('0x3d')](handleError(_0x473104,null));};exports['describe']=function(_0x2ed52c,_0x38dd30){return db[_0xef8c('0x40')]['describe']()['then'](respondWithResult(_0x38dd30,null))[_0xef8c('0x3d')](handleError(_0x38dd30,null));};exports[_0xef8c('0x46')]=function(_0x459291,_0x4a2331,_0x19ed7e){return db[_0xef8c('0x47')][_0xef8c('0x1c')]({'where':{'ChatGroupId':_0x459291[_0xef8c('0x3f')]['id'],'ToId':_0x459291['user']['id'],'read':![]}})[_0xef8c('0x23')](function(_0x1b221a){return{'id':_[_0xef8c('0x48')](_0x459291[_0xef8c('0x3f')]['id']),'count':_0x1b221a};})['then'](respondWithResult(_0x4a2331,null))[_0xef8c('0x3d')](handleError(_0x4a2331,null));};exports['addMembers']=function(_0x554534,_0x32f9c7,_0x5dd0fc){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x554534[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x32f9c7,null))['then'](function(_0x393d8b){if(_0x393d8b){return _0x393d8b['addMembers'](_0x554534['body']['ids'],_['omit'](_0x554534[_0xef8c('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x32f9c7,null))['catch'](handleError(_0x32f9c7,null));};exports[_0xef8c('0x49')]=function(_0x2137ad,_0x4a56d6,_0x4e3c50){var _0x179b21={};var _0xce07b7={};var _0x44f917;var _0x1a7a19;return db[_0xef8c('0x40')][_0xef8c('0x4a')]({'where':{'id':_0x2137ad[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a56d6,null))['then'](function(_0x5af429){if(_0x5af429){_0x44f917=_0x5af429;_0xce07b7['model']=_[_0xef8c('0x42')](db[_0xef8c('0x4b')][_0xef8c('0x41')]);_0xce07b7[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x2137ad[_0xef8c('0x2a')]);_0xce07b7[_0xef8c('0x2b')]=_['intersection'](_0xce07b7['model'],_0xce07b7[_0xef8c('0x2a')]);_0x179b21[_0xef8c('0x2d')]=_['intersection'](_0xce07b7[_0xef8c('0x29')],qs['fields'](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x179b21[_0xef8c('0x2d')]=_0x179b21['attributes']['length']?_0x179b21[_0xef8c('0x2d')]:_0xce07b7[_0xef8c('0x29')];_0x179b21[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x179b21[_0xef8c('0x33')]=qs['filters'](_[_0xef8c('0x34')](_0x2137ad[_0xef8c('0x2a')],_0xce07b7[_0xef8c('0x2b')]));if(_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x179b21[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x179b21[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x179b21[_0xef8c('0x2d')],function(_0x27ef19){var _0x52cfe9={};_0x52cfe9[_0x27ef19]={'$like':'%'+_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x52cfe9;})});}_0x179b21=_[_0xef8c('0x36')]({},_0x179b21,_0x2137ad[_0xef8c('0x4c')]);return _0x44f917[_0xef8c('0x49')](_0x179b21);}})[_0xef8c('0x23')](function(_0x3cb8d8){if(_0x3cb8d8){_0x1a7a19=_0x3cb8d8[_0xef8c('0x4d')];if(!_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2f')]('nolimit')){_0x179b21[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x179b21[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x19')]);}return _0x44f917['getMembers'](_0x179b21);}})[_0xef8c('0x23')](function(_0x47f35b){if(_0x47f35b){return _0x47f35b?{'count':_0x1a7a19,'rows':_0x47f35b}:null;}})[_0xef8c('0x23')](respondWithResult(_0x4a56d6,null))[_0xef8c('0x3d')](handleError(_0x4a56d6,null));};exports[_0xef8c('0x4e')]=function(_0x20cc4e,_0x4ca08a,_0x3ada07){return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x20cc4e['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x4ca08a,null))[_0xef8c('0x23')](function(_0x27ad10){if(_0x27ad10){return _0x27ad10['removeMembers'](_0x20cc4e[_0xef8c('0x2a')][_0xef8c('0x4f')]);}})[_0xef8c('0x23')](respondWithStatusCode(_0x4ca08a,null))[_0xef8c('0x3d')](handleError(_0x4ca08a,null));};exports[_0xef8c('0x50')]=function(_0x4447e3,_0x53df13,_0xc2f61e){if(_0x4447e3['body']['id']){delete _0x4447e3[_0xef8c('0x45')]['id'];}return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x4447e3['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x53df13,null))[_0xef8c('0x23')](function(_0x40a083){if(_0x40a083){_0x4447e3[_0xef8c('0x45')][_0xef8c('0x51')]=_0x40a083['id'];return db['ChatInternalMessage'][_0xef8c('0x44')](_0x4447e3['body']);}})[_0xef8c('0x23')](respondWithResult(_0x53df13,null))[_0xef8c('0x3d')](handleError(_0x53df13,null));};exports[_0xef8c('0x52')]=function(_0x66cc2,_0x43ace3,_0x12870b){var _0x19be11={};var _0xc83512={};var _0x4fd9a7;var _0x5045e9;return db[_0xef8c('0x40')]['findOne']({'where':{'id':_0x66cc2[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x43ace3,null))['then'](function(_0x1f4cf3){if(_0x1f4cf3){_0x4fd9a7=_0x1f4cf3;_0xc83512['model']=_[_0xef8c('0x42')](db['ChatInternalMessage'][_0xef8c('0x41')]);_0xc83512[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x66cc2[_0xef8c('0x2a')]);_0xc83512[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0xc83512[_0xef8c('0x29')],_0xc83512[_0xef8c('0x2a')]);_0x19be11[_0xef8c('0x2d')]=_['intersection'](_0xc83512[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x66cc2['query'][_0xef8c('0x2e')]));_0x19be11[_0xef8c('0x2d')]=_0x19be11[_0xef8c('0x2d')][_0xef8c('0x4d')]?_0x19be11[_0xef8c('0x2d')]:_0xc83512['model'];_0x19be11[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x19be11['where']=qs['filters'](_['pick'](_0x66cc2['query'],_0xc83512[_0xef8c('0x2b')]));if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x19be11['where']=_['merge'](_0x19be11[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x19be11[_0xef8c('0x2d')],function(_0x2a11f6){var _0x32e96a={};_0x32e96a[_0x2a11f6]={'$like':'%'+_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x32e96a;})});}if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')]){var _0x324013=_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')][_0xef8c('0x54')](',');var _0x201a40={};_0x201a40[_0x324013[0x0]]={'$gte':moment(_0x324013[0x1])[_0xef8c('0x55')](_0xef8c('0x56'))};_0x19be11[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x19be11[_0xef8c('0x33')],_0x201a40);}_0x19be11=_[_0xef8c('0x36')]({},_0x19be11,_0x66cc2[_0xef8c('0x4c')]);return _0x4fd9a7[_0xef8c('0x52')](_0x19be11);}})[_0xef8c('0x23')](function(_0x3dd41c){if(_0x3dd41c){_0x5045e9=_0x3dd41c['length'];if(!_0x66cc2['query']['hasOwnProperty'](_0xef8c('0x30'))){_0x19be11['limit']=qs[_0xef8c('0x1b')](_0x66cc2[_0xef8c('0x2a')]['limit']);_0x19be11[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x66cc2['query']['offset']);}return _0x4fd9a7['getMessages'](_0x19be11);}})[_0xef8c('0x23')](function(_0x1cead1){if(_0x1cead1){return _0x1cead1?{'count':_0x5045e9,'rows':_0x1cead1}:null;}})[_0xef8c('0x23')](respondWithResult(_0x43ace3,null))['catch'](handleError(_0x43ace3,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 765f608..5adca32 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 _0x9826=['ChatGroup','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x9826,0x1c7));var _0x6982=function(_0x39b2b1,_0x24fac0){_0x39b2b1=_0x39b2b1-0x0;var _0x4d23fe=_0x9826[_0x39b2b1];return _0x4d23fe;};'use strict';var EventEmitter=require(_0x6982('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x6982('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6982('0x2'),'afterDestroy':_0x6982('0x3')};function emitEvent(_0xdc6e60){return function(_0x503b3d,_0x3ef790,_0x272dcb){ChatGroupEvents[_0x6982('0x4')](_0xdc6e60+':'+_0x503b3d['id'],_0x503b3d);ChatGroupEvents[_0x6982('0x4')](_0xdc6e60,_0x503b3d);_0x272dcb(null);};}for(var e in events){if(events[_0x6982('0x5')](e)){var event=events[e];ChatGroup[_0x6982('0x6')](e,emitEvent(event));}}module[_0x6982('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x35a5=['save','update','emit','exports','setMaxListeners'];(function(_0x12a37e,_0x83815f){var _0x244a0f=function(_0xa251d1){while(--_0xa251d1){_0x12a37e['push'](_0x12a37e['shift']());}};_0x244a0f(++_0x83815f);}(_0x35a5,0x1b7));var _0x535a=function(_0x971a7d,_0x1d8235){_0x971a7d=_0x971a7d-0x0;var _0xc7b4a3=_0x35a5[_0x971a7d];return _0xc7b4a3;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x535a('0x0')](0x0);var events={'afterCreate':_0x535a('0x1'),'afterUpdate':_0x535a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3b1c34){return function(_0x5bb039,_0x955000,_0x3b0cbd){ChatGroupEvents[_0x535a('0x3')](_0x3b1c34+':'+_0x5bb039['id'],_0x5bb039);ChatGroupEvents['emit'](_0x3b1c34,_0x5bb039);_0x3b0cbd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x535a('0x4')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 165188f..41950ac 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 _0xe443=['ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1377a1,_0x2467bf){var _0x42150e=function(_0x5803e9){while(--_0x5803e9){_0x1377a1['push'](_0x1377a1['shift']());}};_0x42150e(++_0x2467bf);}(_0xe443,0xf9));var _0x3e44=function(_0x4fb722,_0x2a2164){_0x4fb722=_0x4fb722-0x0;var _0x19bf60=_0xe443[_0x4fb722];return _0x19bf60;};'use strict';var _=require('lodash');var util=require(_0x3e44('0x0'));var logger=require(_0x3e44('0x1'))(_0x3e44('0x2'));var moment=require(_0x3e44('0x3'));var BPromise=require(_0x3e44('0x4'));var rp=require(_0x3e44('0x5'));var fs=require('fs');var path=require(_0x3e44('0x6'));var rimraf=require(_0x3e44('0x7'));var config=require(_0x3e44('0x8'));var attributes=require('./chatGroup.attributes');module[_0x3e44('0x9')]=function(_0x317429,_0x5d525a){return _0x317429[_0x3e44('0xa')](_0x3e44('0xb'),attributes,{'tableName':_0x3e44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4996a7,_0x41b1c5){var _0x5b0895=function(_0x46e7a6){while(--_0x46e7a6){_0x4996a7['push'](_0x4996a7['shift']());}};_0x5b0895(++_0x41b1c5);}(_0xbaf0,0x1e8));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0baf('0x0'));var util=require('util');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(_0x0baf('0x6'));var rimraf=require(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var attributes=require('./chatGroup.attributes');module[_0x0baf('0x9')]=function(_0x5eb85c,_0x4eb914){return _0x5eb85c[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'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 ffc42bb..398ffa5 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 _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4d16bd,_0x3b7634){var _0x2fd438=function(_0x1771a7){while(--_0x1771a7){_0x4d16bd['push'](_0x4d16bd['shift']());}};_0x2fd438(++_0x3b7634);}(_0xaeaf,0x14e));var _0xfaea=function(_0x5c2bef,_0x16806e){_0x5c2bef=_0x5c2bef-0x0;var _0xd60cc1=_0xaeaf[_0x5c2bef];return _0xd60cc1;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});}
\ No newline at end of file
+var _0xff96=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xff96,0x179));var _0x6ff9=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xff96[_0x383dbb];return _0x6e8bde;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6ff9('0xd'),'port':0x18eb});var socket=require(_0x6ff9('0xe'))(new Redis(config[_0x6ff9('0xf')]));require(_0x6ff9('0x10'))[_0x6ff9('0x11')](socket);function respondWithRpcPromise(_0x40d18c,_0x5e81cd,_0x27aab4){return new BPromise(function(_0x1e8a6d,_0x2cbf11){return client[_0x6ff9('0x12')](_0x40d18c,_0x27aab4)[_0x6ff9('0x13')](function(_0x153757){logger[_0x6ff9('0x14')](_0x6ff9('0x15'),_0x5e81cd,_0x6ff9('0x16'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'),JSON['stringify'](_0x153757));if(_0x153757[_0x6ff9('0x17')]){if(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x18')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x2cbf11(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x1e8a6d(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}else{logger[_0x6ff9('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'));_0x1e8a6d(_0x153757[_0x6ff9('0x1a')][_0x6ff9('0x19')]);}})['catch'](function(_0x48269e){logger['error'](_0x6ff9('0x15'),_0x5e81cd,_0x48269e);_0x2cbf11(_0x48269e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e226de0..5a17f92 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 _0x3e53=['chatGroup:','save','remove','update','removeListener','register','length'];(function(_0x53955c,_0x1400fd){var _0x591b50=function(_0x4af6be){while(--_0x4af6be){_0x53955c['push'](_0x53955c['shift']());}};_0x591b50(++_0x1400fd);}(_0x3e53,0x17b));var _0x33e5=function(_0xfa0650,_0x4cd59d){_0xfa0650=_0xfa0650-0x0;var _0x279aa7=_0x3e53[_0xfa0650];return _0x279aa7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x33e5('0x0'),_0x33e5('0x1'),_0x33e5('0x2')];function createListener(_0x4a24b7,_0x5f4cc8){return function(_0x5705af){_0x5f4cc8['emit'](_0x4a24b7,_0x5705af);};}function removeListener(_0x26b238,_0x4356bd){return function(){ChatGroupEvents[_0x33e5('0x3')](_0x26b238,_0x4356bd);};}exports[_0x33e5('0x4')]=function(_0x531a34){for(var _0x1ec882=0x0,_0x25c8fa=events[_0x33e5('0x5')];_0x1ec882<_0x25c8fa;_0x1ec882++){var _0x2220ab=events[_0x1ec882];var _0x5bbde6=createListener(_0x33e5('0x6')+_0x2220ab,_0x531a34);ChatGroupEvents['on'](_0x2220ab,_0x5bbde6);}};
\ No newline at end of file
+var _0xc6d9=['update','emit','register','length','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc6d9,0xd0));var _0x9c6d=function(_0x946cc6,_0x18f910){_0x946cc6=_0x946cc6-0x0;var _0x2a72e7=_0xc6d9[_0x946cc6];return _0x2a72e7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9c6d('0x0'),_0x9c6d('0x1'),_0x9c6d('0x2')];function createListener(_0x1345d5,_0x1207c8){return function(_0x5eee3c){_0x1207c8[_0x9c6d('0x3')](_0x1345d5,_0x5eee3c);};}function removeListener(_0x169d64,_0x38ac2a){return function(){ChatGroupEvents['removeListener'](_0x169d64,_0x38ac2a);};}exports[_0x9c6d('0x4')]=function(_0x3426cd){for(var _0x330796=0x0,_0x1e952c=events[_0x9c6d('0x5')];_0x330796<_0x1e952c;_0x330796++){var _0x2c1e06=events[_0x330796];var _0x11d56c=createListener('chatGroup:'+_0x2c1e06,_0x3426cd);ChatGroupEvents['on'](_0x2c1e06,_0x11d56c);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 680696a..5507858 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 _0x3259=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','addMessage','put','/:id','delete','removeMembers','exports','multer','path'];(function(_0x3cc299,_0x59c672){var _0x2e3a50=function(_0x4aa0ba){while(--_0x4aa0ba){_0x3cc299['push'](_0x3cc299['shift']());}};_0x2e3a50(++_0x59c672);}(_0x3259,0x1de));var _0x9325=function(_0x2bad5f,_0x245b7e){_0x2bad5f=_0x2bad5f-0x0;var _0x1b63b6=_0x3259[_0x2bad5f];return _0x1b63b6;};'use strict';var multer=require(_0x9325('0x0'));var util=require('util');var path=require(_0x9325('0x1'));var timeout=require(_0x9325('0x2'));var express=require('express');var router=express[_0x9325('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9325('0x4'));var interaction=require(_0x9325('0x5'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x9325('0x6')]('/',auth[_0x9325('0x7')](),controller[_0x9325('0x8')]);router[_0x9325('0x6')]('/describe',auth[_0x9325('0x7')](),controller[_0x9325('0x9')]);router[_0x9325('0x6')]('/:id',auth[_0x9325('0x7')](),controller[_0x9325('0xa')]);router[_0x9325('0x6')](_0x9325('0xb'),auth['isAuthenticated'](),controller[_0x9325('0xc')]);router[_0x9325('0x6')](_0x9325('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9325('0x6')]('/:id/messages',auth[_0x9325('0x7')](),controller[_0x9325('0xe')]);router[_0x9325('0xf')]('/',auth[_0x9325('0x7')](),controller[_0x9325('0x10')]);router['post'](_0x9325('0xd'),auth[_0x9325('0x7')](),controller[_0x9325('0x11')]);router[_0x9325('0xf')]('/:id/messages',auth[_0x9325('0x7')](),controller[_0x9325('0x12')]);router[_0x9325('0x13')](_0x9325('0x14'),auth[_0x9325('0x7')](),controller['update']);router['delete'](_0x9325('0x14'),auth[_0x9325('0x7')](),controller['destroy']);router[_0x9325('0x15')](_0x9325('0xd'),auth[_0x9325('0x7')](),controller[_0x9325('0x16')]);module[_0x9325('0x17')]=router;
\ No newline at end of file
+var _0x47d6=['post','create','addMessage','put','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages'];(function(_0x29d762,_0x2fe851){var _0x2b1c63=function(_0xc55c15){while(--_0xc55c15){_0x29d762['push'](_0x29d762['shift']());}};_0x2b1c63(++_0x2fe851);}(_0x47d6,0xd4));var _0x647d=function(_0x1fb01e,_0x2dbcc9){_0x1fb01e=_0x1fb01e-0x0;var _0x1a88d2=_0x47d6[_0x1fb01e];return _0x1a88d2;};'use strict';var multer=require(_0x647d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x647d('0x1'));var express=require(_0x647d('0x2'));var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require(_0x647d('0x6'));var config=require(_0x647d('0x7'));var controller=require(_0x647d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0xa')](_0x647d('0xb'),auth[_0x647d('0xc')](),controller[_0x647d('0xd')]);router['get'](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0xf')]);router[_0x647d('0xa')](_0x647d('0x10'),auth['isAuthenticated'](),controller['getUnread']);router[_0x647d('0xa')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x12')]);router[_0x647d('0xa')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x13')]);router[_0x647d('0x14')]('/',auth[_0x647d('0xc')](),controller[_0x647d('0x15')]);router['post'](_0x647d('0x11'),auth[_0x647d('0xc')](),controller['addMembers']);router[_0x647d('0x14')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x16')]);router[_0x647d('0x17')](_0x647d('0xe'),auth['isAuthenticated'](),controller[_0x647d('0x18')]);router[_0x647d('0x19')](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0x1a')]);router[_0x647d('0x19')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x1b')]);module[_0x647d('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 2f05973..a963800 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 _0x9d9b=['out','exports','BOOLEAN','ENUM','thumb','star','TEXT','STRING','long','DATE'];(function(_0x429a21,_0x43b4e0){var _0x3a8c04=function(_0x589489){while(--_0x589489){_0x429a21['push'](_0x429a21['shift']());}};_0x3a8c04(++_0x43b4e0);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x2cf341,_0x3ff277){_0x2cf341=_0x2cf341-0x0;var _0xf162ea=_0x9d9b[_0x2cf341];return _0xf162ea;};'use strict';var Sequelize=require('sequelize');module[_0xb9d9('0x0')]={'closed':{'type':Sequelize[_0xb9d9('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xb9d9('0x2')]('star',_0xb9d9('0x3')),'defaultValue':_0xb9d9('0x4')},'ratingMessage':{'type':Sequelize[_0xb9d9('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xb9d9('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb9d9('0x6')]},'secondDisposition':{'type':Sequelize[_0xb9d9('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9d9('0x6')]},'browserName':{'type':Sequelize[_0xb9d9('0x6')]},'browserVersion':{'type':Sequelize[_0xb9d9('0x6')]},'osName':{'type':Sequelize[_0xb9d9('0x6')]},'osVersion':{'type':Sequelize[_0xb9d9('0x6')]},'deviceModel':{'type':Sequelize[_0xb9d9('0x6')]},'deviceVendor':{'type':Sequelize[_0xb9d9('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb9d9('0x7'))},'read1stAt':{'type':Sequelize[_0xb9d9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xb9d9('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb9d9('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb9d9('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xb9d9('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9563=['thumb','TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star'];(function(_0x35a4a3,_0x282840){var _0x56c301=function(_0x64677c){while(--_0x64677c){_0x35a4a3['push'](_0x35a4a3['shift']());}};_0x56c301(++_0x282840);}(_0x9563,0x1e7));var _0x3956=function(_0x2a308c,_0x4e64ec){_0x2a308c=_0x2a308c-0x0;var _0x21c60f=_0x9563[_0x2a308c];return _0x21c60f;};'use strict';var Sequelize=require(_0x3956('0x0'));module[_0x3956('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3956('0x2')]},'ratingType':{'type':Sequelize[_0x3956('0x3')](_0x3956('0x4'),_0x3956('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3956('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3956('0x7')]},'disposition':{'type':Sequelize[_0x3956('0x8')]},'secondDisposition':{'type':Sequelize[_0x3956('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3956('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x3956('0x8')]},'browserVersion':{'type':Sequelize[_0x3956('0x8')]},'osName':{'type':Sequelize[_0x3956('0x8')]},'osVersion':{'type':Sequelize[_0x3956('0x8')]},'deviceModel':{'type':Sequelize[_0x3956('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3956('0x6')]},'customerIp':{'type':Sequelize[_0x3956('0x8')]},'formData':{'type':Sequelize[_0x3956('0x6')](_0x3956('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3956('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3956('0x3')]('in',_0x3956('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3956('0x8')]},'customerPort':{'type':Sequelize[_0x3956('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3956('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3956('0xb')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 310ca02..3a48779 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 _0x896e=['group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','show','params','rawAttributes','include','options','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','System','Visitor','website_alias','agentAlias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','includeAll','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','download','server','files','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','closedAt','disposition','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','name','render','merge','body','contact','account','fullname','TagIds','Tags','split','forEach','push','catch','map','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x645422,_0x254a30){var _0x328a3c=function(_0x46759b){while(--_0x46759b){_0x645422['push'](_0x645422['shift']());}};_0x328a3c(++_0x254a30);}(_0x896e,0x1e9));var _0xe896=function(_0x42857e,_0xcf56e6){_0x42857e=_0x42857e-0x0;var _0x1eb01e=_0x896e[_0x42857e];return _0x1eb01e;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe896('0x15'));var logger=require(_0xe896('0x16'))(_0xe896('0x17'));var utils=require('../../config/utils');var config=require(_0xe896('0x18'));var licenseUtil=require(_0xe896('0x19'));var db=require(_0xe896('0x1a'))['db'];config['redis']=_[_0xe896('0x1b')](config[_0xe896('0x1c')],{'host':_0xe896('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0x1c')]));require(_0xe896('0x1e'))[_0xe896('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe896('0x20')]({'port':0x232b});var client9004=jayson[_0xe896('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5e78d6,_0x11f41c,_0x16e272,_0x57f04b){return new BPromise(function(_0x50d224,_0x4e062a){var _0x41cbd7=_0x57f04b||client;return _0x41cbd7[_0xe896('0x22')](_0x5e78d6,_0x16e272)[_0xe896('0x23')](function(_0x5dc89d){logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));logger[_0xe896('0x27')](_0xe896('0x28'),_0x11f41c,_0xe896('0x26'),JSON[_0xe896('0x29')](_0x5dc89d));if(_0x5dc89d[_0xe896('0x2a')]){if(_0x5dc89d['error'][_0xe896('0x2b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11f41c,_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);return _0x4e062a(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}logger['error'](_0xe896('0x25'),_0x11f41c,_0x5dc89d['error']['message']);return _0x50d224(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}else{logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));_0x50d224(_0x5dc89d[_0xe896('0x2d')][_0xe896('0x2c')]);}})['catch'](function(_0x390128){logger[_0xe896('0x2a')](_0xe896('0x25'),_0x11f41c,_0x390128);_0x4e062a(_0x390128);});});}function respondWithStatusCode(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0xcc;return function(_0xd50fe2){if(_0xd50fe2){return _0x569d5f[_0xe896('0x2e')](_0x26635e);}return _0x569d5f[_0xe896('0x2f')](_0x26635e)[_0xe896('0x30')]();};}function respondWithResult(_0x3f8ceb,_0x498341){_0x498341=_0x498341||0xc8;return function(_0x10adad){if(_0x10adad){return _0x3f8ceb[_0xe896('0x2f')](_0x498341)[_0xe896('0x31')](_0x10adad);}};}function respondWithFilteredResult(_0xbfb15b,_0xace03f){return function(_0x5e0d9b){if(_0x5e0d9b){var _0x47c268=typeof _0xace03f['offset']==='undefined'&&typeof _0xace03f['limit']===_0xe896('0x32');var _0x29a18e=_0x5e0d9b[_0xe896('0x33')];var _0x76c781=_0x47c268?0x0:_0xace03f[_0xe896('0x34')];var _0x1a6090=_0x47c268?_0x5e0d9b[_0xe896('0x33')]:_0xace03f[_0xe896('0x34')]+_0xace03f['limit'];var _0x4ce052;if(_0x1a6090>=_0x29a18e){_0x1a6090=_0x29a18e;_0x4ce052=0xc8;}else{_0x4ce052=0xce;}_0xbfb15b[_0xe896('0x2f')](_0x4ce052);return _0xbfb15b[_0xe896('0x35')](_0xe896('0x36'),_0x76c781+'-'+_0x1a6090+'/'+_0x29a18e)[_0xe896('0x31')](_0x5e0d9b);}return null;};}function patchUpdates(_0x4ddeb6){return function(_0x14ad7a){try{jsonpatch['apply'](_0x14ad7a,_0x4ddeb6,!![]);}catch(_0x57c6e8){return BPromise[_0xe896('0x37')](_0x57c6e8);}return _0x14ad7a[_0xe896('0x38')]();};}function saveUpdates(_0x266c0e,_0x4a1115){return function(_0x4d8092){if(_0x4d8092){return _0x4d8092['update'](_0x266c0e)[_0xe896('0x23')](function(_0x1493b8){return _0x1493b8;});}return null;};}function removeEntity(_0x10fa64,_0x13e8fa){return function(_0x36d2d7){if(_0x36d2d7){return _0x36d2d7['destroy']()[_0xe896('0x23')](function(){_0x10fa64[_0xe896('0x2f')](0xcc)[_0xe896('0x30')]();});}};}function handleEntityNotFound(_0x28e09c,_0x1366d0){return function(_0x2cce09){if(!_0x2cce09){_0x28e09c[_0xe896('0x2e')](0x194);}return _0x2cce09;};}function handleError(_0x3e28f0,_0x5ea3ce){_0x5ea3ce=_0x5ea3ce||0x1f4;return function(_0x42f3fb){logger[_0xe896('0x2a')](_0x42f3fb['stack']);if(_0x42f3fb[_0xe896('0x39')]){delete _0x42f3fb['name'];}_0x3e28f0[_0xe896('0x2f')](_0x5ea3ce)['send'](_0x42f3fb);};}function getMustacheRender(_0x42f445,_0x5ba71e){return Mustache[_0xe896('0x3a')](_0x42f445,_[_0xe896('0x3b')](_0x5ba71e[_0xe896('0x3c')],{'contact':_0x5ba71e[_0xe896('0x3d')],'message':_0x5ba71e[_0xe896('0x2c')],'agent':_0x5ba71e['agent'],'interaction':_0x5ba71e['interaction'],'account':_0x5ba71e[_0xe896('0x3e')]}))||'';}function getInteractionUsers(_0x2ea387,_0x387cc6){return new BPromise(function(_0x15b6c5,_0x2ff489){try{if(_0x387cc6[_0x2ea387['id']]){_0x2ea387['Users']=_['map'](_0x387cc6[_0x2ea387['id']],function(_0x127a6f){return{'id':_0x127a6f['id'],'fullname':_0x127a6f[_0xe896('0x3f')]};});}}catch(_0x5890b1){_0x2ff489(_0x5890b1);}_0x15b6c5(_0x2ea387);});}function getInteractionTags(_0x57e194,_0x19d2fd){return new BPromise(function(_0x3b1de8,_0x911adb){try{if(_0x57e194[_0xe896('0x40')]){_0x57e194[_0xe896('0x41')]=[];_0x57e194[_0xe896('0x40')][_0xe896('0x42')](',')[_0xe896('0x43')](function(_0x372c71){_0x57e194[_0xe896('0x41')][_0xe896('0x44')](_0x19d2fd[_0x372c71]);});}delete _0x57e194[_0xe896('0x40')];}catch(_0x5c00c6){_0x911adb(_0x5c00c6);}_0x3b1de8(_0x57e194);});}function updateChatInteraction(_0x1e5434,_0x143ad4,_0x59b97f){return new BPromise(function(_0x57366b,_0x5cd5a3){return getInteractionUsers(_0x1e5434,_0x59b97f)[_0xe896('0x23')](function(_0x2a354f){return getInteractionTags(_0x2a354f,_0x143ad4);})[_0xe896('0x23')](function(_0x5d1a19){_0x57366b(_0x5d1a19);})[_0xe896('0x45')](function(_0x22189c){_0x5cd5a3(_0x22189c);});});}exports['index']=function(_0x4c05ce,_0x489254){var _0x22c628={},_0x2b0273={},_0x16927a={'count':0x0,'rows':[]};var _0x402aef=_[_0xe896('0x46')](db[_0xe896('0x47')]['rawAttributes'],function(_0x125fbc){return{'name':_0x125fbc[_0xe896('0x48')],'type':_0x125fbc['type'][_0xe896('0x49')]};});_0x2b0273[_0xe896('0x4a')]=_[_0xe896('0x46')](_0x402aef,_0xe896('0x39'));_0x2b0273['query']=_[_0xe896('0x4b')](_0x4c05ce[_0xe896('0x4c')]);_0x2b0273[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x2b0273[_0xe896('0x4a')],_0x2b0273[_0xe896('0x4c')]);_0x22c628['attributes']=_[_0xe896('0x4e')](_0x2b0273['model'],qs[_0xe896('0x4f')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]));_0x22c628[_0xe896('0x50')]=_0x22c628[_0xe896('0x50')][_0xe896('0x51')]?_0x22c628['attributes']:_0x2b0273[_0xe896('0x4a')];if(!_0x4c05ce[_0xe896('0x4c')]['hasOwnProperty'](_0xe896('0x52'))){_0x22c628[_0xe896('0x53')]=qs['limit'](_0x4c05ce[_0xe896('0x4c')]['limit']);_0x22c628[_0xe896('0x34')]=qs[_0xe896('0x34')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x34')]);}_0x22c628[_0xe896('0x54')]=qs['sort'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x55')]);_0x22c628[_0xe896('0x56')]=qs['filters'](_[_0xe896('0x57')](_0x4c05ce['query'],_0x2b0273['filters']),_0x402aef);var _0x388375=[];var _0x20fe4f=squel['select']()[_0xe896('0x58')]('id')[_0xe896('0x58')]('name')['field'](_0xe896('0x59'))[_0xe896('0x5a')]('tools_tags');var _0x1d18f6=squel[_0xe896('0x5b')]()[_0xe896('0x58')](_0xe896('0x5c'))[_0xe896('0x58')](_0xe896('0x5d'))[_0xe896('0x58')](_0xe896('0x5e'))[_0xe896('0x5a')](_0xe896('0x5f'),'ui')[_0xe896('0x60')]('users','u',_0xe896('0x61'));var _0x2a23a2=squel[_0xe896('0x5b')]()[_0xe896('0x5a')](_0xe896('0x62'),'i')[_0xe896('0x60')](_0xe896('0x63'),'c',_0xe896('0x64'))[_0xe896('0x60')](_0xe896('0x65'),'o',_0xe896('0x66'))[_0xe896('0x60')]('chat_websites','a',_0xe896('0x67'))[_0xe896('0x60')](_0xe896('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0xe896('0x69'))[_0xe896('0x60')](_0xe896('0x6a'),'t',_0xe896('0x6b'));var _0x50c910=squel[_0xe896('0x6c')]();var _0x28396c=[];var _0x57ed84=squel[_0xe896('0x6c')]();var _0x5d6c1c;if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]){_0x5d6c1c=as['parseSearch'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]);var _0x568d89=_0x5d6c1c['sqlOperator'];for(var _0x2a5e68=0x0;_0x2a5e68<_0x5d6c1c[_0xe896('0x6e')][_0xe896('0x51')];_0x2a5e68++){var _0x11291a=_0x5d6c1c[_0xe896('0x6e')][_0x2a5e68];var _0x4e4092='i';var _0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0x11291a[_0xe896('0x58')]]);if(!_0xdadb92){switch(_0x11291a['field']){case'unreadMessages':if(_0x11291a[_0xe896('0x70')]==0x1){_0x2a23a2[_0xe896('0x71')]('`'+_0x11291a['field']+_0xe896('0x72'));}else{_0x2a23a2['having']('`'+_0x11291a[_0xe896('0x58')]+_0xe896('0x73'));}break;case _0xe896('0x74'):if(_0x11291a[_0xe896('0x75')]===_0xe896('0x76')){if(_0x11291a[_0xe896('0x70')][_0xe896('0x42')]('\x20')[_0xe896('0x51')]>0x1){_0x50c910[_0x568d89](_0xe896('0x77'),qs[_0xe896('0x78')](_0x11291a[_0xe896('0x70')]),null);}else{var _0x3248e6='%'+_0x11291a[_0xe896('0x70')]+'%';_0x50c910[_0x568d89](_0xe896('0x79'),_0x3248e6,_0x3248e6,_0x3248e6);}}else{_0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0xe896('0x7a')]);_0x11291a[_0xe896('0x58')]=_0xe896('0x7a');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value']['start'],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}break;case'Tag':var _0x1165ad=_0x11291a[_0xe896('0x70')][_0xe896('0x42')](',')[_0xe896('0x46')](function(_0x19781b){return Number(_0x19781b);});_0x1165ad[_0xe896('0x43')](function(_0x475459){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x475459+',%');});_0x28396c=_[_0xe896('0x7f')](_0x28396c,_0x1165ad);break;case _0xe896('0x80'):if(_0x11291a[_0xe896('0x75')]==='$substring'){_0x50c910[_0x568d89](_0xe896('0x81'),'%'+_0x11291a[_0xe896('0x70')]+'%',null);}else{_0xdadb92=_['find'](_0x402aef,[_0xe896('0x39'),'UserId']);_0x11291a['field']=_0xe896('0x82');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92['type'],_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')]['start'],_0x1c118e['value'][_0xe896('0x30')]);}break;case _0xe896('0x3c'):_0x1c118e=as[_0xe896('0x7b')]('me',null,_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')]['end']);break;}}else{var _0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value'][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}}}else{var _0x4fcd37=_(_0x4c05ce['query'])[_0xe896('0x4b')]()[_0xe896('0x46')](function(_0x4c5091){return _[_0xe896('0x84')](_0x402aef,[_0xe896('0x39'),_0x4c5091])?_0x4c5091:undefined;})[_0xe896('0x85')]()[_0xe896('0x70')]();if(!_['isEmpty'](_0x4fcd37)){_0x4fcd37[_0xe896('0x43')](function(_0x234a3a){if(_0x234a3a===_0xe896('0x86')){_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),[][_0xe896('0x88')](_0x4c05ce['query'][_0x234a3a]));}else if(_0x234a3a==='createdAt'){var _0x48b523=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8a')];var _0x270121=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8b')];_0x2a23a2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48b523,_0x270121);}else{if(_0x4c05ce[_0xe896('0x4c')][_0x234a3a]==='null'){_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20IS\x20NULL');}else{_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20=\x20?',_0x4c05ce[_0xe896('0x4c')][_0x234a3a]);}}});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]==0x1){_0x2a23a2['having'](_0xe896('0x8d'));}else{_0x2a23a2[_0xe896('0x71')](_0xe896('0x8e'));}}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]){_0x28396c=_[_0xe896('0x90')](_0x4c05ce[_0xe896('0x4c')]['tag'])?_0x4c05ce[_0xe896('0x4c')]['tag']:new Array(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]);_0x28396c[_0xe896('0x43')](function(_0x503131){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x503131+',%');});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')]){var _0x1913b2=_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')][_0xe896('0x92')]('\x5c','\x5c\x5c')[_0xe896('0x92')](/'/g,'\x27\x27');if(qs[_0xe896('0x93')](_0x1913b2)){_0x50c910['or'](_0xe896('0x94'),_0x1913b2+'%');}else{_0x50c910['or'](_0xe896('0x95'),qs['getFullTextValue'](_0x1913b2))['or'](_0xe896('0x96'),_0x1913b2+'%');}}}_0x2a23a2[_0xe896('0x56')](_0x50c910);_0x2a23a2[_0xe896('0x97')](_0xe896('0x98'));var _0x48885e={'type':db[_0xe896('0x99')][_0xe896('0x9a')][_0xe896('0x9b')],'raw':!![]};var _0x779db6=_0x2a23a2[_0xe896('0x9c')]();_0x779db6[_0xe896('0x58')](_0xe896('0x98'));_0x779db6[_0xe896('0x58')](_0xe896('0x9d'),_0xe896('0x9e'));if(_0x22c628[_0xe896('0x54')]){_0x22c628[_0xe896('0x54')]['forEach'](function(_0x2bd061){var _0x1d1364=_0x2bd061[0x0]===_0xe896('0x9f')?_0x2bd061[0x0]:'i.'+_0x2bd061[0x0];_0x2a23a2['order'](_0x1d1364,_0x2bd061[0x1]===_0xe896('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x28396c)){_0x2a23a2['having'](_0x57ed84);_0x779db6[_0xe896('0x56')](_0xe896('0xa1'),_0x28396c);}BPromise[_0xe896('0xa2')]()['then'](function(){if(!_0x5d6c1c){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return;_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa3'));return;}if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]!==_0xe896('0xa6'))return;return _0x4c05ce[_0xe896('0xa4')][_0xe896('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x544d2d){if(_[_0xe896('0xa8')](_0x544d2d)){_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa9'));}else{_0x779db6[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));}});})[_0xe896('0x23')](function(){if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]===_0xe896('0xa6')&&!_0x5d6c1c&&!_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x779db6[_0xe896('0xab')](),_0x48885e);})[_0xe896('0x23')](function(_0x16ff5e){_0x16927a[_0xe896('0x33')]=_0x16ff5e[_0xe896('0x51')];if(_0x16927a['count']===0x0)return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x20fe4f[_0xe896('0xab')](),_0x48885e)[_0xe896('0x23')](function(_0x229150){_0x388375=_[_0xe896('0xac')](_0x229150,'id');_0x48885e=_[_0xe896('0x3b')](_0x48885e,{'model':db[_0xe896('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]){_0x22c628['attributes']['forEach'](function(_0x41e6c4){_0x2a23a2[_0xe896('0x58')]('i.'+_0x41e6c4);});}else{_0x2a23a2[_0xe896('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe896('0x9e'));_0x2a23a2[_0xe896('0x58')]('a.key',_0xe896('0xad'));_0x2a23a2[_0xe896('0x58')]('a.mandatoryDisposition',_0xe896('0xae'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xaf'),_0xe896('0x9f'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb0'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb1'),'Contact.firstName');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb2'),_0xe896('0xb3'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb4'),'Contact.email');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb5'),_0xe896('0xb6'));_0x2a23a2['field'](_0xe896('0xb7'),_0xe896('0xb8'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb9'),_0xe896('0xba'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xbb'),_0xe896('0xbc'));_0x2a23a2[_0xe896('0x58')]('o.internal',_0xe896('0xbd'));_0x2a23a2['field'](_0xe896('0xbe'),_0xe896('0x40'));}if(_0x22c628[_0xe896('0x53')])_0x2a23a2[_0xe896('0x53')](_0x22c628['limit']);if(_0x22c628[_0xe896('0x34')])_0x2a23a2[_0xe896('0x34')](_0x22c628['offset']);return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x2a23a2[_0xe896('0xab')](),_0x48885e);})['then'](function(_0xadc81f){if(_0xadc81f['length']>0x0)_0x1d18f6['where'](_0xe896('0xbf'),_[_0xe896('0x46')](_0xadc81f,'id'));return db['sequelize'][_0xe896('0x4c')](_0x1d18f6[_0xe896('0xab')](),_0x48885e)['then'](function(_0x529df2){var _0x5b4e01=_['groupBy'](_0x529df2,_0xe896('0xc0'));var _0x237cae=[];_0xadc81f[_0xe896('0x43')](function(_0xc0fa84){_0x237cae[_0xe896('0x44')](updateChatInteraction(_0xc0fa84,_0x388375,_0x5b4e01));});return BPromise[_0xe896('0xc1')](_0x237cae);});});})[_0xe896('0x23')](function(_0x2dbfd3){_0x16927a['rows']=_0x2dbfd3;return _0x16927a;})[_0xe896('0x23')](respondWithFilteredResult(_0x489254,_0x22c628))[_0xe896('0x45')](handleError(_0x489254,null));};exports[_0xe896('0xc2')]=function(_0x2a1d41,_0x5a254b){var _0x4f4d26={'raw':![],'where':{'id':_0x2a1d41[_0xe896('0xc3')]['id']}},_0x2f30a9={};_0x2f30a9['model']=_['keys'](db[_0xe896('0x47')][_0xe896('0xc4')]);_0x2f30a9[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x2a1d41[_0xe896('0x4c')]);_0x2f30a9['filters']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],_0x2f30a9[_0xe896('0x4c')]);_0x4f4d26['attributes']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x2a1d41[_0xe896('0x4c')][_0xe896('0x4f')]));_0x4f4d26['attributes']=_0x4f4d26[_0xe896('0x50')][_0xe896('0x51')]?_0x4f4d26[_0xe896('0x50')]:_0x2f30a9['model'];if(_0x2a1d41[_0xe896('0x4c')]['includeAll']){_0x4f4d26[_0xe896('0xc5')]=[{'all':!![]}];}_0x4f4d26=_[_0xe896('0x3b')]({},_0x4f4d26,_0x2a1d41[_0xe896('0xc6')]);return db[_0xe896('0x47')][_0xe896('0x6f')](_0x4f4d26)[_0xe896('0x23')](handleEntityNotFound(_0x5a254b,null))['then'](respondWithResult(_0x5a254b,null))['catch'](handleError(_0x5a254b,null));};exports[_0xe896('0xc7')]=function(_0x54c61f,_0x15af0e){return db[_0xe896('0x47')]['create'](_0x54c61f[_0xe896('0x3c')],{})[_0xe896('0x23')](respondWithResult(_0x15af0e,0xc9))['catch'](handleError(_0x15af0e,null));};exports[_0xe896('0xc8')]=function(_0x4bcd8c,_0x326c67){if(_0x4bcd8c[_0xe896('0x3c')]['id']){delete _0x4bcd8c[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')]['find']({'where':{'id':_0x4bcd8c[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x326c67,null))[_0xe896('0x23')](saveUpdates(_0x4bcd8c[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x326c67,null))[_0xe896('0x45')](handleError(_0x326c67,null));};exports[_0xe896('0xc9')]=function(_0x3c8951,_0x41b162){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x3c8951[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x41b162,null))[_0xe896('0x23')](removeEntity(_0x41b162,null))[_0xe896('0x45')](handleError(_0x41b162,null));};exports[_0xe896('0xca')]=function(_0x16b398,_0x4edeaf){return db[_0xe896('0x47')][_0xe896('0xca')]()['then'](respondWithResult(_0x4edeaf,null))['catch'](handleError(_0x4edeaf,null));};exports[_0xe896('0xcb')]=function(_0xdd4767,_0x3df01d){var _0xf6563d=_0xdd4767[_0xe896('0xc3')]['id'];var _0x21e7a2;var _0x43b9e0;var _0x46a4f0;return db['ChatInteraction'][_0xe896('0xcc')]({'where':{'id':_0xf6563d}})[_0xe896('0x23')](function(_0x2ee264){_0x21e7a2=_0x2ee264;return db[_0xe896('0xcd')]['findOne']({'where':{'id':_0x2ee264[_0xe896('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe896('0xce'),_0xe896('0xcf'),_0xe896('0xd0')],'raw':!![]});})[_0xe896('0x23')](function(_0x3e55b7){if(_0x3e55b7&&_0x3e55b7[_0xe896('0xd1')]&&_0x3e55b7[_0xe896('0xd2')]){_0x43b9e0=_0x3e55b7;var _0x49293e={'interaction':{'id':_0xf6563d},'agent':{'id':_0xdd4767[_0xe896('0xa4')]['id'],'name':_0xdd4767[_0xe896('0xa4')][_0xe896('0x39')],'fullname':_0xdd4767[_0xe896('0xa4')][_0xe896('0x3f')],'email':_0xdd4767[_0xe896('0xa4')][_0xe896('0xd3')]},'contact':_0xdd4767[_0xe896('0x3c')][_0xe896('0x3d')],'account':_0xdd4767['body'][_0xe896('0x3e')]};var _0x13c2fb={'rejectUnauthorized':![],'method':'POST','url':_0xe896('0xd4'),'headers':{'X-APIKEY':_0x3e55b7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xdd4767['user'][_0xe896('0xd3')]],'buttons':null,'topic':_0x43b9e0['vidaooTopic'],'note':_['isNull'](_0x43b9e0[_0xe896('0xcf')])?null:getMustacheRender(_0x43b9e0[_0xe896('0xcf')],_0x49293e),'metadata':null},'redirect':_0xe896('0xd5'),'json':!![]};try{if(!_['isNull'](_0x43b9e0[_0xe896('0xd0')])){var _0x55be9b=getMustacheRender(_0x43b9e0[_0xe896('0xd0')],_0x49293e);var _0x1406c2=JSON['parse'](_0x55be9b);_0x13c2fb[_0xe896('0x3c')][_0xe896('0xd6')]=_0x1406c2;}}catch(_0x53cebb){throw new db[(_0xe896('0x99'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x13c2fb);}else{throw new db['Sequelize'][(_0xe896('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe896('0x23')](function(_0x30c8f4){_0x46a4f0=_0x30c8f4;if(_0x46a4f0['id']){var _0x386f5a={'body':_0x46a4f0[_0xe896('0xd8')],'ChatWebsiteId':_0x43b9e0['id'],'ChatInteractionId':_0x21e7a2['id'],'direction':'out','UserId':_0xdd4767[_0xe896('0xa4')]['id']};return db[_0xe896('0xd9')][_0xe896('0xc7')](_0x386f5a,{});}else{throw new db[(_0xe896('0x99'))]['ValidationError'](_0xe896('0xda'));}})['then'](function(){return _0x21e7a2[_0xe896('0xdb')]({'vidaooSessionId':_0x46a4f0['id']});})[_0xe896('0x23')](respondWithResult(_0x3df01d,null))[_0xe896('0x45')](handleError(_0x3df01d,null));};exports[_0xe896('0xdc')]=function(_0x5a5336,_0x42ab19){if(_0x5a5336['body']['id']){delete _0x5a5336[_0xe896('0x3c')]['id'];}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x5a5336[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xdd')],'as':'Contact'}]})[_0xe896('0x23')](handleEntityNotFound(_0x42ab19,null))['then'](saveUpdates(_0x5a5336[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x42ab19,null))['catch'](handleError(_0x42ab19,null));};exports[_0xe896('0xde')]=function(_0x384116,_0x5949f1,_0x432775){if(_0x384116[_0xe896('0x3c')]['id']){delete _0x384116[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x384116[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](function(_0x5da1fa){if(!_0x5da1fa){logger[_0xe896('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xe896('0xdf'));_0x5949f1[_0xe896('0x2e')](0x194);}else{if(_0x5da1fa['UserId']){throw new db[(_0xe896('0x99'))][(_0xe896('0xd7'))]('Interaction\x20already\x20assigned');}}return _0x5da1fa;})['then'](function(_0x24c6bc){if(_0x24c6bc){return _0x24c6bc[_0xe896('0xc8')]({'closed':_0x384116['body'][_0xe896('0xe0')],'disposition':_0x384116[_0xe896('0x3c')]['disposition']})[_0xe896('0x23')](function(_0x54219c){return _0x54219c;});}})[_0xe896('0x23')](function(_0x577d5a){return respondWithRpcPromise(_0xe896('0xe1'),_0xe896('0xde'),_0x384116['body'],client9004);})[_0xe896('0x23')](respondWithResult(_0x5949f1,null))[_0xe896('0x45')](handleError(_0x5949f1,null));};exports[_0xe896('0xe2')]=function(_0x32f30e,_0x265206,_0x90a856){_0x32f30e[_0xe896('0x3c')][_0xe896('0x39')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe4')];_0x32f30e[_0xe896('0x3c')][_0xe896('0xe5')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe6')];_0x32f30e['body'][_0xe896('0x7c')]=_0x32f30e['file'][_0xe896('0xe7')];return db[_0xe896('0xe8')]['create'](_0x32f30e[_0xe896('0x3c')])[_0xe896('0x23')](respondWithResult(_0x265206,0xc9))[_0xe896('0x45')](handleError(_0x265206,null));};exports['attachmentDownload']=function(_0x28deef,_0x3f32f7,_0x2b1427){return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x28deef[_0xe896('0xc3')]['id']},'raw':!![]})[_0xe896('0x23')](handleEntityNotFound(_0x3f32f7,null))[_0xe896('0x23')](function(_0xdd5dbf){if(_0xdd5dbf){if(_0xdd5dbf['closed']){return _0x3f32f7['status'](0x193)['json']({'status':0x193,'message':_0xe896('0xe9')});}return db['Attachment']['findOne']({'where':{'id':_0x28deef[_0xe896('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3f32f7,null));}})['then'](function(_0x348cd5){if(_0x348cd5){var _0x4a5f7f=_0x348cd5[_0xe896('0xea')]!==null;var _0x222029=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server/files/attachments/');if(_0x4a5f7f){_0x222029=path[_0xe896('0xeb')](_0x222029,_0xe896('0xed'));}var _0x36c394=path[_0xe896('0xeb')](_0x222029,_0x348cd5[_0xe896('0xe5')]);return _0x3f32f7['download'](_0x36c394);}})['catch'](handleError(_0x3f32f7,null));};exports[_0xe896('0xee')]=function(_0x1a5056,_0x57aa1b){var _0x21b078=null;var _0x17edcd=null;var _0x71d912=null;var _0x22a63d=null;if(_0x1a5056[_0xe896('0x3c')]['id']){delete _0x1a5056[_0xe896('0x3c')]['id'];}if(_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')]){_0x22a63d=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0xf0'),util[_0xe896('0xf1')](_0xe896('0xf2'),Date['now']()));_0x1a5056[_0xe896('0x3c')][_0xe896('0xf3')]=_0x22a63d;}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x1a5056[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'include':[{'model':db[_0xe896('0x80')],'as':_0xe896('0x80')}]}]})[_0xe896('0x23')](handleEntityNotFound(_0x57aa1b,null))[_0xe896('0x23')](saveUpdates(_0x1a5056[_0xe896('0x3c')],null))[_0xe896('0x23')](function(_0x5487f0){if(_0x5487f0){_0x21b078=_0x5487f0;return db[_0xe896('0xcd')]['find']({'where':{'id':_0x21b078[_0xe896('0x86')]}});}})[_0xe896('0x23')](function(_0xb528ff){if(_0xb528ff){_0x71d912=_0xb528ff;return db[_0xe896('0xdd')][_0xe896('0x6f')]({'where':{'id':_0x21b078[_0xe896('0x7a')]}});}})[_0xe896('0x23')](function(_0x6e53ae){if(_0x6e53ae){_0x17edcd=_0x6e53ae;if(_0x22a63d){var _0x52337e=null;for(var _0x1d6003=0x1;_0x1d6003<_0x21b078[_0xe896('0xf4')][_0xe896('0x51')];++_0x1d6003){_0x52337e=_0x21b078[_0xe896('0xf4')][_0x1d6003];var _0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912['agentAlias'],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');var _0x27743a=_0x1a5056['body']['customer']||util[_0xe896('0xf1')](_0xe896('0xf5'),_0xe896('0xf7'),_0x52337e['ContactId']);switch(_0x71d912['agentIdentifier']){case _0xe896('0xf8'):_0x882a0e=_0x52337e[_0xe896('0x82')]?util['format'](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');break;case _0xe896('0xfa'):_0x882a0e=_0x52337e[_0xe896('0x82')]?_0x52337e['User'][_0xe896('0xfb')]||_0x52337e[_0xe896('0x80')]['fullname']:_0xe896('0xf6');break;case _0xe896('0xfc'):_0x882a0e=_0x52337e['UserId']?_0x52337e['User']['fullname']:'System';break;default:_0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');}var _0x58fcf9=util[_0xe896('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x52337e[_0xe896('0xfd')])['format'](_0xe896('0xfe')),_0x52337e[_0xe896('0xff')]==='in'?_0x27743a:_0x882a0e,_0x52337e['body']);if(!_0x52337e['secret']){fs[_0xe896('0x100')](_0x22a63d,_0x58fcf9);}}return db[_0xe896('0x101')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe896('0x102'),'raw':!![]}]});}}})[_0xe896('0x23')](function(_0xbee8fa){if(_0xbee8fa&&_0xbee8fa[_0xe896('0x102')]&&_0x1a5056[_0xe896('0x3c')]){var _0x1a50c3={'tls':{'rejectUnauthorized':![]}};if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')]){_0x1a50c3[_0xe896('0x103')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')];}else{_0x1a50c3[_0xe896('0x104')]=_0xbee8fa[_0xe896('0x102')]['host'];_0x1a50c3['port']=_0xbee8fa[_0xe896('0x102')][_0xe896('0x105')];_0x1a50c3[_0xe896('0x106')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x106')];}if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x107')]){_0x1a50c3[_0xe896('0x108')]={'user':_0xbee8fa[_0xe896('0x102')][_0xe896('0xa4')],'pass':_0xbee8fa[_0xe896('0x102')][_0xe896('0x109')]};}return respondWithRpcPromise(_0xe896('0x10a'),_0xe896('0x10b'),{'account':_0x1a50c3,'message':{'from':util[_0xe896('0xf1')](_0xe896('0x10c'),_0xbee8fa['name'],_0xbee8fa['email']||_0xbee8fa['Smtp'][_0xe896('0xa4')]),'to':_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')],'subject':_0xe896('0x10d'),'text':util[_0xe896('0xf1')](_0xe896('0x10e'),_0x1a5056[_0xe896('0x3c')]['mailTranscript']),'attachments':[{'path':_0x22a63d}]}})['then'](function(){return _0x21b078;})[_0xe896('0x45')](function(_0x550c55){console['error'](_0x550c55);});}else{return _0x21b078;}})['then'](respondWithStatusCode(_0x57aa1b,0xc8))[_0xe896('0x45')](handleError(_0x57aa1b,null));};exports[_0xe896('0x10f')]=function(_0x14da55,_0x5656d0,_0x31ca0b){return db[_0xe896('0xd9')][_0xe896('0x6f')]({'where':{'id':_0x14da55[_0xe896('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5656d0,null))['then'](function(_0x518847){if(_0x518847){return _0x518847[_0xe896('0x10f')](_0x14da55[_0xe896('0x3c')]['ids'],_[_0xe896('0x110')](_0x14da55[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{});}})[_0xe896('0x23')](respondWithResult(_0x5656d0,null))['catch'](handleError(_0x5656d0,null));};exports[_0xe896('0x112')]=function(_0xf78ce2,_0x3f8ea0,_0x254420){var _0x1196d4={'raw':![],'where':{}};var _0x1ee26e={};var _0x1bd649={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0xf78ce2[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f8ea0,null))[_0xe896('0x23')](function(_0x2e5c38){if(_0x2e5c38){_0x1ee26e[_0xe896('0x4a')]=_['keys'](db[_0xe896('0xd9')]['rawAttributes']);_0x1ee26e[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0xf78ce2['query']);_0x1ee26e['filters']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],_0x1ee26e[_0xe896('0x4c')]);_0x1196d4['attributes']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0xf78ce2['query'][_0xe896('0x4f')]));_0x1196d4[_0xe896('0x50')]=_0x1196d4[_0xe896('0x50')]['length']?_0x1196d4['attributes']:_0x1ee26e[_0xe896('0x4a')];if(!_0xf78ce2['query'][_0xe896('0x113')](_0xe896('0x52'))){_0x1196d4[_0xe896('0x53')]=qs[_0xe896('0x53')](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x53')]);_0x1196d4[_0xe896('0x34')]=qs['offset'](_0xf78ce2['query'][_0xe896('0x34')]);}_0x1196d4[_0xe896('0x54')]=qs['sort'](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x55')]);_0x1196d4['where']=qs['filters'](_['pick'](_0xf78ce2['query'],_0x1ee26e['filters']));_0x1196d4['where'][_0xe896('0xc0')]=_0x2e5c38['id'];if(_0xf78ce2['query'][_0xe896('0x91')]){_0x1196d4[_0xe896('0x56')]=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],{'$or':_['map'](_0x1196d4[_0xe896('0x50')],function(_0x646354){var _0x3d751c={};_0x3d751c[_0x646354]={'$like':'%'+_0xf78ce2['query'][_0xe896('0x91')]+'%'};return _0x3d751c;})});}if(_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')]){var _0x42bf84=_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')][_0xe896('0x42')](',');var _0x115450={};_0x115450[_0x42bf84[0x0]]={'$gte':moment(_0x42bf84[0x1])[_0xe896('0xf1')](_0xe896('0x114'))};_0x1196d4['where']=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],_0x115450);}_0x1196d4=_[_0xe896('0x3b')]({},_0x1196d4,_0xf78ce2[_0xe896('0xc6')]);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x1196d4[_0xe896('0x56')]})[_0xe896('0x23')](function(_0x3bee56){_0x1bd649[_0xe896('0x33')]=_0x3bee56;if(_0xf78ce2[_0xe896('0x4c')]['includeAll']){_0x1196d4['include']=[{'all':!![]}];}return db[_0xe896('0xd9')]['findAll'](_0x1196d4);})['then'](function(_0x1d3083){_0x1bd649[_0xe896('0x115')]=_0x1d3083;return _0x1bd649;});}})[_0xe896('0x23')](respondWithFilteredResult(_0x3f8ea0,_0x1196d4))['catch'](handleError(_0x3f8ea0,null));};exports[_0xe896('0x116')]=function(_0x4ddfde,_0xc1bdcf,_0xdea91f){var _0x5c2af6={'where':{}},_0x306757={},_0x31f4e1={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x4ddfde['params']['id']}})[_0xe896('0x23')](handleEntityNotFound(_0xc1bdcf,null))['then'](function(_0x186b58){if(_0x186b58){_0x306757[_0xe896('0x4a')]=_[_0xe896('0x4b')](db['ChatMessage']['rawAttributes']);_0x306757[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x4ddfde[_0xe896('0x4c')]);_0x306757[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x306757[_0xe896('0x4a')],_0x306757[_0xe896('0x4c')]);_0x5c2af6[_0xe896('0x50')]=_['intersection'](_0x306757[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x4ddfde['query'][_0xe896('0x4f')]));_0x5c2af6['attributes']=_0x5c2af6['attributes'][_0xe896('0x51')]?_0x5c2af6[_0xe896('0x50')]:_0x306757[_0xe896('0x4a')];if(!_0x4ddfde[_0xe896('0x4c')][_0xe896('0x113')]('nolimit')){_0x5c2af6[_0xe896('0x53')]=qs[_0xe896('0x53')](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x53')]);_0x5c2af6[_0xe896('0x34')]=qs['offset'](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x34')]);}_0x5c2af6[_0xe896('0x54')]=qs[_0xe896('0x55')](_0x4ddfde['query'][_0xe896('0x55')]);_0x5c2af6[_0xe896('0x56')]=qs[_0xe896('0x4d')](_[_0xe896('0x57')](_0x4ddfde['query'],_0x306757[_0xe896('0x4d')]));_0x5c2af6[_0xe896('0x56')][_0xe896('0xc0')]=_0x186b58['id'];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]){_0x5c2af6['where']=_[_0xe896('0x3b')](_0x5c2af6[_0xe896('0x56')],{'$or':_['map'](_0x5c2af6['attributes'],function(_0x42490d){var _0x2dba2f={};_0x2dba2f[_0x42490d]={'$like':'%'+_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]+'%'};return _0x2dba2f;})});}_0x5c2af6['where'][_0xe896('0x117')]=![];if(_0x4ddfde[_0xe896('0x4c')]['id']){_0x5c2af6[_0xe896('0x56')]['id']={'$gt':_0x4ddfde[_0xe896('0x4c')]['id']};}_0x5c2af6=_['merge']({},_0x5c2af6,_0x4ddfde['options']);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x5c2af6[_0xe896('0x56')]})[_0xe896('0x23')](function(_0xabf68b){_0x31f4e1[_0xe896('0x33')]=_0xabf68b;_0x5c2af6['include']=[];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x118')]){_0x5c2af6['include'][_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id','fullname',_0xe896('0xfb')]});}if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x119')]){_0x5c2af6[_0xe896('0xc5')]=[{'all':!![]}];}return db[_0xe896('0xd9')][_0xe896('0x11a')](_0x5c2af6);})['then'](function(_0xbf5fec){_0x31f4e1[_0xe896('0x115')]=_0xbf5fec;return _0x31f4e1;});}})['then'](respondWithFilteredResult(_0xc1bdcf,_0x5c2af6))[_0xe896('0x45')](handleError(_0xc1bdcf,null));};exports[_0xe896('0x11b')]=function(_0x50e9f6,_0x3f7f9b,_0x45fbfd){return db['ChatInteraction']['find']({'where':{'id':_0x50e9f6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f7f9b,null))['then'](function(_0xd7222b){if(_0xd7222b){return _0xd7222b[_0xe896('0x11c')](_0x50e9f6['body'][_0xe896('0x111')],_[_0xe896('0x110')](_0x50e9f6[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{})[_0xe896('0x11d')](function(){return db[_0xe896('0x11e')][_0xe896('0x11a')]({'attributes':['id',_0xe896('0x39'),_0xe896('0x59')],'where':{'id':_0x50e9f6[_0xe896('0x3c')]['ids']}});})[_0xe896('0x23')](function(_0x4b7dda){socket['emit'](_0xe896('0x11f'),{'id':Number(_0x50e9f6[_0xe896('0xc3')]['id']),'tags':_0x4b7dda||[]});return{'id':Number(_0x50e9f6['params']['id']),'tags':_0x4b7dda||[]};});}})['then'](respondWithResult(_0x3f7f9b,null))[_0xe896('0x45')](handleError(_0x3f7f9b,null));};exports[_0xe896('0x120')]=function(_0x40efd6,_0x513fbe,_0x17b841){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x40efd6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x513fbe,null))['then'](function(_0x704996){if(_0x704996){return _0x704996[_0xe896('0x120')](_0x40efd6[_0xe896('0x4c')]['ids']);}})[_0xe896('0x23')](respondWithStatusCode(_0x513fbe,null))[_0xe896('0x45')](handleError(_0x513fbe,null));};exports[_0xe896('0x121')]=function(_0x99a090,_0x15c4f9){var _0x4b1785=moment()['unix']()[_0xe896('0xab')]();var _0x5bc230=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0x122'),_0xe896('0x123'),'tmp');var _0x2d2654=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x123'),_0xe896('0x124'));var _0x5bbc65=path[_0xe896('0xeb')](_0x5bc230,_0x4b1785);var _0x194003=util[_0xe896('0xf1')](_0xe896('0x125'),_0x99a090[_0xe896('0xc3')]['id'],_0x4b1785);var _0x2a3489=path[_0xe896('0xeb')](_0x5bc230,_0x194003);var _0x54df80=[];_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id',_0xe896('0x3f')],'raw':!![]});_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0xdd')],'as':_0xe896('0x74'),'attributes':['id',_0xe896('0x126'),'lastName'],'raw':!![]});if(_0x99a090[_0xe896('0x4c')][_0xe896('0x124')]){_0x54df80[_0xe896('0x44')]({'model':db['Attachment'],'as':_0xe896('0xe8'),'raw':!![]});}var _0x2279c9=[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'attributes':['id','body',_0xe896('0xfd'),_0xe896('0xff'),_0xe896('0x117'),_0xe896('0x8c')],'include':_0x54df80}];_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0xcd')],'as':_0xe896('0x127'),'attributes':['id',_0xe896('0x39')]});_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x128'),'attributes':['id',_0xe896('0x3f')]});return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x99a090[_0xe896('0xc3')]['id']},'include':_0x2279c9})['then'](handleEntityNotFound(_0x15c4f9,null))['then'](function(_0x5cd4ff){if(_0x5cd4ff){var _0x81d8be=_0x5cd4ff[_0xe896('0x129')]({'plain':!![]});fs[_0xe896('0x12a')](_0x5bbc65);var _0x132625={'channel':_0xe896('0x12b'),'account':_0x81d8be[_0xe896('0x127')][_0xe896('0x39')],'agent':_0x81d8be[_0xe896('0x128')]?_0x81d8be[_0xe896('0x128')][_0xe896('0x3f')]:'N.A.','createdAt':moment(_0x81d8be[_0xe896('0xfd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')](),'closedAt':_0x81d8be[_0xe896('0xe0')]?moment(_0x81d8be[_0xe896('0x12c')])[_0xe896('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')]():'','disposition':_0x81d8be[_0xe896('0x12d')],'chatInfo':{'browser':_0x81d8be['browserName'],'os':_0x81d8be[_0xe896('0x12e')],'referer':_0x81d8be[_0xe896('0x12f')],'customerIp':_0x81d8be[_0xe896('0x130')],'customerPort':_0x81d8be[_0xe896('0x131')]?_0x81d8be['customerPort']:_0xe896('0x132')},'messages':_(_0x81d8be['Messages'])[_0xe896('0x133')]()[_0xe896('0x91')]({'secret':![]})[_0xe896('0x46')](function(_0x374e2f){if(_0x374e2f[_0xe896('0xe8')]){var _0x328e2b=path['join'](_0x2d2654,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]);if(fs[_0xe896('0x134')](_0x328e2b)){fs[_0xe896('0x135')](_0x328e2b)['pipe'](fs[_0xe896('0x136')](path[_0xe896('0xeb')](_0x5bbc65,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')])));}}return{'date':moment(_0x374e2f['createdAt'])[_0xe896('0xf1')](_0xe896('0x114'))[_0xe896('0xab')](),'sender':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?_0x374e2f[_0xe896('0x80')]?_0x374e2f[_0xe896('0x80')][_0xe896('0x3f')]:'System':_0x374e2f['Contact'][_0xe896('0x126')]+(_0x374e2f[_0xe896('0x74')][_0xe896('0x138')]?'\x20'+_0x374e2f[_0xe896('0x74')]['lastName']:''),'body':_0x374e2f[_0xe896('0xe8')]?_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]:_0x374e2f[_0xe896('0x3c')],'direction':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?'A':'C','secret':_0x374e2f[_0xe896('0x117')],'read':_0x374e2f['read'],'attachment':_0x374e2f[_0xe896('0xe8')]};})[_0xe896('0x70')]()};return ejs[_0xe896('0x139')](path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x13a'),'downloadInteraction.ejs'),{'interaction':_0x132625})[_0xe896('0x23')](function(_0x50d56b){var _0x5d05a4=path[_0xe896('0xeb')](_0x5bbc65,_0xe896('0x13b')+_0x81d8be['id']+'-'+_0x4b1785+_0xe896('0x13c'));var _0x9223f={'path':_0x5d05a4,'channel':_0xe896('0x12b'),'interactionId':_0x81d8be['id']};return pdf[_0xe896('0x13d')](_0x50d56b,_0x9223f);})[_0xe896('0x23')](function(){return new BPromise(function(_0x399827,_0x2a2fa5){zipdir(_0x5bbc65,{'saveTo':_0x2a3489},function(_0x21d235,_0x3d7f5f){if(_0x21d235)return _0x2a2fa5(_0x21d235);return _0x399827(_0x3d7f5f);});})[_0xe896('0x23')](function(){return new BPromise(function(_0x313eb0,_0x54a741){rimraf(_0x5bbc65,function(_0x3edee9){if(_0x3edee9)_0x54a741(_0x3edee9);return _0x313eb0();});});})[_0xe896('0x23')](function(){return _0x15c4f9['download'](_0x2a3489,_0x194003,function(_0x42163c){if(_0x42163c){console[_0xe896('0x13e')]('err',_0x42163c);}else{fs[_0xe896('0x13f')](_0x2a3489);}});});});}else{return _0x15c4f9[_0xe896('0x2e')](0xc8);}})[_0xe896('0x45')](handleError(_0x15c4f9,null));};
\ No newline at end of file
+var _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x14a0,0x8e));var _0x014a=function(_0x541399,_0x16175c){_0x541399=_0x541399-0x0;var _0x3f98b9=_0x14a0[_0x541399];return _0x3f98b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2e747d7..ee50445 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 _0xff0c=['then','setDataValue','Users','map','findAll','emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove','getUsers'];(function(_0x39735a,_0x17ad25){var _0x39d581=function(_0x5c759b){while(--_0x5c759b){_0x39735a['push'](_0x39735a['shift']());}};_0x39d581(++_0x17ad25);}(_0xff0c,0x6a));var _0xcff0=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0xff0c[_0x476c7];return _0x47ae56;};'use strict';var EventEmitter=require(_0xcff0('0x0'));var ChatInteraction=require(_0xcff0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xcff0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcff0('0x2'),'afterUpdate':_0xcff0('0x3'),'afterDestroy':_0xcff0('0x4')};function emitEvent(_0x3c25db){return function(_0x5379a5,_0x25860f,_0x211e79){_0x5379a5[_0xcff0('0x5')]({'attributes':['id'],'raw':!![]})[_0xcff0('0x6')](function(_0x20be68){_0x5379a5[_0xcff0('0x7')](_0xcff0('0x8'),_0x20be68[_0xcff0('0x9')](function(_0x271f23){return{'id':_0x271f23['id']};}));return ChatMessage[_0xcff0('0xa')]({'where':{'ChatInteractionId':_0x5379a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcff0('0x6')](function(_0x3db1bc){_0x5379a5[_0xcff0('0x7')]('unreadMessages',_0x3db1bc['length']);ChatInteractionEvents['emit'](_0x3c25db+':'+_0x5379a5['id'],_0x5379a5);ChatInteractionEvents[_0xcff0('0xb')](_0x3c25db,_0x5379a5);_0x211e79(null);})['catch'](_0x211e79(null));};}for(var e in events){if(events[_0xcff0('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcff0('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xdef4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','setDataValue','map','unreadMessages'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdef4,0x18a));var _0x4def=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xdef4[_0x14eb9e];return _0x4c59c4;};'use strict';var EventEmitter=require(_0x4def('0x0'));var ChatInteraction=require(_0x4def('0x1'))['db'][_0x4def('0x2')];var ChatMessage=require(_0x4def('0x1'))['db'][_0x4def('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4def('0x4'),'afterUpdate':_0x4def('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c57ea){return function(_0x4a720f,_0x1c8dfd,_0x41feaa){_0x4a720f[_0x4def('0x6')]({'attributes':['id'],'raw':!![]})[_0x4def('0x7')](function(_0x515727){_0x4a720f[_0x4def('0x8')]('Users',_0x515727[_0x4def('0x9')](function(_0x21c129){return{'id':_0x21c129['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4a720f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43a03f){_0x4a720f['setDataValue'](_0x4def('0xa'),_0x43a03f['length']);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea+':'+_0x4a720f['id'],_0x4a720f);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea,_0x4a720f);_0x41feaa(null);})['catch'](_0x41feaa(null));};}for(var e in events){if(events[_0x4def('0xc')](e)){var event=events[e];ChatInteraction[_0x4def('0xd')](e,emitEvent(event));}}module[_0x4def('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index b9c0b34..d387005 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 _0x25e7=['path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25e7,0x11c));var _0x725e=function(_0x2404ab,_0x1008c2){_0x2404ab=_0x2404ab-0x0;var _0x5edff9=_0x25e7[_0x2404ab];return _0x5edff9;};'use strict';var _=require(_0x725e('0x0'));var util=require('util');var logger=require(_0x725e('0x1'))('api');var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var fs=require('fs');var path=require(_0x725e('0x5'));var rimraf=require(_0x725e('0x6'));var config=require('../../config/environment');var attributes=require(_0x725e('0x7'));module[_0x725e('0x8')]=function(_0x2b5b90,_0x1afa7a){return _0x2b5b90['define'](_0x725e('0x9'),attributes,{'tableName':_0x725e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19154f,_0x396930,_0x354d86){if(_0x19154f[_0x725e('0xb')](_0x725e('0xc'))){_0x19154f['closedAt']=moment()[_0x725e('0xd')](_0x725e('0xe'));}_0x354d86(null,_0x19154f);}},'charset':_0x725e('0xf'),'collate':_0x725e('0x10')});};
\ No newline at end of file
+var _0x9e3d=['define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x5edd2f,_0x245dcd){var _0x37b39e=function(_0x42c1e7){while(--_0x42c1e7){_0x5edd2f['push'](_0x5edd2f['shift']());}};_0x37b39e(++_0x245dcd);}(_0x9e3d,0x1e9));var _0xd9e3=function(_0x55850c,_0x229051){_0x55850c=_0x55850c-0x0;var _0x32d952=_0x9e3d[_0x55850c];return _0x32d952;};'use strict';var _=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var logger=require('../../config/logger')(_0xd9e3('0x2'));var moment=require(_0xd9e3('0x3'));var BPromise=require(_0xd9e3('0x4'));var rp=require(_0xd9e3('0x5'));var fs=require('fs');var path=require(_0xd9e3('0x6'));var rimraf=require(_0xd9e3('0x7'));var config=require(_0xd9e3('0x8'));var attributes=require(_0xd9e3('0x9'));module[_0xd9e3('0xa')]=function(_0x41cc79,_0x2d2fb9){return _0x41cc79[_0xd9e3('0xb')](_0xd9e3('0xc'),attributes,{'tableName':_0xd9e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c8308,_0x50da69,_0x1ce0d0){if(_0x2c8308[_0xd9e3('0xe')]('closed')){_0x2c8308[_0xd9e3('0xf')]=moment()[_0xd9e3('0x10')](_0xd9e3('0x11'));}_0x1ce0d0(null,_0x2c8308);}},'charset':_0xd9e3('0x12'),'collate':_0xd9e3('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 688bcb0..334716a 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 _0xdc65=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateChatInteraction','body','options','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','spread','AddTags','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x4588bd,_0x57222b){var _0x1becaa=function(_0x2ec59d){while(--_0x2ec59d){_0x4588bd['push'](_0x4588bd['shift']());}};_0x1becaa(++_0x57222b);}(_0xdc65,0xf5));var _0x5dc6=function(_0x22e4ea,_0x1eaab1){_0x22e4ea=_0x22e4ea-0x0;var _0x2237dc=_0xdc65[_0x22e4ea];return _0x2237dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5dc6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc6('0x1'));var db=require(_0x5dc6('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5dc6('0x3'))('rpc');var config=require(_0x5dc6('0x4'));var jayson=require(_0x5dc6('0x5'));var client=jayson[_0x5dc6('0x6')][_0x5dc6('0x7')]({'port':0x232a});config['redis']=_[_0x5dc6('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc6('0x9'))(new Redis(config['redis']));require(_0x5dc6('0xa'))[_0x5dc6('0xb')](socket);function respondWithRpcPromise(_0x2e3517,_0x520752,_0x13910a){return new BPromise(function(_0x2b05a9,_0x418328){return client[_0x5dc6('0xc')](_0x2e3517,_0x13910a)[_0x5dc6('0xd')](function(_0x1c772a){logger['info'](_0x5dc6('0xe'),_0x520752,_0x5dc6('0xf'));logger[_0x5dc6('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x520752,_0x5dc6('0xf'),JSON[_0x5dc6('0x11')](_0x1c772a));if(_0x1c772a[_0x5dc6('0x12')]){if(_0x1c772a[_0x5dc6('0x12')][_0x5dc6('0x13')]===0x1f4){logger[_0x5dc6('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x520752,_0x1c772a[_0x5dc6('0x12')]['message']);return _0x418328(_0x1c772a['error']['message']);}logger[_0x5dc6('0x12')](_0x5dc6('0xe'),_0x520752,_0x1c772a[_0x5dc6('0x12')][_0x5dc6('0x14')]);return _0x2b05a9(_0x1c772a[_0x5dc6('0x12')]['message']);}else{logger[_0x5dc6('0x15')](_0x5dc6('0xe'),_0x520752,_0x5dc6('0xf'));_0x2b05a9(_0x1c772a[_0x5dc6('0x16')][_0x5dc6('0x14')]);}})[_0x5dc6('0x17')](function(_0x5cf96b){logger[_0x5dc6('0x12')](_0x5dc6('0xe'),_0x520752,_0x5cf96b);_0x418328(_0x5cf96b);});});}exports[_0x5dc6('0x18')]=function(_0x5776aa){var _0x5bfeae=this;return new Promise(function(_0x5257dd,_0x90f071){return db['ChatInteraction']['update'](_0x5776aa[_0x5dc6('0x19')],{'raw':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')][_0x5dc6('0x1b')]||null:null,'attributes':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')][_0x5dc6('0x1c')]||null:null,'limit':_0x5776aa['options']?_0x5776aa[_0x5dc6('0x1a')]['limit']||null:null})['then'](function(_0x5791ea){logger[_0x5dc6('0x15')]('UpdateChatInteraction',_0x5776aa);logger['debug'](_0x5dc6('0x18'),_0x5776aa,JSON[_0x5dc6('0x11')](_0x5791ea));_0x5257dd(_0x5791ea);})[_0x5dc6('0x17')](function(_0x1aea45){logger[_0x5dc6('0x12')](_0x5dc6('0x18'),_0x1aea45['message'],_0x5776aa);_0x90f071(_0x5bfeae[_0x5dc6('0x12')](0x1f4,_0x1aea45[_0x5dc6('0x14')]));});});};exports[_0x5dc6('0x1d')]=function(_0x1389a0){return new Promise(function(_0x43efb0,_0x56c8b4){return db[_0x5dc6('0x1e')][_0x5dc6('0x1f')]({'where':_0x1389a0[_0x5dc6('0x1a')]?_0x1389a0[_0x5dc6('0x1a')][_0x5dc6('0x1b')]||null:null})[_0x5dc6('0xd')](function(_0x1d0e76){if(_0x1d0e76){return _0x1d0e76[_0x5dc6('0x20')](_0x1389a0['body']['ids'],_[_0x5dc6('0x21')](_0x1389a0['body'],[_0x5dc6('0x22'),'id'])||{});}})[_0x5dc6('0x23')](function(_0x2e8b58){logger[_0x5dc6('0x15')](_0x5dc6('0x24'),_0x1389a0);logger[_0x5dc6('0x10')](_0x5dc6('0x24'),_0x1389a0,JSON['stringify'](_0x2e8b58));_0x43efb0(_0x2e8b58);})[_0x5dc6('0x17')](function(_0x4fbae7){logger[_0x5dc6('0x12')](_0x5dc6('0x24'),_0x4fbae7[_0x5dc6('0x14')],_0x1389a0);_0x56c8b4(_this[_0x5dc6('0x12')](0x1f4,_0x4fbae7[_0x5dc6('0x14')]));});});};
\ No newline at end of file
+var _0xecf5=['where','attributes','limit','UpdateChatInteraction','stringify','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options','raw'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xecf5,0x17b));var _0x5ecf=function(_0x372fa3,_0x1c49aa){_0x372fa3=_0x372fa3-0x0;var _0x49e830=_0xecf5[_0x372fa3];return _0x49e830;};'use strict';var _=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var moment=require(_0x5ecf('0x2'));var BPromise=require(_0x5ecf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecf('0x4'));var db=require(_0x5ecf('0x5'))['db'];var utils=require(_0x5ecf('0x6'));var logger=require(_0x5ecf('0x7'))(_0x5ecf('0x8'));var config=require(_0x5ecf('0x9'));var jayson=require(_0x5ecf('0xa'));var client=jayson['client'][_0x5ecf('0xb')]({'port':0x232a});config['redis']=_[_0x5ecf('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5ecf('0xd'))(new Redis(config[_0x5ecf('0xe')]));require('./chatInteraction.socket')[_0x5ecf('0xf')](socket);function respondWithRpcPromise(_0x251a04,_0x3ddfb6,_0x5e0f19){return new BPromise(function(_0x1fa6a5,_0x2cc906){return client[_0x5ecf('0x10')](_0x251a04,_0x5e0f19)[_0x5ecf('0x11')](function(_0x433a14){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x5ecf('0x12'));logger[_0x5ecf('0x13')](_0x5ecf('0x14'),_0x3ddfb6,_0x5ecf('0x12'),JSON['stringify'](_0x433a14));if(_0x433a14[_0x5ecf('0x15')]){if(_0x433a14[_0x5ecf('0x15')]['code']===0x1f4){logger['error'](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x2cc906(_0x433a14[_0x5ecf('0x15')]['message']);}logger[_0x5ecf('0x15')](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x1fa6a5(_0x433a14[_0x5ecf('0x15')]['message']);}else{logger['info'](_0x5ecf('0x16'),_0x3ddfb6,_0x5ecf('0x12'));_0x1fa6a5(_0x433a14[_0x5ecf('0x18')][_0x5ecf('0x17')]);}})[_0x5ecf('0x19')](function(_0x28c824){logger[_0x5ecf('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x28c824);_0x2cc906(_0x28c824);});});}exports['UpdateChatInteraction']=function(_0x48fca8){var _0x155534=this;return new Promise(function(_0x465c5e,_0x17bd18){return db[_0x5ecf('0x1a')][_0x5ecf('0x1b')](_0x48fca8[_0x5ecf('0x1c')],{'raw':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null,'attributes':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x20')]||null:null,'limit':_0x48fca8['options']?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x21')]||null:null})[_0x5ecf('0x11')](function(_0x3613de){logger['info'](_0x5ecf('0x22'),_0x48fca8);logger[_0x5ecf('0x13')]('UpdateChatInteraction',_0x48fca8,JSON[_0x5ecf('0x23')](_0x3613de));_0x465c5e(_0x3613de);})[_0x5ecf('0x19')](function(_0x593b84){logger[_0x5ecf('0x15')]('UpdateChatInteraction',_0x593b84[_0x5ecf('0x17')],_0x48fca8);_0x17bd18(_0x155534['error'](0x1f4,_0x593b84['message']));});});};exports['AddTagsToChatInteraction']=function(_0x172714){return new Promise(function(_0x4773fb,_0x4d1ac3){return db[_0x5ecf('0x1a')][_0x5ecf('0x24')]({'where':_0x172714[_0x5ecf('0x1d')]?_0x172714[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null})['then'](function(_0x56dfbe){if(_0x56dfbe){return _0x56dfbe['addTags'](_0x172714[_0x5ecf('0x1c')][_0x5ecf('0x25')],_[_0x5ecf('0x26')](_0x172714[_0x5ecf('0x1c')],[_0x5ecf('0x25'),'id'])||{});}})[_0x5ecf('0x27')](function(_0x1b52cc){logger['info'](_0x5ecf('0x28'),_0x172714);logger[_0x5ecf('0x13')](_0x5ecf('0x28'),_0x172714,JSON['stringify'](_0x1b52cc));_0x4773fb(_0x1b52cc);})['catch'](function(_0x5d0650){logger['error']('AddTags',_0x5d0650[_0x5ecf('0x17')],_0x172714);_0x4d1ac3(_this[_0x5ecf('0x15')](0x1f4,_0x5d0650[_0x5ecf('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 7c45d13..056300f 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 _0xefe7=['./chatInteraction.events','remove','update','emit','length','chatInteraction:'];(function(_0x53969e,_0xf883b8){var _0x3dfc7a=function(_0xb41ef){while(--_0xb41ef){_0x53969e['push'](_0x53969e['shift']());}};_0x3dfc7a(++_0xf883b8);}(_0xefe7,0x168));var _0x7efe=function(_0x261d58,_0x1745c3){_0x261d58=_0x261d58-0x0;var _0x2ce66c=_0xefe7[_0x261d58];return _0x2ce66c;};'use strict';var ChatInteractionEvents=require(_0x7efe('0x0'));var events=['save',_0x7efe('0x1'),_0x7efe('0x2')];function createListener(_0x4986dc,_0x5901c0){return function(_0xb80e9c){_0x5901c0[_0x7efe('0x3')](_0x4986dc,_0xb80e9c);};}function removeListener(_0x5044d0,_0x1e380e){return function(){ChatInteractionEvents['removeListener'](_0x5044d0,_0x1e380e);};}exports['register']=function(_0x4183a6){for(var _0x43ac91=0x0,_0x6c7f38=events[_0x7efe('0x4')];_0x43ac91<_0x6c7f38;_0x43ac91++){var _0x56093c=events[_0x43ac91];var _0x3f24f3=createListener(_0x7efe('0x5')+_0x56093c,_0x4183a6);ChatInteractionEvents['on'](_0x56093c,_0x3f24f3);}};
\ No newline at end of file
+var _0xa553=['./chatInteraction.events','save','remove','update','removeListener','register','length','chatInteraction:'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xa553,0x158));var _0x3a55=function(_0x342c40,_0x8174ef){_0x342c40=_0x342c40-0x0;var _0x4cb218=_0xa553[_0x342c40];return _0x4cb218;};'use strict';var ChatInteractionEvents=require(_0x3a55('0x0'));var events=[_0x3a55('0x1'),_0x3a55('0x2'),_0x3a55('0x3')];function createListener(_0x7d0b52,_0x41dd31){return function(_0x1636ba){_0x41dd31['emit'](_0x7d0b52,_0x1636ba);};}function removeListener(_0x287402,_0xfc35ae){return function(){ChatInteractionEvents[_0x3a55('0x4')](_0x287402,_0xfc35ae);};}exports[_0x3a55('0x5')]=function(_0x285fb3){for(var _0x488937=0x0,_0x4fd97a=events[_0x3a55('0x6')];_0x488937<_0x4fd97a;_0x488937++){var _0x17a451=events[_0x488937];var _0x218ccb=createListener(_0x3a55('0x7')+_0x17a451,_0x285fb3);ChatInteractionEvents['on'](_0x17a451,_0x218ccb);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c4cb72a..8165339 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 _0x0f87=['originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','format','now'];(function(_0x1f9ddb,_0xe6b723){var _0x38db97=function(_0x4b6edd){while(--_0x4b6edd){_0x1f9ddb['push'](_0x1f9ddb['shift']());}};_0x38db97(++_0xe6b723);}(_0x0f87,0xf3));var _0x70f8=function(_0x44b400,_0x3b299d){_0x44b400=_0x44b400-0x0;var _0x38e966=_0x0f87[_0x44b400];return _0x38e966;};'use strict';var multer=require(_0x70f8('0x0'));var util=require(_0x70f8('0x1'));var path=require(_0x70f8('0x2'));var timeout=require(_0x70f8('0x3'));var express=require(_0x70f8('0x4'));var router=express[_0x70f8('0x5')]();var fs_extra=require(_0x70f8('0x6'));var auth=require(_0x70f8('0x7'));var interaction=require(_0x70f8('0x8'));var config=require(_0x70f8('0x9'));var controller=require(_0x70f8('0xa'));router[_0x70f8('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x70f8('0xb')](_0x70f8('0xc'),auth[_0x70f8('0xd')](),controller['describe']);router[_0x70f8('0xb')](_0x70f8('0xe'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x10')]);router[_0x70f8('0xb')](_0x70f8('0x11'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x12')]);router['get'](_0x70f8('0x13'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x14')]);router[_0x70f8('0xb')](_0x70f8('0x15'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x16')]);router[_0x70f8('0xb')](_0x70f8('0x17'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x18')]);router[_0x70f8('0x19')]('/',auth[_0x70f8('0xd')](),controller[_0x70f8('0x1a')]);router[_0x70f8('0x19')]('/:id/vidaoo',auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x267734,_0x45f72f,_0x6643dc){_0x6643dc(null,path[_0x70f8('0x1b')](config[_0x70f8('0x1c')],_0x70f8('0x1d')));},'filename':function(_0x5322dd,_0x44e636,_0x1e12e3){_0x1e12e3(null,util[_0x70f8('0x1e')]('%s-%s',Date[_0x70f8('0x1f')](),_0x44e636[_0x70f8('0x20')][_0x70f8('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x70f8('0x19')](_0x70f8('0x22'),upload[_0x70f8('0x23')](_0x70f8('0x24')),controller['attachmentUpload']);router['post'](_0x70f8('0x13'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x25')]);router['post'](_0x70f8('0x26'),auth[_0x70f8('0xd')](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x29')),controller[_0x70f8('0x2a')]);router[_0x70f8('0x2b')](_0x70f8('0xe'),auth[_0x70f8('0xd')](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x2c')),controller[_0x70f8('0x2d')]);router[_0x70f8('0x2b')]('/:id/custom_update',controller[_0x70f8('0x2e')]);router[_0x70f8('0x2b')](_0x70f8('0x2f'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x30')]);router[_0x70f8('0x2b')](_0x70f8('0x31'),controller[_0x70f8('0x32')]);router[_0x70f8('0x33')](_0x70f8('0xe'),auth['isAuthenticated'](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x34')),controller[_0x70f8('0x35')]);router['delete'](_0x70f8('0x26'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x36')]);module['exports']=router;
\ No newline at end of file
+var _0x54b6=['addTags','put','/:id/custom_update','customUpdate','abandon','chatinteraction:destroy','delete','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x3abd49,_0x5ec0ec){var _0x5f5677=function(_0x29478a){while(--_0x29478a){_0x3abd49['push'](_0x3abd49['shift']());}};_0x5f5677(++_0x5ec0ec);}(_0x54b6,0x144));var _0x654b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x54b6[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x654b('0x0'));var timeout=require(_0x654b('0x1'));var express=require(_0x654b('0x2'));var router=express[_0x654b('0x3')]();var fs_extra=require(_0x654b('0x4'));var auth=require(_0x654b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x654b('0x6'));var controller=require(_0x654b('0x7'));router[_0x654b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x654b('0x9')](),controller['describe']);router[_0x654b('0x8')](_0x654b('0xa'),auth[_0x654b('0xb')](),controller[_0x654b('0xc')]);router[_0x654b('0x8')](_0x654b('0xd'),auth[_0x654b('0xb')](),controller[_0x654b('0xe')]);router[_0x654b('0x8')](_0x654b('0xf'),auth[_0x654b('0x9')](),controller['getMessages']);router['get'](_0x654b('0x10'),auth[_0x654b('0xb')](),controller[_0x654b('0x11')]);router['get'](_0x654b('0x12'),auth[_0x654b('0x9')](),controller[_0x654b('0x13')]);router[_0x654b('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x654b('0x14')]('/:id/vidaoo',auth[_0x654b('0x9')](),controller[_0x654b('0x15')]);var upload=multer({'storage':multer[_0x654b('0x16')]({'destination':function(_0x54b4d6,_0x1b0467,_0x26e860){_0x26e860(null,path['join'](config[_0x654b('0x17')],_0x654b('0x18')));},'filename':function(_0x1949eb,_0x232432,_0xc1cdf3){_0xc1cdf3(null,util['format'](_0x654b('0x19'),Date[_0x654b('0x1a')](),_0x232432['originalname'][_0x654b('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x654b('0x14')](_0x654b('0x1c'),upload[_0x654b('0x1d')](_0x654b('0x1e')),controller[_0x654b('0x1f')]);router[_0x654b('0x14')](_0x654b('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x654b('0x20')]);router['post'](_0x654b('0x21'),auth[_0x654b('0x9')](),interaction[_0x654b('0x22')](_0x654b('0x23'),'chatinteraction:addtags'),controller[_0x654b('0x24')]);router[_0x654b('0x25')](_0x654b('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:update'),controller['update']);router[_0x654b('0x25')](_0x654b('0x26'),controller[_0x654b('0x27')]);router[_0x654b('0x25')]('/:id/abandon',auth[_0x654b('0xb')](),controller[_0x654b('0x28')]);router[_0x654b('0x25')]('/:id/close',controller['close']);router['delete'](_0x654b('0xa'),auth[_0x654b('0x9')](),interaction['tracked']('chat',_0x654b('0x29')),controller['destroy']);router[_0x654b('0x2a')](_0x654b('0x21'),auth[_0x654b('0x9')](),controller[_0x654b('0x2b')]);module[_0x654b('0x2c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index a4d97bd..88231dc 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 _0x06a8=['BOOLEAN','INTEGER','sequelize','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06a8,0x1e2));var _0x806a=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x06a8[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x806a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x806a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x806a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x806a('0x3')]}};
\ No newline at end of file
+var _0x4c38=['sequelize','medium','BOOLEAN'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4c38,0x14a));var _0x84c3=function(_0x21a7aa,_0x2248dc){_0x21a7aa=_0x21a7aa-0x0;var _0x20c622=_0x4c38[_0x21a7aa];return _0x20c622;};'use strict';var Sequelize=require(_0x84c3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x84c3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x84c3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a3f68e9..8e554e5 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 _0x784d=['showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','length','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','catch','update','find','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','internal','online','lastLoginAt'];(function(_0x3ed195,_0x793f6d){var _0x10e647=function(_0x326c02){while(--_0x326c02){_0x3ed195['push'](_0x3ed195['shift']());}};_0x10e647(++_0x793f6d);}(_0x784d,0x14e));var _0xd784=function(_0x4187b7,_0x11a446){_0x4187b7=_0x4187b7-0x0;var _0x3a4625=_0x784d[_0x4187b7];return _0x3a4625;};'use strict';var emlformat=require(_0xd784('0x0'));var rimraf=require(_0xd784('0x1'));var zipdir=require(_0xd784('0x2'));var jsonpatch=require(_0xd784('0x3'));var rp=require(_0xd784('0x4'));var moment=require('moment');var BPromise=require(_0xd784('0x5'));var Mustache=require(_0xd784('0x6'));var util=require('util');var path=require(_0xd784('0x7'));var sox=require(_0xd784('0x8'));var csv=require('to-csv');var ejs=require(_0xd784('0x9'));var fs=require('fs');var fs_extra=require(_0xd784('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd784('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd784('0xc'));var querystring=require(_0xd784('0xd'));var Papa=require(_0xd784('0xe'));var Redis=require(_0xd784('0xf'));var authService=require(_0xd784('0x10'));var qs=require(_0xd784('0x11'));var as=require(_0xd784('0x12'));var hardwareService=require(_0xd784('0x13'));var logger=require(_0xd784('0x14'))(_0xd784('0x15'));var utils=require(_0xd784('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd784('0x17'));var db=require(_0xd784('0x18'))['db'];config[_0xd784('0x19')]=_[_0xd784('0x1a')](config[_0xd784('0x19')],{'host':_0xd784('0x1b'),'port':0x18eb});var socket=require(_0xd784('0x1c'))(new Redis(config[_0xd784('0x19')]));require(_0xd784('0x1d'))[_0xd784('0x1e')](socket);function respondWithStatusCode(_0xdb4365,_0x37459b){_0x37459b=_0x37459b||0xcc;return function(_0x5b2113){if(_0x5b2113){return _0xdb4365['sendStatus'](_0x37459b);}return _0xdb4365[_0xd784('0x1f')](_0x37459b)['end']();};}function respondWithResult(_0x3ad3b8,_0x1e1477){_0x1e1477=_0x1e1477||0xc8;return function(_0x343024){if(_0x343024){return _0x3ad3b8['status'](_0x1e1477)[_0xd784('0x20')](_0x343024);}};}function respondWithFilteredResult(_0x4d21c5,_0x4f3f50){return function(_0x27a8a7){if(_0x27a8a7){var _0x5a97ef=typeof _0x4f3f50[_0xd784('0x21')]===_0xd784('0x22')&&typeof _0x4f3f50[_0xd784('0x23')]===_0xd784('0x22');var _0x4d1549=_0x27a8a7[_0xd784('0x24')];var _0x1bef86=_0x5a97ef?0x0:_0x4f3f50[_0xd784('0x21')];var _0x4324a2=_0x5a97ef?_0x27a8a7[_0xd784('0x24')]:_0x4f3f50[_0xd784('0x21')]+_0x4f3f50[_0xd784('0x23')];var _0x3b7478;if(_0x4324a2>=_0x4d1549){_0x4324a2=_0x4d1549;_0x3b7478=0xc8;}else{_0x3b7478=0xce;}_0x4d21c5[_0xd784('0x1f')](_0x3b7478);return _0x4d21c5[_0xd784('0x25')](_0xd784('0x26'),_0x1bef86+'-'+_0x4324a2+'/'+_0x4d1549)[_0xd784('0x20')](_0x27a8a7);}return null;};}function patchUpdates(_0x17bbc5){return function(_0x1c8253){try{jsonpatch['apply'](_0x1c8253,_0x17bbc5,!![]);}catch(_0x5ef368){return BPromise[_0xd784('0x27')](_0x5ef368);}return _0x1c8253[_0xd784('0x28')]();};}function saveUpdates(_0x334371,_0x359b52){return function(_0x1fcaa6){if(_0x1fcaa6){return _0x1fcaa6['update'](_0x334371)[_0xd784('0x29')](function(_0xd97df6){return _0xd97df6;});}return null;};}function removeEntity(_0x5af39d,_0x2d2fcc){return function(_0x35afaf){if(_0x35afaf){return _0x35afaf['destroy']()[_0xd784('0x29')](function(){_0x5af39d[_0xd784('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc1eb,_0x527f1e){return function(_0x81d873){if(!_0x81d873){_0x1dc1eb['sendStatus'](0x194);}return _0x81d873;};}function handleError(_0x4abdc2,_0x3fcda1){_0x3fcda1=_0x3fcda1||0x1f4;return function(_0x3b2e7a){logger[_0xd784('0x2a')](_0x3b2e7a[_0xd784('0x2b')]);if(_0x3b2e7a[_0xd784('0x2c')]){delete _0x3b2e7a[_0xd784('0x2c')];}_0x4abdc2[_0xd784('0x1f')](_0x3fcda1)[_0xd784('0x2d')](_0x3b2e7a);};}exports[_0xd784('0x2e')]=function(_0xdc44ca,_0x12526b){var _0xaeaff6={},_0x190938={},_0x1f71e9={'count':0x0,'rows':[]};var _0xbf2846=_[_0xd784('0x2f')](db[_0xd784('0x30')][_0xd784('0x31')],function(_0x125a79){return{'name':_0x125a79['fieldName'],'type':_0x125a79[_0xd784('0x32')][_0xd784('0x33')]};});_0x190938[_0xd784('0x34')]=_[_0xd784('0x2f')](_0xbf2846,_0xd784('0x2c'));_0x190938['query']=_[_0xd784('0x35')](_0xdc44ca[_0xd784('0x36')]);_0x190938['filters']=_[_0xd784('0x37')](_0x190938[_0xd784('0x34')],_0x190938[_0xd784('0x36')]);_0xaeaff6[_0xd784('0x38')]=_[_0xd784('0x37')](_0x190938['model'],qs['fields'](_0xdc44ca[_0xd784('0x36')][_0xd784('0x39')]));_0xaeaff6[_0xd784('0x38')]=_0xaeaff6[_0xd784('0x38')]['length']?_0xaeaff6['attributes']:_0x190938[_0xd784('0x34')];if(!_0xdc44ca[_0xd784('0x36')][_0xd784('0x3a')]('nolimit')){_0xaeaff6['limit']=qs[_0xd784('0x23')](_0xdc44ca[_0xd784('0x36')]['limit']);_0xaeaff6['offset']=qs[_0xd784('0x21')](_0xdc44ca[_0xd784('0x36')][_0xd784('0x21')]);}_0xaeaff6['order']=qs[_0xd784('0x3b')](_0xdc44ca[_0xd784('0x36')][_0xd784('0x3b')]);_0xaeaff6[_0xd784('0x3c')]=qs[_0xd784('0x3d')](_[_0xd784('0x3e')](_0xdc44ca['query'],_0x190938['filters']),_0xbf2846);if(_0xdc44ca[_0xd784('0x36')][_0xd784('0x3f')]){_0xaeaff6[_0xd784('0x3c')]=_[_0xd784('0x40')](_0xaeaff6[_0xd784('0x3c')],{'$or':_[_0xd784('0x2f')](_0xbf2846,function(_0xf7220e){if(_0xf7220e[_0xd784('0x32')]!==_0xd784('0x41')){var _0x15c199={};_0x15c199[_0xf7220e[_0xd784('0x2c')]]={'$like':'%'+_0xdc44ca[_0xd784('0x36')][_0xd784('0x3f')]+'%'};return _0x15c199;}})});}_0xaeaff6=_[_0xd784('0x40')]({},_0xaeaff6,_0xdc44ca[_0xd784('0x42')]);var _0x3b4b4d={'where':_0xaeaff6[_0xd784('0x3c')]};return db[_0xd784('0x30')][_0xd784('0x24')](_0x3b4b4d)[_0xd784('0x29')](function(_0x406a85){_0x1f71e9[_0xd784('0x24')]=_0x406a85;if(_0xdc44ca['query']['includeAll']){_0xaeaff6[_0xd784('0x43')]=[{'all':!![]}];}return db[_0xd784('0x30')][_0xd784('0x44')](_0xaeaff6);})['then'](function(_0x46a41a){_0x1f71e9[_0xd784('0x45')]=_0x46a41a;return _0x1f71e9;})[_0xd784('0x29')](respondWithFilteredResult(_0x12526b,_0xaeaff6))['catch'](handleError(_0x12526b,null));};exports[_0xd784('0x46')]=function(_0xf1e754,_0x5da78d){var _0x118350={'raw':!![],'where':{'id':_0xf1e754[_0xd784('0x47')]['id']}},_0x3d8989={};_0x3d8989[_0xd784('0x34')]=_[_0xd784('0x35')](db[_0xd784('0x30')]['rawAttributes']);_0x3d8989[_0xd784('0x36')]=_[_0xd784('0x35')](_0xf1e754[_0xd784('0x36')]);_0x3d8989['filters']=_[_0xd784('0x37')](_0x3d8989[_0xd784('0x34')],_0x3d8989[_0xd784('0x36')]);_0x118350[_0xd784('0x38')]=_[_0xd784('0x37')](_0x3d8989[_0xd784('0x34')],qs[_0xd784('0x39')](_0xf1e754[_0xd784('0x36')][_0xd784('0x39')]));_0x118350['attributes']=_0x118350[_0xd784('0x38')]['length']?_0x118350[_0xd784('0x38')]:_0x3d8989[_0xd784('0x34')];if(_0xf1e754[_0xd784('0x36')][_0xd784('0x48')]){_0x118350[_0xd784('0x43')]=[{'all':!![]}];}_0x118350=_[_0xd784('0x40')]({},_0x118350,_0xf1e754[_0xd784('0x42')]);return db[_0xd784('0x30')]['find'](_0x118350)[_0xd784('0x29')](handleEntityNotFound(_0x5da78d,null))[_0xd784('0x29')](respondWithResult(_0x5da78d,null))['catch'](handleError(_0x5da78d,null));};exports[_0xd784('0x49')]=function(_0x43441e,_0x3b9539){return db[_0xd784('0x30')][_0xd784('0x49')](_0x43441e[_0xd784('0x4a')],{})[_0xd784('0x29')](respondWithResult(_0x3b9539,0xc9))[_0xd784('0x4b')](handleError(_0x3b9539,null));};exports[_0xd784('0x4c')]=function(_0x48b536,_0x1ca909){if(_0x48b536['body']['id']){delete _0x48b536[_0xd784('0x4a')]['id'];}return db[_0xd784('0x30')]['find']({'where':{'id':_0x48b536[_0xd784('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ca909,null))[_0xd784('0x29')](saveUpdates(_0x48b536['body'],null))[_0xd784('0x29')](respondWithResult(_0x1ca909,null))[_0xd784('0x4b')](handleError(_0x1ca909,null));};exports['destroy']=function(_0x4a46a0,_0x565341){return db[_0xd784('0x30')][_0xd784('0x4d')]({'where':{'id':_0x4a46a0[_0xd784('0x47')]['id']}})[_0xd784('0x29')](handleEntityNotFound(_0x565341,null))['then'](removeEntity(_0x565341,null))['catch'](handleError(_0x565341,null));};exports[_0xd784('0x4e')]=function(_0x1aaa5e,_0x215c2b){return db['ChatInternalMessage'][_0xd784('0x4e')]()['then'](respondWithResult(_0x215c2b,null))[_0xd784('0x4b')](handleError(_0x215c2b,null));};function wrapUser(_0x5f3174){return function(_0x40b962){var _0x48f640=_0x5f3174[_0xd784('0x4f')]({'plain':!![]});_0x48f640[_0xd784('0x50')]=[];if(_0x40b962){_0x48f640[_0xd784('0x51')]=_0x40b962[_0xd784('0x52')];_0x48f640['lastMessage']=_0x40b962;}else{_0x48f640['lastMessageAt']=moment(0x0)['format'](_0xd784('0x53'));_0x48f640[_0xd784('0x54')]={};}return _0x48f640;};}exports[_0xd784('0x55')]=function(_0xa2c767,_0x52d146,_0x5e17eb){var _0x3d632e=[];return db['User'][_0xd784('0x44')]({'where':{'role':[_0xd784('0x56'),_0xd784('0x57'),_0xd784('0x58')]},'attributes':['id',_0xd784('0x59'),'name',_0xd784('0x5a'),'userpic',_0xd784('0x5b'),_0xd784('0x5c'),_0xd784('0x5d'),'allowmessenger',_0xd784('0x5e')],'order':qs[_0xd784('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xd784('0x2c'),_0xd784('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x28d010){if(_0x28d010){var _0x192d9e=_0xa2c767['user'][_0xd784('0x4f')]({'plain':!![]});if(!_0x192d9e)throw new Error(_0xd784('0x5f'));if(_0x192d9e[_0xd784('0x5a')]===_0xd784('0x58')){return db[_0xd784('0x60')]['find']({'where':{'name':_0xd784('0x61'),'userProfileId':_0x192d9e['userProfileId']},'raw':!![]})[_0xd784('0x29')](function(_0xf49dba){if(_0xf49dba){if(_0xf49dba[_0xd784('0x62')]===0x0){return db['UserProfileResource'][_0xd784('0x44')]({'where':{'sectionId':_0xf49dba['id']},'raw':!![]})[_0xd784('0x29')](function(_0x39e13e){var _0x198581=[];if(_[_0xd784('0x63')](_0x39e13e)){_0x198581=_[_0xd784('0x3f')](_0x28d010,function(_0x1fa2c2){if(_0x1fa2c2['role']!=='agent'){return _0x1fa2c2;}});return _0x198581;}else{for(var _0x5586b0=0x0;_0x5586b0<_0x28d010[_0xd784('0x64')];_0x5586b0++){var _0x2086ba=_0x28d010[_0x5586b0];if(_0x2086ba[_0xd784('0x5a')]===_0xd784('0x56')){var _0x3fb035=_['find'](_0x39e13e,function(_0x4487fd){return _0x4487fd[_0xd784('0x65')]===_0x2086ba['id'];});if(_0x3fb035)_0x198581[_0xd784('0x66')](_0x2086ba);}else{_0x198581[_0xd784('0x66')](_0x2086ba);}}return _0x198581;}});}else{return _0x28d010;}}else{var _0x5870fa=_[_0xd784('0x3f')](_0x28d010,function(_0x1d1c1b){if(_0x1d1c1b[_0xd784('0x5a')]!=='agent'){return _0x1d1c1b;}});return _0x5870fa;}});}else{return _0x28d010;}}})[_0xd784('0x29')](function(_0x5e27b6){var _0x2d21be=[];if(_0x5e27b6){_0x3d632e=_0x5e27b6;for(var _0x4713b9=0x0;_0x4713b9<_0x5e27b6[_0xd784('0x64')];_0x4713b9+=0x1){_0x3d632e[_0x4713b9][_0xd784('0x50')]=[];_0x2d21be[_0xd784('0x66')](db['ChatInternalMessage'][_0xd784('0x4d')]({'where':{'FromId':[_0xa2c767[_0xd784('0x58')]['id'],_0x5e27b6[_0x4713b9]['id']],'ToId':[_0xa2c767[_0xd784('0x58')]['id'],_0x5e27b6[_0x4713b9]['id']],'ChatGroupId':null},'attributes':['id',_0xd784('0x52'),_0xd784('0x67'),'ToId',_0xd784('0x68'),_0xd784('0x4a')],'order':qs[_0xd784('0x3b')](_0xd784('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd784('0x29')](wrapUser(_0x5e27b6[_0x4713b9])));}return BPromise[_0xd784('0x6a')](_0x2d21be);}return[];})['then'](function(_0x3b4f02){return{'rows':_0x3b4f02,'count':_0x3b4f02['length']};})['then'](respondWithResult(_0x52d146,null))['catch'](handleError(_0x52d146,null));};
\ No newline at end of file
+var _0xa957=['eml-format','rimraf','fast-json-patch','request-promise','moment','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./chatInternalMessage.socket','sendStatus','status','offset','limit','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','describe','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','read','-createdAt','all'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa957,0x141));var _0x7a95=function(_0x2386c7,_0x6330c){_0x2386c7=_0x2386c7-0x0;var _0x5f388a=_0xa957[_0x2386c7];return _0x5f388a;};'use strict';var emlformat=require(_0x7a95('0x0'));var rimraf=require(_0x7a95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a95('0x2'));var rp=require(_0x7a95('0x3'));var moment=require(_0x7a95('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7a95('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a95('0x6'));var fs=require('fs');var fs_extra=require(_0x7a95('0x7'));var _=require(_0x7a95('0x8'));var squel=require('squel');var crypto=require(_0x7a95('0x9'));var jsforce=require(_0x7a95('0xa'));var deskjs=require(_0x7a95('0xb'));var toCsv=require(_0x7a95('0xc'));var querystring=require(_0x7a95('0xd'));var Papa=require(_0x7a95('0xe'));var Redis=require('ioredis');var authService=require(_0x7a95('0xf'));var qs=require(_0x7a95('0x10'));var as=require(_0x7a95('0x11'));var hardwareService=require(_0x7a95('0x12'));var logger=require(_0x7a95('0x13'))(_0x7a95('0x14'));var utils=require(_0x7a95('0x15'));var config=require(_0x7a95('0x16'));var licenseUtil=require(_0x7a95('0x17'));var db=require(_0x7a95('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7a95('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a95('0x1a'))['register'](socket);function respondWithStatusCode(_0x3a62e3,_0x30d682){_0x30d682=_0x30d682||0xcc;return function(_0x3c2e76){if(_0x3c2e76){return _0x3a62e3[_0x7a95('0x1b')](_0x30d682);}return _0x3a62e3[_0x7a95('0x1c')](_0x30d682)['end']();};}function respondWithResult(_0x1b1d18,_0x14dfd8){_0x14dfd8=_0x14dfd8||0xc8;return function(_0x33ce16){if(_0x33ce16){return _0x1b1d18[_0x7a95('0x1c')](_0x14dfd8)['json'](_0x33ce16);}};}function respondWithFilteredResult(_0x4fd2d8,_0x54b447){return function(_0x3da5e9){if(_0x3da5e9){var _0x120b9d=typeof _0x54b447['offset']==='undefined'&&typeof _0x54b447['limit']==='undefined';var _0x5536ce=_0x3da5e9['count'];var _0x21f80f=_0x120b9d?0x0:_0x54b447['offset'];var _0x19f6c0=_0x120b9d?_0x3da5e9['count']:_0x54b447[_0x7a95('0x1d')]+_0x54b447[_0x7a95('0x1e')];var _0x590e9c;if(_0x19f6c0>=_0x5536ce){_0x19f6c0=_0x5536ce;_0x590e9c=0xc8;}else{_0x590e9c=0xce;}_0x4fd2d8['status'](_0x590e9c);return _0x4fd2d8['set'](_0x7a95('0x1f'),_0x21f80f+'-'+_0x19f6c0+'/'+_0x5536ce)[_0x7a95('0x20')](_0x3da5e9);}return null;};}function patchUpdates(_0x2abef9){return function(_0xc9bb9){try{jsonpatch[_0x7a95('0x21')](_0xc9bb9,_0x2abef9,!![]);}catch(_0x50b863){return BPromise['reject'](_0x50b863);}return _0xc9bb9[_0x7a95('0x22')]();};}function saveUpdates(_0x3ec5cb,_0x452c6c){return function(_0x4cf784){if(_0x4cf784){return _0x4cf784['update'](_0x3ec5cb)[_0x7a95('0x23')](function(_0xccbdcb){return _0xccbdcb;});}return null;};}function removeEntity(_0x22a9bb,_0x22be51){return function(_0x45cab9){if(_0x45cab9){return _0x45cab9[_0x7a95('0x24')]()[_0x7a95('0x23')](function(){_0x22a9bb[_0x7a95('0x1c')](0xcc)[_0x7a95('0x25')]();});}};}function handleEntityNotFound(_0xea6e32,_0x2ff421){return function(_0x4d3a17){if(!_0x4d3a17){_0xea6e32[_0x7a95('0x1b')](0x194);}return _0x4d3a17;};}function handleError(_0x271d37,_0x361cde){_0x361cde=_0x361cde||0x1f4;return function(_0x38ece2){logger[_0x7a95('0x26')](_0x38ece2[_0x7a95('0x27')]);if(_0x38ece2['name']){delete _0x38ece2[_0x7a95('0x28')];}_0x271d37[_0x7a95('0x1c')](_0x361cde)['send'](_0x38ece2);};}exports[_0x7a95('0x29')]=function(_0x4951cb,_0x53dc11){var _0x232fa8={},_0x4bc01b={},_0x146c78={'count':0x0,'rows':[]};var _0x4984cd=_[_0x7a95('0x2a')](db[_0x7a95('0x2b')][_0x7a95('0x2c')],function(_0x51d198){return{'name':_0x51d198[_0x7a95('0x2d')],'type':_0x51d198[_0x7a95('0x2e')][_0x7a95('0x2f')]};});_0x4bc01b[_0x7a95('0x30')]=_[_0x7a95('0x2a')](_0x4984cd,_0x7a95('0x28'));_0x4bc01b['query']=_[_0x7a95('0x31')](_0x4951cb[_0x7a95('0x32')]);_0x4bc01b['filters']=_[_0x7a95('0x33')](_0x4bc01b[_0x7a95('0x30')],_0x4bc01b[_0x7a95('0x32')]);_0x232fa8[_0x7a95('0x34')]=_['intersection'](_0x4bc01b[_0x7a95('0x30')],qs[_0x7a95('0x35')](_0x4951cb[_0x7a95('0x32')]['fields']));_0x232fa8[_0x7a95('0x34')]=_0x232fa8[_0x7a95('0x34')][_0x7a95('0x36')]?_0x232fa8[_0x7a95('0x34')]:_0x4bc01b[_0x7a95('0x30')];if(!_0x4951cb['query'][_0x7a95('0x37')](_0x7a95('0x38'))){_0x232fa8[_0x7a95('0x1e')]=qs[_0x7a95('0x1e')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1e')]);_0x232fa8[_0x7a95('0x1d')]=qs[_0x7a95('0x1d')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1d')]);}_0x232fa8[_0x7a95('0x39')]=qs[_0x7a95('0x3a')](_0x4951cb['query'][_0x7a95('0x3a')]);_0x232fa8[_0x7a95('0x3b')]=qs['filters'](_['pick'](_0x4951cb[_0x7a95('0x32')],_0x4bc01b[_0x7a95('0x3c')]),_0x4984cd);if(_0x4951cb[_0x7a95('0x32')][_0x7a95('0x3d')]){_0x232fa8['where']=_['merge'](_0x232fa8['where'],{'$or':_[_0x7a95('0x2a')](_0x4984cd,function(_0x374792){if(_0x374792[_0x7a95('0x2e')]!==_0x7a95('0x3e')){var _0x1bca09={};_0x1bca09[_0x374792[_0x7a95('0x28')]]={'$like':'%'+_0x4951cb['query'][_0x7a95('0x3d')]+'%'};return _0x1bca09;}})});}_0x232fa8=_[_0x7a95('0x3f')]({},_0x232fa8,_0x4951cb['options']);var _0x87e711={'where':_0x232fa8[_0x7a95('0x3b')]};return db[_0x7a95('0x2b')][_0x7a95('0x40')](_0x87e711)[_0x7a95('0x23')](function(_0x1d7c41){_0x146c78['count']=_0x1d7c41;if(_0x4951cb['query'][_0x7a95('0x41')]){_0x232fa8[_0x7a95('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7a95('0x43')](_0x232fa8);})[_0x7a95('0x23')](function(_0x1e880a){_0x146c78[_0x7a95('0x44')]=_0x1e880a;return _0x146c78;})[_0x7a95('0x23')](respondWithFilteredResult(_0x53dc11,_0x232fa8))[_0x7a95('0x45')](handleError(_0x53dc11,null));};exports['show']=function(_0x2c6544,_0x2f5482){var _0x4d26d5={'raw':!![],'where':{'id':_0x2c6544['params']['id']}},_0x27b170={};_0x27b170[_0x7a95('0x30')]=_[_0x7a95('0x31')](db[_0x7a95('0x2b')][_0x7a95('0x2c')]);_0x27b170[_0x7a95('0x32')]=_[_0x7a95('0x31')](_0x2c6544[_0x7a95('0x32')]);_0x27b170[_0x7a95('0x3c')]=_[_0x7a95('0x33')](_0x27b170[_0x7a95('0x30')],_0x27b170[_0x7a95('0x32')]);_0x4d26d5[_0x7a95('0x34')]=_['intersection'](_0x27b170[_0x7a95('0x30')],qs['fields'](_0x2c6544[_0x7a95('0x32')][_0x7a95('0x35')]));_0x4d26d5[_0x7a95('0x34')]=_0x4d26d5[_0x7a95('0x34')][_0x7a95('0x36')]?_0x4d26d5[_0x7a95('0x34')]:_0x27b170[_0x7a95('0x30')];if(_0x2c6544[_0x7a95('0x32')][_0x7a95('0x41')]){_0x4d26d5[_0x7a95('0x42')]=[{'all':!![]}];}_0x4d26d5=_[_0x7a95('0x3f')]({},_0x4d26d5,_0x2c6544[_0x7a95('0x46')]);return db[_0x7a95('0x2b')][_0x7a95('0x47')](_0x4d26d5)[_0x7a95('0x23')](handleEntityNotFound(_0x2f5482,null))[_0x7a95('0x23')](respondWithResult(_0x2f5482,null))['catch'](handleError(_0x2f5482,null));};exports[_0x7a95('0x48')]=function(_0x1d50da,_0x326d7c){return db['ChatInternalMessage']['create'](_0x1d50da[_0x7a95('0x49')],{})[_0x7a95('0x23')](respondWithResult(_0x326d7c,0xc9))[_0x7a95('0x45')](handleError(_0x326d7c,null));};exports[_0x7a95('0x4a')]=function(_0x2e6196,_0x4ea155){if(_0x2e6196[_0x7a95('0x49')]['id']){delete _0x2e6196[_0x7a95('0x49')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2e6196[_0x7a95('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea155,null))['then'](saveUpdates(_0x2e6196[_0x7a95('0x49')],null))['then'](respondWithResult(_0x4ea155,null))[_0x7a95('0x45')](handleError(_0x4ea155,null));};exports[_0x7a95('0x24')]=function(_0x281940,_0x52319f){return db[_0x7a95('0x2b')][_0x7a95('0x47')]({'where':{'id':_0x281940[_0x7a95('0x4b')]['id']}})[_0x7a95('0x23')](handleEntityNotFound(_0x52319f,null))['then'](removeEntity(_0x52319f,null))[_0x7a95('0x45')](handleError(_0x52319f,null));};exports[_0x7a95('0x4c')]=function(_0x4c25e0,_0x5469e0){return db[_0x7a95('0x2b')][_0x7a95('0x4c')]()[_0x7a95('0x23')](respondWithResult(_0x5469e0,null))['catch'](handleError(_0x5469e0,null));};function wrapUser(_0x508f91){return function(_0x392907){var _0x532439=_0x508f91['get']({'plain':!![]});_0x532439[_0x7a95('0x4d')]=[];if(_0x392907){_0x532439['lastMessageAt']=_0x392907[_0x7a95('0x4e')];_0x532439['lastMessage']=_0x392907;}else{_0x532439['lastMessageAt']=moment(0x0)[_0x7a95('0x4f')](_0x7a95('0x50'));_0x532439['lastMessage']={};}return _0x532439;};}exports[_0x7a95('0x51')]=function(_0x2e2c59,_0x5e65ed,_0x4d6983){var _0x5d9cb0=[];return db['User'][_0x7a95('0x43')]({'where':{'role':['agent',_0x7a95('0x52'),_0x7a95('0x53')]},'attributes':['id',_0x7a95('0x54'),_0x7a95('0x28'),_0x7a95('0x55'),_0x7a95('0x56'),'internal',_0x7a95('0x57'),_0x7a95('0x58'),_0x7a95('0x59'),_0x7a95('0x5a')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x5b')),'include':[{'model':db['VoiceQueue'],'as':_0x7a95('0x5c'),'attributes':['id',_0x7a95('0x28'),_0x7a95('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x4c90dc){if(_0x4c90dc){var _0x11e47f=_0x2e2c59[_0x7a95('0x53')][_0x7a95('0x5d')]({'plain':!![]});if(!_0x11e47f)throw new Error(_0x7a95('0x5e'));if(_0x11e47f[_0x7a95('0x55')]===_0x7a95('0x53')){return db[_0x7a95('0x5f')][_0x7a95('0x47')]({'where':{'name':_0x7a95('0x60'),'userProfileId':_0x11e47f[_0x7a95('0x61')]},'raw':!![]})[_0x7a95('0x23')](function(_0x39b5ab){if(_0x39b5ab){if(_0x39b5ab[_0x7a95('0x62')]===0x0){return db[_0x7a95('0x63')][_0x7a95('0x43')]({'where':{'sectionId':_0x39b5ab['id']},'raw':!![]})['then'](function(_0x414ac7){var _0x248ac0=[];if(_[_0x7a95('0x64')](_0x414ac7)){_0x248ac0=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x1dd6a2){if(_0x1dd6a2['role']!==_0x7a95('0x65')){return _0x1dd6a2;}});return _0x248ac0;}else{for(var _0x35ad70=0x0;_0x35ad70<_0x4c90dc[_0x7a95('0x36')];_0x35ad70++){var _0x19158e=_0x4c90dc[_0x35ad70];if(_0x19158e[_0x7a95('0x55')]===_0x7a95('0x65')){var _0x2cf9ed=_[_0x7a95('0x47')](_0x414ac7,function(_0x209fe5){return _0x209fe5['resourceId']===_0x19158e['id'];});if(_0x2cf9ed)_0x248ac0['push'](_0x19158e);}else{_0x248ac0['push'](_0x19158e);}}return _0x248ac0;}});}else{return _0x4c90dc;}}else{var _0x987159=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x2942b7){if(_0x2942b7['role']!==_0x7a95('0x65')){return _0x2942b7;}});return _0x987159;}});}else{return _0x4c90dc;}}})['then'](function(_0x213680){var _0x7d41ff=[];if(_0x213680){_0x5d9cb0=_0x213680;for(var _0x4e327a=0x0;_0x4e327a<_0x213680[_0x7a95('0x36')];_0x4e327a+=0x1){_0x5d9cb0[_0x4e327a]['messages']=[];_0x7d41ff[_0x7a95('0x66')](db['ChatInternalMessage'][_0x7a95('0x47')]({'where':{'FromId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ToId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ChatGroupId':null},'attributes':['id',_0x7a95('0x4e'),_0x7a95('0x67'),'ToId',_0x7a95('0x68'),_0x7a95('0x49')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a95('0x23')](wrapUser(_0x213680[_0x4e327a])));}return BPromise[_0x7a95('0x6a')](_0x7d41ff);}return[];})['then'](function(_0x10491e){return{'rows':_0x10491e,'count':_0x10491e[_0x7a95('0x36')]};})['then'](respondWithResult(_0x5e65ed,null))[_0x7a95('0x45')](handleError(_0x5e65ed,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 364bf17..1d1f930 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 _0x1e41=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x3925ff,_0x3fe6e5){var _0x1f16d5=function(_0xc538a2){while(--_0xc538a2){_0x3925ff['push'](_0x3925ff['shift']());}};_0x1f16d5(++_0x3fe6e5);}(_0x1e41,0x11c));var _0x11e4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1e41[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x11e4('0x0'))['db'][_0x11e4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11e4('0x2'),'afterUpdate':_0x11e4('0x3'),'afterDestroy':_0x11e4('0x4')};function emitEvent(_0x3801b8){return function(_0x4a27c7,_0x887911,_0x50b974){ChatInternalMessageEvents[_0x11e4('0x5')](_0x3801b8+':'+_0x4a27c7['id'],_0x4a27c7);ChatInternalMessageEvents['emit'](_0x3801b8,_0x4a27c7);_0x50b974(null);};}for(var e in events){if(events[_0x11e4('0x6')](e)){var event=events[e];ChatInternalMessage[_0x11e4('0x7')](e,emitEvent(event));}}module[_0x11e4('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x137b=['exports','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x360d0c,_0x5ea257){var _0x419c20=function(_0x36cd39){while(--_0x36cd39){_0x360d0c['push'](_0x360d0c['shift']());}};_0x419c20(++_0x5ea257);}(_0x137b,0xac));var _0xb137=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x137b[_0x47c6b9];return _0x34f34d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xb137('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb137('0x1')](0x0);var events={'afterCreate':_0xb137('0x2'),'afterUpdate':_0xb137('0x3'),'afterDestroy':_0xb137('0x4')};function emitEvent(_0x5b4a51){return function(_0x45db83,_0x198c24,_0x3519d8){ChatInternalMessageEvents[_0xb137('0x5')](_0x5b4a51+':'+_0x45db83['id'],_0x45db83);ChatInternalMessageEvents['emit'](_0x5b4a51,_0x45db83);_0x3519d8(null);};}for(var e in events){if(events[_0xb137('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb137('0x7')](e,emitEvent(event));}}module[_0xb137('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 38785e2..2a1238b 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 _0xacd9=['define','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacd9,0x81));var _0x9acd=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xacd9[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x9acd('0x0'));var util=require(_0x9acd('0x1'));var logger=require(_0x9acd('0x2'))(_0x9acd('0x3'));var moment=require(_0x9acd('0x4'));var BPromise=require(_0x9acd('0x5'));var rp=require(_0x9acd('0x6'));var fs=require('fs');var path=require(_0x9acd('0x7'));var rimraf=require(_0x9acd('0x8'));var config=require(_0x9acd('0x9'));var attributes=require(_0x9acd('0xa'));module['exports']=function(_0x5b36c2,_0x115f0a){return _0x5b36c2[_0x9acd('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x9acd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9acd('0xd')});};
\ No newline at end of file
+var _0x94f1=['utf8mb4','lodash','util','api','moment','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages'];(function(_0x4dbe47,_0x325ef7){var _0x2fe4c5=function(_0x1f2fc8){while(--_0x1f2fc8){_0x4dbe47['push'](_0x4dbe47['shift']());}};_0x2fe4c5(++_0x325ef7);}(_0x94f1,0x7a));var _0x194f=function(_0x380c37,_0x57d3d1){_0x380c37=_0x380c37-0x0;var _0x47d664=_0x94f1[_0x380c37];return _0x47d664;};'use strict';var _=require(_0x194f('0x0'));var util=require(_0x194f('0x1'));var logger=require('../../config/logger')(_0x194f('0x2'));var moment=require(_0x194f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x194f('0x4'));var rimraf=require(_0x194f('0x5'));var config=require('../../config/environment');var attributes=require(_0x194f('0x6'));module[_0x194f('0x7')]=function(_0x55bd8b,_0x2db490){return _0x55bd8b['define'](_0x194f('0x8'),attributes,{'tableName':_0x194f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x194f('0xa'),'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 494ed98..1a8de02 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 _0x858a=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','register','request','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x2f3226,_0x2b0272){var _0x16ebcc=function(_0x1a3fd9){while(--_0x1a3fd9){_0x2f3226['push'](_0x2f3226['shift']());}};_0x16ebcc(++_0x2b0272);}(_0x858a,0x1a2));var _0xa858=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x858a[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xa858('0x0'));var util=require(_0xa858('0x1'));var moment=require(_0xa858('0x2'));var BPromise=require(_0xa858('0x3'));var rs=require(_0xa858('0x4'));var fs=require('fs');var Redis=require(_0xa858('0x5'));var db=require(_0xa858('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa858('0x7'))(_0xa858('0x8'));var config=require(_0xa858('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa858('0xa')]({'port':0x232a});config['redis']=_[_0xa858('0xb')](config[_0xa858('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa858('0xd'))(new Redis(config[_0xa858('0xc')]));require('./chatInternalMessage.socket')[_0xa858('0xe')](socket);function respondWithRpcPromise(_0x34d72b,_0x57d8dc,_0x2c16bc){return new BPromise(function(_0x3b0ee6,_0x2d7a98){return client[_0xa858('0xf')](_0x34d72b,_0x2c16bc)['then'](function(_0x352f7d){logger[_0xa858('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x57d8dc,'request\x20sent');logger[_0xa858('0x11')](_0xa858('0x12'),_0x57d8dc,_0xa858('0x13'),JSON[_0xa858('0x14')](_0x352f7d));if(_0x352f7d[_0xa858('0x15')]){if(_0x352f7d[_0xa858('0x15')]['code']===0x1f4){logger[_0xa858('0x15')](_0xa858('0x16'),_0x57d8dc,_0x352f7d[_0xa858('0x15')]['message']);return _0x2d7a98(_0x352f7d['error']['message']);}logger[_0xa858('0x15')](_0xa858('0x16'),_0x57d8dc,_0x352f7d['error'][_0xa858('0x17')]);return _0x3b0ee6(_0x352f7d[_0xa858('0x15')][_0xa858('0x17')]);}else{logger[_0xa858('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x57d8dc,_0xa858('0x13'));_0x3b0ee6(_0x352f7d[_0xa858('0x18')][_0xa858('0x17')]);}})[_0xa858('0x19')](function(_0x1def8c){logger['error'](_0xa858('0x16'),_0x57d8dc,_0x1def8c);_0x2d7a98(_0x1def8c);});});}
\ No newline at end of file
+var _0x209f=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1024a7,_0x4fd745){var _0x30b2b2=function(_0x258595){while(--_0x258595){_0x1024a7['push'](_0x1024a7['shift']());}};_0x30b2b2(++_0x4fd745);}(_0x209f,0x199));var _0xf209=function(_0x1958f0,_0x15ab19){_0x1958f0=_0x1958f0-0x0;var _0x252936=_0x209f[_0x1958f0];return _0x252936;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var moment=require(_0xf209('0x1'));var BPromise=require(_0xf209('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf209('0x3'));var db=require(_0xf209('0x4'))['db'];var utils=require(_0xf209('0x5'));var logger=require('../../config/logger')(_0xf209('0x6'));var config=require(_0xf209('0x7'));var jayson=require(_0xf209('0x8'));var client=jayson[_0xf209('0x9')][_0xf209('0xa')]({'port':0x232a});config['redis']=_[_0xf209('0xb')](config[_0xf209('0xc')],{'host':_0xf209('0xd'),'port':0x18eb});var socket=require(_0xf209('0xe'))(new Redis(config[_0xf209('0xc')]));require(_0xf209('0xf'))['register'](socket);function respondWithRpcPromise(_0x212cdd,_0x13e491,_0x471736){return new BPromise(function(_0x19a62a,_0x517aa4){return client[_0xf209('0x10')](_0x212cdd,_0x471736)[_0xf209('0x11')](function(_0x6eb857){logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));logger[_0xf209('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x13e491,'request\x20sent',JSON['stringify'](_0x6eb857));if(_0x6eb857[_0xf209('0x16')]){if(_0x6eb857[_0xf209('0x16')][_0xf209('0x17')]===0x1f4){logger['error'](_0xf209('0x13'),_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x517aa4(_0x6eb857['error']['message']);}logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x19a62a(_0x6eb857['error']['message']);}else{logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));_0x19a62a(_0x6eb857[_0xf209('0x19')][_0xf209('0x18')]);}})[_0xf209('0x1a')](function(_0x3fc4fa){logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x3fc4fa);_0x517aa4(_0x3fc4fa);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 17331a6..82665ee 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 _0x40e1=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x5ddda9,_0x43e558){var _0x53a004=function(_0x2794a1){while(--_0x2794a1){_0x5ddda9['push'](_0x5ddda9['shift']());}};_0x53a004(++_0x43e558);}(_0x40e1,0xfc));var _0x140e=function(_0x45bee0,_0x42bf09){_0x45bee0=_0x45bee0-0x0;var _0x1fcfd5=_0x40e1[_0x45bee0];return _0x1fcfd5;};'use strict';var ChatInternalMessageEvents=require(_0x140e('0x0'));var events=[_0x140e('0x1'),_0x140e('0x2'),_0x140e('0x3')];function createListener(_0x243c58,_0x39fbc7){return function(_0x436e5c){_0x39fbc7['emit'](_0x243c58,_0x436e5c);};}function removeListener(_0x40c402,_0x1785c3){return function(){ChatInternalMessageEvents[_0x140e('0x4')](_0x40c402,_0x1785c3);};}exports[_0x140e('0x5')]=function(_0x3b1dce){for(var _0x4e89fa=0x0,_0x1d65d8=events[_0x140e('0x6')];_0x4e89fa<_0x1d65d8;_0x4e89fa++){var _0x3cee26=events[_0x4e89fa];var _0x333b1e=createListener(_0x140e('0x7')+_0x3cee26,_0x3b1dce);ChatInternalMessageEvents['on'](_0x3cee26,_0x333b1e);}};
\ No newline at end of file
+var _0x04ba=['./chatInternalMessage.events','remove','register','length'];(function(_0x5b9231,_0x2181c6){var _0x1f7959=function(_0xa1620d){while(--_0xa1620d){_0x5b9231['push'](_0x5b9231['shift']());}};_0x1f7959(++_0x2181c6);}(_0x04ba,0x14c));var _0xa04b=function(_0x270485,_0x455f1e){_0x270485=_0x270485-0x0;var _0x20fa79=_0x04ba[_0x270485];return _0x20fa79;};'use strict';var ChatInternalMessageEvents=require(_0xa04b('0x0'));var events=['save',_0xa04b('0x1'),'update'];function createListener(_0x1025dc,_0x35ed23){return function(_0x10fa3f){_0x35ed23['emit'](_0x1025dc,_0x10fa3f);};}function removeListener(_0x33276b,_0x33d4d3){return function(){ChatInternalMessageEvents['removeListener'](_0x33276b,_0x33d4d3);};}exports[_0xa04b('0x2')]=function(_0x3bc9be){for(var _0x2cd468=0x0,_0x331e81=events[_0xa04b('0x3')];_0x2cd468<_0x331e81;_0x2cd468++){var _0xe1c3d8=events[_0x2cd468];var _0x523a9e=createListener('chatInternalMessage:'+_0xe1c3d8,_0x3bc9be);ChatInternalMessageEvents['on'](_0xe1c3d8,_0x523a9e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 3f32203..f5f2fc2 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 _0x11be=['update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','put'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x11be,0x67));var _0xe11b=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x11be[_0x483102];return _0x5cc885;};'use strict';var multer=require(_0xe11b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe11b('0x1'));var router=express[_0xe11b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe11b('0x3'));var interaction=require(_0xe11b('0x4'));var config=require(_0xe11b('0x5'));var controller=require(_0xe11b('0x6'));router[_0xe11b('0x7')]('/',auth[_0xe11b('0x8')](),controller[_0xe11b('0x9')]);router[_0xe11b('0x7')]('/describe',auth[_0xe11b('0x8')](),controller[_0xe11b('0xa')]);router[_0xe11b('0x7')](_0xe11b('0xb'),auth[_0xe11b('0x8')](),controller[_0xe11b('0xc')]);router[_0xe11b('0x7')](_0xe11b('0xd'),auth[_0xe11b('0x8')](),controller[_0xe11b('0xe')]);router[_0xe11b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe11b('0x10')](_0xe11b('0xd'),controller[_0xe11b('0x11')]);router['delete'](_0xe11b('0xd'),auth[_0xe11b('0x8')](),controller[_0xe11b('0x12')]);module[_0xe11b('0x13')]=router;
\ No newline at end of file
+var _0xcb88=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb88,0x1ea));var _0x8cb8=function(_0x204728,_0x200843){_0x204728=_0x204728-0x0;var _0x36c979=_0xcb88[_0x204728];return _0x36c979;};'use strict';var multer=require(_0x8cb8('0x0'));var util=require(_0x8cb8('0x1'));var path=require(_0x8cb8('0x2'));var timeout=require(_0x8cb8('0x3'));var express=require(_0x8cb8('0x4'));var router=express[_0x8cb8('0x5')]();var fs_extra=require(_0x8cb8('0x6'));var auth=require(_0x8cb8('0x7'));var interaction=require(_0x8cb8('0x8'));var config=require(_0x8cb8('0x9'));var controller=require('./chatInternalMessage.controller');router[_0x8cb8('0xa')]('/',auth[_0x8cb8('0xb')](),controller[_0x8cb8('0xc')]);router['get'](_0x8cb8('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x8cb8('0xa')]('/users',auth['isAuthenticated'](),controller[_0x8cb8('0xe')]);router[_0x8cb8('0xa')](_0x8cb8('0xf'),auth[_0x8cb8('0xb')](),controller[_0x8cb8('0x10')]);router[_0x8cb8('0x11')]('/',auth['isAuthenticated'](),controller[_0x8cb8('0x12')]);router[_0x8cb8('0x13')](_0x8cb8('0xf'),controller[_0x8cb8('0x14')]);router[_0x8cb8('0x15')](_0x8cb8('0xf'),auth['isAuthenticated'](),controller[_0x8cb8('0x16')]);module[_0x8cb8('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8efe0a5..1bb62e1 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 _0x4fc2=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4fc2,0x111));var _0x24fc=function(_0x1d6f1e,_0x22a3f2){_0x1d6f1e=_0x1d6f1e-0x0;var _0xc74a85=_0x4fc2[_0x1d6f1e];return _0xc74a85;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'body':{'type':Sequelize[_0x24fc('0x2')](_0x24fc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x24fc('0x5')]('in',_0x24fc('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24fc('0x7')]},'providerName':{'type':Sequelize[_0x24fc('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4b17=['STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x2d4946,_0x422382){var _0x1905a1=function(_0x19e1c5){while(--_0x19e1c5){_0x2d4946['push'](_0x2d4946['shift']());}};_0x1905a1(++_0x422382);}(_0x4b17,0x10f));var _0x74b1=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x4b17[_0x545bed];return _0x16c79c;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74b1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x74b1('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x74b1('0x4')]},'providerResponse':{'type':Sequelize[_0x74b1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 38d95d7..e15c3ee 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 _0x5a74=['ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','info','user','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','internal','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','limit','count','offset','set','apply','reject','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','show','params','options','create','body','find','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get'];(function(_0x11a444,_0x29ce63){var _0x2bdfca=function(_0x95f24c){while(--_0x95f24c){_0x11a444['push'](_0x11a444['shift']());}};_0x2bdfca(++_0x29ce63);}(_0x5a74,0xac));var _0x45a7=function(_0x18d8e9,_0x2d9568){_0x18d8e9=_0x18d8e9-0x0;var _0x1b9102=_0x5a74[_0x18d8e9];return _0x1b9102;};'use strict';var emlformat=require(_0x45a7('0x0'));var rimraf=require(_0x45a7('0x1'));var zipdir=require(_0x45a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45a7('0x3'));var moment=require(_0x45a7('0x4'));var BPromise=require(_0x45a7('0x5'));var Mustache=require(_0x45a7('0x6'));var util=require(_0x45a7('0x7'));var path=require(_0x45a7('0x8'));var sox=require(_0x45a7('0x9'));var csv=require(_0x45a7('0xa'));var ejs=require(_0x45a7('0xb'));var fs=require('fs');var fs_extra=require(_0x45a7('0xc'));var _=require('lodash');var squel=require(_0x45a7('0xd'));var crypto=require('crypto');var jsforce=require(_0x45a7('0xe'));var deskjs=require(_0x45a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x45a7('0x10'));var Papa=require('papaparse');var Redis=require(_0x45a7('0x11'));var authService=require(_0x45a7('0x12'));var qs=require(_0x45a7('0x13'));var as=require(_0x45a7('0x14'));var hardwareService=require(_0x45a7('0x15'));var logger=require(_0x45a7('0x16'))(_0x45a7('0x17'));var utils=require(_0x45a7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x45a7('0x19'));var db=require(_0x45a7('0x1a'))['db'];config[_0x45a7('0x1b')]=_['defaults'](config[_0x45a7('0x1b')],{'host':_0x45a7('0x1c'),'port':0x18eb});var socket=require(_0x45a7('0x1d'))(new Redis(config['redis']));require(_0x45a7('0x1e'))[_0x45a7('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x45a7('0x20')]({'port':0x232c});var client9002=jayson[_0x45a7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe2bca6,_0x3d5438,_0x4df71c,_0x1d2df1){return new BPromise(function(_0x42824a,_0x54c6a7){var _0x13e356=_0x1d2df1||client;return _0x13e356[_0x45a7('0x22')](_0xe2bca6,_0x4df71c)[_0x45a7('0x23')](function(_0x38f4e0){logger['info'](_0x45a7('0x24'),_0x3d5438,_0x45a7('0x25'));logger[_0x45a7('0x26')](_0x45a7('0x27'),_0x3d5438,_0x45a7('0x25'),JSON[_0x45a7('0x28')](_0x38f4e0));if(_0x38f4e0[_0x45a7('0x29')]){if(_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2a')]===0x1f4){logger[_0x45a7('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3d5438,_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);return _0x54c6a7(_0x38f4e0['error'][_0x45a7('0x2b')]);}logger['error'](_0x45a7('0x24'),_0x3d5438,_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);return _0x42824a(_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);}else{logger['info'](_0x45a7('0x24'),_0x3d5438,'request\x20sent');_0x42824a(_0x38f4e0['result'][_0x45a7('0x2b')]);}})[_0x45a7('0x2c')](function(_0x5609b0){logger[_0x45a7('0x29')](_0x45a7('0x24'),_0x3d5438,_0x5609b0);_0x54c6a7(_0x5609b0);});});}function respondWithStatusCode(_0x5b565b,_0x563413){_0x563413=_0x563413||0xcc;return function(_0x4845ce){if(_0x4845ce){return _0x5b565b[_0x45a7('0x2d')](_0x563413);}return _0x5b565b[_0x45a7('0x2e')](_0x563413)[_0x45a7('0x2f')]();};}function respondWithResult(_0x52c8b3,_0x20c313){_0x20c313=_0x20c313||0xc8;return function(_0x1ec66e){if(_0x1ec66e){return _0x52c8b3[_0x45a7('0x2e')](_0x20c313)['json'](_0x1ec66e);}};}function respondWithFilteredResult(_0x3e295c,_0x31c0fc){return function(_0x2131c6){if(_0x2131c6){var _0x3ac017=typeof _0x31c0fc['offset']==='undefined'&&typeof _0x31c0fc[_0x45a7('0x30')]==='undefined';var _0xf8f331=_0x2131c6[_0x45a7('0x31')];var _0x445718=_0x3ac017?0x0:_0x31c0fc[_0x45a7('0x32')];var _0x1864e9=_0x3ac017?_0x2131c6['count']:_0x31c0fc['offset']+_0x31c0fc[_0x45a7('0x30')];var _0x96ba98;if(_0x1864e9>=_0xf8f331){_0x1864e9=_0xf8f331;_0x96ba98=0xc8;}else{_0x96ba98=0xce;}_0x3e295c[_0x45a7('0x2e')](_0x96ba98);return _0x3e295c[_0x45a7('0x33')]('Content-Range',_0x445718+'-'+_0x1864e9+'/'+_0xf8f331)['json'](_0x2131c6);}return null;};}function patchUpdates(_0x58c05f){return function(_0x3741af){try{jsonpatch[_0x45a7('0x34')](_0x3741af,_0x58c05f,!![]);}catch(_0x4413d6){return BPromise[_0x45a7('0x35')](_0x4413d6);}return _0x3741af[_0x45a7('0x36')]();};}function saveUpdates(_0x4d8da2,_0xcda0f){return function(_0x1d2493){if(_0x1d2493){return _0x1d2493[_0x45a7('0x37')](_0x4d8da2)['then'](function(_0x5daf01){return _0x5daf01;});}return null;};}function removeEntity(_0x5d3319,_0x152112){return function(_0x1edd21){if(_0x1edd21){return _0x1edd21[_0x45a7('0x38')]()[_0x45a7('0x23')](function(){_0x5d3319[_0x45a7('0x2e')](0xcc)[_0x45a7('0x2f')]();});}};}function handleEntityNotFound(_0x2e456a,_0x31c53f){return function(_0x535d43){if(!_0x535d43){_0x2e456a[_0x45a7('0x2d')](0x194);}return _0x535d43;};}function handleError(_0x536f6b,_0x5e9b9a){_0x5e9b9a=_0x5e9b9a||0x1f4;return function(_0x5efe96){logger[_0x45a7('0x29')](_0x5efe96[_0x45a7('0x39')]);if(_0x5efe96[_0x45a7('0x3a')]){delete _0x5efe96[_0x45a7('0x3a')];}_0x536f6b[_0x45a7('0x2e')](_0x5e9b9a)[_0x45a7('0x3b')](_0x5efe96);};}exports['index']=function(_0x4fae5d,_0x2439b7){var _0x4f8817={},_0x5b52bd={},_0x45f72f={'count':0x0,'rows':[]};var _0x1e25b8=_[_0x45a7('0x3c')](db[_0x45a7('0x3d')][_0x45a7('0x3e')],function(_0x287231){return{'name':_0x287231[_0x45a7('0x3f')],'type':_0x287231[_0x45a7('0x40')]['key']};});_0x5b52bd[_0x45a7('0x41')]=_[_0x45a7('0x3c')](_0x1e25b8,_0x45a7('0x3a'));_0x5b52bd['query']=_[_0x45a7('0x42')](_0x4fae5d[_0x45a7('0x43')]);_0x5b52bd['filters']=_[_0x45a7('0x44')](_0x5b52bd[_0x45a7('0x41')],_0x5b52bd['query']);_0x4f8817[_0x45a7('0x45')]=_[_0x45a7('0x44')](_0x5b52bd[_0x45a7('0x41')],qs[_0x45a7('0x46')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x46')]));_0x4f8817[_0x45a7('0x45')]=_0x4f8817[_0x45a7('0x45')][_0x45a7('0x47')]?_0x4f8817['attributes']:_0x5b52bd['model'];if(!_0x4fae5d['query'][_0x45a7('0x48')](_0x45a7('0x49'))){_0x4f8817[_0x45a7('0x30')]=qs[_0x45a7('0x30')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x30')]);_0x4f8817[_0x45a7('0x32')]=qs[_0x45a7('0x32')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x32')]);}_0x4f8817[_0x45a7('0x4a')]=qs[_0x45a7('0x4b')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x4b')]);_0x4f8817[_0x45a7('0x4c')]=qs[_0x45a7('0x4d')](_['pick'](_0x4fae5d[_0x45a7('0x43')],_0x5b52bd['filters']),_0x1e25b8);if(_0x4fae5d['query'][_0x45a7('0x4e')]){_0x4f8817[_0x45a7('0x4c')]=_['merge'](_0x4f8817[_0x45a7('0x4c')],{'$or':_[_0x45a7('0x3c')](_0x1e25b8,function(_0x47ffd9){if(_0x47ffd9[_0x45a7('0x40')]!=='VIRTUAL'){var _0xda4cbb={};_0xda4cbb[_0x47ffd9[_0x45a7('0x3a')]]={'$like':'%'+_0x4fae5d['query']['filter']+'%'};return _0xda4cbb;}})});}_0x4f8817=_[_0x45a7('0x4f')]({},_0x4f8817,_0x4fae5d['options']);var _0x579698={'where':_0x4f8817[_0x45a7('0x4c')]};return db[_0x45a7('0x3d')]['count'](_0x579698)[_0x45a7('0x23')](function(_0x23dd42){_0x45f72f[_0x45a7('0x31')]=_0x23dd42;if(_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x50')]){_0x4f8817[_0x45a7('0x51')]=[{'all':!![]}];}return db[_0x45a7('0x3d')][_0x45a7('0x52')](_0x4f8817);})[_0x45a7('0x23')](function(_0x59631a){_0x45f72f[_0x45a7('0x53')]=_0x59631a;return _0x45f72f;})['then'](respondWithFilteredResult(_0x2439b7,_0x4f8817))['catch'](handleError(_0x2439b7,null));};exports[_0x45a7('0x54')]=function(_0x2ef17d,_0x106469){var _0x473211={'raw':!![],'where':{'id':_0x2ef17d[_0x45a7('0x55')]['id']}},_0x5be26e={};_0x5be26e[_0x45a7('0x41')]=_[_0x45a7('0x42')](db[_0x45a7('0x3d')]['rawAttributes']);_0x5be26e[_0x45a7('0x43')]=_[_0x45a7('0x42')](_0x2ef17d[_0x45a7('0x43')]);_0x5be26e[_0x45a7('0x4d')]=_[_0x45a7('0x44')](_0x5be26e['model'],_0x5be26e[_0x45a7('0x43')]);_0x473211[_0x45a7('0x45')]=_['intersection'](_0x5be26e[_0x45a7('0x41')],qs[_0x45a7('0x46')](_0x2ef17d[_0x45a7('0x43')][_0x45a7('0x46')]));_0x473211[_0x45a7('0x45')]=_0x473211[_0x45a7('0x45')][_0x45a7('0x47')]?_0x473211[_0x45a7('0x45')]:_0x5be26e[_0x45a7('0x41')];if(_0x2ef17d['query'][_0x45a7('0x50')]){_0x473211[_0x45a7('0x51')]=[{'all':!![]}];}_0x473211=_[_0x45a7('0x4f')]({},_0x473211,_0x2ef17d[_0x45a7('0x56')]);return db[_0x45a7('0x3d')]['find'](_0x473211)[_0x45a7('0x23')](handleEntityNotFound(_0x106469,null))[_0x45a7('0x23')](respondWithResult(_0x106469,null))['catch'](handleError(_0x106469,null));};exports[_0x45a7('0x57')]=function(_0x59fed1,_0x56c638){return db[_0x45a7('0x3d')][_0x45a7('0x57')](_0x59fed1[_0x45a7('0x58')],{})[_0x45a7('0x23')](respondWithResult(_0x56c638,0xc9))['catch'](handleError(_0x56c638,null));};exports[_0x45a7('0x37')]=function(_0x3dbf9e,_0x15b32d){if(_0x3dbf9e[_0x45a7('0x58')]['id']){delete _0x3dbf9e[_0x45a7('0x58')]['id'];}return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x3dbf9e[_0x45a7('0x55')]['id']}})['then'](handleEntityNotFound(_0x15b32d,null))[_0x45a7('0x23')](saveUpdates(_0x3dbf9e[_0x45a7('0x58')],null))[_0x45a7('0x23')](respondWithResult(_0x15b32d,null))[_0x45a7('0x2c')](handleError(_0x15b32d,null));};exports[_0x45a7('0x38')]=function(_0x84d97e,_0x252d7f){return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x84d97e[_0x45a7('0x55')]['id']}})[_0x45a7('0x23')](handleEntityNotFound(_0x252d7f,null))[_0x45a7('0x23')](removeEntity(_0x252d7f,null))[_0x45a7('0x2c')](handleError(_0x252d7f,null));};exports[_0x45a7('0x5a')]=function(_0x2ed4fe,_0x2e5923){return db[_0x45a7('0x3d')]['describe']()[_0x45a7('0x23')](respondWithResult(_0x2e5923,null))['catch'](handleError(_0x2e5923,null));};var interaction_log=require(_0x45a7('0x16'))(_0x45a7('0x5b'));exports[_0x45a7('0x5c')]=function(_0x27cee5,_0x13be16,_0x11f8ad){var _0xb6b0a2={'agent':{},'channel':_0x45a7('0x5d')};if(_0x27cee5[_0x45a7('0x58')]['id']){delete _0x27cee5[_0x45a7('0x58')]['id'];}_0x27cee5[_0x45a7('0x58')][_0x45a7('0x5e')]=!![];_0x27cee5['body']['readAt']=moment()[_0x45a7('0x5f')](_0x45a7('0x60'));_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')]=_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')]||_0x27cee5['user']['id'];_0xb6b0a2[_0x45a7('0x62')]['id']=_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')];return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x27cee5['params']['id'],'UserId':null}})[_0x45a7('0x23')](handleEntityNotFound(_0x13be16,null))['then'](saveUpdates(_0x27cee5[_0x45a7('0x58')],null))['then'](function(_0x5b1687){if(_0x5b1687){_0xb6b0a2[_0x45a7('0x2b')]=_0x5b1687[_0x45a7('0x63')]({'plain':!![]});return db[_0x45a7('0x64')][_0x45a7('0x59')]({'where':{'id':_0x5b1687[_0x45a7('0x65')]}});}return null;})[_0x45a7('0x23')](handleEntityNotFound(_0x13be16,null))['then'](function(_0x283dcb){if(_0x283dcb){return _0x283dcb['update']({'UserId':_0x27cee5['body'][_0x45a7('0x61')],'read1stAt':_[_0x45a7('0x66')](_0x283dcb[_0x45a7('0x67')])?moment()[_0x45a7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x45a7('0x23')](function(_0x39d85b){if(_0x39d85b){_0xb6b0a2[_0x45a7('0x68')]=_0x39d85b[_0x45a7('0x63')]({'plain':!![]});interaction_log[_0x45a7('0x69')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x27cee5[_0x45a7('0x6a')]['id'],_0x27cee5['user']['name'],_0x27cee5[_0x45a7('0x6a')]['role'],_0xb6b0a2[_0x45a7('0x68')]['id'],_0x27cee5['body']?JSON[_0x45a7('0x28')](_0x27cee5[_0x45a7('0x58')]):'null');return respondWithRpcPromise(_0x45a7('0x6b'),_0x45a7('0x6c'),_0xb6b0a2);}return null;})[_0x45a7('0x23')](function(_0x14b546){var _0x339a58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14b546[_0x45a7('0x2b')][_0x45a7('0x6d')];return db[_0x45a7('0x6e')][_0x45a7('0x43')](_0x339a58,{'type':db[_0x45a7('0x6f')][_0x45a7('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x426638){return _0x426638;});})[_0x45a7('0x23')](function(_0x749dd9){if(_0x749dd9){_0xb6b0a2[_0x45a7('0x2b')][_0x45a7('0x71')]=_0x749dd9[0x0];if(!_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')])return;return db[_0x45a7('0x72')][_0x45a7('0x59')]({'where':{'id':_0x27cee5[_0x45a7('0x58')]['UserId'],'role':_0x45a7('0x62')},'attributes':['id','name',_0x45a7('0x73'),_0x45a7('0x74'),'internal'],'raw':!![]});}return null;})[_0x45a7('0x23')](function(_0x38921b){if(!_0x38921b)return null;_0xb6b0a2['message'][_0x45a7('0x62')]=_0x38921b;return _0xb6b0a2;})['then'](function(_0x528999){if(_0x528999){if(_0x27cee5[_0x45a7('0x58')][_0x45a7('0x75')]){_0xb6b0a2[_0x45a7('0x2b')][_0x45a7('0x76')]=util[_0x45a7('0x5f')]('SIP/%s',_0x27cee5[_0x45a7('0x6a')][_0x45a7('0x3a')]);_0xb6b0a2[_0x45a7('0x2b')]['channel']=_0xb6b0a2[_0x45a7('0x77')];_0xb6b0a2[_0x45a7('0x2b')]['motionChannel']=_0xb6b0a2[_0x45a7('0x77')];_0xb6b0a2['message'][_0x45a7('0x78')]=_0x45a7('0x5c');return respondWithRpcPromise(_0x45a7('0x79'),_0x45a7('0x79'),{'event':_0x45a7('0x7a'),'message':_[_0x45a7('0x4f')](_0xb6b0a2[_0x45a7('0x2b')],JSON[_0x45a7('0x7b')](_0xb6b0a2[_0x45a7('0x68')][_0x45a7('0x7c')]))},client9002)['then'](function(){return _0xb6b0a2;});}return _0xb6b0a2;}return null;})['then'](respondWithResult(_0x13be16,null))['catch'](handleError(_0x13be16,null));};var interaction_log=require(_0x45a7('0x16'))('chat-interactions');exports['reject']=function(_0x2d9c46,_0x31d9bf,_0x132016){var _0x43cc93={'agent':{},'channel':'chat'};if(_0x2d9c46[_0x45a7('0x58')]['id']){delete _0x2d9c46[_0x45a7('0x58')]['id'];}_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')]=_0x2d9c46['body'][_0x45a7('0x61')]||_0x2d9c46[_0x45a7('0x6a')]['id'];_0x43cc93[_0x45a7('0x62')]['id']=_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')];return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x2d9c46['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31d9bf,null))['then'](function(_0x2fc764){if(_0x2fc764){_0x43cc93[_0x45a7('0x2b')]=_0x2fc764[_0x45a7('0x63')]({'plain':!![]});return db[_0x45a7('0x64')][_0x45a7('0x59')]({'where':{'id':_0x2fc764[_0x45a7('0x65')]}});}return null;})[_0x45a7('0x23')](handleEntityNotFound(_0x31d9bf,null))[_0x45a7('0x23')](function(_0x1e6d45){if(_0x1e6d45){_0x43cc93[_0x45a7('0x68')]=_0x1e6d45[_0x45a7('0x63')]({'plain':!![]});interaction_log['info'](_0x45a7('0x7d'),_0x2d9c46[_0x45a7('0x6a')]['id'],_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x3a')],_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x7e')],_0x43cc93[_0x45a7('0x68')]['id'],_0x2d9c46[_0x45a7('0x58')]?JSON[_0x45a7('0x28')](_0x2d9c46[_0x45a7('0x58')]):_0x45a7('0x7f'));return respondWithRpcPromise(_0x45a7('0x80'),_0x45a7('0x81'),_0x43cc93);}return null;})[_0x45a7('0x23')](function(_0x2f9383){var _0x2fc6b5=_0x45a7('0x82')+_0x2f9383[_0x45a7('0x2b')][_0x45a7('0x6d')];return db['sequelize'][_0x45a7('0x43')](_0x2fc6b5,{'type':db['Sequelize'][_0x45a7('0x70')][_0x45a7('0x83')],'raw':!![]})[_0x45a7('0x23')](function(_0xbcc007){return _0xbcc007;});})[_0x45a7('0x23')](function(_0x420913){if(_0x420913){_0x43cc93[_0x45a7('0x2b')][_0x45a7('0x71')]=_0x420913[0x0];if(!_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')])return;return db[_0x45a7('0x72')][_0x45a7('0x59')]({'where':{'id':_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')],'role':'agent'},'attributes':['id',_0x45a7('0x3a'),'fullname',_0x45a7('0x74'),_0x45a7('0x84')],'raw':!![]});}return null;})[_0x45a7('0x23')](function(_0x2063e8){if(!_0x2063e8)return null;_0x43cc93[_0x45a7('0x2b')][_0x45a7('0x62')]=_0x2063e8;return _0x43cc93;})[_0x45a7('0x23')](function(_0x345652){if(_0x345652){_0x345652[_0x45a7('0x2b')][_0x45a7('0x76')]=util[_0x45a7('0x5f')](_0x45a7('0x85'),_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x3a')]);_0x345652[_0x45a7('0x2b')][_0x45a7('0x77')]=_0x43cc93['channel'];_0x345652[_0x45a7('0x2b')][_0x45a7('0x86')]=_0x43cc93[_0x45a7('0x77')];_0x345652[_0x45a7('0x2b')][_0x45a7('0x78')]=_0x45a7('0x35');respondWithRpcPromise(_0x45a7('0x79'),_0x45a7('0x79'),{'event':_0x45a7('0x87'),'message':_[_0x45a7('0x4f')](_0x43cc93[_0x45a7('0x2b')],JSON['parse'](_0x43cc93[_0x45a7('0x68')][_0x45a7('0x7c')]))},client9002);return _0x43cc93;}return null;})[_0x45a7('0x23')](respondWithResult(_0x31d9bf,null))[_0x45a7('0x2c')](handleError(_0x31d9bf,null));};
\ No newline at end of file
+var _0x57f8=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','find','create','body','describe','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','user','channel','motionChannel','EventManager','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47d3ce,_0x41ac2c){var _0xb7d1db=function(_0x13c8be){while(--_0x13c8be){_0x47d3ce['push'](_0x47d3ce['shift']());}};_0xb7d1db(++_0x41ac2c);}(_0x57f8,0x1e3));var _0x857f=function(_0xb31b62,_0x309405){_0xb31b62=_0xb31b62-0x0;var _0x3928ed=_0x57f8[_0xb31b62];return _0x3928ed;};'use strict';var emlformat=require(_0x857f('0x0'));var rimraf=require(_0x857f('0x1'));var zipdir=require(_0x857f('0x2'));var jsonpatch=require(_0x857f('0x3'));var rp=require(_0x857f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x857f('0x5'));var util=require(_0x857f('0x6'));var path=require(_0x857f('0x7'));var sox=require(_0x857f('0x8'));var csv=require('to-csv');var ejs=require(_0x857f('0x9'));var fs=require('fs');var fs_extra=require(_0x857f('0xa'));var _=require(_0x857f('0xb'));var squel=require(_0x857f('0xc'));var crypto=require(_0x857f('0xd'));var jsforce=require(_0x857f('0xe'));var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x857f('0x11'));var as=require(_0x857f('0x12'));var hardwareService=require(_0x857f('0x13'));var logger=require(_0x857f('0x14'))(_0x857f('0x15'));var utils=require(_0x857f('0x16'));var config=require(_0x857f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x857f('0x18'))['db'];config[_0x857f('0x19')]=_[_0x857f('0x1a')](config[_0x857f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x857f('0x1b'))(new Redis(config[_0x857f('0x19')]));require('./chatMessage.socket')[_0x857f('0x1c')](socket);var jayson=require(_0x857f('0x1d'));var client=jayson['client'][_0x857f('0x1e')]({'port':0x232c});var client9002=jayson[_0x857f('0x1f')][_0x857f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x138297,_0x370133,_0x12cae0,_0x578738){return new BPromise(function(_0x3324ec,_0x32ef3c){var _0x1d300e=_0x578738||client;return _0x1d300e['request'](_0x138297,_0x12cae0)[_0x857f('0x20')](function(_0x3cf807){logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));logger[_0x857f('0x24')](_0x857f('0x25'),_0x370133,_0x857f('0x23'),JSON['stringify'](_0x3cf807));if(_0x3cf807[_0x857f('0x26')]){if(_0x3cf807[_0x857f('0x26')][_0x857f('0x27')]===0x1f4){logger[_0x857f('0x26')]('ChatMessage,\x20%s,\x20%s',_0x370133,_0x3cf807['error']['message']);return _0x32ef3c(_0x3cf807['error'][_0x857f('0x28')]);}logger[_0x857f('0x26')](_0x857f('0x22'),_0x370133,_0x3cf807[_0x857f('0x26')][_0x857f('0x28')]);return _0x3324ec(_0x3cf807[_0x857f('0x26')]['message']);}else{logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));_0x3324ec(_0x3cf807[_0x857f('0x29')]['message']);}})[_0x857f('0x2a')](function(_0x79cd87){logger['error'](_0x857f('0x22'),_0x370133,_0x79cd87);_0x32ef3c(_0x79cd87);});});}function respondWithStatusCode(_0x5a3ba0,_0x33f220){_0x33f220=_0x33f220||0xcc;return function(_0x4b9dcc){if(_0x4b9dcc){return _0x5a3ba0[_0x857f('0x2b')](_0x33f220);}return _0x5a3ba0[_0x857f('0x2c')](_0x33f220)[_0x857f('0x2d')]();};}function respondWithResult(_0x36200b,_0x18edac){_0x18edac=_0x18edac||0xc8;return function(_0x347439){if(_0x347439){return _0x36200b['status'](_0x18edac)[_0x857f('0x2e')](_0x347439);}};}function respondWithFilteredResult(_0x4bb6e2,_0x377d40){return function(_0x13ec0e){if(_0x13ec0e){var _0x5e8c0f=typeof _0x377d40[_0x857f('0x2f')]==='undefined'&&typeof _0x377d40[_0x857f('0x30')]==='undefined';var _0x1cd2cd=_0x13ec0e[_0x857f('0x31')];var _0x57c6e2=_0x5e8c0f?0x0:_0x377d40[_0x857f('0x2f')];var _0x4342a3=_0x5e8c0f?_0x13ec0e['count']:_0x377d40[_0x857f('0x2f')]+_0x377d40['limit'];var _0x476ec5;if(_0x4342a3>=_0x1cd2cd){_0x4342a3=_0x1cd2cd;_0x476ec5=0xc8;}else{_0x476ec5=0xce;}_0x4bb6e2[_0x857f('0x2c')](_0x476ec5);return _0x4bb6e2[_0x857f('0x32')]('Content-Range',_0x57c6e2+'-'+_0x4342a3+'/'+_0x1cd2cd)[_0x857f('0x2e')](_0x13ec0e);}return null;};}function patchUpdates(_0x4989a6){return function(_0x4e574c){try{jsonpatch[_0x857f('0x33')](_0x4e574c,_0x4989a6,!![]);}catch(_0x5c8b2d){return BPromise[_0x857f('0x34')](_0x5c8b2d);}return _0x4e574c[_0x857f('0x35')]();};}function saveUpdates(_0x358320,_0x1b801b){return function(_0xc2c464){if(_0xc2c464){return _0xc2c464[_0x857f('0x36')](_0x358320)[_0x857f('0x20')](function(_0x4344b2){return _0x4344b2;});}return null;};}function removeEntity(_0x4a26cf,_0x245507){return function(_0x55c2bb){if(_0x55c2bb){return _0x55c2bb[_0x857f('0x37')]()[_0x857f('0x20')](function(){_0x4a26cf[_0x857f('0x2c')](0xcc)[_0x857f('0x2d')]();});}};}function handleEntityNotFound(_0x5d4c5c,_0x4177ef){return function(_0xf2ba3d){if(!_0xf2ba3d){_0x5d4c5c[_0x857f('0x2b')](0x194);}return _0xf2ba3d;};}function handleError(_0x1cdfed,_0x312935){_0x312935=_0x312935||0x1f4;return function(_0x3b5977){logger[_0x857f('0x26')](_0x3b5977[_0x857f('0x38')]);if(_0x3b5977['name']){delete _0x3b5977[_0x857f('0x39')];}_0x1cdfed[_0x857f('0x2c')](_0x312935)[_0x857f('0x3a')](_0x3b5977);};}exports[_0x857f('0x3b')]=function(_0x2e3626,_0x150871){var _0x190887={},_0x4b7931={},_0x14ec3c={'count':0x0,'rows':[]};var _0x178c69=_[_0x857f('0x3c')](db[_0x857f('0x3d')][_0x857f('0x3e')],function(_0x4212d2){return{'name':_0x4212d2[_0x857f('0x3f')],'type':_0x4212d2[_0x857f('0x40')][_0x857f('0x41')]};});_0x4b7931['model']=_[_0x857f('0x3c')](_0x178c69,_0x857f('0x39'));_0x4b7931[_0x857f('0x42')]=_[_0x857f('0x43')](_0x2e3626[_0x857f('0x42')]);_0x4b7931['filters']=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],_0x4b7931['query']);_0x190887[_0x857f('0x46')]=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],qs[_0x857f('0x47')](_0x2e3626[_0x857f('0x42')][_0x857f('0x47')]));_0x190887[_0x857f('0x46')]=_0x190887[_0x857f('0x46')][_0x857f('0x48')]?_0x190887[_0x857f('0x46')]:_0x4b7931[_0x857f('0x45')];if(!_0x2e3626[_0x857f('0x42')]['hasOwnProperty']('nolimit')){_0x190887[_0x857f('0x30')]=qs['limit'](_0x2e3626[_0x857f('0x42')][_0x857f('0x30')]);_0x190887[_0x857f('0x2f')]=qs['offset'](_0x2e3626[_0x857f('0x42')][_0x857f('0x2f')]);}_0x190887[_0x857f('0x49')]=qs[_0x857f('0x4a')](_0x2e3626['query'][_0x857f('0x4a')]);_0x190887[_0x857f('0x4b')]=qs[_0x857f('0x4c')](_[_0x857f('0x4d')](_0x2e3626['query'],_0x4b7931['filters']),_0x178c69);if(_0x2e3626['query'][_0x857f('0x4e')]){_0x190887[_0x857f('0x4b')]=_[_0x857f('0x4f')](_0x190887[_0x857f('0x4b')],{'$or':_[_0x857f('0x3c')](_0x178c69,function(_0x5c59c1){if(_0x5c59c1[_0x857f('0x40')]!==_0x857f('0x50')){var _0x4fb23e={};_0x4fb23e[_0x5c59c1[_0x857f('0x39')]]={'$like':'%'+_0x2e3626[_0x857f('0x42')][_0x857f('0x4e')]+'%'};return _0x4fb23e;}})});}_0x190887=_['merge']({},_0x190887,_0x2e3626[_0x857f('0x51')]);var _0x2a4112={'where':_0x190887[_0x857f('0x4b')]};return db[_0x857f('0x3d')][_0x857f('0x31')](_0x2a4112)[_0x857f('0x20')](function(_0x1b5317){_0x14ec3c[_0x857f('0x31')]=_0x1b5317;if(_0x2e3626[_0x857f('0x42')]['includeAll']){_0x190887[_0x857f('0x52')]=[{'all':!![]}];}return db[_0x857f('0x3d')]['findAll'](_0x190887);})[_0x857f('0x20')](function(_0x34380d){_0x14ec3c[_0x857f('0x53')]=_0x34380d;return _0x14ec3c;})[_0x857f('0x20')](respondWithFilteredResult(_0x150871,_0x190887))[_0x857f('0x2a')](handleError(_0x150871,null));};exports['show']=function(_0x42b2fc,_0x4a9c4e){var _0x1bac3c={'raw':!![],'where':{'id':_0x42b2fc[_0x857f('0x54')]['id']}},_0x430de6={};_0x430de6[_0x857f('0x45')]=_[_0x857f('0x43')](db['ChatMessage'][_0x857f('0x3e')]);_0x430de6[_0x857f('0x42')]=_['keys'](_0x42b2fc[_0x857f('0x42')]);_0x430de6[_0x857f('0x4c')]=_[_0x857f('0x44')](_0x430de6[_0x857f('0x45')],_0x430de6[_0x857f('0x42')]);_0x1bac3c[_0x857f('0x46')]=_[_0x857f('0x44')](_0x430de6['model'],qs[_0x857f('0x47')](_0x42b2fc['query'][_0x857f('0x47')]));_0x1bac3c[_0x857f('0x46')]=_0x1bac3c['attributes'][_0x857f('0x48')]?_0x1bac3c[_0x857f('0x46')]:_0x430de6[_0x857f('0x45')];if(_0x42b2fc['query']['includeAll']){_0x1bac3c[_0x857f('0x52')]=[{'all':!![]}];}_0x1bac3c=_[_0x857f('0x4f')]({},_0x1bac3c,_0x42b2fc[_0x857f('0x51')]);return db[_0x857f('0x3d')][_0x857f('0x55')](_0x1bac3c)[_0x857f('0x20')](handleEntityNotFound(_0x4a9c4e,null))[_0x857f('0x20')](respondWithResult(_0x4a9c4e,null))[_0x857f('0x2a')](handleError(_0x4a9c4e,null));};exports[_0x857f('0x56')]=function(_0x50e645,_0x1bd0aa){return db[_0x857f('0x3d')]['create'](_0x50e645[_0x857f('0x57')],{})['then'](respondWithResult(_0x1bd0aa,0xc9))[_0x857f('0x2a')](handleError(_0x1bd0aa,null));};exports[_0x857f('0x36')]=function(_0x4db953,_0x1ae91d){if(_0x4db953[_0x857f('0x57')]['id']){delete _0x4db953[_0x857f('0x57')]['id'];}return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x4db953[_0x857f('0x54')]['id']}})[_0x857f('0x20')](handleEntityNotFound(_0x1ae91d,null))[_0x857f('0x20')](saveUpdates(_0x4db953[_0x857f('0x57')],null))[_0x857f('0x20')](respondWithResult(_0x1ae91d,null))[_0x857f('0x2a')](handleError(_0x1ae91d,null));};exports['destroy']=function(_0x419d85,_0x361f6d){return db['ChatMessage'][_0x857f('0x55')]({'where':{'id':_0x419d85[_0x857f('0x54')]['id']}})['then'](handleEntityNotFound(_0x361f6d,null))[_0x857f('0x20')](removeEntity(_0x361f6d,null))[_0x857f('0x2a')](handleError(_0x361f6d,null));};exports['describe']=function(_0x1e00dd,_0x1dcc94){return db[_0x857f('0x3d')][_0x857f('0x58')]()[_0x857f('0x20')](respondWithResult(_0x1dcc94,null))[_0x857f('0x2a')](handleError(_0x1dcc94,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x21c6b1,_0x34fc5f,_0x21bbcb){var _0x39d5a5={'agent':{},'channel':_0x857f('0x59')};if(_0x21c6b1['body']['id']){delete _0x21c6b1[_0x857f('0x57')]['id'];}_0x21c6b1[_0x857f('0x57')][_0x857f('0x5a')]=!![];_0x21c6b1[_0x857f('0x57')][_0x857f('0x5b')]=moment()['format'](_0x857f('0x5c'));_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')]=_0x21c6b1['body'][_0x857f('0x5d')]||_0x21c6b1['user']['id'];_0x39d5a5[_0x857f('0x5e')]['id']=_0x21c6b1['body'][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x21c6b1[_0x857f('0x54')]['id'],'UserId':null}})[_0x857f('0x20')](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](saveUpdates(_0x21c6b1[_0x857f('0x57')],null))[_0x857f('0x20')](function(_0x1975b4){if(_0x1975b4){_0x39d5a5[_0x857f('0x28')]=_0x1975b4[_0x857f('0x5f')]({'plain':!![]});return db[_0x857f('0x60')][_0x857f('0x55')]({'where':{'id':_0x1975b4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](function(_0x3997b4){if(_0x3997b4){return _0x3997b4[_0x857f('0x36')]({'UserId':_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')],'read1stAt':_['isNil'](_0x3997b4['read1stAt'])?moment()[_0x857f('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x857f('0x20')](function(_0x2fc80a){if(_0x2fc80a){_0x39d5a5[_0x857f('0x62')]=_0x2fc80a['get']({'plain':!![]});interaction_log['info'](_0x857f('0x63'),_0x21c6b1['user']['id'],_0x21c6b1['user'][_0x857f('0x39')],_0x21c6b1['user'][_0x857f('0x64')],_0x39d5a5[_0x857f('0x62')]['id'],_0x21c6b1['body']?JSON[_0x857f('0x65')](_0x21c6b1[_0x857f('0x57')]):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x67'),_0x857f('0x68'),_0x39d5a5);}return null;})[_0x857f('0x20')](function(_0x732a1d){var _0x45fa9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x732a1d['message']['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x45fa9f,{'type':db['Sequelize'][_0x857f('0x6a')]['SELECT'],'raw':!![]})[_0x857f('0x20')](function(_0x497d7b){return _0x497d7b;});})[_0x857f('0x20')](function(_0x250b7b){if(_0x250b7b){_0x39d5a5[_0x857f('0x28')][_0x857f('0x6b')]=_0x250b7b[0x0];if(!_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')])return;return db[_0x857f('0x6c')][_0x857f('0x55')]({'where':{'id':_0x21c6b1['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id','name',_0x857f('0x6d'),_0x857f('0x6e'),_0x857f('0x6f')],'raw':!![]});}return null;})[_0x857f('0x20')](function(_0x1c417d){if(!_0x1c417d)return null;_0x39d5a5['message']['agent']=_0x1c417d;return _0x39d5a5;})[_0x857f('0x20')](function(_0x1f964d){if(_0x1f964d){if(_0x21c6b1[_0x857f('0x57')][_0x857f('0x70')]){_0x39d5a5['message'][_0x857f('0x71')]=util['format'](_0x857f('0x72'),_0x21c6b1[_0x857f('0x73')][_0x857f('0x39')]);_0x39d5a5[_0x857f('0x28')]['channel']=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')][_0x857f('0x75')]=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')]['event']='accept';return respondWithRpcPromise(_0x857f('0x76'),_0x857f('0x76'),{'event':'acceptmessage','message':_[_0x857f('0x4f')](_0x39d5a5[_0x857f('0x28')],JSON[_0x857f('0x77')](_0x39d5a5[_0x857f('0x62')][_0x857f('0x78')]))},client9002)['then'](function(){return _0x39d5a5;});}return _0x39d5a5;}return null;})[_0x857f('0x20')](respondWithResult(_0x34fc5f,null))[_0x857f('0x2a')](handleError(_0x34fc5f,null));};var interaction_log=require(_0x857f('0x14'))(_0x857f('0x79'));exports[_0x857f('0x34')]=function(_0x44126f,_0x27fc9e,_0x3eaaf5){var _0x46b0e4={'agent':{},'channel':'chat'};if(_0x44126f[_0x857f('0x57')]['id']){delete _0x44126f[_0x857f('0x57')]['id'];}_0x44126f[_0x857f('0x57')]['UserId']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')]||_0x44126f[_0x857f('0x73')]['id'];_0x46b0e4['agent']['id']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x44126f[_0x857f('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x16074a){if(_0x16074a){_0x46b0e4[_0x857f('0x28')]=_0x16074a['get']({'plain':!![]});return db[_0x857f('0x60')]['find']({'where':{'id':_0x16074a[_0x857f('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x11703d){if(_0x11703d){_0x46b0e4['interaction']=_0x11703d[_0x857f('0x5f')]({'plain':!![]});interaction_log[_0x857f('0x21')](_0x857f('0x7b'),_0x44126f[_0x857f('0x73')]['id'],_0x44126f['user'][_0x857f('0x39')],_0x44126f[_0x857f('0x73')][_0x857f('0x64')],_0x46b0e4[_0x857f('0x62')]['id'],_0x44126f['body']?JSON[_0x857f('0x65')](_0x44126f['body']):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x7c'),_0x857f('0x7d'),_0x46b0e4);}return null;})[_0x857f('0x20')](function(_0x23fb85){var _0x341a9d=_0x857f('0x7e')+_0x23fb85[_0x857f('0x28')]['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x341a9d,{'type':db[_0x857f('0x7f')][_0x857f('0x6a')][_0x857f('0x80')],'raw':!![]})[_0x857f('0x20')](function(_0x7ae6f4){return _0x7ae6f4;});})['then'](function(_0x20e078){if(_0x20e078){_0x46b0e4['message']['contact']=_0x20e078[0x0];if(!_0x44126f[_0x857f('0x57')][_0x857f('0x5d')])return;return db['User'][_0x857f('0x55')]({'where':{'id':_0x44126f['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id',_0x857f('0x39'),_0x857f('0x6d'),'email',_0x857f('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2ea1f5){if(!_0x2ea1f5)return null;_0x46b0e4['message'][_0x857f('0x5e')]=_0x2ea1f5;return _0x46b0e4;})[_0x857f('0x20')](function(_0x2f522f){if(_0x2f522f){_0x2f522f[_0x857f('0x28')][_0x857f('0x71')]=util[_0x857f('0x61')]('SIP/%s',_0x44126f['user'][_0x857f('0x39')]);_0x2f522f['message']['channel']=_0x46b0e4[_0x857f('0x74')];_0x2f522f[_0x857f('0x28')][_0x857f('0x75')]=_0x46b0e4['channel'];_0x2f522f[_0x857f('0x28')]['event']=_0x857f('0x34');respondWithRpcPromise('EventManager',_0x857f('0x76'),{'event':_0x857f('0x81'),'message':_[_0x857f('0x4f')](_0x46b0e4['message'],JSON[_0x857f('0x77')](_0x46b0e4[_0x857f('0x62')][_0x857f('0x78')]))},client9002);return _0x46b0e4;}return null;})[_0x857f('0x20')](respondWithResult(_0x27fc9e,null))[_0x857f('0x2a')](handleError(_0x27fc9e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5328c6f..75e6270 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 _0x127f=['../../mysqldb','save','remove','emit','exports','events'];(function(_0x1c3abe,_0x9f50b9){var _0x1ee64a=function(_0x4e351b){while(--_0x4e351b){_0x1c3abe['push'](_0x1c3abe['shift']());}};_0x1ee64a(++_0x9f50b9);}(_0x127f,0xa1));var _0xf127=function(_0x411e97,_0x4848d5){_0x411e97=_0x411e97-0x0;var _0x1498ad=_0x127f[_0x411e97];return _0x1498ad;};'use strict';var EventEmitter=require(_0xf127('0x0'));var ChatMessage=require(_0xf127('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf127('0x2'),'afterUpdate':'update','afterDestroy':_0xf127('0x3')};function emitEvent(_0x4022a7){return function(_0x10b0ff,_0x3c2995,_0x5af703){ChatMessageEvents[_0xf127('0x4')](_0x4022a7+':'+_0x10b0ff['id'],_0x10b0ff);ChatMessageEvents[_0xf127('0x4')](_0x4022a7,_0x10b0ff);_0x5af703(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf127('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x446a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x2ff7eb,_0x1564c0){var _0x4fbd3a=function(_0x53ab7f){while(--_0x53ab7f){_0x2ff7eb['push'](_0x2ff7eb['shift']());}};_0x4fbd3a(++_0x1564c0);}(_0x446a,0x145));var _0xa446=function(_0x5d56c5,_0x5899f5){_0x5d56c5=_0x5d56c5-0x0;var _0x1ae496=_0x446a[_0x5d56c5];return _0x1ae496;};'use strict';var EventEmitter=require(_0xa446('0x0'));var ChatMessage=require(_0xa446('0x1'))['db'][_0xa446('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa446('0x3')](0x0);var events={'afterCreate':_0xa446('0x4'),'afterUpdate':_0xa446('0x5'),'afterDestroy':_0xa446('0x6')};function emitEvent(_0x59c7f9){return function(_0x2c52dd,_0x57a898,_0x582a99){ChatMessageEvents[_0xa446('0x7')](_0x59c7f9+':'+_0x2c52dd['id'],_0x2c52dd);ChatMessageEvents[_0xa446('0x7')](_0x59c7f9,_0x2c52dd);_0x582a99(null);};}for(var e in events){if(events[_0xa446('0x8')](e)){var event=events[e];ChatMessage[_0xa446('0x9')](e,emitEvent(event));}}module[_0xa446('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 3e3d347..c72325f 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 _0x4fd9=['ChatInteraction','then','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x415e9c,_0x3e5a3c){var _0x44d2fc=function(_0x5d7de9){while(--_0x5d7de9){_0x415e9c['push'](_0x415e9c['shift']());}};_0x44d2fc(++_0x3e5a3c);}(_0x4fd9,0x6c));var _0x94fd=function(_0xa59696,_0x333d6f){_0xa59696=_0xa59696-0x0;var _0x1c67ae=_0x4fd9[_0xa59696];return _0x1c67ae;};'use strict';var _=require(_0x94fd('0x0'));var util=require('util');var logger=require(_0x94fd('0x1'))(_0x94fd('0x2'));var moment=require(_0x94fd('0x3'));var BPromise=require(_0x94fd('0x4'));var rp=require(_0x94fd('0x5'));var fs=require('fs');var path=require(_0x94fd('0x6'));var rimraf=require('rimraf');var config=require(_0x94fd('0x7'));var attributes=require(_0x94fd('0x8'));module[_0x94fd('0x9')]=function(_0x22479b,_0x676339){return _0x22479b['define'](_0x94fd('0xa'),attributes,{'tableName':_0x94fd('0xb'),'paranoid':![],'indexes':[{'name':_0x94fd('0xc'),'fields':[_0x94fd('0xd')],'type':_0x94fd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c3f4b,_0x37c6af,_0xf81e1e){var _0x22b06c=_0x22479b['models'];var _0x43c407=_0x2c3f4b[_0x94fd('0xf')]({'plain':!![]});if(_0x43c407['direction'][_0x94fd('0x10')]()==='in'||_0x43c407[_0x94fd('0x11')]['toLowerCase']()===_0x94fd('0x12')&&!_0x43c407[_0x94fd('0x13')]&&!_[_0x94fd('0x14')](_0x43c407[_0x94fd('0x15')])){_0x22b06c[_0x94fd('0x16')]['findOne']({'where':{'id':_0x43c407['ChatInteractionId']}})[_0x94fd('0x17')](function(_0x2f1799){if(_0x2f1799){_0x2f1799['update']({'lastMsgAt':_0x43c407['createdAt'],'lastMsgDirection':_0x43c407[_0x94fd('0x11')]['toLowerCase']()});}})['catch'](function(_0x4eef4f){console[_0x94fd('0x18')](_0x4eef4f);});}_0xf81e1e();}},'charset':'utf8mb4','collate':_0x94fd('0x19')});};
\ No newline at end of file
+var _0x4740=['body','FULLTEXT','models','get','direction','toLowerCase','UserId','ChatInteraction','then','update','catch','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x435e2f,_0x43f39d){var _0x4f128e=function(_0x51840c){while(--_0x51840c){_0x435e2f['push'](_0x435e2f['shift']());}};_0x4f128e(++_0x43f39d);}(_0x4740,0x1b5));var _0x0474=function(_0x3a9b94,_0x526b54){_0x3a9b94=_0x3a9b94-0x0;var _0x155e6d=_0x4740[_0x3a9b94];return _0x155e6d;};'use strict';var _=require(_0x0474('0x0'));var util=require(_0x0474('0x1'));var logger=require(_0x0474('0x2'))(_0x0474('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0474('0x4'));var fs=require('fs');var path=require(_0x0474('0x5'));var rimraf=require(_0x0474('0x6'));var config=require(_0x0474('0x7'));var attributes=require('./chatMessage.attributes');module[_0x0474('0x8')]=function(_0x20ac37,_0x36441d){return _0x20ac37[_0x0474('0x9')](_0x0474('0xa'),attributes,{'tableName':_0x0474('0xb'),'paranoid':![],'indexes':[{'name':_0x0474('0xc'),'fields':[_0x0474('0xd')],'type':_0x0474('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330906,_0x35ccbc,_0x504778){var _0x4d58e2=_0x20ac37[_0x0474('0xf')];var _0xec2803=_0x330906[_0x0474('0x10')]({'plain':!![]});if(_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='in'||_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='out'&&!_0xec2803['secret']&&!_['isNil'](_0xec2803[_0x0474('0x13')])){_0x4d58e2[_0x0474('0x14')]['findOne']({'where':{'id':_0xec2803['ChatInteractionId']}})[_0x0474('0x15')](function(_0x122829){if(_0x122829){_0x122829[_0x0474('0x16')]({'lastMsgAt':_0xec2803['createdAt'],'lastMsgDirection':_0xec2803[_0x0474('0x11')]['toLowerCase']()});}})[_0x0474('0x17')](function(_0x52f62c){console['error'](_0x52f62c);});}_0x504778();}},'charset':_0x0474('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b599b70..b8e5b3e 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 _0xd66e=['request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xd66e,0x1bf));var _0xed66=function(_0x195fbb,_0x3e7933){_0x195fbb=_0x195fbb-0x0;var _0x6c5304=_0xd66e[_0x195fbb];return _0x6c5304;};'use strict';var _=require('lodash');var util=require(_0xed66('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed66('0x1'));var fs=require('fs');var Redis=require(_0xed66('0x2'));var db=require(_0xed66('0x3'))['db'];var utils=require(_0xed66('0x4'));var logger=require(_0xed66('0x5'))(_0xed66('0x6'));var config=require(_0xed66('0x7'));var jayson=require(_0xed66('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xed66('0x9')]=_[_0xed66('0xa')](config[_0xed66('0x9')],{'host':_0xed66('0xb'),'port':0x18eb});var socket=require(_0xed66('0xc'))(new Redis(config[_0xed66('0x9')]));require(_0xed66('0xd'))[_0xed66('0xe')](socket);function respondWithRpcPromise(_0x49c5a0,_0x2aa6d3,_0x29ebc6){return new BPromise(function(_0xd526f1,_0x1d5132){return client[_0xed66('0xf')](_0x49c5a0,_0x29ebc6)[_0xed66('0x10')](function(_0x22d08b){logger[_0xed66('0x11')](_0xed66('0x12'),_0x2aa6d3,'request\x20sent');logger[_0xed66('0x13')](_0xed66('0x14'),_0x2aa6d3,'request\x20sent',JSON[_0xed66('0x15')](_0x22d08b));if(_0x22d08b[_0xed66('0x16')]){if(_0x22d08b[_0xed66('0x16')]['code']===0x1f4){logger[_0xed66('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2aa6d3,_0x22d08b['error'][_0xed66('0x17')]);return _0x1d5132(_0x22d08b['error'][_0xed66('0x17')]);}logger[_0xed66('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2aa6d3,_0x22d08b['error'][_0xed66('0x17')]);return _0xd526f1(_0x22d08b[_0xed66('0x16')]['message']);}else{logger[_0xed66('0x11')](_0xed66('0x12'),_0x2aa6d3,_0xed66('0x18'));_0xd526f1(_0x22d08b[_0xed66('0x19')][_0xed66('0x17')]);}})[_0xed66('0x1a')](function(_0x57d3a0){logger['error'](_0xed66('0x12'),_0x2aa6d3,_0x57d3a0);_0x1d5132(_0x57d3a0);});});}exports[_0xed66('0x1b')]=function(_0x703b63){var _0x23e5d4=this;return new Promise(function(_0x42a88f,_0x31d0ec){return db[_0xed66('0x1c')][_0xed66('0x1d')](_0x703b63[_0xed66('0x1e')],{'raw':_0x703b63['options']?_0x703b63[_0xed66('0x1f')][_0xed66('0x20')]===undefined?!![]:![]:!![]})[_0xed66('0x10')](function(_0x1fc607){logger['info'](_0xed66('0x1b'),_0x703b63);logger[_0xed66('0x13')](_0xed66('0x1b'),_0x703b63,JSON['stringify'](_0x1fc607));_0x42a88f(_0x1fc607);})[_0xed66('0x1a')](function(_0x261cad){logger[_0xed66('0x16')](_0xed66('0x1b'),_0x261cad[_0xed66('0x17')],_0x703b63);_0x31d0ec(_0x23e5d4['error'](0x1f4,_0x261cad[_0xed66('0x17')]));});});};
\ No newline at end of file
+var _0xa925=['debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','CreateChatMessage','ChatMessage','create','body','options','raw'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xa925,0x134));var _0x5a92=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa925[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x5a92('0x0'));var moment=require(_0x5a92('0x1'));var BPromise=require(_0x5a92('0x2'));var rs=require(_0x5a92('0x3'));var fs=require('fs');var Redis=require(_0x5a92('0x4'));var db=require(_0x5a92('0x5'))['db'];var utils=require(_0x5a92('0x6'));var logger=require(_0x5a92('0x7'))(_0x5a92('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a92('0x9'));var client=jayson['client'][_0x5a92('0xa')]({'port':0x232a});config['redis']=_[_0x5a92('0xb')](config[_0x5a92('0xc')],{'host':_0x5a92('0xd'),'port':0x18eb});var socket=require(_0x5a92('0xe'))(new Redis(config['redis']));require(_0x5a92('0xf'))[_0x5a92('0x10')](socket);function respondWithRpcPromise(_0x53373f,_0x275ccb,_0x4266ba){return new BPromise(function(_0x42b226,_0xfc11e6){return client[_0x5a92('0x11')](_0x53373f,_0x4266ba)[_0x5a92('0x12')](function(_0x4ab6c8){logger[_0x5a92('0x13')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x275ccb,_0x5a92('0x14'),JSON[_0x5a92('0x15')](_0x4ab6c8));if(_0x4ab6c8[_0x5a92('0x16')]){if(_0x4ab6c8[_0x5a92('0x16')][_0x5a92('0x17')]===0x1f4){logger[_0x5a92('0x16')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,_0x4ab6c8[_0x5a92('0x16')]['message']);return _0xfc11e6(_0x4ab6c8['error'][_0x5a92('0x18')]);}logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x4ab6c8['error'][_0x5a92('0x18')]);return _0x42b226(_0x4ab6c8['error'][_0x5a92('0x18')]);}else{logger['info'](_0x5a92('0x19'),_0x275ccb,_0x5a92('0x14'));_0x42b226(_0x4ab6c8['result'][_0x5a92('0x18')]);}})['catch'](function(_0x108a13){logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x108a13);_0xfc11e6(_0x108a13);});});}exports[_0x5a92('0x1a')]=function(_0x2c7033){var _0x2d7817=this;return new Promise(function(_0x55fdd9,_0x1ccb14){return db[_0x5a92('0x1b')][_0x5a92('0x1c')](_0x2c7033[_0x5a92('0x1d')],{'raw':_0x2c7033[_0x5a92('0x1e')]?_0x2c7033[_0x5a92('0x1e')][_0x5a92('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x377c92){logger[_0x5a92('0x13')]('CreateChatMessage',_0x2c7033);logger[_0x5a92('0x20')]('CreateChatMessage',_0x2c7033,JSON[_0x5a92('0x15')](_0x377c92));_0x55fdd9(_0x377c92);})[_0x5a92('0x21')](function(_0x4ab4a7){logger[_0x5a92('0x16')](_0x5a92('0x1a'),_0x4ab4a7[_0x5a92('0x18')],_0x2c7033);_0x1ccb14(_0x2d7817[_0x5a92('0x16')](0x1f4,_0x4ab4a7[_0x5a92('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 7ccc9d5..b70b716 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 _0xc949=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x46f153,_0x8061fd){var _0x43b848=function(_0x5deddf){while(--_0x5deddf){_0x46f153['push'](_0x46f153['shift']());}};_0x43b848(++_0x8061fd);}(_0xc949,0x181));var _0x9c94=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc949[_0x47a7d0];return _0xb9bd08;};'use strict';var ChatMessageEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){ChatMessageEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);ChatMessageEvents['on'](_0x360e7b,_0x25ecd0);}};
\ No newline at end of file
+var _0x27c5=['update','emit','removeListener','register','chatMessage:','remove'];(function(_0x592109,_0x10d79a){var _0x328ecd=function(_0x320091){while(--_0x320091){_0x592109['push'](_0x592109['shift']());}};_0x328ecd(++_0x10d79a);}(_0x27c5,0x173));var _0x527c=function(_0x3c49b2,_0x285e48){_0x3c49b2=_0x3c49b2-0x0;var _0x2d9203=_0x27c5[_0x3c49b2];return _0x2d9203;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x527c('0x0'),_0x527c('0x1')];function createListener(_0xd193d0,_0x5771e6){return function(_0x1a35ed){_0x5771e6[_0x527c('0x2')](_0xd193d0,_0x1a35ed);};}function removeListener(_0x371ae5,_0x45478a){return function(){ChatMessageEvents[_0x527c('0x3')](_0x371ae5,_0x45478a);};}exports[_0x527c('0x4')]=function(_0x37bd95){for(var _0x552d9b=0x0,_0x18c413=events['length'];_0x552d9b<_0x18c413;_0x552d9b++){var _0x2db820=events[_0x552d9b];var _0x5e07ba=createListener(_0x527c('0x5')+_0x2db820,_0x37bd95);ChatMessageEvents['on'](_0x2db820,_0x5e07ba);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ddf4f6d..e9822e6 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 _0x607d=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','show','post','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','delete'];(function(_0x529c6a,_0x1b6bbf){var _0x4ca96a=function(_0x1f0dc9){while(--_0x1f0dc9){_0x529c6a['push'](_0x529c6a['shift']());}};_0x4ca96a(++_0x1b6bbf);}(_0x607d,0x1e4));var _0xd607=function(_0x1b9c13,_0x5a7224){_0x1b9c13=_0x1b9c13-0x0;var _0x57cabe=_0x607d[_0x1b9c13];return _0x57cabe;};'use strict';var multer=require('multer');var util=require(_0xd607('0x0'));var path=require(_0xd607('0x1'));var timeout=require(_0xd607('0x2'));var express=require(_0xd607('0x3'));var router=express['Router']();var fs_extra=require(_0xd607('0x4'));var auth=require(_0xd607('0x5'));var interaction=require(_0xd607('0x6'));var config=require('../../config/environment');var controller=require(_0xd607('0x7'));router['get']('/',auth[_0xd607('0x8')](),controller[_0xd607('0x9')]);router[_0xd607('0xa')](_0xd607('0xb'),auth[_0xd607('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd607('0x8')](),controller[_0xd607('0xc')]);router[_0xd607('0xd')]('/',auth[_0xd607('0x8')](),interaction['tracked']('chat',_0xd607('0xe')),controller[_0xd607('0xf')]);router[_0xd607('0x10')](_0xd607('0x11'),controller['update']);router[_0xd607('0x10')](_0xd607('0x12'),auth[_0xd607('0x8')](),controller['accept']);router['put'](_0xd607('0x13'),auth[_0xd607('0x8')](),controller[_0xd607('0x14')]);router[_0xd607('0x15')](_0xd607('0x11'),auth[_0xd607('0x8')](),controller['destroy']);module[_0xd607('0x16')]=router;
\ No newline at end of file
+var _0x1b02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x1b02,0xe2));var _0x21b0=function(_0x49dd26,_0x9e5a5d){_0x49dd26=_0x49dd26-0x0;var _0x45f549=_0x1b02[_0x49dd26];return _0x45f549;};'use strict';var multer=require(_0x21b0('0x0'));var util=require(_0x21b0('0x1'));var path=require(_0x21b0('0x2'));var timeout=require(_0x21b0('0x3'));var express=require(_0x21b0('0x4'));var router=express[_0x21b0('0x5')]();var fs_extra=require(_0x21b0('0x6'));var auth=require(_0x21b0('0x7'));var interaction=require(_0x21b0('0x8'));var config=require(_0x21b0('0x9'));var controller=require(_0x21b0('0xa'));router[_0x21b0('0xb')]('/',auth['isAuthenticated'](),controller[_0x21b0('0xc')]);router[_0x21b0('0xb')](_0x21b0('0xd'),auth['isAuthenticated'](),controller[_0x21b0('0xe')]);router[_0x21b0('0xb')](_0x21b0('0xf'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x11')]);router['post']('/',auth[_0x21b0('0x10')](),interaction[_0x21b0('0x12')]('chat',_0x21b0('0x13')),controller[_0x21b0('0x14')]);router[_0x21b0('0x15')]('/:id',controller[_0x21b0('0x16')]);router[_0x21b0('0x15')](_0x21b0('0x17'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x18')]);router['put'](_0x21b0('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x21b0('0x1a')]('/:id',auth[_0x21b0('0x10')](),controller[_0x21b0('0x1b')]);module[_0x21b0('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 5acc3dc..3a215d8 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 _0x15c6=['medium','exports'];(function(_0x1f2f9f,_0x52b1a5){var _0x20c387=function(_0x42e3ba){while(--_0x42e3ba){_0x1f2f9f['push'](_0x1f2f9f['shift']());}};_0x20c387(++_0x52b1a5);}(_0x15c6,0xf3));var _0x615c=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x15c6[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0x615c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x615c('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x976c=['exports','TEXT','medium'];(function(_0x464597,_0x4b3ab0){var _0x227f22=function(_0x4ec014){while(--_0x4ec014){_0x464597['push'](_0x464597['shift']());}};_0x227f22(++_0x4b3ab0);}(_0x976c,0x72));var _0xc976=function(_0x5b47e1,_0x159b15){_0x5b47e1=_0x5b47e1-0x0;var _0x572a56=_0x976c[_0x5b47e1];return _0x572a56;};'use strict';var Sequelize=require('sequelize');module[_0xc976('0x0')]={'body':{'type':Sequelize[_0xc976('0x1')](_0xc976('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 37b022a..48d24e9 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(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd943,_0x4fb6f9){_0x1fd943=_0x1fd943-0x0;var _0x2f324f=_0x7a54[_0x1fd943];return _0x2f324f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x21ff2d,_0x375e29){_0x21ff2d=_0x21ff2d-0x0;var _0x495eae=_0x7a54[_0x21ff2d];return _0x495eae;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 9f4617a..9d9c0a0 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 _0xdb60=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0xddeac9,_0x2ebf8c){var _0x65fa72=function(_0x795e4f){while(--_0x795e4f){_0xddeac9['push'](_0xddeac9['shift']());}};_0x65fa72(++_0x2ebf8c);}(_0xdb60,0x6c));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0db6('0x0'));var util=require(_0x0db6('0x1'));var logger=require(_0x0db6('0x2'))(_0x0db6('0x3'));var moment=require(_0x0db6('0x4'));var BPromise=require(_0x0db6('0x5'));var rp=require(_0x0db6('0x6'));var fs=require('fs');var path=require(_0x0db6('0x7'));var rimraf=require('rimraf');var config=require(_0x0db6('0x8'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x43c8c0,_0x1f54be){return _0x43c8c0['define'](_0x0db6('0x9'),attributes,{'tableName':_0x0db6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0db6('0xb')});};
\ No newline at end of file
+var _0x949b=['ChatOfflineMessage','lodash','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0x949b,0x88));var _0xb949=function(_0x8c4b43,_0xd43984){_0x8c4b43=_0x8c4b43-0x0;var _0x56cf12=_0x949b[_0x8c4b43];return _0x56cf12;};'use strict';var _=require(_0xb949('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb949('0x1'));var moment=require('moment');var BPromise=require(_0xb949('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb949('0x3'));var rimraf=require('rimraf');var config=require(_0xb949('0x4'));var attributes=require(_0xb949('0x5'));module[_0xb949('0x6')]=function(_0x18dbc9,_0x3f200f){return _0x18dbc9[_0xb949('0x7')](_0xb949('0x8'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index e63a87b..4a1d666 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 _0x9937=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','../../config/utils'];(function(_0x3fceca,_0x1e7b3c){var _0x4c992a=function(_0x509d6d){while(--_0x509d6d){_0x3fceca['push'](_0x3fceca['shift']());}};_0x4c992a(++_0x1e7b3c);}(_0x9937,0x164));var _0x7993=function(_0x4950f3,_0xcb3c1a){_0x4950f3=_0x4950f3-0x0;var _0x2a429f=_0x9937[_0x4950f3];return _0x2a429f;};'use strict';var _=require('lodash');var util=require(_0x7993('0x0'));var moment=require(_0x7993('0x1'));var BPromise=require('bluebird');var rs=require(_0x7993('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7993('0x3'));var logger=require('../../config/logger')(_0x7993('0x4'));var config=require(_0x7993('0x5'));var jayson=require(_0x7993('0x6'));var client=jayson[_0x7993('0x7')][_0x7993('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17f22b,_0x1b6ea9,_0x268ce6){return new BPromise(function(_0x1bb54b,_0x540b5d){return client[_0x7993('0x9')](_0x17f22b,_0x268ce6)[_0x7993('0xa')](function(_0x3847c7){logger[_0x7993('0xb')](_0x7993('0xc'),_0x1b6ea9,_0x7993('0xd'));logger[_0x7993('0xe')](_0x7993('0xf'),_0x1b6ea9,_0x7993('0xd'),JSON['stringify'](_0x3847c7));if(_0x3847c7[_0x7993('0x10')]){if(_0x3847c7[_0x7993('0x10')][_0x7993('0x11')]===0x1f4){logger['error'](_0x7993('0xc'),_0x1b6ea9,_0x3847c7[_0x7993('0x10')][_0x7993('0x12')]);return _0x540b5d(_0x3847c7[_0x7993('0x10')][_0x7993('0x12')]);}logger[_0x7993('0x10')](_0x7993('0xc'),_0x1b6ea9,_0x3847c7[_0x7993('0x10')]['message']);return _0x1bb54b(_0x3847c7[_0x7993('0x10')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x1b6ea9,_0x7993('0xd'));_0x1bb54b(_0x3847c7['result']['message']);}})[_0x7993('0x13')](function(_0x3082ab){logger[_0x7993('0x10')](_0x7993('0xc'),_0x1b6ea9,_0x3082ab);_0x540b5d(_0x3082ab);});});}
\ No newline at end of file
+var _0x02df=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4da447,_0x201307){var _0x11c06f=function(_0x79f49e){while(--_0x79f49e){_0x4da447['push'](_0x4da447['shift']());}};_0x11c06f(++_0x201307);}(_0x02df,0x128));var _0xf02d=function(_0x23010f,_0x8fe0e1){_0x23010f=_0x23010f-0x0;var _0x2a445e=_0x02df[_0x23010f];return _0x2a445e;};'use strict';var _=require(_0xf02d('0x0'));var util=require(_0xf02d('0x1'));var moment=require(_0xf02d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf02d('0x3'));var fs=require('fs');var Redis=require(_0xf02d('0x4'));var db=require(_0xf02d('0x5'))['db'];var utils=require(_0xf02d('0x6'));var logger=require(_0xf02d('0x7'))(_0xf02d('0x8'));var config=require(_0xf02d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf02d('0xa')][_0xf02d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe72fc1,_0x446feb,_0x189612){return new BPromise(function(_0x3ae48b,_0x47217e){return client['request'](_0xe72fc1,_0x189612)[_0xf02d('0xc')](function(_0x13e0fb){logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,_0xf02d('0xf'));logger[_0xf02d('0x10')](_0xf02d('0x11'),_0x446feb,_0xf02d('0xf'),JSON[_0xf02d('0x12')](_0x13e0fb));if(_0x13e0fb[_0xf02d('0x13')]){if(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x14')]===0x1f4){logger[_0xf02d('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x446feb,_0x13e0fb[_0xf02d('0x13')]['message']);return _0x47217e(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);}logger[_0xf02d('0x13')](_0xf02d('0xe'),_0x446feb,_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);return _0x3ae48b(_0x13e0fb['error'][_0xf02d('0x15')]);}else{logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,'request\x20sent');_0x3ae48b(_0x13e0fb[_0xf02d('0x16')][_0xf02d('0x15')]);}})[_0xf02d('0x17')](function(_0x36142e){logger['error'](_0xf02d('0xe'),_0x446feb,_0x36142e);_0x47217e(_0x36142e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 64fc549..c9899e4 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 _0xa299=['show','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa299,0xce));var _0x9a29=function(_0x383576,_0xeab5ba){_0x383576=_0x383576-0x0;var _0x31fb1c=_0xa299[_0x383576];return _0x31fb1c;};'use strict';var multer=require(_0x9a29('0x0'));var util=require(_0x9a29('0x1'));var path=require(_0x9a29('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a29('0x3'));var router=express[_0x9a29('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a29('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a29('0x6'));var controller=require(_0x9a29('0x7'));router[_0x9a29('0x8')]('/',auth[_0x9a29('0x9')](),controller['index']);router[_0x9a29('0x8')]('/describe',auth[_0x9a29('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9a29('0xa')]);router[_0x9a29('0xb')]('/',auth[_0x9a29('0x9')](),controller['create']);router[_0x9a29('0xc')](_0x9a29('0xd'),auth[_0x9a29('0x9')](),controller[_0x9a29('0xe')]);router[_0x9a29('0xf')]('/:id',auth[_0x9a29('0x9')](),controller[_0x9a29('0x10')]);module[_0x9a29('0x11')]=router;
\ No newline at end of file
+var _0x59c3=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','show','post','/:id','destroy'];(function(_0x5e7095,_0x3418ac){var _0x3f4f9e=function(_0x258627){while(--_0x258627){_0x5e7095['push'](_0x5e7095['shift']());}};_0x3f4f9e(++_0x3418ac);}(_0x59c3,0x120));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0x359c('0x0'));var path=require(_0x359c('0x1'));var timeout=require('connect-timeout');var express=require(_0x359c('0x2'));var router=express[_0x359c('0x3')]();var fs_extra=require(_0x359c('0x4'));var auth=require(_0x359c('0x5'));var interaction=require(_0x359c('0x6'));var config=require(_0x359c('0x7'));var controller=require(_0x359c('0x8'));router[_0x359c('0x9')]('/',auth[_0x359c('0xa')](),controller['index']);router['get']('/describe',auth[_0x359c('0xa')](),controller[_0x359c('0xb')]);router[_0x359c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x359c('0xc')]);router[_0x359c('0xd')]('/',auth[_0x359c('0xa')](),controller['create']);router['put']('/:id',auth[_0x359c('0xa')](),controller['update']);router['delete'](_0x359c('0xe'),auth[_0x359c('0xa')](),controller[_0x359c('0xf')]);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 6088fa8..ed60fc7 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 _0xfa1e=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x49d45b,_0x58b1b8){var _0x16f8b3=function(_0x22a1ba){while(--_0x22a1ba){_0x49d45b['push'](_0x49d45b['shift']());}};_0x16f8b3(++_0x58b1b8);}(_0xfa1e,0xf5));var _0xefa1=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xfa1e[_0xdeefbd];return _0x4ff63f;};'use strict';var Sequelize=require(_0xefa1('0x0'));module['exports']={'name':{'type':Sequelize[_0xefa1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xefa1('0x2')](_0xefa1('0x3'),_0xefa1('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xefa1('0x5')]}};
\ No newline at end of file
+var _0x935e=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x935e,0xac));var _0xe935=function(_0x1230e5,_0x1a98be){_0x1230e5=_0x1230e5-0x0;var _0x564c99=_0x935e[_0x1230e5];return _0x564c99;};'use strict';var Sequelize=require(_0xe935('0x0'));module[_0xe935('0x1')]={'name':{'type':Sequelize[_0xe935('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe935('0x3')](_0xe935('0x4'),_0xe935('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe935('0x2')]},'timeout':{'type':Sequelize[_0xe935('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 439a115..794dd2c 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 _0x3fc6=['sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','include','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x145fff,_0x110a35){var _0x2ec362=function(_0x4d901f){while(--_0x4d901f){_0x145fff['push'](_0x145fff['shift']());}};_0x2ec362(++_0x110a35);}(_0x3fc6,0x159));var _0x63fc=function(_0x38d288,_0x100d8f){_0x38d288=_0x38d288-0x0;var _0x1ae855=_0x3fc6[_0x38d288];return _0x1ae855;};'use strict';var emlformat=require(_0x63fc('0x0'));var rimraf=require(_0x63fc('0x1'));var zipdir=require(_0x63fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63fc('0x3'));var moment=require(_0x63fc('0x4'));var BPromise=require(_0x63fc('0x5'));var Mustache=require(_0x63fc('0x6'));var util=require(_0x63fc('0x7'));var path=require(_0x63fc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63fc('0x9'));var fs=require('fs');var fs_extra=require(_0x63fc('0xa'));var _=require(_0x63fc('0xb'));var squel=require('squel');var crypto=require(_0x63fc('0xc'));var jsforce=require(_0x63fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x63fc('0xe'));var querystring=require(_0x63fc('0xf'));var Papa=require(_0x63fc('0x10'));var Redis=require(_0x63fc('0x11'));var authService=require(_0x63fc('0x12'));var qs=require(_0x63fc('0x13'));var as=require(_0x63fc('0x14'));var hardwareService=require(_0x63fc('0x15'));var logger=require(_0x63fc('0x16'))(_0x63fc('0x17'));var utils=require('../../config/utils');var config=require(_0x63fc('0x18'));var licenseUtil=require(_0x63fc('0x19'));var db=require(_0x63fc('0x1a'))['db'];function respondWithStatusCode(_0x4cdde1,_0x493528){_0x493528=_0x493528||0xcc;return function(_0x293c4c){if(_0x293c4c){return _0x4cdde1[_0x63fc('0x1b')](_0x493528);}return _0x4cdde1[_0x63fc('0x1c')](_0x493528)[_0x63fc('0x1d')]();};}function respondWithResult(_0xed9cc1,_0x1bcf57){_0x1bcf57=_0x1bcf57||0xc8;return function(_0x4ebbbf){if(_0x4ebbbf){return _0xed9cc1[_0x63fc('0x1c')](_0x1bcf57)[_0x63fc('0x1e')](_0x4ebbbf);}};}function respondWithFilteredResult(_0x46926d,_0x337192){return function(_0x5c4c72){if(_0x5c4c72){var _0x3cd826=typeof _0x337192['offset']===_0x63fc('0x1f')&&typeof _0x337192[_0x63fc('0x20')]===_0x63fc('0x1f');var _0x42ef5e=_0x5c4c72[_0x63fc('0x21')];var _0x5e0630=_0x3cd826?0x0:_0x337192[_0x63fc('0x22')];var _0x71ad1d=_0x3cd826?_0x5c4c72[_0x63fc('0x21')]:_0x337192['offset']+_0x337192['limit'];var _0x6e1361;if(_0x71ad1d>=_0x42ef5e){_0x71ad1d=_0x42ef5e;_0x6e1361=0xc8;}else{_0x6e1361=0xce;}_0x46926d[_0x63fc('0x1c')](_0x6e1361);return _0x46926d['set'](_0x63fc('0x23'),_0x5e0630+'-'+_0x71ad1d+'/'+_0x42ef5e)['json'](_0x5c4c72);}return null;};}function patchUpdates(_0x1c2198){return function(_0x2c6d11){try{jsonpatch[_0x63fc('0x24')](_0x2c6d11,_0x1c2198,!![]);}catch(_0x40ae7a){return BPromise[_0x63fc('0x25')](_0x40ae7a);}return _0x2c6d11[_0x63fc('0x26')]();};}function saveUpdates(_0x3047cf,_0x57528b){return function(_0x2e991e){if(_0x2e991e){return _0x2e991e[_0x63fc('0x27')](_0x3047cf)[_0x63fc('0x28')](function(_0x1dcec0){return _0x1dcec0;});}return null;};}function removeEntity(_0x2dd713,_0x561c9b){return function(_0x4f6498){if(_0x4f6498){return _0x4f6498[_0x63fc('0x29')]()[_0x63fc('0x28')](function(){_0x2dd713[_0x63fc('0x1c')](0xcc)[_0x63fc('0x1d')]();});}};}function handleEntityNotFound(_0x59b130,_0x184b80){return function(_0x3af124){if(!_0x3af124){_0x59b130[_0x63fc('0x1b')](0x194);}return _0x3af124;};}function handleError(_0x2d1dc3,_0x3d7b61){_0x3d7b61=_0x3d7b61||0x1f4;return function(_0x390f41){logger[_0x63fc('0x2a')](_0x390f41[_0x63fc('0x2b')]);if(_0x390f41['name']){delete _0x390f41['name'];}_0x2d1dc3[_0x63fc('0x1c')](_0x3d7b61)[_0x63fc('0x2c')](_0x390f41);};}exports['show']=function(_0x53e3c6,_0x5ace6f){var _0x3bb029={'raw':!![],'where':{'id':_0x53e3c6[_0x63fc('0x2d')]['id']}},_0x17c0fd={};_0x17c0fd[_0x63fc('0x2e')]=_[_0x63fc('0x2f')](db[_0x63fc('0x30')][_0x63fc('0x31')]);_0x17c0fd['query']=_[_0x63fc('0x2f')](_0x53e3c6[_0x63fc('0x32')]);_0x17c0fd['filters']=_[_0x63fc('0x33')](_0x17c0fd[_0x63fc('0x2e')],_0x17c0fd[_0x63fc('0x32')]);_0x3bb029['attributes']=_[_0x63fc('0x33')](_0x17c0fd['model'],qs[_0x63fc('0x34')](_0x53e3c6[_0x63fc('0x32')][_0x63fc('0x34')]));_0x3bb029['attributes']=_0x3bb029[_0x63fc('0x35')][_0x63fc('0x36')]?_0x3bb029[_0x63fc('0x35')]:_0x17c0fd['model'];if(_0x53e3c6[_0x63fc('0x32')]['includeAll']){_0x3bb029[_0x63fc('0x37')]=[{'all':!![]}];}_0x3bb029=_[_0x63fc('0x38')]({},_0x3bb029,_0x53e3c6[_0x63fc('0x39')]);return db['ChatProactiveAction'][_0x63fc('0x3a')](_0x3bb029)[_0x63fc('0x28')](handleEntityNotFound(_0x5ace6f,null))[_0x63fc('0x28')](respondWithResult(_0x5ace6f,null))['catch'](handleError(_0x5ace6f,null));};exports[_0x63fc('0x3b')]=function(_0x57df97,_0x168d8d){return db[_0x63fc('0x30')]['create'](_0x57df97[_0x63fc('0x3c')],{})[_0x63fc('0x28')](respondWithResult(_0x168d8d,0xc9))['catch'](handleError(_0x168d8d,null));};exports[_0x63fc('0x27')]=function(_0x48c3ca,_0x4de243){if(_0x48c3ca['body']['id']){delete _0x48c3ca['body']['id'];}return db[_0x63fc('0x30')][_0x63fc('0x3a')]({'where':{'id':_0x48c3ca[_0x63fc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4de243,null))[_0x63fc('0x28')](saveUpdates(_0x48c3ca[_0x63fc('0x3c')],null))['then'](respondWithResult(_0x4de243,null))['catch'](handleError(_0x4de243,null));};exports[_0x63fc('0x29')]=function(_0x16552e,_0x516e71){return db[_0x63fc('0x30')][_0x63fc('0x3a')]({'where':{'id':_0x16552e['params']['id']}})['then'](handleEntityNotFound(_0x516e71,null))[_0x63fc('0x28')](removeEntity(_0x516e71,null))[_0x63fc('0x3d')](handleError(_0x516e71,null));};
\ No newline at end of file
+var _0xf776=['include','merge','ChatProactiveAction','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','update','then','destroy','error','stack','name','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x272bf3,_0x2226b6){var _0x33c087=function(_0x4b9467){while(--_0x4b9467){_0x272bf3['push'](_0x272bf3['shift']());}};_0x33c087(++_0x2226b6);}(_0xf776,0x169));var _0x6f77=function(_0x4100e5,_0x4656a1){_0x4100e5=_0x4100e5-0x0;var _0x5663cf=_0xf776[_0x4100e5];return _0x5663cf;};'use strict';var emlformat=require(_0x6f77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f77('0x1'));var jsonpatch=require(_0x6f77('0x2'));var rp=require('request-promise');var moment=require(_0x6f77('0x3'));var BPromise=require(_0x6f77('0x4'));var Mustache=require(_0x6f77('0x5'));var util=require(_0x6f77('0x6'));var path=require('path');var sox=require(_0x6f77('0x7'));var csv=require('to-csv');var ejs=require(_0x6f77('0x8'));var fs=require('fs');var fs_extra=require(_0x6f77('0x9'));var _=require(_0x6f77('0xa'));var squel=require(_0x6f77('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f77('0xd'));var querystring=require(_0x6f77('0xe'));var Papa=require(_0x6f77('0xf'));var Redis=require(_0x6f77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6f77('0x11'));var as=require(_0x6f77('0x12'));var hardwareService=require(_0x6f77('0x13'));var logger=require(_0x6f77('0x14'))(_0x6f77('0x15'));var utils=require(_0x6f77('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6f77('0x17'));var db=require(_0x6f77('0x18'))['db'];function respondWithStatusCode(_0x150260,_0x17fda5){_0x17fda5=_0x17fda5||0xcc;return function(_0x413e19){if(_0x413e19){return _0x150260[_0x6f77('0x19')](_0x17fda5);}return _0x150260[_0x6f77('0x1a')](_0x17fda5)[_0x6f77('0x1b')]();};}function respondWithResult(_0x34547,_0x28e354){_0x28e354=_0x28e354||0xc8;return function(_0x386c51){if(_0x386c51){return _0x34547[_0x6f77('0x1a')](_0x28e354)['json'](_0x386c51);}};}function respondWithFilteredResult(_0x48c26c,_0x17c0a5){return function(_0x2b9b87){if(_0x2b9b87){var _0x5cf3b9=typeof _0x17c0a5[_0x6f77('0x1c')]==='undefined'&&typeof _0x17c0a5[_0x6f77('0x1d')]===_0x6f77('0x1e');var _0x531908=_0x2b9b87['count'];var _0x42f774=_0x5cf3b9?0x0:_0x17c0a5[_0x6f77('0x1c')];var _0x128e84=_0x5cf3b9?_0x2b9b87[_0x6f77('0x1f')]:_0x17c0a5[_0x6f77('0x1c')]+_0x17c0a5[_0x6f77('0x1d')];var _0x3f9943;if(_0x128e84>=_0x531908){_0x128e84=_0x531908;_0x3f9943=0xc8;}else{_0x3f9943=0xce;}_0x48c26c[_0x6f77('0x1a')](_0x3f9943);return _0x48c26c['set'](_0x6f77('0x20'),_0x42f774+'-'+_0x128e84+'/'+_0x531908)[_0x6f77('0x21')](_0x2b9b87);}return null;};}function patchUpdates(_0x3ce6ad){return function(_0x5298e2){try{jsonpatch['apply'](_0x5298e2,_0x3ce6ad,!![]);}catch(_0x499678){return BPromise[_0x6f77('0x22')](_0x499678);}return _0x5298e2['save']();};}function saveUpdates(_0x142416,_0x2d7970){return function(_0x494765){if(_0x494765){return _0x494765[_0x6f77('0x23')](_0x142416)[_0x6f77('0x24')](function(_0x2df95d){return _0x2df95d;});}return null;};}function removeEntity(_0x292ddc,_0x2c0cb2){return function(_0x5e09d6){if(_0x5e09d6){return _0x5e09d6[_0x6f77('0x25')]()[_0x6f77('0x24')](function(){_0x292ddc[_0x6f77('0x1a')](0xcc)[_0x6f77('0x1b')]();});}};}function handleEntityNotFound(_0x2a8a41,_0x12c392){return function(_0x2a907d){if(!_0x2a907d){_0x2a8a41['sendStatus'](0x194);}return _0x2a907d;};}function handleError(_0x4a35d0,_0x1f4af8){_0x1f4af8=_0x1f4af8||0x1f4;return function(_0x1e503c){logger[_0x6f77('0x26')](_0x1e503c[_0x6f77('0x27')]);if(_0x1e503c[_0x6f77('0x28')]){delete _0x1e503c[_0x6f77('0x28')];}_0x4a35d0['status'](_0x1f4af8)['send'](_0x1e503c);};}exports[_0x6f77('0x29')]=function(_0x3904f9,_0x1d08de){var _0x2f2b23={'raw':!![],'where':{'id':_0x3904f9[_0x6f77('0x2a')]['id']}},_0x1381af={};_0x1381af[_0x6f77('0x2b')]=_[_0x6f77('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x1381af[_0x6f77('0x2d')]=_[_0x6f77('0x2c')](_0x3904f9[_0x6f77('0x2d')]);_0x1381af[_0x6f77('0x2e')]=_[_0x6f77('0x2f')](_0x1381af['model'],_0x1381af[_0x6f77('0x2d')]);_0x2f2b23[_0x6f77('0x30')]=_[_0x6f77('0x2f')](_0x1381af['model'],qs[_0x6f77('0x31')](_0x3904f9['query']['fields']));_0x2f2b23[_0x6f77('0x30')]=_0x2f2b23[_0x6f77('0x30')][_0x6f77('0x32')]?_0x2f2b23[_0x6f77('0x30')]:_0x1381af[_0x6f77('0x2b')];if(_0x3904f9[_0x6f77('0x2d')][_0x6f77('0x33')]){_0x2f2b23[_0x6f77('0x34')]=[{'all':!![]}];}_0x2f2b23=_[_0x6f77('0x35')]({},_0x2f2b23,_0x3904f9['options']);return db[_0x6f77('0x36')]['find'](_0x2f2b23)[_0x6f77('0x24')](handleEntityNotFound(_0x1d08de,null))['then'](respondWithResult(_0x1d08de,null))[_0x6f77('0x37')](handleError(_0x1d08de,null));};exports[_0x6f77('0x38')]=function(_0x5d6cff,_0xe00f94){return db[_0x6f77('0x36')][_0x6f77('0x38')](_0x5d6cff[_0x6f77('0x39')],{})[_0x6f77('0x24')](respondWithResult(_0xe00f94,0xc9))['catch'](handleError(_0xe00f94,null));};exports[_0x6f77('0x23')]=function(_0x347d37,_0x28dcff){if(_0x347d37[_0x6f77('0x39')]['id']){delete _0x347d37[_0x6f77('0x39')]['id'];}return db['ChatProactiveAction'][_0x6f77('0x3a')]({'where':{'id':_0x347d37[_0x6f77('0x2a')]['id']}})[_0x6f77('0x24')](handleEntityNotFound(_0x28dcff,null))[_0x6f77('0x24')](saveUpdates(_0x347d37[_0x6f77('0x39')],null))['then'](respondWithResult(_0x28dcff,null))[_0x6f77('0x37')](handleError(_0x28dcff,null));};exports['destroy']=function(_0x2445c6,_0x21b4aa){return db[_0x6f77('0x36')][_0x6f77('0x3a')]({'where':{'id':_0x2445c6[_0x6f77('0x2a')]['id']}})['then'](handleEntityNotFound(_0x21b4aa,null))[_0x6f77('0x24')](removeEntity(_0x21b4aa,null))[_0x6f77('0x37')](handleError(_0x21b4aa,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 318cc86..a634578 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 _0xd5ba=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd5ba,0x154));var _0xad5b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd5ba[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var logger=require(_0xad5b('0x2'))(_0xad5b('0x3'));var moment=require(_0xad5b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad5b('0x5'));var rimraf=require(_0xad5b('0x6'));var config=require(_0xad5b('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xad5b('0x8')]=function(_0x2c49e5,_0x74eb3f){return _0x2c49e5[_0xad5b('0x9')](_0xad5b('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4839=['../../config/environment','./chatProactiveAction.attributes','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2386dd,_0x3777a1){var _0x195648=function(_0x411c1e){while(--_0x411c1e){_0x2386dd['push'](_0x2386dd['shift']());}};_0x195648(++_0x3777a1);}(_0x4839,0x12f));var _0x9483=function(_0x6ef16f,_0x1722ae){_0x6ef16f=_0x6ef16f-0x0;var _0x484cc5=_0x4839[_0x6ef16f];return _0x484cc5;};'use strict';var _=require(_0x9483('0x0'));var util=require(_0x9483('0x1'));var logger=require(_0x9483('0x2'))(_0x9483('0x3'));var moment=require(_0x9483('0x4'));var BPromise=require('bluebird');var rp=require(_0x9483('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9483('0x6'));var config=require(_0x9483('0x7'));var attributes=require(_0x9483('0x8'));module['exports']=function(_0x39b4be,_0x1287a7){return _0x39b4be['define']('ChatProactiveAction',attributes,{'tableName':_0x9483('0x9'),'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 452592b..32305d0 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 _0xc193=['../../config/environment','jayson/promise','client','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','info','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xbc2d9e,_0x40ef4f){var _0x2e315c=function(_0x57fc55){while(--_0x57fc55){_0xbc2d9e['push'](_0xbc2d9e['shift']());}};_0x2e315c(++_0x40ef4f);}(_0xc193,0x1e0));var _0x3c19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc193[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c19('0x0'));var util=require(_0x3c19('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3c19('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c19('0x3'))['db'];var utils=require(_0x3c19('0x4'));var logger=require('../../config/logger')(_0x3c19('0x5'));var config=require(_0x3c19('0x6'));var jayson=require(_0x3c19('0x7'));var client=jayson[_0x3c19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8605a,_0x314107,_0x27b9a3){return new BPromise(function(_0x4384a7,_0x51b8ff){return client['request'](_0xd8605a,_0x27b9a3)[_0x3c19('0x9')](function(_0x33e737){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x3c19('0xa'));logger[_0x3c19('0xb')](_0x3c19('0xc'),_0x314107,_0x3c19('0xa'),JSON[_0x3c19('0xd')](_0x33e737));if(_0x33e737['error']){if(_0x33e737['error']['code']===0x1f4){logger[_0x3c19('0xe')](_0x3c19('0xf'),_0x314107,_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);return _0x51b8ff(_0x33e737[_0x3c19('0xe')]['message']);}logger[_0x3c19('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);return _0x4384a7(_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);}else{logger[_0x3c19('0x11')](_0x3c19('0xf'),_0x314107,_0x3c19('0xa'));_0x4384a7(_0x33e737['result']['message']);}})['catch'](function(_0x12dd51){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x12dd51);_0x51b8ff(_0x12dd51);});});}
\ No newline at end of file
+var _0xd095=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0xd095,0xd5));var _0x5d09=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd095[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x5d09('0x0'));var util=require('util');var moment=require(_0x5d09('0x1'));var BPromise=require(_0x5d09('0x2'));var rs=require(_0x5d09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d09('0x4'))['db'];var utils=require(_0x5d09('0x5'));var logger=require('../../config/logger')(_0x5d09('0x6'));var config=require(_0x5d09('0x7'));var jayson=require(_0x5d09('0x8'));var client=jayson[_0x5d09('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1515,_0x44b475,_0x26dd0e){return new BPromise(function(_0x113be2,_0x214744){return client['request'](_0x3b1515,_0x26dd0e)[_0x5d09('0xa')](function(_0x2bccfc){logger['info'](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));logger[_0x5d09('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x44b475,'request\x20sent',JSON[_0x5d09('0xe')](_0x2bccfc));if(_0x2bccfc[_0x5d09('0xf')]){if(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x10')]===0x1f4){logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);return _0x214744(_0x2bccfc['error'][_0x5d09('0x11')]);}logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc['error']['message']);return _0x113be2(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);}else{logger[_0x5d09('0x12')](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));_0x113be2(_0x2bccfc['result'][_0x5d09('0x11')]);}})[_0x5d09('0x13')](function(_0x496873){logger['error'](_0x5d09('0xb'),_0x44b475,_0x496873);_0x214744(_0x496873);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 6e35b0b..51bfbbd 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 _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x1a5bcf,_0x25b189){var _0x312c29=function(_0x16a633){while(--_0x16a633){_0x1a5bcf['push'](_0x1a5bcf['shift']());}};_0x312c29(++_0x25b189);}(_0xdc97,0x13b));var _0x7dc9=function(_0xfb6347,_0x2dd312){_0xfb6347=_0xfb6347-0x0;var _0x2f7997=_0xdc97[_0xfb6347];return _0x2f7997;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router;
\ No newline at end of file
+var _0x207c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x3bbacb,_0x3a554a){var _0x1ea059=function(_0x32a962){while(--_0x32a962){_0x3bbacb['push'](_0x3bbacb['shift']());}};_0x1ea059(++_0x3a554a);}(_0x207c,0x1e8));var _0xc207=function(_0x497641,_0x5d4f64){_0x497641=_0x497641-0x0;var _0x3c355e=_0x207c[_0x497641];return _0x3c355e;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router[_0xc207('0xa')]('/',auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')](_0xc207('0xd'),auth[_0xc207('0x8')](),controller[_0xc207('0x10')]);module[_0xc207('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 7c603c3..c885d50 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 _0x578d=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x578d,0x95));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd578('0x0')]={'name':{'type':Sequelize[_0xd578('0x1')],'unique':_0xd578('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd578('0x1')]},'timeout':{'type':Sequelize[_0xd578('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd578('0x4'),_0xd578('0x5'),_0xd578('0x6'))}};
\ No newline at end of file
+var _0x5942=['roundrobin','sequelize','exports','INTEGER','ENUM','rrmemory'];(function(_0x45ea9d,_0x2e2a68){var _0x367e67=function(_0x5243ca){while(--_0x5243ca){_0x45ea9d['push'](_0x45ea9d['shift']());}};_0x367e67(++_0x2e2a68);}(_0x5942,0xaf));var _0x2594=function(_0x3b4979,_0x29bd1b){_0x3b4979=_0x3b4979-0x0;var _0x52aa62=_0x5942[_0x3b4979];return _0x52aa62;};'use strict';var Sequelize=require(_0x2594('0x0'));module[_0x2594('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2594('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2594('0x3')](_0x2594('0x4'),'beepall',_0x2594('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 5601b97..29887d9 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 _0x2490=['QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','sendStatus','name','send','map','ChatQueue','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','ChatQueueId','UserChatQueue','findAll','findAndCountAll','UserId','agent','chatPause','createdAt','rows','%s/%s','SIP','updatedAt','Team','getTeams','ids','Agents','online','interface','flatMap','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2490,0x145));var _0x0249=function(_0x4afac5,_0x5e3825){_0x4afac5=_0x4afac5-0x0;var _0x14238c=_0x2490[_0x4afac5];return _0x14238c;};'use strict';var emlformat=require(_0x0249('0x0'));var rimraf=require(_0x0249('0x1'));var zipdir=require(_0x0249('0x2'));var jsonpatch=require(_0x0249('0x3'));var rp=require(_0x0249('0x4'));var moment=require(_0x0249('0x5'));var BPromise=require(_0x0249('0x6'));var Mustache=require(_0x0249('0x7'));var util=require(_0x0249('0x8'));var path=require(_0x0249('0x9'));var sox=require(_0x0249('0xa'));var csv=require('to-csv');var ejs=require(_0x0249('0xb'));var fs=require('fs');var fs_extra=require(_0x0249('0xc'));var _=require(_0x0249('0xd'));var squel=require(_0x0249('0xe'));var crypto=require(_0x0249('0xf'));var jsforce=require(_0x0249('0x10'));var deskjs=require(_0x0249('0x11'));var toCsv=require(_0x0249('0x12'));var querystring=require('querystring');var Papa=require(_0x0249('0x13'));var Redis=require(_0x0249('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0249('0x15'));var logger=require(_0x0249('0x16'))(_0x0249('0x17'));var utils=require(_0x0249('0x18'));var config=require(_0x0249('0x19'));var licenseUtil=require(_0x0249('0x1a'));var db=require(_0x0249('0x1b'))['db'];config[_0x0249('0x1c')]=_[_0x0249('0x1d')](config[_0x0249('0x1c')],{'host':_0x0249('0x1e'),'port':0x18eb});var socket=require(_0x0249('0x1f'))(new Redis(config[_0x0249('0x1c')]));require(_0x0249('0x20'))['register'](socket);var jayson=require(_0x0249('0x21'));var client=jayson['client'][_0x0249('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x52e3c3,_0x2c018b,_0x9c1034,_0x22b656){return new BPromise(function(_0x359315,_0x5d05d4){var _0x2fdc89=_0x22b656||client;return _0x2fdc89[_0x0249('0x23')](_0x52e3c3,_0x9c1034)[_0x0249('0x24')](function(_0x59b662){logger[_0x0249('0x25')]('ChatQueue,\x20%s,\x20%s',_0x2c018b,_0x0249('0x26'));logger[_0x0249('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2c018b,'request\x20sent',JSON['stringify'](_0x59b662));if(_0x59b662[_0x0249('0x28')]){if(_0x59b662['error'][_0x0249('0x29')]===0x1f4){logger['error'](_0x0249('0x2a'),_0x2c018b,_0x59b662['error'][_0x0249('0x2b')]);return _0x5d05d4(_0x59b662['error'][_0x0249('0x2b')]);}logger[_0x0249('0x28')](_0x0249('0x2a'),_0x2c018b,_0x59b662['error'][_0x0249('0x2b')]);return _0x359315(_0x59b662[_0x0249('0x28')][_0x0249('0x2b')]);}else{logger[_0x0249('0x25')](_0x0249('0x2a'),_0x2c018b,'request\x20sent');_0x359315(_0x59b662[_0x0249('0x2c')][_0x0249('0x2b')]);}})[_0x0249('0x2d')](function(_0x240c0c){logger[_0x0249('0x28')](_0x0249('0x2a'),_0x2c018b,_0x240c0c);_0x5d05d4(_0x240c0c);});});}function respondWithStatusCode(_0x3304a4,_0x1675ba){_0x1675ba=_0x1675ba||0xcc;return function(_0xc4dd37){if(_0xc4dd37){return _0x3304a4['sendStatus'](_0x1675ba);}return _0x3304a4[_0x0249('0x2e')](_0x1675ba)[_0x0249('0x2f')]();};}function respondWithResult(_0x280330,_0x7066db){_0x7066db=_0x7066db||0xc8;return function(_0x21c44f){if(_0x21c44f){return _0x280330[_0x0249('0x2e')](_0x7066db)[_0x0249('0x30')](_0x21c44f);}};}function respondWithFilteredResult(_0x4131be,_0x495177){return function(_0x52e467){if(_0x52e467){var _0x1106b8=typeof _0x495177[_0x0249('0x31')]==='undefined'&&typeof _0x495177[_0x0249('0x32')]===_0x0249('0x33');var _0x1cb107=_0x52e467['count'];var _0x1ce174=_0x1106b8?0x0:_0x495177[_0x0249('0x31')];var _0x64004f=_0x1106b8?_0x52e467[_0x0249('0x34')]:_0x495177[_0x0249('0x31')]+_0x495177[_0x0249('0x32')];var _0x5113cc;if(_0x64004f>=_0x1cb107){_0x64004f=_0x1cb107;_0x5113cc=0xc8;}else{_0x5113cc=0xce;}_0x4131be[_0x0249('0x2e')](_0x5113cc);return _0x4131be['set'](_0x0249('0x35'),_0x1ce174+'-'+_0x64004f+'/'+_0x1cb107)[_0x0249('0x30')](_0x52e467);}return null;};}function patchUpdates(_0x4741e1){return function(_0xe4088f){try{jsonpatch[_0x0249('0x36')](_0xe4088f,_0x4741e1,!![]);}catch(_0x5b9dd9){return BPromise[_0x0249('0x37')](_0x5b9dd9);}return _0xe4088f[_0x0249('0x38')]();};}function saveUpdates(_0x151d4a,_0x463e9e){return function(_0x471f9d){if(_0x471f9d){return _0x471f9d[_0x0249('0x39')](_0x151d4a)[_0x0249('0x24')](function(_0x4d1b16){return _0x4d1b16;});}return null;};}function removeEntity(_0x28f747,_0x121d3f){return function(_0x1cfda3){if(_0x1cfda3){return _0x1cfda3[_0x0249('0x3a')]()['then'](function(){var _0x5beb50=_0x1cfda3[_0x0249('0x3b')]({'plain':!![]});var _0x415e6e='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x415e6e,'resourceId':_0x5beb50['id']}})[_0x0249('0x24')](function(){return _0x1cfda3;});})['then'](function(){_0x28f747['status'](0xcc)[_0x0249('0x2f')]();});}};}function handleEntityNotFound(_0x18493f,_0x4c9dde){return function(_0x56e4ef){if(!_0x56e4ef){_0x18493f[_0x0249('0x3c')](0x194);}return _0x56e4ef;};}function handleError(_0x1a86e5,_0x29337a){_0x29337a=_0x29337a||0x1f4;return function(_0xe46f87){logger[_0x0249('0x28')](_0xe46f87['stack']);if(_0xe46f87['name']){delete _0xe46f87[_0x0249('0x3d')];}_0x1a86e5['status'](_0x29337a)[_0x0249('0x3e')](_0xe46f87);};}exports['index']=function(_0xdd0c76,_0x251cc7){var _0x5194c5={},_0x399369={},_0x1d1cae={'count':0x0,'rows':[]};var _0x9c9bb4=_[_0x0249('0x3f')](db[_0x0249('0x40')]['rawAttributes'],function(_0x2d3b08){return{'name':_0x2d3b08[_0x0249('0x41')],'type':_0x2d3b08[_0x0249('0x42')][_0x0249('0x43')]};});_0x399369[_0x0249('0x44')]=_[_0x0249('0x3f')](_0x9c9bb4,'name');_0x399369[_0x0249('0x45')]=_['keys'](_0xdd0c76[_0x0249('0x45')]);_0x399369[_0x0249('0x46')]=_['intersection'](_0x399369[_0x0249('0x44')],_0x399369['query']);_0x5194c5[_0x0249('0x47')]=_[_0x0249('0x48')](_0x399369[_0x0249('0x44')],qs[_0x0249('0x49')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x49')]));_0x5194c5['attributes']=_0x5194c5[_0x0249('0x47')][_0x0249('0x4a')]?_0x5194c5[_0x0249('0x47')]:_0x399369[_0x0249('0x44')];if(!_0xdd0c76[_0x0249('0x45')]['hasOwnProperty'](_0x0249('0x4b'))){_0x5194c5[_0x0249('0x32')]=qs[_0x0249('0x32')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x32')]);_0x5194c5[_0x0249('0x31')]=qs[_0x0249('0x31')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x31')]);}_0x5194c5[_0x0249('0x4c')]=qs[_0x0249('0x4d')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x4d')]);_0x5194c5[_0x0249('0x4e')]=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0xdd0c76[_0x0249('0x45')],_0x399369['filters']),_0x9c9bb4);if(_0xdd0c76[_0x0249('0x45')][_0x0249('0x50')]){_0x5194c5[_0x0249('0x4e')]=_[_0x0249('0x51')](_0x5194c5[_0x0249('0x4e')],{'$or':_[_0x0249('0x3f')](_0x9c9bb4,function(_0xa13374){if(_0xa13374[_0x0249('0x42')]!==_0x0249('0x52')){var _0x5418f0={};_0x5418f0[_0xa13374[_0x0249('0x3d')]]={'$like':'%'+_0xdd0c76[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x5418f0;}})});}_0x5194c5=_[_0x0249('0x51')]({},_0x5194c5,_0xdd0c76[_0x0249('0x53')]);var _0x41ad82={'where':_0x5194c5[_0x0249('0x4e')]};return db[_0x0249('0x40')][_0x0249('0x34')](_0x41ad82)[_0x0249('0x24')](function(_0x488e20){_0x1d1cae['count']=_0x488e20;if(_0xdd0c76['query'][_0x0249('0x54')]){_0x5194c5[_0x0249('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x5194c5);})[_0x0249('0x24')](function(_0x2c581c){_0x1d1cae['rows']=_0x2c581c;return _0x1d1cae;})['then'](respondWithFilteredResult(_0x251cc7,_0x5194c5))[_0x0249('0x2d')](handleError(_0x251cc7,null));};exports['show']=function(_0x576517,_0x248fb0){var _0x552320={'raw':!![],'where':{'id':_0x576517['params']['id']}},_0x59a280={};_0x59a280[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x40')][_0x0249('0x57')]);_0x59a280[_0x0249('0x45')]=_[_0x0249('0x56')](_0x576517[_0x0249('0x45')]);_0x59a280[_0x0249('0x46')]=_[_0x0249('0x48')](_0x59a280[_0x0249('0x44')],_0x59a280['query']);_0x552320[_0x0249('0x47')]=_['intersection'](_0x59a280[_0x0249('0x44')],qs[_0x0249('0x49')](_0x576517[_0x0249('0x45')][_0x0249('0x49')]));_0x552320[_0x0249('0x47')]=_0x552320[_0x0249('0x47')]['length']?_0x552320[_0x0249('0x47')]:_0x59a280['model'];if(_0x576517[_0x0249('0x45')][_0x0249('0x54')]){_0x552320[_0x0249('0x55')]=[{'all':!![]}];}_0x552320=_[_0x0249('0x51')]({},_0x552320,_0x576517[_0x0249('0x53')]);return db[_0x0249('0x40')][_0x0249('0x58')](_0x552320)[_0x0249('0x24')](handleEntityNotFound(_0x248fb0,null))['then'](respondWithResult(_0x248fb0,null))[_0x0249('0x2d')](handleError(_0x248fb0,null));};exports[_0x0249('0x59')]=function(_0x309cb8,_0x5722cf){return db[_0x0249('0x40')][_0x0249('0x59')](_0x309cb8[_0x0249('0x5a')],{})[_0x0249('0x24')](function(_0x4c9f3d){var _0x249756=_0x309cb8[_0x0249('0x5b')][_0x0249('0x3b')]({'plain':!![]});if(!_0x249756)throw new Error(_0x0249('0x5c'));if(_0x249756['role']===_0x0249('0x5b')){var _0x4637a8=_0x4c9f3d[_0x0249('0x3b')]({'plain':!![]});var _0x2e3d8c=_0x0249('0x5d');return db[_0x0249('0x5e')][_0x0249('0x58')]({'where':{'name':_0x2e3d8c,'userProfileId':_0x249756[_0x0249('0x5f')]},'raw':!![]})[_0x0249('0x24')](function(_0x1e62e3){if(_0x1e62e3&&_0x1e62e3[_0x0249('0x60')]===0x0){return db[_0x0249('0x61')]['create']({'name':_0x4637a8[_0x0249('0x3d')],'resourceId':_0x4637a8['id'],'type':_0x1e62e3[_0x0249('0x3d')],'sectionId':_0x1e62e3['id']},{})[_0x0249('0x24')](function(){return _0x4c9f3d;});}else{return _0x4c9f3d;}})[_0x0249('0x2d')](function(_0x3bb658){logger[_0x0249('0x28')](_0x0249('0x62'),_0x3bb658);throw _0x3bb658;});}return _0x4c9f3d;})[_0x0249('0x24')](respondWithResult(_0x5722cf,0xc9))[_0x0249('0x2d')](handleError(_0x5722cf,null));};exports['update']=function(_0x4f169f,_0x5e61fe){if(_0x4f169f[_0x0249('0x5a')]['id']){delete _0x4f169f[_0x0249('0x5a')]['id'];}return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x4f169f['params']['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x5e61fe,null))[_0x0249('0x24')](saveUpdates(_0x4f169f[_0x0249('0x5a')],null))[_0x0249('0x24')](respondWithResult(_0x5e61fe,null))['catch'](handleError(_0x5e61fe,null));};exports[_0x0249('0x3a')]=function(_0x4e2bac,_0x172036){return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x4e2bac[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x172036,null))[_0x0249('0x24')](removeEntity(_0x172036,null))[_0x0249('0x2d')](handleError(_0x172036,null));};exports[_0x0249('0x64')]=function(_0x4935ab,_0x18b746){return db['ChatQueue'][_0x0249('0x64')]()[_0x0249('0x24')](respondWithResult(_0x18b746,null))[_0x0249('0x2d')](handleError(_0x18b746,null));};exports[_0x0249('0x65')]=function(_0x3772a8,_0x12e045,_0x1c1926){var _0x474044={'raw':!![],'where':{}},_0x4c1eda={},_0x5c9fbc;return db[_0x0249('0x40')][_0x0249('0x66')]({'where':{'id':_0x3772a8[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x12e045,null))[_0x0249('0x24')](function(_0x2fa6c3){if(_0x2fa6c3){_0x5c9fbc=_0x2fa6c3[_0x0249('0x3b')]({'plain':!![]});_0x4c1eda[_0x0249('0x44')]=_[_0x0249('0x56')](db['UserChatQueue'][_0x0249('0x57')]);_0x4c1eda[_0x0249('0x45')]=_[_0x0249('0x56')](_0x3772a8['query']);_0x4c1eda[_0x0249('0x46')]=_['intersection'](_0x4c1eda['model'],_0x4c1eda['query']);_0x474044[_0x0249('0x47')]=_[_0x0249('0x48')](_0x4c1eda['model'],qs[_0x0249('0x49')](_0x3772a8[_0x0249('0x45')][_0x0249('0x49')]));_0x474044['attributes']=_0x474044[_0x0249('0x47')][_0x0249('0x4a')]?_0x474044['attributes']:_0x4c1eda[_0x0249('0x44')];if(!_0x3772a8['query'][_0x0249('0x67')](_0x0249('0x4b'))){_0x474044['limit']=qs[_0x0249('0x32')](_0x3772a8[_0x0249('0x45')][_0x0249('0x32')]);_0x474044['offset']=qs[_0x0249('0x31')](_0x3772a8[_0x0249('0x45')]['offset']);}_0x474044['order']=qs[_0x0249('0x4d')](_0x3772a8[_0x0249('0x45')][_0x0249('0x4d')]);_0x474044['where']=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0x3772a8[_0x0249('0x45')],_0x4c1eda['filters']));_0x474044[_0x0249('0x4e')][_0x0249('0x68')]=_0x2fa6c3['id'];if(_0x3772a8[_0x0249('0x45')]['filter']){_0x474044['where']=_[_0x0249('0x51')](_0x474044[_0x0249('0x4e')],{'$or':_['map'](_0x474044[_0x0249('0x47')],function(_0x4ce136){var _0x3ccd4d={};_0x3ccd4d[_0x4ce136]={'$like':'%'+_0x3772a8[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x3ccd4d;})});}_0x474044=_['merge']({},_0x474044,_0x3772a8[_0x0249('0x53')]);return db[_0x0249('0x69')][_0x0249('0x6a')](_0x474044);}})[_0x0249('0x24')](function(_0x111cc2){if(_0x111cc2){return db['User'][_0x0249('0x6b')]({'where':{'id':_['map'](_0x111cc2,_0x0249('0x6c')),'role':_0x0249('0x6d')},'attributes':['id','name',_0x0249('0x6e'),'updatedAt',_0x0249('0x6f')]});}})[_0x0249('0x24')](function(_0x903a56){if(_0x903a56){return{'count':_0x903a56[_0x0249('0x34')],'rows':_[_0x0249('0x3f')](_0x903a56[_0x0249('0x70')],function(_0x513e5a){return{'membername':_0x513e5a[_0x0249('0x3d')],'UserId':_0x513e5a['id'],'queue_name':_0x5c9fbc[_0x0249('0x3d')],'ChatQueueId':_0x5c9fbc['id'],'interface':util['format'](_0x0249('0x71'),_0x0249('0x72'),_0x513e5a[_0x0249('0x3d')]),'penalty':0x0,'paused':_0x513e5a['chatPause'],'createdAt':_0x513e5a[_0x0249('0x6f')],'updatedAt':_0x513e5a[_0x0249('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x12e045,_0x474044))[_0x0249('0x2d')](handleError(_0x12e045,null));};exports['getTeams']=function(_0x277a70,_0xe1b2b,_0xa648b4){var _0xa6e642={};var _0x1dac9a={};var _0x3f9d6;var _0x391c53;return db[_0x0249('0x40')][_0x0249('0x66')]({'where':{'id':_0x277a70[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0xe1b2b,null))[_0x0249('0x24')](function(_0x14202e){if(_0x14202e){_0x3f9d6=_0x14202e;_0x1dac9a[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x74')][_0x0249('0x57')]);_0x1dac9a[_0x0249('0x45')]=_['keys'](_0x277a70[_0x0249('0x45')]);_0x1dac9a[_0x0249('0x46')]=_['intersection'](_0x1dac9a[_0x0249('0x44')],_0x1dac9a[_0x0249('0x45')]);_0xa6e642[_0x0249('0x47')]=_[_0x0249('0x48')](_0x1dac9a['model'],qs[_0x0249('0x49')](_0x277a70['query'][_0x0249('0x49')]));_0xa6e642[_0x0249('0x47')]=_0xa6e642[_0x0249('0x47')]['length']?_0xa6e642[_0x0249('0x47')]:_0x1dac9a[_0x0249('0x44')];_0xa6e642[_0x0249('0x4c')]=qs['sort'](_0x277a70[_0x0249('0x45')][_0x0249('0x4d')]);_0xa6e642[_0x0249('0x4e')]=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0x277a70[_0x0249('0x45')],_0x1dac9a[_0x0249('0x46')]));if(_0x277a70[_0x0249('0x45')][_0x0249('0x50')]){_0xa6e642[_0x0249('0x4e')]=_[_0x0249('0x51')](_0xa6e642['where'],{'$or':_[_0x0249('0x3f')](_0xa6e642[_0x0249('0x47')],function(_0x16eef8){var _0x22ad08={};_0x22ad08[_0x16eef8]={'$like':'%'+_0x277a70['query'][_0x0249('0x50')]+'%'};return _0x22ad08;})});}_0xa6e642=_['merge']({},_0xa6e642,_0x277a70[_0x0249('0x53')]);return _0x3f9d6[_0x0249('0x75')](_0xa6e642);}})[_0x0249('0x24')](function(_0x114340){if(_0x114340){_0x391c53=_0x114340[_0x0249('0x4a')];if(!_0x277a70[_0x0249('0x45')][_0x0249('0x67')](_0x0249('0x4b'))){_0xa6e642[_0x0249('0x32')]=qs[_0x0249('0x32')](_0x277a70[_0x0249('0x45')][_0x0249('0x32')]);_0xa6e642['offset']=qs[_0x0249('0x31')](_0x277a70[_0x0249('0x45')][_0x0249('0x31')]);}return _0x3f9d6[_0x0249('0x75')](_0xa6e642);}})[_0x0249('0x24')](function(_0x10bd8f){if(_0x10bd8f){return _0x10bd8f?{'count':_0x391c53,'rows':_0x10bd8f}:null;}})[_0x0249('0x24')](respondWithResult(_0xe1b2b,null))[_0x0249('0x2d')](handleError(_0xe1b2b,null));};exports['addTeams']=function(_0x5ee6d3,_0x476460,_0x2e80b7){var _0x27cb2c=_0x5ee6d3[_0x0249('0x5a')][_0x0249('0x76')];return db['Team']['findAll']({'where':{'id':_0x27cb2c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0249('0x77'),'attributes':['id',_0x0249('0x3d'),_0x0249('0x78'),'voicePause',_0x0249('0x79')],'raw':!![]}]})[_0x0249('0x24')](function(_0xa263d4){if(_0xa263d4){var _0x511d68=_[_0x0249('0x7a')](_0xa263d4,function(_0x4c2c91){var _0x1229ad=_0x4c2c91['get']({'plain':!![]});return _0x1229ad[_0x0249('0x77')];});return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x5ee6d3[_0x0249('0x63')]['id']}})[_0x0249('0x24')](function(_0x67e71d){return db['sequelize']['transaction'](function(_0x58b44c){return _0x67e71d[_0x0249('0x7b')](_0x27cb2c,{'transaction':_0x58b44c})[_0x0249('0x24')](function(){return BPromise[_0x0249('0x7c')](_0x511d68,function(_0x268e36){return db[_0x0249('0x69')][_0x0249('0x7d')]({'where':{'UserId':_0x268e36['id'],'ChatQueueId':_0x5ee6d3['params']['id']},'transaction':_0x58b44c});});})[_0x0249('0x24')](function(){_0x511d68[_0x0249('0x7e')](function(_0x48ebef){socket[_0x0249('0x7f')](_0x0249('0x80'),{'UserId':_0x48ebef['id'],'ChatQueueId':_0x67e71d['id']});});});});});}})[_0x0249('0x24')](respondWithStatusCode(_0x476460,null))[_0x0249('0x2d')](handleError(_0x476460,null));};exports[_0x0249('0x81')]=function(_0x598462,_0x35a57a,_0x269af7){return db[_0x0249('0x74')][_0x0249('0x6a')]({'where':{'id':_0x598462['query'][_0x0249('0x76')]},'attributes':['id'],'include':[{'model':db[_0x0249('0x82')],'as':_0x0249('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35a57a,null))[_0x0249('0x24')](function(_0x2d3d63){var _0xf46328=_[_0x0249('0x3f')](_0x2d3d63,'id');var _0x28e66a=[];var _0x151922=[];var _0x154821=squel['select']();_0x154821['field']('tq.TeamId')[_0x0249('0x83')](_0x0249('0x84'),'tq')[_0x0249('0x85')]('user_has_teams','ut',_0x0249('0x86'))[_0x0249('0x4e')](_0x0249('0x87'),_0x598462[_0x0249('0x63')]['id']);for(var _0x207268=0x0;_0x207268<_0x2d3d63[_0x0249('0x4a')];_0x207268+=0x1){let _0x4d029c=_0x2d3d63[_0x207268];for(var _0x4b0d04=0x0;_0x4b0d04<_0x4d029c[_0x0249('0x77')][_0x0249('0x4a')];_0x4b0d04+=0x1){let _0x4e66a4=_0x4d029c['Agents'][_0x4b0d04];var _0x3efec2=_0x154821[_0x0249('0x88')]();_0x3efec2[_0x0249('0x4e')](_0x0249('0x89'),_0x4e66a4['id']);_0x151922['push'](db['sequelize'][_0x0249('0x45')](_0x3efec2[_0x0249('0x8a')](),{'type':db[_0x0249('0x8b')][_0x0249('0x8c')][_0x0249('0x8d')]})[_0x0249('0x24')](function(_0x1339b6){if(_0x1339b6['length']===0x1){return _0x4e66a4['id'];}else{var _0x49c211=_[_0x0249('0x8e')](_[_0x0249('0x3f')](_0x1339b6,_0x0249('0x8f')),function(_0x9b45bf){return _['includes'](_0xf46328,_0x9b45bf);});if(_0x49c211){return _0x4e66a4['id'];}}}));}}return BPromise[_0x0249('0x90')](_0x151922)['then'](function(_0x4c4f68){_0x28e66a=_(_0x28e66a)[_0x0249('0x91')](_0x4c4f68)['compact']()[_0x0249('0x92')]();return db[_0x0249('0x40')]['find']({'where':{'id':_0x598462['params']['id']}})[_0x0249('0x24')](function(_0x1237fa){return db[_0x0249('0x8b')]['transaction'](function(_0x493de0){return _0x1237fa[_0x0249('0x81')](_0x598462[_0x0249('0x45')][_0x0249('0x76')],{'transaction':_0x493de0})[_0x0249('0x24')](function(){if(!_[_0x0249('0x93')](_0x28e66a)){return _0x1237fa[_0x0249('0x94')](_0x28e66a,{'transaction':_0x493de0});}})[_0x0249('0x24')](function(){_0x28e66a['forEach'](function(_0x47a22d){socket[_0x0249('0x7f')]('userChatQueue:remove',{'UserId':_0x47a22d,'ChatQueueId':_0x1237fa['id']});});});});});});})['then'](respondWithStatusCode(_0x35a57a,null))['catch'](handleError(_0x35a57a,null));};exports['addAgents']=function(_0x40a0dd,_0x41cf61,_0x4bdb29){return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x40a0dd[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x41cf61,null))['then'](function(_0x4602a2){if(_0x4602a2){return _0x4602a2[_0x0249('0x95')](_0x40a0dd[_0x0249('0x5a')][_0x0249('0x76')],_[_0x0249('0x96')](_0x40a0dd['body'],[_0x0249('0x76'),'id'])||{})[_0x0249('0x97')](function(_0x291dd0){for(var _0x2220b2=0x0;_0x2220b2<_0x40a0dd[_0x0249('0x5a')][_0x0249('0x76')][_0x0249('0x4a')];_0x2220b2+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x40a0dd['body'][_0x0249('0x76')][_0x2220b2]),'ChatQueueId':Number(_0x40a0dd[_0x0249('0x63')]['id'])});}return _0x291dd0;});}})[_0x0249('0x24')](respondWithResult(_0x41cf61,null))[_0x0249('0x2d')](handleError(_0x41cf61,null));};exports[_0x0249('0x94')]=function(_0x46a3d2,_0x680988,_0x3c9e67){return db[_0x0249('0x40')]['find']({'where':{'id':_0x46a3d2[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x680988,null))[_0x0249('0x24')](function(_0x4102fa){if(_0x4102fa){return _0x4102fa[_0x0249('0x94')](_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')])[_0x0249('0x24')](function(){if(_[_0x0249('0x98')](_0x46a3d2['query']['ids'])){for(var _0x58f6b5=0x0;_0x58f6b5<_0x46a3d2['query']['ids'][_0x0249('0x4a')];_0x58f6b5+=0x1){socket['emit'](_0x0249('0x99'),{'UserId':Number(_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')][_0x58f6b5]),'ChatQueueId':Number(_0x46a3d2[_0x0249('0x63')]['id'])});}}else{socket[_0x0249('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')]),'ChatQueueId':Number(_0x46a3d2[_0x0249('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x680988,null))['catch'](handleError(_0x680988,null));};exports[_0x0249('0x9a')]=function(_0x33d6c4,_0x35054a,_0x1d0fc5){var _0x34b016={};var _0x51b9ec={};var _0x37cf69;var _0x488058;return db['ChatQueue'][_0x0249('0x66')]({'where':{'id':_0x33d6c4[_0x0249('0x63')]['id']}})['then'](handleEntityNotFound(_0x35054a,null))[_0x0249('0x24')](function(_0x56b34c){if(_0x56b34c){_0x37cf69=_0x56b34c;_0x51b9ec[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x82')][_0x0249('0x57')]);_0x51b9ec['query']=_[_0x0249('0x56')](_0x33d6c4[_0x0249('0x45')]);_0x51b9ec['filters']=_['intersection'](_0x51b9ec['model'],_0x51b9ec[_0x0249('0x45')]);_0x34b016[_0x0249('0x47')]=_['intersection'](_0x51b9ec[_0x0249('0x44')],qs[_0x0249('0x49')](_0x33d6c4[_0x0249('0x45')][_0x0249('0x49')]));_0x34b016[_0x0249('0x47')]=_0x34b016[_0x0249('0x47')][_0x0249('0x4a')]?_0x34b016[_0x0249('0x47')]:_0x51b9ec[_0x0249('0x44')];_0x34b016[_0x0249('0x4c')]=qs['sort'](_0x33d6c4['query'][_0x0249('0x4d')]);_0x34b016['where']=qs[_0x0249('0x46')](_['pick'](_0x33d6c4[_0x0249('0x45')],_0x51b9ec[_0x0249('0x46')]));if(_0x33d6c4[_0x0249('0x45')]['filter']){_0x34b016[_0x0249('0x4e')]=_[_0x0249('0x51')](_0x34b016[_0x0249('0x4e')],{'$or':_[_0x0249('0x3f')](_0x34b016[_0x0249('0x47')],function(_0x552fc3){var _0x34f010={};_0x34f010[_0x552fc3]={'$like':'%'+_0x33d6c4[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x34f010;})});}_0x34b016=_[_0x0249('0x51')]({},_0x34b016,_0x33d6c4[_0x0249('0x53')]);return _0x37cf69['getAgents'](_0x34b016);}})['then'](function(_0x4ea6b7){if(_0x4ea6b7){_0x488058=_0x4ea6b7['length'];if(!_0x33d6c4[_0x0249('0x45')][_0x0249('0x67')](_0x0249('0x4b'))){_0x34b016[_0x0249('0x32')]=qs['limit'](_0x33d6c4[_0x0249('0x45')][_0x0249('0x32')]);_0x34b016['offset']=qs[_0x0249('0x31')](_0x33d6c4[_0x0249('0x45')][_0x0249('0x31')]);}return _0x37cf69[_0x0249('0x9a')](_0x34b016);}})[_0x0249('0x24')](function(_0x262b37){if(_0x262b37){return _0x262b37?{'count':_0x488058,'rows':_0x262b37}:null;}})['then'](respondWithResult(_0x35054a,null))['catch'](handleError(_0x35054a,null));};
\ No newline at end of file
+var _0x453f=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','createdAt','%s/%s','Team','getTeams','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','ids','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','intersection','find'];(function(_0xea7072,_0xf4f740){var _0x5487c1=function(_0x4bce83){while(--_0x4bce83){_0xea7072['push'](_0xea7072['shift']());}};_0x5487c1(++_0xf4f740);}(_0x453f,0xd4));var _0xf453=function(_0xd63b78,_0x17cb52){_0xd63b78=_0xd63b78-0x0;var _0x169180=_0x453f[_0xd63b78];return _0x169180;};'use strict';var emlformat=require(_0xf453('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf453('0x1'));var jsonpatch=require(_0xf453('0x2'));var rp=require(_0xf453('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf453('0x4'));var util=require(_0xf453('0x5'));var path=require('path');var sox=require(_0xf453('0x6'));var csv=require(_0xf453('0x7'));var ejs=require(_0xf453('0x8'));var fs=require('fs');var fs_extra=require(_0xf453('0x9'));var _=require('lodash');var squel=require(_0xf453('0xa'));var crypto=require(_0xf453('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf453('0xc'));var toCsv=require(_0xf453('0x7'));var querystring=require(_0xf453('0xd'));var Papa=require(_0xf453('0xe'));var Redis=require(_0xf453('0xf'));var authService=require(_0xf453('0x10'));var qs=require(_0xf453('0x11'));var as=require(_0xf453('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf453('0x13'))(_0xf453('0x14'));var utils=require(_0xf453('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf453('0x16'));var db=require(_0xf453('0x17'))['db'];config['redis']=_[_0xf453('0x18')](config[_0xf453('0x19')],{'host':_0xf453('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf453('0x1b'))[_0xf453('0x1c')](socket);var jayson=require(_0xf453('0x1d'));var client=jayson[_0xf453('0x1e')][_0xf453('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x154aab,_0xd07df3,_0x4381c0,_0x62db02){return new BPromise(function(_0x29668d,_0x51985d){var _0x557600=_0x62db02||client;return _0x557600[_0xf453('0x20')](_0x154aab,_0x4381c0)[_0xf453('0x21')](function(_0x3aa431){logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));logger['debug'](_0xf453('0x25'),_0xd07df3,_0xf453('0x24'),JSON[_0xf453('0x26')](_0x3aa431));if(_0x3aa431['error']){if(_0x3aa431[_0xf453('0x27')][_0xf453('0x28')]===0x1f4){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x51985d(_0x3aa431['error'][_0xf453('0x29')]);}logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x29668d(_0x3aa431['error'][_0xf453('0x29')]);}else{logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));_0x29668d(_0x3aa431[_0xf453('0x2a')]['message']);}})[_0xf453('0x2b')](function(_0x502775){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x502775);_0x51985d(_0x502775);});});}function respondWithStatusCode(_0x2bce69,_0x484cc2){_0x484cc2=_0x484cc2||0xcc;return function(_0x31aa67){if(_0x31aa67){return _0x2bce69[_0xf453('0x2c')](_0x484cc2);}return _0x2bce69[_0xf453('0x2d')](_0x484cc2)['end']();};}function respondWithResult(_0xd288c9,_0x259683){_0x259683=_0x259683||0xc8;return function(_0x42cc39){if(_0x42cc39){return _0xd288c9[_0xf453('0x2d')](_0x259683)['json'](_0x42cc39);}};}function respondWithFilteredResult(_0x768a9e,_0xdb40f6){return function(_0x537836){if(_0x537836){var _0x469e83=typeof _0xdb40f6[_0xf453('0x2e')]===_0xf453('0x2f')&&typeof _0xdb40f6[_0xf453('0x30')]===_0xf453('0x2f');var _0x7c2ba=_0x537836[_0xf453('0x31')];var _0x4ec60b=_0x469e83?0x0:_0xdb40f6['offset'];var _0x302620=_0x469e83?_0x537836[_0xf453('0x31')]:_0xdb40f6['offset']+_0xdb40f6[_0xf453('0x30')];var _0x1e5ba6;if(_0x302620>=_0x7c2ba){_0x302620=_0x7c2ba;_0x1e5ba6=0xc8;}else{_0x1e5ba6=0xce;}_0x768a9e[_0xf453('0x2d')](_0x1e5ba6);return _0x768a9e[_0xf453('0x32')](_0xf453('0x33'),_0x4ec60b+'-'+_0x302620+'/'+_0x7c2ba)[_0xf453('0x34')](_0x537836);}return null;};}function patchUpdates(_0x58fa92){return function(_0x4642fd){try{jsonpatch[_0xf453('0x35')](_0x4642fd,_0x58fa92,!![]);}catch(_0x54738e){return BPromise[_0xf453('0x36')](_0x54738e);}return _0x4642fd[_0xf453('0x37')]();};}function saveUpdates(_0x101100,_0x427012){return function(_0x532b8a){if(_0x532b8a){return _0x532b8a[_0xf453('0x38')](_0x101100)[_0xf453('0x21')](function(_0x1059df){return _0x1059df;});}return null;};}function removeEntity(_0x18e2f8,_0x1c4e1c){return function(_0x1fb4bc){if(_0x1fb4bc){return _0x1fb4bc[_0xf453('0x39')]()[_0xf453('0x21')](function(){var _0x23cabf=_0x1fb4bc[_0xf453('0x3a')]({'plain':!![]});var _0x4870d1=_0xf453('0x3b');return db[_0xf453('0x3c')][_0xf453('0x39')]({'where':{'type':_0x4870d1,'resourceId':_0x23cabf['id']}})['then'](function(){return _0x1fb4bc;});})[_0xf453('0x21')](function(){_0x18e2f8[_0xf453('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331941,_0x31f74a){return function(_0x4ea64e){if(!_0x4ea64e){_0x331941[_0xf453('0x2c')](0x194);}return _0x4ea64e;};}function handleError(_0x2abccb,_0x2e0d85){_0x2e0d85=_0x2e0d85||0x1f4;return function(_0x29f88b){logger[_0xf453('0x27')](_0x29f88b[_0xf453('0x3d')]);if(_0x29f88b[_0xf453('0x3e')]){delete _0x29f88b[_0xf453('0x3e')];}_0x2abccb[_0xf453('0x2d')](_0x2e0d85)[_0xf453('0x3f')](_0x29f88b);};}exports[_0xf453('0x40')]=function(_0x292dfa,_0x4a7f9e){var _0x261d28={},_0x37cf71={},_0x45aab8={'count':0x0,'rows':[]};var _0x1bf473=_[_0xf453('0x41')](db[_0xf453('0x42')][_0xf453('0x43')],function(_0x46d624){return{'name':_0x46d624[_0xf453('0x44')],'type':_0x46d624[_0xf453('0x45')][_0xf453('0x46')]};});_0x37cf71[_0xf453('0x47')]=_['map'](_0x1bf473,_0xf453('0x3e'));_0x37cf71[_0xf453('0x48')]=_['keys'](_0x292dfa['query']);_0x37cf71['filters']=_['intersection'](_0x37cf71[_0xf453('0x47')],_0x37cf71[_0xf453('0x48')]);_0x261d28[_0xf453('0x49')]=_['intersection'](_0x37cf71['model'],qs[_0xf453('0x4a')](_0x292dfa[_0xf453('0x48')]['fields']));_0x261d28['attributes']=_0x261d28[_0xf453('0x49')][_0xf453('0x4b')]?_0x261d28[_0xf453('0x49')]:_0x37cf71[_0xf453('0x47')];if(!_0x292dfa['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x261d28[_0xf453('0x30')]=qs[_0xf453('0x30')](_0x292dfa[_0xf453('0x48')][_0xf453('0x30')]);_0x261d28[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x292dfa[_0xf453('0x48')][_0xf453('0x2e')]);}_0x261d28[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x292dfa['query'][_0xf453('0x4f')]);_0x261d28[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x292dfa['query'],_0x37cf71[_0xf453('0x51')]),_0x1bf473);if(_0x292dfa[_0xf453('0x48')]['filter']){_0x261d28['where']=_[_0xf453('0x53')](_0x261d28[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x1bf473,function(_0x6a60ea){if(_0x6a60ea[_0xf453('0x45')]!==_0xf453('0x54')){var _0x587dad={};_0x587dad[_0x6a60ea[_0xf453('0x3e')]]={'$like':'%'+_0x292dfa[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x587dad;}})});}_0x261d28=_[_0xf453('0x53')]({},_0x261d28,_0x292dfa[_0xf453('0x56')]);var _0x3a4146={'where':_0x261d28['where']};return db['ChatQueue'][_0xf453('0x31')](_0x3a4146)[_0xf453('0x21')](function(_0x5da753){_0x45aab8[_0xf453('0x31')]=_0x5da753;if(_0x292dfa[_0xf453('0x48')][_0xf453('0x57')]){_0x261d28[_0xf453('0x58')]=[{'all':!![]}];}return db[_0xf453('0x42')][_0xf453('0x59')](_0x261d28);})[_0xf453('0x21')](function(_0x5d6235){_0x45aab8[_0xf453('0x5a')]=_0x5d6235;return _0x45aab8;})[_0xf453('0x21')](respondWithFilteredResult(_0x4a7f9e,_0x261d28))[_0xf453('0x2b')](handleError(_0x4a7f9e,null));};exports[_0xf453('0x5b')]=function(_0x58d8f6,_0x31cb65){var _0x32ae03={'raw':!![],'where':{'id':_0x58d8f6[_0xf453('0x5c')]['id']}},_0x51a848={};_0x51a848[_0xf453('0x47')]=_[_0xf453('0x5d')](db['ChatQueue'][_0xf453('0x43')]);_0x51a848[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x58d8f6['query']);_0x51a848['filters']=_[_0xf453('0x5e')](_0x51a848['model'],_0x51a848[_0xf453('0x48')]);_0x32ae03[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x51a848['model'],qs['fields'](_0x58d8f6[_0xf453('0x48')][_0xf453('0x4a')]));_0x32ae03[_0xf453('0x49')]=_0x32ae03[_0xf453('0x49')][_0xf453('0x4b')]?_0x32ae03[_0xf453('0x49')]:_0x51a848['model'];if(_0x58d8f6[_0xf453('0x48')][_0xf453('0x57')]){_0x32ae03['include']=[{'all':!![]}];}_0x32ae03=_[_0xf453('0x53')]({},_0x32ae03,_0x58d8f6[_0xf453('0x56')]);return db[_0xf453('0x42')][_0xf453('0x5f')](_0x32ae03)[_0xf453('0x21')](handleEntityNotFound(_0x31cb65,null))[_0xf453('0x21')](respondWithResult(_0x31cb65,null))[_0xf453('0x2b')](handleError(_0x31cb65,null));};exports[_0xf453('0x60')]=function(_0x41319b,_0x518330){return db[_0xf453('0x42')][_0xf453('0x60')](_0x41319b[_0xf453('0x61')],{})[_0xf453('0x21')](function(_0x29d51c){var _0x473bf9=_0x41319b[_0xf453('0x62')][_0xf453('0x3a')]({'plain':!![]});if(!_0x473bf9)throw new Error(_0xf453('0x63'));if(_0x473bf9[_0xf453('0x64')]===_0xf453('0x62')){var _0x1a5aca=_0x29d51c['get']({'plain':!![]});var _0x26c54b=_0xf453('0x3b');return db['UserProfileSection'][_0xf453('0x5f')]({'where':{'name':_0x26c54b,'userProfileId':_0x473bf9[_0xf453('0x65')]},'raw':!![]})[_0xf453('0x21')](function(_0x24aaab){if(_0x24aaab&&_0x24aaab[_0xf453('0x66')]===0x0){return db[_0xf453('0x3c')][_0xf453('0x60')]({'name':_0x1a5aca['name'],'resourceId':_0x1a5aca['id'],'type':_0x24aaab[_0xf453('0x3e')],'sectionId':_0x24aaab['id']},{})[_0xf453('0x21')](function(){return _0x29d51c;});}else{return _0x29d51c;}})['catch'](function(_0x1ff00c){logger[_0xf453('0x27')](_0xf453('0x67'),_0x1ff00c);throw _0x1ff00c;});}return _0x29d51c;})['then'](respondWithResult(_0x518330,0xc9))['catch'](handleError(_0x518330,null));};exports['update']=function(_0xcf1d20,_0xa68f3b){if(_0xcf1d20['body']['id']){delete _0xcf1d20['body']['id'];}return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0xcf1d20[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0xa68f3b,null))[_0xf453('0x21')](saveUpdates(_0xcf1d20['body'],null))[_0xf453('0x21')](respondWithResult(_0xa68f3b,null))['catch'](handleError(_0xa68f3b,null));};exports[_0xf453('0x39')]=function(_0x4dff78,_0x4d015e){return db['ChatQueue']['find']({'where':{'id':_0x4dff78[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d015e,null))[_0xf453('0x21')](removeEntity(_0x4d015e,null))[_0xf453('0x2b')](handleError(_0x4d015e,null));};exports['describe']=function(_0x1fa18f,_0x467b3d){return db[_0xf453('0x42')][_0xf453('0x68')]()['then'](respondWithResult(_0x467b3d,null))[_0xf453('0x2b')](handleError(_0x467b3d,null));};exports[_0xf453('0x69')]=function(_0x40ef05,_0x4b1166,_0x302597){var _0xcaf2e0={'raw':!![],'where':{}},_0x444f58={},_0x5f45bd;return db[_0xf453('0x42')][_0xf453('0x6a')]({'where':{'id':_0x40ef05[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b1166,null))[_0xf453('0x21')](function(_0x282f7e){if(_0x282f7e){_0x5f45bd=_0x282f7e['get']({'plain':!![]});_0x444f58[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x6b')][_0xf453('0x43')]);_0x444f58[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x40ef05[_0xf453('0x48')]);_0x444f58[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],_0x444f58[_0xf453('0x48')]);_0xcaf2e0[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],qs[_0xf453('0x4a')](_0x40ef05['query'][_0xf453('0x4a')]));_0xcaf2e0['attributes']=_0xcaf2e0['attributes'][_0xf453('0x4b')]?_0xcaf2e0['attributes']:_0x444f58['model'];if(!_0x40ef05[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0xcaf2e0['limit']=qs['limit'](_0x40ef05['query'][_0xf453('0x30')]);_0xcaf2e0[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40ef05['query'][_0xf453('0x2e')]);}_0xcaf2e0['order']=qs[_0xf453('0x4f')](_0x40ef05[_0xf453('0x48')][_0xf453('0x4f')]);_0xcaf2e0[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x40ef05[_0xf453('0x48')],_0x444f58['filters']));_0xcaf2e0['where'][_0xf453('0x6c')]=_0x282f7e['id'];if(_0x40ef05['query'][_0xf453('0x55')]){_0xcaf2e0[_0xf453('0x50')]=_[_0xf453('0x53')](_0xcaf2e0[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0xcaf2e0[_0xf453('0x49')],function(_0x2f1a78){var _0x2b36cd={};_0x2b36cd[_0x2f1a78]={'$like':'%'+_0x40ef05['query']['filter']+'%'};return _0x2b36cd;})});}_0xcaf2e0=_[_0xf453('0x53')]({},_0xcaf2e0,_0x40ef05[_0xf453('0x56')]);return db[_0xf453('0x6b')][_0xf453('0x59')](_0xcaf2e0);}})[_0xf453('0x21')](function(_0x47078e){if(_0x47078e){return db[_0xf453('0x6d')]['findAndCountAll']({'where':{'id':_['map'](_0x47078e,'UserId'),'role':_0xf453('0x6e')},'attributes':['id',_0xf453('0x3e'),_0xf453('0x6f'),_0xf453('0x70'),_0xf453('0x71')]});}})[_0xf453('0x21')](function(_0x251647){if(_0x251647){return{'count':_0x251647['count'],'rows':_[_0xf453('0x41')](_0x251647[_0xf453('0x5a')],function(_0x2a0490){return{'membername':_0x2a0490[_0xf453('0x3e')],'UserId':_0x2a0490['id'],'queue_name':_0x5f45bd[_0xf453('0x3e')],'ChatQueueId':_0x5f45bd['id'],'interface':util['format'](_0xf453('0x72'),'SIP',_0x2a0490[_0xf453('0x3e')]),'penalty':0x0,'paused':_0x2a0490[_0xf453('0x6f')],'createdAt':_0x2a0490['createdAt'],'updatedAt':_0x2a0490['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf453('0x21')](respondWithFilteredResult(_0x4b1166,_0xcaf2e0))[_0xf453('0x2b')](handleError(_0x4b1166,null));};exports['getTeams']=function(_0x478a90,_0x3020d1,_0x263ca5){var _0x200a0c={};var _0x2e51f0={};var _0x4478d8;var _0x5897d9;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x478a90[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3020d1,null))[_0xf453('0x21')](function(_0x1ca998){if(_0x1ca998){_0x4478d8=_0x1ca998;_0x2e51f0[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x73')][_0xf453('0x43')]);_0x2e51f0[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x478a90[_0xf453('0x48')]);_0x2e51f0['filters']=_[_0xf453('0x5e')](_0x2e51f0[_0xf453('0x47')],_0x2e51f0[_0xf453('0x48')]);_0x200a0c[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x2e51f0['model'],qs[_0xf453('0x4a')](_0x478a90['query']['fields']));_0x200a0c[_0xf453('0x49')]=_0x200a0c['attributes']['length']?_0x200a0c[_0xf453('0x49')]:_0x2e51f0[_0xf453('0x47')];_0x200a0c[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x478a90[_0xf453('0x48')][_0xf453('0x4f')]);_0x200a0c[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x478a90[_0xf453('0x48')],_0x2e51f0[_0xf453('0x51')]));if(_0x478a90[_0xf453('0x48')][_0xf453('0x55')]){_0x200a0c[_0xf453('0x50')]=_[_0xf453('0x53')](_0x200a0c[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x200a0c[_0xf453('0x49')],function(_0xef085f){var _0x25e1ea={};_0x25e1ea[_0xef085f]={'$like':'%'+_0x478a90[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x25e1ea;})});}_0x200a0c=_[_0xf453('0x53')]({},_0x200a0c,_0x478a90[_0xf453('0x56')]);return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x183109){if(_0x183109){_0x5897d9=_0x183109[_0xf453('0x4b')];if(!_0x478a90[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0x200a0c['limit']=qs[_0xf453('0x30')](_0x478a90[_0xf453('0x48')][_0xf453('0x30')]);_0x200a0c['offset']=qs[_0xf453('0x2e')](_0x478a90[_0xf453('0x48')]['offset']);}return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x4c4e56){if(_0x4c4e56){return _0x4c4e56?{'count':_0x5897d9,'rows':_0x4c4e56}:null;}})[_0xf453('0x21')](respondWithResult(_0x3020d1,null))[_0xf453('0x2b')](handleError(_0x3020d1,null));};exports['addTeams']=function(_0x47ea0b,_0x3fe343,_0x3983bb){var _0x282d7c=_0x47ea0b[_0xf453('0x61')]['ids'];return db[_0xf453('0x73')][_0xf453('0x59')]({'where':{'id':_0x282d7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf453('0x75'),'attributes':['id',_0xf453('0x3e'),_0xf453('0x76'),_0xf453('0x77'),_0xf453('0x78')],'raw':!![]}]})[_0xf453('0x21')](function(_0x5405e7){if(_0x5405e7){var _0x20f2f6=_[_0xf453('0x79')](_0x5405e7,function(_0x5ac073){var _0x2f414e=_0x5ac073[_0xf453('0x3a')]({'plain':!![]});return _0x2f414e[_0xf453('0x75')];});return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x47ea0b['params']['id']}})[_0xf453('0x21')](function(_0x14e8fa){return db['sequelize'][_0xf453('0x7a')](function(_0x26afba){return _0x14e8fa[_0xf453('0x7b')](_0x282d7c,{'transaction':_0x26afba})[_0xf453('0x21')](function(){return BPromise[_0xf453('0x7c')](_0x20f2f6,function(_0x499d71){return db[_0xf453('0x6b')][_0xf453('0x7d')]({'where':{'UserId':_0x499d71['id'],'ChatQueueId':_0x47ea0b[_0xf453('0x5c')]['id']},'transaction':_0x26afba});});})[_0xf453('0x21')](function(){_0x20f2f6[_0xf453('0x7e')](function(_0x1b2151){socket[_0xf453('0x7f')](_0xf453('0x80'),{'UserId':_0x1b2151['id'],'ChatQueueId':_0x14e8fa['id']});});});});});}})[_0xf453('0x21')](respondWithStatusCode(_0x3fe343,null))[_0xf453('0x2b')](handleError(_0x3fe343,null));};exports[_0xf453('0x81')]=function(_0x1cc4ac,_0x3702f7,_0x44be19){return db['Team']['findAll']({'where':{'id':_0x1cc4ac[_0xf453('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf453('0x6d')],'as':_0xf453('0x75'),'attributes':['id'],'raw':!![]}]})[_0xf453('0x21')](handleEntityNotFound(_0x3702f7,null))[_0xf453('0x21')](function(_0x27385d){var _0x12f34c=_['map'](_0x27385d,'id');var _0x263b13=[];var _0x1f3e8e=[];var _0x406e6f=squel['select']();_0x406e6f[_0xf453('0x82')](_0xf453('0x83'))['from'](_0xf453('0x84'),'tq')['join']('user_has_teams','ut',_0xf453('0x85'))[_0xf453('0x50')](_0xf453('0x86'),_0x1cc4ac[_0xf453('0x5c')]['id']);for(var _0x172b25=0x0;_0x172b25<_0x27385d[_0xf453('0x4b')];_0x172b25+=0x1){let _0x41a049=_0x27385d[_0x172b25];for(var _0x2d729f=0x0;_0x2d729f<_0x41a049[_0xf453('0x75')][_0xf453('0x4b')];_0x2d729f+=0x1){let _0x163459=_0x41a049[_0xf453('0x75')][_0x2d729f];var _0x5c7d6a=_0x406e6f[_0xf453('0x87')]();_0x5c7d6a[_0xf453('0x50')]('ut.UserId\x20=\x20?',_0x163459['id']);_0x1f3e8e[_0xf453('0x88')](db[_0xf453('0x89')][_0xf453('0x48')](_0x5c7d6a[_0xf453('0x8a')](),{'type':db['sequelize'][_0xf453('0x8b')][_0xf453('0x8c')]})[_0xf453('0x21')](function(_0x46158d){if(_0x46158d['length']===0x1){return _0x163459['id'];}else{var _0x338532=_[_0xf453('0x8d')](_['map'](_0x46158d,_0xf453('0x8e')),function(_0xb7f8f5){return _['includes'](_0x12f34c,_0xb7f8f5);});if(_0x338532){return _0x163459['id'];}}}));}}return BPromise[_0xf453('0x8f')](_0x1f3e8e)[_0xf453('0x21')](function(_0x5d1d4d){_0x263b13=_(_0x263b13)[_0xf453('0x90')](_0x5d1d4d)[_0xf453('0x91')]()[_0xf453('0x92')]();return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x1cc4ac[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](function(_0x358ac2){return db[_0xf453('0x89')][_0xf453('0x7a')](function(_0x2320b1){return _0x358ac2['removeTeams'](_0x1cc4ac[_0xf453('0x48')]['ids'],{'transaction':_0x2320b1})[_0xf453('0x21')](function(){if(!_['isEmpty'](_0x263b13)){return _0x358ac2[_0xf453('0x93')](_0x263b13,{'transaction':_0x2320b1});}})[_0xf453('0x21')](function(){_0x263b13[_0xf453('0x7e')](function(_0x3e8646){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':_0x3e8646,'ChatQueueId':_0x358ac2['id']});});});});});});})['then'](respondWithStatusCode(_0x3702f7,null))[_0xf453('0x2b')](handleError(_0x3702f7,null));};exports[_0xf453('0x95')]=function(_0x4708cf,_0x4dc14b,_0x3e5d4f){return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0x4708cf[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x4dc14b,null))[_0xf453('0x21')](function(_0x380336){if(_0x380336){return _0x380336['addAgents'](_0x4708cf[_0xf453('0x61')][_0xf453('0x96')],_[_0xf453('0x97')](_0x4708cf['body'],[_0xf453('0x96'),'id'])||{})[_0xf453('0x98')](function(_0xda95cb){for(var _0x42ad51=0x0;_0x42ad51<_0x4708cf['body'][_0xf453('0x96')][_0xf453('0x4b')];_0x42ad51+=0x1){socket[_0xf453('0x7f')]('userChatQueue:save',{'UserId':Number(_0x4708cf[_0xf453('0x61')]['ids'][_0x42ad51]),'ChatQueueId':Number(_0x4708cf['params']['id'])});}return _0xda95cb;});}})[_0xf453('0x21')](respondWithResult(_0x4dc14b,null))[_0xf453('0x2b')](handleError(_0x4dc14b,null));};exports[_0xf453('0x93')]=function(_0x32ebf5,_0x1e2434,_0x19be79){return db['ChatQueue']['find']({'where':{'id':_0x32ebf5[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x1e2434,null))[_0xf453('0x21')](function(_0x5a4eea){if(_0x5a4eea){return _0x5a4eea[_0xf453('0x93')](_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')])['then'](function(){if(_['isArray'](_0x32ebf5[_0xf453('0x48')]['ids'])){for(var _0x163a6c=0x0;_0x163a6c<_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0xf453('0x4b')];_0x163a6c+=0x1){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':Number(_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0x163a6c]),'ChatQueueId':Number(_0x32ebf5[_0xf453('0x5c')]['id'])});}}else{socket['emit'](_0xf453('0x94'),{'UserId':Number(_0x32ebf5['query'][_0xf453('0x96')]),'ChatQueueId':Number(_0x32ebf5['params']['id'])});}});}})[_0xf453('0x21')](respondWithStatusCode(_0x1e2434,null))[_0xf453('0x2b')](handleError(_0x1e2434,null));};exports[_0xf453('0x99')]=function(_0x40f408,_0x3298cc,_0x318aaf){var _0x474796={};var _0x1e88df={};var _0x231acf;var _0x4735d3;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x40f408[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3298cc,null))['then'](function(_0xfd656b){if(_0xfd656b){_0x231acf=_0xfd656b;_0x1e88df[_0xf453('0x47')]=_[_0xf453('0x5d')](db['User'][_0xf453('0x43')]);_0x1e88df['query']=_[_0xf453('0x5d')](_0x40f408['query']);_0x1e88df[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x1e88df[_0xf453('0x47')],_0x1e88df['query']);_0x474796['attributes']=_['intersection'](_0x1e88df['model'],qs[_0xf453('0x4a')](_0x40f408['query'][_0xf453('0x4a')]));_0x474796[_0xf453('0x49')]=_0x474796[_0xf453('0x49')]['length']?_0x474796[_0xf453('0x49')]:_0x1e88df['model'];_0x474796[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x40f408[_0xf453('0x48')][_0xf453('0x4f')]);_0x474796[_0xf453('0x50')]=qs[_0xf453('0x51')](_['pick'](_0x40f408[_0xf453('0x48')],_0x1e88df[_0xf453('0x51')]));if(_0x40f408[_0xf453('0x48')][_0xf453('0x55')]){_0x474796['where']=_[_0xf453('0x53')](_0x474796['where'],{'$or':_[_0xf453('0x41')](_0x474796[_0xf453('0x49')],function(_0xbe8e97){var _0x201326={};_0x201326[_0xbe8e97]={'$like':'%'+_0x40f408['query']['filter']+'%'};return _0x201326;})});}_0x474796=_[_0xf453('0x53')]({},_0x474796,_0x40f408[_0xf453('0x56')]);return _0x231acf['getAgents'](_0x474796);}})['then'](function(_0x27eff1){if(_0x27eff1){_0x4735d3=_0x27eff1['length'];if(!_0x40f408['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x474796['limit']=qs[_0xf453('0x30')](_0x40f408[_0xf453('0x48')]['limit']);_0x474796[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40f408[_0xf453('0x48')]['offset']);}return _0x231acf['getAgents'](_0x474796);}})[_0xf453('0x21')](function(_0x6f418a){if(_0x6f418a){return _0x6f418a?{'count':_0x4735d3,'rows':_0x6f418a}:null;}})[_0xf453('0x21')](respondWithResult(_0x3298cc,null))['catch'](handleError(_0x3298cc,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e43e5bc..7c759f8 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 _0xd285=['../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17d819,_0x20b7c0){var _0x5b6e5e=function(_0x294dab){while(--_0x294dab){_0x17d819['push'](_0x17d819['shift']());}};_0x5b6e5e(++_0x20b7c0);}(_0xd285,0x132));var _0x5d28=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0xd285[_0x1b2255];return _0x33e57d;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5d28('0x0'))['db'][_0x5d28('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d28('0x2'),'afterUpdate':_0x5d28('0x3'),'afterDestroy':_0x5d28('0x4')};function emitEvent(_0xb8fcdb){return function(_0x1bfd0e,_0x1c988c,_0x3e3185){ChatQueueEvents['emit'](_0xb8fcdb+':'+_0x1bfd0e['id'],_0x1bfd0e);ChatQueueEvents[_0x5d28('0x5')](_0xb8fcdb,_0x1bfd0e);_0x3e3185(null);};}for(var e in events){if(events[_0x5d28('0x6')](e)){var event=events[e];ChatQueue[_0x5d28('0x7')](e,emitEvent(event));}}module[_0x5d28('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7aaf=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x7aaf,0x1dc));var _0xf7aa=function(_0x3b30ec,_0x451311){_0x3b30ec=_0x3b30ec-0x0;var _0x4130e=_0x7aaf[_0x3b30ec];return _0x4130e;};'use strict';var EventEmitter=require(_0xf7aa('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf7aa('0x1')](0x0);var events={'afterCreate':_0xf7aa('0x2'),'afterUpdate':'update','afterDestroy':_0xf7aa('0x3')};function emitEvent(_0x3918a0){return function(_0x122c4a,_0x81d283,_0x21482c){ChatQueueEvents[_0xf7aa('0x4')](_0x3918a0+':'+_0x122c4a['id'],_0x122c4a);ChatQueueEvents['emit'](_0x3918a0,_0x122c4a);_0x21482c(null);};}for(var e in events){if(events[_0xf7aa('0x5')](e)){var event=events[e];ChatQueue[_0xf7aa('0x6')](e,emitEvent(event));}}module[_0xf7aa('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 376bd07..7561f65 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 _0x6063=['define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x6063,0x107));var _0x3606=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6063[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x3606('0x0'));var logger=require(_0x3606('0x1'))(_0x3606('0x2'));var moment=require(_0x3606('0x3'));var BPromise=require(_0x3606('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3606('0x5'));var rimraf=require(_0x3606('0x6'));var config=require(_0x3606('0x7'));var attributes=require(_0x3606('0x8'));module[_0x3606('0x9')]=function(_0xddc808,_0x1fe51f){return _0xddc808[_0x3606('0xa')](_0x3606('0xb'),attributes,{'tableName':_0x3606('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14dd=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util'];(function(_0x469f66,_0x2daba6){var _0x442f79=function(_0x320cc7){while(--_0x320cc7){_0x469f66['push'](_0x469f66['shift']());}};_0x442f79(++_0x2daba6);}(_0x14dd,0x172));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd14d('0x0'));var util=require(_0xd14d('0x1'));var logger=require(_0xd14d('0x2'))(_0xd14d('0x3'));var moment=require('moment');var BPromise=require(_0xd14d('0x4'));var rp=require(_0xd14d('0x5'));var fs=require('fs');var path=require(_0xd14d('0x6'));var rimraf=require('rimraf');var config=require(_0xd14d('0x7'));var attributes=require(_0xd14d('0x8'));module[_0xd14d('0x9')]=function(_0x4d4436,_0x12fb59){return _0x4d4436[_0xd14d('0xa')]('ChatQueue',attributes,{'tableName':_0xd14d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index afa474d..f1d7fe3 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 _0x64e6=['code','error','message','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','find','model','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x1a308b,_0x14560f){var _0x388b10=function(_0x5645d4){while(--_0x5645d4){_0x1a308b['push'](_0x1a308b['shift']());}};_0x388b10(++_0x14560f);}(_0x64e6,0x1b2));var _0x664e=function(_0x20a73d,_0x18df5c){_0x20a73d=_0x20a73d-0x0;var _0x368a87=_0x64e6[_0x20a73d];return _0x368a87;};'use strict';var _=require(_0x664e('0x0'));var util=require('util');var moment=require(_0x664e('0x1'));var BPromise=require(_0x664e('0x2'));var rs=require(_0x664e('0x3'));var fs=require('fs');var Redis=require(_0x664e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x664e('0x5'))('rpc');var config=require(_0x664e('0x6'));var jayson=require(_0x664e('0x7'));var client=jayson['client'][_0x664e('0x8')]({'port':0x232a});config[_0x664e('0x9')]=_[_0x664e('0xa')](config['redis'],{'host':_0x664e('0xb'),'port':0x18eb});var socket=require(_0x664e('0xc'))(new Redis(config[_0x664e('0x9')]));require(_0x664e('0xd'))[_0x664e('0xe')](socket);function respondWithRpcPromise(_0x2bc4cc,_0x5544aa,_0x294c98){return new BPromise(function(_0x2ded79,_0x245170){return client[_0x664e('0xf')](_0x2bc4cc,_0x294c98)[_0x664e('0x10')](function(_0x50b700){logger[_0x664e('0x11')](_0x664e('0x12'),_0x5544aa,'request\x20sent');logger[_0x664e('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5544aa,_0x664e('0x14'),JSON[_0x664e('0x15')](_0x50b700));if(_0x50b700['error']){if(_0x50b700['error'][_0x664e('0x16')]===0x1f4){logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x50b700[_0x664e('0x17')][_0x664e('0x18')]);return _0x245170(_0x50b700[_0x664e('0x17')][_0x664e('0x18')]);}logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x50b700[_0x664e('0x17')]['message']);return _0x2ded79(_0x50b700[_0x664e('0x17')]['message']);}else{logger[_0x664e('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x664e('0x14'));_0x2ded79(_0x50b700[_0x664e('0x19')]['message']);}})[_0x664e('0x1a')](function(_0x39e9f0){logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x39e9f0);_0x245170(_0x39e9f0);});});}exports[_0x664e('0x1b')]=function(_0x49b444){var _0x1cf289=this;return new Promise(function(_0x896c86,_0x3b5c0a){return db['ChatQueue']['findAll']({'raw':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x1d')]===undefined?!![]:![]:!![],'where':_0x49b444[_0x664e('0x1c')]?_0x49b444[_0x664e('0x1c')][_0x664e('0x1e')]||null:null,'attributes':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x1f')]||null:null,'limit':_0x49b444[_0x664e('0x1c')]?_0x49b444[_0x664e('0x1c')][_0x664e('0x20')]||null:null,'include':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x21')]?_[_0x664e('0x22')](_0x49b444[_0x664e('0x1c')][_0x664e('0x21')],function(_0x7e3679){return{'model':db[_0x7e3679['model']],'as':_0x7e3679['as'],'attributes':_0x7e3679[_0x664e('0x1f')],'include':_0x7e3679[_0x664e('0x21')]?_['map'](_0x7e3679[_0x664e('0x21')],function(_0x28980d){return{'model':db[_0x28980d['model']],'as':_0x28980d['as'],'attributes':_0x28980d[_0x664e('0x1f')],'include':_0x28980d[_0x664e('0x21')]?_[_0x664e('0x22')](_0x28980d['include'],function(_0x35220f){return{'model':db[_0x35220f['model']],'as':_0x35220f['as'],'attributes':_0x35220f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27ef96){logger[_0x664e('0x11')](_0x664e('0x1b'),_0x49b444);logger[_0x664e('0x13')](_0x664e('0x1b'),_0x49b444,JSON[_0x664e('0x15')](_0x27ef96));_0x896c86(_0x27ef96);})[_0x664e('0x1a')](function(_0x4d9612){logger['error'](_0x664e('0x1b'),_0x4d9612[_0x664e('0x18')],_0x49b444);_0x3b5c0a(_0x1cf289[_0x664e('0x17')](0x1f4,_0x4d9612[_0x664e('0x18')]));});});};exports['ShowChatQueue']=function(_0x32f8c8){var _0x22b618=this;return new Promise(function(_0x2904f8,_0x14b02b){return db['ChatQueue'][_0x664e('0x23')]({'raw':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1d')]===undefined?!![]:![]:!![],'where':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1e')]||null:null,'attributes':_0x32f8c8['options']?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1f')]||null:null,'include':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8['options'][_0x664e('0x21')]?_[_0x664e('0x22')](_0x32f8c8['options'][_0x664e('0x21')],function(_0x435c71){return{'model':db[_0x435c71['model']],'as':_0x435c71['as'],'attributes':_0x435c71[_0x664e('0x1f')],'include':_0x435c71[_0x664e('0x21')]?_['map'](_0x435c71[_0x664e('0x21')],function(_0x2e8c29){return{'model':db[_0x2e8c29['model']],'as':_0x2e8c29['as'],'attributes':_0x2e8c29['attributes'],'include':_0x2e8c29[_0x664e('0x21')]?_[_0x664e('0x22')](_0x2e8c29[_0x664e('0x21')],function(_0x6e5f91){return{'model':db[_0x6e5f91[_0x664e('0x24')]],'as':_0x6e5f91['as'],'attributes':_0x6e5f91['attributes']};}):[]};}):[]};}):[]:[]})[_0x664e('0x10')](function(_0x1f71f0){logger[_0x664e('0x11')](_0x664e('0x25'),_0x32f8c8);logger[_0x664e('0x13')](_0x664e('0x25'),_0x32f8c8,JSON[_0x664e('0x15')](_0x1f71f0));_0x2904f8(_0x1f71f0);})[_0x664e('0x1a')](function(_0x5af41c){logger[_0x664e('0x17')](_0x664e('0x25'),_0x5af41c[_0x664e('0x18')],_0x32f8c8);_0x14b02b(_0x22b618['error'](0x1f4,_0x5af41c['message']));});});};
\ No newline at end of file
+var _0x1aab=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x28ea86,_0x7402c6){var _0x25a519=function(_0x5edafb){while(--_0x5edafb){_0x28ea86['push'](_0x28ea86['shift']());}};_0x25a519(++_0x7402c6);}(_0x1aab,0x122));var _0xb1aa=function(_0x56f75c,_0x32b053){_0x56f75c=_0x56f75c-0x0;var _0x34ba47=_0x1aab[_0x56f75c];return _0x34ba47;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});config[_0xb1aa('0xa')]=_[_0xb1aa('0xb')](config[_0xb1aa('0xa')],{'host':_0xb1aa('0xc'),'port':0x18eb});var socket=require(_0xb1aa('0xd'))(new Redis(config[_0xb1aa('0xa')]));require('./chatQueue.socket')[_0xb1aa('0xe')](socket);function respondWithRpcPromise(_0x3ad2cf,_0x4ecea1,_0x16af92){return new BPromise(function(_0x14f02f,_0x7525e6){return client[_0xb1aa('0xf')](_0x3ad2cf,_0x16af92)[_0xb1aa('0x10')](function(_0x317da5){logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));logger[_0xb1aa('0x14')](_0xb1aa('0x15'),_0x4ecea1,_0xb1aa('0x13'),JSON[_0xb1aa('0x16')](_0x317da5));if(_0x317da5[_0xb1aa('0x17')]){if(_0x317da5[_0xb1aa('0x17')]['code']===0x1f4){logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x7525e6(_0x317da5['error'][_0xb1aa('0x18')]);}logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x14f02f(_0x317da5[_0xb1aa('0x17')]['message']);}else{logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));_0x14f02f(_0x317da5[_0xb1aa('0x19')][_0xb1aa('0x18')]);}})[_0xb1aa('0x1a')](function(_0x40c985){logger[_0xb1aa('0x17')](_0xb1aa('0x12'),_0x4ecea1,_0x40c985);_0x7525e6(_0x40c985);});});}exports[_0xb1aa('0x1b')]=function(_0x142c6d){var _0x346858=this;return new Promise(function(_0x452e6b,_0x5ca191){return db['ChatQueue'][_0xb1aa('0x1c')]({'raw':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'limit':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d['options']['limit']||null:null,'include':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x26ec21){return{'model':db[_0x26ec21[_0xb1aa('0x23')]],'as':_0x26ec21['as'],'attributes':_0x26ec21[_0xb1aa('0x20')],'include':_0x26ec21[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x26ec21[_0xb1aa('0x21')],function(_0x34b5e8){return{'model':db[_0x34b5e8[_0xb1aa('0x23')]],'as':_0x34b5e8['as'],'attributes':_0x34b5e8[_0xb1aa('0x20')],'include':_0x34b5e8['include']?_[_0xb1aa('0x22')](_0x34b5e8[_0xb1aa('0x21')],function(_0x3c1b92){return{'model':db[_0x3c1b92[_0xb1aa('0x23')]],'as':_0x3c1b92['as'],'attributes':_0x3c1b92['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x44ac69){logger['info'](_0xb1aa('0x1b'),_0x142c6d);logger[_0xb1aa('0x14')](_0xb1aa('0x1b'),_0x142c6d,JSON['stringify'](_0x44ac69));_0x452e6b(_0x44ac69);})[_0xb1aa('0x1a')](function(_0x120cc3){logger['error']('GetChatQueue',_0x120cc3[_0xb1aa('0x18')],_0x142c6d);_0x5ca191(_0x346858[_0xb1aa('0x17')](0x1f4,_0x120cc3[_0xb1aa('0x18')]));});});};exports[_0xb1aa('0x24')]=function(_0x28ad9a){var _0x1d0f05=this;return new Promise(function(_0x51000f,_0x42ff4a){return db['ChatQueue']['find']({'raw':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'include':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a['options']['include']?_['map'](_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x2b49d6){return{'model':db[_0x2b49d6[_0xb1aa('0x23')]],'as':_0x2b49d6['as'],'attributes':_0x2b49d6['attributes'],'include':_0x2b49d6[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x2b49d6[_0xb1aa('0x21')],function(_0x30cee3){return{'model':db[_0x30cee3['model']],'as':_0x30cee3['as'],'attributes':_0x30cee3[_0xb1aa('0x20')],'include':_0x30cee3[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x30cee3['include'],function(_0xf2ed78){return{'model':db[_0xf2ed78[_0xb1aa('0x23')]],'as':_0xf2ed78['as'],'attributes':_0xf2ed78[_0xb1aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x2f8443){logger[_0xb1aa('0x11')](_0xb1aa('0x24'),_0x28ad9a);logger[_0xb1aa('0x14')](_0xb1aa('0x24'),_0x28ad9a,JSON['stringify'](_0x2f8443));_0x51000f(_0x2f8443);})[_0xb1aa('0x1a')](function(_0x4a6ce0){logger[_0xb1aa('0x17')](_0xb1aa('0x24'),_0x4a6ce0[_0xb1aa('0x18')],_0x28ad9a);_0x42ff4a(_0x1d0f05[_0xb1aa('0x17')](0x1f4,_0x4a6ce0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ea814f8..a7a5744 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 _0xe5b3=['remove','update','emit','removeListener','register','chatQueue:','save'];(function(_0x190e61,_0x45b2a7){var _0x53ce76=function(_0x40bbad){while(--_0x40bbad){_0x190e61['push'](_0x190e61['shift']());}};_0x53ce76(++_0x45b2a7);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2e1c63,_0x576c5b){_0x2e1c63=_0x2e1c63-0x0;var _0x224607=_0xe5b3[_0x2e1c63];return _0x224607;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x3e5b('0x0'),_0x3e5b('0x1'),_0x3e5b('0x2')];function createListener(_0x1c38ed,_0x2a71ef){return function(_0x3171c5){_0x2a71ef[_0x3e5b('0x3')](_0x1c38ed,_0x3171c5);};}function removeListener(_0x1e58ed,_0x320b1e){return function(){ChatQueueEvents[_0x3e5b('0x4')](_0x1e58ed,_0x320b1e);};}exports[_0x3e5b('0x5')]=function(_0x54e1fb){for(var _0x174923=0x0,_0x5dcf55=events['length'];_0x174923<_0x5dcf55;_0x174923++){var _0x41d46f=events[_0x174923];var _0x3901c2=createListener(_0x3e5b('0x6')+_0x41d46f,_0x54e1fb);ChatQueueEvents['on'](_0x41d46f,_0x3901c2);}};
\ No newline at end of file
+var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5eb2bf,_0x3929ec){_0x5eb2bf=_0x5eb2bf-0x0;var _0x1ce48e=_0x9bde[_0x5eb2bf];return _0x1ce48e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ce154a7..41db94c 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x8b4cdb,_0x1c9023){var _0x185628=function(_0xf4b4f2){while(--_0xf4b4f2){_0x8b4cdb['push'](_0x8b4cdb['shift']());}};_0x185628(++_0x1c9023);}(_0x814b,0x1a2));var _0xb814=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x814b[_0x261b8a];return _0x3455e8;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55893f,_0x3edced){var _0xded9b=function(_0x3c43ef){while(--_0x3c43ef){_0x55893f['push'](_0x55893f['shift']());}};_0xded9b(++_0x3edced);}(_0x008c,0x188));var _0xc008=function(_0x5e9c3a,_0x13acc2){_0x5e9c3a=_0x5e9c3a-0x0;var _0x12ccb4=_0x008c[_0x5e9c3a];return _0x12ccb4;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 4039c55..34d565d 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 _0xcf6a=['DATE','STRING','moment','sequelize','exports'];(function(_0x581041,_0x5bd550){var _0xdcae4=function(_0x38d1a3){while(--_0x38d1a3){_0x581041['push'](_0x581041['shift']());}};_0xdcae4(++_0x5bd550);}(_0xcf6a,0xbb));var _0xacf6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xcf6a[_0x5834bc];return _0x3e183a;};'use strict';var moment=require(_0xacf6('0x0'));var Sequelize=require(_0xacf6('0x1'));module[_0xacf6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xacf6('0x3')]},'leaveAt':{'type':Sequelize[_0xacf6('0x3')]},'acceptAt':{'type':Sequelize[_0xacf6('0x3')]},'exitAt':{'type':Sequelize[_0xacf6('0x3')]},'reason':{'type':Sequelize[_0xacf6('0x4')]}};
\ No newline at end of file
+var _0xfa57=['moment','sequelize','exports','STRING','DATE'];(function(_0x260511,_0x336f67){var _0x507f2=function(_0x46ceb7){while(--_0x46ceb7){_0x260511['push'](_0x260511['shift']());}};_0x507f2(++_0x336f67);}(_0xfa57,0xe6));var _0x7fa5=function(_0x4aa8ef,_0x3d922a){_0x4aa8ef=_0x4aa8ef-0x0;var _0x2f1c74=_0xfa57[_0x4aa8ef];return _0x2f1c74;};'use strict';var moment=require(_0x7fa5('0x0'));var Sequelize=require(_0x7fa5('0x1'));module[_0x7fa5('0x2')]={'uniqueid':{'type':Sequelize[_0x7fa5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7fa5('0x3')]},'joinAt':{'type':Sequelize[_0x7fa5('0x4')]},'leaveAt':{'type':Sequelize[_0x7fa5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7fa5('0x4')]},'reason':{'type':Sequelize[_0x7fa5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 501ac0b..0d44195 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 _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x687b,0x14a));var _0xb687=function(_0x2a6193,_0x2ec097){_0x2a6193=_0x2a6193-0x0;var _0x317a31=_0x687b[_0x2a6193];return _0x317a31;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['ChatQueueReport'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));};
\ No newline at end of file
+var _0x7c09=['map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x5bf172,_0x50b1c4){var _0x824c0c=function(_0x379459){while(--_0x379459){_0x5bf172['push'](_0x5bf172['shift']());}};_0x824c0c(++_0x50b1c4);}(_0x7c09,0x102));var _0x97c0=function(_0x4e267d,_0x18c2b7){_0x4e267d=_0x4e267d-0x0;var _0x4ae1b2=_0x7c09[_0x4e267d];return _0x4ae1b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['ChatQueueReport'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['ChatQueueReport'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9c712f3..cdc6a08 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(_0xec17dc,_0x30bada){var _0x1ef30d=function(_0x542423){while(--_0x542423){_0xec17dc['push'](_0xec17dc['shift']());}};_0x1ef30d(++_0x30bada);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x187536,_0x330504){var _0x5d1f13=function(_0xdbcf0e){while(--_0xdbcf0e){_0x187536['push'](_0x187536['shift']());}};_0x5d1f13(++_0x330504);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1931d76..e6cc9a0 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 _0x9003=['UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','update','where','attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9003,0xcd));var _0x3900=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9003[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3900('0x0'));var util=require('util');var moment=require(_0x3900('0x1'));var BPromise=require(_0x3900('0x2'));var rs=require(_0x3900('0x3'));var fs=require('fs');var Redis=require(_0x3900('0x4'));var db=require(_0x3900('0x5'))['db'];var utils=require(_0x3900('0x6'));var logger=require(_0x3900('0x7'))(_0x3900('0x8'));var config=require(_0x3900('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3900('0xa')][_0x3900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50281e,_0x2b550c,_0x4d6979){return new BPromise(function(_0x3a8ed4,_0xa12b58){return client['request'](_0x50281e,_0x4d6979)['then'](function(_0x584bcc){logger[_0x3900('0xc')](_0x3900('0xd'),_0x2b550c,_0x3900('0xe'));logger['debug'](_0x3900('0xf'),_0x2b550c,_0x3900('0xe'),JSON[_0x3900('0x10')](_0x584bcc));if(_0x584bcc[_0x3900('0x11')]){if(_0x584bcc[_0x3900('0x11')][_0x3900('0x12')]===0x1f4){logger['error'](_0x3900('0xd'),_0x2b550c,_0x584bcc['error'][_0x3900('0x13')]);return _0xa12b58(_0x584bcc['error']['message']);}logger[_0x3900('0x11')](_0x3900('0xd'),_0x2b550c,_0x584bcc[_0x3900('0x11')]['message']);return _0x3a8ed4(_0x584bcc['error'][_0x3900('0x13')]);}else{logger[_0x3900('0xc')](_0x3900('0xd'),_0x2b550c,_0x3900('0xe'));_0x3a8ed4(_0x584bcc[_0x3900('0x14')][_0x3900('0x13')]);}})[_0x3900('0x15')](function(_0x19730c){logger[_0x3900('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2b550c,_0x19730c);_0xa12b58(_0x19730c);});});}exports[_0x3900('0x16')]=function(_0x5e5367){var _0x59049b=this;return new Promise(function(_0x39a4cb,_0x43150c){return db[_0x3900('0x17')][_0x3900('0x18')](_0x5e5367[_0x3900('0x19')],{'raw':_0x5e5367['options']?_0x5e5367[_0x3900('0x1a')][_0x3900('0x1b')]===undefined?!![]:![]:!![]})[_0x3900('0x1c')](function(_0x4f343f){logger[_0x3900('0xc')](_0x3900('0x16'),_0x5e5367);logger[_0x3900('0x1d')](_0x3900('0x16'),_0x5e5367,JSON[_0x3900('0x10')](_0x4f343f));_0x39a4cb(_0x4f343f);})[_0x3900('0x15')](function(_0x2065bd){logger['error']('CreateChatQueueReport',_0x2065bd[_0x3900('0x13')],_0x5e5367);_0x43150c(_0x59049b['error'](0x1f4,_0x2065bd['message']));});});};exports['UpdateChatQueueReport']=function(_0x39ed4a){var _0x1f319d=this;return new Promise(function(_0xca43be,_0x568fd6){return db[_0x3900('0x17')][_0x3900('0x1e')](_0x39ed4a['body'],{'raw':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a['options'][_0x3900('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a[_0x3900('0x1a')][_0x3900('0x1f')]||null:null,'attributes':_0x39ed4a['options']?_0x39ed4a[_0x3900('0x1a')][_0x3900('0x20')]||null:null,'limit':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a[_0x3900('0x1a')]['limit']||null:null})[_0x3900('0x1c')](function(_0x1f70b8){logger[_0x3900('0xc')](_0x3900('0x21'),_0x39ed4a);logger[_0x3900('0x1d')](_0x3900('0x21'),_0x39ed4a,JSON[_0x3900('0x10')](_0x1f70b8));_0xca43be(_0x1f70b8);})[_0x3900('0x15')](function(_0x481441){logger[_0x3900('0x11')](_0x3900('0x21'),_0x481441[_0x3900('0x13')],_0x39ed4a);_0x568fd6(_0x1f319d[_0x3900('0x11')](0x1f4,_0x481441[_0x3900('0x13')]));});});};
\ No newline at end of file
+var _0x79d3=['options','CreateChatQueueReport','UpdateChatQueueReport','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','body'];(function(_0x56f0ed,_0x431d41){var _0x218285=function(_0x16c4b5){while(--_0x16c4b5){_0x56f0ed['push'](_0x56f0ed['shift']());}};_0x218285(++_0x431d41);}(_0x79d3,0x1c6));var _0x379d=function(_0x523cc7,_0x34b3d0){_0x523cc7=_0x523cc7-0x0;var _0x268b8b=_0x79d3[_0x523cc7];return _0x268b8b;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require(_0x379d('0x6'))['db'];var utils=require(_0x379d('0x7'));var logger=require('../../config/logger')(_0x379d('0x8'));var config=require(_0x379d('0x9'));var jayson=require(_0x379d('0xa'));var client=jayson[_0x379d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16155a,_0x8aee7c,_0x3d1905){return new BPromise(function(_0x20e8b4,_0x4a0de6){return client['request'](_0x16155a,_0x3d1905)[_0x379d('0xc')](function(_0x160db2){logger[_0x379d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x8aee7c,_0x379d('0xe'));logger[_0x379d('0xf')](_0x379d('0x10'),_0x8aee7c,'request\x20sent',JSON[_0x379d('0x11')](_0x160db2));if(_0x160db2[_0x379d('0x12')]){if(_0x160db2[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0x14'),_0x8aee7c,_0x160db2['error'][_0x379d('0x15')]);return _0x4a0de6(_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);}logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);return _0x20e8b4(_0x160db2[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xd')](_0x379d('0x14'),_0x8aee7c,_0x379d('0xe'));_0x20e8b4(_0x160db2[_0x379d('0x16')][_0x379d('0x15')]);}})[_0x379d('0x17')](function(_0x2e768f){logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x2e768f);_0x4a0de6(_0x2e768f);});});}exports['CreateChatQueueReport']=function(_0x4708b3){var _0x191083=this;return new Promise(function(_0x247da8,_0x81c1d5){return db[_0x379d('0x18')]['create'](_0x4708b3[_0x379d('0x19')],{'raw':_0x4708b3[_0x379d('0x1a')]?_0x4708b3[_0x379d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x379d('0xc')](function(_0x46ed45){logger[_0x379d('0xd')](_0x379d('0x1b'),_0x4708b3);logger['debug'](_0x379d('0x1b'),_0x4708b3,JSON[_0x379d('0x11')](_0x46ed45));_0x247da8(_0x46ed45);})[_0x379d('0x17')](function(_0x4678f6){logger['error'](_0x379d('0x1b'),_0x4678f6[_0x379d('0x15')],_0x4708b3);_0x81c1d5(_0x191083[_0x379d('0x12')](0x1f4,_0x4678f6['message']));});});};exports[_0x379d('0x1c')]=function(_0x181b6c){var _0x57058c=this;return new Promise(function(_0x480480,_0x495bda){return db[_0x379d('0x18')]['update'](_0x181b6c['body'],{'raw':_0x181b6c[_0x379d('0x1a')]?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1e')]||null:null,'attributes':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1f')]||null:null,'limit':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')]['limit']||null:null})['then'](function(_0x2be3bc){logger[_0x379d('0xd')](_0x379d('0x1c'),_0x181b6c);logger['debug'](_0x379d('0x1c'),_0x181b6c,JSON[_0x379d('0x11')](_0x2be3bc));_0x480480(_0x2be3bc);})[_0x379d('0x17')](function(_0x931d5e){logger['error'](_0x379d('0x1c'),_0x931d5e[_0x379d('0x15')],_0x181b6c);_0x495bda(_0x57058c['error'](0x1f4,_0x931d5e[_0x379d('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7559b23..26dd3ca 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 _0xee4e=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0xee4e,0xa0));var _0xeee4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xee4e[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var path=require(_0xeee4('0x2'));var timeout=require(_0xeee4('0x3'));var express=require(_0xeee4('0x4'));var router=express['Router']();var fs_extra=require(_0xeee4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeee4('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xeee4('0x7')]('/',auth[_0xeee4('0x8')](),controller[_0xeee4('0x9')]);router['get'](_0xeee4('0xa'),auth[_0xeee4('0x8')](),controller[_0xeee4('0xb')]);router['get']('/:id',auth[_0xeee4('0x8')](),controller[_0xeee4('0xc')]);router[_0xeee4('0xd')]('/',auth[_0xeee4('0x8')](),controller[_0xeee4('0xe')]);router[_0xeee4('0xf')](_0xeee4('0x10'),auth[_0xeee4('0x8')](),controller[_0xeee4('0x11')]);router[_0xeee4('0x12')](_0xeee4('0x10'),auth['isAuthenticated'](),controller[_0xeee4('0x13')]);module[_0xeee4('0x14')]=router;
\ No newline at end of file
+var _0xab90=['/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x14de91,_0x18abe0){var _0x46fee0=function(_0x535e04){while(--_0x535e04){_0x14de91['push'](_0x14de91['shift']());}};_0x46fee0(++_0x18abe0);}(_0xab90,0xb3));var _0x0ab9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab90[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var path=require('path');var timeout=require(_0x0ab9('0x2'));var express=require('express');var router=express[_0x0ab9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ab9('0x4'));var config=require(_0x0ab9('0x5'));var controller=require(_0x0ab9('0x6'));router['get']('/',auth[_0x0ab9('0x7')](),controller['index']);router[_0x0ab9('0x8')](_0x0ab9('0x9'),auth['isAuthenticated'](),controller[_0x0ab9('0xa')]);router[_0x0ab9('0x8')](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xc')]);router[_0x0ab9('0xd')]('/',auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xe')]);router[_0x0ab9('0xf')](_0x0ab9('0xb'),auth['isAuthenticated'](),controller[_0x0ab9('0x10')]);router['delete'](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0x11')]);module[_0x0ab9('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index adab93f..f2eb3ad 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3bf54b,_0xb1eac8){var _0x38a60e=function(_0x39a842){while(--_0x39a842){_0x3bf54b['push'](_0x3bf54b['shift']());}};_0x38a60e(++_0xb1eac8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xcb91[_0x144b30];return _0x1bb7bc;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2fe767,_0x2d37e4){var _0x341e44=function(_0x32aa7f){while(--_0x32aa7f){_0x2fe767['push'](_0x2fe767['shift']());}};_0x341e44(++_0x2d37e4);}(_0xedd9,0xfc));var _0x9edd=function(_0x56092a,_0x291ce5){_0x56092a=_0x56092a-0x0;var _0x1c9558=_0xedd9[_0x56092a];return _0x1c9558;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 3729056..786db5e 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 _0x4093=['type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName'];(function(_0x486708,_0x50387e){var _0x24a5fe=function(_0x3fe599){while(--_0x3fe599){_0x486708['push'](_0x486708['shift']());}};_0x24a5fe(++_0x50387e);}(_0x4093,0x10d));var _0x3409=function(_0x54b0f3,_0x5834a0){_0x54b0f3=_0x54b0f3-0x0;var _0x16c089=_0x4093[_0x54b0f3];return _0x16c089;};'use strict';var emlformat=require(_0x3409('0x0'));var rimraf=require(_0x3409('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3409('0x2'));var rp=require('request-promise');var moment=require(_0x3409('0x3'));var BPromise=require(_0x3409('0x4'));var Mustache=require(_0x3409('0x5'));var util=require('util');var path=require(_0x3409('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3409('0x7'));var fs=require('fs');var fs_extra=require(_0x3409('0x8'));var _=require(_0x3409('0x9'));var squel=require(_0x3409('0xa'));var crypto=require(_0x3409('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3409('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3409('0xd'));var Papa=require('papaparse');var Redis=require(_0x3409('0xe'));var authService=require(_0x3409('0xf'));var qs=require(_0x3409('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3409('0x11'));var logger=require(_0x3409('0x12'))(_0x3409('0x13'));var utils=require(_0x3409('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3409('0x15'));var db=require(_0x3409('0x16'))['db'];function respondWithStatusCode(_0x48f2b9,_0x3c3dc8){_0x3c3dc8=_0x3c3dc8||0xcc;return function(_0x44767f){if(_0x44767f){return _0x48f2b9[_0x3409('0x17')](_0x3c3dc8);}return _0x48f2b9[_0x3409('0x18')](_0x3c3dc8)[_0x3409('0x19')]();};}function respondWithResult(_0x3e7cea,_0x51f641){_0x51f641=_0x51f641||0xc8;return function(_0x27a93d){if(_0x27a93d){return _0x3e7cea[_0x3409('0x18')](_0x51f641)[_0x3409('0x1a')](_0x27a93d);}};}function respondWithFilteredResult(_0x5a2376,_0x56e1ea){return function(_0x2b9567){if(_0x2b9567){var _0x2126e3=typeof _0x56e1ea['offset']===_0x3409('0x1b')&&typeof _0x56e1ea[_0x3409('0x1c')]==='undefined';var _0x3a55c7=_0x2b9567[_0x3409('0x1d')];var _0x2cb2c7=_0x2126e3?0x0:_0x56e1ea[_0x3409('0x1e')];var _0x17feb6=_0x2126e3?_0x2b9567[_0x3409('0x1d')]:_0x56e1ea[_0x3409('0x1e')]+_0x56e1ea[_0x3409('0x1c')];var _0x59b01f;if(_0x17feb6>=_0x3a55c7){_0x17feb6=_0x3a55c7;_0x59b01f=0xc8;}else{_0x59b01f=0xce;}_0x5a2376[_0x3409('0x18')](_0x59b01f);return _0x5a2376[_0x3409('0x1f')](_0x3409('0x20'),_0x2cb2c7+'-'+_0x17feb6+'/'+_0x3a55c7)['json'](_0x2b9567);}return null;};}function patchUpdates(_0x167a43){return function(_0x2120bb){try{jsonpatch[_0x3409('0x21')](_0x2120bb,_0x167a43,!![]);}catch(_0xd305f6){return BPromise[_0x3409('0x22')](_0xd305f6);}return _0x2120bb[_0x3409('0x23')]();};}function saveUpdates(_0x28cd11,_0x3eae6f){return function(_0x1df232){if(_0x1df232){return _0x1df232[_0x3409('0x24')](_0x28cd11)['then'](function(_0x261b94){return _0x261b94;});}return null;};}function removeEntity(_0x2b50b7,_0x304d6b){return function(_0x3cbafc){if(_0x3cbafc){return _0x3cbafc[_0x3409('0x25')]()[_0x3409('0x26')](function(){_0x2b50b7[_0x3409('0x18')](0xcc)[_0x3409('0x19')]();});}};}function handleEntityNotFound(_0x3a2e7f,_0xf9de78){return function(_0x42136b){if(!_0x42136b){_0x3a2e7f[_0x3409('0x17')](0x194);}return _0x42136b;};}function handleError(_0x22378d,_0xd27301){_0xd27301=_0xd27301||0x1f4;return function(_0x5cc1d1){logger[_0x3409('0x27')](_0x5cc1d1[_0x3409('0x28')]);if(_0x5cc1d1['name']){delete _0x5cc1d1[_0x3409('0x29')];}_0x22378d[_0x3409('0x18')](_0xd27301)[_0x3409('0x2a')](_0x5cc1d1);};}exports[_0x3409('0x2b')]=function(_0x1bbe95,_0x184f5d){var _0x74cbf2={},_0x2ee3a0={},_0x59366c={'count':0x0,'rows':[]};var _0x2f671f=_['map'](db[_0x3409('0x2c')][_0x3409('0x2d')],function(_0x591876){return{'name':_0x591876[_0x3409('0x2e')],'type':_0x591876[_0x3409('0x2f')][_0x3409('0x30')]};});_0x2ee3a0[_0x3409('0x31')]=_[_0x3409('0x32')](_0x2f671f,_0x3409('0x29'));_0x2ee3a0[_0x3409('0x33')]=_['keys'](_0x1bbe95[_0x3409('0x33')]);_0x2ee3a0[_0x3409('0x34')]=_[_0x3409('0x35')](_0x2ee3a0[_0x3409('0x31')],_0x2ee3a0['query']);_0x74cbf2[_0x3409('0x36')]=_[_0x3409('0x35')](_0x2ee3a0[_0x3409('0x31')],qs[_0x3409('0x37')](_0x1bbe95['query'][_0x3409('0x37')]));_0x74cbf2[_0x3409('0x36')]=_0x74cbf2[_0x3409('0x36')][_0x3409('0x38')]?_0x74cbf2['attributes']:_0x2ee3a0[_0x3409('0x31')];if(!_0x1bbe95[_0x3409('0x33')][_0x3409('0x39')](_0x3409('0x3a'))){_0x74cbf2[_0x3409('0x1c')]=qs[_0x3409('0x1c')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x1c')]);_0x74cbf2[_0x3409('0x1e')]=qs[_0x3409('0x1e')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x1e')]);}_0x74cbf2[_0x3409('0x3b')]=qs[_0x3409('0x3c')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x3c')]);_0x74cbf2[_0x3409('0x3d')]=qs[_0x3409('0x34')](_[_0x3409('0x3e')](_0x1bbe95['query'],_0x2ee3a0[_0x3409('0x34')]),_0x2f671f);if(_0x1bbe95[_0x3409('0x33')]['filter']){_0x74cbf2[_0x3409('0x3d')]=_[_0x3409('0x3f')](_0x74cbf2[_0x3409('0x3d')],{'$or':_[_0x3409('0x32')](_0x2f671f,function(_0x2d644){if(_0x2d644[_0x3409('0x2f')]!==_0x3409('0x40')){var _0x2233f4={};_0x2233f4[_0x2d644[_0x3409('0x29')]]={'$like':'%'+_0x1bbe95[_0x3409('0x33')][_0x3409('0x41')]+'%'};return _0x2233f4;}})});}_0x74cbf2=_['merge']({},_0x74cbf2,_0x1bbe95[_0x3409('0x42')]);var _0x4735cc={'where':_0x74cbf2['where']};return db[_0x3409('0x2c')][_0x3409('0x1d')](_0x4735cc)[_0x3409('0x26')](function(_0x4083db){_0x59366c[_0x3409('0x1d')]=_0x4083db;if(_0x1bbe95[_0x3409('0x33')][_0x3409('0x43')]){_0x74cbf2[_0x3409('0x44')]=[{'all':!![]}];}return db[_0x3409('0x2c')][_0x3409('0x45')](_0x74cbf2);})[_0x3409('0x26')](function(_0xcec97d){_0x59366c[_0x3409('0x46')]=_0xcec97d;return _0x59366c;})['then'](respondWithFilteredResult(_0x184f5d,_0x74cbf2))['catch'](handleError(_0x184f5d,null));};exports[_0x3409('0x47')]=function(_0x129934,_0x41437c){var _0x55444d={'raw':!![],'where':{'id':_0x129934['params']['id']}},_0x51dad3={};_0x51dad3['model']=_[_0x3409('0x48')](db['ChatTransferReport'][_0x3409('0x2d')]);_0x51dad3[_0x3409('0x33')]=_[_0x3409('0x48')](_0x129934[_0x3409('0x33')]);_0x51dad3[_0x3409('0x34')]=_[_0x3409('0x35')](_0x51dad3[_0x3409('0x31')],_0x51dad3[_0x3409('0x33')]);_0x55444d[_0x3409('0x36')]=_[_0x3409('0x35')](_0x51dad3[_0x3409('0x31')],qs['fields'](_0x129934[_0x3409('0x33')][_0x3409('0x37')]));_0x55444d[_0x3409('0x36')]=_0x55444d['attributes'][_0x3409('0x38')]?_0x55444d[_0x3409('0x36')]:_0x51dad3[_0x3409('0x31')];if(_0x129934[_0x3409('0x33')][_0x3409('0x43')]){_0x55444d[_0x3409('0x44')]=[{'all':!![]}];}_0x55444d=_[_0x3409('0x3f')]({},_0x55444d,_0x129934[_0x3409('0x42')]);return db[_0x3409('0x2c')][_0x3409('0x49')](_0x55444d)[_0x3409('0x26')](handleEntityNotFound(_0x41437c,null))[_0x3409('0x26')](respondWithResult(_0x41437c,null))[_0x3409('0x4a')](handleError(_0x41437c,null));};exports[_0x3409('0x4b')]=function(_0x88f899,_0x1352aa){return db[_0x3409('0x2c')]['create'](_0x88f899[_0x3409('0x4c')],{})[_0x3409('0x26')](respondWithResult(_0x1352aa,0xc9))[_0x3409('0x4a')](handleError(_0x1352aa,null));};exports[_0x3409('0x24')]=function(_0x1b1ed8,_0x14d97d){if(_0x1b1ed8[_0x3409('0x4c')]['id']){delete _0x1b1ed8[_0x3409('0x4c')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x1b1ed8[_0x3409('0x4d')]['id']}})[_0x3409('0x26')](handleEntityNotFound(_0x14d97d,null))['then'](saveUpdates(_0x1b1ed8[_0x3409('0x4c')],null))[_0x3409('0x26')](respondWithResult(_0x14d97d,null))[_0x3409('0x4a')](handleError(_0x14d97d,null));};exports[_0x3409('0x25')]=function(_0x3ec68e,_0xbe8ff5){return db[_0x3409('0x2c')][_0x3409('0x49')]({'where':{'id':_0x3ec68e['params']['id']}})[_0x3409('0x26')](handleEntityNotFound(_0xbe8ff5,null))[_0x3409('0x26')](removeEntity(_0xbe8ff5,null))[_0x3409('0x4a')](handleError(_0xbe8ff5,null));};exports[_0x3409('0x4e')]=function(_0x2774e2,_0x442ce9){return db['ChatTransferReport'][_0x3409('0x4e')]()['then'](respondWithResult(_0x442ce9,null))[_0x3409('0x4a')](handleError(_0x442ce9,null));};
\ No newline at end of file
+var _0x0472=['lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','ChatTransferReport','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra'];(function(_0x48a366,_0x66ca83){var _0x5664f0=function(_0xeada7d){while(--_0xeada7d){_0x48a366['push'](_0x48a366['shift']());}};_0x5664f0(++_0x66ca83);}(_0x0472,0x1a5));var _0x2047=function(_0x1addc8,_0x3061e9){_0x1addc8=_0x1addc8-0x0;var _0x1ecfa7=_0x0472[_0x1addc8];return _0x1ecfa7;};'use strict';var emlformat=require(_0x2047('0x0'));var rimraf=require(_0x2047('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2047('0x2'));var rp=require(_0x2047('0x3'));var moment=require(_0x2047('0x4'));var BPromise=require(_0x2047('0x5'));var Mustache=require(_0x2047('0x6'));var util=require(_0x2047('0x7'));var path=require(_0x2047('0x8'));var sox=require(_0x2047('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2047('0xa'));var _=require(_0x2047('0xb'));var squel=require(_0x2047('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2047('0xd'));var querystring=require(_0x2047('0xe'));var Papa=require(_0x2047('0xf'));var Redis=require(_0x2047('0x10'));var authService=require(_0x2047('0x11'));var qs=require(_0x2047('0x12'));var as=require(_0x2047('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2047('0x14'))(_0x2047('0x15'));var utils=require(_0x2047('0x16'));var config=require(_0x2047('0x17'));var licenseUtil=require(_0x2047('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x272842,_0x749e95){_0x749e95=_0x749e95||0xcc;return function(_0x361fde){if(_0x361fde){return _0x272842[_0x2047('0x19')](_0x749e95);}return _0x272842[_0x2047('0x1a')](_0x749e95)['end']();};}function respondWithResult(_0x38a45e,_0x539d1e){_0x539d1e=_0x539d1e||0xc8;return function(_0x32d748){if(_0x32d748){return _0x38a45e[_0x2047('0x1a')](_0x539d1e)[_0x2047('0x1b')](_0x32d748);}};}function respondWithFilteredResult(_0x6ec360,_0x1c2d2f){return function(_0x2aa88e){if(_0x2aa88e){var _0x53941d=typeof _0x1c2d2f[_0x2047('0x1c')]===_0x2047('0x1d')&&typeof _0x1c2d2f[_0x2047('0x1e')]===_0x2047('0x1d');var _0x4b283e=_0x2aa88e[_0x2047('0x1f')];var _0x51dae5=_0x53941d?0x0:_0x1c2d2f[_0x2047('0x1c')];var _0x2a08ce=_0x53941d?_0x2aa88e[_0x2047('0x1f')]:_0x1c2d2f['offset']+_0x1c2d2f[_0x2047('0x1e')];var _0x3abe75;if(_0x2a08ce>=_0x4b283e){_0x2a08ce=_0x4b283e;_0x3abe75=0xc8;}else{_0x3abe75=0xce;}_0x6ec360[_0x2047('0x1a')](_0x3abe75);return _0x6ec360[_0x2047('0x20')](_0x2047('0x21'),_0x51dae5+'-'+_0x2a08ce+'/'+_0x4b283e)[_0x2047('0x1b')](_0x2aa88e);}return null;};}function patchUpdates(_0x51f361){return function(_0x16b2a1){try{jsonpatch[_0x2047('0x22')](_0x16b2a1,_0x51f361,!![]);}catch(_0x1f36d2){return BPromise[_0x2047('0x23')](_0x1f36d2);}return _0x16b2a1[_0x2047('0x24')]();};}function saveUpdates(_0x11487e,_0x32c094){return function(_0x8bb2de){if(_0x8bb2de){return _0x8bb2de[_0x2047('0x25')](_0x11487e)[_0x2047('0x26')](function(_0x4e029d){return _0x4e029d;});}return null;};}function removeEntity(_0x2f3395,_0x25cb14){return function(_0x180e21){if(_0x180e21){return _0x180e21['destroy']()[_0x2047('0x26')](function(){_0x2f3395['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x202bd4,_0x32aee4){return function(_0x56840f){if(!_0x56840f){_0x202bd4['sendStatus'](0x194);}return _0x56840f;};}function handleError(_0x17b85c,_0x4ba1d2){_0x4ba1d2=_0x4ba1d2||0x1f4;return function(_0x544673){logger[_0x2047('0x27')](_0x544673['stack']);if(_0x544673[_0x2047('0x28')]){delete _0x544673['name'];}_0x17b85c['status'](_0x4ba1d2)['send'](_0x544673);};}exports['index']=function(_0x20a61f,_0x145d3d){var _0x491f8a={},_0x464e5b={},_0x5c9ce1={'count':0x0,'rows':[]};var _0x1de0f2=_['map'](db[_0x2047('0x29')][_0x2047('0x2a')],function(_0x56f18f){return{'name':_0x56f18f[_0x2047('0x2b')],'type':_0x56f18f[_0x2047('0x2c')]['key']};});_0x464e5b['model']=_[_0x2047('0x2d')](_0x1de0f2,'name');_0x464e5b[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x20a61f[_0x2047('0x2e')]);_0x464e5b['filters']=_['intersection'](_0x464e5b[_0x2047('0x30')],_0x464e5b['query']);_0x491f8a[_0x2047('0x31')]=_[_0x2047('0x32')](_0x464e5b['model'],qs[_0x2047('0x33')](_0x20a61f['query']['fields']));_0x491f8a['attributes']=_0x491f8a['attributes'][_0x2047('0x34')]?_0x491f8a['attributes']:_0x464e5b[_0x2047('0x30')];if(!_0x20a61f[_0x2047('0x2e')][_0x2047('0x35')](_0x2047('0x36'))){_0x491f8a[_0x2047('0x1e')]=qs[_0x2047('0x1e')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1e')]);_0x491f8a[_0x2047('0x1c')]=qs[_0x2047('0x1c')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1c')]);}_0x491f8a[_0x2047('0x37')]=qs[_0x2047('0x38')](_0x20a61f['query'][_0x2047('0x38')]);_0x491f8a[_0x2047('0x39')]=qs[_0x2047('0x3a')](_['pick'](_0x20a61f[_0x2047('0x2e')],_0x464e5b[_0x2047('0x3a')]),_0x1de0f2);if(_0x20a61f[_0x2047('0x2e')]['filter']){_0x491f8a['where']=_[_0x2047('0x3b')](_0x491f8a[_0x2047('0x39')],{'$or':_[_0x2047('0x2d')](_0x1de0f2,function(_0x23b048){if(_0x23b048[_0x2047('0x2c')]!=='VIRTUAL'){var _0x2689be={};_0x2689be[_0x23b048[_0x2047('0x28')]]={'$like':'%'+_0x20a61f[_0x2047('0x2e')][_0x2047('0x3c')]+'%'};return _0x2689be;}})});}_0x491f8a=_[_0x2047('0x3b')]({},_0x491f8a,_0x20a61f[_0x2047('0x3d')]);var _0x2ee205={'where':_0x491f8a[_0x2047('0x39')]};return db[_0x2047('0x29')][_0x2047('0x1f')](_0x2ee205)[_0x2047('0x26')](function(_0x25b0c0){_0x5c9ce1[_0x2047('0x1f')]=_0x25b0c0;if(_0x20a61f[_0x2047('0x2e')]['includeAll']){_0x491f8a[_0x2047('0x3e')]=[{'all':!![]}];}return db[_0x2047('0x29')]['findAll'](_0x491f8a);})[_0x2047('0x26')](function(_0xf28300){_0x5c9ce1[_0x2047('0x3f')]=_0xf28300;return _0x5c9ce1;})[_0x2047('0x26')](respondWithFilteredResult(_0x145d3d,_0x491f8a))['catch'](handleError(_0x145d3d,null));};exports[_0x2047('0x40')]=function(_0x2e36e2,_0xc77543){var _0xe5f2a1={'raw':!![],'where':{'id':_0x2e36e2[_0x2047('0x41')]['id']}},_0x111113={};_0x111113[_0x2047('0x30')]=_[_0x2047('0x2f')](db[_0x2047('0x29')][_0x2047('0x2a')]);_0x111113[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x2e36e2[_0x2047('0x2e')]);_0x111113[_0x2047('0x3a')]=_[_0x2047('0x32')](_0x111113['model'],_0x111113[_0x2047('0x2e')]);_0xe5f2a1[_0x2047('0x31')]=_['intersection'](_0x111113['model'],qs[_0x2047('0x33')](_0x2e36e2[_0x2047('0x2e')]['fields']));_0xe5f2a1['attributes']=_0xe5f2a1[_0x2047('0x31')][_0x2047('0x34')]?_0xe5f2a1[_0x2047('0x31')]:_0x111113[_0x2047('0x30')];if(_0x2e36e2['query'][_0x2047('0x42')]){_0xe5f2a1[_0x2047('0x3e')]=[{'all':!![]}];}_0xe5f2a1=_[_0x2047('0x3b')]({},_0xe5f2a1,_0x2e36e2['options']);return db[_0x2047('0x29')][_0x2047('0x43')](_0xe5f2a1)['then'](handleEntityNotFound(_0xc77543,null))[_0x2047('0x26')](respondWithResult(_0xc77543,null))[_0x2047('0x44')](handleError(_0xc77543,null));};exports[_0x2047('0x45')]=function(_0x200090,_0x273705){return db[_0x2047('0x29')][_0x2047('0x45')](_0x200090[_0x2047('0x46')],{})['then'](respondWithResult(_0x273705,0xc9))[_0x2047('0x44')](handleError(_0x273705,null));};exports[_0x2047('0x25')]=function(_0x3da4ce,_0x5a9821){if(_0x3da4ce[_0x2047('0x46')]['id']){delete _0x3da4ce[_0x2047('0x46')]['id'];}return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x3da4ce[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x5a9821,null))[_0x2047('0x26')](saveUpdates(_0x3da4ce[_0x2047('0x46')],null))[_0x2047('0x26')](respondWithResult(_0x5a9821,null))[_0x2047('0x44')](handleError(_0x5a9821,null));};exports['destroy']=function(_0x414e22,_0x1621a5){return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x414e22[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x1621a5,null))['then'](removeEntity(_0x1621a5,null))[_0x2047('0x44')](handleError(_0x1621a5,null));};exports['describe']=function(_0x1e14ac,_0x12ae2f){return db[_0x2047('0x29')][_0x2047('0x47')]()[_0x2047('0x26')](respondWithResult(_0x12ae2f,null))[_0x2047('0x44')](handleError(_0x12ae2f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index dc1eef5..7b32a80 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 _0xc53d=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x19f64f,_0x52c873){var _0x5e2150=function(_0x1d5f64){while(--_0x1d5f64){_0x19f64f['push'](_0x19f64f['shift']());}};_0x5e2150(++_0x52c873);}(_0xc53d,0x65));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc53('0x0'));var util=require(_0xdc53('0x1'));var logger=require(_0xdc53('0x2'))(_0xdc53('0x3'));var moment=require(_0xdc53('0x4'));var BPromise=require(_0xdc53('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc53('0x6'));var rimraf=require('rimraf');var config=require(_0xdc53('0x7'));var attributes=require(_0xdc53('0x8'));module[_0xdc53('0x9')]=function(_0x35c0b7,_0x2b30e6){return _0x35c0b7[_0xdc53('0xa')](_0xdc53('0xb'),attributes,{'tableName':_0xdc53('0xc'),'paranoid':![],'indexes':[{'name':_0xdc53('0xd'),'fields':[_0xdc53('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4921=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatTransferReport.attributes'];(function(_0x1d81ef,_0x5e02f0){var _0x2931ba=function(_0x1f8473){while(--_0x1f8473){_0x1d81ef['push'](_0x1d81ef['shift']());}};_0x2931ba(++_0x5e02f0);}(_0x4921,0xa0));var _0x1492=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0x4921[_0x2daef6];return _0x62d030;};'use strict';var _=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var logger=require(_0x1492('0x2'))(_0x1492('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1492('0x4'));var fs=require('fs');var path=require(_0x1492('0x5'));var rimraf=require(_0x1492('0x6'));var config=require('../../config/environment');var attributes=require(_0x1492('0x7'));module[_0x1492('0x8')]=function(_0x321385,_0x52e02c){return _0x321385['define'](_0x1492('0x9'),attributes,{'tableName':_0x1492('0xa'),'paranoid':![],'indexes':[{'name':_0x1492('0xb'),'fields':[_0x1492('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 1ea13f2..078f884 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 _0x8c4e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x8c4e,0x153));var _0xe8c4=function(_0x208619,_0x4de765){_0x208619=_0x208619-0x0;var _0x1b4b69=_0x8c4e[_0x208619];return _0x1b4b69;};'use strict';var _=require(_0xe8c4('0x0'));var util=require(_0xe8c4('0x1'));var moment=require(_0xe8c4('0x2'));var BPromise=require(_0xe8c4('0x3'));var rs=require(_0xe8c4('0x4'));var fs=require('fs');var Redis=require(_0xe8c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8c4('0x6'));var logger=require(_0xe8c4('0x7'))(_0xe8c4('0x8'));var config=require(_0xe8c4('0x9'));var jayson=require(_0xe8c4('0xa'));var client=jayson[_0xe8c4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f895,_0x22d240,_0xcd5268){return new BPromise(function(_0x2cd2bd,_0x8da751){return client['request'](_0x30f895,_0xcd5268)[_0xe8c4('0xc')](function(_0x55ea31){logger[_0xe8c4('0xd')](_0xe8c4('0xe'),_0x22d240,_0xe8c4('0xf'));logger[_0xe8c4('0x10')](_0xe8c4('0x11'),_0x22d240,_0xe8c4('0xf'),JSON[_0xe8c4('0x12')](_0x55ea31));if(_0x55ea31[_0xe8c4('0x13')]){if(_0x55ea31[_0xe8c4('0x13')]['code']===0x1f4){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x22d240,_0x55ea31['error'][_0xe8c4('0x14')]);return _0x8da751(_0x55ea31[_0xe8c4('0x13')][_0xe8c4('0x14')]);}logger['error'](_0xe8c4('0xe'),_0x22d240,_0x55ea31['error']['message']);return _0x2cd2bd(_0x55ea31[_0xe8c4('0x13')][_0xe8c4('0x14')]);}else{logger['info'](_0xe8c4('0xe'),_0x22d240,_0xe8c4('0xf'));_0x2cd2bd(_0x55ea31[_0xe8c4('0x15')][_0xe8c4('0x14')]);}})[_0xe8c4('0x16')](function(_0x3acfab){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x22d240,_0x3acfab);_0x8da751(_0x3acfab);});});}
\ No newline at end of file
+var _0x4253=['message','ChatTransferReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0xf0f6c7,_0x1de992){var _0x3ba4b3=function(_0x41a0de){while(--_0x41a0de){_0xf0f6c7['push'](_0xf0f6c7['shift']());}};_0x3ba4b3(++_0x1de992);}(_0x4253,0x7a));var _0x3425=function(_0x2cc5ae,_0x4f1bc1){_0x2cc5ae=_0x2cc5ae-0x0;var _0xdffed7=_0x4253[_0x2cc5ae];return _0xdffed7;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var moment=require(_0x3425('0x2'));var BPromise=require(_0x3425('0x3'));var rs=require(_0x3425('0x4'));var fs=require('fs');var Redis=require(_0x3425('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3425('0x6'))(_0x3425('0x7'));var config=require('../../config/environment');var jayson=require(_0x3425('0x8'));var client=jayson[_0x3425('0x9')][_0x3425('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297486,_0xc10fad,_0xe4de64){return new BPromise(function(_0x3f0521,_0xd89b22){return client[_0x3425('0xb')](_0x297486,_0xe4de64)[_0x3425('0xc')](function(_0x3df6d8){logger[_0x3425('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3425('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xc10fad,'request\x20sent',JSON[_0x3425('0xf')](_0x3df6d8));if(_0x3df6d8[_0x3425('0x10')]){if(_0x3df6d8['error'][_0x3425('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3df6d8[_0x3425('0x10')]['message']);return _0xd89b22(_0x3df6d8[_0x3425('0x10')][_0x3425('0x12')]);}logger[_0x3425('0x10')](_0x3425('0x13'),_0xc10fad,_0x3df6d8['error'][_0x3425('0x12')]);return _0x3f0521(_0x3df6d8['error']['message']);}else{logger['info'](_0x3425('0x13'),_0xc10fad,_0x3425('0xe'));_0x3f0521(_0x3df6d8['result'][_0x3425('0x12')]);}})['catch'](function(_0x53df9a){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x53df9a);_0xd89b22(_0x53df9a);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index cc1dba4..b80a66b 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 _0xe34b=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe34b,0xdc));var _0xbe34=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe34b[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0xbe34('0x0'));var util=require(_0xbe34('0x1'));var path=require(_0xbe34('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe34('0x3'));var router=express[_0xbe34('0x4')]();var fs_extra=require(_0xbe34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe34('0x6'));var config=require(_0xbe34('0x7'));var controller=require(_0xbe34('0x8'));router['get']('/',auth[_0xbe34('0x9')](),controller[_0xbe34('0xa')]);router[_0xbe34('0xb')](_0xbe34('0xc'),auth[_0xbe34('0x9')](),controller[_0xbe34('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe34('0xe')]);router[_0xbe34('0xf')]('/',auth[_0xbe34('0x9')](),controller[_0xbe34('0x10')]);router[_0xbe34('0x11')](_0xbe34('0x12'),auth[_0xbe34('0x9')](),controller[_0xbe34('0x13')]);router['delete'](_0xbe34('0x12'),auth[_0xbe34('0x9')](),controller[_0xbe34('0x14')]);module[_0xbe34('0x15')]=router;
\ No newline at end of file
+var _0x3c03=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1676dc,_0x1a027b){var _0x3659d7=function(_0x5ace7f){while(--_0x5ace7f){_0x1676dc['push'](_0x1676dc['shift']());}};_0x3659d7(++_0x1a027b);}(_0x3c03,0xcb));var _0x33c0=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3c03[_0x49ca18];return _0x145d54;};'use strict';var multer=require('multer');var util=require(_0x33c0('0x0'));var path=require('path');var timeout=require(_0x33c0('0x1'));var express=require(_0x33c0('0x2'));var router=express['Router']();var fs_extra=require(_0x33c0('0x3'));var auth=require(_0x33c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x33c0('0x5'));var controller=require(_0x33c0('0x6'));router[_0x33c0('0x7')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0x9')]);router[_0x33c0('0x7')](_0x33c0('0xa'),auth[_0x33c0('0x8')](),controller['describe']);router[_0x33c0('0x7')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0xc')]);router[_0x33c0('0xd')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0xe')]);router[_0x33c0('0xf')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller['update']);router[_0x33c0('0x10')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0x11')]);module[_0x33c0('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 1b51774..1e179e4 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 _0xdffd=['thumb','TEXT','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','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','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdffd,0x154));var _0xddff=function(_0xabf81e,_0x4425d3){_0xabf81e=_0xabf81e-0x0;var _0x4f2a96=_0xdffd[_0xabf81e];return _0x4f2a96;};'use strict';var Sequelize=require(_0xddff('0x0'));var rs=require(_0xddff('0x1'));module[_0xddff('0x2')]={'name':{'type':Sequelize[_0xddff('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x5')},'customerAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xddff('0x9'),_0xddff('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0xd')},'header_offline':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xe')},'download_transcript':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x13')},'placeholderMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x14')},'closingMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xd')},'skipMessageButton':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x15')},'conditionAgreement':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x16')},'ratingType':{'type':Sequelize[_0xddff('0x17')]('star',_0xddff('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return JSON[_0xddff('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xddff('0x1b'),'type':'text','required':!![]},'props':{'title':_0xddff('0x1b'),'helpText':''}},{'type':_0xddff('0x1c'),'props':{'title':_0xddff('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xddff('0x4'),'type':_0xddff('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xddff('0x1d')](_0xddff('0x1e'))?JSON[_0xddff('0x1f')](this[_0xddff('0x1d')](_0xddff('0x1e'))):{};},'set':function(_0x404e20){return this[_0xddff('0x20')](_0xddff('0x1e'),JSON[_0xddff('0x1a')](_0x404e20));}},'offlineForm':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return JSON[_0xddff('0x1a')]({'items':[{'type':_0xddff('0x1c'),'props':{'title':_0xddff('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xddff('0x4'),'type':_0xddff('0x4')},'variable':null},{'type':_0xddff('0x21'),'config':{'placeholder':_0xddff('0x22')},'props':{'title':_0xddff('0x22'),'helpText':_0xddff('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xddff('0x1f')](this[_0xddff('0x1d')]('offlineForm')):{};},'set':function(_0xe9007c){return this[_0xddff('0x20')]('offlineForm',JSON[_0xddff('0x1a')](_0xe9007c));}},'token':{'type':Sequelize[_0xddff('0x3')],'defaultValue':function(){return rs[_0xddff('0x24')]();}},'autoclose':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xddff('0x3')]},'forwardOffline':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x25')},'waitingMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x29')},'skipUnmanaged':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x15')},'sendUnmanaged':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xddff('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xddff('0x3')]},'notificationTemplate':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return _0xddff('0x2a');}},'notificationSound':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xddff('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2e')},'systemAvatar':{'type':Sequelize[_0xddff('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xddff('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![],'comment':_0xddff('0x2f'),'set':function(_0xafc8c9){if(!_0xafc8c9)this[_0xddff('0x20')](_0xddff('0x30'),null);this[_0xddff('0x20')](_0xddff('0x31'),_0xafc8c9);}},'vidaooEscalation':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xddff('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xddff('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xddff('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xddff('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xddff('0x19')]}};
\ No newline at end of file
+var _0x1429=['#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','getDataValue','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.','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'];(function(_0x59676f,_0x205f4a){var _0x355160=function(_0x4b1e94){while(--_0x4b1e94){_0x59676f['push'](_0x59676f['shift']());}};_0x355160(++_0x205f4a);}(_0x1429,0xcf));var _0x9142=function(_0x113124,_0x2d3bc6){_0x113124=_0x113124-0x0;var _0x205781=_0x1429[_0x113124];return _0x205781;};'use strict';var Sequelize=require(_0x9142('0x0'));var rs=require(_0x9142('0x1'));module[_0x9142('0x2')]={'name':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'unique':_0x9142('0x4')},'description':{'type':Sequelize[_0x9142('0x3')]},'mapKey':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'key':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9142('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9142('0xa')](_0x9142('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0xc')},'offline_chat_button':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'header_offline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xe')},'download_transcript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9142('0x11')]},'closingQuestion':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x14')},'closingMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'skipMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x15')},'conditionAgreement':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x9142('0x17'),_0x9142('0x18')),'defaultValue':_0x9142('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9142('0x19'),'variable':null,'config':{'placeholder':_0x9142('0x1a'),'type':_0x9142('0x1b'),'required':!![]},'props':{'title':_0x9142('0x1a'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':_0x9142('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9142('0x1c'))?JSON[_0x9142('0x1d')](this['getDataValue'](_0x9142('0x1c'))):{};},'set':function(_0x25ca11){return this['setDataValue']('onlineForm',JSON[_0x9142('0x1e')](_0x25ca11));}},'offlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON[_0x9142('0x1e')]({'items':[{'type':_0x9142('0x19'),'props':{'title':_0x9142('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x9142('0x1f'),'helpText':_0x9142('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x9142('0x21')](_0x9142('0x22'))?JSON['parse'](this['getDataValue'](_0x9142('0x22'))):{};},'set':function(_0x2d5d28){return this['setDataValue'](_0x9142('0x22'),JSON[_0x9142('0x1e')](_0x2d5d28));}},'token':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9142('0x3')]},'forwardOffline':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9142('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x23')},'waitingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x27')},'skipUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9142('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9142('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return _0x9142('0x28');}},'notificationSound':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9142('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9142('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'comment':_0x9142('0x2c'),'set':function(_0x2e3312){if(!_0x2e3312)this['setDataValue'](_0x9142('0x2d'),null);this[_0x9142('0x2e')](_0x9142('0x2f'),_0x2e3312);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x30')},'vidaooNote':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return _0x9142('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x9142('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9142('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index eb84583..6d7b848 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 _0xf828=['threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','update','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','offlineMessageBody','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','lastName','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','addInteraction','Contact','User','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','x-real-ip','connection','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','omit','getFields','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','destroy','get','ChatWebsites','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','ChatWebsite','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','findOne','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s'];(function(_0x6bf4f,_0x16bd90){var _0x2ccc13=function(_0x2daacd){while(--_0x2daacd){_0x6bf4f['push'](_0x6bf4f['shift']());}};_0x2ccc13(++_0x16bd90);}(_0xf828,0x75));var _0x8f82=function(_0x7d9126,_0x1846b8){_0x7d9126=_0x7d9126-0x0;var _0x3db79e=_0xf828[_0x7d9126];return _0x3db79e;};'use strict';var emlformat=require(_0x8f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f82('0x1'));var jsonpatch=require(_0x8f82('0x2'));var rp=require(_0x8f82('0x3'));var moment=require(_0x8f82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f82('0x5'));var util=require(_0x8f82('0x6'));var path=require(_0x8f82('0x7'));var sox=require(_0x8f82('0x8'));var csv=require('to-csv');var ejs=require(_0x8f82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f82('0xa'));var squel=require(_0x8f82('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f82('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8f82('0xd'));var querystring=require(_0x8f82('0xe'));var Papa=require(_0x8f82('0xf'));var Redis=require('ioredis');var authService=require(_0x8f82('0x10'));var qs=require(_0x8f82('0x11'));var as=require(_0x8f82('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f82('0x13'));var utils=require(_0x8f82('0x14'));var config=require(_0x8f82('0x15'));var licenseUtil=require(_0x8f82('0x16'));var db=require(_0x8f82('0x17'))['db'];config[_0x8f82('0x18')]=_[_0x8f82('0x19')](config[_0x8f82('0x18')],{'host':_0x8f82('0x1a'),'port':0x18eb});var socket=require(_0x8f82('0x1b'))(new Redis(config[_0x8f82('0x18')]));require(_0x8f82('0x1c'))[_0x8f82('0x1d')](socket);var jayson=require(_0x8f82('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x8f82('0x1f')]({'port':0x232a});var client9003=jayson[_0x8f82('0x20')]['http']({'port':0x232b});var client9001=jayson[_0x8f82('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0x14c633,_0x1fab60,_0x40bab9,_0x3cecae){return new BPromise(function(_0x56d019,_0x2360c9){var _0x2fa9a2=_0x3cecae||client;return _0x2fa9a2[_0x8f82('0x21')](_0x14c633,_0x40bab9)[_0x8f82('0x22')](function(_0x23a506){logger[_0x8f82('0x23')](_0x8f82('0x24'),_0x1fab60,_0x8f82('0x25'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1fab60,_0x8f82('0x25'),JSON[_0x8f82('0x26')](_0x23a506));if(_0x23a506[_0x8f82('0x27')]){if(_0x23a506[_0x8f82('0x27')]['code']===0x1f4){logger[_0x8f82('0x27')](_0x8f82('0x24'),_0x1fab60,_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);return _0x2360c9(_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);}logger[_0x8f82('0x27')](_0x8f82('0x24'),_0x1fab60,_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);return _0x56d019(_0x23a506['error'][_0x8f82('0x28')]);}else{logger['info'](_0x8f82('0x24'),_0x1fab60,_0x8f82('0x25'));_0x56d019(_0x23a506[_0x8f82('0x29')][_0x8f82('0x28')]);}})[_0x8f82('0x2a')](function(_0x3a750d){logger[_0x8f82('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x1fab60,_0x3a750d);_0x2360c9(_0x3a750d);});});}function respondWithStatusCode(_0x4fb356,_0x552594){_0x552594=_0x552594||0xcc;return function(_0x2cc681){if(_0x2cc681){return _0x4fb356[_0x8f82('0x2b')](_0x552594);}return _0x4fb356[_0x8f82('0x2c')](_0x552594)['end']();};}function respondWithResult(_0x499692,_0x366284){_0x366284=_0x366284||0xc8;return function(_0x313381){if(_0x313381){return _0x499692[_0x8f82('0x2c')](_0x366284)[_0x8f82('0x2d')](_0x313381);}};}function respondWithFilteredResult(_0x472b48,_0xc56478){return function(_0x279b6c){if(_0x279b6c){var _0x4acf1f=typeof _0xc56478[_0x8f82('0x2e')]===_0x8f82('0x2f')&&typeof _0xc56478[_0x8f82('0x30')]===_0x8f82('0x2f');var _0x422b9b=_0x279b6c[_0x8f82('0x31')];var _0x8ae4ec=_0x4acf1f?0x0:_0xc56478['offset'];var _0x45dca4=_0x4acf1f?_0x279b6c[_0x8f82('0x31')]:_0xc56478[_0x8f82('0x2e')]+_0xc56478[_0x8f82('0x30')];var _0x437bfc;if(_0x45dca4>=_0x422b9b){_0x45dca4=_0x422b9b;_0x437bfc=0xc8;}else{_0x437bfc=0xce;}_0x472b48['status'](_0x437bfc);return _0x472b48[_0x8f82('0x32')]('Content-Range',_0x8ae4ec+'-'+_0x45dca4+'/'+_0x422b9b)[_0x8f82('0x2d')](_0x279b6c);}return null;};}function patchUpdates(_0x389e97){return function(_0x4cd971){try{jsonpatch[_0x8f82('0x33')](_0x4cd971,_0x389e97,!![]);}catch(_0x2d5e7d){return BPromise['reject'](_0x2d5e7d);}return _0x4cd971['save']();};}function saveUpdates(_0x4591bc,_0x42e6f4){return function(_0x365701){if(_0x365701){return _0x365701['update'](_0x4591bc)[_0x8f82('0x22')](function(_0x1088fb){return _0x1088fb;});}return null;};}function removeEntity(_0x27fbfd,_0x233717){return function(_0xbddd7c){if(_0xbddd7c){return _0xbddd7c[_0x8f82('0x34')]()[_0x8f82('0x22')](function(){var _0x5afc69=_0xbddd7c[_0x8f82('0x35')]({'plain':!![]});var _0x49960f=_0x8f82('0x36');return db['UserProfileResource'][_0x8f82('0x34')]({'where':{'type':_0x49960f,'resourceId':_0x5afc69['id']}})[_0x8f82('0x22')](function(){return _0xbddd7c;});})[_0x8f82('0x22')](function(){_0x27fbfd[_0x8f82('0x2c')](0xcc)[_0x8f82('0x37')]();});}};}function handleEntityNotFound(_0x58ca90,_0x20da3f){return function(_0x12949a){if(!_0x12949a){_0x58ca90[_0x8f82('0x2b')](0x194);}return _0x12949a;};}function handleError(_0x73afaf,_0x3dded8){_0x3dded8=_0x3dded8||0x1f4;return function(_0x2fb4b2){logger[_0x8f82('0x27')](_0x2fb4b2[_0x8f82('0x38')]);if(_0x2fb4b2[_0x8f82('0x39')]){delete _0x2fb4b2['name'];}_0x73afaf[_0x8f82('0x2c')](_0x3dded8)[_0x8f82('0x3a')](_0x2fb4b2);};}exports[_0x8f82('0x3b')]=function(_0x2b5f52,_0x3d5a02){var _0x2dcc92={'include':[{'model':db[_0x8f82('0x3c')],'as':_0x8f82('0x3d')}]},_0x4574fb={},_0x2ebf42={'count':0x0,'rows':[]};var _0x37af4a=_[_0x8f82('0x3e')](db['ChatWebsite'][_0x8f82('0x3f')],function(_0x173111){return{'name':_0x173111[_0x8f82('0x40')],'type':_0x173111[_0x8f82('0x41')]['key']};});_0x4574fb[_0x8f82('0x42')]=_[_0x8f82('0x3e')](_0x37af4a,'name');_0x4574fb[_0x8f82('0x43')]=_[_0x8f82('0x44')](_0x2b5f52[_0x8f82('0x43')]);_0x4574fb['filters']=_[_0x8f82('0x45')](_0x4574fb[_0x8f82('0x42')],_0x4574fb['query']);_0x2dcc92['attributes']=_['intersection'](_0x4574fb[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x2b5f52['query'][_0x8f82('0x46')]));_0x2dcc92[_0x8f82('0x47')]=_0x2dcc92[_0x8f82('0x47')][_0x8f82('0x48')]?_0x2dcc92[_0x8f82('0x47')]:_0x4574fb[_0x8f82('0x42')];if(!_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x2dcc92[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x30')]);_0x2dcc92['offset']=qs[_0x8f82('0x2e')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x2dcc92['order']=qs[_0x8f82('0x4b')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x2dcc92['where']=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x2b5f52['query'],_0x4574fb[_0x8f82('0x4c')]),_0x37af4a);if(_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x2dcc92['where']=_[_0x8f82('0x4f')](_0x2dcc92['where'],{'$or':_[_0x8f82('0x3e')](_0x37af4a,function(_0x1fad7e){if(_0x1fad7e[_0x8f82('0x41')]!==_0x8f82('0x50')){var _0x5e7f70={};_0x5e7f70[_0x1fad7e[_0x8f82('0x39')]]={'$like':'%'+_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x5e7f70;}})});}_0x2dcc92=_['merge']({},_0x2dcc92,_0x2b5f52[_0x8f82('0x51')]);var _0x2e28f7={'where':_0x2dcc92[_0x8f82('0x52')]};return db['ChatWebsite'][_0x8f82('0x31')](_0x2e28f7)[_0x8f82('0x22')](function(_0x14c37f){_0x2ebf42[_0x8f82('0x31')]=_0x14c37f;if(_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x53')]){_0x2dcc92['include']=[{'all':!![]}];}return db[_0x8f82('0x54')][_0x8f82('0x55')](_0x2dcc92);})['then'](function(_0x3892ba){_0x2ebf42[_0x8f82('0x56')]=_0x3892ba;return _0x2ebf42;})[_0x8f82('0x22')](respondWithFilteredResult(_0x3d5a02,_0x2dcc92))['catch'](handleError(_0x3d5a02,null));};exports[_0x8f82('0x57')]=function(_0x44f982,_0x43bf1d){var _0x5775e1={'raw':![],'where':{'id':_0x44f982['params']['id']},'include':[{'model':db[_0x8f82('0x3c')],'as':'mandatoryDispositionPause'}]},_0x54bd2e={};_0x54bd2e[_0x8f82('0x42')]=_['keys'](db[_0x8f82('0x54')][_0x8f82('0x3f')]);_0x54bd2e[_0x8f82('0x43')]=_['keys'](_0x44f982[_0x8f82('0x43')]);_0x54bd2e[_0x8f82('0x4c')]=_['intersection'](_0x54bd2e[_0x8f82('0x42')],_0x54bd2e[_0x8f82('0x43')]);_0x5775e1['attributes']=_['intersection'](_0x54bd2e[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x44f982[_0x8f82('0x43')][_0x8f82('0x46')]));_0x5775e1[_0x8f82('0x47')]=_0x5775e1[_0x8f82('0x47')][_0x8f82('0x48')]?_0x5775e1[_0x8f82('0x47')]:_0x54bd2e[_0x8f82('0x42')];if(_0x44f982['query'][_0x8f82('0x53')]){_0x5775e1[_0x8f82('0x58')]=[{'all':!![]}];}_0x5775e1=_[_0x8f82('0x4f')]({},_0x5775e1,_0x44f982[_0x8f82('0x51')]);return db['ChatWebsite'][_0x8f82('0x59')](_0x5775e1)[_0x8f82('0x22')](handleEntityNotFound(_0x43bf1d,null))[_0x8f82('0x22')](respondWithResult(_0x43bf1d,null))['catch'](handleError(_0x43bf1d,null));};exports['create']=function(_0x32c5c3,_0x4fa3c6){return db[_0x8f82('0x54')][_0x8f82('0x5a')](_0x32c5c3['body'],{})['then'](function(_0x168bdf){var _0x50adbd=_0x32c5c3[_0x8f82('0x5b')][_0x8f82('0x35')]({'plain':!![]});if(!_0x50adbd)throw new Error(_0x8f82('0x5c'));if(_0x50adbd['role']===_0x8f82('0x5b')){var _0x2eb489=_0x168bdf['get']({'plain':!![]});var _0x48e1ce=_0x8f82('0x36');return db[_0x8f82('0x5d')][_0x8f82('0x59')]({'where':{'name':_0x48e1ce,'userProfileId':_0x50adbd[_0x8f82('0x5e')]},'raw':!![]})['then'](function(_0x375d25){if(_0x375d25&&_0x375d25[_0x8f82('0x5f')]===0x0){return db[_0x8f82('0x60')][_0x8f82('0x5a')]({'name':_0x2eb489[_0x8f82('0x39')],'resourceId':_0x2eb489['id'],'type':_0x375d25[_0x8f82('0x39')],'sectionId':_0x375d25['id']},{})[_0x8f82('0x22')](function(){return _0x168bdf;});}else{return _0x168bdf;}})['catch'](function(_0x5c26ae){logger[_0x8f82('0x27')](_0x8f82('0x61'),_0x5c26ae);throw _0x5c26ae;});}return _0x168bdf;})[_0x8f82('0x22')](respondWithResult(_0x4fa3c6,0xc9))[_0x8f82('0x2a')](handleError(_0x4fa3c6,null));};exports['update']=function(_0x97748a,_0x12c2e8){if(_0x97748a[_0x8f82('0x62')]['id']){delete _0x97748a[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x97748a[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x3c')],'as':_0x8f82('0x3d')}]})['then'](handleEntityNotFound(_0x12c2e8,null))[_0x8f82('0x22')](saveUpdates(_0x97748a[_0x8f82('0x62')],null))['then'](respondWithResult(_0x12c2e8,null))[_0x8f82('0x2a')](handleError(_0x12c2e8,null));};exports['destroy']=function(_0x3ca4f0,_0x115816){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x3ca4f0[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x115816,null))[_0x8f82('0x22')](removeEntity(_0x115816,null))[_0x8f82('0x2a')](handleError(_0x115816,null));};exports[_0x8f82('0x64')]=function(_0x15b48d,_0x50f23a){return db['ChatWebsite'][_0x8f82('0x64')]()[_0x8f82('0x22')](respondWithResult(_0x50f23a,null))['catch'](handleError(_0x50f23a,null));};exports[_0x8f82('0x65')]=function(_0x492eb8,_0x5094d6,_0x5c1f21){if(_0x492eb8[_0x8f82('0x62')]['id']){delete _0x492eb8[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x492eb8[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5094d6,null))[_0x8f82('0x22')](function(_0x556e4e){if(_0x556e4e){_0x492eb8[_0x8f82('0x62')]['ChatWebsiteId']=_0x556e4e['id'];return db[_0x8f82('0x66')][_0x8f82('0x5a')](_0x492eb8['body']);}})[_0x8f82('0x22')](respondWithResult(_0x5094d6,null))[_0x8f82('0x2a')](handleError(_0x5094d6,null));};exports[_0x8f82('0x67')]=function(_0x3b8273,_0x75c391,_0x459956){var _0x59d042={'raw':![],'where':{}};var _0x4a4c00={};var _0x2ff805={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x3b8273[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x75c391,null))[_0x8f82('0x22')](function(_0x40b17d){if(_0x40b17d){_0x4a4c00[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0x66')][_0x8f82('0x3f')]);_0x4a4c00[_0x8f82('0x43')]=_['keys'](_0x3b8273[_0x8f82('0x43')]);_0x4a4c00[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x4a4c00[_0x8f82('0x42')],_0x4a4c00[_0x8f82('0x43')]);_0x59d042[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x4a4c00['model'],qs[_0x8f82('0x46')](_0x3b8273[_0x8f82('0x43')]['fields']));_0x59d042[_0x8f82('0x47')]=_0x59d042[_0x8f82('0x47')]['length']?_0x59d042[_0x8f82('0x47')]:_0x4a4c00[_0x8f82('0x42')];if(!_0x3b8273[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x59d042[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x3b8273[_0x8f82('0x43')][_0x8f82('0x30')]);_0x59d042[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x3b8273[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x59d042[_0x8f82('0x69')]=qs['sort'](_0x3b8273['query'][_0x8f82('0x4b')]);_0x59d042['where']=qs[_0x8f82('0x4c')](_['pick'](_0x3b8273['query'],_0x4a4c00['filters']));_0x59d042[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x40b17d['id'];if(_0x3b8273[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x59d042[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x59d042[_0x8f82('0x52')],{'$or':_['map'](_0x59d042['attributes'],function(_0x258b96){var _0x24b305={};_0x24b305[_0x258b96]={'$like':'%'+_0x3b8273[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x24b305;})});}_0x59d042=_[_0x8f82('0x4f')]({},_0x59d042,_0x3b8273['options']);return db[_0x8f82('0x66')][_0x8f82('0x31')]({'where':_0x59d042[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x425ce6){_0x2ff805[_0x8f82('0x31')]=_0x425ce6;if(_0x3b8273[_0x8f82('0x43')][_0x8f82('0x53')]){_0x59d042[_0x8f82('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x8f82('0x55')](_0x59d042);})['then'](function(_0x4f4923){_0x2ff805[_0x8f82('0x56')]=_0x4f4923;return _0x2ff805;});}})['then'](respondWithFilteredResult(_0x75c391,_0x59d042))[_0x8f82('0x2a')](handleError(_0x75c391,null));};exports[_0x8f82('0x6b')]=function(_0xc50288,_0x5bdb99,_0x4b2ff8){return db[_0x8f82('0x54')]['find']({'where':{'id':_0xc50288['params']['id']}})['then'](handleEntityNotFound(_0x5bdb99,null))[_0x8f82('0x22')](function(_0x39e244){if(_0x39e244){return _0x39e244[_0x8f82('0x6b')](_0xc50288[_0x8f82('0x43')][_0x8f82('0x6c')]);}})[_0x8f82('0x22')](respondWithStatusCode(_0x5bdb99,null))['catch'](handleError(_0x5bdb99,null));};exports[_0x8f82('0x6d')]=function(_0x554761,_0x144ca5,_0x2bcc89){if(_0x554761[_0x8f82('0x62')]['id']){delete _0x554761[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x554761['params']['id']}})['then'](handleEntityNotFound(_0x144ca5,null))[_0x8f82('0x22')](function(_0x46e302){if(_0x46e302){_0x554761[_0x8f82('0x62')][_0x8f82('0x6a')]=_0x46e302['id'];return db[_0x8f82('0x6e')][_0x8f82('0x5a')](_0x554761[_0x8f82('0x62')]);}})['then'](respondWithResult(_0x144ca5,null))[_0x8f82('0x2a')](handleError(_0x144ca5,null));};exports[_0x8f82('0x6f')]=function(_0x24f967,_0x5148a7,_0x4c96ad){var _0x8951da={'raw':![],'where':{}};var _0x2444d6={};var _0x1623c1={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x24f967['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5148a7,null))[_0x8f82('0x22')](function(_0x178b37){if(_0x178b37){_0x2444d6[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0x6e')]['rawAttributes']);_0x2444d6['query']=_['keys'](_0x24f967[_0x8f82('0x43')]);_0x2444d6['filters']=_[_0x8f82('0x45')](_0x2444d6[_0x8f82('0x42')],_0x2444d6[_0x8f82('0x43')]);_0x8951da[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x2444d6[_0x8f82('0x42')],qs['fields'](_0x24f967[_0x8f82('0x43')]['fields']));_0x8951da[_0x8f82('0x47')]=_0x8951da[_0x8f82('0x47')][_0x8f82('0x48')]?_0x8951da[_0x8f82('0x47')]:_0x2444d6['model'];if(!_0x24f967[_0x8f82('0x43')]['hasOwnProperty']('nolimit')){_0x8951da[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x24f967[_0x8f82('0x43')]['limit']);_0x8951da[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x24f967[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x8951da[_0x8f82('0x69')]=qs['sort'](_0x24f967[_0x8f82('0x43')]['sort']);_0x8951da[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x24f967[_0x8f82('0x43')],_0x2444d6[_0x8f82('0x4c')]));_0x8951da[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x178b37['id'];if(_0x24f967[_0x8f82('0x43')]['filter']){_0x8951da[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x8951da[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x8951da['attributes'],function(_0x549d0f){var _0x42dcf1={};_0x42dcf1[_0x549d0f]={'$like':'%'+_0x24f967['query']['filter']+'%'};return _0x42dcf1;})});}_0x8951da=_[_0x8f82('0x4f')]({},_0x8951da,_0x24f967['options']);return db['CannedAnswer'][_0x8f82('0x31')]({'where':_0x8951da[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x4faa5a){_0x1623c1[_0x8f82('0x31')]=_0x4faa5a;if(_0x24f967[_0x8f82('0x43')]['includeAll']){_0x8951da[_0x8f82('0x58')]=[{'all':!![]}];}return db[_0x8f82('0x6e')]['findAll'](_0x8951da);})[_0x8f82('0x22')](function(_0x4d38f){_0x1623c1['rows']=_0x4d38f;return _0x1623c1;});}})['then'](respondWithFilteredResult(_0x5148a7,_0x8951da))['catch'](handleError(_0x5148a7,null));};exports[_0x8f82('0x70')]=function(_0x502733,_0x4e8006,_0x27c74f){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x502733['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4e8006,null))[_0x8f82('0x22')](function(_0x4ba1e1){if(_0x4ba1e1){return _0x4ba1e1['removeAnswers'](_0x502733[_0x8f82('0x43')][_0x8f82('0x6c')]);}})[_0x8f82('0x22')](respondWithStatusCode(_0x4e8006,null))[_0x8f82('0x2a')](handleError(_0x4e8006,null));};exports[_0x8f82('0x71')]=function(_0x2a4413,_0x178a53,_0xa03d87){_0x2a4413[_0x8f82('0x62')][_0x8f82('0x72')]=_0x2a4413[_0x8f82('0x73')][_0x8f82('0x74')];return db[_0x8f82('0x54')]['find']({'where':{'id':_0x2a4413[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x178a53,null))['then'](saveUpdates(_0x2a4413['body'],null))[_0x8f82('0x22')](respondWithResult(_0x178a53,null))[_0x8f82('0x2a')](handleError(_0x178a53,null));};exports['addAvatar']=function(_0x396480,_0x5cd890,_0x2a7d03){_0x396480[_0x8f82('0x62')][_0x8f82('0x75')]=_0x396480['file'][_0x8f82('0x74')];return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x396480[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5cd890,null))[_0x8f82('0x22')](saveUpdates(_0x396480[_0x8f82('0x62')],null))['then'](respondWithResult(_0x5cd890,null))[_0x8f82('0x2a')](handleError(_0x5cd890,null));};exports[_0x8f82('0x76')]=function(_0x374a85,_0x285c0a,_0x31c669){_0x374a85[_0x8f82('0x62')]['customerAvatar']=_0x374a85['file'][_0x8f82('0x74')];return db['ChatWebsite'][_0x8f82('0x59')]({'where':{'id':_0x374a85[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x285c0a,null))[_0x8f82('0x22')](saveUpdates(_0x374a85[_0x8f82('0x62')],null))[_0x8f82('0x22')](respondWithResult(_0x285c0a,null))[_0x8f82('0x2a')](handleError(_0x285c0a,null));};exports[_0x8f82('0x77')]=function(_0x65826a,_0x4628d9,_0x12a79e){_0x65826a['body'][_0x8f82('0x78')]=_0x65826a[_0x8f82('0x73')][_0x8f82('0x74')];return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x65826a[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4628d9,null))[_0x8f82('0x22')](saveUpdates(_0x65826a['body'],null))['then'](respondWithResult(_0x4628d9,null))[_0x8f82('0x2a')](handleError(_0x4628d9,null));};exports[_0x8f82('0x79')]=function(_0x24b96c,_0x22442a,_0x2c5d8b){var _0x10ee4d=path['join'](config[_0x8f82('0x7a')],'server/files/images/logos/default_logo.svg');var _0x3dd226={'where':{'id':_0x24b96c[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x72')],'raw':!![]};var _0x171ab7=![];return require(_0x8f82('0x16'))[_0x8f82('0x7b')]()[_0x8f82('0x22')](function(_0x325b24){if(_0x325b24){_0x171ab7=_0x325b24[_0x8f82('0x7c')];}})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x3dd226);})[_0x8f82('0x22')](handleEntityNotFound(_0x22442a,null))[_0x8f82('0x22')](function(_0x28c564){if(_0x28c564){if(!_[_0x8f82('0x7d')](_0x28c564[_0x8f82('0x72')])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/logos/',_0x28c564['sitepic']))&&_0x171ab7){_0x10ee4d=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x80'),_0x28c564['sitepic']);}}return _0x22442a[_0x8f82('0x81')](_0x10ee4d);}})['catch'](handleError(_0x22442a,null));};exports[_0x8f82('0x82')]=function(_0x4c1442,_0x197b90,_0x5c8a00){var _0x3a1ee3=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x83'));var _0x4d8527={'where':{'id':_0x4c1442[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x75')],'raw':!![]};return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x4d8527)[_0x8f82('0x22')](handleEntityNotFound(_0x197b90,null))[_0x8f82('0x22')](function(_0xcdc50f){if(_0xcdc50f){if(!_[_0x8f82('0x7d')](_0xcdc50f['agentAvatar'])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config['root'],_0x8f82('0x84'),_0xcdc50f[_0x8f82('0x75')]))){_0x3a1ee3=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x84'),_0xcdc50f['agentAvatar']);}}return _0x197b90['download'](_0x3a1ee3);}})[_0x8f82('0x2a')](handleError(_0x197b90,null));};exports[_0x8f82('0x85')]=function(_0xfee807,_0x95435d,_0xd14559){var _0xccad6c=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/customer_avatar.png');var _0x1d01e8={'where':{'id':_0xfee807[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x86'),_0x8f82('0x87')],'raw':!![]};return db[_0x8f82('0x54')]['find'](_0x1d01e8)[_0x8f82('0x22')](handleEntityNotFound(_0x95435d,null))['then'](function(_0x264bf5){if(_0x264bf5){if(!_[_0x8f82('0x7d')](_0x264bf5[_0x8f82('0x86')])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x264bf5[_0x8f82('0x86')]))&&_0x264bf5['showCustomerAvatar']){_0xccad6c=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x264bf5[_0x8f82('0x86')]);}}return _0x95435d['download'](_0xccad6c);}})['catch'](handleError(_0x95435d,null));};exports['getSystemAvatar']=function(_0x249f44,_0x44b8f7,_0x2cdaa7){var _0x3d4516=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x88'));var _0x3911f4={'where':{'id':_0x249f44[_0x8f82('0x63')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x3911f4)['then'](handleEntityNotFound(_0x44b8f7,null))['then'](function(_0x270a01){if(_0x270a01){if(!_[_0x8f82('0x7d')](_0x270a01[_0x8f82('0x78')])){if(fs[_0x8f82('0x7e')](path['join'](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x270a01[_0x8f82('0x78')]))){_0x3d4516=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x84'),_0x270a01['systemAvatar']);}}return _0x44b8f7[_0x8f82('0x81')](_0x3d4516);}})[_0x8f82('0x2a')](handleError(_0x44b8f7,null));};exports[_0x8f82('0x89')]=function(_0x5a3214,_0x59219f,_0x133f43){var _0x4e7c30=require(_0x8f82('0x8a'));var _0x157113=new _0x4e7c30();var _0x2e76cf=_0x157113[_0x8f82('0x8b')](_0x5a3214[_0x8f82('0x8c')][_0x8f82('0x8d')])[_0x8f82('0x8e')]();var _0x151d9c={'body':_0x5a3214[_0x8f82('0x62')],'channel':'chat'};var _0x52e38b=[];var _0x40df5d=[];var _0x340f99={};var _0x40730a=![];return db[_0x8f82('0x8f')][_0x8f82('0x64')]()[_0x8f82('0x22')](function(_0x3e775d){if(!_0x3e775d){throw new db['Sequelize'][(_0x8f82('0x90'))]('no\x20available\x20attributes');}_0x52e38b=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x3e775d),['createdAt',_0x8f82('0x92')]);_0x40df5d=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x3e775d),['createdAt','updatedAt',_0x8f82('0x93'),_0x8f82('0x94')]);if(_0x5a3214[_0x8f82('0x62')]['id']){delete _0x5a3214['body']['id'];}if(_[_0x8f82('0x7d')](_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')])){throw new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0x96'));}if(_[_0x8f82('0x7d')](_0x5a3214[_0x8f82('0x62')]['body'])||_0x5a3214[_0x8f82('0x62')]['body']===''){throw new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0x98'));}if(_[_0x8f82('0x7d')](_0x5a3214['body'][_0x8f82('0x99')])){throw new db[(_0x8f82('0x97'))]['ValidationError'](_0x8f82('0x9a')+_0x40df5d);}if(!_[_0x8f82('0x9b')](_0x40df5d,_0x5a3214[_0x8f82('0x62')][_0x8f82('0x99')])){throw new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0x9c')+_0x40df5d);}_0x340f99[_0x5a3214['body'][_0x8f82('0x99')]]=_0x5a3214['body'][_0x8f82('0x95')];})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')]['find']({'where':{'id':_0x5a3214[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x9d')],'as':_0x8f82('0x9e'),'include':[{'model':db[_0x8f82('0x8f')],'as':_0x8f82('0x9f'),'where':_0x340f99,'limit':0x1,'order':[[_0x8f82('0x92'),_0x8f82('0xa0')]]}]},{'model':db[_0x8f82('0xa1')],'as':_0x8f82('0xa2')}]});})['then'](handleEntityNotFound(_0x59219f,null))[_0x8f82('0x22')](function(_0x403d60){if(_0x403d60&&_0x403d60[_0x8f82('0x9e')]){_0x151d9c[_0x8f82('0xa3')]=_0x403d60;_0x151d9c[_0x8f82('0xa4')]=_0x403d60[_0x8f82('0xa2')];_0x151d9c[_0x8f82('0xa5')]=_0x403d60[_0x8f82('0x9e')];_0x151d9c[_0x8f82('0xa4')]=_[_0x8f82('0xa6')](_0x151d9c[_0x8f82('0xa4')],[_0x8f82('0xa7')],[_0x8f82('0xa8')]);if(_0x151d9c[_0x8f82('0xa3')][_0x8f82('0xa2')]){delete _0x151d9c[_0x8f82('0xa3')][_0x8f82('0xa2')];}if(_0x151d9c['account'][_0x8f82('0x9e')]&&_0x151d9c[_0x8f82('0xa3')][_0x8f82('0x9e')][_0x8f82('0x9f')]['length']){return _0x151d9c[_0x8f82('0xa3')][_0x8f82('0x9e')][_0x8f82('0x9f')][0x0];}var _0x53158c=_[_0x8f82('0x19')](_0x5a3214[_0x8f82('0x62')],{'firstName':_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')],'ListId':_0x403d60[_0x8f82('0x94')]});_0x53158c[_0x5a3214[_0x8f82('0x62')][_0x8f82('0x99')]]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')];return db[_0x8f82('0x8f')][_0x8f82('0x5a')](_0x53158c,{'fields':_0x52e38b,'raw':!![]});}})[_0x8f82('0x22')](handleEntityNotFound(_0x59219f,null))[_0x8f82('0x22')](function(_0x1fddb9){_0x151d9c[_0x8f82('0xa9')]=_0x1fddb9;var _0xa3133=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xaa')];if(_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xab')]){_0xa3133=_0x5a3214[_0x8f82('0x8c')]['cf-connecting-ip'];}else if(_0x5a3214[_0x8f82('0x8c')]['x-forwarded-for']){_0xa3133=_[_0x8f82('0xac')](_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xad')]['split'](','));}if(_0x1fddb9){var _0x5741d9={'ContactId':_0x1fddb9['id'],'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'from':(_0x1fddb9['firstName']||'')+'\x20'+(_0x1fddb9['lastName']||''),'customerIp':_0xa3133,'customerPort':_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xae')]?_0x5a3214[_0x8f82('0x8c')]['x-real-port']:null,'referer':_0x5a3214['body'][_0x8f82('0xaf')],'browserName':_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0x39')]&&_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]?util[_0x8f82('0xb2')](_0x8f82('0xb3'),_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0x39')],_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]):_0x8f82('0xb4'),'browserVersion':_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]||_0x8f82('0xb4'),'osName':util[_0x8f82('0xb2')](_0x8f82('0xb3'),_0x2e76cf['os']['name'],_0x2e76cf['os'][_0x8f82('0xb1')]),'osVersion':_0x2e76cf['os'][_0x8f82('0xb1')],'deviceModel':_0x2e76cf['device']['model']&&_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')]?util['format'](_0x8f82('0xb7'),_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0x42')],_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')],_0x2e76cf[_0x8f82('0xb5')]['type']):null,'deviceVendor':_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')],'deviceType':_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0x41')],'formData':JSON[_0x8f82('0x26')](_0x5a3214[_0x8f82('0x62')])};var _0x11d39e={'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'closed':![]};if(_0x5a3214[_0x8f82('0x62')]['threadId']){_0x11d39e[_0x8f82('0xb8')]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')];return db[_0x8f82('0xb9')][_0x8f82('0x59')]({'where':_0x11d39e})['then'](function(_0x256b6d){if(_0x256b6d){return[_0x256b6d,![]];}_0x5741d9['threadId']=_0x5a3214[_0x8f82('0x62')]['threadId'];_0x5741d9[_0x8f82('0xba')]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xba')];return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)['then'](function(_0x321b94){return[_0x321b94,!![]];});});}_0x11d39e['ContactId']=_0x1fddb9['id'];if(_0x5a3214[_0x8f82('0x62')]['interaction']&&_0x5a3214['body']['interaction']['id']){_0x11d39e['id']=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xbb')]['id'];return db['ChatInteraction'][_0x8f82('0x59')]({'where':_0x11d39e})['then'](function(_0x8ea81d){if(_0x8ea81d){return[_0x8ea81d,![]];}return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)[_0x8f82('0x22')](function(_0x15699c){return[_0x15699c,!![]];});});}return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)[_0x8f82('0x22')](function(_0x32b1da){return[_0x32b1da,!![]];});}})[_0x8f82('0xbc')](function(_0x631156,_0x31ee5d){if(_0x631156){_0x40730a=_0x31ee5d;if(!_0x31ee5d){var _0x13239b={'from':(_0x151d9c['contact'][_0x8f82('0xbd')]||'')+'\x20'+(_0x151d9c[_0x8f82('0xa9')]['lastName']||'')};if(_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')]&&_0x5a3214[_0x8f82('0x62')]['messageId']&&_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')]!=_0x5a3214['body'][_0x8f82('0xbe')]){_0x13239b['threadId']=_0x5a3214['body'][_0x8f82('0xbe')];}return _0x631156[_0x8f82('0xbf')](_0x13239b);}else{return _0x631156;}}})[_0x8f82('0x22')](function(_0x2dc057){_0x151d9c[_0x8f82('0xbb')]=_0x2dc057['get']({'plain':!![]});_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc0')]=_0x40730a;if(_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc0')]){if(_0x151d9c[_0x8f82('0xa3')]['autoclose']){_0x151d9c[_0x8f82('0xa4')][_0x8f82('0xc1')]({'id':0x0,'priority':_0x151d9c[_0x8f82('0xa4')][_0x8f82('0x48')]+0x1,'app':'close','appdata':_0x8f82('0xc2'),'interval':_0x8f82('0xc3')});}}return db[_0x8f82('0xc4')][_0x8f82('0x5a')]({'body':_0x5a3214[_0x8f82('0x62')][_0x8f82('0x62')],'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'ChatInteractionId':_0x2dc057['id'],'direction':'in','ContactId':_0x151d9c[_0x8f82('0xa9')]['id'],'AttachmentId':_0x5a3214['body'][_0x8f82('0xc5')]});})[_0x8f82('0x22')](function(_0x564279){_0x151d9c[_0x8f82('0x28')]=_0x564279;if(_0x151d9c[_0x8f82('0xbb')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc6')]}})[_0x8f82('0x22')](function(_0x4dec57){if(_0x4dec57){_0x151d9c[_0x8f82('0xa4')][_0x8f82('0xc7')]({'id':0x0,'priority':0x0,'app':_0x8f82('0xc8'),'appdata':_0x4dec57[_0x8f82('0x39')]+','+(_0x151d9c[_0x8f82('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x151d9c[_0x8f82('0xc9')]=!![];}return respondWithRpcPromise(_0x8f82('0xca'),_0x8f82('0xcb'),_0x151d9c);});}return respondWithRpcPromise(_0x8f82('0xca'),_0x8f82('0xcb'),_0x151d9c);})[_0x8f82('0x22')](function(_0x1bd456){respondWithRpcPromise(_0x8f82('0xcc'),_0x8f82('0xcc'),{'event':_0x8f82('0x89'),'message':_0x1bd456},client9002);return _0x1bd456;})['then'](respondWithResult(_0x59219f,null))[_0x8f82('0x2a')](handleError(_0x59219f,null));};exports[_0x8f82('0xcd')]=function(_0x5294a2,_0x4f1d38,_0x524ed){var _0x4d7d00,_0x110590,_0x271863;var _0x369fb6=[];var _0x18a80c=[];var _0x1b9c37={};var _0x52099a=_0x5294a2[_0x8f82('0xce')]||[];var _0x12cb5a=[];var _0x22c0ea;return db[_0x8f82('0x8f')][_0x8f82('0x64')]()[_0x8f82('0x22')](function(_0x44f9bb){if(!_0x44f9bb){throw new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0xcf'));}_0x18a80c=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x44f9bb),[_0x8f82('0xd0'),_0x8f82('0x92')]);_0x369fb6=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x44f9bb),[_0x8f82('0xd0'),'updatedAt',_0x8f82('0x93'),_0x8f82('0x94')]);if(_0x5294a2[_0x8f82('0x62')]['id']){delete _0x5294a2[_0x8f82('0x62')]['id'];}if(_['isNil'](_0x5294a2[_0x8f82('0x62')]['from'])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)[_0x8f82('0x3a')](new db['Sequelize'][(_0x8f82('0x90'))]('from\x20is\x20mandatory'));}if(_[_0x8f82('0x7d')](_0x5294a2[_0x8f82('0x62')][_0x8f82('0x62')])||_0x5294a2[_0x8f82('0x62')][_0x8f82('0x62')]===''){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)['send'](new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8f82('0x7d')](_0x5294a2['body'][_0x8f82('0xd1')])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)[_0x8f82('0x3a')](new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0xd2')+_0x369fb6));}if(!_['includes'](_0x369fb6,_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0xd3')+_0x369fb6));}_0x1b9c37[_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')]]=_0x5294a2['body'][_0x8f82('0x95')];})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x5294a2[_0x8f82('0x63')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x8f82('0xd4')}]});})[_0x8f82('0x22')](handleEntityNotFound(_0x4f1d38,null))['then'](function(_0x1274c6){if(_0x1274c6&&_0x1274c6[_0x8f82('0x9e')]){_0x110590=_0x1274c6;var _0x5a5c86=_[_0x8f82('0x19')](_0x5294a2[_0x8f82('0x62')],{'firstName':_0x5294a2[_0x8f82('0x62')]['from'],'phone':_0x5294a2['body']['from'],'ListId':_0x1274c6[_0x8f82('0x94')]});_0x5a5c86[_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')]]=_0x5294a2[_0x8f82('0x62')][_0x8f82('0x95')];return db['CmContact'][_0x8f82('0xd5')]({'where':_0x1b9c37,'defaults':_0x5a5c86});}})[_0x8f82('0xbc')](function(_0x4bfe69){if(_0x4bfe69){_0x271863=_0x4bfe69;var _0x35365c=fs[_0x8f82('0xd6')](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x8f82('0xd7'));var _0x5a6d37=ejs[_0x8f82('0xd8')](_0x35365c,{'body':_['toPairs'](_0x5294a2[_0x8f82('0x62')]['body']),'bodyTitle':_0x110590[_0x8f82('0xd9')]});return db['ChatOfflineMessage'][_0x8f82('0x5a')]({'body':_0x5a6d37,'ContactId':_0x4bfe69['id'],'ChatWebsiteId':_0x110590['id']});}})['then'](function(_0x406849){_0x22c0ea=_0x406849;if(_0x52099a[_0x8f82('0x48')]){var _0xcfbb85=_0x52099a['map'](function(_0x2991cd){return{'name':_0x2991cd[_0x8f82('0xda')],'basename':_0x2991cd[_0x8f82('0x74')],'type':_0x2991cd[_0x8f82('0xdb')],'ChatOfflineMessageId':_0x406849['id']};});_0x12cb5a=_0xcfbb85[_0x8f82('0x3e')](_0x3bfb22=>{var _0x37e167={'filename':_0x3bfb22['name'],'path':path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server','files',_0x8f82('0xdc'),'offline-chat',_0x3bfb22[_0x8f82('0xdd')])};return _0x37e167;});if(!_0x110590[_0x8f82('0xde')]){return db[_0x8f82('0xdf')]['transaction'](function(_0xef7eaf){return db[_0x8f82('0xe0')][_0x8f82('0xe1')](_0xcfbb85,{'transaction':_0xef7eaf});});}}})[_0x8f82('0x22')](function(){if(_0x22c0ea){_0x4d7d00=_0x22c0ea;return db[_0x8f82('0xd4')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x8f82('0xe2')],'as':'Smtp','raw':!![]}]});}})[_0x8f82('0x22')](function(_0x14cb06){if(_0x14cb06&&_0x14cb06[_0x8f82('0xe3')]&&_0x110590[_0x8f82('0xe4')]&&_0x110590['forwardOfflineAddress']){var _0x38fb76={'tls':{'rejectUnauthorized':![]}};if(_0x14cb06[_0x8f82('0xe3')]['service']){_0x38fb76['service']=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe5')];}else{_0x38fb76[_0x8f82('0xe6')]=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe6')];_0x38fb76[_0x8f82('0xe7')]=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe7')];_0x38fb76[_0x8f82('0xe8')]=_0x14cb06[_0x8f82('0xe3')]['secure'];}if(_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe9')]){_0x38fb76[_0x8f82('0xea')]={'user':_0x14cb06[_0x8f82('0xe3')][_0x8f82('0x5b')],'pass':_0x14cb06[_0x8f82('0xe3')]['pass']};}return respondWithRpcPromise(_0x8f82('0xeb'),_0x8f82('0xec'),{'account':_0x38fb76,'message':{'from':util['format'](_0x8f82('0xed'),_0x14cb06[_0x8f82('0x39')],_0x14cb06[_0x8f82('0xee')]||_0x14cb06[_0x8f82('0xe3')][_0x8f82('0x5b')]),'to':_0x110590[_0x8f82('0xef')],'subject':_0x110590[_0x8f82('0xf0')],'html':_0x4d7d00[_0x8f82('0x62')],'attachments':_0x12cb5a}},client9003)[_0x8f82('0x22')](function(){return _0x4d7d00;})[_0x8f82('0x2a')](function(_0x5a22fc){console[_0x8f82('0x27')](_0x5a22fc);});}})[_0x8f82('0x22')](function(){if(_0x110590&&_0x110590[_0x8f82('0xde')]&&_0x110590['MailAccountId']){var _0x5d9b57=[];if(_0x52099a[_0x8f82('0x48')]){_0x5d9b57=_0x52099a['map'](function(_0x10bf68){return{'name':_0x10bf68[_0x8f82('0xda')],'basename':_0x10bf68[_0x8f82('0x74')],'type':_0x10bf68['mimetype'],'ChatOfflineMessageId':_0x22c0ea['id']};});}var _0x3cdf00;if(!_['isNil'](_0x110590[_0x8f82('0xf1')])){var _0x1cdda8=_[_0x8f82('0x3e')](_0x5294a2['body'],function(_0x4033dc){return _0x4033dc;});var _0x4eb4f3=_[_0x8f82('0xf2')](_0x1cdda8)[0x0];var _0x4cf072=_[_0x8f82('0xf3')](_0x4eb4f3,function(_0x5dde13){return _0x5dde13;});_0x3cdf00=_0x4cf072[0x1][_0x110590[_0x8f82('0xf1')]];}var _0x1db679={'from':_0x271863[_0x8f82('0xee')],'firstName':_0x271863[_0x8f82('0xbd')],'lastName':_0x271863[_0x8f82('0xf4')],'mapKey':_0x8f82('0xee'),'message':{'from':_0x271863[_0x8f82('0xee')],'to':_0x110590[_0x8f82('0xd4')][_0x8f82('0xee')],'cc':'','subject':_[_0x8f82('0x7d')](_0x3cdf00)?_0x110590[_0x8f82('0xf0')]:_0x3cdf00,'messageId':'','sentAt':new Date(),'attach':_0x5d9b57['length'],'attachments':_0x5d9b57,'originChannel':_0x8f82('0xf5'),'ChatWebsiteId':_0x110590['id'],'ChatOfflineMessageId':_0x4d7d00['id'],'originTo':_0x110590[_0x8f82('0xd4')][_0x8f82('0xee')]},'body':_0x4d7d00[_0x8f82('0x62')]};var _0x456f1a={'account':{'id':_0x110590[_0x8f82('0xf6')]},'body':_0x1db679,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8f82('0xf7'),_0x8f82('0xf8'),_0x456f1a,client9001)[_0x8f82('0x22')](function(){return _0x4d7d00;})[_0x8f82('0x2a')](function(_0x4894ea){console[_0x8f82('0x27')](_0x4894ea);});}return;})[_0x8f82('0x22')](function(){if(_0x4d7d00){return _0x4d7d00;}})[_0x8f82('0x22')](respondWithResult(_0x4f1d38,null))[_0x8f82('0x2a')](function(_0x40bcbd){console[_0x8f82('0x27')](_0x8f82('0x2a'),_0x40bcbd);for(var _0x3f5c12 of _0x52099a){var _0x20ea8b=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0xf9'),_0x8f82('0xce'),'attachments','offline-chat',_0x3f5c12[_0x8f82('0x74')]);fs_extra['remove'](_0x20ea8b)[_0x8f82('0x2a')](function(_0x2b6ee0){console[_0x8f82('0x27')]('Could\x20not\x20remove\x20attachment\x20file',_0x20ea8b,_0x2b6ee0);});}});};exports[_0x8f82('0xfa')]=function(_0x1ae86f,_0x461732,_0x20903f){return db[_0x8f82('0xb9')][_0x8f82('0x59')]({'where':{'id':_0x1ae86f['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x461732,null))[_0x8f82('0x22')](function(_0x1927e3){if(_0x1927e3){return _0x1927e3[_0x8f82('0xfa')](_0x1ae86f[_0x8f82('0x62')]['ids'],_['omit'](_0x1ae86f[_0x8f82('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x461732,null))[_0x8f82('0x2a')](handleError(_0x461732,null));};exports['getInteractions']=function(_0x2abe0d,_0x27ea38,_0xc66e0e){var _0x423a8d={'raw':![],'where':{}};var _0x3bdb34={};var _0x46472e={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x2abe0d['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x27ea38,null))[_0x8f82('0x22')](function(_0x2b79b6){if(_0x2b79b6){_0x3bdb34[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0xb9')]['rawAttributes']);_0x3bdb34[_0x8f82('0x43')]=_[_0x8f82('0x44')](_0x2abe0d[_0x8f82('0x43')]);_0x3bdb34[_0x8f82('0x4c')]=_['intersection'](_0x3bdb34[_0x8f82('0x42')],_0x3bdb34['query']);_0x423a8d[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x3bdb34[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x46')]));_0x423a8d[_0x8f82('0x47')]=_0x423a8d[_0x8f82('0x47')][_0x8f82('0x48')]?_0x423a8d[_0x8f82('0x47')]:_0x3bdb34[_0x8f82('0x42')];if(!_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x423a8d[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x30')]);_0x423a8d[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x423a8d[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x423a8d[_0x8f82('0x52')]=qs['filters'](_['pick'](_0x2abe0d[_0x8f82('0x43')],_0x3bdb34['filters']));_0x423a8d['where'][_0x8f82('0x6a')]=_0x2b79b6['id'];if(_0x2abe0d['query'][_0x8f82('0x4e')]){_0x423a8d[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x423a8d[_0x8f82('0x52')],{'$or':_['map'](_0x423a8d[_0x8f82('0x47')],function(_0x42d158){var _0x2a7c35={};_0x2a7c35[_0x42d158]={'$like':'%'+_0x2abe0d[_0x8f82('0x43')]['filter']+'%'};return _0x2a7c35;})});}_0x423a8d=_[_0x8f82('0x4f')]({},_0x423a8d,_0x2abe0d[_0x8f82('0x51')]);return db[_0x8f82('0xb9')][_0x8f82('0x31')]({'where':_0x423a8d[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x20ab0f){_0x46472e[_0x8f82('0x31')]=_0x20ab0f;if(_0x2abe0d[_0x8f82('0x43')]['includeAll']){_0x423a8d[_0x8f82('0x58')]=[{'model':db['CmContact'],'as':_0x8f82('0xfb'),'required':![]},{'model':db[_0x8f82('0xfc')],'as':'Owner','attributes':['name',_0x8f82('0xfd'),_0x8f82('0xfe')],'required':![]},{'model':db[_0x8f82('0xff')],'as':'Tags','attributes':['id',_0x8f82('0x39'),_0x8f82('0x100')],'where':_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x101')]?{'id':_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x101')]}:undefined,'required':_0x2abe0d[_0x8f82('0x43')]['tag']?!![]:![]}];}return db[_0x8f82('0xb9')]['findAll'](_0x423a8d);})[_0x8f82('0x22')](function(_0x4fedad){_0x46472e[_0x8f82('0x56')]=_0x4fedad;return _0x46472e;});}})['then'](respondWithFilteredResult(_0x27ea38,_0x423a8d))['catch'](handleError(_0x27ea38,null));};function iftimePromise(_0x2d5df6,_0x3b208a){return respondWithRpcPromise('Command',_0x8f82('0x102'),{'command':_0x3b208a[_0x8f82('0x103')]?util[_0x8f82('0xb2')](_0x8f82('0x104'),_0x2d5df6['interval'],_0x3b208a['timezone']):util['format'](_0x8f82('0x105'),_0x2d5df6[_0x8f82('0x106')])},client9002)[_0x8f82('0x22')](function(_0x4c475c){var _0x273090=_0x4c475c&&_0x4c475c[_0x8f82('0x107')](_0x8f82('0x108'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3b208a['id'],_0x2d5df6['id'],_0x2d5df6[_0x8f82('0x106')],_0x273090?_0x8f82('0x109'):_0x8f82('0x10a'),_0x3b208a[_0x8f82('0x103')]?_0x3b208a['timezone']:_0x8f82('0x10b'));return _0x273090;})['catch'](function(_0x3e1b2d){logger[_0x8f82('0x27')](_0x8f82('0x10c'),_0x3b208a['id'],_0x2d5df6['id'],_0x2d5df6[_0x8f82('0x106')],util['inspect'](_0x3e1b2d,{'showHidden':![],'depth':null}),_0x3b208a[_0x8f82('0x103')]?_0x3b208a['timezone']:_0x8f82('0x10b'));return![];});}exports[_0x8f82('0x102')]=function(_0x3fb2ce,_0x528a54,_0x46ef71){var _0x4bf9f7=0x0;var _0x4685cd=0x0;var _0x314f8a=![];var _0x354627;var _0x3e4f73;return db['ChatWebsite'][_0x8f82('0x59')]({'where':{'id':_0x3fb2ce[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x10d')],'as':_0x8f82('0x10d'),'include':[{'model':db[_0x8f82('0x10d')],'as':_0x8f82('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x528a54,null))[_0x8f82('0x22')](function(_0x4cdfd6){if(_0x4cdfd6){_0x354627=_0x4cdfd6;return _0x4cdfd6[_0x8f82('0x10f')]({'raw':!![]});}})['then'](function(_0xae1457){if(_0x354627){if(_0xae1457){_0x3e4f73=_0xae1457;}}return require(_0x8f82('0x16'))['getLicense']();})[_0x8f82('0x22')](function(_0x5376e0){if(_0x5376e0){_0x4685cd=_0x5376e0[_0x8f82('0x110')];_0x314f8a=_0x5376e0['custom'];}})[_0x8f82('0x22')](function(){return db[_0x8f82('0xb9')][_0x8f82('0x31')]({'where':{'closed':![]}});})[_0x8f82('0x22')](function(_0x3e4ae2){_0x4bf9f7=_0x3e4ae2;if(_0x4685cd&&_0x3e4ae2>_0x4685cd){return db[_0x8f82('0x111')][_0x8f82('0x68')]({'where':{'id':0x1}})[_0x8f82('0x22')](function(_0x4cec86){if(_0x4cec86){_0x4cec86['increment'](_0x8f82('0x112'));}});}})['then'](function(){if(_0x354627[_0x8f82('0x10d')]&&_0x354627[_0x8f82('0x10d')][_0x8f82('0x10e')]){var _0x11017f=[];for(var _0x486b39=0x0;_0x486b39<_0x354627[_0x8f82('0x10d')][_0x8f82('0x10e')][_0x8f82('0x48')];_0x486b39++){var _0x3f1135=_0x354627[_0x8f82('0x10d')]['Intervals'][_0x486b39]['get']({'plain':!![]});_0x11017f['push'](iftimePromise(_0x3f1135,_0x354627));}return BPromise[_0x8f82('0x113')](_0x11017f)[_0x8f82('0x22')](function(_0x3170fd){return _['some'](_0x3170fd);});}else{return!![];}})[_0x8f82('0x22')](function(_0x3a42cc){var _0x5cee34=fs['readFileSync'](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/chat/iframe.ejs'),'utf8');var _0x3c7c23={'remote':_0x354627['remote'],'query':querystring[_0x8f82('0x26')](_[_0x8f82('0x4f')](_0x354627[_0x8f82('0x35')]({'plain':!![]}),{'customerIp':_0x3fb2ce['headers'][_0x8f82('0xad')]||_0x3fb2ce[_0x8f82('0x8c')][_0x8f82('0x114')]||_0x3fb2ce[_0x8f82('0x115')]['remoteAddress']||_0x3fb2ce['ip'],'referer':_0x3fb2ce['headers'][_0x8f82('0xaf')],'openedInteractions':_0x4bf9f7,'maxInteractions':_0x4685cd,'virtual':_0x314f8a[_0x8f82('0x110')],'online':_0x3a42cc,'custom':_0x314f8a}))['replace'](/'/g,'\x5c\x27')};_0x528a54[_0x8f82('0x3a')](ejs[_0x8f82('0xd8')](Mustache[_0x8f82('0xd8')](_0x5cee34,_0x3c7c23),{'proactiveActions':_0x3e4f73,'alignment':_0x354627[_0x8f82('0x116')],'verticalAlignment':_0x354627[_0x8f82('0x117')],'div_color':_0x354627[_0x8f82('0x100')],'text_color':_0x354627[_0x8f82('0x118')],'button_color':_0x354627[_0x8f82('0x119')],'background_color':_0x354627[_0x8f82('0x11a')]}));})['catch'](handleError(_0x528a54,null));};exports[_0x8f82('0x11b')]=function(_0x4a6b8b,_0x4bfb88,_0x236584){return db[_0x8f82('0x54')]['findOne']({'where':{'id':_0x4a6b8b[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4bfb88,null))['then'](function(_0x5af643){if(_0x5af643){return db[_0x8f82('0xdf')][_0x8f82('0x11c')](function(_0xc3cfe4){return db[_0x8f82('0xa1')][_0x8f82('0x34')]({'where':{'ChatWebsiteId':_0x4a6b8b[_0x8f82('0x63')]['id']},'transaction':_0xc3cfe4})[_0x8f82('0x22')](function(_0xa88a9a){var _0xb623a9=_[_0x8f82('0x3e')](_0x4a6b8b['body'],function(_0x2bc73a){_0x2bc73a[_0x8f82('0x6a')]=_0x4a6b8b[_0x8f82('0x63')]['id'];return _0x2bc73a;});return db['ChatApplication'][_0x8f82('0xe1')](_0xb623a9,{'transaction':_0xc3cfe4});});})[_0x8f82('0x22')](function(){return db[_0x8f82('0xa1')][_0x8f82('0x11d')]({'where':{'ChatWebsiteId':_0x4a6b8b['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4bfb88,null))['catch'](handleError(_0x4bfb88,null));};exports[_0x8f82('0x11e')]=function(_0x506db1,_0x498bb3,_0x1cb9a1){var _0x5f05fb={};var _0x5d828f={};var _0x4b0db0;var _0x27e382;return db['ChatWebsite'][_0x8f82('0x68')]({'where':{'id':_0x506db1['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x498bb3,null))[_0x8f82('0x22')](function(_0x253378){if(_0x253378){_0x4b0db0=_0x253378;_0x5d828f['model']=_[_0x8f82('0x44')](db['ChatApplication'][_0x8f82('0x3f')]);_0x5d828f[_0x8f82('0x43')]=_['keys'](_0x506db1[_0x8f82('0x43')]);_0x5d828f[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x5d828f[_0x8f82('0x42')],_0x5d828f['query']);_0x5f05fb[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x5d828f[_0x8f82('0x42')],qs['fields'](_0x506db1[_0x8f82('0x43')]['fields']));_0x5f05fb[_0x8f82('0x47')]=_0x5f05fb[_0x8f82('0x47')][_0x8f82('0x48')]?_0x5f05fb[_0x8f82('0x47')]:_0x5d828f[_0x8f82('0x42')];_0x5f05fb[_0x8f82('0x69')]=qs['sort'](_0x506db1['query'][_0x8f82('0x4b')]);_0x5f05fb[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_['pick'](_0x506db1[_0x8f82('0x43')],_0x5d828f[_0x8f82('0x4c')]));if(_0x506db1[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x5f05fb[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x5f05fb[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x5f05fb[_0x8f82('0x47')],function(_0x4a6fb8){var _0x2c5c2b={};_0x2c5c2b[_0x4a6fb8]={'$like':'%'+_0x506db1[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x2c5c2b;})});}_0x5f05fb=_['merge']({},_0x5f05fb,_0x506db1['options']);return _0x4b0db0[_0x8f82('0x11e')](_0x5f05fb);}})[_0x8f82('0x22')](function(_0xe98781){if(_0xe98781){_0x27e382=_0xe98781[_0x8f82('0x48')];if(!_0x506db1[_0x8f82('0x43')][_0x8f82('0x49')]('nolimit')){_0x5f05fb['limit']=qs[_0x8f82('0x30')](_0x506db1[_0x8f82('0x43')][_0x8f82('0x30')]);_0x5f05fb[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x506db1[_0x8f82('0x43')][_0x8f82('0x2e')]);}return _0x4b0db0[_0x8f82('0x11e')](_0x5f05fb);}})[_0x8f82('0x22')](function(_0x54a586){if(_0x54a586){return _0x54a586?{'count':_0x27e382,'rows':_0x54a586}:null;}})['then'](respondWithResult(_0x498bb3,null))['catch'](handleError(_0x498bb3,null));};exports['addProactiveActions']=function(_0x1aa3d3,_0x2827f0,_0x1b8848){return db['chatProactiveAction']['find']({'where':{'id':_0x1aa3d3['params']['id']}})['then'](handleEntityNotFound(_0x2827f0,null))['then'](function(_0x34544c){if(_0x34544c){return _0x34544c[_0x8f82('0x11f')](_0x1aa3d3[_0x8f82('0x62')][_0x8f82('0x6c')],_[_0x8f82('0x120')](_0x1aa3d3[_0x8f82('0x62')],[_0x8f82('0x6c'),'id'])||{});}})[_0x8f82('0x22')](respondWithResult(_0x2827f0,null))['catch'](handleError(_0x2827f0,null));};exports[_0x8f82('0x10f')]=function(_0x4484e5,_0x278e82,_0x5f1921){var _0x5f3752={};var _0x43316a={};var _0x5aa6d4;var _0x2a6e90;return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x4484e5[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x278e82,null))[_0x8f82('0x22')](function(_0x4771ae){if(_0x4771ae){_0x5aa6d4=_0x4771ae;_0x43316a[_0x8f82('0x42')]=_[_0x8f82('0x44')](db['ChatProactiveAction'][_0x8f82('0x3f')]);_0x43316a[_0x8f82('0x43')]=_['keys'](_0x4484e5['query']);_0x43316a['filters']=_[_0x8f82('0x45')](_0x43316a[_0x8f82('0x42')],_0x43316a[_0x8f82('0x43')]);_0x5f3752[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x43316a[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x4484e5['query'][_0x8f82('0x46')]));_0x5f3752[_0x8f82('0x47')]=_0x5f3752[_0x8f82('0x47')]['length']?_0x5f3752[_0x8f82('0x47')]:_0x43316a['model'];_0x5f3752['order']=qs[_0x8f82('0x4b')](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x5f3752[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x4484e5['query'],_0x43316a[_0x8f82('0x4c')]));if(_0x4484e5['query'][_0x8f82('0x4e')]){_0x5f3752[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x5f3752[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x5f3752[_0x8f82('0x47')],function(_0xe12e5e){var _0x592f73={};_0x592f73[_0xe12e5e]={'$like':'%'+_0x4484e5[_0x8f82('0x43')]['filter']+'%'};return _0x592f73;})});}_0x5f3752=_[_0x8f82('0x4f')]({},_0x5f3752,_0x4484e5[_0x8f82('0x51')]);return _0x5aa6d4['getProactiveActions'](_0x5f3752);}})[_0x8f82('0x22')](function(_0x3ceb40){if(_0x3ceb40){_0x2a6e90=_0x3ceb40['length'];if(!_0x4484e5[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x5f3752[_0x8f82('0x30')]=qs['limit'](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x30')]);_0x5f3752[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x2e')]);}return _0x5aa6d4[_0x8f82('0x10f')](_0x5f3752);}})[_0x8f82('0x22')](function(_0x214927){if(_0x214927){return _0x214927?{'count':_0x2a6e90,'rows':_0x214927}:null;}})[_0x8f82('0x22')](respondWithResult(_0x278e82,null))[_0x8f82('0x2a')](handleError(_0x278e82,null));};exports[_0x8f82('0x121')]=function(_0x133b15,_0x61e314,_0x19c420){var _0x10b222=_0x133b15[_0x8f82('0x43')]['online']==='false'?'offlineForm':_0x8f82('0x122');return db['ChatWebsite'][_0x8f82('0x59')]({'attributes':['id',_0x10b222],'where':{'id':_0x133b15['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x61e314,null))[_0x8f82('0x22')](function(_0x416cf8){if(_0x416cf8){var _0x1209cc=_0x416cf8[_0x10b222];var _0x57781e=_0x1209cc&&_0x1209cc[_0x8f82('0x123')]?_0x1209cc[_0x8f82('0x123')]:[];_0x61e314['send']({'fromKey':_[_0x8f82('0x7d')](_0x1209cc[_0x8f82('0x124')])?undefined:_0x1209cc[_0x8f82('0x124')],'count':_0x57781e[_0x8f82('0x48')],'rows':_0x57781e});}})['catch'](handleError(_0x61e314,null));};exports[_0x8f82('0x125')]=function(_0x5a4a01,_0x289e52,_0x390e69){var _0x510796={'raw':![],'where':{}};var _0x5744cd={};var _0xb69389={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8f82('0x68')]({'where':{'id':_0x5a4a01[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x289e52,null))['then'](function(_0x494fc2){if(_0x494fc2){_0x5744cd[_0x8f82('0x42')]=_[_0x8f82('0x44')](db['ChatOfflineMessage'][_0x8f82('0x3f')]);_0x5744cd[_0x8f82('0x43')]=_['keys'](_0x5a4a01[_0x8f82('0x43')]);_0x5744cd[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x5744cd[_0x8f82('0x42')],_0x5744cd['query']);_0x510796[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x5744cd[_0x8f82('0x42')],qs['fields'](_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x46')]));_0x510796[_0x8f82('0x47')]=_0x510796[_0x8f82('0x47')][_0x8f82('0x48')]?_0x510796[_0x8f82('0x47')]:_0x5744cd['model'];if(!_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x510796[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x5a4a01['query'][_0x8f82('0x30')]);_0x510796[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x5a4a01[_0x8f82('0x43')]['offset']);}_0x510796[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x5a4a01['query'][_0x8f82('0x4b')]);_0x510796['where']=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x5a4a01[_0x8f82('0x43')],_0x5744cd[_0x8f82('0x4c')]));_0x510796[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x494fc2['id'];if(_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x510796[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x510796[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x510796['attributes'],function(_0x341525){var _0x3b8321={};_0x3b8321[_0x341525]={'$like':'%'+_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x3b8321;})});}_0x510796=_['merge']({},_0x510796,_0x5a4a01[_0x8f82('0x51')]);return db[_0x8f82('0x126')][_0x8f82('0x31')]({'where':_0x510796['where']})['then'](function(_0x1cc9a1){_0xb69389[_0x8f82('0x31')]=_0x1cc9a1;if(_0x5a4a01['query'][_0x8f82('0x53')]){_0x510796['include']=[{'all':!![]}];}else{_0x510796['include']=[{'model':db[_0x8f82('0x8f')],'as':_0x8f82('0xfb'),'required':![]},{'model':db[_0x8f82('0xe0')],'as':'Attachments','required':![]}];}return db[_0x8f82('0x126')]['findAll'](_0x510796);})[_0x8f82('0x22')](function(_0x5b1010){_0xb69389[_0x8f82('0x56')]=_0x5b1010;return _0xb69389;});}})[_0x8f82('0x22')](respondWithFilteredResult(_0x289e52,_0x510796))[_0x8f82('0x2a')](handleError(_0x289e52,null));};exports[_0x8f82('0x127')]=function(_0x55175b,_0x3c6f35,_0x1c19af){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x55175b[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x3c6f35,null))[_0x8f82('0x22')](function(_0x1c5f03){if(_0x1c5f03){return _0x1c5f03[_0x8f82('0x127')](_0x55175b[_0x8f82('0x62')][_0x8f82('0x6c')],_[_0x8f82('0x120')](_0x55175b[_0x8f82('0x62')],[_0x8f82('0x6c'),'id'])||{})['spread'](function(_0x1d905b){for(var _0x2e210a=0x0;_0x2e210a<_0x55175b['body'][_0x8f82('0x6c')][_0x8f82('0x48')];_0x2e210a+=0x1){socket[_0x8f82('0x128')]('userChatWebsite:save',{'UserId':Number(_0x55175b[_0x8f82('0x62')]['ids'][_0x2e210a]),'ChatWebsiteId':Number(_0x55175b['params']['id'])});}return _0x1d905b;});}})['then'](respondWithResult(_0x3c6f35,null))[_0x8f82('0x2a')](handleError(_0x3c6f35,null));};exports[_0x8f82('0x129')]=function(_0x59b424,_0x9025c,_0x4ff242){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x59b424['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x9025c,null))[_0x8f82('0x22')](function(_0xba3494){if(_0xba3494){return _0xba3494[_0x8f82('0x129')](_0x59b424[_0x8f82('0x43')][_0x8f82('0x6c')])[_0x8f82('0x22')](function(){if(_[_0x8f82('0x12a')](_0x59b424['query'][_0x8f82('0x6c')])){for(var _0x487afe=0x0;_0x487afe<_0x59b424[_0x8f82('0x43')]['ids'][_0x8f82('0x48')];_0x487afe+=0x1){socket[_0x8f82('0x128')](_0x8f82('0x12b'),{'UserId':Number(_0x59b424['query'][_0x8f82('0x6c')][_0x487afe]),'ChatWebsiteId':Number(_0x59b424[_0x8f82('0x63')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x59b424[_0x8f82('0x43')][_0x8f82('0x6c')]),'ChatWebsiteId':Number(_0x59b424['params']['id'])});}});}})[_0x8f82('0x22')](respondWithStatusCode(_0x9025c,null))[_0x8f82('0x2a')](handleError(_0x9025c,null));};exports[_0x8f82('0x12c')]=function(_0x34137c,_0xaf8e88,_0xfb63c8){var _0x2f068f={};var _0x15f9fd={};var _0x31a6b5;var _0x3ef9e9;return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x34137c[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0xaf8e88,null))['then'](function(_0x3719fd){if(_0x3719fd){_0x31a6b5=_0x3719fd;_0x15f9fd[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0xfc')][_0x8f82('0x3f')]);_0x15f9fd['query']=_[_0x8f82('0x44')](_0x34137c[_0x8f82('0x43')]);_0x15f9fd[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x15f9fd[_0x8f82('0x42')],_0x15f9fd[_0x8f82('0x43')]);_0x2f068f[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x15f9fd[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x34137c[_0x8f82('0x43')]['fields']));_0x2f068f['attributes']=_0x2f068f[_0x8f82('0x47')][_0x8f82('0x48')]?_0x2f068f[_0x8f82('0x47')]:_0x15f9fd[_0x8f82('0x42')];_0x2f068f[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x34137c[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x2f068f[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x34137c[_0x8f82('0x43')],_0x15f9fd[_0x8f82('0x4c')]));if(_0x34137c['query'][_0x8f82('0x4e')]){_0x2f068f[_0x8f82('0x52')]=_['merge'](_0x2f068f[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x2f068f[_0x8f82('0x47')],function(_0x449fb3){var _0x226a2a={};_0x226a2a[_0x449fb3]={'$like':'%'+_0x34137c[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x226a2a;})});}_0x2f068f=_[_0x8f82('0x4f')]({},_0x2f068f,_0x34137c[_0x8f82('0x51')]);return _0x31a6b5['getAgents'](_0x2f068f);}})[_0x8f82('0x22')](function(_0x5cf2c){if(_0x5cf2c){_0x3ef9e9=_0x5cf2c['length'];if(!_0x34137c[_0x8f82('0x43')]['hasOwnProperty'](_0x8f82('0x4a'))){_0x2f068f[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x34137c[_0x8f82('0x43')][_0x8f82('0x30')]);_0x2f068f['offset']=qs['offset'](_0x34137c[_0x8f82('0x43')]['offset']);}return _0x31a6b5[_0x8f82('0x12c')](_0x2f068f);}})['then'](function(_0x367035){if(_0x367035){return _0x367035?{'count':_0x3ef9e9,'rows':_0x367035}:null;}})['then'](respondWithResult(_0xaf8e88,null))[_0x8f82('0x2a')](handleError(_0xaf8e88,null));};
\ No newline at end of file
+var _0xcbcd=['addAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','file','join','root','getLicense','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','defaults','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','firstName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','Tag','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','push','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','textColor','color_button','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','ChatWebsite','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','ChatWebsiteId','Disposition','getDispositions','findOne','include','removeDispositions','ids','getAnswers','CannedAnswer','order','removeAnswers','addLogo','sitepic'];(function(_0x257794,_0x38561d){var _0x2d3c13=function(_0x535307){while(--_0x535307){_0x257794['push'](_0x257794['shift']());}};_0x2d3c13(++_0x38561d);}(_0xcbcd,0x1f2));var _0xdcbc=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xcbcd[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0xdcbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcbc('0x1'));var jsonpatch=require(_0xdcbc('0x2'));var rp=require(_0xdcbc('0x3'));var moment=require(_0xdcbc('0x4'));var BPromise=require(_0xdcbc('0x5'));var Mustache=require(_0xdcbc('0x6'));var util=require(_0xdcbc('0x7'));var path=require(_0xdcbc('0x8'));var sox=require(_0xdcbc('0x9'));var csv=require(_0xdcbc('0xa'));var ejs=require(_0xdcbc('0xb'));var fs=require('fs');var fs_extra=require(_0xdcbc('0xc'));var _=require('lodash');var squel=require(_0xdcbc('0xd'));var crypto=require(_0xdcbc('0xe'));var jsforce=require(_0xdcbc('0xf'));var deskjs=require(_0xdcbc('0x10'));var toCsv=require(_0xdcbc('0xa'));var querystring=require(_0xdcbc('0x11'));var Papa=require(_0xdcbc('0x12'));var Redis=require(_0xdcbc('0x13'));var authService=require(_0xdcbc('0x14'));var qs=require(_0xdcbc('0x15'));var as=require(_0xdcbc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcbc('0x17'))('api');var utils=require(_0xdcbc('0x18'));var config=require(_0xdcbc('0x19'));var licenseUtil=require(_0xdcbc('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdcbc('0x1b')]=_['defaults'](config[_0xdcbc('0x1b')],{'host':_0xdcbc('0x1c'),'port':0x18eb});var socket=require(_0xdcbc('0x1d'))(new Redis(config['redis']));require(_0xdcbc('0x1e'))[_0xdcbc('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232c});var client9002=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232a});var client9003=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232b});var client9001=jayson[_0xdcbc('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0xbdb1d7,_0x3aa1eb,_0x14169b,_0x3f760d){return new BPromise(function(_0x9b79e9,_0x2e355a){var _0x1a8dd6=_0x3f760d||client;return _0x1a8dd6[_0xdcbc('0x22')](_0xbdb1d7,_0x14169b)[_0xdcbc('0x23')](function(_0x141816){logger['info'](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));logger[_0xdcbc('0x26')](_0xdcbc('0x27'),_0x3aa1eb,_0xdcbc('0x25'),JSON[_0xdcbc('0x28')](_0x141816));if(_0x141816['error']){if(_0x141816['error'][_0xdcbc('0x29')]===0x1f4){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')][_0xdcbc('0x2b')]);return _0x2e355a(_0x141816['error']['message']);}logger['error'](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')]['message']);return _0x9b79e9(_0x141816['error'][_0xdcbc('0x2b')]);}else{logger[_0xdcbc('0x2c')](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));_0x9b79e9(_0x141816['result'][_0xdcbc('0x2b')]);}})['catch'](function(_0x2275d1){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x2275d1);_0x2e355a(_0x2275d1);});});}function respondWithStatusCode(_0x4f5edc,_0x2bda34){_0x2bda34=_0x2bda34||0xcc;return function(_0x21c0e3){if(_0x21c0e3){return _0x4f5edc[_0xdcbc('0x2d')](_0x2bda34);}return _0x4f5edc[_0xdcbc('0x2e')](_0x2bda34)[_0xdcbc('0x2f')]();};}function respondWithResult(_0x31b7bc,_0x3d5e57){_0x3d5e57=_0x3d5e57||0xc8;return function(_0x43c79b){if(_0x43c79b){return _0x31b7bc[_0xdcbc('0x2e')](_0x3d5e57)['json'](_0x43c79b);}};}function respondWithFilteredResult(_0x2ea5ec,_0x5487ab){return function(_0x364796){if(_0x364796){var _0x431e9e=typeof _0x5487ab[_0xdcbc('0x30')]==='undefined'&&typeof _0x5487ab[_0xdcbc('0x31')]===_0xdcbc('0x32');var _0x16230b=_0x364796[_0xdcbc('0x33')];var _0x1893f1=_0x431e9e?0x0:_0x5487ab[_0xdcbc('0x30')];var _0x4c5e76=_0x431e9e?_0x364796['count']:_0x5487ab['offset']+_0x5487ab[_0xdcbc('0x31')];var _0x2f7e9e;if(_0x4c5e76>=_0x16230b){_0x4c5e76=_0x16230b;_0x2f7e9e=0xc8;}else{_0x2f7e9e=0xce;}_0x2ea5ec[_0xdcbc('0x2e')](_0x2f7e9e);return _0x2ea5ec[_0xdcbc('0x34')]('Content-Range',_0x1893f1+'-'+_0x4c5e76+'/'+_0x16230b)[_0xdcbc('0x35')](_0x364796);}return null;};}function patchUpdates(_0x270cb8){return function(_0xe374be){try{jsonpatch[_0xdcbc('0x36')](_0xe374be,_0x270cb8,!![]);}catch(_0x327816){return BPromise['reject'](_0x327816);}return _0xe374be[_0xdcbc('0x37')]();};}function saveUpdates(_0x2a6202,_0x51e6b0){return function(_0x68f2b9){if(_0x68f2b9){return _0x68f2b9[_0xdcbc('0x38')](_0x2a6202)[_0xdcbc('0x23')](function(_0x873ec6){return _0x873ec6;});}return null;};}function removeEntity(_0x8844e4,_0x5ef776){return function(_0x6706b8){if(_0x6706b8){return _0x6706b8[_0xdcbc('0x39')]()[_0xdcbc('0x23')](function(){var _0x4d0faa=_0x6706b8[_0xdcbc('0x3a')]({'plain':!![]});var _0x50bb42=_0xdcbc('0x3b');return db[_0xdcbc('0x3c')][_0xdcbc('0x39')]({'where':{'type':_0x50bb42,'resourceId':_0x4d0faa['id']}})['then'](function(){return _0x6706b8;});})['then'](function(){_0x8844e4[_0xdcbc('0x2e')](0xcc)[_0xdcbc('0x2f')]();});}};}function handleEntityNotFound(_0x35d94e,_0x514731){return function(_0x5bbd5c){if(!_0x5bbd5c){_0x35d94e[_0xdcbc('0x2d')](0x194);}return _0x5bbd5c;};}function handleError(_0x565c04,_0x2bd97c){_0x2bd97c=_0x2bd97c||0x1f4;return function(_0x44cb89){logger[_0xdcbc('0x2a')](_0x44cb89[_0xdcbc('0x3d')]);if(_0x44cb89[_0xdcbc('0x3e')]){delete _0x44cb89[_0xdcbc('0x3e')];}_0x565c04[_0xdcbc('0x2e')](_0x2bd97c)['send'](_0x44cb89);};}exports[_0xdcbc('0x3f')]=function(_0x53dd84,_0x52e4a2){var _0x471a87={'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x4e75f3={},_0x2df4c8={'count':0x0,'rows':[]};var _0x281a46=_[_0xdcbc('0x42')](db['ChatWebsite']['rawAttributes'],function(_0x3434a3){return{'name':_0x3434a3['fieldName'],'type':_0x3434a3[_0xdcbc('0x43')]['key']};});_0x4e75f3[_0xdcbc('0x44')]=_[_0xdcbc('0x42')](_0x281a46,_0xdcbc('0x3e'));_0x4e75f3[_0xdcbc('0x45')]=_['keys'](_0x53dd84[_0xdcbc('0x45')]);_0x4e75f3[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],_0x4e75f3[_0xdcbc('0x45')]);_0x471a87[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x53dd84[_0xdcbc('0x45')]['fields']));_0x471a87[_0xdcbc('0x48')]=_0x471a87['attributes'][_0xdcbc('0x4a')]?_0x471a87[_0xdcbc('0x48')]:_0x4e75f3[_0xdcbc('0x44')];if(!_0x53dd84['query'][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x471a87[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x53dd84['query'][_0xdcbc('0x31')]);_0x471a87[_0xdcbc('0x30')]=qs['offset'](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x471a87['order']=qs[_0xdcbc('0x4d')](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x471a87['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x53dd84['query'],_0x4e75f3[_0xdcbc('0x46')]),_0x281a46);if(_0x53dd84['query'][_0xdcbc('0x4f')]){_0x471a87['where']=_[_0xdcbc('0x50')](_0x471a87[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x281a46,function(_0x5cc56d){if(_0x5cc56d['type']!==_0xdcbc('0x52')){var _0x5176d6={};_0x5176d6[_0x5cc56d['name']]={'$like':'%'+_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x5176d6;}})});}_0x471a87=_[_0xdcbc('0x50')]({},_0x471a87,_0x53dd84[_0xdcbc('0x53')]);var _0xad0781={'where':_0x471a87[_0xdcbc('0x51')]};return db['ChatWebsite'][_0xdcbc('0x33')](_0xad0781)['then'](function(_0x406a73){_0x2df4c8[_0xdcbc('0x33')]=_0x406a73;if(_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x471a87['include']=[{'all':!![]}];}return db[_0xdcbc('0x55')][_0xdcbc('0x56')](_0x471a87);})[_0xdcbc('0x23')](function(_0x48a79f){_0x2df4c8[_0xdcbc('0x57')]=_0x48a79f;return _0x2df4c8;})[_0xdcbc('0x23')](respondWithFilteredResult(_0x52e4a2,_0x471a87))[_0xdcbc('0x58')](handleError(_0x52e4a2,null));};exports[_0xdcbc('0x59')]=function(_0x10e22e,_0x4aa135){var _0x2601e8={'raw':![],'where':{'id':_0x10e22e[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x1581a8={};_0x1581a8[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x55')][_0xdcbc('0x5c')]);_0x1581a8[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x10e22e[_0xdcbc('0x45')]);_0x1581a8[_0xdcbc('0x46')]=_['intersection'](_0x1581a8[_0xdcbc('0x44')],_0x1581a8['query']);_0x2601e8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x1581a8['model'],qs[_0xdcbc('0x49')](_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x2601e8[_0xdcbc('0x48')]=_0x2601e8[_0xdcbc('0x48')]['length']?_0x2601e8[_0xdcbc('0x48')]:_0x1581a8[_0xdcbc('0x44')];if(_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x2601e8['include']=[{'all':!![]}];}_0x2601e8=_[_0xdcbc('0x50')]({},_0x2601e8,_0x10e22e[_0xdcbc('0x53')]);return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x2601e8)[_0xdcbc('0x23')](handleEntityNotFound(_0x4aa135,null))[_0xdcbc('0x23')](respondWithResult(_0x4aa135,null))[_0xdcbc('0x58')](handleError(_0x4aa135,null));};exports[_0xdcbc('0x5e')]=function(_0x79dc31,_0x3229a8){return db[_0xdcbc('0x55')][_0xdcbc('0x5e')](_0x79dc31[_0xdcbc('0x5f')],{})['then'](function(_0x28ff89){var _0x3ef259=_0x79dc31[_0xdcbc('0x60')][_0xdcbc('0x3a')]({'plain':!![]});if(!_0x3ef259)throw new Error(_0xdcbc('0x61'));if(_0x3ef259[_0xdcbc('0x62')]===_0xdcbc('0x60')){var _0xbc91b3=_0x28ff89['get']({'plain':!![]});var _0x3451fe=_0xdcbc('0x3b');return db[_0xdcbc('0x63')][_0xdcbc('0x5d')]({'where':{'name':_0x3451fe,'userProfileId':_0x3ef259[_0xdcbc('0x64')]},'raw':!![]})[_0xdcbc('0x23')](function(_0x32a5ed){if(_0x32a5ed&&_0x32a5ed[_0xdcbc('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0xbc91b3['name'],'resourceId':_0xbc91b3['id'],'type':_0x32a5ed[_0xdcbc('0x3e')],'sectionId':_0x32a5ed['id']},{})[_0xdcbc('0x23')](function(){return _0x28ff89;});}else{return _0x28ff89;}})[_0xdcbc('0x58')](function(_0x426fcc){logger[_0xdcbc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426fcc);throw _0x426fcc;});}return _0x28ff89;})[_0xdcbc('0x23')](respondWithResult(_0x3229a8,0xc9))[_0xdcbc('0x58')](handleError(_0x3229a8,null));};exports[_0xdcbc('0x38')]=function(_0xefe450,_0x57f6ac){if(_0xefe450[_0xdcbc('0x5f')]['id']){delete _0xefe450[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0xefe450[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]})[_0xdcbc('0x23')](handleEntityNotFound(_0x57f6ac,null))['then'](saveUpdates(_0xefe450['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x57f6ac,null))[_0xdcbc('0x58')](handleError(_0x57f6ac,null));};exports[_0xdcbc('0x39')]=function(_0x3e84ba,_0x1a7b96){return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0x3e84ba[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a7b96,null))[_0xdcbc('0x23')](removeEntity(_0x1a7b96,null))[_0xdcbc('0x58')](handleError(_0x1a7b96,null));};exports[_0xdcbc('0x66')]=function(_0x4fcb54,_0x599c42){return db[_0xdcbc('0x55')][_0xdcbc('0x66')]()['then'](respondWithResult(_0x599c42,null))[_0xdcbc('0x58')](handleError(_0x599c42,null));};exports['addDisposition']=function(_0x499b7e,_0x238ebf,_0x395f4e){if(_0x499b7e[_0xdcbc('0x5f')]['id']){delete _0x499b7e[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x499b7e[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x238ebf,null))['then'](function(_0x4ccdef){if(_0x4ccdef){_0x499b7e['body'][_0xdcbc('0x67')]=_0x4ccdef['id'];return db[_0xdcbc('0x68')][_0xdcbc('0x5e')](_0x499b7e[_0xdcbc('0x5f')]);}})[_0xdcbc('0x23')](respondWithResult(_0x238ebf,null))[_0xdcbc('0x58')](handleError(_0x238ebf,null));};exports[_0xdcbc('0x69')]=function(_0x5a7b7a,_0x85bfb6,_0x19d08a){var _0x5ac0c0={'raw':![],'where':{}};var _0xf5af29={};var _0x11348f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x5a7b7a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x85bfb6,null))['then'](function(_0x35c493){if(_0x35c493){_0xf5af29[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0x68')][_0xdcbc('0x5c')]);_0xf5af29[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x5a7b7a[_0xdcbc('0x45')]);_0xf5af29[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xf5af29['model'],_0xf5af29[_0xdcbc('0x45')]);_0x5ac0c0[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xf5af29['model'],qs[_0xdcbc('0x49')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x5ac0c0[_0xdcbc('0x48')]=_0x5ac0c0[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x5ac0c0[_0xdcbc('0x48')]:_0xf5af29[_0xdcbc('0x44')];if(!_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5ac0c0[_0xdcbc('0x31')]=qs['limit'](_0x5a7b7a[_0xdcbc('0x45')]['limit']);_0x5ac0c0['offset']=qs[_0xdcbc('0x30')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x5ac0c0['order']=qs[_0xdcbc('0x4d')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5ac0c0['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x5a7b7a[_0xdcbc('0x45')],_0xf5af29[_0xdcbc('0x46')]));_0x5ac0c0['where'][_0xdcbc('0x67')]=_0x35c493['id'];if(_0x5a7b7a[_0xdcbc('0x45')]['filter']){_0x5ac0c0[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5ac0c0[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x5ac0c0[_0xdcbc('0x48')],function(_0x3bb8aa){var _0x152894={};_0x152894[_0x3bb8aa]={'$like':'%'+_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x152894;})});}_0x5ac0c0=_['merge']({},_0x5ac0c0,_0x5a7b7a['options']);return db['Disposition'][_0xdcbc('0x33')]({'where':_0x5ac0c0[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x12378e){_0x11348f[_0xdcbc('0x33')]=_0x12378e;if(_0x5a7b7a['query'][_0xdcbc('0x54')]){_0x5ac0c0[_0xdcbc('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xdcbc('0x56')](_0x5ac0c0);})[_0xdcbc('0x23')](function(_0x2e4e7e){_0x11348f[_0xdcbc('0x57')]=_0x2e4e7e;return _0x11348f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x85bfb6,_0x5ac0c0))['catch'](handleError(_0x85bfb6,null));};exports[_0xdcbc('0x6c')]=function(_0x4f9bef,_0x3289bd,_0x5a492a){return db[_0xdcbc('0x55')]['find']({'where':{'id':_0x4f9bef[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3289bd,null))[_0xdcbc('0x23')](function(_0x2f3260){if(_0x2f3260){return _0x2f3260[_0xdcbc('0x6c')](_0x4f9bef[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0x3289bd,null))[_0xdcbc('0x58')](handleError(_0x3289bd,null));};exports['addAnswer']=function(_0x3d548a,_0x54dde5,_0x5a45fa){if(_0x3d548a[_0xdcbc('0x5f')]['id']){delete _0x3d548a[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3d548a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x54dde5,null))[_0xdcbc('0x23')](function(_0x4aade2){if(_0x4aade2){_0x3d548a[_0xdcbc('0x5f')][_0xdcbc('0x67')]=_0x4aade2['id'];return db['CannedAnswer']['create'](_0x3d548a[_0xdcbc('0x5f')]);}})['then'](respondWithResult(_0x54dde5,null))[_0xdcbc('0x58')](handleError(_0x54dde5,null));};exports[_0xdcbc('0x6e')]=function(_0x115d7f,_0x53f98f,_0x2c8d4c){var _0x48e23f={'raw':![],'where':{}};var _0x3c71d6={};var _0x25102f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x115d7f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x53f98f,null))[_0xdcbc('0x23')](function(_0xf3f066){if(_0xf3f066){_0x3c71d6['model']=_[_0xdcbc('0x5b')](db[_0xdcbc('0x6f')][_0xdcbc('0x5c')]);_0x3c71d6[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x115d7f['query']);_0x3c71d6[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],_0x3c71d6['query']);_0x48e23f[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x48e23f[_0xdcbc('0x48')]=_0x48e23f['attributes'][_0xdcbc('0x4a')]?_0x48e23f[_0xdcbc('0x48')]:_0x3c71d6[_0xdcbc('0x44')];if(!_0x115d7f['query'][_0xdcbc('0x4b')]('nolimit')){_0x48e23f['limit']=qs[_0xdcbc('0x31')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x48e23f[_0xdcbc('0x30')]=qs['offset'](_0x115d7f['query'][_0xdcbc('0x30')]);}_0x48e23f[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x48e23f[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x115d7f[_0xdcbc('0x45')],_0x3c71d6[_0xdcbc('0x46')]));_0x48e23f[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0xf3f066['id'];if(_0x115d7f[_0xdcbc('0x45')]['filter']){_0x48e23f[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x48e23f[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x48e23f[_0xdcbc('0x48')],function(_0x5509f7){var _0x218227={};_0x218227[_0x5509f7]={'$like':'%'+_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x218227;})});}_0x48e23f=_[_0xdcbc('0x50')]({},_0x48e23f,_0x115d7f[_0xdcbc('0x53')]);return db[_0xdcbc('0x6f')][_0xdcbc('0x33')]({'where':_0x48e23f['where']})[_0xdcbc('0x23')](function(_0x276464){_0x25102f['count']=_0x276464;if(_0x115d7f['query'][_0xdcbc('0x54')]){_0x48e23f[_0xdcbc('0x6b')]=[{'all':!![]}];}return db[_0xdcbc('0x6f')][_0xdcbc('0x56')](_0x48e23f);})[_0xdcbc('0x23')](function(_0x4828dc){_0x25102f[_0xdcbc('0x57')]=_0x4828dc;return _0x25102f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x53f98f,_0x48e23f))[_0xdcbc('0x58')](handleError(_0x53f98f,null));};exports[_0xdcbc('0x71')]=function(_0x292478,_0xcc908a,_0xf48165){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x292478[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcc908a,null))[_0xdcbc('0x23')](function(_0x58c449){if(_0x58c449){return _0x58c449[_0xdcbc('0x71')](_0x292478[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0xcc908a,null))[_0xdcbc('0x58')](handleError(_0xcc908a,null));};exports[_0xdcbc('0x72')]=function(_0x4d27f0,_0x4d1fd7,_0x26cdf5){_0x4d27f0['body'][_0xdcbc('0x73')]=_0x4d27f0['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4d27f0[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d1fd7,null))[_0xdcbc('0x23')](saveUpdates(_0x4d27f0[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x4d1fd7,null))[_0xdcbc('0x58')](handleError(_0x4d1fd7,null));};exports[_0xdcbc('0x74')]=function(_0x1cb941,_0x245304,_0x1e362f){_0x1cb941['body']['agentAvatar']=_0x1cb941['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x1cb941['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x245304,null))[_0xdcbc('0x23')](saveUpdates(_0x1cb941['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x245304,null))[_0xdcbc('0x58')](handleError(_0x245304,null));};exports[_0xdcbc('0x75')]=function(_0x3fd0f5,_0x28c391,_0x2046a2){_0x3fd0f5['body'][_0xdcbc('0x76')]=_0x3fd0f5['file'][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3fd0f5[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x28c391,null))['then'](saveUpdates(_0x3fd0f5[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x28c391,null))['catch'](handleError(_0x28c391,null));};exports[_0xdcbc('0x78')]=function(_0x4a6b30,_0xa6bfec,_0x3feeaf){_0x4a6b30[_0xdcbc('0x5f')][_0xdcbc('0x79')]=_0x4a6b30[_0xdcbc('0x7a')][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4a6b30[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xa6bfec,null))[_0xdcbc('0x23')](saveUpdates(_0x4a6b30[_0xdcbc('0x5f')],null))['then'](respondWithResult(_0xa6bfec,null))['catch'](handleError(_0xa6bfec,null));};exports['getLogo']=function(_0xea29be,_0x512c7c,_0x18e71a){var _0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/images/logos/default_logo.svg');var _0x248353={'where':{'id':_0xea29be[_0xdcbc('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4c7e39=![];return require('../../config/license/util')[_0xdcbc('0x7d')]()[_0xdcbc('0x23')](function(_0x366a4c){if(_0x366a4c){_0x4c7e39=_0x366a4c[_0xdcbc('0x7e')];}})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x248353);})[_0xdcbc('0x23')](handleEntityNotFound(_0x512c7c,null))[_0xdcbc('0x23')](function(_0x23ba43){if(_0x23ba43){if(!_['isNil'](_0x23ba43[_0xdcbc('0x73')])){if(fs[_0xdcbc('0x7f')](path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43[_0xdcbc('0x73')]))&&_0x4c7e39){_0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43['sitepic']);}}return _0x512c7c['download'](_0x558e9f);}})[_0xdcbc('0x58')](handleError(_0x512c7c,null));};exports[_0xdcbc('0x81')]=function(_0x290eb9,_0x43595f,_0x236ca9){var _0x460269=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x82'));var _0x16eba6={'where':{'id':_0x290eb9[_0xdcbc('0x5a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x16eba6)['then'](handleEntityNotFound(_0x43595f,null))['then'](function(_0x27fa93){if(_0x27fa93){if(!_[_0xdcbc('0x83')](_0x27fa93[_0xdcbc('0x84')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]))){_0x460269=path['join'](config['root'],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]);}}return _0x43595f[_0xdcbc('0x86')](_0x460269);}})['catch'](handleError(_0x43595f,null));};exports[_0xdcbc('0x87')]=function(_0x3d8a41,_0x24ac6b,_0x372e51){var _0xf56360=path['join'](config[_0xdcbc('0x7c')],'server/files/images/avatars/customer_avatar.png');var _0x4c77f1={'where':{'id':_0x3d8a41[_0xdcbc('0x5a')]['id']},'attributes':['id',_0xdcbc('0x76'),_0xdcbc('0x88')],'raw':!![]};return db['ChatWebsite']['find'](_0x4c77f1)[_0xdcbc('0x23')](handleEntityNotFound(_0x24ac6b,null))['then'](function(_0x15acd2){if(_0x15acd2){if(!_[_0xdcbc('0x83')](_0x15acd2[_0xdcbc('0x76')])){if(fs['existsSync'](path['join'](config['root'],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]))&&_0x15acd2[_0xdcbc('0x88')]){_0xf56360=path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]);}}return _0x24ac6b[_0xdcbc('0x86')](_0xf56360);}})[_0xdcbc('0x58')](handleError(_0x24ac6b,null));};exports[_0xdcbc('0x89')]=function(_0x1f06c0,_0x5832d1,_0x11b3ca){var _0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x8a'));var _0x10abe7={'where':{'id':_0x1f06c0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xdcbc('0x55')]['find'](_0x10abe7)['then'](handleEntityNotFound(_0x5832d1,null))[_0xdcbc('0x23')](function(_0x1ce5f1){if(_0x1ce5f1){if(!_[_0xdcbc('0x83')](_0x1ce5f1[_0xdcbc('0x79')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1['systemAvatar']))){_0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1[_0xdcbc('0x79')]);}}return _0x5832d1['download'](_0x5ad96f);}})[_0xdcbc('0x58')](handleError(_0x5832d1,null));};exports[_0xdcbc('0x8b')]=function(_0x5d6352,_0xcd971a,_0x2f8689){var _0x441082=require(_0xdcbc('0x8c'));var _0x26b0a4=new _0x441082();var _0x594fce=_0x26b0a4[_0xdcbc('0x8d')](_0x5d6352[_0xdcbc('0x8e')]['user-agent'])['getResult']();var _0x16b597={'body':_0x5d6352['body'],'channel':_0xdcbc('0x8f')};var _0x3cfe62=[];var _0x46388c=[];var _0x51fb8d={};var _0x3f8f59=![];return db['CmContact']['describe']()['then'](function(_0x5cfc9d){if(!_0x5cfc9d){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3cfe62=_['difference'](_[_0xdcbc('0x5b')](_0x5cfc9d),['createdAt',_0xdcbc('0x93')]);_0x46388c=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x5cfc9d),[_0xdcbc('0x95'),_0xdcbc('0x93'),'CompanyId',_0xdcbc('0x96')]);if(_0x5d6352[_0xdcbc('0x5f')]['id']){delete _0x5d6352[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98'));}if(_['isNil'](_0x5d6352['body'][_0xdcbc('0x5f')])||_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xdcbc('0x99'));}if(_[_0xdcbc('0x83')](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x9b')+_0x46388c);}if(!_[_0xdcbc('0x9c')](_0x46388c,_0x5d6352['body'][_0xdcbc('0x9a')])){throw new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0x9d')+_0x46388c);}_0x51fb8d[_0x5d6352['body'][_0xdcbc('0x9a')]]=_0x5d6352['body'][_0xdcbc('0x97')];})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x5d6352[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f'),'include':[{'model':db['CmContact'],'as':_0xdcbc('0xa0'),'where':_0x51fb8d,'limit':0x1,'order':[[_0xdcbc('0x93'),_0xdcbc('0xa1')]]}]},{'model':db[_0xdcbc('0xa2')],'as':_0xdcbc('0xa3')}]});})['then'](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x4673b0){if(_0x4673b0&&_0x4673b0[_0xdcbc('0x9f')]){_0x16b597[_0xdcbc('0xa4')]=_0x4673b0;_0x16b597['applications']=_0x4673b0[_0xdcbc('0xa3')];_0x16b597[_0xdcbc('0xa5')]=_0x4673b0[_0xdcbc('0x9f')];_0x16b597[_0xdcbc('0xa6')]=_[_0xdcbc('0xa7')](_0x16b597[_0xdcbc('0xa6')],['priority'],[_0xdcbc('0xa8')]);if(_0x16b597['account'][_0xdcbc('0xa3')]){delete _0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xa3')];}if(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')]&&_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')][_0xdcbc('0xa0')][_0xdcbc('0x4a')]){return _0x16b597[_0xdcbc('0xa4')]['List'][_0xdcbc('0xa0')][0x0];}var _0x331d96=_[_0xdcbc('0xa9')](_0x5d6352['body'],{'firstName':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')],'ListId':_0x4673b0['ListId']});_0x331d96[_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')]]=_0x5d6352[_0xdcbc('0x5f')]['from'];return db[_0xdcbc('0xaa')][_0xdcbc('0x5e')](_0x331d96,{'fields':_0x3cfe62,'raw':!![]});}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x3165a1){_0x16b597[_0xdcbc('0xab')]=_0x3165a1;var _0x301b5d=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xac')];if(_0x5d6352['headers'][_0xdcbc('0xad')]){_0x301b5d=_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xad')];}else if(_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')]){_0x301b5d=_[_0xdcbc('0xaf')](_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')][_0xdcbc('0xb0')](','));}if(_0x3165a1){var _0x6b2109={'ContactId':_0x3165a1['id'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'from':(_0x3165a1['firstName']||'')+'\x20'+(_0x3165a1['lastName']||''),'customerIp':_0x301b5d,'customerPort':_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xb1')]?_0x5d6352['headers'][_0xdcbc('0xb1')]:null,'referer':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xb2')],'browserName':_0x594fce[_0xdcbc('0xb3')]['name']&&_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]?util[_0xdcbc('0xb5')](_0xdcbc('0xb6'),_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0x3e')],_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]):'unknown','browserVersion':_0x594fce['browser'][_0xdcbc('0xb4')]||_0xdcbc('0xb7'),'osName':util['format']('%s\x20%s',_0x594fce['os'][_0xdcbc('0x3e')],_0x594fce['os'][_0xdcbc('0xb4')]),'osVersion':_0x594fce['os'][_0xdcbc('0xb4')],'deviceModel':_0x594fce['device'][_0xdcbc('0x44')]&&_0x594fce[_0xdcbc('0xb8')]['vendor']?util['format'](_0xdcbc('0xb9'),_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x44')],_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],_0x594fce['device']['type']):null,'deviceVendor':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],'deviceType':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x43')],'formData':JSON['stringify'](_0x5d6352[_0xdcbc('0x5f')])};var _0x5097ef={'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'closed':![]};if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]){_0x5097ef[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];return db[_0xdcbc('0xbc')]['find']({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x3e610f){if(_0x3e610f){return[_0x3e610f,![]];}_0x6b2109[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];_0x6b2109[_0xdcbc('0xbd')]=_0x5d6352['body'][_0xdcbc('0xbd')];return db[_0xdcbc('0xbc')]['create'](_0x6b2109)[_0xdcbc('0x23')](function(_0x5acb28){return[_0x5acb28,!![]];});});}_0x5097ef['ContactId']=_0x3165a1['id'];if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbe')]&&_0x5d6352[_0xdcbc('0x5f')]['interaction']['id']){_0x5097ef['id']=_0x5d6352[_0xdcbc('0x5f')]['interaction']['id'];return db['ChatInteraction'][_0xdcbc('0x5d')]({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x20753c){if(_0x20753c){return[_0x20753c,![]];}return db['ChatInteraction'][_0xdcbc('0x5e')](_0x6b2109)[_0xdcbc('0x23')](function(_0x5c0fa6){return[_0x5c0fa6,!![]];});});}return db[_0xdcbc('0xbc')][_0xdcbc('0x5e')](_0x6b2109)['then'](function(_0x4f998c){return[_0x4f998c,!![]];});}})[_0xdcbc('0xbf')](function(_0x66ba22,_0x10da11){if(_0x66ba22){_0x3f8f59=_0x10da11;if(!_0x10da11){var _0x181741={'from':(_0x16b597[_0xdcbc('0xab')]['firstName']||'')+'\x20'+(_0x16b597[_0xdcbc('0xab')]['lastName']||'')};if(_0x5d6352['body']['threadId']&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]!=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]){_0x181741[_0xdcbc('0xbb')]=_0x5d6352['body'][_0xdcbc('0xc0')];}return _0x66ba22[_0xdcbc('0x38')](_0x181741);}else{return _0x66ba22;}}})[_0xdcbc('0x23')](function(_0x24800f){_0x16b597[_0xdcbc('0xbe')]=_0x24800f[_0xdcbc('0x3a')]({'plain':!![]});_0x16b597['interaction'][_0xdcbc('0xc1')]=_0x3f8f59;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc1')]){if(_0x16b597[_0xdcbc('0xa4')]['autoclose']){_0x16b597[_0xdcbc('0xa6')]['push']({'id':0x0,'priority':_0x16b597[_0xdcbc('0xa6')]['length']+0x1,'app':_0xdcbc('0xc2'),'appdata':_0xdcbc('0xc3'),'interval':'*,*,*,*'});}}return db[_0xdcbc('0xc4')][_0xdcbc('0x5e')]({'body':_0x5d6352[_0xdcbc('0x5f')]['body'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'ChatInteractionId':_0x24800f['id'],'direction':'in','ContactId':_0x16b597[_0xdcbc('0xab')]['id'],'AttachmentId':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc5')]});})['then'](function(_0x1fcfb1){_0x16b597['message']=_0x1fcfb1;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]){return db[_0xdcbc('0xc7')]['find']({'attributes':['id',_0xdcbc('0x3e')],'where':{'id':_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]}})[_0xdcbc('0x23')](function(_0x2f3683){if(_0x2f3683){_0x16b597[_0xdcbc('0xa6')][_0xdcbc('0xc8')]({'id':0x0,'priority':0x0,'app':_0xdcbc('0xc9'),'appdata':_0x2f3683[_0xdcbc('0x3e')]+','+(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xca')]||0xa),'interval':'*,*,*,*'});_0x16b597[_0xdcbc('0xcb')]=!![];}return respondWithRpcPromise(_0xdcbc('0xcc'),_0xdcbc('0xcd'),_0x16b597);});}return respondWithRpcPromise('Start',_0xdcbc('0xcd'),_0x16b597);})[_0xdcbc('0x23')](function(_0x53bca8){respondWithRpcPromise('EventManager',_0xdcbc('0xce'),{'event':_0xdcbc('0x8b'),'message':_0x53bca8},client9002);return _0x53bca8;})[_0xdcbc('0x23')](respondWithResult(_0xcd971a,null))[_0xdcbc('0x58')](handleError(_0xcd971a,null));};exports[_0xdcbc('0xcf')]=function(_0x41837a,_0x52a4e8,_0x297249){var _0x2460ca,_0x9f0067,_0xfb5e7b;var _0x586c47=[];var _0x3d58b5=[];var _0x1d3d00={};var _0x25f014=_0x41837a[_0xdcbc('0xd0')]||[];var _0x357332=[];var _0x5e7fe1;return db[_0xdcbc('0xaa')][_0xdcbc('0x66')]()[_0xdcbc('0x23')](function(_0x11d210){if(!_0x11d210){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3d58b5=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),['createdAt','updatedAt']);_0x586c47=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),[_0xdcbc('0x95'),_0xdcbc('0x93'),_0xdcbc('0xd1'),_0xdcbc('0x96')]);if(_0x41837a[_0xdcbc('0x5f')]['id']){delete _0x41837a[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x41837a[_0xdcbc('0x5f')]['from'])){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')]['body'])||_0x41837a[_0xdcbc('0x5f')]['body']===''){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x99')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8['status'](0x1f4)['send'](new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0xd4')+_0x586c47));}if(!_[_0xdcbc('0x9c')](_0x586c47,_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8[_0xdcbc('0x2e')](0x1f4)['send'](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x586c47));}_0x1d3d00[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];})['then'](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x41837a['params']['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f')},{'model':db[_0xdcbc('0xd5')],'as':'MailAccount'}]});})[_0xdcbc('0x23')](handleEntityNotFound(_0x52a4e8,null))[_0xdcbc('0x23')](function(_0x460805){if(_0x460805&&_0x460805['List']){_0x9f0067=_0x460805;var _0x1fa520=_['defaults'](_0x41837a[_0xdcbc('0x5f')],{'firstName':_0x41837a[_0xdcbc('0x5f')]['from'],'phone':_0x41837a['body'][_0xdcbc('0x97')],'ListId':_0x460805[_0xdcbc('0x96')]});_0x1fa520[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];return db[_0xdcbc('0xaa')][_0xdcbc('0xd6')]({'where':_0x1d3d00,'defaults':_0x1fa520});}})[_0xdcbc('0xbf')](function(_0x4b8a3f){if(_0x4b8a3f){_0xfb5e7b=_0x4b8a3f;var _0x1caa40=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xdcbc('0xd8'));var _0x202851=ejs[_0xdcbc('0xd9')](_0x1caa40,{'body':_[_0xdcbc('0xda')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x5f')]),'bodyTitle':_0x9f0067[_0xdcbc('0xdb')]});return db[_0xdcbc('0xdc')][_0xdcbc('0x5e')]({'body':_0x202851,'ContactId':_0x4b8a3f['id'],'ChatWebsiteId':_0x9f0067['id']});}})[_0xdcbc('0x23')](function(_0x167637){_0x5e7fe1=_0x167637;if(_0x25f014[_0xdcbc('0x4a')]){var _0x206214=_0x25f014[_0xdcbc('0x42')](function(_0x4f6b80){return{'name':_0x4f6b80[_0xdcbc('0xdd')],'basename':_0x4f6b80['filename'],'type':_0x4f6b80[_0xdcbc('0xde')],'ChatOfflineMessageId':_0x167637['id']};});_0x357332=_0x206214['map'](_0x4b6916=>{var _0x35a93b={'filename':_0x4b6916['name'],'path':path[_0xdcbc('0x7b')](config['root'],_0xdcbc('0xdf'),_0xdcbc('0xd0'),_0xdcbc('0xe0'),_0xdcbc('0xe1'),_0x4b6916[_0xdcbc('0xe2')])};return _0x35a93b;});if(!_0x9f0067[_0xdcbc('0xe3')]){return db[_0xdcbc('0xe4')][_0xdcbc('0xe5')](function(_0x3c7971){return db[_0xdcbc('0xe6')][_0xdcbc('0xe7')](_0x206214,{'transaction':_0x3c7971});});}}})[_0xdcbc('0x23')](function(){if(_0x5e7fe1){_0x2460ca=_0x5e7fe1;return db[_0xdcbc('0xd5')][_0xdcbc('0x6a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x3430c2){if(_0x3430c2&&_0x3430c2[_0xdcbc('0xe8')]&&_0x9f0067[_0xdcbc('0xe9')]&&_0x9f0067[_0xdcbc('0xea')]){var _0x4b1af7={'tls':{'rejectUnauthorized':![]}};if(_0x3430c2['Smtp'][_0xdcbc('0xeb')]){_0x4b1af7[_0xdcbc('0xeb')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xeb')];}else{_0x4b1af7['host']=_0x3430c2['Smtp'][_0xdcbc('0xec')];_0x4b1af7[_0xdcbc('0xed')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xed')];_0x4b1af7[_0xdcbc('0xee')]=_0x3430c2['Smtp'][_0xdcbc('0xee')];}if(_0x3430c2['Smtp'][_0xdcbc('0xef')]){_0x4b1af7['auth']={'user':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')],'pass':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xf0')]};}return respondWithRpcPromise(_0xdcbc('0xf1'),_0xdcbc('0xf2'),{'account':_0x4b1af7,'message':{'from':util['format'](_0xdcbc('0xf3'),_0x3430c2[_0xdcbc('0x3e')],_0x3430c2[_0xdcbc('0xf4')]||_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')]),'to':_0x9f0067[_0xdcbc('0xea')],'subject':_0x9f0067[_0xdcbc('0xf5')],'html':_0x2460ca[_0xdcbc('0x5f')],'attachments':_0x357332}},client9003)[_0xdcbc('0x23')](function(){return _0x2460ca;})[_0xdcbc('0x58')](function(_0x5a159e){console[_0xdcbc('0x2a')](_0x5a159e);});}})[_0xdcbc('0x23')](function(){if(_0x9f0067&&_0x9f0067[_0xdcbc('0xe3')]&&_0x9f0067['MailAccountId']){var _0x5a52db=[];if(_0x25f014[_0xdcbc('0x4a')]){_0x5a52db=_0x25f014[_0xdcbc('0x42')](function(_0x88828f){return{'name':_0x88828f[_0xdcbc('0xdd')],'basename':_0x88828f['filename'],'type':_0x88828f['mimetype'],'ChatOfflineMessageId':_0x5e7fe1['id']};});}var _0xac9478;if(!_[_0xdcbc('0x83')](_0x9f0067[_0xdcbc('0xf6')])){var _0x1ad03d=_['map'](_0x41837a['body'],function(_0x5be47c){return _0x5be47c;});var _0x33ec6b=_[_0xdcbc('0xf7')](_0x1ad03d)[0x0];var _0x2a22cd=_[_0xdcbc('0xf8')](_0x33ec6b,function(_0x442568){return _0x442568;});_0xac9478=_0x2a22cd[0x1][_0x9f0067[_0xdcbc('0xf6')]];}var _0x249579={'from':_0xfb5e7b[_0xdcbc('0xf4')],'firstName':_0xfb5e7b[_0xdcbc('0xf9')],'lastName':_0xfb5e7b['lastName'],'mapKey':_0xdcbc('0xf4'),'message':{'from':_0xfb5e7b[_0xdcbc('0xf4')],'to':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')],'cc':'','subject':_[_0xdcbc('0x83')](_0xac9478)?_0x9f0067[_0xdcbc('0xf5')]:_0xac9478,'messageId':'','sentAt':new Date(),'attach':_0x5a52db[_0xdcbc('0x4a')],'attachments':_0x5a52db,'originChannel':_0xdcbc('0xfa'),'ChatWebsiteId':_0x9f0067['id'],'ChatOfflineMessageId':_0x2460ca['id'],'originTo':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')]},'body':_0x2460ca['body']};var _0x1ca6c7={'account':{'id':_0x9f0067['MailAccountId']},'body':_0x249579,'log':_0xdcbc('0xfb')};return respondWithRpcPromise('NotifyMailAccount',_0xdcbc('0xfc'),_0x1ca6c7,client9001)['then'](function(){return _0x2460ca;})['catch'](function(_0x5568a1){console[_0xdcbc('0x2a')](_0x5568a1);});}return;})[_0xdcbc('0x23')](function(){if(_0x2460ca){return _0x2460ca;}})['then'](respondWithResult(_0x52a4e8,null))[_0xdcbc('0x58')](function(_0xd3c3b1){console[_0xdcbc('0x2a')]('catch',_0xd3c3b1);for(var _0x44020d of _0x25f014){var _0x53a9a2=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server',_0xdcbc('0xd0'),'attachments',_0xdcbc('0xe1'),_0x44020d['filename']);fs_extra[_0xdcbc('0xfd')](_0x53a9a2)[_0xdcbc('0x58')](function(_0x5dcf96){console[_0xdcbc('0x2a')](_0xdcbc('0xfe'),_0x53a9a2,_0x5dcf96);});}});};exports[_0xdcbc('0xff')]=function(_0x3aa884,_0xe67977,_0x28d84e){return db[_0xdcbc('0xbc')][_0xdcbc('0x5d')]({'where':{'id':_0x3aa884[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe67977,null))[_0xdcbc('0x23')](function(_0x451dc9){if(_0x451dc9){return _0x451dc9['addInteraction'](_0x3aa884[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x3aa884['body'],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0xe67977,null))['catch'](handleError(_0xe67977,null));};exports['getInteractions']=function(_0x4d9567,_0xf1f092,_0x2da46a){var _0x150bb4={'raw':![],'where':{}};var _0xeee135={};var _0x117a34={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')]['findOne']({'where':{'id':_0x4d9567[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xf1f092,null))[_0xdcbc('0x23')](function(_0x930085){if(_0x930085){_0xeee135[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xbc')][_0xdcbc('0x5c')]);_0xeee135[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x4d9567[_0xdcbc('0x45')]);_0xeee135['filters']=_[_0xdcbc('0x47')](_0xeee135['model'],_0xeee135[_0xdcbc('0x45')]);_0x150bb4[_0xdcbc('0x48')]=_['intersection'](_0xeee135[_0xdcbc('0x44')],qs['fields'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x150bb4['attributes']=_0x150bb4[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x150bb4[_0xdcbc('0x48')]:_0xeee135[_0xdcbc('0x44')];if(!_0x4d9567[_0xdcbc('0x45')]['hasOwnProperty'](_0xdcbc('0x4c'))){_0x150bb4[_0xdcbc('0x31')]=qs['limit'](_0x4d9567[_0xdcbc('0x45')]['limit']);_0x150bb4[_0xdcbc('0x30')]=qs['offset'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x150bb4[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x150bb4[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x4d9567['query'],_0xeee135['filters']));_0x150bb4[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0x930085['id'];if(_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x150bb4[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x150bb4[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x150bb4[_0xdcbc('0x48')],function(_0x5d3fb8){var _0x3d7561={};_0x3d7561[_0x5d3fb8]={'$like':'%'+_0x4d9567[_0xdcbc('0x45')]['filter']+'%'};return _0x3d7561;})});}_0x150bb4=_[_0xdcbc('0x50')]({},_0x150bb4,_0x4d9567['options']);return db[_0xdcbc('0xbc')]['count']({'where':_0x150bb4[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x354ba9){_0x117a34[_0xdcbc('0x33')]=_0x354ba9;if(_0x4d9567[_0xdcbc('0x45')]['includeAll']){_0x150bb4[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xc7')],'as':'Owner','attributes':[_0xdcbc('0x3e'),_0xdcbc('0x102'),'internal'],'required':![]},{'model':db[_0xdcbc('0x103')],'as':'Tags','attributes':['id',_0xdcbc('0x3e'),'color'],'where':_0x4d9567[_0xdcbc('0x45')]['tag']?{'id':_0x4d9567['query'][_0xdcbc('0x104')]}:undefined,'required':_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x104')]?!![]:![]}];}return db[_0xdcbc('0xbc')]['findAll'](_0x150bb4);})['then'](function(_0x2d978d){_0x117a34[_0xdcbc('0x57')]=_0x2d978d;return _0x117a34;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0xf1f092,_0x150bb4))[_0xdcbc('0x58')](handleError(_0xf1f092,null));};function iftimePromise(_0x9c26dc,_0x5f5148){return respondWithRpcPromise(_0xdcbc('0x105'),_0xdcbc('0x106'),{'command':_0x5f5148['timezone']?util[_0xdcbc('0xb5')](_0xdcbc('0x107'),_0x9c26dc[_0xdcbc('0x108')],_0x5f5148[_0xdcbc('0x109')]):util[_0xdcbc('0xb5')](_0xdcbc('0x10a'),_0x9c26dc['interval'])},client9002)['then'](function(_0x2fffff){var _0x429446=_0x2fffff&&_0x2fffff[_0xdcbc('0x10b')](_0xdcbc('0x10c'))>=0x0?!![]:![];logger[_0xdcbc('0x2c')](_0xdcbc('0x10d'),_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],_0x429446?_0xdcbc('0x10e'):'OFFLINE',_0x5f5148[_0xdcbc('0x109')]?_0x5f5148['timezone']:_0xdcbc('0x10f'));return _0x429446;})[_0xdcbc('0x58')](function(_0x11fe78){logger[_0xdcbc('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],util[_0xdcbc('0x110')](_0x11fe78,{'showHidden':![],'depth':null}),_0x5f5148[_0xdcbc('0x109')]?_0x5f5148[_0xdcbc('0x109')]:_0xdcbc('0x10f'));return![];});}exports[_0xdcbc('0x106')]=function(_0xa3f780,_0x3508b9,_0x2ae507){var _0x3b5247=0x0;var _0x4d7789=0x0;var _0x72756e=![];var _0x2d92c2;var _0x191c5;return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0xa3f780['params']['id']},'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x111'),'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x112'),'attributes':['id',_0xdcbc('0x108')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3508b9,null))[_0xdcbc('0x23')](function(_0x10d979){if(_0x10d979){_0x2d92c2=_0x10d979;return _0x10d979[_0xdcbc('0x113')]({'raw':!![]});}})[_0xdcbc('0x23')](function(_0x1c7e35){if(_0x2d92c2){if(_0x1c7e35){_0x191c5=_0x1c7e35;}}return require(_0xdcbc('0x1a'))[_0xdcbc('0x7d')]();})[_0xdcbc('0x23')](function(_0x310369){if(_0x310369){_0x4d7789=_0x310369['virtual'];_0x72756e=_0x310369['custom'];}})['then'](function(){return db[_0xdcbc('0xbc')][_0xdcbc('0x33')]({'where':{'closed':![]}});})[_0xdcbc('0x23')](function(_0x4e0707){_0x3b5247=_0x4e0707;if(_0x4d7789&&_0x4e0707>_0x4d7789){return db[_0xdcbc('0x114')]['findOne']({'where':{'id':0x1}})[_0xdcbc('0x23')](function(_0x36616d){if(_0x36616d){_0x36616d['increment'](_0xdcbc('0x115'));}});}})[_0xdcbc('0x23')](function(){if(_0x2d92c2[_0xdcbc('0x111')]&&_0x2d92c2['Interval'][_0xdcbc('0x112')]){var _0x418299=[];for(var _0x16fb7a=0x0;_0x16fb7a<_0x2d92c2['Interval']['Intervals']['length'];_0x16fb7a++){var _0x463798=_0x2d92c2['Interval'][_0xdcbc('0x112')][_0x16fb7a][_0xdcbc('0x3a')]({'plain':!![]});_0x418299[_0xdcbc('0x116')](iftimePromise(_0x463798,_0x2d92c2));}return BPromise['all'](_0x418299)['then'](function(_0xfe0304){return _['some'](_0xfe0304);});}else{return!![];}})[_0xdcbc('0x23')](function(_0x2ec9e5){var _0x230226=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/chat/iframe.ejs'),_0xdcbc('0xd8'));var _0x25c7a5={'remote':_0x2d92c2['remote'],'query':querystring[_0xdcbc('0x28')](_[_0xdcbc('0x50')](_0x2d92c2['get']({'plain':!![]}),{'customerIp':_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0xae')]||_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0x117')]||_0xa3f780[_0xdcbc('0x118')][_0xdcbc('0x119')]||_0xa3f780['ip'],'referer':_0xa3f780['headers'][_0xdcbc('0xb2')],'openedInteractions':_0x3b5247,'maxInteractions':_0x4d7789,'virtual':_0x72756e['virtual'],'online':_0x2ec9e5,'custom':_0x72756e}))['replace'](/'/g,'\x5c\x27')};_0x3508b9[_0xdcbc('0xd2')](ejs[_0xdcbc('0xd9')](Mustache[_0xdcbc('0xd9')](_0x230226,_0x25c7a5),{'proactiveActions':_0x191c5,'alignment':_0x2d92c2[_0xdcbc('0x11a')],'verticalAlignment':_0x2d92c2[_0xdcbc('0x11b')],'div_color':_0x2d92c2[_0xdcbc('0x11c')],'text_color':_0x2d92c2[_0xdcbc('0x11d')],'button_color':_0x2d92c2[_0xdcbc('0x11e')],'background_color':_0x2d92c2['backgroundColor']}));})['catch'](handleError(_0x3508b9,null));};exports[_0xdcbc('0x11f')]=function(_0x5784f4,_0x579b92,_0x2c8acb){return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x5784f4['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x579b92,null))[_0xdcbc('0x23')](function(_0x730713){if(_0x730713){return db['sequelize'][_0xdcbc('0xe5')](function(_0x4a147a){return db[_0xdcbc('0xa2')][_0xdcbc('0x39')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'transaction':_0x4a147a})[_0xdcbc('0x23')](function(_0x34830c){var _0x4445f2=_[_0xdcbc('0x42')](_0x5784f4['body'],function(_0x105fc8){_0x105fc8[_0xdcbc('0x67')]=_0x5784f4[_0xdcbc('0x5a')]['id'];return _0x105fc8;});return db[_0xdcbc('0xa2')][_0xdcbc('0xe7')](_0x4445f2,{'transaction':_0x4a147a});});})['then'](function(){return db[_0xdcbc('0xa2')][_0xdcbc('0x120')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'order':_0xdcbc('0x121')});});}})[_0xdcbc('0x23')](respondWithResult(_0x579b92,null))['catch'](handleError(_0x579b92,null));};exports[_0xdcbc('0x122')]=function(_0x117edb,_0x8d865c,_0x512df9){var _0x5567f8={};var _0xa6c89b={};var _0x9ec2c8;var _0x3802da;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x117edb[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x8d865c,null))[_0xdcbc('0x23')](function(_0x44eba8){if(_0x44eba8){_0x9ec2c8=_0x44eba8;_0xa6c89b[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xa2')][_0xdcbc('0x5c')]);_0xa6c89b[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x117edb['query']);_0xa6c89b[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xa6c89b['model'],_0xa6c89b[_0xdcbc('0x45')]);_0x5567f8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xa6c89b[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x117edb['query']['fields']));_0x5567f8[_0xdcbc('0x48')]=_0x5567f8[_0xdcbc('0x48')]['length']?_0x5567f8[_0xdcbc('0x48')]:_0xa6c89b['model'];_0x5567f8[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5567f8[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x117edb[_0xdcbc('0x45')],_0xa6c89b[_0xdcbc('0x46')]));if(_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x5567f8[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5567f8[_0xdcbc('0x51')],{'$or':_['map'](_0x5567f8[_0xdcbc('0x48')],function(_0x2875df){var _0x57c6fb={};_0x57c6fb[_0x2875df]={'$like':'%'+_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x57c6fb;})});}_0x5567f8=_[_0xdcbc('0x50')]({},_0x5567f8,_0x117edb['options']);return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0xcb6986){if(_0xcb6986){_0x3802da=_0xcb6986[_0xdcbc('0x4a')];if(!_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5567f8[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x5567f8[_0xdcbc('0x30')]=qs['offset'](_0x117edb['query'][_0xdcbc('0x30')]);}return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0x14e7ae){if(_0x14e7ae){return _0x14e7ae?{'count':_0x3802da,'rows':_0x14e7ae}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x8d865c,null))[_0xdcbc('0x58')](handleError(_0x8d865c,null));};exports['addProactiveActions']=function(_0xe3329f,_0x1a11a1,_0x1b0844){return db[_0xdcbc('0x123')][_0xdcbc('0x5d')]({'where':{'id':_0xe3329f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a11a1,null))[_0xdcbc('0x23')](function(_0x44382f){if(_0x44382f){return _0x44382f[_0xdcbc('0x124')](_0xe3329f[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0xe3329f[_0xdcbc('0x5f')],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0x1a11a1,null))[_0xdcbc('0x58')](handleError(_0x1a11a1,null));};exports[_0xdcbc('0x113')]=function(_0x111a47,_0x473642,_0x580845){var _0x123db5={};var _0x23f710={};var _0x86db36;var _0x21877a;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x111a47['params']['id']}})['then'](handleEntityNotFound(_0x473642,null))[_0xdcbc('0x23')](function(_0x278d5f){if(_0x278d5f){_0x86db36=_0x278d5f;_0x23f710[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x125')][_0xdcbc('0x5c')]);_0x23f710[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x111a47[_0xdcbc('0x45')]);_0x23f710[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x23f710[_0xdcbc('0x44')],_0x23f710['query']);_0x123db5[_0xdcbc('0x48')]=_['intersection'](_0x23f710[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x123db5[_0xdcbc('0x48')]=_0x123db5[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x123db5[_0xdcbc('0x48')]:_0x23f710[_0xdcbc('0x44')];_0x123db5[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x111a47['query'][_0xdcbc('0x4d')]);_0x123db5[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x111a47[_0xdcbc('0x45')],_0x23f710[_0xdcbc('0x46')]));if(_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x123db5[_0xdcbc('0x51')]=_['merge'](_0x123db5[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x123db5['attributes'],function(_0x432da2){var _0x164e6e={};_0x164e6e[_0x432da2]={'$like':'%'+_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x164e6e;})});}_0x123db5=_[_0xdcbc('0x50')]({},_0x123db5,_0x111a47[_0xdcbc('0x53')]);return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x3a8bec){if(_0x3a8bec){_0x21877a=_0x3a8bec[_0xdcbc('0x4a')];if(!_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x123db5[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x111a47[_0xdcbc('0x45')]['limit']);_0x123db5['offset']=qs[_0xdcbc('0x30')](_0x111a47['query'][_0xdcbc('0x30')]);}return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x2af3c6){if(_0x2af3c6){return _0x2af3c6?{'count':_0x21877a,'rows':_0x2af3c6}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x473642,null))[_0xdcbc('0x58')](handleError(_0x473642,null));};exports[_0xdcbc('0x126')]=function(_0x4167c1,_0xdd6dba,_0x4b6884){var _0x1a7ab7=_0x4167c1['query'][_0xdcbc('0x127')]===_0xdcbc('0x128')?_0xdcbc('0x129'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x1a7ab7],'where':{'id':_0x4167c1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xdd6dba,null))[_0xdcbc('0x23')](function(_0x5b36e3){if(_0x5b36e3){var _0x42a7a7=_0x5b36e3[_0x1a7ab7];var _0x294be7=_0x42a7a7&&_0x42a7a7[_0xdcbc('0x12a')]?_0x42a7a7[_0xdcbc('0x12a')]:[];_0xdd6dba[_0xdcbc('0xd2')]({'fromKey':_[_0xdcbc('0x83')](_0x42a7a7[_0xdcbc('0x12b')])?undefined:_0x42a7a7[_0xdcbc('0x12b')],'count':_0x294be7[_0xdcbc('0x4a')],'rows':_0x294be7});}})[_0xdcbc('0x58')](handleError(_0xdd6dba,null));};exports[_0xdcbc('0x12c')]=function(_0x120679,_0x5d47c2,_0x27f1be){var _0x19598a={'raw':![],'where':{}};var _0x154094={};var _0x4c88bc={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x120679[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x5d47c2,null))[_0xdcbc('0x23')](function(_0x2e65d8){if(_0x2e65d8){_0x154094[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0xdc')][_0xdcbc('0x5c')]);_0x154094[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x120679[_0xdcbc('0x45')]);_0x154094[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x154094[_0xdcbc('0x44')],_0x154094[_0xdcbc('0x45')]);_0x19598a[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x154094['model'],qs[_0xdcbc('0x49')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x19598a[_0xdcbc('0x48')]=_0x19598a[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x19598a[_0xdcbc('0x48')]:_0x154094[_0xdcbc('0x44')];if(!_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x19598a[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x19598a['offset']=qs['offset'](_0x120679['query'][_0xdcbc('0x30')]);}_0x19598a[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x19598a['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x120679[_0xdcbc('0x45')],_0x154094['filters']));_0x19598a['where'][_0xdcbc('0x67')]=_0x2e65d8['id'];if(_0x120679['query']['filter']){_0x19598a[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x19598a[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x19598a['attributes'],function(_0x3ba46a){var _0x49bd66={};_0x49bd66[_0x3ba46a]={'$like':'%'+_0x120679[_0xdcbc('0x45')]['filter']+'%'};return _0x49bd66;})});}_0x19598a=_[_0xdcbc('0x50')]({},_0x19598a,_0x120679['options']);return db[_0xdcbc('0xdc')]['count']({'where':_0x19598a[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x4560c1){_0x4c88bc[_0xdcbc('0x33')]=_0x4560c1;if(_0x120679['query'][_0xdcbc('0x54')]){_0x19598a[_0xdcbc('0x6b')]=[{'all':!![]}];}else{_0x19598a[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xe6')],'as':_0xdcbc('0x12d'),'required':![]}];}return db[_0xdcbc('0xdc')][_0xdcbc('0x56')](_0x19598a);})[_0xdcbc('0x23')](function(_0x3f1199){_0x4c88bc[_0xdcbc('0x57')]=_0x3f1199;return _0x4c88bc;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x5d47c2,_0x19598a))[_0xdcbc('0x58')](handleError(_0x5d47c2,null));};exports['addAgents']=function(_0x17f605,_0x445460,_0x2c4b67){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x17f605[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x445460,null))[_0xdcbc('0x23')](function(_0x356db6){if(_0x356db6){return _0x356db6['addAgents'](_0x17f605['body'][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x17f605['body'],[_0xdcbc('0x6d'),'id'])||{})[_0xdcbc('0xbf')](function(_0x9eb906){for(var _0x425271=0x0;_0x425271<_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0xdcbc('0x4a')];_0x425271+=0x1){socket['emit'](_0xdcbc('0x12e'),{'UserId':Number(_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0x425271]),'ChatWebsiteId':Number(_0x17f605[_0xdcbc('0x5a')]['id'])});}return _0x9eb906;});}})['then'](respondWithResult(_0x445460,null))[_0xdcbc('0x58')](handleError(_0x445460,null));};exports[_0xdcbc('0x12f')]=function(_0x2e0005,_0x400a00,_0x1d2ab0){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x2e0005['params']['id']}})['then'](handleEntityNotFound(_0x400a00,null))['then'](function(_0x3e6776){if(_0x3e6776){return _0x3e6776[_0xdcbc('0x12f')](_0x2e0005[_0xdcbc('0x45')]['ids'])[_0xdcbc('0x23')](function(){if(_['isArray'](_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')])){for(var _0x4d8f09=0x0;_0x4d8f09<_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]['length'];_0x4d8f09+=0x1){socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005['query'][_0xdcbc('0x6d')][_0x4d8f09]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}}else{socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}});}})[_0xdcbc('0x23')](respondWithStatusCode(_0x400a00,null))['catch'](handleError(_0x400a00,null));};exports[_0xdcbc('0x132')]=function(_0x15ccc1,_0x2ee409,_0xe9259d){var _0x520850={};var _0x295304={};var _0x543d33;var _0x8eff12;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x15ccc1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x2ee409,null))[_0xdcbc('0x23')](function(_0x1f42f4){if(_0x1f42f4){_0x543d33=_0x1f42f4;_0x295304[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xc7')][_0xdcbc('0x5c')]);_0x295304[_0xdcbc('0x45')]=_['keys'](_0x15ccc1[_0xdcbc('0x45')]);_0x295304[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],_0x295304['query']);_0x520850['attributes']=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x15ccc1[_0xdcbc('0x45')]['fields']));_0x520850[_0xdcbc('0x48')]=_0x520850[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x520850[_0xdcbc('0x48')]:_0x295304['model'];_0x520850[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x520850[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x15ccc1[_0xdcbc('0x45')],_0x295304[_0xdcbc('0x46')]));if(_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x520850['where']=_[_0xdcbc('0x50')](_0x520850[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x520850['attributes'],function(_0x5523e3){var _0x5b1098={};_0x5b1098[_0x5523e3]={'$like':'%'+_0x15ccc1[_0xdcbc('0x45')]['filter']+'%'};return _0x5b1098;})});}_0x520850=_[_0xdcbc('0x50')]({},_0x520850,_0x15ccc1[_0xdcbc('0x53')]);return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x369447){if(_0x369447){_0x8eff12=_0x369447['length'];if(!_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4b')]('nolimit')){_0x520850[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x15ccc1[_0xdcbc('0x45')]['limit']);_0x520850[_0xdcbc('0x30')]=qs['offset'](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x30')]);}return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x4f6f1b){if(_0x4f6f1b){return _0x4f6f1b?{'count':_0x8eff12,'rows':_0x4f6f1b}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x2ee409,null))[_0xdcbc('0x58')](handleError(_0x2ee409,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d3eeb01..fc4a26c 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 _0x2b83=['emit','hook','exports','../../mysqldb','ChatWebsite','save','update','remove'];(function(_0x5ecec9,_0xb79a14){var _0x74c17=function(_0x18dbb1){while(--_0x18dbb1){_0x5ecec9['push'](_0x5ecec9['shift']());}};_0x74c17(++_0xb79a14);}(_0x2b83,0x1d3));var _0x32b8=function(_0x39d4c5,_0x143f5e){_0x39d4c5=_0x39d4c5-0x0;var _0x99bb94=_0x2b83[_0x39d4c5];return _0x99bb94;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x32b8('0x0'))['db'][_0x32b8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32b8('0x2'),'afterUpdate':_0x32b8('0x3'),'afterDestroy':_0x32b8('0x4')};function emitEvent(_0x5a4168){return function(_0x51d3b4,_0xdd712a,_0x1cc832){ChatWebsiteEvents['emit'](_0x5a4168+':'+_0x51d3b4['id'],_0x51d3b4);ChatWebsiteEvents[_0x32b8('0x5')](_0x5a4168,_0x51d3b4);_0x1cc832(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x32b8('0x6')](e,emitEvent(event));}}module[_0x32b8('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x5a01=['../../mysqldb','ChatWebsite','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x5adcee,_0xfdda97){var _0x1beaa3=function(_0x948152){while(--_0x948152){_0x5adcee['push'](_0x5adcee['shift']());}};_0x1beaa3(++_0xfdda97);}(_0x5a01,0x1af));var _0x15a0=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x5a01[_0x50f6e5];return _0x5988c5;};'use strict';var EventEmitter=require(_0x15a0('0x0'));var ChatWebsite=require(_0x15a0('0x1'))['db'][_0x15a0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x15a0('0x3'),'afterDestroy':_0x15a0('0x4')};function emitEvent(_0x4c7c75){return function(_0x1c83a1,_0x12ae6b,_0x1751ed){ChatWebsiteEvents['emit'](_0x4c7c75+':'+_0x1c83a1['id'],_0x1c83a1);ChatWebsiteEvents['emit'](_0x4c7c75,_0x1c83a1);_0x1751ed(null);};}for(var e in events){if(events[_0x15a0('0x5')](e)){var event=events[e];ChatWebsite[_0x15a0('0x6')](e,emitEvent(event));}}module[_0x15a0('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 29773b9..684f6b6 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 _0x62e1=['moment','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','../../config/logger','api'];(function(_0x7e807b,_0x59bf3a){var _0x4ca606=function(_0x43caab){while(--_0x43caab){_0x7e807b['push'](_0x7e807b['shift']());}};_0x4ca606(++_0x59bf3a);}(_0x62e1,0x97));var _0x162e=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x62e1[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0x162e('0x0'));var util=require('util');var logger=require(_0x162e('0x1'))(_0x162e('0x2'));var moment=require(_0x162e('0x3'));var BPromise=require('bluebird');var rp=require(_0x162e('0x4'));var fs=require('fs');var path=require(_0x162e('0x5'));var rimraf=require(_0x162e('0x6'));var config=require('../../config/environment');var attributes=require(_0x162e('0x7'));module[_0x162e('0x8')]=function(_0x442752,_0x3477ac){return _0x442752[_0x162e('0x9')]('ChatWebsite',attributes,{'tableName':_0x162e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd154=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api'];(function(_0x2c4bc3,_0x34f08b){var _0x31ca59=function(_0x2190f0){while(--_0x2190f0){_0x2c4bc3['push'](_0x2c4bc3['shift']());}};_0x31ca59(++_0x34f08b);}(_0xd154,0x177));var _0x4d15=function(_0x564820,_0x344e99){_0x564820=_0x564820-0x0;var _0x1f8ab3=_0xd154[_0x564820];return _0x1f8ab3;};'use strict';var _=require(_0x4d15('0x0'));var util=require(_0x4d15('0x1'));var logger=require('../../config/logger')(_0x4d15('0x2'));var moment=require(_0x4d15('0x3'));var BPromise=require(_0x4d15('0x4'));var rp=require(_0x4d15('0x5'));var fs=require('fs');var path=require(_0x4d15('0x6'));var rimraf=require(_0x4d15('0x7'));var config=require(_0x4d15('0x8'));var attributes=require(_0x4d15('0x9'));module[_0x4d15('0xa')]=function(_0x6963e4,_0xf58fda){return _0x6963e4[_0x4d15('0xb')](_0x4d15('0xc'),attributes,{'tableName':_0x4d15('0xd'),'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 dd8fa25..6e5c3dd 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 _0x5bb0=['lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2c0686,_0x5451a0){var _0x51b5e6=function(_0x366c54){while(--_0x366c54){_0x2c0686['push'](_0x2c0686['shift']());}};_0x51b5e6(++_0x5451a0);}(_0x5bb0,0x1a0));var _0x05bb=function(_0x4b392f,_0x4ad5b7){_0x4b392f=_0x4b392f-0x0;var _0x222927=_0x5bb0[_0x4b392f];return _0x222927;};'use strict';var _=require(_0x05bb('0x0'));var util=require(_0x05bb('0x1'));var moment=require(_0x05bb('0x2'));var BPromise=require(_0x05bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x05bb('0x5'));var config=require(_0x05bb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x05bb('0x7')][_0x05bb('0x8')]({'port':0x232a});config[_0x05bb('0x9')]=_[_0x05bb('0xa')](config[_0x05bb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x05bb('0xb'))(new Redis(config[_0x05bb('0x9')]));require(_0x05bb('0xc'))[_0x05bb('0xd')](socket);function respondWithRpcPromise(_0x3e0438,_0x32661b,_0x308f22){return new BPromise(function(_0x386351,_0x4d0f02){return client[_0x05bb('0xe')](_0x3e0438,_0x308f22)['then'](function(_0xc4e62e){logger[_0x05bb('0xf')](_0x05bb('0x10'),_0x32661b,'request\x20sent');logger[_0x05bb('0x11')](_0x05bb('0x12'),_0x32661b,_0x05bb('0x13'),JSON[_0x05bb('0x14')](_0xc4e62e));if(_0xc4e62e[_0x05bb('0x15')]){if(_0xc4e62e['error'][_0x05bb('0x16')]===0x1f4){logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0xc4e62e['error'][_0x05bb('0x17')]);return _0x4d0f02(_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);}logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);return _0x386351(_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);}else{logger[_0x05bb('0xf')](_0x05bb('0x10'),_0x32661b,_0x05bb('0x13'));_0x386351(_0xc4e62e[_0x05bb('0x18')][_0x05bb('0x17')]);}})[_0x05bb('0x19')](function(_0x50d508){logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0x50d508);_0x4d0f02(_0x50d508);});});}
\ No newline at end of file
+var _0x02c2=['message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x02c2,0x14d));var _0x202c=function(_0x548fe7,_0xd82e3d){_0x548fe7=_0x548fe7-0x0;var _0x3a1e53=_0x02c2[_0x548fe7];return _0x3a1e53;};'use strict';var _=require(_0x202c('0x0'));var util=require(_0x202c('0x1'));var moment=require(_0x202c('0x2'));var BPromise=require('bluebird');var rs=require(_0x202c('0x3'));var fs=require('fs');var Redis=require(_0x202c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x202c('0x5'));var config=require(_0x202c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x202c('0x7')][_0x202c('0x8')]({'port':0x232a});config[_0x202c('0x9')]=_[_0x202c('0xa')](config['redis'],{'host':_0x202c('0xb'),'port':0x18eb});var socket=require(_0x202c('0xc'))(new Redis(config['redis']));require(_0x202c('0xd'))['register'](socket);function respondWithRpcPromise(_0x54f610,_0x107cda,_0x273a51){return new BPromise(function(_0x3180f9,_0x2490de){return client['request'](_0x54f610,_0x273a51)['then'](function(_0x82b89){logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,_0x202c('0x10'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107cda,_0x202c('0x10'),JSON[_0x202c('0x11')](_0x82b89));if(_0x82b89['error']){if(_0x82b89[_0x202c('0x12')]['code']===0x1f4){logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);return _0x2490de(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89['error'][_0x202c('0x13')]);return _0x3180f9(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}else{logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,'request\x20sent');_0x3180f9(_0x82b89[_0x202c('0x14')][_0x202c('0x13')]);}})[_0x202c('0x15')](function(_0x38da67){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x38da67);_0x2490de(_0x38da67);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 3f8a56f..eb1d01d 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 _0x14b0=['./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x3adf98,_0x1c0b5a){var _0x32bee8=function(_0x5cd50c){while(--_0x5cd50c){_0x3adf98['push'](_0x3adf98['shift']());}};_0x32bee8(++_0x1c0b5a);}(_0x14b0,0x181));var _0x014b=function(_0x33e580,_0x21b7fa){_0x33e580=_0x33e580-0x0;var _0xab7b7c=_0x14b0[_0x33e580];return _0xab7b7c;};'use strict';var ChatWebsiteEvents=require(_0x014b('0x0'));var events=[_0x014b('0x1'),_0x014b('0x2'),'update'];function createListener(_0x1f1914,_0x44ca12){return function(_0x35354e){_0x44ca12[_0x014b('0x3')](_0x1f1914,_0x35354e);};}function removeListener(_0x592d60,_0x3b94d9){return function(){ChatWebsiteEvents[_0x014b('0x4')](_0x592d60,_0x3b94d9);};}exports[_0x014b('0x5')]=function(_0x4b9276){for(var _0x89f5e0=0x0,_0x1c3cb8=events[_0x014b('0x6')];_0x89f5e0<_0x1c3cb8;_0x89f5e0++){var _0x29eb89=events[_0x89f5e0];var _0x8df7c=createListener('chatWebsite:'+_0x29eb89,_0x4b9276);ChatWebsiteEvents['on'](_0x29eb89,_0x8df7c);}};
\ No newline at end of file
+var _0x198d=['removeListener','register','length','save','remove','update','emit'];(function(_0x21d5f9,_0x11e8f2){var _0xb9a560=function(_0x232214){while(--_0x232214){_0x21d5f9['push'](_0x21d5f9['shift']());}};_0xb9a560(++_0x11e8f2);}(_0x198d,0x88));var _0xd198=function(_0x1923d4,_0x5c968b){_0x1923d4=_0x1923d4-0x0;var _0x5d8474=_0x198d[_0x1923d4];return _0x5d8474;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd198('0x0'),_0xd198('0x1'),_0xd198('0x2')];function createListener(_0x6f6671,_0x51cdcc){return function(_0x480c21){_0x51cdcc[_0xd198('0x3')](_0x6f6671,_0x480c21);};}function removeListener(_0xdc4825,_0x1d8464){return function(){ChatWebsiteEvents[_0xd198('0x4')](_0xdc4825,_0x1d8464);};}exports[_0xd198('0x5')]=function(_0x5ce33b){for(var _0x390d6d=0x0,_0x4ac82f=events[_0xd198('0x6')];_0x390d6d<_0x4ac82f;_0x390d6d++){var _0x577e98=events[_0x390d6d];var _0x1c2747=createListener('chatWebsite:'+_0x577e98,_0x5ce33b);ChatWebsiteEvents['on'](_0x577e98,_0x1c2747);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c050349..6b1d50f 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 _0xf93d=['server/files/images/logos/','format','%s-%s','now','/:id/logo','single','addLogo','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','/:id/applications','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','diskStorage','join','root'];(function(_0x106f32,_0x17a206){var _0x37c5c1=function(_0x3a2e8a){while(--_0x3a2e8a){_0x106f32['push'](_0x106f32['shift']());}};_0x37c5c1(++_0x17a206);}(_0xf93d,0x66));var _0xdf93=function(_0x1ead47,_0x2d2868){_0x1ead47=_0x1ead47-0x0;var _0x5731e0=_0xf93d[_0x1ead47];return _0x5731e0;};'use strict';var multer=require(_0xdf93('0x0'));var util=require('util');var path=require(_0xdf93('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf93('0x2'));var router=express[_0xdf93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf93('0x4'));var interaction=require(_0xdf93('0x5'));var config=require(_0xdf93('0x6'));var controller=require('./chatWebsite.controller');router[_0xdf93('0x7')]('/',auth['isAuthenticated'](),controller[_0xdf93('0x8')]);router[_0xdf93('0x7')](_0xdf93('0x9'),auth['isAuthenticated'](),controller[_0xdf93('0xa')]);router[_0xdf93('0x7')](_0xdf93('0xb'),auth[_0xdf93('0xc')](),controller[_0xdf93('0xd')]);router[_0xdf93('0x7')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller[_0xdf93('0xf')]);router[_0xdf93('0x7')](_0xdf93('0x10'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x11')]);router[_0xdf93('0x7')]('/:id/logo',controller[_0xdf93('0x12')]);router[_0xdf93('0x7')](_0xdf93('0x13'),controller['getAvatar']);router[_0xdf93('0x7')](_0xdf93('0x14'),controller[_0xdf93('0x15')]);router[_0xdf93('0x7')](_0xdf93('0x16'),controller[_0xdf93('0x17')]);router[_0xdf93('0x7')](_0xdf93('0x18'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x19')]);router['get'](_0xdf93('0x1a'),controller['getSnippet']);router[_0xdf93('0x7')]('/:id/applications',auth[_0xdf93('0xc')](),controller['getApplications']);router['get'](_0xdf93('0x1b'),auth['isAuthenticated'](),controller[_0xdf93('0x1c')]);router[_0xdf93('0x7')](_0xdf93('0x1d'),controller[_0xdf93('0x1e')]);router['get'](_0xdf93('0x1f'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x20')]);router[_0xdf93('0x7')](_0xdf93('0x21'),auth['isAuthenticated'](),controller[_0xdf93('0x22')]);router[_0xdf93('0x23')]('/',auth['isAuthenticated'](),controller[_0xdf93('0x24')]);router[_0xdf93('0x23')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller['addDisposition']);router[_0xdf93('0x23')](_0xdf93('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x21c76c,_0x3e1f6b,_0x3f2a6d){_0x3f2a6d(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x28')));},'filename':function(_0x3ffb6c,_0x43accd,_0x47082d){_0x47082d(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x43accd['originalname']));}})});router[_0xdf93('0x23')](_0xdf93('0x2c'),upload[_0xdf93('0x2d')]('file'),controller[_0xdf93('0x2e')]);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x5cfba3,_0x426480,_0x1d281c){_0x1d281c(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x2f')));},'filename':function(_0x165452,_0x55d3dc,_0x5a2a64){_0x5a2a64(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x55d3dc[_0xdf93('0x30')]));}})});router[_0xdf93('0x23')](_0xdf93('0x13'),upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x32')]);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x1f83fc,_0x1c5d52,_0xde599c){_0xde599c(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x2f')));},'filename':function(_0x4cb651,_0x5d10f8,_0x1245c3){_0x1245c3(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x5d10f8[_0xdf93('0x30')]));}})});router[_0xdf93('0x23')]('/:id/customer_avatar',upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a1f20,_0x3e7e84,_0x549c97){_0x549c97(null,path[_0xdf93('0x26')](config['root'],_0xdf93('0x2f')));},'filename':function(_0xcf8773,_0x5f3cb3,_0x28aed7){_0x28aed7(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date['now'](),_0x5f3cb3['originalname']));}})});router[_0xdf93('0x23')]('/:id/system_avatar',upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x34')]);router[_0xdf93('0x23')](_0xdf93('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x14db21,_0x2f1847,_0x2deadf){const _0x4efb4f=path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x36'),_0xdf93('0x37'),_0xdf93('0x38'));fs_extra[_0xdf93('0x39')](_0x4efb4f,function(){_0x2deadf(null,_0x4efb4f);});},'filename':function(_0x4cf0c7,_0x291b28,_0x523dce){const _0x10d6a9=_0x291b28[_0xdf93('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xac4229=path[_0xdf93('0x3a')](_0x10d6a9);const _0x4bd4e6=Date['now']()+'-'+_0x10d6a9[_0xdf93('0x3b')](_0xac4229,'')+_0xac4229;_0x523dce(null,_0x4bd4e6);}})});router[_0xdf93('0x23')]('/:id/offline',offlineUploadMulter[_0xdf93('0x3c')](),controller[_0xdf93('0x3d')]);router['post']('/:id/interactions',auth[_0xdf93('0xc')](),controller['addInteraction']);router[_0xdf93('0x23')](_0xdf93('0x3e'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x3f')]);router[_0xdf93('0x23')](_0xdf93('0x1b'),auth['isAuthenticated'](),controller[_0xdf93('0x40')]);router['post'](_0xdf93('0x21'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x41')]);router['put']('/:id',auth[_0xdf93('0xc')](),controller[_0xdf93('0x42')]);router[_0xdf93('0x43')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xdf93('0x43')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x44')]);router[_0xdf93('0x43')]('/:id/canned_answers',auth[_0xdf93('0xc')](),controller['removeAnswers']);router[_0xdf93('0x43')](_0xdf93('0x21'),auth['isAuthenticated'](),controller[_0xdf93('0x45')]);module[_0xdf93('0x46')]=router;
\ No newline at end of file
+var _0xc84d=['Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addApplications','delete','destroy','removeDispositions','removeAnswers','multer','util','connect-timeout','express'];(function(_0x56f937,_0x58d121){var _0x297fad=function(_0x5456a5){while(--_0x5456a5){_0x56f937['push'](_0x56f937['shift']());}};_0x297fad(++_0x58d121);}(_0xc84d,0x114));var _0xdc84=function(_0x1d757a,_0xf81a72){_0x1d757a=_0x1d757a-0x0;var _0x1d3ed7=_0xc84d[_0x1d757a];return _0x1d3ed7;};'use strict';var multer=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var path=require('path');var timeout=require(_0xdc84('0x2'));var express=require(_0xdc84('0x3'));var router=express[_0xdc84('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdc84('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdc84('0x6'));var controller=require(_0xdc84('0x7'));router[_0xdc84('0x8')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0xa')]);router[_0xdc84('0x8')](_0xdc84('0xb'),auth[_0xdc84('0x9')](),controller[_0xdc84('0xc')]);router[_0xdc84('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xdc84('0xd')]);router[_0xdc84('0x8')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0xe')]);router[_0xdc84('0x8')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x10')]);router[_0xdc84('0x8')](_0xdc84('0x11'),controller[_0xdc84('0x12')]);router[_0xdc84('0x8')]('/:id/avatar',controller[_0xdc84('0x13')]);router['get'](_0xdc84('0x14'),controller['getCustomerAvatar']);router[_0xdc84('0x8')](_0xdc84('0x15'),controller[_0xdc84('0x16')]);router['get'](_0xdc84('0x17'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x18')]);router['get'](_0xdc84('0x19'),controller['getSnippet']);router['get'](_0xdc84('0x1a'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1b')]);router[_0xdc84('0x8')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1d')]);router['get'](_0xdc84('0x1e'),controller[_0xdc84('0x1f')]);router[_0xdc84('0x8')](_0xdc84('0x20'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x21')]);router['get'](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['getAgents']);router[_0xdc84('0x23')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0x24')]);router[_0xdc84('0x23')](_0xdc84('0x25'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x26')]);router['post'](_0xdc84('0xf'),auth['isAuthenticated'](),controller[_0xdc84('0x27')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x26dee3,_0x393e87,_0x5ec070){_0x5ec070(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x2b')));},'filename':function(_0x56d843,_0x5c307c,_0x3587c1){_0x3587c1(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date['now'](),_0x5c307c[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x11'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x30')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x120624,_0x5184f0,_0x468caa){_0x468caa(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x29f0e3,_0x5c9fd7,_0x4637f5){_0x4637f5(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x5c9fd7[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x33'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x34')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x38af6f,_0x4a4105,_0x2aba01){_0x2aba01(null,path['join'](config['root'],_0xdc84('0x31')));},'filename':function(_0xd1a1c7,_0x31c351,_0x2eb6c7){_0x2eb6c7(null,util[_0xdc84('0x2c')]('%s-%s',Date[_0xdc84('0x32')](),_0x31c351['originalname']));}})});router['post'](_0xdc84('0x14'),upload[_0xdc84('0x35')](_0xdc84('0x2f')),controller[_0xdc84('0x36')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x1a21a4,_0x5bb167,_0x38df93){_0x38df93(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x555dac,_0x341b5e,_0x19e799){_0x19e799(null,util['format'](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x341b5e[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x15'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x37')]);router[_0xdc84('0x23')](_0xdc84('0x38'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x219b44,_0x4d40f1,_0x33710f){const _0x74e6e6=path[_0xdc84('0x29')](config['root'],_0xdc84('0x39'),_0xdc84('0x3a'),_0xdc84('0x3b'));fs_extra[_0xdc84('0x3c')](_0x74e6e6,function(){_0x33710f(null,_0x74e6e6);});},'filename':function(_0x428aae,_0xdd78d9,_0x7aa21d){const _0x49c4d8=_0xdd78d9[_0xdc84('0x2e')][_0xdc84('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b94c1=path[_0xdc84('0x3e')](_0x49c4d8);const _0x4c244b=Date[_0xdc84('0x32')]()+'-'+_0x49c4d8['replace'](_0x5b94c1,'')+_0x5b94c1;_0x7aa21d(null,_0x4c244b);}})});router['post'](_0xdc84('0x3f'),offlineUploadMulter['any'](),controller[_0xdc84('0x40')]);router[_0xdc84('0x23')](_0xdc84('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xdc84('0x23')](_0xdc84('0x1a'),auth['isAuthenticated'](),controller[_0xdc84('0x41')]);router[_0xdc84('0x23')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller['addProactiveActions']);router[_0xdc84('0x23')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xdc84('0x9')](),controller['update']);router[_0xdc84('0x42')]('/:id',auth[_0xdc84('0x9')](),controller[_0xdc84('0x43')]);router[_0xdc84('0x42')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0x44')]);router[_0xdc84('0x42')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x45')]);router[_0xdc84('0x42')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c977426..f6874d5 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 _0x25fa=['Google','sequelize','STRING','ENUM'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x25fa,0x109));var _0xa25f=function(_0x50f6ab,_0x4a9425){_0x50f6ab=_0x50f6ab-0x0;var _0xfeeac=_0x25fa[_0x50f6ab];return _0xfeeac;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa25f('0x2')]('AmazonAWS',_0xa25f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa25f('0x1')]},'data2':{'type':Sequelize[_0xa25f('0x1')]}};
\ No newline at end of file
+var _0x038b=['exports','STRING','ENUM','Google'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x038b,0x114));var _0xb038=function(_0x32d626,_0x3e794b){_0x32d626=_0x32d626-0x0;var _0x5099b5=_0x038b[_0x32d626];return _0x5099b5;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb038('0x2')]('AmazonAWS',_0xb038('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb038('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index acc2cb7..60074f4 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x184dee,_0x398ee0){var _0x21303b=function(_0x1e5103){while(--_0x1e5103){_0x184dee['push'](_0x184dee['shift']());}};_0x21303b(++_0x398ee0);}(_0x2032,0xd9));var _0x2203=function(_0x37ec58,_0x3e5596){_0x37ec58=_0x37ec58-0x0;var _0x36240e=_0x2032[_0x37ec58];return _0x36240e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
+var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ac2ed,_0x60b800){_0x3ac2ed=_0x3ac2ed-0x0;var _0x56b758=_0x5f2f[_0x3ac2ed];return _0x56b758;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2ed1706..0a91bbb 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 _0x607c=['../../config/logger','api','moment','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x607c,0xe2));var _0xc607=function(_0x3b0b72,_0x2514bc){_0x3b0b72=_0x3b0b72-0x0;var _0x39bde6=_0x607c[_0x3b0b72];return _0x39bde6;};'use strict';var _=require(_0xc607('0x0'));var util=require(_0xc607('0x1'));var logger=require(_0xc607('0x2'))(_0xc607('0x3'));var moment=require(_0xc607('0x4'));var BPromise=require('bluebird');var rp=require(_0xc607('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc607('0x6'));var attributes=require(_0xc607('0x7'));module[_0xc607('0x8')]=function(_0x20df35,_0x4d395a){return _0x20df35[_0xc607('0x9')](_0xc607('0xa'),attributes,{'tableName':_0xc607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc17=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger','api','request-promise'];(function(_0x321283,_0x4aa366){var _0xf8a248=function(_0x234762){while(--_0x234762){_0x321283['push'](_0x321283['shift']());}};_0xf8a248(++_0x4aa366);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x35239e,_0x5463a1){_0x35239e=_0x35239e-0x0;var _0x265c79=_0xfc17[_0x35239e];return _0x265c79;};'use strict';var _=require(_0x7fc1('0x0'));var util=require('util');var logger=require(_0x7fc1('0x1'))(_0x7fc1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fc1('0x3'));var fs=require('fs');var path=require(_0x7fc1('0x4'));var rimraf=require(_0x7fc1('0x5'));var config=require(_0x7fc1('0x6'));var attributes=require(_0x7fc1('0x7'));module[_0x7fc1('0x8')]=function(_0x33c6d9,_0x17d8a3){return _0x33c6d9[_0x7fc1('0x9')](_0x7fc1('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 4ec623a..32284f0 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 _0x0137=['http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x0137,0x1d8));var _0x7013=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x0137[_0x2a390b];return _0x5df10a;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var moment=require(_0x7013('0x2'));var BPromise=require(_0x7013('0x3'));var rs=require(_0x7013('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7013('0x5'))['db'];var utils=require(_0x7013('0x6'));var logger=require(_0x7013('0x7'))(_0x7013('0x8'));var config=require(_0x7013('0x9'));var jayson=require(_0x7013('0xa'));var client=jayson['client'][_0x7013('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346a4d,_0x4e2460,_0x16c0c8){return new BPromise(function(_0x16dae3,_0x1b748c){return client['request'](_0x346a4d,_0x16c0c8)[_0x7013('0xc')](function(_0x551b8a){logger[_0x7013('0xd')](_0x7013('0xe'),_0x4e2460,'request\x20sent');logger[_0x7013('0xf')](_0x7013('0x10'),_0x4e2460,_0x7013('0x11'),JSON[_0x7013('0x12')](_0x551b8a));if(_0x551b8a[_0x7013('0x13')]){if(_0x551b8a[_0x7013('0x13')]['code']===0x1f4){logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x1b748c(_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);}logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x16dae3(_0x551b8a[_0x7013('0x13')]['message']);}else{logger['info'](_0x7013('0xe'),_0x4e2460,_0x7013('0x11'));_0x16dae3(_0x551b8a[_0x7013('0x15')][_0x7013('0x14')]);}})[_0x7013('0x16')](function(_0x48614e){logger['error'](_0x7013('0xe'),_0x4e2460,_0x48614e);_0x1b748c(_0x48614e);});});}
\ No newline at end of file
+var _0x13cc=['../../config/environment','client','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','CloudProvider,\x20%s,\x20%s','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x253141,_0x396c1e){var _0x4472f3=function(_0x28b591){while(--_0x28b591){_0x253141['push'](_0x253141['shift']());}};_0x4472f3(++_0x396c1e);}(_0x13cc,0x161));var _0xc13c=function(_0x2e7f71,_0xb8d20c){_0x2e7f71=_0x2e7f71-0x0;var _0x145b93=_0x13cc[_0x2e7f71];return _0x145b93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0b4,_0x41b41b,_0x4889d6){return new BPromise(function(_0x318eab,_0x3570f3){return client[_0xc13c('0x9')](_0x18b0b4,_0x4889d6)[_0xc13c('0xa')](function(_0x5ee2aa){logger['info']('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));logger[_0xc13c('0xc')](_0xc13c('0xd'),_0x41b41b,_0xc13c('0xb'),JSON[_0xc13c('0xe')](_0x5ee2aa));if(_0x5ee2aa['error']){if(_0x5ee2aa[_0xc13c('0xf')]['code']===0x1f4){logger[_0xc13c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0x5ee2aa['error'][_0xc13c('0x10')]);return _0x3570f3(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);return _0x318eab(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}else{logger[_0xc13c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));_0x318eab(_0x5ee2aa[_0xc13c('0x13')][_0xc13c('0x10')]);}})['catch'](function(_0x93cb3b){logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x93cb3b);_0x3570f3(_0x93cb3b);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 84d3c65..200ecb6 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 _0xb1fa=['./cloudProvider.controller','get','isAuthenticated','show','/:id','update','delete','destroy','path','express'];(function(_0x45a793,_0x2a1e72){var _0x2a2c61=function(_0x5d46a0){while(--_0x5d46a0){_0x45a793['push'](_0x45a793['shift']());}};_0x2a2c61(++_0x2a1e72);}(_0xb1fa,0x9e));var _0xab1f=function(_0x36d921,_0x4f802f){_0x36d921=_0x36d921-0x0;var _0x48d9a3=_0xb1fa[_0x36d921];return _0x48d9a3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab1f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab1f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab1f('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab1f('0x3')]('/:id',auth[_0xab1f('0x4')](),controller[_0xab1f('0x5')]);router['post']('/',auth[_0xab1f('0x4')](),controller['create']);router['put'](_0xab1f('0x6'),auth[_0xab1f('0x4')](),controller[_0xab1f('0x7')]);router[_0xab1f('0x8')](_0xab1f('0x6'),auth['isAuthenticated'](),controller[_0xab1f('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xfa2c=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa2c,0xda));var _0xcfa2=function(_0x2c8bee,_0xbdef90){_0x2c8bee=_0x2c8bee-0x0;var _0xd6335e=_0xfa2c[_0x2c8bee];return _0xd6335e;};'use strict';var multer=require(_0xcfa2('0x0'));var util=require(_0xcfa2('0x1'));var path=require(_0xcfa2('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfa2('0x3'));var router=express[_0xcfa2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcfa2('0x5'));var config=require(_0xcfa2('0x6'));var controller=require(_0xcfa2('0x7'));router[_0xcfa2('0x8')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xa')]);router[_0xcfa2('0x8')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xc')]);router[_0xcfa2('0xd')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xe')]);router[_0xcfa2('0xf')](_0xcfa2('0xb'),auth['isAuthenticated'](),controller[_0xcfa2('0x10')]);router[_0xcfa2('0x11')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller['destroy']);module[_0xcfa2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 94cdc99..4c5c5a8 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 _0xd798=['sequelize','exports','name','STRING'];(function(_0x34f46d,_0x1d6712){var _0x3a2d9e=function(_0x13eaec){while(--_0x13eaec){_0x34f46d['push'](_0x34f46d['shift']());}};_0x3a2d9e(++_0x1d6712);}(_0xd798,0x78));var _0x8d79=function(_0x47d171,_0x462d9b){_0x47d171=_0x47d171-0x0;var _0x110676=_0xd798[_0x47d171];return _0x110676;};'use strict';var Sequelize=require(_0x8d79('0x0'));module[_0x8d79('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8d79('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8d79('0x3')]},'companyId':{'type':Sequelize[_0x8d79('0x3')]},'website':{'type':Sequelize[_0x8d79('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8d79('0x3')]},'type':{'type':Sequelize[_0x8d79('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8d79('0x3')]},'city':{'type':Sequelize[_0x8d79('0x3')]},'country':{'type':Sequelize[_0x8d79('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8d79('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x8d79('0x3')]},'sCountry':{'type':Sequelize[_0x8d79('0x3')]},'description':{'type':Sequelize[_0x8d79('0x3')]}};
\ No newline at end of file
+var _0x43ce=['exports','STRING','name','sequelize'];(function(_0x5eb584,_0x8fbc2d){var _0x5f4a0f=function(_0x565a1d){while(--_0x565a1d){_0x5eb584['push'](_0x5eb584['shift']());}};_0x5f4a0f(++_0x8fbc2d);}(_0x43ce,0x14b));var _0xe43c=function(_0x31f2be,_0xf21d6b){_0x31f2be=_0x31f2be-0x0;var _0x1ccae0=_0x43ce[_0x31f2be];return _0x1ccae0;};'use strict';var Sequelize=require(_0xe43c('0x0'));module[_0xe43c('0x1')]={'name':{'type':Sequelize[_0xe43c('0x2')],'unique':_0xe43c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe43c('0x2')]},'companyId':{'type':Sequelize[_0xe43c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe43c('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe43c('0x2')]},'postalCode':{'type':Sequelize[_0xe43c('0x2')]},'city':{'type':Sequelize[_0xe43c('0x2')]},'country':{'type':Sequelize[_0xe43c('0x2')]},'email':{'type':Sequelize[_0xe43c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe43c('0x2')]},'sStreet':{'type':Sequelize[_0xe43c('0x2')]},'sPostalCode':{'type':Sequelize[_0xe43c('0x2')]},'sCity':{'type':Sequelize[_0xe43c('0x2')]},'sCountry':{'type':Sequelize[_0xe43c('0x2')]},'description':{'type':Sequelize[_0xe43c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b9e8b5d..95276ee 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 _0xb713=['../../config/logger','api','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','status','error','stack','name','send','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xb713,0x14b));var _0x3b71=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xb713[_0x344a3f];return _0x264712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b71('0x0'));var zipdir=require(_0x3b71('0x1'));var jsonpatch=require(_0x3b71('0x2'));var rp=require(_0x3b71('0x3'));var moment=require('moment');var BPromise=require(_0x3b71('0x4'));var Mustache=require(_0x3b71('0x5'));var util=require(_0x3b71('0x6'));var path=require(_0x3b71('0x7'));var sox=require(_0x3b71('0x8'));var csv=require(_0x3b71('0x9'));var ejs=require(_0x3b71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b71('0xb'));var squel=require(_0x3b71('0xc'));var crypto=require('crypto');var jsforce=require(_0x3b71('0xd'));var deskjs=require(_0x3b71('0xe'));var toCsv=require(_0x3b71('0x9'));var querystring=require(_0x3b71('0xf'));var Papa=require(_0x3b71('0x10'));var Redis=require(_0x3b71('0x11'));var authService=require(_0x3b71('0x12'));var qs=require(_0x3b71('0x13'));var as=require(_0x3b71('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b71('0x15'))(_0x3b71('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b71('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f39f2,_0x1f860f){_0x1f860f=_0x1f860f||0xcc;return function(_0x3e3124){if(_0x3e3124){return _0x1f39f2[_0x3b71('0x18')](_0x1f860f);}return _0x1f39f2['status'](_0x1f860f)[_0x3b71('0x19')]();};}function respondWithResult(_0x568af5,_0x29e860){_0x29e860=_0x29e860||0xc8;return function(_0x40f834){if(_0x40f834){return _0x568af5['status'](_0x29e860)[_0x3b71('0x1a')](_0x40f834);}};}function respondWithFilteredResult(_0x22ac5a,_0x17c56d){return function(_0x374b66){if(_0x374b66){var _0x1a90c3=typeof _0x17c56d[_0x3b71('0x1b')]===_0x3b71('0x1c')&&typeof _0x17c56d[_0x3b71('0x1d')]===_0x3b71('0x1c');var _0x341a3e=_0x374b66[_0x3b71('0x1e')];var _0x4a0265=_0x1a90c3?0x0:_0x17c56d[_0x3b71('0x1b')];var _0x401d9f=_0x1a90c3?_0x374b66['count']:_0x17c56d[_0x3b71('0x1b')]+_0x17c56d[_0x3b71('0x1d')];var _0x1f9a52;if(_0x401d9f>=_0x341a3e){_0x401d9f=_0x341a3e;_0x1f9a52=0xc8;}else{_0x1f9a52=0xce;}_0x22ac5a['status'](_0x1f9a52);return _0x22ac5a[_0x3b71('0x1f')](_0x3b71('0x20'),_0x4a0265+'-'+_0x401d9f+'/'+_0x341a3e)[_0x3b71('0x1a')](_0x374b66);}return null;};}function patchUpdates(_0x4c5d4d){return function(_0x17d08a){try{jsonpatch[_0x3b71('0x21')](_0x17d08a,_0x4c5d4d,!![]);}catch(_0x1a5d84){return BPromise[_0x3b71('0x22')](_0x1a5d84);}return _0x17d08a[_0x3b71('0x23')]();};}function saveUpdates(_0x47c88d,_0x39db72){return function(_0x529bb3){if(_0x529bb3){return _0x529bb3[_0x3b71('0x24')](_0x47c88d)[_0x3b71('0x25')](function(_0x16460f){return _0x16460f;});}return null;};}function removeEntity(_0x41be09,_0x30ad0e){return function(_0x11ee43){if(_0x11ee43){return _0x11ee43[_0x3b71('0x26')]()[_0x3b71('0x25')](function(){var _0x306865=_0x11ee43[_0x3b71('0x27')]({'plain':!![]});var _0x452166=_0x3b71('0x28');return db[_0x3b71('0x29')][_0x3b71('0x26')]({'where':{'type':_0x452166,'resourceId':_0x306865['id']}})[_0x3b71('0x25')](function(){return _0x11ee43;});})[_0x3b71('0x25')](function(){_0x41be09[_0x3b71('0x2a')](0xcc)[_0x3b71('0x19')]();});}};}function handleEntityNotFound(_0x5c06e9,_0x48daa4){return function(_0x5753ce){if(!_0x5753ce){_0x5c06e9[_0x3b71('0x18')](0x194);}return _0x5753ce;};}function handleError(_0x3bb594,_0x2ca11e){_0x2ca11e=_0x2ca11e||0x1f4;return function(_0x4f4ac0){logger[_0x3b71('0x2b')](_0x4f4ac0[_0x3b71('0x2c')]);if(_0x4f4ac0[_0x3b71('0x2d')]){delete _0x4f4ac0[_0x3b71('0x2d')];}_0x3bb594[_0x3b71('0x2a')](_0x2ca11e)[_0x3b71('0x2e')](_0x4f4ac0);};}exports['index']=function(_0x3e0ec1,_0x2ac28b){var _0x336d17={},_0x484aca={},_0x3e386f={'count':0x0,'rows':[]};return db[_0x3b71('0x2f')]['describe']()[_0x3b71('0x25')](function(_0x23243b){_0x484aca[_0x3b71('0x30')]=_[_0x3b71('0x31')](_0x23243b);_0x484aca[_0x3b71('0x32')]=_['keys'](_0x3e0ec1[_0x3b71('0x32')]);_0x484aca[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x484aca[_0x3b71('0x30')],_0x484aca[_0x3b71('0x32')]);_0x336d17[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x484aca[_0x3b71('0x30')],qs['fields'](_0x3e0ec1[_0x3b71('0x32')][_0x3b71('0x36')]));_0x336d17[_0x3b71('0x35')]=_0x336d17[_0x3b71('0x35')][_0x3b71('0x37')]?_0x336d17[_0x3b71('0x35')]:_0x484aca[_0x3b71('0x30')];if(!_0x3e0ec1['query'][_0x3b71('0x38')]('nolimit')){_0x336d17[_0x3b71('0x1d')]=qs['limit'](_0x3e0ec1['query'][_0x3b71('0x1d')]);_0x336d17[_0x3b71('0x1b')]=qs[_0x3b71('0x1b')](_0x3e0ec1[_0x3b71('0x32')]['offset']);}_0x336d17[_0x3b71('0x39')]=qs[_0x3b71('0x3a')](_0x3e0ec1[_0x3b71('0x32')]['sort']);_0x336d17[_0x3b71('0x3b')]=qs[_0x3b71('0x33')](_[_0x3b71('0x3c')](_0x3e0ec1[_0x3b71('0x32')],_0x484aca[_0x3b71('0x33')]),_0x23243b);if(_0x3e0ec1['query']['filter']){_0x336d17[_0x3b71('0x3b')]=_['merge'](_0x336d17[_0x3b71('0x3b')],{'$or':_['map'](_0x336d17[_0x3b71('0x35')],function(_0x1ca407){var _0x481f21={};_0x481f21[_0x1ca407]={'$like':'%'+_0x3e0ec1[_0x3b71('0x32')][_0x3b71('0x3d')]+'%'};return _0x481f21;})});}_0x336d17=_[_0x3b71('0x3e')]({},_0x336d17,_0x3e0ec1[_0x3b71('0x3f')]);var _0x21d3eb={'where':_0x336d17[_0x3b71('0x3b')]};return db[_0x3b71('0x2f')][_0x3b71('0x1e')](_0x21d3eb)[_0x3b71('0x25')](function(_0x187871){_0x3e386f[_0x3b71('0x1e')]=_0x187871;if(_0x3e0ec1['query']['includeAll']){_0x336d17['include']=[{'all':!![]}];}return db[_0x3b71('0x2f')][_0x3b71('0x40')](_0x336d17);})[_0x3b71('0x25')](function(_0x3fce58){_0x3e386f[_0x3b71('0x41')]=_0x3fce58;return _0x3e386f;})[_0x3b71('0x25')](respondWithFilteredResult(_0x2ac28b,_0x336d17))[_0x3b71('0x42')](handleError(_0x2ac28b,null));})[_0x3b71('0x42')](handleError(_0x2ac28b,null));};exports[_0x3b71('0x43')]=function(_0x141a07,_0x1dda01){var _0x568069={'raw':![],'where':{'id':_0x141a07['params']['id']}},_0x696bc7={};_0x696bc7[_0x3b71('0x30')]=_[_0x3b71('0x31')](db[_0x3b71('0x2f')][_0x3b71('0x44')]);_0x696bc7[_0x3b71('0x32')]=_[_0x3b71('0x31')](_0x141a07[_0x3b71('0x32')]);_0x696bc7[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x696bc7[_0x3b71('0x30')],_0x696bc7['query']);_0x568069[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x696bc7[_0x3b71('0x30')],qs[_0x3b71('0x36')](_0x141a07['query']['fields']));_0x568069[_0x3b71('0x35')]=_0x568069[_0x3b71('0x35')][_0x3b71('0x37')]?_0x568069['attributes']:_0x696bc7['model'];if(_0x141a07[_0x3b71('0x32')][_0x3b71('0x45')]){_0x568069[_0x3b71('0x46')]=[{'all':!![]}];}_0x568069=_[_0x3b71('0x3e')]({},_0x568069,_0x141a07[_0x3b71('0x3f')]);return db[_0x3b71('0x2f')][_0x3b71('0x47')](_0x568069)[_0x3b71('0x25')](handleEntityNotFound(_0x1dda01,null))[_0x3b71('0x25')](respondWithResult(_0x1dda01,null))[_0x3b71('0x42')](handleError(_0x1dda01,null));};exports['create']=function(_0x57fdd5,_0x5abe08){return db['CmCompany'][_0x3b71('0x48')](_0x57fdd5[_0x3b71('0x49')],{})[_0x3b71('0x25')](function(_0x1377e9){var _0x34946d=_0x57fdd5[_0x3b71('0x4a')][_0x3b71('0x27')]({'plain':!![]});if(!_0x34946d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34946d[_0x3b71('0x4b')]==='user'){var _0x89c719=_0x1377e9[_0x3b71('0x27')]({'plain':!![]});var _0x563255=_0x3b71('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x563255,'userProfileId':_0x34946d[_0x3b71('0x4c')]},'raw':!![]})[_0x3b71('0x25')](function(_0x502972){if(_0x502972&&_0x502972[_0x3b71('0x4d')]===0x0){return db[_0x3b71('0x29')][_0x3b71('0x48')]({'name':_0x89c719[_0x3b71('0x2d')],'resourceId':_0x89c719['id'],'type':_0x502972[_0x3b71('0x2d')],'sectionId':_0x502972['id']},{})[_0x3b71('0x25')](function(){return _0x1377e9;});}else{return _0x1377e9;}})[_0x3b71('0x42')](function(_0x2c543a){logger[_0x3b71('0x2b')](_0x3b71('0x4e'),_0x2c543a);throw _0x2c543a;});}return _0x1377e9;})[_0x3b71('0x25')](respondWithResult(_0x5abe08,0xc9))[_0x3b71('0x42')](handleError(_0x5abe08,null));};exports[_0x3b71('0x24')]=function(_0x595475,_0x5751da){if(_0x595475['body']['id']){delete _0x595475[_0x3b71('0x49')]['id'];}return db[_0x3b71('0x2f')]['find']({'where':{'id':_0x595475[_0x3b71('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5751da,null))[_0x3b71('0x25')](saveUpdates(_0x595475[_0x3b71('0x49')],null))['then'](respondWithResult(_0x5751da,null))[_0x3b71('0x42')](handleError(_0x5751da,null));};exports[_0x3b71('0x26')]=function(_0x1eb732,_0x55b9c6){return db['CmCompany'][_0x3b71('0x47')]({'where':{'id':_0x1eb732[_0x3b71('0x4f')]['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x55b9c6,null))[_0x3b71('0x25')](removeEntity(_0x55b9c6,null))[_0x3b71('0x42')](handleError(_0x55b9c6,null));};exports['describe']=function(_0x58f2c4,_0x210c74){return db[_0x3b71('0x2f')][_0x3b71('0x50')]()[_0x3b71('0x25')](respondWithResult(_0x210c74,null))[_0x3b71('0x42')](handleError(_0x210c74,null));};exports[_0x3b71('0x51')]=function(_0x8194fe,_0x27c157,_0x275e91){return db[_0x3b71('0x52')][_0x3b71('0x47')]({'where':{'id':_0x8194fe[_0x3b71('0x4f')]['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x27c157,null))['then'](function(_0x347f46){if(_0x347f46){return _0x347f46[_0x3b71('0x51')](_0x8194fe['body'][_0x3b71('0x53')],_[_0x3b71('0x54')](_0x8194fe['body'],[_0x3b71('0x53'),'id'])||{});}})[_0x3b71('0x25')](respondWithResult(_0x27c157,null))['catch'](handleError(_0x27c157,null));};exports[_0x3b71('0x55')]=function(_0x590867,_0x10ca73,_0x236b29){var _0x52a188={};var _0x240b24={};var _0x254a93;var _0x3a0c1d;return db[_0x3b71('0x2f')][_0x3b71('0x56')]({'where':{'id':_0x590867['params']['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x10ca73,null))[_0x3b71('0x25')](function(_0x476892){if(_0x476892){_0x254a93=_0x476892;_0x240b24[_0x3b71('0x30')]=_['keys'](db[_0x3b71('0x52')][_0x3b71('0x44')]);_0x240b24[_0x3b71('0x32')]=_[_0x3b71('0x31')](_0x590867[_0x3b71('0x32')]);_0x240b24[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x240b24[_0x3b71('0x30')],_0x240b24['query']);_0x52a188[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x240b24[_0x3b71('0x30')],qs[_0x3b71('0x36')](_0x590867[_0x3b71('0x32')]['fields']));_0x52a188['attributes']=_0x52a188['attributes']['length']?_0x52a188['attributes']:_0x240b24[_0x3b71('0x30')];_0x52a188[_0x3b71('0x39')]=qs[_0x3b71('0x3a')](_0x590867[_0x3b71('0x32')][_0x3b71('0x3a')]);_0x52a188['where']=qs['filters'](_['pick'](_0x590867[_0x3b71('0x32')],_0x240b24[_0x3b71('0x33')]));if(_0x590867[_0x3b71('0x32')][_0x3b71('0x3d')]){_0x52a188[_0x3b71('0x3b')]=_[_0x3b71('0x3e')](_0x52a188[_0x3b71('0x3b')],{'$or':_['map'](_0x52a188[_0x3b71('0x35')],function(_0x4fbedb){var _0x122bba={};_0x122bba[_0x4fbedb]={'$like':'%'+_0x590867[_0x3b71('0x32')][_0x3b71('0x3d')]+'%'};return _0x122bba;})});}_0x52a188=_[_0x3b71('0x3e')]({},_0x52a188,_0x590867[_0x3b71('0x3f')]);return _0x254a93[_0x3b71('0x55')](_0x52a188);}})[_0x3b71('0x25')](function(_0x1395be){if(_0x1395be){_0x3a0c1d=_0x1395be[_0x3b71('0x37')];if(!_0x590867[_0x3b71('0x32')][_0x3b71('0x38')](_0x3b71('0x57'))){_0x52a188[_0x3b71('0x1d')]=qs[_0x3b71('0x1d')](_0x590867['query']['limit']);_0x52a188[_0x3b71('0x1b')]=qs['offset'](_0x590867['query']['offset']);}return _0x254a93['getContacts'](_0x52a188);}})['then'](function(_0x5852c0){if(_0x5852c0){return _0x5852c0?{'count':_0x3a0c1d,'rows':_0x5852c0}:null;}})[_0x3b71('0x25')](respondWithResult(_0x10ca73,null))[_0x3b71('0x42')](handleError(_0x10ca73,null));};
\ No newline at end of file
+var _0x756a=['order','sort','where','filter','merge','map','options','CmCompany','includeAll','include','rows','catch','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','addContacts','CmContact','ids','omit','getContacts','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x26f954,_0x406ad6){var _0x5360f7=function(_0x78abd9){while(--_0x78abd9){_0x26f954['push'](_0x26f954['shift']());}};_0x5360f7(++_0x406ad6);}(_0x756a,0x1c0));var _0xa756=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x756a[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xa756('0x0'));var rimraf=require(_0xa756('0x1'));var zipdir=require(_0xa756('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require(_0xa756('0x5'));var Mustache=require(_0xa756('0x6'));var util=require(_0xa756('0x7'));var path=require(_0xa756('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa756('0x9'));var fs=require('fs');var fs_extra=require(_0xa756('0xa'));var _=require(_0xa756('0xb'));var squel=require(_0xa756('0xc'));var crypto=require(_0xa756('0xd'));var jsforce=require(_0xa756('0xe'));var deskjs=require(_0xa756('0xf'));var toCsv=require(_0xa756('0x10'));var querystring=require(_0xa756('0x11'));var Papa=require('papaparse');var Redis=require(_0xa756('0x12'));var authService=require(_0xa756('0x13'));var qs=require(_0xa756('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa756('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa756('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa756('0x17'))['db'];function respondWithStatusCode(_0x32e650,_0x13cbea){_0x13cbea=_0x13cbea||0xcc;return function(_0x80ce5e){if(_0x80ce5e){return _0x32e650[_0xa756('0x18')](_0x13cbea);}return _0x32e650[_0xa756('0x19')](_0x13cbea)['end']();};}function respondWithResult(_0x2d1190,_0x36d3ae){_0x36d3ae=_0x36d3ae||0xc8;return function(_0x15aabf){if(_0x15aabf){return _0x2d1190[_0xa756('0x19')](_0x36d3ae)['json'](_0x15aabf);}};}function respondWithFilteredResult(_0x2e8631,_0x1a590b){return function(_0x341c3f){if(_0x341c3f){var _0x5e4bf8=typeof _0x1a590b[_0xa756('0x1a')]===_0xa756('0x1b')&&typeof _0x1a590b['limit']===_0xa756('0x1b');var _0x50492f=_0x341c3f[_0xa756('0x1c')];var _0x5421e4=_0x5e4bf8?0x0:_0x1a590b[_0xa756('0x1a')];var _0x4340d3=_0x5e4bf8?_0x341c3f[_0xa756('0x1c')]:_0x1a590b[_0xa756('0x1a')]+_0x1a590b[_0xa756('0x1d')];var _0x795302;if(_0x4340d3>=_0x50492f){_0x4340d3=_0x50492f;_0x795302=0xc8;}else{_0x795302=0xce;}_0x2e8631[_0xa756('0x19')](_0x795302);return _0x2e8631['set'](_0xa756('0x1e'),_0x5421e4+'-'+_0x4340d3+'/'+_0x50492f)[_0xa756('0x1f')](_0x341c3f);}return null;};}function patchUpdates(_0x3098b3){return function(_0x186c80){try{jsonpatch[_0xa756('0x20')](_0x186c80,_0x3098b3,!![]);}catch(_0x443230){return BPromise['reject'](_0x443230);}return _0x186c80[_0xa756('0x21')]();};}function saveUpdates(_0x184af5,_0x107142){return function(_0x5d31d6){if(_0x5d31d6){return _0x5d31d6[_0xa756('0x22')](_0x184af5)[_0xa756('0x23')](function(_0xa4522c){return _0xa4522c;});}return null;};}function removeEntity(_0x471ddc,_0x3dd77d){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0xa756('0x24')]()['then'](function(){var _0x61a0ab=_0x3c1694[_0xa756('0x25')]({'plain':!![]});var _0x30fd83=_0xa756('0x26');return db[_0xa756('0x27')][_0xa756('0x24')]({'where':{'type':_0x30fd83,'resourceId':_0x61a0ab['id']}})[_0xa756('0x23')](function(){return _0x3c1694;});})['then'](function(){_0x471ddc[_0xa756('0x19')](0xcc)[_0xa756('0x28')]();});}};}function handleEntityNotFound(_0x460de6,_0x43865d){return function(_0x410449){if(!_0x410449){_0x460de6[_0xa756('0x18')](0x194);}return _0x410449;};}function handleError(_0x38fd5e,_0x38c903){_0x38c903=_0x38c903||0x1f4;return function(_0x234778){logger['error'](_0x234778[_0xa756('0x29')]);if(_0x234778[_0xa756('0x2a')]){delete _0x234778[_0xa756('0x2a')];}_0x38fd5e[_0xa756('0x19')](_0x38c903)[_0xa756('0x2b')](_0x234778);};}exports[_0xa756('0x2c')]=function(_0x22d8b7,_0x1603fc){var _0x1d98ba={},_0x4a3371={},_0x2edfcf={'count':0x0,'rows':[]};return db['CmCompany'][_0xa756('0x2d')]()['then'](function(_0x528334){_0x4a3371[_0xa756('0x2e')]=_[_0xa756('0x2f')](_0x528334);_0x4a3371[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x22d8b7[_0xa756('0x30')]);_0x4a3371[_0xa756('0x31')]=_[_0xa756('0x32')](_0x4a3371['model'],_0x4a3371[_0xa756('0x30')]);_0x1d98ba[_0xa756('0x33')]=_[_0xa756('0x32')](_0x4a3371[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x22d8b7['query'][_0xa756('0x34')]));_0x1d98ba[_0xa756('0x33')]=_0x1d98ba[_0xa756('0x33')][_0xa756('0x35')]?_0x1d98ba[_0xa756('0x33')]:_0x4a3371[_0xa756('0x2e')];if(!_0x22d8b7['query'][_0xa756('0x36')](_0xa756('0x37'))){_0x1d98ba[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1d')]);_0x1d98ba[_0xa756('0x1a')]=qs['offset'](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1a')]);}_0x1d98ba[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x22d8b7['query']['sort']);_0x1d98ba[_0xa756('0x3a')]=qs[_0xa756('0x31')](_['pick'](_0x22d8b7[_0xa756('0x30')],_0x4a3371[_0xa756('0x31')]),_0x528334);if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x3b')]){_0x1d98ba[_0xa756('0x3a')]=_[_0xa756('0x3c')](_0x1d98ba['where'],{'$or':_[_0xa756('0x3d')](_0x1d98ba[_0xa756('0x33')],function(_0x57a07b){var _0x118834={};_0x118834[_0x57a07b]={'$like':'%'+_0x22d8b7['query']['filter']+'%'};return _0x118834;})});}_0x1d98ba=_['merge']({},_0x1d98ba,_0x22d8b7[_0xa756('0x3e')]);var _0xb89578={'where':_0x1d98ba[_0xa756('0x3a')]};return db[_0xa756('0x3f')][_0xa756('0x1c')](_0xb89578)[_0xa756('0x23')](function(_0x518f83){_0x2edfcf[_0xa756('0x1c')]=_0x518f83;if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x40')]){_0x1d98ba[_0xa756('0x41')]=[{'all':!![]}];}return db[_0xa756('0x3f')]['findAll'](_0x1d98ba);})[_0xa756('0x23')](function(_0x36f31f){_0x2edfcf[_0xa756('0x42')]=_0x36f31f;return _0x2edfcf;})['then'](respondWithFilteredResult(_0x1603fc,_0x1d98ba))[_0xa756('0x43')](handleError(_0x1603fc,null));})[_0xa756('0x43')](handleError(_0x1603fc,null));};exports['show']=function(_0x2dee7a,_0x10558f){var _0x1e5028={'raw':![],'where':{'id':_0x2dee7a[_0xa756('0x44')]['id']}},_0x15ed13={};_0x15ed13[_0xa756('0x2e')]=_[_0xa756('0x2f')](db['CmCompany'][_0xa756('0x45')]);_0x15ed13[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x2dee7a[_0xa756('0x30')]);_0x15ed13[_0xa756('0x31')]=_['intersection'](_0x15ed13[_0xa756('0x2e')],_0x15ed13['query']);_0x1e5028[_0xa756('0x33')]=_['intersection'](_0x15ed13['model'],qs[_0xa756('0x34')](_0x2dee7a[_0xa756('0x30')]['fields']));_0x1e5028[_0xa756('0x33')]=_0x1e5028[_0xa756('0x33')][_0xa756('0x35')]?_0x1e5028[_0xa756('0x33')]:_0x15ed13[_0xa756('0x2e')];if(_0x2dee7a[_0xa756('0x30')][_0xa756('0x40')]){_0x1e5028['include']=[{'all':!![]}];}_0x1e5028=_[_0xa756('0x3c')]({},_0x1e5028,_0x2dee7a['options']);return db[_0xa756('0x3f')][_0xa756('0x46')](_0x1e5028)['then'](handleEntityNotFound(_0x10558f,null))[_0xa756('0x23')](respondWithResult(_0x10558f,null))[_0xa756('0x43')](handleError(_0x10558f,null));};exports['create']=function(_0x4cede4,_0x224b3d){return db[_0xa756('0x3f')]['create'](_0x4cede4[_0xa756('0x47')],{})[_0xa756('0x23')](function(_0x22f3f6){var _0xf3ac50=_0x4cede4[_0xa756('0x48')][_0xa756('0x25')]({'plain':!![]});if(!_0xf3ac50)throw new Error(_0xa756('0x49'));if(_0xf3ac50[_0xa756('0x4a')]===_0xa756('0x48')){var _0x5794c4=_0x22f3f6[_0xa756('0x25')]({'plain':!![]});var _0x5dc8f4=_0xa756('0x26');return db[_0xa756('0x4b')]['find']({'where':{'name':_0x5dc8f4,'userProfileId':_0xf3ac50['userProfileId']},'raw':!![]})[_0xa756('0x23')](function(_0xe107ae){if(_0xe107ae&&_0xe107ae[_0xa756('0x4c')]===0x0){return db['UserProfileResource'][_0xa756('0x4d')]({'name':_0x5794c4[_0xa756('0x2a')],'resourceId':_0x5794c4['id'],'type':_0xe107ae[_0xa756('0x2a')],'sectionId':_0xe107ae['id']},{})[_0xa756('0x23')](function(){return _0x22f3f6;});}else{return _0x22f3f6;}})[_0xa756('0x43')](function(_0x496afd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496afd);throw _0x496afd;});}return _0x22f3f6;})[_0xa756('0x23')](respondWithResult(_0x224b3d,0xc9))[_0xa756('0x43')](handleError(_0x224b3d,null));};exports['update']=function(_0x1bd498,_0x5e38b7){if(_0x1bd498[_0xa756('0x47')]['id']){delete _0x1bd498['body']['id'];}return db['CmCompany'][_0xa756('0x46')]({'where':{'id':_0x1bd498[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e38b7,null))[_0xa756('0x23')](saveUpdates(_0x1bd498[_0xa756('0x47')],null))[_0xa756('0x23')](respondWithResult(_0x5e38b7,null))[_0xa756('0x43')](handleError(_0x5e38b7,null));};exports[_0xa756('0x24')]=function(_0x5ce106,_0x4a8558){return db[_0xa756('0x3f')][_0xa756('0x46')]({'where':{'id':_0x5ce106[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a8558,null))[_0xa756('0x23')](removeEntity(_0x4a8558,null))[_0xa756('0x43')](handleError(_0x4a8558,null));};exports['describe']=function(_0x66a5c3,_0x325875){return db[_0xa756('0x3f')][_0xa756('0x2d')]()[_0xa756('0x23')](respondWithResult(_0x325875,null))[_0xa756('0x43')](handleError(_0x325875,null));};exports[_0xa756('0x4e')]=function(_0x40b149,_0x57c090,_0x2b750c){return db[_0xa756('0x4f')][_0xa756('0x46')]({'where':{'id':_0x40b149[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x57c090,null))[_0xa756('0x23')](function(_0x494dad){if(_0x494dad){return _0x494dad[_0xa756('0x4e')](_0x40b149[_0xa756('0x47')][_0xa756('0x50')],_[_0xa756('0x51')](_0x40b149[_0xa756('0x47')],[_0xa756('0x50'),'id'])||{});}})[_0xa756('0x23')](respondWithResult(_0x57c090,null))[_0xa756('0x43')](handleError(_0x57c090,null));};exports[_0xa756('0x52')]=function(_0x3180f4,_0x29e7e9,_0x4064da){var _0x510194={};var _0x243464={};var _0x3cdc33;var _0x8602a8;return db['CmCompany']['findOne']({'where':{'id':_0x3180f4[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x29e7e9,null))[_0xa756('0x23')](function(_0x467be7){if(_0x467be7){_0x3cdc33=_0x467be7;_0x243464[_0xa756('0x2e')]=_[_0xa756('0x2f')](db[_0xa756('0x4f')][_0xa756('0x45')]);_0x243464['query']=_[_0xa756('0x2f')](_0x3180f4['query']);_0x243464[_0xa756('0x31')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],_0x243464[_0xa756('0x30')]);_0x510194[_0xa756('0x33')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x3180f4['query'][_0xa756('0x34')]));_0x510194['attributes']=_0x510194['attributes'][_0xa756('0x35')]?_0x510194[_0xa756('0x33')]:_0x243464['model'];_0x510194[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x3180f4['query'][_0xa756('0x39')]);_0x510194[_0xa756('0x3a')]=qs[_0xa756('0x31')](_[_0xa756('0x53')](_0x3180f4[_0xa756('0x30')],_0x243464[_0xa756('0x31')]));if(_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]){_0x510194['where']=_['merge'](_0x510194[_0xa756('0x3a')],{'$or':_[_0xa756('0x3d')](_0x510194[_0xa756('0x33')],function(_0x25825c){var _0x120ca6={};_0x120ca6[_0x25825c]={'$like':'%'+_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]+'%'};return _0x120ca6;})});}_0x510194=_[_0xa756('0x3c')]({},_0x510194,_0x3180f4[_0xa756('0x3e')]);return _0x3cdc33['getContacts'](_0x510194);}})[_0xa756('0x23')](function(_0x470b34){if(_0x470b34){_0x8602a8=_0x470b34[_0xa756('0x35')];if(!_0x3180f4[_0xa756('0x30')][_0xa756('0x36')](_0xa756('0x37'))){_0x510194[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x3180f4[_0xa756('0x30')]['limit']);_0x510194[_0xa756('0x1a')]=qs['offset'](_0x3180f4[_0xa756('0x30')]['offset']);}return _0x3cdc33[_0xa756('0x52')](_0x510194);}})[_0xa756('0x23')](function(_0x47ad9b){if(_0x47ad9b){return _0x47ad9b?{'count':_0x8602a8,'rows':_0x47ad9b}:null;}})[_0xa756('0x23')](respondWithResult(_0x29e7e9,null))[_0xa756('0x43')](handleError(_0x29e7e9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d76810a..d172d69 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 _0x196a=['request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','moment','bluebird'];(function(_0x3e0722,_0x4826d9){var _0x49a6b5=function(_0x48dc5b){while(--_0x48dc5b){_0x3e0722['push'](_0x3e0722['shift']());}};_0x49a6b5(++_0x4826d9);}(_0x196a,0x93));var _0xa196=function(_0x2a139e,_0xa5e346){_0x2a139e=_0x2a139e-0x0;var _0x242052=_0x196a[_0x2a139e];return _0x242052;};'use strict';var _=require(_0xa196('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa196('0x1'));var BPromise=require(_0xa196('0x2'));var rp=require(_0xa196('0x3'));var fs=require('fs');var path=require(_0xa196('0x4'));var rimraf=require('rimraf');var config=require(_0xa196('0x5'));var attributes=require(_0xa196('0x6'));module['exports']=function(_0x1a1864,_0x21fdb1){return _0x1a1864[_0xa196('0x7')](_0xa196('0x8'),attributes,{'tableName':_0xa196('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d59=['moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x588fa9,_0x39e9b3){var _0x2fc217=function(_0x123ca3){while(--_0x123ca3){_0x588fa9['push'](_0x588fa9['shift']());}};_0x2fc217(++_0x39e9b3);}(_0x7d59,0xce));var _0x97d5=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x7d59[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x97d5('0x0'));var util=require(_0x97d5('0x1'));var logger=require(_0x97d5('0x2'))('api');var moment=require(_0x97d5('0x3'));var BPromise=require(_0x97d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97d5('0x5'));var config=require(_0x97d5('0x6'));var attributes=require(_0x97d5('0x7'));module['exports']=function(_0x7b392e,_0x1f5049){return _0x7b392e[_0x97d5('0x8')](_0x97d5('0x9'),attributes,{'tableName':_0x97d5('0xa'),'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 0002757..f85b207 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 _0xd318=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd318,0xe0));var _0x8d31=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd318[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8d31('0x0'));var util=require(_0x8d31('0x1'));var moment=require(_0x8d31('0x2'));var BPromise=require(_0x8d31('0x3'));var rs=require(_0x8d31('0x4'));var fs=require('fs');var Redis=require(_0x8d31('0x5'));var db=require(_0x8d31('0x6'))['db'];var utils=require(_0x8d31('0x7'));var logger=require(_0x8d31('0x8'))(_0x8d31('0x9'));var config=require(_0x8d31('0xa'));var jayson=require(_0x8d31('0xb'));var client=jayson[_0x8d31('0xc')][_0x8d31('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b5780,_0x92a3f0,_0x2a9edf){return new BPromise(function(_0x336624,_0x25c24a){return client[_0x8d31('0xe')](_0x4b5780,_0x2a9edf)[_0x8d31('0xf')](function(_0x2cc87a){logger[_0x8d31('0x10')](_0x8d31('0x11'),_0x92a3f0,_0x8d31('0x12'));logger[_0x8d31('0x13')](_0x8d31('0x14'),_0x92a3f0,_0x8d31('0x12'),JSON['stringify'](_0x2cc87a));if(_0x2cc87a[_0x8d31('0x15')]){if(_0x2cc87a[_0x8d31('0x15')]['code']===0x1f4){logger[_0x8d31('0x15')](_0x8d31('0x11'),_0x92a3f0,_0x2cc87a[_0x8d31('0x15')][_0x8d31('0x16')]);return _0x25c24a(_0x2cc87a['error']['message']);}logger[_0x8d31('0x15')](_0x8d31('0x11'),_0x92a3f0,_0x2cc87a['error'][_0x8d31('0x16')]);return _0x336624(_0x2cc87a[_0x8d31('0x15')]['message']);}else{logger[_0x8d31('0x10')](_0x8d31('0x11'),_0x92a3f0,'request\x20sent');_0x336624(_0x2cc87a['result'][_0x8d31('0x16')]);}})[_0x8d31('0x17')](function(_0x3d1533){logger['error'](_0x8d31('0x11'),_0x92a3f0,_0x3d1533);_0x25c24a(_0x3d1533);});});}
\ No newline at end of file
+var _0x33e7=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','request\x20sent'];(function(_0x537928,_0x4444f1){var _0x26c016=function(_0x4f7e95){while(--_0x4f7e95){_0x537928['push'](_0x537928['shift']());}};_0x26c016(++_0x4444f1);}(_0x33e7,0x1ac));var _0x733e=function(_0x142d65,_0x36cff7){_0x142d65=_0x142d65-0x0;var _0x4b3054=_0x33e7[_0x142d65];return _0x4b3054;};'use strict';var _=require(_0x733e('0x0'));var util=require(_0x733e('0x1'));var moment=require('moment');var BPromise=require(_0x733e('0x2'));var rs=require(_0x733e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x733e('0x4'))['db'];var utils=require(_0x733e('0x5'));var logger=require(_0x733e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x733e('0x7')][_0x733e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322cdf,_0x7159a4,_0x43df8d){return new BPromise(function(_0x221009,_0x848787){return client[_0x733e('0x9')](_0x322cdf,_0x43df8d)[_0x733e('0xa')](function(_0x5855c6){logger['info']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));logger['debug'](_0x733e('0xc'),_0x7159a4,_0x733e('0xb'),JSON[_0x733e('0xd')](_0x5855c6));if(_0x5855c6[_0x733e('0xe')]){if(_0x5855c6[_0x733e('0xe')][_0x733e('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x5855c6['error'][_0x733e('0x10')]);return _0x848787(_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);}logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);return _0x221009(_0x5855c6[_0x733e('0xe')]['message']);}else{logger[_0x733e('0x12')]('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));_0x221009(_0x5855c6['result']['message']);}})[_0x733e('0x13')](function(_0x564883){logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x564883);_0x848787(_0x564883);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 6ee7999..ad9c321 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 _0x6a80=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','getContacts','post','create','addContacts'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x6a80,0x1e7));var _0x06a8=function(_0x41571a,_0x53dd95){_0x41571a=_0x41571a-0x0;var _0x2b1fa4=_0x6a80[_0x41571a];return _0x2b1fa4;};'use strict';var multer=require(_0x06a8('0x0'));var util=require(_0x06a8('0x1'));var path=require('path');var timeout=require(_0x06a8('0x2'));var express=require(_0x06a8('0x3'));var router=express[_0x06a8('0x4')]();var fs_extra=require(_0x06a8('0x5'));var auth=require(_0x06a8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06a8('0x7'));router[_0x06a8('0x8')]('/',auth[_0x06a8('0x9')](),controller[_0x06a8('0xa')]);router['get']('/describe',auth[_0x06a8('0x9')](),controller[_0x06a8('0xb')]);router[_0x06a8('0x8')](_0x06a8('0xc'),auth[_0x06a8('0x9')](),controller['show']);router[_0x06a8('0x8')]('/:id/contacts',auth[_0x06a8('0x9')](),controller[_0x06a8('0xd')]);router[_0x06a8('0xe')]('/',auth[_0x06a8('0x9')](),controller[_0x06a8('0xf')]);router[_0x06a8('0xe')]('/:id/contacts',auth[_0x06a8('0x9')](),controller[_0x06a8('0x10')]);router[_0x06a8('0x11')](_0x06a8('0xc'),auth[_0x06a8('0x9')](),controller[_0x06a8('0x12')]);router[_0x06a8('0x13')]('/:id',auth[_0x06a8('0x9')](),controller['destroy']);module[_0x06a8('0x14')]=router;
\ No newline at end of file
+var _0x35cf=['getContacts','create','post','/:id/contacts','addContacts','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x35cf,0x118));var _0xf35c=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0x35cf[_0xb4e052];return _0x5197e7;};'use strict';var multer=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var path=require('path');var timeout=require(_0xf35c('0x2'));var express=require(_0xf35c('0x3'));var router=express[_0xf35c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf35c('0x5'));var interaction=require(_0xf35c('0x6'));var config=require(_0xf35c('0x7'));var controller=require(_0xf35c('0x8'));router[_0xf35c('0x9')]('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xb')]);router[_0xf35c('0x9')](_0xf35c('0xc'),auth[_0xf35c('0xa')](),controller['describe']);router['get']('/:id',auth[_0xf35c('0xa')](),controller[_0xf35c('0xd')]);router[_0xf35c('0x9')]('/:id/contacts',auth[_0xf35c('0xa')](),controller[_0xf35c('0xe')]);router['post']('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xf')]);router[_0xf35c('0x10')](_0xf35c('0x11'),auth['isAuthenticated'](),controller[_0xf35c('0x12')]);router['put'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['update']);router['delete'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['destroy']);module[_0xf35c('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c9a51f5..290ee1f 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 _0x1d61=['STRING','TEXT','INTEGER','DATE','NOW','lodash','exports'];(function(_0x5c7158,_0x40146f){var _0x526bc4=function(_0x58260f){while(--_0x58260f){_0x5c7158['push'](_0x5c7158['shift']());}};_0x526bc4(++_0x40146f);}(_0x1d61,0xd7));var _0x11d6=function(_0x555435,_0x30e908){_0x555435=_0x555435-0x0;var _0x3ac9c9=_0x1d61[_0x555435];return _0x3ac9c9;};'use strict';var _=require(_0x11d6('0x0'));var Sequelize=require('sequelize');module[_0x11d6('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x11d6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x11d6('0x2')]},'city':{'type':Sequelize[_0x11d6('0x2')]},'country':{'type':Sequelize[_0x11d6('0x2')]},'dateOfBirth':{'type':Sequelize[_0x11d6('0x2')]},'description':{'type':Sequelize[_0x11d6('0x3')]},'phone':{'type':Sequelize[_0x11d6('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x11d6('0x2')]},'email':{'type':Sequelize[_0x11d6('0x2')]},'url':{'type':Sequelize[_0x11d6('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x11d6('0x2')]},'twitter':{'type':Sequelize[_0x11d6('0x2')]},'skype':{'type':Sequelize[_0x11d6('0x2')]},'teams':{'type':Sequelize[_0x11d6('0x2')]},'viber':{'type':Sequelize[_0x11d6('0x2')]},'line':{'type':Sequelize[_0x11d6('0x2')]},'wechat':{'type':Sequelize[_0x11d6('0x2')]},'telegram':{'type':Sequelize[_0x11d6('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x11d6('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x11d6('0x5')],'defaultValue':Sequelize[_0x11d6('0x6')]}};
\ No newline at end of file
+var _0xce32=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports'];(function(_0x8c7dcc,_0x34b381){var _0x539b2d=function(_0x4960b9){while(--_0x4960b9){_0x8c7dcc['push'](_0x8c7dcc['shift']());}};_0x539b2d(++_0x34b381);}(_0xce32,0x17d));var _0x2ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ce3('0x0'));var Sequelize=require(_0x2ce3('0x1'));module[_0x2ce3('0x2')]={'firstName':{'type':Sequelize[_0x2ce3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2ce3('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2ce3('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ce3('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2ce3('0x3')]},'email':{'type':Sequelize[_0x2ce3('0x3')]},'url':{'type':Sequelize[_0x2ce3('0x3')]},'facebook':{'type':Sequelize[_0x2ce3('0x3')]},'fb_data':{'type':Sequelize[_0x2ce3('0x3')]},'twitter':{'type':Sequelize[_0x2ce3('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2ce3('0x3')]},'line':{'type':Sequelize[_0x2ce3('0x3')]},'wechat':{'type':Sequelize[_0x2ce3('0x3')]},'telegram':{'type':Sequelize[_0x2ce3('0x3')]},'UserId':{'type':Sequelize[_0x2ce3('0x5')]},'priority':{'type':Sequelize[_0x2ce3('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2ce3('0x6')],'defaultValue':Sequelize[_0x2ce3('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1d812a5..a038f2c 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 _0xda02=['cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','buildExpression','text','start','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','analytics','findAll','alias','custom','values','hasOwnProperty','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','isNil','$and','omit','format','cf_%d','pickBy','table','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','include','CmHopperHistory','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','child_process','fork','join','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','No\x20ListId\x20specified','binding','firstName','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','startCase','chat','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','openchannel','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','length','fieldType','type','query','filters','intersection','model','attributes','fields','nolimit','offset','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join'];(function(_0x46a616,_0x52e0df){var _0x50f3dd=function(_0x25606d){while(--_0x25606d){_0x46a616['push'](_0x46a616['shift']());}};_0x50f3dd(++_0x52e0df);}(_0xda02,0xdf));var _0x2da0=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xda02[_0x4dc7b9];return _0x3ab114;};'use strict';var moment=require(_0x2da0('0x0'));var BPromise=require(_0x2da0('0x1'));var util=require('util');var path=require(_0x2da0('0x2'));var fs=require('fs');var _=require(_0x2da0('0x3'));var squel=require('squel');var Papa=require(_0x2da0('0x4'));var Redis=require(_0x2da0('0x5'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x2da0('0x6'))(_0x2da0('0x7'));var config=require('../../config/environment');var db=require(_0x2da0('0x8'))['db'];config[_0x2da0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2da0('0xa'))(new Redis(config[_0x2da0('0x9')]));require(_0x2da0('0xb'))[_0x2da0('0xc')](socket);function respondWithResult(_0x136cf3,_0x465f99){_0x465f99=_0x465f99||0xc8;return function(_0x51bdc3){if(_0x51bdc3){return _0x136cf3[_0x2da0('0xd')](_0x465f99)['json'](_0x51bdc3);}};}function respondWithFilteredResult(_0x1677ce,_0x53cb0f){return function(_0x4dfe25){if(_0x4dfe25){var _0x75b37f=typeof _0x53cb0f['offset']===_0x2da0('0xe')&&typeof _0x53cb0f[_0x2da0('0xf')]===_0x2da0('0xe');var _0x3886d7=_0x4dfe25[_0x2da0('0x10')];var _0xe8b4c4=_0x75b37f?0x0:_0x53cb0f['offset'];var _0x402502=_0x75b37f?_0x4dfe25[_0x2da0('0x10')]:_0x53cb0f['offset']+_0x53cb0f[_0x2da0('0xf')];var _0x4aaed9;if(_0x402502>=_0x3886d7){_0x402502=_0x3886d7;_0x4aaed9=0xc8;}else{_0x4aaed9=0xce;}_0x1677ce['status'](_0x4aaed9);return _0x1677ce[_0x2da0('0x11')](_0x2da0('0x12'),_0xe8b4c4+'-'+_0x402502+'/'+_0x3886d7)[_0x2da0('0x13')](_0x4dfe25);}return null;};}function saveUpdates(_0xce0652){return function(_0x523ca2){if(_0x523ca2){return _0x523ca2['update'](_0xce0652)[_0x2da0('0x14')](function(_0x2973a4){return _0x2973a4;});}return null;};}function removeEntity(_0x5dabe2){return function(_0x41b112){if(_0x41b112){return _0x41b112[_0x2da0('0x15')]()[_0x2da0('0x14')](function(){_0x5dabe2['status'](0xcc)[_0x2da0('0x16')]();});}};}function handleEntityNotFound(_0x5b6366){return function(_0x477192){if(!_0x477192){_0x5b6366[_0x2da0('0x17')](0x194);}return _0x477192;};}function handleError(_0x474c7c,_0x330636){_0x330636=_0x330636||0x1f4;return function(_0x25a325){logger[_0x2da0('0x18')](_0x25a325[_0x2da0('0x19')]);if(_0x25a325[_0x2da0('0x1a')]){delete _0x25a325[_0x2da0('0x1a')];}_0x474c7c[_0x2da0('0xd')](_0x330636)[_0x2da0('0x1b')](_0x25a325);};}exports[_0x2da0('0x1c')]=function(_0x4c9f2e,_0x17e4db){var _0x2a8f72={},_0x492a24={},_0x1511b6={'count':0x0,'rows':[]};return db[_0x2da0('0x1d')][_0x2da0('0x1e')]()[_0x2da0('0x14')](function(_0x35815a){var _0xf1a751=[];for(var _0x46f5ea=0x0;_0x46f5ea
','gmail'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3a15,0xde));var _0x53a1=function(_0x4c5770,_0x48b574){_0x4c5770=_0x4c5770-0x0;var _0x303251=_0x3a15[_0x4c5770];return _0x303251;};'use strict';var _=require(_0x53a1('0x0'));var moment=require('moment');var random=require(_0x53a1('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x53a1('0x2'));var tnef=require(_0x53a1('0x3'));var logger=require(_0x53a1('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0x467848){var _0x479af7=_['head'](_0x467848['value']);return _0x479af7&&_0x479af7[_0x53a1('0x5')]?_0x479af7['address']:_0x53a1('0x6')+random[_0x53a1('0x7')](0x6)+_0x53a1('0x8');}function getFirstName(_0x5252d4){var _0xa6fa00=_[_0x53a1('0x9')](_0x5252d4['value']);if(_0xa6fa00&&_0xa6fa00['name']){if(_0xa6fa00['name']==_0xa6fa00[_0x53a1('0x5')]){return _0xa6fa00[_0x53a1('0xa')][_0x53a1('0xb')](0x0,_0xa6fa00[_0x53a1('0xa')]['indexOf']('@'));}var _0x499f17=_0xa6fa00['name'][_0x53a1('0xc')](/\s+/);return _0x499f17[_0x53a1('0xd')]>0x1?_0x499f17['slice'](0x0,-0x1)[_0x53a1('0xe')]('\x20'):_0xa6fa00[_0x53a1('0xa')];}return _0x53a1('0xf');}function getLastName(_0x4a14bc){var _0x192ec5=_[_0x53a1('0x9')](_0x4a14bc[_0x53a1('0x10')]);if(_0x192ec5&&_0x192ec5[_0x53a1('0xa')]){var _0x2dbca7=_0x192ec5[_0x53a1('0xa')][_0x53a1('0xc')](/\s+/);return _0x2dbca7[_0x53a1('0xd')]>0x1?_0x2dbca7[_0x53a1('0x11')]():'';}return'';}function getMails(_0x552306,_0x367f3e){var _0xd7a6a4='';for(var _0x1793e0=0x0;_0x1793e0<_0x367f3e[_0x53a1('0x10')][_0x53a1('0xd')];_0x1793e0+=0x1){if(_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]!==_0x552306){if(!_['isEmpty'](_0xd7a6a4)){_0xd7a6a4+=',';}_0xd7a6a4+=_0x367f3e[_0x53a1('0x10')][_0x1793e0]['name']||_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]||'';_0xd7a6a4+='\x20<';_0xd7a6a4+=_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]?_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]:'anonymous'+random[_0x53a1('0x7')](0x6)+_0x53a1('0x8');_0xd7a6a4+='>';}}return _0xd7a6a4;}function parseEmail(_0x4eb6bd,_0xcea683,_0x32c5f5){if(_0xcea683['html']){var _0x2f0f7e=/