From 292fe04214005b54f3659181368e81216bf41e52 Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Wed, 13 Oct 2021 09:41:16 +0200
Subject: [PATCH] Built motion from commit 80d28ea5.|2.5.37
---
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/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/safe-template.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1152 files changed, 1152 insertions(+), 1152 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9d3ed21..ef47eee 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-12T15:38:29.547Z",
+ "time": "2021-10-13T07:34:54.163Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0e9b896..ff77385 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-12T15:38:29.547Z",
+ "time": "2021-10-13T07:34:54.163Z",
"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 3a4e07f..5e6b18a 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 _0x70d9=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0x53ac15,_0x3e9c70){var _0x2cac44=function(_0x6984e9){while(--_0x6984e9){_0x53ac15['push'](_0x53ac15['shift']());}};_0x2cac44(++_0x3e9c70);}(_0x70d9,0xb3));var _0x970d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x70d9[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x970d('0x0'));module[_0x970d('0x1')]={'name':{'type':Sequelize[_0x970d('0x2')],'get':function(_0x3f787d){return this[_0x970d('0x3')]('action');}},'action':{'type':Sequelize[_0x970d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x970d('0x5'),_0x970d('0x6'),_0x970d('0x7'),_0x970d('0x8'),_0x970d('0x9'),'browser',_0x970d('0xa'),_0x970d('0xb')]],'msg':_0x970d('0xc')}},'comment':_0x970d('0xc')},'data1':{'type':Sequelize[_0x970d('0x4')](0x1000),'comment':_0x970d('0xd')},'data2':{'type':Sequelize[_0x970d('0x4')](0x1000),'comment':_0x970d('0xe')},'data3':{'type':Sequelize[_0x970d('0x4')](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':_0x970d('0xf')},'data5':{'type':Sequelize[_0x970d('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x970d('0x10')},'data7':{'type':Sequelize[_0x970d('0x11')],'comments':_0x970d('0x12')}};
\ No newline at end of file
+var _0x4cc7=['getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0xb9622e,_0x91225d){var _0x12969e=function(_0x5e8b52){while(--_0x5e8b52){_0xb9622e['push'](_0xb9622e['shift']());}};_0x12969e(++_0x91225d);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x229dea,_0x108755){_0x229dea=_0x229dea-0x0;var _0x4763a7=_0x4cc7[_0x229dea];return _0x4763a7;};'use strict';var Sequelize=require(_0x74cc('0x0'));module[_0x74cc('0x1')]={'name':{'type':Sequelize[_0x74cc('0x2')],'get':function(_0x21187e){return this[_0x74cc('0x3')](_0x74cc('0x4'));}},'action':{'type':Sequelize[_0x74cc('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x74cc('0x6'),'integration',_0x74cc('0x7'),_0x74cc('0x8'),_0x74cc('0x9'),_0x74cc('0xa'),_0x74cc('0xb'),_0x74cc('0xc')]],'msg':_0x74cc('0xd')}},'comment':_0x74cc('0xd')},'data1':{'type':Sequelize[_0x74cc('0x5')](0x1000),'comment':_0x74cc('0xe')},'data2':{'type':Sequelize[_0x74cc('0x5')](0x1000),'comment':_0x74cc('0xf')},'data3':{'type':Sequelize[_0x74cc('0x5')](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[_0x74cc('0x5')](0x1000),'comments':_0x74cc('0x10')},'data5':{'type':Sequelize[_0x74cc('0x5')](0x1000),'comments':_0x74cc('0x11')},'data6':{'type':Sequelize[_0x74cc('0x5')],'comments':_0x74cc('0x12')},'data7':{'type':Sequelize[_0x74cc('0x13')],'comments':_0x74cc('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 1c53b5c..1fee1db 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 _0x660b=['reject','save','then','destroy','stack','name','send','update','body','Action','params','catch','find','eml-format','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x70be97,_0x436825){var _0xaa070c=function(_0xdb6e2f){while(--_0xdb6e2f){_0x70be97['push'](_0x70be97['shift']());}};_0xaa070c(++_0x436825);}(_0x660b,0x155));var _0xb660=function(_0x2957d6,_0x1b0a85){_0x2957d6=_0x2957d6-0x0;var _0x4183b1=_0x660b[_0x2957d6];return _0x4183b1;};'use strict';var emlformat=require(_0xb660('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb660('0x1'));var rp=require('request-promise');var moment=require(_0xb660('0x2'));var BPromise=require(_0xb660('0x3'));var Mustache=require(_0xb660('0x4'));var util=require('util');var path=require(_0xb660('0x5'));var sox=require('sox');var csv=require(_0xb660('0x6'));var ejs=require(_0xb660('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb660('0x8'));var crypto=require(_0xb660('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb660('0x6'));var querystring=require(_0xb660('0xa'));var Papa=require(_0xb660('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb660('0xc'));var logger=require('../../config/logger')(_0xb660('0xd'));var utils=require(_0xb660('0xe'));var config=require(_0xb660('0xf'));var licenseUtil=require(_0xb660('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc4d82a,_0x2f3583){_0x2f3583=_0x2f3583||0xcc;return function(_0xfc8aed){if(_0xfc8aed){return _0xc4d82a[_0xb660('0x11')](_0x2f3583);}return _0xc4d82a[_0xb660('0x12')](_0x2f3583)[_0xb660('0x13')]();};}function respondWithResult(_0x38c19f,_0x366a27){_0x366a27=_0x366a27||0xc8;return function(_0x8bb582){if(_0x8bb582){return _0x38c19f[_0xb660('0x12')](_0x366a27)[_0xb660('0x14')](_0x8bb582);}};}function respondWithFilteredResult(_0x3ebd9d,_0x4b5aab){return function(_0x5ab856){if(_0x5ab856){var _0x5c00ce=typeof _0x4b5aab[_0xb660('0x15')]===_0xb660('0x16')&&typeof _0x4b5aab[_0xb660('0x17')]===_0xb660('0x16');var _0x32aa83=_0x5ab856[_0xb660('0x18')];var _0x1c94dc=_0x5c00ce?0x0:_0x4b5aab[_0xb660('0x15')];var _0x4542c6=_0x5c00ce?_0x5ab856['count']:_0x4b5aab[_0xb660('0x15')]+_0x4b5aab[_0xb660('0x17')];var _0x4fbbfa;if(_0x4542c6>=_0x32aa83){_0x4542c6=_0x32aa83;_0x4fbbfa=0xc8;}else{_0x4fbbfa=0xce;}_0x3ebd9d[_0xb660('0x12')](_0x4fbbfa);return _0x3ebd9d[_0xb660('0x19')](_0xb660('0x1a'),_0x1c94dc+'-'+_0x4542c6+'/'+_0x32aa83)[_0xb660('0x14')](_0x5ab856);}return null;};}function patchUpdates(_0xcb9ba){return function(_0x9b505a){try{jsonpatch[_0xb660('0x1b')](_0x9b505a,_0xcb9ba,!![]);}catch(_0x171354){return BPromise[_0xb660('0x1c')](_0x171354);}return _0x9b505a[_0xb660('0x1d')]();};}function saveUpdates(_0x1516a5,_0x4b22dd){return function(_0x5b957a){if(_0x5b957a){return _0x5b957a['update'](_0x1516a5)[_0xb660('0x1e')](function(_0x2132ac){return _0x2132ac;});}return null;};}function removeEntity(_0x408310,_0x2235f9){return function(_0x1b5f0c){if(_0x1b5f0c){return _0x1b5f0c[_0xb660('0x1f')]()['then'](function(){_0x408310[_0xb660('0x12')](0xcc)[_0xb660('0x13')]();});}};}function handleEntityNotFound(_0x141672,_0x5e0432){return function(_0x307f6e){if(!_0x307f6e){_0x141672[_0xb660('0x11')](0x194);}return _0x307f6e;};}function handleError(_0x5c5b8e,_0x5d7612){_0x5d7612=_0x5d7612||0x1f4;return function(_0x37eb85){logger['error'](_0x37eb85[_0xb660('0x20')]);if(_0x37eb85['name']){delete _0x37eb85[_0xb660('0x21')];}_0x5c5b8e[_0xb660('0x12')](_0x5d7612)[_0xb660('0x22')](_0x37eb85);};}exports[_0xb660('0x23')]=function(_0x1125c3,_0x212999){if(_0x1125c3[_0xb660('0x24')]['id']){delete _0x1125c3[_0xb660('0x24')]['id'];}return db[_0xb660('0x25')]['find']({'where':{'id':_0x1125c3[_0xb660('0x26')]['id']}})[_0xb660('0x1e')](handleEntityNotFound(_0x212999,null))[_0xb660('0x1e')](saveUpdates(_0x1125c3[_0xb660('0x24')],null))[_0xb660('0x1e')](respondWithResult(_0x212999,null))[_0xb660('0x27')](handleError(_0x212999,null));};exports[_0xb660('0x1f')]=function(_0x165ef2,_0x1aafd2){return db[_0xb660('0x25')][_0xb660('0x28')]({'where':{'id':_0x165ef2[_0xb660('0x26')]['id']}})[_0xb660('0x1e')](handleEntityNotFound(_0x1aafd2,null))[_0xb660('0x1e')](removeEntity(_0x1aafd2,null))['catch'](handleError(_0x1aafd2,null));};
\ No newline at end of file
+var _0xc7f3=['then','destroy','stack','send','update','body','Action','find','params','catch','eml-format','fast-json-patch','request-promise','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save'];(function(_0x11a6bd,_0x526e61){var _0x120525=function(_0x41617a){while(--_0x41617a){_0x11a6bd['push'](_0x11a6bd['shift']());}};_0x120525(++_0x526e61);}(_0xc7f3,0x1de));var _0x3c7f=function(_0x171fb6,_0x1116d6){_0x171fb6=_0x171fb6-0x0;var _0x2dda01=_0xc7f3[_0x171fb6];return _0x2dda01;};'use strict';var emlformat=require(_0x3c7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c7f('0x1'));var rp=require(_0x3c7f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3c7f('0x3'));var path=require(_0x3c7f('0x4'));var sox=require('sox');var csv=require(_0x3c7f('0x5'));var ejs=require(_0x3c7f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3c7f('0x7'));var crypto=require('crypto');var jsforce=require(_0x3c7f('0x8'));var deskjs=require(_0x3c7f('0x9'));var toCsv=require(_0x3c7f('0x5'));var querystring=require(_0x3c7f('0xa'));var Papa=require(_0x3c7f('0xb'));var Redis=require('ioredis');var authService=require(_0x3c7f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x3c7f('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c7f('0xe'))('api');var utils=require(_0x3c7f('0xf'));var config=require(_0x3c7f('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c7f('0x11'))['db'];function respondWithStatusCode(_0x369893,_0x2ef4be){_0x2ef4be=_0x2ef4be||0xcc;return function(_0x468ec7){if(_0x468ec7){return _0x369893['sendStatus'](_0x2ef4be);}return _0x369893[_0x3c7f('0x12')](_0x2ef4be)[_0x3c7f('0x13')]();};}function respondWithResult(_0x90e240,_0x156c4c){_0x156c4c=_0x156c4c||0xc8;return function(_0x53c16b){if(_0x53c16b){return _0x90e240[_0x3c7f('0x12')](_0x156c4c)[_0x3c7f('0x14')](_0x53c16b);}};}function respondWithFilteredResult(_0xa30bba,_0x28e181){return function(_0x24e5e1){if(_0x24e5e1){var _0x2c2ace=typeof _0x28e181[_0x3c7f('0x15')]===_0x3c7f('0x16')&&typeof _0x28e181['limit']===_0x3c7f('0x16');var _0x136c75=_0x24e5e1['count'];var _0x81c6cf=_0x2c2ace?0x0:_0x28e181[_0x3c7f('0x15')];var _0x21614e=_0x2c2ace?_0x24e5e1[_0x3c7f('0x17')]:_0x28e181[_0x3c7f('0x15')]+_0x28e181[_0x3c7f('0x18')];var _0x19fdb4;if(_0x21614e>=_0x136c75){_0x21614e=_0x136c75;_0x19fdb4=0xc8;}else{_0x19fdb4=0xce;}_0xa30bba['status'](_0x19fdb4);return _0xa30bba['set'](_0x3c7f('0x19'),_0x81c6cf+'-'+_0x21614e+'/'+_0x136c75)['json'](_0x24e5e1);}return null;};}function patchUpdates(_0x5f5572){return function(_0x23245a){try{jsonpatch[_0x3c7f('0x1a')](_0x23245a,_0x5f5572,!![]);}catch(_0x5b2047){return BPromise[_0x3c7f('0x1b')](_0x5b2047);}return _0x23245a[_0x3c7f('0x1c')]();};}function saveUpdates(_0x458ced,_0x29683c){return function(_0xda713b){if(_0xda713b){return _0xda713b['update'](_0x458ced)[_0x3c7f('0x1d')](function(_0x4e918f){return _0x4e918f;});}return null;};}function removeEntity(_0x3a0bed,_0x87ce0d){return function(_0x475f22){if(_0x475f22){return _0x475f22[_0x3c7f('0x1e')]()[_0x3c7f('0x1d')](function(){_0x3a0bed[_0x3c7f('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dcb1,_0x526332){return function(_0xf148d9){if(!_0xf148d9){_0x50dcb1['sendStatus'](0x194);}return _0xf148d9;};}function handleError(_0x5123b3,_0x32a3c9){_0x32a3c9=_0x32a3c9||0x1f4;return function(_0x6afbd4){logger['error'](_0x6afbd4[_0x3c7f('0x1f')]);if(_0x6afbd4['name']){delete _0x6afbd4['name'];}_0x5123b3[_0x3c7f('0x12')](_0x32a3c9)[_0x3c7f('0x20')](_0x6afbd4);};}exports[_0x3c7f('0x21')]=function(_0x1c6ef7,_0x3ae2bd){if(_0x1c6ef7[_0x3c7f('0x22')]['id']){delete _0x1c6ef7[_0x3c7f('0x22')]['id'];}return db[_0x3c7f('0x23')][_0x3c7f('0x24')]({'where':{'id':_0x1c6ef7[_0x3c7f('0x25')]['id']}})['then'](handleEntityNotFound(_0x3ae2bd,null))[_0x3c7f('0x1d')](saveUpdates(_0x1c6ef7[_0x3c7f('0x22')],null))[_0x3c7f('0x1d')](respondWithResult(_0x3ae2bd,null))[_0x3c7f('0x26')](handleError(_0x3ae2bd,null));};exports[_0x3c7f('0x1e')]=function(_0x2a3231,_0x1d330a){return db[_0x3c7f('0x23')][_0x3c7f('0x24')]({'where':{'id':_0x2a3231[_0x3c7f('0x25')]['id']}})[_0x3c7f('0x1d')](handleEntityNotFound(_0x1d330a,null))[_0x3c7f('0x1d')](removeEntity(_0x1d330a,null))[_0x3c7f('0x26')](handleError(_0x1d330a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index e264772..0609684 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 _0xde6f=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x5d2f84,_0x49868f){var _0xc181c0=function(_0x27897f){while(--_0x27897f){_0x5d2f84['push'](_0x5d2f84['shift']());}};_0xc181c0(++_0x49868f);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfde6('0x0'))(_0xfde6('0x1'));var moment=require(_0xfde6('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde6('0x3'));var fs=require('fs');var path=require(_0xfde6('0x4'));var rimraf=require(_0xfde6('0x5'));var config=require(_0xfde6('0x6'));var attributes=require(_0xfde6('0x7'));module[_0xfde6('0x8')]=function(_0x50d21a,_0x5628ea){return _0x50d21a[_0xfde6('0x9')](_0xfde6('0xa'),attributes,{'tableName':_0xfde6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b12=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x5b12,0x1d4));var _0x25b1=function(_0x5af2c5,_0x3011b6){_0x5af2c5=_0x5af2c5-0x0;var _0x63f16a=_0x5b12[_0x5af2c5];return _0x63f16a;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require('../../config/logger')(_0x25b1('0x2'));var moment=require(_0x25b1('0x3'));var BPromise=require(_0x25b1('0x4'));var rp=require(_0x25b1('0x5'));var fs=require('fs');var path=require(_0x25b1('0x6'));var rimraf=require(_0x25b1('0x7'));var config=require(_0x25b1('0x8'));var attributes=require(_0x25b1('0x9'));module[_0x25b1('0xa')]=function(_0x552e68,_0x443594){return _0x552e68[_0x25b1('0xb')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 2b922af..483c42a 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x537710,_0x282703){var _0x4cefbf=function(_0xb77f83){while(--_0xb77f83){_0x537710['push'](_0x537710['shift']());}};_0x4cefbf(++_0x282703);}(_0xe14b,0x93));var _0xbe14=function(_0x483afc,_0x2f07f3){_0x483afc=_0x483afc-0x0;var _0x888dfb=_0xe14b[_0x483afc];return _0x888dfb;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0xcd48c6,_0x398f0e){var _0x44dc94=function(_0x1b8163){while(--_0x1b8163){_0xcd48c6['push'](_0xcd48c6['shift']());}};_0x44dc94(++_0x398f0e);}(_0x1261,0x144));var _0x1126=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x1261[_0x4e9d3c];return _0x2d0825;};'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')]('Action,\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/action/index.js b/server/api/action/index.js
index 7be2384..a0ebaff 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 _0x7af7=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0xfd9097,_0x18fe4c){var _0x646a2b=function(_0x265f59){while(--_0x265f59){_0xfd9097['push'](_0xfd9097['shift']());}};_0x646a2b(++_0x18fe4c);}(_0x7af7,0x1ee));var _0x77af=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x7af7[_0x113a6c];return _0x1ac632;};'use strict';var multer=require(_0x77af('0x0'));var util=require(_0x77af('0x1'));var path=require(_0x77af('0x2'));var timeout=require(_0x77af('0x3'));var express=require('express');var router=express[_0x77af('0x4')]();var fs_extra=require(_0x77af('0x5'));var auth=require(_0x77af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x77af('0x7'));var controller=require(_0x77af('0x8'));router[_0x77af('0x9')](_0x77af('0xa'),auth[_0x77af('0xb')](),controller[_0x77af('0xc')]);router[_0x77af('0xd')](_0x77af('0xa'),auth['isAuthenticated'](),controller[_0x77af('0xe')]);module[_0x77af('0xf')]=router;
\ No newline at end of file
+var _0x5cb2=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x5cb2,0x90));var _0x25cb=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x5cb2[_0x4b4b0e];return _0x4c2d91;};'use strict';var multer=require('multer');var util=require(_0x25cb('0x0'));var path=require(_0x25cb('0x1'));var timeout=require(_0x25cb('0x2'));var express=require(_0x25cb('0x3'));var router=express[_0x25cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x25cb('0x5'));var interaction=require(_0x25cb('0x6'));var config=require(_0x25cb('0x7'));var controller=require(_0x25cb('0x8'));router[_0x25cb('0x9')](_0x25cb('0xa'),auth[_0x25cb('0xb')](),controller[_0x25cb('0xc')]);router[_0x25cb('0xd')](_0x25cb('0xa'),auth[_0x25cb('0xb')](),controller[_0x25cb('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b281f97..03ab9b6 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(_0x3ad964,_0x1e3ebf){var _0xc09da7=function(_0x1ab99c){while(--_0x1ab99c){_0x3ad964['push'](_0x3ad964['shift']());}};_0xc09da7(++_0x1e3ebf);}(_0x7217,0x19e));var _0x7721=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7217[_0x102e37];return _0x35a07c;};'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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x468a77,_0x1382be){var _0x2d1c33=function(_0x2f2e83){while(--_0x2f2e83){_0x468a77['push'](_0x468a77['shift']());}};_0x2d1c33(++_0x1382be);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3580bf,_0x14c1c5){_0x3580bf=_0x3580bf-0x0;var _0x571a9c=_0xb4c7[_0x3580bf];return _0x571a9c;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 05f7e9d..edc4ece 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 _0x3d2f=['rules','group','field','condition','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','MAX(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','value','getFields','Sequelize','MetricId','order','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','UserProfileResource','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','rows','show','params','find','catch','create','body','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator'];(function(_0x16d523,_0x21b346){var _0x511b64=function(_0x47d6f1){while(--_0x47d6f1){_0x16d523['push'](_0x16d523['shift']());}};_0x511b64(++_0x21b346);}(_0x3d2f,0x18f));var _0xf3d2=function(_0x19af6b,_0x5b2017){_0x19af6b=_0x19af6b-0x0;var _0x2915aa=_0x3d2f[_0x19af6b];return _0x2915aa;};'use strict';var emlformat=require(_0xf3d2('0x0'));var rimraf=require(_0xf3d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3d2('0x2'));var rp=require(_0xf3d2('0x3'));var moment=require(_0xf3d2('0x4'));var BPromise=require(_0xf3d2('0x5'));var Mustache=require(_0xf3d2('0x6'));var util=require(_0xf3d2('0x7'));var path=require(_0xf3d2('0x8'));var sox=require('sox');var csv=require(_0xf3d2('0x9'));var ejs=require(_0xf3d2('0xa'));var fs=require('fs');var fs_extra=require(_0xf3d2('0xb'));var _=require(_0xf3d2('0xc'));var squel=require(_0xf3d2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf3d2('0xe'));var deskjs=require(_0xf3d2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3d2('0x10'));var Papa=require('papaparse');var Redis=require(_0xf3d2('0x11'));var authService=require(_0xf3d2('0x12'));var qs=require(_0xf3d2('0x13'));var as=require(_0xf3d2('0x14'));var hardwareService=require(_0xf3d2('0x15'));var logger=require(_0xf3d2('0x16'))('api');var utils=require(_0xf3d2('0x17'));var config=require(_0xf3d2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3d2('0x19'))['db'];var dbH=require('../../mysqldb')[_0xf3d2('0x1a')];function respondWithStatusCode(_0x230a4b,_0x39f9d2){_0x39f9d2=_0x39f9d2||0xcc;return function(_0x4cd302){if(_0x4cd302){return _0x230a4b[_0xf3d2('0x1b')](_0x39f9d2);}return _0x230a4b[_0xf3d2('0x1c')](_0x39f9d2)[_0xf3d2('0x1d')]();};}function respondWithResult(_0x30b905,_0x1bf4c1){_0x1bf4c1=_0x1bf4c1||0xc8;return function(_0x4483d7){if(_0x4483d7){return _0x30b905['status'](_0x1bf4c1)[_0xf3d2('0x1e')](_0x4483d7);}};}function respondWithFilteredResult(_0x892094,_0x3a43f6){return function(_0x24cfc1){if(_0x24cfc1){var _0x92ba9c=typeof _0x3a43f6[_0xf3d2('0x1f')]===_0xf3d2('0x20')&&typeof _0x3a43f6[_0xf3d2('0x21')]===_0xf3d2('0x20');var _0x5a4afd=_0x24cfc1[_0xf3d2('0x22')];var _0x9bb587=_0x92ba9c?0x0:_0x3a43f6['offset'];var _0x1dfc9f=_0x92ba9c?_0x24cfc1[_0xf3d2('0x22')]:_0x3a43f6[_0xf3d2('0x1f')]+_0x3a43f6['limit'];var _0x18fab0;if(_0x1dfc9f>=_0x5a4afd){_0x1dfc9f=_0x5a4afd;_0x18fab0=0xc8;}else{_0x18fab0=0xce;}_0x892094[_0xf3d2('0x1c')](_0x18fab0);return _0x892094[_0xf3d2('0x23')](_0xf3d2('0x24'),_0x9bb587+'-'+_0x1dfc9f+'/'+_0x5a4afd)[_0xf3d2('0x1e')](_0x24cfc1);}return null;};}function patchUpdates(_0x1c2b51){return function(_0x2009bf){try{jsonpatch[_0xf3d2('0x25')](_0x2009bf,_0x1c2b51,!![]);}catch(_0x12b0d3){return BPromise[_0xf3d2('0x26')](_0x12b0d3);}return _0x2009bf['save']();};}function saveUpdates(_0x12e0be,_0x1ae124){return function(_0x472fd){if(_0x472fd){return _0x472fd[_0xf3d2('0x27')](_0x12e0be)[_0xf3d2('0x28')](function(_0x3d40ff){return _0x3d40ff;});}return null;};}function removeEntity(_0x1d1b44,_0x39f9a8){return function(_0x11eed0){if(_0x11eed0){return _0x11eed0['destroy']()[_0xf3d2('0x28')](function(){var _0x1c6ae5=_0x11eed0['get']({'plain':!![]});var _0xab37c2='CustomReports';return db[_0xf3d2('0x29')]['destroy']({'where':{'type':_0xab37c2,'resourceId':_0x1c6ae5['id']}})[_0xf3d2('0x28')](function(){return _0x11eed0;});})[_0xf3d2('0x28')](function(){_0x1d1b44['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea85d,_0x135191){return function(_0x179e23){if(!_0x179e23){_0x3ea85d['sendStatus'](0x194);}return _0x179e23;};}function handleError(_0x2ff7c5,_0x3cdb21){_0x3cdb21=_0x3cdb21||0x1f4;return function(_0x39e846){logger['error'](_0x39e846[_0xf3d2('0x2a')]);if(_0x39e846[_0xf3d2('0x2b')]){delete _0x39e846['name'];}_0x2ff7c5['status'](_0x3cdb21)[_0xf3d2('0x2c')](_0x39e846);};}exports[_0xf3d2('0x2d')]=function(_0x374583,_0x50f614){var _0x357e2f={},_0x3aa01f={},_0x127f85={'count':0x0,'rows':[]};var _0x41a1b7=_['map'](db['AnalyticCustomReport'][_0xf3d2('0x2e')],function(_0x2e4c0d){return{'name':_0x2e4c0d['fieldName'],'type':_0x2e4c0d['type'][_0xf3d2('0x2f')]};});_0x3aa01f[_0xf3d2('0x30')]=_[_0xf3d2('0x31')](_0x41a1b7,_0xf3d2('0x2b'));_0x3aa01f[_0xf3d2('0x32')]=_[_0xf3d2('0x33')](_0x374583[_0xf3d2('0x32')]);_0x3aa01f[_0xf3d2('0x34')]=_[_0xf3d2('0x35')](_0x3aa01f[_0xf3d2('0x30')],_0x3aa01f[_0xf3d2('0x32')]);_0x357e2f['attributes']=_['intersection'](_0x3aa01f[_0xf3d2('0x30')],qs[_0xf3d2('0x36')](_0x374583[_0xf3d2('0x32')][_0xf3d2('0x36')]));_0x357e2f['attributes']=_0x357e2f[_0xf3d2('0x37')][_0xf3d2('0x38')]?_0x357e2f[_0xf3d2('0x37')]:_0x3aa01f[_0xf3d2('0x30')];if(!_0x374583[_0xf3d2('0x32')][_0xf3d2('0x39')](_0xf3d2('0x3a'))){_0x357e2f['limit']=qs[_0xf3d2('0x21')](_0x374583[_0xf3d2('0x32')][_0xf3d2('0x21')]);_0x357e2f['offset']=qs[_0xf3d2('0x1f')](_0x374583[_0xf3d2('0x32')]['offset']);}_0x357e2f['order']=qs[_0xf3d2('0x3b')](_0x374583[_0xf3d2('0x32')][_0xf3d2('0x3b')]);_0x357e2f[_0xf3d2('0x3c')]=qs[_0xf3d2('0x34')](_[_0xf3d2('0x3d')](_0x374583[_0xf3d2('0x32')],_0x3aa01f[_0xf3d2('0x34')]),_0x41a1b7);if(_0x374583['query'][_0xf3d2('0x3e')]){_0x357e2f[_0xf3d2('0x3c')]=_[_0xf3d2('0x3f')](_0x357e2f['where'],{'$or':_[_0xf3d2('0x31')](_0x41a1b7,function(_0x1e9d8e){if(_0x1e9d8e['type']!==_0xf3d2('0x40')){var _0x4a7ab3={};_0x4a7ab3[_0x1e9d8e['name']]={'$like':'%'+_0x374583[_0xf3d2('0x32')][_0xf3d2('0x3e')]+'%'};return _0x4a7ab3;}})});}_0x357e2f=_[_0xf3d2('0x3f')]({},_0x357e2f,_0x374583[_0xf3d2('0x41')]);var _0x14937e={'where':_0x357e2f['where']};return db[_0xf3d2('0x42')][_0xf3d2('0x22')](_0x14937e)['then'](function(_0x57f57e){_0x127f85[_0xf3d2('0x22')]=_0x57f57e;if(_0x374583[_0xf3d2('0x32')][_0xf3d2('0x43')]){_0x357e2f[_0xf3d2('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x357e2f);})[_0xf3d2('0x28')](function(_0x1eda55){_0x127f85[_0xf3d2('0x45')]=_0x1eda55;return _0x127f85;})[_0xf3d2('0x28')](respondWithFilteredResult(_0x50f614,_0x357e2f))['catch'](handleError(_0x50f614,null));};exports[_0xf3d2('0x46')]=function(_0x17b447,_0x5683cb){var _0x5aef78={'raw':![],'where':{'id':_0x17b447[_0xf3d2('0x47')]['id']}},_0x13834b={};_0x13834b[_0xf3d2('0x30')]=_[_0xf3d2('0x33')](db[_0xf3d2('0x42')][_0xf3d2('0x2e')]);_0x13834b[_0xf3d2('0x32')]=_[_0xf3d2('0x33')](_0x17b447[_0xf3d2('0x32')]);_0x13834b[_0xf3d2('0x34')]=_['intersection'](_0x13834b[_0xf3d2('0x30')],_0x13834b[_0xf3d2('0x32')]);_0x5aef78[_0xf3d2('0x37')]=_['intersection'](_0x13834b[_0xf3d2('0x30')],qs[_0xf3d2('0x36')](_0x17b447[_0xf3d2('0x32')][_0xf3d2('0x36')]));_0x5aef78['attributes']=_0x5aef78[_0xf3d2('0x37')][_0xf3d2('0x38')]?_0x5aef78[_0xf3d2('0x37')]:_0x13834b[_0xf3d2('0x30')];if(_0x17b447[_0xf3d2('0x32')][_0xf3d2('0x43')]){_0x5aef78[_0xf3d2('0x44')]=[{'all':!![]}];}_0x5aef78=_[_0xf3d2('0x3f')]({},_0x5aef78,_0x17b447[_0xf3d2('0x41')]);return db[_0xf3d2('0x42')][_0xf3d2('0x48')](_0x5aef78)[_0xf3d2('0x28')](handleEntityNotFound(_0x5683cb,null))[_0xf3d2('0x28')](respondWithResult(_0x5683cb,null))[_0xf3d2('0x49')](handleError(_0x5683cb,null));};exports[_0xf3d2('0x4a')]=function(_0x213b33,_0x9948bf){return db['AnalyticCustomReport'][_0xf3d2('0x4a')](_0x213b33[_0xf3d2('0x4b')],{})[_0xf3d2('0x28')](function(_0x3270a1){var _0xd3ccb2=_0x213b33[_0xf3d2('0x4c')][_0xf3d2('0x4d')]({'plain':!![]});if(!_0xd3ccb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd3ccb2['role']===_0xf3d2('0x4c')){var _0x34ab14=_0x3270a1[_0xf3d2('0x4d')]({'plain':!![]});var _0x2afef0=_0xf3d2('0x4e');return db[_0xf3d2('0x4f')][_0xf3d2('0x48')]({'where':{'name':_0x2afef0,'userProfileId':_0xd3ccb2[_0xf3d2('0x50')]},'raw':!![]})['then'](function(_0x110e77){if(_0x110e77&&_0x110e77[_0xf3d2('0x51')]===0x0){return db[_0xf3d2('0x29')][_0xf3d2('0x4a')]({'name':_0x34ab14[_0xf3d2('0x2b')],'resourceId':_0x34ab14['id'],'type':_0xf3d2('0x52'),'sectionId':_0x110e77['id']},{})[_0xf3d2('0x28')](function(){return _0x3270a1;});}else{return _0x3270a1;}})[_0xf3d2('0x49')](function(_0x580fbf){logger['error'](_0xf3d2('0x53'),_0x580fbf);throw _0x580fbf;});}return _0x3270a1;})[_0xf3d2('0x28')](respondWithResult(_0x9948bf,0xc9))[_0xf3d2('0x49')](handleError(_0x9948bf,null));};exports[_0xf3d2('0x27')]=function(_0x4d71b8,_0x4f5657){if(_0x4d71b8[_0xf3d2('0x4b')]['id']){delete _0x4d71b8['body']['id'];}return db[_0xf3d2('0x42')]['find']({'where':{'id':_0x4d71b8[_0xf3d2('0x47')]['id']}})[_0xf3d2('0x28')](handleEntityNotFound(_0x4f5657,null))[_0xf3d2('0x28')](saveUpdates(_0x4d71b8['body'],null))[_0xf3d2('0x28')](respondWithResult(_0x4f5657,null))[_0xf3d2('0x49')](handleError(_0x4f5657,null));};exports[_0xf3d2('0x54')]=function(_0x46a7e5,_0x4696f3){return db[_0xf3d2('0x42')]['find']({'where':{'id':_0x46a7e5[_0xf3d2('0x47')]['id']}})[_0xf3d2('0x28')](handleEntityNotFound(_0x4696f3,null))[_0xf3d2('0x28')](removeEntity(_0x4696f3,null))['catch'](handleError(_0x4696f3,null));};exports[_0xf3d2('0x55')]=function(_0x45073a,_0x5476f8){var _0x19f241=0xa;var _0x4a602b=[_0xf3d2('0x56'),_0xf3d2('0x57'),_0xf3d2('0x58'),_0xf3d2('0x59')];var _0x2b0668={'SUM':_0xf3d2('0x5a'),'COUNT':_0xf3d2('0x5b'),'COUNT DISTINCT':_0xf3d2('0x5c'),'MAX':'MAX(%s)','MIN':_0xf3d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf3d2('0x5e'),'GROUP_CONCAT DESC':_0xf3d2('0x5f')};var _0x44efb3={'SEC_TO_TIME':_0xf3d2('0x60'),'DATE':_0xf3d2('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xf3d2('0x62'),'UNIX_TIMESTAMP':_0xf3d2('0x63')};var _0x2befce=function(_0x347033){return!_[_0xf3d2('0x64')]([_0xf3d2('0x65'),_0xf3d2('0x66'),_0xf3d2('0x67'),'IS\x20NOT\x20EMPTY'],_0x347033);};var _0x4c9552=function(_0x1d7c96){if(!_0x1d7c96||!_0x1d7c96['rules'][_0xf3d2('0x38')]){return'';}for(var _0x32adec='(',_0x5c38cf=0x0;_0x5c38cf<_0x1d7c96['rules']['length'];_0x5c38cf+=0x1){_0x5c38cf>0x0&&(_0x32adec+='\x20'+_0x1d7c96[_0xf3d2('0x68')]+'\x20');_0x32adec+=_0x1d7c96[_0xf3d2('0x69')][_0x5c38cf][_0xf3d2('0x6a')]?_0x4c9552(_0x1d7c96[_0xf3d2('0x69')][_0x5c38cf][_0xf3d2('0x6a')]):_0x1d7c96[_0xf3d2('0x69')][_0x5c38cf][_0xf3d2('0x6b')]+'\x20'+_0x1d7c96['rules'][_0x5c38cf][_0xf3d2('0x6c')]+(_0x2befce(_0x1d7c96[_0xf3d2('0x69')][_0x5c38cf]['condition'])?'\x20'+_0x1d7c96[_0xf3d2('0x69')][_0x5c38cf]['value']:'');}return _0x32adec+')';};var _0x50f489={'where':{'id':_0x45073a[_0xf3d2('0x47')]['id']}},_0x499e8e,_0x5bdf27,_0x1f1160,_0x19a614,_0x46d4de;_0x50f489=_['merge']({},_0x50f489,_0x45073a['options']);return db[_0xf3d2('0x42')][_0xf3d2('0x48')](_0x50f489)['then'](function(_0x5658b2){if(_0x5658b2){_0x499e8e=_0x5658b2;return _0x5658b2['getFields']();}return null;})[_0xf3d2('0x28')](function(_0x4ca331){if(_0x4ca331){if(!_0x4ca331[_0xf3d2('0x38')]){throw new db['Sequelize'][(_0xf3d2('0x6d'))](_0xf3d2('0x6e'),0x193);}_0x5bdf27=_0x4ca331;return db[_0xf3d2('0x6f')][_0xf3d2('0x70')]({'raw':!![]});}return null;})[_0xf3d2('0x28')](function(_0x2cc5a3){if(_0x2cc5a3){_0x1f1160=_[_0xf3d2('0x71')](_0x2cc5a3,'id');var _0x1ec9fd;var _0x41e006=squel[_0xf3d2('0x72')]();_0x41e006[_0xf3d2('0x73')](_0x499e8e[_0xf3d2('0x74')]);for(var _0x4746aa=0x0;_0x4746aa<_0x5bdf27[_0xf3d2('0x38')];_0x4746aa+=0x1){_0x1ec9fd=_0x5bdf27[_0x4746aa]['MetricId']?_0x1f1160[_0x5bdf27[_0x4746aa]['MetricId']][_0xf3d2('0x75')]:_0x5bdf27[_0x4746aa][_0xf3d2('0x6b')];_0x1ec9fd=_0x5bdf27[_0x4746aa][_0xf3d2('0x76')]?_[_0xf3d2('0x77')](_0x2b0668[_0x5bdf27[_0x4746aa][_0xf3d2('0x76')]],'%s',_0x1ec9fd):_0x1ec9fd;_0x1ec9fd=_0x5bdf27[_0x4746aa][_0xf3d2('0x78')]?_[_0xf3d2('0x77')](_0x44efb3[_0x5bdf27[_0x4746aa][_0xf3d2('0x78')]],'%s',_0x1ec9fd):_0x1ec9fd;if(_0x5bdf27[_0x4746aa][_0xf3d2('0x79')]){_0x41e006[_0xf3d2('0x6a')](_0x1ec9fd);}_0x5bdf27[_0x4746aa][_0xf3d2('0x7a')]&&_0x41e006['order'](_0x1ec9fd,_0x5bdf27[_0x4746aa][_0xf3d2('0x7a')]===_0xf3d2('0x7b')?![]:!![]);_0x41e006[_0xf3d2('0x6b')](_0x1ec9fd,_0x5bdf27[_0x4746aa][_0xf3d2('0x7c')]||_0x1ec9fd);}if(_0x499e8e[_0xf3d2('0x7d')]){_0x499e8e[_0xf3d2('0x7d')]=JSON[_0xf3d2('0x7e')](_0x499e8e[_0xf3d2('0x7d')]);for(var _0x2ddbdc=0x0;_0x2ddbdc<_0x499e8e[_0xf3d2('0x7d')][_0xf3d2('0x38')];_0x2ddbdc+=0x1){if(_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x7f')]&&_[_0xf3d2('0x64')](_0x4a602b,_0x499e8e['joins'][_0x2ddbdc][_0xf3d2('0x7f')])&&_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x80')]&&_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc]['foreignTable']&&_0x499e8e['joins'][_0x2ddbdc][_0xf3d2('0x81')]){_0x41e006[_0x499e8e['joins'][_0x2ddbdc][_0xf3d2('0x7f')]](_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x82')],null,util[_0xf3d2('0x78')](_0xf3d2('0x83'),_0x499e8e[_0xf3d2('0x74')],_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x80')],_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x82')],_0x499e8e[_0xf3d2('0x7d')][_0x2ddbdc][_0xf3d2('0x81')]));}}}if(_0x499e8e[_0xf3d2('0x84')]){_0x499e8e[_0xf3d2('0x84')]=JSON[_0xf3d2('0x7e')](_0x499e8e[_0xf3d2('0x84')]);_0x41e006['where'](_0x4c9552(_0x499e8e[_0xf3d2('0x84')][_0xf3d2('0x6a')]));}_0x46d4de=_0x41e006[_0xf3d2('0x85')]();_0x41e006['limit'](_0x19f241);_0x41e006[_0xf3d2('0x1f')](0x0);logger[_0xf3d2('0x86')](_0xf3d2('0x87'),_0x41e006[_0xf3d2('0x88')]());return dbH[_0xf3d2('0x89')][_0xf3d2('0x32')](_0x41e006[_0xf3d2('0x88')](),{'type':dbH['sequelize']['QueryTypes'][_0xf3d2('0x8a')]});}})[_0xf3d2('0x28')](respondWithResult(_0x5476f8,null))[_0xf3d2('0x49')](handleError(_0x5476f8,null));};function runReport(_0x4886f9,_0x1b4dec,_0x33109e){var _0x44f5a1=_0x1b4dec[_0xf3d2('0x2b')];var _0x14b7a6=0xa;var _0x207101=[_0xf3d2('0x56'),_0xf3d2('0x57'),_0xf3d2('0x58'),_0xf3d2('0x59')];var _0x3c9159={'SUM':_0xf3d2('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf3d2('0x5c'),'MAX':_0xf3d2('0x8b'),'MIN':_0xf3d2('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf3d2('0x5e'),'GROUP_CONCAT DESC':_0xf3d2('0x5f')};var _0x4e2263={'SEC_TO_TIME':_0xf3d2('0x60'),'DATE':_0xf3d2('0x61'),'HOUR':_0xf3d2('0x8c'),'ROUND':_0xf3d2('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x547c50=function(_0x5c0b32){return!_[_0xf3d2('0x64')]([_0xf3d2('0x65'),'IS\x20NOT\x20NULL',_0xf3d2('0x67'),_0xf3d2('0x8d')],_0x5c0b32);};var _0x22ad41=function(_0x255e7f){if(!_0x255e7f||!_0x255e7f[_0xf3d2('0x69')][_0xf3d2('0x38')]){return'';}for(var _0x304610='(',_0x3f9d11=0x0;_0x3f9d11<_0x255e7f[_0xf3d2('0x69')]['length'];_0x3f9d11+=0x1){_0x3f9d11>0x0&&(_0x304610+='\x20'+_0x255e7f[_0xf3d2('0x68')]+'\x20');_0x304610+=_0x255e7f['rules'][_0x3f9d11]['group']?_0x22ad41(_0x255e7f[_0xf3d2('0x69')][_0x3f9d11][_0xf3d2('0x6a')]):_0x255e7f[_0xf3d2('0x69')][_0x3f9d11][_0xf3d2('0x6b')]+'\x20'+_0x255e7f[_0xf3d2('0x69')][_0x3f9d11][_0xf3d2('0x6c')]+(_0x547c50(_0x255e7f[_0xf3d2('0x69')][_0x3f9d11][_0xf3d2('0x6c')])?'\x20'+_0x255e7f[_0xf3d2('0x69')][_0x3f9d11][_0xf3d2('0x8e')]:'');}return _0x304610+')';};var _0xe52e06={'where':{'id':_0x4886f9['id']}},_0x4f899b,_0x40fee0,_0x5d9259,_0x34cc3c,_0x3a8946;_0xe52e06=_[_0xf3d2('0x3f')]({},_0xe52e06,_0x33109e);return db[_0xf3d2('0x42')]['find'](_0xe52e06)['then'](function(_0x50a001){if(_0x50a001){_0x4f899b=_0x50a001;return _0x50a001[_0xf3d2('0x8f')]();}return null;})[_0xf3d2('0x28')](function(_0x5cbb0a){if(_0x5cbb0a){if(!_0x5cbb0a[_0xf3d2('0x38')]){throw new db[(_0xf3d2('0x90'))][(_0xf3d2('0x6d'))](_0xf3d2('0x6e'),0x193);}_0x40fee0=_0x5cbb0a;return db[_0xf3d2('0x6f')][_0xf3d2('0x70')]({'raw':!![]});}return null;})[_0xf3d2('0x28')](function(_0x539b5f){if(_0x539b5f){_0x5d9259=_['keyBy'](_0x539b5f,'id');var _0x1d3157;var _0x4d1cc5=squel['select']();_0x4d1cc5[_0xf3d2('0x73')](_0x4f899b[_0xf3d2('0x74')]);for(var _0x11143d=0x0;_0x11143d<_0x40fee0['length'];_0x11143d+=0x1){_0x1d3157=_0x40fee0[_0x11143d][_0xf3d2('0x91')]?_0x5d9259[_0x40fee0[_0x11143d][_0xf3d2('0x91')]][_0xf3d2('0x75')]:_0x40fee0[_0x11143d]['field'];_0x1d3157=_0x40fee0[_0x11143d][_0xf3d2('0x76')]?_['replace'](_0x3c9159[_0x40fee0[_0x11143d][_0xf3d2('0x76')]],'%s',_0x1d3157):_0x1d3157;_0x1d3157=_0x40fee0[_0x11143d][_0xf3d2('0x78')]?_[_0xf3d2('0x77')](_0x4e2263[_0x40fee0[_0x11143d]['format']],'%s',_0x1d3157):_0x1d3157;if(_0x40fee0[_0x11143d][_0xf3d2('0x79')]){_0x4d1cc5['group'](_0x1d3157);}_0x40fee0[_0x11143d][_0xf3d2('0x7a')]&&_0x4d1cc5[_0xf3d2('0x92')](_0x1d3157,_0x40fee0[_0x11143d][_0xf3d2('0x7a')]===_0xf3d2('0x7b')?![]:!![]);_0x4d1cc5[_0xf3d2('0x6b')](_0x1d3157,_0x40fee0[_0x11143d][_0xf3d2('0x7c')]||_0x1d3157);}if(_0x4f899b[_0xf3d2('0x7d')]){_0x4f899b[_0xf3d2('0x7d')]=JSON['parse'](_0x4f899b[_0xf3d2('0x7d')]);for(var _0x2eddeb=0x0;_0x2eddeb<_0x4f899b[_0xf3d2('0x7d')]['length'];_0x2eddeb+=0x1){if(_0x4f899b['joins'][_0x2eddeb]['type']&&_[_0xf3d2('0x64')](_0x207101,_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x7f')])&&_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x80')]&&_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x82')]&&_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x81')]){_0x4d1cc5[_0x4f899b['joins'][_0x2eddeb]['type']](_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x82')],null,util['format'](_0xf3d2('0x83'),_0x4f899b[_0xf3d2('0x74')],_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x80')],_0x4f899b['joins'][_0x2eddeb]['foreignTable'],_0x4f899b[_0xf3d2('0x7d')][_0x2eddeb][_0xf3d2('0x81')]));}}}if(_0x4f899b['conditions']){_0x4f899b[_0xf3d2('0x84')]=JSON[_0xf3d2('0x7e')](_0x4f899b[_0xf3d2('0x84')]);_0x4d1cc5[_0xf3d2('0x3c')](_0x22ad41(_0x4f899b[_0xf3d2('0x84')][_0xf3d2('0x6a')]));}_0x3a8946=_0x4d1cc5[_0xf3d2('0x85')]();_0x4d1cc5['limit'](_0x14b7a6);_0x4d1cc5[_0xf3d2('0x1f')](0x0);return;}})[_0xf3d2('0x28')](function(){if(_0x1b4dec['output']===_0xf3d2('0x93')){return null;}var _0x578a21=_['merge'](_0x1b4dec,{'name':_0x1b4dec['fullPath']||_0x1b4dec['name']||_0x4f899b[_0xf3d2('0x2b')],'basename':_0x44f5a1,'savename':util['format'](_0xf3d2('0x94'),_0x1b4dec[_0xf3d2('0x2b')]||_0x4f899b[_0xf3d2('0x2b')],require(_0xf3d2('0x95'))[_0xf3d2('0x96')](0x4),_0x1b4dec['output']||_0xf3d2('0x97')),'reportId':_0x4f899b['id'],'reportType':_0xf3d2('0x98')});return db['AnalyticExtractedReport']['create'](_0x578a21,{'raw':!![]});})['then'](function(_0x2d8aed){if(_0x4f899b[_0xf3d2('0x74')]===_0xf3d2('0x99')){_0x3a8946[_0xf3d2('0x3c')](_0x4f899b[_0xf3d2('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1b4dec[_0xf3d2('0x9a')],_0x1b4dec[_0xf3d2('0x9b')]);}else{_0x3a8946['where'](_0x4f899b['table']+_0xf3d2('0x9c'),_0x1b4dec[_0xf3d2('0x9a')],_0x1b4dec[_0xf3d2('0x9b')]);}if(_0x2d8aed){logger[_0xf3d2('0x9d')](_0xf3d2('0x9e'),_0x3a8946[_0xf3d2('0x88')]());require(_0xf3d2('0x9f'))[_0xf3d2('0xa0')](path['join'](__dirname,_0xf3d2('0xa1'),_0x2d8aed['output']),[_0x2d8aed['id'],_0x3a8946['toString'](),path['join'](__dirname,_0xf3d2('0xa2'),_0x2d8aed[_0xf3d2('0xa3')]),_0x44f5a1]);return _0x2d8aed;}else{var _0x72a8cf=squel[_0xf3d2('0x72')]();_0x72a8cf[_0xf3d2('0x73')]('('+_0x3a8946[_0xf3d2('0x88')]()+')',_0xf3d2('0xa4'));_0x72a8cf['field']('COUNT(*)',_0xf3d2('0x22'));_0x3a8946[_0xf3d2('0x21')](_0x1b4dec[_0xf3d2('0x21')]||_0x14b7a6);_0x3a8946[_0xf3d2('0x1f')](_0x1b4dec['offset']||0x0);return dbH[_0xf3d2('0x89')]['query'](_0x72a8cf[_0xf3d2('0x88')](),{'type':dbH['sequelize'][_0xf3d2('0xa5')][_0xf3d2('0x8a')]})[_0xf3d2('0x28')](function(_0x13dfad){if(!_0x13dfad[_0xf3d2('0x38')]){_0x34cc3c=0x0;}else{_0x34cc3c=_0x13dfad[0x0][_0xf3d2('0x22')]||0x0;}return dbH[_0xf3d2('0x89')]['query'](_0x3a8946[_0xf3d2('0x88')](),{'type':dbH['sequelize'][_0xf3d2('0xa5')][_0xf3d2('0x8a')]});})['then'](function(_0xb9778b){return{'rows':_0xb9778b||[],'count':_0x34cc3c};});}});}exports['run']=function(_0x247d0f,_0x6ebc59){return runReport(_0x247d0f[_0xf3d2('0x47')],_0x247d0f['query'],_0x247d0f['options'])[_0xf3d2('0x28')](respondWithResult(_0x6ebc59,null))[_0xf3d2('0x49')](handleError(_0x6ebc59,null));};exports[_0xf3d2('0xa6')]=runReport;exports['query']=function(_0x5c9ac8,_0x1a1d76){var _0x171cba=0xa;var _0x1421a6=['join',_0xf3d2('0x57'),_0xf3d2('0x58'),_0xf3d2('0x59')];var _0xc2994={'SUM':_0xf3d2('0x5a'),'COUNT':_0xf3d2('0x5b'),'COUNT DISTINCT':_0xf3d2('0x5c'),'MAX':_0xf3d2('0x8b'),'MIN':_0xf3d2('0x5d'),'AVG':_0xf3d2('0xa7'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf3d2('0x5e'),'GROUP_CONCAT DESC':_0xf3d2('0x5f')};var _0x1a2df6={'SEC_TO_TIME':_0xf3d2('0x60'),'DATE':'DATE(%s)','HOUR':_0xf3d2('0x8c'),'ROUND':_0xf3d2('0x62'),'UNIX_TIMESTAMP':_0xf3d2('0x63')};var _0x480f79=function(_0x134f27){return!_['includes']([_0xf3d2('0x65'),'IS\x20NOT\x20NULL',_0xf3d2('0x67'),'IS\x20NOT\x20EMPTY'],_0x134f27);};var _0x5bea41=function(_0x4314fe){if(!_0x4314fe||!_0x4314fe[_0xf3d2('0x69')][_0xf3d2('0x38')]){return'';}for(var _0x5608d6='(',_0x4450f0=0x0;_0x4450f0<_0x4314fe['rules'][_0xf3d2('0x38')];_0x4450f0+=0x1){_0x4450f0>0x0&&(_0x5608d6+='\x20'+_0x4314fe[_0xf3d2('0x68')]+'\x20');_0x5608d6+=_0x4314fe[_0xf3d2('0x69')][_0x4450f0][_0xf3d2('0x6a')]?_0x5bea41(_0x4314fe['rules'][_0x4450f0][_0xf3d2('0x6a')]):_0x4314fe[_0xf3d2('0x69')][_0x4450f0][_0xf3d2('0x6b')]+'\x20'+_0x4314fe[_0xf3d2('0x69')][_0x4450f0][_0xf3d2('0x6c')]+(_0x480f79(_0x4314fe[_0xf3d2('0x69')][_0x4450f0][_0xf3d2('0x6c')])?'\x20'+_0x4314fe[_0xf3d2('0x69')][_0x4450f0][_0xf3d2('0x8e')]:'');}return _0x5608d6+')';};var _0x56fc62={'where':{'id':_0x5c9ac8[_0xf3d2('0x47')]['id']}},_0x3b0326,_0x4a1e47,_0x365320,_0x146a66,_0x15c48d;_0x56fc62=_['merge']({},_0x56fc62,_0x5c9ac8[_0xf3d2('0x41')]);return db[_0xf3d2('0x42')][_0xf3d2('0x48')](_0x56fc62)['then'](function(_0x2b6b0e){if(_0x2b6b0e){_0x3b0326=_0x2b6b0e;return _0x2b6b0e[_0xf3d2('0x8f')]();}return null;})['then'](function(_0x3ecd1c){if(_0x3ecd1c){if(!_0x3ecd1c[_0xf3d2('0x38')]){throw new db[(_0xf3d2('0x90'))][(_0xf3d2('0x6d'))](_0xf3d2('0x6e'),0x193);}_0x4a1e47=_0x3ecd1c;return db[_0xf3d2('0x6f')][_0xf3d2('0x70')]({'raw':!![]});}return null;})['then'](function(_0x9df033){if(_0x9df033){_0x365320=_[_0xf3d2('0x71')](_0x9df033,'id');var _0x2b8101;var _0x146ccf=squel[_0xf3d2('0x72')]();_0x146ccf[_0xf3d2('0x73')](_0x3b0326[_0xf3d2('0x74')]);for(var _0x723f72=0x0;_0x723f72<_0x4a1e47['length'];_0x723f72+=0x1){_0x2b8101=_0x4a1e47[_0x723f72][_0xf3d2('0x91')]?_0x365320[_0x4a1e47[_0x723f72][_0xf3d2('0x91')]][_0xf3d2('0x75')]:_0x4a1e47[_0x723f72][_0xf3d2('0x6b')];_0x2b8101=_0x4a1e47[_0x723f72]['function']?_[_0xf3d2('0x77')](_0xc2994[_0x4a1e47[_0x723f72]['function']],'%s',_0x2b8101):_0x2b8101;_0x2b8101=_0x4a1e47[_0x723f72][_0xf3d2('0x78')]?_[_0xf3d2('0x77')](_0x1a2df6[_0x4a1e47[_0x723f72][_0xf3d2('0x78')]],'%s',_0x2b8101):_0x2b8101;if(_0x4a1e47[_0x723f72][_0xf3d2('0x79')]){_0x146ccf[_0xf3d2('0x6a')](_0x2b8101);}_0x4a1e47[_0x723f72][_0xf3d2('0x7a')]&&_0x146ccf[_0xf3d2('0x92')](_0x2b8101,_0x4a1e47[_0x723f72][_0xf3d2('0x7a')]===_0xf3d2('0x7b')?![]:!![]);_0x146ccf[_0xf3d2('0x6b')](_0x2b8101,_0x4a1e47[_0x723f72][_0xf3d2('0x7c')]||_0x2b8101);}if(_0x3b0326[_0xf3d2('0x7d')]){_0x3b0326[_0xf3d2('0x7d')]=JSON['parse'](_0x3b0326[_0xf3d2('0x7d')]);for(var _0x25dba0=0x0;_0x25dba0<_0x3b0326['joins'][_0xf3d2('0x38')];_0x25dba0+=0x1){if(_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x7f')]&&_['includes'](_0x1421a6,_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x7f')])&&_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x80')]&&_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x82')]&&_0x3b0326['joins'][_0x25dba0][_0xf3d2('0x81')]){_0x146ccf[_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x7f')]](_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x82')],null,util[_0xf3d2('0x78')]('%s.%s\x20=\x20%s.%s',_0x3b0326[_0xf3d2('0x74')],_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x80')],_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x82')],_0x3b0326[_0xf3d2('0x7d')][_0x25dba0][_0xf3d2('0x81')]));}}}if(_0x3b0326[_0xf3d2('0x84')]){_0x3b0326[_0xf3d2('0x84')]=JSON[_0xf3d2('0x7e')](_0x3b0326[_0xf3d2('0x84')]);_0x146ccf[_0xf3d2('0x3c')](_0x5bea41(_0x3b0326[_0xf3d2('0x84')][_0xf3d2('0x6a')]));}_0x15c48d=_0x146ccf[_0xf3d2('0x85')]();_0x146ccf[_0xf3d2('0x21')](_0x171cba);_0x146ccf[_0xf3d2('0x1f')](0x0);logger[_0xf3d2('0x86')](_0xf3d2('0x87'),_0x146ccf[_0xf3d2('0x88')]());return dbH[_0xf3d2('0x89')][_0xf3d2('0x32')](_0x146ccf[_0xf3d2('0x88')](),{'type':dbH[_0xf3d2('0x89')][_0xf3d2('0xa5')][_0xf3d2('0x8a')]});}})[_0xf3d2('0x28')](function(){return{'sql':_0x15c48d[_0xf3d2('0x88')]()};})[_0xf3d2('0x28')](respondWithResult(_0x1a1d76,null))[_0xf3d2('0x49')](handleError(_0x1a1d76,null));};
\ No newline at end of file
+var _0x898c=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NULL','order','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','right_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x1e0849,_0x4be10c){var _0x513ff9=function(_0x17dc0d){while(--_0x17dc0d){_0x1e0849['push'](_0x1e0849['shift']());}};_0x513ff9(++_0x4be10c);}(_0x898c,0x73));var _0xc898=function(_0xd637a3,_0x19b904){_0xd637a3=_0xd637a3-0x0;var _0x180a84=_0x898c[_0xd637a3];return _0x180a84;};'use strict';var emlformat=require(_0xc898('0x0'));var rimraf=require(_0xc898('0x1'));var zipdir=require(_0xc898('0x2'));var jsonpatch=require(_0xc898('0x3'));var rp=require(_0xc898('0x4'));var moment=require(_0xc898('0x5'));var BPromise=require(_0xc898('0x6'));var Mustache=require(_0xc898('0x7'));var util=require(_0xc898('0x8'));var path=require('path');var sox=require(_0xc898('0x9'));var csv=require(_0xc898('0xa'));var ejs=require(_0xc898('0xb'));var fs=require('fs');var fs_extra=require(_0xc898('0xc'));var _=require(_0xc898('0xd'));var squel=require('squel');var crypto=require(_0xc898('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc898('0xf'));var toCsv=require(_0xc898('0xa'));var querystring=require(_0xc898('0x10'));var Papa=require(_0xc898('0x11'));var Redis=require(_0xc898('0x12'));var authService=require(_0xc898('0x13'));var qs=require(_0xc898('0x14'));var as=require(_0xc898('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc898('0x16'))(_0xc898('0x17'));var utils=require(_0xc898('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc898('0x19'));var db=require(_0xc898('0x1a'))['db'];var dbH=require(_0xc898('0x1a'))['dbH'];function respondWithStatusCode(_0x21f745,_0x452184){_0x452184=_0x452184||0xcc;return function(_0x273c66){if(_0x273c66){return _0x21f745[_0xc898('0x1b')](_0x452184);}return _0x21f745[_0xc898('0x1c')](_0x452184)[_0xc898('0x1d')]();};}function respondWithResult(_0x36837c,_0x2dd4bd){_0x2dd4bd=_0x2dd4bd||0xc8;return function(_0x39fb51){if(_0x39fb51){return _0x36837c[_0xc898('0x1c')](_0x2dd4bd)[_0xc898('0x1e')](_0x39fb51);}};}function respondWithFilteredResult(_0xf30fed,_0x55bd83){return function(_0x2fec02){if(_0x2fec02){var _0x3a89ff=typeof _0x55bd83['offset']===_0xc898('0x1f')&&typeof _0x55bd83[_0xc898('0x20')]===_0xc898('0x1f');var _0x47c555=_0x2fec02['count'];var _0x3d7982=_0x3a89ff?0x0:_0x55bd83[_0xc898('0x21')];var _0x5e8c44=_0x3a89ff?_0x2fec02['count']:_0x55bd83[_0xc898('0x21')]+_0x55bd83[_0xc898('0x20')];var _0x2e8876;if(_0x5e8c44>=_0x47c555){_0x5e8c44=_0x47c555;_0x2e8876=0xc8;}else{_0x2e8876=0xce;}_0xf30fed['status'](_0x2e8876);return _0xf30fed[_0xc898('0x22')](_0xc898('0x23'),_0x3d7982+'-'+_0x5e8c44+'/'+_0x47c555)[_0xc898('0x1e')](_0x2fec02);}return null;};}function patchUpdates(_0x28a84f){return function(_0x4a1cec){try{jsonpatch[_0xc898('0x24')](_0x4a1cec,_0x28a84f,!![]);}catch(_0x53bbd6){return BPromise[_0xc898('0x25')](_0x53bbd6);}return _0x4a1cec[_0xc898('0x26')]();};}function saveUpdates(_0x133a35,_0x3e6c32){return function(_0x2ca497){if(_0x2ca497){return _0x2ca497[_0xc898('0x27')](_0x133a35)[_0xc898('0x28')](function(_0x27be7a){return _0x27be7a;});}return null;};}function removeEntity(_0xc63a39,_0x309669){return function(_0x470bbb){if(_0x470bbb){return _0x470bbb[_0xc898('0x29')]()['then'](function(){var _0x1be0b6=_0x470bbb[_0xc898('0x2a')]({'plain':!![]});var _0x3e6aed=_0xc898('0x2b');return db[_0xc898('0x2c')][_0xc898('0x29')]({'where':{'type':_0x3e6aed,'resourceId':_0x1be0b6['id']}})['then'](function(){return _0x470bbb;});})['then'](function(){_0xc63a39['status'](0xcc)[_0xc898('0x1d')]();});}};}function handleEntityNotFound(_0x249a54,_0x3b6db5){return function(_0x4015fc){if(!_0x4015fc){_0x249a54[_0xc898('0x1b')](0x194);}return _0x4015fc;};}function handleError(_0x147126,_0xf3c3ff){_0xf3c3ff=_0xf3c3ff||0x1f4;return function(_0x290a3b){logger[_0xc898('0x2d')](_0x290a3b[_0xc898('0x2e')]);if(_0x290a3b[_0xc898('0x2f')]){delete _0x290a3b['name'];}_0x147126['status'](_0xf3c3ff)[_0xc898('0x30')](_0x290a3b);};}exports['index']=function(_0x49232c,_0x5d82f7){var _0x9705f6={},_0x4122dd={},_0xad9ec7={'count':0x0,'rows':[]};var _0x5c6fdb=_[_0xc898('0x31')](db[_0xc898('0x32')][_0xc898('0x33')],function(_0x3242ab){return{'name':_0x3242ab[_0xc898('0x34')],'type':_0x3242ab[_0xc898('0x35')][_0xc898('0x36')]};});_0x4122dd['model']=_['map'](_0x5c6fdb,_0xc898('0x2f'));_0x4122dd[_0xc898('0x37')]=_[_0xc898('0x38')](_0x49232c['query']);_0x4122dd[_0xc898('0x39')]=_[_0xc898('0x3a')](_0x4122dd[_0xc898('0x3b')],_0x4122dd[_0xc898('0x37')]);_0x9705f6[_0xc898('0x3c')]=_[_0xc898('0x3a')](_0x4122dd[_0xc898('0x3b')],qs[_0xc898('0x3d')](_0x49232c[_0xc898('0x37')][_0xc898('0x3d')]));_0x9705f6[_0xc898('0x3c')]=_0x9705f6[_0xc898('0x3c')][_0xc898('0x3e')]?_0x9705f6[_0xc898('0x3c')]:_0x4122dd[_0xc898('0x3b')];if(!_0x49232c[_0xc898('0x37')][_0xc898('0x3f')](_0xc898('0x40'))){_0x9705f6[_0xc898('0x20')]=qs[_0xc898('0x20')](_0x49232c[_0xc898('0x37')]['limit']);_0x9705f6[_0xc898('0x21')]=qs[_0xc898('0x21')](_0x49232c[_0xc898('0x37')][_0xc898('0x21')]);}_0x9705f6['order']=qs[_0xc898('0x41')](_0x49232c['query'][_0xc898('0x41')]);_0x9705f6[_0xc898('0x42')]=qs[_0xc898('0x39')](_[_0xc898('0x43')](_0x49232c[_0xc898('0x37')],_0x4122dd['filters']),_0x5c6fdb);if(_0x49232c[_0xc898('0x37')][_0xc898('0x44')]){_0x9705f6[_0xc898('0x42')]=_[_0xc898('0x45')](_0x9705f6['where'],{'$or':_['map'](_0x5c6fdb,function(_0x2f79bf){if(_0x2f79bf[_0xc898('0x35')]!==_0xc898('0x46')){var _0x4ecb93={};_0x4ecb93[_0x2f79bf[_0xc898('0x2f')]]={'$like':'%'+_0x49232c['query'][_0xc898('0x44')]+'%'};return _0x4ecb93;}})});}_0x9705f6=_[_0xc898('0x45')]({},_0x9705f6,_0x49232c[_0xc898('0x47')]);var _0x5997cd={'where':_0x9705f6[_0xc898('0x42')]};return db[_0xc898('0x32')][_0xc898('0x48')](_0x5997cd)[_0xc898('0x28')](function(_0x37c310){_0xad9ec7[_0xc898('0x48')]=_0x37c310;if(_0x49232c[_0xc898('0x37')][_0xc898('0x49')]){_0x9705f6['include']=[{'all':!![]}];}return db[_0xc898('0x32')]['findAll'](_0x9705f6);})[_0xc898('0x28')](function(_0x26802c){_0xad9ec7[_0xc898('0x4a')]=_0x26802c;return _0xad9ec7;})[_0xc898('0x28')](respondWithFilteredResult(_0x5d82f7,_0x9705f6))[_0xc898('0x4b')](handleError(_0x5d82f7,null));};exports[_0xc898('0x4c')]=function(_0x3094ef,_0x212073){var _0x52875e={'raw':![],'where':{'id':_0x3094ef[_0xc898('0x4d')]['id']}},_0x24e03b={};_0x24e03b[_0xc898('0x3b')]=_['keys'](db[_0xc898('0x32')][_0xc898('0x33')]);_0x24e03b['query']=_['keys'](_0x3094ef[_0xc898('0x37')]);_0x24e03b[_0xc898('0x39')]=_[_0xc898('0x3a')](_0x24e03b[_0xc898('0x3b')],_0x24e03b['query']);_0x52875e['attributes']=_['intersection'](_0x24e03b[_0xc898('0x3b')],qs[_0xc898('0x3d')](_0x3094ef['query'][_0xc898('0x3d')]));_0x52875e[_0xc898('0x3c')]=_0x52875e['attributes'][_0xc898('0x3e')]?_0x52875e[_0xc898('0x3c')]:_0x24e03b[_0xc898('0x3b')];if(_0x3094ef[_0xc898('0x37')][_0xc898('0x49')]){_0x52875e[_0xc898('0x4e')]=[{'all':!![]}];}_0x52875e=_[_0xc898('0x45')]({},_0x52875e,_0x3094ef[_0xc898('0x47')]);return db['AnalyticCustomReport'][_0xc898('0x4f')](_0x52875e)[_0xc898('0x28')](handleEntityNotFound(_0x212073,null))[_0xc898('0x28')](respondWithResult(_0x212073,null))[_0xc898('0x4b')](handleError(_0x212073,null));};exports['create']=function(_0xe3b99a,_0x3200d9){return db[_0xc898('0x32')]['create'](_0xe3b99a[_0xc898('0x50')],{})['then'](function(_0x4ce0fd){var _0xe82920=_0xe3b99a['user'][_0xc898('0x2a')]({'plain':!![]});if(!_0xe82920)throw new Error(_0xc898('0x51'));if(_0xe82920[_0xc898('0x52')]===_0xc898('0x53')){var _0xef5a5d=_0x4ce0fd[_0xc898('0x2a')]({'plain':!![]});var _0x11d35b=_0xc898('0x54');return db['UserProfileSection'][_0xc898('0x4f')]({'where':{'name':_0x11d35b,'userProfileId':_0xe82920[_0xc898('0x55')]},'raw':!![]})[_0xc898('0x28')](function(_0x44c135){if(_0x44c135&&_0x44c135[_0xc898('0x56')]===0x0){return db['UserProfileResource'][_0xc898('0x57')]({'name':_0xef5a5d['name'],'resourceId':_0xef5a5d['id'],'type':_0xc898('0x2b'),'sectionId':_0x44c135['id']},{})[_0xc898('0x28')](function(){return _0x4ce0fd;});}else{return _0x4ce0fd;}})[_0xc898('0x4b')](function(_0x3a0d0b){logger[_0xc898('0x2d')](_0xc898('0x58'),_0x3a0d0b);throw _0x3a0d0b;});}return _0x4ce0fd;})[_0xc898('0x28')](respondWithResult(_0x3200d9,0xc9))[_0xc898('0x4b')](handleError(_0x3200d9,null));};exports[_0xc898('0x27')]=function(_0x19a7d6,_0x1f2fa5){if(_0x19a7d6['body']['id']){delete _0x19a7d6['body']['id'];}return db[_0xc898('0x32')]['find']({'where':{'id':_0x19a7d6[_0xc898('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f2fa5,null))['then'](saveUpdates(_0x19a7d6[_0xc898('0x50')],null))[_0xc898('0x28')](respondWithResult(_0x1f2fa5,null))[_0xc898('0x4b')](handleError(_0x1f2fa5,null));};exports[_0xc898('0x29')]=function(_0x5ae916,_0x492fe6){return db[_0xc898('0x32')]['find']({'where':{'id':_0x5ae916['params']['id']}})[_0xc898('0x28')](handleEntityNotFound(_0x492fe6,null))[_0xc898('0x28')](removeEntity(_0x492fe6,null))[_0xc898('0x4b')](handleError(_0x492fe6,null));};exports[_0xc898('0x59')]=function(_0x2f2f3,_0xed02d7){var _0x2c397f=0xa;var _0x5a5ce7=[_0xc898('0x5a'),_0xc898('0x5b'),'right_join',_0xc898('0x5c')];var _0x4fa8cf={'SUM':_0xc898('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc898('0x5e'),'MAX':_0xc898('0x5f'),'MIN':'MIN(%s)','AVG':_0xc898('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x996029={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc898('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc898('0x62')};var _0x5f10c7=function(_0x1d33b6){return!_[_0xc898('0x63')](['IS\x20NULL',_0xc898('0x64'),_0xc898('0x65'),_0xc898('0x66')],_0x1d33b6);};var _0x557f2d=function(_0x1d72f2){if(!_0x1d72f2||!_0x1d72f2['rules'][_0xc898('0x3e')]){return'';}for(var _0x129593='(',_0x94ac17=0x0;_0x94ac17<_0x1d72f2[_0xc898('0x67')]['length'];_0x94ac17+=0x1){_0x94ac17>0x0&&(_0x129593+='\x20'+_0x1d72f2[_0xc898('0x68')]+'\x20');_0x129593+=_0x1d72f2[_0xc898('0x67')][_0x94ac17]['group']?_0x557f2d(_0x1d72f2[_0xc898('0x67')][_0x94ac17][_0xc898('0x69')]):_0x1d72f2[_0xc898('0x67')][_0x94ac17]['field']+'\x20'+_0x1d72f2[_0xc898('0x67')][_0x94ac17][_0xc898('0x6a')]+(_0x5f10c7(_0x1d72f2[_0xc898('0x67')][_0x94ac17][_0xc898('0x6a')])?'\x20'+_0x1d72f2[_0xc898('0x67')][_0x94ac17][_0xc898('0x6b')]:'');}return _0x129593+')';};var _0x34398e={'where':{'id':_0x2f2f3['params']['id']}},_0x3990f5,_0x336f0f,_0x190d2b,_0x10b1d2,_0xce8318;_0x34398e=_[_0xc898('0x45')]({},_0x34398e,_0x2f2f3[_0xc898('0x47')]);return db[_0xc898('0x32')]['find'](_0x34398e)[_0xc898('0x28')](function(_0xa3a8cf){if(_0xa3a8cf){_0x3990f5=_0xa3a8cf;return _0xa3a8cf[_0xc898('0x6c')]();}return null;})[_0xc898('0x28')](function(_0x296351){if(_0x296351){if(!_0x296351['length']){throw new db[(_0xc898('0x6d'))][(_0xc898('0x6e'))](_0xc898('0x6f'),0x193);}_0x336f0f=_0x296351;return db[_0xc898('0x70')][_0xc898('0x71')]({'raw':!![]});}return null;})[_0xc898('0x28')](function(_0x29d848){if(_0x29d848){_0x190d2b=_[_0xc898('0x72')](_0x29d848,'id');var _0x475574;var _0x1aa995=squel[_0xc898('0x73')]();_0x1aa995[_0xc898('0x74')](_0x3990f5['table']);for(var _0x42cdab=0x0;_0x42cdab<_0x336f0f['length'];_0x42cdab+=0x1){_0x475574=_0x336f0f[_0x42cdab][_0xc898('0x75')]?_0x190d2b[_0x336f0f[_0x42cdab][_0xc898('0x75')]][_0xc898('0x76')]:_0x336f0f[_0x42cdab][_0xc898('0x77')];_0x475574=_0x336f0f[_0x42cdab][_0xc898('0x78')]?_[_0xc898('0x79')](_0x4fa8cf[_0x336f0f[_0x42cdab]['function']],'%s',_0x475574):_0x475574;_0x475574=_0x336f0f[_0x42cdab][_0xc898('0x7a')]?_[_0xc898('0x79')](_0x996029[_0x336f0f[_0x42cdab][_0xc898('0x7a')]],'%s',_0x475574):_0x475574;if(_0x336f0f[_0x42cdab][_0xc898('0x7b')]){_0x1aa995['group'](_0x475574);}_0x336f0f[_0x42cdab][_0xc898('0x7c')]&&_0x1aa995['order'](_0x475574,_0x336f0f[_0x42cdab]['orderBy']===_0xc898('0x7d')?![]:!![]);_0x1aa995[_0xc898('0x77')](_0x475574,_0x336f0f[_0x42cdab][_0xc898('0x7e')]||_0x475574);}if(_0x3990f5[_0xc898('0x7f')]){_0x3990f5[_0xc898('0x7f')]=JSON[_0xc898('0x80')](_0x3990f5['joins']);for(var _0x113e6f=0x0;_0x113e6f<_0x3990f5[_0xc898('0x7f')][_0xc898('0x3e')];_0x113e6f+=0x1){if(_0x3990f5['joins'][_0x113e6f][_0xc898('0x35')]&&_['includes'](_0x5a5ce7,_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x35')])&&_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x81')]&&_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x82')]&&_0x3990f5[_0xc898('0x7f')][_0x113e6f]['foreignKey']){_0x1aa995[_0x3990f5[_0xc898('0x7f')][_0x113e6f]['type']](_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x82')],null,util[_0xc898('0x7a')](_0xc898('0x83'),_0x3990f5[_0xc898('0x84')],_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x81')],_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x82')],_0x3990f5[_0xc898('0x7f')][_0x113e6f][_0xc898('0x85')]));}}}if(_0x3990f5[_0xc898('0x86')]){_0x3990f5[_0xc898('0x86')]=JSON[_0xc898('0x80')](_0x3990f5[_0xc898('0x86')]);_0x1aa995[_0xc898('0x42')](_0x557f2d(_0x3990f5[_0xc898('0x86')][_0xc898('0x69')]));}_0xce8318=_0x1aa995['clone']();_0x1aa995[_0xc898('0x20')](_0x2c397f);_0x1aa995[_0xc898('0x21')](0x0);logger[_0xc898('0x87')]('Limited\x20Query:',_0x1aa995[_0xc898('0x88')]());return dbH[_0xc898('0x89')][_0xc898('0x37')](_0x1aa995['toString'](),{'type':dbH[_0xc898('0x89')][_0xc898('0x8a')][_0xc898('0x8b')]});}})[_0xc898('0x28')](respondWithResult(_0xed02d7,null))['catch'](handleError(_0xed02d7,null));};function runReport(_0x3a3593,_0x340824,_0x55cad1){var _0x309473=_0x340824[_0xc898('0x2f')];var _0x25de53=0xa;var _0x2a2a6e=[_0xc898('0x5a'),_0xc898('0x5b'),'right_join','cross_join'];var _0x3c4296={'SUM':_0xc898('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xc898('0x60'),'GROUP_CONCAT':_0xc898('0x8c'),'GROUP_CONCAT ASC':_0xc898('0x8d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x32c89a={'SEC_TO_TIME':_0xc898('0x8e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xc898('0x8f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3e8cb9=function(_0x446751){return!_[_0xc898('0x63')]([_0xc898('0x90'),_0xc898('0x64'),_0xc898('0x65'),_0xc898('0x66')],_0x446751);};var _0x16f7f5=function(_0x36900a){if(!_0x36900a||!_0x36900a[_0xc898('0x67')][_0xc898('0x3e')]){return'';}for(var _0x5acc94='(',_0xe4a996=0x0;_0xe4a996<_0x36900a['rules']['length'];_0xe4a996+=0x1){_0xe4a996>0x0&&(_0x5acc94+='\x20'+_0x36900a[_0xc898('0x68')]+'\x20');_0x5acc94+=_0x36900a[_0xc898('0x67')][_0xe4a996][_0xc898('0x69')]?_0x16f7f5(_0x36900a[_0xc898('0x67')][_0xe4a996][_0xc898('0x69')]):_0x36900a[_0xc898('0x67')][_0xe4a996][_0xc898('0x77')]+'\x20'+_0x36900a[_0xc898('0x67')][_0xe4a996][_0xc898('0x6a')]+(_0x3e8cb9(_0x36900a[_0xc898('0x67')][_0xe4a996][_0xc898('0x6a')])?'\x20'+_0x36900a['rules'][_0xe4a996]['value']:'');}return _0x5acc94+')';};var _0x1d40f4={'where':{'id':_0x3a3593['id']}},_0x5035b6,_0xd26830,_0x36c104,_0x249b29,_0x4d180f;_0x1d40f4=_['merge']({},_0x1d40f4,_0x55cad1);return db['AnalyticCustomReport'][_0xc898('0x4f')](_0x1d40f4)[_0xc898('0x28')](function(_0xb0afe4){if(_0xb0afe4){_0x5035b6=_0xb0afe4;return _0xb0afe4[_0xc898('0x6c')]();}return null;})[_0xc898('0x28')](function(_0xe537f9){if(_0xe537f9){if(!_0xe537f9['length']){throw new db[(_0xc898('0x6d'))][(_0xc898('0x6e'))](_0xc898('0x6f'),0x193);}_0xd26830=_0xe537f9;return db[_0xc898('0x70')]['findAll']({'raw':!![]});}return null;})[_0xc898('0x28')](function(_0x62e4d){if(_0x62e4d){_0x36c104=_['keyBy'](_0x62e4d,'id');var _0x1a09cb;var _0x5820a5=squel[_0xc898('0x73')]();_0x5820a5['from'](_0x5035b6['table']);for(var _0x1ed4bf=0x0;_0x1ed4bf<_0xd26830[_0xc898('0x3e')];_0x1ed4bf+=0x1){_0x1a09cb=_0xd26830[_0x1ed4bf]['MetricId']?_0x36c104[_0xd26830[_0x1ed4bf][_0xc898('0x75')]][_0xc898('0x76')]:_0xd26830[_0x1ed4bf][_0xc898('0x77')];_0x1a09cb=_0xd26830[_0x1ed4bf][_0xc898('0x78')]?_[_0xc898('0x79')](_0x3c4296[_0xd26830[_0x1ed4bf][_0xc898('0x78')]],'%s',_0x1a09cb):_0x1a09cb;_0x1a09cb=_0xd26830[_0x1ed4bf][_0xc898('0x7a')]?_[_0xc898('0x79')](_0x32c89a[_0xd26830[_0x1ed4bf][_0xc898('0x7a')]],'%s',_0x1a09cb):_0x1a09cb;if(_0xd26830[_0x1ed4bf][_0xc898('0x7b')]){_0x5820a5[_0xc898('0x69')](_0x1a09cb);}_0xd26830[_0x1ed4bf][_0xc898('0x7c')]&&_0x5820a5[_0xc898('0x91')](_0x1a09cb,_0xd26830[_0x1ed4bf][_0xc898('0x7c')]===_0xc898('0x7d')?![]:!![]);_0x5820a5[_0xc898('0x77')](_0x1a09cb,_0xd26830[_0x1ed4bf][_0xc898('0x7e')]||_0x1a09cb);}if(_0x5035b6[_0xc898('0x7f')]){_0x5035b6[_0xc898('0x7f')]=JSON[_0xc898('0x80')](_0x5035b6['joins']);for(var _0x120633=0x0;_0x120633<_0x5035b6[_0xc898('0x7f')]['length'];_0x120633+=0x1){if(_0x5035b6[_0xc898('0x7f')][_0x120633][_0xc898('0x35')]&&_[_0xc898('0x63')](_0x2a2a6e,_0x5035b6['joins'][_0x120633][_0xc898('0x35')])&&_0x5035b6['joins'][_0x120633][_0xc898('0x81')]&&_0x5035b6[_0xc898('0x7f')][_0x120633]['foreignTable']&&_0x5035b6['joins'][_0x120633][_0xc898('0x85')]){_0x5820a5[_0x5035b6['joins'][_0x120633][_0xc898('0x35')]](_0x5035b6['joins'][_0x120633][_0xc898('0x82')],null,util[_0xc898('0x7a')]('%s.%s\x20=\x20%s.%s',_0x5035b6[_0xc898('0x84')],_0x5035b6['joins'][_0x120633][_0xc898('0x81')],_0x5035b6['joins'][_0x120633][_0xc898('0x82')],_0x5035b6['joins'][_0x120633][_0xc898('0x85')]));}}}if(_0x5035b6['conditions']){_0x5035b6['conditions']=JSON[_0xc898('0x80')](_0x5035b6[_0xc898('0x86')]);_0x5820a5[_0xc898('0x42')](_0x16f7f5(_0x5035b6['conditions'][_0xc898('0x69')]));}_0x4d180f=_0x5820a5[_0xc898('0x92')]();_0x5820a5[_0xc898('0x20')](_0x25de53);_0x5820a5[_0xc898('0x21')](0x0);return;}})[_0xc898('0x28')](function(){if(_0x340824[_0xc898('0x93')]===_0xc898('0x94')){return null;}var _0x32be6d=_[_0xc898('0x45')](_0x340824,{'name':_0x340824[_0xc898('0x95')]||_0x340824[_0xc898('0x2f')]||_0x5035b6[_0xc898('0x2f')],'basename':_0x309473,'savename':util[_0xc898('0x7a')](_0xc898('0x96'),_0x340824[_0xc898('0x2f')]||_0x5035b6['name'],require(_0xc898('0x97'))[_0xc898('0x98')](0x4),_0x340824[_0xc898('0x93')]||_0xc898('0x99')),'reportId':_0x5035b6['id'],'reportType':_0xc898('0x9a')});return db[_0xc898('0x9b')][_0xc898('0x57')](_0x32be6d,{'raw':!![]});})[_0xc898('0x28')](function(_0x4f8e78){if(_0x5035b6[_0xc898('0x84')]==='cdr'){_0x4d180f[_0xc898('0x42')](_0x5035b6[_0xc898('0x84')]+_0xc898('0x9c'),_0x340824['startDate'],_0x340824[_0xc898('0x9d')]);}else{_0x4d180f[_0xc898('0x42')](_0x5035b6[_0xc898('0x84')]+_0xc898('0x9e'),_0x340824[_0xc898('0x9f')],_0x340824[_0xc898('0x9d')]);}if(_0x4f8e78){logger[_0xc898('0xa0')]('Run\x20Query:',_0x4d180f[_0xc898('0x88')]());require(_0xc898('0xa1'))['fork'](path[_0xc898('0x5a')](__dirname,_0xc898('0xa2'),_0x4f8e78[_0xc898('0x93')]),[_0x4f8e78['id'],_0x4d180f['toString'](),path[_0xc898('0x5a')](__dirname,_0xc898('0xa3'),_0x4f8e78[_0xc898('0xa4')]),_0x309473]);return _0x4f8e78;}else{var _0x3c915c=squel['select']();_0x3c915c[_0xc898('0x74')]('('+_0x4d180f['toString']()+')',_0xc898('0xa5'));_0x3c915c[_0xc898('0x77')](_0xc898('0xa6'),_0xc898('0x48'));_0x4d180f[_0xc898('0x20')](_0x340824[_0xc898('0x20')]||_0x25de53);_0x4d180f[_0xc898('0x21')](_0x340824[_0xc898('0x21')]||0x0);return dbH[_0xc898('0x89')][_0xc898('0x37')](_0x3c915c[_0xc898('0x88')](),{'type':dbH[_0xc898('0x89')][_0xc898('0x8a')][_0xc898('0x8b')]})[_0xc898('0x28')](function(_0x56fd31){if(!_0x56fd31[_0xc898('0x3e')]){_0x249b29=0x0;}else{_0x249b29=_0x56fd31[0x0][_0xc898('0x48')]||0x0;}return dbH['sequelize'][_0xc898('0x37')](_0x4d180f[_0xc898('0x88')](),{'type':dbH['sequelize'][_0xc898('0x8a')]['SELECT']});})[_0xc898('0x28')](function(_0x4dcde7){return{'rows':_0x4dcde7||[],'count':_0x249b29};});}});}exports[_0xc898('0xa7')]=function(_0x49574d,_0x54b014){return runReport(_0x49574d[_0xc898('0x4d')],_0x49574d[_0xc898('0x37')],_0x49574d[_0xc898('0x47')])[_0xc898('0x28')](respondWithResult(_0x54b014,null))['catch'](handleError(_0x54b014,null));};exports[_0xc898('0xa8')]=runReport;exports[_0xc898('0x37')]=function(_0x155971,_0x410acc){var _0x2ef64a=0xa;var _0xcd5f6c=[_0xc898('0x5a'),_0xc898('0x5b'),_0xc898('0xa9'),_0xc898('0x5c')];var _0x3c5ac2={'SUM':_0xc898('0x5d'),'COUNT':_0xc898('0xaa'),'COUNT DISTINCT':_0xc898('0x5e'),'MAX':'MAX(%s)','MIN':_0xc898('0xab'),'AVG':_0xc898('0x60'),'GROUP_CONCAT':_0xc898('0x8c'),'GROUP_CONCAT ASC':_0xc898('0x8d'),'GROUP_CONCAT DESC':_0xc898('0xac')};var _0x3e9788={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc898('0x61'),'HOUR':_0xc898('0xad'),'ROUND':_0xc898('0x8f'),'UNIX_TIMESTAMP':_0xc898('0x62')};var _0x10824b=function(_0x566906){return!_[_0xc898('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc898('0x65'),'IS\x20NOT\x20EMPTY'],_0x566906);};var _0x12e997=function(_0x58f8b1){if(!_0x58f8b1||!_0x58f8b1[_0xc898('0x67')][_0xc898('0x3e')]){return'';}for(var _0x28af93='(',_0x566ccb=0x0;_0x566ccb<_0x58f8b1['rules'][_0xc898('0x3e')];_0x566ccb+=0x1){_0x566ccb>0x0&&(_0x28af93+='\x20'+_0x58f8b1[_0xc898('0x68')]+'\x20');_0x28af93+=_0x58f8b1[_0xc898('0x67')][_0x566ccb][_0xc898('0x69')]?_0x12e997(_0x58f8b1['rules'][_0x566ccb][_0xc898('0x69')]):_0x58f8b1[_0xc898('0x67')][_0x566ccb][_0xc898('0x77')]+'\x20'+_0x58f8b1[_0xc898('0x67')][_0x566ccb][_0xc898('0x6a')]+(_0x10824b(_0x58f8b1[_0xc898('0x67')][_0x566ccb]['condition'])?'\x20'+_0x58f8b1[_0xc898('0x67')][_0x566ccb]['value']:'');}return _0x28af93+')';};var _0x253f27={'where':{'id':_0x155971[_0xc898('0x4d')]['id']}},_0x2b3c44,_0x41e008,_0x394005,_0x223cb5,_0x527ec1;_0x253f27=_[_0xc898('0x45')]({},_0x253f27,_0x155971[_0xc898('0x47')]);return db[_0xc898('0x32')][_0xc898('0x4f')](_0x253f27)[_0xc898('0x28')](function(_0x3c8355){if(_0x3c8355){_0x2b3c44=_0x3c8355;return _0x3c8355['getFields']();}return null;})[_0xc898('0x28')](function(_0x204e5f){if(_0x204e5f){if(!_0x204e5f['length']){throw new db['Sequelize'][(_0xc898('0x6e'))](_0xc898('0x6f'),0x193);}_0x41e008=_0x204e5f;return db[_0xc898('0x70')][_0xc898('0x71')]({'raw':!![]});}return null;})[_0xc898('0x28')](function(_0x43aeed){if(_0x43aeed){_0x394005=_[_0xc898('0x72')](_0x43aeed,'id');var _0x171edd;var _0x3d6943=squel[_0xc898('0x73')]();_0x3d6943['from'](_0x2b3c44[_0xc898('0x84')]);for(var _0x26c54d=0x0;_0x26c54d<_0x41e008['length'];_0x26c54d+=0x1){_0x171edd=_0x41e008[_0x26c54d][_0xc898('0x75')]?_0x394005[_0x41e008[_0x26c54d][_0xc898('0x75')]][_0xc898('0x76')]:_0x41e008[_0x26c54d][_0xc898('0x77')];_0x171edd=_0x41e008[_0x26c54d][_0xc898('0x78')]?_[_0xc898('0x79')](_0x3c5ac2[_0x41e008[_0x26c54d]['function']],'%s',_0x171edd):_0x171edd;_0x171edd=_0x41e008[_0x26c54d][_0xc898('0x7a')]?_['replace'](_0x3e9788[_0x41e008[_0x26c54d]['format']],'%s',_0x171edd):_0x171edd;if(_0x41e008[_0x26c54d][_0xc898('0x7b')]){_0x3d6943['group'](_0x171edd);}_0x41e008[_0x26c54d][_0xc898('0x7c')]&&_0x3d6943[_0xc898('0x91')](_0x171edd,_0x41e008[_0x26c54d]['orderBy']===_0xc898('0x7d')?![]:!![]);_0x3d6943[_0xc898('0x77')](_0x171edd,_0x41e008[_0x26c54d][_0xc898('0x7e')]||_0x171edd);}if(_0x2b3c44[_0xc898('0x7f')]){_0x2b3c44[_0xc898('0x7f')]=JSON[_0xc898('0x80')](_0x2b3c44[_0xc898('0x7f')]);for(var _0x59894e=0x0;_0x59894e<_0x2b3c44[_0xc898('0x7f')]['length'];_0x59894e+=0x1){if(_0x2b3c44['joins'][_0x59894e]['type']&&_[_0xc898('0x63')](_0xcd5f6c,_0x2b3c44['joins'][_0x59894e][_0xc898('0x35')])&&_0x2b3c44[_0xc898('0x7f')][_0x59894e]['parentKey']&&_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x82')]&&_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x85')]){_0x3d6943[_0x2b3c44[_0xc898('0x7f')][_0x59894e]['type']](_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x82')],null,util['format'](_0xc898('0x83'),_0x2b3c44[_0xc898('0x84')],_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x81')],_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x82')],_0x2b3c44[_0xc898('0x7f')][_0x59894e][_0xc898('0x85')]));}}}if(_0x2b3c44[_0xc898('0x86')]){_0x2b3c44[_0xc898('0x86')]=JSON[_0xc898('0x80')](_0x2b3c44[_0xc898('0x86')]);_0x3d6943[_0xc898('0x42')](_0x12e997(_0x2b3c44['conditions'][_0xc898('0x69')]));}_0x527ec1=_0x3d6943[_0xc898('0x92')]();_0x3d6943[_0xc898('0x20')](_0x2ef64a);_0x3d6943[_0xc898('0x21')](0x0);logger[_0xc898('0x87')](_0xc898('0xae'),_0x3d6943[_0xc898('0x88')]());return dbH[_0xc898('0x89')]['query'](_0x3d6943[_0xc898('0x88')](),{'type':dbH['sequelize'][_0xc898('0x8a')][_0xc898('0x8b')]});}})[_0xc898('0x28')](function(){return{'sql':_0x527ec1[_0xc898('0x88')]()};})[_0xc898('0x28')](respondWithResult(_0x410acc,null))[_0xc898('0x4b')](handleError(_0x410acc,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 0ab2eb2..fa2398d 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 _0x4215=['request-promise','path','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api'];(function(_0xc4aab1,_0xd8d562){var _0x4228bf=function(_0x5e31a3){while(--_0x5e31a3){_0xc4aab1['push'](_0xc4aab1['shift']());}};_0x4228bf(++_0xd8d562);}(_0x4215,0x9f));var _0x5421=function(_0x35ef7a,_0x2b3df3){_0x35ef7a=_0x35ef7a-0x0;var _0x3e1c56=_0x4215[_0x35ef7a];return _0x3e1c56;};'use strict';var _=require(_0x5421('0x0'));var util=require(_0x5421('0x1'));var logger=require('../../config/logger')(_0x5421('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5421('0x3'));var fs=require('fs');var path=require(_0x5421('0x4'));var rimraf=require('rimraf');var config=require(_0x5421('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x402e87,_0x3599ab){return _0x402e87[_0x5421('0x6')](_0x5421('0x7'),attributes,{'tableName':_0x5421('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2639=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define'];(function(_0x35fa8a,_0x4092e0){var _0x2d35af=function(_0x5c9e4c){while(--_0x5c9e4c){_0x35fa8a['push'](_0x35fa8a['shift']());}};_0x2d35af(++_0x4092e0);}(_0x2639,0x144));var _0x9263=function(_0x548b86,_0x263139){_0x548b86=_0x548b86-0x0;var _0x5325d7=_0x2639[_0x548b86];return _0x5325d7;};'use strict';var _=require(_0x9263('0x0'));var util=require(_0x9263('0x1'));var logger=require(_0x9263('0x2'))(_0x9263('0x3'));var moment=require(_0x9263('0x4'));var BPromise=require(_0x9263('0x5'));var rp=require(_0x9263('0x6'));var fs=require('fs');var path=require(_0x9263('0x7'));var rimraf=require(_0x9263('0x8'));var config=require('../../config/environment');var attributes=require(_0x9263('0x9'));module[_0x9263('0xa')]=function(_0x259962,_0x5673d6){return _0x259962[_0x9263('0xb')](_0x9263('0xc'),attributes,{'tableName':_0x9263('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index a7edad0..dcaed24 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 _0x4e8e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis'];(function(_0x55ef5b,_0x4db02f){var _0x49e4c7=function(_0x18f51f){while(--_0x18f51f){_0x55ef5b['push'](_0x55ef5b['shift']());}};_0x49e4c7(++_0x4db02f);}(_0x4e8e,0xd4));var _0xe4e8=function(_0x581da8,_0x2348ed){_0x581da8=_0x581da8-0x0;var _0x295bec=_0x4e8e[_0x581da8];return _0x295bec;};'use strict';var _=require(_0xe4e8('0x0'));var util=require(_0xe4e8('0x1'));var moment=require(_0xe4e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4e8('0x3'));var db=require(_0xe4e8('0x4'))['db'];var utils=require(_0xe4e8('0x5'));var logger=require(_0xe4e8('0x6'))(_0xe4e8('0x7'));var config=require(_0xe4e8('0x8'));var jayson=require(_0xe4e8('0x9'));var client=jayson[_0xe4e8('0xa')][_0xe4e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16fedf,_0x46af29,_0x22a2d6){return new BPromise(function(_0x15e286,_0x567094){return client[_0xe4e8('0xc')](_0x16fedf,_0x22a2d6)[_0xe4e8('0xd')](function(_0x13917d){logger[_0xe4e8('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x46af29,_0xe4e8('0xf'));logger[_0xe4e8('0x10')](_0xe4e8('0x11'),_0x46af29,_0xe4e8('0xf'),JSON[_0xe4e8('0x12')](_0x13917d));if(_0x13917d[_0xe4e8('0x13')]){if(_0x13917d[_0xe4e8('0x13')][_0xe4e8('0x14')]===0x1f4){logger[_0xe4e8('0x13')](_0xe4e8('0x15'),_0x46af29,_0x13917d[_0xe4e8('0x13')][_0xe4e8('0x16')]);return _0x567094(_0x13917d[_0xe4e8('0x13')][_0xe4e8('0x16')]);}logger[_0xe4e8('0x13')](_0xe4e8('0x15'),_0x46af29,_0x13917d['error']['message']);return _0x15e286(_0x13917d[_0xe4e8('0x13')][_0xe4e8('0x16')]);}else{logger[_0xe4e8('0xe')](_0xe4e8('0x15'),_0x46af29,'request\x20sent');_0x15e286(_0x13917d['result'][_0xe4e8('0x16')]);}})[_0xe4e8('0x17')](function(_0x4996b4){logger[_0xe4e8('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x46af29,_0x4996b4);_0x567094(_0x4996b4);});});}
\ No newline at end of file
+var _0x45b1=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x45b1,0xfb));var _0x145b=function(_0x1ec6e5,_0x18dd4d){_0x1ec6e5=_0x1ec6e5-0x0;var _0x446062=_0x45b1[_0x1ec6e5];return _0x446062;};'use strict';var _=require(_0x145b('0x0'));var util=require(_0x145b('0x1'));var moment=require(_0x145b('0x2'));var BPromise=require(_0x145b('0x3'));var rs=require(_0x145b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145b('0x5'))['db'];var utils=require(_0x145b('0x6'));var logger=require(_0x145b('0x7'))(_0x145b('0x8'));var config=require(_0x145b('0x9'));var jayson=require(_0x145b('0xa'));var client=jayson[_0x145b('0xb')][_0x145b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e248f,_0x406221,_0x122e6d){return new BPromise(function(_0x5cbc8e,_0x378fe1){return client[_0x145b('0xd')](_0x2e248f,_0x122e6d)[_0x145b('0xe')](function(_0x1bfeeb){logger['info'](_0x145b('0xf'),_0x406221,_0x145b('0x10'));logger[_0x145b('0x11')](_0x145b('0x12'),_0x406221,_0x145b('0x10'),JSON['stringify'](_0x1bfeeb));if(_0x1bfeeb[_0x145b('0x13')]){if(_0x1bfeeb[_0x145b('0x13')]['code']===0x1f4){logger[_0x145b('0x13')](_0x145b('0xf'),_0x406221,_0x1bfeeb[_0x145b('0x13')][_0x145b('0x14')]);return _0x378fe1(_0x1bfeeb[_0x145b('0x13')][_0x145b('0x14')]);}logger[_0x145b('0x13')](_0x145b('0xf'),_0x406221,_0x1bfeeb[_0x145b('0x13')][_0x145b('0x14')]);return _0x5cbc8e(_0x1bfeeb[_0x145b('0x13')][_0x145b('0x14')]);}else{logger['info'](_0x145b('0xf'),_0x406221,_0x145b('0x10'));_0x5cbc8e(_0x1bfeeb[_0x145b('0x15')][_0x145b('0x14')]);}})[_0x145b('0x16')](function(_0x18e253){logger[_0x145b('0x13')](_0x145b('0xf'),_0x406221,_0x18e253);_0x378fe1(_0x18e253);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index e20a295..f65c3fd 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 _0x67a4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','/:id','isAuthenticated','get','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x37bd46,_0x2cd9de){var _0x560101=function(_0x447878){while(--_0x447878){_0x37bd46['push'](_0x37bd46['shift']());}};_0x560101(++_0x2cd9de);}(_0x67a4,0x141));var _0x467a=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x67a4[_0x51e79c];return _0x2467be;};'use strict';var multer=require(_0x467a('0x0'));var util=require(_0x467a('0x1'));var path=require(_0x467a('0x2'));var timeout=require(_0x467a('0x3'));var express=require(_0x467a('0x4'));var router=express[_0x467a('0x5')]();var fs_extra=require(_0x467a('0x6'));var auth=require(_0x467a('0x7'));var interaction=require(_0x467a('0x8'));var config=require(_0x467a('0x9'));var controller=require(_0x467a('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x467a('0xb')]);router['get'](_0x467a('0xc'),auth[_0x467a('0xd')](),controller['show']);router[_0x467a('0xe')](_0x467a('0xf'),auth[_0x467a('0xd')](),controller[_0x467a('0x10')]);router['get']('/:id/run',auth[_0x467a('0xd')](),controller[_0x467a('0x11')]);router['get'](_0x467a('0x12'),auth[_0x467a('0xd')](),controller['query']);router[_0x467a('0x13')]('/',auth[_0x467a('0xd')](),controller[_0x467a('0x14')]);router[_0x467a('0x15')](_0x467a('0xc'),auth[_0x467a('0xd')](),controller[_0x467a('0x16')]);router[_0x467a('0x17')]('/:id',auth[_0x467a('0xd')](),controller['destroy']);module[_0x467a('0x18')]=router;
\ No newline at end of file
+var _0xc082=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','preview','/:id/run','/:id/query','query','create','put','update','delete','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc082,0x12b));var _0x2c08=function(_0x2251d3,_0xdd6bdc){_0x2251d3=_0x2251d3-0x0;var _0x512535=_0xc082[_0x2251d3];return _0x512535;};'use strict';var multer=require(_0x2c08('0x0'));var util=require(_0x2c08('0x1'));var path=require(_0x2c08('0x2'));var timeout=require(_0x2c08('0x3'));var express=require(_0x2c08('0x4'));var router=express['Router']();var fs_extra=require(_0x2c08('0x5'));var auth=require(_0x2c08('0x6'));var interaction=require(_0x2c08('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x2c08('0x8')]('/',auth[_0x2c08('0x9')](),controller[_0x2c08('0xa')]);router[_0x2c08('0x8')](_0x2c08('0xb'),auth[_0x2c08('0x9')](),controller['show']);router[_0x2c08('0x8')]('/:id/preview',auth[_0x2c08('0x9')](),controller[_0x2c08('0xc')]);router[_0x2c08('0x8')](_0x2c08('0xd'),auth[_0x2c08('0x9')](),controller['run']);router[_0x2c08('0x8')](_0x2c08('0xe'),auth['isAuthenticated'](),controller[_0x2c08('0xf')]);router['post']('/',auth[_0x2c08('0x9')](),controller[_0x2c08('0x10')]);router[_0x2c08('0x11')](_0x2c08('0xb'),auth[_0x2c08('0x9')](),controller[_0x2c08('0x12')]);router[_0x2c08('0x13')](_0x2c08('0xb'),auth[_0x2c08('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index c3f2f18..3a96d52 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x5fd1,0x155));var _0x15fd=function(_0x8f7ade,_0x54464b){_0x8f7ade=_0x8f7ade-0x0;var _0x6a72e=_0x5fd1[_0x8f7ade];return _0x6a72e;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x2675,0x75));var _0x5267=function(_0x185161,_0x2a99bb){_0x185161=_0x185161-0x0;var _0x4ad80a=_0x2675[_0x185161];return _0x4ad80a;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7ef0c93..92f8e9f 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 _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x50bba0,_0x7be6d4){var _0x5e2db0=function(_0x4f4ed8){while(--_0x4f4ed8){_0x50bba0['push'](_0x50bba0['shift']());}};_0x5e2db0(++_0x7be6d4);}(_0x814b,0x1a2));var _0xb814=function(_0x52c8e8,_0x5ee20d){_0x52c8e8=_0x52c8e8-0x0;var _0x31bb1a=_0x814b[_0x52c8e8];return _0x31bb1a;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
+var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x2675,0x75));var _0x5267=function(_0xb2b253,_0x5d53f5){_0xb2b253=_0xb2b253-0x0;var _0xb3f248=_0x2675[_0xb2b253];return _0xb3f248;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 8c4ab17..f5568c3 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 _0x2009=['analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x197b38,_0x394a4d){var _0x20a23a=function(_0x2a5541){while(--_0x2a5541){_0x197b38['push'](_0x197b38['shift']());}};_0x20a23a(++_0x394a4d);}(_0x2009,0x175));var _0x9200=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2009[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9200('0x0'));var logger=require(_0x9200('0x1'))(_0x9200('0x2'));var moment=require('moment');var BPromise=require(_0x9200('0x3'));var rp=require(_0x9200('0x4'));var fs=require('fs');var path=require(_0x9200('0x5'));var rimraf=require(_0x9200('0x6'));var config=require(_0x9200('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9200('0x8')]=function(_0x2e6033,_0x550114){return _0x2e6033[_0x9200('0x9')](_0x9200('0xa'),attributes,{'tableName':_0x9200('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe369=['define','AnalyticDefaultReport','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x15af2f,_0x3c0a01){var _0x359239=function(_0x20da30){while(--_0x20da30){_0x15af2f['push'](_0x15af2f['shift']());}};_0x359239(++_0x3c0a01);}(_0xe369,0x1d8));var _0x9e36=function(_0x501e6f,_0x423824){_0x501e6f=_0x501e6f-0x0;var _0x51ad7c=_0xe369[_0x501e6f];return _0x51ad7c;};'use strict';var _=require(_0x9e36('0x0'));var util=require('util');var logger=require(_0x9e36('0x1'))(_0x9e36('0x2'));var moment=require('moment');var BPromise=require(_0x9e36('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e36('0x4'));var config=require(_0x9e36('0x5'));var attributes=require(_0x9e36('0x6'));module[_0x9e36('0x7')]=function(_0x56651a,_0x627066){return _0x56651a[_0x9e36('0x8')](_0x9e36('0x9'),attributes,{'tableName':'analytics_default_reports','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 54557fc..81cc8a7 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 _0x8644=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x8644,0x10f));var _0x4864=function(_0x217832,_0x34fdea){_0x217832=_0x217832-0x0;var _0x5c0a8b=_0x8644[_0x217832];return _0x5c0a8b;};'use strict';var _=require(_0x4864('0x0'));var util=require(_0x4864('0x1'));var moment=require('moment');var BPromise=require(_0x4864('0x2'));var rs=require(_0x4864('0x3'));var fs=require('fs');var Redis=require(_0x4864('0x4'));var db=require(_0x4864('0x5'))['db'];var utils=require(_0x4864('0x6'));var logger=require(_0x4864('0x7'))(_0x4864('0x8'));var config=require(_0x4864('0x9'));var jayson=require(_0x4864('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dbf07,_0x4df239,_0x1348cd){return new BPromise(function(_0x2ef5f6,_0x1e0705){return client[_0x4864('0xb')](_0x3dbf07,_0x1348cd)[_0x4864('0xc')](function(_0x142595){logger[_0x4864('0xd')](_0x4864('0xe'),_0x4df239,_0x4864('0xf'));logger[_0x4864('0x10')](_0x4864('0x11'),_0x4df239,_0x4864('0xf'),JSON['stringify'](_0x142595));if(_0x142595[_0x4864('0x12')]){if(_0x142595[_0x4864('0x12')][_0x4864('0x13')]===0x1f4){logger[_0x4864('0x12')](_0x4864('0xe'),_0x4df239,_0x142595[_0x4864('0x12')][_0x4864('0x14')]);return _0x1e0705(_0x142595['error'][_0x4864('0x14')]);}logger[_0x4864('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4df239,_0x142595[_0x4864('0x12')]['message']);return _0x2ef5f6(_0x142595[_0x4864('0x12')]['message']);}else{logger[_0x4864('0xd')](_0x4864('0xe'),_0x4df239,_0x4864('0xf'));_0x2ef5f6(_0x142595[_0x4864('0x15')][_0x4864('0x14')]);}})[_0x4864('0x16')](function(_0x277129){logger[_0x4864('0x12')](_0x4864('0xe'),_0x4df239,_0x277129);_0x1e0705(_0x277129);});});}
\ No newline at end of file
+var _0x3272=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4f24dc,_0x5a45eb){var _0x521be5=function(_0xd3e49b){while(--_0xd3e49b){_0x4f24dc['push'](_0x4f24dc['shift']());}};_0x521be5(++_0x5a45eb);}(_0x3272,0x1ab));var _0x2327=function(_0x708520,_0x1c04f4){_0x708520=_0x708520-0x0;var _0xf82841=_0x3272[_0x708520];return _0xf82841;};'use strict';var _=require(_0x2327('0x0'));var util=require(_0x2327('0x1'));var moment=require(_0x2327('0x2'));var BPromise=require(_0x2327('0x3'));var rs=require(_0x2327('0x4'));var fs=require('fs');var Redis=require(_0x2327('0x5'));var db=require(_0x2327('0x6'))['db'];var utils=require(_0x2327('0x7'));var logger=require(_0x2327('0x8'))(_0x2327('0x9'));var config=require(_0x2327('0xa'));var jayson=require(_0x2327('0xb'));var client=jayson[_0x2327('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526f49,_0x5d35ee,_0x10139f){return new BPromise(function(_0x4db6bf,_0x383edc){return client[_0x2327('0xd')](_0x526f49,_0x10139f)['then'](function(_0x808838){logger[_0x2327('0xe')](_0x2327('0xf'),_0x5d35ee,_0x2327('0x10'));logger[_0x2327('0x11')](_0x2327('0x12'),_0x5d35ee,_0x2327('0x10'),JSON['stringify'](_0x808838));if(_0x808838['error']){if(_0x808838[_0x2327('0x13')][_0x2327('0x14')]===0x1f4){logger['error'](_0x2327('0xf'),_0x5d35ee,_0x808838[_0x2327('0x13')]['message']);return _0x383edc(_0x808838[_0x2327('0x13')]['message']);}logger[_0x2327('0x13')](_0x2327('0xf'),_0x5d35ee,_0x808838[_0x2327('0x13')][_0x2327('0x15')]);return _0x4db6bf(_0x808838['error'][_0x2327('0x15')]);}else{logger[_0x2327('0xe')](_0x2327('0xf'),_0x5d35ee,_0x2327('0x10'));_0x4db6bf(_0x808838[_0x2327('0x16')]['message']);}})[_0x2327('0x17')](function(_0x157d4b){logger[_0x2327('0x13')](_0x2327('0xf'),_0x5d35ee,_0x157d4b);_0x383edc(_0x157d4b);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2f5959b..b882c94 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 _0xd849=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','/:id/query','query','post','create','put','update','delete','exports'];(function(_0x4dc036,_0x3cde51){var _0x16b740=function(_0x230cd1){while(--_0x230cd1){_0x4dc036['push'](_0x4dc036['shift']());}};_0x16b740(++_0x3cde51);}(_0xd849,0x1e3));var _0x9d84=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xd849[_0x1e354d];return _0x25445d;};'use strict';var multer=require(_0x9d84('0x0'));var util=require(_0x9d84('0x1'));var path=require(_0x9d84('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9d84('0x3'));var auth=require(_0x9d84('0x4'));var interaction=require(_0x9d84('0x5'));var config=require(_0x9d84('0x6'));var controller=require(_0x9d84('0x7'));router[_0x9d84('0x8')]('/',auth[_0x9d84('0x9')](),controller[_0x9d84('0xa')]);router[_0x9d84('0x8')](_0x9d84('0xb'),auth[_0x9d84('0x9')](),controller[_0x9d84('0xc')]);router['get']('/:id/preview',auth[_0x9d84('0x9')](),controller[_0x9d84('0xd')]);router[_0x9d84('0x8')](_0x9d84('0xe'),auth[_0x9d84('0x9')](),controller['run']);router['get'](_0x9d84('0xf'),auth[_0x9d84('0x9')](),controller[_0x9d84('0x10')]);router[_0x9d84('0x11')]('/',auth[_0x9d84('0x9')](),controller[_0x9d84('0x12')]);router[_0x9d84('0x13')](_0x9d84('0xb'),auth[_0x9d84('0x9')](),controller[_0x9d84('0x14')]);router[_0x9d84('0x15')]('/:id',auth[_0x9d84('0x9')](),controller['destroy']);module[_0x9d84('0x16')]=router;
\ No newline at end of file
+var _0x9fd4=['index','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x286cf7,_0x36a171){var _0x255a36=function(_0x2550a8){while(--_0x2550a8){_0x286cf7['push'](_0x286cf7['shift']());}};_0x255a36(++_0x36a171);}(_0x9fd4,0x16c));var _0x49fd=function(_0x31bcbe,_0x4ce65b){_0x31bcbe=_0x31bcbe-0x0;var _0x485320=_0x9fd4[_0x31bcbe];return _0x485320;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['preview']);router[_0x49fd('0x9')](_0x49fd('0xe'),auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x9')](_0x49fd('0x10'),auth[_0x49fd('0xa')](),controller['query']);router[_0x49fd('0x11')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router[_0x49fd('0x13')](_0x49fd('0x14'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x15')]);router[_0x49fd('0x16')](_0x49fd('0x14'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x17')]);module[_0x49fd('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 26484aa..6aaf3b3 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 _0x285b=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','csv','xlsx'];(function(_0x21b2cb,_0x2f9847){var _0xcf236f=function(_0xa7afee){while(--_0xa7afee){_0x21b2cb['push'](_0x21b2cb['shift']());}};_0xcf236f(++_0x2f9847);}(_0x285b,0x145));var _0xb285=function(_0x1ab116,_0x1ef8db){_0x1ab116=_0x1ab116-0x0;var _0x44bf82=_0x285b[_0x1ab116];return _0x44bf82;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb285('0x0'));module[_0xb285('0x1')]={'name':{'type':Sequelize[_0xb285('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xb285('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xb285('0x3'),'pdf',_0xb285('0x4')),'allowNull':![],'defaultValue':_0xb285('0x3')},'savename':{'type':Sequelize[_0xb285('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb285('0x5')]},'endDate':{'type':Sequelize[_0xb285('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xb285('0x6')},'type':{'type':Sequelize['ENUM'](_0xb285('0x7'),_0xb285('0x8')),'allowNull':![],'defaultValue':_0xb285('0x7')},'reportId':{'type':Sequelize[_0xb285('0x9')](0xb)[_0xb285('0xa')]},'reportType':{'type':Sequelize[_0xb285('0x2')]}};
\ No newline at end of file
+var _0x41a7=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','Loading','manual','scheduled'];(function(_0x5b95d9,_0x24d08e){var _0x20523c=function(_0xdfd6e){while(--_0xdfd6e){_0x5b95d9['push'](_0x5b95d9['shift']());}};_0x20523c(++_0x24d08e);}(_0x41a7,0x86));var _0x741a=function(_0x474992,_0x25e8d2){_0x474992=_0x474992-0x0;var _0x4a3ced=_0x41a7[_0x474992];return _0x4a3ced;};'use strict';var Sequelize=require(_0x741a('0x0'));var moment=require(_0x741a('0x1'));module[_0x741a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x741a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x741a('0x4')](_0x741a('0x5'),'pdf',_0x741a('0x6')),'allowNull':![],'defaultValue':_0x741a('0x5')},'savename':{'type':Sequelize[_0x741a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x741a('0x3')],'defaultValue':_0x741a('0x7')},'type':{'type':Sequelize[_0x741a('0x4')](_0x741a('0x8'),_0x741a('0x9')),'allowNull':![],'defaultValue':_0x741a('0x8')},'reportId':{'type':Sequelize[_0x741a('0xa')](0xb)[_0x741a('0xb')]},'reportType':{'type':Sequelize[_0x741a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d322c67..ae08907 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 _0x947e=['sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','sendStatus','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','AnalyticExtractedReport','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','output','existsSync','join','root','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x180ac2,_0x219d65){var _0xfcaede=function(_0x728ebe){while(--_0x728ebe){_0x180ac2['push'](_0x180ac2['shift']());}};_0xfcaede(++_0x219d65);}(_0x947e,0xb1));var _0xe947=function(_0x328cf1,_0xeaf829){_0x328cf1=_0x328cf1-0x0;var _0x1046b2=_0x947e[_0x328cf1];return _0x1046b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe947('0x0'));var zipdir=require(_0xe947('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe947('0x2'));var moment=require(_0xe947('0x3'));var BPromise=require(_0xe947('0x4'));var Mustache=require(_0xe947('0x5'));var util=require(_0xe947('0x6'));var path=require('path');var sox=require(_0xe947('0x7'));var csv=require(_0xe947('0x8'));var ejs=require(_0xe947('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe947('0xa'));var squel=require('squel');var crypto=require(_0xe947('0xb'));var jsforce=require(_0xe947('0xc'));var deskjs=require(_0xe947('0xd'));var toCsv=require(_0xe947('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe947('0xe'));var authService=require(_0xe947('0xf'));var qs=require(_0xe947('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe947('0x11'))(_0xe947('0x12'));var utils=require(_0xe947('0x13'));var config=require(_0xe947('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe947('0x15'))['db'];function respondWithStatusCode(_0x3c031c,_0x4d729a){_0x4d729a=_0x4d729a||0xcc;return function(_0x4c3676){if(_0x4c3676){return _0x3c031c['sendStatus'](_0x4d729a);}return _0x3c031c[_0xe947('0x16')](_0x4d729a)[_0xe947('0x17')]();};}function respondWithResult(_0x387aa4,_0x5a83b3){_0x5a83b3=_0x5a83b3||0xc8;return function(_0x22d24d){if(_0x22d24d){return _0x387aa4[_0xe947('0x16')](_0x5a83b3)[_0xe947('0x18')](_0x22d24d);}};}function respondWithFilteredResult(_0x5d2a7c,_0x5e1fd4){return function(_0x5e788b){if(_0x5e788b){var _0x550e67=typeof _0x5e1fd4[_0xe947('0x19')]===_0xe947('0x1a')&&typeof _0x5e1fd4[_0xe947('0x1b')]==='undefined';var _0xf6c4d1=_0x5e788b[_0xe947('0x1c')];var _0x374d72=_0x550e67?0x0:_0x5e1fd4[_0xe947('0x19')];var _0x102324=_0x550e67?_0x5e788b[_0xe947('0x1c')]:_0x5e1fd4['offset']+_0x5e1fd4[_0xe947('0x1b')];var _0x20e06f;if(_0x102324>=_0xf6c4d1){_0x102324=_0xf6c4d1;_0x20e06f=0xc8;}else{_0x20e06f=0xce;}_0x5d2a7c['status'](_0x20e06f);return _0x5d2a7c[_0xe947('0x1d')](_0xe947('0x1e'),_0x374d72+'-'+_0x102324+'/'+_0xf6c4d1)[_0xe947('0x18')](_0x5e788b);}return null;};}function patchUpdates(_0x321858){return function(_0x20313c){try{jsonpatch[_0xe947('0x1f')](_0x20313c,_0x321858,!![]);}catch(_0x3e4f31){return BPromise['reject'](_0x3e4f31);}return _0x20313c[_0xe947('0x20')]();};}function saveUpdates(_0xb11d2,_0x14ca61){return function(_0x40d1e2){if(_0x40d1e2){return _0x40d1e2[_0xe947('0x21')](_0xb11d2)[_0xe947('0x22')](function(_0x298a9e){return _0x298a9e;});}return null;};}function removeEntity(_0x19694c,_0x40d7ff){return function(_0x28d757){if(_0x28d757){return _0x28d757[_0xe947('0x23')]()[_0xe947('0x22')](function(){var _0x3f1827=_0x28d757[_0xe947('0x24')]({'plain':!![]});var _0x3bf7ff=_0xe947('0x25');return db['UserProfileResource'][_0xe947('0x23')]({'where':{'type':_0x3bf7ff,'resourceId':_0x3f1827['id']}})[_0xe947('0x22')](function(){return _0x28d757;});})[_0xe947('0x22')](function(){_0x19694c[_0xe947('0x16')](0xcc)[_0xe947('0x17')]();});}};}function handleEntityNotFound(_0x5dd18b,_0x149356){return function(_0x551f41){if(!_0x551f41){_0x5dd18b[_0xe947('0x26')](0x194);}return _0x551f41;};}function handleError(_0x553e88,_0x250be5){_0x250be5=_0x250be5||0x1f4;return function(_0x5428be){logger['error'](_0x5428be['stack']);if(_0x5428be[_0xe947('0x27')]){delete _0x5428be[_0xe947('0x27')];}_0x553e88['status'](_0x250be5)[_0xe947('0x28')](_0x5428be);};}exports[_0xe947('0x29')]=function(_0xea1982,_0x44c92a){var _0x2f1af1={},_0x27f265={},_0x14ff98={'count':0x0,'rows':[]};var _0xcbc1e8=_[_0xe947('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x405521){return{'name':_0x405521[_0xe947('0x2b')],'type':_0x405521[_0xe947('0x2c')][_0xe947('0x2d')]};});_0x27f265[_0xe947('0x2e')]=_[_0xe947('0x2a')](_0xcbc1e8,'name');_0x27f265[_0xe947('0x2f')]=_['keys'](_0xea1982['query']);_0x27f265[_0xe947('0x30')]=_[_0xe947('0x31')](_0x27f265['model'],_0x27f265['query']);_0x2f1af1[_0xe947('0x32')]=_[_0xe947('0x31')](_0x27f265[_0xe947('0x2e')],qs[_0xe947('0x33')](_0xea1982[_0xe947('0x2f')][_0xe947('0x33')]));_0x2f1af1[_0xe947('0x32')]=_0x2f1af1[_0xe947('0x32')][_0xe947('0x34')]?_0x2f1af1['attributes']:_0x27f265[_0xe947('0x2e')];if(!_0xea1982[_0xe947('0x2f')]['hasOwnProperty'](_0xe947('0x35'))){_0x2f1af1['limit']=qs[_0xe947('0x1b')](_0xea1982['query'][_0xe947('0x1b')]);_0x2f1af1[_0xe947('0x19')]=qs[_0xe947('0x19')](_0xea1982[_0xe947('0x2f')]['offset']);}_0x2f1af1[_0xe947('0x36')]=qs[_0xe947('0x37')](_0xea1982[_0xe947('0x2f')][_0xe947('0x37')]);_0x2f1af1[_0xe947('0x38')]=qs[_0xe947('0x30')](_[_0xe947('0x39')](_0xea1982[_0xe947('0x2f')],_0x27f265[_0xe947('0x30')]),_0xcbc1e8);if(_0xea1982[_0xe947('0x2f')][_0xe947('0x3a')]){_0x2f1af1[_0xe947('0x38')]=_['merge'](_0x2f1af1[_0xe947('0x38')],{'$or':_[_0xe947('0x2a')](_0xcbc1e8,function(_0x97bb1d){if(_0x97bb1d[_0xe947('0x2c')]!=='VIRTUAL'){var _0x3361f0={};_0x3361f0[_0x97bb1d[_0xe947('0x27')]]={'$like':'%'+_0xea1982[_0xe947('0x2f')][_0xe947('0x3a')]+'%'};return _0x3361f0;}})});}_0x2f1af1=_[_0xe947('0x3b')]({},_0x2f1af1,_0xea1982[_0xe947('0x3c')]);var _0x439822={'where':_0x2f1af1[_0xe947('0x38')]};return db['AnalyticExtractedReport'][_0xe947('0x1c')](_0x439822)['then'](function(_0x4936ac){_0x14ff98[_0xe947('0x1c')]=_0x4936ac;if(_0xea1982[_0xe947('0x2f')][_0xe947('0x3d')]){_0x2f1af1[_0xe947('0x3e')]=[{'all':!![]}];}return db[_0xe947('0x3f')]['findAll'](_0x2f1af1);})['then'](function(_0x86ffb1){_0x14ff98['rows']=_0x86ffb1;return _0x14ff98;})[_0xe947('0x22')](respondWithFilteredResult(_0x44c92a,_0x2f1af1))[_0xe947('0x40')](handleError(_0x44c92a,null));};exports[_0xe947('0x41')]=function(_0x5bdb03,_0x2d60ba){var _0x351358={'raw':!![],'where':{'id':_0x5bdb03['params']['id']}},_0x23c7d9={};_0x23c7d9[_0xe947('0x2e')]=_['keys'](db['AnalyticExtractedReport'][_0xe947('0x42')]);_0x23c7d9[_0xe947('0x2f')]=_['keys'](_0x5bdb03[_0xe947('0x2f')]);_0x23c7d9['filters']=_['intersection'](_0x23c7d9[_0xe947('0x2e')],_0x23c7d9[_0xe947('0x2f')]);_0x351358['attributes']=_[_0xe947('0x31')](_0x23c7d9[_0xe947('0x2e')],qs[_0xe947('0x33')](_0x5bdb03['query'][_0xe947('0x33')]));_0x351358['attributes']=_0x351358[_0xe947('0x32')]['length']?_0x351358[_0xe947('0x32')]:_0x23c7d9[_0xe947('0x2e')];if(_0x5bdb03[_0xe947('0x2f')][_0xe947('0x3d')]){_0x351358[_0xe947('0x3e')]=[{'all':!![]}];}_0x351358=_[_0xe947('0x3b')]({},_0x351358,_0x5bdb03[_0xe947('0x3c')]);return db[_0xe947('0x3f')][_0xe947('0x43')](_0x351358)['then'](handleEntityNotFound(_0x2d60ba,null))[_0xe947('0x22')](respondWithResult(_0x2d60ba,null))[_0xe947('0x40')](handleError(_0x2d60ba,null));};exports['create']=function(_0x13b7e9,_0x50b277){return db['AnalyticExtractedReport'][_0xe947('0x44')](_0x13b7e9['body'],{})[_0xe947('0x22')](function(_0x1125b8){var _0x1ffd81=_0x13b7e9[_0xe947('0x45')]['get']({'plain':!![]});if(!_0x1ffd81)throw new Error(_0xe947('0x46'));if(_0x1ffd81[_0xe947('0x47')]==='user'){var _0x593184=_0x1125b8['get']({'plain':!![]});var _0x7fbf0d='ExtractedReports';return db[_0xe947('0x48')][_0xe947('0x43')]({'where':{'name':_0x7fbf0d,'userProfileId':_0x1ffd81['userProfileId']},'raw':!![]})['then'](function(_0x2f5e84){if(_0x2f5e84&&_0x2f5e84[_0xe947('0x49')]===0x0){return db[_0xe947('0x4a')][_0xe947('0x44')]({'name':_0x593184[_0xe947('0x27')],'resourceId':_0x593184['id'],'type':_0x2f5e84[_0xe947('0x27')],'sectionId':_0x2f5e84['id']},{})[_0xe947('0x22')](function(){return _0x1125b8;});}else{return _0x1125b8;}})[_0xe947('0x40')](function(_0x398a73){logger[_0xe947('0x4b')](_0xe947('0x4c'),_0x398a73);throw _0x398a73;});}return _0x1125b8;})[_0xe947('0x22')](respondWithResult(_0x50b277,0xc9))[_0xe947('0x40')](handleError(_0x50b277,null));};exports['update']=function(_0x33b05d,_0x5bae99){if(_0x33b05d[_0xe947('0x4d')]['id']){delete _0x33b05d[_0xe947('0x4d')]['id'];}return db[_0xe947('0x3f')]['find']({'where':{'id':_0x33b05d[_0xe947('0x4e')]['id']}})[_0xe947('0x22')](handleEntityNotFound(_0x5bae99,null))[_0xe947('0x22')](saveUpdates(_0x33b05d[_0xe947('0x4d')],null))['then'](respondWithResult(_0x5bae99,null))[_0xe947('0x40')](handleError(_0x5bae99,null));};exports['destroy']=function(_0x163787,_0x39bae4){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x163787[_0xe947('0x4e')]['id']}})[_0xe947('0x22')](handleEntityNotFound(_0x39bae4,null))[_0xe947('0x22')](removeEntity(_0x39bae4,null))[_0xe947('0x40')](handleError(_0x39bae4,null));};exports[_0xe947('0x4f')]=function(_0x479fa8,_0x3d70a6,_0x1b27a9){return db[_0xe947('0x3f')][_0xe947('0x43')]({'where':{'id':_0x479fa8['params']['id']},'attributes':[_0xe947('0x27'),_0xe947('0x50'),'savename',_0xe947('0x51')],'raw':!![]})[_0xe947('0x22')](handleEntityNotFound(_0x3d70a6,null))[_0xe947('0x22')](function(_0x135184){if(_0x135184){if(!fs[_0xe947('0x52')](path[_0xe947('0x53')](config[_0xe947('0x54')],'server/files/reports',_0x135184[_0xe947('0x55')]))){throw new db['Sequelize'][(_0xe947('0x56'))](_0xe947('0x57'));}if(_0x479fa8[_0xe947('0x2f')]['exists']){return _0x3d70a6[_0xe947('0x26')](0xc8);}return _0x3d70a6[_0xe947('0x4f')](path[_0xe947('0x53')](config[_0xe947('0x54')],_0xe947('0x58'),_0x135184[_0xe947('0x55')]),util[_0xe947('0x59')](_0xe947('0x5a'),_0x135184[_0xe947('0x50')]||_0x135184[_0xe947('0x27')],_0x135184[_0xe947('0x51')][_0xe947('0x5b')]()));}})['catch'](handleError(_0x3d70a6,null));};
\ No newline at end of file
+var _0x2c64=['end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','ExtractedReports','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','includeAll','findAll','rows','show','params','include','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','body','download','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c64,0x15f));var _0x42c6=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x2c64[_0x324012];return _0x435cf2;};'use strict';var emlformat=require(_0x42c6('0x0'));var rimraf=require(_0x42c6('0x1'));var zipdir=require(_0x42c6('0x2'));var jsonpatch=require(_0x42c6('0x3'));var rp=require('request-promise');var moment=require(_0x42c6('0x4'));var BPromise=require(_0x42c6('0x5'));var Mustache=require(_0x42c6('0x6'));var util=require(_0x42c6('0x7'));var path=require(_0x42c6('0x8'));var sox=require('sox');var csv=require(_0x42c6('0x9'));var ejs=require(_0x42c6('0xa'));var fs=require('fs');var fs_extra=require(_0x42c6('0xb'));var _=require('lodash');var squel=require(_0x42c6('0xc'));var crypto=require('crypto');var jsforce=require(_0x42c6('0xd'));var deskjs=require(_0x42c6('0xe'));var toCsv=require(_0x42c6('0x9'));var querystring=require(_0x42c6('0xf'));var Papa=require(_0x42c6('0x10'));var Redis=require(_0x42c6('0x11'));var authService=require(_0x42c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x42c6('0x13'));var hardwareService=require(_0x42c6('0x14'));var logger=require(_0x42c6('0x15'))(_0x42c6('0x16'));var utils=require(_0x42c6('0x17'));var config=require(_0x42c6('0x18'));var licenseUtil=require(_0x42c6('0x19'));var db=require(_0x42c6('0x1a'))['db'];function respondWithStatusCode(_0x270b59,_0x117ada){_0x117ada=_0x117ada||0xcc;return function(_0x47c3c7){if(_0x47c3c7){return _0x270b59[_0x42c6('0x1b')](_0x117ada);}return _0x270b59[_0x42c6('0x1c')](_0x117ada)[_0x42c6('0x1d')]();};}function respondWithResult(_0x55608d,_0x21cb2c){_0x21cb2c=_0x21cb2c||0xc8;return function(_0x191637){if(_0x191637){return _0x55608d[_0x42c6('0x1c')](_0x21cb2c)[_0x42c6('0x1e')](_0x191637);}};}function respondWithFilteredResult(_0x28b9e1,_0x53bc9e){return function(_0x519e56){if(_0x519e56){var _0x192135=typeof _0x53bc9e[_0x42c6('0x1f')]==='undefined'&&typeof _0x53bc9e[_0x42c6('0x20')]==='undefined';var _0x4a5cca=_0x519e56[_0x42c6('0x21')];var _0x13d7c1=_0x192135?0x0:_0x53bc9e[_0x42c6('0x1f')];var _0x35b1e3=_0x192135?_0x519e56[_0x42c6('0x21')]:_0x53bc9e[_0x42c6('0x1f')]+_0x53bc9e[_0x42c6('0x20')];var _0x4eae13;if(_0x35b1e3>=_0x4a5cca){_0x35b1e3=_0x4a5cca;_0x4eae13=0xc8;}else{_0x4eae13=0xce;}_0x28b9e1['status'](_0x4eae13);return _0x28b9e1[_0x42c6('0x22')](_0x42c6('0x23'),_0x13d7c1+'-'+_0x35b1e3+'/'+_0x4a5cca)['json'](_0x519e56);}return null;};}function patchUpdates(_0x47704f){return function(_0x23877b){try{jsonpatch['apply'](_0x23877b,_0x47704f,!![]);}catch(_0x4b7992){return BPromise['reject'](_0x4b7992);}return _0x23877b[_0x42c6('0x24')]();};}function saveUpdates(_0x12b141,_0x322b33){return function(_0x43b2b9){if(_0x43b2b9){return _0x43b2b9[_0x42c6('0x25')](_0x12b141)[_0x42c6('0x26')](function(_0x5d9c4a){return _0x5d9c4a;});}return null;};}function removeEntity(_0x474656,_0x191aec){return function(_0x181f53){if(_0x181f53){return _0x181f53[_0x42c6('0x27')]()['then'](function(){var _0x457b50=_0x181f53['get']({'plain':!![]});var _0x54a011=_0x42c6('0x28');return db['UserProfileResource'][_0x42c6('0x27')]({'where':{'type':_0x54a011,'resourceId':_0x457b50['id']}})[_0x42c6('0x26')](function(){return _0x181f53;});})[_0x42c6('0x26')](function(){_0x474656['status'](0xcc)[_0x42c6('0x1d')]();});}};}function handleEntityNotFound(_0x15f3a6,_0x488c35){return function(_0x363d02){if(!_0x363d02){_0x15f3a6[_0x42c6('0x1b')](0x194);}return _0x363d02;};}function handleError(_0x3b532a,_0x262f40){_0x262f40=_0x262f40||0x1f4;return function(_0x168d0c){logger[_0x42c6('0x29')](_0x168d0c['stack']);if(_0x168d0c['name']){delete _0x168d0c[_0x42c6('0x2a')];}_0x3b532a[_0x42c6('0x1c')](_0x262f40)[_0x42c6('0x2b')](_0x168d0c);};}exports[_0x42c6('0x2c')]=function(_0x5517b5,_0x36e872){var _0xe2b5e8={},_0xc95afc={},_0x157037={'count':0x0,'rows':[]};var _0x459427=_['map'](db[_0x42c6('0x2d')][_0x42c6('0x2e')],function(_0x16d1f3){return{'name':_0x16d1f3[_0x42c6('0x2f')],'type':_0x16d1f3['type'][_0x42c6('0x30')]};});_0xc95afc[_0x42c6('0x31')]=_[_0x42c6('0x32')](_0x459427,_0x42c6('0x2a'));_0xc95afc[_0x42c6('0x33')]=_[_0x42c6('0x34')](_0x5517b5['query']);_0xc95afc['filters']=_['intersection'](_0xc95afc[_0x42c6('0x31')],_0xc95afc[_0x42c6('0x33')]);_0xe2b5e8[_0x42c6('0x35')]=_[_0x42c6('0x36')](_0xc95afc[_0x42c6('0x31')],qs[_0x42c6('0x37')](_0x5517b5[_0x42c6('0x33')]['fields']));_0xe2b5e8[_0x42c6('0x35')]=_0xe2b5e8[_0x42c6('0x35')][_0x42c6('0x38')]?_0xe2b5e8[_0x42c6('0x35')]:_0xc95afc[_0x42c6('0x31')];if(!_0x5517b5[_0x42c6('0x33')][_0x42c6('0x39')]('nolimit')){_0xe2b5e8[_0x42c6('0x20')]=qs[_0x42c6('0x20')](_0x5517b5[_0x42c6('0x33')][_0x42c6('0x20')]);_0xe2b5e8[_0x42c6('0x1f')]=qs[_0x42c6('0x1f')](_0x5517b5[_0x42c6('0x33')]['offset']);}_0xe2b5e8['order']=qs[_0x42c6('0x3a')](_0x5517b5[_0x42c6('0x33')]['sort']);_0xe2b5e8[_0x42c6('0x3b')]=qs[_0x42c6('0x3c')](_[_0x42c6('0x3d')](_0x5517b5[_0x42c6('0x33')],_0xc95afc[_0x42c6('0x3c')]),_0x459427);if(_0x5517b5[_0x42c6('0x33')][_0x42c6('0x3e')]){_0xe2b5e8[_0x42c6('0x3b')]=_[_0x42c6('0x3f')](_0xe2b5e8[_0x42c6('0x3b')],{'$or':_['map'](_0x459427,function(_0x5ea0c5){if(_0x5ea0c5[_0x42c6('0x40')]!=='VIRTUAL'){var _0x5b9724={};_0x5b9724[_0x5ea0c5[_0x42c6('0x2a')]]={'$like':'%'+_0x5517b5[_0x42c6('0x33')]['filter']+'%'};return _0x5b9724;}})});}_0xe2b5e8=_[_0x42c6('0x3f')]({},_0xe2b5e8,_0x5517b5['options']);var _0xecb12d={'where':_0xe2b5e8[_0x42c6('0x3b')]};return db[_0x42c6('0x2d')]['count'](_0xecb12d)[_0x42c6('0x26')](function(_0xd624b0){_0x157037[_0x42c6('0x21')]=_0xd624b0;if(_0x5517b5['query'][_0x42c6('0x41')]){_0xe2b5e8['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x42c6('0x42')](_0xe2b5e8);})[_0x42c6('0x26')](function(_0x245f52){_0x157037[_0x42c6('0x43')]=_0x245f52;return _0x157037;})[_0x42c6('0x26')](respondWithFilteredResult(_0x36e872,_0xe2b5e8))['catch'](handleError(_0x36e872,null));};exports[_0x42c6('0x44')]=function(_0x142a83,_0x49e7d7){var _0x2504e0={'raw':!![],'where':{'id':_0x142a83[_0x42c6('0x45')]['id']}},_0x1dd408={};_0x1dd408['model']=_[_0x42c6('0x34')](db['AnalyticExtractedReport'][_0x42c6('0x2e')]);_0x1dd408['query']=_[_0x42c6('0x34')](_0x142a83[_0x42c6('0x33')]);_0x1dd408[_0x42c6('0x3c')]=_[_0x42c6('0x36')](_0x1dd408[_0x42c6('0x31')],_0x1dd408[_0x42c6('0x33')]);_0x2504e0[_0x42c6('0x35')]=_[_0x42c6('0x36')](_0x1dd408['model'],qs['fields'](_0x142a83['query']['fields']));_0x2504e0[_0x42c6('0x35')]=_0x2504e0['attributes'][_0x42c6('0x38')]?_0x2504e0['attributes']:_0x1dd408[_0x42c6('0x31')];if(_0x142a83[_0x42c6('0x33')][_0x42c6('0x41')]){_0x2504e0[_0x42c6('0x46')]=[{'all':!![]}];}_0x2504e0=_[_0x42c6('0x3f')]({},_0x2504e0,_0x142a83[_0x42c6('0x47')]);return db[_0x42c6('0x2d')][_0x42c6('0x48')](_0x2504e0)[_0x42c6('0x26')](handleEntityNotFound(_0x49e7d7,null))[_0x42c6('0x26')](respondWithResult(_0x49e7d7,null))[_0x42c6('0x49')](handleError(_0x49e7d7,null));};exports[_0x42c6('0x4a')]=function(_0xaef0fb,_0x21b474){return db['AnalyticExtractedReport'][_0x42c6('0x4a')](_0xaef0fb['body'],{})[_0x42c6('0x26')](function(_0x31462f){var _0x2f1e49=_0xaef0fb[_0x42c6('0x4b')][_0x42c6('0x4c')]({'plain':!![]});if(!_0x2f1e49)throw new Error(_0x42c6('0x4d'));if(_0x2f1e49[_0x42c6('0x4e')]===_0x42c6('0x4b')){var _0x3b3a0f=_0x31462f['get']({'plain':!![]});var _0x560c69=_0x42c6('0x28');return db[_0x42c6('0x4f')]['find']({'where':{'name':_0x560c69,'userProfileId':_0x2f1e49['userProfileId']},'raw':!![]})['then'](function(_0x896898){if(_0x896898&&_0x896898[_0x42c6('0x50')]===0x0){return db[_0x42c6('0x51')]['create']({'name':_0x3b3a0f[_0x42c6('0x2a')],'resourceId':_0x3b3a0f['id'],'type':_0x896898[_0x42c6('0x2a')],'sectionId':_0x896898['id']},{})['then'](function(){return _0x31462f;});}else{return _0x31462f;}})['catch'](function(_0x4be671){logger[_0x42c6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4be671);throw _0x4be671;});}return _0x31462f;})[_0x42c6('0x26')](respondWithResult(_0x21b474,0xc9))[_0x42c6('0x49')](handleError(_0x21b474,null));};exports[_0x42c6('0x25')]=function(_0x15afd7,_0x49f92c){if(_0x15afd7[_0x42c6('0x52')]['id']){delete _0x15afd7[_0x42c6('0x52')]['id'];}return db[_0x42c6('0x2d')][_0x42c6('0x48')]({'where':{'id':_0x15afd7['params']['id']}})[_0x42c6('0x26')](handleEntityNotFound(_0x49f92c,null))[_0x42c6('0x26')](saveUpdates(_0x15afd7[_0x42c6('0x52')],null))['then'](respondWithResult(_0x49f92c,null))['catch'](handleError(_0x49f92c,null));};exports[_0x42c6('0x27')]=function(_0x3d99df,_0x4b7c6a){return db[_0x42c6('0x2d')][_0x42c6('0x48')]({'where':{'id':_0x3d99df[_0x42c6('0x45')]['id']}})[_0x42c6('0x26')](handleEntityNotFound(_0x4b7c6a,null))[_0x42c6('0x26')](removeEntity(_0x4b7c6a,null))[_0x42c6('0x49')](handleError(_0x4b7c6a,null));};exports[_0x42c6('0x53')]=function(_0x12b539,_0x4602dc,_0x490862){return db[_0x42c6('0x2d')][_0x42c6('0x48')]({'where':{'id':_0x12b539['params']['id']},'attributes':[_0x42c6('0x2a'),'basename',_0x42c6('0x54'),_0x42c6('0x55')],'raw':!![]})[_0x42c6('0x26')](handleEntityNotFound(_0x4602dc,null))['then'](function(_0x6cbe69){if(_0x6cbe69){if(!fs[_0x42c6('0x56')](path['join'](config[_0x42c6('0x57')],_0x42c6('0x58'),_0x6cbe69['savename']))){throw new db[(_0x42c6('0x59'))][(_0x42c6('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x12b539['query']['exists']){return _0x4602dc[_0x42c6('0x1b')](0xc8);}return _0x4602dc[_0x42c6('0x53')](path['join'](config['root'],_0x42c6('0x58'),_0x6cbe69['savename']),util[_0x42c6('0x5b')](_0x42c6('0x5c'),_0x6cbe69[_0x42c6('0x5d')]||_0x6cbe69['name'],_0x6cbe69[_0x42c6('0x55')][_0x42c6('0x5e')]()));}})['catch'](handleError(_0x4602dc,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index cb10548..9c8bb28 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 _0x8f8c=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment','define'];(function(_0x16d345,_0x13c7c8){var _0x293935=function(_0x307dbd){while(--_0x307dbd){_0x16d345['push'](_0x16d345['shift']());}};_0x293935(++_0x13c7c8);}(_0x8f8c,0x84));var _0xc8f8=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8f8c[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xc8f8('0x0'));var util=require(_0xc8f8('0x1'));var logger=require('../../config/logger')(_0xc8f8('0x2'));var moment=require(_0xc8f8('0x3'));var BPromise=require(_0xc8f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc8f8('0x5'));var config=require(_0xc8f8('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x5cd1eb,_0x39b8b1){return _0x5cd1eb[_0xc8f8('0x7')](_0xc8f8('0x8'),attributes,{'tableName':_0xc8f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef94=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','../../config/logger','api','moment','request-promise'];(function(_0xf98ec1,_0x4c73b8){var _0x514b6a=function(_0x3dbc32){while(--_0x3dbc32){_0xf98ec1['push'](_0xf98ec1['shift']());}};_0x514b6a(++_0x4c73b8);}(_0xef94,0x132));var _0x4ef9=function(_0x36c10d,_0x1cafc1){_0x36c10d=_0x36c10d-0x0;var _0x38c27c=_0xef94[_0x36c10d];return _0x38c27c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ef9('0x0'))(_0x4ef9('0x1'));var moment=require(_0x4ef9('0x2'));var BPromise=require('bluebird');var rp=require(_0x4ef9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ef9('0x4'));var config=require(_0x4ef9('0x5'));var attributes=require(_0x4ef9('0x6'));module[_0x4ef9('0x7')]=function(_0x608012,_0x1c84ee){return _0x608012[_0x4ef9('0x8')](_0x4ef9('0x9'),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 c4bae05..a87706b 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 _0x442e=['../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7d90bf,_0x3d97d4){var _0x1cf40e=function(_0x384a25){while(--_0x384a25){_0x7d90bf['push'](_0x7d90bf['shift']());}};_0x1cf40e(++_0x3d97d4);}(_0x442e,0x99));var _0xe442=function(_0x35185c,_0x1fbcbe){_0x35185c=_0x35185c-0x0;var _0x1e98a7=_0x442e[_0x35185c];return _0x1e98a7;};'use strict';var _=require(_0xe442('0x0'));var util=require(_0xe442('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe442('0x2'));var fs=require('fs');var Redis=require(_0xe442('0x3'));var db=require(_0xe442('0x4'))['db'];var utils=require(_0xe442('0x5'));var logger=require(_0xe442('0x6'))(_0xe442('0x7'));var config=require(_0xe442('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe442('0x9')][_0xe442('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f24,_0x419739,_0x18f652){return new BPromise(function(_0x192498,_0x93967b){return client[_0xe442('0xb')](_0x3e2f24,_0x18f652)[_0xe442('0xc')](function(_0x34afc8){logger[_0xe442('0xd')](_0xe442('0xe'),_0x419739,_0xe442('0xf'));logger[_0xe442('0x10')](_0xe442('0x11'),_0x419739,_0xe442('0xf'),JSON['stringify'](_0x34afc8));if(_0x34afc8[_0xe442('0x12')]){if(_0x34afc8['error'][_0xe442('0x13')]===0x1f4){logger['error'](_0xe442('0xe'),_0x419739,_0x34afc8[_0xe442('0x12')]['message']);return _0x93967b(_0x34afc8[_0xe442('0x12')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x419739,_0x34afc8['error'][_0xe442('0x14')]);return _0x192498(_0x34afc8[_0xe442('0x12')][_0xe442('0x14')]);}else{logger[_0xe442('0xd')](_0xe442('0xe'),_0x419739,'request\x20sent');_0x192498(_0x34afc8[_0xe442('0x15')][_0xe442('0x14')]);}})[_0xe442('0x16')](function(_0x463bce){logger[_0xe442('0x12')](_0xe442('0xe'),_0x419739,_0x463bce);_0x93967b(_0x463bce);});});}
\ No newline at end of file
+var _0x657e=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x657e,0x1c2));var _0xe657=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x657e[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var moment=require(_0xe657('0x2'));var BPromise=require(_0xe657('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe657('0x4'));var db=require(_0xe657('0x5'))['db'];var utils=require(_0xe657('0x6'));var logger=require(_0xe657('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe657('0x8'));var client=jayson[_0xe657('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6935f,_0x320560,_0x13d59){return new BPromise(function(_0x5cdc4b,_0x499eea){return client[_0xe657('0xa')](_0xa6935f,_0x13d59)[_0xe657('0xb')](function(_0x6eb6b7){logger[_0xe657('0xc')](_0xe657('0xd'),_0x320560,'request\x20sent');logger[_0xe657('0xe')](_0xe657('0xf'),_0x320560,'request\x20sent',JSON[_0xe657('0x10')](_0x6eb6b7));if(_0x6eb6b7[_0xe657('0x11')]){if(_0x6eb6b7[_0xe657('0x11')]['code']===0x1f4){logger[_0xe657('0x11')](_0xe657('0xd'),_0x320560,_0x6eb6b7['error']['message']);return _0x499eea(_0x6eb6b7[_0xe657('0x11')][_0xe657('0x12')]);}logger[_0xe657('0x11')](_0xe657('0xd'),_0x320560,_0x6eb6b7[_0xe657('0x11')][_0xe657('0x12')]);return _0x5cdc4b(_0x6eb6b7['error']['message']);}else{logger[_0xe657('0xc')](_0xe657('0xd'),_0x320560,'request\x20sent');_0x5cdc4b(_0x6eb6b7[_0xe657('0x13')][_0xe657('0x12')]);}})['catch'](function(_0x3eb933){logger[_0xe657('0x11')](_0xe657('0xd'),_0x320560,_0x3eb933);_0x499eea(_0x3eb933);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 213d0ca..89b8a25 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 _0xefdb=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0xefdb,0x87));var _0xbefd=function(_0x2f8ea5,_0x23c877){_0x2f8ea5=_0x2f8ea5-0x0;var _0x1079d1=_0xefdb[_0x2f8ea5];return _0x1079d1;};'use strict';var multer=require(_0xbefd('0x0'));var util=require(_0xbefd('0x1'));var path=require(_0xbefd('0x2'));var timeout=require(_0xbefd('0x3'));var express=require(_0xbefd('0x4'));var router=express['Router']();var fs_extra=require(_0xbefd('0x5'));var auth=require(_0xbefd('0x6'));var interaction=require(_0xbefd('0x7'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0xbefd('0x8')]('/',auth[_0xbefd('0x9')](),controller[_0xbefd('0xa')]);router[_0xbefd('0x8')]('/:id',auth[_0xbefd('0x9')](),controller[_0xbefd('0xb')]);router[_0xbefd('0x8')](_0xbefd('0xc'),auth[_0xbefd('0x9')](),controller[_0xbefd('0xd')]);router[_0xbefd('0xe')]('/',auth[_0xbefd('0x9')](),controller['create']);router[_0xbefd('0xf')](_0xbefd('0x10'),auth[_0xbefd('0x9')](),controller['update']);router[_0xbefd('0x11')](_0xbefd('0x10'),auth['isAuthenticated'](),controller[_0xbefd('0x12')]);module[_0xbefd('0x13')]=router;
\ No newline at end of file
+var _0x4e3c=['index','/:id','show','/:id/download','post','create','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x13be72,_0x25b6ea){var _0x260331=function(_0x2c7b33){while(--_0x2c7b33){_0x13be72['push'](_0x13be72['shift']());}};_0x260331(++_0x25b6ea);}(_0x4e3c,0xdf));var _0xc4e3=function(_0x7f1644,_0x268f86){_0x7f1644=_0x7f1644-0x0;var _0x5518b0=_0x4e3c[_0x7f1644];return _0x5518b0;};'use strict';var multer=require('multer');var util=require(_0xc4e3('0x0'));var path=require(_0xc4e3('0x1'));var timeout=require(_0xc4e3('0x2'));var express=require(_0xc4e3('0x3'));var router=express[_0xc4e3('0x4')]();var fs_extra=require(_0xc4e3('0x5'));var auth=require(_0xc4e3('0x6'));var interaction=require(_0xc4e3('0x7'));var config=require('../../config/environment');var controller=require(_0xc4e3('0x8'));router[_0xc4e3('0x9')]('/',auth[_0xc4e3('0xa')](),controller[_0xc4e3('0xb')]);router[_0xc4e3('0x9')](_0xc4e3('0xc'),auth[_0xc4e3('0xa')](),controller[_0xc4e3('0xd')]);router[_0xc4e3('0x9')](_0xc4e3('0xe'),auth[_0xc4e3('0xa')](),controller['download']);router[_0xc4e3('0xf')]('/',auth[_0xc4e3('0xa')](),controller[_0xc4e3('0x10')]);router['put']('/:id',auth[_0xc4e3('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc4e3('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 370f91a..36215de 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 _0x1259=['STRING','BOOLEAN'];(function(_0x18bd66,_0x29296a){var _0x22912d=function(_0x4bfb31){while(--_0x4bfb31){_0x18bd66['push'](_0x18bd66['shift']());}};_0x22912d(++_0x29296a);}(_0x1259,0x12e));var _0x9125=function(_0x33fcfd,_0x2e4462){_0x33fcfd=_0x33fcfd-0x0;var _0x2976c0=_0x1259[_0x33fcfd];return _0x2976c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x9125('0x0')]},'function':{'type':Sequelize[_0x9125('0x0')]},'format':{'type':Sequelize[_0x9125('0x0')]},'groupBy':{'type':Sequelize[_0x9125('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9125('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x618c=['exports','STRING','BOOLEAN'];(function(_0x5624eb,_0x5cad4c){var _0x2eba70=function(_0x10421c){while(--_0x10421c){_0x5624eb['push'](_0x5624eb['shift']());}};_0x2eba70(++_0x5cad4c);}(_0x618c,0x123));var _0xc618=function(_0x4cd935,_0x10d794){_0x4cd935=_0x4cd935-0x0;var _0x5a5f88=_0x618c[_0x4cd935];return _0x5a5f88;};'use strict';var Sequelize=require('sequelize');module[_0xc618('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc618('0x1')]},'function':{'type':Sequelize[_0xc618('0x1')]},'format':{'type':Sequelize[_0xc618('0x1')]},'groupBy':{'type':Sequelize[_0xc618('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc618('0x1')]},'custom':{'type':Sequelize[_0xc618('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index a1af3c6..61ab373 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 _0x062f=['update','then','destroy','error','stack','name','index','AnalyticFieldReport','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','rows','show','keys','catch','create','body','bulkCreate','find','params','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','findAll','eml-format','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','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','offset','undefined','limit','count','Content-Range','apply','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x062f,0x1ad));var _0xf062=function(_0x2ca794,_0x3e0030){_0x2ca794=_0x2ca794-0x0;var _0x27b67b=_0x062f[_0x2ca794];return _0x27b67b;};'use strict';var emlformat=require(_0xf062('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf062('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xf062('0x2'));var util=require(_0xf062('0x3'));var path=require('path');var sox=require(_0xf062('0x4'));var csv=require(_0xf062('0x5'));var ejs=require(_0xf062('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf062('0x7'));var crypto=require(_0xf062('0x8'));var jsforce=require(_0xf062('0x9'));var deskjs=require(_0xf062('0xa'));var toCsv=require(_0xf062('0x5'));var querystring=require('querystring');var Papa=require(_0xf062('0xb'));var Redis=require(_0xf062('0xc'));var authService=require(_0xf062('0xd'));var qs=require(_0xf062('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf062('0xf'));var logger=require(_0xf062('0x10'))(_0xf062('0x11'));var utils=require(_0xf062('0x12'));var config=require(_0xf062('0x13'));var licenseUtil=require(_0xf062('0x14'));var db=require(_0xf062('0x15'))['db'];function respondWithStatusCode(_0x490670,_0x21843c){_0x21843c=_0x21843c||0xcc;return function(_0x4388b5){if(_0x4388b5){return _0x490670[_0xf062('0x16')](_0x21843c);}return _0x490670[_0xf062('0x17')](_0x21843c)[_0xf062('0x18')]();};}function respondWithResult(_0x3bd864,_0x5bddd8){_0x5bddd8=_0x5bddd8||0xc8;return function(_0x4d04c6){if(_0x4d04c6){return _0x3bd864[_0xf062('0x17')](_0x5bddd8)[_0xf062('0x19')](_0x4d04c6);}};}function respondWithFilteredResult(_0x49cec4,_0x12895b){return function(_0x5ae381){if(_0x5ae381){var _0x4d4e4b=typeof _0x12895b[_0xf062('0x1a')]===_0xf062('0x1b')&&typeof _0x12895b[_0xf062('0x1c')]===_0xf062('0x1b');var _0x2801f6=_0x5ae381[_0xf062('0x1d')];var _0x5f13b7=_0x4d4e4b?0x0:_0x12895b[_0xf062('0x1a')];var _0xc1f63=_0x4d4e4b?_0x5ae381[_0xf062('0x1d')]:_0x12895b[_0xf062('0x1a')]+_0x12895b['limit'];var _0x481ee1;if(_0xc1f63>=_0x2801f6){_0xc1f63=_0x2801f6;_0x481ee1=0xc8;}else{_0x481ee1=0xce;}_0x49cec4[_0xf062('0x17')](_0x481ee1);return _0x49cec4['set'](_0xf062('0x1e'),_0x5f13b7+'-'+_0xc1f63+'/'+_0x2801f6)[_0xf062('0x19')](_0x5ae381);}return null;};}function patchUpdates(_0xf9cf53){return function(_0x36f1e7){try{jsonpatch[_0xf062('0x1f')](_0x36f1e7,_0xf9cf53,!![]);}catch(_0x247b72){return BPromise['reject'](_0x247b72);}return _0x36f1e7[_0xf062('0x20')]();};}function saveUpdates(_0x2b0a04,_0x39df11){return function(_0x304318){if(_0x304318){return _0x304318[_0xf062('0x21')](_0x2b0a04)[_0xf062('0x22')](function(_0x134ed3){return _0x134ed3;});}return null;};}function removeEntity(_0x63f4a7,_0xf7b732){return function(_0x429dba){if(_0x429dba){return _0x429dba[_0xf062('0x23')]()[_0xf062('0x22')](function(){_0x63f4a7[_0xf062('0x17')](0xcc)[_0xf062('0x18')]();});}};}function handleEntityNotFound(_0x599169,_0x16ecef){return function(_0x1bef9d){if(!_0x1bef9d){_0x599169[_0xf062('0x16')](0x194);}return _0x1bef9d;};}function handleError(_0x58e1bf,_0xdf9679){_0xdf9679=_0xdf9679||0x1f4;return function(_0x3df192){logger[_0xf062('0x24')](_0x3df192[_0xf062('0x25')]);if(_0x3df192['name']){delete _0x3df192[_0xf062('0x26')];}_0x58e1bf[_0xf062('0x17')](_0xdf9679)['send'](_0x3df192);};}exports[_0xf062('0x27')]=function(_0x21f10a,_0x12c5eb){var _0x2fb14d={},_0x12a840={},_0x4e1193={'count':0x0,'rows':[]};var _0x471c21=_['map'](db[_0xf062('0x28')][_0xf062('0x29')],function(_0x2f5dbc){return{'name':_0x2f5dbc['fieldName'],'type':_0x2f5dbc[_0xf062('0x2a')][_0xf062('0x2b')]};});_0x12a840['model']=_['map'](_0x471c21,_0xf062('0x26'));_0x12a840[_0xf062('0x2c')]=_['keys'](_0x21f10a[_0xf062('0x2c')]);_0x12a840[_0xf062('0x2d')]=_[_0xf062('0x2e')](_0x12a840[_0xf062('0x2f')],_0x12a840['query']);_0x2fb14d['attributes']=_[_0xf062('0x2e')](_0x12a840[_0xf062('0x2f')],qs['fields'](_0x21f10a[_0xf062('0x2c')][_0xf062('0x30')]));_0x2fb14d[_0xf062('0x31')]=_0x2fb14d[_0xf062('0x31')][_0xf062('0x32')]?_0x2fb14d[_0xf062('0x31')]:_0x12a840[_0xf062('0x2f')];if(!_0x21f10a[_0xf062('0x2c')][_0xf062('0x33')](_0xf062('0x34'))){_0x2fb14d['limit']=qs[_0xf062('0x1c')](_0x21f10a[_0xf062('0x2c')][_0xf062('0x1c')]);_0x2fb14d[_0xf062('0x1a')]=qs[_0xf062('0x1a')](_0x21f10a[_0xf062('0x2c')][_0xf062('0x1a')]);}_0x2fb14d['order']=qs[_0xf062('0x35')](_0x21f10a['query'][_0xf062('0x35')]);_0x2fb14d[_0xf062('0x36')]=qs[_0xf062('0x2d')](_[_0xf062('0x37')](_0x21f10a[_0xf062('0x2c')],_0x12a840[_0xf062('0x2d')]),_0x471c21);if(_0x21f10a[_0xf062('0x2c')][_0xf062('0x38')]){_0x2fb14d[_0xf062('0x36')]=_[_0xf062('0x39')](_0x2fb14d[_0xf062('0x36')],{'$or':_[_0xf062('0x3a')](_0x471c21,function(_0xdc1d51){if(_0xdc1d51[_0xf062('0x2a')]!==_0xf062('0x3b')){var _0x3bf62c={};_0x3bf62c[_0xdc1d51[_0xf062('0x26')]]={'$like':'%'+_0x21f10a[_0xf062('0x2c')]['filter']+'%'};return _0x3bf62c;}})});}_0x2fb14d=_[_0xf062('0x39')]({},_0x2fb14d,_0x21f10a['options']);var _0x6f1f18={'where':_0x2fb14d[_0xf062('0x36')]};return db['AnalyticFieldReport'][_0xf062('0x1d')](_0x6f1f18)[_0xf062('0x22')](function(_0x1ab086){_0x4e1193[_0xf062('0x1d')]=_0x1ab086;if(_0x21f10a[_0xf062('0x2c')][_0xf062('0x3c')]){_0x2fb14d[_0xf062('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x2fb14d);})[_0xf062('0x22')](function(_0x5ee6df){_0x4e1193[_0xf062('0x3e')]=_0x5ee6df;return _0x4e1193;})[_0xf062('0x22')](respondWithFilteredResult(_0x12c5eb,_0x2fb14d))['catch'](handleError(_0x12c5eb,null));};exports[_0xf062('0x3f')]=function(_0x31da10,_0x119d26){var _0x49cc7a={'raw':![],'where':{'id':_0x31da10['params']['id']}},_0x36b362={};_0x36b362[_0xf062('0x2f')]=_[_0xf062('0x40')](db[_0xf062('0x28')][_0xf062('0x29')]);_0x36b362[_0xf062('0x2c')]=_[_0xf062('0x40')](_0x31da10[_0xf062('0x2c')]);_0x36b362[_0xf062('0x2d')]=_['intersection'](_0x36b362['model'],_0x36b362[_0xf062('0x2c')]);_0x49cc7a[_0xf062('0x31')]=_[_0xf062('0x2e')](_0x36b362[_0xf062('0x2f')],qs[_0xf062('0x30')](_0x31da10[_0xf062('0x2c')][_0xf062('0x30')]));_0x49cc7a['attributes']=_0x49cc7a[_0xf062('0x31')][_0xf062('0x32')]?_0x49cc7a[_0xf062('0x31')]:_0x36b362[_0xf062('0x2f')];if(_0x31da10[_0xf062('0x2c')][_0xf062('0x3c')]){_0x49cc7a['include']=[{'all':!![]}];}_0x49cc7a=_[_0xf062('0x39')]({},_0x49cc7a,_0x31da10['options']);return db[_0xf062('0x28')]['find'](_0x49cc7a)[_0xf062('0x22')](handleEntityNotFound(_0x119d26,null))['then'](respondWithResult(_0x119d26,null))[_0xf062('0x41')](handleError(_0x119d26,null));};exports[_0xf062('0x42')]=function(_0xf57510,_0x213ff5){return db[_0xf062('0x28')][_0xf062('0x42')](_0xf57510[_0xf062('0x43')],{})[_0xf062('0x22')](respondWithResult(_0x213ff5,0xc9))[_0xf062('0x41')](handleError(_0x213ff5,null));};exports[_0xf062('0x44')]=function(_0x17fdf3,_0x4d09c3){return db[_0xf062('0x28')][_0xf062('0x44')](_0x17fdf3[_0xf062('0x43')],{'raw':![],'individualHooks':!![]})[_0xf062('0x22')](respondWithResult(_0x4d09c3,0xc9))['catch'](handleError(_0x4d09c3,null));};exports[_0xf062('0x21')]=function(_0x4477d0,_0x8ca196){if(_0x4477d0[_0xf062('0x43')]['id']){delete _0x4477d0[_0xf062('0x43')]['id'];}return db[_0xf062('0x28')][_0xf062('0x45')]({'where':{'id':_0x4477d0[_0xf062('0x46')]['id']}})['then'](handleEntityNotFound(_0x8ca196,null))['then'](saveUpdates(_0x4477d0[_0xf062('0x43')],null))[_0xf062('0x22')](respondWithResult(_0x8ca196,null))[_0xf062('0x41')](handleError(_0x8ca196,null));};exports[_0xf062('0x23')]=function(_0x433077,_0x51a824){return db[_0xf062('0x28')][_0xf062('0x45')]({'where':{'id':_0x433077[_0xf062('0x46')]['id']}})[_0xf062('0x22')](handleEntityNotFound(_0x51a824,null))['then'](removeEntity(_0x51a824,null))[_0xf062('0x41')](handleError(_0x51a824,null));};exports[_0xf062('0x47')]=function(_0x47e884,_0x1c1d9c){return db[_0xf062('0x28')][_0xf062('0x23')]({'where':{'id':_0x47e884['query'][_0xf062('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xf062('0x22')](respondWithResult(_0x1c1d9c,0xcc))[_0xf062('0x41')](handleError(_0x1c1d9c,null));};exports['addFields']=function(_0x42bae3,_0x74df82,_0xf7807d){return db[_0xf062('0x49')][_0xf062('0x4a')]({'where':{'id':_0x42bae3['params']['id']}})['then'](handleEntityNotFound(_0x74df82,null))['then'](function(_0x443870){if(_0x443870){return db[_0xf062('0x4b')]['transaction'](function(_0x175055){return db[_0xf062('0x28')][_0xf062('0x23')]({'where':{'CustomReportId':_0x42bae3[_0xf062('0x46')]['id']},'transaction':_0x175055})[_0xf062('0x22')](function(_0x1ce7f8){var _0x825cd4=_[_0xf062('0x3a')](_0x42bae3[_0xf062('0x43')],function(_0x367fc6){delete _0x367fc6['id'];_0x367fc6['CustomReportId']=_0x42bae3['params']['id'];return _0x367fc6;});return db[_0xf062('0x28')]['bulkCreate'](_0x825cd4,{'transaction':_0x175055});});})['then'](function(){return db['AnalyticFieldReport'][_0xf062('0x4c')]({'where':{'CustomReportId':_0x42bae3[_0xf062('0x46')]['id']}});});}})[_0xf062('0x22')](respondWithResult(_0x74df82,null))['catch'](handleError(_0x74df82,null));};
\ No newline at end of file
+var _0x3d63=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','then','name','send','index','AnalyticFieldReport','rawAttributes','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0x3d63,0xdd));var _0x33d6=function(_0xbb39cf,_0x346217){_0xbb39cf=_0xbb39cf-0x0;var _0x308986=_0x3d63[_0xbb39cf];return _0x308986;};'use strict';var emlformat=require(_0x33d6('0x0'));var rimraf=require(_0x33d6('0x1'));var zipdir=require(_0x33d6('0x2'));var jsonpatch=require(_0x33d6('0x3'));var rp=require(_0x33d6('0x4'));var moment=require(_0x33d6('0x5'));var BPromise=require(_0x33d6('0x6'));var Mustache=require('mustache');var util=require(_0x33d6('0x7'));var path=require(_0x33d6('0x8'));var sox=require(_0x33d6('0x9'));var csv=require(_0x33d6('0xa'));var ejs=require(_0x33d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33d6('0xc'));var squel=require(_0x33d6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33d6('0xe'));var Papa=require('papaparse');var Redis=require(_0x33d6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x33d6('0x10'));var as=require(_0x33d6('0x11'));var hardwareService=require(_0x33d6('0x12'));var logger=require(_0x33d6('0x13'))(_0x33d6('0x14'));var utils=require(_0x33d6('0x15'));var config=require(_0x33d6('0x16'));var licenseUtil=require(_0x33d6('0x17'));var db=require(_0x33d6('0x18'))['db'];function respondWithStatusCode(_0xb6e214,_0x4c72cf){_0x4c72cf=_0x4c72cf||0xcc;return function(_0x410c90){if(_0x410c90){return _0xb6e214[_0x33d6('0x19')](_0x4c72cf);}return _0xb6e214[_0x33d6('0x1a')](_0x4c72cf)[_0x33d6('0x1b')]();};}function respondWithResult(_0x1b7319,_0x2e0d8c){_0x2e0d8c=_0x2e0d8c||0xc8;return function(_0x591a66){if(_0x591a66){return _0x1b7319[_0x33d6('0x1a')](_0x2e0d8c)['json'](_0x591a66);}};}function respondWithFilteredResult(_0x43263b,_0x2d3efe){return function(_0x30ddb3){if(_0x30ddb3){var _0x6c18c2=typeof _0x2d3efe[_0x33d6('0x1c')]===_0x33d6('0x1d')&&typeof _0x2d3efe[_0x33d6('0x1e')]===_0x33d6('0x1d');var _0x4b5b55=_0x30ddb3['count'];var _0x17d860=_0x6c18c2?0x0:_0x2d3efe[_0x33d6('0x1c')];var _0x4930db=_0x6c18c2?_0x30ddb3[_0x33d6('0x1f')]:_0x2d3efe[_0x33d6('0x1c')]+_0x2d3efe[_0x33d6('0x1e')];var _0x20b865;if(_0x4930db>=_0x4b5b55){_0x4930db=_0x4b5b55;_0x20b865=0xc8;}else{_0x20b865=0xce;}_0x43263b[_0x33d6('0x1a')](_0x20b865);return _0x43263b['set']('Content-Range',_0x17d860+'-'+_0x4930db+'/'+_0x4b5b55)[_0x33d6('0x20')](_0x30ddb3);}return null;};}function patchUpdates(_0x323479){return function(_0x117fcd){try{jsonpatch[_0x33d6('0x21')](_0x117fcd,_0x323479,!![]);}catch(_0x2f87f5){return BPromise[_0x33d6('0x22')](_0x2f87f5);}return _0x117fcd['save']();};}function saveUpdates(_0x41d62f,_0x420890){return function(_0xda4f62){if(_0xda4f62){return _0xda4f62[_0x33d6('0x23')](_0x41d62f)['then'](function(_0x4a38cd){return _0x4a38cd;});}return null;};}function removeEntity(_0x2a5115,_0x18288c){return function(_0x40c10d){if(_0x40c10d){return _0x40c10d[_0x33d6('0x24')]()[_0x33d6('0x25')](function(){_0x2a5115['status'](0xcc)[_0x33d6('0x1b')]();});}};}function handleEntityNotFound(_0x37b544,_0x18d066){return function(_0xd4d11d){if(!_0xd4d11d){_0x37b544[_0x33d6('0x19')](0x194);}return _0xd4d11d;};}function handleError(_0x198db8,_0x57339a){_0x57339a=_0x57339a||0x1f4;return function(_0x167d11){logger['error'](_0x167d11['stack']);if(_0x167d11[_0x33d6('0x26')]){delete _0x167d11[_0x33d6('0x26')];}_0x198db8[_0x33d6('0x1a')](_0x57339a)[_0x33d6('0x27')](_0x167d11);};}exports[_0x33d6('0x28')]=function(_0x29c81c,_0x4c3995){var _0x4952eb={},_0x34437f={},_0x420afe={'count':0x0,'rows':[]};var _0xa25dd9=_['map'](db[_0x33d6('0x29')][_0x33d6('0x2a')],function(_0x380aba){return{'name':_0x380aba['fieldName'],'type':_0x380aba['type'][_0x33d6('0x2b')]};});_0x34437f['model']=_[_0x33d6('0x2c')](_0xa25dd9,_0x33d6('0x26'));_0x34437f[_0x33d6('0x2d')]=_[_0x33d6('0x2e')](_0x29c81c[_0x33d6('0x2d')]);_0x34437f[_0x33d6('0x2f')]=_['intersection'](_0x34437f[_0x33d6('0x30')],_0x34437f[_0x33d6('0x2d')]);_0x4952eb[_0x33d6('0x31')]=_[_0x33d6('0x32')](_0x34437f[_0x33d6('0x30')],qs[_0x33d6('0x33')](_0x29c81c[_0x33d6('0x2d')][_0x33d6('0x33')]));_0x4952eb[_0x33d6('0x31')]=_0x4952eb[_0x33d6('0x31')]['length']?_0x4952eb['attributes']:_0x34437f[_0x33d6('0x30')];if(!_0x29c81c[_0x33d6('0x2d')][_0x33d6('0x34')]('nolimit')){_0x4952eb[_0x33d6('0x1e')]=qs[_0x33d6('0x1e')](_0x29c81c[_0x33d6('0x2d')][_0x33d6('0x1e')]);_0x4952eb[_0x33d6('0x1c')]=qs[_0x33d6('0x1c')](_0x29c81c['query'][_0x33d6('0x1c')]);}_0x4952eb[_0x33d6('0x35')]=qs['sort'](_0x29c81c[_0x33d6('0x2d')][_0x33d6('0x36')]);_0x4952eb[_0x33d6('0x37')]=qs[_0x33d6('0x2f')](_[_0x33d6('0x38')](_0x29c81c[_0x33d6('0x2d')],_0x34437f[_0x33d6('0x2f')]),_0xa25dd9);if(_0x29c81c['query'][_0x33d6('0x39')]){_0x4952eb[_0x33d6('0x37')]=_[_0x33d6('0x3a')](_0x4952eb[_0x33d6('0x37')],{'$or':_[_0x33d6('0x2c')](_0xa25dd9,function(_0xa73805){if(_0xa73805[_0x33d6('0x3b')]!==_0x33d6('0x3c')){var _0x4ed34d={};_0x4ed34d[_0xa73805[_0x33d6('0x26')]]={'$like':'%'+_0x29c81c[_0x33d6('0x2d')]['filter']+'%'};return _0x4ed34d;}})});}_0x4952eb=_['merge']({},_0x4952eb,_0x29c81c[_0x33d6('0x3d')]);var _0x5ebc62={'where':_0x4952eb[_0x33d6('0x37')]};return db[_0x33d6('0x29')][_0x33d6('0x1f')](_0x5ebc62)['then'](function(_0x3faec5){_0x420afe['count']=_0x3faec5;if(_0x29c81c[_0x33d6('0x2d')][_0x33d6('0x3e')]){_0x4952eb[_0x33d6('0x3f')]=[{'all':!![]}];}return db[_0x33d6('0x29')][_0x33d6('0x40')](_0x4952eb);})[_0x33d6('0x25')](function(_0x502f20){_0x420afe['rows']=_0x502f20;return _0x420afe;})[_0x33d6('0x25')](respondWithFilteredResult(_0x4c3995,_0x4952eb))[_0x33d6('0x41')](handleError(_0x4c3995,null));};exports[_0x33d6('0x42')]=function(_0x1ab42e,_0x611996){var _0x24509f={'raw':![],'where':{'id':_0x1ab42e[_0x33d6('0x43')]['id']}},_0x5cd7de={};_0x5cd7de[_0x33d6('0x30')]=_['keys'](db[_0x33d6('0x29')][_0x33d6('0x2a')]);_0x5cd7de[_0x33d6('0x2d')]=_['keys'](_0x1ab42e[_0x33d6('0x2d')]);_0x5cd7de[_0x33d6('0x2f')]=_[_0x33d6('0x32')](_0x5cd7de[_0x33d6('0x30')],_0x5cd7de[_0x33d6('0x2d')]);_0x24509f[_0x33d6('0x31')]=_['intersection'](_0x5cd7de['model'],qs['fields'](_0x1ab42e[_0x33d6('0x2d')]['fields']));_0x24509f['attributes']=_0x24509f[_0x33d6('0x31')][_0x33d6('0x44')]?_0x24509f[_0x33d6('0x31')]:_0x5cd7de[_0x33d6('0x30')];if(_0x1ab42e[_0x33d6('0x2d')][_0x33d6('0x3e')]){_0x24509f['include']=[{'all':!![]}];}_0x24509f=_[_0x33d6('0x3a')]({},_0x24509f,_0x1ab42e[_0x33d6('0x3d')]);return db[_0x33d6('0x29')]['find'](_0x24509f)[_0x33d6('0x25')](handleEntityNotFound(_0x611996,null))[_0x33d6('0x25')](respondWithResult(_0x611996,null))['catch'](handleError(_0x611996,null));};exports[_0x33d6('0x45')]=function(_0x229fa3,_0x4335f){return db[_0x33d6('0x29')]['create'](_0x229fa3[_0x33d6('0x46')],{})['then'](respondWithResult(_0x4335f,0xc9))['catch'](handleError(_0x4335f,null));};exports[_0x33d6('0x47')]=function(_0x391074,_0x5bdc1a){return db[_0x33d6('0x29')][_0x33d6('0x47')](_0x391074[_0x33d6('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5bdc1a,0xc9))[_0x33d6('0x41')](handleError(_0x5bdc1a,null));};exports[_0x33d6('0x23')]=function(_0x579101,_0x3f97e3){if(_0x579101[_0x33d6('0x46')]['id']){delete _0x579101[_0x33d6('0x46')]['id'];}return db[_0x33d6('0x29')][_0x33d6('0x48')]({'where':{'id':_0x579101[_0x33d6('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f97e3,null))[_0x33d6('0x25')](saveUpdates(_0x579101[_0x33d6('0x46')],null))[_0x33d6('0x25')](respondWithResult(_0x3f97e3,null))['catch'](handleError(_0x3f97e3,null));};exports[_0x33d6('0x24')]=function(_0x2fa897,_0x586934){return db[_0x33d6('0x29')]['find']({'where':{'id':_0x2fa897['params']['id']}})[_0x33d6('0x25')](handleEntityNotFound(_0x586934,null))['then'](removeEntity(_0x586934,null))[_0x33d6('0x41')](handleError(_0x586934,null));};exports[_0x33d6('0x49')]=function(_0x11f9f4,_0x12a62f){return db['AnalyticFieldReport'][_0x33d6('0x24')]({'where':{'id':_0x11f9f4['query'][_0x33d6('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x12a62f,0xcc))[_0x33d6('0x41')](handleError(_0x12a62f,null));};exports[_0x33d6('0x4b')]=function(_0x4a8552,_0x27773b,_0x29bbc0){return db[_0x33d6('0x4c')][_0x33d6('0x4d')]({'where':{'id':_0x4a8552[_0x33d6('0x43')]['id']}})[_0x33d6('0x25')](handleEntityNotFound(_0x27773b,null))[_0x33d6('0x25')](function(_0x2ad53a){if(_0x2ad53a){return db['sequelize'][_0x33d6('0x4e')](function(_0x30720a){return db[_0x33d6('0x29')][_0x33d6('0x24')]({'where':{'CustomReportId':_0x4a8552[_0x33d6('0x43')]['id']},'transaction':_0x30720a})[_0x33d6('0x25')](function(_0x555839){var _0x4d8c46=_['map'](_0x4a8552[_0x33d6('0x46')],function(_0xf859a9){delete _0xf859a9['id'];_0xf859a9[_0x33d6('0x4f')]=_0x4a8552[_0x33d6('0x43')]['id'];return _0xf859a9;});return db['AnalyticFieldReport'][_0x33d6('0x47')](_0x4d8c46,{'transaction':_0x30720a});});})['then'](function(){return db[_0x33d6('0x29')][_0x33d6('0x40')]({'where':{'CustomReportId':_0x4a8552[_0x33d6('0x43')]['id']}});});}})[_0x33d6('0x25')](respondWithResult(_0x27773b,null))[_0x33d6('0x41')](handleError(_0x27773b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b5a0b38..171b38c 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 _0x32f8=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x393525,_0x258412){var _0x5e8282=function(_0x24a496){while(--_0x24a496){_0x393525['push'](_0x393525['shift']());}};_0x5e8282(++_0x258412);}(_0x32f8,0xad));var _0x832f=function(_0x53d3cd,_0x4974aa){_0x53d3cd=_0x53d3cd-0x0;var _0x5a714f=_0x32f8[_0x53d3cd];return _0x5a714f;};'use strict';var _=require(_0x832f('0x0'));var util=require('util');var logger=require(_0x832f('0x1'))(_0x832f('0x2'));var moment=require(_0x832f('0x3'));var BPromise=require('bluebird');var rp=require(_0x832f('0x4'));var fs=require('fs');var path=require(_0x832f('0x5'));var rimraf=require(_0x832f('0x6'));var config=require(_0x832f('0x7'));var attributes=require(_0x832f('0x8'));module[_0x832f('0x9')]=function(_0x518184,_0x140228){return _0x518184[_0x832f('0xa')](_0x832f('0xb'),attributes,{'tableName':_0x832f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9a2=['path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','bluebird'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xf9a2,0x125));var _0x2f9a=function(_0x5e43ae,_0x302656){_0x5e43ae=_0x5e43ae-0x0;var _0x2596af=_0xf9a2[_0x5e43ae];return _0x2596af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f9a('0x0'))(_0x2f9a('0x1'));var moment=require(_0x2f9a('0x2'));var BPromise=require(_0x2f9a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f9a('0x4'));var rimraf=require(_0x2f9a('0x5'));var config=require('../../config/environment');var attributes=require(_0x2f9a('0x6'));module[_0x2f9a('0x7')]=function(_0xa1912a,_0x35ea9f){return _0xa1912a[_0x2f9a('0x8')](_0x2f9a('0x9'),attributes,{'tableName':_0x2f9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index de5211d..1249453 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 _0xfc21=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch'];(function(_0xb72ea1,_0x593e01){var _0xc42ec5=function(_0x4ef73c){while(--_0x4ef73c){_0xb72ea1['push'](_0xb72ea1['shift']());}};_0xc42ec5(++_0x593e01);}(_0xfc21,0x1b5));var _0x1fc2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc21[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x1fc2('0x0'));var util=require(_0x1fc2('0x1'));var moment=require(_0x1fc2('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fc2('0x3'));var fs=require('fs');var Redis=require(_0x1fc2('0x4'));var db=require(_0x1fc2('0x5'))['db'];var utils=require(_0x1fc2('0x6'));var logger=require('../../config/logger')(_0x1fc2('0x7'));var config=require(_0x1fc2('0x8'));var jayson=require(_0x1fc2('0x9'));var client=jayson['client'][_0x1fc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbfd0ee,_0x2ee060,_0x20bcad){return new BPromise(function(_0x2080a1,_0x34faf4){return client[_0x1fc2('0xb')](_0xbfd0ee,_0x20bcad)[_0x1fc2('0xc')](function(_0x1507db){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2ee060,_0x1fc2('0xd'));logger[_0x1fc2('0xe')](_0x1fc2('0xf'),_0x2ee060,_0x1fc2('0xd'),JSON[_0x1fc2('0x10')](_0x1507db));if(_0x1507db[_0x1fc2('0x11')]){if(_0x1507db[_0x1fc2('0x11')][_0x1fc2('0x12')]===0x1f4){logger[_0x1fc2('0x11')](_0x1fc2('0x13'),_0x2ee060,_0x1507db['error'][_0x1fc2('0x14')]);return _0x34faf4(_0x1507db[_0x1fc2('0x11')]['message']);}logger[_0x1fc2('0x11')](_0x1fc2('0x13'),_0x2ee060,_0x1507db['error'][_0x1fc2('0x14')]);return _0x2080a1(_0x1507db[_0x1fc2('0x11')][_0x1fc2('0x14')]);}else{logger['info'](_0x1fc2('0x13'),_0x2ee060,_0x1fc2('0xd'));_0x2080a1(_0x1507db[_0x1fc2('0x15')]['message']);}})[_0x1fc2('0x16')](function(_0x5e32b7){logger['error'](_0x1fc2('0x13'),_0x2ee060,_0x5e32b7);_0x34faf4(_0x5e32b7);});});}
\ No newline at end of file
+var _0x3416=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x35e8bf,_0x259748){var _0x48049c=function(_0x3ce485){while(--_0x3ce485){_0x35e8bf['push'](_0x35e8bf['shift']());}};_0x48049c(++_0x259748);}(_0x3416,0x13f));var _0x6341=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x3416[_0x448f8];return _0xa73126;};'use strict';var _=require(_0x6341('0x0'));var util=require(_0x6341('0x1'));var moment=require(_0x6341('0x2'));var BPromise=require(_0x6341('0x3'));var rs=require(_0x6341('0x4'));var fs=require('fs');var Redis=require(_0x6341('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6341('0x6'));var logger=require(_0x6341('0x7'))(_0x6341('0x8'));var config=require(_0x6341('0x9'));var jayson=require(_0x6341('0xa'));var client=jayson['client'][_0x6341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dd7fb,_0x35ca53,_0x5ad454){return new BPromise(function(_0x47e9f4,_0x55dfce){return client['request'](_0x5dd7fb,_0x5ad454)['then'](function(_0x35405f){logger[_0x6341('0xc')](_0x6341('0xd'),_0x35ca53,_0x6341('0xe'));logger['debug'](_0x6341('0xf'),_0x35ca53,'request\x20sent',JSON['stringify'](_0x35405f));if(_0x35405f[_0x6341('0x10')]){if(_0x35405f[_0x6341('0x10')][_0x6341('0x11')]===0x1f4){logger[_0x6341('0x10')](_0x6341('0xd'),_0x35ca53,_0x35405f['error'][_0x6341('0x12')]);return _0x55dfce(_0x35405f[_0x6341('0x10')][_0x6341('0x12')]);}logger[_0x6341('0x10')](_0x6341('0xd'),_0x35ca53,_0x35405f[_0x6341('0x10')]['message']);return _0x47e9f4(_0x35405f['error']['message']);}else{logger[_0x6341('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x35ca53,'request\x20sent');_0x47e9f4(_0x35405f[_0x6341('0x13')][_0x6341('0x12')]);}})['catch'](function(_0x1032c0){logger['error'](_0x6341('0xd'),_0x35ca53,_0x1032c0);_0x55dfce(_0x1032c0);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b20f533..89d28df 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(_0x3db326,_0x5eb2bf){var _0x36cfd0=function(_0x216baf){while(--_0x216baf){_0x3db326['push'](_0x3db326['shift']());}};_0x36cfd0(++_0x5eb2bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x51c560,_0x4e6c0e){var _0x594579=function(_0x18c6fe){while(--_0x18c6fe){_0x51c560['push'](_0x51c560['shift']());}};_0x594579(++_0x4e6c0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 58de969..7e383dd 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 _0xa3b9=['exports','STRING','name','TEXT','sequelize'];(function(_0x54f8cb,_0xa8994e){var _0x4a1d18=function(_0x4ac6d1){while(--_0x4ac6d1){_0x54f8cb['push'](_0x54f8cb['shift']());}};_0x4a1d18(++_0xa8994e);}(_0xa3b9,0x112));var _0x9a3b=function(_0x17f602,_0x18fc6f){_0x17f602=_0x17f602-0x0;var _0x1279a0=_0xa3b9[_0x17f602];return _0x1279a0;};'use strict';var Sequelize=require(_0x9a3b('0x0'));module[_0x9a3b('0x1')]={'name':{'type':Sequelize[_0x9a3b('0x2')],'allowNull':![],'unique':_0x9a3b('0x3')},'table':{'type':Sequelize[_0x9a3b('0x2')]},'metric':{'type':Sequelize[_0x9a3b('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb264=['sequelize','exports','name','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4b26('0x0'));module[_0x4b26('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b26('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x4b26('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 86bc8d7..fc53412 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 _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x2df7a7,_0x34b265){var _0x34ec49=function(_0x3da3d2){while(--_0x3da3d2){_0x2df7a7['push'](_0x2df7a7['shift']());}};_0x34ec49(++_0x34b265);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x351617,_0x101d34){_0x351617=_0x351617-0x0;var _0x41bb53=_0xd6d6[_0x351617];return _0x41bb53;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1be123,_0x57fd4d){var _0x5606d1=function(_0x4560d1){while(--_0x4560d1){_0x1be123['push'](_0x1be123['shift']());}};_0x5606d1(++_0x57fd4d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x904d6a,_0x3cda68){_0x904d6a=_0x904d6a-0x0;var _0x588beb=_0xdc97[_0x904d6a];return _0x588beb;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index bdaf520..3e4ed32 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 _0xbccd=['lodash','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1f38ad,_0x393233){var _0x1bffc8=function(_0xd5df14){while(--_0xd5df14){_0x1f38ad['push'](_0x1f38ad['shift']());}};_0x1bffc8(++_0x393233);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbccd[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbcc('0x1'));var moment=require(_0xdbcc('0x2'));var BPromise=require(_0xdbcc('0x3'));var rp=require(_0xdbcc('0x4'));var fs=require('fs');var path=require(_0xdbcc('0x5'));var rimraf=require(_0xdbcc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbcc('0x7'));module[_0xdbcc('0x8')]=function(_0x9cca7a,_0x2997fd){return _0x9cca7a[_0xdbcc('0x9')](_0xdbcc('0xa'),attributes,{'tableName':_0xdbcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbcd=['../../config/environment','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x1e1233,_0x3f6cd0){var _0x38bc85=function(_0x31fff9){while(--_0x31fff9){_0x1e1233['push'](_0x1e1233['shift']());}};_0x38bc85(++_0x3f6cd0);}(_0xdbcd,0x1ba));var _0xddbc=function(_0x4832fe,_0x3558aa){_0x4832fe=_0x4832fe-0x0;var _0x237c72=_0xdbcd[_0x4832fe];return _0x237c72;};'use strict';var _=require(_0xddbc('0x0'));var util=require(_0xddbc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xddbc('0x2'));var BPromise=require(_0xddbc('0x3'));var rp=require(_0xddbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x599f35,_0x2308e5){return _0x599f35['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 56dd0d4..3445237 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 _0xe3b4=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xe3b4,0x163));var _0x4e3b=function(_0xc681a8,_0x4a45ba){_0xc681a8=_0xc681a8-0x0;var _0x4bdfae=_0xe3b4[_0xc681a8];return _0x4bdfae;};'use strict';var _=require(_0x4e3b('0x0'));var util=require('util');var moment=require(_0x4e3b('0x1'));var BPromise=require(_0x4e3b('0x2'));var rs=require(_0x4e3b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e3b('0x4'))['db'];var utils=require(_0x4e3b('0x5'));var logger=require(_0x4e3b('0x6'))(_0x4e3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e3b('0x8'));var client=jayson[_0x4e3b('0x9')][_0x4e3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31a2a6,_0x385043,_0x20b94a){return new BPromise(function(_0x351266,_0x17ba03){return client[_0x4e3b('0xb')](_0x31a2a6,_0x20b94a)[_0x4e3b('0xc')](function(_0x469c3a){logger['info'](_0x4e3b('0xd'),_0x385043,_0x4e3b('0xe'));logger[_0x4e3b('0xf')](_0x4e3b('0x10'),_0x385043,_0x4e3b('0xe'),JSON['stringify'](_0x469c3a));if(_0x469c3a[_0x4e3b('0x11')]){if(_0x469c3a[_0x4e3b('0x11')][_0x4e3b('0x12')]===0x1f4){logger[_0x4e3b('0x11')](_0x4e3b('0xd'),_0x385043,_0x469c3a['error'][_0x4e3b('0x13')]);return _0x17ba03(_0x469c3a['error'][_0x4e3b('0x13')]);}logger[_0x4e3b('0x11')](_0x4e3b('0xd'),_0x385043,_0x469c3a[_0x4e3b('0x11')][_0x4e3b('0x13')]);return _0x351266(_0x469c3a[_0x4e3b('0x11')]['message']);}else{logger['info'](_0x4e3b('0xd'),_0x385043,_0x4e3b('0xe'));_0x351266(_0x469c3a['result'][_0x4e3b('0x13')]);}})[_0x4e3b('0x14')](function(_0x37631c){logger[_0x4e3b('0x11')](_0x4e3b('0xd'),_0x385043,_0x37631c);_0x17ba03(_0x37631c);});});}
\ No newline at end of file
+var _0x3704=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request'];(function(_0x261ea9,_0x2aca31){var _0x5e080c=function(_0x27b93d){while(--_0x27b93d){_0x261ea9['push'](_0x261ea9['shift']());}};_0x5e080c(++_0x2aca31);}(_0x3704,0x187));var _0x4370=function(_0x1deded,_0x404373){_0x1deded=_0x1deded-0x0;var _0x49622f=_0x3704[_0x1deded];return _0x49622f;};'use strict';var _=require('lodash');var util=require(_0x4370('0x0'));var moment=require('moment');var BPromise=require(_0x4370('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4370('0x2'))['db'];var utils=require(_0x4370('0x3'));var logger=require(_0x4370('0x4'))(_0x4370('0x5'));var config=require(_0x4370('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3a91,_0x55482e,_0x38bcd3){return new BPromise(function(_0x54cf6f,_0x111fc3){return client[_0x4370('0x7')](_0x1f3a91,_0x38bcd3)[_0x4370('0x8')](function(_0x7377a6){logger[_0x4370('0x9')](_0x4370('0xa'),_0x55482e,_0x4370('0xb'));logger[_0x4370('0xc')](_0x4370('0xd'),_0x55482e,_0x4370('0xb'),JSON[_0x4370('0xe')](_0x7377a6));if(_0x7377a6[_0x4370('0xf')]){if(_0x7377a6[_0x4370('0xf')][_0x4370('0x10')]===0x1f4){logger[_0x4370('0xf')](_0x4370('0xa'),_0x55482e,_0x7377a6['error'][_0x4370('0x11')]);return _0x111fc3(_0x7377a6['error']['message']);}logger['error'](_0x4370('0xa'),_0x55482e,_0x7377a6[_0x4370('0xf')][_0x4370('0x11')]);return _0x54cf6f(_0x7377a6[_0x4370('0xf')]['message']);}else{logger[_0x4370('0x9')](_0x4370('0xa'),_0x55482e,_0x4370('0xb'));_0x54cf6f(_0x7377a6[_0x4370('0x12')]['message']);}})['catch'](function(_0x18ece9){logger[_0x4370('0xf')](_0x4370('0xa'),_0x55482e,_0x18ece9);_0x111fc3(_0x18ece9);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cf3403e..09a046c 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 _0xe314=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x3bf25b,_0x2aeedf){var _0x4c3af5=function(_0x291a47){while(--_0x291a47){_0x3bf25b['push'](_0x3bf25b['shift']());}};_0x4c3af5(++_0x2aeedf);}(_0xe314,0x7c));var _0x4e31=function(_0x2f10f1,_0x1dc685){_0x2f10f1=_0x2f10f1-0x0;var _0x5cb718=_0xe314[_0x2f10f1];return _0x5cb718;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xf')]('/',auth['isAuthenticated'](),controller[_0x4e31('0x10')]);router[_0x4e31('0x11')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller['update']);router[_0x4e31('0x12')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router;
\ No newline at end of file
+var _0xaa5c=['delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xda8f94,_0xba9150){var _0x5ef241=function(_0x119b90){while(--_0x119b90){_0xda8f94['push'](_0xda8f94['shift']());}};_0x5ef241(++_0xba9150);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x2ac55f,_0x20a584){_0x2ac55f=_0x2ac55f-0x0;var _0x13e605=_0xaa5c[_0x2ac55f];return _0x13e605;};'use strict';var multer=require(_0xcaa5('0x0'));var util=require(_0xcaa5('0x1'));var path=require(_0xcaa5('0x2'));var timeout=require(_0xcaa5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaa5('0x4'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xcaa5('0x5')]('/',auth[_0xcaa5('0x6')](),controller[_0xcaa5('0x7')]);router['get'](_0xcaa5('0x8'),auth[_0xcaa5('0x6')](),controller[_0xcaa5('0x9')]);router[_0xcaa5('0xa')]('/',auth['isAuthenticated'](),controller[_0xcaa5('0xb')]);router[_0xcaa5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xcaa5('0xd')]);router[_0xcaa5('0xe')](_0xcaa5('0x8'),auth['isAuthenticated'](),controller[_0xcaa5('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 12373da..b6ace20 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 _0xd006=['TEXT','sequelize','exports'];(function(_0x272e6c,_0x393c36){var _0xc812ad=function(_0x2a1726){while(--_0x2a1726){_0x272e6c['push'](_0x272e6c['shift']());}};_0xc812ad(++_0x393c36);}(_0xd006,0x124));var _0x6d00=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xd006[_0xf79bae];return _0x5d2cb7;};'use strict';var Sequelize=require(_0x6d00('0x0'));module[_0x6d00('0x1')]={'tree':{'type':Sequelize[_0x6d00('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xacdd=['exports','sequelize'];(function(_0xe618a9,_0x3eddc5){var _0x20aae0=function(_0x587f26){while(--_0x587f26){_0xe618a9['push'](_0xe618a9['shift']());}};_0x20aae0(++_0x3eddc5);}(_0xacdd,0xbf));var _0xdacd=function(_0x5ed652,_0x531731){_0x5ed652=_0x5ed652-0x0;var _0x3c0826=_0xacdd[_0x5ed652];return _0x3c0826;};'use strict';var Sequelize=require(_0xdacd('0x0'));module[_0xdacd('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 87aa62d..a617b9e 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 _0xe3f5=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','index','map','AnalyticTreeReport','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0xfebd70,_0xab7381){var _0x3816ae=function(_0x744f5b){while(--_0x744f5b){_0xfebd70['push'](_0xfebd70['shift']());}};_0x3816ae(++_0xab7381);}(_0xe3f5,0x157));var _0x5e3f=function(_0x44cd4d,_0x383dde){_0x44cd4d=_0x44cd4d-0x0;var _0x318e38=_0xe3f5[_0x44cd4d];return _0x318e38;};'use strict';var emlformat=require(_0x5e3f('0x0'));var rimraf=require(_0x5e3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e3f('0x2'));var rp=require(_0x5e3f('0x3'));var moment=require(_0x5e3f('0x4'));var BPromise=require(_0x5e3f('0x5'));var Mustache=require(_0x5e3f('0x6'));var util=require(_0x5e3f('0x7'));var path=require('path');var sox=require(_0x5e3f('0x8'));var csv=require(_0x5e3f('0x9'));var ejs=require(_0x5e3f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e3f('0xb'));var squel=require(_0x5e3f('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e3f('0xd'));var deskjs=require(_0x5e3f('0xe'));var toCsv=require(_0x5e3f('0x9'));var querystring=require(_0x5e3f('0xf'));var Papa=require(_0x5e3f('0x10'));var Redis=require(_0x5e3f('0x11'));var authService=require(_0x5e3f('0x12'));var qs=require(_0x5e3f('0x13'));var as=require(_0x5e3f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e3f('0x15'))('api');var utils=require(_0x5e3f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5e3f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371aec,_0x197946){_0x197946=_0x197946||0xcc;return function(_0x319a20){if(_0x319a20){return _0x371aec[_0x5e3f('0x18')](_0x197946);}return _0x371aec[_0x5e3f('0x19')](_0x197946)['end']();};}function respondWithResult(_0x418abc,_0x4a4b2e){_0x4a4b2e=_0x4a4b2e||0xc8;return function(_0x465c58){if(_0x465c58){return _0x418abc[_0x5e3f('0x19')](_0x4a4b2e)[_0x5e3f('0x1a')](_0x465c58);}};}function respondWithFilteredResult(_0x114508,_0x2d8007){return function(_0x32d36e){if(_0x32d36e){var _0x2ea9d2=typeof _0x2d8007[_0x5e3f('0x1b')]===_0x5e3f('0x1c')&&typeof _0x2d8007[_0x5e3f('0x1d')]===_0x5e3f('0x1c');var _0x4e6d9c=_0x32d36e[_0x5e3f('0x1e')];var _0x3eaf06=_0x2ea9d2?0x0:_0x2d8007[_0x5e3f('0x1b')];var _0x2fbaab=_0x2ea9d2?_0x32d36e[_0x5e3f('0x1e')]:_0x2d8007[_0x5e3f('0x1b')]+_0x2d8007['limit'];var _0x5b8862;if(_0x2fbaab>=_0x4e6d9c){_0x2fbaab=_0x4e6d9c;_0x5b8862=0xc8;}else{_0x5b8862=0xce;}_0x114508[_0x5e3f('0x19')](_0x5b8862);return _0x114508[_0x5e3f('0x1f')](_0x5e3f('0x20'),_0x3eaf06+'-'+_0x2fbaab+'/'+_0x4e6d9c)['json'](_0x32d36e);}return null;};}function patchUpdates(_0x31e404){return function(_0x583de9){try{jsonpatch['apply'](_0x583de9,_0x31e404,!![]);}catch(_0x465b5b){return BPromise[_0x5e3f('0x21')](_0x465b5b);}return _0x583de9[_0x5e3f('0x22')]();};}function saveUpdates(_0x3d9cd5,_0x4613ab){return function(_0x58ecf5){if(_0x58ecf5){return _0x58ecf5['update'](_0x3d9cd5)[_0x5e3f('0x23')](function(_0x5611e8){return _0x5611e8;});}return null;};}function removeEntity(_0x1c5f12,_0x11e36d){return function(_0x1b145f){if(_0x1b145f){return _0x1b145f['destroy']()[_0x5e3f('0x23')](function(){_0x1c5f12[_0x5e3f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33aa67,_0x632fe1){return function(_0x24cbd1){if(!_0x24cbd1){_0x33aa67[_0x5e3f('0x18')](0x194);}return _0x24cbd1;};}function handleError(_0x77c1be,_0x32d4b9){_0x32d4b9=_0x32d4b9||0x1f4;return function(_0x35b288){logger['error'](_0x35b288['stack']);if(_0x35b288[_0x5e3f('0x24')]){delete _0x35b288[_0x5e3f('0x24')];}_0x77c1be[_0x5e3f('0x19')](_0x32d4b9)[_0x5e3f('0x25')](_0x35b288);};}exports[_0x5e3f('0x26')]=function(_0x45bad0,_0x20393f){var _0x4f7324={},_0x56c50c={},_0x42302f={'count':0x0,'rows':[]};var _0x1660d2=_[_0x5e3f('0x27')](db[_0x5e3f('0x28')][_0x5e3f('0x29')],function(_0x4b61a2){return{'name':_0x4b61a2['fieldName'],'type':_0x4b61a2[_0x5e3f('0x2a')]['key']};});_0x56c50c['model']=_['map'](_0x1660d2,_0x5e3f('0x24'));_0x56c50c['query']=_[_0x5e3f('0x2b')](_0x45bad0['query']);_0x56c50c[_0x5e3f('0x2c')]=_[_0x5e3f('0x2d')](_0x56c50c[_0x5e3f('0x2e')],_0x56c50c[_0x5e3f('0x2f')]);_0x4f7324[_0x5e3f('0x30')]=_[_0x5e3f('0x2d')](_0x56c50c[_0x5e3f('0x2e')],qs[_0x5e3f('0x31')](_0x45bad0['query'][_0x5e3f('0x31')]));_0x4f7324[_0x5e3f('0x30')]=_0x4f7324[_0x5e3f('0x30')][_0x5e3f('0x32')]?_0x4f7324['attributes']:_0x56c50c[_0x5e3f('0x2e')];if(!_0x45bad0[_0x5e3f('0x2f')][_0x5e3f('0x33')](_0x5e3f('0x34'))){_0x4f7324['limit']=qs['limit'](_0x45bad0['query']['limit']);_0x4f7324['offset']=qs[_0x5e3f('0x1b')](_0x45bad0[_0x5e3f('0x2f')][_0x5e3f('0x1b')]);}_0x4f7324[_0x5e3f('0x35')]=qs['sort'](_0x45bad0[_0x5e3f('0x2f')]['sort']);_0x4f7324[_0x5e3f('0x36')]=qs[_0x5e3f('0x2c')](_[_0x5e3f('0x37')](_0x45bad0[_0x5e3f('0x2f')],_0x56c50c[_0x5e3f('0x2c')]),_0x1660d2);if(_0x45bad0['query']['filter']){_0x4f7324[_0x5e3f('0x36')]=_['merge'](_0x4f7324[_0x5e3f('0x36')],{'$or':_[_0x5e3f('0x27')](_0x1660d2,function(_0x554dc4){if(_0x554dc4[_0x5e3f('0x2a')]!==_0x5e3f('0x38')){var _0x2cc4fb={};_0x2cc4fb[_0x554dc4['name']]={'$like':'%'+_0x45bad0[_0x5e3f('0x2f')][_0x5e3f('0x39')]+'%'};return _0x2cc4fb;}})});}_0x4f7324=_[_0x5e3f('0x3a')]({},_0x4f7324,_0x45bad0[_0x5e3f('0x3b')]);var _0x4fd4f0={'where':_0x4f7324['where']};return db[_0x5e3f('0x28')][_0x5e3f('0x1e')](_0x4fd4f0)[_0x5e3f('0x23')](function(_0x4bfc14){_0x42302f[_0x5e3f('0x1e')]=_0x4bfc14;if(_0x45bad0[_0x5e3f('0x2f')][_0x5e3f('0x3c')]){_0x4f7324[_0x5e3f('0x3d')]=[{'all':!![]}];}return db[_0x5e3f('0x28')][_0x5e3f('0x3e')](_0x4f7324);})[_0x5e3f('0x23')](function(_0x11f443){_0x42302f['rows']=_0x11f443;return _0x42302f;})[_0x5e3f('0x23')](respondWithFilteredResult(_0x20393f,_0x4f7324))[_0x5e3f('0x3f')](handleError(_0x20393f,null));};exports[_0x5e3f('0x40')]=function(_0x3442dc,_0x2a6260){var _0x519a5c={'raw':!![],'where':{'id':_0x3442dc[_0x5e3f('0x41')]['id']}},_0x452745={};_0x452745[_0x5e3f('0x2e')]=_[_0x5e3f('0x2b')](db[_0x5e3f('0x28')][_0x5e3f('0x29')]);_0x452745['query']=_[_0x5e3f('0x2b')](_0x3442dc[_0x5e3f('0x2f')]);_0x452745[_0x5e3f('0x2c')]=_[_0x5e3f('0x2d')](_0x452745['model'],_0x452745['query']);_0x519a5c[_0x5e3f('0x30')]=_[_0x5e3f('0x2d')](_0x452745[_0x5e3f('0x2e')],qs['fields'](_0x3442dc[_0x5e3f('0x2f')][_0x5e3f('0x31')]));_0x519a5c[_0x5e3f('0x30')]=_0x519a5c[_0x5e3f('0x30')]['length']?_0x519a5c[_0x5e3f('0x30')]:_0x452745[_0x5e3f('0x2e')];if(_0x3442dc[_0x5e3f('0x2f')][_0x5e3f('0x3c')]){_0x519a5c[_0x5e3f('0x3d')]=[{'all':!![]}];}_0x519a5c=_[_0x5e3f('0x3a')]({},_0x519a5c,_0x3442dc[_0x5e3f('0x3b')]);return db[_0x5e3f('0x28')][_0x5e3f('0x42')](_0x519a5c)['then'](handleEntityNotFound(_0x2a6260,null))[_0x5e3f('0x23')](respondWithResult(_0x2a6260,null))[_0x5e3f('0x3f')](handleError(_0x2a6260,null));};exports[_0x5e3f('0x43')]=function(_0x1fb847,_0x1c1f92){return db[_0x5e3f('0x28')]['create'](_0x1fb847[_0x5e3f('0x44')],{})[_0x5e3f('0x23')](respondWithResult(_0x1c1f92,0xc9))[_0x5e3f('0x3f')](handleError(_0x1c1f92,null));};exports['update']=function(_0x3a871f,_0x4efc3e){if(_0x3a871f[_0x5e3f('0x44')]['id']){delete _0x3a871f[_0x5e3f('0x44')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3a871f['params']['id']}})[_0x5e3f('0x23')](handleEntityNotFound(_0x4efc3e,null))[_0x5e3f('0x23')](saveUpdates(_0x3a871f['body'],null))[_0x5e3f('0x23')](respondWithResult(_0x4efc3e,null))['catch'](handleError(_0x4efc3e,null));};exports['destroy']=function(_0x34c927,_0x3284d3){return db['AnalyticTreeReport'][_0x5e3f('0x42')]({'where':{'id':_0x34c927[_0x5e3f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3284d3,null))[_0x5e3f('0x23')](removeEntity(_0x3284d3,null))[_0x5e3f('0x3f')](handleError(_0x3284d3,null));};
\ No newline at end of file
+var _0x7a35=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows','length','includeAll','include','catch','create','body','find','params'];(function(_0x11f358,_0x36c643){var _0xe639de=function(_0x33f871){while(--_0x33f871){_0x11f358['push'](_0x11f358['shift']());}};_0xe639de(++_0x36c643);}(_0x7a35,0x130));var _0x57a3=function(_0x27378b,_0x1a7162){_0x27378b=_0x27378b-0x0;var _0x4b637b=_0x7a35[_0x27378b];return _0x4b637b;};'use strict';var emlformat=require(_0x57a3('0x0'));var rimraf=require(_0x57a3('0x1'));var zipdir=require(_0x57a3('0x2'));var jsonpatch=require(_0x57a3('0x3'));var rp=require(_0x57a3('0x4'));var moment=require(_0x57a3('0x5'));var BPromise=require(_0x57a3('0x6'));var Mustache=require(_0x57a3('0x7'));var util=require(_0x57a3('0x8'));var path=require(_0x57a3('0x9'));var sox=require(_0x57a3('0xa'));var csv=require(_0x57a3('0xb'));var ejs=require(_0x57a3('0xc'));var fs=require('fs');var fs_extra=require(_0x57a3('0xd'));var _=require('lodash');var squel=require(_0x57a3('0xe'));var crypto=require('crypto');var jsforce=require(_0x57a3('0xf'));var deskjs=require(_0x57a3('0x10'));var toCsv=require(_0x57a3('0xb'));var querystring=require(_0x57a3('0x11'));var Papa=require(_0x57a3('0x12'));var Redis=require(_0x57a3('0x13'));var authService=require(_0x57a3('0x14'));var qs=require(_0x57a3('0x15'));var as=require(_0x57a3('0x16'));var hardwareService=require(_0x57a3('0x17'));var logger=require('../../config/logger')(_0x57a3('0x18'));var utils=require(_0x57a3('0x19'));var config=require(_0x57a3('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499ab1,_0x8c2831){_0x8c2831=_0x8c2831||0xcc;return function(_0x337425){if(_0x337425){return _0x499ab1[_0x57a3('0x1b')](_0x8c2831);}return _0x499ab1['status'](_0x8c2831)['end']();};}function respondWithResult(_0x5006d3,_0xe8114c){_0xe8114c=_0xe8114c||0xc8;return function(_0x435968){if(_0x435968){return _0x5006d3[_0x57a3('0x1c')](_0xe8114c)['json'](_0x435968);}};}function respondWithFilteredResult(_0x25ada1,_0x4af677){return function(_0x7cc799){if(_0x7cc799){var _0x313756=typeof _0x4af677[_0x57a3('0x1d')]===_0x57a3('0x1e')&&typeof _0x4af677[_0x57a3('0x1f')]===_0x57a3('0x1e');var _0x20bbfb=_0x7cc799[_0x57a3('0x20')];var _0x4eb3e8=_0x313756?0x0:_0x4af677[_0x57a3('0x1d')];var _0x174762=_0x313756?_0x7cc799[_0x57a3('0x20')]:_0x4af677[_0x57a3('0x1d')]+_0x4af677['limit'];var _0x5cb5e1;if(_0x174762>=_0x20bbfb){_0x174762=_0x20bbfb;_0x5cb5e1=0xc8;}else{_0x5cb5e1=0xce;}_0x25ada1[_0x57a3('0x1c')](_0x5cb5e1);return _0x25ada1[_0x57a3('0x21')](_0x57a3('0x22'),_0x4eb3e8+'-'+_0x174762+'/'+_0x20bbfb)[_0x57a3('0x23')](_0x7cc799);}return null;};}function patchUpdates(_0x1b34b4){return function(_0x2f25d6){try{jsonpatch[_0x57a3('0x24')](_0x2f25d6,_0x1b34b4,!![]);}catch(_0x4d4c12){return BPromise['reject'](_0x4d4c12);}return _0x2f25d6[_0x57a3('0x25')]();};}function saveUpdates(_0x43c391,_0x157b87){return function(_0x33a738){if(_0x33a738){return _0x33a738[_0x57a3('0x26')](_0x43c391)[_0x57a3('0x27')](function(_0x1624f3){return _0x1624f3;});}return null;};}function removeEntity(_0x2c0bad,_0x1a28db){return function(_0x259bbd){if(_0x259bbd){return _0x259bbd[_0x57a3('0x28')]()[_0x57a3('0x27')](function(){_0x2c0bad[_0x57a3('0x1c')](0xcc)[_0x57a3('0x29')]();});}};}function handleEntityNotFound(_0x12a180,_0x3804da){return function(_0xbb8e75){if(!_0xbb8e75){_0x12a180[_0x57a3('0x1b')](0x194);}return _0xbb8e75;};}function handleError(_0x48c78b,_0x23149e){_0x23149e=_0x23149e||0x1f4;return function(_0xc995ec){logger[_0x57a3('0x2a')](_0xc995ec['stack']);if(_0xc995ec[_0x57a3('0x2b')]){delete _0xc995ec['name'];}_0x48c78b['status'](_0x23149e)['send'](_0xc995ec);};}exports[_0x57a3('0x2c')]=function(_0x192c74,_0x4d5962){var _0x3254c1={},_0x49fb72={},_0x55e849={'count':0x0,'rows':[]};var _0x503108=_[_0x57a3('0x2d')](db[_0x57a3('0x2e')][_0x57a3('0x2f')],function(_0x1e23e7){return{'name':_0x1e23e7[_0x57a3('0x30')],'type':_0x1e23e7[_0x57a3('0x31')][_0x57a3('0x32')]};});_0x49fb72['model']=_['map'](_0x503108,_0x57a3('0x2b'));_0x49fb72[_0x57a3('0x33')]=_[_0x57a3('0x34')](_0x192c74['query']);_0x49fb72[_0x57a3('0x35')]=_['intersection'](_0x49fb72['model'],_0x49fb72[_0x57a3('0x33')]);_0x3254c1['attributes']=_[_0x57a3('0x36')](_0x49fb72[_0x57a3('0x37')],qs['fields'](_0x192c74['query'][_0x57a3('0x38')]));_0x3254c1['attributes']=_0x3254c1['attributes']['length']?_0x3254c1[_0x57a3('0x39')]:_0x49fb72['model'];if(!_0x192c74[_0x57a3('0x33')][_0x57a3('0x3a')]('nolimit')){_0x3254c1['limit']=qs[_0x57a3('0x1f')](_0x192c74['query'][_0x57a3('0x1f')]);_0x3254c1[_0x57a3('0x1d')]=qs[_0x57a3('0x1d')](_0x192c74[_0x57a3('0x33')][_0x57a3('0x1d')]);}_0x3254c1[_0x57a3('0x3b')]=qs[_0x57a3('0x3c')](_0x192c74[_0x57a3('0x33')][_0x57a3('0x3c')]);_0x3254c1[_0x57a3('0x3d')]=qs[_0x57a3('0x35')](_[_0x57a3('0x3e')](_0x192c74[_0x57a3('0x33')],_0x49fb72['filters']),_0x503108);if(_0x192c74[_0x57a3('0x33')]['filter']){_0x3254c1[_0x57a3('0x3d')]=_[_0x57a3('0x3f')](_0x3254c1[_0x57a3('0x3d')],{'$or':_['map'](_0x503108,function(_0x4a4b0e){if(_0x4a4b0e[_0x57a3('0x31')]!==_0x57a3('0x40')){var _0x890470={};_0x890470[_0x4a4b0e[_0x57a3('0x2b')]]={'$like':'%'+_0x192c74[_0x57a3('0x33')]['filter']+'%'};return _0x890470;}})});}_0x3254c1=_['merge']({},_0x3254c1,_0x192c74[_0x57a3('0x41')]);var _0x3e8e77={'where':_0x3254c1[_0x57a3('0x3d')]};return db['AnalyticTreeReport'][_0x57a3('0x20')](_0x3e8e77)['then'](function(_0x3ec801){_0x55e849[_0x57a3('0x20')]=_0x3ec801;if(_0x192c74['query']['includeAll']){_0x3254c1['include']=[{'all':!![]}];}return db[_0x57a3('0x2e')][_0x57a3('0x42')](_0x3254c1);})['then'](function(_0x17ae88){_0x55e849[_0x57a3('0x43')]=_0x17ae88;return _0x55e849;})[_0x57a3('0x27')](respondWithFilteredResult(_0x4d5962,_0x3254c1))['catch'](handleError(_0x4d5962,null));};exports['show']=function(_0xcade7c,_0x33980e){var _0x26680b={'raw':!![],'where':{'id':_0xcade7c['params']['id']}},_0x431f2d={};_0x431f2d[_0x57a3('0x37')]=_[_0x57a3('0x34')](db[_0x57a3('0x2e')][_0x57a3('0x2f')]);_0x431f2d[_0x57a3('0x33')]=_['keys'](_0xcade7c[_0x57a3('0x33')]);_0x431f2d[_0x57a3('0x35')]=_[_0x57a3('0x36')](_0x431f2d[_0x57a3('0x37')],_0x431f2d[_0x57a3('0x33')]);_0x26680b[_0x57a3('0x39')]=_[_0x57a3('0x36')](_0x431f2d[_0x57a3('0x37')],qs[_0x57a3('0x38')](_0xcade7c[_0x57a3('0x33')][_0x57a3('0x38')]));_0x26680b[_0x57a3('0x39')]=_0x26680b[_0x57a3('0x39')][_0x57a3('0x44')]?_0x26680b[_0x57a3('0x39')]:_0x431f2d[_0x57a3('0x37')];if(_0xcade7c[_0x57a3('0x33')][_0x57a3('0x45')]){_0x26680b[_0x57a3('0x46')]=[{'all':!![]}];}_0x26680b=_[_0x57a3('0x3f')]({},_0x26680b,_0xcade7c[_0x57a3('0x41')]);return db[_0x57a3('0x2e')]['find'](_0x26680b)[_0x57a3('0x27')](handleEntityNotFound(_0x33980e,null))['then'](respondWithResult(_0x33980e,null))[_0x57a3('0x47')](handleError(_0x33980e,null));};exports[_0x57a3('0x48')]=function(_0x45dc3b,_0x8e5891){return db[_0x57a3('0x2e')]['create'](_0x45dc3b[_0x57a3('0x49')],{})[_0x57a3('0x27')](respondWithResult(_0x8e5891,0xc9))['catch'](handleError(_0x8e5891,null));};exports['update']=function(_0x105507,_0x32d83f){if(_0x105507[_0x57a3('0x49')]['id']){delete _0x105507[_0x57a3('0x49')]['id'];}return db[_0x57a3('0x2e')][_0x57a3('0x4a')]({'where':{'id':_0x105507[_0x57a3('0x4b')]['id']}})[_0x57a3('0x27')](handleEntityNotFound(_0x32d83f,null))[_0x57a3('0x27')](saveUpdates(_0x105507[_0x57a3('0x49')],null))[_0x57a3('0x27')](respondWithResult(_0x32d83f,null))[_0x57a3('0x47')](handleError(_0x32d83f,null));};exports['destroy']=function(_0x337671,_0x58e325){return db['AnalyticTreeReport'][_0x57a3('0x4a')]({'where':{'id':_0x337671['params']['id']}})[_0x57a3('0x27')](handleEntityNotFound(_0x58e325,null))[_0x57a3('0x27')](removeEntity(_0x58e325,null))[_0x57a3('0x47')](handleError(_0x58e325,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5921948..ddd8846 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 _0x50bd=['path','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x22bac5,_0x8325e){var _0x57d7ac=function(_0x3e653c){while(--_0x3e653c){_0x22bac5['push'](_0x22bac5['shift']());}};_0x57d7ac(++_0x8325e);}(_0x50bd,0x1aa));var _0xd50b=function(_0x2432a7,_0x130e99){_0x2432a7=_0x2432a7-0x0;var _0x6281fd=_0x50bd[_0x2432a7];return _0x6281fd;};'use strict';var _=require(_0xd50b('0x0'));var util=require(_0xd50b('0x1'));var logger=require(_0xd50b('0x2'))('api');var moment=require(_0xd50b('0x3'));var BPromise=require(_0xd50b('0x4'));var rp=require(_0xd50b('0x5'));var fs=require('fs');var path=require(_0xd50b('0x6'));var rimraf=require('rimraf');var config=require(_0xd50b('0x7'));var attributes=require(_0xd50b('0x8'));module[_0xd50b('0x9')]=function(_0x12ec84,_0x1da2da){return _0x12ec84[_0xd50b('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xd50b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48df=['../../config/environment','exports','analytics_report_trees','lodash','util','../../config/logger','api','request-promise'];(function(_0x450efb,_0x532589){var _0x54af88=function(_0x553f76){while(--_0x553f76){_0x450efb['push'](_0x450efb['shift']());}};_0x54af88(++_0x532589);}(_0x48df,0x1cb));var _0xf48d=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x48df[_0x4067ac];return _0x53d74d;};'use strict';var _=require(_0xf48d('0x0'));var util=require(_0xf48d('0x1'));var logger=require(_0xf48d('0x2'))(_0xf48d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf48d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf48d('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0xf48d('0x6')]=function(_0x4089fa,_0x578352){return _0x4089fa['define']('AnalyticTreeReport',attributes,{'tableName':_0xf48d('0x7'),'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 5aaba19..6ae2196 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x241230,_0x254340){_0x241230=_0x241230-0x0;var _0x4bba83=_0x7a54[_0x241230];return _0x4bba83;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x26ebe3,_0x4ee6b7){var _0x337695=function(_0x377cf1){while(--_0x377cf1){_0x26ebe3['push'](_0x26ebe3['shift']());}};_0x337695(++_0x4ee6b7);}(_0xadb5,0xad));var _0x5adb=function(_0x45a7bd,_0x1b8bcc){_0x45a7bd=_0x45a7bd-0x0;var _0x1fa25c=_0xadb5[_0x45a7bd];return _0x1fa25c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d4756ca..cd7a163 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 _0x747b=['index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x55d204,_0x38db05){var _0x1d3a22=function(_0x48a668){while(--_0x48a668){_0x55d204['push'](_0x55d204['shift']());}};_0x1d3a22(++_0x38db05);}(_0x747b,0xa2));var _0xb747=function(_0x527565,_0x1b901a){_0x527565=_0x527565-0x0;var _0x212852=_0x747b[_0x527565];return _0x212852;};'use strict';var multer=require(_0xb747('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb747('0x1'));var express=require('express');var router=express[_0xb747('0x2')]();var fs_extra=require(_0xb747('0x3'));var auth=require(_0xb747('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb747('0x5'));var controller=require(_0xb747('0x6'));router[_0xb747('0x7')]('/',auth['isAuthenticated'](),controller[_0xb747('0x8')]);router['get'](_0xb747('0x9'),auth[_0xb747('0xa')](),controller[_0xb747('0xb')]);router['post']('/',auth[_0xb747('0xa')](),controller[_0xb747('0xc')]);router['put'](_0xb747('0x9'),auth[_0xb747('0xa')](),controller[_0xb747('0xd')]);router[_0xb747('0xe')](_0xb747('0x9'),auth[_0xb747('0xa')](),controller[_0xb747('0xf')]);module[_0xb747('0x10')]=router;
\ No newline at end of file
+var _0xa28a=['delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x3b4c4c,_0x1c79a2){var _0x1c2436=function(_0x301efa){while(--_0x301efa){_0x3b4c4c['push'](_0x3b4c4c['shift']());}};_0x1c2436(++_0x1c79a2);}(_0xa28a,0xf9));var _0xaa28=function(_0x4c5870,_0x14bb04){_0x4c5870=_0x4c5870-0x0;var _0x3c0d22=_0xa28a[_0x4c5870];return _0x3c0d22;};'use strict';var multer=require(_0xaa28('0x0'));var util=require(_0xaa28('0x1'));var path=require('path');var timeout=require(_0xaa28('0x2'));var express=require(_0xaa28('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaa28('0x4'));var interaction=require(_0xaa28('0x5'));var config=require(_0xaa28('0x6'));var controller=require(_0xaa28('0x7'));router[_0xaa28('0x8')]('/',auth[_0xaa28('0x9')](),controller[_0xaa28('0xa')]);router['get'](_0xaa28('0xb'),auth[_0xaa28('0x9')](),controller[_0xaa28('0xc')]);router[_0xaa28('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa28('0xe')]);router[_0xaa28('0xf')](_0xaa28('0xb'),auth[_0xaa28('0x9')](),controller[_0xaa28('0x10')]);router[_0xaa28('0x11')](_0xaa28('0xb'),auth['isAuthenticated'](),controller[_0xaa28('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 7b232fe..d41d368 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 _0xd846=['sequelize','exports','STRING'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0xd846,0x195));var _0x6d84=function(_0x39172b,_0x50a905){_0x39172b=_0x39172b-0x0;var _0x1c7fb8=_0xd846[_0x39172b];return _0x1c7fb8;};'use strict';var Sequelize=require(_0x6d84('0x0'));module[_0x6d84('0x1')]={'name':{'type':Sequelize[_0x6d84('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xff98=['exports','STRING'];(function(_0x316cd6,_0x19c988){var _0x4076c3=function(_0x44d40b){while(--_0x44d40b){_0x316cd6['push'](_0x316cd6['shift']());}};_0x4076c3(++_0x19c988);}(_0xff98,0x9c));var _0x8ff9=function(_0x4167cd,_0x24e095){_0x4167cd=_0x4167cd-0x0;var _0x57a4ac=_0xff98[_0x4167cd];return _0x57a4ac;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'name':{'type':Sequelize[_0x8ff9('0x1')]},'basename':{'type':Sequelize[_0x8ff9('0x1')]},'type':{'type':Sequelize[_0x8ff9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 7f615e7..98ef9c1 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 _0x0b22=['intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','rawAttributes','include','clone','params','find','updatedAt','body','createdAt','create','update','file','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','map','Attachment','fieldName','type','query','keys','filters','model','attributes'];(function(_0x111fec,_0x59d834){var _0x3eba6b=function(_0x4a4f7f){while(--_0x4a4f7f){_0x111fec['push'](_0x111fec['shift']());}};_0x3eba6b(++_0x59d834);}(_0x0b22,0xcd));var _0x20b2=function(_0x3ce354,_0x1a444d){_0x3ce354=_0x3ce354-0x0;var _0x411fdc=_0x0b22[_0x3ce354];return _0x411fdc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20b2('0x0'));var zipdir=require(_0x20b2('0x1'));var jsonpatch=require(_0x20b2('0x2'));var rp=require(_0x20b2('0x3'));var moment=require(_0x20b2('0x4'));var BPromise=require(_0x20b2('0x5'));var Mustache=require(_0x20b2('0x6'));var util=require(_0x20b2('0x7'));var path=require(_0x20b2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20b2('0x9'));var fs=require('fs');var fs_extra=require(_0x20b2('0xa'));var _=require(_0x20b2('0xb'));var squel=require(_0x20b2('0xc'));var crypto=require(_0x20b2('0xd'));var jsforce=require(_0x20b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x20b2('0xf'));var querystring=require(_0x20b2('0x10'));var Papa=require(_0x20b2('0x11'));var Redis=require('ioredis');var authService=require(_0x20b2('0x12'));var qs=require(_0x20b2('0x13'));var as=require(_0x20b2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x20b2('0x15'));var utils=require('../../config/utils');var config=require(_0x20b2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x20b2('0x17'))['db'];function respondWithStatusCode(_0x52632e,_0x42d59e){_0x42d59e=_0x42d59e||0xcc;return function(_0x28da7b){if(_0x28da7b){return _0x52632e[_0x20b2('0x18')](_0x42d59e);}return _0x52632e['status'](_0x42d59e)[_0x20b2('0x19')]();};}function respondWithResult(_0x4d7a1e,_0x1f49cc){_0x1f49cc=_0x1f49cc||0xc8;return function(_0xc22d51){if(_0xc22d51){return _0x4d7a1e[_0x20b2('0x1a')](_0x1f49cc)[_0x20b2('0x1b')](_0xc22d51);}};}function respondWithFilteredResult(_0x2ceb4a,_0x557206){return function(_0x198866){if(_0x198866){var _0x14a36f=typeof _0x557206[_0x20b2('0x1c')]===_0x20b2('0x1d')&&typeof _0x557206[_0x20b2('0x1e')]==='undefined';var _0x2fe902=_0x198866['count'];var _0x469bf8=_0x14a36f?0x0:_0x557206[_0x20b2('0x1c')];var _0x161804=_0x14a36f?_0x198866[_0x20b2('0x1f')]:_0x557206[_0x20b2('0x1c')]+_0x557206['limit'];var _0x3adfa7;if(_0x161804>=_0x2fe902){_0x161804=_0x2fe902;_0x3adfa7=0xc8;}else{_0x3adfa7=0xce;}_0x2ceb4a[_0x20b2('0x1a')](_0x3adfa7);return _0x2ceb4a[_0x20b2('0x20')](_0x20b2('0x21'),_0x469bf8+'-'+_0x161804+'/'+_0x2fe902)[_0x20b2('0x1b')](_0x198866);}return null;};}function patchUpdates(_0xb66b63){return function(_0xfce84b){try{jsonpatch[_0x20b2('0x22')](_0xfce84b,_0xb66b63,!![]);}catch(_0x4019f){return BPromise[_0x20b2('0x23')](_0x4019f);}return _0xfce84b['save']();};}function saveUpdates(_0x55a968,_0xffb2dd){return function(_0x4fc746){if(_0x4fc746){return _0x4fc746['update'](_0x55a968)['then'](function(_0x23337f){return _0x23337f;});}return null;};}function removeEntity(_0x4fb032,_0x12e0b4){return function(_0xd4e0d2){if(_0xd4e0d2){return _0xd4e0d2[_0x20b2('0x24')]()[_0x20b2('0x25')](function(){_0x4fb032['status'](0xcc)[_0x20b2('0x19')]();});}};}function handleEntityNotFound(_0xec1edd,_0x566bf3){return function(_0x4191ab){if(!_0x4191ab){_0xec1edd[_0x20b2('0x18')](0x194);}return _0x4191ab;};}function handleError(_0x396267,_0x2e4e39){_0x2e4e39=_0x2e4e39||0x1f4;return function(_0x30a3b4){logger[_0x20b2('0x26')](_0x30a3b4[_0x20b2('0x27')]);if(_0x30a3b4[_0x20b2('0x28')]){delete _0x30a3b4[_0x20b2('0x28')];}_0x396267[_0x20b2('0x1a')](_0x2e4e39)['send'](_0x30a3b4);};}exports['index']=function(_0x3f6501,_0x2b203b){var _0x3d70b3={},_0x1dfa37={},_0x202eb1={'count':0x0,'rows':[]};var _0xf0ca4=_[_0x20b2('0x29')](db[_0x20b2('0x2a')]['rawAttributes'],function(_0x1bb7a4){return{'name':_0x1bb7a4[_0x20b2('0x2b')],'type':_0x1bb7a4[_0x20b2('0x2c')]['key']};});_0x1dfa37['model']=_['map'](_0xf0ca4,_0x20b2('0x28'));_0x1dfa37[_0x20b2('0x2d')]=_[_0x20b2('0x2e')](_0x3f6501[_0x20b2('0x2d')]);_0x1dfa37[_0x20b2('0x2f')]=_['intersection'](_0x1dfa37[_0x20b2('0x30')],_0x1dfa37['query']);_0x3d70b3[_0x20b2('0x31')]=_[_0x20b2('0x32')](_0x1dfa37[_0x20b2('0x30')],qs[_0x20b2('0x33')](_0x3f6501[_0x20b2('0x2d')][_0x20b2('0x33')]));_0x3d70b3['attributes']=_0x3d70b3[_0x20b2('0x31')][_0x20b2('0x34')]?_0x3d70b3['attributes']:_0x1dfa37[_0x20b2('0x30')];if(!_0x3f6501['query']['hasOwnProperty'](_0x20b2('0x35'))){_0x3d70b3[_0x20b2('0x1e')]=qs['limit'](_0x3f6501['query'][_0x20b2('0x1e')]);_0x3d70b3['offset']=qs[_0x20b2('0x1c')](_0x3f6501['query'][_0x20b2('0x1c')]);}_0x3d70b3[_0x20b2('0x36')]=qs[_0x20b2('0x37')](_0x3f6501['query'][_0x20b2('0x37')]);_0x3d70b3[_0x20b2('0x38')]=qs[_0x20b2('0x2f')](_[_0x20b2('0x39')](_0x3f6501['query'],_0x1dfa37[_0x20b2('0x2f')]),_0xf0ca4);if(_0x3f6501[_0x20b2('0x2d')][_0x20b2('0x3a')]){_0x3d70b3[_0x20b2('0x38')]=_[_0x20b2('0x3b')](_0x3d70b3[_0x20b2('0x38')],{'$or':_[_0x20b2('0x29')](_0xf0ca4,function(_0x11c5a7){if(_0x11c5a7[_0x20b2('0x2c')]!==_0x20b2('0x3c')){var _0x4c6239={};_0x4c6239[_0x11c5a7[_0x20b2('0x28')]]={'$like':'%'+_0x3f6501[_0x20b2('0x2d')]['filter']+'%'};return _0x4c6239;}})});}_0x3d70b3=_['merge']({},_0x3d70b3,_0x3f6501[_0x20b2('0x3d')]);var _0x4117e4={'where':_0x3d70b3[_0x20b2('0x38')]};return db[_0x20b2('0x2a')][_0x20b2('0x1f')](_0x4117e4)['then'](function(_0x268d09){_0x202eb1['count']=_0x268d09;if(_0x3f6501['query'][_0x20b2('0x3e')]){_0x3d70b3['include']=[{'all':!![]}];}return db['Attachment'][_0x20b2('0x3f')](_0x3d70b3);})[_0x20b2('0x25')](function(_0x505529){_0x202eb1['rows']=_0x505529;return _0x202eb1;})[_0x20b2('0x25')](respondWithFilteredResult(_0x2b203b,_0x3d70b3))[_0x20b2('0x40')](handleError(_0x2b203b,null));};exports[_0x20b2('0x41')]=function(_0x5ced39,_0x1cc3f8){var _0x2da143={'raw':!![],'where':{'id':_0x5ced39['params']['id']}},_0x67c05a={};_0x67c05a[_0x20b2('0x30')]=_[_0x20b2('0x2e')](db[_0x20b2('0x2a')][_0x20b2('0x42')]);_0x67c05a[_0x20b2('0x2d')]=_['keys'](_0x5ced39[_0x20b2('0x2d')]);_0x67c05a[_0x20b2('0x2f')]=_['intersection'](_0x67c05a[_0x20b2('0x30')],_0x67c05a[_0x20b2('0x2d')]);_0x2da143[_0x20b2('0x31')]=_[_0x20b2('0x32')](_0x67c05a[_0x20b2('0x30')],qs[_0x20b2('0x33')](_0x5ced39[_0x20b2('0x2d')]['fields']));_0x2da143[_0x20b2('0x31')]=_0x2da143['attributes'][_0x20b2('0x34')]?_0x2da143[_0x20b2('0x31')]:_0x67c05a['model'];if(_0x5ced39[_0x20b2('0x2d')][_0x20b2('0x3e')]){_0x2da143[_0x20b2('0x43')]=[{'all':!![]}];}_0x2da143=_[_0x20b2('0x3b')]({},_0x2da143,_0x5ced39[_0x20b2('0x3d')]);return db[_0x20b2('0x2a')]['find'](_0x2da143)[_0x20b2('0x25')](handleEntityNotFound(_0x1cc3f8,null))[_0x20b2('0x25')](respondWithResult(_0x1cc3f8,null))[_0x20b2('0x40')](handleError(_0x1cc3f8,null));};exports[_0x20b2('0x44')]=function(_0x177cb8,_0x2413cb){var _0x5791b8={'where':{'id':_0x177cb8[_0x20b2('0x45')]['id']}},_0x3573b8={};_0x3573b8[_0x20b2('0x30')]=_[_0x20b2('0x2e')](db[_0x20b2('0x2a')]['rawAttributes']);_0x5791b8[_0x20b2('0x31')]=_[_0x20b2('0x32')](_0x3573b8['model'],qs[_0x20b2('0x33')](_0x177cb8[_0x20b2('0x2d')][_0x20b2('0x33')]));_0x5791b8[_0x20b2('0x31')]=_0x5791b8[_0x20b2('0x31')][_0x20b2('0x34')]?_0x5791b8[_0x20b2('0x31')]:_0x3573b8[_0x20b2('0x30')];if(_0x177cb8[_0x20b2('0x2d')][_0x20b2('0x3e')]){_0x5791b8[_0x20b2('0x43')]=[{'all':!![]}];}_0x5791b8=_[_0x20b2('0x3b')]({},_0x5791b8,_0x177cb8['options']);return db[_0x20b2('0x2a')][_0x20b2('0x46')](_0x5791b8)['then'](handleEntityNotFound(_0x2413cb,null))[_0x20b2('0x25')](function(_0x541a10){if(_0x541a10){var _0x3103d6=_0x541a10['get']({'plain':!![]});_0x3103d6=qs['omit'](_0x3103d6,['id','createdAt',_0x20b2('0x47')]);_0x177cb8[_0x20b2('0x48')]=_['omit'](_0x177cb8[_0x20b2('0x48')],['id',_0x20b2('0x49'),_0x20b2('0x47')]);return db[_0x20b2('0x2a')][_0x20b2('0x4a')](_['merge'](_0x3103d6,_0x177cb8['body']),{'include':_0x177cb8['query'][_0x20b2('0x3e')]?[{'all':!![]}]:undefined});}})[_0x20b2('0x25')](respondWithResult(_0x2413cb,0xc9))['catch'](handleError(_0x2413cb,null));};exports[_0x20b2('0x4b')]=function(_0x969ae5,_0x23cb1d){if(_0x969ae5[_0x20b2('0x48')]['id']){delete _0x969ae5[_0x20b2('0x48')]['id'];}return db[_0x20b2('0x2a')][_0x20b2('0x46')]({'where':{'id':_0x969ae5['params']['id']}})[_0x20b2('0x25')](handleEntityNotFound(_0x23cb1d,null))['then'](saveUpdates(_0x969ae5['body'],null))['then'](respondWithResult(_0x23cb1d,null))[_0x20b2('0x40')](handleError(_0x23cb1d,null));};exports[_0x20b2('0x24')]=function(_0x5400ac,_0x2c6220){return db[_0x20b2('0x2a')][_0x20b2('0x46')]({'where':{'id':_0x5400ac['params']['id']}})[_0x20b2('0x25')](handleEntityNotFound(_0x2c6220,null))[_0x20b2('0x25')](removeEntity(_0x2c6220,null))['catch'](handleError(_0x2c6220,null));};exports['create']=function(_0x38d90d,_0x4a7108,_0x5a6137){_0x38d90d[_0x20b2('0x48')][_0x20b2('0x28')]=_0x38d90d[_0x20b2('0x4c')]['originalname'];_0x38d90d['body'][_0x20b2('0x4d')]=_0x38d90d[_0x20b2('0x4c')][_0x20b2('0x4e')];_0x38d90d[_0x20b2('0x48')][_0x20b2('0x2c')]=_0x38d90d[_0x20b2('0x4c')]['mimetype'];return db['Attachment'][_0x20b2('0x4a')](_0x38d90d['body'])['then'](respondWithResult(_0x4a7108,0xc9))['catch'](handleError(_0x4a7108,null));};exports[_0x20b2('0x4f')]=function(_0x31e651,_0x38db8d,_0x41bb58){return db[_0x20b2('0x2a')][_0x20b2('0x50')]({'where':{'id':_0x31e651[_0x20b2('0x45')]['id']},'raw':!![]})[_0x20b2('0x25')](handleEntityNotFound(_0x38db8d,null))[_0x20b2('0x25')](function(_0x5e33ff){if(_0x5e33ff){var _0x40956a=_0x5e33ff[_0x20b2('0x51')]!==null;var _0x4977ec=path[_0x20b2('0x52')](config[_0x20b2('0x53')],'server/files/attachments/');if(_0x40956a){_0x4977ec=path[_0x20b2('0x52')](_0x4977ec,_0x20b2('0x54'));}var _0x4b6211=path[_0x20b2('0x52')](_0x4977ec,_0x5e33ff['basename']);return _0x38db8d[_0x20b2('0x4f')](_0x4b6211);}})['catch'](handleError(_0x38db8d,null));};
\ No newline at end of file
+var _0x58a1=['sort','where','filters','VIRTUAL','filter','merge','options','findAll','rows','show','params','clone','rawAttributes','includeAll','include','get','omit','createdAt','updatedAt','body','catch','update','find','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy','error','name','send','index','map','Attachment','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x58a1,0x1ee));var _0x158a=function(_0x47c93b,_0x5f5b8e){_0x47c93b=_0x47c93b-0x0;var _0x3d3f4f=_0x58a1[_0x47c93b];return _0x3d3f4f;};'use strict';var emlformat=require(_0x158a('0x0'));var rimraf=require(_0x158a('0x1'));var zipdir=require(_0x158a('0x2'));var jsonpatch=require(_0x158a('0x3'));var rp=require(_0x158a('0x4'));var moment=require(_0x158a('0x5'));var BPromise=require(_0x158a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x158a('0x7'));var sox=require(_0x158a('0x8'));var csv=require(_0x158a('0x9'));var ejs=require(_0x158a('0xa'));var fs=require('fs');var fs_extra=require(_0x158a('0xb'));var _=require(_0x158a('0xc'));var squel=require(_0x158a('0xd'));var crypto=require('crypto');var jsforce=require(_0x158a('0xe'));var deskjs=require(_0x158a('0xf'));var toCsv=require(_0x158a('0x9'));var querystring=require(_0x158a('0x10'));var Papa=require(_0x158a('0x11'));var Redis=require('ioredis');var authService=require(_0x158a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x158a('0x13'));var hardwareService=require(_0x158a('0x14'));var logger=require(_0x158a('0x15'))(_0x158a('0x16'));var utils=require(_0x158a('0x17'));var config=require(_0x158a('0x18'));var licenseUtil=require(_0x158a('0x19'));var db=require(_0x158a('0x1a'))['db'];function respondWithStatusCode(_0x897c93,_0x4d9077){_0x4d9077=_0x4d9077||0xcc;return function(_0x5ec554){if(_0x5ec554){return _0x897c93[_0x158a('0x1b')](_0x4d9077);}return _0x897c93[_0x158a('0x1c')](_0x4d9077)[_0x158a('0x1d')]();};}function respondWithResult(_0x4d03a8,_0x45b58d){_0x45b58d=_0x45b58d||0xc8;return function(_0x245c19){if(_0x245c19){return _0x4d03a8[_0x158a('0x1c')](_0x45b58d)['json'](_0x245c19);}};}function respondWithFilteredResult(_0x464342,_0x48af01){return function(_0x2ab10a){if(_0x2ab10a){var _0x1bf81a=typeof _0x48af01[_0x158a('0x1e')]===_0x158a('0x1f')&&typeof _0x48af01[_0x158a('0x20')]===_0x158a('0x1f');var _0x567dc2=_0x2ab10a[_0x158a('0x21')];var _0x1fb02e=_0x1bf81a?0x0:_0x48af01[_0x158a('0x1e')];var _0x319826=_0x1bf81a?_0x2ab10a['count']:_0x48af01['offset']+_0x48af01[_0x158a('0x20')];var _0x1e1c8d;if(_0x319826>=_0x567dc2){_0x319826=_0x567dc2;_0x1e1c8d=0xc8;}else{_0x1e1c8d=0xce;}_0x464342[_0x158a('0x1c')](_0x1e1c8d);return _0x464342[_0x158a('0x22')]('Content-Range',_0x1fb02e+'-'+_0x319826+'/'+_0x567dc2)[_0x158a('0x23')](_0x2ab10a);}return null;};}function patchUpdates(_0x3017a2){return function(_0x3466dd){try{jsonpatch[_0x158a('0x24')](_0x3466dd,_0x3017a2,!![]);}catch(_0x15ca42){return BPromise[_0x158a('0x25')](_0x15ca42);}return _0x3466dd['save']();};}function saveUpdates(_0x4d2a8c,_0x3f9817){return function(_0x5b8887){if(_0x5b8887){return _0x5b8887['update'](_0x4d2a8c)[_0x158a('0x26')](function(_0x16a131){return _0x16a131;});}return null;};}function removeEntity(_0x3f0bda,_0x2aa041){return function(_0x2e9538){if(_0x2e9538){return _0x2e9538[_0x158a('0x27')]()[_0x158a('0x26')](function(){_0x3f0bda[_0x158a('0x1c')](0xcc)[_0x158a('0x1d')]();});}};}function handleEntityNotFound(_0x3d6a2c,_0x436236){return function(_0x135653){if(!_0x135653){_0x3d6a2c[_0x158a('0x1b')](0x194);}return _0x135653;};}function handleError(_0xba3970,_0x53216c){_0x53216c=_0x53216c||0x1f4;return function(_0x1fe929){logger[_0x158a('0x28')](_0x1fe929['stack']);if(_0x1fe929['name']){delete _0x1fe929[_0x158a('0x29')];}_0xba3970[_0x158a('0x1c')](_0x53216c)[_0x158a('0x2a')](_0x1fe929);};}exports[_0x158a('0x2b')]=function(_0x11bd42,_0x265b63){var _0x43d83d={},_0x2ba713={},_0x2b5fa8={'count':0x0,'rows':[]};var _0x35c48c=_[_0x158a('0x2c')](db[_0x158a('0x2d')]['rawAttributes'],function(_0x3b7053){return{'name':_0x3b7053[_0x158a('0x2e')],'type':_0x3b7053[_0x158a('0x2f')][_0x158a('0x30')]};});_0x2ba713[_0x158a('0x31')]=_[_0x158a('0x2c')](_0x35c48c,_0x158a('0x29'));_0x2ba713['query']=_[_0x158a('0x32')](_0x11bd42[_0x158a('0x33')]);_0x2ba713['filters']=_[_0x158a('0x34')](_0x2ba713[_0x158a('0x31')],_0x2ba713[_0x158a('0x33')]);_0x43d83d[_0x158a('0x35')]=_[_0x158a('0x34')](_0x2ba713[_0x158a('0x31')],qs[_0x158a('0x36')](_0x11bd42[_0x158a('0x33')][_0x158a('0x36')]));_0x43d83d[_0x158a('0x35')]=_0x43d83d[_0x158a('0x35')][_0x158a('0x37')]?_0x43d83d[_0x158a('0x35')]:_0x2ba713[_0x158a('0x31')];if(!_0x11bd42[_0x158a('0x33')]['hasOwnProperty'](_0x158a('0x38'))){_0x43d83d[_0x158a('0x20')]=qs[_0x158a('0x20')](_0x11bd42['query'][_0x158a('0x20')]);_0x43d83d[_0x158a('0x1e')]=qs[_0x158a('0x1e')](_0x11bd42[_0x158a('0x33')][_0x158a('0x1e')]);}_0x43d83d[_0x158a('0x39')]=qs['sort'](_0x11bd42[_0x158a('0x33')][_0x158a('0x3a')]);_0x43d83d[_0x158a('0x3b')]=qs[_0x158a('0x3c')](_['pick'](_0x11bd42['query'],_0x2ba713[_0x158a('0x3c')]),_0x35c48c);if(_0x11bd42['query']['filter']){_0x43d83d[_0x158a('0x3b')]=_['merge'](_0x43d83d[_0x158a('0x3b')],{'$or':_[_0x158a('0x2c')](_0x35c48c,function(_0x28fbd5){if(_0x28fbd5[_0x158a('0x2f')]!==_0x158a('0x3d')){var _0x42ac7f={};_0x42ac7f[_0x28fbd5['name']]={'$like':'%'+_0x11bd42[_0x158a('0x33')][_0x158a('0x3e')]+'%'};return _0x42ac7f;}})});}_0x43d83d=_[_0x158a('0x3f')]({},_0x43d83d,_0x11bd42[_0x158a('0x40')]);var _0x38e6fa={'where':_0x43d83d[_0x158a('0x3b')]};return db[_0x158a('0x2d')][_0x158a('0x21')](_0x38e6fa)[_0x158a('0x26')](function(_0x35ca0e){_0x2b5fa8[_0x158a('0x21')]=_0x35ca0e;if(_0x11bd42[_0x158a('0x33')]['includeAll']){_0x43d83d['include']=[{'all':!![]}];}return db[_0x158a('0x2d')][_0x158a('0x41')](_0x43d83d);})[_0x158a('0x26')](function(_0x35088f){_0x2b5fa8[_0x158a('0x42')]=_0x35088f;return _0x2b5fa8;})['then'](respondWithFilteredResult(_0x265b63,_0x43d83d))['catch'](handleError(_0x265b63,null));};exports[_0x158a('0x43')]=function(_0x150619,_0x536dfc){var _0x54322b={'raw':!![],'where':{'id':_0x150619[_0x158a('0x44')]['id']}},_0x5aee5d={};_0x5aee5d['model']=_['keys'](db[_0x158a('0x2d')]['rawAttributes']);_0x5aee5d[_0x158a('0x33')]=_[_0x158a('0x32')](_0x150619[_0x158a('0x33')]);_0x5aee5d[_0x158a('0x3c')]=_[_0x158a('0x34')](_0x5aee5d[_0x158a('0x31')],_0x5aee5d['query']);_0x54322b[_0x158a('0x35')]=_[_0x158a('0x34')](_0x5aee5d['model'],qs['fields'](_0x150619[_0x158a('0x33')]['fields']));_0x54322b[_0x158a('0x35')]=_0x54322b[_0x158a('0x35')][_0x158a('0x37')]?_0x54322b[_0x158a('0x35')]:_0x5aee5d[_0x158a('0x31')];if(_0x150619[_0x158a('0x33')]['includeAll']){_0x54322b['include']=[{'all':!![]}];}_0x54322b=_[_0x158a('0x3f')]({},_0x54322b,_0x150619['options']);return db['Attachment']['find'](_0x54322b)[_0x158a('0x26')](handleEntityNotFound(_0x536dfc,null))['then'](respondWithResult(_0x536dfc,null))['catch'](handleError(_0x536dfc,null));};exports[_0x158a('0x45')]=function(_0x1c1873,_0xd57b62){var _0x2d4dca={'where':{'id':_0x1c1873[_0x158a('0x44')]['id']}},_0x1c63e5={};_0x1c63e5['model']=_['keys'](db[_0x158a('0x2d')][_0x158a('0x46')]);_0x2d4dca[_0x158a('0x35')]=_[_0x158a('0x34')](_0x1c63e5[_0x158a('0x31')],qs[_0x158a('0x36')](_0x1c1873[_0x158a('0x33')][_0x158a('0x36')]));_0x2d4dca[_0x158a('0x35')]=_0x2d4dca[_0x158a('0x35')][_0x158a('0x37')]?_0x2d4dca[_0x158a('0x35')]:_0x1c63e5[_0x158a('0x31')];if(_0x1c1873[_0x158a('0x33')][_0x158a('0x47')]){_0x2d4dca[_0x158a('0x48')]=[{'all':!![]}];}_0x2d4dca=_[_0x158a('0x3f')]({},_0x2d4dca,_0x1c1873[_0x158a('0x40')]);return db[_0x158a('0x2d')]['find'](_0x2d4dca)[_0x158a('0x26')](handleEntityNotFound(_0xd57b62,null))[_0x158a('0x26')](function(_0x5596f4){if(_0x5596f4){var _0x6821b9=_0x5596f4[_0x158a('0x49')]({'plain':!![]});_0x6821b9=qs[_0x158a('0x4a')](_0x6821b9,['id',_0x158a('0x4b'),_0x158a('0x4c')]);_0x1c1873[_0x158a('0x4d')]=_[_0x158a('0x4a')](_0x1c1873[_0x158a('0x4d')],['id',_0x158a('0x4b'),'updatedAt']);return db[_0x158a('0x2d')]['create'](_['merge'](_0x6821b9,_0x1c1873[_0x158a('0x4d')]),{'include':_0x1c1873[_0x158a('0x33')][_0x158a('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xd57b62,0xc9))[_0x158a('0x4e')](handleError(_0xd57b62,null));};exports[_0x158a('0x4f')]=function(_0xe9355a,_0xc808e1){if(_0xe9355a['body']['id']){delete _0xe9355a[_0x158a('0x4d')]['id'];}return db['Attachment']['find']({'where':{'id':_0xe9355a[_0x158a('0x44')]['id']}})[_0x158a('0x26')](handleEntityNotFound(_0xc808e1,null))[_0x158a('0x26')](saveUpdates(_0xe9355a[_0x158a('0x4d')],null))['then'](respondWithResult(_0xc808e1,null))[_0x158a('0x4e')](handleError(_0xc808e1,null));};exports[_0x158a('0x27')]=function(_0x5e0b15,_0x34f9b8){return db[_0x158a('0x2d')][_0x158a('0x50')]({'where':{'id':_0x5e0b15[_0x158a('0x44')]['id']}})['then'](handleEntityNotFound(_0x34f9b8,null))['then'](removeEntity(_0x34f9b8,null))[_0x158a('0x4e')](handleError(_0x34f9b8,null));};exports[_0x158a('0x51')]=function(_0x18af36,_0x1b305e,_0x3a54b2){_0x18af36[_0x158a('0x4d')]['name']=_0x18af36[_0x158a('0x52')][_0x158a('0x53')];_0x18af36[_0x158a('0x4d')][_0x158a('0x54')]=_0x18af36[_0x158a('0x52')][_0x158a('0x55')];_0x18af36[_0x158a('0x4d')]['type']=_0x18af36[_0x158a('0x52')][_0x158a('0x56')];return db['Attachment'][_0x158a('0x51')](_0x18af36[_0x158a('0x4d')])['then'](respondWithResult(_0x1b305e,0xc9))[_0x158a('0x4e')](handleError(_0x1b305e,null));};exports[_0x158a('0x57')]=function(_0x9b676f,_0x5b8b3e,_0x4f15b5){return db[_0x158a('0x2d')][_0x158a('0x58')]({'where':{'id':_0x9b676f[_0x158a('0x44')]['id']},'raw':!![]})[_0x158a('0x26')](handleEntityNotFound(_0x5b8b3e,null))[_0x158a('0x26')](function(_0x105944){if(_0x105944){var _0x5718b5=_0x105944[_0x158a('0x59')]!==null;var _0x4fc3dc=path['join'](config['root'],_0x158a('0x5a'));if(_0x5718b5){_0x4fc3dc=path[_0x158a('0x5b')](_0x4fc3dc,'offline-chat/');}var _0x40e1ed=path[_0x158a('0x5b')](_0x4fc3dc,_0x105944[_0x158a('0x54')]);return _0x5b8b3e[_0x158a('0x57')](_0x40e1ed);}})[_0x158a('0x4e')](handleError(_0x5b8b3e,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a1d0103..a630f7e 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 _0x47bb=['path','rimraf','../../config/environment','./attachment.attributes','Attachment','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3829b7,_0x143b66){var _0x19afdc=function(_0x453833){while(--_0x453833){_0x3829b7['push'](_0x3829b7['shift']());}};_0x19afdc(++_0x143b66);}(_0x47bb,0x17b));var _0xb47b=function(_0x401ccd,_0x140815){_0x401ccd=_0x401ccd-0x0;var _0x5a57ad=_0x47bb[_0x401ccd];return _0x5a57ad;};'use strict';var _=require(_0xb47b('0x0'));var util=require(_0xb47b('0x1'));var logger=require(_0xb47b('0x2'))(_0xb47b('0x3'));var moment=require(_0xb47b('0x4'));var BPromise=require(_0xb47b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb47b('0x6'));var rimraf=require(_0xb47b('0x7'));var config=require(_0xb47b('0x8'));var attributes=require(_0xb47b('0x9'));module['exports']=function(_0x441c07,_0xd7a581){return _0x441c07['define'](_0xb47b('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd33a=['Attachment','attachments','lodash','util','moment','path','../../config/environment','./attachment.attributes','exports','define'];(function(_0x11bd03,_0x22bb46){var _0x59ca5c=function(_0x34ee29){while(--_0x34ee29){_0x11bd03['push'](_0x11bd03['shift']());}};_0x59ca5c(++_0x22bb46);}(_0xd33a,0xde));var _0xad33=function(_0x1beafc,_0x4d28e3){_0x1beafc=_0x1beafc-0x0;var _0x5e1f7b=_0xd33a[_0x1beafc];return _0x5e1f7b;};'use strict';var _=require(_0xad33('0x0'));var util=require(_0xad33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xad33('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad33('0x3'));var rimraf=require('rimraf');var config=require(_0xad33('0x4'));var attributes=require(_0xad33('0x5'));module[_0xad33('0x6')]=function(_0x4d294c,_0x539f8b){return _0x4d294c[_0xad33('0x7')](_0xad33('0x8'),attributes,{'tableName':_0xad33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 98ae598..8119c14 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 _0x87f8=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','info'];(function(_0x13fcc0,_0x4e22e3){var _0x1d2868=function(_0x4508d9){while(--_0x4508d9){_0x13fcc0['push'](_0x13fcc0['shift']());}};_0x1d2868(++_0x4e22e3);}(_0x87f8,0x152));var _0x887f=function(_0x69871e,_0x468017){_0x69871e=_0x69871e-0x0;var _0x35c641=_0x87f8[_0x69871e];return _0x35c641;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x887f('0x0'));var rs=require(_0x887f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x887f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x887f('0x3'))(_0x887f('0x4'));var config=require(_0x887f('0x5'));var jayson=require(_0x887f('0x6'));var client=jayson['client'][_0x887f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x330116,_0x200eb8,_0x40c7aa){return new BPromise(function(_0x3d0d5e,_0xc2c38){return client[_0x887f('0x8')](_0x330116,_0x40c7aa)['then'](function(_0x261382){logger['info'](_0x887f('0x9'),_0x200eb8,_0x887f('0xa'));logger[_0x887f('0xb')](_0x887f('0xc'),_0x200eb8,'request\x20sent',JSON[_0x887f('0xd')](_0x261382));if(_0x261382[_0x887f('0xe')]){if(_0x261382['error']['code']===0x1f4){logger[_0x887f('0xe')](_0x887f('0x9'),_0x200eb8,_0x261382[_0x887f('0xe')]['message']);return _0xc2c38(_0x261382[_0x887f('0xe')][_0x887f('0xf')]);}logger['error'](_0x887f('0x9'),_0x200eb8,_0x261382[_0x887f('0xe')]['message']);return _0x3d0d5e(_0x261382[_0x887f('0xe')][_0x887f('0xf')]);}else{logger['info'](_0x887f('0x9'),_0x200eb8,_0x887f('0xa'));_0x3d0d5e(_0x261382[_0x887f('0x10')]['message']);}})[_0x887f('0x11')](function(_0x2f3d36){logger['error'](_0x887f('0x9'),_0x200eb8,_0x2f3d36);_0xc2c38(_0x2f3d36);});});}exports[_0x887f('0x12')]=function(_0x3ab397){var _0x3d3b0c=this;return new Promise(function(_0x2399a5,_0x19a134){return db[_0x887f('0x13')][_0x887f('0x14')](_0x3ab397[_0x887f('0x15')],{'raw':_0x3ab397[_0x887f('0x16')]?_0x3ab397[_0x887f('0x16')][_0x887f('0x17')]===undefined?!![]:![]:!![]})[_0x887f('0x18')](function(_0x4deddd){logger[_0x887f('0x19')](_0x887f('0x12'),_0x3ab397);logger['debug'](_0x887f('0x12'),_0x3ab397,JSON[_0x887f('0xd')](_0x4deddd));_0x2399a5(_0x4deddd);})['catch'](function(_0xc09608){logger['error'](_0x887f('0x12'),_0xc09608[_0x887f('0xf')],_0x3ab397);_0x19a134(_0x3d3b0c['error'](0x1f4,_0xc09608[_0x887f('0xf')]));});});};
\ No newline at end of file
+var _0x9234=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','body','options','raw','lodash','moment','bluebird'];(function(_0x595722,_0x3b0e9a){var _0x530cef=function(_0x2dbb9e){while(--_0x2dbb9e){_0x595722['push'](_0x595722['shift']());}};_0x530cef(++_0x3b0e9a);}(_0x9234,0x1bd));var _0x4923=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0x9234[_0x90f34f];return _0x4b18cf;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var moment=require(_0x4923('0x1'));var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require(_0x4923('0x6'))('rpc');var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson[_0x4923('0x9')][_0x4923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b854,_0x133b0d,_0x2de396){return new BPromise(function(_0x548676,_0x1fffc2){return client['request'](_0x17b854,_0x2de396)[_0x4923('0xb')](function(_0x2c4057){logger[_0x4923('0xc')]('Attachment,\x20%s,\x20%s',_0x133b0d,_0x4923('0xd'));logger[_0x4923('0xe')](_0x4923('0xf'),_0x133b0d,_0x4923('0xd'),JSON[_0x4923('0x10')](_0x2c4057));if(_0x2c4057[_0x4923('0x11')]){if(_0x2c4057[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x2c4057['error']['message']);return _0x1fffc2(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}logger[_0x4923('0x11')]('Attachment,\x20%s,\x20%s',_0x133b0d,_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);return _0x548676(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}else{logger[_0x4923('0xc')](_0x4923('0x13'),_0x133b0d,_0x4923('0xd'));_0x548676(_0x2c4057[_0x4923('0x15')][_0x4923('0x14')]);}})[_0x4923('0x16')](function(_0x559e4a){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x559e4a);_0x1fffc2(_0x559e4a);});});}exports[_0x4923('0x17')]=function(_0x1be04d){var _0x517b95=this;return new Promise(function(_0x50fd18,_0x16955b){return db['Attachment'][_0x4923('0x18')](_0x1be04d[_0x4923('0x19')],{'raw':_0x1be04d['options']?_0x1be04d[_0x4923('0x1a')][_0x4923('0x1b')]===undefined?!![]:![]:!![]})[_0x4923('0xb')](function(_0x8a9ab7){logger['info'](_0x4923('0x17'),_0x1be04d);logger[_0x4923('0xe')]('CreateAttachment',_0x1be04d,JSON[_0x4923('0x10')](_0x8a9ab7));_0x50fd18(_0x8a9ab7);})['catch'](function(_0x3de8f5){logger[_0x4923('0x11')]('CreateAttachment',_0x3de8f5[_0x4923('0x14')],_0x1be04d);_0x16955b(_0x517b95[_0x4923('0x11')](0x1f4,_0x3de8f5[_0x4923('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 53ec022..3f29144 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x2186b3,_0x58244d){_0x2186b3=_0x2186b3-0x0;var _0xc20f1=_0xdb28[_0x2186b3];return _0xc20f1;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x49e0ba,_0x1f7d0e){var _0x1263b0=function(_0x60dfa){while(--_0x60dfa){_0x49e0ba['push'](_0x49e0ba['shift']());}};_0x1263b0(++_0x1f7d0e);}(_0xadb5,0xad));var _0x5adb=function(_0x296973,_0xce79bd){_0x296973=_0x296973-0x0;var _0x3cc090=_0xadb5[_0x296973];return _0x3cc090;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 6f0cdd0..7ff3c06 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 _0x752b=['use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','map','emails','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile','email','callback'];(function(_0x434557,_0x570a53){var _0x333e13=function(_0x279e97){while(--_0x279e97){_0x434557['push'](_0x434557['shift']());}};_0x333e13(++_0x570a53);}(_0x752b,0x80));var _0xb752=function(_0x141c8c,_0x183123){_0x141c8c=_0x141c8c-0x0;var _0x3b519b=_0x752b[_0x141c8c];return _0x3b519b;};'use strict';var _=require(_0xb752('0x0'));var passport=require(_0xb752('0x1'));var GoogleStrategy=require(_0xb752('0x2'))[_0xb752('0x3')];var moment=require(_0xb752('0x4'));var db=require(_0xb752('0x5'))['db'];var config=require(_0xb752('0x6'));var signToken=require(_0xb752('0x7'))['signToken'];var utils=require(_0xb752('0x8'));exports[_0xb752('0x9')]=passport[_0xb752('0xa')](_0xb752('0xb'),{'failureRedirect':_0xb752('0xc'),'scope':[_0xb752('0xd'),_0xb752('0xe')],'session':![]});exports[_0xb752('0xf')]=passport[_0xb752('0xa')]('google',{'failureRedirect':_0xb752('0xc'),'session':![]});passport[_0xb752('0x10')](new GoogleStrategy({'clientID':config[_0xb752('0xb')]?config[_0xb752('0xb')][_0xb752('0x11')]:'id','clientSecret':config[_0xb752('0xb')]?config[_0xb752('0xb')]['clientSecret']:_0xb752('0x12'),'callbackURL':config['google']?config[_0xb752('0xb')][_0xb752('0x13')]:''},function(_0x40c239,_0x1a6c34,_0x460b44,_0x4fdd62){var _0x1929c2,_0x103702;return db[_0xb752('0x14')][_0xb752('0x15')]({'where':{'id':0x1},'attributes':[_0xb752('0x16'),'blockDuration'],'raw':!![]})[_0xb752('0x17')](function(_0x36ad85){_0x1929c2=_0x36ad85;return db['User']['find']({'where':{'email':_[_0xb752('0x18')](_0x460b44[_0xb752('0x19')],'value'),'role':{'$or':[_0xb752('0x1a'),_0xb752('0x1b'),'agent']}}});})[_0xb752('0x17')](function(_0x505315){_0x103702=_0x505315;if(_0x103702){if(_0x103702[_0xb752('0x1c')]){return _0x4fdd62(_0xb752('0x1d'));}else if(_0x1929c2[_0xb752('0x1e')]>0x0){if(_0x103702[_0xb752('0x1f')]){if(moment(_0x103702[_0xb752('0x20')])[_0xb752('0x21')](_0x1929c2['blockDuration'],_0xb752('0x22'))>moment()){return _0x4fdd62(_0xb752('0x1d'));}else{return utils['clearBlockUser'](_0x103702,0x0,![],null)[_0xb752('0x17')](function(){return utils[_0xb752('0x23')](_0x103702);})[_0xb752('0x17')](function(){return _0x4fdd62(null,_0x103702);});}}else{return utils['getLicense'](_0x103702)[_0xb752('0x17')](function(){return _0x4fdd62(null,_0x103702);});}}else{return utils[_0xb752('0x23')](_0x103702)[_0xb752('0x17')](function(){return _0x4fdd62(null,_0x103702);});}}return _0x4fdd62(_0xb752('0x1d'));})['catch'](function(_0x126294){_0x4fdd62(_0x126294);});}));
\ No newline at end of file
+var _0x9e20=['../../config/environment','../../components/auth/service','signToken','login','google','/login','profile','callback','authenticate','clientID','callbackURL','Setting','findOne','then','User','find','agent','disabled','blocked','blockedAt','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','lodash','passport','Strategy','moment','../../mysqldb'];(function(_0x520f54,_0x25ddfe){var _0x56fcde=function(_0x3530e8){while(--_0x3530e8){_0x520f54['push'](_0x520f54['shift']());}};_0x56fcde(++_0x25ddfe);}(_0x9e20,0x113));var _0x09e2=function(_0x1eb5fa,_0x573f8c){_0x1eb5fa=_0x1eb5fa-0x0;var _0x46d45a=_0x9e20[_0x1eb5fa];return _0x46d45a;};'use strict';var _=require(_0x09e2('0x0'));var passport=require(_0x09e2('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x09e2('0x2')];var moment=require(_0x09e2('0x3'));var db=require(_0x09e2('0x4'))['db'];var config=require(_0x09e2('0x5'));var signToken=require(_0x09e2('0x6'))[_0x09e2('0x7')];var utils=require('../../config/utils');exports[_0x09e2('0x8')]=passport['authenticate'](_0x09e2('0x9'),{'failureRedirect':_0x09e2('0xa'),'scope':[_0x09e2('0xb'),'email'],'session':![]});exports[_0x09e2('0xc')]=passport[_0x09e2('0xd')](_0x09e2('0x9'),{'failureRedirect':_0x09e2('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x09e2('0x9')]?config[_0x09e2('0x9')][_0x09e2('0xe')]:'id','clientSecret':config[_0x09e2('0x9')]?config['google']['clientSecret']:'secret','callbackURL':config['google']?config[_0x09e2('0x9')][_0x09e2('0xf')]:''},function(_0x2d45a5,_0x16fc51,_0x4058a2,_0x2332e2){var _0x3b0121,_0x491f10;return db[_0x09e2('0x10')][_0x09e2('0x11')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x09e2('0x12')](function(_0x39ad2f){_0x3b0121=_0x39ad2f;return db[_0x09e2('0x13')][_0x09e2('0x14')]({'where':{'email':_['map'](_0x4058a2['emails'],'value'),'role':{'$or':['admin','user',_0x09e2('0x15')]}}});})[_0x09e2('0x12')](function(_0x13bf07){_0x491f10=_0x13bf07;if(_0x491f10){if(_0x491f10[_0x09e2('0x16')]){return _0x2332e2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x3b0121['blockDuration']>0x0){if(_0x491f10[_0x09e2('0x17')]){if(moment(_0x491f10[_0x09e2('0x18')])['add'](_0x3b0121['blockDuration'],_0x09e2('0x19'))>moment()){return _0x2332e2(_0x09e2('0x1a'));}else{return utils['clearBlockUser'](_0x491f10,0x0,![],null)['then'](function(){return utils['getLicense'](_0x491f10);})[_0x09e2('0x12')](function(){return _0x2332e2(null,_0x491f10);});}}else{return utils[_0x09e2('0x1b')](_0x491f10)['then'](function(){return _0x2332e2(null,_0x491f10);});}}else{return utils[_0x09e2('0x1b')](_0x491f10)[_0x09e2('0x12')](function(){return _0x2332e2(null,_0x491f10);});}}return _0x2332e2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x4e0aca){_0x2332e2(_0x4e0aca);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 047e3ec..2d4d08e 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 _0x2ce7=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2ce7,0x1ea));var _0x72ce=function(_0x7a212e,_0x219924){_0x7a212e=_0x7a212e-0x0;var _0x318eb9=_0x2ce7[_0x7a212e];return _0x318eb9;};'use strict';var express=require('express');var passport=require(_0x72ce('0x0'));var router=express[_0x72ce('0x1')]();var controller=require(_0x72ce('0x2'));var userController=require(_0x72ce('0x3'));var authService=require(_0x72ce('0x4'));router[_0x72ce('0x5')]('/',controller['login']);router[_0x72ce('0x5')]('/callback',controller[_0x72ce('0x6')],authService[_0x72ce('0x7')],userController[_0x72ce('0x8')],authService['setTokenCookie']);module[_0x72ce('0x9')]=router;
\ No newline at end of file
+var _0x425c=['passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','exports','express'];(function(_0x195a3a,_0x2a00e8){var _0x5783eb=function(_0x6584d3){while(--_0x6584d3){_0x195a3a['push'](_0x195a3a['shift']());}};_0x5783eb(++_0x2a00e8);}(_0x425c,0x149));var _0xc425=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x425c[_0x173441];return _0x2423a8;};'use strict';var express=require(_0xc425('0x0'));var passport=require(_0xc425('0x1'));var router=express['Router']();var controller=require(_0xc425('0x2'));var userController=require(_0xc425('0x3'));var authService=require(_0xc425('0x4'));router[_0xc425('0x5')]('/',controller['login']);router['get'](_0xc425('0x6'),controller[_0xc425('0x7')],authService[_0xc425('0x8')],userController[_0xc425('0x9')],authService['setTokenCookie']);module[_0xc425('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 5eaeb28..cd20859 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 _0xbbf6=['password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','send','util','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','findOne','blockDuration','then'];(function(_0x1f9ef9,_0xef2ee0){var _0x3d8fde=function(_0x343dd8){while(--_0x343dd8){_0x1f9ef9['push'](_0x1f9ef9['shift']());}};_0x3d8fde(++_0xef2ee0);}(_0xbbf6,0x143));var _0x6bbf=function(_0x24b715,_0x40c28e){_0x24b715=_0x24b715-0x0;var _0x223d3f=_0xbbf6[_0x24b715];return _0x223d3f;};'use strict';var util=require(_0x6bbf('0x0'));var passport=require('passport');var LocalStrategy=require(_0x6bbf('0x1'))[_0x6bbf('0x2')];var jayson=require(_0x6bbf('0x3'));var _=require(_0x6bbf('0x4'));var rs=require('randomstring');var moment=require(_0x6bbf('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x6bbf('0x6'));var utils=require(_0x6bbf('0x7'));var client=jayson[_0x6bbf('0x8')][_0x6bbf('0x9')]({'port':0x232b});function localAuthenticate(_0x37a458,_0xa47293,_0x5b9b47,_0x11a88d){var _0x1e45af,_0x442a28;return db['Setting'][_0x6bbf('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6bbf('0xb')],'raw':!![]})[_0x6bbf('0xc')](function(_0x5eb721){_0x1e45af=_0x5eb721;return _0x37a458[_0x6bbf('0xa')]({'attributes':['id','name',_0x6bbf('0xd'),_0x6bbf('0xe'),_0x6bbf('0xf'),_0x6bbf('0x10'),_0x6bbf('0x11'),_0x6bbf('0x12'),_0x6bbf('0x13')],'where':{'name':_0xa47293,'role':{'$or':[_0x6bbf('0x14'),_0x6bbf('0x15'),'agent']}}});})[_0x6bbf('0xc')](function(_0x5b8475){if(!_0x5b8475||_0x5b8475&&_0x5b8475[_0x6bbf('0x16')]!==_0xa47293){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x442a28=_0x5b8475;return _0x442a28;}})[_0x6bbf('0xc')](function(){_0x442a28[_0x6bbf('0x17')](_0x5b9b47,function(_0x5d5a43,_0x579b20){var _0x3c6ff3=_0x442a28[_0x6bbf('0x13')]+0x1;if(_0x5d5a43){return _0x11a88d(_0x5d5a43);}else if(!_0x579b20){if(_0x442a28[_0x6bbf('0x10')]){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}else if(_0x1e45af[_0x6bbf('0x19')]>0x0){if(_0x442a28[_0x6bbf('0x11')]){if(_0x1e45af[_0x6bbf('0xb')]>0x0){if(moment(_0x442a28[_0x6bbf('0x12')])[_0x6bbf('0x1a')](_0x1e45af[_0x6bbf('0xb')],_0x6bbf('0x1b'))>moment()){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}else{return utils[_0x6bbf('0x1c')](_0x442a28,_0x3c6ff3,![],null)[_0x6bbf('0xc')](function(){return _0x11a88d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x11a88d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3c6ff3>=_0x1e45af['allowedLoginAttempts']){return utils[_0x6bbf('0x1c')](_0x442a28,0x0,!![],moment())[_0x6bbf('0xc')](function(){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});});}else{return utils[_0x6bbf('0x1c')](_0x442a28,_0x3c6ff3,![],null)['then'](function(){return _0x11a88d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}}else{if(_0x442a28[_0x6bbf('0x10')]){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}else if(_0x1e45af[_0x6bbf('0x19')]>0x0){if(_0x442a28['blocked']){if(_0x1e45af['blockDuration']>0x0){if(moment(_0x442a28['blockedAt'])[_0x6bbf('0x1a')](_0x1e45af[_0x6bbf('0xb')],_0x6bbf('0x1b'))>moment()){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}else{return utils['clearBlockUser'](_0x442a28,0x0,![],null)['then'](function(){return utils[_0x6bbf('0x1d')](_0x442a28);})[_0x6bbf('0xc')](function(){return _0x11a88d(null,_0x442a28);});}}else{return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}}else{return utils[_0x6bbf('0x1c')](_0x442a28,0x0,![],null)[_0x6bbf('0xc')](function(){return utils[_0x6bbf('0x1d')](_0x442a28);})[_0x6bbf('0xc')](function(){return _0x11a88d(null,_0x442a28);})[_0x6bbf('0x1e')](function(_0x9fcc8e){return _0x11a88d(null,![],_0x9fcc8e);});}}else{if(_0x442a28[_0x6bbf('0x11')]){return _0x11a88d(null,![],{'message':_0x6bbf('0x18')});}else{return utils[_0x6bbf('0x1d')](_0x442a28)['then'](function(){return _0x11a88d(null,_0x442a28);});}}}});})['catch'](function(_0x24171d){return _0x11a88d(null,![],_0x24171d);});}function sendServiceMail(_0x11a80d){return db[_0x6bbf('0x1f')][_0x6bbf('0x20')]({'where':{'service':!![]},'attributes':['id',_0x6bbf('0x16'),_0x6bbf('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x6bbf('0x22')}]})[_0x6bbf('0xc')](function(_0xb61f54){if(!_0xb61f54){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x107759={'tls':{'rejectUnauthorized':![]}};if(_0xb61f54['Smtp'][_0x6bbf('0x23')]){_0x107759[_0x6bbf('0x23')]=_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x23')];}else{_0x107759[_0x6bbf('0x24')]=_0xb61f54[_0x6bbf('0x22')]['host'];_0x107759[_0x6bbf('0x25')]=_0xb61f54['Smtp']['port'];_0x107759['secure']=_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x26')];}if(_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x27')]){_0x107759[_0x6bbf('0x28')]={'user':_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x15')],'pass':_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x29')]};}var _0xa05095={'account':_0x107759,'message':_[_0x6bbf('0x2a')]({'from':util[_0x6bbf('0x2b')](_0x6bbf('0x2c'),_0xb61f54[_0x6bbf('0x16')],_0xb61f54[_0x6bbf('0x21')]||_0xb61f54[_0x6bbf('0x22')][_0x6bbf('0x15')])},_0x11a80d)};return client[_0x6bbf('0x2d')]('SendMail',_0xa05095);})[_0x6bbf('0xc')](function(_0xf6fc02){if(_0xf6fc02['error']){throw new Error(util[_0x6bbf('0x2b')](_0x6bbf('0x2e'),_0xf6fc02['error'][_0x6bbf('0x2f')]||JSON['stringify'](_0xf6fc02['error'])));}return!![];});}function handleError(_0xe0d8e7,_0x553fb5,_0x701729){return _0xe0d8e7['status'](_0x553fb5||0x1f4)['send']({'message':_0x701729?_0x701729[_0x6bbf('0x2f')]||_0x701729:''});}exports[_0x6bbf('0x30')]=function(_0x224992,_0x4d801a,_0x5f5d2b){passport[_0x6bbf('0x17')](_0x6bbf('0x31'),function(_0x3aeee4,_0x3c5bbe,_0x12b397){var _0x706982=_0x3aeee4||_0x12b397;if(_0x706982){return handleError(_0x4d801a,0x191,_0x706982);}if(!_0x3c5bbe){return handleError(_0x4d801a,0x194,{'message':_0x6bbf('0x32')});}else{var _0x26b804={'payload':{'id':_0x3c5bbe['id'],'role':_0x3c5bbe['role']},'options':{'expiresIn':0x15180}};return authService[_0x6bbf('0x33')](_0x26b804)[_0x6bbf('0xc')](function(_0x5d5a3f){_0x4d801a[_0x6bbf('0x34')]({'id':_0x3c5bbe['id'],'token':_0x5d5a3f,'statusCall':'','isAlreadyLogged':_0x3c5bbe[_0x6bbf('0x35')]});});}})(_0x224992,_0x4d801a,_0x5f5d2b);};exports['forgot']=function(_0x548796,_0x3631f4,_0x1d5749){if(!_0x548796[_0x6bbf('0x36')][_0x6bbf('0x21')]){return handleError(_0x3631f4,0x1f4,{'message':_0x6bbf('0x37')});}var _0x3a85f5=rs[_0x6bbf('0x38')]();_0x548796[_0x6bbf('0x36')][_0x6bbf('0x21')]=_0x548796[_0x6bbf('0x36')][_0x6bbf('0x21')][_0x6bbf('0x39')]()[_0x6bbf('0x3a')]();var _0x582449;return db[_0x6bbf('0x3b')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6bbf('0xb')],'raw':!![]})[_0x6bbf('0xc')](function(_0x6f7369){_0x582449=_0x6f7369;return db[_0x6bbf('0x3c')][_0x6bbf('0x20')]({'where':{'email':_0x548796['body']['email']}});})[_0x6bbf('0xc')](function(_0x55448e){if(!_0x55448e){throw new Error(_0x6bbf('0x3d'));}if(_0x55448e[_0x6bbf('0x10')]){throw new Error(_0x6bbf('0x3e'));}if(_0x55448e[_0x6bbf('0x11')]){if(moment(_0x55448e['blockedAt'])[_0x6bbf('0x1a')](_0x582449[_0x6bbf('0xb')],'minutes')>moment()){throw new Error(_0x6bbf('0x3f'));}else{_0x55448e[_0x6bbf('0x11')]=![];_0x55448e[_0x6bbf('0x12')]=null;}}_0x55448e[_0x6bbf('0x40')]=_0x3a85f5;_0x55448e[_0x6bbf('0x41')]=Date[_0x6bbf('0x42')]()+0x36ee80;return _0x55448e[_0x6bbf('0x43')]();})[_0x6bbf('0xc')](function(){return sendServiceMail({'to':_0x548796['body'][_0x6bbf('0x21')],'subject':_0x6bbf('0x44'),'text':_0x6bbf('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x6bbf('0x46')+_0x548796[_0x6bbf('0x47')][_0x6bbf('0x24')]+'/reset/'+_0x3a85f5+'\x0a\x0a'+_0x6bbf('0x48')});})[_0x6bbf('0xc')](function(){_0x3631f4[_0x6bbf('0x49')](0xc8)['send']({'message':_0x6bbf('0x4a')});})[_0x6bbf('0x1e')](function(_0x23f8ea){return handleError(_0x3631f4,0x1f4,_0x23f8ea);});};exports[_0x6bbf('0x4b')]=function(_0x179677,_0x78b02,_0x5789c3){return db['User']['find']({'where':{'resetPasswordToken':_0x179677['params'][_0x6bbf('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6bbf('0xc')](function(_0x16ce5b){if(!_0x16ce5b){throw new Error(_0x6bbf('0x4d'));}return db[_0x6bbf('0x3b')][_0x6bbf('0xa')]({'attributes':['id','securePassword',_0x6bbf('0x4e'),'passwordHistoryLimit']})[_0x6bbf('0xc')](function(_0x3f56ff){if(_0x3f56ff['securePassword'])authService[_0x6bbf('0x4f')](_0x179677[_0x6bbf('0x36')][_0x6bbf('0xd')]);if(!_0x3f56ff[_0x6bbf('0x4e')]||!_0x16ce5b[_0x6bbf('0x50')])return _0x16ce5b;authService[_0x6bbf('0x51')](_0x179677[_0x6bbf('0x36')][_0x6bbf('0xd')],_0x16ce5b['previousPasswords'],_0x3f56ff[_0x6bbf('0x52')]);return _0x16ce5b;})[_0x6bbf('0xc')](function(){_0x16ce5b[_0x6bbf('0xd')]=_0x179677[_0x6bbf('0x36')][_0x6bbf('0xd')];_0x16ce5b[_0x6bbf('0x40')]=null;_0x16ce5b[_0x6bbf('0x41')]=null;return _0x16ce5b[_0x6bbf('0x43')]();});})[_0x6bbf('0xc')](function(){_0x78b02['status'](0xc8)[_0x6bbf('0x53')]({'message':'Password\x20reset!'});})[_0x6bbf('0x1e')](function(_0x5f2f6d){return handleError(_0x78b02,0x1f4,_0x5f2f6d);});};passport['use'](new LocalStrategy({'usernameField':_0x6bbf('0x16'),'passwordField':_0x6bbf('0xd')},function(_0x1c44d1,_0x1e29e0,_0x9598c){return localAuthenticate(db[_0x6bbf('0x3c')],_0x1c44d1,_0x1e29e0,_0x9598c);}));
\ No newline at end of file
+var _0x8bc8=['port','secure','authentication','merge','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','signToken','forgot','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','util','passport','passport-local','Strategy','lodash','../../config/utils','http','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bc8,0xc4));var _0x88bc=function(_0x5ed32c,_0x956025){_0x5ed32c=_0x5ed32c-0x0;var _0x271ea3=_0x8bc8[_0x5ed32c];return _0x271ea3;};'use strict';var util=require(_0x88bc('0x0'));var passport=require(_0x88bc('0x1'));var LocalStrategy=require(_0x88bc('0x2'))[_0x88bc('0x3')];var jayson=require('jayson/promise');var _=require(_0x88bc('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x88bc('0x5'));var client=jayson['client'][_0x88bc('0x6')]({'port':0x232b});function localAuthenticate(_0x57ded5,_0x461948,_0x337252,_0x30e9d7){var _0x206a6c,_0x35e7f5;return db['Setting'][_0x88bc('0x7')]({'where':{'id':0x1},'attributes':[_0x88bc('0x8'),'blockDuration'],'raw':!![]})[_0x88bc('0x9')](function(_0x2d67e0){_0x206a6c=_0x2d67e0;return _0x57ded5[_0x88bc('0x7')]({'attributes':['id',_0x88bc('0xa'),_0x88bc('0xb'),_0x88bc('0xc'),_0x88bc('0xd'),_0x88bc('0xe'),_0x88bc('0xf'),'blockedAt',_0x88bc('0x10')],'where':{'name':_0x461948,'role':{'$or':[_0x88bc('0x11'),_0x88bc('0x12'),_0x88bc('0x13')]}}});})['then'](function(_0x4d5613){if(!_0x4d5613||_0x4d5613&&_0x4d5613['name']!==_0x461948){throw new Error(_0x88bc('0x14'));}else{_0x35e7f5=_0x4d5613;return _0x35e7f5;}})[_0x88bc('0x9')](function(){_0x35e7f5['authenticate'](_0x337252,function(_0x5ef583,_0x19cc1d){var _0x56e171=_0x35e7f5[_0x88bc('0x10')]+0x1;if(_0x5ef583){return _0x30e9d7(_0x5ef583);}else if(!_0x19cc1d){if(_0x35e7f5[_0x88bc('0xe')]){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});}else if(_0x206a6c[_0x88bc('0x8')]>0x0){if(_0x35e7f5[_0x88bc('0xf')]){if(_0x206a6c[_0x88bc('0x15')]>0x0){if(moment(_0x35e7f5[_0x88bc('0x16')])['add'](_0x206a6c[_0x88bc('0x15')],_0x88bc('0x17'))>moment()){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});}else{return utils[_0x88bc('0x18')](_0x35e7f5,_0x56e171,![],null)[_0x88bc('0x9')](function(){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});});}}else{return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});}}else{if(_0x56e171>=_0x206a6c[_0x88bc('0x8')]){return utils[_0x88bc('0x18')](_0x35e7f5,0x0,!![],moment())[_0x88bc('0x9')](function(){return _0x30e9d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x88bc('0x18')](_0x35e7f5,_0x56e171,![],null)[_0x88bc('0x9')](function(){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});});}}}else{return _0x30e9d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x35e7f5[_0x88bc('0xe')]){return _0x30e9d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x206a6c[_0x88bc('0x8')]>0x0){if(_0x35e7f5[_0x88bc('0xf')]){if(_0x206a6c['blockDuration']>0x0){if(moment(_0x35e7f5[_0x88bc('0x16')])[_0x88bc('0x19')](_0x206a6c['blockDuration'],_0x88bc('0x17'))>moment()){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});}else{return utils['clearBlockUser'](_0x35e7f5,0x0,![],null)['then'](function(){return utils['getLicense'](_0x35e7f5);})[_0x88bc('0x9')](function(){return _0x30e9d7(null,_0x35e7f5);});}}else{return _0x30e9d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x88bc('0x18')](_0x35e7f5,0x0,![],null)[_0x88bc('0x9')](function(){return utils[_0x88bc('0x1a')](_0x35e7f5);})['then'](function(){return _0x30e9d7(null,_0x35e7f5);})['catch'](function(_0x155d43){return _0x30e9d7(null,![],_0x155d43);});}}else{if(_0x35e7f5[_0x88bc('0xf')]){return _0x30e9d7(null,![],{'message':_0x88bc('0x14')});}else{return utils['getLicense'](_0x35e7f5)[_0x88bc('0x9')](function(){return _0x30e9d7(null,_0x35e7f5);});}}}});})[_0x88bc('0x1b')](function(_0x564e3d){return _0x30e9d7(null,![],_0x564e3d);});}function sendServiceMail(_0x11c31a){return db[_0x88bc('0x1c')][_0x88bc('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x88bc('0x1e')],'include':[{'model':db[_0x88bc('0x1f')],'as':_0x88bc('0x20')}]})['then'](function(_0x3cf461){if(!_0x3cf461){throw new Error(_0x88bc('0x21'));}var _0x2bc0cc={'tls':{'rejectUnauthorized':![]}};if(_0x3cf461['Smtp'][_0x88bc('0x22')]){_0x2bc0cc['service']=_0x3cf461[_0x88bc('0x20')][_0x88bc('0x22')];}else{_0x2bc0cc['host']=_0x3cf461['Smtp']['host'];_0x2bc0cc[_0x88bc('0x23')]=_0x3cf461['Smtp'][_0x88bc('0x23')];_0x2bc0cc[_0x88bc('0x24')]=_0x3cf461[_0x88bc('0x20')][_0x88bc('0x24')];}if(_0x3cf461[_0x88bc('0x20')][_0x88bc('0x25')]){_0x2bc0cc['auth']={'user':_0x3cf461[_0x88bc('0x20')][_0x88bc('0x12')],'pass':_0x3cf461[_0x88bc('0x20')]['pass']};}var _0x281c48={'account':_0x2bc0cc,'message':_[_0x88bc('0x26')]({'from':util['format'](_0x88bc('0x27'),_0x3cf461['name'],_0x3cf461['email']||_0x3cf461['Smtp'][_0x88bc('0x12')])},_0x11c31a)};return client[_0x88bc('0x28')]('SendMail',_0x281c48);})[_0x88bc('0x9')](function(_0x6ba72d){if(_0x6ba72d[_0x88bc('0x29')]){throw new Error(util['format'](_0x88bc('0x2a'),_0x6ba72d['error'][_0x88bc('0x2b')]||JSON[_0x88bc('0x2c')](_0x6ba72d[_0x88bc('0x29')])));}return!![];});}function handleError(_0x2e2e0c,_0x318588,_0xcf5d2c){return _0x2e2e0c[_0x88bc('0x2d')](_0x318588||0x1f4)['send']({'message':_0xcf5d2c?_0xcf5d2c['message']||_0xcf5d2c:''});}exports[_0x88bc('0x2e')]=function(_0x1aec0d,_0x5bbc40,_0x3d34b9){passport['authenticate'](_0x88bc('0x2f'),function(_0x261fe2,_0x1008fd,_0x42695a){var _0x59352b=_0x261fe2||_0x42695a;if(_0x59352b){return handleError(_0x5bbc40,0x191,_0x59352b);}if(!_0x1008fd){return handleError(_0x5bbc40,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5d92d9={'payload':{'id':_0x1008fd['id'],'role':_0x1008fd['role']},'options':{'expiresIn':0x15180}};return authService[_0x88bc('0x30')](_0x5d92d9)[_0x88bc('0x9')](function(_0x4a8f9f){_0x5bbc40['json']({'id':_0x1008fd['id'],'token':_0x4a8f9f,'statusCall':'','isAlreadyLogged':_0x1008fd['online']});});}})(_0x1aec0d,_0x5bbc40,_0x3d34b9);};exports[_0x88bc('0x31')]=function(_0x17c12d,_0x8a3327,_0xdd260){if(!_0x17c12d[_0x88bc('0x32')][_0x88bc('0x1e')]){return handleError(_0x8a3327,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x688ef8=rs['generate']();_0x17c12d[_0x88bc('0x32')]['email']=_0x17c12d[_0x88bc('0x32')][_0x88bc('0x1e')][_0x88bc('0x33')]()[_0x88bc('0x34')]();var _0x4ce909;return db[_0x88bc('0x35')]['findOne']({'where':{'id':0x1},'attributes':[_0x88bc('0x8'),_0x88bc('0x15')],'raw':!![]})[_0x88bc('0x9')](function(_0x50fd6b){_0x4ce909=_0x50fd6b;return db[_0x88bc('0x36')]['find']({'where':{'email':_0x17c12d[_0x88bc('0x32')]['email']}});})[_0x88bc('0x9')](function(_0x2ac3e4){if(!_0x2ac3e4){throw new Error(_0x88bc('0x37'));}if(_0x2ac3e4['disabled']){throw new Error(_0x88bc('0x38'));}if(_0x2ac3e4['blocked']){if(moment(_0x2ac3e4['blockedAt'])[_0x88bc('0x19')](_0x4ce909[_0x88bc('0x15')],_0x88bc('0x17'))>moment()){throw new Error(_0x88bc('0x39'));}else{_0x2ac3e4[_0x88bc('0xf')]=![];_0x2ac3e4[_0x88bc('0x16')]=null;}}_0x2ac3e4[_0x88bc('0x3a')]=_0x688ef8;_0x2ac3e4[_0x88bc('0x3b')]=Date[_0x88bc('0x3c')]()+0x36ee80;return _0x2ac3e4[_0x88bc('0x3d')]();})[_0x88bc('0x9')](function(){return sendServiceMail({'to':_0x17c12d[_0x88bc('0x32')][_0x88bc('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x88bc('0x3e')+_0x17c12d[_0x88bc('0x3f')][_0x88bc('0x40')]+_0x88bc('0x41')+_0x688ef8+'\x0a\x0a'+_0x88bc('0x42')});})[_0x88bc('0x9')](function(){_0x8a3327[_0x88bc('0x2d')](0xc8)[_0x88bc('0x43')]({'message':_0x88bc('0x44')});})['catch'](function(_0x39a087){return handleError(_0x8a3327,0x1f4,_0x39a087);});};exports[_0x88bc('0x45')]=function(_0x4fb353,_0x26b9b8,_0x7928fe){return db['User'][_0x88bc('0x1d')]({'where':{'resetPasswordToken':_0x4fb353[_0x88bc('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x88bc('0x3c')]()}}})[_0x88bc('0x9')](function(_0x1b2eff){if(!_0x1b2eff){throw new Error(_0x88bc('0x47'));}return db[_0x88bc('0x35')][_0x88bc('0x7')]({'attributes':['id',_0x88bc('0x48'),_0x88bc('0x49'),_0x88bc('0x4a')]})[_0x88bc('0x9')](function(_0x1d5e54){if(_0x1d5e54[_0x88bc('0x48')])authService[_0x88bc('0x4b')](_0x4fb353[_0x88bc('0x32')]['password']);if(!_0x1d5e54['enforcePasswordHistory']||!_0x1b2eff['previousPasswords'])return _0x1b2eff;authService['validatePasswordHistory'](_0x4fb353[_0x88bc('0x32')][_0x88bc('0xb')],_0x1b2eff[_0x88bc('0x4c')],_0x1d5e54[_0x88bc('0x4a')]);return _0x1b2eff;})[_0x88bc('0x9')](function(){_0x1b2eff['password']=_0x4fb353['body'][_0x88bc('0xb')];_0x1b2eff[_0x88bc('0x3a')]=null;_0x1b2eff[_0x88bc('0x3b')]=null;return _0x1b2eff[_0x88bc('0x3d')]();});})[_0x88bc('0x9')](function(){_0x26b9b8[_0x88bc('0x2d')](0xc8)[_0x88bc('0x43')]({'message':'Password\x20reset!'});})[_0x88bc('0x1b')](function(_0x24fe36){return handleError(_0x26b9b8,0x1f4,_0x24fe36);});};passport['use'](new LocalStrategy({'usernameField':_0x88bc('0xa'),'passwordField':'password'},function(_0x416b1e,_0xd0e8e9,_0x2f7066){return localAuthenticate(db[_0x88bc('0x36')],_0x416b1e,_0xd0e8e9,_0x2f7066);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 64f1a33..f17a1e5 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 _0x82f7=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports','express'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x82f7,0x104));var _0x782f=function(_0x2d4393,_0x1ea1c2){_0x2d4393=_0x2d4393-0x0;var _0x3e0ef8=_0x82f7[_0x2d4393];return _0x3e0ef8;};'use strict';var express=require(_0x782f('0x0'));var router=express[_0x782f('0x1')]();var controller=require(_0x782f('0x2'));router[_0x782f('0x3')]('/',controller[_0x782f('0x4')]);router['post'](_0x782f('0x5'),controller[_0x782f('0x6')]);router[_0x782f('0x3')](_0x782f('0x7'),controller['reset']);module[_0x782f('0x8')]=router;
\ No newline at end of file
+var _0x868c=['./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','express','Router'];(function(_0x293e7a,_0x1792a2){var _0xb78342=function(_0x833afe){while(--_0x833afe){_0x293e7a['push'](_0x293e7a['shift']());}};_0xb78342(++_0x1792a2);}(_0x868c,0x12e));var _0xc868=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x868c[_0x43c8b8];return _0x413be3;};'use strict';var express=require(_0xc868('0x0'));var router=express[_0xc868('0x1')]();var controller=require(_0xc868('0x2'));router[_0xc868('0x3')]('/',controller['login']);router['post'](_0xc868('0x4'),controller[_0xc868('0x5')]);router[_0xc868('0x3')](_0xc868('0x6'),controller[_0xc868('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7982948..20c20d5 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 _0xbabb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x125784,_0xdc246e){var _0xedefd6=function(_0x47aa22){while(--_0x47aa22){_0x125784['push'](_0x125784['shift']());}};_0xedefd6(++_0xdc246e);}(_0xbabb,0x89));var _0xbbab=function(_0x2f3296,_0x4aa6ca){_0x2f3296=_0x2f3296-0x0;var _0x3ebe1b=_0xbabb[_0x2f3296];return _0x3ebe1b;};'use strict';var Sequelize=require(_0xbbab('0x0'));module[_0xbbab('0x1')]={'name':{'type':Sequelize[_0xbbab('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xbbab('0x2')]},'description':{'type':Sequelize[_0xbbab('0x2')]},'status':{'type':Sequelize[_0xbbab('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa377=['sequelize','exports','STRING','INTEGER'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xa377,0x1c8));var _0x7a37=function(_0x11972,_0x980c2b){_0x11972=_0x11972-0x0;var _0x4ad4fc=_0xa377[_0x11972];return _0x4ad4fc;};'use strict';var Sequelize=require(_0x7a37('0x0'));module[_0x7a37('0x1')]={'name':{'type':Sequelize[_0x7a37('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7a37('0x2')]},'description':{'type':Sequelize[_0x7a37('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7a37('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index cace0a7..199b894 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 _0x882d=['intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','addConditions','Condition','ids','omit','getConditions','findOne','length','addActions','Action','getActions','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','attributes'];(function(_0x18c4ec,_0x158c92){var _0x11b8f9=function(_0x233ed3){while(--_0x233ed3){_0x18c4ec['push'](_0x18c4ec['shift']());}};_0x11b8f9(++_0x158c92);}(_0x882d,0x16a));var _0xd882=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x882d[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd882('0x0'));var jsonpatch=require(_0xd882('0x1'));var rp=require('request-promise');var moment=require(_0xd882('0x2'));var BPromise=require(_0xd882('0x3'));var Mustache=require(_0xd882('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd882('0x5'));var csv=require(_0xd882('0x6'));var ejs=require(_0xd882('0x7'));var fs=require('fs');var fs_extra=require(_0xd882('0x8'));var _=require(_0xd882('0x9'));var squel=require('squel');var crypto=require(_0xd882('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd882('0xb'));var toCsv=require(_0xd882('0x6'));var querystring=require(_0xd882('0xc'));var Papa=require(_0xd882('0xd'));var Redis=require(_0xd882('0xe'));var authService=require(_0xd882('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd882('0x10'));var hardwareService=require(_0xd882('0x11'));var logger=require('../../config/logger')(_0xd882('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd882('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56c5e0,_0x39ba4f){_0x39ba4f=_0x39ba4f||0xcc;return function(_0x4a1321){if(_0x4a1321){return _0x56c5e0[_0xd882('0x14')](_0x39ba4f);}return _0x56c5e0[_0xd882('0x15')](_0x39ba4f)[_0xd882('0x16')]();};}function respondWithResult(_0xc02119,_0x275b13){_0x275b13=_0x275b13||0xc8;return function(_0x25587e){if(_0x25587e){return _0xc02119[_0xd882('0x15')](_0x275b13)[_0xd882('0x17')](_0x25587e);}};}function respondWithFilteredResult(_0x30de29,_0x1b946a){return function(_0x29c472){if(_0x29c472){var _0x1a011a=typeof _0x1b946a[_0xd882('0x18')]===_0xd882('0x19')&&typeof _0x1b946a['limit']===_0xd882('0x19');var _0x36b94e=_0x29c472[_0xd882('0x1a')];var _0x50efa4=_0x1a011a?0x0:_0x1b946a['offset'];var _0x1ab68a=_0x1a011a?_0x29c472[_0xd882('0x1a')]:_0x1b946a[_0xd882('0x18')]+_0x1b946a[_0xd882('0x1b')];var _0x5a5e5a;if(_0x1ab68a>=_0x36b94e){_0x1ab68a=_0x36b94e;_0x5a5e5a=0xc8;}else{_0x5a5e5a=0xce;}_0x30de29[_0xd882('0x15')](_0x5a5e5a);return _0x30de29[_0xd882('0x1c')](_0xd882('0x1d'),_0x50efa4+'-'+_0x1ab68a+'/'+_0x36b94e)[_0xd882('0x17')](_0x29c472);}return null;};}function patchUpdates(_0xba4092){return function(_0x4da34a){try{jsonpatch[_0xd882('0x1e')](_0x4da34a,_0xba4092,!![]);}catch(_0x5ca294){return BPromise['reject'](_0x5ca294);}return _0x4da34a[_0xd882('0x1f')]();};}function saveUpdates(_0x53f818,_0x4c7f63){return function(_0x499138){if(_0x499138){return _0x499138['update'](_0x53f818)['then'](function(_0x158884){return _0x158884;});}return null;};}function removeEntity(_0x1fe75d,_0xa9f513){return function(_0x5c4b45){if(_0x5c4b45){return _0x5c4b45[_0xd882('0x20')]()[_0xd882('0x21')](function(){_0x1fe75d[_0xd882('0x15')](0xcc)[_0xd882('0x16')]();});}};}function handleEntityNotFound(_0x2a54c4,_0x46f050){return function(_0x32a07e){if(!_0x32a07e){_0x2a54c4[_0xd882('0x14')](0x194);}return _0x32a07e;};}function handleError(_0x3f7d97,_0x37fdc2){_0x37fdc2=_0x37fdc2||0x1f4;return function(_0x4f49d0){logger['error'](_0x4f49d0[_0xd882('0x22')]);if(_0x4f49d0['name']){delete _0x4f49d0[_0xd882('0x23')];}_0x3f7d97['status'](_0x37fdc2)[_0xd882('0x24')](_0x4f49d0);};}exports[_0xd882('0x25')]=function(_0x56c06e,_0x4e7137){var _0x5c4345={},_0xeec825={},_0x1dc305={'count':0x0,'rows':[]};var _0x4c3a9f=_[_0xd882('0x26')](db[_0xd882('0x27')][_0xd882('0x28')],function(_0x3902fc){return{'name':_0x3902fc[_0xd882('0x29')],'type':_0x3902fc[_0xd882('0x2a')][_0xd882('0x2b')]};});_0xeec825['model']=_[_0xd882('0x26')](_0x4c3a9f,'name');_0xeec825['query']=_[_0xd882('0x2c')](_0x56c06e[_0xd882('0x2d')]);_0xeec825[_0xd882('0x2e')]=_['intersection'](_0xeec825['model'],_0xeec825[_0xd882('0x2d')]);_0x5c4345[_0xd882('0x2f')]=_[_0xd882('0x30')](_0xeec825[_0xd882('0x31')],qs[_0xd882('0x32')](_0x56c06e[_0xd882('0x2d')][_0xd882('0x32')]));_0x5c4345[_0xd882('0x2f')]=_0x5c4345[_0xd882('0x2f')]['length']?_0x5c4345[_0xd882('0x2f')]:_0xeec825[_0xd882('0x31')];if(!_0x56c06e['query'][_0xd882('0x33')](_0xd882('0x34'))){_0x5c4345[_0xd882('0x1b')]=qs['limit'](_0x56c06e[_0xd882('0x2d')][_0xd882('0x1b')]);_0x5c4345[_0xd882('0x18')]=qs[_0xd882('0x18')](_0x56c06e[_0xd882('0x2d')]['offset']);}_0x5c4345[_0xd882('0x35')]=qs[_0xd882('0x36')](_0x56c06e['query'][_0xd882('0x36')]);_0x5c4345[_0xd882('0x37')]=qs[_0xd882('0x2e')](_[_0xd882('0x38')](_0x56c06e[_0xd882('0x2d')],_0xeec825[_0xd882('0x2e')]),_0x4c3a9f);if(_0x56c06e[_0xd882('0x2d')][_0xd882('0x39')]){_0x5c4345[_0xd882('0x37')]=_['merge'](_0x5c4345[_0xd882('0x37')],{'$or':_[_0xd882('0x26')](_0x4c3a9f,function(_0x4e1d3d){if(_0x4e1d3d['type']!==_0xd882('0x3a')){var _0x4ac696={};_0x4ac696[_0x4e1d3d['name']]={'$like':'%'+_0x56c06e['query'][_0xd882('0x39')]+'%'};return _0x4ac696;}})});}_0x5c4345=_[_0xd882('0x3b')]({},_0x5c4345,_0x56c06e[_0xd882('0x3c')]);var _0x3dd1da={'where':_0x5c4345['where']};return db['Automation']['count'](_0x3dd1da)[_0xd882('0x21')](function(_0x394b27){_0x1dc305[_0xd882('0x1a')]=_0x394b27;if(_0x56c06e['query'][_0xd882('0x3d')]){_0x5c4345[_0xd882('0x3e')]=[{'all':!![]}];}return db[_0xd882('0x27')][_0xd882('0x3f')](_0x5c4345);})['then'](function(_0x519496){_0x1dc305[_0xd882('0x40')]=_0x519496;return _0x1dc305;})[_0xd882('0x21')](respondWithFilteredResult(_0x4e7137,_0x5c4345))['catch'](handleError(_0x4e7137,null));};exports[_0xd882('0x41')]=function(_0x2d4427,_0x42801b){var _0x25f9e6={'raw':![],'where':{'id':_0x2d4427[_0xd882('0x42')]['id']}},_0x15abde={};_0x15abde[_0xd882('0x31')]=_[_0xd882('0x2c')](db[_0xd882('0x27')]['rawAttributes']);_0x15abde[_0xd882('0x2d')]=_['keys'](_0x2d4427[_0xd882('0x2d')]);_0x15abde[_0xd882('0x2e')]=_[_0xd882('0x30')](_0x15abde['model'],_0x15abde[_0xd882('0x2d')]);_0x25f9e6[_0xd882('0x2f')]=_[_0xd882('0x30')](_0x15abde['model'],qs[_0xd882('0x32')](_0x2d4427[_0xd882('0x2d')][_0xd882('0x32')]));_0x25f9e6[_0xd882('0x2f')]=_0x25f9e6[_0xd882('0x2f')]['length']?_0x25f9e6[_0xd882('0x2f')]:_0x15abde[_0xd882('0x31')];if(_0x2d4427[_0xd882('0x2d')][_0xd882('0x3d')]){_0x25f9e6['include']=[{'all':!![]}];}_0x25f9e6=_[_0xd882('0x3b')]({},_0x25f9e6,_0x2d4427['options']);return db[_0xd882('0x27')][_0xd882('0x43')](_0x25f9e6)[_0xd882('0x21')](handleEntityNotFound(_0x42801b,null))[_0xd882('0x21')](respondWithResult(_0x42801b,null))[_0xd882('0x44')](handleError(_0x42801b,null));};exports['create']=function(_0x4f5b73,_0x5f3894){return db['Automation'][_0xd882('0x45')](_0x4f5b73['body'],{})[_0xd882('0x21')](respondWithResult(_0x5f3894,0xc9))[_0xd882('0x44')](handleError(_0x5f3894,null));};exports[_0xd882('0x46')]=function(_0x5aa3f3,_0x7ae346){if(_0x5aa3f3['body']['id']){delete _0x5aa3f3['body']['id'];}return db[_0xd882('0x27')][_0xd882('0x43')]({'where':{'id':_0x5aa3f3[_0xd882('0x42')]['id']}})['then'](handleEntityNotFound(_0x7ae346,null))[_0xd882('0x21')](saveUpdates(_0x5aa3f3[_0xd882('0x47')],null))['then'](respondWithResult(_0x7ae346,null))[_0xd882('0x44')](handleError(_0x7ae346,null));};exports['destroy']=function(_0x58b697,_0x119b7d){return db[_0xd882('0x27')][_0xd882('0x43')]({'where':{'id':_0x58b697[_0xd882('0x42')]['id']}})['then'](handleEntityNotFound(_0x119b7d,null))['then'](removeEntity(_0x119b7d,null))[_0xd882('0x44')](handleError(_0x119b7d,null));};exports[_0xd882('0x48')]=function(_0x1cf114,_0x46384b,_0x490048){return db[_0xd882('0x49')]['find']({'where':{'id':_0x1cf114['params']['id']}})[_0xd882('0x21')](handleEntityNotFound(_0x46384b,null))[_0xd882('0x21')](function(_0x3b5314){if(_0x3b5314){return _0x3b5314['addConditions'](_0x1cf114[_0xd882('0x47')][_0xd882('0x4a')],_[_0xd882('0x4b')](_0x1cf114[_0xd882('0x47')],[_0xd882('0x4a'),'id'])||{});}})[_0xd882('0x21')](respondWithResult(_0x46384b,null))['catch'](handleError(_0x46384b,null));};exports[_0xd882('0x4c')]=function(_0x314ac4,_0x21ea06,_0x33ee0f){var _0x438f6d={};var _0x442928={};var _0x2aa135;var _0x583487;return db[_0xd882('0x27')][_0xd882('0x4d')]({'where':{'id':_0x314ac4['params']['id']}})[_0xd882('0x21')](handleEntityNotFound(_0x21ea06,null))[_0xd882('0x21')](function(_0x2b6e5d){if(_0x2b6e5d){_0x2aa135=_0x2b6e5d;_0x442928[_0xd882('0x31')]=_[_0xd882('0x2c')](db[_0xd882('0x49')][_0xd882('0x28')]);_0x442928['query']=_['keys'](_0x314ac4[_0xd882('0x2d')]);_0x442928['filters']=_['intersection'](_0x442928[_0xd882('0x31')],_0x442928[_0xd882('0x2d')]);_0x438f6d[_0xd882('0x2f')]=_[_0xd882('0x30')](_0x442928[_0xd882('0x31')],qs['fields'](_0x314ac4['query'][_0xd882('0x32')]));_0x438f6d[_0xd882('0x2f')]=_0x438f6d[_0xd882('0x2f')][_0xd882('0x4e')]?_0x438f6d['attributes']:_0x442928[_0xd882('0x31')];_0x438f6d[_0xd882('0x35')]=qs[_0xd882('0x36')](_0x314ac4['query'][_0xd882('0x36')]);_0x438f6d['where']=qs[_0xd882('0x2e')](_[_0xd882('0x38')](_0x314ac4['query'],_0x442928['filters']));if(_0x314ac4[_0xd882('0x2d')][_0xd882('0x39')]){_0x438f6d[_0xd882('0x37')]=_[_0xd882('0x3b')](_0x438f6d['where'],{'$or':_[_0xd882('0x26')](_0x438f6d[_0xd882('0x2f')],function(_0x5c53ff){var _0x5027a6={};_0x5027a6[_0x5c53ff]={'$like':'%'+_0x314ac4['query']['filter']+'%'};return _0x5027a6;})});}_0x438f6d=_[_0xd882('0x3b')]({},_0x438f6d,_0x314ac4[_0xd882('0x3c')]);return _0x2aa135['getConditions'](_0x438f6d);}})[_0xd882('0x21')](function(_0x5ae111){if(_0x5ae111){_0x583487=_0x5ae111[_0xd882('0x4e')];if(!_0x314ac4[_0xd882('0x2d')]['hasOwnProperty']('nolimit')){_0x438f6d[_0xd882('0x1b')]=qs[_0xd882('0x1b')](_0x314ac4[_0xd882('0x2d')]['limit']);_0x438f6d[_0xd882('0x18')]=qs['offset'](_0x314ac4['query'][_0xd882('0x18')]);}return _0x2aa135[_0xd882('0x4c')](_0x438f6d);}})[_0xd882('0x21')](function(_0x1a7188){if(_0x1a7188){return _0x1a7188?{'count':_0x583487,'rows':_0x1a7188}:null;}})[_0xd882('0x21')](respondWithResult(_0x21ea06,null))['catch'](handleError(_0x21ea06,null));};exports[_0xd882('0x4f')]=function(_0x162ea4,_0x3c1034,_0x5af5b7){return db[_0xd882('0x50')][_0xd882('0x43')]({'where':{'id':_0x162ea4[_0xd882('0x42')]['id']}})[_0xd882('0x21')](handleEntityNotFound(_0x3c1034,null))[_0xd882('0x21')](function(_0x268b55){if(_0x268b55){return _0x268b55[_0xd882('0x4f')](_0x162ea4[_0xd882('0x47')]['ids'],_[_0xd882('0x4b')](_0x162ea4[_0xd882('0x47')],['ids','id'])||{});}})[_0xd882('0x21')](respondWithResult(_0x3c1034,null))[_0xd882('0x44')](handleError(_0x3c1034,null));};exports[_0xd882('0x51')]=function(_0x11f6f4,_0x3b0cb4,_0x73a6c){var _0x308a46={};var _0x367d20={};var _0x405364;var _0xcf5c0a;return db[_0xd882('0x27')][_0xd882('0x4d')]({'where':{'id':_0x11f6f4[_0xd882('0x42')]['id']}})[_0xd882('0x21')](handleEntityNotFound(_0x3b0cb4,null))['then'](function(_0x3ae239){if(_0x3ae239){_0x405364=_0x3ae239;_0x367d20[_0xd882('0x31')]=_[_0xd882('0x2c')](db[_0xd882('0x50')][_0xd882('0x28')]);_0x367d20[_0xd882('0x2d')]=_[_0xd882('0x2c')](_0x11f6f4[_0xd882('0x2d')]);_0x367d20['filters']=_['intersection'](_0x367d20[_0xd882('0x31')],_0x367d20['query']);_0x308a46['attributes']=_[_0xd882('0x30')](_0x367d20['model'],qs[_0xd882('0x32')](_0x11f6f4[_0xd882('0x2d')]['fields']));_0x308a46[_0xd882('0x2f')]=_0x308a46[_0xd882('0x2f')][_0xd882('0x4e')]?_0x308a46[_0xd882('0x2f')]:_0x367d20[_0xd882('0x31')];_0x308a46[_0xd882('0x35')]=qs[_0xd882('0x36')](_0x11f6f4[_0xd882('0x2d')]['sort']);_0x308a46[_0xd882('0x37')]=qs[_0xd882('0x2e')](_['pick'](_0x11f6f4[_0xd882('0x2d')],_0x367d20[_0xd882('0x2e')]));if(_0x11f6f4[_0xd882('0x2d')]['filter']){_0x308a46[_0xd882('0x37')]=_[_0xd882('0x3b')](_0x308a46[_0xd882('0x37')],{'$or':_['map'](_0x308a46['attributes'],function(_0xeb45ea){var _0x350618={};_0x350618[_0xeb45ea]={'$like':'%'+_0x11f6f4[_0xd882('0x2d')]['filter']+'%'};return _0x350618;})});}_0x308a46=_[_0xd882('0x3b')]({},_0x308a46,_0x11f6f4[_0xd882('0x3c')]);return _0x405364['getActions'](_0x308a46);}})['then'](function(_0x3982f7){if(_0x3982f7){_0xcf5c0a=_0x3982f7['length'];if(!_0x11f6f4['query'][_0xd882('0x33')](_0xd882('0x34'))){_0x308a46['limit']=qs[_0xd882('0x1b')](_0x11f6f4[_0xd882('0x2d')]['limit']);_0x308a46['offset']=qs['offset'](_0x11f6f4['query'][_0xd882('0x18')]);}return _0x405364[_0xd882('0x51')](_0x308a46);}})[_0xd882('0x21')](function(_0x2bbd85){if(_0x2bbd85){return _0x2bbd85?{'count':_0xcf5c0a,'rows':_0x2bbd85}:null;}})[_0xd882('0x21')](respondWithResult(_0x3b0cb4,null))['catch'](handleError(_0x3b0cb4,null));};
\ No newline at end of file
+var _0xa118=['params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','error','name','send','map','Automation','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','keys','find','create','body'];(function(_0x6ed8a8,_0x31877c){var _0x3ef5f0=function(_0x59cfd5){while(--_0x59cfd5){_0x6ed8a8['push'](_0x6ed8a8['shift']());}};_0x3ef5f0(++_0x31877c);}(_0xa118,0x1eb));var _0x8a11=function(_0x5307f1,_0x66442d){_0x5307f1=_0x5307f1-0x0;var _0x212ae1=_0xa118[_0x5307f1];return _0x212ae1;};'use strict';var emlformat=require(_0x8a11('0x0'));var rimraf=require(_0x8a11('0x1'));var zipdir=require(_0x8a11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a11('0x3'));var BPromise=require(_0x8a11('0x4'));var Mustache=require(_0x8a11('0x5'));var util=require(_0x8a11('0x6'));var path=require('path');var sox=require(_0x8a11('0x7'));var csv=require(_0x8a11('0x8'));var ejs=require(_0x8a11('0x9'));var fs=require('fs');var fs_extra=require(_0x8a11('0xa'));var _=require(_0x8a11('0xb'));var squel=require(_0x8a11('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a11('0xd'));var toCsv=require(_0x8a11('0x8'));var querystring=require(_0x8a11('0xe'));var Papa=require(_0x8a11('0xf'));var Redis=require('ioredis');var authService=require(_0x8a11('0x10'));var qs=require(_0x8a11('0x11'));var as=require(_0x8a11('0x12'));var hardwareService=require(_0x8a11('0x13'));var logger=require('../../config/logger')(_0x8a11('0x14'));var utils=require(_0x8a11('0x15'));var config=require(_0x8a11('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a11('0x17'))['db'];function respondWithStatusCode(_0x2c1f73,_0x1baf19){_0x1baf19=_0x1baf19||0xcc;return function(_0x49f2a1){if(_0x49f2a1){return _0x2c1f73[_0x8a11('0x18')](_0x1baf19);}return _0x2c1f73[_0x8a11('0x19')](_0x1baf19)[_0x8a11('0x1a')]();};}function respondWithResult(_0x385a7b,_0x57d0a0){_0x57d0a0=_0x57d0a0||0xc8;return function(_0x510f58){if(_0x510f58){return _0x385a7b[_0x8a11('0x19')](_0x57d0a0)['json'](_0x510f58);}};}function respondWithFilteredResult(_0x1dd60e,_0x55e9e5){return function(_0x12372d){if(_0x12372d){var _0x2c5764=typeof _0x55e9e5[_0x8a11('0x1b')]===_0x8a11('0x1c')&&typeof _0x55e9e5[_0x8a11('0x1d')]==='undefined';var _0x10237f=_0x12372d[_0x8a11('0x1e')];var _0x32135f=_0x2c5764?0x0:_0x55e9e5[_0x8a11('0x1b')];var _0x138590=_0x2c5764?_0x12372d[_0x8a11('0x1e')]:_0x55e9e5[_0x8a11('0x1b')]+_0x55e9e5[_0x8a11('0x1d')];var _0x1bb1fd;if(_0x138590>=_0x10237f){_0x138590=_0x10237f;_0x1bb1fd=0xc8;}else{_0x1bb1fd=0xce;}_0x1dd60e[_0x8a11('0x19')](_0x1bb1fd);return _0x1dd60e[_0x8a11('0x1f')]('Content-Range',_0x32135f+'-'+_0x138590+'/'+_0x10237f)[_0x8a11('0x20')](_0x12372d);}return null;};}function patchUpdates(_0x3ea46a){return function(_0x5c3d23){try{jsonpatch[_0x8a11('0x21')](_0x5c3d23,_0x3ea46a,!![]);}catch(_0x415c0a){return BPromise['reject'](_0x415c0a);}return _0x5c3d23[_0x8a11('0x22')]();};}function saveUpdates(_0xf87287,_0x3ec062){return function(_0x521e73){if(_0x521e73){return _0x521e73[_0x8a11('0x23')](_0xf87287)[_0x8a11('0x24')](function(_0x2ed7fe){return _0x2ed7fe;});}return null;};}function removeEntity(_0x3bf5c8,_0x26ea1e){return function(_0x58cdcc){if(_0x58cdcc){return _0x58cdcc['destroy']()['then'](function(){_0x3bf5c8[_0x8a11('0x19')](0xcc)[_0x8a11('0x1a')]();});}};}function handleEntityNotFound(_0x475645,_0x5591b0){return function(_0x1b4d13){if(!_0x1b4d13){_0x475645[_0x8a11('0x18')](0x194);}return _0x1b4d13;};}function handleError(_0x2503a8,_0x20b115){_0x20b115=_0x20b115||0x1f4;return function(_0x34b417){logger[_0x8a11('0x25')](_0x34b417['stack']);if(_0x34b417['name']){delete _0x34b417[_0x8a11('0x26')];}_0x2503a8[_0x8a11('0x19')](_0x20b115)[_0x8a11('0x27')](_0x34b417);};}exports['index']=function(_0x16708a,_0xb601ea){var _0x23ce72={},_0x126079={},_0x3f9a0f={'count':0x0,'rows':[]};var _0x4fcb2c=_[_0x8a11('0x28')](db[_0x8a11('0x29')][_0x8a11('0x2a')],function(_0x222c4c){return{'name':_0x222c4c['fieldName'],'type':_0x222c4c['type'][_0x8a11('0x2b')]};});_0x126079[_0x8a11('0x2c')]=_[_0x8a11('0x28')](_0x4fcb2c,_0x8a11('0x26'));_0x126079[_0x8a11('0x2d')]=_['keys'](_0x16708a['query']);_0x126079[_0x8a11('0x2e')]=_[_0x8a11('0x2f')](_0x126079['model'],_0x126079[_0x8a11('0x2d')]);_0x23ce72[_0x8a11('0x30')]=_['intersection'](_0x126079[_0x8a11('0x2c')],qs[_0x8a11('0x31')](_0x16708a[_0x8a11('0x2d')][_0x8a11('0x31')]));_0x23ce72[_0x8a11('0x30')]=_0x23ce72[_0x8a11('0x30')][_0x8a11('0x32')]?_0x23ce72['attributes']:_0x126079[_0x8a11('0x2c')];if(!_0x16708a[_0x8a11('0x2d')][_0x8a11('0x33')](_0x8a11('0x34'))){_0x23ce72['limit']=qs['limit'](_0x16708a[_0x8a11('0x2d')]['limit']);_0x23ce72[_0x8a11('0x1b')]=qs['offset'](_0x16708a[_0x8a11('0x2d')][_0x8a11('0x1b')]);}_0x23ce72[_0x8a11('0x35')]=qs[_0x8a11('0x36')](_0x16708a[_0x8a11('0x2d')][_0x8a11('0x36')]);_0x23ce72[_0x8a11('0x37')]=qs[_0x8a11('0x2e')](_[_0x8a11('0x38')](_0x16708a['query'],_0x126079['filters']),_0x4fcb2c);if(_0x16708a[_0x8a11('0x2d')][_0x8a11('0x39')]){_0x23ce72[_0x8a11('0x37')]=_[_0x8a11('0x3a')](_0x23ce72['where'],{'$or':_[_0x8a11('0x28')](_0x4fcb2c,function(_0x214fba){if(_0x214fba[_0x8a11('0x3b')]!=='VIRTUAL'){var _0x2aeaca={};_0x2aeaca[_0x214fba[_0x8a11('0x26')]]={'$like':'%'+_0x16708a['query']['filter']+'%'};return _0x2aeaca;}})});}_0x23ce72=_[_0x8a11('0x3a')]({},_0x23ce72,_0x16708a[_0x8a11('0x3c')]);var _0x2cdacc={'where':_0x23ce72[_0x8a11('0x37')]};return db[_0x8a11('0x29')]['count'](_0x2cdacc)[_0x8a11('0x24')](function(_0x5463e2){_0x3f9a0f[_0x8a11('0x1e')]=_0x5463e2;if(_0x16708a[_0x8a11('0x2d')]['includeAll']){_0x23ce72[_0x8a11('0x3d')]=[{'all':!![]}];}return db[_0x8a11('0x29')][_0x8a11('0x3e')](_0x23ce72);})[_0x8a11('0x24')](function(_0x3ccef7){_0x3f9a0f['rows']=_0x3ccef7;return _0x3f9a0f;})[_0x8a11('0x24')](respondWithFilteredResult(_0xb601ea,_0x23ce72))[_0x8a11('0x3f')](handleError(_0xb601ea,null));};exports[_0x8a11('0x40')]=function(_0x5151e1,_0x3e8d0d){var _0x12cf90={'raw':![],'where':{'id':_0x5151e1['params']['id']}},_0x8bf4b={};_0x8bf4b['model']=_[_0x8a11('0x41')](db[_0x8a11('0x29')][_0x8a11('0x2a')]);_0x8bf4b[_0x8a11('0x2d')]=_[_0x8a11('0x41')](_0x5151e1['query']);_0x8bf4b[_0x8a11('0x2e')]=_[_0x8a11('0x2f')](_0x8bf4b[_0x8a11('0x2c')],_0x8bf4b[_0x8a11('0x2d')]);_0x12cf90[_0x8a11('0x30')]=_['intersection'](_0x8bf4b[_0x8a11('0x2c')],qs[_0x8a11('0x31')](_0x5151e1['query'][_0x8a11('0x31')]));_0x12cf90['attributes']=_0x12cf90[_0x8a11('0x30')][_0x8a11('0x32')]?_0x12cf90[_0x8a11('0x30')]:_0x8bf4b['model'];if(_0x5151e1['query']['includeAll']){_0x12cf90[_0x8a11('0x3d')]=[{'all':!![]}];}_0x12cf90=_['merge']({},_0x12cf90,_0x5151e1['options']);return db[_0x8a11('0x29')][_0x8a11('0x42')](_0x12cf90)[_0x8a11('0x24')](handleEntityNotFound(_0x3e8d0d,null))[_0x8a11('0x24')](respondWithResult(_0x3e8d0d,null))[_0x8a11('0x3f')](handleError(_0x3e8d0d,null));};exports[_0x8a11('0x43')]=function(_0x3c5d62,_0xe09399){return db[_0x8a11('0x29')]['create'](_0x3c5d62[_0x8a11('0x44')],{})[_0x8a11('0x24')](respondWithResult(_0xe09399,0xc9))[_0x8a11('0x3f')](handleError(_0xe09399,null));};exports[_0x8a11('0x23')]=function(_0x4b861e,_0x587774){if(_0x4b861e[_0x8a11('0x44')]['id']){delete _0x4b861e[_0x8a11('0x44')]['id'];}return db[_0x8a11('0x29')][_0x8a11('0x42')]({'where':{'id':_0x4b861e[_0x8a11('0x45')]['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0x587774,null))[_0x8a11('0x24')](saveUpdates(_0x4b861e[_0x8a11('0x44')],null))['then'](respondWithResult(_0x587774,null))[_0x8a11('0x3f')](handleError(_0x587774,null));};exports[_0x8a11('0x46')]=function(_0xe623ac,_0x519e21){return db['Automation'][_0x8a11('0x42')]({'where':{'id':_0xe623ac[_0x8a11('0x45')]['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0x519e21,null))['then'](removeEntity(_0x519e21,null))['catch'](handleError(_0x519e21,null));};exports[_0x8a11('0x47')]=function(_0x5a48f3,_0x1347eb,_0xcffc1a){return db[_0x8a11('0x48')]['find']({'where':{'id':_0x5a48f3['params']['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0x1347eb,null))[_0x8a11('0x24')](function(_0x3084e8){if(_0x3084e8){return _0x3084e8['addConditions'](_0x5a48f3['body'][_0x8a11('0x49')],_[_0x8a11('0x4a')](_0x5a48f3[_0x8a11('0x44')],[_0x8a11('0x49'),'id'])||{});}})[_0x8a11('0x24')](respondWithResult(_0x1347eb,null))['catch'](handleError(_0x1347eb,null));};exports[_0x8a11('0x4b')]=function(_0x538c2c,_0x59bf07,_0x3daf9a){var _0x4f4f51={};var _0x6e1f1a={};var _0x10e3f3;var _0x38415d;return db[_0x8a11('0x29')][_0x8a11('0x4c')]({'where':{'id':_0x538c2c[_0x8a11('0x45')]['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0x59bf07,null))[_0x8a11('0x24')](function(_0x10bde2){if(_0x10bde2){_0x10e3f3=_0x10bde2;_0x6e1f1a[_0x8a11('0x2c')]=_['keys'](db[_0x8a11('0x48')][_0x8a11('0x2a')]);_0x6e1f1a[_0x8a11('0x2d')]=_[_0x8a11('0x41')](_0x538c2c['query']);_0x6e1f1a['filters']=_['intersection'](_0x6e1f1a['model'],_0x6e1f1a['query']);_0x4f4f51[_0x8a11('0x30')]=_['intersection'](_0x6e1f1a[_0x8a11('0x2c')],qs[_0x8a11('0x31')](_0x538c2c[_0x8a11('0x2d')][_0x8a11('0x31')]));_0x4f4f51['attributes']=_0x4f4f51[_0x8a11('0x30')]['length']?_0x4f4f51[_0x8a11('0x30')]:_0x6e1f1a[_0x8a11('0x2c')];_0x4f4f51[_0x8a11('0x35')]=qs[_0x8a11('0x36')](_0x538c2c[_0x8a11('0x2d')][_0x8a11('0x36')]);_0x4f4f51[_0x8a11('0x37')]=qs[_0x8a11('0x2e')](_[_0x8a11('0x38')](_0x538c2c['query'],_0x6e1f1a[_0x8a11('0x2e')]));if(_0x538c2c[_0x8a11('0x2d')]['filter']){_0x4f4f51[_0x8a11('0x37')]=_[_0x8a11('0x3a')](_0x4f4f51[_0x8a11('0x37')],{'$or':_[_0x8a11('0x28')](_0x4f4f51[_0x8a11('0x30')],function(_0x17129b){var _0x396615={};_0x396615[_0x17129b]={'$like':'%'+_0x538c2c['query'][_0x8a11('0x39')]+'%'};return _0x396615;})});}_0x4f4f51=_[_0x8a11('0x3a')]({},_0x4f4f51,_0x538c2c[_0x8a11('0x3c')]);return _0x10e3f3[_0x8a11('0x4b')](_0x4f4f51);}})[_0x8a11('0x24')](function(_0x171e29){if(_0x171e29){_0x38415d=_0x171e29[_0x8a11('0x32')];if(!_0x538c2c[_0x8a11('0x2d')]['hasOwnProperty']('nolimit')){_0x4f4f51[_0x8a11('0x1d')]=qs[_0x8a11('0x1d')](_0x538c2c[_0x8a11('0x2d')]['limit']);_0x4f4f51[_0x8a11('0x1b')]=qs[_0x8a11('0x1b')](_0x538c2c[_0x8a11('0x2d')][_0x8a11('0x1b')]);}return _0x10e3f3[_0x8a11('0x4b')](_0x4f4f51);}})[_0x8a11('0x24')](function(_0x3029a7){if(_0x3029a7){return _0x3029a7?{'count':_0x38415d,'rows':_0x3029a7}:null;}})['then'](respondWithResult(_0x59bf07,null))[_0x8a11('0x3f')](handleError(_0x59bf07,null));};exports[_0x8a11('0x4d')]=function(_0x6aa0b0,_0xcaeebc,_0x4b1253){return db[_0x8a11('0x4e')][_0x8a11('0x42')]({'where':{'id':_0x6aa0b0[_0x8a11('0x45')]['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0xcaeebc,null))['then'](function(_0x570c43){if(_0x570c43){return _0x570c43[_0x8a11('0x4d')](_0x6aa0b0[_0x8a11('0x44')][_0x8a11('0x49')],_[_0x8a11('0x4a')](_0x6aa0b0[_0x8a11('0x44')],['ids','id'])||{});}})[_0x8a11('0x24')](respondWithResult(_0xcaeebc,null))[_0x8a11('0x3f')](handleError(_0xcaeebc,null));};exports[_0x8a11('0x4f')]=function(_0x34e846,_0x244816,_0x2d30d0){var _0x45a915={};var _0x92257={};var _0x234aa2;var _0x3be079;return db['Automation'][_0x8a11('0x4c')]({'where':{'id':_0x34e846['params']['id']}})[_0x8a11('0x24')](handleEntityNotFound(_0x244816,null))['then'](function(_0x2bfe59){if(_0x2bfe59){_0x234aa2=_0x2bfe59;_0x92257[_0x8a11('0x2c')]=_[_0x8a11('0x41')](db[_0x8a11('0x4e')]['rawAttributes']);_0x92257['query']=_['keys'](_0x34e846['query']);_0x92257['filters']=_['intersection'](_0x92257[_0x8a11('0x2c')],_0x92257['query']);_0x45a915[_0x8a11('0x30')]=_[_0x8a11('0x2f')](_0x92257[_0x8a11('0x2c')],qs['fields'](_0x34e846[_0x8a11('0x2d')][_0x8a11('0x31')]));_0x45a915[_0x8a11('0x30')]=_0x45a915[_0x8a11('0x30')][_0x8a11('0x32')]?_0x45a915['attributes']:_0x92257[_0x8a11('0x2c')];_0x45a915[_0x8a11('0x35')]=qs[_0x8a11('0x36')](_0x34e846[_0x8a11('0x2d')][_0x8a11('0x36')]);_0x45a915[_0x8a11('0x37')]=qs[_0x8a11('0x2e')](_[_0x8a11('0x38')](_0x34e846['query'],_0x92257[_0x8a11('0x2e')]));if(_0x34e846[_0x8a11('0x2d')][_0x8a11('0x39')]){_0x45a915[_0x8a11('0x37')]=_[_0x8a11('0x3a')](_0x45a915['where'],{'$or':_[_0x8a11('0x28')](_0x45a915[_0x8a11('0x30')],function(_0x366536){var _0x3c9cf8={};_0x3c9cf8[_0x366536]={'$like':'%'+_0x34e846[_0x8a11('0x2d')]['filter']+'%'};return _0x3c9cf8;})});}_0x45a915=_['merge']({},_0x45a915,_0x34e846[_0x8a11('0x3c')]);return _0x234aa2[_0x8a11('0x4f')](_0x45a915);}})[_0x8a11('0x24')](function(_0x4a98cc){if(_0x4a98cc){_0x3be079=_0x4a98cc['length'];if(!_0x34e846['query']['hasOwnProperty'](_0x8a11('0x34'))){_0x45a915[_0x8a11('0x1d')]=qs[_0x8a11('0x1d')](_0x34e846[_0x8a11('0x2d')][_0x8a11('0x1d')]);_0x45a915['offset']=qs['offset'](_0x34e846[_0x8a11('0x2d')][_0x8a11('0x1b')]);}return _0x234aa2[_0x8a11('0x4f')](_0x45a915);}})['then'](function(_0x32abbe){if(_0x32abbe){return _0x32abbe?{'count':_0x3be079,'rows':_0x32abbe}:null;}})[_0x8a11('0x24')](respondWithResult(_0x244816,null))[_0x8a11('0x3f')](handleError(_0x244816,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index c2c6b67..fdde73d 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 _0x7c8c=['Automation','tools_automations','lodash','../../config/logger','api','bluebird','request-promise','path','./automation.attributes','exports'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x7c8c,0x174));var _0xc7c8=function(_0x5d2f6d,_0x9d48cd){_0x5d2f6d=_0x5d2f6d-0x0;var _0x1c8f82=_0x7c8c[_0x5d2f6d];return _0x1c8f82;};'use strict';var _=require(_0xc7c8('0x0'));var util=require('util');var logger=require(_0xc7c8('0x1'))(_0xc7c8('0x2'));var moment=require('moment');var BPromise=require(_0xc7c8('0x3'));var rp=require(_0xc7c8('0x4'));var fs=require('fs');var path=require(_0xc7c8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc7c8('0x6'));module[_0xc7c8('0x7')]=function(_0x48fee1,_0x2c8e7d){return _0x48fee1['define'](_0xc7c8('0x8'),attributes,{'tableName':_0xc7c8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b9d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations','lodash'];(function(_0x107bfa,_0x5aae40){var _0xcd2c33=function(_0x306f28){while(--_0x306f28){_0x107bfa['push'](_0x107bfa['shift']());}};_0xcd2c33(++_0x5aae40);}(_0x7b9d,0xf6));var _0xd7b9=function(_0x2a5af5,_0x2517ed){_0x2a5af5=_0x2a5af5-0x0;var _0x4353eb=_0x7b9d[_0x2a5af5];return _0x4353eb;};'use strict';var _=require(_0xd7b9('0x0'));var util=require(_0xd7b9('0x1'));var logger=require(_0xd7b9('0x2'))(_0xd7b9('0x3'));var moment=require(_0xd7b9('0x4'));var BPromise=require(_0xd7b9('0x5'));var rp=require(_0xd7b9('0x6'));var fs=require('fs');var path=require(_0xd7b9('0x7'));var rimraf=require(_0xd7b9('0x8'));var config=require(_0xd7b9('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x5568d1,_0x56574b){return _0x5568d1[_0xd7b9('0xa')](_0xd7b9('0xb'),attributes,{'tableName':_0xd7b9('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 d74a5cd..84b8f89 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 _0xfa25=['info','Automation,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x59f73f,_0x2c641a){var _0x33b5a1=function(_0x362b89){while(--_0x362b89){_0x59f73f['push'](_0x59f73f['shift']());}};_0x33b5a1(++_0x2c641a);}(_0xfa25,0xd1));var _0x5fa2=function(_0x2f55c2,_0xb0a593){_0x2f55c2=_0x2f55c2-0x0;var _0x9b9cd2=_0xfa25[_0x2f55c2];return _0x9b9cd2;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var moment=require(_0x5fa2('0x1'));var BPromise=require(_0x5fa2('0x2'));var rs=require(_0x5fa2('0x3'));var fs=require('fs');var Redis=require(_0x5fa2('0x4'));var db=require(_0x5fa2('0x5'))['db'];var utils=require(_0x5fa2('0x6'));var logger=require(_0x5fa2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fa2('0x8'));var client=jayson[_0x5fa2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53a560,_0x2a9a69,_0x4b04ea){return new BPromise(function(_0x35c145,_0x9c9f1c){return client[_0x5fa2('0xa')](_0x53a560,_0x4b04ea)['then'](function(_0x36778e){logger[_0x5fa2('0xb')](_0x5fa2('0xc'),_0x2a9a69,'request\x20sent');logger[_0x5fa2('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x2a9a69,'request\x20sent',JSON[_0x5fa2('0xe')](_0x36778e));if(_0x36778e[_0x5fa2('0xf')]){if(_0x36778e['error'][_0x5fa2('0x10')]===0x1f4){logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);return _0x9c9f1c(_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);}logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);return _0x35c145(_0x36778e[_0x5fa2('0xf')][_0x5fa2('0x11')]);}else{logger[_0x5fa2('0xb')]('Automation,\x20%s,\x20%s',_0x2a9a69,_0x5fa2('0x12'));_0x35c145(_0x36778e[_0x5fa2('0x13')][_0x5fa2('0x11')]);}})['catch'](function(_0x4e20d1){logger[_0x5fa2('0xf')](_0x5fa2('0xc'),_0x2a9a69,_0x4e20d1);_0x9c9f1c(_0x4e20d1);});});}
\ No newline at end of file
+var _0x7366=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x424841,_0x1b900a){var _0xab5a43=function(_0x301a02){while(--_0x301a02){_0x424841['push'](_0x424841['shift']());}};_0xab5a43(++_0x1b900a);}(_0x7366,0x9d));var _0x6736=function(_0x11fd65,_0x2f79e9){_0x11fd65=_0x11fd65-0x0;var _0x344f0f=_0x7366[_0x11fd65];return _0x344f0f;};'use strict';var _=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var moment=require(_0x6736('0x2'));var BPromise=require(_0x6736('0x3'));var rs=require(_0x6736('0x4'));var fs=require('fs');var Redis=require(_0x6736('0x5'));var db=require(_0x6736('0x6'))['db'];var utils=require(_0x6736('0x7'));var logger=require(_0x6736('0x8'))('rpc');var config=require(_0x6736('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6736('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e0c1,_0x2cc35d,_0x4f4944){return new BPromise(function(_0x123b3c,_0x3a966c){return client[_0x6736('0xb')](_0x32e0c1,_0x4f4944)['then'](function(_0x1d0c58){logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,'request\x20sent');logger[_0x6736('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x2cc35d,_0x6736('0xf'),JSON[_0x6736('0x10')](_0x1d0c58));if(_0x1d0c58['error']){if(_0x1d0c58[_0x6736('0x11')][_0x6736('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x2cc35d,_0x1d0c58['error'][_0x6736('0x13')]);return _0x3a966c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}logger[_0x6736('0x11')](_0x6736('0xd'),_0x2cc35d,_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);return _0x123b3c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}else{logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,_0x6736('0xf'));_0x123b3c(_0x1d0c58[_0x6736('0x14')][_0x6736('0x13')]);}})[_0x6736('0x15')](function(_0x3290a1){logger['error'](_0x6736('0xd'),_0x2cc35d,_0x3290a1);_0x3a966c(_0x3290a1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d9b5712..bbd9d29 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 _0x355e=['addActions','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','/:id/actions','post','create','addConditions'];(function(_0x5e2a0f,_0x447ab4){var _0x3e8c10=function(_0x56dd4e){while(--_0x56dd4e){_0x5e2a0f['push'](_0x5e2a0f['shift']());}};_0x3e8c10(++_0x447ab4);}(_0x355e,0xa7));var _0xe355=function(_0x4c72cf,_0x244156){_0x4c72cf=_0x4c72cf-0x0;var _0x237b21=_0x355e[_0x4c72cf];return _0x237b21;};'use strict';var multer=require(_0xe355('0x0'));var util=require(_0xe355('0x1'));var path=require('path');var timeout=require(_0xe355('0x2'));var express=require(_0xe355('0x3'));var router=express[_0xe355('0x4')]();var fs_extra=require(_0xe355('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe355('0x6'));var controller=require(_0xe355('0x7'));router[_0xe355('0x8')]('/',auth[_0xe355('0x9')](),controller[_0xe355('0xa')]);router[_0xe355('0x8')](_0xe355('0xb'),auth[_0xe355('0x9')](),controller['show']);router[_0xe355('0x8')](_0xe355('0xc'),auth[_0xe355('0x9')](),controller['getConditions']);router['get'](_0xe355('0xd'),auth[_0xe355('0x9')](),controller['getActions']);router[_0xe355('0xe')]('/',auth[_0xe355('0x9')](),controller[_0xe355('0xf')]);router['post'](_0xe355('0xc'),auth[_0xe355('0x9')](),controller[_0xe355('0x10')]);router[_0xe355('0xe')](_0xe355('0xd'),auth[_0xe355('0x9')](),controller[_0xe355('0x11')]);router[_0xe355('0x12')](_0xe355('0xb'),auth['isAuthenticated'](),controller[_0xe355('0x13')]);router[_0xe355('0x14')]('/:id',auth[_0xe355('0x9')](),controller[_0xe355('0x15')]);module[_0xe355('0x16')]=router;
\ No newline at end of file
+var _0x9ff7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id/conditions','getActions','post','addConditions','/:id/actions','addActions','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x2faf63,_0x43ea11){var _0x56d9ce=function(_0x6809b8){while(--_0x6809b8){_0x2faf63['push'](_0x2faf63['shift']());}};_0x56d9ce(++_0x43ea11);}(_0x9ff7,0x8c));var _0x79ff=function(_0x55a127,_0x49613b){_0x55a127=_0x55a127-0x0;var _0x3a343d=_0x9ff7[_0x55a127];return _0x3a343d;};'use strict';var multer=require(_0x79ff('0x0'));var util=require(_0x79ff('0x1'));var path=require('path');var timeout=require(_0x79ff('0x2'));var express=require('express');var router=express[_0x79ff('0x3')]();var fs_extra=require(_0x79ff('0x4'));var auth=require(_0x79ff('0x5'));var interaction=require(_0x79ff('0x6'));var config=require(_0x79ff('0x7'));var controller=require(_0x79ff('0x8'));router['get']('/',auth[_0x79ff('0x9')](),controller[_0x79ff('0xa')]);router['get']('/:id',auth[_0x79ff('0x9')](),controller['show']);router[_0x79ff('0xb')](_0x79ff('0xc'),auth['isAuthenticated'](),controller['getConditions']);router[_0x79ff('0xb')]('/:id/actions',auth[_0x79ff('0x9')](),controller[_0x79ff('0xd')]);router['post']('/',auth[_0x79ff('0x9')](),controller['create']);router[_0x79ff('0xe')](_0x79ff('0xc'),auth[_0x79ff('0x9')](),controller[_0x79ff('0xf')]);router[_0x79ff('0xe')](_0x79ff('0x10'),auth[_0x79ff('0x9')](),controller[_0x79ff('0x11')]);router[_0x79ff('0x12')]('/:id',auth[_0x79ff('0x9')](),controller[_0x79ff('0x13')]);router[_0x79ff('0x14')](_0x79ff('0x15'),auth[_0x79ff('0x9')](),controller[_0x79ff('0x16')]);module[_0x79ff('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 f47645d..38634eb 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 _0x0e4a=['STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0e4a,0xd8));var _0xa0e4=function(_0x33cf15,_0x151ab4){_0x33cf15=_0x33cf15-0x0;var _0x2fed78=_0x0e4a[_0x33cf15];return _0x2fed78;};'use strict';var Sequelize=require(_0xa0e4('0x0'));module[_0xa0e4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa0e4('0x2')),'allowNull':![],'defaultValue':_0xa0e4('0x2')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa0e4('0x3')],'defaultValue':0x0,'comment':_0xa0e4('0x4')},'limitCalls':{'type':Sequelize[_0xa0e4('0x5')](0x4)[_0xa0e4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa0e4('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa0e4('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa0e4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'comment':_0xa0e4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa0e4('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa0e4('0x8')],'defaultValue':_0xa0e4('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xa0e4('0x11')](_0xa0e4('0x12'),'never','onlyIfOpen'),'defaultValue':_0xa0e4('0x12')},'dialAMDActive':{'type':Sequelize[_0xa0e4('0x3')],'defaultValue':0x0,'comment':_0xa0e4('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa0e4('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xa0e4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa0e4('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa0e4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa0e4('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa0e4('0x5')](0x9)[_0xa0e4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa0e4('0x11')]('DESC','ASC'),'defaultValue':_0xa0e4('0x17')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa0e4('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0x1c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0e4('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa0e4('0x5')](0x3)[_0xa0e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa0e4('0x5')](0x5)[_0xa0e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0e4('0x1f')}};
\ No newline at end of file
+var _0xdcc1=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0xdcc1,0x170));var _0x1dcc=function(_0x240334,_0x35f3bb){_0x240334=_0x240334-0x0;var _0x5cfacf=_0xdcc1[_0x240334];return _0x5cfacf;};'use strict';var Sequelize=require(_0x1dcc('0x0'));module[_0x1dcc('0x1')]={'name':{'type':Sequelize[_0x1dcc('0x2')],'unique':_0x1dcc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1dcc('0x4')),'allowNull':![],'defaultValue':_0x1dcc('0x4')},'description':{'type':Sequelize[_0x1dcc('0x2')]},'active':{'type':Sequelize[_0x1dcc('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1dcc('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1dcc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1dcc('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1dcc('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1dcc('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'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':_0x1dcc('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1dcc('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'comment':_0x1dcc('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1dcc('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1dcc('0xd')},'dialTimezone':{'type':Sequelize[_0x1dcc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1dcc('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1dcc('0xf'),_0x1dcc('0x10'),_0x1dcc('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1dcc('0x5')],'defaultValue':0x0,'comment':_0x1dcc('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1dcc('0x6')](0x9)[_0x1dcc('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1dcc('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x1dcc('0x6')](0x9)[_0x1dcc('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1dcc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1dcc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1dcc('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1dcc('0x6')](0x9)[_0x1dcc('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1dcc('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1dcc('0x6')](0x9)[_0x1dcc('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1dcc('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1dcc('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1dcc('0x6')](0x5)[_0x1dcc('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1dcc('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1dcc('0x18')](_0x1dcc('0x19'),_0x1dcc('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1dcc('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1dcc('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1dcc('0x1b')},'dialCutDigit':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1dcc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1dcc('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1dcc('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1dcc('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1dcc('0x6')](0x3)[_0x1dcc('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1dcc('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1dcc('0x6')](0x5)[_0x1dcc('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 36a94e2..45d6190 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 _0xabcb=['CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','insert','fromQuery','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','Campaign','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','userProfileId','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','rawAttributes','getHopperHistories'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xabcb,0x1c5));var _0xbabc=function(_0x633098,_0x3a4624){_0x633098=_0x633098-0x0;var _0x318694=_0xabcb[_0x633098];return _0x318694;};'use strict';var emlformat=require(_0xbabc('0x0'));var rimraf=require(_0xbabc('0x1'));var zipdir=require(_0xbabc('0x2'));var jsonpatch=require(_0xbabc('0x3'));var rp=require('request-promise');var moment=require(_0xbabc('0x4'));var BPromise=require(_0xbabc('0x5'));var Mustache=require('mustache');var util=require(_0xbabc('0x6'));var path=require(_0xbabc('0x7'));var sox=require(_0xbabc('0x8'));var csv=require('to-csv');var ejs=require(_0xbabc('0x9'));var fs=require('fs');var fs_extra=require(_0xbabc('0xa'));var _=require(_0xbabc('0xb'));var squel=require(_0xbabc('0xc'));var crypto=require(_0xbabc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbabc('0xe'));var toCsv=require(_0xbabc('0xf'));var querystring=require(_0xbabc('0x10'));var Papa=require(_0xbabc('0x11'));var Redis=require(_0xbabc('0x12'));var authService=require(_0xbabc('0x13'));var qs=require(_0xbabc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbabc('0x15'));var logger=require('../../config/logger')(_0xbabc('0x16'));var utils=require(_0xbabc('0x17'));var config=require(_0xbabc('0x18'));var licenseUtil=require(_0xbabc('0x19'));var db=require(_0xbabc('0x1a'))['db'];function respondWithStatusCode(_0x3e09b2,_0x58aede){_0x58aede=_0x58aede||0xcc;return function(_0x5647be){if(_0x5647be){return _0x3e09b2[_0xbabc('0x1b')](_0x58aede);}return _0x3e09b2['status'](_0x58aede)[_0xbabc('0x1c')]();};}function respondWithResult(_0x5b36ce,_0x197d04){_0x197d04=_0x197d04||0xc8;return function(_0xbfd17d){if(_0xbfd17d){return _0x5b36ce['status'](_0x197d04)[_0xbabc('0x1d')](_0xbfd17d);}};}function respondWithFilteredResult(_0x1470b0,_0x2a5275){return function(_0x612910){if(_0x612910){var _0x5952e4=typeof _0x2a5275[_0xbabc('0x1e')]===_0xbabc('0x1f')&&typeof _0x2a5275[_0xbabc('0x20')]==='undefined';var _0xf0730b=_0x612910[_0xbabc('0x21')];var _0x6b398e=_0x5952e4?0x0:_0x2a5275[_0xbabc('0x1e')];var _0x20f762=_0x5952e4?_0x612910[_0xbabc('0x21')]:_0x2a5275[_0xbabc('0x1e')]+_0x2a5275[_0xbabc('0x20')];var _0x5efb10;if(_0x20f762>=_0xf0730b){_0x20f762=_0xf0730b;_0x5efb10=0xc8;}else{_0x5efb10=0xce;}_0x1470b0[_0xbabc('0x22')](_0x5efb10);return _0x1470b0[_0xbabc('0x23')](_0xbabc('0x24'),_0x6b398e+'-'+_0x20f762+'/'+_0xf0730b)[_0xbabc('0x1d')](_0x612910);}return null;};}function patchUpdates(_0x595563){return function(_0x20b91d){try{jsonpatch['apply'](_0x20b91d,_0x595563,!![]);}catch(_0x14baf7){return BPromise[_0xbabc('0x25')](_0x14baf7);}return _0x20b91d[_0xbabc('0x26')]();};}function saveUpdates(_0xd0bc4d,_0x4970fe){return function(_0x1d821e){if(_0x1d821e){return _0x1d821e[_0xbabc('0x27')](_0xd0bc4d)[_0xbabc('0x28')](function(_0x4e4203){return _0x4e4203;});}return null;};}function removeEntity(_0xc8fa19,_0x10e4d4){return function(_0x2c7061){if(_0x2c7061){return _0x2c7061[_0xbabc('0x29')]()[_0xbabc('0x28')](function(){var _0x595368=_0x2c7061[_0xbabc('0x2a')]({'plain':!![]});var _0x161764=_0xbabc('0x2b');return db[_0xbabc('0x2c')]['destroy']({'where':{'type':_0x161764,'resourceId':_0x595368['id']}})[_0xbabc('0x28')](function(){return _0x2c7061;});})[_0xbabc('0x28')](function(){_0xc8fa19[_0xbabc('0x22')](0xcc)[_0xbabc('0x1c')]();});}};}function handleEntityNotFound(_0x35ec30,_0x36aba0){return function(_0x165228){if(!_0x165228){_0x35ec30[_0xbabc('0x1b')](0x194);}return _0x165228;};}function handleError(_0x46c8c1,_0x38418e){_0x38418e=_0x38418e||0x1f4;return function(_0x3b4836){logger[_0xbabc('0x2d')](_0x3b4836['stack']);if(_0x3b4836['name']){delete _0x3b4836[_0xbabc('0x2e')];}_0x46c8c1[_0xbabc('0x22')](_0x38418e)[_0xbabc('0x2f')](_0x3b4836);};}exports[_0xbabc('0x30')]=function(_0x54ac3e,_0x9f2162){var _0x2ff517={},_0x50f1e8={},_0x20bb11={'count':0x0,'rows':[]};var _0x584d18=_['map'](db[_0xbabc('0x31')]['rawAttributes'],function(_0x616e21){return{'name':_0x616e21[_0xbabc('0x32')],'type':_0x616e21['type']['key']};});_0x50f1e8[_0xbabc('0x33')]=_['map'](_0x584d18,_0xbabc('0x2e'));_0x50f1e8[_0xbabc('0x34')]=_[_0xbabc('0x35')](_0x54ac3e['query']);_0x50f1e8[_0xbabc('0x36')]=_[_0xbabc('0x37')](_0x50f1e8[_0xbabc('0x33')],_0x50f1e8[_0xbabc('0x34')]);_0x2ff517[_0xbabc('0x38')]=_[_0xbabc('0x37')](_0x50f1e8['model'],qs[_0xbabc('0x39')](_0x54ac3e[_0xbabc('0x34')][_0xbabc('0x39')]));_0x2ff517[_0xbabc('0x38')]=_0x2ff517[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x2ff517[_0xbabc('0x38')]:_0x50f1e8[_0xbabc('0x33')];if(!_0x54ac3e[_0xbabc('0x34')][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x2ff517[_0xbabc('0x20')]=qs[_0xbabc('0x20')](_0x54ac3e[_0xbabc('0x34')][_0xbabc('0x20')]);_0x2ff517['offset']=qs[_0xbabc('0x1e')](_0x54ac3e[_0xbabc('0x34')]['offset']);}_0x2ff517[_0xbabc('0x3d')]=qs[_0xbabc('0x3e')](_0x54ac3e[_0xbabc('0x34')]['sort']);_0x2ff517[_0xbabc('0x3f')]=qs['filters'](_[_0xbabc('0x40')](_0x54ac3e['query'],_0x50f1e8[_0xbabc('0x36')]),_0x584d18);if(_0x54ac3e[_0xbabc('0x34')]['filter']){_0x2ff517[_0xbabc('0x3f')]=_[_0xbabc('0x41')](_0x2ff517[_0xbabc('0x3f')],{'$or':_[_0xbabc('0x42')](_0x584d18,function(_0x5efaa3){if(_0x5efaa3['type']!=='VIRTUAL'){var _0x581186={};_0x581186[_0x5efaa3[_0xbabc('0x2e')]]={'$like':'%'+_0x54ac3e[_0xbabc('0x34')][_0xbabc('0x43')]+'%'};return _0x581186;}})});}_0x2ff517=_['merge']({},_0x2ff517,_0x54ac3e[_0xbabc('0x44')]);var _0x135938={'where':_0x2ff517[_0xbabc('0x3f')]};return db['Campaign'][_0xbabc('0x21')](_0x135938)[_0xbabc('0x28')](function(_0x670af5){_0x20bb11[_0xbabc('0x21')]=_0x670af5;if(_0x54ac3e[_0xbabc('0x34')][_0xbabc('0x45')]){_0x2ff517[_0xbabc('0x46')]=[{'all':!![]}];}return db[_0xbabc('0x31')][_0xbabc('0x47')](_0x2ff517);})[_0xbabc('0x28')](function(_0xcb3e8a){_0x20bb11[_0xbabc('0x48')]=_0xcb3e8a;return _0x20bb11;})['then'](respondWithFilteredResult(_0x9f2162,_0x2ff517))[_0xbabc('0x49')](handleError(_0x9f2162,null));};exports['show']=function(_0x2d477d,_0x5e21ca){var _0x3b4508={'raw':![],'where':{'id':_0x2d477d[_0xbabc('0x4a')]['id']}},_0x47fcee={};_0x47fcee[_0xbabc('0x33')]=_['keys'](db['Campaign']['rawAttributes']);_0x47fcee[_0xbabc('0x34')]=_['keys'](_0x2d477d[_0xbabc('0x34')]);_0x47fcee['filters']=_[_0xbabc('0x37')](_0x47fcee[_0xbabc('0x33')],_0x47fcee[_0xbabc('0x34')]);_0x3b4508[_0xbabc('0x38')]=_['intersection'](_0x47fcee[_0xbabc('0x33')],qs[_0xbabc('0x39')](_0x2d477d[_0xbabc('0x34')][_0xbabc('0x39')]));_0x3b4508[_0xbabc('0x38')]=_0x3b4508[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x3b4508['attributes']:_0x47fcee[_0xbabc('0x33')];if(_0x2d477d[_0xbabc('0x34')]['includeAll']){_0x3b4508[_0xbabc('0x46')]=[{'all':!![]}];}_0x3b4508=_[_0xbabc('0x41')]({},_0x3b4508,_0x2d477d[_0xbabc('0x44')]);return db['Campaign'][_0xbabc('0x4b')](_0x3b4508)[_0xbabc('0x28')](handleEntityNotFound(_0x5e21ca,null))['then'](respondWithResult(_0x5e21ca,null))[_0xbabc('0x49')](handleError(_0x5e21ca,null));};exports[_0xbabc('0x4c')]=function(_0x202755,_0x388655){return db[_0xbabc('0x31')][_0xbabc('0x4c')](_0x202755[_0xbabc('0x4d')],{})[_0xbabc('0x28')](function(_0xc583fc){var _0x467b62=_0x202755[_0xbabc('0x4e')]['get']({'plain':!![]});if(!_0x467b62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x467b62['role']==='user'){var _0x25c45d=_0xc583fc[_0xbabc('0x2a')]({'plain':!![]});var _0x3a0ed5=_0xbabc('0x2b');return db['UserProfileSection'][_0xbabc('0x4b')]({'where':{'name':_0x3a0ed5,'userProfileId':_0x467b62[_0xbabc('0x4f')]},'raw':!![]})[_0xbabc('0x28')](function(_0x7188e2){if(_0x7188e2&&_0x7188e2['autoAssociation']===0x0){return db['UserProfileResource'][_0xbabc('0x4c')]({'name':_0x25c45d['name'],'resourceId':_0x25c45d['id'],'type':_0x7188e2[_0xbabc('0x2e')],'sectionId':_0x7188e2['id']},{})[_0xbabc('0x28')](function(){return _0xc583fc;});}else{return _0xc583fc;}})[_0xbabc('0x49')](function(_0x3ec195){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec195);throw _0x3ec195;});}return _0xc583fc;})[_0xbabc('0x28')](respondWithResult(_0x388655,0xc9))[_0xbabc('0x49')](handleError(_0x388655,null));};exports['clone']=function(_0x2d5633,_0x333a0c){var _0x1711f4={'where':{'id':_0x2d5633[_0xbabc('0x4a')]['id']}},_0x1fd79e={};_0x1fd79e[_0xbabc('0x33')]=_['keys'](db[_0xbabc('0x31')]['rawAttributes']);_0x1711f4['attributes']=_[_0xbabc('0x37')](_0x1fd79e[_0xbabc('0x33')],qs[_0xbabc('0x39')](_0x2d5633['query'][_0xbabc('0x39')]));_0x1711f4[_0xbabc('0x38')]=_0x1711f4[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x1711f4[_0xbabc('0x38')]:_0x1fd79e['model'];if(_0x2d5633[_0xbabc('0x34')]['includeAll']){_0x1711f4[_0xbabc('0x46')]=[{'all':!![]}];}_0x1711f4=_[_0xbabc('0x41')]({},_0x1711f4,_0x2d5633[_0xbabc('0x44')]);return db[_0xbabc('0x31')][_0xbabc('0x4b')](_0x1711f4)[_0xbabc('0x28')](handleEntityNotFound(_0x333a0c,null))[_0xbabc('0x28')](function(_0xcaf93a){if(_0xcaf93a){var _0x44b0a2=_0xcaf93a[_0xbabc('0x2a')]({'plain':!![]});_0x44b0a2=qs['omit'](_0x44b0a2,['id','createdAt','updatedAt']);_0x2d5633[_0xbabc('0x4d')]=_[_0xbabc('0x50')](_0x2d5633['body'],['id',_0xbabc('0x51'),'updatedAt']);return db['Campaign']['create'](_['merge'](_0x44b0a2,_0x2d5633[_0xbabc('0x4d')]),{'include':_0x2d5633[_0xbabc('0x34')][_0xbabc('0x45')]?[{'all':!![]}]:undefined})[_0xbabc('0x28')](function(_0x56cca8){var _0x46a201=_0x2d5633['user'][_0xbabc('0x2a')]({'plain':!![]});if(!_0x46a201)throw new Error(_0xbabc('0x52'));if(_0x46a201['role']===_0xbabc('0x4e')){var _0x2e5cde=_0x56cca8[_0xbabc('0x2a')]({'plain':!![]});var _0x46dbb3=_0xbabc('0x2b');return db[_0xbabc('0x53')][_0xbabc('0x4b')]({'where':{'name':_0x46dbb3,'userProfileId':_0x46a201[_0xbabc('0x4f')]},'raw':!![]})[_0xbabc('0x28')](function(_0x4c575a){if(_0x4c575a&&_0x4c575a[_0xbabc('0x54')]===0x0){return db[_0xbabc('0x2c')][_0xbabc('0x4c')]({'name':_0x2e5cde[_0xbabc('0x2e')],'resourceId':_0x2e5cde['id'],'type':_0x4c575a[_0xbabc('0x2e')],'sectionId':_0x4c575a['id']},{})[_0xbabc('0x28')](function(){return _0x56cca8;});}else{return _0x56cca8;}})[_0xbabc('0x49')](function(_0x5e9dec){logger[_0xbabc('0x2d')](_0xbabc('0x55'),_0x5e9dec);throw _0x5e9dec;});}return _0x56cca8;});}})[_0xbabc('0x28')](respondWithResult(_0x333a0c,0xc9))[_0xbabc('0x49')](handleError(_0x333a0c,null));};exports[_0xbabc('0x27')]=function(_0x1b62c2,_0x262e1a){if(_0x1b62c2[_0xbabc('0x4d')]['id']){delete _0x1b62c2[_0xbabc('0x4d')]['id'];}return db[_0xbabc('0x31')][_0xbabc('0x4b')]({'where':{'id':_0x1b62c2[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x262e1a,null))['then'](saveUpdates(_0x1b62c2[_0xbabc('0x4d')],null))[_0xbabc('0x28')](respondWithResult(_0x262e1a,null))[_0xbabc('0x49')](handleError(_0x262e1a,null));};exports[_0xbabc('0x29')]=function(_0x284600,_0x44f69e){return db[_0xbabc('0x31')]['find']({'where':{'id':_0x284600[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x44f69e,null))[_0xbabc('0x28')](removeEntity(_0x44f69e,null))[_0xbabc('0x49')](handleError(_0x44f69e,null));};exports[_0xbabc('0x56')]=function(_0xe1afad,_0x3d9267,_0x2493f9){var _0x295c35={'raw':!![],'where':{}};var _0x411020={};var _0x62f2d3={'count':0x0,'rows':[]};return db[_0xbabc('0x31')][_0xbabc('0x57')]({'where':{'id':_0xe1afad['params']['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x3d9267,null))['then'](function(_0x1183ad){if(_0x1183ad){_0x411020[_0xbabc('0x33')]=_[_0xbabc('0x35')](db[_0xbabc('0x58')][_0xbabc('0x59')]);_0x411020[_0xbabc('0x34')]=_['keys'](_0xe1afad[_0xbabc('0x34')]);_0x411020[_0xbabc('0x36')]=_['intersection'](_0x411020[_0xbabc('0x33')],_0x411020['query']);_0x295c35[_0xbabc('0x38')]=_[_0xbabc('0x37')](_0x411020['model'],qs[_0xbabc('0x39')](_0xe1afad[_0xbabc('0x34')][_0xbabc('0x39')]));_0x295c35[_0xbabc('0x38')]=_0x295c35[_0xbabc('0x38')]['length']?_0x295c35[_0xbabc('0x38')]:_0x411020['model'];if(!_0xe1afad[_0xbabc('0x34')][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x295c35[_0xbabc('0x20')]=qs[_0xbabc('0x20')](_0xe1afad[_0xbabc('0x34')]['limit']);_0x295c35[_0xbabc('0x1e')]=qs[_0xbabc('0x1e')](_0xe1afad[_0xbabc('0x34')][_0xbabc('0x1e')]);}_0x295c35[_0xbabc('0x3d')]=qs['sort'](_0xe1afad[_0xbabc('0x34')]['sort']);_0x295c35[_0xbabc('0x3f')]=qs[_0xbabc('0x36')](_[_0xbabc('0x40')](_0xe1afad[_0xbabc('0x34')],_0x411020['filters']));_0x295c35['where']['CampaignId']=_0x1183ad['id'];if(_0xe1afad[_0xbabc('0x34')]['filter']){_0x295c35['where']=_[_0xbabc('0x41')](_0x295c35[_0xbabc('0x3f')],{'$or':_['map'](_0x295c35['attributes'],function(_0x23d28a){var _0x346cb2={};_0x346cb2[_0x23d28a]={'$like':'%'+_0xe1afad[_0xbabc('0x34')][_0xbabc('0x43')]+'%'};return _0x346cb2;})});}_0x295c35=_[_0xbabc('0x41')]({},_0x295c35,_0xe1afad['options']);return db[_0xbabc('0x58')][_0xbabc('0x21')]({'where':_0x295c35[_0xbabc('0x3f')]})[_0xbabc('0x28')](function(_0x3a4e8b){_0x62f2d3[_0xbabc('0x21')]=_0x3a4e8b;if(_0xe1afad[_0xbabc('0x34')][_0xbabc('0x45')]){_0x295c35[_0xbabc('0x46')]=[{'all':!![]}];}return db[_0xbabc('0x58')][_0xbabc('0x47')](_0x295c35);})[_0xbabc('0x28')](function(_0x256599){_0x62f2d3['rows']=_0x256599;return _0x62f2d3;});}})[_0xbabc('0x28')](respondWithFilteredResult(_0x3d9267,_0x295c35))[_0xbabc('0x49')](handleError(_0x3d9267,null));};exports[_0xbabc('0x5a')]=function(_0x5c5cf8,_0x22c90d,_0x2711b8){var _0x180cf5={'raw':!![],'where':{}};var _0x4ffb28={};var _0x367e7a={'count':0x0,'rows':[]};return db[_0xbabc('0x31')][_0xbabc('0x57')]({'where':{'id':_0x5c5cf8['params']['id']}})['then'](handleEntityNotFound(_0x22c90d,null))[_0xbabc('0x28')](function(_0x58a5b6){if(_0x58a5b6){_0x4ffb28['model']=_['keys'](db[_0xbabc('0x5b')]['rawAttributes']);_0x4ffb28['query']=_['keys'](_0x5c5cf8['query']);_0x4ffb28[_0xbabc('0x36')]=_[_0xbabc('0x37')](_0x4ffb28[_0xbabc('0x33')],_0x4ffb28[_0xbabc('0x34')]);_0x180cf5[_0xbabc('0x38')]=_[_0xbabc('0x37')](_0x4ffb28[_0xbabc('0x33')],qs[_0xbabc('0x39')](_0x5c5cf8[_0xbabc('0x34')][_0xbabc('0x39')]));_0x180cf5[_0xbabc('0x38')]=_0x180cf5[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x180cf5[_0xbabc('0x38')]:_0x4ffb28[_0xbabc('0x33')];if(!_0x5c5cf8[_0xbabc('0x34')]['hasOwnProperty'](_0xbabc('0x3c'))){_0x180cf5[_0xbabc('0x20')]=qs['limit'](_0x5c5cf8[_0xbabc('0x34')]['limit']);_0x180cf5['offset']=qs[_0xbabc('0x1e')](_0x5c5cf8[_0xbabc('0x34')][_0xbabc('0x1e')]);}_0x180cf5[_0xbabc('0x3d')]=qs['sort'](_0x5c5cf8[_0xbabc('0x34')][_0xbabc('0x3e')]);_0x180cf5[_0xbabc('0x3f')]=qs[_0xbabc('0x36')](_[_0xbabc('0x40')](_0x5c5cf8[_0xbabc('0x34')],_0x4ffb28[_0xbabc('0x36')]));_0x180cf5[_0xbabc('0x3f')][_0xbabc('0x5c')]=_0x58a5b6['id'];if(_0x5c5cf8[_0xbabc('0x34')]['filter']){_0x180cf5[_0xbabc('0x3f')]=_['merge'](_0x180cf5['where'],{'$or':_['map'](_0x180cf5[_0xbabc('0x38')],function(_0x347a15){var _0x256526={};_0x256526[_0x347a15]={'$like':'%'+_0x5c5cf8[_0xbabc('0x34')][_0xbabc('0x43')]+'%'};return _0x256526;})});}_0x180cf5=_['merge']({},_0x180cf5,_0x5c5cf8['options']);return db[_0xbabc('0x5b')][_0xbabc('0x21')]({'where':_0x180cf5[_0xbabc('0x3f')]})[_0xbabc('0x28')](function(_0x53a811){_0x367e7a['count']=_0x53a811;if(_0x5c5cf8[_0xbabc('0x34')][_0xbabc('0x45')]){_0x180cf5[_0xbabc('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xbabc('0x47')](_0x180cf5);})[_0xbabc('0x28')](function(_0x2d26a7){_0x367e7a[_0xbabc('0x48')]=_0x2d26a7;return _0x367e7a;});}})[_0xbabc('0x28')](respondWithFilteredResult(_0x22c90d,_0x180cf5))[_0xbabc('0x49')](handleError(_0x22c90d,null));};exports[_0xbabc('0x5d')]=function(_0x57b4d9,_0x3ee772,_0x559d9a){var _0x4d1142={'raw':!![],'where':{}};var _0x402383={};var _0x140767={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x57b4d9[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x3ee772,null))['then'](function(_0x3b9246){if(_0x3b9246){_0x402383['model']=_[_0xbabc('0x35')](db['CmHopperFinal'][_0xbabc('0x59')]);_0x402383[_0xbabc('0x34')]=_[_0xbabc('0x35')](_0x57b4d9[_0xbabc('0x34')]);_0x402383['filters']=_[_0xbabc('0x37')](_0x402383[_0xbabc('0x33')],_0x402383[_0xbabc('0x34')]);_0x4d1142['attributes']=_[_0xbabc('0x37')](_0x402383['model'],qs[_0xbabc('0x39')](_0x57b4d9[_0xbabc('0x34')][_0xbabc('0x39')]));_0x4d1142['attributes']=_0x4d1142[_0xbabc('0x38')]['length']?_0x4d1142[_0xbabc('0x38')]:_0x402383[_0xbabc('0x33')];if(!_0x57b4d9[_0xbabc('0x34')][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x4d1142[_0xbabc('0x20')]=qs[_0xbabc('0x20')](_0x57b4d9[_0xbabc('0x34')][_0xbabc('0x20')]);_0x4d1142[_0xbabc('0x1e')]=qs[_0xbabc('0x1e')](_0x57b4d9[_0xbabc('0x34')][_0xbabc('0x1e')]);}_0x4d1142['order']=qs[_0xbabc('0x3e')](_0x57b4d9['query']['sort']);_0x4d1142[_0xbabc('0x3f')]=qs[_0xbabc('0x36')](_['pick'](_0x57b4d9[_0xbabc('0x34')],_0x402383[_0xbabc('0x36')]));_0x4d1142[_0xbabc('0x3f')][_0xbabc('0x5c')]=_0x3b9246['id'];if(_0x57b4d9['query']['filter']){_0x4d1142[_0xbabc('0x3f')]=_[_0xbabc('0x41')](_0x4d1142[_0xbabc('0x3f')],{'$or':_['map'](_0x4d1142[_0xbabc('0x38')],function(_0x44d85e){var _0x3711d0={};_0x3711d0[_0x44d85e]={'$like':'%'+_0x57b4d9[_0xbabc('0x34')]['filter']+'%'};return _0x3711d0;})});}_0x4d1142=_[_0xbabc('0x41')]({},_0x4d1142,_0x57b4d9['options']);return db['CmHopperFinal'][_0xbabc('0x21')]({'where':_0x4d1142[_0xbabc('0x3f')]})[_0xbabc('0x28')](function(_0x217874){_0x140767[_0xbabc('0x21')]=_0x217874;if(_0x57b4d9[_0xbabc('0x34')][_0xbabc('0x45')]){_0x4d1142['include']=[{'all':!![]}];}return db[_0xbabc('0x5e')][_0xbabc('0x47')](_0x4d1142);})[_0xbabc('0x28')](function(_0x59739f){_0x140767[_0xbabc('0x48')]=_0x59739f;return _0x140767;});}})[_0xbabc('0x28')](respondWithFilteredResult(_0x3ee772,_0x4d1142))[_0xbabc('0x49')](handleError(_0x3ee772,null));};exports[_0xbabc('0x5f')]=function(_0x25a134,_0x22a97e,_0x3141c1){var _0x26efc8={'raw':!![],'where':{}};var _0x4c13ce={};var _0x4e4442={'count':0x0,'rows':[]};return db[_0xbabc('0x31')][_0xbabc('0x57')]({'where':{'id':_0x25a134[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x22a97e,null))[_0xbabc('0x28')](function(_0x1c71d0){if(_0x1c71d0){_0x4c13ce[_0xbabc('0x33')]=_['keys'](db[_0xbabc('0x60')]['rawAttributes']);_0x4c13ce[_0xbabc('0x34')]=_[_0xbabc('0x35')](_0x25a134[_0xbabc('0x34')]);_0x4c13ce['filters']=_[_0xbabc('0x37')](_0x4c13ce['model'],_0x4c13ce[_0xbabc('0x34')]);_0x26efc8[_0xbabc('0x38')]=_['intersection'](_0x4c13ce[_0xbabc('0x33')],qs['fields'](_0x25a134[_0xbabc('0x34')][_0xbabc('0x39')]));_0x26efc8[_0xbabc('0x38')]=_0x26efc8[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x26efc8['attributes']:_0x4c13ce[_0xbabc('0x33')];if(!_0x25a134[_0xbabc('0x34')][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x26efc8[_0xbabc('0x20')]=qs[_0xbabc('0x20')](_0x25a134[_0xbabc('0x34')]['limit']);_0x26efc8['offset']=qs['offset'](_0x25a134[_0xbabc('0x34')][_0xbabc('0x1e')]);}_0x26efc8[_0xbabc('0x3d')]=qs[_0xbabc('0x3e')](_0x25a134[_0xbabc('0x34')][_0xbabc('0x3e')]);_0x26efc8[_0xbabc('0x3f')]=qs[_0xbabc('0x36')](_[_0xbabc('0x40')](_0x25a134['query'],_0x4c13ce[_0xbabc('0x36')]));_0x26efc8[_0xbabc('0x3f')][_0xbabc('0x5c')]=_0x1c71d0['id'];if(_0x25a134[_0xbabc('0x34')][_0xbabc('0x43')]){_0x26efc8[_0xbabc('0x3f')]=_['merge'](_0x26efc8[_0xbabc('0x3f')],{'$or':_[_0xbabc('0x42')](_0x26efc8['attributes'],function(_0x27c342){var _0x445458={};_0x445458[_0x27c342]={'$like':'%'+_0x25a134[_0xbabc('0x34')]['filter']+'%'};return _0x445458;})});}_0x26efc8=_['merge']({},_0x26efc8,_0x25a134[_0xbabc('0x44')]);return db['CmHopperBlack'][_0xbabc('0x21')]({'where':_0x26efc8[_0xbabc('0x3f')]})[_0xbabc('0x28')](function(_0x44e782){_0x4e4442[_0xbabc('0x21')]=_0x44e782;if(_0x25a134[_0xbabc('0x34')][_0xbabc('0x45')]){_0x26efc8['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xbabc('0x47')](_0x26efc8);})[_0xbabc('0x28')](function(_0x55bedd){_0x4e4442[_0xbabc('0x48')]=_0x55bedd;return _0x4e4442;});}})['then'](respondWithFilteredResult(_0x22a97e,_0x26efc8))['catch'](handleError(_0x22a97e,null));};exports[_0xbabc('0x61')]=function(_0x53bc8a,_0x945f4b,_0x467aab){var _0x1d3dc3={};var _0x591df7={};var _0x2c617d;var _0x3a5b8a;return db[_0xbabc('0x31')][_0xbabc('0x57')]({'where':{'id':_0x53bc8a[_0xbabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x945f4b,null))[_0xbabc('0x28')](function(_0x277270){if(_0x277270){_0x2c617d=_0x277270;_0x591df7[_0xbabc('0x33')]=_[_0xbabc('0x35')](db[_0xbabc('0x62')][_0xbabc('0x59')]);_0x591df7[_0xbabc('0x34')]=_[_0xbabc('0x35')](_0x53bc8a[_0xbabc('0x34')]);_0x591df7[_0xbabc('0x36')]=_[_0xbabc('0x37')](_0x591df7['model'],_0x591df7[_0xbabc('0x34')]);_0x1d3dc3[_0xbabc('0x38')]=_[_0xbabc('0x37')](_0x591df7['model'],qs[_0xbabc('0x39')](_0x53bc8a['query'][_0xbabc('0x39')]));_0x1d3dc3[_0xbabc('0x38')]=_0x1d3dc3[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x1d3dc3[_0xbabc('0x38')]:_0x591df7['model'];_0x1d3dc3[_0xbabc('0x3d')]=qs[_0xbabc('0x3e')](_0x53bc8a[_0xbabc('0x34')][_0xbabc('0x3e')]);_0x1d3dc3[_0xbabc('0x3f')]=qs[_0xbabc('0x36')](_[_0xbabc('0x40')](_0x53bc8a['query'],_0x591df7[_0xbabc('0x36')]));if(_0x53bc8a[_0xbabc('0x34')][_0xbabc('0x43')]){_0x1d3dc3['where']=_['merge'](_0x1d3dc3['where'],{'$or':_[_0xbabc('0x42')](_0x1d3dc3[_0xbabc('0x38')],function(_0x252791){var _0x511367={};_0x511367[_0x252791]={'$like':'%'+_0x53bc8a[_0xbabc('0x34')][_0xbabc('0x43')]+'%'};return _0x511367;})});}_0x1d3dc3=_[_0xbabc('0x41')]({},_0x1d3dc3,_0x53bc8a[_0xbabc('0x44')]);return _0x2c617d['getLists'](_0x1d3dc3);}})[_0xbabc('0x28')](function(_0x4fffdd){if(_0x4fffdd){_0x3a5b8a=_0x4fffdd['length'];if(!_0x53bc8a['query'][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x1d3dc3['limit']=qs[_0xbabc('0x20')](_0x53bc8a[_0xbabc('0x34')][_0xbabc('0x20')]);_0x1d3dc3['offset']=qs[_0xbabc('0x1e')](_0x53bc8a[_0xbabc('0x34')]['offset']);}return _0x2c617d[_0xbabc('0x61')](_0x1d3dc3);}})[_0xbabc('0x28')](function(_0x5770d1){if(_0x5770d1){return _0x5770d1?{'count':_0x3a5b8a,'rows':_0x5770d1}:null;}})['then'](respondWithResult(_0x945f4b,null))[_0xbabc('0x49')](handleError(_0x945f4b,null));};exports['addLists']=function(_0x389ae3,_0x1eff7f,_0x219d25){var _0x96aa14,_0x46f4cd;return db[_0xbabc('0x31')][_0xbabc('0x4b')]({'where':{'id':_0x389ae3['params']['id']}})['then'](handleEntityNotFound(_0x1eff7f,null))[_0xbabc('0x28')](function(_0x392030){if(_0x392030){_0x46f4cd=_0x392030;return _0x392030['addLists'](_0x389ae3[_0xbabc('0x4d')][_0xbabc('0x63')],_[_0xbabc('0x50')](_0x389ae3[_0xbabc('0x4d')],[_0xbabc('0x63'),'id'])||{});}return null;})[_0xbabc('0x64')](function(_0x4146d7){var _0x55ac25;_0x96aa14=_0x4146d7||[];var _0xf14867=[];if(_0x4146d7){for(var _0x56ace2=0x0;_0x56ace2<_0x4146d7[_0xbabc('0x3a')];_0x56ace2+=0x1){var _0x27002c=_0x4146d7[_0x56ace2]['get']({'plain':!![]});_0x46f4cd['dialCheckDuplicateType']=_0x389ae3[_0xbabc('0x4d')][_0xbabc('0x65')]?_0x389ae3[_0xbabc('0x4d')]['dialCheckDuplicateType']:_0x46f4cd[_0xbabc('0x65')];switch(_0x46f4cd[_0xbabc('0x65')]){case _0xbabc('0x66'):_0x55ac25=squel['insert']()[_0xbabc('0x67')](_0xbabc('0x68'))['fromQuery']([_0xbabc('0x69'),_0xbabc('0x6a'),_0xbabc('0x6b'),_0xbabc('0x6c'),_0xbabc('0x5c'),_0xbabc('0x51'),_0xbabc('0x6d')],squel[_0xbabc('0x6e')]()[_0xbabc('0x6f')](_0xbabc('0x69'),_0xbabc('0x69'))[_0xbabc('0x6f')](_0xbabc('0x70'),'scheduledAt')[_0xbabc('0x6f')]('id',_0xbabc('0x6b'))[_0xbabc('0x6f')](_0x27002c[_0xbabc('0x71')]['toString'](),'ListId')[_0xbabc('0x6f')](_0x389ae3[_0xbabc('0x4a')]['id'][_0xbabc('0x72')](),_0xbabc('0x5c'))[_0xbabc('0x6f')](_0xbabc('0x70'),_0xbabc('0x51'))['field'](_0xbabc('0x70'),_0xbabc('0x6d'))[_0xbabc('0x73')](_0xbabc('0x74'))[_0xbabc('0x3f')](_0xbabc('0x75'))['where'](_0xbabc('0x76'),_0x27002c[_0xbabc('0x71')][_0xbabc('0x72')]())[_0xbabc('0x3f')](_0xbabc('0x77'))[_0xbabc('0x3f')](_0xbabc('0x78'),squel[_0xbabc('0x6e')]()[_0xbabc('0x6f')](_0xbabc('0x79'))['from'](_0xbabc('0x7a'))['where'](_0xbabc('0x7b'),_0x389ae3[_0xbabc('0x4a')]['id'][_0xbabc('0x72')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xbabc('0x6e')]()[_0xbabc('0x6f')]('COALESCE(phone,\x27\x27)')[_0xbabc('0x73')]('cm_hopper')['where'](_0xbabc('0x7b'),_0x389ae3[_0xbabc('0x4a')]['id']['toString']())))[_0xbabc('0x72')]();break;case _0xbabc('0x7c'):_0x55ac25=squel[_0xbabc('0x7d')]()['into'](_0xbabc('0x68'))[_0xbabc('0x7e')]([_0xbabc('0x69'),'scheduledAt',_0xbabc('0x6b'),_0xbabc('0x6c'),'CampaignId',_0xbabc('0x51'),'updatedAt'],squel[_0xbabc('0x6e')]()[_0xbabc('0x6f')](_0xbabc('0x69'),_0xbabc('0x69'))[_0xbabc('0x6f')]('NOW()',_0xbabc('0x6a'))[_0xbabc('0x6f')]('id',_0xbabc('0x6b'))[_0xbabc('0x6f')](_0x27002c[_0xbabc('0x71')][_0xbabc('0x72')](),_0xbabc('0x6c'))[_0xbabc('0x6f')](_0x389ae3[_0xbabc('0x4a')]['id'][_0xbabc('0x72')](),_0xbabc('0x5c'))[_0xbabc('0x6f')](_0xbabc('0x70'),_0xbabc('0x51'))[_0xbabc('0x6f')]('NOW()','updatedAt')[_0xbabc('0x73')](_0xbabc('0x74'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xbabc('0x76'),_0x27002c['CmListId'][_0xbabc('0x72')]())[_0xbabc('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xbabc('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xbabc('0x7f'))[_0xbabc('0x73')](_0xbabc('0x68'))[_0xbabc('0x3f')](_0xbabc('0x7b'),_0x389ae3[_0xbabc('0x4a')]['id']['toString']())))[_0xbabc('0x72')]();break;default:_0x55ac25=squel[_0xbabc('0x7d')]()[_0xbabc('0x67')]('cm_hopper')[_0xbabc('0x7e')]([_0xbabc('0x69'),_0xbabc('0x6a'),_0xbabc('0x6b'),_0xbabc('0x6c'),_0xbabc('0x5c'),_0xbabc('0x51'),_0xbabc('0x6d')],squel[_0xbabc('0x6e')]()['field'](_0xbabc('0x69'),_0xbabc('0x69'))['field'](_0xbabc('0x70'),_0xbabc('0x6a'))[_0xbabc('0x6f')]('id',_0xbabc('0x6b'))[_0xbabc('0x6f')](_0x27002c[_0xbabc('0x71')][_0xbabc('0x72')](),_0xbabc('0x6c'))['field'](_0x389ae3['params']['id'][_0xbabc('0x72')](),_0xbabc('0x5c'))[_0xbabc('0x6f')](_0xbabc('0x70'),_0xbabc('0x51'))[_0xbabc('0x6f')]('NOW()','updatedAt')[_0xbabc('0x73')](_0xbabc('0x74'))[_0xbabc('0x3f')](_0xbabc('0x75'))[_0xbabc('0x3f')](_0xbabc('0x76'),_0x27002c[_0xbabc('0x71')][_0xbabc('0x72')]())['where'](_0xbabc('0x77')))['toString']();}_0xf14867[_0xbabc('0x80')](db[_0xbabc('0x81')][_0xbabc('0x34')](_0x55ac25));}return BPromise[_0xbabc('0x82')](_0xf14867);}})[_0xbabc('0x28')](function(){return _0x96aa14;})['then'](respondWithResult(_0x1eff7f,null))[_0xbabc('0x49')](handleError(_0x1eff7f,null));};exports[_0xbabc('0x83')]=function(_0x29be87,_0x24b186,_0x5393f8){return db[_0xbabc('0x31')][_0xbabc('0x4b')]({'where':{'id':_0x29be87[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x24b186,null))['then'](function(_0x54f619){if(_0x54f619){return _0x54f619[_0xbabc('0x83')](_0x29be87[_0xbabc('0x34')][_0xbabc('0x63')]);}})[_0xbabc('0x28')](function(_0x54c14b){if(_0x54c14b){return db['CmHopper'][_0xbabc('0x29')]({'where':{'ListId':_0x29be87[_0xbabc('0x34')][_0xbabc('0x63')],'CampaignId':_0x29be87[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](function(){return _0x54c14b;});}})[_0xbabc('0x28')](respondWithStatusCode(_0x24b186,null))['catch'](handleError(_0x24b186,null));};exports[_0xbabc('0x84')]=function(_0x1aad9d,_0xc4c262,_0x1de453){var _0x12b9a7={};var _0x3564f4={};var _0x63bd6e;var _0x1d8cbd;return db['Campaign'][_0xbabc('0x57')]({'where':{'id':_0x1aad9d[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0xc4c262,null))[_0xbabc('0x28')](function(_0x5a1e5c){if(_0x5a1e5c){_0x63bd6e=_0x5a1e5c;_0x3564f4[_0xbabc('0x33')]=_[_0xbabc('0x35')](db[_0xbabc('0x62')][_0xbabc('0x59')]);_0x3564f4[_0xbabc('0x34')]=_[_0xbabc('0x35')](_0x1aad9d[_0xbabc('0x34')]);_0x3564f4['filters']=_[_0xbabc('0x37')](_0x3564f4[_0xbabc('0x33')],_0x3564f4[_0xbabc('0x34')]);_0x12b9a7[_0xbabc('0x38')]=_[_0xbabc('0x37')](_0x3564f4[_0xbabc('0x33')],qs['fields'](_0x1aad9d[_0xbabc('0x34')][_0xbabc('0x39')]));_0x12b9a7[_0xbabc('0x38')]=_0x12b9a7[_0xbabc('0x38')][_0xbabc('0x3a')]?_0x12b9a7[_0xbabc('0x38')]:_0x3564f4[_0xbabc('0x33')];_0x12b9a7['order']=qs[_0xbabc('0x3e')](_0x1aad9d[_0xbabc('0x34')][_0xbabc('0x3e')]);_0x12b9a7[_0xbabc('0x3f')]=qs['filters'](_[_0xbabc('0x40')](_0x1aad9d[_0xbabc('0x34')],_0x3564f4[_0xbabc('0x36')]));if(_0x1aad9d[_0xbabc('0x34')][_0xbabc('0x43')]){_0x12b9a7[_0xbabc('0x3f')]=_[_0xbabc('0x41')](_0x12b9a7[_0xbabc('0x3f')],{'$or':_['map'](_0x12b9a7['attributes'],function(_0x4e799d){var _0x5c7074={};_0x5c7074[_0x4e799d]={'$like':'%'+_0x1aad9d[_0xbabc('0x34')]['filter']+'%'};return _0x5c7074;})});}_0x12b9a7=_[_0xbabc('0x41')]({},_0x12b9a7,_0x1aad9d[_0xbabc('0x44')]);return _0x63bd6e[_0xbabc('0x84')](_0x12b9a7);}})['then'](function(_0x1f0e0c){if(_0x1f0e0c){_0x1d8cbd=_0x1f0e0c[_0xbabc('0x3a')];if(!_0x1aad9d[_0xbabc('0x34')][_0xbabc('0x3b')](_0xbabc('0x3c'))){_0x12b9a7[_0xbabc('0x20')]=qs[_0xbabc('0x20')](_0x1aad9d['query'][_0xbabc('0x20')]);_0x12b9a7['offset']=qs['offset'](_0x1aad9d[_0xbabc('0x34')][_0xbabc('0x1e')]);}return _0x63bd6e[_0xbabc('0x84')](_0x12b9a7);}})[_0xbabc('0x28')](function(_0x4a2ff1){if(_0x4a2ff1){return _0x4a2ff1?{'count':_0x1d8cbd,'rows':_0x4a2ff1}:null;}})[_0xbabc('0x28')](respondWithResult(_0xc4c262,null))[_0xbabc('0x49')](handleError(_0xc4c262,null));};exports['addBlackLists']=function(_0x14e1a6,_0x89ad86,_0x29c1c3){var _0x39625d,_0x24193a;return db[_0xbabc('0x31')]['find']({'where':{'id':_0x14e1a6['params']['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x89ad86,null))[_0xbabc('0x28')](function(_0x58a0bc){if(_0x58a0bc){_0x24193a=_0x58a0bc;return _0x58a0bc[_0xbabc('0x85')](_0x14e1a6[_0xbabc('0x4d')][_0xbabc('0x63')],_['omit'](_0x14e1a6[_0xbabc('0x4d')],[_0xbabc('0x63'),'id'])||{});}return null;})['spread'](function(_0x311885){var _0x590fc6;_0x39625d=_0x311885||[];var _0x30a997=[];if(_0x311885){for(var _0x49101f=0x0;_0x49101f<_0x311885[_0xbabc('0x3a')];_0x49101f+=0x1){var _0x468180=_0x311885[_0x49101f][_0xbabc('0x2a')]({'plain':!![]});_0x590fc6=squel[_0xbabc('0x7d')]()[_0xbabc('0x67')](_0xbabc('0x86'))[_0xbabc('0x7e')]([_0xbabc('0x69'),_0xbabc('0x6b'),_0xbabc('0x6c'),_0xbabc('0x5c'),_0xbabc('0x51'),_0xbabc('0x6d')],squel[_0xbabc('0x6e')]()[_0xbabc('0x6f')](_0xbabc('0x69'),_0xbabc('0x69'))[_0xbabc('0x6f')]('id',_0xbabc('0x6b'))[_0xbabc('0x6f')](_0x468180[_0xbabc('0x71')]['toString'](),_0xbabc('0x6c'))['field'](_0x14e1a6['params']['id'][_0xbabc('0x72')](),_0xbabc('0x5c'))[_0xbabc('0x6f')]('NOW()','createdAt')[_0xbabc('0x6f')](_0xbabc('0x70'),'updatedAt')[_0xbabc('0x73')](_0xbabc('0x74'))[_0xbabc('0x3f')](_0xbabc('0x75'))[_0xbabc('0x3f')](_0xbabc('0x76'),_0x468180[_0xbabc('0x71')][_0xbabc('0x72')]())[_0xbabc('0x3f')](_0xbabc('0x77')))['toString']();_0x30a997[_0xbabc('0x80')](db[_0xbabc('0x81')]['query'](_0x590fc6));}return BPromise[_0xbabc('0x82')](_0x30a997);}})['then'](function(){return _0x39625d;})[_0xbabc('0x28')](respondWithResult(_0x89ad86,null))[_0xbabc('0x49')](handleError(_0x89ad86,null));};exports[_0xbabc('0x87')]=function(_0x221986,_0x4111c3,_0xbc4c5b){return db[_0xbabc('0x31')]['find']({'where':{'id':_0x221986[_0xbabc('0x4a')]['id']}})[_0xbabc('0x28')](handleEntityNotFound(_0x4111c3,null))[_0xbabc('0x28')](function(_0x36e883){if(_0x36e883){return _0x36e883['removeBlackLists'](_0x221986[_0xbabc('0x34')][_0xbabc('0x63')]);}})['then'](function(_0x2f94e1){if(_0x2f94e1){return db[_0xbabc('0x60')][_0xbabc('0x29')]({'where':{'ListId':_0x221986[_0xbabc('0x34')][_0xbabc('0x63')],'CampaignId':_0x221986[_0xbabc('0x4a')]['id']}})['then'](function(){return _0x2f94e1;});}})[_0xbabc('0x28')](respondWithStatusCode(_0x4111c3,null))['catch'](handleError(_0x4111c3,null));};
\ No newline at end of file
+var _0xca42=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','Campaign','includeAll','include','findAll','rows','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xca42,0xb5));var _0x2ca4=function(_0x5d3d5e,_0x35668b){_0x5d3d5e=_0x5d3d5e-0x0;var _0x7d41ad=_0xca42[_0x5d3d5e];return _0x7d41ad;};'use strict';var emlformat=require(_0x2ca4('0x0'));var rimraf=require(_0x2ca4('0x1'));var zipdir=require(_0x2ca4('0x2'));var jsonpatch=require(_0x2ca4('0x3'));var rp=require(_0x2ca4('0x4'));var moment=require(_0x2ca4('0x5'));var BPromise=require(_0x2ca4('0x6'));var Mustache=require(_0x2ca4('0x7'));var util=require(_0x2ca4('0x8'));var path=require(_0x2ca4('0x9'));var sox=require(_0x2ca4('0xa'));var csv=require(_0x2ca4('0xb'));var ejs=require(_0x2ca4('0xc'));var fs=require('fs');var fs_extra=require(_0x2ca4('0xd'));var _=require(_0x2ca4('0xe'));var squel=require(_0x2ca4('0xf'));var crypto=require(_0x2ca4('0x10'));var jsforce=require(_0x2ca4('0x11'));var deskjs=require(_0x2ca4('0x12'));var toCsv=require(_0x2ca4('0xb'));var querystring=require(_0x2ca4('0x13'));var Papa=require(_0x2ca4('0x14'));var Redis=require(_0x2ca4('0x15'));var authService=require(_0x2ca4('0x16'));var qs=require(_0x2ca4('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ca4('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x2ca4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2ca4('0x1a'));var db=require(_0x2ca4('0x1b'))['db'];function respondWithStatusCode(_0x162077,_0x18b8f1){_0x18b8f1=_0x18b8f1||0xcc;return function(_0x40ce05){if(_0x40ce05){return _0x162077[_0x2ca4('0x1c')](_0x18b8f1);}return _0x162077[_0x2ca4('0x1d')](_0x18b8f1)[_0x2ca4('0x1e')]();};}function respondWithResult(_0x1e3e2e,_0x53bb94){_0x53bb94=_0x53bb94||0xc8;return function(_0x1efb78){if(_0x1efb78){return _0x1e3e2e[_0x2ca4('0x1d')](_0x53bb94)[_0x2ca4('0x1f')](_0x1efb78);}};}function respondWithFilteredResult(_0x52ffab,_0x4ebd84){return function(_0x2b78ea){if(_0x2b78ea){var _0x3e0b65=typeof _0x4ebd84['offset']==='undefined'&&typeof _0x4ebd84['limit']===_0x2ca4('0x20');var _0x555b3d=_0x2b78ea[_0x2ca4('0x21')];var _0x6799ef=_0x3e0b65?0x0:_0x4ebd84[_0x2ca4('0x22')];var _0x38cb92=_0x3e0b65?_0x2b78ea['count']:_0x4ebd84[_0x2ca4('0x22')]+_0x4ebd84['limit'];var _0x587f43;if(_0x38cb92>=_0x555b3d){_0x38cb92=_0x555b3d;_0x587f43=0xc8;}else{_0x587f43=0xce;}_0x52ffab[_0x2ca4('0x1d')](_0x587f43);return _0x52ffab[_0x2ca4('0x23')](_0x2ca4('0x24'),_0x6799ef+'-'+_0x38cb92+'/'+_0x555b3d)['json'](_0x2b78ea);}return null;};}function patchUpdates(_0x3ca6a3){return function(_0x68108c){try{jsonpatch[_0x2ca4('0x25')](_0x68108c,_0x3ca6a3,!![]);}catch(_0x1e05ed){return BPromise[_0x2ca4('0x26')](_0x1e05ed);}return _0x68108c[_0x2ca4('0x27')]();};}function saveUpdates(_0x342153,_0x48feb8){return function(_0x249579){if(_0x249579){return _0x249579[_0x2ca4('0x28')](_0x342153)['then'](function(_0x19f4fa){return _0x19f4fa;});}return null;};}function removeEntity(_0x3c306e,_0xa83724){return function(_0xf03748){if(_0xf03748){return _0xf03748[_0x2ca4('0x29')]()[_0x2ca4('0x2a')](function(){var _0xe99d1e=_0xf03748[_0x2ca4('0x2b')]({'plain':!![]});var _0x5d1638=_0x2ca4('0x2c');return db[_0x2ca4('0x2d')]['destroy']({'where':{'type':_0x5d1638,'resourceId':_0xe99d1e['id']}})['then'](function(){return _0xf03748;});})[_0x2ca4('0x2a')](function(){_0x3c306e[_0x2ca4('0x1d')](0xcc)[_0x2ca4('0x1e')]();});}};}function handleEntityNotFound(_0x105c34,_0x1e404c){return function(_0x501875){if(!_0x501875){_0x105c34[_0x2ca4('0x1c')](0x194);}return _0x501875;};}function handleError(_0x18437f,_0x4a7bde){_0x4a7bde=_0x4a7bde||0x1f4;return function(_0x1bfc29){logger['error'](_0x1bfc29['stack']);if(_0x1bfc29[_0x2ca4('0x2e')]){delete _0x1bfc29[_0x2ca4('0x2e')];}_0x18437f[_0x2ca4('0x1d')](_0x4a7bde)[_0x2ca4('0x2f')](_0x1bfc29);};}exports[_0x2ca4('0x30')]=function(_0x449c2c,_0x2ac748){var _0x2ea567={},_0x1a95ed={},_0x4b935d={'count':0x0,'rows':[]};var _0x4c6529=_[_0x2ca4('0x31')](db['Campaign'][_0x2ca4('0x32')],function(_0x1aa6da){return{'name':_0x1aa6da[_0x2ca4('0x33')],'type':_0x1aa6da[_0x2ca4('0x34')]['key']};});_0x1a95ed[_0x2ca4('0x35')]=_[_0x2ca4('0x31')](_0x4c6529,_0x2ca4('0x2e'));_0x1a95ed[_0x2ca4('0x36')]=_['keys'](_0x449c2c[_0x2ca4('0x36')]);_0x1a95ed['filters']=_[_0x2ca4('0x37')](_0x1a95ed[_0x2ca4('0x35')],_0x1a95ed[_0x2ca4('0x36')]);_0x2ea567[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x1a95ed[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x449c2c[_0x2ca4('0x36')]['fields']));_0x2ea567[_0x2ca4('0x38')]=_0x2ea567[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x2ea567[_0x2ca4('0x38')]:_0x1a95ed[_0x2ca4('0x35')];if(!_0x449c2c[_0x2ca4('0x36')][_0x2ca4('0x3b')](_0x2ca4('0x3c'))){_0x2ea567[_0x2ca4('0x3d')]=qs[_0x2ca4('0x3d')](_0x449c2c['query'][_0x2ca4('0x3d')]);_0x2ea567[_0x2ca4('0x22')]=qs[_0x2ca4('0x22')](_0x449c2c['query']['offset']);}_0x2ea567[_0x2ca4('0x3e')]=qs['sort'](_0x449c2c['query'][_0x2ca4('0x3f')]);_0x2ea567[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_[_0x2ca4('0x42')](_0x449c2c[_0x2ca4('0x36')],_0x1a95ed[_0x2ca4('0x41')]),_0x4c6529);if(_0x449c2c['query'][_0x2ca4('0x43')]){_0x2ea567['where']=_['merge'](_0x2ea567[_0x2ca4('0x40')],{'$or':_[_0x2ca4('0x31')](_0x4c6529,function(_0x4d49c8){if(_0x4d49c8[_0x2ca4('0x34')]!==_0x2ca4('0x44')){var _0x4d7167={};_0x4d7167[_0x4d49c8[_0x2ca4('0x2e')]]={'$like':'%'+_0x449c2c[_0x2ca4('0x36')][_0x2ca4('0x43')]+'%'};return _0x4d7167;}})});}_0x2ea567=_[_0x2ca4('0x45')]({},_0x2ea567,_0x449c2c[_0x2ca4('0x46')]);var _0x338f9a={'where':_0x2ea567['where']};return db[_0x2ca4('0x47')][_0x2ca4('0x21')](_0x338f9a)[_0x2ca4('0x2a')](function(_0x51496e){_0x4b935d['count']=_0x51496e;if(_0x449c2c[_0x2ca4('0x36')][_0x2ca4('0x48')]){_0x2ea567[_0x2ca4('0x49')]=[{'all':!![]}];}return db[_0x2ca4('0x47')][_0x2ca4('0x4a')](_0x2ea567);})[_0x2ca4('0x2a')](function(_0x106ace){_0x4b935d[_0x2ca4('0x4b')]=_0x106ace;return _0x4b935d;})[_0x2ca4('0x2a')](respondWithFilteredResult(_0x2ac748,_0x2ea567))['catch'](handleError(_0x2ac748,null));};exports['show']=function(_0x4997dc,_0x528c67){var _0x53a8b6={'raw':![],'where':{'id':_0x4997dc[_0x2ca4('0x4c')]['id']}},_0x81b5e8={};_0x81b5e8[_0x2ca4('0x35')]=_['keys'](db[_0x2ca4('0x47')]['rawAttributes']);_0x81b5e8['query']=_[_0x2ca4('0x4d')](_0x4997dc[_0x2ca4('0x36')]);_0x81b5e8[_0x2ca4('0x41')]=_[_0x2ca4('0x37')](_0x81b5e8[_0x2ca4('0x35')],_0x81b5e8['query']);_0x53a8b6[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x81b5e8[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x4997dc[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x53a8b6[_0x2ca4('0x38')]=_0x53a8b6[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x53a8b6[_0x2ca4('0x38')]:_0x81b5e8[_0x2ca4('0x35')];if(_0x4997dc[_0x2ca4('0x36')][_0x2ca4('0x48')]){_0x53a8b6[_0x2ca4('0x49')]=[{'all':!![]}];}_0x53a8b6=_['merge']({},_0x53a8b6,_0x4997dc[_0x2ca4('0x46')]);return db['Campaign'][_0x2ca4('0x4e')](_0x53a8b6)[_0x2ca4('0x2a')](handleEntityNotFound(_0x528c67,null))[_0x2ca4('0x2a')](respondWithResult(_0x528c67,null))[_0x2ca4('0x4f')](handleError(_0x528c67,null));};exports['create']=function(_0x2c1619,_0x215c00){return db['Campaign'][_0x2ca4('0x50')](_0x2c1619[_0x2ca4('0x51')],{})[_0x2ca4('0x2a')](function(_0x1a7f7c){var _0x45dfaf=_0x2c1619['user'][_0x2ca4('0x2b')]({'plain':!![]});if(!_0x45dfaf)throw new Error(_0x2ca4('0x52'));if(_0x45dfaf[_0x2ca4('0x53')]===_0x2ca4('0x54')){var _0x2a68f0=_0x1a7f7c[_0x2ca4('0x2b')]({'plain':!![]});var _0x46a16c=_0x2ca4('0x2c');return db[_0x2ca4('0x55')]['find']({'where':{'name':_0x46a16c,'userProfileId':_0x45dfaf[_0x2ca4('0x56')]},'raw':!![]})[_0x2ca4('0x2a')](function(_0x5be7b7){if(_0x5be7b7&&_0x5be7b7[_0x2ca4('0x57')]===0x0){return db[_0x2ca4('0x2d')][_0x2ca4('0x50')]({'name':_0x2a68f0[_0x2ca4('0x2e')],'resourceId':_0x2a68f0['id'],'type':_0x5be7b7[_0x2ca4('0x2e')],'sectionId':_0x5be7b7['id']},{})[_0x2ca4('0x2a')](function(){return _0x1a7f7c;});}else{return _0x1a7f7c;}})[_0x2ca4('0x4f')](function(_0x26282d){logger[_0x2ca4('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26282d);throw _0x26282d;});}return _0x1a7f7c;})[_0x2ca4('0x2a')](respondWithResult(_0x215c00,0xc9))[_0x2ca4('0x4f')](handleError(_0x215c00,null));};exports[_0x2ca4('0x59')]=function(_0x34e66d,_0x3f2ab6){var _0x2fb787={'where':{'id':_0x34e66d[_0x2ca4('0x4c')]['id']}},_0x3d902f={};_0x3d902f[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db[_0x2ca4('0x47')][_0x2ca4('0x32')]);_0x2fb787[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x3d902f[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x34e66d[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x2fb787['attributes']=_0x2fb787[_0x2ca4('0x38')]['length']?_0x2fb787[_0x2ca4('0x38')]:_0x3d902f[_0x2ca4('0x35')];if(_0x34e66d[_0x2ca4('0x36')][_0x2ca4('0x48')]){_0x2fb787[_0x2ca4('0x49')]=[{'all':!![]}];}_0x2fb787=_[_0x2ca4('0x45')]({},_0x2fb787,_0x34e66d['options']);return db[_0x2ca4('0x47')][_0x2ca4('0x4e')](_0x2fb787)[_0x2ca4('0x2a')](handleEntityNotFound(_0x3f2ab6,null))['then'](function(_0x23c949){if(_0x23c949){var _0x324da2=_0x23c949[_0x2ca4('0x2b')]({'plain':!![]});_0x324da2=qs[_0x2ca4('0x5a')](_0x324da2,['id',_0x2ca4('0x5b'),_0x2ca4('0x5c')]);_0x34e66d[_0x2ca4('0x51')]=_['omit'](_0x34e66d[_0x2ca4('0x51')],['id',_0x2ca4('0x5b'),_0x2ca4('0x5c')]);return db['Campaign'][_0x2ca4('0x50')](_[_0x2ca4('0x45')](_0x324da2,_0x34e66d[_0x2ca4('0x51')]),{'include':_0x34e66d[_0x2ca4('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x30304a){var _0x160d53=_0x34e66d[_0x2ca4('0x54')][_0x2ca4('0x2b')]({'plain':!![]});if(!_0x160d53)throw new Error(_0x2ca4('0x52'));if(_0x160d53[_0x2ca4('0x53')]===_0x2ca4('0x54')){var _0x7d3848=_0x30304a['get']({'plain':!![]});var _0x4f547a=_0x2ca4('0x2c');return db[_0x2ca4('0x55')][_0x2ca4('0x4e')]({'where':{'name':_0x4f547a,'userProfileId':_0x160d53[_0x2ca4('0x56')]},'raw':!![]})[_0x2ca4('0x2a')](function(_0x49fa9a){if(_0x49fa9a&&_0x49fa9a[_0x2ca4('0x57')]===0x0){return db[_0x2ca4('0x2d')]['create']({'name':_0x7d3848[_0x2ca4('0x2e')],'resourceId':_0x7d3848['id'],'type':_0x49fa9a[_0x2ca4('0x2e')],'sectionId':_0x49fa9a['id']},{})['then'](function(){return _0x30304a;});}else{return _0x30304a;}})[_0x2ca4('0x4f')](function(_0xf3d690){logger[_0x2ca4('0x58')](_0x2ca4('0x5d'),_0xf3d690);throw _0xf3d690;});}return _0x30304a;});}})['then'](respondWithResult(_0x3f2ab6,0xc9))['catch'](handleError(_0x3f2ab6,null));};exports[_0x2ca4('0x28')]=function(_0x275c05,_0x1e99c5){if(_0x275c05[_0x2ca4('0x51')]['id']){delete _0x275c05['body']['id'];}return db['Campaign'][_0x2ca4('0x4e')]({'where':{'id':_0x275c05[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x1e99c5,null))[_0x2ca4('0x2a')](saveUpdates(_0x275c05[_0x2ca4('0x51')],null))[_0x2ca4('0x2a')](respondWithResult(_0x1e99c5,null))[_0x2ca4('0x4f')](handleError(_0x1e99c5,null));};exports['destroy']=function(_0x2c2a84,_0xbc6ce5){return db[_0x2ca4('0x47')]['find']({'where':{'id':_0x2c2a84[_0x2ca4('0x4c')]['id']}})['then'](handleEntityNotFound(_0xbc6ce5,null))[_0x2ca4('0x2a')](removeEntity(_0xbc6ce5,null))[_0x2ca4('0x4f')](handleError(_0xbc6ce5,null));};exports[_0x2ca4('0x5e')]=function(_0x4978da,_0x25349d,_0x576f76){var _0x49ed5b={'raw':!![],'where':{}};var _0x3347bc={};var _0x4ac97c={'count':0x0,'rows':[]};return db['Campaign'][_0x2ca4('0x5f')]({'where':{'id':_0x4978da['params']['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x25349d,null))[_0x2ca4('0x2a')](function(_0x31c904){if(_0x31c904){_0x3347bc[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db[_0x2ca4('0x60')]['rawAttributes']);_0x3347bc['query']=_[_0x2ca4('0x4d')](_0x4978da[_0x2ca4('0x36')]);_0x3347bc['filters']=_[_0x2ca4('0x37')](_0x3347bc[_0x2ca4('0x35')],_0x3347bc['query']);_0x49ed5b[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x3347bc[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x4978da['query']['fields']));_0x49ed5b[_0x2ca4('0x38')]=_0x49ed5b[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x49ed5b['attributes']:_0x3347bc['model'];if(!_0x4978da[_0x2ca4('0x36')][_0x2ca4('0x3b')]('nolimit')){_0x49ed5b[_0x2ca4('0x3d')]=qs[_0x2ca4('0x3d')](_0x4978da[_0x2ca4('0x36')][_0x2ca4('0x3d')]);_0x49ed5b['offset']=qs[_0x2ca4('0x22')](_0x4978da[_0x2ca4('0x36')][_0x2ca4('0x22')]);}_0x49ed5b[_0x2ca4('0x3e')]=qs[_0x2ca4('0x3f')](_0x4978da[_0x2ca4('0x36')]['sort']);_0x49ed5b[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_['pick'](_0x4978da[_0x2ca4('0x36')],_0x3347bc[_0x2ca4('0x41')]));_0x49ed5b['where'][_0x2ca4('0x61')]=_0x31c904['id'];if(_0x4978da['query']['filter']){_0x49ed5b['where']=_[_0x2ca4('0x45')](_0x49ed5b[_0x2ca4('0x40')],{'$or':_[_0x2ca4('0x31')](_0x49ed5b['attributes'],function(_0x496238){var _0x36ea11={};_0x36ea11[_0x496238]={'$like':'%'+_0x4978da[_0x2ca4('0x36')][_0x2ca4('0x43')]+'%'};return _0x36ea11;})});}_0x49ed5b=_[_0x2ca4('0x45')]({},_0x49ed5b,_0x4978da[_0x2ca4('0x46')]);return db['CmHopper'][_0x2ca4('0x21')]({'where':_0x49ed5b[_0x2ca4('0x40')]})[_0x2ca4('0x2a')](function(_0x52b5c5){_0x4ac97c[_0x2ca4('0x21')]=_0x52b5c5;if(_0x4978da[_0x2ca4('0x36')][_0x2ca4('0x48')]){_0x49ed5b[_0x2ca4('0x49')]=[{'all':!![]}];}return db[_0x2ca4('0x60')][_0x2ca4('0x4a')](_0x49ed5b);})['then'](function(_0x22a0cd){_0x4ac97c['rows']=_0x22a0cd;return _0x4ac97c;});}})[_0x2ca4('0x2a')](respondWithFilteredResult(_0x25349d,_0x49ed5b))[_0x2ca4('0x4f')](handleError(_0x25349d,null));};exports[_0x2ca4('0x62')]=function(_0x146a4a,_0x4d5acb,_0x1e3107){var _0x582bb7={'raw':!![],'where':{}};var _0x26a8e4={};var _0x3927cc={'count':0x0,'rows':[]};return db[_0x2ca4('0x47')][_0x2ca4('0x5f')]({'where':{'id':_0x146a4a[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x4d5acb,null))[_0x2ca4('0x2a')](function(_0x1706da){if(_0x1706da){_0x26a8e4[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db[_0x2ca4('0x63')][_0x2ca4('0x32')]);_0x26a8e4[_0x2ca4('0x36')]=_['keys'](_0x146a4a[_0x2ca4('0x36')]);_0x26a8e4[_0x2ca4('0x41')]=_['intersection'](_0x26a8e4['model'],_0x26a8e4[_0x2ca4('0x36')]);_0x582bb7[_0x2ca4('0x38')]=_['intersection'](_0x26a8e4[_0x2ca4('0x35')],qs['fields'](_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x582bb7[_0x2ca4('0x38')]=_0x582bb7[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x582bb7[_0x2ca4('0x38')]:_0x26a8e4[_0x2ca4('0x35')];if(!_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x3b')](_0x2ca4('0x3c'))){_0x582bb7[_0x2ca4('0x3d')]=qs[_0x2ca4('0x3d')](_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x3d')]);_0x582bb7[_0x2ca4('0x22')]=qs['offset'](_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x22')]);}_0x582bb7['order']=qs[_0x2ca4('0x3f')](_0x146a4a[_0x2ca4('0x36')]['sort']);_0x582bb7[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_[_0x2ca4('0x42')](_0x146a4a[_0x2ca4('0x36')],_0x26a8e4[_0x2ca4('0x41')]));_0x582bb7[_0x2ca4('0x40')][_0x2ca4('0x61')]=_0x1706da['id'];if(_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x43')]){_0x582bb7[_0x2ca4('0x40')]=_[_0x2ca4('0x45')](_0x582bb7['where'],{'$or':_[_0x2ca4('0x31')](_0x582bb7[_0x2ca4('0x38')],function(_0x220dc0){var _0x470f26={};_0x470f26[_0x220dc0]={'$like':'%'+_0x146a4a[_0x2ca4('0x36')][_0x2ca4('0x43')]+'%'};return _0x470f26;})});}_0x582bb7=_[_0x2ca4('0x45')]({},_0x582bb7,_0x146a4a['options']);return db[_0x2ca4('0x63')][_0x2ca4('0x21')]({'where':_0x582bb7[_0x2ca4('0x40')]})['then'](function(_0x242de7){_0x3927cc[_0x2ca4('0x21')]=_0x242de7;if(_0x146a4a[_0x2ca4('0x36')]['includeAll']){_0x582bb7['include']=[{'all':!![]}];}return db[_0x2ca4('0x63')][_0x2ca4('0x4a')](_0x582bb7);})[_0x2ca4('0x2a')](function(_0x2330e8){_0x3927cc[_0x2ca4('0x4b')]=_0x2330e8;return _0x3927cc;});}})[_0x2ca4('0x2a')](respondWithFilteredResult(_0x4d5acb,_0x582bb7))[_0x2ca4('0x4f')](handleError(_0x4d5acb,null));};exports[_0x2ca4('0x64')]=function(_0x4e4a59,_0x3dadb3,_0x1afc44){var _0x504202={'raw':!![],'where':{}};var _0x2a6f2d={};var _0xfbf183={'count':0x0,'rows':[]};return db[_0x2ca4('0x47')]['findOne']({'where':{'id':_0x4e4a59[_0x2ca4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3dadb3,null))['then'](function(_0x41db78){if(_0x41db78){_0x2a6f2d['model']=_[_0x2ca4('0x4d')](db['CmHopperFinal']['rawAttributes']);_0x2a6f2d[_0x2ca4('0x36')]=_[_0x2ca4('0x4d')](_0x4e4a59[_0x2ca4('0x36')]);_0x2a6f2d[_0x2ca4('0x41')]=_[_0x2ca4('0x37')](_0x2a6f2d['model'],_0x2a6f2d[_0x2ca4('0x36')]);_0x504202[_0x2ca4('0x38')]=_['intersection'](_0x2a6f2d[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x504202['attributes']=_0x504202[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x504202[_0x2ca4('0x38')]:_0x2a6f2d[_0x2ca4('0x35')];if(!_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x3b')](_0x2ca4('0x3c'))){_0x504202['limit']=qs[_0x2ca4('0x3d')](_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x3d')]);_0x504202[_0x2ca4('0x22')]=qs[_0x2ca4('0x22')](_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x22')]);}_0x504202['order']=qs['sort'](_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x3f')]);_0x504202[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_['pick'](_0x4e4a59[_0x2ca4('0x36')],_0x2a6f2d[_0x2ca4('0x41')]));_0x504202[_0x2ca4('0x40')]['CampaignId']=_0x41db78['id'];if(_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x43')]){_0x504202[_0x2ca4('0x40')]=_[_0x2ca4('0x45')](_0x504202[_0x2ca4('0x40')],{'$or':_[_0x2ca4('0x31')](_0x504202[_0x2ca4('0x38')],function(_0x5a6330){var _0x4c2a9f={};_0x4c2a9f[_0x5a6330]={'$like':'%'+_0x4e4a59[_0x2ca4('0x36')]['filter']+'%'};return _0x4c2a9f;})});}_0x504202=_[_0x2ca4('0x45')]({},_0x504202,_0x4e4a59[_0x2ca4('0x46')]);return db[_0x2ca4('0x65')]['count']({'where':_0x504202[_0x2ca4('0x40')]})[_0x2ca4('0x2a')](function(_0xb9e4b3){_0xfbf183[_0x2ca4('0x21')]=_0xb9e4b3;if(_0x4e4a59[_0x2ca4('0x36')][_0x2ca4('0x48')]){_0x504202[_0x2ca4('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2ca4('0x4a')](_0x504202);})['then'](function(_0x70729a){_0xfbf183[_0x2ca4('0x4b')]=_0x70729a;return _0xfbf183;});}})[_0x2ca4('0x2a')](respondWithFilteredResult(_0x3dadb3,_0x504202))[_0x2ca4('0x4f')](handleError(_0x3dadb3,null));};exports[_0x2ca4('0x66')]=function(_0x2ca8ff,_0x4ab991,_0x162a5a){var _0x3e0a3d={'raw':!![],'where':{}};var _0x4ee6fa={};var _0x2b4f05={'count':0x0,'rows':[]};return db['Campaign'][_0x2ca4('0x5f')]({'where':{'id':_0x2ca8ff['params']['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x4ab991,null))[_0x2ca4('0x2a')](function(_0x2a1686){if(_0x2a1686){_0x4ee6fa[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db[_0x2ca4('0x67')][_0x2ca4('0x32')]);_0x4ee6fa[_0x2ca4('0x36')]=_['keys'](_0x2ca8ff['query']);_0x4ee6fa['filters']=_['intersection'](_0x4ee6fa[_0x2ca4('0x35')],_0x4ee6fa['query']);_0x3e0a3d[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x4ee6fa[_0x2ca4('0x35')],qs['fields'](_0x2ca8ff['query'][_0x2ca4('0x39')]));_0x3e0a3d[_0x2ca4('0x38')]=_0x3e0a3d['attributes'][_0x2ca4('0x3a')]?_0x3e0a3d['attributes']:_0x4ee6fa[_0x2ca4('0x35')];if(!_0x2ca8ff['query'][_0x2ca4('0x3b')](_0x2ca4('0x3c'))){_0x3e0a3d[_0x2ca4('0x3d')]=qs['limit'](_0x2ca8ff['query'][_0x2ca4('0x3d')]);_0x3e0a3d[_0x2ca4('0x22')]=qs[_0x2ca4('0x22')](_0x2ca8ff[_0x2ca4('0x36')][_0x2ca4('0x22')]);}_0x3e0a3d[_0x2ca4('0x3e')]=qs[_0x2ca4('0x3f')](_0x2ca8ff[_0x2ca4('0x36')][_0x2ca4('0x3f')]);_0x3e0a3d[_0x2ca4('0x40')]=qs['filters'](_[_0x2ca4('0x42')](_0x2ca8ff[_0x2ca4('0x36')],_0x4ee6fa[_0x2ca4('0x41')]));_0x3e0a3d[_0x2ca4('0x40')]['CampaignId']=_0x2a1686['id'];if(_0x2ca8ff[_0x2ca4('0x36')][_0x2ca4('0x43')]){_0x3e0a3d[_0x2ca4('0x40')]=_[_0x2ca4('0x45')](_0x3e0a3d['where'],{'$or':_[_0x2ca4('0x31')](_0x3e0a3d['attributes'],function(_0x2d550f){var _0x1862ea={};_0x1862ea[_0x2d550f]={'$like':'%'+_0x2ca8ff[_0x2ca4('0x36')][_0x2ca4('0x43')]+'%'};return _0x1862ea;})});}_0x3e0a3d=_[_0x2ca4('0x45')]({},_0x3e0a3d,_0x2ca8ff[_0x2ca4('0x46')]);return db[_0x2ca4('0x67')][_0x2ca4('0x21')]({'where':_0x3e0a3d[_0x2ca4('0x40')]})[_0x2ca4('0x2a')](function(_0x387513){_0x2b4f05[_0x2ca4('0x21')]=_0x387513;if(_0x2ca8ff['query'][_0x2ca4('0x48')]){_0x3e0a3d['include']=[{'all':!![]}];}return db[_0x2ca4('0x67')][_0x2ca4('0x4a')](_0x3e0a3d);})['then'](function(_0x7f11b7){_0x2b4f05[_0x2ca4('0x4b')]=_0x7f11b7;return _0x2b4f05;});}})[_0x2ca4('0x2a')](respondWithFilteredResult(_0x4ab991,_0x3e0a3d))[_0x2ca4('0x4f')](handleError(_0x4ab991,null));};exports[_0x2ca4('0x68')]=function(_0x22de90,_0x1404b8,_0x42220e){var _0x3ba26c={};var _0x572aae={};var _0x2b7022;var _0x2fdc3e;return db[_0x2ca4('0x47')][_0x2ca4('0x5f')]({'where':{'id':_0x22de90['params']['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x1404b8,null))[_0x2ca4('0x2a')](function(_0x28c916){if(_0x28c916){_0x2b7022=_0x28c916;_0x572aae[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db['CmList']['rawAttributes']);_0x572aae[_0x2ca4('0x36')]=_[_0x2ca4('0x4d')](_0x22de90[_0x2ca4('0x36')]);_0x572aae[_0x2ca4('0x41')]=_[_0x2ca4('0x37')](_0x572aae[_0x2ca4('0x35')],_0x572aae['query']);_0x3ba26c[_0x2ca4('0x38')]=_[_0x2ca4('0x37')](_0x572aae[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x22de90[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x3ba26c[_0x2ca4('0x38')]=_0x3ba26c[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x3ba26c[_0x2ca4('0x38')]:_0x572aae['model'];_0x3ba26c[_0x2ca4('0x3e')]=qs['sort'](_0x22de90[_0x2ca4('0x36')][_0x2ca4('0x3f')]);_0x3ba26c[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_[_0x2ca4('0x42')](_0x22de90['query'],_0x572aae[_0x2ca4('0x41')]));if(_0x22de90[_0x2ca4('0x36')][_0x2ca4('0x43')]){_0x3ba26c['where']=_['merge'](_0x3ba26c[_0x2ca4('0x40')],{'$or':_['map'](_0x3ba26c[_0x2ca4('0x38')],function(_0x522112){var _0xc5603={};_0xc5603[_0x522112]={'$like':'%'+_0x22de90['query'][_0x2ca4('0x43')]+'%'};return _0xc5603;})});}_0x3ba26c=_[_0x2ca4('0x45')]({},_0x3ba26c,_0x22de90[_0x2ca4('0x46')]);return _0x2b7022[_0x2ca4('0x68')](_0x3ba26c);}})['then'](function(_0x4744d4){if(_0x4744d4){_0x2fdc3e=_0x4744d4['length'];if(!_0x22de90['query']['hasOwnProperty'](_0x2ca4('0x3c'))){_0x3ba26c[_0x2ca4('0x3d')]=qs[_0x2ca4('0x3d')](_0x22de90[_0x2ca4('0x36')][_0x2ca4('0x3d')]);_0x3ba26c[_0x2ca4('0x22')]=qs[_0x2ca4('0x22')](_0x22de90[_0x2ca4('0x36')][_0x2ca4('0x22')]);}return _0x2b7022[_0x2ca4('0x68')](_0x3ba26c);}})['then'](function(_0x1b2ffd){if(_0x1b2ffd){return _0x1b2ffd?{'count':_0x2fdc3e,'rows':_0x1b2ffd}:null;}})['then'](respondWithResult(_0x1404b8,null))[_0x2ca4('0x4f')](handleError(_0x1404b8,null));};exports['addLists']=function(_0x2f0ac5,_0x5d08c0,_0x23fb1c){var _0x24f28a,_0x183534;return db[_0x2ca4('0x47')]['find']({'where':{'id':_0x2f0ac5['params']['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x5d08c0,null))['then'](function(_0x142a28){if(_0x142a28){_0x183534=_0x142a28;return _0x142a28[_0x2ca4('0x69')](_0x2f0ac5[_0x2ca4('0x51')]['ids'],_[_0x2ca4('0x5a')](_0x2f0ac5[_0x2ca4('0x51')],[_0x2ca4('0x6a'),'id'])||{});}return null;})[_0x2ca4('0x6b')](function(_0x19fb2d){var _0x254108;_0x24f28a=_0x19fb2d||[];var _0x415b69=[];if(_0x19fb2d){for(var _0x31de2b=0x0;_0x31de2b<_0x19fb2d[_0x2ca4('0x3a')];_0x31de2b+=0x1){var _0x44f021=_0x19fb2d[_0x31de2b][_0x2ca4('0x2b')]({'plain':!![]});_0x183534[_0x2ca4('0x6c')]=_0x2f0ac5[_0x2ca4('0x51')]['dialCheckDuplicateType']?_0x2f0ac5[_0x2ca4('0x51')][_0x2ca4('0x6c')]:_0x183534['dialCheckDuplicateType'];switch(_0x183534['dialCheckDuplicateType']){case'always':_0x254108=squel[_0x2ca4('0x6d')]()[_0x2ca4('0x6e')](_0x2ca4('0x6f'))[_0x2ca4('0x70')]([_0x2ca4('0x71'),_0x2ca4('0x72'),_0x2ca4('0x73'),_0x2ca4('0x74'),_0x2ca4('0x61'),_0x2ca4('0x5b'),_0x2ca4('0x5c')],squel['select']()[_0x2ca4('0x75')](_0x2ca4('0x71'),_0x2ca4('0x71'))[_0x2ca4('0x75')](_0x2ca4('0x76'),'scheduledAt')[_0x2ca4('0x75')]('id','ContactId')[_0x2ca4('0x75')](_0x44f021[_0x2ca4('0x77')][_0x2ca4('0x78')](),_0x2ca4('0x74'))[_0x2ca4('0x75')](_0x2f0ac5[_0x2ca4('0x4c')]['id']['toString'](),_0x2ca4('0x61'))[_0x2ca4('0x75')](_0x2ca4('0x76'),_0x2ca4('0x5b'))['field'](_0x2ca4('0x76'),_0x2ca4('0x5c'))[_0x2ca4('0x79')](_0x2ca4('0x7a'))[_0x2ca4('0x40')](_0x2ca4('0x7b'))[_0x2ca4('0x40')](_0x2ca4('0x7c'),_0x44f021[_0x2ca4('0x77')][_0x2ca4('0x78')]())[_0x2ca4('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x2ca4('0x7d'),squel[_0x2ca4('0x7e')]()[_0x2ca4('0x75')](_0x2ca4('0x7f'))[_0x2ca4('0x79')]('cm_hopper_final')['where'](_0x2ca4('0x80'),_0x2f0ac5['params']['id'][_0x2ca4('0x78')]()))[_0x2ca4('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2ca4('0x75')](_0x2ca4('0x81'))['from']('cm_hopper')[_0x2ca4('0x40')](_0x2ca4('0x80'),_0x2f0ac5['params']['id'][_0x2ca4('0x78')]())))[_0x2ca4('0x78')]();break;case _0x2ca4('0x82'):_0x254108=squel[_0x2ca4('0x6d')]()['into'](_0x2ca4('0x6f'))[_0x2ca4('0x70')]([_0x2ca4('0x71'),_0x2ca4('0x72'),'ContactId',_0x2ca4('0x74'),_0x2ca4('0x61'),'createdAt','updatedAt'],squel['select']()[_0x2ca4('0x75')](_0x2ca4('0x71'),_0x2ca4('0x71'))[_0x2ca4('0x75')]('NOW()',_0x2ca4('0x72'))[_0x2ca4('0x75')]('id',_0x2ca4('0x73'))['field'](_0x44f021['CmListId'][_0x2ca4('0x78')](),_0x2ca4('0x74'))['field'](_0x2f0ac5[_0x2ca4('0x4c')]['id']['toString'](),_0x2ca4('0x61'))[_0x2ca4('0x75')]('NOW()','createdAt')[_0x2ca4('0x75')](_0x2ca4('0x76'),_0x2ca4('0x5c'))[_0x2ca4('0x79')](_0x2ca4('0x7a'))[_0x2ca4('0x40')](_0x2ca4('0x7b'))['where'](_0x2ca4('0x7c'),_0x44f021[_0x2ca4('0x77')][_0x2ca4('0x78')]())[_0x2ca4('0x40')](_0x2ca4('0x83'))[_0x2ca4('0x40')](_0x2ca4('0x7d'),squel['select']()[_0x2ca4('0x75')](_0x2ca4('0x81'))['from'](_0x2ca4('0x6f'))[_0x2ca4('0x40')](_0x2ca4('0x80'),_0x2f0ac5[_0x2ca4('0x4c')]['id'][_0x2ca4('0x78')]())))[_0x2ca4('0x78')]();break;default:_0x254108=squel[_0x2ca4('0x6d')]()[_0x2ca4('0x6e')](_0x2ca4('0x6f'))['fromQuery']([_0x2ca4('0x71'),'scheduledAt',_0x2ca4('0x73'),_0x2ca4('0x74'),_0x2ca4('0x61'),'createdAt','updatedAt'],squel['select']()['field'](_0x2ca4('0x71'),'phone')[_0x2ca4('0x75')](_0x2ca4('0x76'),_0x2ca4('0x72'))[_0x2ca4('0x75')]('id','ContactId')[_0x2ca4('0x75')](_0x44f021[_0x2ca4('0x77')]['toString'](),'ListId')[_0x2ca4('0x75')](_0x2f0ac5['params']['id'][_0x2ca4('0x78')](),_0x2ca4('0x61'))['field'](_0x2ca4('0x76'),_0x2ca4('0x5b'))[_0x2ca4('0x75')](_0x2ca4('0x76'),'updatedAt')['from'](_0x2ca4('0x7a'))[_0x2ca4('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x44f021[_0x2ca4('0x77')][_0x2ca4('0x78')]())[_0x2ca4('0x40')](_0x2ca4('0x83')))[_0x2ca4('0x78')]();}_0x415b69[_0x2ca4('0x84')](db['sequelize'][_0x2ca4('0x36')](_0x254108));}return BPromise[_0x2ca4('0x85')](_0x415b69);}})[_0x2ca4('0x2a')](function(){return _0x24f28a;})[_0x2ca4('0x2a')](respondWithResult(_0x5d08c0,null))[_0x2ca4('0x4f')](handleError(_0x5d08c0,null));};exports[_0x2ca4('0x86')]=function(_0x5633a4,_0x140447,_0x2a311f){return db[_0x2ca4('0x47')][_0x2ca4('0x4e')]({'where':{'id':_0x5633a4[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x140447,null))[_0x2ca4('0x2a')](function(_0x1f5e2f){if(_0x1f5e2f){return _0x1f5e2f[_0x2ca4('0x86')](_0x5633a4[_0x2ca4('0x36')]['ids']);}})[_0x2ca4('0x2a')](function(_0x28bdea){if(_0x28bdea){return db[_0x2ca4('0x60')][_0x2ca4('0x29')]({'where':{'ListId':_0x5633a4[_0x2ca4('0x36')][_0x2ca4('0x6a')],'CampaignId':_0x5633a4['params']['id']}})['then'](function(){return _0x28bdea;});}})[_0x2ca4('0x2a')](respondWithStatusCode(_0x140447,null))[_0x2ca4('0x4f')](handleError(_0x140447,null));};exports[_0x2ca4('0x87')]=function(_0x406af2,_0x2dd965,_0x623d50){var _0x13e8fd={};var _0x444ebc={};var _0x21fa4d;var _0x380fa3;return db['Campaign']['findOne']({'where':{'id':_0x406af2[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x2dd965,null))[_0x2ca4('0x2a')](function(_0xde698f){if(_0xde698f){_0x21fa4d=_0xde698f;_0x444ebc[_0x2ca4('0x35')]=_[_0x2ca4('0x4d')](db[_0x2ca4('0x88')]['rawAttributes']);_0x444ebc[_0x2ca4('0x36')]=_['keys'](_0x406af2[_0x2ca4('0x36')]);_0x444ebc[_0x2ca4('0x41')]=_[_0x2ca4('0x37')](_0x444ebc[_0x2ca4('0x35')],_0x444ebc[_0x2ca4('0x36')]);_0x13e8fd[_0x2ca4('0x38')]=_['intersection'](_0x444ebc[_0x2ca4('0x35')],qs[_0x2ca4('0x39')](_0x406af2[_0x2ca4('0x36')][_0x2ca4('0x39')]));_0x13e8fd[_0x2ca4('0x38')]=_0x13e8fd[_0x2ca4('0x38')][_0x2ca4('0x3a')]?_0x13e8fd[_0x2ca4('0x38')]:_0x444ebc[_0x2ca4('0x35')];_0x13e8fd[_0x2ca4('0x3e')]=qs[_0x2ca4('0x3f')](_0x406af2[_0x2ca4('0x36')][_0x2ca4('0x3f')]);_0x13e8fd[_0x2ca4('0x40')]=qs[_0x2ca4('0x41')](_[_0x2ca4('0x42')](_0x406af2[_0x2ca4('0x36')],_0x444ebc['filters']));if(_0x406af2[_0x2ca4('0x36')]['filter']){_0x13e8fd[_0x2ca4('0x40')]=_[_0x2ca4('0x45')](_0x13e8fd['where'],{'$or':_['map'](_0x13e8fd[_0x2ca4('0x38')],function(_0x1d95a2){var _0x4b479d={};_0x4b479d[_0x1d95a2]={'$like':'%'+_0x406af2['query'][_0x2ca4('0x43')]+'%'};return _0x4b479d;})});}_0x13e8fd=_[_0x2ca4('0x45')]({},_0x13e8fd,_0x406af2[_0x2ca4('0x46')]);return _0x21fa4d[_0x2ca4('0x87')](_0x13e8fd);}})[_0x2ca4('0x2a')](function(_0x3fb029){if(_0x3fb029){_0x380fa3=_0x3fb029['length'];if(!_0x406af2[_0x2ca4('0x36')]['hasOwnProperty'](_0x2ca4('0x3c'))){_0x13e8fd[_0x2ca4('0x3d')]=qs[_0x2ca4('0x3d')](_0x406af2[_0x2ca4('0x36')][_0x2ca4('0x3d')]);_0x13e8fd[_0x2ca4('0x22')]=qs[_0x2ca4('0x22')](_0x406af2[_0x2ca4('0x36')][_0x2ca4('0x22')]);}return _0x21fa4d[_0x2ca4('0x87')](_0x13e8fd);}})[_0x2ca4('0x2a')](function(_0x1d2244){if(_0x1d2244){return _0x1d2244?{'count':_0x380fa3,'rows':_0x1d2244}:null;}})[_0x2ca4('0x2a')](respondWithResult(_0x2dd965,null))[_0x2ca4('0x4f')](handleError(_0x2dd965,null));};exports['addBlackLists']=function(_0x6461fd,_0x99f231,_0x5eee01){var _0x5181bd,_0x441f59;return db[_0x2ca4('0x47')][_0x2ca4('0x4e')]({'where':{'id':_0x6461fd['params']['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x99f231,null))[_0x2ca4('0x2a')](function(_0x3a7e16){if(_0x3a7e16){_0x441f59=_0x3a7e16;return _0x3a7e16[_0x2ca4('0x89')](_0x6461fd[_0x2ca4('0x51')][_0x2ca4('0x6a')],_[_0x2ca4('0x5a')](_0x6461fd['body'],[_0x2ca4('0x6a'),'id'])||{});}return null;})[_0x2ca4('0x6b')](function(_0x8cf58d){var _0x56bd83;_0x5181bd=_0x8cf58d||[];var _0x1c2631=[];if(_0x8cf58d){for(var _0x37fba5=0x0;_0x37fba5<_0x8cf58d[_0x2ca4('0x3a')];_0x37fba5+=0x1){var _0x1df59b=_0x8cf58d[_0x37fba5]['get']({'plain':!![]});_0x56bd83=squel[_0x2ca4('0x6d')]()['into'](_0x2ca4('0x8a'))[_0x2ca4('0x70')]([_0x2ca4('0x71'),_0x2ca4('0x73'),'ListId',_0x2ca4('0x61'),'createdAt',_0x2ca4('0x5c')],squel[_0x2ca4('0x7e')]()[_0x2ca4('0x75')](_0x2ca4('0x71'),'phone')[_0x2ca4('0x75')]('id',_0x2ca4('0x73'))[_0x2ca4('0x75')](_0x1df59b[_0x2ca4('0x77')][_0x2ca4('0x78')](),_0x2ca4('0x74'))[_0x2ca4('0x75')](_0x6461fd[_0x2ca4('0x4c')]['id'][_0x2ca4('0x78')](),_0x2ca4('0x61'))[_0x2ca4('0x75')](_0x2ca4('0x76'),_0x2ca4('0x5b'))[_0x2ca4('0x75')]('NOW()',_0x2ca4('0x5c'))[_0x2ca4('0x79')](_0x2ca4('0x7a'))['where'](_0x2ca4('0x7b'))[_0x2ca4('0x40')](_0x2ca4('0x7c'),_0x1df59b[_0x2ca4('0x77')][_0x2ca4('0x78')]())[_0x2ca4('0x40')](_0x2ca4('0x83')))['toString']();_0x1c2631['push'](db[_0x2ca4('0x8b')]['query'](_0x56bd83));}return BPromise[_0x2ca4('0x85')](_0x1c2631);}})[_0x2ca4('0x2a')](function(){return _0x5181bd;})[_0x2ca4('0x2a')](respondWithResult(_0x99f231,null))[_0x2ca4('0x4f')](handleError(_0x99f231,null));};exports[_0x2ca4('0x8c')]=function(_0x8a459b,_0x423450,_0x4f521c){return db[_0x2ca4('0x47')][_0x2ca4('0x4e')]({'where':{'id':_0x8a459b[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](handleEntityNotFound(_0x423450,null))['then'](function(_0x442b22){if(_0x442b22){return _0x442b22[_0x2ca4('0x8c')](_0x8a459b[_0x2ca4('0x36')][_0x2ca4('0x6a')]);}})[_0x2ca4('0x2a')](function(_0xdcacb8){if(_0xdcacb8){return db[_0x2ca4('0x67')][_0x2ca4('0x29')]({'where':{'ListId':_0x8a459b[_0x2ca4('0x36')][_0x2ca4('0x6a')],'CampaignId':_0x8a459b[_0x2ca4('0x4c')]['id']}})[_0x2ca4('0x2a')](function(){return _0xdcacb8;});}})[_0x2ca4('0x2a')](respondWithStatusCode(_0x423450,null))[_0x2ca4('0x4f')](handleError(_0x423450,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 751a3c3..8793831 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(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x41d9a8,_0x386c27){var _0x146498=function(_0x5c399c){while(--_0x5c399c){_0x41d9a8['push'](_0x41d9a8['shift']());}};_0x146498(++_0x386c27);}(_0x7a54,0x106));var _0x47a5=function(_0x577b05,_0x2fdd7f){_0x577b05=_0x577b05-0x0;var _0x19553b=_0x7a54[_0x577b05];return _0x19553b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 692cdac..5197b5b 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 _0xf290=['message','catch','GetCampaign','findAll','options','raw','where','map','include','model','attributes','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x34ef06,_0x9dee){var _0x4b347a=function(_0x3374b9){while(--_0x3374b9){_0x34ef06['push'](_0x34ef06['shift']());}};_0x4b347a(++_0x9dee);}(_0xf290,0xde));var _0x0f29=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xf290[_0x5be7aa];return _0x215408;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Campaign,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['Campaign'][_0x0f29('0x15')]({'raw':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x17')]===undefined?!![]:![]:!![],'where':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x18')]||null:null,'attributes':_0x5d72a5['options']?_0x5d72a5[_0x0f29('0x16')]['attributes']||null:null,'limit':_0x5d72a5['options']?_0x5d72a5['options']['limit']||null:null,'include':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')]['include']?_[_0x0f29('0x19')](_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x1a')],function(_0x3402dc){return{'model':db[_0x3402dc[_0x0f29('0x1b')]],'as':_0x3402dc['as'],'attributes':_0x3402dc['attributes'],'include':_0x3402dc[_0x0f29('0x1a')]?_['map'](_0x3402dc[_0x0f29('0x1a')],function(_0x26f46f){return{'model':db[_0x26f46f[_0x0f29('0x1b')]],'as':_0x26f46f['as'],'attributes':_0x26f46f[_0x0f29('0x1c')],'include':_0x26f46f['include']?_[_0x0f29('0x19')](_0x26f46f['include'],function(_0x58b201){return{'model':db[_0x58b201[_0x0f29('0x1b')]],'as':_0x58b201['as'],'attributes':_0x58b201['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57dcc7){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger[_0x0f29('0xe')]('GetCampaign',_0x5d72a5,JSON[_0x0f29('0x1d')](_0x57dcc7));_0x4ca5e8(_0x57dcc7);})[_0x0f29('0x13')](function(_0x274c9d){logger['error']('GetCampaign',_0x274c9d[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994['error'](0x1f4,_0x274c9d[_0x0f29('0x12')]));});});};
\ No newline at end of file
+var _0x83f1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','catch','lodash','util'];(function(_0x4d8e39,_0x1a5325){var _0x41869c=function(_0x2557b4){while(--_0x2557b4){_0x4d8e39['push'](_0x4d8e39['shift']());}};_0x41869c(++_0x1a5325);}(_0x83f1,0x1cc));var _0x183f=function(_0x4c5637,_0x12bfb7){_0x4c5637=_0x4c5637-0x0;var _0x5510d8=_0x83f1[_0x4c5637];return _0x5510d8;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var moment=require(_0x183f('0x2'));var BPromise=require(_0x183f('0x3'));var rs=require(_0x183f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x183f('0x5'));var logger=require(_0x183f('0x6'))(_0x183f('0x7'));var config=require(_0x183f('0x8'));var jayson=require(_0x183f('0x9'));var client=jayson['client'][_0x183f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf702f5,_0x364cc4,_0x5c75c3){return new BPromise(function(_0x434be2,_0x5bdf95){return client[_0x183f('0xb')](_0xf702f5,_0x5c75c3)[_0x183f('0xc')](function(_0x37ed60){logger[_0x183f('0xd')](_0x183f('0xe'),_0x364cc4,_0x183f('0xf'));logger[_0x183f('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'),JSON[_0x183f('0x11')](_0x37ed60));if(_0x37ed60[_0x183f('0x12')]){if(_0x37ed60[_0x183f('0x12')][_0x183f('0x13')]===0x1f4){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60['error'][_0x183f('0x14')]);return _0x5bdf95(_0x37ed60['error']['message']);}logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60[_0x183f('0x12')][_0x183f('0x14')]);return _0x434be2(_0x37ed60[_0x183f('0x12')]['message']);}else{logger[_0x183f('0xd')]('Campaign,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'));_0x434be2(_0x37ed60[_0x183f('0x15')][_0x183f('0x14')]);}})['catch'](function(_0xe9c5d9){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0xe9c5d9);_0x5bdf95(_0xe9c5d9);});});}exports['GetCampaign']=function(_0x284244){var _0x2b819e=this;return new Promise(function(_0x2c3468,_0x3f713f){return db[_0x183f('0x16')][_0x183f('0x17')]({'raw':_0x284244['options']?_0x284244[_0x183f('0x18')][_0x183f('0x19')]===undefined?!![]:![]:!![],'where':_0x284244[_0x183f('0x18')]?_0x284244['options'][_0x183f('0x1a')]||null:null,'attributes':_0x284244['options']?_0x284244[_0x183f('0x18')][_0x183f('0x1b')]||null:null,'limit':_0x284244[_0x183f('0x18')]?_0x284244[_0x183f('0x18')]['limit']||null:null,'include':_0x284244[_0x183f('0x18')]?_0x284244[_0x183f('0x18')][_0x183f('0x1c')]?_[_0x183f('0x1d')](_0x284244[_0x183f('0x18')][_0x183f('0x1c')],function(_0x2b0f17){return{'model':db[_0x2b0f17[_0x183f('0x1e')]],'as':_0x2b0f17['as'],'attributes':_0x2b0f17[_0x183f('0x1b')],'include':_0x2b0f17[_0x183f('0x1c')]?_['map'](_0x2b0f17[_0x183f('0x1c')],function(_0x4d6ccf){return{'model':db[_0x4d6ccf['model']],'as':_0x4d6ccf['as'],'attributes':_0x4d6ccf[_0x183f('0x1b')],'include':_0x4d6ccf[_0x183f('0x1c')]?_[_0x183f('0x1d')](_0x4d6ccf[_0x183f('0x1c')],function(_0x3fd9de){return{'model':db[_0x3fd9de[_0x183f('0x1e')]],'as':_0x3fd9de['as'],'attributes':_0x3fd9de[_0x183f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x183f('0xc')](function(_0x52308f){logger[_0x183f('0xd')](_0x183f('0x1f'),_0x284244);logger[_0x183f('0x10')](_0x183f('0x1f'),_0x284244,JSON[_0x183f('0x11')](_0x52308f));_0x2c3468(_0x52308f);})[_0x183f('0x20')](function(_0x43bd3c){logger[_0x183f('0x12')]('GetCampaign',_0x43bd3c['message'],_0x284244);_0x3f713f(_0x2b819e[_0x183f('0x12')](0x1f4,_0x43bd3c[_0x183f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f61351b..3f5c102 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 _0x7a62=['getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists'];(function(_0x4bb34c,_0x10b710){var _0x2e7e30=function(_0xe6b477){while(--_0xe6b477){_0x4bb34c['push'](_0x4bb34c['shift']());}};_0x2e7e30(++_0x10b710);}(_0x7a62,0x1b0));var _0x27a6=function(_0x500d36,_0x4db012){_0x500d36=_0x500d36-0x0;var _0x1faf19=_0x7a62[_0x500d36];return _0x1faf19;};'use strict';var multer=require(_0x27a6('0x0'));var util=require(_0x27a6('0x1'));var path=require(_0x27a6('0x2'));var timeout=require(_0x27a6('0x3'));var express=require(_0x27a6('0x4'));var router=express[_0x27a6('0x5')]();var fs_extra=require(_0x27a6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x27a6('0x7'));var config=require(_0x27a6('0x8'));var controller=require(_0x27a6('0x9'));router[_0x27a6('0xa')]('/',auth[_0x27a6('0xb')](),controller['index']);router['get'](_0x27a6('0xc'),auth[_0x27a6('0xb')](),controller[_0x27a6('0xd')]);router[_0x27a6('0xa')](_0x27a6('0xe'),auth['isAuthenticated'](),controller[_0x27a6('0xf')]);router['get']('/:id/hopper_histories',auth[_0x27a6('0xb')](),controller['getHopperHistories']);router['get'](_0x27a6('0x10'),auth['isAuthenticated'](),controller[_0x27a6('0x11')]);router['get'](_0x27a6('0x12'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x13')]);router[_0x27a6('0xa')](_0x27a6('0x14'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x15')]);router[_0x27a6('0xa')](_0x27a6('0x16'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x17')]);router[_0x27a6('0x18')]('/',auth[_0x27a6('0xb')](),controller[_0x27a6('0x19')]);router[_0x27a6('0x18')](_0x27a6('0x1a'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x1b')]);router['post']('/:id/lists',auth[_0x27a6('0xb')](),controller[_0x27a6('0x1c')]);router['post'](_0x27a6('0x16'),auth[_0x27a6('0xb')](),controller['addBlackLists']);router[_0x27a6('0x1d')](_0x27a6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x27a6('0x1e')](_0x27a6('0xc'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x1f')]);router[_0x27a6('0x1e')]('/:id/lists',auth[_0x27a6('0xb')](),controller[_0x27a6('0x20')]);router[_0x27a6('0x1e')](_0x27a6('0x16'),auth[_0x27a6('0xb')](),controller[_0x27a6('0x21')]);module[_0x27a6('0x22')]=router;
\ No newline at end of file
+var _0x7dde=['isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','addBlackLists','put','/:id','update','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','index'];(function(_0x4186ae,_0x5548e5){var _0x31d4b0=function(_0xf394a9){while(--_0xf394a9){_0x4186ae['push'](_0x4186ae['shift']());}};_0x31d4b0(++_0x5548e5);}(_0x7dde,0x66));var _0xe7dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dde[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe7dd('0x0'));var util=require(_0xe7dd('0x1'));var path=require(_0xe7dd('0x2'));var timeout=require(_0xe7dd('0x3'));var express=require(_0xe7dd('0x4'));var router=express[_0xe7dd('0x5')]();var fs_extra=require(_0xe7dd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7dd('0x7'));var config=require(_0xe7dd('0x8'));var controller=require(_0xe7dd('0x9'));router[_0xe7dd('0xa')]('/',auth['isAuthenticated'](),controller[_0xe7dd('0xb')]);router['get']('/:id',auth[_0xe7dd('0xc')](),controller[_0xe7dd('0xd')]);router[_0xe7dd('0xa')](_0xe7dd('0xe'),auth['isAuthenticated'](),controller[_0xe7dd('0xf')]);router[_0xe7dd('0xa')](_0xe7dd('0x10'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x11')]);router[_0xe7dd('0xa')](_0xe7dd('0x12'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x13')]);router[_0xe7dd('0xa')](_0xe7dd('0x14'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x15')]);router['get']('/:id/lists',auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x16')]);router[_0xe7dd('0xa')](_0xe7dd('0x17'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x18')]);router[_0xe7dd('0x19')]('/',auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x1a')]);router['post']('/:id/clone',auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x1b')]);router[_0xe7dd('0x19')](_0xe7dd('0x1c'),auth['isAuthenticated'](),controller[_0xe7dd('0x1d')]);router[_0xe7dd('0x19')](_0xe7dd('0x17'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x1e')]);router[_0xe7dd('0x1f')](_0xe7dd('0x20'),auth['isAuthenticated'](),controller[_0xe7dd('0x21')]);router[_0xe7dd('0x22')](_0xe7dd('0x20'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x23')]);router[_0xe7dd('0x22')]('/:id/lists',auth[_0xe7dd('0xc')](),controller['removeLists']);router[_0xe7dd('0x22')](_0xe7dd('0x17'),auth[_0xe7dd('0xc')](),controller[_0xe7dd('0x24')]);module[_0xe7dd('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index df62297..f654f68 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 _0xb5cf=['TEXT','STRING'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb5cf,0x1b5));var _0xfb5c=function(_0x2c128f,_0x3e67f3){_0x2c128f=_0x2c128f-0x0;var _0x342b04=_0xb5cf[_0x2c128f];return _0x342b04;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xfb5c('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xfb5c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfb5c('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x322b=['VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x305112,_0x45cefd){var _0x246241=function(_0x1adf76){while(--_0x1adf76){_0x305112['push'](_0x305112['shift']());}};_0x246241(++_0x45cefd);}(_0x322b,0x1c5));var _0xb322=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0x322b[_0x210603];return _0x1bcb7d;};'use strict';var Sequelize=require(_0xb322('0x0'));module['exports']={'key':{'type':Sequelize[_0xb322('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xb322('0x1')]},'name':{'type':Sequelize[_0xb322('0x2')],'get':function(){return this[_0xb322('0x3')](_0xb322('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index e8b4e33..b40511d 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 _0xf46c=['get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','CannedAnswers','stack','name','send','index','CannedAnswer','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x278648,_0x23be73){var _0x10d2e5=function(_0x13d34b){while(--_0x13d34b){_0x278648['push'](_0x278648['shift']());}};_0x10d2e5(++_0x23be73);}(_0xf46c,0x1c2));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcf46('0x0'));var rimraf=require(_0xcf46('0x1'));var zipdir=require(_0xcf46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcf46('0x3'));var BPromise=require(_0xcf46('0x4'));var Mustache=require(_0xcf46('0x5'));var util=require(_0xcf46('0x6'));var path=require(_0xcf46('0x7'));var sox=require(_0xcf46('0x8'));var csv=require(_0xcf46('0x9'));var ejs=require(_0xcf46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf46('0xb'));var squel=require('squel');var crypto=require(_0xcf46('0xc'));var jsforce=require(_0xcf46('0xd'));var deskjs=require(_0xcf46('0xe'));var toCsv=require(_0xcf46('0x9'));var querystring=require(_0xcf46('0xf'));var Papa=require(_0xcf46('0x10'));var Redis=require(_0xcf46('0x11'));var authService=require(_0xcf46('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcf46('0x13'));var hardwareService=require(_0xcf46('0x14'));var logger=require(_0xcf46('0x15'))(_0xcf46('0x16'));var utils=require(_0xcf46('0x17'));var config=require(_0xcf46('0x18'));var licenseUtil=require(_0xcf46('0x19'));var db=require(_0xcf46('0x1a'))['db'];function respondWithStatusCode(_0x254978,_0x359e3e){_0x359e3e=_0x359e3e||0xcc;return function(_0x56d3ad){if(_0x56d3ad){return _0x254978[_0xcf46('0x1b')](_0x359e3e);}return _0x254978['status'](_0x359e3e)[_0xcf46('0x1c')]();};}function respondWithResult(_0x1f8886,_0x14960a){_0x14960a=_0x14960a||0xc8;return function(_0x121836){if(_0x121836){return _0x1f8886[_0xcf46('0x1d')](_0x14960a)[_0xcf46('0x1e')](_0x121836);}};}function respondWithFilteredResult(_0x1dfee1,_0x5351a5){return function(_0xf420){if(_0xf420){var _0x342df9=typeof _0x5351a5[_0xcf46('0x1f')]===_0xcf46('0x20')&&typeof _0x5351a5['limit']===_0xcf46('0x20');var _0x59c9e6=_0xf420[_0xcf46('0x21')];var _0x2846a3=_0x342df9?0x0:_0x5351a5[_0xcf46('0x1f')];var _0x104b0a=_0x342df9?_0xf420[_0xcf46('0x21')]:_0x5351a5[_0xcf46('0x1f')]+_0x5351a5[_0xcf46('0x22')];var _0x132a40;if(_0x104b0a>=_0x59c9e6){_0x104b0a=_0x59c9e6;_0x132a40=0xc8;}else{_0x132a40=0xce;}_0x1dfee1[_0xcf46('0x1d')](_0x132a40);return _0x1dfee1['set']('Content-Range',_0x2846a3+'-'+_0x104b0a+'/'+_0x59c9e6)[_0xcf46('0x1e')](_0xf420);}return null;};}function patchUpdates(_0x4b104b){return function(_0x1ea58f){try{jsonpatch[_0xcf46('0x23')](_0x1ea58f,_0x4b104b,!![]);}catch(_0x2e9545){return BPromise[_0xcf46('0x24')](_0x2e9545);}return _0x1ea58f[_0xcf46('0x25')]();};}function saveUpdates(_0x2a3d1b,_0x5ae708){return function(_0x3671db){if(_0x3671db){return _0x3671db[_0xcf46('0x26')](_0x2a3d1b)['then'](function(_0x595d67){return _0x595d67;});}return null;};}function removeEntity(_0x3cf799,_0xccc027){return function(_0x5012a6){if(_0x5012a6){return _0x5012a6[_0xcf46('0x27')]()[_0xcf46('0x28')](function(){var _0x2019b2=_0x5012a6['get']({'plain':!![]});var _0x3f144d=_0xcf46('0x29');return db['UserProfileResource'][_0xcf46('0x27')]({'where':{'type':_0x3f144d,'resourceId':_0x2019b2['id']}})[_0xcf46('0x28')](function(){return _0x5012a6;});})[_0xcf46('0x28')](function(){_0x3cf799[_0xcf46('0x1d')](0xcc)[_0xcf46('0x1c')]();});}};}function handleEntityNotFound(_0x3c75f8,_0x12cfe7){return function(_0x591e05){if(!_0x591e05){_0x3c75f8[_0xcf46('0x1b')](0x194);}return _0x591e05;};}function handleError(_0x4b16d7,_0x3a529e){_0x3a529e=_0x3a529e||0x1f4;return function(_0x2feb11){logger['error'](_0x2feb11[_0xcf46('0x2a')]);if(_0x2feb11[_0xcf46('0x2b')]){delete _0x2feb11[_0xcf46('0x2b')];}_0x4b16d7[_0xcf46('0x1d')](_0x3a529e)[_0xcf46('0x2c')](_0x2feb11);};}exports[_0xcf46('0x2d')]=function(_0x1aa055,_0x5b6a90){var _0x1f1ebd={},_0x222a81={},_0x43bab2={'count':0x0,'rows':[]};var _0x1fb163=_['map'](db[_0xcf46('0x2e')]['rawAttributes'],function(_0x1ee5f6){return{'name':_0x1ee5f6['fieldName'],'type':_0x1ee5f6[_0xcf46('0x2f')][_0xcf46('0x30')]};});_0x222a81[_0xcf46('0x31')]=_['map'](_0x1fb163,_0xcf46('0x2b'));_0x222a81['query']=_[_0xcf46('0x32')](_0x1aa055[_0xcf46('0x33')]);_0x222a81[_0xcf46('0x34')]=_[_0xcf46('0x35')](_0x222a81[_0xcf46('0x31')],_0x222a81[_0xcf46('0x33')]);_0x1f1ebd['attributes']=_[_0xcf46('0x35')](_0x222a81['model'],qs[_0xcf46('0x36')](_0x1aa055[_0xcf46('0x33')][_0xcf46('0x36')]));_0x1f1ebd['attributes']=_0x1f1ebd[_0xcf46('0x37')][_0xcf46('0x38')]?_0x1f1ebd[_0xcf46('0x37')]:_0x222a81[_0xcf46('0x31')];if(!_0x1aa055['query'][_0xcf46('0x39')]('nolimit')){_0x1f1ebd['limit']=qs[_0xcf46('0x22')](_0x1aa055[_0xcf46('0x33')]['limit']);_0x1f1ebd[_0xcf46('0x1f')]=qs[_0xcf46('0x1f')](_0x1aa055[_0xcf46('0x33')]['offset']);}_0x1f1ebd[_0xcf46('0x3a')]=qs[_0xcf46('0x3b')](_0x1aa055[_0xcf46('0x33')][_0xcf46('0x3b')]);_0x1f1ebd[_0xcf46('0x3c')]=qs[_0xcf46('0x34')](_[_0xcf46('0x3d')](_0x1aa055[_0xcf46('0x33')],_0x222a81[_0xcf46('0x34')]),_0x1fb163);if(_0x1aa055[_0xcf46('0x33')][_0xcf46('0x3e')]){_0x1f1ebd[_0xcf46('0x3c')]=_[_0xcf46('0x3f')](_0x1f1ebd[_0xcf46('0x3c')],{'$or':[{'key':{'$like':'%'+_0x1aa055['query']['filter']+'%'}},{'value':{'$like':'%'+_0x1aa055['query']['filter']+'%'}}]});}_0x1f1ebd=_[_0xcf46('0x3f')]({},_0x1f1ebd,_0x1aa055[_0xcf46('0x40')]);var _0x2f82a0={'where':_0x1f1ebd[_0xcf46('0x3c')]};return db[_0xcf46('0x2e')][_0xcf46('0x21')](_0x2f82a0)[_0xcf46('0x28')](function(_0x1319b3){_0x43bab2[_0xcf46('0x21')]=_0x1319b3;if(_0x1aa055[_0xcf46('0x33')]['includeAll']){_0x1f1ebd[_0xcf46('0x41')]=[{'all':!![]}];}return db[_0xcf46('0x2e')][_0xcf46('0x42')](_0x1f1ebd);})[_0xcf46('0x28')](function(_0x4ec70f){_0x43bab2[_0xcf46('0x43')]=_0x4ec70f;return _0x43bab2;})['then'](respondWithFilteredResult(_0x5b6a90,_0x1f1ebd))[_0xcf46('0x44')](handleError(_0x5b6a90,null));};exports[_0xcf46('0x45')]=function(_0x328ade,_0x541a74){var _0x4ce5f3={'raw':!![],'where':{'id':_0x328ade['params']['id']}},_0x17d3dc={};_0x17d3dc[_0xcf46('0x31')]=_[_0xcf46('0x32')](db[_0xcf46('0x2e')][_0xcf46('0x46')]);_0x17d3dc[_0xcf46('0x33')]=_[_0xcf46('0x32')](_0x328ade[_0xcf46('0x33')]);_0x17d3dc[_0xcf46('0x34')]=_[_0xcf46('0x35')](_0x17d3dc[_0xcf46('0x31')],_0x17d3dc[_0xcf46('0x33')]);_0x4ce5f3[_0xcf46('0x37')]=_['intersection'](_0x17d3dc[_0xcf46('0x31')],qs[_0xcf46('0x36')](_0x328ade[_0xcf46('0x33')][_0xcf46('0x36')]));_0x4ce5f3[_0xcf46('0x37')]=_0x4ce5f3[_0xcf46('0x37')][_0xcf46('0x38')]?_0x4ce5f3[_0xcf46('0x37')]:_0x17d3dc[_0xcf46('0x31')];if(_0x328ade[_0xcf46('0x33')][_0xcf46('0x47')]){_0x4ce5f3[_0xcf46('0x41')]=[{'all':!![]}];}_0x4ce5f3=_[_0xcf46('0x3f')]({},_0x4ce5f3,_0x328ade['options']);return db['CannedAnswer'][_0xcf46('0x48')](_0x4ce5f3)[_0xcf46('0x28')](handleEntityNotFound(_0x541a74,null))[_0xcf46('0x28')](respondWithResult(_0x541a74,null))[_0xcf46('0x44')](handleError(_0x541a74,null));};exports[_0xcf46('0x26')]=function(_0x2cdade,_0x168a32){if(_0x2cdade['body']['id']){delete _0x2cdade[_0xcf46('0x49')]['id'];}return db[_0xcf46('0x2e')]['find']({'where':{'id':_0x2cdade['params']['id']}})[_0xcf46('0x28')](handleEntityNotFound(_0x168a32,null))[_0xcf46('0x28')](saveUpdates(_0x2cdade[_0xcf46('0x49')],null))[_0xcf46('0x28')](respondWithResult(_0x168a32,null))[_0xcf46('0x44')](handleError(_0x168a32,null));};exports[_0xcf46('0x27')]=function(_0x1d1a78,_0x14e861){return db[_0xcf46('0x2e')][_0xcf46('0x48')]({'where':{'id':_0x1d1a78[_0xcf46('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14e861,null))[_0xcf46('0x28')](removeEntity(_0x14e861,null))[_0xcf46('0x44')](handleError(_0x14e861,null));};exports[_0xcf46('0x4b')]=function(_0x2a1e84,_0x1fc9c7){var _0x10360c={'key':_0x2a1e84[_0xcf46('0x49')]['key']};if(_0x2a1e84[_0xcf46('0x49')][_0xcf46('0x4c')]){_0x10360c[_0xcf46('0x4c')]=_0x2a1e84[_0xcf46('0x49')][_0xcf46('0x4c')];}else if(_0x2a1e84[_0xcf46('0x49')]['SmsAccountId']){_0x10360c[_0xcf46('0x4d')]=_0x2a1e84[_0xcf46('0x49')][_0xcf46('0x4d')];}else if(_0x2a1e84[_0xcf46('0x49')][_0xcf46('0x4e')]){_0x10360c[_0xcf46('0x4e')]=_0x2a1e84[_0xcf46('0x49')]['OpenchannelAccountId'];}else if(_0x2a1e84[_0xcf46('0x49')]['ChatWebsiteId']){_0x10360c['ChatWebsiteId']=_0x2a1e84[_0xcf46('0x49')]['ChatWebsiteId'];}return db[_0xcf46('0x2e')][_0xcf46('0x48')]({'where':_0x10360c})[_0xcf46('0x28')](function(_0x195a35){if(_0x195a35){throw new db[(_0xcf46('0x4f'))][(_0xcf46('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xcf46('0x4b')](_0x2a1e84[_0xcf46('0x49')]);})[_0xcf46('0x28')](function(_0x5e8e38){var _0x504013=_0x2a1e84['user']['get']({'plain':!![]});if(!_0x504013)throw new Error(_0xcf46('0x51'));if(_0x504013[_0xcf46('0x52')]===_0xcf46('0x53')){var _0x4ed0fd=_0x5e8e38[_0xcf46('0x54')]({'plain':!![]});return db[_0xcf46('0x55')][_0xcf46('0x48')]({'where':{'name':_0xcf46('0x29'),'userProfileId':_0x504013[_0xcf46('0x56')]},'raw':!![]})[_0xcf46('0x28')](function(_0x563c42){if(_0x563c42&&_0x563c42[_0xcf46('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x4ed0fd[_0xcf46('0x2b')],'resourceId':_0x4ed0fd['id'],'type':_0x563c42['name'],'sectionId':_0x563c42['id']},{})['then'](function(){return _0x5e8e38;});}else{return _0x5e8e38;}})[_0xcf46('0x44')](function(_0x2a319a){logger['error'](_0xcf46('0x58'),_0x2a319a);throw _0x2a319a;});}return _0x5e8e38;})['then'](respondWithResult(_0x1fc9c7,0xc9))['catch'](handleError(_0x1fc9c7,null));};
\ No newline at end of file
+var _0x74b8=['index','map','CannedAnswer','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','keys','length','includeAll','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','get','CannedAnswers','error','stack','name','send'];(function(_0xbbf487,_0x502b1f){var _0x194eaa=function(_0x48d609){while(--_0x48d609){_0xbbf487['push'](_0xbbf487['shift']());}};_0x194eaa(++_0x502b1f);}(_0x74b8,0x86));var _0x874b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x74b8[_0x47e7cb];return _0x2a8874;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x874b('0x0'));var jsonpatch=require(_0x874b('0x1'));var rp=require(_0x874b('0x2'));var moment=require(_0x874b('0x3'));var BPromise=require(_0x874b('0x4'));var Mustache=require(_0x874b('0x5'));var util=require(_0x874b('0x6'));var path=require(_0x874b('0x7'));var sox=require(_0x874b('0x8'));var csv=require(_0x874b('0x9'));var ejs=require(_0x874b('0xa'));var fs=require('fs');var fs_extra=require(_0x874b('0xb'));var _=require(_0x874b('0xc'));var squel=require(_0x874b('0xd'));var crypto=require(_0x874b('0xe'));var jsforce=require(_0x874b('0xf'));var deskjs=require(_0x874b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x874b('0x11'));var Papa=require(_0x874b('0x12'));var Redis=require(_0x874b('0x13'));var authService=require(_0x874b('0x14'));var qs=require(_0x874b('0x15'));var as=require(_0x874b('0x16'));var hardwareService=require(_0x874b('0x17'));var logger=require('../../config/logger')(_0x874b('0x18'));var utils=require(_0x874b('0x19'));var config=require(_0x874b('0x1a'));var licenseUtil=require(_0x874b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41fbcf,_0x406c92){_0x406c92=_0x406c92||0xcc;return function(_0x228cb9){if(_0x228cb9){return _0x41fbcf[_0x874b('0x1c')](_0x406c92);}return _0x41fbcf['status'](_0x406c92)[_0x874b('0x1d')]();};}function respondWithResult(_0x7d8b82,_0x12599f){_0x12599f=_0x12599f||0xc8;return function(_0x3ee409){if(_0x3ee409){return _0x7d8b82[_0x874b('0x1e')](_0x12599f)['json'](_0x3ee409);}};}function respondWithFilteredResult(_0x400ba2,_0x9a140c){return function(_0x3eb081){if(_0x3eb081){var _0x4c327e=typeof _0x9a140c[_0x874b('0x1f')]===_0x874b('0x20')&&typeof _0x9a140c['limit']===_0x874b('0x20');var _0x230612=_0x3eb081[_0x874b('0x21')];var _0x27d943=_0x4c327e?0x0:_0x9a140c['offset'];var _0x14ad57=_0x4c327e?_0x3eb081['count']:_0x9a140c['offset']+_0x9a140c[_0x874b('0x22')];var _0x4c701a;if(_0x14ad57>=_0x230612){_0x14ad57=_0x230612;_0x4c701a=0xc8;}else{_0x4c701a=0xce;}_0x400ba2[_0x874b('0x1e')](_0x4c701a);return _0x400ba2[_0x874b('0x23')](_0x874b('0x24'),_0x27d943+'-'+_0x14ad57+'/'+_0x230612)[_0x874b('0x25')](_0x3eb081);}return null;};}function patchUpdates(_0x1d2ff7){return function(_0x5a6e95){try{jsonpatch[_0x874b('0x26')](_0x5a6e95,_0x1d2ff7,!![]);}catch(_0x5972fd){return BPromise['reject'](_0x5972fd);}return _0x5a6e95[_0x874b('0x27')]();};}function saveUpdates(_0x56496d,_0x3a1589){return function(_0x3c7bb3){if(_0x3c7bb3){return _0x3c7bb3['update'](_0x56496d)[_0x874b('0x28')](function(_0x233dec){return _0x233dec;});}return null;};}function removeEntity(_0x185d6a,_0x28dfb6){return function(_0x30b18c){if(_0x30b18c){return _0x30b18c[_0x874b('0x29')]()[_0x874b('0x28')](function(){var _0x451f72=_0x30b18c[_0x874b('0x2a')]({'plain':!![]});var _0x5bcb28=_0x874b('0x2b');return db['UserProfileResource'][_0x874b('0x29')]({'where':{'type':_0x5bcb28,'resourceId':_0x451f72['id']}})[_0x874b('0x28')](function(){return _0x30b18c;});})[_0x874b('0x28')](function(){_0x185d6a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a07cc,_0x5322ec){return function(_0x14c612){if(!_0x14c612){_0x3a07cc[_0x874b('0x1c')](0x194);}return _0x14c612;};}function handleError(_0x3cfc1d,_0x23ed47){_0x23ed47=_0x23ed47||0x1f4;return function(_0xc95305){logger[_0x874b('0x2c')](_0xc95305[_0x874b('0x2d')]);if(_0xc95305[_0x874b('0x2e')]){delete _0xc95305[_0x874b('0x2e')];}_0x3cfc1d[_0x874b('0x1e')](_0x23ed47)[_0x874b('0x2f')](_0xc95305);};}exports[_0x874b('0x30')]=function(_0x21695c,_0x1f97db){var _0x134c3b={},_0x39b492={},_0x3ef959={'count':0x0,'rows':[]};var _0x250d40=_[_0x874b('0x31')](db[_0x874b('0x32')][_0x874b('0x33')],function(_0x182239){return{'name':_0x182239['fieldName'],'type':_0x182239[_0x874b('0x34')][_0x874b('0x35')]};});_0x39b492[_0x874b('0x36')]=_['map'](_0x250d40,'name');_0x39b492['query']=_['keys'](_0x21695c['query']);_0x39b492[_0x874b('0x37')]=_[_0x874b('0x38')](_0x39b492['model'],_0x39b492[_0x874b('0x39')]);_0x134c3b[_0x874b('0x3a')]=_[_0x874b('0x38')](_0x39b492['model'],qs[_0x874b('0x3b')](_0x21695c['query'][_0x874b('0x3b')]));_0x134c3b['attributes']=_0x134c3b[_0x874b('0x3a')]['length']?_0x134c3b[_0x874b('0x3a')]:_0x39b492[_0x874b('0x36')];if(!_0x21695c[_0x874b('0x39')][_0x874b('0x3c')]('nolimit')){_0x134c3b[_0x874b('0x22')]=qs[_0x874b('0x22')](_0x21695c[_0x874b('0x39')][_0x874b('0x22')]);_0x134c3b['offset']=qs[_0x874b('0x1f')](_0x21695c[_0x874b('0x39')][_0x874b('0x1f')]);}_0x134c3b[_0x874b('0x3d')]=qs[_0x874b('0x3e')](_0x21695c['query']['sort']);_0x134c3b[_0x874b('0x3f')]=qs[_0x874b('0x37')](_['pick'](_0x21695c['query'],_0x39b492[_0x874b('0x37')]),_0x250d40);if(_0x21695c[_0x874b('0x39')][_0x874b('0x40')]){_0x134c3b[_0x874b('0x3f')]=_['merge'](_0x134c3b['where'],{'$or':[{'key':{'$like':'%'+_0x21695c[_0x874b('0x39')][_0x874b('0x40')]+'%'}},{'value':{'$like':'%'+_0x21695c[_0x874b('0x39')][_0x874b('0x40')]+'%'}}]});}_0x134c3b=_[_0x874b('0x41')]({},_0x134c3b,_0x21695c['options']);var _0x447d7a={'where':_0x134c3b[_0x874b('0x3f')]};return db[_0x874b('0x32')][_0x874b('0x21')](_0x447d7a)[_0x874b('0x28')](function(_0x5e9d4f){_0x3ef959[_0x874b('0x21')]=_0x5e9d4f;if(_0x21695c[_0x874b('0x39')]['includeAll']){_0x134c3b[_0x874b('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x874b('0x43')](_0x134c3b);})[_0x874b('0x28')](function(_0x38eaea){_0x3ef959[_0x874b('0x44')]=_0x38eaea;return _0x3ef959;})[_0x874b('0x28')](respondWithFilteredResult(_0x1f97db,_0x134c3b))[_0x874b('0x45')](handleError(_0x1f97db,null));};exports[_0x874b('0x46')]=function(_0x1bd302,_0x45700d){var _0x549f58={'raw':!![],'where':{'id':_0x1bd302[_0x874b('0x47')]['id']}},_0x586acd={};_0x586acd['model']=_[_0x874b('0x48')](db[_0x874b('0x32')][_0x874b('0x33')]);_0x586acd['query']=_[_0x874b('0x48')](_0x1bd302['query']);_0x586acd['filters']=_[_0x874b('0x38')](_0x586acd[_0x874b('0x36')],_0x586acd[_0x874b('0x39')]);_0x549f58[_0x874b('0x3a')]=_[_0x874b('0x38')](_0x586acd[_0x874b('0x36')],qs['fields'](_0x1bd302['query'][_0x874b('0x3b')]));_0x549f58[_0x874b('0x3a')]=_0x549f58[_0x874b('0x3a')][_0x874b('0x49')]?_0x549f58[_0x874b('0x3a')]:_0x586acd[_0x874b('0x36')];if(_0x1bd302['query'][_0x874b('0x4a')]){_0x549f58['include']=[{'all':!![]}];}_0x549f58=_[_0x874b('0x41')]({},_0x549f58,_0x1bd302[_0x874b('0x4b')]);return db[_0x874b('0x32')][_0x874b('0x4c')](_0x549f58)[_0x874b('0x28')](handleEntityNotFound(_0x45700d,null))[_0x874b('0x28')](respondWithResult(_0x45700d,null))[_0x874b('0x45')](handleError(_0x45700d,null));};exports[_0x874b('0x4d')]=function(_0x4c17da,_0x4bd520){if(_0x4c17da['body']['id']){delete _0x4c17da[_0x874b('0x4e')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4c17da[_0x874b('0x47')]['id']}})[_0x874b('0x28')](handleEntityNotFound(_0x4bd520,null))[_0x874b('0x28')](saveUpdates(_0x4c17da[_0x874b('0x4e')],null))[_0x874b('0x28')](respondWithResult(_0x4bd520,null))[_0x874b('0x45')](handleError(_0x4bd520,null));};exports[_0x874b('0x29')]=function(_0x5d68a4,_0xe9f36){return db[_0x874b('0x32')][_0x874b('0x4c')]({'where':{'id':_0x5d68a4['params']['id']}})[_0x874b('0x28')](handleEntityNotFound(_0xe9f36,null))[_0x874b('0x28')](removeEntity(_0xe9f36,null))[_0x874b('0x45')](handleError(_0xe9f36,null));};exports[_0x874b('0x4f')]=function(_0x9ed7dd,_0x13c19d){var _0xb028a2={'key':_0x9ed7dd[_0x874b('0x4e')][_0x874b('0x35')]};if(_0x9ed7dd[_0x874b('0x4e')][_0x874b('0x50')]){_0xb028a2[_0x874b('0x50')]=_0x9ed7dd[_0x874b('0x4e')]['MailAccountId'];}else if(_0x9ed7dd[_0x874b('0x4e')][_0x874b('0x51')]){_0xb028a2[_0x874b('0x51')]=_0x9ed7dd[_0x874b('0x4e')]['SmsAccountId'];}else if(_0x9ed7dd['body']['OpenchannelAccountId']){_0xb028a2[_0x874b('0x52')]=_0x9ed7dd[_0x874b('0x4e')]['OpenchannelAccountId'];}else if(_0x9ed7dd[_0x874b('0x4e')]['ChatWebsiteId']){_0xb028a2[_0x874b('0x53')]=_0x9ed7dd[_0x874b('0x4e')][_0x874b('0x53')];}return db[_0x874b('0x32')][_0x874b('0x4c')]({'where':_0xb028a2})[_0x874b('0x28')](function(_0x4f84c4){if(_0x4f84c4){throw new db[(_0x874b('0x54'))][(_0x874b('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x874b('0x32')]['create'](_0x9ed7dd[_0x874b('0x4e')]);})[_0x874b('0x28')](function(_0x4dcdf9){var _0x34cf01=_0x9ed7dd[_0x874b('0x56')][_0x874b('0x2a')]({'plain':!![]});if(!_0x34cf01)throw new Error(_0x874b('0x57'));if(_0x34cf01['role']===_0x874b('0x56')){var _0x1b8349=_0x4dcdf9['get']({'plain':!![]});return db[_0x874b('0x58')][_0x874b('0x4c')]({'where':{'name':'CannedAnswers','userProfileId':_0x34cf01[_0x874b('0x59')]},'raw':!![]})[_0x874b('0x28')](function(_0x347619){if(_0x347619&&_0x347619[_0x874b('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b8349['name'],'resourceId':_0x1b8349['id'],'type':_0x347619[_0x874b('0x2e')],'sectionId':_0x347619['id']},{})[_0x874b('0x28')](function(){return _0x4dcdf9;});}else{return _0x4dcdf9;}})[_0x874b('0x45')](function(_0x41e332){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41e332);throw _0x41e332;});}return _0x4dcdf9;})['then'](respondWithResult(_0x13c19d,0xc9))['catch'](handleError(_0x13c19d,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 37f8c40..46e7d14 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 _0x6fd3=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x382342,_0x3a5274){var _0x449930=function(_0x352f48){while(--_0x352f48){_0x382342['push'](_0x382342['shift']());}};_0x449930(++_0x3a5274);}(_0x6fd3,0x1ee));var _0x36fd=function(_0x34e6af,_0x36c00a){_0x34e6af=_0x34e6af-0x0;var _0x8592ed=_0x6fd3[_0x34e6af];return _0x8592ed;};'use strict';var _=require(_0x36fd('0x0'));var util=require(_0x36fd('0x1'));var logger=require(_0x36fd('0x2'))(_0x36fd('0x3'));var moment=require(_0x36fd('0x4'));var BPromise=require('bluebird');var rp=require(_0x36fd('0x5'));var fs=require('fs');var path=require(_0x36fd('0x6'));var rimraf=require('rimraf');var config=require(_0x36fd('0x7'));var attributes=require(_0x36fd('0x8'));module[_0x36fd('0x9')]=function(_0x868060,_0x235bc9){return _0x868060[_0x36fd('0xa')](_0x36fd('0xb'),attributes,{'tableName':_0x36fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x36fd('0xd'),'collate':_0x36fd('0xe')});};
\ No newline at end of file
+var _0x0163=['bluebird','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x0163,0xa4));var _0x3016=function(_0x408dd9,_0x2cd63d){_0x408dd9=_0x408dd9-0x0;var _0x40f209=_0x0163[_0x408dd9];return _0x40f209;};'use strict';var _=require(_0x3016('0x0'));var util=require(_0x3016('0x1'));var logger=require(_0x3016('0x2'))(_0x3016('0x3'));var moment=require(_0x3016('0x4'));var BPromise=require(_0x3016('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3016('0x6'));var config=require(_0x3016('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x3016('0x8')]=function(_0x3a610d,_0x251d2b){return _0x3a610d[_0x3016('0x9')](_0x3016('0xa'),attributes,{'tableName':_0x3016('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3016('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index f35a065..c2a3029 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(_0x583c91,_0x229c7e){var _0x28a440=function(_0x351eaa){while(--_0x351eaa){_0x583c91['push'](_0x583c91['shift']());}};_0x28a440(++_0x229c7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16bd23,_0x41f3a9){var _0x191783=function(_0x9459ec){while(--_0x9459ec){_0x16bd23['push'](_0x16bd23['shift']());}};_0x191783(++_0x41f3a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 c858172..f678b09 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 _0x89b4=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x10ac11,_0x1782e8){var _0xace7c5=function(_0x5f3c2c){while(--_0x5f3c2c){_0x10ac11['push'](_0x10ac11['shift']());}};_0xace7c5(++_0x1782e8);}(_0x89b4,0x89));var _0x489b=function(_0x534524,_0x192f26){_0x534524=_0x534524-0x0;var _0x510e84=_0x89b4[_0x534524];return _0x510e84;};'use strict';var multer=require(_0x489b('0x0'));var util=require(_0x489b('0x1'));var path=require(_0x489b('0x2'));var timeout=require(_0x489b('0x3'));var express=require(_0x489b('0x4'));var router=express[_0x489b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x489b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x489b('0x7'));var controller=require(_0x489b('0x8'));router[_0x489b('0x9')]('/',auth[_0x489b('0xa')](),controller[_0x489b('0xb')]);router[_0x489b('0x9')](_0x489b('0xc'),auth[_0x489b('0xa')](),controller[_0x489b('0xd')]);router[_0x489b('0xe')]('/',auth[_0x489b('0xa')](),controller['create']);router[_0x489b('0xf')](_0x489b('0xc'),auth[_0x489b('0xa')](),controller[_0x489b('0x10')]);router[_0x489b('0x11')](_0x489b('0xc'),auth[_0x489b('0xa')](),controller[_0x489b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x35cd=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','create','update','delete','destroy','exports'];(function(_0x45df06,_0x212694){var _0x28ae4b=function(_0x2ffbfa){while(--_0x2ffbfa){_0x45df06['push'](_0x45df06['shift']());}};_0x28ae4b(++_0x212694);}(_0x35cd,0x90));var _0xd35c=function(_0x18c59d,_0x127a90){_0x18c59d=_0x18c59d-0x0;var _0x592891=_0x35cd[_0x18c59d];return _0x592891;};'use strict';var multer=require('multer');var util=require(_0xd35c('0x0'));var path=require(_0xd35c('0x1'));var timeout=require('connect-timeout');var express=require(_0xd35c('0x2'));var router=express[_0xd35c('0x3')]();var fs_extra=require(_0xd35c('0x4'));var auth=require(_0xd35c('0x5'));var interaction=require(_0xd35c('0x6'));var config=require(_0xd35c('0x7'));var controller=require(_0xd35c('0x8'));router[_0xd35c('0x9')]('/',auth['isAuthenticated'](),controller[_0xd35c('0xa')]);router['get'](_0xd35c('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd35c('0xc')](),controller[_0xd35c('0xd')]);router['put'](_0xd35c('0xb'),auth[_0xd35c('0xc')](),controller[_0xd35c('0xe')]);router[_0xd35c('0xf')](_0xd35c('0xb'),auth[_0xd35c('0xc')](),controller[_0xd35c('0x10')]);module[_0xd35c('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7d69f87..615f403 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 _0x9c54=['sequelize','STRING','INTEGER'];(function(_0x2decbd,_0x390205){var _0x3979e5=function(_0x277fa5){while(--_0x277fa5){_0x2decbd['push'](_0x2decbd['shift']());}};_0x3979e5(++_0x390205);}(_0x9c54,0x120));var _0x49c5=function(_0x336e8b,_0x338dd9){_0x336e8b=_0x336e8b-0x0;var _0x280150=_0x9c54[_0x336e8b];return _0x280150;};'use strict';var Sequelize=require(_0x49c5('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x49c5('0x1')]},'dst':{'type':Sequelize[_0x49c5('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x49c5('0x1')]},'dstchannel':{'type':Sequelize[_0x49c5('0x1')]},'lastapp':{'type':Sequelize[_0x49c5('0x1')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x49c5('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x49c5('0x1')]},'amaflags':{'type':Sequelize[_0x49c5('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x49c5('0x1')]},'userfield':{'type':Sequelize[_0x49c5('0x1')]},'uniqueid':{'type':Sequelize[_0x49c5('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x49c5('0x1')]},'peeraccount':{'type':Sequelize[_0x49c5('0x1')]},'type':{'type':Sequelize[_0x49c5('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb010=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x4e03b4,_0x1fd68c){var _0x5acf51=function(_0x597dba){while(--_0x597dba){_0x4e03b4['push'](_0x4e03b4['shift']());}};_0x5acf51(++_0x1fd68c);}(_0xb010,0x8b));var _0x0b01=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb010[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require('sequelize');module[_0x0b01('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0b01('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0b01('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0b01('0x2')]},'channel':{'type':Sequelize[_0x0b01('0x2')]},'dstchannel':{'type':Sequelize[_0x0b01('0x2')]},'lastapp':{'type':Sequelize[_0x0b01('0x2')]},'lastdata':{'type':Sequelize[_0x0b01('0x2')]},'duration':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b01('0x2')]},'amaflags':{'type':Sequelize[_0x0b01('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b01('0x2')]},'userfield':{'type':Sequelize[_0x0b01('0x2')]},'uniqueid':{'type':Sequelize[_0x0b01('0x2')]},'linkedid':{'type':Sequelize[_0x0b01('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0b01('0x2')]},'type':{'type':Sequelize[_0x0b01('0x2')]},'tag':{'type':Sequelize[_0x0b01('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 712d998..1beb51d 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 _0xa0a1=['querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','set','apply','reject','then','destroy','end','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','options','create','body','update','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2dfe6a,_0x571fd7){var _0x14cccd=function(_0x66f02a){while(--_0x66f02a){_0x2dfe6a['push'](_0x2dfe6a['shift']());}};_0x14cccd(++_0x571fd7);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x1e4ac8,_0x4260bd){_0x1e4ac8=_0x1e4ac8-0x0;var _0x1b85db=_0xa0a1[_0x1e4ac8];return _0x1b85db;};'use strict';var emlformat=require(_0x1a0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0a('0x1'));var jsonpatch=require(_0x1a0a('0x2'));var rp=require(_0x1a0a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a0a('0x4'));var util=require(_0x1a0a('0x5'));var path=require('path');var sox=require(_0x1a0a('0x6'));var csv=require(_0x1a0a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a0a('0x8'));var _=require(_0x1a0a('0x9'));var squel=require(_0x1a0a('0xa'));var crypto=require(_0x1a0a('0xb'));var jsforce=require(_0x1a0a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1a0a('0x7'));var querystring=require(_0x1a0a('0xd'));var Papa=require(_0x1a0a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a0a('0xf'));var hardwareService=require(_0x1a0a('0x10'));var logger=require(_0x1a0a('0x11'))('api');var utils=require(_0x1a0a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1a0a('0x13'));var db=require(_0x1a0a('0x14'))['db'];function respondWithStatusCode(_0x461b36,_0x1877bf){_0x1877bf=_0x1877bf||0xcc;return function(_0x289046){if(_0x289046){return _0x461b36[_0x1a0a('0x15')](_0x1877bf);}return _0x461b36[_0x1a0a('0x16')](_0x1877bf)['end']();};}function respondWithResult(_0x88d191,_0x3b0b2d){_0x3b0b2d=_0x3b0b2d||0xc8;return function(_0x3c531c){if(_0x3c531c){return _0x88d191[_0x1a0a('0x16')](_0x3b0b2d)[_0x1a0a('0x17')](_0x3c531c);}};}function respondWithFilteredResult(_0x4c8080,_0x16b8c9){return function(_0x80627b){if(_0x80627b){var _0x157b74=typeof _0x16b8c9['offset']===_0x1a0a('0x18')&&typeof _0x16b8c9['limit']===_0x1a0a('0x18');var _0x57f65d=_0x80627b['count'];var _0x3a988c=_0x157b74?0x0:_0x16b8c9[_0x1a0a('0x19')];var _0x307fdc=_0x157b74?_0x80627b[_0x1a0a('0x1a')]:_0x16b8c9['offset']+_0x16b8c9['limit'];var _0x239065;if(_0x307fdc>=_0x57f65d){_0x307fdc=_0x57f65d;_0x239065=0xc8;}else{_0x239065=0xce;}_0x4c8080[_0x1a0a('0x16')](_0x239065);return _0x4c8080[_0x1a0a('0x1b')]('Content-Range',_0x3a988c+'-'+_0x307fdc+'/'+_0x57f65d)[_0x1a0a('0x17')](_0x80627b);}return null;};}function patchUpdates(_0x3547fe){return function(_0x5bb4bd){try{jsonpatch[_0x1a0a('0x1c')](_0x5bb4bd,_0x3547fe,!![]);}catch(_0x1ba27f){return BPromise[_0x1a0a('0x1d')](_0x1ba27f);}return _0x5bb4bd['save']();};}function saveUpdates(_0x159a2a,_0xc33284){return function(_0x1f4083){if(_0x1f4083){return _0x1f4083['update'](_0x159a2a)[_0x1a0a('0x1e')](function(_0x47ef88){return _0x47ef88;});}return null;};}function removeEntity(_0x28c094,_0x2d426d){return function(_0x2d7967){if(_0x2d7967){return _0x2d7967[_0x1a0a('0x1f')]()[_0x1a0a('0x1e')](function(){_0x28c094['status'](0xcc)[_0x1a0a('0x20')]();});}};}function handleEntityNotFound(_0x8e4151,_0x561407){return function(_0x4cf939){if(!_0x4cf939){_0x8e4151[_0x1a0a('0x15')](0x194);}return _0x4cf939;};}function handleError(_0x184de8,_0x3f61e4){_0x3f61e4=_0x3f61e4||0x1f4;return function(_0x365ab5){logger[_0x1a0a('0x21')](_0x365ab5[_0x1a0a('0x22')]);if(_0x365ab5[_0x1a0a('0x23')]){delete _0x365ab5[_0x1a0a('0x23')];}_0x184de8[_0x1a0a('0x16')](_0x3f61e4)[_0x1a0a('0x24')](_0x365ab5);};}exports[_0x1a0a('0x25')]=function(_0x35fd0a,_0x354d89){var _0x385f2b={},_0x396c01={},_0x3069ab={'count':0x0,'rows':[]};var _0x297b12=_['map'](db[_0x1a0a('0x26')][_0x1a0a('0x27')],function(_0x36ca44){return{'name':_0x36ca44[_0x1a0a('0x28')],'type':_0x36ca44[_0x1a0a('0x29')][_0x1a0a('0x2a')]};});_0x396c01[_0x1a0a('0x2b')]=_[_0x1a0a('0x2c')](_0x297b12,_0x1a0a('0x23'));_0x396c01[_0x1a0a('0x2d')]=_['keys'](_0x35fd0a[_0x1a0a('0x2d')]);_0x396c01[_0x1a0a('0x2e')]=_['intersection'](_0x396c01[_0x1a0a('0x2b')],_0x396c01['query']);_0x385f2b['attributes']=_[_0x1a0a('0x2f')](_0x396c01[_0x1a0a('0x2b')],qs['fields'](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x30')]));_0x385f2b[_0x1a0a('0x31')]=_0x385f2b['attributes'][_0x1a0a('0x32')]?_0x385f2b[_0x1a0a('0x31')]:_0x396c01['model'];if(!_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x33')]('nolimit')){_0x385f2b[_0x1a0a('0x34')]=qs[_0x1a0a('0x34')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x34')]);_0x385f2b['offset']=qs[_0x1a0a('0x19')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x19')]);}_0x385f2b[_0x1a0a('0x35')]=qs[_0x1a0a('0x36')](_0x35fd0a[_0x1a0a('0x2d')][_0x1a0a('0x36')]);_0x385f2b[_0x1a0a('0x37')]=qs[_0x1a0a('0x2e')](_['pick'](_0x35fd0a['query'],_0x396c01['filters']),_0x297b12);if(_0x35fd0a['query'][_0x1a0a('0x38')]){_0x385f2b['where']=_[_0x1a0a('0x39')](_0x385f2b[_0x1a0a('0x37')],{'$or':_['map'](_0x297b12,function(_0x5f586c){if(_0x5f586c[_0x1a0a('0x29')]!==_0x1a0a('0x3a')){var _0x13042e={};_0x13042e[_0x5f586c[_0x1a0a('0x23')]]={'$like':'%'+_0x35fd0a['query'][_0x1a0a('0x38')]+'%'};return _0x13042e;}})});}_0x385f2b=_['merge']({},_0x385f2b,_0x35fd0a['options']);var _0x4852e8={'where':_0x385f2b[_0x1a0a('0x37')]};return db[_0x1a0a('0x26')]['count'](_0x4852e8)[_0x1a0a('0x1e')](function(_0x2dcda5){_0x3069ab['count']=_0x2dcda5;if(_0x35fd0a['query'][_0x1a0a('0x3b')]){_0x385f2b[_0x1a0a('0x3c')]=[{'all':!![]}];}return db['Cdr'][_0x1a0a('0x3d')](_0x385f2b);})[_0x1a0a('0x1e')](function(_0x56cfd6){_0x3069ab[_0x1a0a('0x3e')]=_0x56cfd6;return _0x3069ab;})['then'](respondWithFilteredResult(_0x354d89,_0x385f2b))[_0x1a0a('0x3f')](handleError(_0x354d89,null));};exports['show']=function(_0x2dfcfb,_0x7b6e14){var _0x3466f6={'raw':!![],'where':{'id':_0x2dfcfb['params']['id']}},_0x2a72b7={};_0x2a72b7[_0x1a0a('0x2b')]=_[_0x1a0a('0x40')](db[_0x1a0a('0x26')][_0x1a0a('0x27')]);_0x2a72b7['query']=_[_0x1a0a('0x40')](_0x2dfcfb[_0x1a0a('0x2d')]);_0x2a72b7['filters']=_[_0x1a0a('0x2f')](_0x2a72b7[_0x1a0a('0x2b')],_0x2a72b7[_0x1a0a('0x2d')]);_0x3466f6[_0x1a0a('0x31')]=_[_0x1a0a('0x2f')](_0x2a72b7[_0x1a0a('0x2b')],qs[_0x1a0a('0x30')](_0x2dfcfb[_0x1a0a('0x2d')][_0x1a0a('0x30')]));_0x3466f6[_0x1a0a('0x31')]=_0x3466f6['attributes'][_0x1a0a('0x32')]?_0x3466f6[_0x1a0a('0x31')]:_0x2a72b7['model'];if(_0x2dfcfb['query']['includeAll']){_0x3466f6['include']=[{'all':!![]}];}_0x3466f6=_[_0x1a0a('0x39')]({},_0x3466f6,_0x2dfcfb[_0x1a0a('0x41')]);return db['Cdr']['find'](_0x3466f6)['then'](handleEntityNotFound(_0x7b6e14,null))[_0x1a0a('0x1e')](respondWithResult(_0x7b6e14,null))[_0x1a0a('0x3f')](handleError(_0x7b6e14,null));};exports[_0x1a0a('0x42')]=function(_0x2c58a9,_0x4678da){return db[_0x1a0a('0x26')][_0x1a0a('0x42')](_0x2c58a9[_0x1a0a('0x43')],{})[_0x1a0a('0x1e')](respondWithResult(_0x4678da,0xc9))[_0x1a0a('0x3f')](handleError(_0x4678da,null));};exports[_0x1a0a('0x44')]=function(_0x2bab64,_0x23a985){if(_0x2bab64['body']['id']){delete _0x2bab64[_0x1a0a('0x43')]['id'];}return db[_0x1a0a('0x26')][_0x1a0a('0x45')]({'where':{'id':_0x2bab64['params']['id']}})[_0x1a0a('0x1e')](handleEntityNotFound(_0x23a985,null))[_0x1a0a('0x1e')](saveUpdates(_0x2bab64['body'],null))[_0x1a0a('0x1e')](respondWithResult(_0x23a985,null))[_0x1a0a('0x3f')](handleError(_0x23a985,null));};exports['destroy']=function(_0x555b6d,_0x313e79){return db['Cdr']['find']({'where':{'id':_0x555b6d[_0x1a0a('0x46')]['id']}})['then'](handleEntityNotFound(_0x313e79,null))[_0x1a0a('0x1e')](removeEntity(_0x313e79,null))[_0x1a0a('0x3f')](handleError(_0x313e79,null));};exports[_0x1a0a('0x47')]=function(_0x3678c7,_0x22a0f9){return db[_0x1a0a('0x26')][_0x1a0a('0x47')]()[_0x1a0a('0x1e')](respondWithResult(_0x22a0f9,null))[_0x1a0a('0x3f')](handleError(_0x22a0f9,null));};
\ No newline at end of file
+var _0x9206=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','Cdr','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel'];(function(_0x155fa5,_0x3c4b3e){var _0x47a72e=function(_0x386208){while(--_0x386208){_0x155fa5['push'](_0x155fa5['shift']());}};_0x47a72e(++_0x3c4b3e);}(_0x9206,0x176));var _0x6920=function(_0x48e414,_0x1d1f85){_0x48e414=_0x48e414-0x0;var _0x171890=_0x9206[_0x48e414];return _0x171890;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];function respondWithStatusCode(_0x5ad438,_0x4f8430){_0x4f8430=_0x4f8430||0xcc;return function(_0x31730c){if(_0x31730c){return _0x5ad438[_0x6920('0x1a')](_0x4f8430);}return _0x5ad438['status'](_0x4f8430)[_0x6920('0x1b')]();};}function respondWithResult(_0xfa2823,_0x18140a){_0x18140a=_0x18140a||0xc8;return function(_0x2c3a35){if(_0x2c3a35){return _0xfa2823[_0x6920('0x1c')](_0x18140a)['json'](_0x2c3a35);}};}function respondWithFilteredResult(_0x338e5f,_0x20cdfb){return function(_0x15d8af){if(_0x15d8af){var _0xa64034=typeof _0x20cdfb[_0x6920('0x1d')]===_0x6920('0x1e')&&typeof _0x20cdfb[_0x6920('0x1f')]===_0x6920('0x1e');var _0x11ce91=_0x15d8af[_0x6920('0x20')];var _0x462500=_0xa64034?0x0:_0x20cdfb[_0x6920('0x1d')];var _0xc6e86b=_0xa64034?_0x15d8af[_0x6920('0x20')]:_0x20cdfb[_0x6920('0x1d')]+_0x20cdfb['limit'];var _0x3a0c0c;if(_0xc6e86b>=_0x11ce91){_0xc6e86b=_0x11ce91;_0x3a0c0c=0xc8;}else{_0x3a0c0c=0xce;}_0x338e5f[_0x6920('0x1c')](_0x3a0c0c);return _0x338e5f[_0x6920('0x21')](_0x6920('0x22'),_0x462500+'-'+_0xc6e86b+'/'+_0x11ce91)[_0x6920('0x23')](_0x15d8af);}return null;};}function patchUpdates(_0x16cb96){return function(_0x2cce0b){try{jsonpatch[_0x6920('0x24')](_0x2cce0b,_0x16cb96,!![]);}catch(_0xaf93ba){return BPromise[_0x6920('0x25')](_0xaf93ba);}return _0x2cce0b[_0x6920('0x26')]();};}function saveUpdates(_0x39013e,_0x1df372){return function(_0x2dd788){if(_0x2dd788){return _0x2dd788[_0x6920('0x27')](_0x39013e)[_0x6920('0x28')](function(_0x1ae686){return _0x1ae686;});}return null;};}function removeEntity(_0x3a6e48,_0xa8f55){return function(_0x258986){if(_0x258986){return _0x258986['destroy']()[_0x6920('0x28')](function(){_0x3a6e48['status'](0xcc)[_0x6920('0x1b')]();});}};}function handleEntityNotFound(_0x4dd08b,_0x72316a){return function(_0x32a6ae){if(!_0x32a6ae){_0x4dd08b[_0x6920('0x1a')](0x194);}return _0x32a6ae;};}function handleError(_0xd069c,_0x5868e1){_0x5868e1=_0x5868e1||0x1f4;return function(_0x1cab00){logger[_0x6920('0x29')](_0x1cab00[_0x6920('0x2a')]);if(_0x1cab00[_0x6920('0x2b')]){delete _0x1cab00[_0x6920('0x2b')];}_0xd069c[_0x6920('0x1c')](_0x5868e1)[_0x6920('0x2c')](_0x1cab00);};}exports[_0x6920('0x2d')]=function(_0x400894,_0x2f5ce8){var _0x6860c7={},_0x2b2cd9={},_0x548fbc={'count':0x0,'rows':[]};var _0x182f1b=_['map'](db[_0x6920('0x2e')]['rawAttributes'],function(_0x31aa90){return{'name':_0x31aa90[_0x6920('0x2f')],'type':_0x31aa90['type'][_0x6920('0x30')]};});_0x2b2cd9[_0x6920('0x31')]=_[_0x6920('0x32')](_0x182f1b,'name');_0x2b2cd9['query']=_[_0x6920('0x33')](_0x400894['query']);_0x2b2cd9['filters']=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],_0x2b2cd9[_0x6920('0x35')]);_0x6860c7[_0x6920('0x36')]=_[_0x6920('0x34')](_0x2b2cd9[_0x6920('0x31')],qs[_0x6920('0x37')](_0x400894['query'][_0x6920('0x37')]));_0x6860c7['attributes']=_0x6860c7[_0x6920('0x36')]['length']?_0x6860c7['attributes']:_0x2b2cd9[_0x6920('0x31')];if(!_0x400894[_0x6920('0x35')][_0x6920('0x38')](_0x6920('0x39'))){_0x6860c7[_0x6920('0x1f')]=qs[_0x6920('0x1f')](_0x400894[_0x6920('0x35')][_0x6920('0x1f')]);_0x6860c7[_0x6920('0x1d')]=qs[_0x6920('0x1d')](_0x400894[_0x6920('0x35')][_0x6920('0x1d')]);}_0x6860c7['order']=qs[_0x6920('0x3a')](_0x400894['query'][_0x6920('0x3a')]);_0x6860c7[_0x6920('0x3b')]=qs[_0x6920('0x3c')](_['pick'](_0x400894[_0x6920('0x35')],_0x2b2cd9[_0x6920('0x3c')]),_0x182f1b);if(_0x400894[_0x6920('0x35')][_0x6920('0x3d')]){_0x6860c7['where']=_[_0x6920('0x3e')](_0x6860c7[_0x6920('0x3b')],{'$or':_['map'](_0x182f1b,function(_0x49be52){if(_0x49be52[_0x6920('0x3f')]!==_0x6920('0x40')){var _0x56ca8f={};_0x56ca8f[_0x49be52[_0x6920('0x2b')]]={'$like':'%'+_0x400894[_0x6920('0x35')]['filter']+'%'};return _0x56ca8f;}})});}_0x6860c7=_['merge']({},_0x6860c7,_0x400894[_0x6920('0x41')]);var _0x1f0c5f={'where':_0x6860c7[_0x6920('0x3b')]};return db[_0x6920('0x2e')][_0x6920('0x20')](_0x1f0c5f)['then'](function(_0x58f0e8){_0x548fbc['count']=_0x58f0e8;if(_0x400894[_0x6920('0x35')]['includeAll']){_0x6860c7['include']=[{'all':!![]}];}return db[_0x6920('0x2e')][_0x6920('0x42')](_0x6860c7);})['then'](function(_0x3aad11){_0x548fbc['rows']=_0x3aad11;return _0x548fbc;})[_0x6920('0x28')](respondWithFilteredResult(_0x2f5ce8,_0x6860c7))[_0x6920('0x43')](handleError(_0x2f5ce8,null));};exports[_0x6920('0x44')]=function(_0x1b3ebb,_0x3a994d){var _0x55d7b5={'raw':!![],'where':{'id':_0x1b3ebb[_0x6920('0x45')]['id']}},_0x4dfa0c={};_0x4dfa0c['model']=_['keys'](db['Cdr']['rawAttributes']);_0x4dfa0c[_0x6920('0x35')]=_[_0x6920('0x33')](_0x1b3ebb[_0x6920('0x35')]);_0x4dfa0c['filters']=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],_0x4dfa0c[_0x6920('0x35')]);_0x55d7b5[_0x6920('0x36')]=_[_0x6920('0x34')](_0x4dfa0c[_0x6920('0x31')],qs['fields'](_0x1b3ebb[_0x6920('0x35')][_0x6920('0x37')]));_0x55d7b5[_0x6920('0x36')]=_0x55d7b5[_0x6920('0x36')][_0x6920('0x46')]?_0x55d7b5[_0x6920('0x36')]:_0x4dfa0c[_0x6920('0x31')];if(_0x1b3ebb[_0x6920('0x35')][_0x6920('0x47')]){_0x55d7b5[_0x6920('0x48')]=[{'all':!![]}];}_0x55d7b5=_[_0x6920('0x3e')]({},_0x55d7b5,_0x1b3ebb[_0x6920('0x41')]);return db['Cdr'][_0x6920('0x49')](_0x55d7b5)[_0x6920('0x28')](handleEntityNotFound(_0x3a994d,null))['then'](respondWithResult(_0x3a994d,null))['catch'](handleError(_0x3a994d,null));};exports[_0x6920('0x4a')]=function(_0x3c231e,_0x20fab4){return db[_0x6920('0x2e')][_0x6920('0x4a')](_0x3c231e['body'],{})[_0x6920('0x28')](respondWithResult(_0x20fab4,0xc9))[_0x6920('0x43')](handleError(_0x20fab4,null));};exports[_0x6920('0x27')]=function(_0x51b12d,_0x4d1c79){if(_0x51b12d[_0x6920('0x4b')]['id']){delete _0x51b12d[_0x6920('0x4b')]['id'];}return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x51b12d['params']['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x4d1c79,null))[_0x6920('0x28')](saveUpdates(_0x51b12d[_0x6920('0x4b')],null))[_0x6920('0x28')](respondWithResult(_0x4d1c79,null))[_0x6920('0x43')](handleError(_0x4d1c79,null));};exports['destroy']=function(_0x1c0dd9,_0x3fe81d){return db[_0x6920('0x2e')][_0x6920('0x49')]({'where':{'id':_0x1c0dd9[_0x6920('0x45')]['id']}})[_0x6920('0x28')](handleEntityNotFound(_0x3fe81d,null))[_0x6920('0x28')](removeEntity(_0x3fe81d,null))[_0x6920('0x43')](handleError(_0x3fe81d,null));};exports[_0x6920('0x4c')]=function(_0x1c6bba,_0x492a02){return db[_0x6920('0x2e')][_0x6920('0x4c')]()[_0x6920('0x28')](respondWithResult(_0x492a02,null))[_0x6920('0x43')](handleError(_0x492a02,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1ebd989..e51da5d 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(_0xdfa41c,_0x260b65){var _0x3d995b=function(_0x2712a7){while(--_0x2712a7){_0xdfa41c['push'](_0xdfa41c['shift']());}};_0x3d995b(++_0x260b65);}(_0x7a54,0x106));var _0x47a5=function(_0x258c09,_0xf9fc42){_0x258c09=_0x258c09-0x0;var _0x17c9c9=_0x7a54[_0x258c09];return _0x17c9c9;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5ce43b,_0x34cb92){var _0x4ede79=function(_0x49bb0b){while(--_0x49bb0b){_0x5ce43b['push'](_0x5ce43b['shift']());}};_0x4ede79(++_0x34cb92);}(_0x7a54,0x106));var _0x47a5=function(_0x4f0bb6,_0x59bc2f){_0x4f0bb6=_0x4f0bb6-0x0;var _0x152012=_0x7a54[_0x4f0bb6];return _0x152012;};'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index f8736a6..9fabbeb 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 _0x2ca7=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','util'];(function(_0x2aab6f,_0x14b0a4){var _0x36818e=function(_0x2ea140){while(--_0x2ea140){_0x2aab6f['push'](_0x2aab6f['shift']());}};_0x36818e(++_0x14b0a4);}(_0x2ca7,0x142));var _0x72ca=function(_0x1e468f,_0x13c29b){_0x1e468f=_0x1e468f-0x0;var _0x15ebcf=_0x2ca7[_0x1e468f];return _0x15ebcf;};'use strict';var _=require('lodash');var util=require(_0x72ca('0x0'));var moment=require(_0x72ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x72ca('0x2'));var fs=require('fs');var Redis=require(_0x72ca('0x3'));var db=require(_0x72ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x72ca('0x5'))(_0x72ca('0x6'));var config=require(_0x72ca('0x7'));var jayson=require(_0x72ca('0x8'));var client=jayson['client'][_0x72ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52db57,_0x359c8d,_0x3eaecb){return new BPromise(function(_0x2315a0,_0x2e6906){return client[_0x72ca('0xa')](_0x52db57,_0x3eaecb)[_0x72ca('0xb')](function(_0x30601b){logger['info'](_0x72ca('0xc'),_0x359c8d,_0x72ca('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x359c8d,_0x72ca('0xd'),JSON['stringify'](_0x30601b));if(_0x30601b[_0x72ca('0xe')]){if(_0x30601b[_0x72ca('0xe')][_0x72ca('0xf')]===0x1f4){logger[_0x72ca('0xe')](_0x72ca('0xc'),_0x359c8d,_0x30601b[_0x72ca('0xe')][_0x72ca('0x10')]);return _0x2e6906(_0x30601b['error'][_0x72ca('0x10')]);}logger[_0x72ca('0xe')](_0x72ca('0xc'),_0x359c8d,_0x30601b['error'][_0x72ca('0x10')]);return _0x2315a0(_0x30601b['error']['message']);}else{logger[_0x72ca('0x11')](_0x72ca('0xc'),_0x359c8d,_0x72ca('0xd'));_0x2315a0(_0x30601b['result'][_0x72ca('0x10')]);}})[_0x72ca('0x12')](function(_0x1c2026){logger['error'](_0x72ca('0xc'),_0x359c8d,_0x1c2026);_0x2e6906(_0x1c2026);});});}
\ No newline at end of file
+var _0x7749=['util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xe8ffc3,_0x2c98){var _0x404d70=function(_0x5778f4){while(--_0x5778f4){_0xe8ffc3['push'](_0xe8ffc3['shift']());}};_0x404d70(++_0x2c98);}(_0x7749,0xf1));var _0x9774=function(_0x495571,_0x24d1da){_0x495571=_0x495571-0x0;var _0xed671a=_0x7749[_0x495571];return _0xed671a;};'use strict';var _=require(_0x9774('0x0'));var util=require(_0x9774('0x1'));var moment=require('moment');var BPromise=require(_0x9774('0x2'));var rs=require(_0x9774('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9774('0x4'));var logger=require('../../config/logger')(_0x9774('0x5'));var config=require(_0x9774('0x6'));var jayson=require(_0x9774('0x7'));var client=jayson[_0x9774('0x8')][_0x9774('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x255ab2,_0xaded08,_0x168a14){return new BPromise(function(_0x3353de,_0x2c8b3b){return client['request'](_0x255ab2,_0x168a14)[_0x9774('0xa')](function(_0x45bc7b){logger[_0x9774('0xb')](_0x9774('0xc'),_0xaded08,_0x9774('0xd'));logger[_0x9774('0xe')](_0x9774('0xf'),_0xaded08,_0x9774('0xd'),JSON[_0x9774('0x10')](_0x45bc7b));if(_0x45bc7b[_0x9774('0x11')]){if(_0x45bc7b[_0x9774('0x11')][_0x9774('0x12')]===0x1f4){logger[_0x9774('0x11')](_0x9774('0xc'),_0xaded08,_0x45bc7b[_0x9774('0x11')][_0x9774('0x13')]);return _0x2c8b3b(_0x45bc7b['error'][_0x9774('0x13')]);}logger['error'](_0x9774('0xc'),_0xaded08,_0x45bc7b['error'][_0x9774('0x13')]);return _0x3353de(_0x45bc7b[_0x9774('0x11')][_0x9774('0x13')]);}else{logger[_0x9774('0xb')](_0x9774('0xc'),_0xaded08,_0x9774('0xd'));_0x3353de(_0x45bc7b[_0x9774('0x14')][_0x9774('0x13')]);}})[_0x9774('0x15')](function(_0x8dde9){logger['error'](_0x9774('0xc'),_0xaded08,_0x8dde9);_0x2c8b3b(_0x8dde9);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index b8e9500..92a12c0 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(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x454780,_0x45516a){var _0x1a2049=function(_0x2ba244){while(--_0x2ba244){_0x454780['push'](_0x454780['shift']());}};_0x1a2049(++_0x45516a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c4016,_0x2e220f){_0x3c4016=_0x3c4016-0x0;var _0x3cebbd=_0xb10b[_0x3c4016];return _0x3cebbd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1843041..f66f21e 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 _0x5952=['sequelize','exports','noop','STRING','*,*,*,*'];(function(_0x1f43fc,_0x446494){var _0x36c52c=function(_0x3d748d){while(--_0x3d748d){_0x1f43fc['push'](_0x1f43fc['shift']());}};_0x36c52c(++_0x446494);}(_0x5952,0x14f));var _0x2595=function(_0xdb5ec5,_0x33e135){_0xdb5ec5=_0xdb5ec5-0x0;var _0x36bb9e=_0x5952[_0xdb5ec5];return _0x36bb9e;};'use strict';var Sequelize=require(_0x2595('0x0'));module[_0x2595('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2595('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2595('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2595('0x4')}};
\ No newline at end of file
+var _0x9312=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3d4da7,_0x5cb3f4){var _0x149b14=function(_0x31b005){while(--_0x31b005){_0x3d4da7['push'](_0x3d4da7['shift']());}};_0x149b14(++_0x5cb3f4);}(_0x9312,0x1b4));var _0x2931=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x9312[_0xa388a2];return _0x7ce7f6;};'use strict';var Sequelize=require(_0x2931('0x0'));module[_0x2931('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2931('0x2')],'allowNull':![],'defaultValue':_0x2931('0x3')},'appdata':{'type':Sequelize[_0x2931('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2931('0x2')],'defaultValue':_0x2931('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index acec7b1..f2c6c92 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 _0x5cd8=['path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','save','update','then','destroy','error','name','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','ChatApplication','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x2eebc6,_0x14c2c5){var _0x4cfc1e=function(_0x395586){while(--_0x395586){_0x2eebc6['push'](_0x2eebc6['shift']());}};_0x4cfc1e(++_0x14c2c5);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x3ebbb8,_0x275fd4){_0x3ebbb8=_0x3ebbb8-0x0;var _0x3a9126=_0x5cd8[_0x3ebbb8];return _0x3a9126;};'use strict';var emlformat=require(_0x85cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85cd('0x1'));var jsonpatch=require(_0x85cd('0x2'));var rp=require(_0x85cd('0x3'));var moment=require(_0x85cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x85cd('0x5'));var util=require('util');var path=require(_0x85cd('0x6'));var sox=require(_0x85cd('0x7'));var csv=require(_0x85cd('0x8'));var ejs=require(_0x85cd('0x9'));var fs=require('fs');var fs_extra=require(_0x85cd('0xa'));var _=require('lodash');var squel=require(_0x85cd('0xb'));var crypto=require(_0x85cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x85cd('0xd'));var toCsv=require(_0x85cd('0x8'));var querystring=require(_0x85cd('0xe'));var Papa=require(_0x85cd('0xf'));var Redis=require(_0x85cd('0x10'));var authService=require(_0x85cd('0x11'));var qs=require(_0x85cd('0x12'));var as=require(_0x85cd('0x13'));var hardwareService=require(_0x85cd('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x85cd('0x15'));var config=require(_0x85cd('0x16'));var licenseUtil=require(_0x85cd('0x17'));var db=require(_0x85cd('0x18'))['db'];function respondWithStatusCode(_0x4f054b,_0x3c3ffe){_0x3c3ffe=_0x3c3ffe||0xcc;return function(_0x398f7c){if(_0x398f7c){return _0x4f054b[_0x85cd('0x19')](_0x3c3ffe);}return _0x4f054b[_0x85cd('0x1a')](_0x3c3ffe)[_0x85cd('0x1b')]();};}function respondWithResult(_0x3639c2,_0x58c13e){_0x58c13e=_0x58c13e||0xc8;return function(_0x3d4c54){if(_0x3d4c54){return _0x3639c2['status'](_0x58c13e)[_0x85cd('0x1c')](_0x3d4c54);}};}function respondWithFilteredResult(_0x3e5e89,_0x208490){return function(_0x424a01){if(_0x424a01){var _0xedc03b=typeof _0x208490['offset']===_0x85cd('0x1d')&&typeof _0x208490['limit']===_0x85cd('0x1d');var _0x51dc9c=_0x424a01[_0x85cd('0x1e')];var _0x4d9c64=_0xedc03b?0x0:_0x208490[_0x85cd('0x1f')];var _0x11292e=_0xedc03b?_0x424a01[_0x85cd('0x1e')]:_0x208490[_0x85cd('0x1f')]+_0x208490[_0x85cd('0x20')];var _0x1123c0;if(_0x11292e>=_0x51dc9c){_0x11292e=_0x51dc9c;_0x1123c0=0xc8;}else{_0x1123c0=0xce;}_0x3e5e89[_0x85cd('0x1a')](_0x1123c0);return _0x3e5e89[_0x85cd('0x21')]('Content-Range',_0x4d9c64+'-'+_0x11292e+'/'+_0x51dc9c)[_0x85cd('0x1c')](_0x424a01);}return null;};}function patchUpdates(_0x425779){return function(_0x5bb4cc){try{jsonpatch['apply'](_0x5bb4cc,_0x425779,!![]);}catch(_0x5c268f){return BPromise['reject'](_0x5c268f);}return _0x5bb4cc[_0x85cd('0x22')]();};}function saveUpdates(_0x597e6e,_0x3cf6c6){return function(_0x2385e7){if(_0x2385e7){return _0x2385e7[_0x85cd('0x23')](_0x597e6e)[_0x85cd('0x24')](function(_0x592b77){return _0x592b77;});}return null;};}function removeEntity(_0x290b57,_0x2b00a8){return function(_0x358202){if(_0x358202){return _0x358202[_0x85cd('0x25')]()[_0x85cd('0x24')](function(){_0x290b57[_0x85cd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3500f,_0x421baa){return function(_0x216106){if(!_0x216106){_0xb3500f[_0x85cd('0x19')](0x194);}return _0x216106;};}function handleError(_0x560e27,_0x3b3b9f){_0x3b3b9f=_0x3b3b9f||0x1f4;return function(_0x43a062){logger[_0x85cd('0x26')](_0x43a062['stack']);if(_0x43a062['name']){delete _0x43a062[_0x85cd('0x27')];}_0x560e27['status'](_0x3b3b9f)[_0x85cd('0x28')](_0x43a062);};}exports[_0x85cd('0x29')]=function(_0x26e79c,_0x1d25a8){var _0x5dba6a={'raw':!![],'where':{'id':_0x26e79c[_0x85cd('0x2a')]['id']}},_0x225802={};_0x225802[_0x85cd('0x2b')]=_[_0x85cd('0x2c')](db['ChatApplication'][_0x85cd('0x2d')]);_0x225802[_0x85cd('0x2e')]=_[_0x85cd('0x2c')](_0x26e79c['query']);_0x225802['filters']=_[_0x85cd('0x2f')](_0x225802[_0x85cd('0x2b')],_0x225802[_0x85cd('0x2e')]);_0x5dba6a[_0x85cd('0x30')]=_[_0x85cd('0x2f')](_0x225802[_0x85cd('0x2b')],qs[_0x85cd('0x31')](_0x26e79c[_0x85cd('0x2e')]['fields']));_0x5dba6a[_0x85cd('0x30')]=_0x5dba6a[_0x85cd('0x30')][_0x85cd('0x32')]?_0x5dba6a[_0x85cd('0x30')]:_0x225802['model'];if(_0x26e79c[_0x85cd('0x2e')][_0x85cd('0x33')]){_0x5dba6a[_0x85cd('0x34')]=[{'all':!![]}];}_0x5dba6a=_[_0x85cd('0x35')]({},_0x5dba6a,_0x26e79c[_0x85cd('0x36')]);return db['ChatApplication'][_0x85cd('0x37')](_0x5dba6a)[_0x85cd('0x24')](handleEntityNotFound(_0x1d25a8,null))['then'](respondWithResult(_0x1d25a8,null))[_0x85cd('0x38')](handleError(_0x1d25a8,null));};exports[_0x85cd('0x23')]=function(_0x1d6ac2,_0x5e652e){if(_0x1d6ac2['body']['id']){delete _0x1d6ac2[_0x85cd('0x39')]['id'];}return db[_0x85cd('0x3a')]['find']({'where':{'id':_0x1d6ac2['params']['id']}})[_0x85cd('0x24')](handleEntityNotFound(_0x5e652e,null))['then'](saveUpdates(_0x1d6ac2['body'],null))[_0x85cd('0x24')](respondWithResult(_0x5e652e,null))[_0x85cd('0x38')](handleError(_0x5e652e,null));};exports[_0x85cd('0x25')]=function(_0x1cbf78,_0x662a87){return db[_0x85cd('0x3a')][_0x85cd('0x37')]({'where':{'id':_0x1cbf78[_0x85cd('0x2a')]['id']}})[_0x85cd('0x24')](handleEntityNotFound(_0x662a87,null))[_0x85cd('0x24')](removeEntity(_0x662a87,null))[_0x85cd('0x38')](handleError(_0x662a87,null));};
\ No newline at end of file
+var _0xf403=['catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','model','fields','includeAll','include','merge','options','find'];(function(_0x3d259b,_0x29f950){var _0x108d50=function(_0x5b06c9){while(--_0x5b06c9){_0x3d259b['push'](_0x3d259b['shift']());}};_0x108d50(++_0x29f950);}(_0xf403,0x1d3));var _0x3f40=function(_0x31250a,_0x3be34d){_0x31250a=_0x31250a-0x0;var _0x23d987=_0xf403[_0x31250a];return _0x23d987;};'use strict';var emlformat=require(_0x3f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f40('0x1'));var jsonpatch=require(_0x3f40('0x2'));var rp=require(_0x3f40('0x3'));var moment=require(_0x3f40('0x4'));var BPromise=require(_0x3f40('0x5'));var Mustache=require(_0x3f40('0x6'));var util=require(_0x3f40('0x7'));var path=require(_0x3f40('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f40('0x9'));var fs=require('fs');var fs_extra=require(_0x3f40('0xa'));var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f40('0x11'));var hardwareService=require(_0x3f40('0x12'));var logger=require(_0x3f40('0x13'))('api');var utils=require(_0x3f40('0x14'));var config=require(_0x3f40('0x15'));var licenseUtil=require(_0x3f40('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332635,_0x509c02){_0x509c02=_0x509c02||0xcc;return function(_0x116460){if(_0x116460){return _0x332635[_0x3f40('0x17')](_0x509c02);}return _0x332635[_0x3f40('0x18')](_0x509c02)[_0x3f40('0x19')]();};}function respondWithResult(_0x569c6e,_0x2b2bfe){_0x2b2bfe=_0x2b2bfe||0xc8;return function(_0x308e97){if(_0x308e97){return _0x569c6e[_0x3f40('0x18')](_0x2b2bfe)[_0x3f40('0x1a')](_0x308e97);}};}function respondWithFilteredResult(_0x232241,_0x4e28b9){return function(_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=typeof _0x4e28b9['offset']==='undefined'&&typeof _0x4e28b9['limit']===_0x3f40('0x1b');var _0x13b950=_0x2e51ed[_0x3f40('0x1c')];var _0x131e55=_0x3d11c9?0x0:_0x4e28b9[_0x3f40('0x1d')];var _0x5b4ebc=_0x3d11c9?_0x2e51ed[_0x3f40('0x1c')]:_0x4e28b9[_0x3f40('0x1d')]+_0x4e28b9[_0x3f40('0x1e')];var _0x29405a;if(_0x5b4ebc>=_0x13b950){_0x5b4ebc=_0x13b950;_0x29405a=0xc8;}else{_0x29405a=0xce;}_0x232241[_0x3f40('0x18')](_0x29405a);return _0x232241['set'](_0x3f40('0x1f'),_0x131e55+'-'+_0x5b4ebc+'/'+_0x13b950)['json'](_0x2e51ed);}return null;};}function patchUpdates(_0x12aabf){return function(_0x32b945){try{jsonpatch[_0x3f40('0x20')](_0x32b945,_0x12aabf,!![]);}catch(_0x113293){return BPromise[_0x3f40('0x21')](_0x113293);}return _0x32b945['save']();};}function saveUpdates(_0x27f5a5,_0x379b4e){return function(_0x117823){if(_0x117823){return _0x117823[_0x3f40('0x22')](_0x27f5a5)[_0x3f40('0x23')](function(_0xa1f39d){return _0xa1f39d;});}return null;};}function removeEntity(_0x4e1f47,_0x31fc91){return function(_0x59eb32){if(_0x59eb32){return _0x59eb32[_0x3f40('0x24')]()['then'](function(){_0x4e1f47[_0x3f40('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b47e,_0x5ae235){return function(_0x4b206b){if(!_0x4b206b){_0x37b47e['sendStatus'](0x194);}return _0x4b206b;};}function handleError(_0x30a945,_0x26e46b){_0x26e46b=_0x26e46b||0x1f4;return function(_0x140044){logger[_0x3f40('0x25')](_0x140044['stack']);if(_0x140044[_0x3f40('0x26')]){delete _0x140044['name'];}_0x30a945[_0x3f40('0x18')](_0x26e46b)[_0x3f40('0x27')](_0x140044);};}exports[_0x3f40('0x28')]=function(_0x5e0f25,_0x287632){var _0x4b5ef7={'raw':!![],'where':{'id':_0x5e0f25['params']['id']}},_0x1cab5c={};_0x1cab5c['model']=_[_0x3f40('0x29')](db[_0x3f40('0x2a')][_0x3f40('0x2b')]);_0x1cab5c[_0x3f40('0x2c')]=_[_0x3f40('0x29')](_0x5e0f25[_0x3f40('0x2c')]);_0x1cab5c[_0x3f40('0x2d')]=_[_0x3f40('0x2e')](_0x1cab5c['model'],_0x1cab5c[_0x3f40('0x2c')]);_0x4b5ef7[_0x3f40('0x2f')]=_[_0x3f40('0x2e')](_0x1cab5c[_0x3f40('0x30')],qs[_0x3f40('0x31')](_0x5e0f25['query'][_0x3f40('0x31')]));_0x4b5ef7[_0x3f40('0x2f')]=_0x4b5ef7[_0x3f40('0x2f')]['length']?_0x4b5ef7[_0x3f40('0x2f')]:_0x1cab5c[_0x3f40('0x30')];if(_0x5e0f25[_0x3f40('0x2c')][_0x3f40('0x32')]){_0x4b5ef7[_0x3f40('0x33')]=[{'all':!![]}];}_0x4b5ef7=_[_0x3f40('0x34')]({},_0x4b5ef7,_0x5e0f25[_0x3f40('0x35')]);return db[_0x3f40('0x2a')][_0x3f40('0x36')](_0x4b5ef7)[_0x3f40('0x23')](handleEntityNotFound(_0x287632,null))[_0x3f40('0x23')](respondWithResult(_0x287632,null))[_0x3f40('0x37')](handleError(_0x287632,null));};exports[_0x3f40('0x22')]=function(_0x13f7bc,_0x22a8bc){if(_0x13f7bc[_0x3f40('0x38')]['id']){delete _0x13f7bc[_0x3f40('0x38')]['id'];}return db[_0x3f40('0x2a')][_0x3f40('0x36')]({'where':{'id':_0x13f7bc[_0x3f40('0x39')]['id']}})[_0x3f40('0x23')](handleEntityNotFound(_0x22a8bc,null))[_0x3f40('0x23')](saveUpdates(_0x13f7bc[_0x3f40('0x38')],null))[_0x3f40('0x23')](respondWithResult(_0x22a8bc,null))[_0x3f40('0x37')](handleError(_0x22a8bc,null));};exports[_0x3f40('0x24')]=function(_0x2e158a,_0x31ab72){return db[_0x3f40('0x2a')][_0x3f40('0x36')]({'where':{'id':_0x2e158a['params']['id']}})['then'](handleEntityNotFound(_0x31ab72,null))[_0x3f40('0x23')](removeEntity(_0x31ab72,null))[_0x3f40('0x37')](handleError(_0x31ab72,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 6c7746c..0c78f06 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 _0x6c84=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6c84,0x112));var _0x46c8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x6c84[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var logger=require(_0x46c8('0x2'))(_0x46c8('0x3'));var moment=require(_0x46c8('0x4'));var BPromise=require('bluebird');var rp=require(_0x46c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46c8('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x46c8('0x7')]=function(_0x378507,_0x322cba){return _0x378507[_0x46c8('0x8')](_0x46c8('0x9'),attributes,{'tableName':_0x46c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46c8('0xb'),'collate':_0x46c8('0xc')});};
\ No newline at end of file
+var _0xf1c5=['request-promise','rimraf','../../config/environment','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x5ef94c,_0x56b614){var _0x38c21e=function(_0x1699ab){while(--_0x1699ab){_0x5ef94c['push'](_0x5ef94c['shift']());}};_0x38c21e(++_0x56b614);}(_0xf1c5,0x151));var _0x5f1c=function(_0x5be796,_0x4dd53a){_0x5be796=_0x5be796-0x0;var _0x4e8837=_0xf1c5[_0x5be796];return _0x4e8837;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5f1c('0x0'));var moment=require(_0x5f1c('0x1'));var BPromise=require(_0x5f1c('0x2'));var rp=require(_0x5f1c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f1c('0x4'));var config=require(_0x5f1c('0x5'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0xba695b,_0x589ce4){return _0xba695b[_0x5f1c('0x6')]('ChatApplication',attributes,{'tableName':_0x5f1c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f1c('0x8'),'collate':_0x5f1c('0x9')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 216b3fb..39414da 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 _0xd119=['client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x481366,_0x41e46b){var _0x229649=function(_0x508ecc){while(--_0x508ecc){_0x481366['push'](_0x481366['shift']());}};_0x229649(++_0x41e46b);}(_0xd119,0x1bd));var _0x9d11=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xd119[_0x462fe4];return _0x82b23a;};'use strict';var _=require(_0x9d11('0x0'));var util=require(_0x9d11('0x1'));var moment=require(_0x9d11('0x2'));var BPromise=require(_0x9d11('0x3'));var rs=require(_0x9d11('0x4'));var fs=require('fs');var Redis=require(_0x9d11('0x5'));var db=require(_0x9d11('0x6'))['db'];var utils=require(_0x9d11('0x7'));var logger=require(_0x9d11('0x8'))('rpc');var config=require(_0x9d11('0x9'));var jayson=require(_0x9d11('0xa'));var client=jayson[_0x9d11('0xb')][_0x9d11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x518c9a,_0x4d6b9c,_0x1c8c2b){return new BPromise(function(_0x1ce65b,_0x38f37d){return client['request'](_0x518c9a,_0x1c8c2b)[_0x9d11('0xd')](function(_0x4ff5cf){logger[_0x9d11('0xe')](_0x9d11('0xf'),_0x4d6b9c,_0x9d11('0x10'));logger[_0x9d11('0x11')](_0x9d11('0x12'),_0x4d6b9c,'request\x20sent',JSON[_0x9d11('0x13')](_0x4ff5cf));if(_0x4ff5cf['error']){if(_0x4ff5cf[_0x9d11('0x14')]['code']===0x1f4){logger[_0x9d11('0x14')](_0x9d11('0xf'),_0x4d6b9c,_0x4ff5cf[_0x9d11('0x14')][_0x9d11('0x15')]);return _0x38f37d(_0x4ff5cf[_0x9d11('0x14')][_0x9d11('0x15')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x4d6b9c,_0x4ff5cf['error'][_0x9d11('0x15')]);return _0x1ce65b(_0x4ff5cf[_0x9d11('0x14')][_0x9d11('0x15')]);}else{logger[_0x9d11('0xe')](_0x9d11('0xf'),_0x4d6b9c,_0x9d11('0x10'));_0x1ce65b(_0x4ff5cf[_0x9d11('0x16')][_0x9d11('0x15')]);}})[_0x9d11('0x17')](function(_0x3eedb3){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4d6b9c,_0x3eedb3);_0x38f37d(_0x3eedb3);});});}
\ No newline at end of file
+var _0xa701=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','util','moment','randomstring'];(function(_0x5c68d8,_0x200be8){var _0x2e1704=function(_0x267705){while(--_0x267705){_0x5c68d8['push'](_0x5c68d8['shift']());}};_0x2e1704(++_0x200be8);}(_0xa701,0x1cb));var _0x1a70=function(_0x471da7,_0x1a896d){_0x471da7=_0x471da7-0x0;var _0x1a843a=_0xa701[_0x471da7];return _0x1a843a;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a70('0x2'));var fs=require('fs');var Redis=require(_0x1a70('0x3'));var db=require(_0x1a70('0x4'))['db'];var utils=require(_0x1a70('0x5'));var logger=require(_0x1a70('0x6'))(_0x1a70('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a70('0x8'));var client=jayson[_0x1a70('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54a45a,_0x7ab6e2,_0x34131c){return new BPromise(function(_0x38b7be,_0x10cff7){return client[_0x1a70('0xa')](_0x54a45a,_0x34131c)[_0x1a70('0xb')](function(_0x3af9fc){logger['info'](_0x1a70('0xc'),_0x7ab6e2,'request\x20sent');logger[_0x1a70('0xd')](_0x1a70('0xe'),_0x7ab6e2,_0x1a70('0xf'),JSON['stringify'](_0x3af9fc));if(_0x3af9fc[_0x1a70('0x10')]){if(_0x3af9fc[_0x1a70('0x10')][_0x1a70('0x11')]===0x1f4){logger[_0x1a70('0x10')](_0x1a70('0xc'),_0x7ab6e2,_0x3af9fc[_0x1a70('0x10')][_0x1a70('0x12')]);return _0x10cff7(_0x3af9fc['error'][_0x1a70('0x12')]);}logger[_0x1a70('0x10')](_0x1a70('0xc'),_0x7ab6e2,_0x3af9fc[_0x1a70('0x10')][_0x1a70('0x12')]);return _0x38b7be(_0x3af9fc['error'][_0x1a70('0x12')]);}else{logger[_0x1a70('0x13')](_0x1a70('0xc'),_0x7ab6e2,_0x1a70('0xf'));_0x38b7be(_0x3af9fc['result'][_0x1a70('0x12')]);}})[_0x1a70('0x14')](function(_0x2e21d8){logger[_0x1a70('0x10')](_0x1a70('0xc'),_0x7ab6e2,_0x2e21d8);_0x10cff7(_0x2e21d8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0ac8196..774c0ab 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 _0x3482=['fs-extra','../../components/interaction/service','get','/:id','show','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x3482,0xdc));var _0x2348=function(_0x312ad6,_0x5dcca8){_0x312ad6=_0x312ad6-0x0;var _0x1069dc=_0x3482[_0x312ad6];return _0x1069dc;};'use strict';var multer=require(_0x2348('0x0'));var util=require(_0x2348('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2348('0x2'));var router=express[_0x2348('0x3')]();var fs_extra=require(_0x2348('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2348('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x2348('0x6')](_0x2348('0x7'),auth['isAuthenticated'](),controller[_0x2348('0x8')]);router['put'](_0x2348('0x7'),auth[_0x2348('0x9')](),controller[_0x2348('0xa')]);router[_0x2348('0xb')](_0x2348('0x7'),auth[_0x2348('0x9')](),controller[_0x2348('0xc')]);module[_0x2348('0xd')]=router;
\ No newline at end of file
+var _0x4fe4=['connect-timeout','express','fs-extra','./chatApplication.controller','get','/:id','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x564674,_0x462e46){var _0x5a8b9e=function(_0x131d6f){while(--_0x131d6f){_0x564674['push'](_0x564674['shift']());}};_0x5a8b9e(++_0x462e46);}(_0x4fe4,0x14f));var _0x44fe=function(_0x3acfa3,_0x13ea7a){_0x3acfa3=_0x3acfa3-0x0;var _0xcfe26e=_0x4fe4[_0x3acfa3];return _0xcfe26e;};'use strict';var multer=require(_0x44fe('0x0'));var util=require(_0x44fe('0x1'));var path=require(_0x44fe('0x2'));var timeout=require(_0x44fe('0x3'));var express=require(_0x44fe('0x4'));var router=express['Router']();var fs_extra=require(_0x44fe('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x44fe('0x6'));router[_0x44fe('0x7')](_0x44fe('0x8'),auth[_0x44fe('0x9')](),controller['show']);router['put'](_0x44fe('0x8'),auth['isAuthenticated'](),controller[_0x44fe('0xa')]);router[_0x44fe('0xb')]('/:id',auth[_0x44fe('0x9')](),controller['destroy']);module[_0x44fe('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 66278a8..8f5f14f 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 _0xbf40=['STRING'];(function(_0x150c3c,_0x318de9){var _0x3bfc63=function(_0x414b60){while(--_0x414b60){_0x150c3c['push'](_0x150c3c['shift']());}};_0x3bfc63(++_0x318de9);}(_0xbf40,0x1f4));var _0x0bf4=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xbf40[_0x3207aa];return _0x51758f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0bf4('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x88b0=['sequelize','exports','BOOLEAN'];(function(_0xb8f65,_0x5b3d4f){var _0x537221=function(_0x157d70){while(--_0x157d70){_0xb8f65['push'](_0xb8f65['shift']());}};_0x537221(++_0x5b3d4f);}(_0x88b0,0x1cb));var _0x088b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88b0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x088b('0x0'));module[_0x088b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x088b('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index f352c7f..977d78a 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 _0x4a39=['../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatGroup.socket','register','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','ChatGroup','includeAll','include','show','params','options','find','catch','create','body','describe','getUnread','toInteger','addMembers','omit','getMembers','findOne','hasOwnProperty','removeMembers','ids','addMessage','ChatGroupId','getMessages','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x479691,_0x1002be){var _0x32a5c1=function(_0x2753f4){while(--_0x2753f4){_0x479691['push'](_0x479691['shift']());}};_0x32a5c1(++_0x1002be);}(_0x4a39,0x1c3));var _0x94a3=function(_0x5f1b29,_0x513d20){_0x5f1b29=_0x5f1b29-0x0;var _0x2a1c30=_0x4a39[_0x5f1b29];return _0x2a1c30;};'use strict';var emlformat=require(_0x94a3('0x0'));var rimraf=require(_0x94a3('0x1'));var zipdir=require(_0x94a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94a3('0x3'));var moment=require('moment');var BPromise=require(_0x94a3('0x4'));var Mustache=require(_0x94a3('0x5'));var util=require(_0x94a3('0x6'));var path=require(_0x94a3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94a3('0x8'));var fs=require('fs');var fs_extra=require(_0x94a3('0x9'));var _=require(_0x94a3('0xa'));var squel=require(_0x94a3('0xb'));var crypto=require('crypto');var jsforce=require(_0x94a3('0xc'));var deskjs=require(_0x94a3('0xd'));var toCsv=require(_0x94a3('0xe'));var querystring=require(_0x94a3('0xf'));var Papa=require(_0x94a3('0x10'));var Redis=require('ioredis');var authService=require(_0x94a3('0x11'));var qs=require(_0x94a3('0x12'));var as=require(_0x94a3('0x13'));var hardwareService=require(_0x94a3('0x14'));var logger=require(_0x94a3('0x15'))(_0x94a3('0x16'));var utils=require(_0x94a3('0x17'));var config=require(_0x94a3('0x18'));var licenseUtil=require(_0x94a3('0x19'));var db=require(_0x94a3('0x1a'))['db'];config['redis']=_[_0x94a3('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x94a3('0x1c'))(new Redis(config[_0x94a3('0x1d')]));require(_0x94a3('0x1e'))[_0x94a3('0x1f')](socket);function respondWithStatusCode(_0x5438d0,_0x22b0f6){_0x22b0f6=_0x22b0f6||0xcc;return function(_0xad326e){if(_0xad326e){return _0x5438d0['sendStatus'](_0x22b0f6);}return _0x5438d0['status'](_0x22b0f6)['end']();};}function respondWithResult(_0x3faf60,_0x3c5fe8){_0x3c5fe8=_0x3c5fe8||0xc8;return function(_0x3bfe3d){if(_0x3bfe3d){return _0x3faf60[_0x94a3('0x20')](_0x3c5fe8)[_0x94a3('0x21')](_0x3bfe3d);}};}function respondWithFilteredResult(_0x53489c,_0x120656){return function(_0x43d3a0){if(_0x43d3a0){var _0x3b8e46=typeof _0x120656[_0x94a3('0x22')]===_0x94a3('0x23')&&typeof _0x120656[_0x94a3('0x24')]===_0x94a3('0x23');var _0x1fb30a=_0x43d3a0[_0x94a3('0x25')];var _0x13439b=_0x3b8e46?0x0:_0x120656[_0x94a3('0x22')];var _0x2e37a5=_0x3b8e46?_0x43d3a0[_0x94a3('0x25')]:_0x120656[_0x94a3('0x22')]+_0x120656[_0x94a3('0x24')];var _0xf02a81;if(_0x2e37a5>=_0x1fb30a){_0x2e37a5=_0x1fb30a;_0xf02a81=0xc8;}else{_0xf02a81=0xce;}_0x53489c[_0x94a3('0x20')](_0xf02a81);return _0x53489c['set'](_0x94a3('0x26'),_0x13439b+'-'+_0x2e37a5+'/'+_0x1fb30a)[_0x94a3('0x21')](_0x43d3a0);}return null;};}function patchUpdates(_0x2fbb1a){return function(_0x49e698){try{jsonpatch['apply'](_0x49e698,_0x2fbb1a,!![]);}catch(_0x3e2d30){return BPromise[_0x94a3('0x27')](_0x3e2d30);}return _0x49e698[_0x94a3('0x28')]();};}function saveUpdates(_0x1dd8a1,_0x35e80){return function(_0x1c9c6f){if(_0x1c9c6f){return _0x1c9c6f[_0x94a3('0x29')](_0x1dd8a1)[_0x94a3('0x2a')](function(_0x3160a7){return _0x3160a7;});}return null;};}function removeEntity(_0x218c88,_0x989af0){return function(_0x21233e){if(_0x21233e){return _0x21233e[_0x94a3('0x2b')]()[_0x94a3('0x2a')](function(){_0x218c88[_0x94a3('0x20')](0xcc)[_0x94a3('0x2c')]();});}};}function handleEntityNotFound(_0xb4a9ea,_0x2c6d4c){return function(_0x63c034){if(!_0x63c034){_0xb4a9ea[_0x94a3('0x2d')](0x194);}return _0x63c034;};}function handleError(_0x29d0f0,_0x16ed8b){_0x16ed8b=_0x16ed8b||0x1f4;return function(_0x492043){logger[_0x94a3('0x2e')](_0x492043[_0x94a3('0x2f')]);if(_0x492043[_0x94a3('0x30')]){delete _0x492043[_0x94a3('0x30')];}_0x29d0f0[_0x94a3('0x20')](_0x16ed8b)['send'](_0x492043);};}exports[_0x94a3('0x31')]=function(_0x23f382,_0x8348e6){var _0x4c590e={},_0xf87d2d={},_0x777451={'count':0x0,'rows':[]};var _0x53f8d7=_[_0x94a3('0x32')](db['ChatGroup'][_0x94a3('0x33')],function(_0x487df4){return{'name':_0x487df4['fieldName'],'type':_0x487df4['type'][_0x94a3('0x34')]};});_0xf87d2d[_0x94a3('0x35')]=_[_0x94a3('0x32')](_0x53f8d7,_0x94a3('0x30'));_0xf87d2d[_0x94a3('0x36')]=_[_0x94a3('0x37')](_0x23f382[_0x94a3('0x36')]);_0xf87d2d[_0x94a3('0x38')]=_[_0x94a3('0x39')](_0xf87d2d[_0x94a3('0x35')],_0xf87d2d[_0x94a3('0x36')]);_0x4c590e['attributes']=_[_0x94a3('0x39')](_0xf87d2d[_0x94a3('0x35')],qs[_0x94a3('0x3a')](_0x23f382[_0x94a3('0x36')][_0x94a3('0x3a')]));_0x4c590e[_0x94a3('0x3b')]=_0x4c590e[_0x94a3('0x3b')][_0x94a3('0x3c')]?_0x4c590e[_0x94a3('0x3b')]:_0xf87d2d['model'];if(!_0x23f382[_0x94a3('0x36')]['hasOwnProperty'](_0x94a3('0x3d'))){_0x4c590e[_0x94a3('0x24')]=qs[_0x94a3('0x24')](_0x23f382[_0x94a3('0x36')][_0x94a3('0x24')]);_0x4c590e[_0x94a3('0x22')]=qs['offset'](_0x23f382[_0x94a3('0x36')][_0x94a3('0x22')]);}_0x4c590e[_0x94a3('0x3e')]=qs['sort'](_0x23f382['query'][_0x94a3('0x3f')]);_0x4c590e[_0x94a3('0x40')]=qs['filters'](_['pick'](_0x23f382[_0x94a3('0x36')],_0xf87d2d[_0x94a3('0x38')]),_0x53f8d7);if(_0x23f382[_0x94a3('0x36')][_0x94a3('0x41')]){_0x4c590e[_0x94a3('0x40')]=_[_0x94a3('0x42')](_0x4c590e['where'],{'$or':_[_0x94a3('0x32')](_0x53f8d7,function(_0x4f9c51){if(_0x4f9c51['type']!==_0x94a3('0x43')){var _0x37e76d={};_0x37e76d[_0x4f9c51['name']]={'$like':'%'+_0x23f382[_0x94a3('0x36')]['filter']+'%'};return _0x37e76d;}})});}_0x4c590e=_['merge']({},_0x4c590e,_0x23f382['options']);var _0x203309={'where':_0x4c590e[_0x94a3('0x40')]};return db[_0x94a3('0x44')][_0x94a3('0x25')](_0x203309)[_0x94a3('0x2a')](function(_0x5be016){_0x777451[_0x94a3('0x25')]=_0x5be016;if(_0x23f382[_0x94a3('0x36')][_0x94a3('0x45')]){_0x4c590e[_0x94a3('0x46')]=[{'all':!![]}];}return db[_0x94a3('0x44')]['findAll'](_0x4c590e);})['then'](function(_0x352167){_0x777451['rows']=_0x352167;return _0x777451;})[_0x94a3('0x2a')](respondWithFilteredResult(_0x8348e6,_0x4c590e))['catch'](handleError(_0x8348e6,null));};exports[_0x94a3('0x47')]=function(_0x3067c7,_0x8692c1){var _0x2e938b={'raw':!![],'where':{'id':_0x3067c7[_0x94a3('0x48')]['id']}},_0x5891a7={};_0x5891a7['model']=_['keys'](db[_0x94a3('0x44')][_0x94a3('0x33')]);_0x5891a7[_0x94a3('0x36')]=_['keys'](_0x3067c7[_0x94a3('0x36')]);_0x5891a7['filters']=_[_0x94a3('0x39')](_0x5891a7[_0x94a3('0x35')],_0x5891a7[_0x94a3('0x36')]);_0x2e938b['attributes']=_[_0x94a3('0x39')](_0x5891a7['model'],qs[_0x94a3('0x3a')](_0x3067c7[_0x94a3('0x36')][_0x94a3('0x3a')]));_0x2e938b[_0x94a3('0x3b')]=_0x2e938b['attributes'][_0x94a3('0x3c')]?_0x2e938b[_0x94a3('0x3b')]:_0x5891a7[_0x94a3('0x35')];if(_0x3067c7[_0x94a3('0x36')][_0x94a3('0x45')]){_0x2e938b[_0x94a3('0x46')]=[{'all':!![]}];}_0x2e938b=_[_0x94a3('0x42')]({},_0x2e938b,_0x3067c7[_0x94a3('0x49')]);return db[_0x94a3('0x44')][_0x94a3('0x4a')](_0x2e938b)[_0x94a3('0x2a')](handleEntityNotFound(_0x8692c1,null))[_0x94a3('0x2a')](respondWithResult(_0x8692c1,null))[_0x94a3('0x4b')](handleError(_0x8692c1,null));};exports[_0x94a3('0x4c')]=function(_0x576860,_0x4f4729){return db[_0x94a3('0x44')][_0x94a3('0x4c')](_0x576860[_0x94a3('0x4d')],{})['then'](respondWithResult(_0x4f4729,0xc9))['catch'](handleError(_0x4f4729,null));};exports[_0x94a3('0x29')]=function(_0x1fa576,_0x12760f){if(_0x1fa576['body']['id']){delete _0x1fa576['body']['id'];}return db['ChatGroup'][_0x94a3('0x4a')]({'where':{'id':_0x1fa576[_0x94a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x12760f,null))[_0x94a3('0x2a')](saveUpdates(_0x1fa576[_0x94a3('0x4d')],null))['then'](respondWithResult(_0x12760f,null))[_0x94a3('0x4b')](handleError(_0x12760f,null));};exports[_0x94a3('0x2b')]=function(_0x247735,_0x111a73){return db[_0x94a3('0x44')][_0x94a3('0x4a')]({'where':{'id':_0x247735[_0x94a3('0x48')]['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x111a73,null))[_0x94a3('0x2a')](removeEntity(_0x111a73,null))[_0x94a3('0x4b')](handleError(_0x111a73,null));};exports[_0x94a3('0x4e')]=function(_0x129b6f,_0xfeff02){return db[_0x94a3('0x44')]['describe']()['then'](respondWithResult(_0xfeff02,null))[_0x94a3('0x4b')](handleError(_0xfeff02,null));};exports[_0x94a3('0x4f')]=function(_0x37b5a6,_0x5c5028,_0x4b8e38){return db['ChatInternalMessage'][_0x94a3('0x25')]({'where':{'ChatGroupId':_0x37b5a6[_0x94a3('0x48')]['id'],'ToId':_0x37b5a6['user']['id'],'read':![]}})[_0x94a3('0x2a')](function(_0xb4c674){return{'id':_[_0x94a3('0x50')](_0x37b5a6[_0x94a3('0x48')]['id']),'count':_0xb4c674};})[_0x94a3('0x2a')](respondWithResult(_0x5c5028,null))['catch'](handleError(_0x5c5028,null));};exports['addMembers']=function(_0x1b5e94,_0x124e64,_0xbd0131){return db['ChatGroup'][_0x94a3('0x4a')]({'where':{'id':_0x1b5e94[_0x94a3('0x48')]['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x124e64,null))[_0x94a3('0x2a')](function(_0xf9803e){if(_0xf9803e){return _0xf9803e[_0x94a3('0x51')](_0x1b5e94['body']['ids'],_[_0x94a3('0x52')](_0x1b5e94[_0x94a3('0x4d')],['ids','id'])||{});}})[_0x94a3('0x2a')](respondWithResult(_0x124e64,null))['catch'](handleError(_0x124e64,null));};exports[_0x94a3('0x53')]=function(_0x4cc4f7,_0x223b0c,_0x18cd40){var _0x246ad3={};var _0x3ce48a={};var _0x15b65d;var _0x358b3b;return db[_0x94a3('0x44')][_0x94a3('0x54')]({'where':{'id':_0x4cc4f7['params']['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x223b0c,null))[_0x94a3('0x2a')](function(_0x10cf82){if(_0x10cf82){_0x15b65d=_0x10cf82;_0x3ce48a['model']=_['keys'](db['User'][_0x94a3('0x33')]);_0x3ce48a[_0x94a3('0x36')]=_[_0x94a3('0x37')](_0x4cc4f7[_0x94a3('0x36')]);_0x3ce48a[_0x94a3('0x38')]=_['intersection'](_0x3ce48a[_0x94a3('0x35')],_0x3ce48a[_0x94a3('0x36')]);_0x246ad3[_0x94a3('0x3b')]=_[_0x94a3('0x39')](_0x3ce48a[_0x94a3('0x35')],qs[_0x94a3('0x3a')](_0x4cc4f7[_0x94a3('0x36')][_0x94a3('0x3a')]));_0x246ad3[_0x94a3('0x3b')]=_0x246ad3['attributes'][_0x94a3('0x3c')]?_0x246ad3[_0x94a3('0x3b')]:_0x3ce48a[_0x94a3('0x35')];_0x246ad3['order']=qs[_0x94a3('0x3f')](_0x4cc4f7[_0x94a3('0x36')][_0x94a3('0x3f')]);_0x246ad3['where']=qs[_0x94a3('0x38')](_['pick'](_0x4cc4f7[_0x94a3('0x36')],_0x3ce48a[_0x94a3('0x38')]));if(_0x4cc4f7[_0x94a3('0x36')]['filter']){_0x246ad3['where']=_['merge'](_0x246ad3[_0x94a3('0x40')],{'$or':_[_0x94a3('0x32')](_0x246ad3[_0x94a3('0x3b')],function(_0x3573c6){var _0x2a202f={};_0x2a202f[_0x3573c6]={'$like':'%'+_0x4cc4f7[_0x94a3('0x36')][_0x94a3('0x41')]+'%'};return _0x2a202f;})});}_0x246ad3=_[_0x94a3('0x42')]({},_0x246ad3,_0x4cc4f7['options']);return _0x15b65d[_0x94a3('0x53')](_0x246ad3);}})[_0x94a3('0x2a')](function(_0x2be932){if(_0x2be932){_0x358b3b=_0x2be932[_0x94a3('0x3c')];if(!_0x4cc4f7[_0x94a3('0x36')][_0x94a3('0x55')](_0x94a3('0x3d'))){_0x246ad3[_0x94a3('0x24')]=qs[_0x94a3('0x24')](_0x4cc4f7[_0x94a3('0x36')][_0x94a3('0x24')]);_0x246ad3[_0x94a3('0x22')]=qs[_0x94a3('0x22')](_0x4cc4f7['query'][_0x94a3('0x22')]);}return _0x15b65d['getMembers'](_0x246ad3);}})[_0x94a3('0x2a')](function(_0x48ace6){if(_0x48ace6){return _0x48ace6?{'count':_0x358b3b,'rows':_0x48ace6}:null;}})['then'](respondWithResult(_0x223b0c,null))[_0x94a3('0x4b')](handleError(_0x223b0c,null));};exports[_0x94a3('0x56')]=function(_0x29b0fd,_0x5b65d7,_0x18f219){return db['ChatGroup']['find']({'where':{'id':_0x29b0fd['params']['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x5b65d7,null))[_0x94a3('0x2a')](function(_0x19a484){if(_0x19a484){return _0x19a484[_0x94a3('0x56')](_0x29b0fd['query'][_0x94a3('0x57')]);}})['then'](respondWithStatusCode(_0x5b65d7,null))[_0x94a3('0x4b')](handleError(_0x5b65d7,null));};exports[_0x94a3('0x58')]=function(_0x4fc325,_0x52ee63,_0x23e1bd){if(_0x4fc325[_0x94a3('0x4d')]['id']){delete _0x4fc325[_0x94a3('0x4d')]['id'];}return db[_0x94a3('0x44')][_0x94a3('0x4a')]({'where':{'id':_0x4fc325[_0x94a3('0x48')]['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x52ee63,null))[_0x94a3('0x2a')](function(_0x485d3e){if(_0x485d3e){_0x4fc325[_0x94a3('0x4d')][_0x94a3('0x59')]=_0x485d3e['id'];return db['ChatInternalMessage']['create'](_0x4fc325['body']);}})['then'](respondWithResult(_0x52ee63,null))[_0x94a3('0x4b')](handleError(_0x52ee63,null));};exports[_0x94a3('0x5a')]=function(_0x32545d,_0x2eb738,_0x3924c0){var _0xf0f23f={};var _0x1fe406={};var _0x441339;var _0x49d79b;return db[_0x94a3('0x44')]['findOne']({'where':{'id':_0x32545d[_0x94a3('0x48')]['id']}})[_0x94a3('0x2a')](handleEntityNotFound(_0x2eb738,null))['then'](function(_0x1a186e){if(_0x1a186e){_0x441339=_0x1a186e;_0x1fe406[_0x94a3('0x35')]=_[_0x94a3('0x37')](db[_0x94a3('0x5b')][_0x94a3('0x33')]);_0x1fe406['query']=_[_0x94a3('0x37')](_0x32545d[_0x94a3('0x36')]);_0x1fe406[_0x94a3('0x38')]=_[_0x94a3('0x39')](_0x1fe406[_0x94a3('0x35')],_0x1fe406[_0x94a3('0x36')]);_0xf0f23f[_0x94a3('0x3b')]=_[_0x94a3('0x39')](_0x1fe406[_0x94a3('0x35')],qs['fields'](_0x32545d[_0x94a3('0x36')][_0x94a3('0x3a')]));_0xf0f23f[_0x94a3('0x3b')]=_0xf0f23f[_0x94a3('0x3b')][_0x94a3('0x3c')]?_0xf0f23f[_0x94a3('0x3b')]:_0x1fe406['model'];_0xf0f23f[_0x94a3('0x3e')]=qs['sort'](_0x32545d[_0x94a3('0x36')][_0x94a3('0x3f')]);_0xf0f23f[_0x94a3('0x40')]=qs[_0x94a3('0x38')](_['pick'](_0x32545d['query'],_0x1fe406[_0x94a3('0x38')]));if(_0x32545d[_0x94a3('0x36')]['filter']){_0xf0f23f[_0x94a3('0x40')]=_[_0x94a3('0x42')](_0xf0f23f['where'],{'$or':_[_0x94a3('0x32')](_0xf0f23f['attributes'],function(_0x5c0112){var _0x5dd308={};_0x5dd308[_0x5c0112]={'$like':'%'+_0x32545d[_0x94a3('0x36')][_0x94a3('0x41')]+'%'};return _0x5dd308;})});}if(_0x32545d[_0x94a3('0x36')][_0x94a3('0x5c')]){var _0x56c647=_0x32545d[_0x94a3('0x36')][_0x94a3('0x5c')]['split'](',');var _0x58e573={};_0x58e573[_0x56c647[0x0]]={'$gte':moment(_0x56c647[0x1])[_0x94a3('0x5d')](_0x94a3('0x5e'))};_0xf0f23f[_0x94a3('0x40')]=_[_0x94a3('0x42')](_0xf0f23f[_0x94a3('0x40')],_0x58e573);}_0xf0f23f=_[_0x94a3('0x42')]({},_0xf0f23f,_0x32545d['options']);return _0x441339[_0x94a3('0x5a')](_0xf0f23f);}})[_0x94a3('0x2a')](function(_0x1975d6){if(_0x1975d6){_0x49d79b=_0x1975d6['length'];if(!_0x32545d['query'][_0x94a3('0x55')](_0x94a3('0x3d'))){_0xf0f23f[_0x94a3('0x24')]=qs[_0x94a3('0x24')](_0x32545d['query']['limit']);_0xf0f23f[_0x94a3('0x22')]=qs[_0x94a3('0x22')](_0x32545d[_0x94a3('0x36')][_0x94a3('0x22')]);}return _0x441339[_0x94a3('0x5a')](_0xf0f23f);}})[_0x94a3('0x2a')](function(_0x1d02c3){if(_0x1d02c3){return _0x1d02c3?{'count':_0x49d79b,'rows':_0x1d02c3}:null;}})[_0x94a3('0x2a')](respondWithResult(_0x2eb738,null))[_0x94a3('0x4b')](handleError(_0x2eb738,null));};
\ No newline at end of file
+var _0x0093=['reject','update','then','destroy','end','error','stack','name','send','map','ChatGroup','rawAttributes','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','ChatInternalMessage','user','toInteger','ids','findOne','User','where','options','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','zip-dir','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply'];(function(_0x53b8c2,_0x5e697c){var _0x488fe2=function(_0x564f15){while(--_0x564f15){_0x53b8c2['push'](_0x53b8c2['shift']());}};_0x488fe2(++_0x5e697c);}(_0x0093,0x90));var _0x3009=function(_0x202aea,_0x56ab25){_0x202aea=_0x202aea-0x0;var _0x356f66=_0x0093[_0x202aea];return _0x356f66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3009('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3009('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x3009('0x2'));var util=require('util');var path=require(_0x3009('0x3'));var sox=require('sox');var csv=require(_0x3009('0x4'));var ejs=require(_0x3009('0x5'));var fs=require('fs');var fs_extra=require(_0x3009('0x6'));var _=require(_0x3009('0x7'));var squel=require('squel');var crypto=require(_0x3009('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3009('0x9'));var toCsv=require(_0x3009('0x4'));var querystring=require(_0x3009('0xa'));var Papa=require(_0x3009('0xb'));var Redis=require(_0x3009('0xc'));var authService=require(_0x3009('0xd'));var qs=require(_0x3009('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3009('0xf'));var logger=require(_0x3009('0x10'))(_0x3009('0x11'));var utils=require(_0x3009('0x12'));var config=require(_0x3009('0x13'));var licenseUtil=require(_0x3009('0x14'));var db=require('../../mysqldb')['db'];config[_0x3009('0x15')]=_['defaults'](config['redis'],{'host':_0x3009('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3009('0x15')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5f488b,_0x30e68c){_0x30e68c=_0x30e68c||0xcc;return function(_0x311ec4){if(_0x311ec4){return _0x5f488b[_0x3009('0x17')](_0x30e68c);}return _0x5f488b[_0x3009('0x18')](_0x30e68c)['end']();};}function respondWithResult(_0x318be8,_0x3944c1){_0x3944c1=_0x3944c1||0xc8;return function(_0x3e2b6f){if(_0x3e2b6f){return _0x318be8[_0x3009('0x18')](_0x3944c1)['json'](_0x3e2b6f);}};}function respondWithFilteredResult(_0x397428,_0x595449){return function(_0x4939b0){if(_0x4939b0){var _0x2c5dc6=typeof _0x595449[_0x3009('0x19')]==='undefined'&&typeof _0x595449[_0x3009('0x1a')]===_0x3009('0x1b');var _0x29b6f5=_0x4939b0[_0x3009('0x1c')];var _0x5c6b6d=_0x2c5dc6?0x0:_0x595449[_0x3009('0x19')];var _0x28021f=_0x2c5dc6?_0x4939b0[_0x3009('0x1c')]:_0x595449[_0x3009('0x19')]+_0x595449[_0x3009('0x1a')];var _0x1f78f6;if(_0x28021f>=_0x29b6f5){_0x28021f=_0x29b6f5;_0x1f78f6=0xc8;}else{_0x1f78f6=0xce;}_0x397428[_0x3009('0x18')](_0x1f78f6);return _0x397428['set'](_0x3009('0x1d'),_0x5c6b6d+'-'+_0x28021f+'/'+_0x29b6f5)[_0x3009('0x1e')](_0x4939b0);}return null;};}function patchUpdates(_0xf84acf){return function(_0x3ebfd9){try{jsonpatch[_0x3009('0x1f')](_0x3ebfd9,_0xf84acf,!![]);}catch(_0xe54558){return BPromise[_0x3009('0x20')](_0xe54558);}return _0x3ebfd9['save']();};}function saveUpdates(_0x5dec73,_0x1623c3){return function(_0x5379dd){if(_0x5379dd){return _0x5379dd[_0x3009('0x21')](_0x5dec73)[_0x3009('0x22')](function(_0x390f53){return _0x390f53;});}return null;};}function removeEntity(_0x5a3075,_0x1e3d78){return function(_0x1d190f){if(_0x1d190f){return _0x1d190f[_0x3009('0x23')]()[_0x3009('0x22')](function(){_0x5a3075[_0x3009('0x18')](0xcc)[_0x3009('0x24')]();});}};}function handleEntityNotFound(_0x485ee5,_0x4e3f4d){return function(_0x5f3e67){if(!_0x5f3e67){_0x485ee5['sendStatus'](0x194);}return _0x5f3e67;};}function handleError(_0x2c4e8e,_0x24a49c){_0x24a49c=_0x24a49c||0x1f4;return function(_0x5d42f9){logger[_0x3009('0x25')](_0x5d42f9[_0x3009('0x26')]);if(_0x5d42f9['name']){delete _0x5d42f9[_0x3009('0x27')];}_0x2c4e8e[_0x3009('0x18')](_0x24a49c)[_0x3009('0x28')](_0x5d42f9);};}exports['index']=function(_0x58faa5,_0xa171ea){var _0x38de75={},_0x499472={},_0x2d709c={'count':0x0,'rows':[]};var _0x55687c=_[_0x3009('0x29')](db[_0x3009('0x2a')][_0x3009('0x2b')],function(_0xe71cad){return{'name':_0xe71cad['fieldName'],'type':_0xe71cad[_0x3009('0x2c')]['key']};});_0x499472['model']=_[_0x3009('0x29')](_0x55687c,_0x3009('0x27'));_0x499472[_0x3009('0x2d')]=_['keys'](_0x58faa5[_0x3009('0x2d')]);_0x499472[_0x3009('0x2e')]=_[_0x3009('0x2f')](_0x499472['model'],_0x499472[_0x3009('0x2d')]);_0x38de75[_0x3009('0x30')]=_[_0x3009('0x2f')](_0x499472[_0x3009('0x31')],qs[_0x3009('0x32')](_0x58faa5[_0x3009('0x2d')][_0x3009('0x32')]));_0x38de75[_0x3009('0x30')]=_0x38de75[_0x3009('0x30')][_0x3009('0x33')]?_0x38de75[_0x3009('0x30')]:_0x499472[_0x3009('0x31')];if(!_0x58faa5[_0x3009('0x2d')][_0x3009('0x34')](_0x3009('0x35'))){_0x38de75['limit']=qs['limit'](_0x58faa5[_0x3009('0x2d')]['limit']);_0x38de75[_0x3009('0x19')]=qs['offset'](_0x58faa5['query'][_0x3009('0x19')]);}_0x38de75[_0x3009('0x36')]=qs[_0x3009('0x37')](_0x58faa5['query']['sort']);_0x38de75['where']=qs[_0x3009('0x2e')](_[_0x3009('0x38')](_0x58faa5[_0x3009('0x2d')],_0x499472[_0x3009('0x2e')]),_0x55687c);if(_0x58faa5[_0x3009('0x2d')][_0x3009('0x39')]){_0x38de75['where']=_[_0x3009('0x3a')](_0x38de75['where'],{'$or':_[_0x3009('0x29')](_0x55687c,function(_0x77435c){if(_0x77435c[_0x3009('0x2c')]!==_0x3009('0x3b')){var _0x95d2e4={};_0x95d2e4[_0x77435c[_0x3009('0x27')]]={'$like':'%'+_0x58faa5[_0x3009('0x2d')][_0x3009('0x39')]+'%'};return _0x95d2e4;}})});}_0x38de75=_[_0x3009('0x3a')]({},_0x38de75,_0x58faa5['options']);var _0x4871a9={'where':_0x38de75['where']};return db[_0x3009('0x2a')][_0x3009('0x1c')](_0x4871a9)[_0x3009('0x22')](function(_0xced83){_0x2d709c['count']=_0xced83;if(_0x58faa5[_0x3009('0x2d')][_0x3009('0x3c')]){_0x38de75[_0x3009('0x3d')]=[{'all':!![]}];}return db['ChatGroup'][_0x3009('0x3e')](_0x38de75);})[_0x3009('0x22')](function(_0x363b65){_0x2d709c[_0x3009('0x3f')]=_0x363b65;return _0x2d709c;})['then'](respondWithFilteredResult(_0xa171ea,_0x38de75))[_0x3009('0x40')](handleError(_0xa171ea,null));};exports['show']=function(_0x250394,_0x2707b3){var _0x41dfc3={'raw':!![],'where':{'id':_0x250394[_0x3009('0x41')]['id']}},_0x13660c={};_0x13660c[_0x3009('0x31')]=_[_0x3009('0x42')](db['ChatGroup']['rawAttributes']);_0x13660c[_0x3009('0x2d')]=_['keys'](_0x250394[_0x3009('0x2d')]);_0x13660c['filters']=_[_0x3009('0x2f')](_0x13660c[_0x3009('0x31')],_0x13660c[_0x3009('0x2d')]);_0x41dfc3['attributes']=_[_0x3009('0x2f')](_0x13660c['model'],qs[_0x3009('0x32')](_0x250394[_0x3009('0x2d')][_0x3009('0x32')]));_0x41dfc3[_0x3009('0x30')]=_0x41dfc3[_0x3009('0x30')]['length']?_0x41dfc3[_0x3009('0x30')]:_0x13660c['model'];if(_0x250394[_0x3009('0x2d')]['includeAll']){_0x41dfc3[_0x3009('0x3d')]=[{'all':!![]}];}_0x41dfc3=_['merge']({},_0x41dfc3,_0x250394['options']);return db[_0x3009('0x2a')]['find'](_0x41dfc3)[_0x3009('0x22')](handleEntityNotFound(_0x2707b3,null))[_0x3009('0x22')](respondWithResult(_0x2707b3,null))[_0x3009('0x40')](handleError(_0x2707b3,null));};exports[_0x3009('0x43')]=function(_0x4d1cc7,_0x54934d){return db[_0x3009('0x2a')][_0x3009('0x43')](_0x4d1cc7[_0x3009('0x44')],{})[_0x3009('0x22')](respondWithResult(_0x54934d,0xc9))[_0x3009('0x40')](handleError(_0x54934d,null));};exports[_0x3009('0x21')]=function(_0x5e8df3,_0x3eaa29){if(_0x5e8df3[_0x3009('0x44')]['id']){delete _0x5e8df3[_0x3009('0x44')]['id'];}return db[_0x3009('0x2a')][_0x3009('0x45')]({'where':{'id':_0x5e8df3['params']['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x3eaa29,null))[_0x3009('0x22')](saveUpdates(_0x5e8df3[_0x3009('0x44')],null))[_0x3009('0x22')](respondWithResult(_0x3eaa29,null))[_0x3009('0x40')](handleError(_0x3eaa29,null));};exports[_0x3009('0x23')]=function(_0x2b39b0,_0x592ff){return db['ChatGroup'][_0x3009('0x45')]({'where':{'id':_0x2b39b0[_0x3009('0x41')]['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x592ff,null))[_0x3009('0x22')](removeEntity(_0x592ff,null))[_0x3009('0x40')](handleError(_0x592ff,null));};exports[_0x3009('0x46')]=function(_0x343164,_0x28db6a){return db[_0x3009('0x2a')]['describe']()['then'](respondWithResult(_0x28db6a,null))[_0x3009('0x40')](handleError(_0x28db6a,null));};exports['getUnread']=function(_0x37024e,_0x16c11a,_0x13aaea){return db[_0x3009('0x47')]['count']({'where':{'ChatGroupId':_0x37024e[_0x3009('0x41')]['id'],'ToId':_0x37024e[_0x3009('0x48')]['id'],'read':![]}})[_0x3009('0x22')](function(_0x3a53d6){return{'id':_[_0x3009('0x49')](_0x37024e[_0x3009('0x41')]['id']),'count':_0x3a53d6};})[_0x3009('0x22')](respondWithResult(_0x16c11a,null))[_0x3009('0x40')](handleError(_0x16c11a,null));};exports['addMembers']=function(_0x1663fe,_0x1c5dc4,_0xe34b0d){return db['ChatGroup'][_0x3009('0x45')]({'where':{'id':_0x1663fe[_0x3009('0x41')]['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x1c5dc4,null))[_0x3009('0x22')](function(_0x41bd42){if(_0x41bd42){return _0x41bd42['addMembers'](_0x1663fe[_0x3009('0x44')][_0x3009('0x4a')],_['omit'](_0x1663fe[_0x3009('0x44')],['ids','id'])||{});}})[_0x3009('0x22')](respondWithResult(_0x1c5dc4,null))[_0x3009('0x40')](handleError(_0x1c5dc4,null));};exports['getMembers']=function(_0x35d3f7,_0x4bdd80,_0x1144c2){var _0x1d7237={};var _0x28a043={};var _0x1b4dc6;var _0x59d522;return db['ChatGroup'][_0x3009('0x4b')]({'where':{'id':_0x35d3f7[_0x3009('0x41')]['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x4bdd80,null))[_0x3009('0x22')](function(_0x9ab750){if(_0x9ab750){_0x1b4dc6=_0x9ab750;_0x28a043[_0x3009('0x31')]=_[_0x3009('0x42')](db[_0x3009('0x4c')][_0x3009('0x2b')]);_0x28a043[_0x3009('0x2d')]=_['keys'](_0x35d3f7['query']);_0x28a043[_0x3009('0x2e')]=_[_0x3009('0x2f')](_0x28a043[_0x3009('0x31')],_0x28a043[_0x3009('0x2d')]);_0x1d7237[_0x3009('0x30')]=_[_0x3009('0x2f')](_0x28a043[_0x3009('0x31')],qs[_0x3009('0x32')](_0x35d3f7[_0x3009('0x2d')][_0x3009('0x32')]));_0x1d7237[_0x3009('0x30')]=_0x1d7237[_0x3009('0x30')]['length']?_0x1d7237[_0x3009('0x30')]:_0x28a043[_0x3009('0x31')];_0x1d7237[_0x3009('0x36')]=qs[_0x3009('0x37')](_0x35d3f7[_0x3009('0x2d')][_0x3009('0x37')]);_0x1d7237[_0x3009('0x4d')]=qs[_0x3009('0x2e')](_[_0x3009('0x38')](_0x35d3f7[_0x3009('0x2d')],_0x28a043[_0x3009('0x2e')]));if(_0x35d3f7[_0x3009('0x2d')][_0x3009('0x39')]){_0x1d7237[_0x3009('0x4d')]=_[_0x3009('0x3a')](_0x1d7237[_0x3009('0x4d')],{'$or':_[_0x3009('0x29')](_0x1d7237['attributes'],function(_0x2fb922){var _0x1f72fe={};_0x1f72fe[_0x2fb922]={'$like':'%'+_0x35d3f7[_0x3009('0x2d')][_0x3009('0x39')]+'%'};return _0x1f72fe;})});}_0x1d7237=_[_0x3009('0x3a')]({},_0x1d7237,_0x35d3f7[_0x3009('0x4e')]);return _0x1b4dc6[_0x3009('0x4f')](_0x1d7237);}})[_0x3009('0x22')](function(_0x556bb7){if(_0x556bb7){_0x59d522=_0x556bb7[_0x3009('0x33')];if(!_0x35d3f7[_0x3009('0x2d')][_0x3009('0x34')](_0x3009('0x35'))){_0x1d7237[_0x3009('0x1a')]=qs['limit'](_0x35d3f7['query'][_0x3009('0x1a')]);_0x1d7237[_0x3009('0x19')]=qs[_0x3009('0x19')](_0x35d3f7[_0x3009('0x2d')]['offset']);}return _0x1b4dc6[_0x3009('0x4f')](_0x1d7237);}})[_0x3009('0x22')](function(_0x4fd6fe){if(_0x4fd6fe){return _0x4fd6fe?{'count':_0x59d522,'rows':_0x4fd6fe}:null;}})['then'](respondWithResult(_0x4bdd80,null))[_0x3009('0x40')](handleError(_0x4bdd80,null));};exports[_0x3009('0x50')]=function(_0xa47fa4,_0x102fc6,_0x518783){return db[_0x3009('0x2a')][_0x3009('0x45')]({'where':{'id':_0xa47fa4['params']['id']}})['then'](handleEntityNotFound(_0x102fc6,null))['then'](function(_0x1c8155){if(_0x1c8155){return _0x1c8155[_0x3009('0x50')](_0xa47fa4['query'][_0x3009('0x4a')]);}})[_0x3009('0x22')](respondWithStatusCode(_0x102fc6,null))[_0x3009('0x40')](handleError(_0x102fc6,null));};exports[_0x3009('0x51')]=function(_0x4d1b17,_0x9955c4,_0x2164fc){if(_0x4d1b17[_0x3009('0x44')]['id']){delete _0x4d1b17[_0x3009('0x44')]['id'];}return db[_0x3009('0x2a')][_0x3009('0x45')]({'where':{'id':_0x4d1b17[_0x3009('0x41')]['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x9955c4,null))[_0x3009('0x22')](function(_0x128b68){if(_0x128b68){_0x4d1b17[_0x3009('0x44')][_0x3009('0x52')]=_0x128b68['id'];return db['ChatInternalMessage']['create'](_0x4d1b17[_0x3009('0x44')]);}})[_0x3009('0x22')](respondWithResult(_0x9955c4,null))[_0x3009('0x40')](handleError(_0x9955c4,null));};exports[_0x3009('0x53')]=function(_0x23af7d,_0x2ca9e5,_0x2174c4){var _0x193224={};var _0x2bf6d6={};var _0xfc8618;var _0x415f2b;return db['ChatGroup'][_0x3009('0x4b')]({'where':{'id':_0x23af7d[_0x3009('0x41')]['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x2ca9e5,null))[_0x3009('0x22')](function(_0x3cdcdf){if(_0x3cdcdf){_0xfc8618=_0x3cdcdf;_0x2bf6d6[_0x3009('0x31')]=_[_0x3009('0x42')](db['ChatInternalMessage'][_0x3009('0x2b')]);_0x2bf6d6[_0x3009('0x2d')]=_['keys'](_0x23af7d['query']);_0x2bf6d6['filters']=_[_0x3009('0x2f')](_0x2bf6d6['model'],_0x2bf6d6[_0x3009('0x2d')]);_0x193224['attributes']=_['intersection'](_0x2bf6d6[_0x3009('0x31')],qs['fields'](_0x23af7d[_0x3009('0x2d')][_0x3009('0x32')]));_0x193224[_0x3009('0x30')]=_0x193224['attributes'][_0x3009('0x33')]?_0x193224[_0x3009('0x30')]:_0x2bf6d6[_0x3009('0x31')];_0x193224[_0x3009('0x36')]=qs[_0x3009('0x37')](_0x23af7d[_0x3009('0x2d')]['sort']);_0x193224[_0x3009('0x4d')]=qs[_0x3009('0x2e')](_[_0x3009('0x38')](_0x23af7d['query'],_0x2bf6d6[_0x3009('0x2e')]));if(_0x23af7d[_0x3009('0x2d')][_0x3009('0x39')]){_0x193224['where']=_['merge'](_0x193224[_0x3009('0x4d')],{'$or':_[_0x3009('0x29')](_0x193224[_0x3009('0x30')],function(_0x292a96){var _0x2a0a9d={};_0x2a0a9d[_0x292a96]={'$like':'%'+_0x23af7d[_0x3009('0x2d')][_0x3009('0x39')]+'%'};return _0x2a0a9d;})});}if(_0x23af7d[_0x3009('0x2d')][_0x3009('0x54')]){var _0x3e7ef0=_0x23af7d['query']['$gte'][_0x3009('0x55')](',');var _0x33fe7d={};_0x33fe7d[_0x3e7ef0[0x0]]={'$gte':moment(_0x3e7ef0[0x1])[_0x3009('0x56')](_0x3009('0x57'))};_0x193224[_0x3009('0x4d')]=_[_0x3009('0x3a')](_0x193224[_0x3009('0x4d')],_0x33fe7d);}_0x193224=_[_0x3009('0x3a')]({},_0x193224,_0x23af7d[_0x3009('0x4e')]);return _0xfc8618[_0x3009('0x53')](_0x193224);}})[_0x3009('0x22')](function(_0x4d4b7e){if(_0x4d4b7e){_0x415f2b=_0x4d4b7e[_0x3009('0x33')];if(!_0x23af7d[_0x3009('0x2d')]['hasOwnProperty'](_0x3009('0x35'))){_0x193224['limit']=qs['limit'](_0x23af7d['query'][_0x3009('0x1a')]);_0x193224[_0x3009('0x19')]=qs[_0x3009('0x19')](_0x23af7d[_0x3009('0x2d')]['offset']);}return _0xfc8618[_0x3009('0x53')](_0x193224);}})['then'](function(_0x2bd280){if(_0x2bd280){return _0x2bd280?{'count':_0x415f2b,'rows':_0x2bd280}:null;}})[_0x3009('0x22')](respondWithResult(_0x2ca9e5,null))[_0x3009('0x40')](handleError(_0x2ca9e5,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 1ec3cb0..9e75671 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 _0xa2e7=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2e7,0x95));var _0x7a2e=function(_0x23e2eb,_0x91cefb){_0x23e2eb=_0x23e2eb-0x0;var _0x37b2c9=_0xa2e7[_0x23e2eb];return _0x37b2c9;};'use strict';var EventEmitter=require(_0x7a2e('0x0'));var ChatGroup=require(_0x7a2e('0x1'))['db'][_0x7a2e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7a2e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7a2e('0x4')};function emitEvent(_0x461b67){return function(_0x52a351,_0x41c762,_0x459aa2){ChatGroupEvents[_0x7a2e('0x5')](_0x461b67+':'+_0x52a351['id'],_0x52a351);ChatGroupEvents[_0x7a2e('0x5')](_0x461b67,_0x52a351);_0x459aa2(null);};}for(var e in events){if(events[_0x7a2e('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7a2e('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x8f25=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5c4736,_0x4a61b2){var _0x53ade4=function(_0x13d2b3){while(--_0x13d2b3){_0x5c4736['push'](_0x5c4736['shift']());}};_0x53ade4(++_0x4a61b2);}(_0x8f25,0x14b));var _0x58f2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8f25[_0x2b5eae];return _0x5f3ac9;};'use strict';var EventEmitter=require(_0x58f2('0x0'));var ChatGroup=require(_0x58f2('0x1'))['db'][_0x58f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x58f2('0x3')](0x0);var events={'afterCreate':_0x58f2('0x4'),'afterUpdate':_0x58f2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f1491){return function(_0x575160,_0x1a0ef4,_0x8487c3){ChatGroupEvents[_0x58f2('0x6')](_0x4f1491+':'+_0x575160['id'],_0x575160);ChatGroupEvents['emit'](_0x4f1491,_0x575160);_0x8487c3(null);};}for(var e in events){if(events[_0x58f2('0x7')](e)){var event=events[e];ChatGroup[_0x58f2('0x8')](e,emitEvent(event));}}module[_0x58f2('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1b5ec86..b5ed99e 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 _0xb26c=['../../config/logger','moment','path','rimraf','../../config/environment','exports','ChatGroup','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb26c,0xfa));var _0xcb26=function(_0x168ebe,_0x1b8091){_0x168ebe=_0x168ebe-0x0;var _0x39cf63=_0xb26c[_0x168ebe];return _0x39cf63;};'use strict';var _=require(_0xcb26('0x0'));var util=require(_0xcb26('0x1'));var logger=require(_0xcb26('0x2'))('api');var moment=require(_0xcb26('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb26('0x4'));var rimraf=require(_0xcb26('0x5'));var config=require(_0xcb26('0x6'));var attributes=require('./chatGroup.attributes');module[_0xcb26('0x7')]=function(_0x5756a4,_0x1f4e90){return _0x5756a4['define'](_0xcb26('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f63=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0f63,0xf4));var _0x30f6=function(_0xeb3f4d,_0x555376){_0xeb3f4d=_0xeb3f4d-0x0;var _0x33e532=_0x0f63[_0xeb3f4d];return _0x33e532;};'use strict';var _=require(_0x30f6('0x0'));var util=require(_0x30f6('0x1'));var logger=require(_0x30f6('0x2'))(_0x30f6('0x3'));var moment=require('moment');var BPromise=require(_0x30f6('0x4'));var rp=require(_0x30f6('0x5'));var fs=require('fs');var path=require(_0x30f6('0x6'));var rimraf=require(_0x30f6('0x7'));var config=require(_0x30f6('0x8'));var attributes=require('./chatGroup.attributes');module[_0x30f6('0x9')]=function(_0x5362e1,_0x2b3b5e){return _0x5362e1[_0x30f6('0xa')](_0x30f6('0xb'),attributes,{'tableName':_0x30f6('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 3d05899..fc39932 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 _0xb0b9=['./chatGroup.socket','register','request','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3ade1d,_0x254e1c){var _0x439a39=function(_0x4ac00b){while(--_0x4ac00b){_0x3ade1d['push'](_0x3ade1d['shift']());}};_0x439a39(++_0x254e1c);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3c39c4,_0x5286d2){_0x3c39c4=_0x3c39c4-0x0;var _0x4b5d5d=_0xb0b9[_0x3c39c4];return _0x4b5d5d;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b0b('0x1'));var rs=require(_0x9b0b('0x2'));var fs=require('fs');var Redis=require(_0x9b0b('0x3'));var db=require(_0x9b0b('0x4'))['db'];var utils=require(_0x9b0b('0x5'));var logger=require(_0x9b0b('0x6'))(_0x9b0b('0x7'));var config=require(_0x9b0b('0x8'));var jayson=require(_0x9b0b('0x9'));var client=jayson[_0x9b0b('0xa')][_0x9b0b('0xb')]({'port':0x232a});config[_0x9b0b('0xc')]=_[_0x9b0b('0xd')](config[_0x9b0b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b0b('0xc')]));require(_0x9b0b('0xe'))[_0x9b0b('0xf')](socket);function respondWithRpcPromise(_0x2b0384,_0x2b0fd2,_0xc07d94){return new BPromise(function(_0x5713db,_0x426bc4){return client[_0x9b0b('0x10')](_0x2b0384,_0xc07d94)[_0x9b0b('0x11')](function(_0x40c06b){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2b0fd2,_0x9b0b('0x12'));logger['debug'](_0x9b0b('0x13'),_0x2b0fd2,'request\x20sent',JSON[_0x9b0b('0x14')](_0x40c06b));if(_0x40c06b[_0x9b0b('0x15')]){if(_0x40c06b['error']['code']===0x1f4){logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x40c06b[_0x9b0b('0x15')]['message']);return _0x426bc4(_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);}logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);return _0x5713db(_0x40c06b[_0x9b0b('0x15')][_0x9b0b('0x17')]);}else{logger[_0x9b0b('0x18')](_0x9b0b('0x16'),_0x2b0fd2,_0x9b0b('0x12'));_0x5713db(_0x40c06b[_0x9b0b('0x19')][_0x9b0b('0x17')]);}})[_0x9b0b('0x1a')](function(_0x51277a){logger[_0x9b0b('0x15')](_0x9b0b('0x16'),_0x2b0fd2,_0x51277a);_0x426bc4(_0x51277a);});});}
\ No newline at end of file
+var _0xea89=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x247733,_0x576613){var _0x274ffe=function(_0x56e8d7){while(--_0x56e8d7){_0x247733['push'](_0x247733['shift']());}};_0x274ffe(++_0x576613);}(_0xea89,0x1e2));var _0x9ea8=function(_0x40a0e5,_0x57e428){_0x40a0e5=_0x40a0e5-0x0;var _0x2db48a=_0xea89[_0x40a0e5];return _0x2db48a;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var moment=require(_0x9ea8('0x2'));var BPromise=require(_0x9ea8('0x3'));var rs=require(_0x9ea8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ea8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ea8('0x6'))('rpc');var config=require(_0x9ea8('0x7'));var jayson=require(_0x9ea8('0x8'));var client=jayson[_0x9ea8('0x9')][_0x9ea8('0xa')]({'port':0x232a});config[_0x9ea8('0xb')]=_[_0x9ea8('0xc')](config[_0x9ea8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ea8('0xd'))(new Redis(config[_0x9ea8('0xb')]));require('./chatGroup.socket')[_0x9ea8('0xe')](socket);function respondWithRpcPromise(_0x254fe0,_0x2de710,_0x493efe){return new BPromise(function(_0x251150,_0x83be7f){return client[_0x9ea8('0xf')](_0x254fe0,_0x493efe)[_0x9ea8('0x10')](function(_0x3a6e21){logger[_0x9ea8('0x11')](_0x9ea8('0x12'),_0x2de710,'request\x20sent');logger[_0x9ea8('0x13')](_0x9ea8('0x14'),_0x2de710,_0x9ea8('0x15'),JSON['stringify'](_0x3a6e21));if(_0x3a6e21[_0x9ea8('0x16')]){if(_0x3a6e21[_0x9ea8('0x16')][_0x9ea8('0x17')]===0x1f4){logger[_0x9ea8('0x16')](_0x9ea8('0x12'),_0x2de710,_0x3a6e21[_0x9ea8('0x16')][_0x9ea8('0x18')]);return _0x83be7f(_0x3a6e21['error'][_0x9ea8('0x18')]);}logger[_0x9ea8('0x16')](_0x9ea8('0x12'),_0x2de710,_0x3a6e21['error'][_0x9ea8('0x18')]);return _0x251150(_0x3a6e21['error'][_0x9ea8('0x18')]);}else{logger[_0x9ea8('0x11')](_0x9ea8('0x12'),_0x2de710,_0x9ea8('0x15'));_0x251150(_0x3a6e21[_0x9ea8('0x19')][_0x9ea8('0x18')]);}})[_0x9ea8('0x1a')](function(_0x4ce50c){logger[_0x9ea8('0x16')](_0x9ea8('0x12'),_0x2de710,_0x4ce50c);_0x83be7f(_0x4ce50c);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a561feb..6e71efc 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 _0xf814=['save','remove','update','emit','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xf814,0xbf));var _0x4f81=function(_0x1d0946,_0x3732fc){_0x1d0946=_0x1d0946-0x0;var _0x205df=_0xf814[_0x1d0946];return _0x205df;};'use strict';var ChatGroupEvents=require(_0x4f81('0x0'));var events=[_0x4f81('0x1'),_0x4f81('0x2'),_0x4f81('0x3')];function createListener(_0x195c29,_0x5721de){return function(_0x165f6e){_0x5721de[_0x4f81('0x4')](_0x195c29,_0x165f6e);};}function removeListener(_0x1fab8a,_0x127a53){return function(){ChatGroupEvents[_0x4f81('0x5')](_0x1fab8a,_0x127a53);};}exports[_0x4f81('0x6')]=function(_0x516930){for(var _0x74693b=0x0,_0x486619=events['length'];_0x74693b<_0x486619;_0x74693b++){var _0x55a904=events[_0x74693b];var _0x52b13=createListener(_0x4f81('0x7')+_0x55a904,_0x516930);ChatGroupEvents['on'](_0x55a904,_0x52b13);}};
\ No newline at end of file
+var _0x54b4=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x5d517b,_0x4990ae){var _0x675df7=function(_0x1e0b29){while(--_0x1e0b29){_0x5d517b['push'](_0x5d517b['shift']());}};_0x675df7(++_0x4990ae);}(_0x54b4,0x11a));var _0x454b=function(_0x2df3f8,_0x33e5b6){_0x2df3f8=_0x2df3f8-0x0;var _0x143cdc=_0x54b4[_0x2df3f8];return _0x143cdc;};'use strict';var ChatGroupEvents=require(_0x454b('0x0'));var events=[_0x454b('0x1'),_0x454b('0x2'),_0x454b('0x3')];function createListener(_0x323bf0,_0x28182a){return function(_0x25e523){_0x28182a[_0x454b('0x4')](_0x323bf0,_0x25e523);};}function removeListener(_0x2fe5f9,_0x3e44de){return function(){ChatGroupEvents[_0x454b('0x5')](_0x2fe5f9,_0x3e44de);};}exports['register']=function(_0x86dafa){for(var _0x2ffb62=0x0,_0x3443d5=events[_0x454b('0x6')];_0x2ffb62<_0x3443d5;_0x2ffb62++){var _0x5c545d=events[_0x2ffb62];var _0x2e7c84=createListener(_0x454b('0x7')+_0x5c545d,_0x86dafa);ChatGroupEvents['on'](_0x5c545d,_0x2e7c84);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 3d6f8b8..709ef5d 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 _0xf8a0=['get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','post','create','addMembers','/:id/messages','addMessage','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf8a0,0x98));var _0x0f8a=function(_0x33c638,_0x462bff){_0x33c638=_0x33c638-0x0;var _0x18a079=_0xf8a0[_0x33c638];return _0x18a079;};'use strict';var multer=require(_0x0f8a('0x0'));var util=require('util');var path=require(_0x0f8a('0x1'));var timeout=require(_0x0f8a('0x2'));var express=require(_0x0f8a('0x3'));var router=express[_0x0f8a('0x4')]();var fs_extra=require(_0x0f8a('0x5'));var auth=require(_0x0f8a('0x6'));var interaction=require(_0x0f8a('0x7'));var config=require(_0x0f8a('0x8'));var controller=require(_0x0f8a('0x9'));router[_0x0f8a('0xa')]('/',auth[_0x0f8a('0xb')](),controller['index']);router[_0x0f8a('0xa')](_0x0f8a('0xc'),auth[_0x0f8a('0xb')](),controller[_0x0f8a('0xd')]);router[_0x0f8a('0xa')](_0x0f8a('0xe'),auth[_0x0f8a('0xb')](),controller[_0x0f8a('0xf')]);router['get'](_0x0f8a('0x10'),auth['isAuthenticated'](),controller[_0x0f8a('0x11')]);router[_0x0f8a('0xa')](_0x0f8a('0x12'),auth[_0x0f8a('0xb')](),controller[_0x0f8a('0x13')]);router['get']('/:id/messages',auth[_0x0f8a('0xb')](),controller['getMessages']);router[_0x0f8a('0x14')]('/',auth[_0x0f8a('0xb')](),controller[_0x0f8a('0x15')]);router[_0x0f8a('0x14')](_0x0f8a('0x12'),auth[_0x0f8a('0xb')](),controller[_0x0f8a('0x16')]);router[_0x0f8a('0x14')](_0x0f8a('0x17'),auth[_0x0f8a('0xb')](),controller[_0x0f8a('0x18')]);router['put'](_0x0f8a('0xe'),auth['isAuthenticated'](),controller[_0x0f8a('0x19')]);router['delete'](_0x0f8a('0xe'),auth['isAuthenticated'](),controller[_0x0f8a('0x1a')]);router['delete'](_0x0f8a('0x12'),auth[_0x0f8a('0xb')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x47c4=['post','create','/:id/members','addMembers','/:id/messages','addMessage','/:id','update','destroy','delete','removeMembers','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','index','/describe','isAuthenticated','/:id/unread','getUnread','getMembers','getMessages'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x47c4,0x191));var _0x447c=function(_0xbed58e,_0x3a1272){_0xbed58e=_0xbed58e-0x0;var _0x295e44=_0x47c4[_0xbed58e];return _0x295e44;};'use strict';var multer=require('multer');var util=require(_0x447c('0x0'));var path=require(_0x447c('0x1'));var timeout=require(_0x447c('0x2'));var express=require('express');var router=express[_0x447c('0x3')]();var fs_extra=require(_0x447c('0x4'));var auth=require(_0x447c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x447c('0x6'));router[_0x447c('0x7')]('/',auth['isAuthenticated'](),controller[_0x447c('0x8')]);router['get'](_0x447c('0x9'),auth[_0x447c('0xa')](),controller['describe']);router[_0x447c('0x7')]('/:id',auth[_0x447c('0xa')](),controller['show']);router['get'](_0x447c('0xb'),auth['isAuthenticated'](),controller[_0x447c('0xc')]);router[_0x447c('0x7')]('/:id/members',auth[_0x447c('0xa')](),controller[_0x447c('0xd')]);router[_0x447c('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x447c('0xe')]);router[_0x447c('0xf')]('/',auth[_0x447c('0xa')](),controller[_0x447c('0x10')]);router['post'](_0x447c('0x11'),auth[_0x447c('0xa')](),controller[_0x447c('0x12')]);router[_0x447c('0xf')](_0x447c('0x13'),auth[_0x447c('0xa')](),controller[_0x447c('0x14')]);router['put'](_0x447c('0x15'),auth[_0x447c('0xa')](),controller[_0x447c('0x16')]);router['delete'](_0x447c('0x15'),auth['isAuthenticated'](),controller[_0x447c('0x17')]);router[_0x447c('0x18')](_0x447c('0x11'),auth['isAuthenticated'](),controller[_0x447c('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 81b53ec..4dcea8e 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 _0x6cb4=['star','thumb','TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x6cb4,0xff));var _0x46cb=function(_0x5e4052,_0x49d630){_0x5e4052=_0x5e4052-0x0;var _0x8c0452=_0x6cb4[_0x5e4052];return _0x8c0452;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize[_0x46cb('0x8')]},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize[_0x46cb('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize[_0x46cb('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x46cb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x46cb('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9532=['INTEGER','ENUM','star','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN'];(function(_0xebaa94,_0x27d73c){var _0xf4690f=function(_0x436ab2){while(--_0x436ab2){_0xebaa94['push'](_0xebaa94['shift']());}};_0xf4690f(++_0x27d73c);}(_0x9532,0x8c));var _0x2953=function(_0x4131d4,_0x30b3c8){_0x4131d4=_0x4131d4-0x0;var _0x3b88df=_0x9532[_0x4131d4];return _0x3b88df;};'use strict';var Sequelize=require(_0x2953('0x0'));module[_0x2953('0x1')]={'closed':{'type':Sequelize[_0x2953('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2953('0x3')]},'ratingType':{'type':Sequelize[_0x2953('0x4')](_0x2953('0x5'),'thumb'),'defaultValue':_0x2953('0x5')},'ratingMessage':{'type':Sequelize[_0x2953('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2953('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2953('0x7')]},'secondDisposition':{'type':Sequelize[_0x2953('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2953('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2953('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2953('0x7')]},'deviceType':{'type':Sequelize[_0x2953('0x7')]},'referer':{'type':Sequelize[_0x2953('0x6')]},'customerIp':{'type':Sequelize[_0x2953('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x2953('0x8'))},'read1stAt':{'type':Sequelize[_0x2953('0x9')]},'lastMsgAt':{'type':Sequelize[_0x2953('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x2953('0x4')]('in',_0x2953('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2953('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2953('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4365ee1..be334cf 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 _0x1a85=['System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','nolimit','includeAgent','rows','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','body','contact','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','params','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','email','isNull','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','attachmentDownload','Unauthorized','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','CmContact','%s%d','agentAlias'];(function(_0x3ca067,_0x2bf31a){var _0x55ad74=function(_0x7a9a5b){while(--_0x7a9a5b){_0x3ca067['push'](_0x3ca067['shift']());}};_0x55ad74(++_0x2bf31a);}(_0x1a85,0x178));var _0x51a8=function(_0x33b00c,_0x147745){_0x33b00c=_0x33b00c-0x0;var _0x5697dc=_0x1a85[_0x33b00c];return _0x5697dc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var pdf=require(_0x51a8('0x10'));var hardwareService=require(_0x51a8('0x11'));var logger=require(_0x51a8('0x12'))(_0x51a8('0x13'));var utils=require(_0x51a8('0x14'));var config=require(_0x51a8('0x15'));var licenseUtil=require(_0x51a8('0x16'));var db=require(_0x51a8('0x17'))['db'];config[_0x51a8('0x18')]=_[_0x51a8('0x19')](config[_0x51a8('0x18')],{'host':_0x51a8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51a8('0x18')]));require(_0x51a8('0x1b'))[_0x51a8('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0x51a8('0x1d')][_0x51a8('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x39cd45,_0x2b0521,_0x3fbd02,_0x3e0603){return new BPromise(function(_0x1f49ee,_0x516abc){var _0x1c2f25=_0x3e0603||client;return _0x1c2f25[_0x51a8('0x1f')](_0x39cd45,_0x3fbd02)[_0x51a8('0x20')](function(_0x23539e){logger[_0x51a8('0x21')](_0x51a8('0x22'),_0x2b0521,'request\x20sent');logger[_0x51a8('0x23')](_0x51a8('0x24'),_0x2b0521,_0x51a8('0x25'),JSON[_0x51a8('0x26')](_0x23539e));if(_0x23539e[_0x51a8('0x27')]){if(_0x23539e[_0x51a8('0x27')][_0x51a8('0x28')]===0x1f4){logger[_0x51a8('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x23539e[_0x51a8('0x27')]['message']);return _0x516abc(_0x23539e[_0x51a8('0x27')][_0x51a8('0x29')]);}logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x23539e['error'][_0x51a8('0x29')]);return _0x1f49ee(_0x23539e['error']['message']);}else{logger[_0x51a8('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x2b0521,_0x51a8('0x25'));_0x1f49ee(_0x23539e[_0x51a8('0x2a')][_0x51a8('0x29')]);}})[_0x51a8('0x2b')](function(_0x157554){logger[_0x51a8('0x27')](_0x51a8('0x22'),_0x2b0521,_0x157554);_0x516abc(_0x157554);});});}function respondWithStatusCode(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0xcc;return function(_0x273ce2){if(_0x273ce2){return _0x1326a2[_0x51a8('0x2c')](_0x5b3f49);}return _0x1326a2[_0x51a8('0x2d')](_0x5b3f49)[_0x51a8('0x2e')]();};}function respondWithResult(_0x1c150d,_0x11aefc){_0x11aefc=_0x11aefc||0xc8;return function(_0x1a886f){if(_0x1a886f){return _0x1c150d[_0x51a8('0x2d')](_0x11aefc)[_0x51a8('0x2f')](_0x1a886f);}};}function respondWithFilteredResult(_0x4b5cda,_0x20c6b5){return function(_0x347a02){if(_0x347a02){var _0x4a1548=typeof _0x20c6b5[_0x51a8('0x30')]==='undefined'&&typeof _0x20c6b5[_0x51a8('0x31')]===_0x51a8('0x32');var _0x143f46=_0x347a02[_0x51a8('0x33')];var _0x2136b4=_0x4a1548?0x0:_0x20c6b5['offset'];var _0x10c19b=_0x4a1548?_0x347a02['count']:_0x20c6b5[_0x51a8('0x30')]+_0x20c6b5[_0x51a8('0x31')];var _0x253a59;if(_0x10c19b>=_0x143f46){_0x10c19b=_0x143f46;_0x253a59=0xc8;}else{_0x253a59=0xce;}_0x4b5cda['status'](_0x253a59);return _0x4b5cda[_0x51a8('0x34')]('Content-Range',_0x2136b4+'-'+_0x10c19b+'/'+_0x143f46)[_0x51a8('0x2f')](_0x347a02);}return null;};}function patchUpdates(_0x192ac4){return function(_0x1ba6a7){try{jsonpatch[_0x51a8('0x35')](_0x1ba6a7,_0x192ac4,!![]);}catch(_0x193e0f){return BPromise['reject'](_0x193e0f);}return _0x1ba6a7[_0x51a8('0x36')]();};}function saveUpdates(_0x53b3b6,_0x9f0e6){return function(_0x2d977b){if(_0x2d977b){return _0x2d977b[_0x51a8('0x37')](_0x53b3b6)['then'](function(_0x1f9cfc){return _0x1f9cfc;});}return null;};}function removeEntity(_0xdc6cc7,_0x2b7833){return function(_0x2429f8){if(_0x2429f8){return _0x2429f8[_0x51a8('0x38')]()['then'](function(){_0xdc6cc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b871,_0x299001){return function(_0x4ec1db){if(!_0x4ec1db){_0x21b871[_0x51a8('0x2c')](0x194);}return _0x4ec1db;};}function handleError(_0x4ec0ac,_0x13723b){_0x13723b=_0x13723b||0x1f4;return function(_0x38aa25){logger[_0x51a8('0x27')](_0x38aa25[_0x51a8('0x39')]);if(_0x38aa25[_0x51a8('0x3a')]){delete _0x38aa25[_0x51a8('0x3a')];}_0x4ec0ac['status'](_0x13723b)['send'](_0x38aa25);};}function getMustacheRender(_0x377b4c,_0x5f524e){return Mustache['render'](_0x377b4c,_['merge'](_0x5f524e[_0x51a8('0x3b')],{'contact':_0x5f524e[_0x51a8('0x3c')],'message':_0x5f524e[_0x51a8('0x29')],'agent':_0x5f524e['agent'],'interaction':_0x5f524e[_0x51a8('0x3d')],'account':_0x5f524e[_0x51a8('0x3e')]}))||'';}function getInteractionUsers(_0x2e6432,_0x310ad2){return new BPromise(function(_0x5d3983,_0x19fa98){try{if(_0x310ad2[_0x2e6432['id']]){_0x2e6432[_0x51a8('0x3f')]=_[_0x51a8('0x40')](_0x310ad2[_0x2e6432['id']],function(_0x4dcbfb){return{'id':_0x4dcbfb['id'],'fullname':_0x4dcbfb[_0x51a8('0x41')]};});}}catch(_0x51d7bd){_0x19fa98(_0x51d7bd);}_0x5d3983(_0x2e6432);});}function getInteractionTags(_0x2032c0,_0x1e637a){return new BPromise(function(_0x2a98bd,_0x37d50b){try{if(_0x2032c0['TagIds']){_0x2032c0[_0x51a8('0x42')]=[];_0x2032c0[_0x51a8('0x43')][_0x51a8('0x44')](',')[_0x51a8('0x45')](function(_0xa33fc){_0x2032c0[_0x51a8('0x42')][_0x51a8('0x46')](_0x1e637a[_0xa33fc]);});}delete _0x2032c0[_0x51a8('0x43')];}catch(_0x3b15c7){_0x37d50b(_0x3b15c7);}_0x2a98bd(_0x2032c0);});}function updateChatInteraction(_0x4b8467,_0x22e6e6,_0x2afb74){return new BPromise(function(_0x4c7c67,_0x53409d){return getInteractionUsers(_0x4b8467,_0x2afb74)[_0x51a8('0x20')](function(_0x19a57c){return getInteractionTags(_0x19a57c,_0x22e6e6);})[_0x51a8('0x20')](function(_0x27b8e5){_0x4c7c67(_0x27b8e5);})[_0x51a8('0x2b')](function(_0x157a51){_0x53409d(_0x157a51);});});}exports[_0x51a8('0x47')]=function(_0x18c697,_0x26ad89){var _0x2e80ed={},_0x4bdee0={},_0x416988={'count':0x0,'rows':[]};var _0x218ae0=_[_0x51a8('0x40')](db[_0x51a8('0x48')][_0x51a8('0x49')],function(_0x22ff0e){return{'name':_0x22ff0e['fieldName'],'type':_0x22ff0e[_0x51a8('0x4a')]['key']};});_0x4bdee0[_0x51a8('0x4b')]=_[_0x51a8('0x40')](_0x218ae0,_0x51a8('0x3a'));_0x4bdee0[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x18c697['query']);_0x4bdee0['filters']=_[_0x51a8('0x4e')](_0x4bdee0[_0x51a8('0x4b')],_0x4bdee0[_0x51a8('0x4c')]);_0x2e80ed[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4bdee0['model'],qs['fields'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2e80ed[_0x51a8('0x4f')]=_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x51')]?_0x2e80ed[_0x51a8('0x4f')]:_0x4bdee0[_0x51a8('0x4b')];if(!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x52')]('nolimit')){_0x2e80ed['limit']=qs['limit'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x31')]);_0x2e80ed[_0x51a8('0x30')]=qs['offset'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2e80ed['order']=qs[_0x51a8('0x53')](_0x18c697['query']['sort']);_0x2e80ed[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x18c697['query'],_0x4bdee0['filters']),_0x218ae0);var _0x3a8f1e=[];var _0x5b0398=squel[_0x51a8('0x57')]()[_0x51a8('0x58')]('id')[_0x51a8('0x58')](_0x51a8('0x3a'))[_0x51a8('0x58')](_0x51a8('0x59'))[_0x51a8('0x5a')](_0x51a8('0x5b'));var _0x29d31e=squel['select']()[_0x51a8('0x58')](_0x51a8('0x5c'))[_0x51a8('0x58')](_0x51a8('0x5d'))['field'](_0x51a8('0x5e'))['from'](_0x51a8('0x5f'),'ui')[_0x51a8('0x60')]('users','u','u.id\x20=\x20ui.UserId');var _0x2628d4=squel[_0x51a8('0x57')]()[_0x51a8('0x5a')](_0x51a8('0x61'),'i')[_0x51a8('0x60')]('cm_contacts','c',_0x51a8('0x62'))[_0x51a8('0x60')](_0x51a8('0x63'),'o',_0x51a8('0x64'))[_0x51a8('0x60')]('chat_websites','a',_0x51a8('0x65'))[_0x51a8('0x60')](_0x51a8('0x66'),'me',_0x51a8('0x67'))[_0x51a8('0x60')](_0x51a8('0x68'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2048c6=squel[_0x51a8('0x69')]();var _0x51f9f7=[];var _0x7ac0ae=squel['expr']();var _0x41cc00;if(_0x18c697['query'][_0x51a8('0x6a')]){_0x41cc00=as[_0x51a8('0x6b')](_0x18c697['query']['search']);var _0x5eb540=_0x41cc00[_0x51a8('0x6c')];for(var _0x1ead77=0x0;_0x1ead77<_0x41cc00[_0x51a8('0x6d')][_0x51a8('0x51')];_0x1ead77++){var _0x149047=_0x41cc00[_0x51a8('0x6d')][_0x1ead77];var _0x3fd347='i';var _0x259153=_['find'](_0x218ae0,[_0x51a8('0x3a'),_0x149047[_0x51a8('0x58')]]);if(!_0x259153){switch(_0x149047['field']){case _0x51a8('0x6e'):if(_0x149047[_0x51a8('0x6f')]==0x1){_0x2628d4[_0x51a8('0x70')]('`'+_0x149047[_0x51a8('0x58')]+_0x51a8('0x71'));}else{_0x2628d4[_0x51a8('0x70')]('`'+_0x149047['field']+'`\x20>\x200');}break;case _0x51a8('0x72'):if(_0x149047['operator']==='$substring'){if(_0x149047['value']['split']('\x20')['length']>0x1){_0x2048c6[_0x5eb540](_0x51a8('0x73'),qs['getFullTextValue'](_0x149047[_0x51a8('0x6f')]),null);}else{var _0x4772cd='%'+_0x149047[_0x51a8('0x6f')]+'%';_0x2048c6[_0x5eb540](_0x51a8('0x74'),_0x4772cd,_0x4772cd,_0x4772cd);}}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),_0x51a8('0x76')]);_0x149047[_0x51a8('0x58')]=_0x51a8('0x76');_0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074['value']['end']);}break;case'Tag':var _0x10c22e=_0x149047[_0x51a8('0x6f')][_0x51a8('0x44')](',')[_0x51a8('0x40')](function(_0x2efb36){return Number(_0x2efb36);});_0x10c22e[_0x51a8('0x45')](function(_0x351c22){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x351c22+',%');});_0x51f9f7=_[_0x51a8('0x7b')](_0x51f9f7,_0x10c22e);break;case _0x51a8('0x7c'):if(_0x149047[_0x51a8('0x7d')]===_0x51a8('0x7e')){_0x2048c6[_0x5eb540](_0x51a8('0x7f'),'%'+_0x149047['value']+'%',null);}else{_0x259153=_[_0x51a8('0x75')](_0x218ae0,[_0x51a8('0x3a'),'UserId']);_0x149047[_0x51a8('0x58')]='UserId';_0x238074=as['buildExpression'](_0x3fd347,_0x259153['type'],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x79')],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);}break;case _0x51a8('0x3b'):_0x238074=as[_0x51a8('0x77')]('me',null,_0x149047);_0x2048c6[_0x5eb540](_0x238074['text'],_0x238074['value']['start'],_0x238074[_0x51a8('0x6f')][_0x51a8('0x2e')]);break;}}else{var _0x238074=as[_0x51a8('0x77')](_0x3fd347,_0x259153[_0x51a8('0x4a')],_0x149047);_0x2048c6[_0x5eb540](_0x238074[_0x51a8('0x78')],_0x238074['value'][_0x51a8('0x79')],_0x238074['value'][_0x51a8('0x2e')]);}}}else{var _0x1be70f=_(_0x18c697[_0x51a8('0x4c')])[_0x51a8('0x4d')]()[_0x51a8('0x40')](function(_0x3aca4a){return _[_0x51a8('0x80')](_0x218ae0,[_0x51a8('0x3a'),_0x3aca4a])?_0x3aca4a:undefined;})[_0x51a8('0x81')]()[_0x51a8('0x6f')]();if(!_[_0x51a8('0x82')](_0x1be70f)){_0x1be70f['forEach'](function(_0x4b99cb){if(_0x4b99cb===_0x51a8('0x83')){_0x2628d4[_0x51a8('0x54')](_0x51a8('0x84'),[][_0x51a8('0x85')](_0x18c697['query'][_0x4b99cb]));}else if(_0x4b99cb===_0x51a8('0x86')){var _0x4d418a=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x88')];var _0x24fcc3=JSON[_0x51a8('0x87')](_0x18c697[_0x51a8('0x4c')][_0x4b99cb])[_0x51a8('0x89')];_0x2628d4[_0x51a8('0x54')](_0x51a8('0x8a'),_0x4d418a,_0x24fcc3);}else{if(_0x18c697['query'][_0x4b99cb]===_0x51a8('0x8b')){_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+_0x51a8('0x8c'));}else{_0x2628d4[_0x51a8('0x54')]('i.'+_0x4b99cb+'\x20=\x20?',_0x18c697['query'][_0x4b99cb]);}}});}if(_0x18c697[_0x51a8('0x4c')]['read']){if(_0x18c697['query']['read']==0x1){_0x2628d4[_0x51a8('0x70')]('`unreadMessages`\x20=\x200');}else{_0x2628d4['having'](_0x51a8('0x8d'));}}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]){_0x51f9f7=_['isArray'](_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')])?_0x18c697[_0x51a8('0x4c')]['tag']:new Array(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8e')]);_0x51f9f7[_0x51a8('0x45')](function(_0x16e90a){_0x7ac0ae['or'](_0x51a8('0x7a'),'%,'+_0x16e90a+',%');});}if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x8f')]){var _0x245f5b=_0x18c697[_0x51a8('0x4c')]['filter'][_0x51a8('0x90')]('\x5c','\x5c\x5c')[_0x51a8('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x245f5b)){_0x2048c6['or'](_0x51a8('0x91'),_0x245f5b+'%');}else{_0x2048c6['or'](_0x51a8('0x92'),qs['getFullTextValue'](_0x245f5b))['or'](_0x51a8('0x93'),_0x245f5b+'%');}}}_0x2628d4[_0x51a8('0x54')](_0x2048c6);_0x2628d4[_0x51a8('0x94')](_0x51a8('0x95'));var _0x398fb2={'type':db['Sequelize'][_0x51a8('0x96')][_0x51a8('0x97')],'raw':!![]};var _0x12d018=_0x2628d4[_0x51a8('0x98')]();_0x12d018['field'](_0x51a8('0x95'));_0x12d018[_0x51a8('0x58')](_0x51a8('0x99'),_0x51a8('0x6e'));if(_0x2e80ed[_0x51a8('0x9a')]){_0x2e80ed[_0x51a8('0x9a')][_0x51a8('0x45')](function(_0xd22e7b){var _0x540c86=_0xd22e7b[0x0]===_0x51a8('0x9b')?_0xd22e7b[0x0]:'i.'+_0xd22e7b[0x0];_0x2628d4[_0x51a8('0x9a')](_0x540c86,_0xd22e7b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x51a8('0x82')](_0x51f9f7)){_0x2628d4[_0x51a8('0x70')](_0x7ac0ae);_0x12d018['where'](_0x51a8('0x9c'),_0x51f9f7);}BPromise['resolve']()['then'](function(){if(!_0x41cc00){if(_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return;_0x12d018[_0x51a8('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2628d4['where'](_0x51a8('0x9d'));return;}if(_0x18c697['user'][_0x51a8('0x9e')]!==_0x51a8('0x9f'))return;return _0x18c697[_0x51a8('0xa0')][_0x51a8('0xa1')]({'attributes':['id'],'raw':!![]})[_0x51a8('0x20')](function(_0x28acb8){if(_[_0x51a8('0x82')](_0x28acb8)){_0x12d018[_0x51a8('0x54')](_0x51a8('0xa2'));_0x2628d4[_0x51a8('0x54')](_0x51a8('0xa2'));}else{_0x12d018[_0x51a8('0x54')](_0x51a8('0x84'),_[_0x51a8('0x40')](_0x28acb8,'id'));_0x2628d4[_0x51a8('0x54')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x28acb8,'id'));}});})[_0x51a8('0x20')](function(){if(_0x18c697['user']['role']==='agent'&&!_0x41cc00&&!_0x18c697[_0x51a8('0x4c')][_0x51a8('0x83')])return[];return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x12d018['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x343fec){_0x416988['count']=_0x343fec[_0x51a8('0x51')];if(_0x416988[_0x51a8('0x33')]===0x0)return[];return db['sequelize']['query'](_0x5b0398[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x8587b9){_0x3a8f1e=_[_0x51a8('0xa5')](_0x8587b9,'id');_0x398fb2=_[_0x51a8('0xa6')](_0x398fb2,{'model':db[_0x51a8('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18c697['query'][_0x51a8('0x50')]){_0x2e80ed[_0x51a8('0x4f')][_0x51a8('0x45')](function(_0x566d62){_0x2628d4[_0x51a8('0x58')]('i.'+_0x566d62);});}else{_0x2628d4[_0x51a8('0x58')](_0x51a8('0x99'),'unreadMessages');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa7'),'Account.key');_0x2628d4[_0x51a8('0x58')]('a.mandatoryDisposition',_0x51a8('0xa8'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xa9'),_0x51a8('0x9b'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xaa'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xab'),'Contact.firstName');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xac'),_0x51a8('0xad'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xae'),'Contact.email');_0x2628d4['field'](_0x51a8('0xaf'),_0x51a8('0xb0'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb1'),_0x51a8('0xb2'));_0x2628d4['field'](_0x51a8('0xb3'),'Contact.fax');_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb4'),'Owner.fullname');_0x2628d4[_0x51a8('0x58')]('o.internal',_0x51a8('0xb5'));_0x2628d4[_0x51a8('0x58')](_0x51a8('0xb6'),_0x51a8('0x43'));}if(_0x2e80ed[_0x51a8('0x31')])_0x2628d4['limit'](_0x2e80ed[_0x51a8('0x31')]);if(_0x2e80ed[_0x51a8('0x30')])_0x2628d4['offset'](_0x2e80ed[_0x51a8('0x30')]);return db[_0x51a8('0xa3')]['query'](_0x2628d4['toString'](),_0x398fb2);})[_0x51a8('0x20')](function(_0x158c45){if(_0x158c45[_0x51a8('0x51')]>0x0)_0x29d31e['where'](_0x51a8('0xb7'),_[_0x51a8('0x40')](_0x158c45,'id'));return db[_0x51a8('0xa3')][_0x51a8('0x4c')](_0x29d31e[_0x51a8('0xa4')](),_0x398fb2)[_0x51a8('0x20')](function(_0x30bf44){var _0x5a32ce=_[_0x51a8('0xb8')](_0x30bf44,_0x51a8('0xb9'));var _0xa29735=[];_0x158c45[_0x51a8('0x45')](function(_0x4ef066){_0xa29735['push'](updateChatInteraction(_0x4ef066,_0x3a8f1e,_0x5a32ce));});return BPromise[_0x51a8('0xba')](_0xa29735);});});})[_0x51a8('0x20')](function(_0x58b25d){_0x416988['rows']=_0x58b25d;return _0x416988;})['then'](respondWithFilteredResult(_0x26ad89,_0x2e80ed))[_0x51a8('0x2b')](handleError(_0x26ad89,null));};exports['show']=function(_0x47c025,_0x517de1){var _0x2164d7={'raw':![],'where':{'id':_0x47c025[_0x51a8('0xbb')]['id']}},_0x4b03f7={};_0x4b03f7[_0x51a8('0x4b')]=_['keys'](db['ChatInteraction'][_0x51a8('0x49')]);_0x4b03f7['query']=_[_0x51a8('0x4d')](_0x47c025[_0x51a8('0x4c')]);_0x4b03f7['filters']=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],_0x4b03f7['query']);_0x2164d7[_0x51a8('0x4f')]=_[_0x51a8('0x4e')](_0x4b03f7[_0x51a8('0x4b')],qs['fields'](_0x47c025[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2164d7[_0x51a8('0x4f')]=_0x2164d7['attributes']['length']?_0x2164d7[_0x51a8('0x4f')]:_0x4b03f7[_0x51a8('0x4b')];if(_0x47c025[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2164d7[_0x51a8('0xbd')]=[{'all':!![]}];}_0x2164d7=_[_0x51a8('0xa6')]({},_0x2164d7,_0x47c025[_0x51a8('0xbe')]);return db[_0x51a8('0x48')][_0x51a8('0x75')](_0x2164d7)[_0x51a8('0x20')](handleEntityNotFound(_0x517de1,null))[_0x51a8('0x20')](respondWithResult(_0x517de1,null))[_0x51a8('0x2b')](handleError(_0x517de1,null));};exports[_0x51a8('0xbf')]=function(_0x575c51,_0x4fdc39){return db[_0x51a8('0x48')][_0x51a8('0xbf')](_0x575c51[_0x51a8('0x3b')],{})[_0x51a8('0x20')](respondWithResult(_0x4fdc39,0xc9))[_0x51a8('0x2b')](handleError(_0x4fdc39,null));};exports['update']=function(_0x59a17d,_0x39e8e6){if(_0x59a17d[_0x51a8('0x3b')]['id']){delete _0x59a17d['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x59a17d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x39e8e6,null))[_0x51a8('0x20')](saveUpdates(_0x59a17d['body'],null))['then'](respondWithResult(_0x39e8e6,null))[_0x51a8('0x2b')](handleError(_0x39e8e6,null));};exports['destroy']=function(_0x96219,_0x5bd9a6){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x96219['params']['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x5bd9a6,null))[_0x51a8('0x20')](removeEntity(_0x5bd9a6,null))[_0x51a8('0x2b')](handleError(_0x5bd9a6,null));};exports[_0x51a8('0xc0')]=function(_0x5cacc1,_0x57b718){return db[_0x51a8('0x48')][_0x51a8('0xc0')]()[_0x51a8('0x20')](respondWithResult(_0x57b718,null))[_0x51a8('0x2b')](handleError(_0x57b718,null));};exports['createVidaooSession']=function(_0xaaa86f,_0x5ebf39){var _0x40a229=_0xaaa86f['params']['id'];var _0x1d03c1;var _0x1667b7;var _0x1ae73c;return db[_0x51a8('0x48')]['findOne']({'where':{'id':_0x40a229}})[_0x51a8('0x20')](function(_0x50ced7){_0x1d03c1=_0x50ced7;return db[_0x51a8('0xc1')][_0x51a8('0xc2')]({'where':{'id':_0x50ced7[_0x51a8('0x83')]},'attributes':['id','vidaooApiKey',_0x51a8('0xc3'),_0x51a8('0xc4'),_0x51a8('0xc5'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x14792a){if(_0x14792a&&_0x14792a[_0x51a8('0xc6')]&&_0x14792a[_0x51a8('0xc3')]){_0x1667b7=_0x14792a;var _0x706653={'interaction':{'id':_0x40a229},'agent':{'id':_0xaaa86f['user']['id'],'name':_0xaaa86f['user'][_0x51a8('0x3a')],'fullname':_0xaaa86f['user'][_0x51a8('0x41')],'email':_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]},'contact':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3c')],'account':_0xaaa86f[_0x51a8('0x3b')][_0x51a8('0x3e')]};var _0x5ec5f2={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x14792a[_0x51a8('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xaaa86f[_0x51a8('0xa0')][_0x51a8('0xc7')]],'buttons':null,'topic':_0x1667b7[_0x51a8('0xc4')],'note':_[_0x51a8('0xc8')](_0x1667b7['vidaooNote'])?null:getMustacheRender(_0x1667b7[_0x51a8('0xc5')],_0x706653),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x51a8('0xc8')](_0x1667b7[_0x51a8('0xc9')])){var _0x1dcdd9=getMustacheRender(_0x1667b7[_0x51a8('0xc9')],_0x706653);var _0x55d905=JSON['parse'](_0x1dcdd9);_0x5ec5f2[_0x51a8('0x3b')]['metadata']=_0x55d905;}}catch(_0x289366){throw new db[(_0x51a8('0xca'))][(_0x51a8('0xcb'))](_0x51a8('0xcc'));}return rp(_0x5ec5f2);}else{throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xcd'));}})[_0x51a8('0x20')](function(_0x26e672){_0x1ae73c=_0x26e672;if(_0x1ae73c['id']){var _0x3dbfd7={'body':_0x1ae73c[_0x51a8('0xce')],'ChatWebsiteId':_0x1667b7['id'],'ChatInteractionId':_0x1d03c1['id'],'direction':_0x51a8('0xcf'),'UserId':_0xaaa86f[_0x51a8('0xa0')]['id']};return db[_0x51a8('0xd0')][_0x51a8('0xbf')](_0x3dbfd7,{});}else{throw new db[(_0x51a8('0xca'))]['ValidationError'](_0x51a8('0xd1'));}})[_0x51a8('0x20')](function(){return _0x1d03c1[_0x51a8('0xd2')]({'vidaooSessionId':_0x1ae73c['id']});})[_0x51a8('0x20')](respondWithResult(_0x5ebf39,null))[_0x51a8('0x2b')](handleError(_0x5ebf39,null));};exports['customUpdate']=function(_0x3ed105,_0x4a48b4){if(_0x3ed105[_0x51a8('0x3b')]['id']){delete _0x3ed105['body']['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x3ed105[_0x51a8('0xbb')]['id']},'include':[{'model':db['CmContact'],'as':_0x51a8('0x72')}]})[_0x51a8('0x20')](handleEntityNotFound(_0x4a48b4,null))[_0x51a8('0x20')](saveUpdates(_0x3ed105[_0x51a8('0x3b')],null))['then'](respondWithResult(_0x4a48b4,null))['catch'](handleError(_0x4a48b4,null));};exports['abandon']=function(_0x1e957d,_0x5ed8f1,_0x5ee996){if(_0x1e957d[_0x51a8('0x3b')]['id']){delete _0x1e957d[_0x51a8('0x3b')]['id'];}return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x1e957d[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](function(_0x5b316b){if(!_0x5b316b){logger[_0x51a8('0x27')](_0x51a8('0xd3'),'abandon',0x194,'entity\x20not\x20found');_0x5ed8f1[_0x51a8('0x2c')](0x194);}else{if(_0x5b316b[_0x51a8('0xd4')]){throw new db['Sequelize'][(_0x51a8('0xcb'))](_0x51a8('0xd5'));}}return _0x5b316b;})[_0x51a8('0x20')](function(_0x3dbaa0){if(_0x3dbaa0){return _0x3dbaa0[_0x51a8('0x37')]({'closed':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd6')],'disposition':_0x1e957d[_0x51a8('0x3b')][_0x51a8('0xd7')]})[_0x51a8('0x20')](function(_0xc7c551){return _0xc7c551;});}})[_0x51a8('0x20')](function(_0x441b16){return respondWithRpcPromise(_0x51a8('0xd8'),_0x51a8('0xd9'),_0x1e957d['body'],client9004);})[_0x51a8('0x20')](respondWithResult(_0x5ed8f1,null))[_0x51a8('0x2b')](handleError(_0x5ed8f1,null));};exports['attachmentUpload']=function(_0xbc8168,_0x1d9439,_0x4b137c){_0xbc8168[_0x51a8('0x3b')]['name']=_0xbc8168['file'][_0x51a8('0xda')];_0xbc8168['body'][_0x51a8('0xdb')]=_0xbc8168[_0x51a8('0xdc')][_0x51a8('0xdd')];_0xbc8168[_0x51a8('0x3b')]['type']=_0xbc8168['file']['mimetype'];return db['Attachment'][_0x51a8('0xbf')](_0xbc8168[_0x51a8('0x3b')])[_0x51a8('0x20')](respondWithResult(_0x1d9439,0xc9))[_0x51a8('0x2b')](handleError(_0x1d9439,null));};exports[_0x51a8('0xde')]=function(_0x953f85,_0x2d5307,_0x4d7035){return db['ChatInteraction'][_0x51a8('0xc2')]({'where':{'id':_0x953f85['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null))[_0x51a8('0x20')](function(_0x33bea4){if(_0x33bea4){if(_0x33bea4[_0x51a8('0xd6')]){return _0x2d5307[_0x51a8('0x2d')](0x193)[_0x51a8('0x2f')]({'status':0x193,'message':_0x51a8('0xdf')});}return db[_0x51a8('0xe0')][_0x51a8('0xc2')]({'where':{'id':_0x953f85[_0x51a8('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x2d5307,null));}})[_0x51a8('0x20')](function(_0x2d95eb){if(_0x2d95eb){var _0x2559e0=_0x2d95eb[_0x51a8('0xe1')]!==null;var _0x441034=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0xe4'));if(_0x2559e0){_0x441034=path[_0x51a8('0xe2')](_0x441034,_0x51a8('0xe5'));}var _0x4a55c0=path['join'](_0x441034,_0x2d95eb['basename']);return _0x2d5307[_0x51a8('0xe6')](_0x4a55c0);}})[_0x51a8('0x2b')](handleError(_0x2d5307,null));};exports[_0x51a8('0xe7')]=function(_0x58c6df,_0x44fa71){var _0x18179c=null;var _0x17cb9f=null;var _0x43b1d2=null;var _0x4f8535=null;if(_0x58c6df[_0x51a8('0x3b')]['id']){delete _0x58c6df[_0x51a8('0x3b')]['id'];}if(_0x58c6df['body'][_0x51a8('0xe8')]){_0x4f8535=path['join'](config[_0x51a8('0xe3')],_0x51a8('0xe9'),util[_0x51a8('0xea')](_0x51a8('0xeb'),Date['now']()));_0x58c6df[_0x51a8('0x3b')]['pathTranscript']=_0x4f8535;}return db['ChatInteraction'][_0x51a8('0x75')]({'where':{'id':_0x58c6df[_0x51a8('0xbb')]['id']},'include':[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'include':[{'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c')}]}]})[_0x51a8('0x20')](handleEntityNotFound(_0x44fa71,null))['then'](saveUpdates(_0x58c6df[_0x51a8('0x3b')],null))[_0x51a8('0x20')](function(_0x7aa19f){if(_0x7aa19f){_0x18179c=_0x7aa19f;return db[_0x51a8('0xc1')]['find']({'where':{'id':_0x18179c[_0x51a8('0x83')]}});}})[_0x51a8('0x20')](function(_0x350385){if(_0x350385){_0x43b1d2=_0x350385;return db[_0x51a8('0xed')]['find']({'where':{'id':_0x18179c[_0x51a8('0x76')]}});}})[_0x51a8('0x20')](function(_0x584235){if(_0x584235){_0x17cb9f=_0x584235;if(_0x4f8535){var _0x206c27=null;for(var _0x500112=0x1;_0x500112<_0x18179c[_0x51a8('0xec')][_0x51a8('0x51')];++_0x500112){_0x206c27=_0x18179c[_0x51a8('0xec')][_0x500112];var _0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');var _0x5c78b9=_0x58c6df['body'][_0x51a8('0xf1')]||util['format'](_0x51a8('0xee'),_0x51a8('0xf2'),_0x206c27[_0x51a8('0x76')]);switch(_0x43b1d2[_0x51a8('0xf3')]){case _0x51a8('0xf4'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')]('%s%d',_0x43b1d2['agentAlias'],_0x206c27[_0x51a8('0xd4')]):_0x51a8('0xf0');break;case _0x51a8('0xf5'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27[_0x51a8('0x7c')][_0x51a8('0xf6')]||_0x206c27[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0');break;case _0x51a8('0xf7'):_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?_0x206c27['User']['fullname']:_0x51a8('0xf0');break;default:_0x24a6a8=_0x206c27[_0x51a8('0xd4')]?util[_0x51a8('0xea')](_0x51a8('0xee'),_0x43b1d2[_0x51a8('0xef')],_0x206c27[_0x51a8('0xd4')]):'System';}var _0x13fb74=util[_0x51a8('0xea')]('[%s]\x20%s:\x20%s\x0a',moment(_0x206c27[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0xf8')),_0x206c27[_0x51a8('0xf9')]==='in'?_0x5c78b9:_0x24a6a8,_0x206c27['body']);if(!_0x206c27[_0x51a8('0xfa')]){fs[_0x51a8('0xfb')](_0x4f8535,_0x13fb74);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x51a8('0xfc')],'as':_0x51a8('0xfd'),'raw':!![]}]});}}})[_0x51a8('0x20')](function(_0x359e42){if(_0x359e42&&_0x359e42[_0x51a8('0xfd')]&&_0x58c6df[_0x51a8('0x3b')]){var _0x4eeff2={'tls':{'rejectUnauthorized':![]}};if(_0x359e42[_0x51a8('0xfd')]['service']){_0x4eeff2[_0x51a8('0xfe')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xfe')];}else{_0x4eeff2['host']=_0x359e42[_0x51a8('0xfd')]['host'];_0x4eeff2[_0x51a8('0xff')]=_0x359e42[_0x51a8('0xfd')][_0x51a8('0xff')];_0x4eeff2['secure']=_0x359e42[_0x51a8('0xfd')][_0x51a8('0x100')];}if(_0x359e42[_0x51a8('0xfd')][_0x51a8('0x101')]){_0x4eeff2[_0x51a8('0x102')]={'user':_0x359e42[_0x51a8('0xfd')]['user'],'pass':_0x359e42['Smtp'][_0x51a8('0x103')]};}return respondWithRpcPromise(_0x51a8('0x104'),_0x51a8('0x105'),{'account':_0x4eeff2,'message':{'from':util['format'](_0x51a8('0x106'),_0x359e42[_0x51a8('0x3a')],_0x359e42[_0x51a8('0xc7')]||_0x359e42[_0x51a8('0xfd')]['user']),'to':_0x58c6df['body'][_0x51a8('0xe8')],'subject':'Mail\x20Transcript','text':util[_0x51a8('0xea')](_0x51a8('0x107'),_0x58c6df[_0x51a8('0x3b')][_0x51a8('0xe8')]),'attachments':[{'path':_0x4f8535}]}})['then'](function(){return _0x18179c;})[_0x51a8('0x2b')](function(_0x4e62f3){console[_0x51a8('0x27')](_0x4e62f3);});}else{return _0x18179c;}})[_0x51a8('0x20')](respondWithStatusCode(_0x44fa71,0xc8))[_0x51a8('0x2b')](handleError(_0x44fa71,null));};exports['addMessage']=function(_0x5e50ea,_0x3589be,_0x10fd78){return db[_0x51a8('0xd0')][_0x51a8('0x75')]({'where':{'id':_0x5e50ea[_0x51a8('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3589be,null))[_0x51a8('0x20')](function(_0x288180){if(_0x288180){return _0x288180[_0x51a8('0x108')](_0x5e50ea['body'][_0x51a8('0x109')],_[_0x51a8('0x10a')](_0x5e50ea[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{});}})[_0x51a8('0x20')](respondWithResult(_0x3589be,null))[_0x51a8('0x2b')](handleError(_0x3589be,null));};exports[_0x51a8('0x10b')]=function(_0x52004e,_0x15ac9b,_0x1aed5b){var _0xeba541={'raw':![],'where':{}};var _0xbe375d={};var _0x244d95={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x52004e[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x15ac9b,null))['then'](function(_0x3c7726){if(_0x3c7726){_0xbe375d['model']=_['keys'](db[_0x51a8('0xd0')]['rawAttributes']);_0xbe375d[_0x51a8('0x4c')]=_[_0x51a8('0x4d')](_0x52004e['query']);_0xbe375d['filters']=_[_0x51a8('0x4e')](_0xbe375d['model'],_0xbe375d[_0x51a8('0x4c')]);_0xeba541[_0x51a8('0x4f')]=_['intersection'](_0xbe375d[_0x51a8('0x4b')],qs['fields'](_0x52004e[_0x51a8('0x4c')][_0x51a8('0x50')]));_0xeba541['attributes']=_0xeba541[_0x51a8('0x4f')][_0x51a8('0x51')]?_0xeba541[_0x51a8('0x4f')]:_0xbe375d[_0x51a8('0x4b')];if(!_0x52004e[_0x51a8('0x4c')]['hasOwnProperty']('nolimit')){_0xeba541[_0x51a8('0x31')]=qs[_0x51a8('0x31')](_0x52004e['query'][_0x51a8('0x31')]);_0xeba541['offset']=qs[_0x51a8('0x30')](_0x52004e['query'][_0x51a8('0x30')]);}_0xeba541[_0x51a8('0x9a')]=qs['sort'](_0x52004e['query'][_0x51a8('0x53')]);_0xeba541['where']=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x52004e[_0x51a8('0x4c')],_0xbe375d['filters']));_0xeba541[_0x51a8('0x54')][_0x51a8('0xb9')]=_0x3c7726['id'];if(_0x52004e['query'][_0x51a8('0x8f')]){_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541[_0x51a8('0x54')],{'$or':_[_0x51a8('0x40')](_0xeba541[_0x51a8('0x4f')],function(_0x49a943){var _0xad8ab7={};_0xad8ab7[_0x49a943]={'$like':'%'+_0x52004e[_0x51a8('0x4c')]['filter']+'%'};return _0xad8ab7;})});}if(_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')]){var _0x234a4a=_0x52004e[_0x51a8('0x4c')][_0x51a8('0x88')][_0x51a8('0x44')](',');var _0x4b1154={};_0x4b1154[_0x234a4a[0x0]]={'$gte':moment(_0x234a4a[0x1])[_0x51a8('0xea')](_0x51a8('0x10c'))};_0xeba541[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0xeba541['where'],_0x4b1154);}_0xeba541=_[_0x51a8('0xa6')]({},_0xeba541,_0x52004e[_0x51a8('0xbe')]);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0xeba541[_0x51a8('0x54')]})[_0x51a8('0x20')](function(_0x45bd8b){_0x244d95[_0x51a8('0x33')]=_0x45bd8b;if(_0x52004e['query'][_0x51a8('0xbc')]){_0xeba541[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0xeba541);})['then'](function(_0x59e0ed){_0x244d95['rows']=_0x59e0ed;return _0x244d95;});}})['then'](respondWithFilteredResult(_0x15ac9b,_0xeba541))[_0x51a8('0x2b')](handleError(_0x15ac9b,null));};exports['getMyMessages']=function(_0x1f1b3b,_0x3b6e0b,_0x312c20){var _0x2f9fe0={'where':{}},_0x1568f3={},_0x45677c={'count':0x0,'rows':[]};return db[_0x51a8('0x48')][_0x51a8('0xc2')]({'where':{'id':_0x1f1b3b[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x3b6e0b,null))[_0x51a8('0x20')](function(_0x30dbd3){if(_0x30dbd3){_0x1568f3[_0x51a8('0x4b')]=_[_0x51a8('0x4d')](db[_0x51a8('0xd0')][_0x51a8('0x49')]);_0x1568f3[_0x51a8('0x4c')]=_['keys'](_0x1f1b3b['query']);_0x1568f3[_0x51a8('0x55')]=_['intersection'](_0x1568f3[_0x51a8('0x4b')],_0x1568f3[_0x51a8('0x4c')]);_0x2f9fe0['attributes']=_[_0x51a8('0x4e')](_0x1568f3[_0x51a8('0x4b')],qs[_0x51a8('0x50')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x50')]));_0x2f9fe0['attributes']=_0x2f9fe0[_0x51a8('0x4f')]['length']?_0x2f9fe0['attributes']:_0x1568f3[_0x51a8('0x4b')];if(!_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x52')](_0x51a8('0x10e'))){_0x2f9fe0[_0x51a8('0x31')]=qs['limit'](_0x1f1b3b['query'][_0x51a8('0x31')]);_0x2f9fe0[_0x51a8('0x30')]=qs[_0x51a8('0x30')](_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x30')]);}_0x2f9fe0[_0x51a8('0x9a')]=qs[_0x51a8('0x53')](_0x1f1b3b['query']['sort']);_0x2f9fe0[_0x51a8('0x54')]=qs[_0x51a8('0x55')](_[_0x51a8('0x56')](_0x1f1b3b[_0x51a8('0x4c')],_0x1568f3[_0x51a8('0x55')]));_0x2f9fe0[_0x51a8('0x54')]['ChatInteractionId']=_0x30dbd3['id'];if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]){_0x2f9fe0[_0x51a8('0x54')]=_[_0x51a8('0xa6')](_0x2f9fe0['where'],{'$or':_[_0x51a8('0x40')](_0x2f9fe0[_0x51a8('0x4f')],function(_0x45f627){var _0x2d5526={};_0x2d5526[_0x45f627]={'$like':'%'+_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0x8f')]+'%'};return _0x2d5526;})});}_0x2f9fe0[_0x51a8('0x54')]['secret']=![];if(_0x1f1b3b[_0x51a8('0x4c')]['id']){_0x2f9fe0[_0x51a8('0x54')]['id']={'$gt':_0x1f1b3b['query']['id']};}_0x2f9fe0=_[_0x51a8('0xa6')]({},_0x2f9fe0,_0x1f1b3b['options']);return db[_0x51a8('0xd0')][_0x51a8('0x33')]({'where':_0x2f9fe0['where']})[_0x51a8('0x20')](function(_0x3b31f4){_0x45677c[_0x51a8('0x33')]=_0x3b31f4;_0x2f9fe0[_0x51a8('0xbd')]=[];if(_0x1f1b3b['query'][_0x51a8('0x10f')]){_0x2f9fe0[_0x51a8('0xbd')][_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':'User','attributes':['id','fullname',_0x51a8('0xf6')]});}if(_0x1f1b3b[_0x51a8('0x4c')][_0x51a8('0xbc')]){_0x2f9fe0[_0x51a8('0xbd')]=[{'all':!![]}];}return db[_0x51a8('0xd0')][_0x51a8('0x10d')](_0x2f9fe0);})[_0x51a8('0x20')](function(_0x14c1b8){_0x45677c[_0x51a8('0x110')]=_0x14c1b8;return _0x45677c;});}})[_0x51a8('0x20')](respondWithFilteredResult(_0x3b6e0b,_0x2f9fe0))[_0x51a8('0x2b')](handleError(_0x3b6e0b,null));};exports['addTags']=function(_0x675401,_0x35a751,_0x36aac9){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x675401[_0x51a8('0xbb')]['id']}})[_0x51a8('0x20')](handleEntityNotFound(_0x35a751,null))['then'](function(_0x4624f7){if(_0x4624f7){return _0x4624f7[_0x51a8('0x111')](_0x675401['body']['ids'],_['omit'](_0x675401[_0x51a8('0x3b')],[_0x51a8('0x109'),'id'])||{})[_0x51a8('0x112')](function(){return db['Tag'][_0x51a8('0x10d')]({'attributes':['id',_0x51a8('0x3a'),_0x51a8('0x59')],'where':{'id':_0x675401[_0x51a8('0x3b')][_0x51a8('0x109')]}});})['then'](function(_0xa5bcfc){socket[_0x51a8('0x113')](_0x51a8('0x114'),{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]});return{'id':Number(_0x675401[_0x51a8('0xbb')]['id']),'tags':_0xa5bcfc||[]};});}})[_0x51a8('0x20')](respondWithResult(_0x35a751,null))[_0x51a8('0x2b')](handleError(_0x35a751,null));};exports[_0x51a8('0x115')]=function(_0x37b8e4,_0x32038c,_0x19002e){return db[_0x51a8('0x48')][_0x51a8('0x75')]({'where':{'id':_0x37b8e4['params']['id']}})['then'](handleEntityNotFound(_0x32038c,null))[_0x51a8('0x20')](function(_0x38729f){if(_0x38729f){return _0x38729f[_0x51a8('0x115')](_0x37b8e4[_0x51a8('0x4c')][_0x51a8('0x109')]);}})[_0x51a8('0x20')](respondWithStatusCode(_0x32038c,null))[_0x51a8('0x2b')](handleError(_0x32038c,null));};exports['download']=function(_0x9c6443,_0x4ec339){var _0x117d9d=moment()[_0x51a8('0x116')]()[_0x51a8('0xa4')]();var _0x5a82d7=path[_0x51a8('0xe2')](config[_0x51a8('0xe3')],_0x51a8('0x117'),'files',_0x51a8('0x118'));var _0x282ded=path['join'](config[_0x51a8('0xe3')],'server',_0x51a8('0x119'),_0x51a8('0x11a'));var _0x3e05bd=path['join'](_0x5a82d7,_0x117d9d);var _0x589252=util[_0x51a8('0xea')](_0x51a8('0x11b'),_0x9c6443['params']['id'],_0x117d9d);var _0x5370db=path[_0x51a8('0xe2')](_0x5a82d7,_0x589252);var _0x42c534=[];_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x7c'),'attributes':['id',_0x51a8('0x41')],'raw':!![]});_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xed')],'as':_0x51a8('0x72'),'attributes':['id',_0x51a8('0x11c'),_0x51a8('0x11d')],'raw':!![]});if(_0x9c6443[_0x51a8('0x4c')]['attachments']){_0x42c534[_0x51a8('0x46')]({'model':db[_0x51a8('0xe0')],'as':_0x51a8('0xe0'),'raw':!![]});}var _0x556783=[{'model':db[_0x51a8('0xd0')],'as':_0x51a8('0xec'),'attributes':['id','body',_0x51a8('0x86'),_0x51a8('0xf9'),'secret',_0x51a8('0x11e')],'include':_0x42c534}];_0x556783['push']({'model':db[_0x51a8('0xc1')],'as':_0x51a8('0x11f'),'attributes':['id',_0x51a8('0x3a')]});_0x556783[_0x51a8('0x46')]({'model':db[_0x51a8('0x7c')],'as':_0x51a8('0x120'),'attributes':['id','fullname']});return db[_0x51a8('0x48')]['find']({'where':{'id':_0x9c6443[_0x51a8('0xbb')]['id']},'include':_0x556783})[_0x51a8('0x20')](handleEntityNotFound(_0x4ec339,null))['then'](function(_0xf80e41){if(_0xf80e41){var _0x35aed9=_0xf80e41[_0x51a8('0x121')]({'plain':!![]});fs[_0x51a8('0x122')](_0x3e05bd);var _0xcdcbb2={'channel':'Chat','account':_0x35aed9[_0x51a8('0x11f')][_0x51a8('0x3a')],'agent':_0x35aed9[_0x51a8('0x120')]?_0x35aed9[_0x51a8('0x120')]['fullname']:_0x51a8('0x123'),'createdAt':moment(_0x35aed9[_0x51a8('0x86')])['format'](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'closedAt':_0x35aed9['closed']?moment(_0x35aed9['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x35aed9['disposition'],'chatInfo':{'browser':_0x35aed9[_0x51a8('0x124')],'os':_0x35aed9['osName'],'referer':_0x35aed9['referer'],'customerIp':_0x35aed9[_0x51a8('0x125')],'customerPort':_0x35aed9[_0x51a8('0x126')]?_0x35aed9[_0x51a8('0x126')]:_0x51a8('0x123')},'messages':_(_0x35aed9[_0x51a8('0xec')])['tail']()['filter']({'secret':![]})['map'](function(_0x24b953){if(_0x24b953[_0x51a8('0xe0')]){var _0x14df4f=path[_0x51a8('0xe2')](_0x282ded,_0x24b953['Attachment']['basename']);if(fs[_0x51a8('0x127')](_0x14df4f)){fs[_0x51a8('0x128')](_0x14df4f)[_0x51a8('0x129')](fs[_0x51a8('0x12a')](path['join'](_0x3e05bd,_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')])));}}return{'date':moment(_0x24b953[_0x51a8('0x86')])[_0x51a8('0xea')](_0x51a8('0x10c'))[_0x51a8('0xa4')](),'sender':_0x24b953[_0x51a8('0xf9')]===_0x51a8('0xcf')?_0x24b953[_0x51a8('0x7c')]?_0x24b953[_0x51a8('0x7c')][_0x51a8('0x41')]:_0x51a8('0xf0'):_0x24b953['Contact'][_0x51a8('0x11c')]+(_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]?'\x20'+_0x24b953[_0x51a8('0x72')][_0x51a8('0x11d')]:''),'body':_0x24b953['Attachment']?_0x24b953[_0x51a8('0xe0')][_0x51a8('0xdb')]:_0x24b953[_0x51a8('0x3b')],'direction':_0x24b953[_0x51a8('0xf9')]==='out'?'A':'C','secret':_0x24b953[_0x51a8('0xfa')],'read':_0x24b953['read'],'attachment':_0x24b953[_0x51a8('0xe0')]};})[_0x51a8('0x6f')]()};return ejs[_0x51a8('0x12b')](path[_0x51a8('0xe2')](config['root'],_0x51a8('0x117'),_0x51a8('0x12c'),_0x51a8('0x12d')),{'interaction':_0xcdcbb2})[_0x51a8('0x20')](function(_0x3f039c){var _0x3a0c33=path['join'](_0x3e05bd,'transcript-'+_0x35aed9['id']+'-'+_0x117d9d+_0x51a8('0x12e'));var _0x3e1da1={'path':_0x3a0c33,'channel':_0x51a8('0x12f'),'interactionId':_0x35aed9['id']};return pdf[_0x51a8('0x130')](_0x3f039c,_0x3e1da1);})[_0x51a8('0x20')](function(){return new BPromise(function(_0x1e55c1,_0x443db8){zipdir(_0x3e05bd,{'saveTo':_0x5370db},function(_0x192d63,_0x2263e3){if(_0x192d63)return _0x443db8(_0x192d63);return _0x1e55c1(_0x2263e3);});})[_0x51a8('0x20')](function(){return new BPromise(function(_0x32d363,_0x3030ff){rimraf(_0x3e05bd,function(_0x357e44){if(_0x357e44)_0x3030ff(_0x357e44);return _0x32d363();});});})[_0x51a8('0x20')](function(){return _0x4ec339[_0x51a8('0xe6')](_0x5370db,_0x589252,function(_0x44b406){if(_0x44b406){console[_0x51a8('0x131')](_0x51a8('0x132'),_0x44b406);}else{fs[_0x51a8('0x133')](_0x5370db);}});});});}else{return _0x4ec339[_0x51a8('0x2c')](0xc8);}})[_0x51a8('0x2b')](handleError(_0x4ec339,null));};
\ No newline at end of file
+var _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`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?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x13859e,_0x31a451){var _0x5ffcc3=function(_0x1e87c7){while(--_0x1e87c7){_0x13859e['push'](_0x13859e['shift']());}};_0x5ffcc3(++_0x31a451);}(_0xef0f,0x168));var _0xfef0=function(_0x143f1c,_0x3ed377){_0x143f1c=_0x143f1c-0x0;var _0x197eaf=_0xef0f[_0x143f1c];return _0x197eaf;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('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',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2fd95d8..439e19a 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 _0xb5c4=['exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x250d7e,_0x6a7fa3){var _0x1eddbf=function(_0x64d43d){while(--_0x64d43d){_0x250d7e['push'](_0x250d7e['shift']());}};_0x1eddbf(++_0x6a7fa3);}(_0xb5c4,0x91));var _0x4b5c=function(_0x2e26e1,_0x2728de){_0x2e26e1=_0x2e26e1-0x0;var _0x5241f5=_0xb5c4[_0x2e26e1];return _0x5241f5;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x4b5c('0x0'))['db'][_0x4b5c('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x4b5c('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4b5c('0x3')](0x0);var events={'afterCreate':_0x4b5c('0x4'),'afterUpdate':_0x4b5c('0x5'),'afterDestroy':_0x4b5c('0x6')};function emitEvent(_0x558afa){return function(_0xbc88c6,_0x81b81d,_0x205915){_0xbc88c6['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4c06b0){_0xbc88c6[_0x4b5c('0x7')](_0x4b5c('0x8'),_0x4c06b0[_0x4b5c('0x9')](function(_0x3b2c54){return{'id':_0x3b2c54['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xbc88c6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1e50ed){_0xbc88c6[_0x4b5c('0x7')](_0x4b5c('0xa'),_0x1e50ed[_0x4b5c('0xb')]);ChatInteractionEvents['emit'](_0x558afa+':'+_0xbc88c6['id'],_0xbc88c6);ChatInteractionEvents[_0x4b5c('0xc')](_0x558afa,_0xbc88c6);_0x205915(null);})[_0x4b5c('0xd')](_0x205915(null));};}for(var e in events){if(events[_0x4b5c('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x4b5c('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb6c5=['map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0xb6c5,0x1b0));var _0x5b6c=function(_0x16d08a,_0x111329){_0x16d08a=_0x16d08a-0x0;var _0x22c62e=_0xb6c5[_0x16d08a];return _0x22c62e;};'use strict';var EventEmitter=require(_0x5b6c('0x0'));var ChatInteraction=require(_0x5b6c('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5b6c('0x2')](0x0);var events={'afterCreate':_0x5b6c('0x3'),'afterUpdate':_0x5b6c('0x4'),'afterDestroy':_0x5b6c('0x5')};function emitEvent(_0x189eef){return function(_0x2cec12,_0x57cfa7,_0x5359fe){_0x2cec12[_0x5b6c('0x6')]({'attributes':['id'],'raw':!![]})[_0x5b6c('0x7')](function(_0x3dff8a){_0x2cec12[_0x5b6c('0x8')](_0x5b6c('0x9'),_0x3dff8a[_0x5b6c('0xa')](function(_0x5f2377){return{'id':_0x5f2377['id']};}));return ChatMessage[_0x5b6c('0xb')]({'where':{'ChatInteractionId':_0x2cec12['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b6c('0x7')](function(_0xd004d6){_0x2cec12[_0x5b6c('0x8')](_0x5b6c('0xc'),_0xd004d6[_0x5b6c('0xd')]);ChatInteractionEvents['emit'](_0x189eef+':'+_0x2cec12['id'],_0x2cec12);ChatInteractionEvents[_0x5b6c('0xe')](_0x189eef,_0x2cec12);_0x5359fe(null);})['catch'](_0x5359fe(null));};}for(var e in events){if(events[_0x5b6c('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5b6c('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 80e3cfe..b75c134 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 _0x669f=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closedAt'];(function(_0x306e52,_0x8e2386){var _0x475baf=function(_0x5a2d75){while(--_0x5a2d75){_0x306e52['push'](_0x306e52['shift']());}};_0x475baf(++_0x8e2386);}(_0x669f,0x1bd));var _0xf669=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x669f[_0x4a7843];return _0x2c57fe;};'use strict';var _=require(_0xf669('0x0'));var util=require('util');var logger=require(_0xf669('0x1'))('api');var moment=require(_0xf669('0x2'));var BPromise=require('bluebird');var rp=require(_0xf669('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf669('0x4'));var attributes=require(_0xf669('0x5'));module[_0xf669('0x6')]=function(_0x2bfb12,_0x4b5c31){return _0x2bfb12['define'](_0xf669('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eacfc,_0x297bc6,_0x1f8d84){if(_0x5eacfc[_0xf669('0x8')]('closed')){_0x5eacfc[_0xf669('0x9')]=moment()[_0xf669('0xa')](_0xf669('0xb'));}_0x1f8d84(null,_0x5eacfc);}},'charset':'utf8mb4','collate':_0xf669('0xc')});};
\ No newline at end of file
+var _0xbede=['ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','./chatInteraction.attributes','exports','define'];(function(_0x82fe47,_0x268fca){var _0x57c245=function(_0x1c7bf2){while(--_0x1c7bf2){_0x82fe47['push'](_0x82fe47['shift']());}};_0x57c245(++_0x268fca);}(_0xbede,0xd7));var _0xebed=function(_0x4ef3d9,_0x235ddc){_0x4ef3d9=_0x4ef3d9-0x0;var _0x342f8d=_0xbede[_0x4ef3d9];return _0x342f8d;};'use strict';var _=require('lodash');var util=require(_0xebed('0x0'));var logger=require(_0xebed('0x1'))(_0xebed('0x2'));var moment=require(_0xebed('0x3'));var BPromise=require('bluebird');var rp=require(_0xebed('0x4'));var fs=require('fs');var path=require(_0xebed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebed('0x6'));module[_0xebed('0x7')]=function(_0x32fcc,_0x483f79){return _0x32fcc[_0xebed('0x8')](_0xebed('0x9'),attributes,{'tableName':_0xebed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b06d2,_0x52ccf5,_0x2fe995){if(_0x2b06d2['changed'](_0xebed('0xb'))){_0x2b06d2[_0xebed('0xc')]=moment()[_0xebed('0xd')](_0xebed('0xe'));}_0x2fe995(null,_0x2b06d2);}},'charset':'utf8mb4','collate':_0xebed('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 8654337..50479a1 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 _0xce69=['message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce69,0xc9));var _0x9ce6=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xce69[_0x51bda1];return _0x1ce08c;};'use strict';var _=require(_0x9ce6('0x0'));var util=require(_0x9ce6('0x1'));var moment=require(_0x9ce6('0x2'));var BPromise=require(_0x9ce6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ce6('0x4'));var db=require(_0x9ce6('0x5'))['db'];var utils=require(_0x9ce6('0x6'));var logger=require(_0x9ce6('0x7'))(_0x9ce6('0x8'));var config=require('../../config/environment');var jayson=require(_0x9ce6('0x9'));var client=jayson[_0x9ce6('0xa')][_0x9ce6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x9ce6('0xc'),'port':0x18eb});var socket=require(_0x9ce6('0xd'))(new Redis(config[_0x9ce6('0xe')]));require(_0x9ce6('0xf'))[_0x9ce6('0x10')](socket);function respondWithRpcPromise(_0x5b97b5,_0x185312,_0x309047){return new BPromise(function(_0xbcb047,_0x580005){return client['request'](_0x5b97b5,_0x309047)['then'](function(_0x49e128){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x185312,'request\x20sent');logger[_0x9ce6('0x11')](_0x9ce6('0x12'),_0x185312,_0x9ce6('0x13'),JSON[_0x9ce6('0x14')](_0x49e128));if(_0x49e128[_0x9ce6('0x15')]){if(_0x49e128[_0x9ce6('0x15')][_0x9ce6('0x16')]===0x1f4){logger[_0x9ce6('0x15')](_0x9ce6('0x17'),_0x185312,_0x49e128[_0x9ce6('0x15')]['message']);return _0x580005(_0x49e128[_0x9ce6('0x15')]['message']);}logger['error'](_0x9ce6('0x17'),_0x185312,_0x49e128['error'][_0x9ce6('0x18')]);return _0xbcb047(_0x49e128[_0x9ce6('0x15')]['message']);}else{logger[_0x9ce6('0x19')](_0x9ce6('0x17'),_0x185312,_0x9ce6('0x13'));_0xbcb047(_0x49e128[_0x9ce6('0x1a')]['message']);}})[_0x9ce6('0x1b')](function(_0x4ccdff){logger['error'](_0x9ce6('0x17'),_0x185312,_0x4ccdff);_0x580005(_0x4ccdff);});});}exports[_0x9ce6('0x1c')]=function(_0x14c39d){var _0x39987a=this;return new Promise(function(_0x2f54dc,_0x6da352){return db[_0x9ce6('0x1d')][_0x9ce6('0x1e')](_0x14c39d[_0x9ce6('0x1f')],{'raw':_0x14c39d[_0x9ce6('0x20')]?_0x14c39d[_0x9ce6('0x20')][_0x9ce6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14c39d['options']?_0x14c39d[_0x9ce6('0x20')][_0x9ce6('0x22')]||null:null,'attributes':_0x14c39d['options']?_0x14c39d[_0x9ce6('0x20')][_0x9ce6('0x23')]||null:null,'limit':_0x14c39d[_0x9ce6('0x20')]?_0x14c39d[_0x9ce6('0x20')][_0x9ce6('0x24')]||null:null})['then'](function(_0x42614f){logger[_0x9ce6('0x19')](_0x9ce6('0x1c'),_0x14c39d);logger[_0x9ce6('0x11')](_0x9ce6('0x1c'),_0x14c39d,JSON[_0x9ce6('0x14')](_0x42614f));_0x2f54dc(_0x42614f);})[_0x9ce6('0x1b')](function(_0xf10615){logger[_0x9ce6('0x15')](_0x9ce6('0x1c'),_0xf10615[_0x9ce6('0x18')],_0x14c39d);_0x6da352(_0x39987a[_0x9ce6('0x15')](0x1f4,_0xf10615['message']));});});};exports[_0x9ce6('0x25')]=function(_0x7aa9ba){return new Promise(function(_0x3891fc,_0x3879e7){return db[_0x9ce6('0x1d')][_0x9ce6('0x26')]({'where':_0x7aa9ba[_0x9ce6('0x20')]?_0x7aa9ba[_0x9ce6('0x20')][_0x9ce6('0x22')]||null:null})[_0x9ce6('0x27')](function(_0x293bff){if(_0x293bff){return _0x293bff[_0x9ce6('0x28')](_0x7aa9ba[_0x9ce6('0x1f')][_0x9ce6('0x29')],_[_0x9ce6('0x2a')](_0x7aa9ba['body'],[_0x9ce6('0x29'),'id'])||{});}})[_0x9ce6('0x2b')](function(_0x1325aa){logger[_0x9ce6('0x19')](_0x9ce6('0x2c'),_0x7aa9ba);logger[_0x9ce6('0x11')](_0x9ce6('0x2c'),_0x7aa9ba,JSON[_0x9ce6('0x14')](_0x1325aa));_0x3891fc(_0x1325aa);})[_0x9ce6('0x1b')](function(_0x572cb0){logger[_0x9ce6('0x15')]('AddTags',_0x572cb0['message'],_0x7aa9ba);_0x3879e7(_this[_0x9ce6('0x15')](0x1f4,_0x572cb0[_0x9ce6('0x18')]));});});};
\ No newline at end of file
+var _0xee3e=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','find','where','addTags','ids','omit','spread'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xee3e,0x82));var _0xeee3=function(_0x522998,_0x161875){_0x522998=_0x522998-0x0;var _0x126ad9=_0xee3e[_0x522998];return _0x126ad9;};'use strict';var _=require(_0xeee3('0x0'));var util=require(_0xeee3('0x1'));var moment=require(_0xeee3('0x2'));var BPromise=require(_0xeee3('0x3'));var rs=require(_0xeee3('0x4'));var fs=require('fs');var Redis=require(_0xeee3('0x5'));var db=require(_0xeee3('0x6'))['db'];var utils=require(_0xeee3('0x7'));var logger=require(_0xeee3('0x8'))('rpc');var config=require(_0xeee3('0x9'));var jayson=require(_0xeee3('0xa'));var client=jayson[_0xeee3('0xb')][_0xeee3('0xc')]({'port':0x232a});config[_0xeee3('0xd')]=_[_0xeee3('0xe')](config[_0xeee3('0xd')],{'host':_0xeee3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeee3('0xd')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4f16f5,_0x2a9fe2,_0x582b6a){return new BPromise(function(_0x203dbf,_0x45cda1){return client['request'](_0x4f16f5,_0x582b6a)[_0xeee3('0x10')](function(_0x5d07c3){logger[_0xeee3('0x11')](_0xeee3('0x12'),_0x2a9fe2,_0xeee3('0x13'));logger[_0xeee3('0x14')](_0xeee3('0x15'),_0x2a9fe2,_0xeee3('0x13'),JSON[_0xeee3('0x16')](_0x5d07c3));if(_0x5d07c3['error']){if(_0x5d07c3[_0xeee3('0x17')][_0xeee3('0x18')]===0x1f4){logger[_0xeee3('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2a9fe2,_0x5d07c3['error'][_0xeee3('0x19')]);return _0x45cda1(_0x5d07c3['error'][_0xeee3('0x19')]);}logger['error'](_0xeee3('0x12'),_0x2a9fe2,_0x5d07c3[_0xeee3('0x17')]['message']);return _0x203dbf(_0x5d07c3[_0xeee3('0x17')][_0xeee3('0x19')]);}else{logger['info'](_0xeee3('0x12'),_0x2a9fe2,_0xeee3('0x13'));_0x203dbf(_0x5d07c3[_0xeee3('0x1a')]['message']);}})[_0xeee3('0x1b')](function(_0x1c4d4a){logger[_0xeee3('0x17')](_0xeee3('0x12'),_0x2a9fe2,_0x1c4d4a);_0x45cda1(_0x1c4d4a);});});}exports[_0xeee3('0x1c')]=function(_0x18d86a){var _0x1b665e=this;return new Promise(function(_0x1191a7,_0x2c3069){return db[_0xeee3('0x1d')][_0xeee3('0x1e')](_0x18d86a[_0xeee3('0x1f')],{'raw':_0x18d86a[_0xeee3('0x20')]?_0x18d86a[_0xeee3('0x20')][_0xeee3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18d86a['options']?_0x18d86a['options']['where']||null:null,'attributes':_0x18d86a[_0xeee3('0x20')]?_0x18d86a[_0xeee3('0x20')][_0xeee3('0x22')]||null:null,'limit':_0x18d86a['options']?_0x18d86a[_0xeee3('0x20')][_0xeee3('0x23')]||null:null})['then'](function(_0x5ebe3a){logger['info'](_0xeee3('0x1c'),_0x18d86a);logger[_0xeee3('0x14')](_0xeee3('0x1c'),_0x18d86a,JSON[_0xeee3('0x16')](_0x5ebe3a));_0x1191a7(_0x5ebe3a);})[_0xeee3('0x1b')](function(_0x3ad97c){logger[_0xeee3('0x17')](_0xeee3('0x1c'),_0x3ad97c[_0xeee3('0x19')],_0x18d86a);_0x2c3069(_0x1b665e[_0xeee3('0x17')](0x1f4,_0x3ad97c[_0xeee3('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x49f40a){return new Promise(function(_0xe4db30,_0x51294c){return db[_0xeee3('0x1d')][_0xeee3('0x24')]({'where':_0x49f40a['options']?_0x49f40a[_0xeee3('0x20')][_0xeee3('0x25')]||null:null})['then'](function(_0x22aebb){if(_0x22aebb){return _0x22aebb[_0xeee3('0x26')](_0x49f40a[_0xeee3('0x1f')][_0xeee3('0x27')],_[_0xeee3('0x28')](_0x49f40a[_0xeee3('0x1f')],[_0xeee3('0x27'),'id'])||{});}})[_0xeee3('0x29')](function(_0xd82bb2){logger[_0xeee3('0x11')]('AddTags',_0x49f40a);logger[_0xeee3('0x14')](_0xeee3('0x2a'),_0x49f40a,JSON[_0xeee3('0x16')](_0xd82bb2));_0xe4db30(_0xd82bb2);})[_0xeee3('0x1b')](function(_0x3b8e96){logger[_0xeee3('0x17')](_0xeee3('0x2a'),_0x3b8e96['message'],_0x49f40a);_0x51294c(_this[_0xeee3('0x17')](0x1f4,_0x3b8e96[_0xeee3('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b9c9f31..0adcb82 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 _0xd382=['./chatInteraction.events','save','remove','update','emit','chatInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x1b6));var _0x2d38=function(_0x2f8c51,_0x4b6250){_0x2f8c51=_0x2f8c51-0x0;var _0x24f408=_0xd382[_0x2f8c51];return _0x24f408;};'use strict';var ChatInteractionEvents=require(_0x2d38('0x0'));var events=[_0x2d38('0x1'),_0x2d38('0x2'),_0x2d38('0x3')];function createListener(_0x260d8e,_0xe32566){return function(_0x9ab754){_0xe32566[_0x2d38('0x4')](_0x260d8e,_0x9ab754);};}function removeListener(_0xf6bceb,_0x312012){return function(){ChatInteractionEvents['removeListener'](_0xf6bceb,_0x312012);};}exports['register']=function(_0x5a8219){for(var _0x30106c=0x0,_0x1e2919=events['length'];_0x30106c<_0x1e2919;_0x30106c++){var _0x1296cb=events[_0x30106c];var _0x3fb88f=createListener(_0x2d38('0x5')+_0x1296cb,_0x5a8219);ChatInteractionEvents['on'](_0x1296cb,_0x3fb88f);}};
\ No newline at end of file
+var _0x1f36=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x21d6ff,_0xb9d12e){var _0x67f3c2=function(_0x153335){while(--_0x153335){_0x21d6ff['push'](_0x21d6ff['shift']());}};_0x67f3c2(++_0xb9d12e);}(_0x1f36,0x1ed));var _0x61f3=function(_0x5476e6,_0x27955e){_0x5476e6=_0x5476e6-0x0;var _0x4cddb3=_0x1f36[_0x5476e6];return _0x4cddb3;};'use strict';var ChatInteractionEvents=require(_0x61f3('0x0'));var events=[_0x61f3('0x1'),_0x61f3('0x2'),_0x61f3('0x3')];function createListener(_0x530c15,_0x43cb61){return function(_0x5f4742){_0x43cb61[_0x61f3('0x4')](_0x530c15,_0x5f4742);};}function removeListener(_0x596aab,_0x17d9bf){return function(){ChatInteractionEvents[_0x61f3('0x5')](_0x596aab,_0x17d9bf);};}exports[_0x61f3('0x6')]=function(_0x12c372){for(var _0x72af3d=0x0,_0x52a5eb=events[_0x61f3('0x7')];_0x72af3d<_0x52a5eb;_0x72af3d++){var _0x2f1f60=events[_0x72af3d];var _0x2bfda3=createListener(_0x61f3('0x8')+_0x2f1f60,_0x12c372);ChatInteractionEvents['on'](_0x2f1f60,_0x2bfda3);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 736d47d..7d07a07 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 _0xdcda=['post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','now','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','isAuthenticated','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','download'];(function(_0x2dfd5d,_0x237cf6){var _0x5a32ba=function(_0x450727){while(--_0x450727){_0x2dfd5d['push'](_0x2dfd5d['shift']());}};_0x5a32ba(++_0x237cf6);}(_0xdcda,0x117));var _0xadcd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xdcda[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xadcd('0x0'));var util=require('util');var path=require(_0xadcd('0x1'));var timeout=require(_0xadcd('0x2'));var express=require(_0xadcd('0x3'));var router=express[_0xadcd('0x4')]();var fs_extra=require(_0xadcd('0x5'));var auth=require(_0xadcd('0x6'));var interaction=require(_0xadcd('0x7'));var config=require(_0xadcd('0x8'));var controller=require(_0xadcd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xadcd('0xa')]);router[_0xadcd('0xb')](_0xadcd('0xc'),auth[_0xadcd('0xd')](),controller[_0xadcd('0xe')]);router['get']('/:id',auth[_0xadcd('0xf')](),controller['show']);router[_0xadcd('0xb')]('/:id/attachment_download',auth[_0xadcd('0xf')](),controller[_0xadcd('0x10')]);router[_0xadcd('0xb')](_0xadcd('0x11'),auth[_0xadcd('0xd')](),controller[_0xadcd('0x12')]);router['get']('/:id/my_messages',auth[_0xadcd('0xf')](),controller[_0xadcd('0x13')]);router['get']('/:id/download',auth[_0xadcd('0xd')](),controller[_0xadcd('0x14')]);router[_0xadcd('0x15')]('/',auth['isAuthenticated'](),controller[_0xadcd('0x16')]);router[_0xadcd('0x15')](_0xadcd('0x17'),auth['isAuthenticated'](),controller[_0xadcd('0x18')]);var upload=multer({'storage':multer[_0xadcd('0x19')]({'destination':function(_0x45de2f,_0xb1fadb,_0x2378a2){_0x2378a2(null,path[_0xadcd('0x1a')](config[_0xadcd('0x1b')],_0xadcd('0x1c')));},'filename':function(_0x37b21f,_0x1ac955,_0x598cb6){_0x598cb6(null,util['format']('%s-%s',Date[_0xadcd('0x1d')](),_0x1ac955['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xadcd('0x15')](_0xadcd('0x1e'),upload[_0xadcd('0x1f')](_0xadcd('0x20')),controller['attachmentUpload']);router[_0xadcd('0x15')]('/:id/messages',auth[_0xadcd('0xf')](),controller[_0xadcd('0x21')]);router['post'](_0xadcd('0x22'),auth[_0xadcd('0xd')](),interaction[_0xadcd('0x23')](_0xadcd('0x24'),_0xadcd('0x25')),controller[_0xadcd('0x26')]);router[_0xadcd('0x27')]('/:id',auth[_0xadcd('0xd')](),interaction['tracked'](_0xadcd('0x24'),_0xadcd('0x28')),controller[_0xadcd('0x29')]);router[_0xadcd('0x27')](_0xadcd('0x2a'),controller[_0xadcd('0x2b')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xadcd('0x2c')]);router[_0xadcd('0x27')](_0xadcd('0x2d'),controller[_0xadcd('0x2e')]);router[_0xadcd('0x2f')]('/:id',auth[_0xadcd('0xd')](),interaction[_0xadcd('0x23')](_0xadcd('0x24'),_0xadcd('0x30')),controller['destroy']);router[_0xadcd('0x2f')](_0xadcd('0x22'),auth['isAuthenticated'](),controller[_0xadcd('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xa886=['single','file','/:id/messages','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload'];(function(_0x47af3f,_0x3dc5c3){var _0x534745=function(_0x175bcc){while(--_0x175bcc){_0x47af3f['push'](_0x47af3f['shift']());}};_0x534745(++_0x3dc5c3);}(_0xa886,0x143));var _0x6a88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa886[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6a88('0x0'));var util=require(_0x6a88('0x1'));var path=require('path');var timeout=require(_0x6a88('0x2'));var express=require(_0x6a88('0x3'));var router=express[_0x6a88('0x4')]();var fs_extra=require(_0x6a88('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a88('0x6'));var config=require(_0x6a88('0x7'));var controller=require(_0x6a88('0x8'));router[_0x6a88('0x9')]('/',auth[_0x6a88('0xa')](),controller[_0x6a88('0xb')]);router[_0x6a88('0x9')](_0x6a88('0xc'),auth[_0x6a88('0xa')](),controller[_0x6a88('0xd')]);router[_0x6a88('0x9')](_0x6a88('0xe'),auth[_0x6a88('0xf')](),controller[_0x6a88('0x10')]);router[_0x6a88('0x9')](_0x6a88('0x11'),auth[_0x6a88('0xf')](),controller[_0x6a88('0x12')]);router[_0x6a88('0x9')]('/:id/messages',auth[_0x6a88('0xa')](),controller[_0x6a88('0x13')]);router[_0x6a88('0x9')](_0x6a88('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x6a88('0x15')]);router['get'](_0x6a88('0x16'),auth[_0x6a88('0xa')](),controller[_0x6a88('0x17')]);router[_0x6a88('0x18')]('/',auth[_0x6a88('0xa')](),controller['create']);router[_0x6a88('0x18')](_0x6a88('0x19'),auth[_0x6a88('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48e210,_0x36f61f,_0x36b764){_0x36b764(null,path[_0x6a88('0x1a')](config[_0x6a88('0x1b')],'server/files/attachments/'));},'filename':function(_0xb0d75b,_0x5f3b6e,_0x2637c6){_0x2637c6(null,util[_0x6a88('0x1c')](_0x6a88('0x1d'),Date[_0x6a88('0x1e')](),_0x5f3b6e[_0x6a88('0x1f')][_0x6a88('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6a88('0x18')](_0x6a88('0x21'),upload[_0x6a88('0x22')](_0x6a88('0x23')),controller['attachmentUpload']);router[_0x6a88('0x18')](_0x6a88('0x24'),auth[_0x6a88('0xf')](),controller['addMessage']);router['post'](_0x6a88('0x25'),auth[_0x6a88('0xa')](),interaction[_0x6a88('0x26')](_0x6a88('0x27'),'chatinteraction:addtags'),controller[_0x6a88('0x28')]);router[_0x6a88('0x29')](_0x6a88('0xe'),auth[_0x6a88('0xa')](),interaction[_0x6a88('0x26')](_0x6a88('0x27'),_0x6a88('0x2a')),controller[_0x6a88('0x2b')]);router[_0x6a88('0x29')]('/:id/custom_update',controller['customUpdate']);router['put'](_0x6a88('0x2c'),auth[_0x6a88('0xf')](),controller['abandon']);router['put'](_0x6a88('0x2d'),controller[_0x6a88('0x2e')]);router[_0x6a88('0x2f')](_0x6a88('0xe'),auth[_0x6a88('0xa')](),interaction['tracked'](_0x6a88('0x27'),_0x6a88('0x30')),controller[_0x6a88('0x31')]);router['delete'](_0x6a88('0x25'),auth['isAuthenticated'](),controller[_0x6a88('0x32')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7534695..2ee3d7a 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 _0xec2c=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x2d171f,_0x4a2594){var _0x69362e=function(_0x3b12cd){while(--_0x3b12cd){_0x2d171f['push'](_0x2d171f['shift']());}};_0x69362e(++_0x4a2594);}(_0xec2c,0xd0));var _0xcec2=function(_0xa7662e,_0x22304d){_0xa7662e=_0xa7662e-0x0;var _0x425053=_0xec2c[_0xa7662e];return _0x425053;};'use strict';var Sequelize=require('sequelize');module[_0xcec2('0x0')]={'body':{'type':Sequelize[_0xcec2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcec2('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcec2('0x3')]}};
\ No newline at end of file
+var _0x88fc=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x4a3861,_0x10988f){var _0x57aef2=function(_0x545b87){while(--_0x545b87){_0x4a3861['push'](_0x4a3861['shift']());}};_0x57aef2(++_0x10988f);}(_0x88fc,0x1dd));var _0xc88f=function(_0x4d5b70,_0x325f2b){_0x4d5b70=_0x4d5b70-0x0;var _0x3a6c5b=_0x88fc[_0x4d5b70];return _0x3a6c5b;};'use strict';var Sequelize=require(_0xc88f('0x0'));module[_0xc88f('0x1')]={'body':{'type':Sequelize[_0xc88f('0x2')](_0xc88f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc88f('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 347c654..1b96708 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 _0x24db=['mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','get','messages','lastMessageAt','lastMessage','format','User','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','isEmpty','agent','resourceId','push','FromId','ToId','all','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x24db,0x19f));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb24d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb24d('0x1'));var rp=require(_0xb24d('0x2'));var moment=require(_0xb24d('0x3'));var BPromise=require(_0xb24d('0x4'));var Mustache=require(_0xb24d('0x5'));var util=require(_0xb24d('0x6'));var path=require('path');var sox=require(_0xb24d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb24d('0x8'));var _=require(_0xb24d('0x9'));var squel=require('squel');var crypto=require(_0xb24d('0xa'));var jsforce=require(_0xb24d('0xb'));var deskjs=require(_0xb24d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb24d('0xd'));var Papa=require(_0xb24d('0xe'));var Redis=require(_0xb24d('0xf'));var authService=require(_0xb24d('0x10'));var qs=require(_0xb24d('0x11'));var as=require(_0xb24d('0x12'));var hardwareService=require(_0xb24d('0x13'));var logger=require('../../config/logger')(_0xb24d('0x14'));var utils=require(_0xb24d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb24d('0x16'));var db=require(_0xb24d('0x17'))['db'];config['redis']=_[_0xb24d('0x18')](config['redis'],{'host':_0xb24d('0x19'),'port':0x18eb});var socket=require(_0xb24d('0x1a'))(new Redis(config['redis']));require(_0xb24d('0x1b'))[_0xb24d('0x1c')](socket);function respondWithStatusCode(_0x4df7ee,_0x7487e2){_0x7487e2=_0x7487e2||0xcc;return function(_0x17b8aa){if(_0x17b8aa){return _0x4df7ee[_0xb24d('0x1d')](_0x7487e2);}return _0x4df7ee['status'](_0x7487e2)[_0xb24d('0x1e')]();};}function respondWithResult(_0xae1055,_0x2b39cc){_0x2b39cc=_0x2b39cc||0xc8;return function(_0x32b043){if(_0x32b043){return _0xae1055[_0xb24d('0x1f')](_0x2b39cc)[_0xb24d('0x20')](_0x32b043);}};}function respondWithFilteredResult(_0x45cc50,_0x42f851){return function(_0xda9868){if(_0xda9868){var _0x358c7b=typeof _0x42f851['offset']===_0xb24d('0x21')&&typeof _0x42f851[_0xb24d('0x22')]===_0xb24d('0x21');var _0x21366f=_0xda9868[_0xb24d('0x23')];var _0x8553b6=_0x358c7b?0x0:_0x42f851[_0xb24d('0x24')];var _0x413cb6=_0x358c7b?_0xda9868['count']:_0x42f851[_0xb24d('0x24')]+_0x42f851[_0xb24d('0x22')];var _0x218313;if(_0x413cb6>=_0x21366f){_0x413cb6=_0x21366f;_0x218313=0xc8;}else{_0x218313=0xce;}_0x45cc50['status'](_0x218313);return _0x45cc50['set'](_0xb24d('0x25'),_0x8553b6+'-'+_0x413cb6+'/'+_0x21366f)[_0xb24d('0x20')](_0xda9868);}return null;};}function patchUpdates(_0x3ac132){return function(_0x5d60de){try{jsonpatch[_0xb24d('0x26')](_0x5d60de,_0x3ac132,!![]);}catch(_0x23bfdb){return BPromise['reject'](_0x23bfdb);}return _0x5d60de[_0xb24d('0x27')]();};}function saveUpdates(_0x56d68a,_0xe7cf86){return function(_0x14b36f){if(_0x14b36f){return _0x14b36f[_0xb24d('0x28')](_0x56d68a)['then'](function(_0x1f9100){return _0x1f9100;});}return null;};}function removeEntity(_0x1eaf54,_0x173bfc){return function(_0x5f1047){if(_0x5f1047){return _0x5f1047['destroy']()[_0xb24d('0x29')](function(){_0x1eaf54['status'](0xcc)[_0xb24d('0x1e')]();});}};}function handleEntityNotFound(_0x16b353,_0x42bd51){return function(_0x1d7c0c){if(!_0x1d7c0c){_0x16b353[_0xb24d('0x1d')](0x194);}return _0x1d7c0c;};}function handleError(_0x3973b9,_0x935d1){_0x935d1=_0x935d1||0x1f4;return function(_0x1710aa){logger[_0xb24d('0x2a')](_0x1710aa[_0xb24d('0x2b')]);if(_0x1710aa['name']){delete _0x1710aa[_0xb24d('0x2c')];}_0x3973b9['status'](_0x935d1)[_0xb24d('0x2d')](_0x1710aa);};}exports['index']=function(_0x3499c0,_0x2c0514){var _0x27c79c={},_0x34fe2b={},_0x47f7b3={'count':0x0,'rows':[]};var _0x1877bf=_[_0xb24d('0x2e')](db[_0xb24d('0x2f')][_0xb24d('0x30')],function(_0x2a3543){return{'name':_0x2a3543[_0xb24d('0x31')],'type':_0x2a3543[_0xb24d('0x32')][_0xb24d('0x33')]};});_0x34fe2b[_0xb24d('0x34')]=_[_0xb24d('0x2e')](_0x1877bf,_0xb24d('0x2c'));_0x34fe2b[_0xb24d('0x35')]=_['keys'](_0x3499c0['query']);_0x34fe2b[_0xb24d('0x36')]=_[_0xb24d('0x37')](_0x34fe2b['model'],_0x34fe2b[_0xb24d('0x35')]);_0x27c79c[_0xb24d('0x38')]=_['intersection'](_0x34fe2b['model'],qs[_0xb24d('0x39')](_0x3499c0[_0xb24d('0x35')][_0xb24d('0x39')]));_0x27c79c[_0xb24d('0x38')]=_0x27c79c['attributes'][_0xb24d('0x3a')]?_0x27c79c[_0xb24d('0x38')]:_0x34fe2b[_0xb24d('0x34')];if(!_0x3499c0[_0xb24d('0x35')][_0xb24d('0x3b')](_0xb24d('0x3c'))){_0x27c79c[_0xb24d('0x22')]=qs[_0xb24d('0x22')](_0x3499c0[_0xb24d('0x35')][_0xb24d('0x22')]);_0x27c79c[_0xb24d('0x24')]=qs[_0xb24d('0x24')](_0x3499c0[_0xb24d('0x35')]['offset']);}_0x27c79c[_0xb24d('0x3d')]=qs['sort'](_0x3499c0[_0xb24d('0x35')][_0xb24d('0x3e')]);_0x27c79c['where']=qs[_0xb24d('0x36')](_['pick'](_0x3499c0[_0xb24d('0x35')],_0x34fe2b['filters']),_0x1877bf);if(_0x3499c0[_0xb24d('0x35')]['filter']){_0x27c79c[_0xb24d('0x3f')]=_[_0xb24d('0x40')](_0x27c79c['where'],{'$or':_[_0xb24d('0x2e')](_0x1877bf,function(_0x4ab500){if(_0x4ab500['type']!==_0xb24d('0x41')){var _0x1ccb17={};_0x1ccb17[_0x4ab500['name']]={'$like':'%'+_0x3499c0['query'][_0xb24d('0x42')]+'%'};return _0x1ccb17;}})});}_0x27c79c=_[_0xb24d('0x40')]({},_0x27c79c,_0x3499c0[_0xb24d('0x43')]);var _0x13a7f1={'where':_0x27c79c['where']};return db['ChatInternalMessage'][_0xb24d('0x23')](_0x13a7f1)[_0xb24d('0x29')](function(_0x4fab5b){_0x47f7b3['count']=_0x4fab5b;if(_0x3499c0[_0xb24d('0x35')][_0xb24d('0x44')]){_0x27c79c[_0xb24d('0x45')]=[{'all':!![]}];}return db[_0xb24d('0x2f')][_0xb24d('0x46')](_0x27c79c);})[_0xb24d('0x29')](function(_0x54c9e8){_0x47f7b3[_0xb24d('0x47')]=_0x54c9e8;return _0x47f7b3;})[_0xb24d('0x29')](respondWithFilteredResult(_0x2c0514,_0x27c79c))[_0xb24d('0x48')](handleError(_0x2c0514,null));};exports['show']=function(_0x5afdab,_0x2a60b2){var _0x206342={'raw':!![],'where':{'id':_0x5afdab['params']['id']}},_0xf59682={};_0xf59682[_0xb24d('0x34')]=_[_0xb24d('0x49')](db[_0xb24d('0x2f')][_0xb24d('0x30')]);_0xf59682['query']=_[_0xb24d('0x49')](_0x5afdab[_0xb24d('0x35')]);_0xf59682[_0xb24d('0x36')]=_[_0xb24d('0x37')](_0xf59682[_0xb24d('0x34')],_0xf59682[_0xb24d('0x35')]);_0x206342[_0xb24d('0x38')]=_[_0xb24d('0x37')](_0xf59682[_0xb24d('0x34')],qs['fields'](_0x5afdab['query'][_0xb24d('0x39')]));_0x206342[_0xb24d('0x38')]=_0x206342['attributes'][_0xb24d('0x3a')]?_0x206342[_0xb24d('0x38')]:_0xf59682[_0xb24d('0x34')];if(_0x5afdab[_0xb24d('0x35')][_0xb24d('0x44')]){_0x206342[_0xb24d('0x45')]=[{'all':!![]}];}_0x206342=_[_0xb24d('0x40')]({},_0x206342,_0x5afdab['options']);return db[_0xb24d('0x2f')][_0xb24d('0x4a')](_0x206342)[_0xb24d('0x29')](handleEntityNotFound(_0x2a60b2,null))[_0xb24d('0x29')](respondWithResult(_0x2a60b2,null))[_0xb24d('0x48')](handleError(_0x2a60b2,null));};exports['create']=function(_0x5c2bbb,_0xdae242){return db[_0xb24d('0x2f')]['create'](_0x5c2bbb['body'],{})[_0xb24d('0x29')](respondWithResult(_0xdae242,0xc9))['catch'](handleError(_0xdae242,null));};exports[_0xb24d('0x28')]=function(_0x364c65,_0x178300){if(_0x364c65[_0xb24d('0x4b')]['id']){delete _0x364c65[_0xb24d('0x4b')]['id'];}return db[_0xb24d('0x2f')][_0xb24d('0x4a')]({'where':{'id':_0x364c65[_0xb24d('0x4c')]['id']}})[_0xb24d('0x29')](handleEntityNotFound(_0x178300,null))['then'](saveUpdates(_0x364c65[_0xb24d('0x4b')],null))['then'](respondWithResult(_0x178300,null))[_0xb24d('0x48')](handleError(_0x178300,null));};exports[_0xb24d('0x4d')]=function(_0x578a9d,_0x31e887){return db[_0xb24d('0x2f')][_0xb24d('0x4a')]({'where':{'id':_0x578a9d['params']['id']}})['then'](handleEntityNotFound(_0x31e887,null))['then'](removeEntity(_0x31e887,null))[_0xb24d('0x48')](handleError(_0x31e887,null));};exports[_0xb24d('0x4e')]=function(_0x151808,_0x7aae9c){return db[_0xb24d('0x2f')]['describe']()[_0xb24d('0x29')](respondWithResult(_0x7aae9c,null))['catch'](handleError(_0x7aae9c,null));};function wrapUser(_0x45d907){return function(_0x582219){var _0x1514e8=_0x45d907[_0xb24d('0x4f')]({'plain':!![]});_0x1514e8[_0xb24d('0x50')]=[];if(_0x582219){_0x1514e8[_0xb24d('0x51')]=_0x582219['createdAt'];_0x1514e8[_0xb24d('0x52')]=_0x582219;}else{_0x1514e8[_0xb24d('0x51')]=moment(0x0)[_0xb24d('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x1514e8[_0xb24d('0x52')]={};}return _0x1514e8;};}exports['getUsers']=function(_0x17dea3,_0x41e618,_0x5b07a7){var _0xa8365a=[];return db[_0xb24d('0x54')][_0xb24d('0x46')]({'where':{'role':['agent',_0xb24d('0x55'),_0xb24d('0x56')]},'attributes':['id',_0xb24d('0x57'),_0xb24d('0x2c'),_0xb24d('0x58'),_0xb24d('0x59'),'internal','online',_0xb24d('0x5a'),_0xb24d('0x5b'),_0xb24d('0x5c')],'order':qs[_0xb24d('0x3e')]('-online'),'include':[{'model':db[_0xb24d('0x5d')],'as':_0xb24d('0x5e'),'attributes':['id',_0xb24d('0x2c'),_0xb24d('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x1dc46a){if(_0x1dc46a){var _0x1b89c5=_0x17dea3[_0xb24d('0x56')]['get']({'plain':!![]});if(!_0x1b89c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b89c5[_0xb24d('0x58')]===_0xb24d('0x56')){return db[_0xb24d('0x5f')]['find']({'where':{'name':_0xb24d('0x60'),'userProfileId':_0x1b89c5['userProfileId']},'raw':!![]})['then'](function(_0x19c8c4){if(_0x19c8c4){if(_0x19c8c4[_0xb24d('0x61')]===0x0){return db['UserProfileResource'][_0xb24d('0x46')]({'where':{'sectionId':_0x19c8c4['id']},'raw':!![]})[_0xb24d('0x29')](function(_0x22ace7){var _0x5a7eaf=[];if(_[_0xb24d('0x62')](_0x22ace7)){_0x5a7eaf=_['filter'](_0x1dc46a,function(_0x344096){if(_0x344096[_0xb24d('0x58')]!==_0xb24d('0x63')){return _0x344096;}});return _0x5a7eaf;}else{for(var _0x335be4=0x0;_0x335be4<_0x1dc46a[_0xb24d('0x3a')];_0x335be4++){var _0x3d2483=_0x1dc46a[_0x335be4];if(_0x3d2483[_0xb24d('0x58')]===_0xb24d('0x63')){var _0x142f75=_[_0xb24d('0x4a')](_0x22ace7,function(_0x54d520){return _0x54d520[_0xb24d('0x64')]===_0x3d2483['id'];});if(_0x142f75)_0x5a7eaf[_0xb24d('0x65')](_0x3d2483);}else{_0x5a7eaf['push'](_0x3d2483);}}return _0x5a7eaf;}});}else{return _0x1dc46a;}}else{var _0x2b0c55=_[_0xb24d('0x42')](_0x1dc46a,function(_0xd5e032){if(_0xd5e032[_0xb24d('0x58')]!==_0xb24d('0x63')){return _0xd5e032;}});return _0x2b0c55;}});}else{return _0x1dc46a;}}})[_0xb24d('0x29')](function(_0x314fdf){var _0x29b0df=[];if(_0x314fdf){_0xa8365a=_0x314fdf;for(var _0x1bb7f0=0x0;_0x1bb7f0<_0x314fdf[_0xb24d('0x3a')];_0x1bb7f0+=0x1){_0xa8365a[_0x1bb7f0][_0xb24d('0x50')]=[];_0x29b0df[_0xb24d('0x65')](db[_0xb24d('0x2f')][_0xb24d('0x4a')]({'where':{'FromId':[_0x17dea3[_0xb24d('0x56')]['id'],_0x314fdf[_0x1bb7f0]['id']],'ToId':[_0x17dea3['user']['id'],_0x314fdf[_0x1bb7f0]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xb24d('0x66'),_0xb24d('0x67'),'read',_0xb24d('0x4b')],'order':qs[_0xb24d('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb24d('0x29')](wrapUser(_0x314fdf[_0x1bb7f0])));}return BPromise[_0xb24d('0x68')](_0x29b0df);}return[];})[_0xb24d('0x29')](function(_0x2eb9f5){return{'rows':_0x2eb9f5,'count':_0x2eb9f5[_0xb24d('0x3a')]};})[_0xb24d('0x29')](respondWithResult(_0x41e618,null))[_0xb24d('0x48')](handleError(_0x41e618,null));};
\ No newline at end of file
+var _0x06bc=['../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','intersection','find','create','body','describe','messages','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','role','UserProfileSection','userProfileId','autoAssociation','isEmpty','push','createdAt','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3f1114,_0x413c67){var _0x2382a9=function(_0x42a0e4){while(--_0x42a0e4){_0x3f1114['push'](_0x3f1114['shift']());}};_0x2382a9(++_0x413c67);}(_0x06bc,0x195));var _0xc06b=function(_0x5df515,_0x18d824){_0x5df515=_0x5df515-0x0;var _0x8fc686=_0x06bc[_0x5df515];return _0x8fc686;};'use strict';var emlformat=require(_0xc06b('0x0'));var rimraf=require(_0xc06b('0x1'));var zipdir=require(_0xc06b('0x2'));var jsonpatch=require(_0xc06b('0x3'));var rp=require(_0xc06b('0x4'));var moment=require(_0xc06b('0x5'));var BPromise=require(_0xc06b('0x6'));var Mustache=require('mustache');var util=require(_0xc06b('0x7'));var path=require(_0xc06b('0x8'));var sox=require('sox');var csv=require(_0xc06b('0x9'));var ejs=require(_0xc06b('0xa'));var fs=require('fs');var fs_extra=require(_0xc06b('0xb'));var _=require(_0xc06b('0xc'));var squel=require(_0xc06b('0xd'));var crypto=require(_0xc06b('0xe'));var jsforce=require(_0xc06b('0xf'));var deskjs=require(_0xc06b('0x10'));var toCsv=require(_0xc06b('0x9'));var querystring=require(_0xc06b('0x11'));var Papa=require(_0xc06b('0x12'));var Redis=require(_0xc06b('0x13'));var authService=require(_0xc06b('0x14'));var qs=require(_0xc06b('0x15'));var as=require(_0xc06b('0x16'));var hardwareService=require(_0xc06b('0x17'));var logger=require(_0xc06b('0x18'))(_0xc06b('0x19'));var utils=require('../../config/utils');var config=require(_0xc06b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc06b('0x1b'))['db'];config[_0xc06b('0x1c')]=_[_0xc06b('0x1d')](config[_0xc06b('0x1c')],{'host':_0xc06b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc06b('0x1c')]));require(_0xc06b('0x1f'))[_0xc06b('0x20')](socket);function respondWithStatusCode(_0xcd1abb,_0x5221f2){_0x5221f2=_0x5221f2||0xcc;return function(_0x268054){if(_0x268054){return _0xcd1abb[_0xc06b('0x21')](_0x5221f2);}return _0xcd1abb['status'](_0x5221f2)['end']();};}function respondWithResult(_0x460071,_0xed7e58){_0xed7e58=_0xed7e58||0xc8;return function(_0x594560){if(_0x594560){return _0x460071[_0xc06b('0x22')](_0xed7e58)[_0xc06b('0x23')](_0x594560);}};}function respondWithFilteredResult(_0x22eff8,_0x5d1f44){return function(_0x2a1c20){if(_0x2a1c20){var _0x1503e8=typeof _0x5d1f44[_0xc06b('0x24')]===_0xc06b('0x25')&&typeof _0x5d1f44[_0xc06b('0x26')]===_0xc06b('0x25');var _0x296513=_0x2a1c20[_0xc06b('0x27')];var _0xd0b37e=_0x1503e8?0x0:_0x5d1f44[_0xc06b('0x24')];var _0x5f2460=_0x1503e8?_0x2a1c20['count']:_0x5d1f44[_0xc06b('0x24')]+_0x5d1f44['limit'];var _0x4fbc53;if(_0x5f2460>=_0x296513){_0x5f2460=_0x296513;_0x4fbc53=0xc8;}else{_0x4fbc53=0xce;}_0x22eff8['status'](_0x4fbc53);return _0x22eff8[_0xc06b('0x28')](_0xc06b('0x29'),_0xd0b37e+'-'+_0x5f2460+'/'+_0x296513)[_0xc06b('0x23')](_0x2a1c20);}return null;};}function patchUpdates(_0x2a41b6){return function(_0x24e056){try{jsonpatch['apply'](_0x24e056,_0x2a41b6,!![]);}catch(_0x2cae0a){return BPromise[_0xc06b('0x2a')](_0x2cae0a);}return _0x24e056[_0xc06b('0x2b')]();};}function saveUpdates(_0x165a4b,_0x211566){return function(_0x3c4469){if(_0x3c4469){return _0x3c4469[_0xc06b('0x2c')](_0x165a4b)[_0xc06b('0x2d')](function(_0x1edd10){return _0x1edd10;});}return null;};}function removeEntity(_0x3cb76e,_0x2f89d6){return function(_0x231bc5){if(_0x231bc5){return _0x231bc5[_0xc06b('0x2e')]()[_0xc06b('0x2d')](function(){_0x3cb76e[_0xc06b('0x22')](0xcc)[_0xc06b('0x2f')]();});}};}function handleEntityNotFound(_0x55a3bc,_0x24db28){return function(_0x18fd7f){if(!_0x18fd7f){_0x55a3bc[_0xc06b('0x21')](0x194);}return _0x18fd7f;};}function handleError(_0x2a58eb,_0x17a40c){_0x17a40c=_0x17a40c||0x1f4;return function(_0x45744b){logger['error'](_0x45744b[_0xc06b('0x30')]);if(_0x45744b[_0xc06b('0x31')]){delete _0x45744b[_0xc06b('0x31')];}_0x2a58eb[_0xc06b('0x22')](_0x17a40c)[_0xc06b('0x32')](_0x45744b);};}exports['index']=function(_0x40676c,_0x2531e1){var _0x3109ec={},_0x1bf54a={},_0x110456={'count':0x0,'rows':[]};var _0x406dcf=_[_0xc06b('0x33')](db[_0xc06b('0x34')]['rawAttributes'],function(_0x2d1976){return{'name':_0x2d1976[_0xc06b('0x35')],'type':_0x2d1976[_0xc06b('0x36')][_0xc06b('0x37')]};});_0x1bf54a[_0xc06b('0x38')]=_[_0xc06b('0x33')](_0x406dcf,_0xc06b('0x31'));_0x1bf54a[_0xc06b('0x39')]=_[_0xc06b('0x3a')](_0x40676c[_0xc06b('0x39')]);_0x1bf54a[_0xc06b('0x3b')]=_['intersection'](_0x1bf54a[_0xc06b('0x38')],_0x1bf54a['query']);_0x3109ec[_0xc06b('0x3c')]=_['intersection'](_0x1bf54a['model'],qs['fields'](_0x40676c[_0xc06b('0x39')][_0xc06b('0x3d')]));_0x3109ec['attributes']=_0x3109ec['attributes'][_0xc06b('0x3e')]?_0x3109ec['attributes']:_0x1bf54a[_0xc06b('0x38')];if(!_0x40676c[_0xc06b('0x39')][_0xc06b('0x3f')](_0xc06b('0x40'))){_0x3109ec[_0xc06b('0x26')]=qs[_0xc06b('0x26')](_0x40676c['query']['limit']);_0x3109ec['offset']=qs[_0xc06b('0x24')](_0x40676c[_0xc06b('0x39')]['offset']);}_0x3109ec[_0xc06b('0x41')]=qs[_0xc06b('0x42')](_0x40676c['query'][_0xc06b('0x42')]);_0x3109ec['where']=qs['filters'](_[_0xc06b('0x43')](_0x40676c[_0xc06b('0x39')],_0x1bf54a[_0xc06b('0x3b')]),_0x406dcf);if(_0x40676c['query'][_0xc06b('0x44')]){_0x3109ec[_0xc06b('0x45')]=_[_0xc06b('0x46')](_0x3109ec[_0xc06b('0x45')],{'$or':_['map'](_0x406dcf,function(_0x6ef7a0){if(_0x6ef7a0[_0xc06b('0x36')]!=='VIRTUAL'){var _0x46c4b2={};_0x46c4b2[_0x6ef7a0[_0xc06b('0x31')]]={'$like':'%'+_0x40676c[_0xc06b('0x39')][_0xc06b('0x44')]+'%'};return _0x46c4b2;}})});}_0x3109ec=_['merge']({},_0x3109ec,_0x40676c[_0xc06b('0x47')]);var _0xe3f2e4={'where':_0x3109ec['where']};return db[_0xc06b('0x34')][_0xc06b('0x27')](_0xe3f2e4)[_0xc06b('0x2d')](function(_0x9fd427){_0x110456[_0xc06b('0x27')]=_0x9fd427;if(_0x40676c['query'][_0xc06b('0x48')]){_0x3109ec[_0xc06b('0x49')]=[{'all':!![]}];}return db[_0xc06b('0x34')][_0xc06b('0x4a')](_0x3109ec);})['then'](function(_0x5d0fd5){_0x110456[_0xc06b('0x4b')]=_0x5d0fd5;return _0x110456;})[_0xc06b('0x2d')](respondWithFilteredResult(_0x2531e1,_0x3109ec))[_0xc06b('0x4c')](handleError(_0x2531e1,null));};exports['show']=function(_0x5e6c80,_0x7ee733){var _0x1679e6={'raw':!![],'where':{'id':_0x5e6c80['params']['id']}},_0x7c22b4={};_0x7c22b4['model']=_[_0xc06b('0x3a')](db[_0xc06b('0x34')]['rawAttributes']);_0x7c22b4[_0xc06b('0x39')]=_['keys'](_0x5e6c80[_0xc06b('0x39')]);_0x7c22b4[_0xc06b('0x3b')]=_[_0xc06b('0x4d')](_0x7c22b4[_0xc06b('0x38')],_0x7c22b4[_0xc06b('0x39')]);_0x1679e6[_0xc06b('0x3c')]=_[_0xc06b('0x4d')](_0x7c22b4[_0xc06b('0x38')],qs[_0xc06b('0x3d')](_0x5e6c80[_0xc06b('0x39')][_0xc06b('0x3d')]));_0x1679e6[_0xc06b('0x3c')]=_0x1679e6[_0xc06b('0x3c')]['length']?_0x1679e6['attributes']:_0x7c22b4['model'];if(_0x5e6c80[_0xc06b('0x39')]['includeAll']){_0x1679e6['include']=[{'all':!![]}];}_0x1679e6=_['merge']({},_0x1679e6,_0x5e6c80[_0xc06b('0x47')]);return db['ChatInternalMessage'][_0xc06b('0x4e')](_0x1679e6)['then'](handleEntityNotFound(_0x7ee733,null))[_0xc06b('0x2d')](respondWithResult(_0x7ee733,null))[_0xc06b('0x4c')](handleError(_0x7ee733,null));};exports[_0xc06b('0x4f')]=function(_0x58588b,_0x5620a2){return db[_0xc06b('0x34')][_0xc06b('0x4f')](_0x58588b[_0xc06b('0x50')],{})['then'](respondWithResult(_0x5620a2,0xc9))[_0xc06b('0x4c')](handleError(_0x5620a2,null));};exports[_0xc06b('0x2c')]=function(_0xa659db,_0x214c68){if(_0xa659db[_0xc06b('0x50')]['id']){delete _0xa659db[_0xc06b('0x50')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0xa659db['params']['id']}})[_0xc06b('0x2d')](handleEntityNotFound(_0x214c68,null))['then'](saveUpdates(_0xa659db[_0xc06b('0x50')],null))['then'](respondWithResult(_0x214c68,null))[_0xc06b('0x4c')](handleError(_0x214c68,null));};exports[_0xc06b('0x2e')]=function(_0x6c5fa4,_0x1da48b){return db['ChatInternalMessage']['find']({'where':{'id':_0x6c5fa4['params']['id']}})[_0xc06b('0x2d')](handleEntityNotFound(_0x1da48b,null))['then'](removeEntity(_0x1da48b,null))[_0xc06b('0x4c')](handleError(_0x1da48b,null));};exports[_0xc06b('0x51')]=function(_0x467e6c,_0x1fd799){return db[_0xc06b('0x34')][_0xc06b('0x51')]()[_0xc06b('0x2d')](respondWithResult(_0x1fd799,null))[_0xc06b('0x4c')](handleError(_0x1fd799,null));};function wrapUser(_0x1fefa0){return function(_0x198f7a){var _0x4b429f=_0x1fefa0['get']({'plain':!![]});_0x4b429f[_0xc06b('0x52')]=[];if(_0x198f7a){_0x4b429f['lastMessageAt']=_0x198f7a['createdAt'];_0x4b429f[_0xc06b('0x53')]=_0x198f7a;}else{_0x4b429f[_0xc06b('0x54')]=moment(0x0)['format'](_0xc06b('0x55'));_0x4b429f[_0xc06b('0x53')]={};}return _0x4b429f;};}exports['getUsers']=function(_0x15b329,_0x154a74,_0x1e9b99){var _0x214de2=[];return db['User']['findAll']({'where':{'role':[_0xc06b('0x56'),_0xc06b('0x57'),_0xc06b('0x58')]},'attributes':['id','fullname',_0xc06b('0x31'),'role',_0xc06b('0x59'),'internal',_0xc06b('0x5a'),_0xc06b('0x5b'),_0xc06b('0x5c'),_0xc06b('0x5d')],'order':qs[_0xc06b('0x42')](_0xc06b('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0xc06b('0x5f'),'attributes':['id',_0xc06b('0x31'),_0xc06b('0x36')],'through':{'attributes':[]}}]})[_0xc06b('0x2d')](function(_0x489b9d){if(_0x489b9d){var _0x11dcee=_0x15b329[_0xc06b('0x58')][_0xc06b('0x60')]({'plain':!![]});if(!_0x11dcee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11dcee[_0xc06b('0x61')]==='user'){return db[_0xc06b('0x62')][_0xc06b('0x4e')]({'where':{'name':'Agents','userProfileId':_0x11dcee[_0xc06b('0x63')]},'raw':!![]})['then'](function(_0x4a4a03){if(_0x4a4a03){if(_0x4a4a03[_0xc06b('0x64')]===0x0){return db['UserProfileResource'][_0xc06b('0x4a')]({'where':{'sectionId':_0x4a4a03['id']},'raw':!![]})[_0xc06b('0x2d')](function(_0x55c66f){var _0x4d39f4=[];if(_[_0xc06b('0x65')](_0x55c66f)){_0x4d39f4=_[_0xc06b('0x44')](_0x489b9d,function(_0x5c540b){if(_0x5c540b[_0xc06b('0x61')]!==_0xc06b('0x56')){return _0x5c540b;}});return _0x4d39f4;}else{for(var _0x1450f1=0x0;_0x1450f1<_0x489b9d[_0xc06b('0x3e')];_0x1450f1++){var _0x2544c3=_0x489b9d[_0x1450f1];if(_0x2544c3[_0xc06b('0x61')]===_0xc06b('0x56')){var _0x3566ac=_[_0xc06b('0x4e')](_0x55c66f,function(_0x5a2e06){return _0x5a2e06['resourceId']===_0x2544c3['id'];});if(_0x3566ac)_0x4d39f4['push'](_0x2544c3);}else{_0x4d39f4[_0xc06b('0x66')](_0x2544c3);}}return _0x4d39f4;}});}else{return _0x489b9d;}}else{var _0x2ddec4=_[_0xc06b('0x44')](_0x489b9d,function(_0xb7bc9e){if(_0xb7bc9e[_0xc06b('0x61')]!==_0xc06b('0x56')){return _0xb7bc9e;}});return _0x2ddec4;}});}else{return _0x489b9d;}}})[_0xc06b('0x2d')](function(_0x2dd78e){var _0x22c34b=[];if(_0x2dd78e){_0x214de2=_0x2dd78e;for(var _0x307e0e=0x0;_0x307e0e<_0x2dd78e['length'];_0x307e0e+=0x1){_0x214de2[_0x307e0e][_0xc06b('0x52')]=[];_0x22c34b['push'](db[_0xc06b('0x34')][_0xc06b('0x4e')]({'where':{'FromId':[_0x15b329[_0xc06b('0x58')]['id'],_0x2dd78e[_0x307e0e]['id']],'ToId':[_0x15b329['user']['id'],_0x2dd78e[_0x307e0e]['id']],'ChatGroupId':null},'attributes':['id',_0xc06b('0x67'),_0xc06b('0x68'),_0xc06b('0x69'),'read',_0xc06b('0x50')],'order':qs[_0xc06b('0x42')](_0xc06b('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2dd78e[_0x307e0e])));}return BPromise[_0xc06b('0x6b')](_0x22c34b);}return[];})['then'](function(_0x17e157){return{'rows':_0x17e157,'count':_0x17e157[_0xc06b('0x3e')]};})[_0xc06b('0x2d')](respondWithResult(_0x154a74,null))[_0xc06b('0x4c')](handleError(_0x154a74,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2578cb0..f8d4aaa 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 _0xfb84=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x44d4a3,_0x5cce9a){var _0x3a6a93=function(_0x147099){while(--_0x147099){_0x44d4a3['push'](_0x44d4a3['shift']());}};_0x3a6a93(++_0x5cce9a);}(_0xfb84,0x187));var _0x4fb8=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0xfb84[_0x4812e0];return _0x252e0f;};'use strict';var EventEmitter=require(_0x4fb8('0x0'));var ChatInternalMessage=require(_0x4fb8('0x1'))['db'][_0x4fb8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4fb8('0x3')](0x0);var events={'afterCreate':_0x4fb8('0x4'),'afterUpdate':_0x4fb8('0x5'),'afterDestroy':_0x4fb8('0x6')};function emitEvent(_0x2d3088){return function(_0xf08d0,_0x4b1c48,_0x5ea271){ChatInternalMessageEvents[_0x4fb8('0x7')](_0x2d3088+':'+_0xf08d0['id'],_0xf08d0);ChatInternalMessageEvents[_0x4fb8('0x7')](_0x2d3088,_0xf08d0);_0x5ea271(null);};}for(var e in events){if(events[_0x4fb8('0x8')](e)){var event=events[e];ChatInternalMessage[_0x4fb8('0x9')](e,emitEvent(event));}}module[_0x4fb8('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3925=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5d6280,_0x3f72ab){var _0x77b738=function(_0x1b8208){while(--_0x1b8208){_0x5d6280['push'](_0x5d6280['shift']());}};_0x77b738(++_0x3f72ab);}(_0x3925,0x1ba));var _0x5392=function(_0x4766f2,_0x38b8a1){_0x4766f2=_0x4766f2-0x0;var _0xe746c2=_0x3925[_0x4766f2];return _0xe746c2;};'use strict';var EventEmitter=require(_0x5392('0x0'));var ChatInternalMessage=require(_0x5392('0x1'))['db'][_0x5392('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5392('0x3')](0x0);var events={'afterCreate':_0x5392('0x4'),'afterUpdate':_0x5392('0x5'),'afterDestroy':_0x5392('0x6')};function emitEvent(_0x4aa395){return function(_0x492d93,_0x18db04,_0x3b18da){ChatInternalMessageEvents[_0x5392('0x7')](_0x4aa395+':'+_0x492d93['id'],_0x492d93);ChatInternalMessageEvents[_0x5392('0x7')](_0x4aa395,_0x492d93);_0x3b18da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5392('0x8')](e,emitEvent(event));}}module[_0x5392('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cc1ebf1..74e1c5e 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 _0xe1aa=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x763209,_0x364008){var _0x4aa069=function(_0x270cf6){while(--_0x270cf6){_0x763209['push'](_0x763209['shift']());}};_0x4aa069(++_0x364008);}(_0xe1aa,0x156));var _0xae1a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe1aa[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xae1a('0x0'));var logger=require(_0xae1a('0x1'))(_0xae1a('0x2'));var moment=require(_0xae1a('0x3'));var BPromise=require(_0xae1a('0x4'));var rp=require(_0xae1a('0x5'));var fs=require('fs');var path=require(_0xae1a('0x6'));var rimraf=require(_0xae1a('0x7'));var config=require(_0xae1a('0x8'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x31cca3,_0x495f0b){return _0x31cca3[_0xae1a('0x9')](_0xae1a('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae1a('0xb'),'collate':_0xae1a('0xc')});};
\ No newline at end of file
+var _0x5c85=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3ef742,_0x67a6b8){var _0x394d2f=function(_0x491d49){while(--_0x491d49){_0x3ef742['push'](_0x3ef742['shift']());}};_0x394d2f(++_0x67a6b8);}(_0x5c85,0x190));var _0x55c8=function(_0x203105,_0xafa4cf){_0x203105=_0x203105-0x0;var _0x352943=_0x5c85[_0x203105];return _0x352943;};'use strict';var _=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var logger=require(_0x55c8('0x2'))('api');var moment=require(_0x55c8('0x3'));var BPromise=require(_0x55c8('0x4'));var rp=require(_0x55c8('0x5'));var fs=require('fs');var path=require(_0x55c8('0x6'));var rimraf=require(_0x55c8('0x7'));var config=require(_0x55c8('0x8'));var attributes=require(_0x55c8('0x9'));module[_0x55c8('0xa')]=function(_0x400b45,_0x43609f){return _0x400b45[_0x55c8('0xb')](_0x55c8('0xc'),attributes,{'tableName':_0x55c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x55c8('0xe'),'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 08f68b5..0fc3cfb 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 _0x5c54=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4b93fe,_0x1ce6e2){var _0x4af931=function(_0x11c943){while(--_0x11c943){_0x4b93fe['push'](_0x4b93fe['shift']());}};_0x4af931(++_0x1ce6e2);}(_0x5c54,0x71));var _0x45c5=function(_0x3f5ae7,_0x2a2ec0){_0x3f5ae7=_0x3f5ae7-0x0;var _0x1999e1=_0x5c54[_0x3f5ae7];return _0x1999e1;};'use strict';var _=require(_0x45c5('0x0'));var util=require(_0x45c5('0x1'));var moment=require(_0x45c5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45c5('0x3'));var db=require(_0x45c5('0x4'))['db'];var utils=require(_0x45c5('0x5'));var logger=require('../../config/logger')(_0x45c5('0x6'));var config=require(_0x45c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x45c5('0x8')][_0x45c5('0x9')]({'port':0x232a});config[_0x45c5('0xa')]=_['defaults'](config['redis'],{'host':_0x45c5('0xb'),'port':0x18eb});var socket=require(_0x45c5('0xc'))(new Redis(config[_0x45c5('0xa')]));require(_0x45c5('0xd'))[_0x45c5('0xe')](socket);function respondWithRpcPromise(_0x19d8ee,_0x8ff0e2,_0x27e8d0){return new BPromise(function(_0x107365,_0x44dd06){return client[_0x45c5('0xf')](_0x19d8ee,_0x27e8d0)[_0x45c5('0x10')](function(_0x16c6ce){logger[_0x45c5('0x11')](_0x45c5('0x12'),_0x8ff0e2,'request\x20sent');logger[_0x45c5('0x13')](_0x45c5('0x14'),_0x8ff0e2,_0x45c5('0x15'),JSON[_0x45c5('0x16')](_0x16c6ce));if(_0x16c6ce[_0x45c5('0x17')]){if(_0x16c6ce[_0x45c5('0x17')][_0x45c5('0x18')]===0x1f4){logger[_0x45c5('0x17')](_0x45c5('0x12'),_0x8ff0e2,_0x16c6ce[_0x45c5('0x17')][_0x45c5('0x19')]);return _0x44dd06(_0x16c6ce[_0x45c5('0x17')][_0x45c5('0x19')]);}logger[_0x45c5('0x17')](_0x45c5('0x12'),_0x8ff0e2,_0x16c6ce['error']['message']);return _0x107365(_0x16c6ce['error'][_0x45c5('0x19')]);}else{logger['info'](_0x45c5('0x12'),_0x8ff0e2,_0x45c5('0x15'));_0x107365(_0x16c6ce[_0x45c5('0x1a')][_0x45c5('0x19')]);}})[_0x45c5('0x1b')](function(_0x3903f0){logger[_0x45c5('0x17')](_0x45c5('0x12'),_0x8ff0e2,_0x3903f0);_0x44dd06(_0x3903f0);});});}
\ No newline at end of file
+var _0xe7b3=['message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','register','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2033e3,_0x54ece6){var _0x221db8=function(_0x2da44f){while(--_0x2da44f){_0x2033e3['push'](_0x2033e3['shift']());}};_0x221db8(++_0x54ece6);}(_0xe7b3,0x1b6));var _0x3e7b=function(_0x33c389,_0x33cf9f){_0x33c389=_0x33c389-0x0;var _0x2b67c2=_0xe7b3[_0x33c389];return _0x2b67c2;};'use strict';var _=require(_0x3e7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e7b('0x1'));var rs=require(_0x3e7b('0x2'));var fs=require('fs');var Redis=require(_0x3e7b('0x3'));var db=require(_0x3e7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3e7b('0x6'));var client=jayson[_0x3e7b('0x7')][_0x3e7b('0x8')]({'port':0x232a});config[_0x3e7b('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x3e7b('0xa')](socket);function respondWithRpcPromise(_0x46e6fa,_0x188950,_0x155231){return new BPromise(function(_0x5a83a6,_0x14ffcf){return client[_0x3e7b('0xb')](_0x46e6fa,_0x155231)['then'](function(_0x40b4a4){logger[_0x3e7b('0xc')](_0x3e7b('0xd'),_0x188950,'request\x20sent');logger[_0x3e7b('0xe')](_0x3e7b('0xf'),_0x188950,_0x3e7b('0x10'),JSON['stringify'](_0x40b4a4));if(_0x40b4a4['error']){if(_0x40b4a4[_0x3e7b('0x11')]['code']===0x1f4){logger[_0x3e7b('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x188950,_0x40b4a4[_0x3e7b('0x11')][_0x3e7b('0x12')]);return _0x14ffcf(_0x40b4a4['error']['message']);}logger[_0x3e7b('0x11')](_0x3e7b('0xd'),_0x188950,_0x40b4a4['error'][_0x3e7b('0x12')]);return _0x5a83a6(_0x40b4a4[_0x3e7b('0x11')][_0x3e7b('0x12')]);}else{logger[_0x3e7b('0xc')]('ChatInternalMessage,\x20%s,\x20%s',_0x188950,_0x3e7b('0x10'));_0x5a83a6(_0x40b4a4['result'][_0x3e7b('0x12')]);}})['catch'](function(_0x35c1d3){logger['error'](_0x3e7b('0xd'),_0x188950,_0x35c1d3);_0x14ffcf(_0x35c1d3);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 16d7e27..0b575a5 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 _0xf732=['chatInternalMessage:','save','remove','update','removeListener','register','length'];(function(_0x35f211,_0x15174f){var _0x3aab26=function(_0x2088e7){while(--_0x2088e7){_0x35f211['push'](_0x35f211['shift']());}};_0x3aab26(++_0x15174f);}(_0xf732,0x197));var _0x2f73=function(_0x56b6d5,_0x388f95){_0x56b6d5=_0x56b6d5-0x0;var _0x2fb790=_0xf732[_0x56b6d5];return _0x2fb790;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x2f73('0x0'),_0x2f73('0x1'),_0x2f73('0x2')];function createListener(_0x1990a5,_0x4172da){return function(_0x41ea16){_0x4172da['emit'](_0x1990a5,_0x41ea16);};}function removeListener(_0x867eeb,_0x12910f){return function(){ChatInternalMessageEvents[_0x2f73('0x3')](_0x867eeb,_0x12910f);};}exports[_0x2f73('0x4')]=function(_0x202f04){for(var _0x48b675=0x0,_0xb4bfb3=events[_0x2f73('0x5')];_0x48b675<_0xb4bfb3;_0x48b675++){var _0x188fec=events[_0x48b675];var _0x32ab1b=createListener(_0x2f73('0x6')+_0x188fec,_0x202f04);ChatInternalMessageEvents['on'](_0x188fec,_0x32ab1b);}};
\ No newline at end of file
+var _0xe464=['remove','update','emit','length','./chatInternalMessage.events'];(function(_0xb3a459,_0x1b4c7c){var _0x1cfa1d=function(_0x4815d1){while(--_0x4815d1){_0xb3a459['push'](_0xb3a459['shift']());}};_0x1cfa1d(++_0x1b4c7c);}(_0xe464,0x1ad));var _0x4e46=function(_0x12b728,_0x489bf1){_0x12b728=_0x12b728-0x0;var _0xd5549=_0xe464[_0x12b728];return _0xd5549;};'use strict';var ChatInternalMessageEvents=require(_0x4e46('0x0'));var events=['save',_0x4e46('0x1'),_0x4e46('0x2')];function createListener(_0x464f52,_0x5a3578){return function(_0x3ae9f4){_0x5a3578[_0x4e46('0x3')](_0x464f52,_0x3ae9f4);};}function removeListener(_0x901407,_0x1d024b){return function(){ChatInternalMessageEvents['removeListener'](_0x901407,_0x1d024b);};}exports['register']=function(_0x3ece6c){for(var _0x289e97=0x0,_0x43d95f=events[_0x4e46('0x4')];_0x289e97<_0x43d95f;_0x289e97++){var _0x5c4c79=events[_0x289e97];var _0x36120b=createListener('chatInternalMessage:'+_0x5c4c79,_0x3ece6c);ChatInternalMessageEvents['on'](_0x5c4c79,_0x36120b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index a5bebef..61b0be3 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 _0x9fe6=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','destroy','exports'];(function(_0x6d3012,_0x18c6c8){var _0x298f1d=function(_0x1049e0){while(--_0x1049e0){_0x6d3012['push'](_0x6d3012['shift']());}};_0x298f1d(++_0x18c6c8);}(_0x9fe6,0xb4));var _0x69fe=function(_0x3bbd82,_0x35188e){_0x3bbd82=_0x3bbd82-0x0;var _0x1641f1=_0x9fe6[_0x3bbd82];return _0x1641f1;};'use strict';var multer=require(_0x69fe('0x0'));var util=require(_0x69fe('0x1'));var path=require(_0x69fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x69fe('0x3'));var router=express[_0x69fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x69fe('0x5'));var interaction=require(_0x69fe('0x6'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x69fe('0x7')]('/',auth['isAuthenticated'](),controller[_0x69fe('0x8')]);router['get'](_0x69fe('0x9'),auth[_0x69fe('0xa')](),controller[_0x69fe('0xb')]);router[_0x69fe('0x7')](_0x69fe('0xc'),auth[_0x69fe('0xa')](),controller[_0x69fe('0xd')]);router['get'](_0x69fe('0xe'),auth['isAuthenticated'](),controller[_0x69fe('0xf')]);router[_0x69fe('0x10')]('/',auth[_0x69fe('0xa')](),controller[_0x69fe('0x11')]);router['put'](_0x69fe('0xe'),controller['update']);router['delete']('/:id',auth[_0x69fe('0xa')](),controller[_0x69fe('0x12')]);module[_0x69fe('0x13')]=router;
\ No newline at end of file
+var _0x0f1e=['update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','/users','show','post','create','put'];(function(_0x4a80b1,_0x45a10e){var _0x530cc7=function(_0x1c7df8){while(--_0x1c7df8){_0x4a80b1['push'](_0x4a80b1['shift']());}};_0x530cc7(++_0x45a10e);}(_0x0f1e,0x1a7));var _0xe0f1=function(_0x37f3c1,_0x2d46a7){_0x37f3c1=_0x37f3c1-0x0;var _0x261398=_0x0f1e[_0x37f3c1];return _0x261398;};'use strict';var multer=require(_0xe0f1('0x0'));var util=require('util');var path=require(_0xe0f1('0x1'));var timeout=require(_0xe0f1('0x2'));var express=require(_0xe0f1('0x3'));var router=express[_0xe0f1('0x4')]();var fs_extra=require(_0xe0f1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe0f1('0x6'));var config=require('../../config/environment');var controller=require(_0xe0f1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe0f1('0x8')]);router[_0xe0f1('0x9')](_0xe0f1('0xa'),auth[_0xe0f1('0xb')](),controller['describe']);router[_0xe0f1('0x9')](_0xe0f1('0xc'),auth[_0xe0f1('0xb')](),controller['getUsers']);router[_0xe0f1('0x9')]('/:id',auth[_0xe0f1('0xb')](),controller[_0xe0f1('0xd')]);router[_0xe0f1('0xe')]('/',auth[_0xe0f1('0xb')](),controller[_0xe0f1('0xf')]);router[_0xe0f1('0x10')]('/:id',controller[_0xe0f1('0x11')]);router[_0xe0f1('0x12')](_0xe0f1('0x13'),auth[_0xe0f1('0xb')](),controller[_0xe0f1('0x14')]);module[_0xe0f1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 3aae07e..488694a 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 _0xa5fa=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x2ed919,_0x48314b){_0x2ed919=_0x2ed919-0x0;var _0x574174=_0xa5fa[_0x2ed919];return _0x574174;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'body':{'type':Sequelize[_0xaa5f('0x1')](_0xaa5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa5f('0x4')]('in',_0xaa5f('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xaa5f('0x6')]},'providerName':{'type':Sequelize[_0xaa5f('0x7')]},'providerResponse':{'type':Sequelize[_0xaa5f('0x1')]}};
\ No newline at end of file
+var _0x3609=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x67fdc4,_0x4db659){var _0x32b93e=function(_0x1a2f9b){while(--_0x1a2f9b){_0x67fdc4['push'](_0x67fdc4['shift']());}};_0x32b93e(++_0x4db659);}(_0x3609,0x101));var _0x9360=function(_0xf088a3,_0x7ccb2a){_0xf088a3=_0xf088a3-0x0;var _0x5d1a40=_0x3609[_0xf088a3];return _0x5d1a40;};'use strict';var Sequelize=require(_0x9360('0x0'));module[_0x9360('0x1')]={'body':{'type':Sequelize[_0x9360('0x2')](_0x9360('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9360('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9360('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9360('0x5')]('in','out'),'defaultValue':_0x9360('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9360('0x7')]},'providerName':{'type':Sequelize[_0x9360('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index f3af4e0..bac1da9 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 _0x0627=['QueryTypes','interface','EventManager','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','http','request','then','info','debug','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','name','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','create','update','body','find','describe','chat-interactions','accept','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0627,0x180));var _0x7062=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x0627[_0x1b3564];return _0x504069;};'use strict';var emlformat=require(_0x7062('0x0'));var rimraf=require(_0x7062('0x1'));var zipdir=require(_0x7062('0x2'));var jsonpatch=require(_0x7062('0x3'));var rp=require(_0x7062('0x4'));var moment=require(_0x7062('0x5'));var BPromise=require(_0x7062('0x6'));var Mustache=require(_0x7062('0x7'));var util=require(_0x7062('0x8'));var path=require(_0x7062('0x9'));var sox=require('sox');var csv=require(_0x7062('0xa'));var ejs=require(_0x7062('0xb'));var fs=require('fs');var fs_extra=require(_0x7062('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7062('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7062('0xa'));var querystring=require(_0x7062('0xe'));var Papa=require('papaparse');var Redis=require(_0x7062('0xf'));var authService=require(_0x7062('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7062('0x11'));var logger=require(_0x7062('0x12'))(_0x7062('0x13'));var utils=require(_0x7062('0x14'));var config=require(_0x7062('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7062('0x16'))['db'];config['redis']=_[_0x7062('0x17')](config[_0x7062('0x18')],{'host':_0x7062('0x19'),'port':0x18eb});var socket=require(_0x7062('0x1a'))(new Redis(config[_0x7062('0x18')]));require(_0x7062('0x1b'))[_0x7062('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7062('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x7062('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xbf9042,_0x160b17,_0x283854,_0x577131){return new BPromise(function(_0x5dcb65,_0x4101d2){var _0x4dc6fa=_0x577131||client;return _0x4dc6fa[_0x7062('0x1e')](_0xbf9042,_0x283854)[_0x7062('0x1f')](function(_0x4cb518){logger[_0x7062('0x20')]('ChatMessage,\x20%s,\x20%s',_0x160b17,'request\x20sent');logger[_0x7062('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x160b17,_0x7062('0x22'),JSON[_0x7062('0x23')](_0x4cb518));if(_0x4cb518['error']){if(_0x4cb518[_0x7062('0x24')][_0x7062('0x25')]===0x1f4){logger[_0x7062('0x24')]('ChatMessage,\x20%s,\x20%s',_0x160b17,_0x4cb518[_0x7062('0x24')][_0x7062('0x26')]);return _0x4101d2(_0x4cb518[_0x7062('0x24')][_0x7062('0x26')]);}logger[_0x7062('0x24')](_0x7062('0x27'),_0x160b17,_0x4cb518[_0x7062('0x24')]['message']);return _0x5dcb65(_0x4cb518[_0x7062('0x24')][_0x7062('0x26')]);}else{logger[_0x7062('0x20')](_0x7062('0x27'),_0x160b17,_0x7062('0x22'));_0x5dcb65(_0x4cb518['result'][_0x7062('0x26')]);}})[_0x7062('0x28')](function(_0xfab90f){logger[_0x7062('0x24')]('ChatMessage,\x20%s,\x20%s',_0x160b17,_0xfab90f);_0x4101d2(_0xfab90f);});});}function respondWithStatusCode(_0x3d873b,_0x3480ff){_0x3480ff=_0x3480ff||0xcc;return function(_0x4fe6f6){if(_0x4fe6f6){return _0x3d873b[_0x7062('0x29')](_0x3480ff);}return _0x3d873b[_0x7062('0x2a')](_0x3480ff)[_0x7062('0x2b')]();};}function respondWithResult(_0x5b863c,_0x1aab2d){_0x1aab2d=_0x1aab2d||0xc8;return function(_0x36f95f){if(_0x36f95f){return _0x5b863c[_0x7062('0x2a')](_0x1aab2d)[_0x7062('0x2c')](_0x36f95f);}};}function respondWithFilteredResult(_0xb34006,_0x1199e7){return function(_0x706739){if(_0x706739){var _0x13c237=typeof _0x1199e7['offset']===_0x7062('0x2d')&&typeof _0x1199e7[_0x7062('0x2e')]===_0x7062('0x2d');var _0x564c8c=_0x706739[_0x7062('0x2f')];var _0x4ae993=_0x13c237?0x0:_0x1199e7[_0x7062('0x30')];var _0x4c9e32=_0x13c237?_0x706739[_0x7062('0x2f')]:_0x1199e7[_0x7062('0x30')]+_0x1199e7['limit'];var _0x235dcf;if(_0x4c9e32>=_0x564c8c){_0x4c9e32=_0x564c8c;_0x235dcf=0xc8;}else{_0x235dcf=0xce;}_0xb34006['status'](_0x235dcf);return _0xb34006[_0x7062('0x31')](_0x7062('0x32'),_0x4ae993+'-'+_0x4c9e32+'/'+_0x564c8c)[_0x7062('0x2c')](_0x706739);}return null;};}function patchUpdates(_0x2ad99f){return function(_0x1f7c55){try{jsonpatch[_0x7062('0x33')](_0x1f7c55,_0x2ad99f,!![]);}catch(_0x2395e9){return BPromise[_0x7062('0x34')](_0x2395e9);}return _0x1f7c55['save']();};}function saveUpdates(_0x45d56b,_0x340470){return function(_0x1fcf49){if(_0x1fcf49){return _0x1fcf49['update'](_0x45d56b)['then'](function(_0x3157f7){return _0x3157f7;});}return null;};}function removeEntity(_0x415808,_0x2e64df){return function(_0x2e0c11){if(_0x2e0c11){return _0x2e0c11[_0x7062('0x35')]()['then'](function(){_0x415808[_0x7062('0x2a')](0xcc)[_0x7062('0x2b')]();});}};}function handleEntityNotFound(_0x46ff20,_0x4d1e23){return function(_0x2e39f5){if(!_0x2e39f5){_0x46ff20[_0x7062('0x29')](0x194);}return _0x2e39f5;};}function handleError(_0x457661,_0x2665c7){_0x2665c7=_0x2665c7||0x1f4;return function(_0x347629){logger[_0x7062('0x24')](_0x347629['stack']);if(_0x347629[_0x7062('0x36')]){delete _0x347629['name'];}_0x457661[_0x7062('0x2a')](_0x2665c7)['send'](_0x347629);};}exports[_0x7062('0x37')]=function(_0x5813ea,_0x2d140c){var _0x2b4cf4={},_0x1a6d14={},_0x4587ff={'count':0x0,'rows':[]};var _0x1a0963=_['map'](db[_0x7062('0x38')][_0x7062('0x39')],function(_0x4704d3){return{'name':_0x4704d3[_0x7062('0x3a')],'type':_0x4704d3[_0x7062('0x3b')]['key']};});_0x1a6d14[_0x7062('0x3c')]=_[_0x7062('0x3d')](_0x1a0963,'name');_0x1a6d14['query']=_['keys'](_0x5813ea[_0x7062('0x3e')]);_0x1a6d14[_0x7062('0x3f')]=_[_0x7062('0x40')](_0x1a6d14[_0x7062('0x3c')],_0x1a6d14[_0x7062('0x3e')]);_0x2b4cf4[_0x7062('0x41')]=_[_0x7062('0x40')](_0x1a6d14[_0x7062('0x3c')],qs[_0x7062('0x42')](_0x5813ea[_0x7062('0x3e')]['fields']));_0x2b4cf4[_0x7062('0x41')]=_0x2b4cf4[_0x7062('0x41')][_0x7062('0x43')]?_0x2b4cf4[_0x7062('0x41')]:_0x1a6d14['model'];if(!_0x5813ea[_0x7062('0x3e')]['hasOwnProperty'](_0x7062('0x44'))){_0x2b4cf4[_0x7062('0x2e')]=qs[_0x7062('0x2e')](_0x5813ea[_0x7062('0x3e')][_0x7062('0x2e')]);_0x2b4cf4[_0x7062('0x30')]=qs[_0x7062('0x30')](_0x5813ea[_0x7062('0x3e')]['offset']);}_0x2b4cf4[_0x7062('0x45')]=qs[_0x7062('0x46')](_0x5813ea[_0x7062('0x3e')][_0x7062('0x46')]);_0x2b4cf4[_0x7062('0x47')]=qs['filters'](_['pick'](_0x5813ea[_0x7062('0x3e')],_0x1a6d14['filters']),_0x1a0963);if(_0x5813ea[_0x7062('0x3e')][_0x7062('0x48')]){_0x2b4cf4[_0x7062('0x47')]=_[_0x7062('0x49')](_0x2b4cf4[_0x7062('0x47')],{'$or':_[_0x7062('0x3d')](_0x1a0963,function(_0x3ea8e7){if(_0x3ea8e7[_0x7062('0x3b')]!==_0x7062('0x4a')){var _0x207f30={};_0x207f30[_0x3ea8e7[_0x7062('0x36')]]={'$like':'%'+_0x5813ea[_0x7062('0x3e')]['filter']+'%'};return _0x207f30;}})});}_0x2b4cf4=_['merge']({},_0x2b4cf4,_0x5813ea[_0x7062('0x4b')]);var _0x15253c={'where':_0x2b4cf4['where']};return db[_0x7062('0x38')]['count'](_0x15253c)['then'](function(_0x3d0574){_0x4587ff[_0x7062('0x2f')]=_0x3d0574;if(_0x5813ea[_0x7062('0x3e')][_0x7062('0x4c')]){_0x2b4cf4[_0x7062('0x4d')]=[{'all':!![]}];}return db[_0x7062('0x38')][_0x7062('0x4e')](_0x2b4cf4);})['then'](function(_0x367652){_0x4587ff['rows']=_0x367652;return _0x4587ff;})['then'](respondWithFilteredResult(_0x2d140c,_0x2b4cf4))[_0x7062('0x28')](handleError(_0x2d140c,null));};exports[_0x7062('0x4f')]=function(_0x2d7f1e,_0x1465af){var _0x33518d={'raw':!![],'where':{'id':_0x2d7f1e[_0x7062('0x50')]['id']}},_0x2ce782={};_0x2ce782[_0x7062('0x3c')]=_[_0x7062('0x51')](db[_0x7062('0x38')][_0x7062('0x39')]);_0x2ce782[_0x7062('0x3e')]=_[_0x7062('0x51')](_0x2d7f1e[_0x7062('0x3e')]);_0x2ce782[_0x7062('0x3f')]=_[_0x7062('0x40')](_0x2ce782[_0x7062('0x3c')],_0x2ce782['query']);_0x33518d[_0x7062('0x41')]=_[_0x7062('0x40')](_0x2ce782['model'],qs['fields'](_0x2d7f1e['query'][_0x7062('0x42')]));_0x33518d[_0x7062('0x41')]=_0x33518d[_0x7062('0x41')]['length']?_0x33518d[_0x7062('0x41')]:_0x2ce782[_0x7062('0x3c')];if(_0x2d7f1e[_0x7062('0x3e')][_0x7062('0x4c')]){_0x33518d[_0x7062('0x4d')]=[{'all':!![]}];}_0x33518d=_[_0x7062('0x49')]({},_0x33518d,_0x2d7f1e[_0x7062('0x4b')]);return db[_0x7062('0x38')]['find'](_0x33518d)['then'](handleEntityNotFound(_0x1465af,null))[_0x7062('0x1f')](respondWithResult(_0x1465af,null))[_0x7062('0x28')](handleError(_0x1465af,null));};exports[_0x7062('0x52')]=function(_0x4dbfed,_0x5474e0){return db['ChatMessage']['create'](_0x4dbfed['body'],{})[_0x7062('0x1f')](respondWithResult(_0x5474e0,0xc9))[_0x7062('0x28')](handleError(_0x5474e0,null));};exports[_0x7062('0x53')]=function(_0x5d43e3,_0x388f2c){if(_0x5d43e3[_0x7062('0x54')]['id']){delete _0x5d43e3[_0x7062('0x54')]['id'];}return db[_0x7062('0x38')]['find']({'where':{'id':_0x5d43e3[_0x7062('0x50')]['id']}})['then'](handleEntityNotFound(_0x388f2c,null))[_0x7062('0x1f')](saveUpdates(_0x5d43e3[_0x7062('0x54')],null))['then'](respondWithResult(_0x388f2c,null))['catch'](handleError(_0x388f2c,null));};exports['destroy']=function(_0xd582f4,_0x4ab9ee){return db[_0x7062('0x38')][_0x7062('0x55')]({'where':{'id':_0xd582f4[_0x7062('0x50')]['id']}})[_0x7062('0x1f')](handleEntityNotFound(_0x4ab9ee,null))[_0x7062('0x1f')](removeEntity(_0x4ab9ee,null))[_0x7062('0x28')](handleError(_0x4ab9ee,null));};exports[_0x7062('0x56')]=function(_0x547c4a,_0x6af53d){return db[_0x7062('0x38')]['describe']()[_0x7062('0x1f')](respondWithResult(_0x6af53d,null))[_0x7062('0x28')](handleError(_0x6af53d,null));};var interaction_log=require(_0x7062('0x12'))(_0x7062('0x57'));exports[_0x7062('0x58')]=function(_0x353a12,_0x557ca0,_0x2a131c){var _0x52ab01={'agent':{},'channel':'chat'};if(_0x353a12[_0x7062('0x54')]['id']){delete _0x353a12[_0x7062('0x54')]['id'];}_0x353a12['body'][_0x7062('0x59')]=!![];_0x353a12['body'][_0x7062('0x5a')]=moment()[_0x7062('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x353a12[_0x7062('0x54')][_0x7062('0x5c')]=_0x353a12[_0x7062('0x54')][_0x7062('0x5c')]||_0x353a12[_0x7062('0x5d')]['id'];_0x52ab01[_0x7062('0x5e')]['id']=_0x353a12['body'][_0x7062('0x5c')];return db[_0x7062('0x38')][_0x7062('0x55')]({'where':{'id':_0x353a12[_0x7062('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x557ca0,null))[_0x7062('0x1f')](saveUpdates(_0x353a12[_0x7062('0x54')],null))[_0x7062('0x1f')](function(_0x232dfe){if(_0x232dfe){_0x52ab01['message']=_0x232dfe[_0x7062('0x5f')]({'plain':!![]});return db[_0x7062('0x60')]['find']({'where':{'id':_0x232dfe[_0x7062('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x557ca0,null))[_0x7062('0x1f')](function(_0x41a565){if(_0x41a565){return _0x41a565[_0x7062('0x53')]({'UserId':_0x353a12[_0x7062('0x54')][_0x7062('0x5c')],'read1stAt':_[_0x7062('0x62')](_0x41a565[_0x7062('0x63')])?moment()['format'](_0x7062('0x64')):undefined});}return null;})[_0x7062('0x1f')](function(_0x505f6e){if(_0x505f6e){_0x52ab01['interaction']=_0x505f6e['get']({'plain':!![]});interaction_log[_0x7062('0x20')](_0x7062('0x65'),_0x353a12['user']['id'],_0x353a12[_0x7062('0x5d')][_0x7062('0x36')],_0x353a12[_0x7062('0x5d')][_0x7062('0x66')],_0x52ab01[_0x7062('0x67')]['id'],_0x353a12[_0x7062('0x54')]?JSON[_0x7062('0x23')](_0x353a12['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x7062('0x68'),_0x52ab01);}return null;})['then'](function(_0x2a2526){var _0x1c2c61=_0x7062('0x69')+_0x2a2526['message']['ContactId'];return db[_0x7062('0x6a')][_0x7062('0x3e')](_0x1c2c61,{'type':db[_0x7062('0x6b')]['QueryTypes'][_0x7062('0x6c')],'raw':!![]})[_0x7062('0x1f')](function(_0x3e8947){return _0x3e8947;});})[_0x7062('0x1f')](function(_0x30c7d1){if(_0x30c7d1){_0x52ab01[_0x7062('0x26')][_0x7062('0x6d')]=_0x30c7d1[0x0];if(!_0x353a12[_0x7062('0x54')][_0x7062('0x5c')])return;return db[_0x7062('0x6e')][_0x7062('0x55')]({'where':{'id':_0x353a12['body'][_0x7062('0x5c')],'role':_0x7062('0x5e')},'attributes':['id',_0x7062('0x36'),_0x7062('0x6f'),_0x7062('0x70'),_0x7062('0x71')],'raw':!![]});}return null;})[_0x7062('0x1f')](function(_0x5c7e8b){if(!_0x5c7e8b)return null;_0x52ab01[_0x7062('0x26')]['agent']=_0x5c7e8b;return _0x52ab01;})[_0x7062('0x1f')](function(_0x557b58){if(_0x557b58){if(_0x353a12[_0x7062('0x54')][_0x7062('0x72')]){_0x52ab01['message']['interface']=util['format']('SIP/%s',_0x353a12[_0x7062('0x5d')][_0x7062('0x36')]);_0x52ab01[_0x7062('0x26')]['channel']=_0x52ab01[_0x7062('0x73')];_0x52ab01[_0x7062('0x26')][_0x7062('0x74')]=_0x52ab01[_0x7062('0x73')];_0x52ab01[_0x7062('0x26')][_0x7062('0x75')]=_0x7062('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x7062('0x49')](_0x52ab01[_0x7062('0x26')],JSON[_0x7062('0x76')](_0x52ab01['interaction'][_0x7062('0x77')]))},client9002)[_0x7062('0x1f')](function(){return _0x52ab01;});}return _0x52ab01;}return null;})[_0x7062('0x1f')](respondWithResult(_0x557ca0,null))[_0x7062('0x28')](handleError(_0x557ca0,null));};var interaction_log=require(_0x7062('0x12'))(_0x7062('0x57'));exports[_0x7062('0x34')]=function(_0x16d66e,_0x2ff394,_0x4c12ed){var _0x1d91fa={'agent':{},'channel':'chat'};if(_0x16d66e[_0x7062('0x54')]['id']){delete _0x16d66e[_0x7062('0x54')]['id'];}_0x16d66e['body'][_0x7062('0x5c')]=_0x16d66e[_0x7062('0x54')][_0x7062('0x5c')]||_0x16d66e['user']['id'];_0x1d91fa[_0x7062('0x5e')]['id']=_0x16d66e['body'][_0x7062('0x5c')];return db[_0x7062('0x38')][_0x7062('0x55')]({'where':{'id':_0x16d66e['params']['id'],'UserId':null}})[_0x7062('0x1f')](handleEntityNotFound(_0x2ff394,null))[_0x7062('0x1f')](function(_0x3e8c8a){if(_0x3e8c8a){_0x1d91fa[_0x7062('0x26')]=_0x3e8c8a[_0x7062('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0x7062('0x55')]({'where':{'id':_0x3e8c8a['ChatInteractionId']}});}return null;})[_0x7062('0x1f')](handleEntityNotFound(_0x2ff394,null))[_0x7062('0x1f')](function(_0x36aa71){if(_0x36aa71){_0x1d91fa[_0x7062('0x67')]=_0x36aa71[_0x7062('0x5f')]({'plain':!![]});interaction_log[_0x7062('0x20')](_0x7062('0x78'),_0x16d66e[_0x7062('0x5d')]['id'],_0x16d66e['user'][_0x7062('0x36')],_0x16d66e[_0x7062('0x5d')][_0x7062('0x66')],_0x1d91fa['interaction']['id'],_0x16d66e[_0x7062('0x54')]?JSON[_0x7062('0x23')](_0x16d66e[_0x7062('0x54')]):_0x7062('0x79'));return respondWithRpcPromise(_0x7062('0x7a'),_0x7062('0x7b'),_0x1d91fa);}return null;})[_0x7062('0x1f')](function(_0x2a7e9e){var _0xef4b10=_0x7062('0x69')+_0x2a7e9e[_0x7062('0x26')]['ContactId'];return db['sequelize'][_0x7062('0x3e')](_0xef4b10,{'type':db[_0x7062('0x6b')][_0x7062('0x7c')][_0x7062('0x6c')],'raw':!![]})[_0x7062('0x1f')](function(_0x5101de){return _0x5101de;});})[_0x7062('0x1f')](function(_0x314df9){if(_0x314df9){_0x1d91fa['message']['contact']=_0x314df9[0x0];if(!_0x16d66e[_0x7062('0x54')][_0x7062('0x5c')])return;return db[_0x7062('0x6e')][_0x7062('0x55')]({'where':{'id':_0x16d66e[_0x7062('0x54')][_0x7062('0x5c')],'role':_0x7062('0x5e')},'attributes':['id',_0x7062('0x36'),_0x7062('0x6f'),_0x7062('0x70'),_0x7062('0x71')],'raw':!![]});}return null;})[_0x7062('0x1f')](function(_0x4b733){if(!_0x4b733)return null;_0x1d91fa[_0x7062('0x26')][_0x7062('0x5e')]=_0x4b733;return _0x1d91fa;})['then'](function(_0x42d37b){if(_0x42d37b){_0x42d37b['message'][_0x7062('0x7d')]=util[_0x7062('0x5b')]('SIP/%s',_0x16d66e[_0x7062('0x5d')][_0x7062('0x36')]);_0x42d37b['message']['channel']=_0x1d91fa['channel'];_0x42d37b[_0x7062('0x26')][_0x7062('0x74')]=_0x1d91fa[_0x7062('0x73')];_0x42d37b[_0x7062('0x26')]['event']=_0x7062('0x34');respondWithRpcPromise('EventManager',_0x7062('0x7e'),{'event':'rejectmessage','message':_['merge'](_0x1d91fa[_0x7062('0x26')],JSON[_0x7062('0x76')](_0x1d91fa[_0x7062('0x67')][_0x7062('0x77')]))},client9002);return _0x1d91fa;}return null;})[_0x7062('0x1f')](respondWithResult(_0x2ff394,null))['catch'](handleError(_0x2ff394,null));};
\ No newline at end of file
+var _0xeda4=['set','apply','reject','save','update','destroy','end','stack','name','send','index','ChatMessage','fieldName','model','map','query','filters','attributes','intersection','fields','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','json','offset','limit','undefined','count','status'];(function(_0x5b1134,_0x3a5bfd){var _0x27f845=function(_0x578413){while(--_0x578413){_0x5b1134['push'](_0x5b1134['shift']());}};_0x27f845(++_0x3a5bfd);}(_0xeda4,0x154));var _0x4eda=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0xeda4[_0xabbd2f];return _0x34a040;};'use strict';var emlformat=require(_0x4eda('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4eda('0x1'));var jsonpatch=require(_0x4eda('0x2'));var rp=require(_0x4eda('0x3'));var moment=require(_0x4eda('0x4'));var BPromise=require(_0x4eda('0x5'));var Mustache=require(_0x4eda('0x6'));var util=require(_0x4eda('0x7'));var path=require(_0x4eda('0x8'));var sox=require(_0x4eda('0x9'));var csv=require(_0x4eda('0xa'));var ejs=require(_0x4eda('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eda('0xc'));var squel=require(_0x4eda('0xd'));var crypto=require(_0x4eda('0xe'));var jsforce=require(_0x4eda('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4eda('0xa'));var querystring=require(_0x4eda('0x10'));var Papa=require('papaparse');var Redis=require(_0x4eda('0x11'));var authService=require(_0x4eda('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4eda('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4eda('0x14'))(_0x4eda('0x15'));var utils=require('../../config/utils');var config=require(_0x4eda('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4eda('0x17')]=_[_0x4eda('0x18')](config[_0x4eda('0x17')],{'host':_0x4eda('0x19'),'port':0x18eb});var socket=require(_0x4eda('0x1a'))(new Redis(config['redis']));require(_0x4eda('0x1b'))['register'](socket);var jayson=require(_0x4eda('0x1c'));var client=jayson[_0x4eda('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x4eda('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xda9114,_0x4fcd2a,_0x100530,_0x12ece5){return new BPromise(function(_0x127786,_0x47e492){var _0x34ba51=_0x12ece5||client;return _0x34ba51['request'](_0xda9114,_0x100530)[_0x4eda('0x1f')](function(_0x21cfd1){logger[_0x4eda('0x20')](_0x4eda('0x21'),_0x4fcd2a,_0x4eda('0x22'));logger['debug'](_0x4eda('0x23'),_0x4fcd2a,_0x4eda('0x22'),JSON[_0x4eda('0x24')](_0x21cfd1));if(_0x21cfd1['error']){if(_0x21cfd1[_0x4eda('0x25')]['code']===0x1f4){logger[_0x4eda('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fcd2a,_0x21cfd1[_0x4eda('0x25')][_0x4eda('0x26')]);return _0x47e492(_0x21cfd1[_0x4eda('0x25')][_0x4eda('0x26')]);}logger[_0x4eda('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fcd2a,_0x21cfd1[_0x4eda('0x25')][_0x4eda('0x26')]);return _0x127786(_0x21cfd1[_0x4eda('0x25')]['message']);}else{logger[_0x4eda('0x20')](_0x4eda('0x21'),_0x4fcd2a,_0x4eda('0x22'));_0x127786(_0x21cfd1[_0x4eda('0x27')]['message']);}})['catch'](function(_0x57dbc2){logger[_0x4eda('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fcd2a,_0x57dbc2);_0x47e492(_0x57dbc2);});});}function respondWithStatusCode(_0x45ebbd,_0x3cba43){_0x3cba43=_0x3cba43||0xcc;return function(_0x28a692){if(_0x28a692){return _0x45ebbd[_0x4eda('0x28')](_0x3cba43);}return _0x45ebbd['status'](_0x3cba43)['end']();};}function respondWithResult(_0x486231,_0x4e82e9){_0x4e82e9=_0x4e82e9||0xc8;return function(_0x2811d2){if(_0x2811d2){return _0x486231['status'](_0x4e82e9)[_0x4eda('0x29')](_0x2811d2);}};}function respondWithFilteredResult(_0x30fc48,_0x1dc2c9){return function(_0x1adfc1){if(_0x1adfc1){var _0x1a8f15=typeof _0x1dc2c9[_0x4eda('0x2a')]==='undefined'&&typeof _0x1dc2c9[_0x4eda('0x2b')]===_0x4eda('0x2c');var _0x19e3b6=_0x1adfc1[_0x4eda('0x2d')];var _0x556af6=_0x1a8f15?0x0:_0x1dc2c9[_0x4eda('0x2a')];var _0x23d43c=_0x1a8f15?_0x1adfc1[_0x4eda('0x2d')]:_0x1dc2c9[_0x4eda('0x2a')]+_0x1dc2c9[_0x4eda('0x2b')];var _0x3790c4;if(_0x23d43c>=_0x19e3b6){_0x23d43c=_0x19e3b6;_0x3790c4=0xc8;}else{_0x3790c4=0xce;}_0x30fc48[_0x4eda('0x2e')](_0x3790c4);return _0x30fc48[_0x4eda('0x2f')]('Content-Range',_0x556af6+'-'+_0x23d43c+'/'+_0x19e3b6)['json'](_0x1adfc1);}return null;};}function patchUpdates(_0x52b31a){return function(_0x1b194d){try{jsonpatch[_0x4eda('0x30')](_0x1b194d,_0x52b31a,!![]);}catch(_0x35325c){return BPromise[_0x4eda('0x31')](_0x35325c);}return _0x1b194d[_0x4eda('0x32')]();};}function saveUpdates(_0x1b0ce1,_0x3d9837){return function(_0xe58f6f){if(_0xe58f6f){return _0xe58f6f[_0x4eda('0x33')](_0x1b0ce1)['then'](function(_0x4e5516){return _0x4e5516;});}return null;};}function removeEntity(_0x1a24ea,_0x3848e0){return function(_0x48d296){if(_0x48d296){return _0x48d296[_0x4eda('0x34')]()[_0x4eda('0x1f')](function(){_0x1a24ea[_0x4eda('0x2e')](0xcc)[_0x4eda('0x35')]();});}};}function handleEntityNotFound(_0x477744,_0x4ad8ac){return function(_0x5a6e10){if(!_0x5a6e10){_0x477744[_0x4eda('0x28')](0x194);}return _0x5a6e10;};}function handleError(_0x1650c4,_0x342ec4){_0x342ec4=_0x342ec4||0x1f4;return function(_0x1a024a){logger['error'](_0x1a024a[_0x4eda('0x36')]);if(_0x1a024a[_0x4eda('0x37')]){delete _0x1a024a[_0x4eda('0x37')];}_0x1650c4[_0x4eda('0x2e')](_0x342ec4)[_0x4eda('0x38')](_0x1a024a);};}exports[_0x4eda('0x39')]=function(_0x4f4752,_0x2e9e8a){var _0x55fe7a={},_0x47692={},_0x344519={'count':0x0,'rows':[]};var _0xff274a=_['map'](db[_0x4eda('0x3a')]['rawAttributes'],function(_0x3bb746){return{'name':_0x3bb746[_0x4eda('0x3b')],'type':_0x3bb746['type']['key']};});_0x47692[_0x4eda('0x3c')]=_[_0x4eda('0x3d')](_0xff274a,_0x4eda('0x37'));_0x47692[_0x4eda('0x3e')]=_['keys'](_0x4f4752[_0x4eda('0x3e')]);_0x47692[_0x4eda('0x3f')]=_['intersection'](_0x47692['model'],_0x47692[_0x4eda('0x3e')]);_0x55fe7a[_0x4eda('0x40')]=_[_0x4eda('0x41')](_0x47692[_0x4eda('0x3c')],qs[_0x4eda('0x42')](_0x4f4752[_0x4eda('0x3e')][_0x4eda('0x42')]));_0x55fe7a[_0x4eda('0x40')]=_0x55fe7a[_0x4eda('0x40')]['length']?_0x55fe7a[_0x4eda('0x40')]:_0x47692[_0x4eda('0x3c')];if(!_0x4f4752['query']['hasOwnProperty']('nolimit')){_0x55fe7a[_0x4eda('0x2b')]=qs[_0x4eda('0x2b')](_0x4f4752[_0x4eda('0x3e')][_0x4eda('0x2b')]);_0x55fe7a[_0x4eda('0x2a')]=qs[_0x4eda('0x2a')](_0x4f4752['query'][_0x4eda('0x2a')]);}_0x55fe7a[_0x4eda('0x43')]=qs[_0x4eda('0x44')](_0x4f4752[_0x4eda('0x3e')][_0x4eda('0x44')]);_0x55fe7a[_0x4eda('0x45')]=qs[_0x4eda('0x3f')](_[_0x4eda('0x46')](_0x4f4752['query'],_0x47692[_0x4eda('0x3f')]),_0xff274a);if(_0x4f4752[_0x4eda('0x3e')]['filter']){_0x55fe7a[_0x4eda('0x45')]=_['merge'](_0x55fe7a[_0x4eda('0x45')],{'$or':_[_0x4eda('0x3d')](_0xff274a,function(_0x4c132d){if(_0x4c132d[_0x4eda('0x47')]!==_0x4eda('0x48')){var _0x4d2492={};_0x4d2492[_0x4c132d['name']]={'$like':'%'+_0x4f4752[_0x4eda('0x3e')][_0x4eda('0x49')]+'%'};return _0x4d2492;}})});}_0x55fe7a=_[_0x4eda('0x4a')]({},_0x55fe7a,_0x4f4752['options']);var _0x31b2ff={'where':_0x55fe7a[_0x4eda('0x45')]};return db[_0x4eda('0x3a')][_0x4eda('0x2d')](_0x31b2ff)[_0x4eda('0x1f')](function(_0x3283a3){_0x344519[_0x4eda('0x2d')]=_0x3283a3;if(_0x4f4752[_0x4eda('0x3e')][_0x4eda('0x4b')]){_0x55fe7a[_0x4eda('0x4c')]=[{'all':!![]}];}return db[_0x4eda('0x3a')][_0x4eda('0x4d')](_0x55fe7a);})[_0x4eda('0x1f')](function(_0x4e5161){_0x344519[_0x4eda('0x4e')]=_0x4e5161;return _0x344519;})[_0x4eda('0x1f')](respondWithFilteredResult(_0x2e9e8a,_0x55fe7a))[_0x4eda('0x4f')](handleError(_0x2e9e8a,null));};exports[_0x4eda('0x50')]=function(_0x2817c7,_0x1e7fc4){var _0x15d330={'raw':!![],'where':{'id':_0x2817c7[_0x4eda('0x51')]['id']}},_0x5a504e={};_0x5a504e['model']=_[_0x4eda('0x52')](db['ChatMessage']['rawAttributes']);_0x5a504e[_0x4eda('0x3e')]=_[_0x4eda('0x52')](_0x2817c7['query']);_0x5a504e['filters']=_[_0x4eda('0x41')](_0x5a504e[_0x4eda('0x3c')],_0x5a504e[_0x4eda('0x3e')]);_0x15d330['attributes']=_[_0x4eda('0x41')](_0x5a504e[_0x4eda('0x3c')],qs[_0x4eda('0x42')](_0x2817c7[_0x4eda('0x3e')]['fields']));_0x15d330[_0x4eda('0x40')]=_0x15d330[_0x4eda('0x40')]['length']?_0x15d330[_0x4eda('0x40')]:_0x5a504e[_0x4eda('0x3c')];if(_0x2817c7[_0x4eda('0x3e')][_0x4eda('0x4b')]){_0x15d330[_0x4eda('0x4c')]=[{'all':!![]}];}_0x15d330=_[_0x4eda('0x4a')]({},_0x15d330,_0x2817c7[_0x4eda('0x53')]);return db[_0x4eda('0x3a')][_0x4eda('0x54')](_0x15d330)[_0x4eda('0x1f')](handleEntityNotFound(_0x1e7fc4,null))[_0x4eda('0x1f')](respondWithResult(_0x1e7fc4,null))['catch'](handleError(_0x1e7fc4,null));};exports[_0x4eda('0x55')]=function(_0x3bb6d8,_0x57d9f2){return db['ChatMessage'][_0x4eda('0x55')](_0x3bb6d8[_0x4eda('0x56')],{})[_0x4eda('0x1f')](respondWithResult(_0x57d9f2,0xc9))[_0x4eda('0x4f')](handleError(_0x57d9f2,null));};exports[_0x4eda('0x33')]=function(_0x5b7c28,_0x527256){if(_0x5b7c28[_0x4eda('0x56')]['id']){delete _0x5b7c28[_0x4eda('0x56')]['id'];}return db[_0x4eda('0x3a')][_0x4eda('0x54')]({'where':{'id':_0x5b7c28['params']['id']}})[_0x4eda('0x1f')](handleEntityNotFound(_0x527256,null))[_0x4eda('0x1f')](saveUpdates(_0x5b7c28['body'],null))[_0x4eda('0x1f')](respondWithResult(_0x527256,null))[_0x4eda('0x4f')](handleError(_0x527256,null));};exports['destroy']=function(_0x30b02f,_0x11059d){return db[_0x4eda('0x3a')][_0x4eda('0x54')]({'where':{'id':_0x30b02f['params']['id']}})[_0x4eda('0x1f')](handleEntityNotFound(_0x11059d,null))['then'](removeEntity(_0x11059d,null))[_0x4eda('0x4f')](handleError(_0x11059d,null));};exports[_0x4eda('0x57')]=function(_0x41a7f0,_0x53f907){return db[_0x4eda('0x3a')][_0x4eda('0x57')]()[_0x4eda('0x1f')](respondWithResult(_0x53f907,null))[_0x4eda('0x4f')](handleError(_0x53f907,null));};var interaction_log=require(_0x4eda('0x14'))(_0x4eda('0x58'));exports[_0x4eda('0x59')]=function(_0x247516,_0x65fcaf,_0x2bc7e8){var _0x4bea9f={'agent':{},'channel':_0x4eda('0x5a')};if(_0x247516[_0x4eda('0x56')]['id']){delete _0x247516[_0x4eda('0x56')]['id'];}_0x247516[_0x4eda('0x56')][_0x4eda('0x5b')]=!![];_0x247516[_0x4eda('0x56')][_0x4eda('0x5c')]=moment()[_0x4eda('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x247516['body'][_0x4eda('0x5e')]=_0x247516[_0x4eda('0x56')][_0x4eda('0x5e')]||_0x247516[_0x4eda('0x5f')]['id'];_0x4bea9f[_0x4eda('0x60')]['id']=_0x247516['body']['UserId'];return db[_0x4eda('0x3a')][_0x4eda('0x54')]({'where':{'id':_0x247516[_0x4eda('0x51')]['id'],'UserId':null}})[_0x4eda('0x1f')](handleEntityNotFound(_0x65fcaf,null))['then'](saveUpdates(_0x247516[_0x4eda('0x56')],null))['then'](function(_0x1b64da){if(_0x1b64da){_0x4bea9f[_0x4eda('0x26')]=_0x1b64da[_0x4eda('0x61')]({'plain':!![]});return db[_0x4eda('0x62')][_0x4eda('0x54')]({'where':{'id':_0x1b64da[_0x4eda('0x63')]}});}return null;})[_0x4eda('0x1f')](handleEntityNotFound(_0x65fcaf,null))[_0x4eda('0x1f')](function(_0x2d9959){if(_0x2d9959){return _0x2d9959['update']({'UserId':_0x247516['body'][_0x4eda('0x5e')],'read1stAt':_[_0x4eda('0x64')](_0x2d9959[_0x4eda('0x65')])?moment()[_0x4eda('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4eda('0x1f')](function(_0x1ddd05){if(_0x1ddd05){_0x4bea9f[_0x4eda('0x66')]=_0x1ddd05[_0x4eda('0x61')]({'plain':!![]});interaction_log[_0x4eda('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x247516['user']['id'],_0x247516[_0x4eda('0x5f')][_0x4eda('0x37')],_0x247516[_0x4eda('0x5f')][_0x4eda('0x67')],_0x4bea9f[_0x4eda('0x66')]['id'],_0x247516[_0x4eda('0x56')]?JSON['stringify'](_0x247516[_0x4eda('0x56')]):_0x4eda('0x68'));return respondWithRpcPromise(_0x4eda('0x69'),_0x4eda('0x6a'),_0x4bea9f);}return null;})[_0x4eda('0x1f')](function(_0x37aa68){var _0x421585=_0x4eda('0x6b')+_0x37aa68['message'][_0x4eda('0x6c')];return db[_0x4eda('0x6d')][_0x4eda('0x3e')](_0x421585,{'type':db[_0x4eda('0x6e')][_0x4eda('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x1bfc8a){return _0x1bfc8a;});})['then'](function(_0xcc1295){if(_0xcc1295){_0x4bea9f[_0x4eda('0x26')][_0x4eda('0x70')]=_0xcc1295[0x0];if(!_0x247516[_0x4eda('0x56')][_0x4eda('0x5e')])return;return db['User']['find']({'where':{'id':_0x247516[_0x4eda('0x56')][_0x4eda('0x5e')],'role':_0x4eda('0x60')},'attributes':['id',_0x4eda('0x37'),_0x4eda('0x71'),_0x4eda('0x72'),_0x4eda('0x73')],'raw':!![]});}return null;})[_0x4eda('0x1f')](function(_0xbdf17){if(!_0xbdf17)return null;_0x4bea9f[_0x4eda('0x26')][_0x4eda('0x60')]=_0xbdf17;return _0x4bea9f;})[_0x4eda('0x1f')](function(_0x2c7d77){if(_0x2c7d77){if(_0x247516[_0x4eda('0x56')]['manual']){_0x4bea9f[_0x4eda('0x26')][_0x4eda('0x74')]=util['format'](_0x4eda('0x75'),_0x247516[_0x4eda('0x5f')][_0x4eda('0x37')]);_0x4bea9f[_0x4eda('0x26')][_0x4eda('0x76')]=_0x4bea9f[_0x4eda('0x76')];_0x4bea9f[_0x4eda('0x26')][_0x4eda('0x77')]=_0x4bea9f[_0x4eda('0x76')];_0x4bea9f['message'][_0x4eda('0x78')]=_0x4eda('0x59');return respondWithRpcPromise(_0x4eda('0x79'),_0x4eda('0x79'),{'event':_0x4eda('0x7a'),'message':_[_0x4eda('0x4a')](_0x4bea9f[_0x4eda('0x26')],JSON[_0x4eda('0x7b')](_0x4bea9f[_0x4eda('0x66')]['formData']))},client9002)[_0x4eda('0x1f')](function(){return _0x4bea9f;});}return _0x4bea9f;}return null;})[_0x4eda('0x1f')](respondWithResult(_0x65fcaf,null))['catch'](handleError(_0x65fcaf,null));};var interaction_log=require(_0x4eda('0x14'))(_0x4eda('0x58'));exports[_0x4eda('0x31')]=function(_0x419453,_0x21ea60,_0x108c9e){var _0x2b50be={'agent':{},'channel':_0x4eda('0x5a')};if(_0x419453[_0x4eda('0x56')]['id']){delete _0x419453[_0x4eda('0x56')]['id'];}_0x419453[_0x4eda('0x56')][_0x4eda('0x5e')]=_0x419453['body']['UserId']||_0x419453[_0x4eda('0x5f')]['id'];_0x2b50be['agent']['id']=_0x419453[_0x4eda('0x56')][_0x4eda('0x5e')];return db[_0x4eda('0x3a')][_0x4eda('0x54')]({'where':{'id':_0x419453['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21ea60,null))[_0x4eda('0x1f')](function(_0x5ae640){if(_0x5ae640){_0x2b50be[_0x4eda('0x26')]=_0x5ae640[_0x4eda('0x61')]({'plain':!![]});return db[_0x4eda('0x62')][_0x4eda('0x54')]({'where':{'id':_0x5ae640['ChatInteractionId']}});}return null;})[_0x4eda('0x1f')](handleEntityNotFound(_0x21ea60,null))[_0x4eda('0x1f')](function(_0x5d00f0){if(_0x5d00f0){_0x2b50be[_0x4eda('0x66')]=_0x5d00f0['get']({'plain':!![]});interaction_log[_0x4eda('0x20')](_0x4eda('0x7c'),_0x419453[_0x4eda('0x5f')]['id'],_0x419453[_0x4eda('0x5f')][_0x4eda('0x37')],_0x419453[_0x4eda('0x5f')][_0x4eda('0x67')],_0x2b50be['interaction']['id'],_0x419453[_0x4eda('0x56')]?JSON[_0x4eda('0x24')](_0x419453[_0x4eda('0x56')]):_0x4eda('0x68'));return respondWithRpcPromise(_0x4eda('0x7d'),_0x4eda('0x7e'),_0x2b50be);}return null;})[_0x4eda('0x1f')](function(_0x156818){var _0xefb2fc=_0x4eda('0x6b')+_0x156818[_0x4eda('0x26')]['ContactId'];return db['sequelize'][_0x4eda('0x3e')](_0xefb2fc,{'type':db[_0x4eda('0x6e')][_0x4eda('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x4098e4){return _0x4098e4;});})['then'](function(_0x14e4ed){if(_0x14e4ed){_0x2b50be[_0x4eda('0x26')][_0x4eda('0x70')]=_0x14e4ed[0x0];if(!_0x419453[_0x4eda('0x56')][_0x4eda('0x5e')])return;return db[_0x4eda('0x7f')][_0x4eda('0x54')]({'where':{'id':_0x419453['body'][_0x4eda('0x5e')],'role':_0x4eda('0x60')},'attributes':['id','name','fullname',_0x4eda('0x72'),_0x4eda('0x73')],'raw':!![]});}return null;})[_0x4eda('0x1f')](function(_0x2e743c){if(!_0x2e743c)return null;_0x2b50be[_0x4eda('0x26')][_0x4eda('0x60')]=_0x2e743c;return _0x2b50be;})['then'](function(_0x107c17){if(_0x107c17){_0x107c17[_0x4eda('0x26')]['interface']=util[_0x4eda('0x5d')]('SIP/%s',_0x419453['user'][_0x4eda('0x37')]);_0x107c17[_0x4eda('0x26')][_0x4eda('0x76')]=_0x2b50be[_0x4eda('0x76')];_0x107c17[_0x4eda('0x26')][_0x4eda('0x77')]=_0x2b50be[_0x4eda('0x76')];_0x107c17[_0x4eda('0x26')][_0x4eda('0x78')]=_0x4eda('0x31');respondWithRpcPromise(_0x4eda('0x79'),'EventManager',{'event':_0x4eda('0x80'),'message':_[_0x4eda('0x4a')](_0x2b50be[_0x4eda('0x26')],JSON['parse'](_0x2b50be[_0x4eda('0x66')]['formData']))},client9002);return _0x2b50be;}return null;})[_0x4eda('0x1f')](respondWithResult(_0x21ea60,null))['catch'](handleError(_0x21ea60,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index f17a542..a303e20 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 _0xd46d=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x3c60c4,_0x399051){var _0x3ee322=function(_0x1a5328){while(--_0x1a5328){_0x3c60c4['push'](_0x3c60c4['shift']());}};_0x3ee322(++_0x399051);}(_0xd46d,0x16e));var _0xdd46=function(_0x36af32,_0x4a9053){_0x36af32=_0x36af32-0x0;var _0x5822e3=_0xd46d[_0x36af32];return _0x5822e3;};'use strict';var EventEmitter=require(_0xdd46('0x0'));var ChatMessage=require(_0xdd46('0x1'))['db'][_0xdd46('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdd46('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdd46('0x4')};function emitEvent(_0x39a145){return function(_0xbb609d,_0x427300,_0x5752d5){ChatMessageEvents[_0xdd46('0x5')](_0x39a145+':'+_0xbb609d['id'],_0xbb609d);ChatMessageEvents['emit'](_0x39a145,_0xbb609d);_0x5752d5(null);};}for(var e in events){if(events[_0xdd46('0x6')](e)){var event=events[e];ChatMessage[_0xdd46('0x7')](e,emitEvent(event));}}module[_0xdd46('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb1d9=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0xb1d9,0xad));var _0x9b1d=function(_0x5c8d1d,_0x459edf){_0x5c8d1d=_0x5c8d1d-0x0;var _0x474fd6=_0xb1d9[_0x5c8d1d];return _0x474fd6;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x9b1d('0x0'))['db'][_0x9b1d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9b1d('0x2')](0x0);var events={'afterCreate':_0x9b1d('0x3'),'afterUpdate':_0x9b1d('0x4'),'afterDestroy':_0x9b1d('0x5')};function emitEvent(_0x401b17){return function(_0x39b423,_0x5f168a,_0x471f78){ChatMessageEvents[_0x9b1d('0x6')](_0x401b17+':'+_0x39b423['id'],_0x39b423);ChatMessageEvents[_0x9b1d('0x6')](_0x401b17,_0x39b423);_0x471f78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9b1d('0x7')](e,emitEvent(event));}}module[_0x9b1d('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index df30ad2..0f99e83 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 _0xd4ba=['ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','findOne'];(function(_0x2e8c6e,_0x4637c3){var _0x33c76c=function(_0x12f387){while(--_0x12f387){_0x2e8c6e['push'](_0x2e8c6e['shift']());}};_0x33c76c(++_0x4637c3);}(_0xd4ba,0x7c));var _0xad4b=function(_0x263a2d,_0x3ca70b){_0x263a2d=_0x263a2d-0x0;var _0x153caf=_0xd4ba[_0x263a2d];return _0x153caf;};'use strict';var _=require(_0xad4b('0x0'));var util=require(_0xad4b('0x1'));var logger=require(_0xad4b('0x2'))(_0xad4b('0x3'));var moment=require(_0xad4b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad4b('0x5'));var rimraf=require(_0xad4b('0x6'));var config=require(_0xad4b('0x7'));var attributes=require(_0xad4b('0x8'));module[_0xad4b('0x9')]=function(_0x26a504,_0xa4c46a){return _0x26a504[_0xad4b('0xa')]('ChatMessage',attributes,{'tableName':_0xad4b('0xb'),'paranoid':![],'indexes':[{'name':_0xad4b('0xc'),'fields':[_0xad4b('0xd')],'type':_0xad4b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1695e3,_0x34f962,_0x197808){var _0x1264eb=_0x26a504[_0xad4b('0xf')];var _0x51b9c8=_0x1695e3['get']({'plain':!![]});if(_0x51b9c8[_0xad4b('0x10')]['toLowerCase']()==='in'||_0x51b9c8[_0xad4b('0x10')][_0xad4b('0x11')]()==='out'&&!_0x51b9c8['secret']&&!_[_0xad4b('0x12')](_0x51b9c8[_0xad4b('0x13')])){_0x1264eb['ChatInteraction'][_0xad4b('0x14')]({'where':{'id':_0x51b9c8[_0xad4b('0x15')]}})[_0xad4b('0x16')](function(_0x41e66b){if(_0x41e66b){_0x41e66b[_0xad4b('0x17')]({'lastMsgAt':_0x51b9c8[_0xad4b('0x18')],'lastMsgDirection':_0x51b9c8[_0xad4b('0x10')]['toLowerCase']()});}})[_0xad4b('0x19')](function(_0x269db5){console[_0xad4b('0x1a')](_0x269db5);});}_0x197808();}},'charset':_0xad4b('0x1b'),'collate':_0xad4b('0x1c')});};
\ No newline at end of file
+var _0x072d=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x072d,0x1d0));var _0xd072=function(_0x209e59,_0x5343c0){_0x209e59=_0x209e59-0x0;var _0x4fd0a3=_0x072d[_0x209e59];return _0x4fd0a3;};'use strict';var _=require(_0xd072('0x0'));var util=require('util');var logger=require(_0xd072('0x1'))(_0xd072('0x2'));var moment=require(_0xd072('0x3'));var BPromise=require(_0xd072('0x4'));var rp=require(_0xd072('0x5'));var fs=require('fs');var path=require(_0xd072('0x6'));var rimraf=require(_0xd072('0x7'));var config=require(_0xd072('0x8'));var attributes=require(_0xd072('0x9'));module[_0xd072('0xa')]=function(_0x4f848b,_0x1c2aae){return _0x4f848b[_0xd072('0xb')](_0xd072('0xc'),attributes,{'tableName':_0xd072('0xd'),'paranoid':![],'indexes':[{'name':_0xd072('0xe'),'fields':[_0xd072('0xf')],'type':_0xd072('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52c433,_0x4aa64d,_0x4baacc){var _0x3cc907=_0x4f848b[_0xd072('0x11')];var _0x3a42a9=_0x52c433[_0xd072('0x12')]({'plain':!![]});if(_0x3a42a9[_0xd072('0x13')][_0xd072('0x14')]()==='in'||_0x3a42a9[_0xd072('0x13')][_0xd072('0x14')]()===_0xd072('0x15')&&!_0x3a42a9[_0xd072('0x16')]&&!_['isNil'](_0x3a42a9[_0xd072('0x17')])){_0x3cc907[_0xd072('0x18')]['findOne']({'where':{'id':_0x3a42a9['ChatInteractionId']}})[_0xd072('0x19')](function(_0x24a671){if(_0x24a671){_0x24a671[_0xd072('0x1a')]({'lastMsgAt':_0x3a42a9[_0xd072('0x1b')],'lastMsgDirection':_0x3a42a9[_0xd072('0x13')]['toLowerCase']()});}})[_0xd072('0x1c')](function(_0x359a81){console['error'](_0x359a81);});}_0x4baacc();}},'charset':'utf8mb4','collate':_0xd072('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6fed120..b7e46fa 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 _0xb22e=['code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','then','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3cc16a,_0xa5f20b){var _0x4db149=function(_0x2c7506){while(--_0x2c7506){_0x3cc16a['push'](_0x3cc16a['shift']());}};_0x4db149(++_0xa5f20b);}(_0xb22e,0x87));var _0xeb22=function(_0x5e3ee3,_0xd54461){_0x5e3ee3=_0x5e3ee3-0x0;var _0x2d49d8=_0xb22e[_0x5e3ee3];return _0x2d49d8;};'use strict';var _=require(_0xeb22('0x0'));var util=require(_0xeb22('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb22('0x2'));var fs=require('fs');var Redis=require(_0xeb22('0x3'));var db=require(_0xeb22('0x4'))['db'];var utils=require(_0xeb22('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xeb22('0x6'));var client=jayson[_0xeb22('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xeb22('0x8')],{'host':_0xeb22('0x9'),'port':0x18eb});var socket=require(_0xeb22('0xa'))(new Redis(config[_0xeb22('0x8')]));require(_0xeb22('0xb'))[_0xeb22('0xc')](socket);function respondWithRpcPromise(_0x592255,_0x7e3694,_0x5a5447){return new BPromise(function(_0x1d57c4,_0x1fd533){return client[_0xeb22('0xd')](_0x592255,_0x5a5447)['then'](function(_0x481925){logger[_0xeb22('0xe')]('ChatMessage,\x20%s,\x20%s',_0x7e3694,_0xeb22('0xf'));logger[_0xeb22('0x10')](_0xeb22('0x11'),_0x7e3694,_0xeb22('0xf'),JSON[_0xeb22('0x12')](_0x481925));if(_0x481925[_0xeb22('0x13')]){if(_0x481925[_0xeb22('0x13')][_0xeb22('0x14')]===0x1f4){logger[_0xeb22('0x13')](_0xeb22('0x15'),_0x7e3694,_0x481925[_0xeb22('0x13')]['message']);return _0x1fd533(_0x481925[_0xeb22('0x13')][_0xeb22('0x16')]);}logger[_0xeb22('0x13')](_0xeb22('0x15'),_0x7e3694,_0x481925[_0xeb22('0x13')][_0xeb22('0x16')]);return _0x1d57c4(_0x481925[_0xeb22('0x13')][_0xeb22('0x16')]);}else{logger[_0xeb22('0xe')](_0xeb22('0x15'),_0x7e3694,_0xeb22('0xf'));_0x1d57c4(_0x481925[_0xeb22('0x17')][_0xeb22('0x16')]);}})['catch'](function(_0x5a1147){logger[_0xeb22('0x13')](_0xeb22('0x15'),_0x7e3694,_0x5a1147);_0x1fd533(_0x5a1147);});});}exports[_0xeb22('0x18')]=function(_0xec84dc){var _0x3dd596=this;return new Promise(function(_0xbea013,_0x57fbde){return db[_0xeb22('0x19')][_0xeb22('0x1a')](_0xec84dc[_0xeb22('0x1b')],{'raw':_0xec84dc[_0xeb22('0x1c')]?_0xec84dc[_0xeb22('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xeb22('0x1d')](function(_0x38585c){logger[_0xeb22('0xe')](_0xeb22('0x18'),_0xec84dc);logger['debug'](_0xeb22('0x18'),_0xec84dc,JSON['stringify'](_0x38585c));_0xbea013(_0x38585c);})[_0xeb22('0x1e')](function(_0x36531c){logger[_0xeb22('0x13')]('CreateChatMessage',_0x36531c[_0xeb22('0x16')],_0xec84dc);_0x57fbde(_0x3dd596[_0xeb22('0x13')](0x1f4,_0x36531c[_0xeb22('0x16')]));});});};
\ No newline at end of file
+var _0xb6dc=['../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis'];(function(_0x53ee43,_0x2a63ec){var _0x58b2ca=function(_0x35e8a0){while(--_0x35e8a0){_0x53ee43['push'](_0x53ee43['shift']());}};_0x58b2ca(++_0x2a63ec);}(_0xb6dc,0xaa));var _0xcb6d=function(_0x2b71a8,_0x585d2f){_0x2b71a8=_0x2b71a8-0x0;var _0xaa046a=_0xb6dc[_0x2b71a8];return _0xaa046a;};'use strict';var _=require('lodash');var util=require(_0xcb6d('0x0'));var moment=require(_0xcb6d('0x1'));var BPromise=require(_0xcb6d('0x2'));var rs=require(_0xcb6d('0x3'));var fs=require('fs');var Redis=require(_0xcb6d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb6d('0x5'));var logger=require(_0xcb6d('0x6'))(_0xcb6d('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb6d('0x8'));var client=jayson[_0xcb6d('0x9')]['http']({'port':0x232a});config['redis']=_[_0xcb6d('0xa')](config[_0xcb6d('0xb')],{'host':_0xcb6d('0xc'),'port':0x18eb});var socket=require(_0xcb6d('0xd'))(new Redis(config['redis']));require(_0xcb6d('0xe'))[_0xcb6d('0xf')](socket);function respondWithRpcPromise(_0x2271e0,_0x29d6c0,_0x5d8bd3){return new BPromise(function(_0x51eb92,_0x408f18){return client[_0xcb6d('0x10')](_0x2271e0,_0x5d8bd3)[_0xcb6d('0x11')](function(_0x1bea4b){logger[_0xcb6d('0x12')](_0xcb6d('0x13'),_0x29d6c0,_0xcb6d('0x14'));logger[_0xcb6d('0x15')](_0xcb6d('0x16'),_0x29d6c0,_0xcb6d('0x14'),JSON[_0xcb6d('0x17')](_0x1bea4b));if(_0x1bea4b[_0xcb6d('0x18')]){if(_0x1bea4b[_0xcb6d('0x18')][_0xcb6d('0x19')]===0x1f4){logger[_0xcb6d('0x18')](_0xcb6d('0x13'),_0x29d6c0,_0x1bea4b['error'][_0xcb6d('0x1a')]);return _0x408f18(_0x1bea4b[_0xcb6d('0x18')][_0xcb6d('0x1a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x29d6c0,_0x1bea4b['error'][_0xcb6d('0x1a')]);return _0x51eb92(_0x1bea4b[_0xcb6d('0x18')][_0xcb6d('0x1a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x29d6c0,_0xcb6d('0x14'));_0x51eb92(_0x1bea4b[_0xcb6d('0x1b')][_0xcb6d('0x1a')]);}})[_0xcb6d('0x1c')](function(_0x29a460){logger['error'](_0xcb6d('0x13'),_0x29d6c0,_0x29a460);_0x408f18(_0x29a460);});});}exports[_0xcb6d('0x1d')]=function(_0x226e01){var _0x145434=this;return new Promise(function(_0x449d66,_0x15bc12){return db[_0xcb6d('0x1e')][_0xcb6d('0x1f')](_0x226e01[_0xcb6d('0x20')],{'raw':_0x226e01[_0xcb6d('0x21')]?_0x226e01['options'][_0xcb6d('0x22')]===undefined?!![]:![]:!![]})[_0xcb6d('0x11')](function(_0x177c92){logger[_0xcb6d('0x12')](_0xcb6d('0x1d'),_0x226e01);logger[_0xcb6d('0x15')](_0xcb6d('0x1d'),_0x226e01,JSON[_0xcb6d('0x17')](_0x177c92));_0x449d66(_0x177c92);})[_0xcb6d('0x1c')](function(_0x4f5fda){logger[_0xcb6d('0x18')]('CreateChatMessage',_0x4f5fda[_0xcb6d('0x1a')],_0x226e01);_0x15bc12(_0x145434[_0xcb6d('0x18')](0x1f4,_0x4f5fda['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index db78ff0..b0aaa63 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 _0xa4dc=['register','chatMessage:','./chatMessage.events','save','emit','removeListener'];(function(_0x4291ae,_0x32c6b4){var _0x8e8364=function(_0x45171d){while(--_0x45171d){_0x4291ae['push'](_0x4291ae['shift']());}};_0x8e8364(++_0x32c6b4);}(_0xa4dc,0x16a));var _0xca4d=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xa4dc[_0x4ed520];return _0x4415a6;};'use strict';var ChatMessageEvents=require(_0xca4d('0x0'));var events=[_0xca4d('0x1'),'remove','update'];function createListener(_0x3e9b62,_0x3e51a4){return function(_0xf35655){_0x3e51a4[_0xca4d('0x2')](_0x3e9b62,_0xf35655);};}function removeListener(_0x22d0cf,_0x504f4a){return function(){ChatMessageEvents[_0xca4d('0x3')](_0x22d0cf,_0x504f4a);};}exports[_0xca4d('0x4')]=function(_0x1b60f4){for(var _0x51470b=0x0,_0x299f58=events['length'];_0x51470b<_0x299f58;_0x51470b++){var _0x35b21a=events[_0x51470b];var _0x2fa52a=createListener(_0xca4d('0x5')+_0x35b21a,_0x1b60f4);ChatMessageEvents['on'](_0x35b21a,_0x2fa52a);}};
\ No newline at end of file
+var _0xea31=['register','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xea31,0x6b));var _0x1ea3=function(_0x594023,_0x544aac){_0x594023=_0x594023-0x0;var _0x190c4f=_0xea31[_0x594023];return _0x190c4f;};'use strict';var ChatMessageEvents=require(_0x1ea3('0x0'));var events=['save',_0x1ea3('0x1'),_0x1ea3('0x2')];function createListener(_0x3b1d99,_0x153625){return function(_0x2dc24e){_0x153625[_0x1ea3('0x3')](_0x3b1d99,_0x2dc24e);};}function removeListener(_0x1142f1,_0x555620){return function(){ChatMessageEvents[_0x1ea3('0x4')](_0x1142f1,_0x555620);};}exports[_0x1ea3('0x5')]=function(_0x6810da){for(var _0x27c695=0x0,_0x13e6fb=events['length'];_0x27c695<_0x13e6fb;_0x27c695++){var _0x1fa3a8=events[_0x27c695];var _0x1b578e=createListener(_0x1ea3('0x6')+_0x1fa3a8,_0x6810da);ChatMessageEvents['on'](_0x1fa3a8,_0x1b578e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 62a73f1..8dce7a2 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 _0x47ee=['util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x47ee,0x108));var _0xe47e=function(_0x1c5260,_0xb74272){_0x1c5260=_0x1c5260-0x0;var _0x59e3f5=_0x47ee[_0x1c5260];return _0x59e3f5;};'use strict';var multer=require('multer');var util=require(_0xe47e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe47e('0x1'));var auth=require(_0xe47e('0x2'));var interaction=require(_0xe47e('0x3'));var config=require(_0xe47e('0x4'));var controller=require('./chatMessage.controller');router[_0xe47e('0x5')]('/',auth[_0xe47e('0x6')](),controller[_0xe47e('0x7')]);router[_0xe47e('0x5')](_0xe47e('0x8'),auth['isAuthenticated'](),controller[_0xe47e('0x9')]);router[_0xe47e('0x5')](_0xe47e('0xa'),auth[_0xe47e('0x6')](),controller[_0xe47e('0xb')]);router[_0xe47e('0xc')]('/',auth[_0xe47e('0x6')](),interaction[_0xe47e('0xd')]('chat',_0xe47e('0xe')),controller[_0xe47e('0xf')]);router[_0xe47e('0x10')](_0xe47e('0xa'),controller[_0xe47e('0x11')]);router[_0xe47e('0x10')](_0xe47e('0x12'),auth[_0xe47e('0x6')](),controller['accept']);router[_0xe47e('0x10')](_0xe47e('0x13'),auth[_0xe47e('0x6')](),controller[_0xe47e('0x14')]);router[_0xe47e('0x15')](_0xe47e('0xa'),auth[_0xe47e('0x6')](),controller[_0xe47e('0x16')]);module[_0xe47e('0x17')]=router;
\ No newline at end of file
+var _0xff0e=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','show','tracked','chatmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer'];(function(_0x17ba32,_0x313e0f){var _0x57507d=function(_0x4f5c0b){while(--_0x4f5c0b){_0x17ba32['push'](_0x17ba32['shift']());}};_0x57507d(++_0x313e0f);}(_0xff0e,0x14f));var _0xeff0=function(_0x5d646f,_0x46f0fa){_0x5d646f=_0x5d646f-0x0;var _0x4c2e7b=_0xff0e[_0x5d646f];return _0x4c2e7b;};'use strict';var multer=require(_0xeff0('0x0'));var util=require(_0xeff0('0x1'));var path=require(_0xeff0('0x2'));var timeout=require('connect-timeout');var express=require(_0xeff0('0x3'));var router=express[_0xeff0('0x4')]();var fs_extra=require(_0xeff0('0x5'));var auth=require(_0xeff0('0x6'));var interaction=require(_0xeff0('0x7'));var config=require(_0xeff0('0x8'));var controller=require(_0xeff0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xeff0('0xa')]);router[_0xeff0('0xb')](_0xeff0('0xc'),auth[_0xeff0('0xd')](),controller[_0xeff0('0xe')]);router[_0xeff0('0xb')]('/:id',auth[_0xeff0('0xd')](),controller[_0xeff0('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xeff0('0x10')]('chat',_0xeff0('0x11')),controller[_0xeff0('0x12')]);router['put'](_0xeff0('0x13'),controller[_0xeff0('0x14')]);router[_0xeff0('0x15')](_0xeff0('0x16'),auth[_0xeff0('0xd')](),controller[_0xeff0('0x17')]);router['put'](_0xeff0('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0xeff0('0x19')](_0xeff0('0x13'),auth[_0xeff0('0xd')](),controller[_0xeff0('0x1a')]);module[_0xeff0('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 5ddd42d..d74322f 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 _0x189c=['medium','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x189c,0x73));var _0xc189=function(_0x48a61c,_0x408259){_0x48a61c=_0x48a61c-0x0;var _0x195bb7=_0x189c[_0x48a61c];return _0x195bb7;};'use strict';var Sequelize=require('sequelize');module[_0xc189('0x0')]={'body':{'type':Sequelize[_0xc189('0x1')](_0xc189('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x8339=['sequelize','exports','TEXT','medium'];(function(_0x3378f1,_0x460be2){var _0x24280b=function(_0x5c03a0){while(--_0x5c03a0){_0x3378f1['push'](_0x3378f1['shift']());}};_0x24280b(++_0x460be2);}(_0x8339,0x180));var _0x9833=function(_0x50392,_0x5f2c41){_0x50392=_0x50392-0x0;var _0x11d87b=_0x8339[_0x50392];return _0x11d87b;};'use strict';var Sequelize=require(_0x9833('0x0'));module[_0x9833('0x1')]={'body':{'type':Sequelize[_0x9833('0x2')](_0x9833('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index da4d603..86e955f 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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a54,0x106));var _0x47a5=function(_0x517fba,_0x475b9d){_0x517fba=_0x517fba-0x0;var _0xbcbd53=_0x7a54[_0x517fba];return _0xbcbd53;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x395ac6,_0x30f7ec){var _0x4013e6=function(_0xce25b7){while(--_0xce25b7){_0x395ac6['push'](_0x395ac6['shift']());}};_0x4013e6(++_0x30f7ec);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3589685..535ae72 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 _0x6b97=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x6b97,0x10f));var _0x76b9=function(_0x4c6f81,_0x4e469a){_0x4c6f81=_0x4c6f81-0x0;var _0x1cd596=_0x6b97[_0x4c6f81];return _0x1cd596;};'use strict';var _=require(_0x76b9('0x0'));var util=require(_0x76b9('0x1'));var logger=require(_0x76b9('0x2'))(_0x76b9('0x3'));var moment=require(_0x76b9('0x4'));var BPromise=require(_0x76b9('0x5'));var rp=require(_0x76b9('0x6'));var fs=require('fs');var path=require(_0x76b9('0x7'));var rimraf=require('rimraf');var config=require(_0x76b9('0x8'));var attributes=require(_0x76b9('0x9'));module[_0x76b9('0xa')]=function(_0x43a60c,_0x48f32e){return _0x43a60c[_0x76b9('0xb')](_0x76b9('0xc'),attributes,{'tableName':_0x76b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76b9('0xe'),'collate':_0x76b9('0xf')});};
\ No newline at end of file
+var _0xc1ea=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','api','request-promise'];(function(_0xce81ae,_0x59901b){var _0x1fabce=function(_0x417001){while(--_0x417001){_0xce81ae['push'](_0xce81ae['shift']());}};_0x1fabce(++_0x59901b);}(_0xc1ea,0x72));var _0xac1e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc1ea[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xac1e('0x0'));var logger=require('../../config/logger')(_0xac1e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac1e('0x2'));var fs=require('fs');var path=require(_0xac1e('0x3'));var rimraf=require(_0xac1e('0x4'));var config=require(_0xac1e('0x5'));var attributes=require(_0xac1e('0x6'));module[_0xac1e('0x7')]=function(_0x339b26,_0x35df04){return _0x339b26[_0xac1e('0x8')](_0xac1e('0x9'),attributes,{'tableName':_0xac1e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac1e('0xb'),'collate':_0xac1e('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c24102e..5f23c41 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 _0x7497=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','request\x20sent','debug','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7497,0xef));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var moment=require(_0x7749('0x2'));var BPromise=require(_0x7749('0x3'));var rs=require(_0x7749('0x4'));var fs=require('fs');var Redis=require(_0x7749('0x5'));var db=require(_0x7749('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7749('0x7'))(_0x7749('0x8'));var config=require('../../config/environment');var jayson=require(_0x7749('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57fe27,_0x22baac,_0x5d9226){return new BPromise(function(_0x960185,_0x2c95e9){return client['request'](_0x57fe27,_0x5d9226)[_0x7749('0xa')](function(_0x582b3a){logger[_0x7749('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x22baac,_0x7749('0xc'));logger[_0x7749('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x22baac,_0x7749('0xc'),JSON[_0x7749('0xe')](_0x582b3a));if(_0x582b3a[_0x7749('0xf')]){if(_0x582b3a['error']['code']===0x1f4){logger['error'](_0x7749('0x10'),_0x22baac,_0x582b3a[_0x7749('0xf')]['message']);return _0x2c95e9(_0x582b3a[_0x7749('0xf')][_0x7749('0x11')]);}logger[_0x7749('0xf')](_0x7749('0x10'),_0x22baac,_0x582b3a[_0x7749('0xf')]['message']);return _0x960185(_0x582b3a['error']['message']);}else{logger[_0x7749('0xb')](_0x7749('0x10'),_0x22baac,_0x7749('0xc'));_0x960185(_0x582b3a[_0x7749('0x12')][_0x7749('0x11')]);}})[_0x7749('0x13')](function(_0x3523fc){logger[_0x7749('0xf')](_0x7749('0x10'),_0x22baac,_0x3523fc);_0x2c95e9(_0x3523fc);});});}
\ No newline at end of file
+var _0x84e6=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x84e6,0x8f));var _0x684e=function(_0x2738ac,_0x4fe397){_0x2738ac=_0x2738ac-0x0;var _0x58d83e=_0x84e6[_0x2738ac];return _0x58d83e;};'use strict';var _=require(_0x684e('0x0'));var util=require(_0x684e('0x1'));var moment=require(_0x684e('0x2'));var BPromise=require(_0x684e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x684e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x684e('0x5'));var config=require(_0x684e('0x6'));var jayson=require(_0x684e('0x7'));var client=jayson['client'][_0x684e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x532dc8,_0x3da98b,_0x5873a7){return new BPromise(function(_0x51ccc3,_0xe89252){return client[_0x684e('0x9')](_0x532dc8,_0x5873a7)[_0x684e('0xa')](function(_0x23b771){logger[_0x684e('0xb')](_0x684e('0xc'),_0x3da98b,_0x684e('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3da98b,_0x684e('0xd'),JSON[_0x684e('0xe')](_0x23b771));if(_0x23b771['error']){if(_0x23b771[_0x684e('0xf')][_0x684e('0x10')]===0x1f4){logger['error'](_0x684e('0xc'),_0x3da98b,_0x23b771['error'][_0x684e('0x11')]);return _0xe89252(_0x23b771[_0x684e('0xf')][_0x684e('0x11')]);}logger[_0x684e('0xf')](_0x684e('0xc'),_0x3da98b,_0x23b771[_0x684e('0xf')][_0x684e('0x11')]);return _0x51ccc3(_0x23b771[_0x684e('0xf')][_0x684e('0x11')]);}else{logger[_0x684e('0xb')](_0x684e('0xc'),_0x3da98b,_0x684e('0xd'));_0x51ccc3(_0x23b771[_0x684e('0x12')][_0x684e('0x11')]);}})[_0x684e('0x13')](function(_0x8fa67b){logger[_0x684e('0xf')](_0x684e('0xc'),_0x3da98b,_0x8fa67b);_0xe89252(_0x8fa67b);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 8bd817e..d675243 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 _0x6deb=['fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x236255,_0x14d612){var _0x43ac8f=function(_0x3e9472){while(--_0x3e9472){_0x236255['push'](_0x236255['shift']());}};_0x43ac8f(++_0x14d612);}(_0x6deb,0x153));var _0xb6de=function(_0x3c4bf6,_0x2a503b){_0x3c4bf6=_0x3c4bf6-0x0;var _0x4546b1=_0x6deb[_0x3c4bf6];return _0x4546b1;};'use strict';var multer=require(_0xb6de('0x0'));var util=require(_0xb6de('0x1'));var path=require(_0xb6de('0x2'));var timeout=require(_0xb6de('0x3'));var express=require(_0xb6de('0x4'));var router=express[_0xb6de('0x5')]();var fs_extra=require(_0xb6de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb6de('0x7'));var config=require(_0xb6de('0x8'));var controller=require(_0xb6de('0x9'));router['get']('/',auth[_0xb6de('0xa')](),controller[_0xb6de('0xb')]);router[_0xb6de('0xc')](_0xb6de('0xd'),auth[_0xb6de('0xa')](),controller[_0xb6de('0xe')]);router[_0xb6de('0xc')](_0xb6de('0xf'),auth[_0xb6de('0xa')](),controller[_0xb6de('0x10')]);router['post']('/',auth[_0xb6de('0xa')](),controller[_0xb6de('0x11')]);router[_0xb6de('0x12')](_0xb6de('0xf'),auth[_0xb6de('0xa')](),controller[_0xb6de('0x13')]);router[_0xb6de('0x14')](_0xb6de('0xf'),auth['isAuthenticated'](),controller[_0xb6de('0x15')]);module[_0xb6de('0x16')]=router;
\ No newline at end of file
+var _0xff58=['create','put','update','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post'];(function(_0x1167a7,_0xe68920){var _0x2ea2b1=function(_0xc3f4ec){while(--_0xc3f4ec){_0x1167a7['push'](_0x1167a7['shift']());}};_0x2ea2b1(++_0xe68920);}(_0xff58,0xcc));var _0x8ff5=function(_0x19d6f2,_0x38aee2){_0x19d6f2=_0x19d6f2-0x0;var _0x3a44b2=_0xff58[_0x19d6f2];return _0x3a44b2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ff5('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8ff5('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x8ff5('0x2'));var interaction=require(_0x8ff5('0x3'));var config=require(_0x8ff5('0x4'));var controller=require(_0x8ff5('0x5'));router[_0x8ff5('0x6')]('/',auth[_0x8ff5('0x7')](),controller['index']);router['get'](_0x8ff5('0x8'),auth[_0x8ff5('0x7')](),controller[_0x8ff5('0x9')]);router['get'](_0x8ff5('0xa'),auth[_0x8ff5('0x7')](),controller['show']);router[_0x8ff5('0xb')]('/',auth[_0x8ff5('0x7')](),controller[_0x8ff5('0xc')]);router[_0x8ff5('0xd')](_0x8ff5('0xa'),auth[_0x8ff5('0x7')](),controller[_0x8ff5('0xe')]);router[_0x8ff5('0xf')](_0x8ff5('0xa'),auth[_0x8ff5('0x7')](),controller[_0x8ff5('0x10')]);module[_0x8ff5('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1e1b807..abeeb25 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 _0x0447=['INTEGER','sequelize','STRING','ENUM','timeout','mouseOver'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x0447,0x1b1));var _0x7044=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0x0447[_0x3662b4];return _0x50928c;};'use strict';var Sequelize=require(_0x7044('0x0'));module['exports']={'name':{'type':Sequelize[_0x7044('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7044('0x2')]('mouseOver',_0x7044('0x3')),'defaultValue':_0x7044('0x4')},'selector':{'type':Sequelize[_0x7044('0x1')]},'timeout':{'type':Sequelize[_0x7044('0x5')]}};
\ No newline at end of file
+var _0x86c8=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x86c8,0x18b));var _0x886c=function(_0x55d0ab,_0x3d06c2){_0x55d0ab=_0x55d0ab-0x0;var _0x1f146c=_0x86c8[_0x55d0ab];return _0x1f146c;};'use strict';var Sequelize=require(_0x886c('0x0'));module[_0x886c('0x1')]={'name':{'type':Sequelize[_0x886c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x886c('0x3')](_0x886c('0x4'),_0x886c('0x5')),'defaultValue':_0x886c('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x886c('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d12cbcb..6ff3ecd 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 _0xc01b=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc01b,0x65));var _0xbc01=function(_0x2e13bc,_0x278c20){_0x2e13bc=_0x2e13bc-0x0;var _0x4da086=_0xc01b[_0x2e13bc];return _0x4da086;};'use strict';var emlformat=require(_0xbc01('0x0'));var rimraf=require(_0xbc01('0x1'));var zipdir=require(_0xbc01('0x2'));var jsonpatch=require(_0xbc01('0x3'));var rp=require('request-promise');var moment=require(_0xbc01('0x4'));var BPromise=require(_0xbc01('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbc01('0x6'));var csv=require(_0xbc01('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc01('0x8'));var squel=require(_0xbc01('0x9'));var crypto=require(_0xbc01('0xa'));var jsforce=require(_0xbc01('0xb'));var deskjs=require(_0xbc01('0xc'));var toCsv=require(_0xbc01('0x7'));var querystring=require(_0xbc01('0xd'));var Papa=require('papaparse');var Redis=require(_0xbc01('0xe'));var authService=require(_0xbc01('0xf'));var qs=require(_0xbc01('0x10'));var as=require(_0xbc01('0x11'));var hardwareService=require(_0xbc01('0x12'));var logger=require(_0xbc01('0x13'))(_0xbc01('0x14'));var utils=require(_0xbc01('0x15'));var config=require(_0xbc01('0x16'));var licenseUtil=require(_0xbc01('0x17'));var db=require(_0xbc01('0x18'))['db'];function respondWithStatusCode(_0x13d9ff,_0x403af3){_0x403af3=_0x403af3||0xcc;return function(_0x2d3cc4){if(_0x2d3cc4){return _0x13d9ff['sendStatus'](_0x403af3);}return _0x13d9ff[_0xbc01('0x19')](_0x403af3)[_0xbc01('0x1a')]();};}function respondWithResult(_0xfc7e92,_0x5de273){_0x5de273=_0x5de273||0xc8;return function(_0x20aedd){if(_0x20aedd){return _0xfc7e92[_0xbc01('0x19')](_0x5de273)['json'](_0x20aedd);}};}function respondWithFilteredResult(_0x3d3fe6,_0x30a0fe){return function(_0x45736c){if(_0x45736c){var _0xf61d88=typeof _0x30a0fe['offset']==='undefined'&&typeof _0x30a0fe[_0xbc01('0x1b')]===_0xbc01('0x1c');var _0x47b5b2=_0x45736c[_0xbc01('0x1d')];var _0x48c750=_0xf61d88?0x0:_0x30a0fe[_0xbc01('0x1e')];var _0x21821a=_0xf61d88?_0x45736c[_0xbc01('0x1d')]:_0x30a0fe[_0xbc01('0x1e')]+_0x30a0fe['limit'];var _0x17cc53;if(_0x21821a>=_0x47b5b2){_0x21821a=_0x47b5b2;_0x17cc53=0xc8;}else{_0x17cc53=0xce;}_0x3d3fe6[_0xbc01('0x19')](_0x17cc53);return _0x3d3fe6[_0xbc01('0x1f')]('Content-Range',_0x48c750+'-'+_0x21821a+'/'+_0x47b5b2)[_0xbc01('0x20')](_0x45736c);}return null;};}function patchUpdates(_0x121670){return function(_0x4a944c){try{jsonpatch['apply'](_0x4a944c,_0x121670,!![]);}catch(_0x4a9656){return BPromise[_0xbc01('0x21')](_0x4a9656);}return _0x4a944c[_0xbc01('0x22')]();};}function saveUpdates(_0x3ae9d6,_0x1299a7){return function(_0x23d4f0){if(_0x23d4f0){return _0x23d4f0[_0xbc01('0x23')](_0x3ae9d6)['then'](function(_0x77a41a){return _0x77a41a;});}return null;};}function removeEntity(_0x5b283b,_0x230ae9){return function(_0x535ad7){if(_0x535ad7){return _0x535ad7[_0xbc01('0x24')]()[_0xbc01('0x25')](function(){_0x5b283b[_0xbc01('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf13b08,_0xd90813){return function(_0x56383f){if(!_0x56383f){_0xf13b08[_0xbc01('0x26')](0x194);}return _0x56383f;};}function handleError(_0x23c9f8,_0x1097f6){_0x1097f6=_0x1097f6||0x1f4;return function(_0x14dbcb){logger[_0xbc01('0x27')](_0x14dbcb[_0xbc01('0x28')]);if(_0x14dbcb[_0xbc01('0x29')]){delete _0x14dbcb[_0xbc01('0x29')];}_0x23c9f8[_0xbc01('0x19')](_0x1097f6)[_0xbc01('0x2a')](_0x14dbcb);};}exports[_0xbc01('0x2b')]=function(_0x5778d7,_0x305628){var _0x46d0de={'raw':!![],'where':{'id':_0x5778d7[_0xbc01('0x2c')]['id']}},_0x1a146f={};_0x1a146f[_0xbc01('0x2d')]=_[_0xbc01('0x2e')](db[_0xbc01('0x2f')]['rawAttributes']);_0x1a146f[_0xbc01('0x30')]=_['keys'](_0x5778d7[_0xbc01('0x30')]);_0x1a146f[_0xbc01('0x31')]=_['intersection'](_0x1a146f[_0xbc01('0x2d')],_0x1a146f[_0xbc01('0x30')]);_0x46d0de['attributes']=_[_0xbc01('0x32')](_0x1a146f[_0xbc01('0x2d')],qs[_0xbc01('0x33')](_0x5778d7['query'][_0xbc01('0x33')]));_0x46d0de[_0xbc01('0x34')]=_0x46d0de[_0xbc01('0x34')][_0xbc01('0x35')]?_0x46d0de[_0xbc01('0x34')]:_0x1a146f['model'];if(_0x5778d7[_0xbc01('0x30')][_0xbc01('0x36')]){_0x46d0de['include']=[{'all':!![]}];}_0x46d0de=_[_0xbc01('0x37')]({},_0x46d0de,_0x5778d7[_0xbc01('0x38')]);return db[_0xbc01('0x2f')][_0xbc01('0x39')](_0x46d0de)[_0xbc01('0x25')](handleEntityNotFound(_0x305628,null))[_0xbc01('0x25')](respondWithResult(_0x305628,null))[_0xbc01('0x3a')](handleError(_0x305628,null));};exports[_0xbc01('0x3b')]=function(_0xdfbe96,_0x2b64c6){return db[_0xbc01('0x2f')]['create'](_0xdfbe96[_0xbc01('0x3c')],{})[_0xbc01('0x25')](respondWithResult(_0x2b64c6,0xc9))['catch'](handleError(_0x2b64c6,null));};exports[_0xbc01('0x23')]=function(_0x308503,_0x4b639c){if(_0x308503[_0xbc01('0x3c')]['id']){delete _0x308503[_0xbc01('0x3c')]['id'];}return db[_0xbc01('0x2f')][_0xbc01('0x39')]({'where':{'id':_0x308503[_0xbc01('0x2c')]['id']}})[_0xbc01('0x25')](handleEntityNotFound(_0x4b639c,null))[_0xbc01('0x25')](saveUpdates(_0x308503[_0xbc01('0x3c')],null))[_0xbc01('0x25')](respondWithResult(_0x4b639c,null))[_0xbc01('0x3a')](handleError(_0x4b639c,null));};exports[_0xbc01('0x24')]=function(_0x575de2,_0x3fabda){return db['ChatProactiveAction'][_0xbc01('0x39')]({'where':{'id':_0x575de2[_0xbc01('0x2c')]['id']}})[_0xbc01('0x25')](handleEntityNotFound(_0x3fabda,null))[_0xbc01('0x25')](removeEntity(_0x3fabda,null))[_0xbc01('0x3a')](handleError(_0x3fabda,null));};
\ No newline at end of file
+var _0xf360=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','name','send','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2fe68d,_0x50f0e0){var _0x32c10f=function(_0x53a79c){while(--_0x53a79c){_0x2fe68d['push'](_0x2fe68d['shift']());}};_0x32c10f(++_0x50f0e0);}(_0xf360,0x9e));var _0x0f36=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf360[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x0f36('0x0'));var rimraf=require(_0x0f36('0x1'));var zipdir=require(_0x0f36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f36('0x3'));var moment=require('moment');var BPromise=require(_0x0f36('0x4'));var Mustache=require(_0x0f36('0x5'));var util=require(_0x0f36('0x6'));var path=require('path');var sox=require(_0x0f36('0x7'));var csv=require(_0x0f36('0x8'));var ejs=require(_0x0f36('0x9'));var fs=require('fs');var fs_extra=require(_0x0f36('0xa'));var _=require(_0x0f36('0xb'));var squel=require(_0x0f36('0xc'));var crypto=require(_0x0f36('0xd'));var jsforce=require(_0x0f36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f36('0x8'));var querystring=require(_0x0f36('0xf'));var Papa=require(_0x0f36('0x10'));var Redis=require(_0x0f36('0x11'));var authService=require(_0x0f36('0x12'));var qs=require(_0x0f36('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f36('0x14'));var logger=require(_0x0f36('0x15'))(_0x0f36('0x16'));var utils=require('../../config/utils');var config=require(_0x0f36('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x478313,_0xea1040){_0xea1040=_0xea1040||0xcc;return function(_0x4e30cc){if(_0x4e30cc){return _0x478313[_0x0f36('0x18')](_0xea1040);}return _0x478313[_0x0f36('0x19')](_0xea1040)[_0x0f36('0x1a')]();};}function respondWithResult(_0xb021c,_0x5dee19){_0x5dee19=_0x5dee19||0xc8;return function(_0x1a06cc){if(_0x1a06cc){return _0xb021c['status'](_0x5dee19)[_0x0f36('0x1b')](_0x1a06cc);}};}function respondWithFilteredResult(_0x19afe8,_0x420baf){return function(_0x38e64a){if(_0x38e64a){var _0x167825=typeof _0x420baf[_0x0f36('0x1c')]===_0x0f36('0x1d')&&typeof _0x420baf['limit']==='undefined';var _0x2f26d2=_0x38e64a[_0x0f36('0x1e')];var _0x4b48eb=_0x167825?0x0:_0x420baf['offset'];var _0x121ff3=_0x167825?_0x38e64a[_0x0f36('0x1e')]:_0x420baf['offset']+_0x420baf[_0x0f36('0x1f')];var _0x28eaf2;if(_0x121ff3>=_0x2f26d2){_0x121ff3=_0x2f26d2;_0x28eaf2=0xc8;}else{_0x28eaf2=0xce;}_0x19afe8['status'](_0x28eaf2);return _0x19afe8[_0x0f36('0x20')]('Content-Range',_0x4b48eb+'-'+_0x121ff3+'/'+_0x2f26d2)['json'](_0x38e64a);}return null;};}function patchUpdates(_0x2f7972){return function(_0x1b365a){try{jsonpatch['apply'](_0x1b365a,_0x2f7972,!![]);}catch(_0x5888c5){return BPromise[_0x0f36('0x21')](_0x5888c5);}return _0x1b365a[_0x0f36('0x22')]();};}function saveUpdates(_0x5c15d9,_0x249b7a){return function(_0x567814){if(_0x567814){return _0x567814[_0x0f36('0x23')](_0x5c15d9)['then'](function(_0x2eb5be){return _0x2eb5be;});}return null;};}function removeEntity(_0x21837e,_0x15722f){return function(_0x552d90){if(_0x552d90){return _0x552d90[_0x0f36('0x24')]()[_0x0f36('0x25')](function(){_0x21837e[_0x0f36('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e7ee5,_0x23050c){return function(_0x264639){if(!_0x264639){_0x2e7ee5[_0x0f36('0x18')](0x194);}return _0x264639;};}function handleError(_0x55b849,_0x20c2e7){_0x20c2e7=_0x20c2e7||0x1f4;return function(_0x5aaa73){logger[_0x0f36('0x26')](_0x5aaa73['stack']);if(_0x5aaa73[_0x0f36('0x27')]){delete _0x5aaa73[_0x0f36('0x27')];}_0x55b849[_0x0f36('0x19')](_0x20c2e7)[_0x0f36('0x28')](_0x5aaa73);};}exports['show']=function(_0x398dcd,_0x597c6c){var _0x1eacbb={'raw':!![],'where':{'id':_0x398dcd[_0x0f36('0x29')]['id']}},_0x438e29={};_0x438e29[_0x0f36('0x2a')]=_[_0x0f36('0x2b')](db['ChatProactiveAction'][_0x0f36('0x2c')]);_0x438e29[_0x0f36('0x2d')]=_[_0x0f36('0x2b')](_0x398dcd[_0x0f36('0x2d')]);_0x438e29[_0x0f36('0x2e')]=_['intersection'](_0x438e29['model'],_0x438e29[_0x0f36('0x2d')]);_0x1eacbb[_0x0f36('0x2f')]=_[_0x0f36('0x30')](_0x438e29[_0x0f36('0x2a')],qs[_0x0f36('0x31')](_0x398dcd['query'][_0x0f36('0x31')]));_0x1eacbb['attributes']=_0x1eacbb[_0x0f36('0x2f')]['length']?_0x1eacbb[_0x0f36('0x2f')]:_0x438e29['model'];if(_0x398dcd[_0x0f36('0x2d')][_0x0f36('0x32')]){_0x1eacbb[_0x0f36('0x33')]=[{'all':!![]}];}_0x1eacbb=_[_0x0f36('0x34')]({},_0x1eacbb,_0x398dcd[_0x0f36('0x35')]);return db[_0x0f36('0x36')][_0x0f36('0x37')](_0x1eacbb)[_0x0f36('0x25')](handleEntityNotFound(_0x597c6c,null))[_0x0f36('0x25')](respondWithResult(_0x597c6c,null))[_0x0f36('0x38')](handleError(_0x597c6c,null));};exports[_0x0f36('0x39')]=function(_0x44c878,_0x2993b1){return db[_0x0f36('0x36')][_0x0f36('0x39')](_0x44c878[_0x0f36('0x3a')],{})['then'](respondWithResult(_0x2993b1,0xc9))[_0x0f36('0x38')](handleError(_0x2993b1,null));};exports['update']=function(_0x335bb2,_0x395bf5){if(_0x335bb2['body']['id']){delete _0x335bb2[_0x0f36('0x3a')]['id'];}return db[_0x0f36('0x36')]['find']({'where':{'id':_0x335bb2[_0x0f36('0x29')]['id']}})[_0x0f36('0x25')](handleEntityNotFound(_0x395bf5,null))[_0x0f36('0x25')](saveUpdates(_0x335bb2['body'],null))['then'](respondWithResult(_0x395bf5,null))[_0x0f36('0x38')](handleError(_0x395bf5,null));};exports[_0x0f36('0x24')]=function(_0x24fbfa,_0xf0bc4e){return db[_0x0f36('0x36')]['find']({'where':{'id':_0x24fbfa[_0x0f36('0x29')]['id']}})['then'](handleEntityNotFound(_0xf0bc4e,null))['then'](removeEntity(_0xf0bc4e,null))[_0x0f36('0x38')](handleError(_0xf0bc4e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index acc0175..70541d4 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 _0xb363=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24aaa2,_0x54935a){var _0x3bf1dc=function(_0x3a4d8d){while(--_0x3a4d8d){_0x24aaa2['push'](_0x24aaa2['shift']());}};_0x3bf1dc(++_0x54935a);}(_0xb363,0x1ac));var _0x3b36=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb363[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x3b36('0x0'));var util=require(_0x3b36('0x1'));var logger=require(_0x3b36('0x2'))(_0x3b36('0x3'));var moment=require(_0x3b36('0x4'));var BPromise=require(_0x3b36('0x5'));var rp=require(_0x3b36('0x6'));var fs=require('fs');var path=require(_0x3b36('0x7'));var rimraf=require(_0x3b36('0x8'));var config=require(_0x3b36('0x9'));var attributes=require(_0x3b36('0xa'));module[_0x3b36('0xb')]=function(_0x17ab6d,_0x2acb42){return _0x17ab6d[_0x3b36('0xc')]('ChatProactiveAction',attributes,{'tableName':_0x3b36('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa754=['../../config/logger','api','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util'];(function(_0x3ea022,_0x2d5328){var _0x3b97a2=function(_0x351179){while(--_0x351179){_0x3ea022['push'](_0x3ea022['shift']());}};_0x3b97a2(++_0x2d5328);}(_0xa754,0x111));var _0x4a75=function(_0x2c5e5d,_0x1800d5){_0x2c5e5d=_0x2c5e5d-0x0;var _0x55f67b=_0xa754[_0x2c5e5d];return _0x55f67b;};'use strict';var _=require(_0x4a75('0x0'));var util=require(_0x4a75('0x1'));var logger=require(_0x4a75('0x2'))(_0x4a75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a75('0x4'));var fs=require('fs');var path=require(_0x4a75('0x5'));var rimraf=require(_0x4a75('0x6'));var config=require('../../config/environment');var attributes=require(_0x4a75('0x7'));module[_0x4a75('0x8')]=function(_0x4418f4,_0x1bdba0){return _0x4418f4[_0x4a75('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x4a75('0xa'),'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 1cde812..083966d 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 _0xa7f2=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7f2,0x197));var _0x2a7f=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0xa7f2[_0x134448];return _0x2d52a1;};'use strict';var _=require(_0x2a7f('0x0'));var util=require(_0x2a7f('0x1'));var moment=require(_0x2a7f('0x2'));var BPromise=require(_0x2a7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a7f('0x4'));var db=require(_0x2a7f('0x5'))['db'];var utils=require(_0x2a7f('0x6'));var logger=require(_0x2a7f('0x7'))(_0x2a7f('0x8'));var config=require(_0x2a7f('0x9'));var jayson=require(_0x2a7f('0xa'));var client=jayson[_0x2a7f('0xb')][_0x2a7f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc94ab8,_0x274f95,_0x49525){return new BPromise(function(_0x1137a0,_0x1eea1b){return client[_0x2a7f('0xd')](_0xc94ab8,_0x49525)['then'](function(_0x5cff9f){logger[_0x2a7f('0xe')](_0x2a7f('0xf'),_0x274f95,_0x2a7f('0x10'));logger['debug'](_0x2a7f('0x11'),_0x274f95,'request\x20sent',JSON[_0x2a7f('0x12')](_0x5cff9f));if(_0x5cff9f[_0x2a7f('0x13')]){if(_0x5cff9f[_0x2a7f('0x13')][_0x2a7f('0x14')]===0x1f4){logger[_0x2a7f('0x13')](_0x2a7f('0xf'),_0x274f95,_0x5cff9f['error'][_0x2a7f('0x15')]);return _0x1eea1b(_0x5cff9f[_0x2a7f('0x13')][_0x2a7f('0x15')]);}logger[_0x2a7f('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x274f95,_0x5cff9f[_0x2a7f('0x13')][_0x2a7f('0x15')]);return _0x1137a0(_0x5cff9f['error'][_0x2a7f('0x15')]);}else{logger[_0x2a7f('0xe')](_0x2a7f('0xf'),_0x274f95,_0x2a7f('0x10'));_0x1137a0(_0x5cff9f[_0x2a7f('0x16')][_0x2a7f('0x15')]);}})[_0x2a7f('0x17')](function(_0xf9e84d){logger['error'](_0x2a7f('0xf'),_0x274f95,_0xf9e84d);_0x1eea1b(_0xf9e84d);});});}
\ No newline at end of file
+var _0x8607=['rpc','../../config/environment','jayson/promise','request','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../config/utils'];(function(_0x30c164,_0x1a7aeb){var _0x582a06=function(_0x4a53e6){while(--_0x4a53e6){_0x30c164['push'](_0x30c164['shift']());}};_0x582a06(++_0x1a7aeb);}(_0x8607,0x187));var _0x7860=function(_0x249917,_0x1cbf2a){_0x249917=_0x249917-0x0;var _0x488d1b=_0x8607[_0x249917];return _0x488d1b;};'use strict';var _=require(_0x7860('0x0'));var util=require(_0x7860('0x1'));var moment=require(_0x7860('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7860('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7860('0x4'));var logger=require('../../config/logger')(_0x7860('0x5'));var config=require(_0x7860('0x6'));var jayson=require(_0x7860('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30fdf1,_0x386721,_0x563e1b){return new BPromise(function(_0x2e58c2,_0x5bda1d){return client[_0x7860('0x8')](_0x30fdf1,_0x563e1b)['then'](function(_0x22c7ac){logger[_0x7860('0x9')]('ChatProactiveAction,\x20%s,\x20%s',_0x386721,'request\x20sent');logger[_0x7860('0xa')](_0x7860('0xb'),_0x386721,_0x7860('0xc'),JSON[_0x7860('0xd')](_0x22c7ac));if(_0x22c7ac[_0x7860('0xe')]){if(_0x22c7ac[_0x7860('0xe')]['code']===0x1f4){logger['error'](_0x7860('0xf'),_0x386721,_0x22c7ac[_0x7860('0xe')][_0x7860('0x10')]);return _0x5bda1d(_0x22c7ac[_0x7860('0xe')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x386721,_0x22c7ac['error'][_0x7860('0x10')]);return _0x2e58c2(_0x22c7ac[_0x7860('0xe')]['message']);}else{logger[_0x7860('0x9')](_0x7860('0xf'),_0x386721,_0x7860('0xc'));_0x2e58c2(_0x22c7ac[_0x7860('0x11')]['message']);}})['catch'](function(_0x1c3e2d){logger['error'](_0x7860('0xf'),_0x386721,_0x1c3e2d);_0x5bda1d(_0x1c3e2d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7ae80ba..f0b84e2 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 _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x2eb2[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x474035,_0x41e639){var _0x1b58e0=function(_0x91b15c){while(--_0x91b15c){_0x474035['push'](_0x474035['shift']());}};_0x1b58e0(++_0x41e639);}(_0x46ed,0x168));var _0xd46e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46ed[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('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 50c80eb..22202c5 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 _0x7ad4=['name','INTEGER','ENUM','rrmemory','roundrobin','exports','STRING'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7ad4,0x67));var _0x47ad=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7ad4[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x47ad('0x0')]={'name':{'type':Sequelize[_0x47ad('0x1')],'unique':_0x47ad('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x47ad('0x1')]},'timeout':{'type':Sequelize[_0x47ad('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x47ad('0x4')](_0x47ad('0x5'),'beepall',_0x47ad('0x6'))}};
\ No newline at end of file
+var _0x28af=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x10f0a5,_0x42ecec){var _0x1849cb=function(_0x251640){while(--_0x251640){_0x10f0a5['push'](_0x10f0a5['shift']());}};_0x1849cb(++_0x42ecec);}(_0x28af,0xcc));var _0xf28a=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x28af[_0x347471];return _0x422b6a;};'use strict';var Sequelize=require(_0xf28a('0x0'));module[_0xf28a('0x1')]={'name':{'type':Sequelize[_0xf28a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf28a('0x2')]},'timeout':{'type':Sequelize[_0xf28a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf28a('0x4')](_0xf28a('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 34404f4..4152038 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 _0xb7f6=['from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','localhost','redis','./chatQueue.socket','register','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','destroy','get','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','nolimit','pick','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select'];(function(_0x1c0fb3,_0x4b9992){var _0x8b5c4a=function(_0x214596){while(--_0x214596){_0x1c0fb3['push'](_0x1c0fb3['shift']());}};_0x8b5c4a(++_0x4b9992);}(_0xb7f6,0x141));var _0x6b7f=function(_0x38f8f2,_0xf4caa5){_0x38f8f2=_0x38f8f2-0x0;var _0x39d1ae=_0xb7f6[_0x38f8f2];return _0x39d1ae;};'use strict';var emlformat=require(_0x6b7f('0x0'));var rimraf=require(_0x6b7f('0x1'));var zipdir=require(_0x6b7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b7f('0x3'));var moment=require('moment');var BPromise=require(_0x6b7f('0x4'));var Mustache=require(_0x6b7f('0x5'));var util=require(_0x6b7f('0x6'));var path=require('path');var sox=require(_0x6b7f('0x7'));var csv=require('to-csv');var ejs=require(_0x6b7f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b7f('0x9'));var squel=require(_0x6b7f('0xa'));var crypto=require(_0x6b7f('0xb'));var jsforce=require(_0x6b7f('0xc'));var deskjs=require(_0x6b7f('0xd'));var toCsv=require(_0x6b7f('0xe'));var querystring=require(_0x6b7f('0xf'));var Papa=require(_0x6b7f('0x10'));var Redis=require(_0x6b7f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b7f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b7f('0x13'));var utils=require('../../config/utils');var config=require(_0x6b7f('0x14'));var licenseUtil=require(_0x6b7f('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6b7f('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b7f('0x17')]));require(_0x6b7f('0x18'))[_0x6b7f('0x19')](socket);var jayson=require(_0x6b7f('0x1a'));var client=jayson[_0x6b7f('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0xac2384,_0x3f7977,_0x55755b,_0x564a28){return new BPromise(function(_0x234cca,_0x347b11){var _0x38df9d=_0x564a28||client;return _0x38df9d['request'](_0xac2384,_0x55755b)[_0x6b7f('0x1c')](function(_0x5b1c54){logger['info'](_0x6b7f('0x1d'),_0x3f7977,_0x6b7f('0x1e'));logger[_0x6b7f('0x1f')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3f7977,_0x6b7f('0x1e'),JSON[_0x6b7f('0x20')](_0x5b1c54));if(_0x5b1c54[_0x6b7f('0x21')]){if(_0x5b1c54['error'][_0x6b7f('0x22')]===0x1f4){logger[_0x6b7f('0x21')](_0x6b7f('0x1d'),_0x3f7977,_0x5b1c54[_0x6b7f('0x21')][_0x6b7f('0x23')]);return _0x347b11(_0x5b1c54['error'][_0x6b7f('0x23')]);}logger[_0x6b7f('0x21')](_0x6b7f('0x1d'),_0x3f7977,_0x5b1c54[_0x6b7f('0x21')][_0x6b7f('0x23')]);return _0x234cca(_0x5b1c54[_0x6b7f('0x21')]['message']);}else{logger[_0x6b7f('0x24')](_0x6b7f('0x1d'),_0x3f7977,_0x6b7f('0x1e'));_0x234cca(_0x5b1c54[_0x6b7f('0x25')][_0x6b7f('0x23')]);}})[_0x6b7f('0x26')](function(_0x4902e7){logger['error'](_0x6b7f('0x1d'),_0x3f7977,_0x4902e7);_0x347b11(_0x4902e7);});});}function respondWithStatusCode(_0x2d2537,_0x51997f){_0x51997f=_0x51997f||0xcc;return function(_0x8c1f26){if(_0x8c1f26){return _0x2d2537['sendStatus'](_0x51997f);}return _0x2d2537[_0x6b7f('0x27')](_0x51997f)[_0x6b7f('0x28')]();};}function respondWithResult(_0x407eb9,_0x54f484){_0x54f484=_0x54f484||0xc8;return function(_0xaf8dc6){if(_0xaf8dc6){return _0x407eb9[_0x6b7f('0x27')](_0x54f484)['json'](_0xaf8dc6);}};}function respondWithFilteredResult(_0x1e43c1,_0x14ee19){return function(_0x487a3f){if(_0x487a3f){var _0x24a70b=typeof _0x14ee19['offset']===_0x6b7f('0x29')&&typeof _0x14ee19[_0x6b7f('0x2a')]==='undefined';var _0x1ebfe5=_0x487a3f[_0x6b7f('0x2b')];var _0x4e8b21=_0x24a70b?0x0:_0x14ee19[_0x6b7f('0x2c')];var _0x4fdeec=_0x24a70b?_0x487a3f[_0x6b7f('0x2b')]:_0x14ee19[_0x6b7f('0x2c')]+_0x14ee19[_0x6b7f('0x2a')];var _0x2aea88;if(_0x4fdeec>=_0x1ebfe5){_0x4fdeec=_0x1ebfe5;_0x2aea88=0xc8;}else{_0x2aea88=0xce;}_0x1e43c1['status'](_0x2aea88);return _0x1e43c1[_0x6b7f('0x2d')](_0x6b7f('0x2e'),_0x4e8b21+'-'+_0x4fdeec+'/'+_0x1ebfe5)[_0x6b7f('0x2f')](_0x487a3f);}return null;};}function patchUpdates(_0x6685f2){return function(_0x2da2a7){try{jsonpatch[_0x6b7f('0x30')](_0x2da2a7,_0x6685f2,!![]);}catch(_0x51b3f1){return BPromise[_0x6b7f('0x31')](_0x51b3f1);}return _0x2da2a7['save']();};}function saveUpdates(_0x205ecc,_0x3e5d92){return function(_0xf04a14){if(_0xf04a14){return _0xf04a14['update'](_0x205ecc)[_0x6b7f('0x1c')](function(_0x8d356a){return _0x8d356a;});}return null;};}function removeEntity(_0x52bbad,_0x4abef7){return function(_0x50c569){if(_0x50c569){return _0x50c569[_0x6b7f('0x32')]()[_0x6b7f('0x1c')](function(){var _0x475376=_0x50c569[_0x6b7f('0x33')]({'plain':!![]});var _0x5eb746='ChatQueues';return db[_0x6b7f('0x34')]['destroy']({'where':{'type':_0x5eb746,'resourceId':_0x475376['id']}})[_0x6b7f('0x1c')](function(){return _0x50c569;});})[_0x6b7f('0x1c')](function(){_0x52bbad['status'](0xcc)[_0x6b7f('0x28')]();});}};}function handleEntityNotFound(_0x1b9ef6,_0x4fa7f9){return function(_0xac1c36){if(!_0xac1c36){_0x1b9ef6['sendStatus'](0x194);}return _0xac1c36;};}function handleError(_0x344261,_0x1449a8){_0x1449a8=_0x1449a8||0x1f4;return function(_0x2d47d4){logger[_0x6b7f('0x21')](_0x2d47d4[_0x6b7f('0x35')]);if(_0x2d47d4[_0x6b7f('0x36')]){delete _0x2d47d4[_0x6b7f('0x36')];}_0x344261['status'](_0x1449a8)[_0x6b7f('0x37')](_0x2d47d4);};}exports['index']=function(_0x34accd,_0x18772c){var _0x1cec78={},_0x39db64={},_0x57327f={'count':0x0,'rows':[]};var _0x361284=_[_0x6b7f('0x38')](db[_0x6b7f('0x39')][_0x6b7f('0x3a')],function(_0x203cc8){return{'name':_0x203cc8[_0x6b7f('0x3b')],'type':_0x203cc8[_0x6b7f('0x3c')][_0x6b7f('0x3d')]};});_0x39db64[_0x6b7f('0x3e')]=_[_0x6b7f('0x38')](_0x361284,'name');_0x39db64['query']=_[_0x6b7f('0x3f')](_0x34accd['query']);_0x39db64[_0x6b7f('0x40')]=_[_0x6b7f('0x41')](_0x39db64['model'],_0x39db64[_0x6b7f('0x42')]);_0x1cec78['attributes']=_[_0x6b7f('0x41')](_0x39db64[_0x6b7f('0x3e')],qs[_0x6b7f('0x43')](_0x34accd[_0x6b7f('0x42')][_0x6b7f('0x43')]));_0x1cec78[_0x6b7f('0x44')]=_0x1cec78[_0x6b7f('0x44')][_0x6b7f('0x45')]?_0x1cec78[_0x6b7f('0x44')]:_0x39db64[_0x6b7f('0x3e')];if(!_0x34accd[_0x6b7f('0x42')][_0x6b7f('0x46')]('nolimit')){_0x1cec78[_0x6b7f('0x2a')]=qs['limit'](_0x34accd[_0x6b7f('0x42')][_0x6b7f('0x2a')]);_0x1cec78[_0x6b7f('0x2c')]=qs[_0x6b7f('0x2c')](_0x34accd['query']['offset']);}_0x1cec78[_0x6b7f('0x47')]=qs['sort'](_0x34accd[_0x6b7f('0x42')][_0x6b7f('0x48')]);_0x1cec78['where']=qs[_0x6b7f('0x40')](_['pick'](_0x34accd['query'],_0x39db64[_0x6b7f('0x40')]),_0x361284);if(_0x34accd[_0x6b7f('0x42')][_0x6b7f('0x49')]){_0x1cec78[_0x6b7f('0x4a')]=_[_0x6b7f('0x4b')](_0x1cec78[_0x6b7f('0x4a')],{'$or':_[_0x6b7f('0x38')](_0x361284,function(_0x2c84e5){if(_0x2c84e5[_0x6b7f('0x3c')]!==_0x6b7f('0x4c')){var _0x20aecf={};_0x20aecf[_0x2c84e5[_0x6b7f('0x36')]]={'$like':'%'+_0x34accd[_0x6b7f('0x42')]['filter']+'%'};return _0x20aecf;}})});}_0x1cec78=_[_0x6b7f('0x4b')]({},_0x1cec78,_0x34accd[_0x6b7f('0x4d')]);var _0x417770={'where':_0x1cec78[_0x6b7f('0x4a')]};return db[_0x6b7f('0x39')]['count'](_0x417770)[_0x6b7f('0x1c')](function(_0x1a6ee3){_0x57327f[_0x6b7f('0x2b')]=_0x1a6ee3;if(_0x34accd[_0x6b7f('0x42')]['includeAll']){_0x1cec78[_0x6b7f('0x4e')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x1cec78);})[_0x6b7f('0x1c')](function(_0x5c3d58){_0x57327f[_0x6b7f('0x4f')]=_0x5c3d58;return _0x57327f;})[_0x6b7f('0x1c')](respondWithFilteredResult(_0x18772c,_0x1cec78))['catch'](handleError(_0x18772c,null));};exports[_0x6b7f('0x50')]=function(_0x9d3d90,_0x20795a){var _0x1ad621={'raw':!![],'where':{'id':_0x9d3d90[_0x6b7f('0x51')]['id']}},_0x11dbe2={};_0x11dbe2[_0x6b7f('0x3e')]=_['keys'](db[_0x6b7f('0x39')][_0x6b7f('0x3a')]);_0x11dbe2['query']=_[_0x6b7f('0x3f')](_0x9d3d90[_0x6b7f('0x42')]);_0x11dbe2[_0x6b7f('0x40')]=_[_0x6b7f('0x41')](_0x11dbe2[_0x6b7f('0x3e')],_0x11dbe2[_0x6b7f('0x42')]);_0x1ad621[_0x6b7f('0x44')]=_[_0x6b7f('0x41')](_0x11dbe2[_0x6b7f('0x3e')],qs['fields'](_0x9d3d90[_0x6b7f('0x42')][_0x6b7f('0x43')]));_0x1ad621['attributes']=_0x1ad621[_0x6b7f('0x44')][_0x6b7f('0x45')]?_0x1ad621[_0x6b7f('0x44')]:_0x11dbe2['model'];if(_0x9d3d90['query'][_0x6b7f('0x52')]){_0x1ad621[_0x6b7f('0x4e')]=[{'all':!![]}];}_0x1ad621=_[_0x6b7f('0x4b')]({},_0x1ad621,_0x9d3d90['options']);return db[_0x6b7f('0x39')][_0x6b7f('0x53')](_0x1ad621)['then'](handleEntityNotFound(_0x20795a,null))['then'](respondWithResult(_0x20795a,null))[_0x6b7f('0x26')](handleError(_0x20795a,null));};exports[_0x6b7f('0x54')]=function(_0x11ae7a,_0x75c558){return db['ChatQueue'][_0x6b7f('0x54')](_0x11ae7a[_0x6b7f('0x55')],{})['then'](function(_0x17c26a){var _0x4765ae=_0x11ae7a['user'][_0x6b7f('0x33')]({'plain':!![]});if(!_0x4765ae)throw new Error(_0x6b7f('0x56'));if(_0x4765ae['role']==='user'){var _0x2e3517=_0x17c26a['get']({'plain':!![]});var _0x4759be=_0x6b7f('0x57');return db[_0x6b7f('0x58')]['find']({'where':{'name':_0x4759be,'userProfileId':_0x4765ae[_0x6b7f('0x59')]},'raw':!![]})[_0x6b7f('0x1c')](function(_0x1a8cbb){if(_0x1a8cbb&&_0x1a8cbb[_0x6b7f('0x5a')]===0x0){return db[_0x6b7f('0x34')][_0x6b7f('0x54')]({'name':_0x2e3517[_0x6b7f('0x36')],'resourceId':_0x2e3517['id'],'type':_0x1a8cbb[_0x6b7f('0x36')],'sectionId':_0x1a8cbb['id']},{})['then'](function(){return _0x17c26a;});}else{return _0x17c26a;}})[_0x6b7f('0x26')](function(_0x4eb05c){logger[_0x6b7f('0x21')](_0x6b7f('0x5b'),_0x4eb05c);throw _0x4eb05c;});}return _0x17c26a;})[_0x6b7f('0x1c')](respondWithResult(_0x75c558,0xc9))['catch'](handleError(_0x75c558,null));};exports[_0x6b7f('0x5c')]=function(_0x42b258,_0x29bfaf){if(_0x42b258[_0x6b7f('0x55')]['id']){delete _0x42b258[_0x6b7f('0x55')]['id'];}return db[_0x6b7f('0x39')][_0x6b7f('0x53')]({'where':{'id':_0x42b258['params']['id']}})['then'](handleEntityNotFound(_0x29bfaf,null))['then'](saveUpdates(_0x42b258[_0x6b7f('0x55')],null))[_0x6b7f('0x1c')](respondWithResult(_0x29bfaf,null))[_0x6b7f('0x26')](handleError(_0x29bfaf,null));};exports['destroy']=function(_0xa83ee3,_0x258d9b){return db[_0x6b7f('0x39')][_0x6b7f('0x53')]({'where':{'id':_0xa83ee3['params']['id']}})[_0x6b7f('0x1c')](handleEntityNotFound(_0x258d9b,null))['then'](removeEntity(_0x258d9b,null))[_0x6b7f('0x26')](handleError(_0x258d9b,null));};exports[_0x6b7f('0x5d')]=function(_0x2b69e6,_0x44f94a){return db[_0x6b7f('0x39')][_0x6b7f('0x5d')]()[_0x6b7f('0x1c')](respondWithResult(_0x44f94a,null))[_0x6b7f('0x26')](handleError(_0x44f94a,null));};exports[_0x6b7f('0x5e')]=function(_0xbb2d82,_0x2fe16d,_0x832a49){var _0x50a677={'raw':!![],'where':{}},_0x26e740={},_0x5aa12c;return db['ChatQueue'][_0x6b7f('0x5f')]({'where':{'id':_0xbb2d82[_0x6b7f('0x51')]['id']}})['then'](handleEntityNotFound(_0x2fe16d,null))['then'](function(_0x570aca){if(_0x570aca){_0x5aa12c=_0x570aca['get']({'plain':!![]});_0x26e740['model']=_[_0x6b7f('0x3f')](db[_0x6b7f('0x60')]['rawAttributes']);_0x26e740[_0x6b7f('0x42')]=_['keys'](_0xbb2d82[_0x6b7f('0x42')]);_0x26e740[_0x6b7f('0x40')]=_[_0x6b7f('0x41')](_0x26e740[_0x6b7f('0x3e')],_0x26e740[_0x6b7f('0x42')]);_0x50a677[_0x6b7f('0x44')]=_[_0x6b7f('0x41')](_0x26e740['model'],qs['fields'](_0xbb2d82[_0x6b7f('0x42')][_0x6b7f('0x43')]));_0x50a677[_0x6b7f('0x44')]=_0x50a677[_0x6b7f('0x44')][_0x6b7f('0x45')]?_0x50a677[_0x6b7f('0x44')]:_0x26e740[_0x6b7f('0x3e')];if(!_0xbb2d82[_0x6b7f('0x42')][_0x6b7f('0x46')](_0x6b7f('0x61'))){_0x50a677[_0x6b7f('0x2a')]=qs[_0x6b7f('0x2a')](_0xbb2d82[_0x6b7f('0x42')][_0x6b7f('0x2a')]);_0x50a677[_0x6b7f('0x2c')]=qs[_0x6b7f('0x2c')](_0xbb2d82[_0x6b7f('0x42')][_0x6b7f('0x2c')]);}_0x50a677[_0x6b7f('0x47')]=qs[_0x6b7f('0x48')](_0xbb2d82[_0x6b7f('0x42')]['sort']);_0x50a677[_0x6b7f('0x4a')]=qs[_0x6b7f('0x40')](_[_0x6b7f('0x62')](_0xbb2d82[_0x6b7f('0x42')],_0x26e740[_0x6b7f('0x40')]));_0x50a677['where'][_0x6b7f('0x63')]=_0x570aca['id'];if(_0xbb2d82[_0x6b7f('0x42')][_0x6b7f('0x49')]){_0x50a677[_0x6b7f('0x4a')]=_[_0x6b7f('0x4b')](_0x50a677['where'],{'$or':_['map'](_0x50a677[_0x6b7f('0x44')],function(_0x1ef58c){var _0x2d6eba={};_0x2d6eba[_0x1ef58c]={'$like':'%'+_0xbb2d82['query'][_0x6b7f('0x49')]+'%'};return _0x2d6eba;})});}_0x50a677=_[_0x6b7f('0x4b')]({},_0x50a677,_0xbb2d82['options']);return db['UserChatQueue'][_0x6b7f('0x64')](_0x50a677);}})['then'](function(_0x6ad6c){if(_0x6ad6c){return db['User'][_0x6b7f('0x65')]({'where':{'id':_['map'](_0x6ad6c,_0x6b7f('0x66')),'role':_0x6b7f('0x67')},'attributes':['id',_0x6b7f('0x36'),_0x6b7f('0x68'),_0x6b7f('0x69'),_0x6b7f('0x6a')]});}})[_0x6b7f('0x1c')](function(_0x41a5f2){if(_0x41a5f2){return{'count':_0x41a5f2['count'],'rows':_[_0x6b7f('0x38')](_0x41a5f2[_0x6b7f('0x4f')],function(_0x3df501){return{'membername':_0x3df501['name'],'UserId':_0x3df501['id'],'queue_name':_0x5aa12c[_0x6b7f('0x36')],'ChatQueueId':_0x5aa12c['id'],'interface':util['format'](_0x6b7f('0x6b'),_0x6b7f('0x6c'),_0x3df501[_0x6b7f('0x36')]),'penalty':0x0,'paused':_0x3df501[_0x6b7f('0x68')],'createdAt':_0x3df501[_0x6b7f('0x6a')],'updatedAt':_0x3df501[_0x6b7f('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2fe16d,_0x50a677))[_0x6b7f('0x26')](handleError(_0x2fe16d,null));};exports[_0x6b7f('0x6d')]=function(_0x3911b1,_0x334f7b,_0xb46d08){var _0x5c5df6={};var _0x240f12={};var _0x5db2cc;var _0x406b62;return db['ChatQueue']['findOne']({'where':{'id':_0x3911b1[_0x6b7f('0x51')]['id']}})[_0x6b7f('0x1c')](handleEntityNotFound(_0x334f7b,null))[_0x6b7f('0x1c')](function(_0x5b7338){if(_0x5b7338){_0x5db2cc=_0x5b7338;_0x240f12[_0x6b7f('0x3e')]=_[_0x6b7f('0x3f')](db[_0x6b7f('0x6e')][_0x6b7f('0x3a')]);_0x240f12['query']=_['keys'](_0x3911b1[_0x6b7f('0x42')]);_0x240f12[_0x6b7f('0x40')]=_['intersection'](_0x240f12[_0x6b7f('0x3e')],_0x240f12[_0x6b7f('0x42')]);_0x5c5df6[_0x6b7f('0x44')]=_['intersection'](_0x240f12[_0x6b7f('0x3e')],qs[_0x6b7f('0x43')](_0x3911b1[_0x6b7f('0x42')]['fields']));_0x5c5df6['attributes']=_0x5c5df6[_0x6b7f('0x44')][_0x6b7f('0x45')]?_0x5c5df6[_0x6b7f('0x44')]:_0x240f12[_0x6b7f('0x3e')];_0x5c5df6[_0x6b7f('0x47')]=qs[_0x6b7f('0x48')](_0x3911b1['query'][_0x6b7f('0x48')]);_0x5c5df6[_0x6b7f('0x4a')]=qs[_0x6b7f('0x40')](_[_0x6b7f('0x62')](_0x3911b1[_0x6b7f('0x42')],_0x240f12[_0x6b7f('0x40')]));if(_0x3911b1[_0x6b7f('0x42')][_0x6b7f('0x49')]){_0x5c5df6[_0x6b7f('0x4a')]=_[_0x6b7f('0x4b')](_0x5c5df6[_0x6b7f('0x4a')],{'$or':_['map'](_0x5c5df6[_0x6b7f('0x44')],function(_0x1e8947){var _0x38aedb={};_0x38aedb[_0x1e8947]={'$like':'%'+_0x3911b1[_0x6b7f('0x42')][_0x6b7f('0x49')]+'%'};return _0x38aedb;})});}_0x5c5df6=_[_0x6b7f('0x4b')]({},_0x5c5df6,_0x3911b1[_0x6b7f('0x4d')]);return _0x5db2cc['getTeams'](_0x5c5df6);}})[_0x6b7f('0x1c')](function(_0x5af40a){if(_0x5af40a){_0x406b62=_0x5af40a[_0x6b7f('0x45')];if(!_0x3911b1['query'][_0x6b7f('0x46')]('nolimit')){_0x5c5df6[_0x6b7f('0x2a')]=qs['limit'](_0x3911b1[_0x6b7f('0x42')]['limit']);_0x5c5df6[_0x6b7f('0x2c')]=qs[_0x6b7f('0x2c')](_0x3911b1[_0x6b7f('0x42')][_0x6b7f('0x2c')]);}return _0x5db2cc[_0x6b7f('0x6d')](_0x5c5df6);}})[_0x6b7f('0x1c')](function(_0x20bea3){if(_0x20bea3){return _0x20bea3?{'count':_0x406b62,'rows':_0x20bea3}:null;}})[_0x6b7f('0x1c')](respondWithResult(_0x334f7b,null))[_0x6b7f('0x26')](handleError(_0x334f7b,null));};exports[_0x6b7f('0x6f')]=function(_0x2dfc25,_0x330316,_0x55c1df){var _0x4e5f2f=_0x2dfc25[_0x6b7f('0x55')][_0x6b7f('0x70')];return db['Team'][_0x6b7f('0x64')]({'where':{'id':_0x4e5f2f},'attributes':['id'],'include':[{'model':db[_0x6b7f('0x71')],'as':'Agents','attributes':['id',_0x6b7f('0x36'),_0x6b7f('0x72'),_0x6b7f('0x73'),_0x6b7f('0x74')],'raw':!![]}]})['then'](function(_0x4e106d){if(_0x4e106d){var _0x2d213f=_[_0x6b7f('0x75')](_0x4e106d,function(_0x3cc1cd){var _0x2a239e=_0x3cc1cd[_0x6b7f('0x33')]({'plain':!![]});return _0x2a239e[_0x6b7f('0x76')];});return db[_0x6b7f('0x39')][_0x6b7f('0x53')]({'where':{'id':_0x2dfc25['params']['id']}})[_0x6b7f('0x1c')](function(_0x1a2300){return db['sequelize'][_0x6b7f('0x77')](function(_0x188fa0){return _0x1a2300[_0x6b7f('0x6f')](_0x4e5f2f,{'transaction':_0x188fa0})[_0x6b7f('0x1c')](function(){return BPromise[_0x6b7f('0x78')](_0x2d213f,function(_0x35bf11){return db[_0x6b7f('0x60')][_0x6b7f('0x79')]({'where':{'UserId':_0x35bf11['id'],'ChatQueueId':_0x2dfc25[_0x6b7f('0x51')]['id']},'transaction':_0x188fa0});});})['then'](function(){_0x2d213f[_0x6b7f('0x7a')](function(_0x27c3db){socket[_0x6b7f('0x7b')]('userChatQueue:save',{'UserId':_0x27c3db['id'],'ChatQueueId':_0x1a2300['id']});});});});});}})[_0x6b7f('0x1c')](respondWithStatusCode(_0x330316,null))['catch'](handleError(_0x330316,null));};exports[_0x6b7f('0x7c')]=function(_0x4c9526,_0x56d844,_0x316761){return db[_0x6b7f('0x6e')][_0x6b7f('0x64')]({'where':{'id':_0x4c9526[_0x6b7f('0x42')][_0x6b7f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x6b7f('0x71')],'as':_0x6b7f('0x76'),'attributes':['id'],'raw':!![]}]})[_0x6b7f('0x1c')](handleEntityNotFound(_0x56d844,null))[_0x6b7f('0x1c')](function(_0x38a900){var _0x23a85a=_[_0x6b7f('0x38')](_0x38a900,'id');var _0x8567df=[];var _0x1b46e5=[];var _0x195761=squel[_0x6b7f('0x7d')]();_0x195761['field']('tq.TeamId')[_0x6b7f('0x7e')](_0x6b7f('0x7f'),'tq')[_0x6b7f('0x80')]('user_has_teams','ut',_0x6b7f('0x81'))[_0x6b7f('0x4a')](_0x6b7f('0x82'),_0x4c9526['params']['id']);for(var _0x1e3267=0x0;_0x1e3267<_0x38a900['length'];_0x1e3267+=0x1){let _0x523b1a=_0x38a900[_0x1e3267];for(var _0x3b8c9d=0x0;_0x3b8c9d<_0x523b1a[_0x6b7f('0x76')]['length'];_0x3b8c9d+=0x1){let _0x57f576=_0x523b1a[_0x6b7f('0x76')][_0x3b8c9d];var _0x3051e1=_0x195761[_0x6b7f('0x83')]();_0x3051e1[_0x6b7f('0x4a')](_0x6b7f('0x84'),_0x57f576['id']);_0x1b46e5[_0x6b7f('0x85')](db[_0x6b7f('0x86')][_0x6b7f('0x42')](_0x3051e1['toString'](),{'type':db[_0x6b7f('0x86')][_0x6b7f('0x87')][_0x6b7f('0x88')]})['then'](function(_0x1cda06){if(_0x1cda06['length']===0x1){return _0x57f576['id'];}else{var _0x4a09a6=_[_0x6b7f('0x89')](_[_0x6b7f('0x38')](_0x1cda06,'TeamId'),function(_0x46c65f){return _[_0x6b7f('0x8a')](_0x23a85a,_0x46c65f);});if(_0x4a09a6){return _0x57f576['id'];}}}));}}return BPromise['all'](_0x1b46e5)[_0x6b7f('0x1c')](function(_0x12ae44){_0x8567df=_(_0x8567df)[_0x6b7f('0x8b')](_0x12ae44)[_0x6b7f('0x8c')]()['value']();return db[_0x6b7f('0x39')][_0x6b7f('0x53')]({'where':{'id':_0x4c9526[_0x6b7f('0x51')]['id']}})[_0x6b7f('0x1c')](function(_0x4cd284){return db[_0x6b7f('0x86')][_0x6b7f('0x77')](function(_0x350749){return _0x4cd284[_0x6b7f('0x7c')](_0x4c9526[_0x6b7f('0x42')][_0x6b7f('0x70')],{'transaction':_0x350749})[_0x6b7f('0x1c')](function(){if(!_[_0x6b7f('0x8d')](_0x8567df)){return _0x4cd284[_0x6b7f('0x8e')](_0x8567df,{'transaction':_0x350749});}})[_0x6b7f('0x1c')](function(){_0x8567df[_0x6b7f('0x7a')](function(_0x5a7f11){socket[_0x6b7f('0x7b')](_0x6b7f('0x8f'),{'UserId':_0x5a7f11,'ChatQueueId':_0x4cd284['id']});});});});});});})[_0x6b7f('0x1c')](respondWithStatusCode(_0x56d844,null))[_0x6b7f('0x26')](handleError(_0x56d844,null));};exports['addAgents']=function(_0x55d0de,_0x388825,_0x31022d){return db['ChatQueue'][_0x6b7f('0x53')]({'where':{'id':_0x55d0de[_0x6b7f('0x51')]['id']}})['then'](handleEntityNotFound(_0x388825,null))[_0x6b7f('0x1c')](function(_0x3e8bbe){if(_0x3e8bbe){return _0x3e8bbe[_0x6b7f('0x90')](_0x55d0de[_0x6b7f('0x55')]['ids'],_[_0x6b7f('0x91')](_0x55d0de[_0x6b7f('0x55')],[_0x6b7f('0x70'),'id'])||{})[_0x6b7f('0x92')](function(_0x3f07e6){for(var _0x108c3c=0x0;_0x108c3c<_0x55d0de[_0x6b7f('0x55')][_0x6b7f('0x70')][_0x6b7f('0x45')];_0x108c3c+=0x1){socket[_0x6b7f('0x7b')](_0x6b7f('0x93'),{'UserId':Number(_0x55d0de[_0x6b7f('0x55')][_0x6b7f('0x70')][_0x108c3c]),'ChatQueueId':Number(_0x55d0de['params']['id'])});}return _0x3f07e6;});}})[_0x6b7f('0x1c')](respondWithResult(_0x388825,null))[_0x6b7f('0x26')](handleError(_0x388825,null));};exports[_0x6b7f('0x8e')]=function(_0x2918a3,_0x17c3f9,_0xe42e24){return db[_0x6b7f('0x39')][_0x6b7f('0x53')]({'where':{'id':_0x2918a3[_0x6b7f('0x51')]['id']}})['then'](handleEntityNotFound(_0x17c3f9,null))[_0x6b7f('0x1c')](function(_0xa07e6a){if(_0xa07e6a){return _0xa07e6a[_0x6b7f('0x8e')](_0x2918a3[_0x6b7f('0x42')][_0x6b7f('0x70')])[_0x6b7f('0x1c')](function(){if(_['isArray'](_0x2918a3[_0x6b7f('0x42')][_0x6b7f('0x70')])){for(var _0x4e06bf=0x0;_0x4e06bf<_0x2918a3[_0x6b7f('0x42')][_0x6b7f('0x70')]['length'];_0x4e06bf+=0x1){socket['emit'](_0x6b7f('0x8f'),{'UserId':Number(_0x2918a3['query'][_0x6b7f('0x70')][_0x4e06bf]),'ChatQueueId':Number(_0x2918a3[_0x6b7f('0x51')]['id'])});}}else{socket[_0x6b7f('0x7b')](_0x6b7f('0x8f'),{'UserId':Number(_0x2918a3[_0x6b7f('0x42')]['ids']),'ChatQueueId':Number(_0x2918a3[_0x6b7f('0x51')]['id'])});}});}})[_0x6b7f('0x1c')](respondWithStatusCode(_0x17c3f9,null))[_0x6b7f('0x26')](handleError(_0x17c3f9,null));};exports[_0x6b7f('0x94')]=function(_0x44ba04,_0x4f7e68,_0x251906){var _0x3d77d5={};var _0x500bb8={};var _0x15d4c0;var _0x44068f;return db['ChatQueue'][_0x6b7f('0x5f')]({'where':{'id':_0x44ba04['params']['id']}})[_0x6b7f('0x1c')](handleEntityNotFound(_0x4f7e68,null))['then'](function(_0x27e281){if(_0x27e281){_0x15d4c0=_0x27e281;_0x500bb8[_0x6b7f('0x3e')]=_[_0x6b7f('0x3f')](db[_0x6b7f('0x71')][_0x6b7f('0x3a')]);_0x500bb8[_0x6b7f('0x42')]=_['keys'](_0x44ba04[_0x6b7f('0x42')]);_0x500bb8[_0x6b7f('0x40')]=_[_0x6b7f('0x41')](_0x500bb8[_0x6b7f('0x3e')],_0x500bb8[_0x6b7f('0x42')]);_0x3d77d5[_0x6b7f('0x44')]=_['intersection'](_0x500bb8['model'],qs['fields'](_0x44ba04[_0x6b7f('0x42')][_0x6b7f('0x43')]));_0x3d77d5[_0x6b7f('0x44')]=_0x3d77d5['attributes'][_0x6b7f('0x45')]?_0x3d77d5[_0x6b7f('0x44')]:_0x500bb8[_0x6b7f('0x3e')];_0x3d77d5[_0x6b7f('0x47')]=qs[_0x6b7f('0x48')](_0x44ba04['query'][_0x6b7f('0x48')]);_0x3d77d5['where']=qs['filters'](_[_0x6b7f('0x62')](_0x44ba04[_0x6b7f('0x42')],_0x500bb8[_0x6b7f('0x40')]));if(_0x44ba04[_0x6b7f('0x42')][_0x6b7f('0x49')]){_0x3d77d5[_0x6b7f('0x4a')]=_[_0x6b7f('0x4b')](_0x3d77d5[_0x6b7f('0x4a')],{'$or':_['map'](_0x3d77d5[_0x6b7f('0x44')],function(_0x20395f){var _0x32ac5a={};_0x32ac5a[_0x20395f]={'$like':'%'+_0x44ba04['query'][_0x6b7f('0x49')]+'%'};return _0x32ac5a;})});}_0x3d77d5=_[_0x6b7f('0x4b')]({},_0x3d77d5,_0x44ba04[_0x6b7f('0x4d')]);return _0x15d4c0[_0x6b7f('0x94')](_0x3d77d5);}})[_0x6b7f('0x1c')](function(_0x4d7025){if(_0x4d7025){_0x44068f=_0x4d7025['length'];if(!_0x44ba04[_0x6b7f('0x42')][_0x6b7f('0x46')](_0x6b7f('0x61'))){_0x3d77d5[_0x6b7f('0x2a')]=qs['limit'](_0x44ba04[_0x6b7f('0x42')]['limit']);_0x3d77d5[_0x6b7f('0x2c')]=qs[_0x6b7f('0x2c')](_0x44ba04[_0x6b7f('0x42')][_0x6b7f('0x2c')]);}return _0x15d4c0[_0x6b7f('0x94')](_0x3d77d5);}})[_0x6b7f('0x1c')](function(_0xf15aeb){if(_0xf15aeb){return _0xf15aeb?{'count':_0x44068f,'rows':_0xf15aeb}:null;}})[_0x6b7f('0x1c')](respondWithResult(_0x4f7e68,null))['catch'](handleError(_0x4f7e68,null));};
\ No newline at end of file
+var _0xd830=['ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','value','transaction','ids','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','include','rows','show','length','find','create','body','user','get','ChatQueues','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','findAll','Agents','online','voicePause','interface','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd830,0x1da));var _0x0d83=function(_0x1102e9,_0x7ec911){_0x1102e9=_0x1102e9-0x0;var _0x35d0cd=_0xd830[_0x1102e9];return _0x35d0cd;};'use strict';var emlformat=require(_0x0d83('0x0'));var rimraf=require(_0x0d83('0x1'));var zipdir=require(_0x0d83('0x2'));var jsonpatch=require(_0x0d83('0x3'));var rp=require(_0x0d83('0x4'));var moment=require('moment');var BPromise=require(_0x0d83('0x5'));var Mustache=require(_0x0d83('0x6'));var util=require('util');var path=require(_0x0d83('0x7'));var sox=require(_0x0d83('0x8'));var csv=require(_0x0d83('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d83('0xa'));var _=require(_0x0d83('0xb'));var squel=require(_0x0d83('0xc'));var crypto=require(_0x0d83('0xd'));var jsforce=require(_0x0d83('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d83('0x9'));var querystring=require('querystring');var Papa=require(_0x0d83('0xf'));var Redis=require(_0x0d83('0x10'));var authService=require(_0x0d83('0x11'));var qs=require(_0x0d83('0x12'));var as=require(_0x0d83('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d83('0x14'))(_0x0d83('0x15'));var utils=require(_0x0d83('0x16'));var config=require(_0x0d83('0x17'));var licenseUtil=require(_0x0d83('0x18'));var db=require(_0x0d83('0x19'))['db'];config['redis']=_['defaults'](config[_0x0d83('0x1a')],{'host':_0x0d83('0x1b'),'port':0x18eb});var socket=require(_0x0d83('0x1c'))(new Redis(config[_0x0d83('0x1a')]));require(_0x0d83('0x1d'))['register'](socket);var jayson=require(_0x0d83('0x1e'));var client=jayson[_0x0d83('0x1f')][_0x0d83('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1264bc,_0x3f0b39,_0x51d86a,_0x586521){return new BPromise(function(_0x545e0a,_0x4deb9f){var _0x274f1a=_0x586521||client;return _0x274f1a[_0x0d83('0x21')](_0x1264bc,_0x51d86a)[_0x0d83('0x22')](function(_0x631225){logger[_0x0d83('0x23')]('ChatQueue,\x20%s,\x20%s',_0x3f0b39,_0x0d83('0x24'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3f0b39,_0x0d83('0x24'),JSON[_0x0d83('0x25')](_0x631225));if(_0x631225[_0x0d83('0x26')]){if(_0x631225['error'][_0x0d83('0x27')]===0x1f4){logger[_0x0d83('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f0b39,_0x631225['error']['message']);return _0x4deb9f(_0x631225[_0x0d83('0x26')]['message']);}logger[_0x0d83('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f0b39,_0x631225['error'][_0x0d83('0x28')]);return _0x545e0a(_0x631225[_0x0d83('0x26')][_0x0d83('0x28')]);}else{logger[_0x0d83('0x23')](_0x0d83('0x29'),_0x3f0b39,_0x0d83('0x24'));_0x545e0a(_0x631225[_0x0d83('0x2a')][_0x0d83('0x28')]);}})[_0x0d83('0x2b')](function(_0x58cbe1){logger[_0x0d83('0x26')](_0x0d83('0x29'),_0x3f0b39,_0x58cbe1);_0x4deb9f(_0x58cbe1);});});}function respondWithStatusCode(_0x49c278,_0x17871c){_0x17871c=_0x17871c||0xcc;return function(_0x2169d9){if(_0x2169d9){return _0x49c278['sendStatus'](_0x17871c);}return _0x49c278[_0x0d83('0x2c')](_0x17871c)[_0x0d83('0x2d')]();};}function respondWithResult(_0x345cac,_0x350b06){_0x350b06=_0x350b06||0xc8;return function(_0x2003f9){if(_0x2003f9){return _0x345cac[_0x0d83('0x2c')](_0x350b06)[_0x0d83('0x2e')](_0x2003f9);}};}function respondWithFilteredResult(_0x29008f,_0x18e2bb){return function(_0x1e0913){if(_0x1e0913){var _0x3b2844=typeof _0x18e2bb[_0x0d83('0x2f')]===_0x0d83('0x30')&&typeof _0x18e2bb[_0x0d83('0x31')]===_0x0d83('0x30');var _0x43f456=_0x1e0913[_0x0d83('0x32')];var _0x24b345=_0x3b2844?0x0:_0x18e2bb[_0x0d83('0x2f')];var _0x367330=_0x3b2844?_0x1e0913['count']:_0x18e2bb[_0x0d83('0x2f')]+_0x18e2bb[_0x0d83('0x31')];var _0x4b2f44;if(_0x367330>=_0x43f456){_0x367330=_0x43f456;_0x4b2f44=0xc8;}else{_0x4b2f44=0xce;}_0x29008f[_0x0d83('0x2c')](_0x4b2f44);return _0x29008f[_0x0d83('0x33')](_0x0d83('0x34'),_0x24b345+'-'+_0x367330+'/'+_0x43f456)[_0x0d83('0x2e')](_0x1e0913);}return null;};}function patchUpdates(_0x33e5f9){return function(_0x2fa440){try{jsonpatch[_0x0d83('0x35')](_0x2fa440,_0x33e5f9,!![]);}catch(_0x57daf4){return BPromise[_0x0d83('0x36')](_0x57daf4);}return _0x2fa440[_0x0d83('0x37')]();};}function saveUpdates(_0x55c12c,_0x482f51){return function(_0x417d1b){if(_0x417d1b){return _0x417d1b[_0x0d83('0x38')](_0x55c12c)['then'](function(_0x86c672){return _0x86c672;});}return null;};}function removeEntity(_0x2266df,_0x4452cc){return function(_0x5560e7){if(_0x5560e7){return _0x5560e7[_0x0d83('0x39')]()['then'](function(){var _0x56ef65=_0x5560e7['get']({'plain':!![]});var _0x2666e2='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x2666e2,'resourceId':_0x56ef65['id']}})[_0x0d83('0x22')](function(){return _0x5560e7;});})[_0x0d83('0x22')](function(){_0x2266df[_0x0d83('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16e887,_0xb8393e){return function(_0x49f70d){if(!_0x49f70d){_0x16e887[_0x0d83('0x3a')](0x194);}return _0x49f70d;};}function handleError(_0x1398a3,_0x2c2909){_0x2c2909=_0x2c2909||0x1f4;return function(_0x3320ce){logger[_0x0d83('0x26')](_0x3320ce[_0x0d83('0x3b')]);if(_0x3320ce[_0x0d83('0x3c')]){delete _0x3320ce[_0x0d83('0x3c')];}_0x1398a3['status'](_0x2c2909)[_0x0d83('0x3d')](_0x3320ce);};}exports[_0x0d83('0x3e')]=function(_0x1dc287,_0x134e96){var _0x583e5c={},_0x17af09={},_0x466441={'count':0x0,'rows':[]};var _0x283ad7=_[_0x0d83('0x3f')](db['ChatQueue'][_0x0d83('0x40')],function(_0x26bc35){return{'name':_0x26bc35[_0x0d83('0x41')],'type':_0x26bc35[_0x0d83('0x42')]['key']};});_0x17af09[_0x0d83('0x43')]=_['map'](_0x283ad7,'name');_0x17af09[_0x0d83('0x44')]=_[_0x0d83('0x45')](_0x1dc287['query']);_0x17af09['filters']=_[_0x0d83('0x46')](_0x17af09['model'],_0x17af09[_0x0d83('0x44')]);_0x583e5c['attributes']=_['intersection'](_0x17af09[_0x0d83('0x43')],qs[_0x0d83('0x47')](_0x1dc287[_0x0d83('0x44')]['fields']));_0x583e5c[_0x0d83('0x48')]=_0x583e5c['attributes']['length']?_0x583e5c[_0x0d83('0x48')]:_0x17af09[_0x0d83('0x43')];if(!_0x1dc287[_0x0d83('0x44')]['hasOwnProperty'](_0x0d83('0x49'))){_0x583e5c[_0x0d83('0x31')]=qs[_0x0d83('0x31')](_0x1dc287[_0x0d83('0x44')][_0x0d83('0x31')]);_0x583e5c[_0x0d83('0x2f')]=qs[_0x0d83('0x2f')](_0x1dc287[_0x0d83('0x44')][_0x0d83('0x2f')]);}_0x583e5c[_0x0d83('0x4a')]=qs['sort'](_0x1dc287[_0x0d83('0x44')][_0x0d83('0x4b')]);_0x583e5c[_0x0d83('0x4c')]=qs[_0x0d83('0x4d')](_[_0x0d83('0x4e')](_0x1dc287['query'],_0x17af09[_0x0d83('0x4d')]),_0x283ad7);if(_0x1dc287[_0x0d83('0x44')][_0x0d83('0x4f')]){_0x583e5c['where']=_[_0x0d83('0x50')](_0x583e5c[_0x0d83('0x4c')],{'$or':_['map'](_0x283ad7,function(_0x171368){if(_0x171368[_0x0d83('0x42')]!==_0x0d83('0x51')){var _0x1fa5fd={};_0x1fa5fd[_0x171368[_0x0d83('0x3c')]]={'$like':'%'+_0x1dc287[_0x0d83('0x44')]['filter']+'%'};return _0x1fa5fd;}})});}_0x583e5c=_[_0x0d83('0x50')]({},_0x583e5c,_0x1dc287[_0x0d83('0x52')]);var _0x95884c={'where':_0x583e5c['where']};return db[_0x0d83('0x53')]['count'](_0x95884c)[_0x0d83('0x22')](function(_0xaa504b){_0x466441[_0x0d83('0x32')]=_0xaa504b;if(_0x1dc287[_0x0d83('0x44')][_0x0d83('0x54')]){_0x583e5c[_0x0d83('0x55')]=[{'all':!![]}];}return db[_0x0d83('0x53')]['findAll'](_0x583e5c);})['then'](function(_0x3667b7){_0x466441[_0x0d83('0x56')]=_0x3667b7;return _0x466441;})[_0x0d83('0x22')](respondWithFilteredResult(_0x134e96,_0x583e5c))[_0x0d83('0x2b')](handleError(_0x134e96,null));};exports[_0x0d83('0x57')]=function(_0x47e223,_0x219d4f){var _0x20946b={'raw':!![],'where':{'id':_0x47e223['params']['id']}},_0x251331={};_0x251331[_0x0d83('0x43')]=_[_0x0d83('0x45')](db[_0x0d83('0x53')][_0x0d83('0x40')]);_0x251331[_0x0d83('0x44')]=_[_0x0d83('0x45')](_0x47e223[_0x0d83('0x44')]);_0x251331['filters']=_[_0x0d83('0x46')](_0x251331[_0x0d83('0x43')],_0x251331[_0x0d83('0x44')]);_0x20946b['attributes']=_[_0x0d83('0x46')](_0x251331[_0x0d83('0x43')],qs[_0x0d83('0x47')](_0x47e223[_0x0d83('0x44')][_0x0d83('0x47')]));_0x20946b[_0x0d83('0x48')]=_0x20946b[_0x0d83('0x48')][_0x0d83('0x58')]?_0x20946b['attributes']:_0x251331['model'];if(_0x47e223[_0x0d83('0x44')]['includeAll']){_0x20946b[_0x0d83('0x55')]=[{'all':!![]}];}_0x20946b=_['merge']({},_0x20946b,_0x47e223[_0x0d83('0x52')]);return db['ChatQueue'][_0x0d83('0x59')](_0x20946b)[_0x0d83('0x22')](handleEntityNotFound(_0x219d4f,null))[_0x0d83('0x22')](respondWithResult(_0x219d4f,null))[_0x0d83('0x2b')](handleError(_0x219d4f,null));};exports[_0x0d83('0x5a')]=function(_0x3bae40,_0x3344a9){return db[_0x0d83('0x53')][_0x0d83('0x5a')](_0x3bae40[_0x0d83('0x5b')],{})[_0x0d83('0x22')](function(_0x224a1b){var _0x4a69ae=_0x3bae40[_0x0d83('0x5c')][_0x0d83('0x5d')]({'plain':!![]});if(!_0x4a69ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a69ae['role']===_0x0d83('0x5c')){var _0x2543c3=_0x224a1b['get']({'plain':!![]});var _0x2641fa=_0x0d83('0x5e');return db[_0x0d83('0x5f')][_0x0d83('0x59')]({'where':{'name':_0x2641fa,'userProfileId':_0x4a69ae['userProfileId']},'raw':!![]})[_0x0d83('0x22')](function(_0x53f20b){if(_0x53f20b&&_0x53f20b['autoAssociation']===0x0){return db[_0x0d83('0x60')][_0x0d83('0x5a')]({'name':_0x2543c3['name'],'resourceId':_0x2543c3['id'],'type':_0x53f20b['name'],'sectionId':_0x53f20b['id']},{})[_0x0d83('0x22')](function(){return _0x224a1b;});}else{return _0x224a1b;}})[_0x0d83('0x2b')](function(_0x304c45){logger[_0x0d83('0x26')](_0x0d83('0x61'),_0x304c45);throw _0x304c45;});}return _0x224a1b;})[_0x0d83('0x22')](respondWithResult(_0x3344a9,0xc9))[_0x0d83('0x2b')](handleError(_0x3344a9,null));};exports['update']=function(_0x32c65c,_0x4f6d95){if(_0x32c65c[_0x0d83('0x5b')]['id']){delete _0x32c65c['body']['id'];}return db[_0x0d83('0x53')][_0x0d83('0x59')]({'where':{'id':_0x32c65c[_0x0d83('0x62')]['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x4f6d95,null))['then'](saveUpdates(_0x32c65c[_0x0d83('0x5b')],null))[_0x0d83('0x22')](respondWithResult(_0x4f6d95,null))[_0x0d83('0x2b')](handleError(_0x4f6d95,null));};exports[_0x0d83('0x39')]=function(_0x2c3e33,_0x4f7dd6){return db[_0x0d83('0x53')]['find']({'where':{'id':_0x2c3e33[_0x0d83('0x62')]['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x4f7dd6,null))[_0x0d83('0x22')](removeEntity(_0x4f7dd6,null))[_0x0d83('0x2b')](handleError(_0x4f7dd6,null));};exports[_0x0d83('0x63')]=function(_0x16a91f,_0x3c4920){return db[_0x0d83('0x53')]['describe']()[_0x0d83('0x22')](respondWithResult(_0x3c4920,null))['catch'](handleError(_0x3c4920,null));};exports['getMembers']=function(_0x400afe,_0x2e91e3,_0x53783e){var _0x2c19b1={'raw':!![],'where':{}},_0x4d17f1={},_0x5819a6;return db[_0x0d83('0x53')][_0x0d83('0x64')]({'where':{'id':_0x400afe[_0x0d83('0x62')]['id']}})['then'](handleEntityNotFound(_0x2e91e3,null))['then'](function(_0x8a75d9){if(_0x8a75d9){_0x5819a6=_0x8a75d9[_0x0d83('0x5d')]({'plain':!![]});_0x4d17f1[_0x0d83('0x43')]=_[_0x0d83('0x45')](db['UserChatQueue'][_0x0d83('0x40')]);_0x4d17f1[_0x0d83('0x44')]=_[_0x0d83('0x45')](_0x400afe['query']);_0x4d17f1[_0x0d83('0x4d')]=_[_0x0d83('0x46')](_0x4d17f1[_0x0d83('0x43')],_0x4d17f1[_0x0d83('0x44')]);_0x2c19b1['attributes']=_[_0x0d83('0x46')](_0x4d17f1[_0x0d83('0x43')],qs[_0x0d83('0x47')](_0x400afe[_0x0d83('0x44')][_0x0d83('0x47')]));_0x2c19b1[_0x0d83('0x48')]=_0x2c19b1[_0x0d83('0x48')][_0x0d83('0x58')]?_0x2c19b1[_0x0d83('0x48')]:_0x4d17f1['model'];if(!_0x400afe[_0x0d83('0x44')][_0x0d83('0x65')](_0x0d83('0x49'))){_0x2c19b1['limit']=qs[_0x0d83('0x31')](_0x400afe['query'][_0x0d83('0x31')]);_0x2c19b1[_0x0d83('0x2f')]=qs[_0x0d83('0x2f')](_0x400afe['query'][_0x0d83('0x2f')]);}_0x2c19b1[_0x0d83('0x4a')]=qs[_0x0d83('0x4b')](_0x400afe[_0x0d83('0x44')][_0x0d83('0x4b')]);_0x2c19b1[_0x0d83('0x4c')]=qs[_0x0d83('0x4d')](_[_0x0d83('0x4e')](_0x400afe[_0x0d83('0x44')],_0x4d17f1['filters']));_0x2c19b1[_0x0d83('0x4c')][_0x0d83('0x66')]=_0x8a75d9['id'];if(_0x400afe['query']['filter']){_0x2c19b1[_0x0d83('0x4c')]=_[_0x0d83('0x50')](_0x2c19b1[_0x0d83('0x4c')],{'$or':_[_0x0d83('0x3f')](_0x2c19b1['attributes'],function(_0x5b4678){var _0x4ff025={};_0x4ff025[_0x5b4678]={'$like':'%'+_0x400afe[_0x0d83('0x44')]['filter']+'%'};return _0x4ff025;})});}_0x2c19b1=_[_0x0d83('0x50')]({},_0x2c19b1,_0x400afe[_0x0d83('0x52')]);return db[_0x0d83('0x67')]['findAll'](_0x2c19b1);}})[_0x0d83('0x22')](function(_0x382751){if(_0x382751){return db[_0x0d83('0x68')][_0x0d83('0x69')]({'where':{'id':_[_0x0d83('0x3f')](_0x382751,_0x0d83('0x6a')),'role':_0x0d83('0x6b')},'attributes':['id','name',_0x0d83('0x6c'),'updatedAt',_0x0d83('0x6d')]});}})[_0x0d83('0x22')](function(_0x2d9783){if(_0x2d9783){return{'count':_0x2d9783[_0x0d83('0x32')],'rows':_[_0x0d83('0x3f')](_0x2d9783['rows'],function(_0x5a2f1c){return{'membername':_0x5a2f1c[_0x0d83('0x3c')],'UserId':_0x5a2f1c['id'],'queue_name':_0x5819a6[_0x0d83('0x3c')],'ChatQueueId':_0x5819a6['id'],'interface':util[_0x0d83('0x6e')]('%s/%s',_0x0d83('0x6f'),_0x5a2f1c['name']),'penalty':0x0,'paused':_0x5a2f1c[_0x0d83('0x6c')],'createdAt':_0x5a2f1c[_0x0d83('0x6d')],'updatedAt':_0x5a2f1c[_0x0d83('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d83('0x22')](respondWithFilteredResult(_0x2e91e3,_0x2c19b1))[_0x0d83('0x2b')](handleError(_0x2e91e3,null));};exports[_0x0d83('0x71')]=function(_0x16b8d2,_0x54ccef,_0x4afe26){var _0x14c640={};var _0x5c868c={};var _0x42dffa;var _0x2bbe37;return db[_0x0d83('0x53')][_0x0d83('0x64')]({'where':{'id':_0x16b8d2['params']['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x54ccef,null))[_0x0d83('0x22')](function(_0x511f09){if(_0x511f09){_0x42dffa=_0x511f09;_0x5c868c[_0x0d83('0x43')]=_[_0x0d83('0x45')](db[_0x0d83('0x72')][_0x0d83('0x40')]);_0x5c868c['query']=_[_0x0d83('0x45')](_0x16b8d2[_0x0d83('0x44')]);_0x5c868c[_0x0d83('0x4d')]=_[_0x0d83('0x46')](_0x5c868c[_0x0d83('0x43')],_0x5c868c[_0x0d83('0x44')]);_0x14c640[_0x0d83('0x48')]=_[_0x0d83('0x46')](_0x5c868c[_0x0d83('0x43')],qs[_0x0d83('0x47')](_0x16b8d2[_0x0d83('0x44')][_0x0d83('0x47')]));_0x14c640[_0x0d83('0x48')]=_0x14c640[_0x0d83('0x48')][_0x0d83('0x58')]?_0x14c640[_0x0d83('0x48')]:_0x5c868c[_0x0d83('0x43')];_0x14c640[_0x0d83('0x4a')]=qs[_0x0d83('0x4b')](_0x16b8d2['query'][_0x0d83('0x4b')]);_0x14c640[_0x0d83('0x4c')]=qs[_0x0d83('0x4d')](_[_0x0d83('0x4e')](_0x16b8d2[_0x0d83('0x44')],_0x5c868c[_0x0d83('0x4d')]));if(_0x16b8d2[_0x0d83('0x44')][_0x0d83('0x4f')]){_0x14c640[_0x0d83('0x4c')]=_['merge'](_0x14c640[_0x0d83('0x4c')],{'$or':_[_0x0d83('0x3f')](_0x14c640[_0x0d83('0x48')],function(_0x3892db){var _0x1a01b2={};_0x1a01b2[_0x3892db]={'$like':'%'+_0x16b8d2[_0x0d83('0x44')][_0x0d83('0x4f')]+'%'};return _0x1a01b2;})});}_0x14c640=_['merge']({},_0x14c640,_0x16b8d2[_0x0d83('0x52')]);return _0x42dffa['getTeams'](_0x14c640);}})[_0x0d83('0x22')](function(_0x5a82be){if(_0x5a82be){_0x2bbe37=_0x5a82be[_0x0d83('0x58')];if(!_0x16b8d2[_0x0d83('0x44')]['hasOwnProperty'](_0x0d83('0x49'))){_0x14c640[_0x0d83('0x31')]=qs[_0x0d83('0x31')](_0x16b8d2[_0x0d83('0x44')][_0x0d83('0x31')]);_0x14c640[_0x0d83('0x2f')]=qs[_0x0d83('0x2f')](_0x16b8d2['query'][_0x0d83('0x2f')]);}return _0x42dffa[_0x0d83('0x71')](_0x14c640);}})[_0x0d83('0x22')](function(_0x463f65){if(_0x463f65){return _0x463f65?{'count':_0x2bbe37,'rows':_0x463f65}:null;}})[_0x0d83('0x22')](respondWithResult(_0x54ccef,null))['catch'](handleError(_0x54ccef,null));};exports[_0x0d83('0x73')]=function(_0x1b8634,_0x5412c8,_0x3d90c6){var _0x22920e=_0x1b8634[_0x0d83('0x5b')]['ids'];return db[_0x0d83('0x72')][_0x0d83('0x74')]({'where':{'id':_0x22920e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d83('0x75'),'attributes':['id',_0x0d83('0x3c'),_0x0d83('0x76'),_0x0d83('0x77'),_0x0d83('0x78')],'raw':!![]}]})['then'](function(_0x434983){if(_0x434983){var _0x5966c2=_['flatMap'](_0x434983,function(_0x1e0f46){var _0x4dd03d=_0x1e0f46[_0x0d83('0x5d')]({'plain':!![]});return _0x4dd03d[_0x0d83('0x75')];});return db['ChatQueue'][_0x0d83('0x59')]({'where':{'id':_0x1b8634['params']['id']}})[_0x0d83('0x22')](function(_0x236a1f){return db['sequelize']['transaction'](function(_0x99e8f4){return _0x236a1f[_0x0d83('0x73')](_0x22920e,{'transaction':_0x99e8f4})[_0x0d83('0x22')](function(){return BPromise[_0x0d83('0x79')](_0x5966c2,function(_0x1c0a46){return db[_0x0d83('0x67')][_0x0d83('0x7a')]({'where':{'UserId':_0x1c0a46['id'],'ChatQueueId':_0x1b8634[_0x0d83('0x62')]['id']},'transaction':_0x99e8f4});});})['then'](function(){_0x5966c2[_0x0d83('0x7b')](function(_0x470f57){socket[_0x0d83('0x7c')](_0x0d83('0x7d'),{'UserId':_0x470f57['id'],'ChatQueueId':_0x236a1f['id']});});});});});}})['then'](respondWithStatusCode(_0x5412c8,null))['catch'](handleError(_0x5412c8,null));};exports[_0x0d83('0x7e')]=function(_0x86a7b0,_0x1bcfa4,_0x33f0fd){return db[_0x0d83('0x72')][_0x0d83('0x74')]({'where':{'id':_0x86a7b0[_0x0d83('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0d83('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0d83('0x22')](handleEntityNotFound(_0x1bcfa4,null))[_0x0d83('0x22')](function(_0x4a9797){var _0x1656f5=_[_0x0d83('0x3f')](_0x4a9797,'id');var _0x2e0170=[];var _0x47c1d7=[];var _0x9340f2=squel['select']();_0x9340f2[_0x0d83('0x7f')](_0x0d83('0x80'))[_0x0d83('0x81')](_0x0d83('0x82'),'tq')['join'](_0x0d83('0x83'),'ut',_0x0d83('0x84'))['where'](_0x0d83('0x85'),_0x86a7b0[_0x0d83('0x62')]['id']);for(var _0x31f777=0x0;_0x31f777<_0x4a9797[_0x0d83('0x58')];_0x31f777+=0x1){let _0x3e28cb=_0x4a9797[_0x31f777];for(var _0x414ad5=0x0;_0x414ad5<_0x3e28cb[_0x0d83('0x75')][_0x0d83('0x58')];_0x414ad5+=0x1){let _0x4edf39=_0x3e28cb[_0x0d83('0x75')][_0x414ad5];var _0x1d09ad=_0x9340f2['clone']();_0x1d09ad[_0x0d83('0x4c')](_0x0d83('0x86'),_0x4edf39['id']);_0x47c1d7['push'](db[_0x0d83('0x87')][_0x0d83('0x44')](_0x1d09ad[_0x0d83('0x88')](),{'type':db[_0x0d83('0x87')][_0x0d83('0x89')][_0x0d83('0x8a')]})[_0x0d83('0x22')](function(_0x57a92d){if(_0x57a92d[_0x0d83('0x58')]===0x1){return _0x4edf39['id'];}else{var _0x327456=_['every'](_[_0x0d83('0x3f')](_0x57a92d,_0x0d83('0x8b')),function(_0x3f779f){return _['includes'](_0x1656f5,_0x3f779f);});if(_0x327456){return _0x4edf39['id'];}}}));}}return BPromise[_0x0d83('0x8c')](_0x47c1d7)['then'](function(_0x3a9843){_0x2e0170=_(_0x2e0170)[_0x0d83('0x8d')](_0x3a9843)['compact']()[_0x0d83('0x8e')]();return db[_0x0d83('0x53')]['find']({'where':{'id':_0x86a7b0[_0x0d83('0x62')]['id']}})[_0x0d83('0x22')](function(_0x8d4f5b){return db[_0x0d83('0x87')][_0x0d83('0x8f')](function(_0x590402){return _0x8d4f5b[_0x0d83('0x7e')](_0x86a7b0['query'][_0x0d83('0x90')],{'transaction':_0x590402})[_0x0d83('0x22')](function(){if(!_['isEmpty'](_0x2e0170)){return _0x8d4f5b['removeAgents'](_0x2e0170,{'transaction':_0x590402});}})[_0x0d83('0x22')](function(){_0x2e0170[_0x0d83('0x7b')](function(_0x3a19c1){socket[_0x0d83('0x7c')]('userChatQueue:remove',{'UserId':_0x3a19c1,'ChatQueueId':_0x8d4f5b['id']});});});});});});})['then'](respondWithStatusCode(_0x1bcfa4,null))['catch'](handleError(_0x1bcfa4,null));};exports[_0x0d83('0x91')]=function(_0x5220b4,_0x3e4166,_0x23c821){return db['ChatQueue'][_0x0d83('0x59')]({'where':{'id':_0x5220b4[_0x0d83('0x62')]['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x3e4166,null))['then'](function(_0x7e0250){if(_0x7e0250){return _0x7e0250[_0x0d83('0x91')](_0x5220b4['body'][_0x0d83('0x90')],_[_0x0d83('0x92')](_0x5220b4['body'],[_0x0d83('0x90'),'id'])||{})[_0x0d83('0x93')](function(_0x207ab8){for(var _0x574b48=0x0;_0x574b48<_0x5220b4[_0x0d83('0x5b')][_0x0d83('0x90')]['length'];_0x574b48+=0x1){socket[_0x0d83('0x7c')](_0x0d83('0x7d'),{'UserId':Number(_0x5220b4[_0x0d83('0x5b')]['ids'][_0x574b48]),'ChatQueueId':Number(_0x5220b4[_0x0d83('0x62')]['id'])});}return _0x207ab8;});}})[_0x0d83('0x22')](respondWithResult(_0x3e4166,null))[_0x0d83('0x2b')](handleError(_0x3e4166,null));};exports[_0x0d83('0x94')]=function(_0x323440,_0x352933,_0x4b6c0b){return db['ChatQueue'][_0x0d83('0x59')]({'where':{'id':_0x323440['params']['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x352933,null))[_0x0d83('0x22')](function(_0x2d19d3){if(_0x2d19d3){return _0x2d19d3['removeAgents'](_0x323440[_0x0d83('0x44')]['ids'])['then'](function(){if(_[_0x0d83('0x95')](_0x323440[_0x0d83('0x44')][_0x0d83('0x90')])){for(var _0x2f1e23=0x0;_0x2f1e23<_0x323440[_0x0d83('0x44')][_0x0d83('0x90')][_0x0d83('0x58')];_0x2f1e23+=0x1){socket[_0x0d83('0x7c')](_0x0d83('0x96'),{'UserId':Number(_0x323440['query']['ids'][_0x2f1e23]),'ChatQueueId':Number(_0x323440[_0x0d83('0x62')]['id'])});}}else{socket[_0x0d83('0x7c')](_0x0d83('0x96'),{'UserId':Number(_0x323440[_0x0d83('0x44')][_0x0d83('0x90')]),'ChatQueueId':Number(_0x323440[_0x0d83('0x62')]['id'])});}});}})[_0x0d83('0x22')](respondWithStatusCode(_0x352933,null))[_0x0d83('0x2b')](handleError(_0x352933,null));};exports[_0x0d83('0x97')]=function(_0x483ad0,_0x47796a,_0x208e34){var _0x5b819d={};var _0x2a4b35={};var _0x53f096;var _0x212d6c;return db[_0x0d83('0x53')][_0x0d83('0x64')]({'where':{'id':_0x483ad0[_0x0d83('0x62')]['id']}})[_0x0d83('0x22')](handleEntityNotFound(_0x47796a,null))[_0x0d83('0x22')](function(_0x2485df){if(_0x2485df){_0x53f096=_0x2485df;_0x2a4b35[_0x0d83('0x43')]=_[_0x0d83('0x45')](db[_0x0d83('0x68')][_0x0d83('0x40')]);_0x2a4b35[_0x0d83('0x44')]=_[_0x0d83('0x45')](_0x483ad0[_0x0d83('0x44')]);_0x2a4b35[_0x0d83('0x4d')]=_[_0x0d83('0x46')](_0x2a4b35[_0x0d83('0x43')],_0x2a4b35[_0x0d83('0x44')]);_0x5b819d['attributes']=_['intersection'](_0x2a4b35['model'],qs[_0x0d83('0x47')](_0x483ad0['query']['fields']));_0x5b819d[_0x0d83('0x48')]=_0x5b819d['attributes'][_0x0d83('0x58')]?_0x5b819d[_0x0d83('0x48')]:_0x2a4b35[_0x0d83('0x43')];_0x5b819d[_0x0d83('0x4a')]=qs[_0x0d83('0x4b')](_0x483ad0[_0x0d83('0x44')][_0x0d83('0x4b')]);_0x5b819d[_0x0d83('0x4c')]=qs[_0x0d83('0x4d')](_[_0x0d83('0x4e')](_0x483ad0['query'],_0x2a4b35[_0x0d83('0x4d')]));if(_0x483ad0[_0x0d83('0x44')][_0x0d83('0x4f')]){_0x5b819d[_0x0d83('0x4c')]=_['merge'](_0x5b819d[_0x0d83('0x4c')],{'$or':_[_0x0d83('0x3f')](_0x5b819d[_0x0d83('0x48')],function(_0x1c1395){var _0x253436={};_0x253436[_0x1c1395]={'$like':'%'+_0x483ad0[_0x0d83('0x44')][_0x0d83('0x4f')]+'%'};return _0x253436;})});}_0x5b819d=_[_0x0d83('0x50')]({},_0x5b819d,_0x483ad0[_0x0d83('0x52')]);return _0x53f096[_0x0d83('0x97')](_0x5b819d);}})['then'](function(_0x2bd0f6){if(_0x2bd0f6){_0x212d6c=_0x2bd0f6['length'];if(!_0x483ad0[_0x0d83('0x44')][_0x0d83('0x65')](_0x0d83('0x49'))){_0x5b819d[_0x0d83('0x31')]=qs[_0x0d83('0x31')](_0x483ad0[_0x0d83('0x44')][_0x0d83('0x31')]);_0x5b819d[_0x0d83('0x2f')]=qs['offset'](_0x483ad0[_0x0d83('0x44')]['offset']);}return _0x53f096[_0x0d83('0x97')](_0x5b819d);}})[_0x0d83('0x22')](function(_0x56143a){if(_0x56143a){return _0x56143a?{'count':_0x212d6c,'rows':_0x56143a}:null;}})[_0x0d83('0x22')](respondWithResult(_0x47796a,null))[_0x0d83('0x2b')](handleError(_0x47796a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f5fd8db..dc9b685 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 _0x5bf2=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0xf2d50f,_0x5e0487){var _0x2bf8de=function(_0x83c390){while(--_0x83c390){_0xf2d50f['push'](_0xf2d50f['shift']());}};_0x2bf8de(++_0x5e0487);}(_0x5bf2,0x129));var _0x25bf=function(_0x434196,_0x5cd879){_0x434196=_0x434196-0x0;var _0x4fb5bc=_0x5bf2[_0x434196];return _0x4fb5bc;};'use strict';var EventEmitter=require(_0x25bf('0x0'));var ChatQueue=require(_0x25bf('0x1'))['db'][_0x25bf('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x25bf('0x3')](0x0);var events={'afterCreate':_0x25bf('0x4'),'afterUpdate':'update','afterDestroy':_0x25bf('0x5')};function emitEvent(_0x5caaf5){return function(_0xd894ff,_0x2d229c,_0x14c0ed){ChatQueueEvents[_0x25bf('0x6')](_0x5caaf5+':'+_0xd894ff['id'],_0xd894ff);ChatQueueEvents[_0x25bf('0x6')](_0x5caaf5,_0xd894ff);_0x14c0ed(null);};}for(var e in events){if(events[_0x25bf('0x7')](e)){var event=events[e];ChatQueue[_0x25bf('0x8')](e,emitEvent(event));}}module[_0x25bf('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x4148=['setMaxListeners','save','hasOwnProperty','hook','ChatQueue'];(function(_0x18c55f,_0x327651){var _0x334690=function(_0x4510b0){while(--_0x4510b0){_0x18c55f['push'](_0x18c55f['shift']());}};_0x334690(++_0x327651);}(_0x4148,0xb8));var _0x8414=function(_0x504582,_0x5b3965){_0x504582=_0x504582-0x0;var _0x43c6ce=_0x4148[_0x504582];return _0x43c6ce;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x8414('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8414('0x1')](0x0);var events={'afterCreate':_0x8414('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x27de1c){return function(_0x1327fc,_0x171343,_0x3529f9){ChatQueueEvents['emit'](_0x27de1c+':'+_0x1327fc['id'],_0x1327fc);ChatQueueEvents['emit'](_0x27de1c,_0x1327fc);_0x3529f9(null);};}for(var e in events){if(events[_0x8414('0x3')](e)){var event=events[e];ChatQueue[_0x8414('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 3c4ed14..aa8d173 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 _0x15ec=['exports','ChatQueue','chat_queues','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x43f988,_0x59ce8e){var _0x1c4881=function(_0x49fa2d){while(--_0x49fa2d){_0x43f988['push'](_0x43f988['shift']());}};_0x1c4881(++_0x59ce8e);}(_0x15ec,0x16e));var _0xc15e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x15ec[_0x220dbb];return _0x2b77de;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc15e('0x0'));var moment=require(_0xc15e('0x1'));var BPromise=require(_0xc15e('0x2'));var rp=require(_0xc15e('0x3'));var fs=require('fs');var path=require(_0xc15e('0x4'));var rimraf=require(_0xc15e('0x5'));var config=require(_0xc15e('0x6'));var attributes=require(_0xc15e('0x7'));module[_0xc15e('0x8')]=function(_0x4e5241,_0x317bda){return _0x4e5241['define'](_0xc15e('0x9'),attributes,{'tableName':_0xc15e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50e4=['./chatQueue.attributes','exports','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5d37e9,_0x216245){var _0x2ae872=function(_0x262cf6){while(--_0x262cf6){_0x5d37e9['push'](_0x5d37e9['shift']());}};_0x2ae872(++_0x216245);}(_0x50e4,0xa4));var _0x450e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x50e4[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x450e('0x0'))(_0x450e('0x1'));var moment=require(_0x450e('0x2'));var BPromise=require(_0x450e('0x3'));var rp=require(_0x450e('0x4'));var fs=require('fs');var path=require(_0x450e('0x5'));var rimraf=require('rimraf');var config=require(_0x450e('0x6'));var attributes=require(_0x450e('0x7'));module[_0x450e('0x8')]=function(_0x49630c,_0x1a802f){return _0x49630c['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 5f854cd..7f1c10e 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 _0x84a0=['error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowChatQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47d0eb,_0x3e1cb8){var _0x20e011=function(_0x2ac42c){while(--_0x2ac42c){_0x47d0eb['push'](_0x47d0eb['shift']());}};_0x20e011(++_0x3e1cb8);}(_0x84a0,0x66));var _0x084a=function(_0x2538c5,_0x398f64){_0x2538c5=_0x2538c5-0x0;var _0x3965d5=_0x84a0[_0x2538c5];return _0x3965d5;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});config[_0x084a('0xa')]=_[_0x084a('0xb')](config[_0x084a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x084a('0xc'))(new Redis(config[_0x084a('0xa')]));require(_0x084a('0xd'))[_0x084a('0xe')](socket);function respondWithRpcPromise(_0x142127,_0x4c1e29,_0x4dd423){return new BPromise(function(_0x3d9dc6,_0x853df){return client[_0x084a('0xf')](_0x142127,_0x4dd423)[_0x084a('0x10')](function(_0x2d7c90){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));logger[_0x084a('0x12')](_0x084a('0x13'),_0x4c1e29,_0x084a('0x11'),JSON[_0x084a('0x14')](_0x2d7c90));if(_0x2d7c90[_0x084a('0x15')]){if(_0x2d7c90[_0x084a('0x15')][_0x084a('0x16')]===0x1f4){logger['error'](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x853df(_0x2d7c90[_0x084a('0x15')][_0x084a('0x18')]);}logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x3d9dc6(_0x2d7c90['error'][_0x084a('0x18')]);}else{logger[_0x084a('0x19')]('ChatQueue,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));_0x3d9dc6(_0x2d7c90[_0x084a('0x1a')][_0x084a('0x18')]);}})[_0x084a('0x1b')](function(_0x33d3a6){logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x33d3a6);_0x853df(_0x33d3a6);});});}exports[_0x084a('0x1c')]=function(_0x3f60cf){var _0xcb5356=this;return new Promise(function(_0x3c7fd6,_0x279e25){return db[_0x084a('0x1d')][_0x084a('0x1e')]({'raw':_0x3f60cf[_0x084a('0x1f')]?_0x3f60cf['options'][_0x084a('0x20')]===undefined?!![]:![]:!![],'where':_0x3f60cf[_0x084a('0x1f')]?_0x3f60cf[_0x084a('0x1f')][_0x084a('0x21')]||null:null,'attributes':_0x3f60cf[_0x084a('0x1f')]?_0x3f60cf['options'][_0x084a('0x22')]||null:null,'limit':_0x3f60cf[_0x084a('0x1f')]?_0x3f60cf[_0x084a('0x1f')][_0x084a('0x23')]||null:null,'include':_0x3f60cf[_0x084a('0x1f')]?_0x3f60cf[_0x084a('0x1f')]['include']?_[_0x084a('0x24')](_0x3f60cf[_0x084a('0x1f')][_0x084a('0x25')],function(_0x5b1474){return{'model':db[_0x5b1474[_0x084a('0x26')]],'as':_0x5b1474['as'],'attributes':_0x5b1474[_0x084a('0x22')],'include':_0x5b1474[_0x084a('0x25')]?_['map'](_0x5b1474['include'],function(_0x4874fe){return{'model':db[_0x4874fe['model']],'as':_0x4874fe['as'],'attributes':_0x4874fe[_0x084a('0x22')],'include':_0x4874fe['include']?_['map'](_0x4874fe['include'],function(_0x3b8176){return{'model':db[_0x3b8176[_0x084a('0x26')]],'as':_0x3b8176['as'],'attributes':_0x3b8176[_0x084a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x084a('0x10')](function(_0x3be7a6){logger[_0x084a('0x19')](_0x084a('0x1c'),_0x3f60cf);logger[_0x084a('0x12')]('GetChatQueue',_0x3f60cf,JSON[_0x084a('0x14')](_0x3be7a6));_0x3c7fd6(_0x3be7a6);})[_0x084a('0x1b')](function(_0x501a16){logger[_0x084a('0x15')](_0x084a('0x1c'),_0x501a16[_0x084a('0x18')],_0x3f60cf);_0x279e25(_0xcb5356[_0x084a('0x15')](0x1f4,_0x501a16[_0x084a('0x18')]));});});};exports[_0x084a('0x27')]=function(_0x3a99fe){var _0x1e971a=this;return new Promise(function(_0x50cb54,_0x2f59a6){return db[_0x084a('0x1d')][_0x084a('0x28')]({'raw':_0x3a99fe[_0x084a('0x1f')]?_0x3a99fe['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a99fe[_0x084a('0x1f')]?_0x3a99fe[_0x084a('0x1f')][_0x084a('0x21')]||null:null,'attributes':_0x3a99fe[_0x084a('0x1f')]?_0x3a99fe[_0x084a('0x1f')]['attributes']||null:null,'include':_0x3a99fe[_0x084a('0x1f')]?_0x3a99fe[_0x084a('0x1f')][_0x084a('0x25')]?_['map'](_0x3a99fe[_0x084a('0x1f')][_0x084a('0x25')],function(_0x2e1d11){return{'model':db[_0x2e1d11['model']],'as':_0x2e1d11['as'],'attributes':_0x2e1d11['attributes'],'include':_0x2e1d11['include']?_[_0x084a('0x24')](_0x2e1d11[_0x084a('0x25')],function(_0x1444ed){return{'model':db[_0x1444ed['model']],'as':_0x1444ed['as'],'attributes':_0x1444ed[_0x084a('0x22')],'include':_0x1444ed[_0x084a('0x25')]?_[_0x084a('0x24')](_0x1444ed[_0x084a('0x25')],function(_0x28a0a5){return{'model':db[_0x28a0a5[_0x084a('0x26')]],'as':_0x28a0a5['as'],'attributes':_0x28a0a5[_0x084a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x084a('0x10')](function(_0x434a06){logger[_0x084a('0x19')](_0x084a('0x27'),_0x3a99fe);logger[_0x084a('0x12')](_0x084a('0x27'),_0x3a99fe,JSON[_0x084a('0x14')](_0x434a06));_0x50cb54(_0x434a06);})[_0x084a('0x1b')](function(_0x597d87){logger[_0x084a('0x15')](_0x084a('0x27'),_0x597d87[_0x084a('0x18')],_0x3a99fe);_0x2f59a6(_0x1e971a[_0x084a('0x15')](0x1f4,_0x597d87[_0x084a('0x18')]));});});};
\ No newline at end of file
+var _0x1a83=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','then','debug','stringify','ShowChatQueue','find','catch','lodash','util','moment'];(function(_0x3175e2,_0x7e4531){var _0x35a692=function(_0x2b5987){while(--_0x2b5987){_0x3175e2['push'](_0x3175e2['shift']());}};_0x35a692(++_0x7e4531);}(_0x1a83,0x1c0));var _0x31a8=function(_0x24c113,_0x44dc9a){_0x24c113=_0x24c113-0x0;var _0x3b63cc=_0x1a83[_0x24c113];return _0x3b63cc;};'use strict';var _=require(_0x31a8('0x0'));var util=require(_0x31a8('0x1'));var moment=require(_0x31a8('0x2'));var BPromise=require('bluebird');var rs=require(_0x31a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31a8('0x4'))['db'];var utils=require(_0x31a8('0x5'));var logger=require(_0x31a8('0x6'))(_0x31a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x31a8('0x8')][_0x31a8('0x9')]({'port':0x232a});config[_0x31a8('0xa')]=_[_0x31a8('0xb')](config[_0x31a8('0xa')],{'host':_0x31a8('0xc'),'port':0x18eb});var socket=require(_0x31a8('0xd'))(new Redis(config[_0x31a8('0xa')]));require(_0x31a8('0xe'))[_0x31a8('0xf')](socket);function respondWithRpcPromise(_0x4f1881,_0x310a3c,_0x486ab0){return new BPromise(function(_0x4a1446,_0x3b0e78){return client[_0x31a8('0x10')](_0x4f1881,_0x486ab0)['then'](function(_0x2b5927){logger[_0x31a8('0x11')](_0x31a8('0x12'),_0x310a3c,_0x31a8('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x310a3c,_0x31a8('0x13'),JSON['stringify'](_0x2b5927));if(_0x2b5927[_0x31a8('0x14')]){if(_0x2b5927['error'][_0x31a8('0x15')]===0x1f4){logger[_0x31a8('0x14')](_0x31a8('0x12'),_0x310a3c,_0x2b5927['error'][_0x31a8('0x16')]);return _0x3b0e78(_0x2b5927[_0x31a8('0x14')]['message']);}logger[_0x31a8('0x14')]('ChatQueue,\x20%s,\x20%s',_0x310a3c,_0x2b5927[_0x31a8('0x14')][_0x31a8('0x16')]);return _0x4a1446(_0x2b5927['error'][_0x31a8('0x16')]);}else{logger[_0x31a8('0x11')](_0x31a8('0x12'),_0x310a3c,_0x31a8('0x13'));_0x4a1446(_0x2b5927[_0x31a8('0x17')][_0x31a8('0x16')]);}})['catch'](function(_0x44b4f2){logger[_0x31a8('0x14')]('ChatQueue,\x20%s,\x20%s',_0x310a3c,_0x44b4f2);_0x3b0e78(_0x44b4f2);});});}exports[_0x31a8('0x18')]=function(_0x35475a){var _0x44a515=this;return new Promise(function(_0x228e79,_0x552af8){return db[_0x31a8('0x19')][_0x31a8('0x1a')]({'raw':_0x35475a[_0x31a8('0x1b')]?_0x35475a[_0x31a8('0x1b')][_0x31a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x35475a[_0x31a8('0x1b')]?_0x35475a[_0x31a8('0x1b')][_0x31a8('0x1d')]||null:null,'attributes':_0x35475a[_0x31a8('0x1b')]?_0x35475a['options']['attributes']||null:null,'limit':_0x35475a[_0x31a8('0x1b')]?_0x35475a['options'][_0x31a8('0x1e')]||null:null,'include':_0x35475a[_0x31a8('0x1b')]?_0x35475a[_0x31a8('0x1b')]['include']?_[_0x31a8('0x1f')](_0x35475a[_0x31a8('0x1b')][_0x31a8('0x20')],function(_0x36a7b1){return{'model':db[_0x36a7b1[_0x31a8('0x21')]],'as':_0x36a7b1['as'],'attributes':_0x36a7b1[_0x31a8('0x22')],'include':_0x36a7b1[_0x31a8('0x20')]?_['map'](_0x36a7b1[_0x31a8('0x20')],function(_0x4a1e58){return{'model':db[_0x4a1e58[_0x31a8('0x21')]],'as':_0x4a1e58['as'],'attributes':_0x4a1e58[_0x31a8('0x22')],'include':_0x4a1e58[_0x31a8('0x20')]?_[_0x31a8('0x1f')](_0x4a1e58['include'],function(_0x510641){return{'model':db[_0x510641['model']],'as':_0x510641['as'],'attributes':_0x510641['attributes']};}):[]};}):[]};}):[]:[]})[_0x31a8('0x23')](function(_0x2e5165){logger[_0x31a8('0x11')](_0x31a8('0x18'),_0x35475a);logger[_0x31a8('0x24')]('GetChatQueue',_0x35475a,JSON[_0x31a8('0x25')](_0x2e5165));_0x228e79(_0x2e5165);})['catch'](function(_0x5aa4a4){logger[_0x31a8('0x14')](_0x31a8('0x18'),_0x5aa4a4[_0x31a8('0x16')],_0x35475a);_0x552af8(_0x44a515[_0x31a8('0x14')](0x1f4,_0x5aa4a4[_0x31a8('0x16')]));});});};exports[_0x31a8('0x26')]=function(_0x362ff1){var _0x32aafb=this;return new Promise(function(_0x5652ac,_0x4074c1){return db['ChatQueue'][_0x31a8('0x27')]({'raw':_0x362ff1[_0x31a8('0x1b')]?_0x362ff1['options']['raw']===undefined?!![]:![]:!![],'where':_0x362ff1[_0x31a8('0x1b')]?_0x362ff1[_0x31a8('0x1b')][_0x31a8('0x1d')]||null:null,'attributes':_0x362ff1[_0x31a8('0x1b')]?_0x362ff1['options'][_0x31a8('0x22')]||null:null,'include':_0x362ff1[_0x31a8('0x1b')]?_0x362ff1['options']['include']?_[_0x31a8('0x1f')](_0x362ff1[_0x31a8('0x1b')]['include'],function(_0x595f42){return{'model':db[_0x595f42[_0x31a8('0x21')]],'as':_0x595f42['as'],'attributes':_0x595f42[_0x31a8('0x22')],'include':_0x595f42['include']?_[_0x31a8('0x1f')](_0x595f42[_0x31a8('0x20')],function(_0x2e213a){return{'model':db[_0x2e213a['model']],'as':_0x2e213a['as'],'attributes':_0x2e213a['attributes'],'include':_0x2e213a[_0x31a8('0x20')]?_[_0x31a8('0x1f')](_0x2e213a[_0x31a8('0x20')],function(_0x53815b){return{'model':db[_0x53815b['model']],'as':_0x53815b['as'],'attributes':_0x53815b[_0x31a8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a93a1){logger['info']('ShowChatQueue',_0x362ff1);logger[_0x31a8('0x24')](_0x31a8('0x26'),_0x362ff1,JSON[_0x31a8('0x25')](_0x1a93a1));_0x5652ac(_0x1a93a1);})[_0x31a8('0x28')](function(_0x4f611d){logger['error'](_0x31a8('0x26'),_0x4f611d['message'],_0x362ff1);_0x4074c1(_0x32aafb[_0x31a8('0x14')](0x1f4,_0x4f611d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e564b73..6bdb4f4 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 _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x4cc820,_0xb017ac){var _0x15096d=function(_0x40a7cd){while(--_0x40a7cd){_0x4cc820['push'](_0x4cc820['shift']());}};_0x15096d(++_0xb017ac);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x56c917,_0x211cf7){_0x56c917=_0x56c917-0x0;var _0x22a37d=_0x8d0e[_0x56c917];return _0x22a37d;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
+var _0xed1f=['register','length','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xed1f,0x6a));var _0xfed1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xed1f[_0x580647];return _0x5f0792;};'use strict';var ChatQueueEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){ChatQueueEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('chatQueue:'+_0x2a6082,_0x3d6706);ChatQueueEvents['on'](_0x2a6082,_0x2967ef);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 320c328..b744df3 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0x5fc3[_0x587ba2];return _0x50ec73;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x19a543,_0x357324){var _0x595130=function(_0x30af71){while(--_0x30af71){_0x19a543['push'](_0x19a543['shift']());}};_0x595130(++_0x357324);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 25b7134..dff4147 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 _0xd5d6=['exports','STRING','DATE','moment'];(function(_0x26bddd,_0x150143){var _0x179b2d=function(_0x2a6edf){while(--_0x2a6edf){_0x26bddd['push'](_0x26bddd['shift']());}};_0x179b2d(++_0x150143);}(_0xd5d6,0xcb));var _0x6d5d=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xd5d6[_0x45e98e];return _0x374dba;};'use strict';var moment=require(_0x6d5d('0x0'));var Sequelize=require('sequelize');module[_0x6d5d('0x1')]={'uniqueid':{'type':Sequelize[_0x6d5d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6d5d('0x2')]},'joinAt':{'type':Sequelize[_0x6d5d('0x3')]},'leaveAt':{'type':Sequelize[_0x6d5d('0x3')]},'acceptAt':{'type':Sequelize[_0x6d5d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc4ea=['exports','STRING','DATE','sequelize'];(function(_0x4ae2fb,_0x1c1c67){var _0x4f5268=function(_0x11236b){while(--_0x11236b){_0x4ae2fb['push'](_0x4ae2fb['shift']());}};_0x4f5268(++_0x1c1c67);}(_0xc4ea,0x1ef));var _0xac4e=function(_0x52804e,_0x829346){_0x52804e=_0x52804e-0x0;var _0x12d452=_0xc4ea[_0x52804e];return _0x12d452;};'use strict';var moment=require('moment');var Sequelize=require(_0xac4e('0x0'));module[_0xac4e('0x1')]={'uniqueid':{'type':Sequelize[_0xac4e('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xac4e('0x3')]},'acceptAt':{'type':Sequelize[_0xac4e('0x3')]},'exitAt':{'type':Sequelize[_0xac4e('0x3')]},'reason':{'type':Sequelize[_0xac4e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9ce04e7..4d7d5dc 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 _0x8ca9=['show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','sendStatus','stack','index','map','ChatQueueReport','type','key','name','keys','filters','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x8ca9,0x9c));var _0x98ca=function(_0x54ad9,_0x4225e4){_0x54ad9=_0x54ad9-0x0;var _0x40c45a=_0x8ca9[_0x54ad9];return _0x40c45a;};'use strict';var emlformat=require(_0x98ca('0x0'));var rimraf=require(_0x98ca('0x1'));var zipdir=require(_0x98ca('0x2'));var jsonpatch=require(_0x98ca('0x3'));var rp=require(_0x98ca('0x4'));var moment=require(_0x98ca('0x5'));var BPromise=require(_0x98ca('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x98ca('0x7'));var sox=require('sox');var csv=require(_0x98ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98ca('0x9'));var _=require(_0x98ca('0xa'));var squel=require(_0x98ca('0xb'));var crypto=require(_0x98ca('0xc'));var jsforce=require(_0x98ca('0xd'));var deskjs=require(_0x98ca('0xe'));var toCsv=require(_0x98ca('0x8'));var querystring=require(_0x98ca('0xf'));var Papa=require(_0x98ca('0x10'));var Redis=require(_0x98ca('0x11'));var authService=require(_0x98ca('0x12'));var qs=require(_0x98ca('0x13'));var as=require(_0x98ca('0x14'));var hardwareService=require(_0x98ca('0x15'));var logger=require(_0x98ca('0x16'))(_0x98ca('0x17'));var utils=require(_0x98ca('0x18'));var config=require(_0x98ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x98ca('0x1a'))['db'];function respondWithStatusCode(_0x44b65b,_0xba3887){_0xba3887=_0xba3887||0xcc;return function(_0x472e13){if(_0x472e13){return _0x44b65b['sendStatus'](_0xba3887);}return _0x44b65b[_0x98ca('0x1b')](_0xba3887)[_0x98ca('0x1c')]();};}function respondWithResult(_0x9a230e,_0xa2bab4){_0xa2bab4=_0xa2bab4||0xc8;return function(_0x3df0ef){if(_0x3df0ef){return _0x9a230e[_0x98ca('0x1b')](_0xa2bab4)[_0x98ca('0x1d')](_0x3df0ef);}};}function respondWithFilteredResult(_0x4940ca,_0x330713){return function(_0x29df1b){if(_0x29df1b){var _0x29f46b=typeof _0x330713[_0x98ca('0x1e')]==='undefined'&&typeof _0x330713[_0x98ca('0x1f')]===_0x98ca('0x20');var _0xe9f8ad=_0x29df1b[_0x98ca('0x21')];var _0x4523bb=_0x29f46b?0x0:_0x330713[_0x98ca('0x1e')];var _0x28c8a6=_0x29f46b?_0x29df1b[_0x98ca('0x21')]:_0x330713[_0x98ca('0x1e')]+_0x330713[_0x98ca('0x1f')];var _0x1b2c69;if(_0x28c8a6>=_0xe9f8ad){_0x28c8a6=_0xe9f8ad;_0x1b2c69=0xc8;}else{_0x1b2c69=0xce;}_0x4940ca['status'](_0x1b2c69);return _0x4940ca[_0x98ca('0x22')]('Content-Range',_0x4523bb+'-'+_0x28c8a6+'/'+_0xe9f8ad)[_0x98ca('0x1d')](_0x29df1b);}return null;};}function patchUpdates(_0x2fe568){return function(_0x50f8b4){try{jsonpatch['apply'](_0x50f8b4,_0x2fe568,!![]);}catch(_0x4620e3){return BPromise[_0x98ca('0x23')](_0x4620e3);}return _0x50f8b4[_0x98ca('0x24')]();};}function saveUpdates(_0x519927,_0x2f7742){return function(_0xc23332){if(_0xc23332){return _0xc23332['update'](_0x519927)[_0x98ca('0x25')](function(_0x5dc400){return _0x5dc400;});}return null;};}function removeEntity(_0x3fd0bd,_0x323cdb){return function(_0x430d16){if(_0x430d16){return _0x430d16[_0x98ca('0x26')]()[_0x98ca('0x25')](function(){_0x3fd0bd[_0x98ca('0x1b')](0xcc)[_0x98ca('0x1c')]();});}};}function handleEntityNotFound(_0x50b1a2,_0x2029cb){return function(_0x4fc3c9){if(!_0x4fc3c9){_0x50b1a2[_0x98ca('0x27')](0x194);}return _0x4fc3c9;};}function handleError(_0x1bdb75,_0x5eb829){_0x5eb829=_0x5eb829||0x1f4;return function(_0x1f569b){logger['error'](_0x1f569b[_0x98ca('0x28')]);if(_0x1f569b['name']){delete _0x1f569b['name'];}_0x1bdb75[_0x98ca('0x1b')](_0x5eb829)['send'](_0x1f569b);};}exports[_0x98ca('0x29')]=function(_0x35b920,_0x13f766){var _0x21a12a={},_0x3b3e60={},_0x1e7fcf={'count':0x0,'rows':[]};var _0x11389a=_[_0x98ca('0x2a')](db[_0x98ca('0x2b')]['rawAttributes'],function(_0x2ebf28){return{'name':_0x2ebf28['fieldName'],'type':_0x2ebf28[_0x98ca('0x2c')][_0x98ca('0x2d')]};});_0x3b3e60['model']=_['map'](_0x11389a,_0x98ca('0x2e'));_0x3b3e60['query']=_[_0x98ca('0x2f')](_0x35b920['query']);_0x3b3e60[_0x98ca('0x30')]=_['intersection'](_0x3b3e60[_0x98ca('0x31')],_0x3b3e60[_0x98ca('0x32')]);_0x21a12a['attributes']=_[_0x98ca('0x33')](_0x3b3e60[_0x98ca('0x31')],qs['fields'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x34')]));_0x21a12a['attributes']=_0x21a12a[_0x98ca('0x35')][_0x98ca('0x36')]?_0x21a12a[_0x98ca('0x35')]:_0x3b3e60[_0x98ca('0x31')];if(!_0x35b920[_0x98ca('0x32')]['hasOwnProperty'](_0x98ca('0x37'))){_0x21a12a[_0x98ca('0x1f')]=qs['limit'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x1f')]);_0x21a12a[_0x98ca('0x1e')]=qs['offset'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x1e')]);}_0x21a12a[_0x98ca('0x38')]=qs['sort'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x39')]);_0x21a12a[_0x98ca('0x3a')]=qs['filters'](_['pick'](_0x35b920[_0x98ca('0x32')],_0x3b3e60[_0x98ca('0x30')]),_0x11389a);if(_0x35b920[_0x98ca('0x32')]['filter']){_0x21a12a[_0x98ca('0x3a')]=_[_0x98ca('0x3b')](_0x21a12a[_0x98ca('0x3a')],{'$or':_['map'](_0x11389a,function(_0x1f513b){if(_0x1f513b[_0x98ca('0x2c')]!==_0x98ca('0x3c')){var _0x450745={};_0x450745[_0x1f513b[_0x98ca('0x2e')]]={'$like':'%'+_0x35b920['query']['filter']+'%'};return _0x450745;}})});}_0x21a12a=_['merge']({},_0x21a12a,_0x35b920[_0x98ca('0x3d')]);var _0x2ef2f4={'where':_0x21a12a[_0x98ca('0x3a')]};return db[_0x98ca('0x2b')][_0x98ca('0x21')](_0x2ef2f4)[_0x98ca('0x25')](function(_0x29801f){_0x1e7fcf['count']=_0x29801f;if(_0x35b920['query'][_0x98ca('0x3e')]){_0x21a12a[_0x98ca('0x3f')]=[{'all':!![]}];}return db[_0x98ca('0x2b')][_0x98ca('0x40')](_0x21a12a);})[_0x98ca('0x25')](function(_0x535fdc){_0x1e7fcf['rows']=_0x535fdc;return _0x1e7fcf;})['then'](respondWithFilteredResult(_0x13f766,_0x21a12a))[_0x98ca('0x41')](handleError(_0x13f766,null));};exports[_0x98ca('0x42')]=function(_0x914606,_0x3f260b){var _0x4ede34={'raw':!![],'where':{'id':_0x914606[_0x98ca('0x43')]['id']}},_0x4c2515={};_0x4c2515[_0x98ca('0x31')]=_[_0x98ca('0x2f')](db[_0x98ca('0x2b')][_0x98ca('0x44')]);_0x4c2515[_0x98ca('0x32')]=_[_0x98ca('0x2f')](_0x914606[_0x98ca('0x32')]);_0x4c2515[_0x98ca('0x30')]=_[_0x98ca('0x33')](_0x4c2515[_0x98ca('0x31')],_0x4c2515['query']);_0x4ede34[_0x98ca('0x35')]=_[_0x98ca('0x33')](_0x4c2515[_0x98ca('0x31')],qs[_0x98ca('0x34')](_0x914606[_0x98ca('0x32')][_0x98ca('0x34')]));_0x4ede34[_0x98ca('0x35')]=_0x4ede34[_0x98ca('0x35')][_0x98ca('0x36')]?_0x4ede34['attributes']:_0x4c2515[_0x98ca('0x31')];if(_0x914606[_0x98ca('0x32')]['includeAll']){_0x4ede34[_0x98ca('0x3f')]=[{'all':!![]}];}_0x4ede34=_['merge']({},_0x4ede34,_0x914606[_0x98ca('0x3d')]);return db[_0x98ca('0x2b')][_0x98ca('0x45')](_0x4ede34)[_0x98ca('0x25')](handleEntityNotFound(_0x3f260b,null))[_0x98ca('0x25')](respondWithResult(_0x3f260b,null))[_0x98ca('0x41')](handleError(_0x3f260b,null));};exports[_0x98ca('0x46')]=function(_0x15ed74,_0x2c7d53){return db[_0x98ca('0x2b')][_0x98ca('0x46')](_0x15ed74[_0x98ca('0x47')],{})['then'](respondWithResult(_0x2c7d53,0xc9))[_0x98ca('0x41')](handleError(_0x2c7d53,null));};exports[_0x98ca('0x48')]=function(_0x40498f,_0x19dc39){if(_0x40498f['body']['id']){delete _0x40498f[_0x98ca('0x47')]['id'];}return db[_0x98ca('0x2b')][_0x98ca('0x45')]({'where':{'id':_0x40498f[_0x98ca('0x43')]['id']}})[_0x98ca('0x25')](handleEntityNotFound(_0x19dc39,null))[_0x98ca('0x25')](saveUpdates(_0x40498f[_0x98ca('0x47')],null))['then'](respondWithResult(_0x19dc39,null))['catch'](handleError(_0x19dc39,null));};exports['destroy']=function(_0x3247af,_0x3715cb){return db[_0x98ca('0x2b')][_0x98ca('0x45')]({'where':{'id':_0x3247af['params']['id']}})['then'](handleEntityNotFound(_0x3715cb,null))[_0x98ca('0x25')](removeEntity(_0x3715cb,null))[_0x98ca('0x41')](handleError(_0x3715cb,null));};exports[_0x98ca('0x49')]=function(_0x408266,_0x46bb13){return db[_0x98ca('0x2b')][_0x98ca('0x49')]()[_0x98ca('0x25')](respondWithResult(_0x46bb13,null))[_0x98ca('0x41')](handleError(_0x46bb13,null));};
\ No newline at end of file
+var _0xba0d=['path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','sort','pick','where','map','type','VIRTUAL','filter','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x4d72aa,_0x5752e3){var _0x22c759=function(_0x27d06f){while(--_0x27d06f){_0x4d72aa['push'](_0x4d72aa['shift']());}};_0x22c759(++_0x5752e3);}(_0xba0d,0x8e));var _0xdba0=function(_0x251acc,_0x31dd90){_0x251acc=_0x251acc-0x0;var _0x5f2a2d=_0xba0d[_0x251acc];return _0x5f2a2d;};'use strict';var emlformat=require(_0xdba0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdba0('0x1'));var jsonpatch=require(_0xdba0('0x2'));var rp=require(_0xdba0('0x3'));var moment=require('moment');var BPromise=require(_0xdba0('0x4'));var Mustache=require('mustache');var util=require(_0xdba0('0x5'));var path=require(_0xdba0('0x6'));var sox=require(_0xdba0('0x7'));var csv=require(_0xdba0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdba0('0x9'));var squel=require(_0xdba0('0xa'));var crypto=require(_0xdba0('0xb'));var jsforce=require(_0xdba0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdba0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdba0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdba0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdba0('0xf'));var logger=require(_0xdba0('0x10'))(_0xdba0('0x11'));var utils=require(_0xdba0('0x12'));var config=require(_0xdba0('0x13'));var licenseUtil=require(_0xdba0('0x14'));var db=require(_0xdba0('0x15'))['db'];function respondWithStatusCode(_0x43ae3a,_0x4fe80c){_0x4fe80c=_0x4fe80c||0xcc;return function(_0x49e581){if(_0x49e581){return _0x43ae3a[_0xdba0('0x16')](_0x4fe80c);}return _0x43ae3a[_0xdba0('0x17')](_0x4fe80c)[_0xdba0('0x18')]();};}function respondWithResult(_0x1c7dbf,_0x29f3f7){_0x29f3f7=_0x29f3f7||0xc8;return function(_0x28da4c){if(_0x28da4c){return _0x1c7dbf[_0xdba0('0x17')](_0x29f3f7)['json'](_0x28da4c);}};}function respondWithFilteredResult(_0x327932,_0x722955){return function(_0x3e47da){if(_0x3e47da){var _0xb0ffc4=typeof _0x722955[_0xdba0('0x19')]===_0xdba0('0x1a')&&typeof _0x722955[_0xdba0('0x1b')]===_0xdba0('0x1a');var _0x119c31=_0x3e47da[_0xdba0('0x1c')];var _0x479a46=_0xb0ffc4?0x0:_0x722955[_0xdba0('0x19')];var _0x5e954c=_0xb0ffc4?_0x3e47da[_0xdba0('0x1c')]:_0x722955[_0xdba0('0x19')]+_0x722955[_0xdba0('0x1b')];var _0x436fff;if(_0x5e954c>=_0x119c31){_0x5e954c=_0x119c31;_0x436fff=0xc8;}else{_0x436fff=0xce;}_0x327932['status'](_0x436fff);return _0x327932['set'](_0xdba0('0x1d'),_0x479a46+'-'+_0x5e954c+'/'+_0x119c31)[_0xdba0('0x1e')](_0x3e47da);}return null;};}function patchUpdates(_0x57f5e1){return function(_0x281669){try{jsonpatch[_0xdba0('0x1f')](_0x281669,_0x57f5e1,!![]);}catch(_0x907a7a){return BPromise['reject'](_0x907a7a);}return _0x281669[_0xdba0('0x20')]();};}function saveUpdates(_0x157da2,_0x35a741){return function(_0x11ded6){if(_0x11ded6){return _0x11ded6[_0xdba0('0x21')](_0x157da2)[_0xdba0('0x22')](function(_0xe4ac33){return _0xe4ac33;});}return null;};}function removeEntity(_0x41d2d8,_0x21932d){return function(_0x46525a){if(_0x46525a){return _0x46525a[_0xdba0('0x23')]()['then'](function(){_0x41d2d8[_0xdba0('0x17')](0xcc)[_0xdba0('0x18')]();});}};}function handleEntityNotFound(_0x4873de,_0x80ec5b){return function(_0x4ac548){if(!_0x4ac548){_0x4873de[_0xdba0('0x16')](0x194);}return _0x4ac548;};}function handleError(_0x1eb891,_0x5d61e0){_0x5d61e0=_0x5d61e0||0x1f4;return function(_0x4ad40f){logger[_0xdba0('0x24')](_0x4ad40f[_0xdba0('0x25')]);if(_0x4ad40f[_0xdba0('0x26')]){delete _0x4ad40f[_0xdba0('0x26')];}_0x1eb891[_0xdba0('0x17')](_0x5d61e0)[_0xdba0('0x27')](_0x4ad40f);};}exports[_0xdba0('0x28')]=function(_0x59b3e7,_0x4891e0){var _0x3cf6c4={},_0x1d91a3={},_0x3d90c1={'count':0x0,'rows':[]};var _0x1c99d4=_['map'](db['ChatQueueReport'][_0xdba0('0x29')],function(_0x5b199b){return{'name':_0x5b199b[_0xdba0('0x2a')],'type':_0x5b199b['type'][_0xdba0('0x2b')]};});_0x1d91a3[_0xdba0('0x2c')]=_['map'](_0x1c99d4,_0xdba0('0x26'));_0x1d91a3[_0xdba0('0x2d')]=_[_0xdba0('0x2e')](_0x59b3e7[_0xdba0('0x2d')]);_0x1d91a3[_0xdba0('0x2f')]=_[_0xdba0('0x30')](_0x1d91a3[_0xdba0('0x2c')],_0x1d91a3['query']);_0x3cf6c4['attributes']=_[_0xdba0('0x30')](_0x1d91a3[_0xdba0('0x2c')],qs[_0xdba0('0x31')](_0x59b3e7[_0xdba0('0x2d')][_0xdba0('0x31')]));_0x3cf6c4['attributes']=_0x3cf6c4['attributes'][_0xdba0('0x32')]?_0x3cf6c4[_0xdba0('0x33')]:_0x1d91a3['model'];if(!_0x59b3e7[_0xdba0('0x2d')]['hasOwnProperty'](_0xdba0('0x34'))){_0x3cf6c4[_0xdba0('0x1b')]=qs[_0xdba0('0x1b')](_0x59b3e7[_0xdba0('0x2d')][_0xdba0('0x1b')]);_0x3cf6c4[_0xdba0('0x19')]=qs[_0xdba0('0x19')](_0x59b3e7['query'][_0xdba0('0x19')]);}_0x3cf6c4['order']=qs['sort'](_0x59b3e7[_0xdba0('0x2d')][_0xdba0('0x35')]);_0x3cf6c4['where']=qs[_0xdba0('0x2f')](_[_0xdba0('0x36')](_0x59b3e7['query'],_0x1d91a3['filters']),_0x1c99d4);if(_0x59b3e7['query']['filter']){_0x3cf6c4[_0xdba0('0x37')]=_['merge'](_0x3cf6c4['where'],{'$or':_[_0xdba0('0x38')](_0x1c99d4,function(_0x5f4146){if(_0x5f4146[_0xdba0('0x39')]!==_0xdba0('0x3a')){var _0x4121ac={};_0x4121ac[_0x5f4146[_0xdba0('0x26')]]={'$like':'%'+_0x59b3e7[_0xdba0('0x2d')][_0xdba0('0x3b')]+'%'};return _0x4121ac;}})});}_0x3cf6c4=_[_0xdba0('0x3c')]({},_0x3cf6c4,_0x59b3e7[_0xdba0('0x3d')]);var _0x470f41={'where':_0x3cf6c4[_0xdba0('0x37')]};return db[_0xdba0('0x3e')][_0xdba0('0x1c')](_0x470f41)['then'](function(_0x101e2c){_0x3d90c1[_0xdba0('0x1c')]=_0x101e2c;if(_0x59b3e7['query'][_0xdba0('0x3f')]){_0x3cf6c4[_0xdba0('0x40')]=[{'all':!![]}];}return db[_0xdba0('0x3e')][_0xdba0('0x41')](_0x3cf6c4);})[_0xdba0('0x22')](function(_0x20d5cf){_0x3d90c1[_0xdba0('0x42')]=_0x20d5cf;return _0x3d90c1;})[_0xdba0('0x22')](respondWithFilteredResult(_0x4891e0,_0x3cf6c4))[_0xdba0('0x43')](handleError(_0x4891e0,null));};exports[_0xdba0('0x44')]=function(_0xb1f5f1,_0x4296c1){var _0x39963d={'raw':!![],'where':{'id':_0xb1f5f1[_0xdba0('0x45')]['id']}},_0x58d14f={};_0x58d14f['model']=_[_0xdba0('0x2e')](db[_0xdba0('0x3e')]['rawAttributes']);_0x58d14f['query']=_['keys'](_0xb1f5f1['query']);_0x58d14f[_0xdba0('0x2f')]=_[_0xdba0('0x30')](_0x58d14f['model'],_0x58d14f['query']);_0x39963d[_0xdba0('0x33')]=_[_0xdba0('0x30')](_0x58d14f[_0xdba0('0x2c')],qs[_0xdba0('0x31')](_0xb1f5f1[_0xdba0('0x2d')][_0xdba0('0x31')]));_0x39963d[_0xdba0('0x33')]=_0x39963d[_0xdba0('0x33')][_0xdba0('0x32')]?_0x39963d[_0xdba0('0x33')]:_0x58d14f[_0xdba0('0x2c')];if(_0xb1f5f1[_0xdba0('0x2d')][_0xdba0('0x3f')]){_0x39963d[_0xdba0('0x40')]=[{'all':!![]}];}_0x39963d=_[_0xdba0('0x3c')]({},_0x39963d,_0xb1f5f1['options']);return db[_0xdba0('0x3e')][_0xdba0('0x46')](_0x39963d)[_0xdba0('0x22')](handleEntityNotFound(_0x4296c1,null))['then'](respondWithResult(_0x4296c1,null))[_0xdba0('0x43')](handleError(_0x4296c1,null));};exports[_0xdba0('0x47')]=function(_0x441d37,_0x24ed04){return db['ChatQueueReport'][_0xdba0('0x47')](_0x441d37[_0xdba0('0x48')],{})[_0xdba0('0x22')](respondWithResult(_0x24ed04,0xc9))[_0xdba0('0x43')](handleError(_0x24ed04,null));};exports[_0xdba0('0x21')]=function(_0x4534bc,_0x374dcd){if(_0x4534bc[_0xdba0('0x48')]['id']){delete _0x4534bc['body']['id'];}return db[_0xdba0('0x3e')][_0xdba0('0x46')]({'where':{'id':_0x4534bc[_0xdba0('0x45')]['id']}})[_0xdba0('0x22')](handleEntityNotFound(_0x374dcd,null))[_0xdba0('0x22')](saveUpdates(_0x4534bc['body'],null))['then'](respondWithResult(_0x374dcd,null))[_0xdba0('0x43')](handleError(_0x374dcd,null));};exports[_0xdba0('0x23')]=function(_0x5e96c8,_0xb33480){return db[_0xdba0('0x3e')][_0xdba0('0x46')]({'where':{'id':_0x5e96c8[_0xdba0('0x45')]['id']}})['then'](handleEntityNotFound(_0xb33480,null))[_0xdba0('0x22')](removeEntity(_0xb33480,null))[_0xdba0('0x43')](handleError(_0xb33480,null));};exports[_0xdba0('0x49')]=function(_0xbe7264,_0x5d43f0){return db['ChatQueueReport'][_0xdba0('0x49')]()['then'](respondWithResult(_0x5d43f0,null))[_0xdba0('0x43')](handleError(_0x5d43f0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index da6e764..c7e34c7 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4c6286,_0x11ccae){var _0x3af87a=function(_0x4915d6){while(--_0x4915d6){_0x4c6286['push'](_0x4c6286['shift']());}};_0x3af87a(++_0x11ccae);}(_0xb7e7,0x121));var _0x7b7e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb7e7[_0x297fd3];return _0x2af381;};'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
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x478b62,_0x162035){var _0xbe72e6=function(_0x4e2ab7){while(--_0x4e2ab7){_0x478b62['push'](_0x478b62['shift']());}};_0xbe72e6(++_0x162035);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 832f07d..bf23553 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 _0x5277=['CreateChatQueueReport','stringify','UpdateChatQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatQueueReport','create','options','raw'];(function(_0x324a76,_0x585652){var _0x184767=function(_0x16b15c){while(--_0x16b15c){_0x324a76['push'](_0x324a76['shift']());}};_0x184767(++_0x585652);}(_0x5277,0x15b));var _0x7527=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5277[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7527('0x0'));var moment=require(_0x7527('0x1'));var BPromise=require('bluebird');var rs=require(_0x7527('0x2'));var fs=require('fs');var Redis=require(_0x7527('0x3'));var db=require(_0x7527('0x4'))['db'];var utils=require(_0x7527('0x5'));var logger=require(_0x7527('0x6'))(_0x7527('0x7'));var config=require(_0x7527('0x8'));var jayson=require(_0x7527('0x9'));var client=jayson[_0x7527('0xa')][_0x7527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d4962,_0x52ea8a,_0x1fe052){return new BPromise(function(_0x5d3c95,_0x54a223){return client['request'](_0x5d4962,_0x1fe052)[_0x7527('0xc')](function(_0x3238d4){logger[_0x7527('0xd')](_0x7527('0xe'),_0x52ea8a,_0x7527('0xf'));logger[_0x7527('0x10')](_0x7527('0x11'),_0x52ea8a,_0x7527('0xf'),JSON['stringify'](_0x3238d4));if(_0x3238d4['error']){if(_0x3238d4[_0x7527('0x12')][_0x7527('0x13')]===0x1f4){logger[_0x7527('0x12')](_0x7527('0xe'),_0x52ea8a,_0x3238d4[_0x7527('0x12')][_0x7527('0x14')]);return _0x54a223(_0x3238d4[_0x7527('0x12')][_0x7527('0x14')]);}logger[_0x7527('0x12')](_0x7527('0xe'),_0x52ea8a,_0x3238d4[_0x7527('0x12')][_0x7527('0x14')]);return _0x5d3c95(_0x3238d4[_0x7527('0x12')][_0x7527('0x14')]);}else{logger['info'](_0x7527('0xe'),_0x52ea8a,_0x7527('0xf'));_0x5d3c95(_0x3238d4[_0x7527('0x15')][_0x7527('0x14')]);}})[_0x7527('0x16')](function(_0x540737){logger[_0x7527('0x12')](_0x7527('0xe'),_0x52ea8a,_0x540737);_0x54a223(_0x540737);});});}exports['CreateChatQueueReport']=function(_0x5057a9){var _0x54341b=this;return new Promise(function(_0x2158be,_0x16dd65){return db[_0x7527('0x17')][_0x7527('0x18')](_0x5057a9['body'],{'raw':_0x5057a9[_0x7527('0x19')]?_0x5057a9[_0x7527('0x19')][_0x7527('0x1a')]===undefined?!![]:![]:!![]})[_0x7527('0xc')](function(_0x114b03){logger[_0x7527('0xd')](_0x7527('0x1b'),_0x5057a9);logger['debug'](_0x7527('0x1b'),_0x5057a9,JSON[_0x7527('0x1c')](_0x114b03));_0x2158be(_0x114b03);})['catch'](function(_0x3db33f){logger[_0x7527('0x12')]('CreateChatQueueReport',_0x3db33f['message'],_0x5057a9);_0x16dd65(_0x54341b[_0x7527('0x12')](0x1f4,_0x3db33f['message']));});});};exports[_0x7527('0x1d')]=function(_0x455ac8){var _0x4ba672=this;return new Promise(function(_0x4894d0,_0x5edda6){return db[_0x7527('0x17')][_0x7527('0x1e')](_0x455ac8['body'],{'raw':_0x455ac8['options']?_0x455ac8[_0x7527('0x19')][_0x7527('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x455ac8[_0x7527('0x19')]?_0x455ac8[_0x7527('0x19')][_0x7527('0x1f')]||null:null,'attributes':_0x455ac8[_0x7527('0x19')]?_0x455ac8[_0x7527('0x19')][_0x7527('0x20')]||null:null,'limit':_0x455ac8['options']?_0x455ac8['options'][_0x7527('0x21')]||null:null})[_0x7527('0xc')](function(_0x551f38){logger[_0x7527('0xd')]('UpdateChatQueueReport',_0x455ac8);logger['debug'](_0x7527('0x1d'),_0x455ac8,JSON['stringify'](_0x551f38));_0x4894d0(_0x551f38);})[_0x7527('0x16')](function(_0x4c0a14){logger[_0x7527('0x12')](_0x7527('0x1d'),_0x4c0a14[_0x7527('0x14')],_0x455ac8);_0x5edda6(_0x4ba672[_0x7527('0x12')](0x1f4,_0x4c0a14[_0x7527('0x14')]));});});};
\ No newline at end of file
+var _0x7a14=['ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a14,0x18e));var _0x47a1=function(_0xbee4cb,_0x57884a){_0xbee4cb=_0xbee4cb-0x0;var _0x3b4416=_0x7a14[_0xbee4cb];return _0x3b4416;};'use strict';var _=require(_0x47a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x47a1('0x1'));var rs=require(_0x47a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47a1('0x3'))['db'];var utils=require(_0x47a1('0x4'));var logger=require('../../config/logger')(_0x47a1('0x5'));var config=require('../../config/environment');var jayson=require(_0x47a1('0x6'));var client=jayson[_0x47a1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35bdb4,_0xd6db4e,_0x302eb5){return new BPromise(function(_0x195cc7,_0x3e4bc0){return client[_0x47a1('0x8')](_0x35bdb4,_0x302eb5)[_0x47a1('0x9')](function(_0x5b783f){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0xd6db4e,_0x47a1('0xa'));logger[_0x47a1('0xb')](_0x47a1('0xc'),_0xd6db4e,_0x47a1('0xa'),JSON[_0x47a1('0xd')](_0x5b783f));if(_0x5b783f['error']){if(_0x5b783f[_0x47a1('0xe')][_0x47a1('0xf')]===0x1f4){logger[_0x47a1('0xe')](_0x47a1('0x10'),_0xd6db4e,_0x5b783f['error']['message']);return _0x3e4bc0(_0x5b783f[_0x47a1('0xe')][_0x47a1('0x11')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xd6db4e,_0x5b783f[_0x47a1('0xe')][_0x47a1('0x11')]);return _0x195cc7(_0x5b783f[_0x47a1('0xe')][_0x47a1('0x11')]);}else{logger[_0x47a1('0x12')](_0x47a1('0x10'),_0xd6db4e,'request\x20sent');_0x195cc7(_0x5b783f[_0x47a1('0x13')][_0x47a1('0x11')]);}})[_0x47a1('0x14')](function(_0x10223b){logger[_0x47a1('0xe')](_0x47a1('0x10'),_0xd6db4e,_0x10223b);_0x3e4bc0(_0x10223b);});});}exports[_0x47a1('0x15')]=function(_0x407004){var _0x2f580b=this;return new Promise(function(_0x4328c9,_0x2d171e){return db[_0x47a1('0x16')][_0x47a1('0x17')](_0x407004[_0x47a1('0x18')],{'raw':_0x407004['options']?_0x407004[_0x47a1('0x19')][_0x47a1('0x1a')]===undefined?!![]:![]:!![]})[_0x47a1('0x9')](function(_0xea1591){logger[_0x47a1('0x12')](_0x47a1('0x15'),_0x407004);logger[_0x47a1('0xb')](_0x47a1('0x15'),_0x407004,JSON[_0x47a1('0xd')](_0xea1591));_0x4328c9(_0xea1591);})[_0x47a1('0x14')](function(_0x547391){logger['error']('CreateChatQueueReport',_0x547391['message'],_0x407004);_0x2d171e(_0x2f580b[_0x47a1('0xe')](0x1f4,_0x547391['message']));});});};exports[_0x47a1('0x1b')]=function(_0x633a2d){var _0x545a64=this;return new Promise(function(_0x44e8f1,_0x4e2579){return db['ChatQueueReport'][_0x47a1('0x1c')](_0x633a2d[_0x47a1('0x18')],{'raw':_0x633a2d['options']?_0x633a2d[_0x47a1('0x19')][_0x47a1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x633a2d[_0x47a1('0x19')]?_0x633a2d[_0x47a1('0x19')]['where']||null:null,'attributes':_0x633a2d[_0x47a1('0x19')]?_0x633a2d['options']['attributes']||null:null,'limit':_0x633a2d[_0x47a1('0x19')]?_0x633a2d[_0x47a1('0x19')][_0x47a1('0x1d')]||null:null})['then'](function(_0x22c007){logger[_0x47a1('0x12')](_0x47a1('0x1b'),_0x633a2d);logger[_0x47a1('0xb')](_0x47a1('0x1b'),_0x633a2d,JSON[_0x47a1('0xd')](_0x22c007));_0x44e8f1(_0x22c007);})[_0x47a1('0x14')](function(_0x251876){logger[_0x47a1('0xe')]('UpdateChatQueueReport',_0x251876['message'],_0x633a2d);_0x4e2579(_0x545a64[_0x47a1('0xe')](0x1f4,_0x251876[_0x47a1('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 126a031..0146a0e 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 _0x817d=['../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x817d,0x14e));var _0xd817=function(_0x45039e,_0x13566f){_0x45039e=_0x45039e-0x0;var _0x3aae26=_0x817d[_0x45039e];return _0x3aae26;};'use strict';var multer=require(_0xd817('0x0'));var util=require(_0xd817('0x1'));var path=require('path');var timeout=require(_0xd817('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd817('0x3'));var auth=require(_0xd817('0x4'));var interaction=require(_0xd817('0x5'));var config=require(_0xd817('0x6'));var controller=require(_0xd817('0x7'));router[_0xd817('0x8')]('/',auth[_0xd817('0x9')](),controller['index']);router['get'](_0xd817('0xa'),auth[_0xd817('0x9')](),controller[_0xd817('0xb')]);router['get']('/:id',auth[_0xd817('0x9')](),controller[_0xd817('0xc')]);router[_0xd817('0xd')]('/',auth['isAuthenticated'](),controller[_0xd817('0xe')]);router[_0xd817('0xf')](_0xd817('0x10'),auth[_0xd817('0x9')](),controller['update']);router[_0xd817('0x11')](_0xd817('0x10'),auth[_0xd817('0x9')](),controller[_0xd817('0x12')]);module[_0xd817('0x13')]=router;
\ No newline at end of file
+var _0xdde1=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete'];(function(_0x2c00e2,_0x52b9c6){var _0x1e36f8=function(_0x3f4b3b){while(--_0x3f4b3b){_0x2c00e2['push'](_0x2c00e2['shift']());}};_0x1e36f8(++_0x52b9c6);}(_0xdde1,0x189));var _0x1dde=function(_0x54a4a5,_0x2ecee1){_0x54a4a5=_0x54a4a5-0x0;var _0x1203e0=_0xdde1[_0x54a4a5];return _0x1203e0;};'use strict';var multer=require(_0x1dde('0x0'));var util=require(_0x1dde('0x1'));var path=require(_0x1dde('0x2'));var timeout=require(_0x1dde('0x3'));var express=require(_0x1dde('0x4'));var router=express[_0x1dde('0x5')]();var fs_extra=require(_0x1dde('0x6'));var auth=require(_0x1dde('0x7'));var interaction=require(_0x1dde('0x8'));var config=require(_0x1dde('0x9'));var controller=require(_0x1dde('0xa'));router[_0x1dde('0xb')]('/',auth[_0x1dde('0xc')](),controller[_0x1dde('0xd')]);router[_0x1dde('0xb')]('/describe',auth[_0x1dde('0xc')](),controller[_0x1dde('0xe')]);router[_0x1dde('0xb')](_0x1dde('0xf'),auth[_0x1dde('0xc')](),controller[_0x1dde('0x10')]);router[_0x1dde('0x11')]('/',auth[_0x1dde('0xc')](),controller[_0x1dde('0x12')]);router['put']('/:id',auth[_0x1dde('0xc')](),controller[_0x1dde('0x13')]);router[_0x1dde('0x14')](_0x1dde('0xf'),auth[_0x1dde('0xc')](),controller[_0x1dde('0x15')]);module[_0x1dde('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b10550a..465f4f4 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x8437a6,_0x3b674a){var _0x5e762f=function(_0x460fc2){while(--_0x460fc2){_0x8437a6['push'](_0x8437a6['shift']());}};_0x5e762f(++_0x3b674a);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4e3fff,_0x2eb510){var _0x3c569c=function(_0x14cc0d){while(--_0x14cc0d){_0x4e3fff['push'](_0x4e3fff['shift']());}};_0x3c569c(++_0x2eb510);}(_0x008c,0x188));var _0xc008=function(_0x37cd8c,_0x425de5){_0x37cd8c=_0x37cd8c-0x0;var _0x213168=_0x008c[_0x37cd8c];return _0x213168;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4a7bd36..9f4f2da 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 _0x406c=['update','destroy','then','error','stack','name','send','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x2c1233,_0x47eaeb){var _0x11946=function(_0x48a982){while(--_0x48a982){_0x2c1233['push'](_0x2c1233['shift']());}};_0x11946(++_0x47eaeb);}(_0x406c,0x1ad));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc406('0x0'));var rimraf=require(_0xc406('0x1'));var zipdir=require(_0xc406('0x2'));var jsonpatch=require(_0xc406('0x3'));var rp=require(_0xc406('0x4'));var moment=require(_0xc406('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc406('0x6'));var util=require(_0xc406('0x7'));var path=require(_0xc406('0x8'));var sox=require(_0xc406('0x9'));var csv=require(_0xc406('0xa'));var ejs=require(_0xc406('0xb'));var fs=require('fs');var fs_extra=require(_0xc406('0xc'));var _=require('lodash');var squel=require(_0xc406('0xd'));var crypto=require(_0xc406('0xe'));var jsforce=require(_0xc406('0xf'));var deskjs=require(_0xc406('0x10'));var toCsv=require(_0xc406('0xa'));var querystring=require(_0xc406('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc406('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc406('0x13'));var logger=require(_0xc406('0x14'))(_0xc406('0x15'));var utils=require(_0xc406('0x16'));var config=require(_0xc406('0x17'));var licenseUtil=require(_0xc406('0x18'));var db=require(_0xc406('0x19'))['db'];function respondWithStatusCode(_0x582450,_0x4534e6){_0x4534e6=_0x4534e6||0xcc;return function(_0x9707f9){if(_0x9707f9){return _0x582450[_0xc406('0x1a')](_0x4534e6);}return _0x582450[_0xc406('0x1b')](_0x4534e6)[_0xc406('0x1c')]();};}function respondWithResult(_0x437a85,_0x3f985b){_0x3f985b=_0x3f985b||0xc8;return function(_0x230978){if(_0x230978){return _0x437a85[_0xc406('0x1b')](_0x3f985b)['json'](_0x230978);}};}function respondWithFilteredResult(_0x14c398,_0x2a9ade){return function(_0x40f6d8){if(_0x40f6d8){var _0x3fb0d6=typeof _0x2a9ade[_0xc406('0x1d')]===_0xc406('0x1e')&&typeof _0x2a9ade[_0xc406('0x1f')]==='undefined';var _0x684c07=_0x40f6d8[_0xc406('0x20')];var _0x160ae6=_0x3fb0d6?0x0:_0x2a9ade['offset'];var _0x457c8d=_0x3fb0d6?_0x40f6d8[_0xc406('0x20')]:_0x2a9ade[_0xc406('0x1d')]+_0x2a9ade[_0xc406('0x1f')];var _0x7764bc;if(_0x457c8d>=_0x684c07){_0x457c8d=_0x684c07;_0x7764bc=0xc8;}else{_0x7764bc=0xce;}_0x14c398[_0xc406('0x1b')](_0x7764bc);return _0x14c398[_0xc406('0x21')](_0xc406('0x22'),_0x160ae6+'-'+_0x457c8d+'/'+_0x684c07)[_0xc406('0x23')](_0x40f6d8);}return null;};}function patchUpdates(_0x43e736){return function(_0x16607b){try{jsonpatch[_0xc406('0x24')](_0x16607b,_0x43e736,!![]);}catch(_0x364de2){return BPromise[_0xc406('0x25')](_0x364de2);}return _0x16607b[_0xc406('0x26')]();};}function saveUpdates(_0x28137f,_0x562471){return function(_0x1daed1){if(_0x1daed1){return _0x1daed1[_0xc406('0x27')](_0x28137f)['then'](function(_0x169440){return _0x169440;});}return null;};}function removeEntity(_0x57ed02,_0x11f655){return function(_0x50b4fb){if(_0x50b4fb){return _0x50b4fb[_0xc406('0x28')]()[_0xc406('0x29')](function(){_0x57ed02[_0xc406('0x1b')](0xcc)[_0xc406('0x1c')]();});}};}function handleEntityNotFound(_0x2ff180,_0x458fc9){return function(_0x3985db){if(!_0x3985db){_0x2ff180[_0xc406('0x1a')](0x194);}return _0x3985db;};}function handleError(_0x1ae81a,_0x37e019){_0x37e019=_0x37e019||0x1f4;return function(_0x21e860){logger[_0xc406('0x2a')](_0x21e860[_0xc406('0x2b')]);if(_0x21e860[_0xc406('0x2c')]){delete _0x21e860[_0xc406('0x2c')];}_0x1ae81a[_0xc406('0x1b')](_0x37e019)[_0xc406('0x2d')](_0x21e860);};}exports['index']=function(_0x4195d0,_0x372ab3){var _0x355d0c={},_0x204451={},_0x3b4ab3={'count':0x0,'rows':[]};var _0x5c6def=_['map'](db[_0xc406('0x2e')][_0xc406('0x2f')],function(_0x473abf){return{'name':_0x473abf[_0xc406('0x30')],'type':_0x473abf['type'][_0xc406('0x31')]};});_0x204451[_0xc406('0x32')]=_['map'](_0x5c6def,_0xc406('0x2c'));_0x204451[_0xc406('0x33')]=_[_0xc406('0x34')](_0x4195d0[_0xc406('0x33')]);_0x204451[_0xc406('0x35')]=_['intersection'](_0x204451[_0xc406('0x32')],_0x204451[_0xc406('0x33')]);_0x355d0c[_0xc406('0x36')]=_[_0xc406('0x37')](_0x204451[_0xc406('0x32')],qs[_0xc406('0x38')](_0x4195d0[_0xc406('0x33')]['fields']));_0x355d0c[_0xc406('0x36')]=_0x355d0c['attributes'][_0xc406('0x39')]?_0x355d0c['attributes']:_0x204451['model'];if(!_0x4195d0[_0xc406('0x33')]['hasOwnProperty'](_0xc406('0x3a'))){_0x355d0c['limit']=qs[_0xc406('0x1f')](_0x4195d0['query'][_0xc406('0x1f')]);_0x355d0c[_0xc406('0x1d')]=qs['offset'](_0x4195d0[_0xc406('0x33')]['offset']);}_0x355d0c[_0xc406('0x3b')]=qs[_0xc406('0x3c')](_0x4195d0[_0xc406('0x33')][_0xc406('0x3c')]);_0x355d0c[_0xc406('0x3d')]=qs[_0xc406('0x35')](_[_0xc406('0x3e')](_0x4195d0['query'],_0x204451['filters']),_0x5c6def);if(_0x4195d0[_0xc406('0x33')][_0xc406('0x3f')]){_0x355d0c[_0xc406('0x3d')]=_[_0xc406('0x40')](_0x355d0c[_0xc406('0x3d')],{'$or':_['map'](_0x5c6def,function(_0x676bf4){if(_0x676bf4[_0xc406('0x41')]!=='VIRTUAL'){var _0x54c252={};_0x54c252[_0x676bf4[_0xc406('0x2c')]]={'$like':'%'+_0x4195d0[_0xc406('0x33')][_0xc406('0x3f')]+'%'};return _0x54c252;}})});}_0x355d0c=_[_0xc406('0x40')]({},_0x355d0c,_0x4195d0['options']);var _0x755bed={'where':_0x355d0c['where']};return db[_0xc406('0x2e')][_0xc406('0x20')](_0x755bed)[_0xc406('0x29')](function(_0x52e6b4){_0x3b4ab3[_0xc406('0x20')]=_0x52e6b4;if(_0x4195d0[_0xc406('0x33')][_0xc406('0x42')]){_0x355d0c[_0xc406('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xc406('0x44')](_0x355d0c);})[_0xc406('0x29')](function(_0x529bce){_0x3b4ab3[_0xc406('0x45')]=_0x529bce;return _0x3b4ab3;})['then'](respondWithFilteredResult(_0x372ab3,_0x355d0c))[_0xc406('0x46')](handleError(_0x372ab3,null));};exports[_0xc406('0x47')]=function(_0x2ed6a8,_0x262c8d){var _0x19be03={'raw':!![],'where':{'id':_0x2ed6a8[_0xc406('0x48')]['id']}},_0x17acb9={};_0x17acb9['model']=_[_0xc406('0x34')](db['ChatTransferReport'][_0xc406('0x2f')]);_0x17acb9[_0xc406('0x33')]=_['keys'](_0x2ed6a8[_0xc406('0x33')]);_0x17acb9['filters']=_[_0xc406('0x37')](_0x17acb9['model'],_0x17acb9['query']);_0x19be03[_0xc406('0x36')]=_[_0xc406('0x37')](_0x17acb9[_0xc406('0x32')],qs[_0xc406('0x38')](_0x2ed6a8['query'][_0xc406('0x38')]));_0x19be03[_0xc406('0x36')]=_0x19be03[_0xc406('0x36')][_0xc406('0x39')]?_0x19be03['attributes']:_0x17acb9[_0xc406('0x32')];if(_0x2ed6a8[_0xc406('0x33')][_0xc406('0x42')]){_0x19be03[_0xc406('0x43')]=[{'all':!![]}];}_0x19be03=_[_0xc406('0x40')]({},_0x19be03,_0x2ed6a8[_0xc406('0x49')]);return db['ChatTransferReport']['find'](_0x19be03)[_0xc406('0x29')](handleEntityNotFound(_0x262c8d,null))[_0xc406('0x29')](respondWithResult(_0x262c8d,null))[_0xc406('0x46')](handleError(_0x262c8d,null));};exports[_0xc406('0x4a')]=function(_0x201609,_0x3338df){return db[_0xc406('0x2e')][_0xc406('0x4a')](_0x201609[_0xc406('0x4b')],{})[_0xc406('0x29')](respondWithResult(_0x3338df,0xc9))[_0xc406('0x46')](handleError(_0x3338df,null));};exports[_0xc406('0x27')]=function(_0x4e542b,_0x3d6acf){if(_0x4e542b['body']['id']){delete _0x4e542b[_0xc406('0x4b')]['id'];}return db[_0xc406('0x2e')][_0xc406('0x4c')]({'where':{'id':_0x4e542b[_0xc406('0x48')]['id']}})[_0xc406('0x29')](handleEntityNotFound(_0x3d6acf,null))[_0xc406('0x29')](saveUpdates(_0x4e542b[_0xc406('0x4b')],null))[_0xc406('0x29')](respondWithResult(_0x3d6acf,null))[_0xc406('0x46')](handleError(_0x3d6acf,null));};exports[_0xc406('0x28')]=function(_0xc6ac3e,_0x11f994){return db[_0xc406('0x2e')]['find']({'where':{'id':_0xc6ac3e[_0xc406('0x48')]['id']}})['then'](handleEntityNotFound(_0x11f994,null))['then'](removeEntity(_0x11f994,null))[_0xc406('0x46')](handleError(_0x11f994,null));};exports[_0xc406('0x4d')]=function(_0x102602,_0x24d176){return db[_0xc406('0x2e')][_0xc406('0x4d')]()[_0xc406('0x29')](respondWithResult(_0x24d176,null))[_0xc406('0x46')](handleError(_0x24d176,null));};
\ No newline at end of file
+var _0x696c=['show','params','rawAttributes','catch','body','update','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','then','error','name','send','index','ChatTransferReport','type','key','model','map','keys','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','options','includeAll','include','rows'];(function(_0xb19354,_0x581dd3){var _0x2a22ea=function(_0x5bebac){while(--_0x5bebac){_0xb19354['push'](_0xb19354['shift']());}};_0x2a22ea(++_0x581dd3);}(_0x696c,0xd4));var _0xc696=function(_0x3b584b,_0x39dc34){_0x3b584b=_0x3b584b-0x0;var _0x38559d=_0x696c[_0x3b584b];return _0x38559d;};'use strict';var emlformat=require(_0xc696('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc696('0x1'));var jsonpatch=require(_0xc696('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc696('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc696('0x4'));var sox=require(_0xc696('0x5'));var csv=require('to-csv');var ejs=require(_0xc696('0x6'));var fs=require('fs');var fs_extra=require(_0xc696('0x7'));var _=require('lodash');var squel=require(_0xc696('0x8'));var crypto=require('crypto');var jsforce=require(_0xc696('0x9'));var deskjs=require(_0xc696('0xa'));var toCsv=require(_0xc696('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc696('0xc'));var authService=require(_0xc696('0xd'));var qs=require(_0xc696('0xe'));var as=require(_0xc696('0xf'));var hardwareService=require(_0xc696('0x10'));var logger=require(_0xc696('0x11'))(_0xc696('0x12'));var utils=require(_0xc696('0x13'));var config=require(_0xc696('0x14'));var licenseUtil=require(_0xc696('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40e1a4,_0x3ebf94){_0x3ebf94=_0x3ebf94||0xcc;return function(_0x29de5c){if(_0x29de5c){return _0x40e1a4[_0xc696('0x16')](_0x3ebf94);}return _0x40e1a4[_0xc696('0x17')](_0x3ebf94)[_0xc696('0x18')]();};}function respondWithResult(_0x4c42e5,_0x18b0c5){_0x18b0c5=_0x18b0c5||0xc8;return function(_0x382841){if(_0x382841){return _0x4c42e5[_0xc696('0x17')](_0x18b0c5)[_0xc696('0x19')](_0x382841);}};}function respondWithFilteredResult(_0x5cfbcd,_0x356bc2){return function(_0x3f4eda){if(_0x3f4eda){var _0xa5869d=typeof _0x356bc2[_0xc696('0x1a')]==='undefined'&&typeof _0x356bc2[_0xc696('0x1b')]===_0xc696('0x1c');var _0xec1acf=_0x3f4eda['count'];var _0x290340=_0xa5869d?0x0:_0x356bc2[_0xc696('0x1a')];var _0x463870=_0xa5869d?_0x3f4eda[_0xc696('0x1d')]:_0x356bc2[_0xc696('0x1a')]+_0x356bc2['limit'];var _0x5d3bcd;if(_0x463870>=_0xec1acf){_0x463870=_0xec1acf;_0x5d3bcd=0xc8;}else{_0x5d3bcd=0xce;}_0x5cfbcd[_0xc696('0x17')](_0x5d3bcd);return _0x5cfbcd['set'](_0xc696('0x1e'),_0x290340+'-'+_0x463870+'/'+_0xec1acf)['json'](_0x3f4eda);}return null;};}function patchUpdates(_0x47ff97){return function(_0x29205a){try{jsonpatch['apply'](_0x29205a,_0x47ff97,!![]);}catch(_0x15cb46){return BPromise[_0xc696('0x1f')](_0x15cb46);}return _0x29205a[_0xc696('0x20')]();};}function saveUpdates(_0x44ba3c,_0x5d3ee3){return function(_0xccaf85){if(_0xccaf85){return _0xccaf85['update'](_0x44ba3c)['then'](function(_0x454beb){return _0x454beb;});}return null;};}function removeEntity(_0x352cb1,_0x3462e1){return function(_0x5f29cc){if(_0x5f29cc){return _0x5f29cc[_0xc696('0x21')]()[_0xc696('0x22')](function(){_0x352cb1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13403a,_0x3a8bf5){return function(_0x581112){if(!_0x581112){_0x13403a[_0xc696('0x16')](0x194);}return _0x581112;};}function handleError(_0x89e39b,_0x5bca21){_0x5bca21=_0x5bca21||0x1f4;return function(_0x5a6ac6){logger[_0xc696('0x23')](_0x5a6ac6['stack']);if(_0x5a6ac6[_0xc696('0x24')]){delete _0x5a6ac6[_0xc696('0x24')];}_0x89e39b[_0xc696('0x17')](_0x5bca21)[_0xc696('0x25')](_0x5a6ac6);};}exports[_0xc696('0x26')]=function(_0x41d590,_0x294d3f){var _0x30acc7={},_0x478703={},_0x4aaa7c={'count':0x0,'rows':[]};var _0x253a35=_['map'](db[_0xc696('0x27')]['rawAttributes'],function(_0x20c3dc){return{'name':_0x20c3dc['fieldName'],'type':_0x20c3dc[_0xc696('0x28')][_0xc696('0x29')]};});_0x478703[_0xc696('0x2a')]=_[_0xc696('0x2b')](_0x253a35,_0xc696('0x24'));_0x478703['query']=_[_0xc696('0x2c')](_0x41d590[_0xc696('0x2d')]);_0x478703['filters']=_[_0xc696('0x2e')](_0x478703['model'],_0x478703[_0xc696('0x2d')]);_0x30acc7[_0xc696('0x2f')]=_[_0xc696('0x2e')](_0x478703[_0xc696('0x2a')],qs[_0xc696('0x30')](_0x41d590[_0xc696('0x2d')][_0xc696('0x30')]));_0x30acc7[_0xc696('0x2f')]=_0x30acc7[_0xc696('0x2f')][_0xc696('0x31')]?_0x30acc7[_0xc696('0x2f')]:_0x478703[_0xc696('0x2a')];if(!_0x41d590[_0xc696('0x2d')]['hasOwnProperty']('nolimit')){_0x30acc7[_0xc696('0x1b')]=qs[_0xc696('0x1b')](_0x41d590[_0xc696('0x2d')][_0xc696('0x1b')]);_0x30acc7[_0xc696('0x1a')]=qs[_0xc696('0x1a')](_0x41d590['query']['offset']);}_0x30acc7[_0xc696('0x32')]=qs[_0xc696('0x33')](_0x41d590['query'][_0xc696('0x33')]);_0x30acc7[_0xc696('0x34')]=qs[_0xc696('0x35')](_['pick'](_0x41d590[_0xc696('0x2d')],_0x478703['filters']),_0x253a35);if(_0x41d590['query'][_0xc696('0x36')]){_0x30acc7[_0xc696('0x34')]=_[_0xc696('0x37')](_0x30acc7[_0xc696('0x34')],{'$or':_[_0xc696('0x2b')](_0x253a35,function(_0xe856e6){if(_0xe856e6[_0xc696('0x28')]!=='VIRTUAL'){var _0x43988f={};_0x43988f[_0xe856e6[_0xc696('0x24')]]={'$like':'%'+_0x41d590[_0xc696('0x2d')]['filter']+'%'};return _0x43988f;}})});}_0x30acc7=_['merge']({},_0x30acc7,_0x41d590[_0xc696('0x38')]);var _0x3669e5={'where':_0x30acc7[_0xc696('0x34')]};return db[_0xc696('0x27')][_0xc696('0x1d')](_0x3669e5)['then'](function(_0x56af60){_0x4aaa7c['count']=_0x56af60;if(_0x41d590[_0xc696('0x2d')][_0xc696('0x39')]){_0x30acc7[_0xc696('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x30acc7);})[_0xc696('0x22')](function(_0x491fd6){_0x4aaa7c[_0xc696('0x3b')]=_0x491fd6;return _0x4aaa7c;})[_0xc696('0x22')](respondWithFilteredResult(_0x294d3f,_0x30acc7))['catch'](handleError(_0x294d3f,null));};exports[_0xc696('0x3c')]=function(_0x3202fc,_0x2bb748){var _0x5d3772={'raw':!![],'where':{'id':_0x3202fc[_0xc696('0x3d')]['id']}},_0xaf5934={};_0xaf5934[_0xc696('0x2a')]=_[_0xc696('0x2c')](db[_0xc696('0x27')][_0xc696('0x3e')]);_0xaf5934[_0xc696('0x2d')]=_[_0xc696('0x2c')](_0x3202fc[_0xc696('0x2d')]);_0xaf5934[_0xc696('0x35')]=_[_0xc696('0x2e')](_0xaf5934[_0xc696('0x2a')],_0xaf5934['query']);_0x5d3772['attributes']=_[_0xc696('0x2e')](_0xaf5934[_0xc696('0x2a')],qs[_0xc696('0x30')](_0x3202fc[_0xc696('0x2d')][_0xc696('0x30')]));_0x5d3772['attributes']=_0x5d3772[_0xc696('0x2f')][_0xc696('0x31')]?_0x5d3772[_0xc696('0x2f')]:_0xaf5934[_0xc696('0x2a')];if(_0x3202fc['query'][_0xc696('0x39')]){_0x5d3772[_0xc696('0x3a')]=[{'all':!![]}];}_0x5d3772=_[_0xc696('0x37')]({},_0x5d3772,_0x3202fc['options']);return db[_0xc696('0x27')]['find'](_0x5d3772)[_0xc696('0x22')](handleEntityNotFound(_0x2bb748,null))[_0xc696('0x22')](respondWithResult(_0x2bb748,null))[_0xc696('0x3f')](handleError(_0x2bb748,null));};exports['create']=function(_0xad4d1b,_0xf53945){return db['ChatTransferReport']['create'](_0xad4d1b[_0xc696('0x40')],{})[_0xc696('0x22')](respondWithResult(_0xf53945,0xc9))['catch'](handleError(_0xf53945,null));};exports[_0xc696('0x41')]=function(_0x481c9c,_0x1a1bf7){if(_0x481c9c[_0xc696('0x40')]['id']){delete _0x481c9c['body']['id'];}return db[_0xc696('0x27')][_0xc696('0x42')]({'where':{'id':_0x481c9c['params']['id']}})[_0xc696('0x22')](handleEntityNotFound(_0x1a1bf7,null))[_0xc696('0x22')](saveUpdates(_0x481c9c[_0xc696('0x40')],null))[_0xc696('0x22')](respondWithResult(_0x1a1bf7,null))['catch'](handleError(_0x1a1bf7,null));};exports[_0xc696('0x21')]=function(_0x3a1252,_0x360d44){return db['ChatTransferReport']['find']({'where':{'id':_0x3a1252['params']['id']}})[_0xc696('0x22')](handleEntityNotFound(_0x360d44,null))[_0xc696('0x22')](removeEntity(_0x360d44,null))[_0xc696('0x3f')](handleError(_0x360d44,null));};exports['describe']=function(_0x1ddd24,_0x1f3bfd){return db[_0xc696('0x27')][_0xc696('0x43')]()[_0xc696('0x22')](respondWithResult(_0x1f3bfd,null))[_0xc696('0x3f')](handleError(_0x1f3bfd,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 6b383c8..60f7084 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 _0xed35=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed35,0x151));var _0x5ed3=function(_0x5205a8,_0x3722fb){_0x5205a8=_0x5205a8-0x0;var _0x41e159=_0xed35[_0x5205a8];return _0x41e159;};'use strict';var _=require('lodash');var util=require(_0x5ed3('0x0'));var logger=require(_0x5ed3('0x1'))(_0x5ed3('0x2'));var moment=require(_0x5ed3('0x3'));var BPromise=require(_0x5ed3('0x4'));var rp=require(_0x5ed3('0x5'));var fs=require('fs');var path=require(_0x5ed3('0x6'));var rimraf=require(_0x5ed3('0x7'));var config=require('../../config/environment');var attributes=require(_0x5ed3('0x8'));module[_0x5ed3('0x9')]=function(_0x3121b7,_0x203a36){return _0x3121b7[_0x5ed3('0xa')](_0x5ed3('0xb'),attributes,{'tableName':_0x5ed3('0xc'),'paranoid':![],'indexes':[{'name':_0x5ed3('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfba=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x48e921,_0x20cf98){var _0x4986fe=function(_0x466eb2){while(--_0x466eb2){_0x48e921['push'](_0x48e921['shift']());}};_0x4986fe(++_0x20cf98);}(_0xcfba,0x7e));var _0xacfb=function(_0x54d7b8,_0x28e769){_0x54d7b8=_0x54d7b8-0x0;var _0x1ccc89=_0xcfba[_0x54d7b8];return _0x1ccc89;};'use strict';var _=require(_0xacfb('0x0'));var util=require(_0xacfb('0x1'));var logger=require(_0xacfb('0x2'))(_0xacfb('0x3'));var moment=require('moment');var BPromise=require(_0xacfb('0x4'));var rp=require(_0xacfb('0x5'));var fs=require('fs');var path=require(_0xacfb('0x6'));var rimraf=require(_0xacfb('0x7'));var config=require(_0xacfb('0x8'));var attributes=require(_0xacfb('0x9'));module['exports']=function(_0x5030e4,_0x233c84){return _0x5030e4[_0xacfb('0xa')](_0xacfb('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xacfb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index c5123b3..0d76223 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 _0x6009=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x58a1a6,_0x3a423a){var _0x41e294=function(_0x5890e6){while(--_0x5890e6){_0x58a1a6['push'](_0x58a1a6['shift']());}};_0x41e294(++_0x3a423a);}(_0x6009,0xfb));var _0x9600=function(_0x71185f,_0x371d74){_0x71185f=_0x71185f-0x0;var _0x160ffe=_0x6009[_0x71185f];return _0x160ffe;};'use strict';var _=require(_0x9600('0x0'));var util=require(_0x9600('0x1'));var moment=require(_0x9600('0x2'));var BPromise=require(_0x9600('0x3'));var rs=require(_0x9600('0x4'));var fs=require('fs');var Redis=require(_0x9600('0x5'));var db=require(_0x9600('0x6'))['db'];var utils=require(_0x9600('0x7'));var logger=require(_0x9600('0x8'))(_0x9600('0x9'));var config=require('../../config/environment');var jayson=require(_0x9600('0xa'));var client=jayson[_0x9600('0xb')][_0x9600('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d5caf,_0x26dd03,_0x49d28b){return new BPromise(function(_0x4cf609,_0x316c33){return client[_0x9600('0xd')](_0x3d5caf,_0x49d28b)[_0x9600('0xe')](function(_0xde5169){logger[_0x9600('0xf')](_0x9600('0x10'),_0x26dd03,_0x9600('0x11'));logger[_0x9600('0x12')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x26dd03,_0x9600('0x11'),JSON[_0x9600('0x13')](_0xde5169));if(_0xde5169[_0x9600('0x14')]){if(_0xde5169[_0x9600('0x14')][_0x9600('0x15')]===0x1f4){logger[_0x9600('0x14')](_0x9600('0x10'),_0x26dd03,_0xde5169[_0x9600('0x14')][_0x9600('0x16')]);return _0x316c33(_0xde5169[_0x9600('0x14')][_0x9600('0x16')]);}logger[_0x9600('0x14')](_0x9600('0x10'),_0x26dd03,_0xde5169[_0x9600('0x14')][_0x9600('0x16')]);return _0x4cf609(_0xde5169[_0x9600('0x14')][_0x9600('0x16')]);}else{logger[_0x9600('0xf')](_0x9600('0x10'),_0x26dd03,_0x9600('0x11'));_0x4cf609(_0xde5169[_0x9600('0x17')][_0x9600('0x16')]);}})[_0x9600('0x18')](function(_0xd4f45e){logger[_0x9600('0x14')](_0x9600('0x10'),_0x26dd03,_0xd4f45e);_0x316c33(_0xd4f45e);});});}
\ No newline at end of file
+var _0x1114=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x342183,_0x2980b6){var _0x17a300=function(_0x4ce0a1){while(--_0x4ce0a1){_0x342183['push'](_0x342183['shift']());}};_0x17a300(++_0x2980b6);}(_0x1114,0x89));var _0x4111=function(_0x5d92d2,_0x399d73){_0x5d92d2=_0x5d92d2-0x0;var _0x5e6d11=_0x1114[_0x5d92d2];return _0x5e6d11;};'use strict';var _=require('lodash');var util=require(_0x4111('0x0'));var moment=require(_0x4111('0x1'));var BPromise=require(_0x4111('0x2'));var rs=require(_0x4111('0x3'));var fs=require('fs');var Redis=require(_0x4111('0x4'));var db=require(_0x4111('0x5'))['db'];var utils=require(_0x4111('0x6'));var logger=require(_0x4111('0x7'))(_0x4111('0x8'));var config=require(_0x4111('0x9'));var jayson=require(_0x4111('0xa'));var client=jayson[_0x4111('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b5b65,_0x2cf079,_0xfed092){return new BPromise(function(_0x2a2cce,_0x4fb53d){return client[_0x4111('0xc')](_0x8b5b65,_0xfed092)[_0x4111('0xd')](function(_0x14ded8){logger[_0x4111('0xe')](_0x4111('0xf'),_0x2cf079,'request\x20sent');logger[_0x4111('0x10')](_0x4111('0x11'),_0x2cf079,_0x4111('0x12'),JSON[_0x4111('0x13')](_0x14ded8));if(_0x14ded8[_0x4111('0x14')]){if(_0x14ded8['error'][_0x4111('0x15')]===0x1f4){logger[_0x4111('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x2cf079,_0x14ded8['error'][_0x4111('0x16')]);return _0x4fb53d(_0x14ded8['error'][_0x4111('0x16')]);}logger[_0x4111('0x14')](_0x4111('0xf'),_0x2cf079,_0x14ded8[_0x4111('0x14')][_0x4111('0x16')]);return _0x2a2cce(_0x14ded8[_0x4111('0x14')]['message']);}else{logger[_0x4111('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x2cf079,'request\x20sent');_0x2a2cce(_0x14ded8[_0x4111('0x17')][_0x4111('0x16')]);}})[_0x4111('0x18')](function(_0x45afe3){logger[_0x4111('0x14')](_0x4111('0xf'),_0x2cf079,_0x45afe3);_0x4fb53d(_0x45afe3);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4647e85..391071b 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 _0x4e03=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x470c71,_0x66f61){var _0x370961=function(_0x102224){while(--_0x102224){_0x470c71['push'](_0x470c71['shift']());}};_0x370961(++_0x66f61);}(_0x4e03,0x199));var _0x34e0=function(_0x56436f,_0x14638c){_0x56436f=_0x56436f-0x0;var _0x30648a=_0x4e03[_0x56436f];return _0x30648a;};'use strict';var multer=require(_0x34e0('0x0'));var util=require(_0x34e0('0x1'));var path=require(_0x34e0('0x2'));var timeout=require(_0x34e0('0x3'));var express=require(_0x34e0('0x4'));var router=express[_0x34e0('0x5')]();var fs_extra=require(_0x34e0('0x6'));var auth=require(_0x34e0('0x7'));var interaction=require(_0x34e0('0x8'));var config=require(_0x34e0('0x9'));var controller=require(_0x34e0('0xa'));router[_0x34e0('0xb')]('/',auth['isAuthenticated'](),controller[_0x34e0('0xc')]);router['get']('/describe',auth[_0x34e0('0xd')](),controller[_0x34e0('0xe')]);router[_0x34e0('0xb')](_0x34e0('0xf'),auth[_0x34e0('0xd')](),controller[_0x34e0('0x10')]);router[_0x34e0('0x11')]('/',auth[_0x34e0('0xd')](),controller[_0x34e0('0x12')]);router[_0x34e0('0x13')](_0x34e0('0xf'),auth[_0x34e0('0xd')](),controller[_0x34e0('0x14')]);router[_0x34e0('0x15')](_0x34e0('0xf'),auth[_0x34e0('0xd')](),controller['destroy']);module[_0x34e0('0x16')]=router;
\ No newline at end of file
+var _0x00a8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x00a8,0xd9));var _0x800a=function(_0x2004b9,_0x46ec1c){_0x2004b9=_0x2004b9-0x0;var _0x3f35f8=_0x00a8[_0x2004b9];return _0x3f35f8;};'use strict';var multer=require(_0x800a('0x0'));var util=require('util');var path=require(_0x800a('0x1'));var timeout=require('connect-timeout');var express=require(_0x800a('0x2'));var router=express[_0x800a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x800a('0x4'));var interaction=require(_0x800a('0x5'));var config=require(_0x800a('0x6'));var controller=require(_0x800a('0x7'));router[_0x800a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x800a('0x9'),auth[_0x800a('0xa')](),controller[_0x800a('0xb')]);router[_0x800a('0x8')](_0x800a('0xc'),auth['isAuthenticated'](),controller[_0x800a('0xd')]);router['post']('/',auth[_0x800a('0xa')](),controller[_0x800a('0xe')]);router[_0x800a('0xf')](_0x800a('0xc'),auth[_0x800a('0xa')](),controller[_0x800a('0x10')]);router[_0x800a('0x11')]('/:id',auth[_0x800a('0xa')](),controller[_0x800a('0x12')]);module[_0x800a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index fc17c8a..169cc32 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 _0x2c0c=['text','name','input','onlineForm','getDataValue','textarea','Comments','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','INTEGER','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','TEXT','stringify'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x2c0c,0xe5));var _0xc2c0=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x2c0c[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc2c0('0x0'));module[_0xc2c0('0x1')]={'name':{'type':Sequelize[_0xc2c0('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc2c0('0x3')},'description':{'type':Sequelize[_0xc2c0('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x4')},'key':{'type':Sequelize[_0xc2c0('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc2c0('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc2c0('0x2')],'allowNull':![],'defaultValue':_0xc2c0('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc2c0('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc2c0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc2c0('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xc2c0('0x7'),_0xc2c0('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x9')},'start_chat_button':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xa')},'offline_chat_button':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xb')},'header_offline':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc2c0('0x11')},'placeholderMessage':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc2c0('0x13')},'closingMessageButton':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xc2c0('0x15')](_0xc2c0('0x16'),_0xc2c0('0x17')),'defaultValue':_0xc2c0('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc2c0('0x18')],'defaultValue':function(){return JSON[_0xc2c0('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xc2c0('0x1a'),'required':!![]},'props':{'title':_0xc2c0('0x1b'),'helpText':''}},{'type':_0xc2c0('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xc2c0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc2c0('0x1d'))?JSON['parse'](this[_0xc2c0('0x1e')]('onlineForm')):{};},'set':function(_0x14f48f){return this['setDataValue']('onlineForm',JSON['stringify'](_0x14f48f));}},'offlineForm':{'type':Sequelize[_0xc2c0('0x18')],'defaultValue':function(){return JSON[_0xc2c0('0x19')]({'items':[{'type':_0xc2c0('0x1c'),'props':{'title':_0xc2c0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc2c0('0x4'),'type':_0xc2c0('0x4')},'variable':null},{'type':_0xc2c0('0x1f'),'config':{'placeholder':_0xc2c0('0x20')},'props':{'title':_0xc2c0('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xc2c0('0x1e')](_0xc2c0('0x21'))?JSON[_0xc2c0('0x22')](this[_0xc2c0('0x1e')]('offlineForm')):{};},'set':function(_0xcdd35d){return this[_0xc2c0('0x23')](_0xc2c0('0x21'),JSON[_0xc2c0('0x19')](_0xcdd35d));}},'token':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':function(){return rs[_0xc2c0('0x24')]();}},'autoclose':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc2c0('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc2c0('0x2')]},'waitingTitle':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x25')},'waitingMessage':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x26')},'offlineMessageBody':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x28')},'skipUnmanaged':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc2c0('0x18')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc2c0('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc2c0('0x18')],'defaultValue':function(){return _0xc2c0('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xc2c0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x2a')},'verticalAlignment':{'type':Sequelize[_0xc2c0('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x2b')},'defaultTitle':{'type':Sequelize[_0xc2c0('0x2')]},'customerAvatar':{'type':Sequelize[_0xc2c0('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc2c0('0x2')],'allowNull':![],'defaultValue':_0xc2c0('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc2c0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc2c0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc2c0('0x2')],'defaultValue':_0xc2c0('0x2d')},'systemAvatar':{'type':Sequelize[_0xc2c0('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc2c0('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![],'comment':_0xc2c0('0x2f'),'set':function(_0xcc86c1){if(!_0xcc86c1)this[_0xc2c0('0x23')]('mandatoryDispositionPauseId',null);this[_0xc2c0('0x23')](_0xc2c0('0x30'),_0xcc86c1);}},'vidaooEscalation':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc2c0('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc2c0('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xc2c0('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xc2c0('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7fb3=['Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','randomstring','exports','STRING','address','email','#011F6A','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!'];(function(_0x2062e7,_0x37a1bf){var _0xf56989=function(_0x45fd7b){while(--_0x45fd7b){_0x2062e7['push'](_0x2062e7['shift']());}};_0xf56989(++_0x37a1bf);}(_0x7fb3,0x137));var _0x37fb=function(_0x1cbff5,_0x4d5c69){_0x1cbff5=_0x1cbff5-0x0;var _0x5fcda9=_0x7fb3[_0x1cbff5];return _0x5fcda9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x37fb('0x0'));module[_0x37fb('0x1')]={'name':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![],'unique':_0x37fb('0x3')},'description':{'type':Sequelize[_0x37fb('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![],'defaultValue':_0x37fb('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x37fb('0x2')]},'animation':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x37fb('0x8')]('rounded',_0x37fb('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xa')},'start_chat_button':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xb')},'header_offline':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x37fb('0xd')]},'closingQuestion':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x10')},'noteTitle':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x12')},'closingMessage':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x13')},'closingMessageButton':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x14')},'conditionAgreement':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x15')},'ratingType':{'type':Sequelize[_0x37fb('0x8')]('star',_0x37fb('0x16')),'defaultValue':_0x37fb('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x37fb('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x37fb('0x18'),'variable':null,'config':{'placeholder':_0x37fb('0x19'),'type':_0x37fb('0x1a'),'required':!![]},'props':{'title':_0x37fb('0x19'),'helpText':''}},{'type':_0x37fb('0x18'),'props':{'title':_0x37fb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x37fb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x37fb('0x1b')](_0x37fb('0x1c'))?JSON[_0x37fb('0x1d')](this[_0x37fb('0x1b')](_0x37fb('0x1c'))):{};},'set':function(_0x1902b9){return this[_0x37fb('0x1e')]('onlineForm',JSON['stringify'](_0x1902b9));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x37fb('0x1f')]({'items':[{'type':_0x37fb('0x18'),'props':{'title':_0x37fb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x37fb('0x4'),'type':_0x37fb('0x4')},'variable':null},{'type':_0x37fb('0x20'),'config':{'placeholder':_0x37fb('0x21')},'props':{'title':'Comments','helpText':_0x37fb('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x37fb('0x1b')](_0x37fb('0x23'))?JSON[_0x37fb('0x1d')](this['getDataValue']('offlineForm')):{};},'set':function(_0x4582e1){return this[_0x37fb('0x1e')]('offlineForm',JSON[_0x37fb('0x1f')](_0x4582e1));}},'token':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':function(){return rs[_0x37fb('0x24')]();}},'autoclose':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x37fb('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x28')},'skipUnmanaged':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x14')},'sendUnmanaged':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x37fb('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x37fb('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':_0x37fb('0x2a')},'defaultTitle':{'type':Sequelize[_0x37fb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x37fb('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x37fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x2b')},'systemAvatar':{'type':Sequelize[_0x37fb('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x37fb('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x37fb('0x2c'),'set':function(_0x4cf524){if(!_0x4cf524)this[_0x37fb('0x1e')](_0x37fb('0x2d'),null);this[_0x37fb('0x1e')]('mandatoryDisposition',_0x4cf524);}},'vidaooEscalation':{'type':Sequelize[_0x37fb('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x37fb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x37fb('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x37fb('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ac789a2..45cf497 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 _0x40f6=['localhost','socket.io-emitter','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','UserProfileResource','destroy','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','create','body','user','role','ChatWebsites','UserProfileSection','find','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','order','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','existsSync','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','CmContact','Contacts','DESC','ChatApplication','account','applications','orderBy','priority','asc','Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','offline-chat','openNewInteraction','sequelize','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','custom','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remoteAddress','render','color_button','backgroundColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','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','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x2c7175,_0x2c013c){var _0x309a6b=function(_0x1c89f6){while(--_0x1c89f6){_0x2c7175['push'](_0x2c7175['shift']());}};_0x309a6b(++_0x2c013c);}(_0x40f6,0x114));var _0x640f=function(_0x41345b,_0x20aa91){_0x41345b=_0x41345b-0x0;var _0x49c94c=_0x40f6[_0x41345b];return _0x49c94c;};'use strict';var emlformat=require(_0x640f('0x0'));var rimraf=require(_0x640f('0x1'));var zipdir=require(_0x640f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x640f('0x3'));var BPromise=require(_0x640f('0x4'));var Mustache=require(_0x640f('0x5'));var util=require(_0x640f('0x6'));var path=require(_0x640f('0x7'));var sox=require(_0x640f('0x8'));var csv=require(_0x640f('0x9'));var ejs=require(_0x640f('0xa'));var fs=require('fs');var fs_extra=require(_0x640f('0xb'));var _=require('lodash');var squel=require(_0x640f('0xc'));var crypto=require(_0x640f('0xd'));var jsforce=require(_0x640f('0xe'));var deskjs=require(_0x640f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x640f('0x10'));var Papa=require(_0x640f('0x11'));var Redis=require(_0x640f('0x12'));var authService=require(_0x640f('0x13'));var qs=require(_0x640f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x640f('0x15'));var logger=require('../../config/logger')(_0x640f('0x16'));var utils=require('../../config/utils');var config=require(_0x640f('0x17'));var licenseUtil=require(_0x640f('0x18'));var db=require(_0x640f('0x19'))['db'];config['redis']=_[_0x640f('0x1a')](config[_0x640f('0x1b')],{'host':_0x640f('0x1c'),'port':0x18eb});var socket=require(_0x640f('0x1d'))(new Redis(config[_0x640f('0x1b')]));require('./chatWebsite.socket')[_0x640f('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x640f('0x1f')][_0x640f('0x20')]({'port':0x232c});var client9002=jayson[_0x640f('0x1f')][_0x640f('0x20')]({'port':0x232a});var client9003=jayson[_0x640f('0x1f')][_0x640f('0x20')]({'port':0x232b});var client9001=jayson[_0x640f('0x1f')][_0x640f('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x47a6b4,_0x48331c,_0x22093f,_0x133f35){return new BPromise(function(_0x417f93,_0x46c6cb){var _0x26d4a7=_0x133f35||client;return _0x26d4a7[_0x640f('0x21')](_0x47a6b4,_0x22093f)[_0x640f('0x22')](function(_0x46f796){logger[_0x640f('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x48331c,_0x640f('0x24'));logger[_0x640f('0x25')](_0x640f('0x26'),_0x48331c,_0x640f('0x24'),JSON['stringify'](_0x46f796));if(_0x46f796[_0x640f('0x27')]){if(_0x46f796[_0x640f('0x27')]['code']===0x1f4){logger[_0x640f('0x27')](_0x640f('0x28'),_0x48331c,_0x46f796[_0x640f('0x27')][_0x640f('0x29')]);return _0x46c6cb(_0x46f796[_0x640f('0x27')][_0x640f('0x29')]);}logger[_0x640f('0x27')](_0x640f('0x28'),_0x48331c,_0x46f796[_0x640f('0x27')][_0x640f('0x29')]);return _0x417f93(_0x46f796[_0x640f('0x27')][_0x640f('0x29')]);}else{logger['info'](_0x640f('0x28'),_0x48331c,_0x640f('0x24'));_0x417f93(_0x46f796[_0x640f('0x2a')][_0x640f('0x29')]);}})[_0x640f('0x2b')](function(_0x21742f){logger[_0x640f('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x48331c,_0x21742f);_0x46c6cb(_0x21742f);});});}function respondWithStatusCode(_0x5f3ed2,_0x38a5aa){_0x38a5aa=_0x38a5aa||0xcc;return function(_0x25e646){if(_0x25e646){return _0x5f3ed2[_0x640f('0x2c')](_0x38a5aa);}return _0x5f3ed2[_0x640f('0x2d')](_0x38a5aa)[_0x640f('0x2e')]();};}function respondWithResult(_0x245316,_0x1cfffe){_0x1cfffe=_0x1cfffe||0xc8;return function(_0x23dfba){if(_0x23dfba){return _0x245316['status'](_0x1cfffe)['json'](_0x23dfba);}};}function respondWithFilteredResult(_0x371e83,_0x5db6de){return function(_0x23b151){if(_0x23b151){var _0x35e862=typeof _0x5db6de[_0x640f('0x2f')]===_0x640f('0x30')&&typeof _0x5db6de[_0x640f('0x31')]===_0x640f('0x30');var _0x2bd0db=_0x23b151[_0x640f('0x32')];var _0x3e422a=_0x35e862?0x0:_0x5db6de[_0x640f('0x2f')];var _0x8ff2bf=_0x35e862?_0x23b151['count']:_0x5db6de[_0x640f('0x2f')]+_0x5db6de[_0x640f('0x31')];var _0x5e916c;if(_0x8ff2bf>=_0x2bd0db){_0x8ff2bf=_0x2bd0db;_0x5e916c=0xc8;}else{_0x5e916c=0xce;}_0x371e83['status'](_0x5e916c);return _0x371e83[_0x640f('0x33')](_0x640f('0x34'),_0x3e422a+'-'+_0x8ff2bf+'/'+_0x2bd0db)[_0x640f('0x35')](_0x23b151);}return null;};}function patchUpdates(_0x3afd8b){return function(_0x14e7f0){try{jsonpatch[_0x640f('0x36')](_0x14e7f0,_0x3afd8b,!![]);}catch(_0x2e70e1){return BPromise[_0x640f('0x37')](_0x2e70e1);}return _0x14e7f0[_0x640f('0x38')]();};}function saveUpdates(_0x10ebb5,_0x12b35a){return function(_0x122cac){if(_0x122cac){return _0x122cac[_0x640f('0x39')](_0x10ebb5)['then'](function(_0x5b1943){return _0x5b1943;});}return null;};}function removeEntity(_0x373fc0,_0xb54656){return function(_0x3fd8d3){if(_0x3fd8d3){return _0x3fd8d3['destroy']()[_0x640f('0x22')](function(){var _0x1f42d1=_0x3fd8d3[_0x640f('0x3a')]({'plain':!![]});var _0x169dc4='ChatWebsites';return db[_0x640f('0x3b')][_0x640f('0x3c')]({'where':{'type':_0x169dc4,'resourceId':_0x1f42d1['id']}})[_0x640f('0x22')](function(){return _0x3fd8d3;});})[_0x640f('0x22')](function(){_0x373fc0['status'](0xcc)[_0x640f('0x2e')]();});}};}function handleEntityNotFound(_0x1ba27c,_0x341322){return function(_0x142953){if(!_0x142953){_0x1ba27c[_0x640f('0x2c')](0x194);}return _0x142953;};}function handleError(_0x51a2f5,_0x46657f){_0x46657f=_0x46657f||0x1f4;return function(_0x250ef9){logger['error'](_0x250ef9[_0x640f('0x3d')]);if(_0x250ef9[_0x640f('0x3e')]){delete _0x250ef9[_0x640f('0x3e')];}_0x51a2f5['status'](_0x46657f)[_0x640f('0x3f')](_0x250ef9);};}exports[_0x640f('0x40')]=function(_0x11e2ac,_0x3f1149){var _0x55aea3={'include':[{'model':db[_0x640f('0x41')],'as':'mandatoryDispositionPause'}]},_0x2327fe={},_0x53cd1e={'count':0x0,'rows':[]};var _0x3e119e=_[_0x640f('0x42')](db[_0x640f('0x43')][_0x640f('0x44')],function(_0x649003){return{'name':_0x649003['fieldName'],'type':_0x649003['type'][_0x640f('0x45')]};});_0x2327fe['model']=_[_0x640f('0x42')](_0x3e119e,_0x640f('0x3e'));_0x2327fe[_0x640f('0x46')]=_[_0x640f('0x47')](_0x11e2ac['query']);_0x2327fe['filters']=_[_0x640f('0x48')](_0x2327fe[_0x640f('0x49')],_0x2327fe[_0x640f('0x46')]);_0x55aea3[_0x640f('0x4a')]=_['intersection'](_0x2327fe['model'],qs[_0x640f('0x4b')](_0x11e2ac[_0x640f('0x46')][_0x640f('0x4b')]));_0x55aea3[_0x640f('0x4a')]=_0x55aea3['attributes'][_0x640f('0x4c')]?_0x55aea3['attributes']:_0x2327fe[_0x640f('0x49')];if(!_0x11e2ac[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0x55aea3[_0x640f('0x31')]=qs[_0x640f('0x31')](_0x11e2ac[_0x640f('0x46')][_0x640f('0x31')]);_0x55aea3[_0x640f('0x2f')]=qs[_0x640f('0x2f')](_0x11e2ac['query']['offset']);}_0x55aea3['order']=qs[_0x640f('0x4f')](_0x11e2ac['query'][_0x640f('0x4f')]);_0x55aea3[_0x640f('0x50')]=qs['filters'](_[_0x640f('0x51')](_0x11e2ac[_0x640f('0x46')],_0x2327fe['filters']),_0x3e119e);if(_0x11e2ac['query'][_0x640f('0x52')]){_0x55aea3[_0x640f('0x50')]=_[_0x640f('0x53')](_0x55aea3[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x3e119e,function(_0x4d0d46){if(_0x4d0d46[_0x640f('0x54')]!==_0x640f('0x55')){var _0x1c486b={};_0x1c486b[_0x4d0d46['name']]={'$like':'%'+_0x11e2ac[_0x640f('0x46')][_0x640f('0x52')]+'%'};return _0x1c486b;}})});}_0x55aea3=_[_0x640f('0x53')]({},_0x55aea3,_0x11e2ac[_0x640f('0x56')]);var _0x2e2923={'where':_0x55aea3[_0x640f('0x50')]};return db[_0x640f('0x43')]['count'](_0x2e2923)['then'](function(_0x4eac2f){_0x53cd1e['count']=_0x4eac2f;if(_0x11e2ac[_0x640f('0x46')][_0x640f('0x57')]){_0x55aea3[_0x640f('0x58')]=[{'all':!![]}];}return db[_0x640f('0x43')][_0x640f('0x59')](_0x55aea3);})['then'](function(_0x2941b3){_0x53cd1e[_0x640f('0x5a')]=_0x2941b3;return _0x53cd1e;})[_0x640f('0x22')](respondWithFilteredResult(_0x3f1149,_0x55aea3))['catch'](handleError(_0x3f1149,null));};exports[_0x640f('0x5b')]=function(_0x3e35ce,_0x207926){var _0x1e595b={'raw':![],'where':{'id':_0x3e35ce[_0x640f('0x5c')]['id']},'include':[{'model':db[_0x640f('0x41')],'as':'mandatoryDispositionPause'}]},_0x3f8d33={};_0x3f8d33['model']=_[_0x640f('0x47')](db[_0x640f('0x43')]['rawAttributes']);_0x3f8d33[_0x640f('0x46')]=_[_0x640f('0x47')](_0x3e35ce['query']);_0x3f8d33[_0x640f('0x5d')]=_['intersection'](_0x3f8d33[_0x640f('0x49')],_0x3f8d33['query']);_0x1e595b[_0x640f('0x4a')]=_['intersection'](_0x3f8d33[_0x640f('0x49')],qs['fields'](_0x3e35ce[_0x640f('0x46')][_0x640f('0x4b')]));_0x1e595b['attributes']=_0x1e595b[_0x640f('0x4a')][_0x640f('0x4c')]?_0x1e595b[_0x640f('0x4a')]:_0x3f8d33[_0x640f('0x49')];if(_0x3e35ce[_0x640f('0x46')][_0x640f('0x57')]){_0x1e595b['include']=[{'all':!![]}];}_0x1e595b=_[_0x640f('0x53')]({},_0x1e595b,_0x3e35ce[_0x640f('0x56')]);return db['ChatWebsite']['find'](_0x1e595b)['then'](handleEntityNotFound(_0x207926,null))[_0x640f('0x22')](respondWithResult(_0x207926,null))['catch'](handleError(_0x207926,null));};exports[_0x640f('0x5e')]=function(_0xfc03e9,_0x50e6a6){return db['ChatWebsite'][_0x640f('0x5e')](_0xfc03e9[_0x640f('0x5f')],{})[_0x640f('0x22')](function(_0x17f07a){var _0x56a963=_0xfc03e9[_0x640f('0x60')]['get']({'plain':!![]});if(!_0x56a963)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56a963[_0x640f('0x61')]===_0x640f('0x60')){var _0x4321d1=_0x17f07a[_0x640f('0x3a')]({'plain':!![]});var _0x4e8d69=_0x640f('0x62');return db[_0x640f('0x63')][_0x640f('0x64')]({'where':{'name':_0x4e8d69,'userProfileId':_0x56a963[_0x640f('0x65')]},'raw':!![]})['then'](function(_0x55e06f){if(_0x55e06f&&_0x55e06f[_0x640f('0x66')]===0x0){return db[_0x640f('0x3b')][_0x640f('0x5e')]({'name':_0x4321d1[_0x640f('0x3e')],'resourceId':_0x4321d1['id'],'type':_0x55e06f[_0x640f('0x3e')],'sectionId':_0x55e06f['id']},{})[_0x640f('0x22')](function(){return _0x17f07a;});}else{return _0x17f07a;}})[_0x640f('0x2b')](function(_0x1daa00){logger[_0x640f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1daa00);throw _0x1daa00;});}return _0x17f07a;})[_0x640f('0x22')](respondWithResult(_0x50e6a6,0xc9))['catch'](handleError(_0x50e6a6,null));};exports['update']=function(_0x56e5ed,_0x1e6f45){if(_0x56e5ed[_0x640f('0x5f')]['id']){delete _0x56e5ed[_0x640f('0x5f')]['id'];}return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x56e5ed[_0x640f('0x5c')]['id']},'include':[{'model':db[_0x640f('0x41')],'as':_0x640f('0x67')}]})['then'](handleEntityNotFound(_0x1e6f45,null))[_0x640f('0x22')](saveUpdates(_0x56e5ed[_0x640f('0x5f')],null))[_0x640f('0x22')](respondWithResult(_0x1e6f45,null))[_0x640f('0x2b')](handleError(_0x1e6f45,null));};exports[_0x640f('0x3c')]=function(_0x3d5cee,_0x5b0b5b){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x3d5cee[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x5b0b5b,null))[_0x640f('0x22')](removeEntity(_0x5b0b5b,null))[_0x640f('0x2b')](handleError(_0x5b0b5b,null));};exports[_0x640f('0x68')]=function(_0x1ecdc1,_0x3e6572){return db['ChatWebsite'][_0x640f('0x68')]()[_0x640f('0x22')](respondWithResult(_0x3e6572,null))[_0x640f('0x2b')](handleError(_0x3e6572,null));};exports[_0x640f('0x69')]=function(_0x2222ab,_0x2ce467,_0x3bbc91){if(_0x2222ab['body']['id']){delete _0x2222ab[_0x640f('0x5f')]['id'];}return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x2222ab[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x2ce467,null))[_0x640f('0x22')](function(_0x172f8c){if(_0x172f8c){_0x2222ab[_0x640f('0x5f')][_0x640f('0x6a')]=_0x172f8c['id'];return db[_0x640f('0x6b')][_0x640f('0x5e')](_0x2222ab[_0x640f('0x5f')]);}})[_0x640f('0x22')](respondWithResult(_0x2ce467,null))['catch'](handleError(_0x2ce467,null));};exports[_0x640f('0x6c')]=function(_0x82d895,_0x446aea,_0x58c118){var _0x37e6fb={'raw':![],'where':{}};var _0x1aed2f={};var _0x187b3a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x640f('0x6d')]({'where':{'id':_0x82d895[_0x640f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x446aea,null))[_0x640f('0x22')](function(_0x108834){if(_0x108834){_0x1aed2f[_0x640f('0x49')]=_[_0x640f('0x47')](db['Disposition'][_0x640f('0x44')]);_0x1aed2f[_0x640f('0x46')]=_[_0x640f('0x47')](_0x82d895[_0x640f('0x46')]);_0x1aed2f[_0x640f('0x5d')]=_['intersection'](_0x1aed2f[_0x640f('0x49')],_0x1aed2f[_0x640f('0x46')]);_0x37e6fb[_0x640f('0x4a')]=_[_0x640f('0x48')](_0x1aed2f[_0x640f('0x49')],qs[_0x640f('0x4b')](_0x82d895[_0x640f('0x46')][_0x640f('0x4b')]));_0x37e6fb[_0x640f('0x4a')]=_0x37e6fb['attributes'][_0x640f('0x4c')]?_0x37e6fb[_0x640f('0x4a')]:_0x1aed2f[_0x640f('0x49')];if(!_0x82d895['query'][_0x640f('0x4d')](_0x640f('0x4e'))){_0x37e6fb[_0x640f('0x31')]=qs['limit'](_0x82d895[_0x640f('0x46')][_0x640f('0x31')]);_0x37e6fb[_0x640f('0x2f')]=qs['offset'](_0x82d895[_0x640f('0x46')][_0x640f('0x2f')]);}_0x37e6fb['order']=qs[_0x640f('0x4f')](_0x82d895[_0x640f('0x46')][_0x640f('0x4f')]);_0x37e6fb[_0x640f('0x50')]=qs[_0x640f('0x5d')](_[_0x640f('0x51')](_0x82d895['query'],_0x1aed2f[_0x640f('0x5d')]));_0x37e6fb[_0x640f('0x50')][_0x640f('0x6a')]=_0x108834['id'];if(_0x82d895[_0x640f('0x46')][_0x640f('0x52')]){_0x37e6fb[_0x640f('0x50')]=_[_0x640f('0x53')](_0x37e6fb[_0x640f('0x50')],{'$or':_['map'](_0x37e6fb[_0x640f('0x4a')],function(_0x24791b){var _0x21375f={};_0x21375f[_0x24791b]={'$like':'%'+_0x82d895[_0x640f('0x46')][_0x640f('0x52')]+'%'};return _0x21375f;})});}_0x37e6fb=_[_0x640f('0x53')]({},_0x37e6fb,_0x82d895[_0x640f('0x56')]);return db['Disposition'][_0x640f('0x32')]({'where':_0x37e6fb[_0x640f('0x50')]})[_0x640f('0x22')](function(_0x6f050d){_0x187b3a[_0x640f('0x32')]=_0x6f050d;if(_0x82d895['query'][_0x640f('0x57')]){_0x37e6fb[_0x640f('0x58')]=[{'all':!![]}];}return db[_0x640f('0x6b')]['findAll'](_0x37e6fb);})['then'](function(_0x2c0c3b){_0x187b3a['rows']=_0x2c0c3b;return _0x187b3a;});}})[_0x640f('0x22')](respondWithFilteredResult(_0x446aea,_0x37e6fb))['catch'](handleError(_0x446aea,null));};exports[_0x640f('0x6e')]=function(_0x15ba28,_0x2fc989,_0x258812){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x15ba28['params']['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x2fc989,null))[_0x640f('0x22')](function(_0x3c33e0){if(_0x3c33e0){return _0x3c33e0[_0x640f('0x6e')](_0x15ba28[_0x640f('0x46')][_0x640f('0x6f')]);}})[_0x640f('0x22')](respondWithStatusCode(_0x2fc989,null))[_0x640f('0x2b')](handleError(_0x2fc989,null));};exports[_0x640f('0x70')]=function(_0x40d996,_0x20ee5d,_0x153b5d){if(_0x40d996['body']['id']){delete _0x40d996[_0x640f('0x5f')]['id'];}return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x40d996[_0x640f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20ee5d,null))[_0x640f('0x22')](function(_0x45afb3){if(_0x45afb3){_0x40d996[_0x640f('0x5f')]['ChatWebsiteId']=_0x45afb3['id'];return db['CannedAnswer'][_0x640f('0x5e')](_0x40d996['body']);}})[_0x640f('0x22')](respondWithResult(_0x20ee5d,null))['catch'](handleError(_0x20ee5d,null));};exports['getAnswers']=function(_0x4cd1ca,_0x2f93f1,_0x2af00d){var _0xb75ae={'raw':![],'where':{}};var _0x32e237={};var _0x4cf0f7={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4cd1ca[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x2f93f1,null))[_0x640f('0x22')](function(_0x3d270a){if(_0x3d270a){_0x32e237[_0x640f('0x49')]=_[_0x640f('0x47')](db['CannedAnswer'][_0x640f('0x44')]);_0x32e237[_0x640f('0x46')]=_['keys'](_0x4cd1ca[_0x640f('0x46')]);_0x32e237['filters']=_[_0x640f('0x48')](_0x32e237[_0x640f('0x49')],_0x32e237[_0x640f('0x46')]);_0xb75ae[_0x640f('0x4a')]=_[_0x640f('0x48')](_0x32e237['model'],qs['fields'](_0x4cd1ca[_0x640f('0x46')][_0x640f('0x4b')]));_0xb75ae[_0x640f('0x4a')]=_0xb75ae[_0x640f('0x4a')][_0x640f('0x4c')]?_0xb75ae[_0x640f('0x4a')]:_0x32e237[_0x640f('0x49')];if(!_0x4cd1ca[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0xb75ae['limit']=qs[_0x640f('0x31')](_0x4cd1ca['query']['limit']);_0xb75ae[_0x640f('0x2f')]=qs[_0x640f('0x2f')](_0x4cd1ca[_0x640f('0x46')][_0x640f('0x2f')]);}_0xb75ae[_0x640f('0x71')]=qs[_0x640f('0x4f')](_0x4cd1ca[_0x640f('0x46')][_0x640f('0x4f')]);_0xb75ae[_0x640f('0x50')]=qs['filters'](_['pick'](_0x4cd1ca['query'],_0x32e237[_0x640f('0x5d')]));_0xb75ae['where'][_0x640f('0x6a')]=_0x3d270a['id'];if(_0x4cd1ca[_0x640f('0x46')][_0x640f('0x52')]){_0xb75ae[_0x640f('0x50')]=_[_0x640f('0x53')](_0xb75ae[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0xb75ae[_0x640f('0x4a')],function(_0x373074){var _0x10875f={};_0x10875f[_0x373074]={'$like':'%'+_0x4cd1ca[_0x640f('0x46')]['filter']+'%'};return _0x10875f;})});}_0xb75ae=_[_0x640f('0x53')]({},_0xb75ae,_0x4cd1ca['options']);return db[_0x640f('0x72')][_0x640f('0x32')]({'where':_0xb75ae[_0x640f('0x50')]})[_0x640f('0x22')](function(_0x27b7e6){_0x4cf0f7[_0x640f('0x32')]=_0x27b7e6;if(_0x4cd1ca['query']['includeAll']){_0xb75ae['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x640f('0x59')](_0xb75ae);})[_0x640f('0x22')](function(_0x597b2e){_0x4cf0f7['rows']=_0x597b2e;return _0x4cf0f7;});}})[_0x640f('0x22')](respondWithFilteredResult(_0x2f93f1,_0xb75ae))['catch'](handleError(_0x2f93f1,null));};exports['removeAnswers']=function(_0x1bc3a6,_0x2ecba7,_0xc39c5e){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x1bc3a6[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x2ecba7,null))[_0x640f('0x22')](function(_0x321b0f){if(_0x321b0f){return _0x321b0f[_0x640f('0x73')](_0x1bc3a6[_0x640f('0x46')][_0x640f('0x6f')]);}})['then'](respondWithStatusCode(_0x2ecba7,null))[_0x640f('0x2b')](handleError(_0x2ecba7,null));};exports[_0x640f('0x74')]=function(_0x49cd11,_0x1dd010,_0x42290b){_0x49cd11[_0x640f('0x5f')][_0x640f('0x75')]=_0x49cd11['file']['filename'];return db['ChatWebsite'][_0x640f('0x64')]({'where':{'id':_0x49cd11[_0x640f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1dd010,null))['then'](saveUpdates(_0x49cd11[_0x640f('0x5f')],null))[_0x640f('0x22')](respondWithResult(_0x1dd010,null))['catch'](handleError(_0x1dd010,null));};exports[_0x640f('0x76')]=function(_0x5ecb94,_0x2088c7,_0x5f448e){_0x5ecb94[_0x640f('0x5f')][_0x640f('0x77')]=_0x5ecb94[_0x640f('0x78')][_0x640f('0x79')];return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x5ecb94[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x2088c7,null))[_0x640f('0x22')](saveUpdates(_0x5ecb94[_0x640f('0x5f')],null))[_0x640f('0x22')](respondWithResult(_0x2088c7,null))[_0x640f('0x2b')](handleError(_0x2088c7,null));};exports[_0x640f('0x7a')]=function(_0x54ce7b,_0x31f2ca,_0x26de7d){_0x54ce7b['body'][_0x640f('0x7b')]=_0x54ce7b[_0x640f('0x78')][_0x640f('0x79')];return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x54ce7b[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x31f2ca,null))[_0x640f('0x22')](saveUpdates(_0x54ce7b[_0x640f('0x5f')],null))[_0x640f('0x22')](respondWithResult(_0x31f2ca,null))['catch'](handleError(_0x31f2ca,null));};exports[_0x640f('0x7c')]=function(_0x386a5b,_0x2bd940,_0x4d00f4){_0x386a5b[_0x640f('0x5f')][_0x640f('0x7d')]=_0x386a5b[_0x640f('0x78')][_0x640f('0x79')];return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x386a5b['params']['id']}})['then'](handleEntityNotFound(_0x2bd940,null))[_0x640f('0x22')](saveUpdates(_0x386a5b[_0x640f('0x5f')],null))[_0x640f('0x22')](respondWithResult(_0x2bd940,null))['catch'](handleError(_0x2bd940,null));};exports[_0x640f('0x7e')]=function(_0xe1b620,_0x3e0a9a,_0x100e62){var _0x3da80b=path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0x81'));var _0x47b111={'where':{'id':_0xe1b620[_0x640f('0x5c')]['id']},'attributes':['id',_0x640f('0x75')],'raw':!![]};var _0xe80e1b=![];return require(_0x640f('0x18'))[_0x640f('0x82')]()['then'](function(_0x43555e){if(_0x43555e){_0xe80e1b=_0x43555e['custom'];}})[_0x640f('0x22')](function(){return db[_0x640f('0x43')][_0x640f('0x64')](_0x47b111);})[_0x640f('0x22')](handleEntityNotFound(_0x3e0a9a,null))[_0x640f('0x22')](function(_0x968f76){if(_0x968f76){if(!_['isNil'](_0x968f76[_0x640f('0x75')])){if(fs[_0x640f('0x83')](path[_0x640f('0x7f')](config['root'],_0x640f('0x84'),_0x968f76[_0x640f('0x75')]))&&_0xe80e1b){_0x3da80b=path['join'](config['root'],_0x640f('0x84'),_0x968f76['sitepic']);}}return _0x3e0a9a[_0x640f('0x85')](_0x3da80b);}})[_0x640f('0x2b')](handleError(_0x3e0a9a,null));};exports[_0x640f('0x86')]=function(_0x571895,_0x1da843,_0x22c564){var _0x5687f7=path[_0x640f('0x7f')](config[_0x640f('0x80')],'server/files/images/avatars/default_avatar.png');var _0x454178={'where':{'id':_0x571895[_0x640f('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x640f('0x43')][_0x640f('0x64')](_0x454178)[_0x640f('0x22')](handleEntityNotFound(_0x1da843,null))[_0x640f('0x22')](function(_0x3f7b3e){if(_0x3f7b3e){if(!_[_0x640f('0x87')](_0x3f7b3e[_0x640f('0x77')])){if(fs[_0x640f('0x83')](path[_0x640f('0x7f')](config[_0x640f('0x80')],'server/files/images/avatars/',_0x3f7b3e[_0x640f('0x77')]))){_0x5687f7=path[_0x640f('0x7f')](config[_0x640f('0x80')],'server/files/images/avatars/',_0x3f7b3e[_0x640f('0x77')]);}}return _0x1da843[_0x640f('0x85')](_0x5687f7);}})['catch'](handleError(_0x1da843,null));};exports['getCustomerAvatar']=function(_0x217201,_0x4266af,_0xc22188){var _0x3ff500=path[_0x640f('0x7f')](config['root'],_0x640f('0x88'));var _0x41613f={'where':{'id':_0x217201[_0x640f('0x5c')]['id']},'attributes':['id','customerAvatar',_0x640f('0x89')],'raw':!![]};return db[_0x640f('0x43')]['find'](_0x41613f)['then'](handleEntityNotFound(_0x4266af,null))[_0x640f('0x22')](function(_0x1f82bb){if(_0x1f82bb){if(!_[_0x640f('0x87')](_0x1f82bb['customerAvatar'])){if(fs[_0x640f('0x83')](path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0x8a'),_0x1f82bb[_0x640f('0x7b')]))&&_0x1f82bb[_0x640f('0x89')]){_0x3ff500=path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0x8a'),_0x1f82bb['customerAvatar']);}}return _0x4266af['download'](_0x3ff500);}})[_0x640f('0x2b')](handleError(_0x4266af,null));};exports[_0x640f('0x8b')]=function(_0x5d3b3f,_0x3a333d,_0x6d5f7d){var _0x25fe6a=path[_0x640f('0x7f')](config[_0x640f('0x80')],'server/files/images/avatars/system_avatar.png');var _0x5b7014={'where':{'id':_0x5d3b3f[_0x640f('0x5c')]['id']},'attributes':['id',_0x640f('0x7d')],'raw':!![]};return db[_0x640f('0x43')][_0x640f('0x64')](_0x5b7014)[_0x640f('0x22')](handleEntityNotFound(_0x3a333d,null))['then'](function(_0x24d5d7){if(_0x24d5d7){if(!_[_0x640f('0x87')](_0x24d5d7[_0x640f('0x7d')])){if(fs['existsSync'](path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0x8a'),_0x24d5d7[_0x640f('0x7d')]))){_0x25fe6a=path[_0x640f('0x7f')](config[_0x640f('0x80')],'server/files/images/avatars/',_0x24d5d7[_0x640f('0x7d')]);}}return _0x3a333d[_0x640f('0x85')](_0x25fe6a);}})[_0x640f('0x2b')](handleError(_0x3a333d,null));};exports[_0x640f('0x8c')]=function(_0x11bd8e,_0x435fc2,_0x3c1783){var _0x2d11e3=require(_0x640f('0x8d'));var _0x1c1e2a=new _0x2d11e3();var _0x27e642=_0x1c1e2a[_0x640f('0x8e')](_0x11bd8e[_0x640f('0x8f')]['user-agent'])[_0x640f('0x90')]();var _0x368cf2={'body':_0x11bd8e[_0x640f('0x5f')],'channel':_0x640f('0x91')};var _0xa54f08=[];var _0x53950a=[];var _0x328ba8={};var _0x57b0ca=![];return db['CmContact'][_0x640f('0x68')]()['then'](function(_0x1cbb15){if(!_0x1cbb15){throw new db[(_0x640f('0x92'))][(_0x640f('0x93'))](_0x640f('0x94'));}_0xa54f08=_['difference'](_[_0x640f('0x47')](_0x1cbb15),[_0x640f('0x95'),_0x640f('0x96')]);_0x53950a=_[_0x640f('0x97')](_[_0x640f('0x47')](_0x1cbb15),[_0x640f('0x95'),'updatedAt',_0x640f('0x98'),_0x640f('0x99')]);if(_0x11bd8e[_0x640f('0x5f')]['id']){delete _0x11bd8e[_0x640f('0x5f')]['id'];}if(_[_0x640f('0x87')](_0x11bd8e['body'][_0x640f('0x9a')])){throw new db[(_0x640f('0x92'))][(_0x640f('0x93'))]('from\x20is\x20mandatory');}if(_[_0x640f('0x87')](_0x11bd8e[_0x640f('0x5f')]['body'])||_0x11bd8e[_0x640f('0x5f')][_0x640f('0x5f')]===''){throw new db[(_0x640f('0x92'))][(_0x640f('0x93'))](_0x640f('0x9b'));}if(_[_0x640f('0x87')](_0x11bd8e['body'][_0x640f('0x9c')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x53950a);}if(!_[_0x640f('0x9d')](_0x53950a,_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9c')])){throw new db[(_0x640f('0x92'))][(_0x640f('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x53950a);}_0x328ba8[_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9c')]]=_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9a')];})[_0x640f('0x22')](function(){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x11bd8e[_0x640f('0x5c')]['id']},'include':[{'model':db[_0x640f('0x9e')],'as':_0x640f('0x9f'),'include':[{'model':db[_0x640f('0xa0')],'as':_0x640f('0xa1'),'where':_0x328ba8,'limit':0x1,'order':[[_0x640f('0x96'),_0x640f('0xa2')]]}]},{'model':db[_0x640f('0xa3')],'as':'Applications'}]});})[_0x640f('0x22')](handleEntityNotFound(_0x435fc2,null))[_0x640f('0x22')](function(_0xf91310){if(_0xf91310&&_0xf91310['List']){_0x368cf2[_0x640f('0xa4')]=_0xf91310;_0x368cf2['applications']=_0xf91310['Applications'];_0x368cf2['list']=_0xf91310[_0x640f('0x9f')];_0x368cf2[_0x640f('0xa5')]=_[_0x640f('0xa6')](_0x368cf2[_0x640f('0xa5')],[_0x640f('0xa7')],[_0x640f('0xa8')]);if(_0x368cf2[_0x640f('0xa4')][_0x640f('0xa9')]){delete _0x368cf2['account'][_0x640f('0xa9')];}if(_0x368cf2[_0x640f('0xa4')][_0x640f('0x9f')]&&_0x368cf2[_0x640f('0xa4')][_0x640f('0x9f')][_0x640f('0xa1')]['length']){return _0x368cf2[_0x640f('0xa4')][_0x640f('0x9f')][_0x640f('0xa1')][0x0];}var _0x538b28=_[_0x640f('0x1a')](_0x11bd8e[_0x640f('0x5f')],{'firstName':_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9a')],'ListId':_0xf91310[_0x640f('0x99')]});_0x538b28[_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9c')]]=_0x11bd8e[_0x640f('0x5f')][_0x640f('0x9a')];return db[_0x640f('0xa0')][_0x640f('0x5e')](_0x538b28,{'fields':_0xa54f08,'raw':!![]});}})[_0x640f('0x22')](handleEntityNotFound(_0x435fc2,null))[_0x640f('0x22')](function(_0x5b5b50){_0x368cf2[_0x640f('0xaa')]=_0x5b5b50;var _0xdf225c=_0x11bd8e[_0x640f('0x5f')][_0x640f('0xab')];if(_0x11bd8e['headers'][_0x640f('0xac')]){_0xdf225c=_0x11bd8e[_0x640f('0x8f')][_0x640f('0xac')];}else if(_0x11bd8e['headers'][_0x640f('0xad')]){_0xdf225c=_['first'](_0x11bd8e['headers'][_0x640f('0xad')][_0x640f('0xae')](','));}if(_0x5b5b50){var _0x2f23ae={'ContactId':_0x5b5b50['id'],'ChatWebsiteId':_0x11bd8e[_0x640f('0x5c')]['id'],'from':(_0x5b5b50[_0x640f('0xaf')]||'')+'\x20'+(_0x5b5b50[_0x640f('0xb0')]||''),'customerIp':_0xdf225c,'customerPort':_0x11bd8e['headers'][_0x640f('0xb1')]?_0x11bd8e['headers'][_0x640f('0xb1')]:null,'referer':_0x11bd8e[_0x640f('0x5f')][_0x640f('0xb2')],'browserName':_0x27e642[_0x640f('0xb3')][_0x640f('0x3e')]&&_0x27e642[_0x640f('0xb3')][_0x640f('0xb4')]?util[_0x640f('0xb5')](_0x640f('0xb6'),_0x27e642['browser'][_0x640f('0x3e')],_0x27e642[_0x640f('0xb3')]['version']):_0x640f('0xb7'),'browserVersion':_0x27e642['browser'][_0x640f('0xb4')]||_0x640f('0xb7'),'osName':util[_0x640f('0xb5')]('%s\x20%s',_0x27e642['os'][_0x640f('0x3e')],_0x27e642['os'][_0x640f('0xb4')]),'osVersion':_0x27e642['os'][_0x640f('0xb4')],'deviceModel':_0x27e642[_0x640f('0xb8')]['model']&&_0x27e642['device']['vendor']?util[_0x640f('0xb5')](_0x640f('0xb9'),_0x27e642[_0x640f('0xb8')]['model'],_0x27e642[_0x640f('0xb8')][_0x640f('0xba')],_0x27e642[_0x640f('0xb8')][_0x640f('0x54')]):null,'deviceVendor':_0x27e642['device'][_0x640f('0xba')],'deviceType':_0x27e642[_0x640f('0xb8')][_0x640f('0x54')],'formData':JSON[_0x640f('0xbb')](_0x11bd8e[_0x640f('0x5f')])};var _0x3649ea={'ChatWebsiteId':_0x11bd8e[_0x640f('0x5c')]['id'],'closed':![]};if(_0x11bd8e['body'][_0x640f('0xbc')]){_0x3649ea['threadId']=_0x11bd8e['body']['threadId'];return db[_0x640f('0xbd')][_0x640f('0x64')]({'where':_0x3649ea})[_0x640f('0x22')](function(_0x11d81e){if(_0x11d81e){return[_0x11d81e,![]];}_0x2f23ae['threadId']=_0x11bd8e['body']['threadId'];_0x2f23ae['externalUrl']=_0x11bd8e[_0x640f('0x5f')][_0x640f('0xbe')];return db[_0x640f('0xbd')][_0x640f('0x5e')](_0x2f23ae)[_0x640f('0x22')](function(_0x4973fc){return[_0x4973fc,!![]];});});}_0x3649ea[_0x640f('0xbf')]=_0x5b5b50['id'];if(_0x11bd8e['body'][_0x640f('0xc0')]&&_0x11bd8e[_0x640f('0x5f')]['interaction']['id']){_0x3649ea['id']=_0x11bd8e['body']['interaction']['id'];return db[_0x640f('0xbd')][_0x640f('0x64')]({'where':_0x3649ea})[_0x640f('0x22')](function(_0x3306f9){if(_0x3306f9){return[_0x3306f9,![]];}return db[_0x640f('0xbd')][_0x640f('0x5e')](_0x2f23ae)[_0x640f('0x22')](function(_0x54a53e){return[_0x54a53e,!![]];});});}return db[_0x640f('0xbd')][_0x640f('0x5e')](_0x2f23ae)['then'](function(_0x3d071f){return[_0x3d071f,!![]];});}})['spread'](function(_0x4862c7,_0x2575d5){if(_0x4862c7){_0x57b0ca=_0x2575d5;if(!_0x2575d5){var _0x538f36={'from':(_0x368cf2['contact'][_0x640f('0xaf')]||'')+'\x20'+(_0x368cf2[_0x640f('0xaa')]['lastName']||'')};if(_0x11bd8e[_0x640f('0x5f')][_0x640f('0xbc')]&&_0x11bd8e[_0x640f('0x5f')][_0x640f('0xc1')]&&_0x11bd8e[_0x640f('0x5f')][_0x640f('0xbc')]!=_0x11bd8e[_0x640f('0x5f')][_0x640f('0xc1')]){_0x538f36[_0x640f('0xbc')]=_0x11bd8e[_0x640f('0x5f')][_0x640f('0xc1')];}return _0x4862c7[_0x640f('0x39')](_0x538f36);}else{return _0x4862c7;}}})[_0x640f('0x22')](function(_0x2b6543){_0x368cf2[_0x640f('0xc0')]=_0x2b6543[_0x640f('0x3a')]({'plain':!![]});_0x368cf2['interaction'][_0x640f('0xc2')]=_0x57b0ca;if(_0x368cf2[_0x640f('0xc0')][_0x640f('0xc2')]){if(_0x368cf2[_0x640f('0xa4')][_0x640f('0xc3')]){_0x368cf2[_0x640f('0xa5')][_0x640f('0xc4')]({'id':0x0,'priority':_0x368cf2[_0x640f('0xa5')]['length']+0x1,'app':_0x640f('0xc5'),'appdata':_0x640f('0xc6'),'interval':_0x640f('0xc7')});}}return db[_0x640f('0xc8')][_0x640f('0x5e')]({'body':_0x11bd8e[_0x640f('0x5f')][_0x640f('0x5f')],'ChatWebsiteId':_0x11bd8e['params']['id'],'ChatInteractionId':_0x2b6543['id'],'direction':'in','ContactId':_0x368cf2[_0x640f('0xaa')]['id'],'AttachmentId':_0x11bd8e[_0x640f('0x5f')][_0x640f('0xc9')]});})[_0x640f('0x22')](function(_0x2229e7){_0x368cf2[_0x640f('0x29')]=_0x2229e7;if(_0x368cf2[_0x640f('0xc0')][_0x640f('0xca')]){return db[_0x640f('0xcb')][_0x640f('0x64')]({'attributes':['id','name'],'where':{'id':_0x368cf2[_0x640f('0xc0')][_0x640f('0xca')]}})[_0x640f('0x22')](function(_0x49ee03){if(_0x49ee03){_0x368cf2['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x49ee03[_0x640f('0x3e')]+','+(_0x368cf2['account'][_0x640f('0xcc')]||0xa),'interval':_0x640f('0xc7')});_0x368cf2[_0x640f('0xcd')]=!![];}return respondWithRpcPromise(_0x640f('0xce'),_0x640f('0xcf'),_0x368cf2);});}return respondWithRpcPromise(_0x640f('0xce'),_0x640f('0xcf'),_0x368cf2);})[_0x640f('0x22')](function(_0x463422){respondWithRpcPromise(_0x640f('0xd0'),_0x640f('0xd0'),{'event':_0x640f('0x8c'),'message':_0x463422},client9002);return _0x463422;})['then'](respondWithResult(_0x435fc2,null))[_0x640f('0x2b')](handleError(_0x435fc2,null));};exports[_0x640f('0xd1')]=function(_0x5c06d6,_0x6ec81,_0x41ce00){var _0x1d81b6,_0x12a035,_0x3ab2c3;var _0x23c695=[];var _0x5ba252=[];var _0x37776e={};var _0x3989d1=_0x5c06d6[_0x640f('0xd2')]||[];var _0x229355=[];var _0x52bdc9;return db['CmContact'][_0x640f('0x68')]()[_0x640f('0x22')](function(_0x3a613e){if(!_0x3a613e){throw new db['Sequelize']['ValidationError'](_0x640f('0x94'));}_0x5ba252=_[_0x640f('0x97')](_['keys'](_0x3a613e),[_0x640f('0x95'),'updatedAt']);_0x23c695=_[_0x640f('0x97')](_[_0x640f('0x47')](_0x3a613e),['createdAt',_0x640f('0x96'),_0x640f('0x98'),'ListId']);if(_0x5c06d6[_0x640f('0x5f')]['id']){delete _0x5c06d6[_0x640f('0x5f')]['id'];}if(_[_0x640f('0x87')](_0x5c06d6[_0x640f('0x5f')][_0x640f('0x9a')])){throw _0x6ec81[_0x640f('0x2d')](0x1f4)[_0x640f('0x3f')](new db[(_0x640f('0x92'))][(_0x640f('0x93'))](_0x640f('0xd3')));}if(_[_0x640f('0x87')](_0x5c06d6[_0x640f('0x5f')][_0x640f('0x5f')])||_0x5c06d6[_0x640f('0x5f')]['body']===''){throw _0x6ec81[_0x640f('0x2d')](0x1f4)[_0x640f('0x3f')](new db[(_0x640f('0x92'))]['ValidationError'](_0x640f('0x9b')));}if(_[_0x640f('0x87')](_0x5c06d6[_0x640f('0x5f')][_0x640f('0xd4')])){throw _0x6ec81[_0x640f('0x2d')](0x1f4)[_0x640f('0x3f')](new db[(_0x640f('0x92'))]['ValidationError'](_0x640f('0xd5')+_0x23c695));}if(!_['includes'](_0x23c695,_0x5c06d6['body']['mapKeyOffline'])){throw _0x6ec81[_0x640f('0x2d')](0x1f4)[_0x640f('0x3f')](new db[(_0x640f('0x92'))][(_0x640f('0x93'))](_0x640f('0xd6')+_0x23c695));}_0x37776e[_0x5c06d6[_0x640f('0x5f')][_0x640f('0xd4')]]=_0x5c06d6[_0x640f('0x5f')][_0x640f('0x9a')];})[_0x640f('0x22')](function(){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x5c06d6[_0x640f('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x640f('0x9f')},{'model':db[_0x640f('0xd7')],'as':_0x640f('0xd7')}]});})[_0x640f('0x22')](handleEntityNotFound(_0x6ec81,null))['then'](function(_0xb89f12){if(_0xb89f12&&_0xb89f12[_0x640f('0x9f')]){_0x12a035=_0xb89f12;var _0x38c4ae=_[_0x640f('0x1a')](_0x5c06d6['body'],{'firstName':_0x5c06d6[_0x640f('0x5f')][_0x640f('0x9a')],'phone':_0x5c06d6[_0x640f('0x5f')][_0x640f('0x9a')],'ListId':_0xb89f12['ListId']});_0x38c4ae[_0x5c06d6[_0x640f('0x5f')][_0x640f('0xd4')]]=_0x5c06d6[_0x640f('0x5f')]['from'];return db[_0x640f('0xa0')]['findOrCreate']({'where':_0x37776e,'defaults':_0x38c4ae});}})['spread'](function(_0x5c7815){if(_0x5c7815){_0x3ab2c3=_0x5c7815;var _0x237b07=fs[_0x640f('0xd8')](path['join'](config[_0x640f('0x80')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x43da3d=ejs['render'](_0x237b07,{'body':_[_0x640f('0xd9')](_0x5c06d6[_0x640f('0x5f')][_0x640f('0x5f')]),'bodyTitle':_0x12a035[_0x640f('0xda')]});return db[_0x640f('0xdb')][_0x640f('0x5e')]({'body':_0x43da3d,'ContactId':_0x5c7815['id'],'ChatWebsiteId':_0x12a035['id']});}})[_0x640f('0x22')](function(_0x5437c3){_0x52bdc9=_0x5437c3;if(_0x3989d1[_0x640f('0x4c')]){var _0x2242ff=_0x3989d1[_0x640f('0x42')](function(_0x45a73d){return{'name':_0x45a73d[_0x640f('0xdc')],'basename':_0x45a73d['filename'],'type':_0x45a73d['mimetype'],'ChatOfflineMessageId':_0x5437c3['id']};});_0x229355=_0x2242ff[_0x640f('0x42')](_0xea464e=>{var _0x575dfd={'filename':_0xea464e[_0x640f('0x3e')],'path':path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0xdd'),_0x640f('0xd2'),'attachments',_0x640f('0xde'),_0xea464e['basename'])};return _0x575dfd;});if(!_0x12a035[_0x640f('0xdf')]){return db[_0x640f('0xe0')][_0x640f('0xe1')](function(_0x5cc53e){return db['Attachment']['bulkCreate'](_0x2242ff,{'transaction':_0x5cc53e});});}}})['then'](function(){if(_0x52bdc9){_0x1d81b6=_0x52bdc9;return db[_0x640f('0xd7')][_0x640f('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x640f('0xe2')],'as':_0x640f('0xe3'),'raw':!![]}]});}})[_0x640f('0x22')](function(_0x3e6d03){if(_0x3e6d03&&_0x3e6d03[_0x640f('0xe3')]&&_0x12a035[_0x640f('0xe4')]&&_0x12a035[_0x640f('0xe5')]){var _0x5546f7={'tls':{'rejectUnauthorized':![]}};if(_0x3e6d03[_0x640f('0xe3')][_0x640f('0xe6')]){_0x5546f7['service']=_0x3e6d03[_0x640f('0xe3')]['service'];}else{_0x5546f7[_0x640f('0xe7')]=_0x3e6d03[_0x640f('0xe3')][_0x640f('0xe7')];_0x5546f7[_0x640f('0xe8')]=_0x3e6d03[_0x640f('0xe3')][_0x640f('0xe8')];_0x5546f7['secure']=_0x3e6d03[_0x640f('0xe3')][_0x640f('0xe9')];}if(_0x3e6d03['Smtp'][_0x640f('0xea')]){_0x5546f7[_0x640f('0xeb')]={'user':_0x3e6d03[_0x640f('0xe3')]['user'],'pass':_0x3e6d03[_0x640f('0xe3')][_0x640f('0xec')]};}return respondWithRpcPromise(_0x640f('0xed'),'sendMail',{'account':_0x5546f7,'message':{'from':util[_0x640f('0xb5')](_0x640f('0xee'),_0x3e6d03['name'],_0x3e6d03[_0x640f('0xef')]||_0x3e6d03['Smtp']['user']),'to':_0x12a035[_0x640f('0xe5')],'subject':_0x12a035['offlineMessageSubject'],'html':_0x1d81b6[_0x640f('0x5f')],'attachments':_0x229355}},client9003)[_0x640f('0x22')](function(){return _0x1d81b6;})[_0x640f('0x2b')](function(_0x49db3e){console[_0x640f('0x27')](_0x49db3e);});}})[_0x640f('0x22')](function(){if(_0x12a035&&_0x12a035[_0x640f('0xdf')]&&_0x12a035['MailAccountId']){var _0x502286=[];if(_0x3989d1[_0x640f('0x4c')]){_0x502286=_0x3989d1[_0x640f('0x42')](function(_0x27f5a5){return{'name':_0x27f5a5[_0x640f('0xdc')],'basename':_0x27f5a5[_0x640f('0x79')],'type':_0x27f5a5['mimetype'],'ChatOfflineMessageId':_0x52bdc9['id']};});}var _0x276861;if(!_[_0x640f('0x87')](_0x12a035[_0x640f('0xf0')])){var _0x49551f=_['map'](_0x5c06d6[_0x640f('0x5f')],function(_0x196534){return _0x196534;});var _0x5ee42e=_[_0x640f('0xf1')](_0x49551f)[0x0];var _0x5b38fd=_[_0x640f('0xf2')](_0x5ee42e,function(_0x4f24fb){return _0x4f24fb;});_0x276861=_0x5b38fd[0x1][_0x12a035[_0x640f('0xf0')]];}var _0x15835c={'from':_0x3ab2c3[_0x640f('0xef')],'firstName':_0x3ab2c3[_0x640f('0xaf')],'lastName':_0x3ab2c3['lastName'],'mapKey':'email','message':{'from':_0x3ab2c3[_0x640f('0xef')],'to':_0x12a035[_0x640f('0xd7')][_0x640f('0xef')],'cc':'','subject':_[_0x640f('0x87')](_0x276861)?_0x12a035[_0x640f('0xf3')]:_0x276861,'messageId':'','sentAt':new Date(),'attach':_0x502286[_0x640f('0x4c')],'attachments':_0x502286,'originChannel':_0x640f('0xf4'),'ChatWebsiteId':_0x12a035['id'],'ChatOfflineMessageId':_0x1d81b6['id'],'originTo':_0x12a035[_0x640f('0xd7')][_0x640f('0xef')]},'body':_0x1d81b6['body']};var _0x21a6ca={'account':{'id':_0x12a035[_0x640f('0xf5')]},'body':_0x15835c,'log':_0x640f('0xf6')};return respondWithRpcPromise(_0x640f('0xf6'),'notifyMail',_0x21a6ca,client9001)[_0x640f('0x22')](function(){return _0x1d81b6;})[_0x640f('0x2b')](function(_0x4da5ac){console[_0x640f('0x27')](_0x4da5ac);});}return;})[_0x640f('0x22')](function(){if(_0x1d81b6){return _0x1d81b6;}})[_0x640f('0x22')](respondWithResult(_0x6ec81,null))[_0x640f('0x2b')](function(_0x3220b9){console[_0x640f('0x27')](_0x640f('0x2b'),_0x3220b9);for(var _0x4e49c1 of _0x3989d1){var _0x47e322=path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0xdd'),'files',_0x640f('0xf7'),_0x640f('0xde'),_0x4e49c1[_0x640f('0x79')]);fs_extra[_0x640f('0xf8')](_0x47e322)[_0x640f('0x2b')](function(_0x49689d){console[_0x640f('0x27')](_0x640f('0xf9'),_0x47e322,_0x49689d);});}});};exports[_0x640f('0xfa')]=function(_0x5166e3,_0x14a025,_0x1496e0){return db['ChatInteraction'][_0x640f('0x64')]({'where':{'id':_0x5166e3[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x14a025,null))[_0x640f('0x22')](function(_0x4e3c80){if(_0x4e3c80){return _0x4e3c80[_0x640f('0xfa')](_0x5166e3[_0x640f('0x5f')]['ids'],_['omit'](_0x5166e3['body'],['ids','id'])||{});}})[_0x640f('0x22')](respondWithResult(_0x14a025,null))[_0x640f('0x2b')](handleError(_0x14a025,null));};exports['getInteractions']=function(_0x22abb9,_0x149071,_0x3b2c49){var _0x172354={'raw':![],'where':{}};var _0x1f24e6={};var _0x4db294={'count':0x0,'rows':[]};return db[_0x640f('0x43')][_0x640f('0x6d')]({'where':{'id':_0x22abb9[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x149071,null))[_0x640f('0x22')](function(_0x43e325){if(_0x43e325){_0x1f24e6[_0x640f('0x49')]=_['keys'](db['ChatInteraction'][_0x640f('0x44')]);_0x1f24e6[_0x640f('0x46')]=_[_0x640f('0x47')](_0x22abb9[_0x640f('0x46')]);_0x1f24e6[_0x640f('0x5d')]=_['intersection'](_0x1f24e6[_0x640f('0x49')],_0x1f24e6[_0x640f('0x46')]);_0x172354[_0x640f('0x4a')]=_[_0x640f('0x48')](_0x1f24e6[_0x640f('0x49')],qs['fields'](_0x22abb9[_0x640f('0x46')][_0x640f('0x4b')]));_0x172354[_0x640f('0x4a')]=_0x172354[_0x640f('0x4a')][_0x640f('0x4c')]?_0x172354[_0x640f('0x4a')]:_0x1f24e6[_0x640f('0x49')];if(!_0x22abb9[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0x172354['limit']=qs['limit'](_0x22abb9[_0x640f('0x46')][_0x640f('0x31')]);_0x172354[_0x640f('0x2f')]=qs[_0x640f('0x2f')](_0x22abb9[_0x640f('0x46')][_0x640f('0x2f')]);}_0x172354['order']=qs['sort'](_0x22abb9[_0x640f('0x46')][_0x640f('0x4f')]);_0x172354[_0x640f('0x50')]=qs[_0x640f('0x5d')](_[_0x640f('0x51')](_0x22abb9[_0x640f('0x46')],_0x1f24e6[_0x640f('0x5d')]));_0x172354[_0x640f('0x50')][_0x640f('0x6a')]=_0x43e325['id'];if(_0x22abb9[_0x640f('0x46')][_0x640f('0x52')]){_0x172354[_0x640f('0x50')]=_[_0x640f('0x53')](_0x172354[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x172354[_0x640f('0x4a')],function(_0x11aa89){var _0x1c6bed={};_0x1c6bed[_0x11aa89]={'$like':'%'+_0x22abb9[_0x640f('0x46')][_0x640f('0x52')]+'%'};return _0x1c6bed;})});}_0x172354=_[_0x640f('0x53')]({},_0x172354,_0x22abb9[_0x640f('0x56')]);return db[_0x640f('0xbd')][_0x640f('0x32')]({'where':_0x172354[_0x640f('0x50')]})['then'](function(_0x34f623){_0x4db294['count']=_0x34f623;if(_0x22abb9['query'][_0x640f('0x57')]){_0x172354[_0x640f('0x58')]=[{'model':db['CmContact'],'as':_0x640f('0xfb'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x640f('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0x640f('0xfc')],'as':_0x640f('0xfd'),'attributes':['id',_0x640f('0x3e'),_0x640f('0xfe')],'where':_0x22abb9[_0x640f('0x46')][_0x640f('0xff')]?{'id':_0x22abb9[_0x640f('0x46')][_0x640f('0xff')]}:undefined,'required':_0x22abb9[_0x640f('0x46')]['tag']?!![]:![]}];}return db[_0x640f('0xbd')][_0x640f('0x59')](_0x172354);})[_0x640f('0x22')](function(_0x3cbd24){_0x4db294[_0x640f('0x5a')]=_0x3cbd24;return _0x4db294;});}})['then'](respondWithFilteredResult(_0x149071,_0x172354))[_0x640f('0x2b')](handleError(_0x149071,null));};function iftimePromise(_0x187d22,_0x1144ac){return respondWithRpcPromise(_0x640f('0x100'),'getSnippet',{'command':_0x1144ac[_0x640f('0x101')]?util[_0x640f('0xb5')](_0x640f('0x102'),_0x187d22[_0x640f('0x103')],_0x1144ac[_0x640f('0x101')]):util[_0x640f('0xb5')](_0x640f('0x104'),_0x187d22['interval'])},client9002)['then'](function(_0x557eda){var _0x52474d=_0x557eda&&_0x557eda[_0x640f('0x105')](_0x640f('0x106'))>=0x0?!![]:![];logger['info'](_0x640f('0x107'),_0x1144ac['id'],_0x187d22['id'],_0x187d22[_0x640f('0x103')],_0x52474d?'ONLINE':_0x640f('0x108'),_0x1144ac[_0x640f('0x101')]?_0x1144ac[_0x640f('0x101')]:_0x640f('0x109'));return _0x52474d;})[_0x640f('0x2b')](function(_0x599f00){logger['error'](_0x640f('0x107'),_0x1144ac['id'],_0x187d22['id'],_0x187d22[_0x640f('0x103')],util[_0x640f('0x10a')](_0x599f00,{'showHidden':![],'depth':null}),_0x1144ac[_0x640f('0x101')]?_0x1144ac[_0x640f('0x101')]:_0x640f('0x109'));return![];});}exports[_0x640f('0x10b')]=function(_0x3a13f5,_0x455e94,_0x37cc36){var _0x3a96ee=0x0;var _0xf50f1b=0x0;var _0x31a49d=![];var _0x587710;var _0x2a33ef;return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x3a13f5[_0x640f('0x5c')]['id']},'include':[{'model':db[_0x640f('0x10c')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x640f('0x10d'),'attributes':['id',_0x640f('0x103')],'raw':!![]}]}]})[_0x640f('0x22')](handleEntityNotFound(_0x455e94,null))[_0x640f('0x22')](function(_0x4222a9){if(_0x4222a9){_0x587710=_0x4222a9;return _0x4222a9['getProactiveActions']({'raw':!![]});}})[_0x640f('0x22')](function(_0x15508d){if(_0x587710){if(_0x15508d){_0x2a33ef=_0x15508d;}}return require(_0x640f('0x18'))[_0x640f('0x82')]();})[_0x640f('0x22')](function(_0x3488c1){if(_0x3488c1){_0xf50f1b=_0x3488c1[_0x640f('0x10e')];_0x31a49d=_0x3488c1[_0x640f('0x10f')];}})[_0x640f('0x22')](function(){return db[_0x640f('0xbd')][_0x640f('0x32')]({'where':{'closed':![]}});})[_0x640f('0x22')](function(_0x58ff92){_0x3a96ee=_0x58ff92;if(_0xf50f1b&&_0x58ff92>_0xf50f1b){return db[_0x640f('0x110')]['findOne']({'where':{'id':0x1}})[_0x640f('0x22')](function(_0x3fa3e1){if(_0x3fa3e1){_0x3fa3e1[_0x640f('0x111')](_0x640f('0x112'));}});}})['then'](function(){if(_0x587710[_0x640f('0x10c')]&&_0x587710[_0x640f('0x10c')]['Intervals']){var _0x4d11f3=[];for(var _0x34c3f8=0x0;_0x34c3f8<_0x587710[_0x640f('0x10c')][_0x640f('0x10d')]['length'];_0x34c3f8++){var _0x14b6f8=_0x587710[_0x640f('0x10c')][_0x640f('0x10d')][_0x34c3f8][_0x640f('0x3a')]({'plain':!![]});_0x4d11f3['push'](iftimePromise(_0x14b6f8,_0x587710));}return BPromise[_0x640f('0x113')](_0x4d11f3)[_0x640f('0x22')](function(_0x28dcdb){return _[_0x640f('0x114')](_0x28dcdb);});}else{return!![];}})[_0x640f('0x22')](function(_0x42e6b9){var _0x42d4dd=fs[_0x640f('0xd8')](path[_0x640f('0x7f')](config[_0x640f('0x80')],_0x640f('0x115')),_0x640f('0x116'));var _0x1d47c6={'remote':_0x587710['remote'],'query':querystring[_0x640f('0xbb')](_['merge'](_0x587710[_0x640f('0x3a')]({'plain':!![]}),{'customerIp':_0x3a13f5[_0x640f('0x8f')][_0x640f('0xad')]||_0x3a13f5[_0x640f('0x8f')]['x-real-ip']||_0x3a13f5['connection'][_0x640f('0x117')]||_0x3a13f5['ip'],'referer':_0x3a13f5[_0x640f('0x8f')]['referer'],'openedInteractions':_0x3a96ee,'maxInteractions':_0xf50f1b,'virtual':_0x31a49d[_0x640f('0x10e')],'online':_0x42e6b9,'custom':_0x31a49d}))['replace'](/'/g,'\x5c\x27')};_0x455e94['send'](ejs[_0x640f('0x118')](Mustache[_0x640f('0x118')](_0x42d4dd,_0x1d47c6),{'proactiveActions':_0x2a33ef,'alignment':_0x587710['alignment'],'verticalAlignment':_0x587710['verticalAlignment'],'div_color':_0x587710[_0x640f('0xfe')],'text_color':_0x587710['textColor'],'button_color':_0x587710[_0x640f('0x119')],'background_color':_0x587710[_0x640f('0x11a')]}));})[_0x640f('0x2b')](handleError(_0x455e94,null));};exports[_0x640f('0x11b')]=function(_0x1e00f2,_0xd79ebd,_0x4431da){return db[_0x640f('0x43')]['findOne']({'where':{'id':_0x1e00f2[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0xd79ebd,null))[_0x640f('0x22')](function(_0x45bedd){if(_0x45bedd){return db[_0x640f('0xe0')][_0x640f('0xe1')](function(_0x2b07a1){return db[_0x640f('0xa3')][_0x640f('0x3c')]({'where':{'ChatWebsiteId':_0x1e00f2['params']['id']},'transaction':_0x2b07a1})[_0x640f('0x22')](function(_0x5054c5){var _0x13e4aa=_[_0x640f('0x42')](_0x1e00f2[_0x640f('0x5f')],function(_0x4737c8){_0x4737c8[_0x640f('0x6a')]=_0x1e00f2['params']['id'];return _0x4737c8;});return db[_0x640f('0xa3')][_0x640f('0x11c')](_0x13e4aa,{'transaction':_0x2b07a1});});})[_0x640f('0x22')](function(){return db[_0x640f('0xa3')][_0x640f('0x11d')]({'where':{'ChatWebsiteId':_0x1e00f2[_0x640f('0x5c')]['id']},'order':'priority'});});}})[_0x640f('0x22')](respondWithResult(_0xd79ebd,null))['catch'](handleError(_0xd79ebd,null));};exports[_0x640f('0x11e')]=function(_0x6df670,_0x1264b3,_0xb470ed){var _0x56edf1={};var _0x43bb46={};var _0x2c32ab;var _0x580b46;return db[_0x640f('0x43')][_0x640f('0x6d')]({'where':{'id':_0x6df670[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x1264b3,null))['then'](function(_0x9f253c){if(_0x9f253c){_0x2c32ab=_0x9f253c;_0x43bb46[_0x640f('0x49')]=_[_0x640f('0x47')](db[_0x640f('0xa3')][_0x640f('0x44')]);_0x43bb46[_0x640f('0x46')]=_[_0x640f('0x47')](_0x6df670[_0x640f('0x46')]);_0x43bb46[_0x640f('0x5d')]=_['intersection'](_0x43bb46['model'],_0x43bb46[_0x640f('0x46')]);_0x56edf1[_0x640f('0x4a')]=_['intersection'](_0x43bb46[_0x640f('0x49')],qs[_0x640f('0x4b')](_0x6df670[_0x640f('0x46')]['fields']));_0x56edf1[_0x640f('0x4a')]=_0x56edf1['attributes'][_0x640f('0x4c')]?_0x56edf1[_0x640f('0x4a')]:_0x43bb46[_0x640f('0x49')];_0x56edf1[_0x640f('0x71')]=qs[_0x640f('0x4f')](_0x6df670[_0x640f('0x46')][_0x640f('0x4f')]);_0x56edf1[_0x640f('0x50')]=qs['filters'](_[_0x640f('0x51')](_0x6df670['query'],_0x43bb46['filters']));if(_0x6df670[_0x640f('0x46')][_0x640f('0x52')]){_0x56edf1[_0x640f('0x50')]=_[_0x640f('0x53')](_0x56edf1[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x56edf1[_0x640f('0x4a')],function(_0x2cded9){var _0x523fef={};_0x523fef[_0x2cded9]={'$like':'%'+_0x6df670['query'][_0x640f('0x52')]+'%'};return _0x523fef;})});}_0x56edf1=_[_0x640f('0x53')]({},_0x56edf1,_0x6df670[_0x640f('0x56')]);return _0x2c32ab[_0x640f('0x11e')](_0x56edf1);}})[_0x640f('0x22')](function(_0x2e9fc9){if(_0x2e9fc9){_0x580b46=_0x2e9fc9[_0x640f('0x4c')];if(!_0x6df670[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0x56edf1[_0x640f('0x31')]=qs[_0x640f('0x31')](_0x6df670[_0x640f('0x46')][_0x640f('0x31')]);_0x56edf1['offset']=qs[_0x640f('0x2f')](_0x6df670[_0x640f('0x46')][_0x640f('0x2f')]);}return _0x2c32ab['getApplications'](_0x56edf1);}})[_0x640f('0x22')](function(_0x29f844){if(_0x29f844){return _0x29f844?{'count':_0x580b46,'rows':_0x29f844}:null;}})[_0x640f('0x22')](respondWithResult(_0x1264b3,null))[_0x640f('0x2b')](handleError(_0x1264b3,null));};exports[_0x640f('0x11f')]=function(_0x57eb6b,_0xcd0ba9,_0x399c94){return db[_0x640f('0x120')][_0x640f('0x64')]({'where':{'id':_0x57eb6b[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0xcd0ba9,null))[_0x640f('0x22')](function(_0x2ee302){if(_0x2ee302){return _0x2ee302[_0x640f('0x11f')](_0x57eb6b['body'][_0x640f('0x6f')],_[_0x640f('0x121')](_0x57eb6b['body'],['ids','id'])||{});}})[_0x640f('0x22')](respondWithResult(_0xcd0ba9,null))[_0x640f('0x2b')](handleError(_0xcd0ba9,null));};exports[_0x640f('0x122')]=function(_0x3ff6cd,_0x73a932,_0xf10a78){var _0x202b67={};var _0x3fc6f1={};var _0x579a88;var _0x5dcd0b;return db[_0x640f('0x43')][_0x640f('0x6d')]({'where':{'id':_0x3ff6cd['params']['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x73a932,null))[_0x640f('0x22')](function(_0x175f82){if(_0x175f82){_0x579a88=_0x175f82;_0x3fc6f1[_0x640f('0x49')]=_[_0x640f('0x47')](db[_0x640f('0x123')][_0x640f('0x44')]);_0x3fc6f1[_0x640f('0x46')]=_['keys'](_0x3ff6cd['query']);_0x3fc6f1['filters']=_[_0x640f('0x48')](_0x3fc6f1[_0x640f('0x49')],_0x3fc6f1['query']);_0x202b67[_0x640f('0x4a')]=_[_0x640f('0x48')](_0x3fc6f1[_0x640f('0x49')],qs[_0x640f('0x4b')](_0x3ff6cd[_0x640f('0x46')][_0x640f('0x4b')]));_0x202b67[_0x640f('0x4a')]=_0x202b67[_0x640f('0x4a')][_0x640f('0x4c')]?_0x202b67[_0x640f('0x4a')]:_0x3fc6f1[_0x640f('0x49')];_0x202b67[_0x640f('0x71')]=qs[_0x640f('0x4f')](_0x3ff6cd[_0x640f('0x46')][_0x640f('0x4f')]);_0x202b67[_0x640f('0x50')]=qs[_0x640f('0x5d')](_[_0x640f('0x51')](_0x3ff6cd[_0x640f('0x46')],_0x3fc6f1[_0x640f('0x5d')]));if(_0x3ff6cd[_0x640f('0x46')]['filter']){_0x202b67[_0x640f('0x50')]=_[_0x640f('0x53')](_0x202b67[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x202b67[_0x640f('0x4a')],function(_0x2b4bc0){var _0x172ca6={};_0x172ca6[_0x2b4bc0]={'$like':'%'+_0x3ff6cd[_0x640f('0x46')]['filter']+'%'};return _0x172ca6;})});}_0x202b67=_[_0x640f('0x53')]({},_0x202b67,_0x3ff6cd[_0x640f('0x56')]);return _0x579a88[_0x640f('0x122')](_0x202b67);}})['then'](function(_0x2d6c57){if(_0x2d6c57){_0x5dcd0b=_0x2d6c57['length'];if(!_0x3ff6cd[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0x202b67[_0x640f('0x31')]=qs['limit'](_0x3ff6cd[_0x640f('0x46')][_0x640f('0x31')]);_0x202b67[_0x640f('0x2f')]=qs[_0x640f('0x2f')](_0x3ff6cd[_0x640f('0x46')][_0x640f('0x2f')]);}return _0x579a88[_0x640f('0x122')](_0x202b67);}})[_0x640f('0x22')](function(_0x31f430){if(_0x31f430){return _0x31f430?{'count':_0x5dcd0b,'rows':_0x31f430}:null;}})[_0x640f('0x22')](respondWithResult(_0x73a932,null))[_0x640f('0x2b')](handleError(_0x73a932,null));};exports['getFields']=function(_0x44c3a,_0xbf808,_0x5b5307){var _0x4bf45c=_0x44c3a[_0x640f('0x46')][_0x640f('0x124')]==='false'?_0x640f('0x125'):_0x640f('0x126');return db[_0x640f('0x43')][_0x640f('0x64')]({'attributes':['id',_0x4bf45c],'where':{'id':_0x44c3a['params']['id']}})['then'](handleEntityNotFound(_0xbf808,null))['then'](function(_0x43d01c){if(_0x43d01c){var _0x79c994=_0x43d01c[_0x4bf45c];var _0x2cdc77=_0x79c994&&_0x79c994['items']?_0x79c994[_0x640f('0x127')]:[];_0xbf808[_0x640f('0x3f')]({'fromKey':_[_0x640f('0x87')](_0x79c994[_0x640f('0x128')])?undefined:_0x79c994[_0x640f('0x128')],'count':_0x2cdc77[_0x640f('0x4c')],'rows':_0x2cdc77});}})[_0x640f('0x2b')](handleError(_0xbf808,null));};exports[_0x640f('0x129')]=function(_0x4fc4e5,_0x57e586,_0x1bf462){var _0x4bad6f={'raw':![],'where':{}};var _0x164b6a={};var _0x61577d={'count':0x0,'rows':[]};return db[_0x640f('0x43')][_0x640f('0x6d')]({'where':{'id':_0x4fc4e5[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x57e586,null))[_0x640f('0x22')](function(_0x3ab076){if(_0x3ab076){_0x164b6a[_0x640f('0x49')]=_['keys'](db['ChatOfflineMessage'][_0x640f('0x44')]);_0x164b6a['query']=_[_0x640f('0x47')](_0x4fc4e5[_0x640f('0x46')]);_0x164b6a['filters']=_['intersection'](_0x164b6a[_0x640f('0x49')],_0x164b6a[_0x640f('0x46')]);_0x4bad6f['attributes']=_[_0x640f('0x48')](_0x164b6a[_0x640f('0x49')],qs[_0x640f('0x4b')](_0x4fc4e5['query'][_0x640f('0x4b')]));_0x4bad6f[_0x640f('0x4a')]=_0x4bad6f[_0x640f('0x4a')][_0x640f('0x4c')]?_0x4bad6f['attributes']:_0x164b6a[_0x640f('0x49')];if(!_0x4fc4e5[_0x640f('0x46')][_0x640f('0x4d')](_0x640f('0x4e'))){_0x4bad6f[_0x640f('0x31')]=qs[_0x640f('0x31')](_0x4fc4e5[_0x640f('0x46')][_0x640f('0x31')]);_0x4bad6f[_0x640f('0x2f')]=qs['offset'](_0x4fc4e5[_0x640f('0x46')][_0x640f('0x2f')]);}_0x4bad6f[_0x640f('0x71')]=qs[_0x640f('0x4f')](_0x4fc4e5[_0x640f('0x46')][_0x640f('0x4f')]);_0x4bad6f['where']=qs['filters'](_[_0x640f('0x51')](_0x4fc4e5[_0x640f('0x46')],_0x164b6a[_0x640f('0x5d')]));_0x4bad6f[_0x640f('0x50')][_0x640f('0x6a')]=_0x3ab076['id'];if(_0x4fc4e5[_0x640f('0x46')][_0x640f('0x52')]){_0x4bad6f[_0x640f('0x50')]=_[_0x640f('0x53')](_0x4bad6f[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x4bad6f['attributes'],function(_0x2f5ab3){var _0xb0ca28={};_0xb0ca28[_0x2f5ab3]={'$like':'%'+_0x4fc4e5[_0x640f('0x46')][_0x640f('0x52')]+'%'};return _0xb0ca28;})});}_0x4bad6f=_[_0x640f('0x53')]({},_0x4bad6f,_0x4fc4e5['options']);return db[_0x640f('0xdb')][_0x640f('0x32')]({'where':_0x4bad6f['where']})[_0x640f('0x22')](function(_0x5bea7a){_0x61577d['count']=_0x5bea7a;if(_0x4fc4e5['query'][_0x640f('0x57')]){_0x4bad6f[_0x640f('0x58')]=[{'all':!![]}];}else{_0x4bad6f[_0x640f('0x58')]=[{'model':db['CmContact'],'as':_0x640f('0xfb'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x640f('0xdb')][_0x640f('0x59')](_0x4bad6f);})['then'](function(_0x3cfee6){_0x61577d['rows']=_0x3cfee6;return _0x61577d;});}})[_0x640f('0x22')](respondWithFilteredResult(_0x57e586,_0x4bad6f))[_0x640f('0x2b')](handleError(_0x57e586,null));};exports[_0x640f('0x12a')]=function(_0x4c4019,_0x33bf73,_0x2bc449){return db['ChatWebsite'][_0x640f('0x64')]({'where':{'id':_0x4c4019['params']['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x33bf73,null))[_0x640f('0x22')](function(_0x5b0077){if(_0x5b0077){return _0x5b0077['addAgents'](_0x4c4019['body'][_0x640f('0x6f')],_[_0x640f('0x121')](_0x4c4019[_0x640f('0x5f')],[_0x640f('0x6f'),'id'])||{})['spread'](function(_0x3e65cb){for(var _0x4afb5=0x0;_0x4afb5<_0x4c4019[_0x640f('0x5f')][_0x640f('0x6f')][_0x640f('0x4c')];_0x4afb5+=0x1){socket[_0x640f('0x12b')](_0x640f('0x12c'),{'UserId':Number(_0x4c4019[_0x640f('0x5f')][_0x640f('0x6f')][_0x4afb5]),'ChatWebsiteId':Number(_0x4c4019[_0x640f('0x5c')]['id'])});}return _0x3e65cb;});}})['then'](respondWithResult(_0x33bf73,null))['catch'](handleError(_0x33bf73,null));};exports['removeAgents']=function(_0x3773da,_0x498dc8,_0x2b6714){return db[_0x640f('0x43')][_0x640f('0x64')]({'where':{'id':_0x3773da[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x498dc8,null))[_0x640f('0x22')](function(_0x2c07a5){if(_0x2c07a5){return _0x2c07a5[_0x640f('0x12d')](_0x3773da['query'][_0x640f('0x6f')])[_0x640f('0x22')](function(){if(_['isArray'](_0x3773da[_0x640f('0x46')]['ids'])){for(var _0x5c9318=0x0;_0x5c9318<_0x3773da[_0x640f('0x46')][_0x640f('0x6f')][_0x640f('0x4c')];_0x5c9318+=0x1){socket[_0x640f('0x12b')](_0x640f('0x12e'),{'UserId':Number(_0x3773da[_0x640f('0x46')][_0x640f('0x6f')][_0x5c9318]),'ChatWebsiteId':Number(_0x3773da['params']['id'])});}}else{socket['emit'](_0x640f('0x12e'),{'UserId':Number(_0x3773da[_0x640f('0x46')][_0x640f('0x6f')]),'ChatWebsiteId':Number(_0x3773da['params']['id'])});}});}})['then'](respondWithStatusCode(_0x498dc8,null))[_0x640f('0x2b')](handleError(_0x498dc8,null));};exports['getAgents']=function(_0x33c1eb,_0x57269c,_0x3e55c5){var _0x9f7f3d={};var _0x5e6344={};var _0x10a684;var _0x1c7400;return db['ChatWebsite'][_0x640f('0x6d')]({'where':{'id':_0x33c1eb[_0x640f('0x5c')]['id']}})[_0x640f('0x22')](handleEntityNotFound(_0x57269c,null))['then'](function(_0xd2f227){if(_0xd2f227){_0x10a684=_0xd2f227;_0x5e6344[_0x640f('0x49')]=_['keys'](db['User'][_0x640f('0x44')]);_0x5e6344[_0x640f('0x46')]=_[_0x640f('0x47')](_0x33c1eb[_0x640f('0x46')]);_0x5e6344[_0x640f('0x5d')]=_[_0x640f('0x48')](_0x5e6344[_0x640f('0x49')],_0x5e6344[_0x640f('0x46')]);_0x9f7f3d['attributes']=_['intersection'](_0x5e6344['model'],qs[_0x640f('0x4b')](_0x33c1eb[_0x640f('0x46')][_0x640f('0x4b')]));_0x9f7f3d[_0x640f('0x4a')]=_0x9f7f3d[_0x640f('0x4a')][_0x640f('0x4c')]?_0x9f7f3d[_0x640f('0x4a')]:_0x5e6344[_0x640f('0x49')];_0x9f7f3d['order']=qs[_0x640f('0x4f')](_0x33c1eb[_0x640f('0x46')]['sort']);_0x9f7f3d[_0x640f('0x50')]=qs[_0x640f('0x5d')](_[_0x640f('0x51')](_0x33c1eb[_0x640f('0x46')],_0x5e6344[_0x640f('0x5d')]));if(_0x33c1eb[_0x640f('0x46')]['filter']){_0x9f7f3d[_0x640f('0x50')]=_[_0x640f('0x53')](_0x9f7f3d[_0x640f('0x50')],{'$or':_[_0x640f('0x42')](_0x9f7f3d[_0x640f('0x4a')],function(_0x1716be){var _0x3017b1={};_0x3017b1[_0x1716be]={'$like':'%'+_0x33c1eb['query'][_0x640f('0x52')]+'%'};return _0x3017b1;})});}_0x9f7f3d=_[_0x640f('0x53')]({},_0x9f7f3d,_0x33c1eb[_0x640f('0x56')]);return _0x10a684[_0x640f('0x12f')](_0x9f7f3d);}})[_0x640f('0x22')](function(_0x393105){if(_0x393105){_0x1c7400=_0x393105[_0x640f('0x4c')];if(!_0x33c1eb['query']['hasOwnProperty'](_0x640f('0x4e'))){_0x9f7f3d[_0x640f('0x31')]=qs[_0x640f('0x31')](_0x33c1eb[_0x640f('0x46')][_0x640f('0x31')]);_0x9f7f3d[_0x640f('0x2f')]=qs['offset'](_0x33c1eb[_0x640f('0x46')][_0x640f('0x2f')]);}return _0x10a684[_0x640f('0x12f')](_0x9f7f3d);}})[_0x640f('0x22')](function(_0x2cfefb){if(_0x2cfefb){return _0x2cfefb?{'count':_0x1c7400,'rows':_0x2cfefb}:null;}})['then'](respondWithResult(_0x57269c,null))[_0x640f('0x2b')](handleError(_0x57269c,null));};
\ No newline at end of file
+var _0xe334=['omit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','remoteAddress','virtual','replace','alignment','color','textColor','color_button','backgroundColor','addApplications','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','end','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','find','create','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','hasOwnProperty','rows','removeAnswers','addLogo','sitepic','addAvatar','file','filename','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','root','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','List','account','applications','orderBy','Contacts','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','created','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','mimetype','files','attachments','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','server','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids'];(function(_0x43a52c,_0x3620a9){var _0x1bdbc0=function(_0x5a8a2f){while(--_0x5a8a2f){_0x43a52c['push'](_0x43a52c['shift']());}};_0x1bdbc0(++_0x3620a9);}(_0xe334,0x16f));var _0x4e33=function(_0x370ddc,_0x42d5df){_0x370ddc=_0x370ddc-0x0;var _0x2ce587=_0xe334[_0x370ddc];return _0x2ce587;};'use strict';var emlformat=require(_0x4e33('0x0'));var rimraf=require(_0x4e33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e33('0x2'));var rp=require(_0x4e33('0x3'));var moment=require(_0x4e33('0x4'));var BPromise=require(_0x4e33('0x5'));var Mustache=require('mustache');var util=require(_0x4e33('0x6'));var path=require(_0x4e33('0x7'));var sox=require(_0x4e33('0x8'));var csv=require('to-csv');var ejs=require(_0x4e33('0x9'));var fs=require('fs');var fs_extra=require(_0x4e33('0xa'));var _=require(_0x4e33('0xb'));var squel=require(_0x4e33('0xc'));var crypto=require(_0x4e33('0xd'));var jsforce=require(_0x4e33('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4e33('0xf'));var Papa=require(_0x4e33('0x10'));var Redis=require(_0x4e33('0x11'));var authService=require(_0x4e33('0x12'));var qs=require(_0x4e33('0x13'));var as=require(_0x4e33('0x14'));var hardwareService=require(_0x4e33('0x15'));var logger=require(_0x4e33('0x16'))(_0x4e33('0x17'));var utils=require(_0x4e33('0x18'));var config=require(_0x4e33('0x19'));var licenseUtil=require(_0x4e33('0x1a'));var db=require(_0x4e33('0x1b'))['db'];config[_0x4e33('0x1c')]=_[_0x4e33('0x1d')](config[_0x4e33('0x1c')],{'host':_0x4e33('0x1e'),'port':0x18eb});var socket=require(_0x4e33('0x1f'))(new Redis(config[_0x4e33('0x1c')]));require(_0x4e33('0x20'))[_0x4e33('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4e33('0x22')][_0x4e33('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x4e33('0x23')]({'port':0x232a});var client9003=jayson['client'][_0x4e33('0x23')]({'port':0x232b});var client9001=jayson[_0x4e33('0x22')]['http']({'port':0x2329});function respondWithRpcPromise(_0x144238,_0x2000fd,_0x39c9d4,_0x5522b2){return new BPromise(function(_0x5d69af,_0x56224b){var _0x1a3c6a=_0x5522b2||client;return _0x1a3c6a[_0x4e33('0x24')](_0x144238,_0x39c9d4)[_0x4e33('0x25')](function(_0x28f736){logger[_0x4e33('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x2000fd,_0x4e33('0x27'));logger[_0x4e33('0x28')](_0x4e33('0x29'),_0x2000fd,_0x4e33('0x27'),JSON[_0x4e33('0x2a')](_0x28f736));if(_0x28f736[_0x4e33('0x2b')]){if(_0x28f736[_0x4e33('0x2b')]['code']===0x1f4){logger['error'](_0x4e33('0x2c'),_0x2000fd,_0x28f736['error'][_0x4e33('0x2d')]);return _0x56224b(_0x28f736[_0x4e33('0x2b')]['message']);}logger[_0x4e33('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x2000fd,_0x28f736[_0x4e33('0x2b')][_0x4e33('0x2d')]);return _0x5d69af(_0x28f736[_0x4e33('0x2b')][_0x4e33('0x2d')]);}else{logger[_0x4e33('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x2000fd,_0x4e33('0x27'));_0x5d69af(_0x28f736[_0x4e33('0x2e')]['message']);}})['catch'](function(_0x557e50){logger[_0x4e33('0x2b')](_0x4e33('0x2c'),_0x2000fd,_0x557e50);_0x56224b(_0x557e50);});});}function respondWithStatusCode(_0x24ea86,_0x323523){_0x323523=_0x323523||0xcc;return function(_0x16b3b8){if(_0x16b3b8){return _0x24ea86[_0x4e33('0x2f')](_0x323523);}return _0x24ea86[_0x4e33('0x30')](_0x323523)['end']();};}function respondWithResult(_0x2af645,_0x306a5d){_0x306a5d=_0x306a5d||0xc8;return function(_0x5d9417){if(_0x5d9417){return _0x2af645[_0x4e33('0x30')](_0x306a5d)[_0x4e33('0x31')](_0x5d9417);}};}function respondWithFilteredResult(_0x2fb2d6,_0x1576ed){return function(_0x365d1f){if(_0x365d1f){var _0x2891aa=typeof _0x1576ed['offset']==='undefined'&&typeof _0x1576ed['limit']===_0x4e33('0x32');var _0x303a35=_0x365d1f[_0x4e33('0x33')];var _0x1802eb=_0x2891aa?0x0:_0x1576ed[_0x4e33('0x34')];var _0x54d8a1=_0x2891aa?_0x365d1f[_0x4e33('0x33')]:_0x1576ed[_0x4e33('0x34')]+_0x1576ed[_0x4e33('0x35')];var _0x1ae5d3;if(_0x54d8a1>=_0x303a35){_0x54d8a1=_0x303a35;_0x1ae5d3=0xc8;}else{_0x1ae5d3=0xce;}_0x2fb2d6[_0x4e33('0x30')](_0x1ae5d3);return _0x2fb2d6[_0x4e33('0x36')](_0x4e33('0x37'),_0x1802eb+'-'+_0x54d8a1+'/'+_0x303a35)['json'](_0x365d1f);}return null;};}function patchUpdates(_0x24a561){return function(_0x231041){try{jsonpatch[_0x4e33('0x38')](_0x231041,_0x24a561,!![]);}catch(_0x4cdc8b){return BPromise[_0x4e33('0x39')](_0x4cdc8b);}return _0x231041[_0x4e33('0x3a')]();};}function saveUpdates(_0x139bef,_0x39e5b7){return function(_0xc8603){if(_0xc8603){return _0xc8603[_0x4e33('0x3b')](_0x139bef)[_0x4e33('0x25')](function(_0x37e5f0){return _0x37e5f0;});}return null;};}function removeEntity(_0x26242c,_0x285927){return function(_0x3d5c09){if(_0x3d5c09){return _0x3d5c09[_0x4e33('0x3c')]()[_0x4e33('0x25')](function(){var _0x1e4791=_0x3d5c09[_0x4e33('0x3d')]({'plain':!![]});var _0x4ddb95=_0x4e33('0x3e');return db['UserProfileResource'][_0x4e33('0x3c')]({'where':{'type':_0x4ddb95,'resourceId':_0x1e4791['id']}})['then'](function(){return _0x3d5c09;});})[_0x4e33('0x25')](function(){_0x26242c['status'](0xcc)[_0x4e33('0x3f')]();});}};}function handleEntityNotFound(_0x150185,_0x4d2494){return function(_0x3e4d0a){if(!_0x3e4d0a){_0x150185[_0x4e33('0x2f')](0x194);}return _0x3e4d0a;};}function handleError(_0x1e9ec2,_0x4c11f8){_0x4c11f8=_0x4c11f8||0x1f4;return function(_0x2d848f){logger['error'](_0x2d848f[_0x4e33('0x40')]);if(_0x2d848f[_0x4e33('0x41')]){delete _0x2d848f[_0x4e33('0x41')];}_0x1e9ec2[_0x4e33('0x30')](_0x4c11f8)[_0x4e33('0x42')](_0x2d848f);};}exports[_0x4e33('0x43')]=function(_0x1b443c,_0x12e2d9){var _0x3d00fc={'include':[{'model':db[_0x4e33('0x44')],'as':_0x4e33('0x45')}]},_0x1042ee={},_0x5b8497={'count':0x0,'rows':[]};var _0x22c848=_['map'](db[_0x4e33('0x46')][_0x4e33('0x47')],function(_0x96eadc){return{'name':_0x96eadc[_0x4e33('0x48')],'type':_0x96eadc[_0x4e33('0x49')][_0x4e33('0x4a')]};});_0x1042ee[_0x4e33('0x4b')]=_[_0x4e33('0x4c')](_0x22c848,_0x4e33('0x41'));_0x1042ee['query']=_[_0x4e33('0x4d')](_0x1b443c['query']);_0x1042ee[_0x4e33('0x4e')]=_[_0x4e33('0x4f')](_0x1042ee[_0x4e33('0x4b')],_0x1042ee[_0x4e33('0x50')]);_0x3d00fc[_0x4e33('0x51')]=_[_0x4e33('0x4f')](_0x1042ee[_0x4e33('0x4b')],qs[_0x4e33('0x52')](_0x1b443c[_0x4e33('0x50')][_0x4e33('0x52')]));_0x3d00fc[_0x4e33('0x51')]=_0x3d00fc[_0x4e33('0x51')][_0x4e33('0x53')]?_0x3d00fc[_0x4e33('0x51')]:_0x1042ee[_0x4e33('0x4b')];if(!_0x1b443c['query']['hasOwnProperty'](_0x4e33('0x54'))){_0x3d00fc[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x1b443c['query'][_0x4e33('0x35')]);_0x3d00fc[_0x4e33('0x34')]=qs['offset'](_0x1b443c[_0x4e33('0x50')][_0x4e33('0x34')]);}_0x3d00fc[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x1b443c['query'][_0x4e33('0x56')]);_0x3d00fc[_0x4e33('0x57')]=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x1b443c['query'],_0x1042ee[_0x4e33('0x4e')]),_0x22c848);if(_0x1b443c[_0x4e33('0x50')]['filter']){_0x3d00fc['where']=_[_0x4e33('0x59')](_0x3d00fc[_0x4e33('0x57')],{'$or':_['map'](_0x22c848,function(_0x12cb2a){if(_0x12cb2a[_0x4e33('0x49')]!==_0x4e33('0x5a')){var _0x19f699={};_0x19f699[_0x12cb2a['name']]={'$like':'%'+_0x1b443c[_0x4e33('0x50')][_0x4e33('0x5b')]+'%'};return _0x19f699;}})});}_0x3d00fc=_[_0x4e33('0x59')]({},_0x3d00fc,_0x1b443c[_0x4e33('0x5c')]);var _0x46509e={'where':_0x3d00fc[_0x4e33('0x57')]};return db[_0x4e33('0x46')][_0x4e33('0x33')](_0x46509e)['then'](function(_0x54a67b){_0x5b8497[_0x4e33('0x33')]=_0x54a67b;if(_0x1b443c[_0x4e33('0x50')][_0x4e33('0x5d')]){_0x3d00fc[_0x4e33('0x5e')]=[{'all':!![]}];}return db[_0x4e33('0x46')]['findAll'](_0x3d00fc);})[_0x4e33('0x25')](function(_0x2e797d){_0x5b8497['rows']=_0x2e797d;return _0x5b8497;})[_0x4e33('0x25')](respondWithFilteredResult(_0x12e2d9,_0x3d00fc))[_0x4e33('0x5f')](handleError(_0x12e2d9,null));};exports[_0x4e33('0x60')]=function(_0x146bcc,_0x3c20b2){var _0x5727e0={'raw':![],'where':{'id':_0x146bcc[_0x4e33('0x61')]['id']},'include':[{'model':db[_0x4e33('0x44')],'as':_0x4e33('0x45')}]},_0x461456={};_0x461456['model']=_[_0x4e33('0x4d')](db['ChatWebsite']['rawAttributes']);_0x461456[_0x4e33('0x50')]=_['keys'](_0x146bcc['query']);_0x461456['filters']=_[_0x4e33('0x4f')](_0x461456['model'],_0x461456[_0x4e33('0x50')]);_0x5727e0[_0x4e33('0x51')]=_[_0x4e33('0x4f')](_0x461456[_0x4e33('0x4b')],qs[_0x4e33('0x52')](_0x146bcc[_0x4e33('0x50')][_0x4e33('0x52')]));_0x5727e0[_0x4e33('0x51')]=_0x5727e0[_0x4e33('0x51')]['length']?_0x5727e0[_0x4e33('0x51')]:_0x461456[_0x4e33('0x4b')];if(_0x146bcc['query'][_0x4e33('0x5d')]){_0x5727e0[_0x4e33('0x5e')]=[{'all':!![]}];}_0x5727e0=_[_0x4e33('0x59')]({},_0x5727e0,_0x146bcc[_0x4e33('0x5c')]);return db[_0x4e33('0x46')][_0x4e33('0x62')](_0x5727e0)[_0x4e33('0x25')](handleEntityNotFound(_0x3c20b2,null))[_0x4e33('0x25')](respondWithResult(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));};exports[_0x4e33('0x63')]=function(_0x3258ed,_0xa78a18){return db['ChatWebsite'][_0x4e33('0x63')](_0x3258ed['body'],{})[_0x4e33('0x25')](function(_0x4b25f3){var _0x3c896a=_0x3258ed['user']['get']({'plain':!![]});if(!_0x3c896a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c896a[_0x4e33('0x64')]===_0x4e33('0x65')){var _0x2b1b6f=_0x4b25f3[_0x4e33('0x3d')]({'plain':!![]});var _0x541e53=_0x4e33('0x3e');return db['UserProfileSection'][_0x4e33('0x62')]({'where':{'name':_0x541e53,'userProfileId':_0x3c896a[_0x4e33('0x66')]},'raw':!![]})[_0x4e33('0x25')](function(_0x37aedc){if(_0x37aedc&&_0x37aedc[_0x4e33('0x67')]===0x0){return db['UserProfileResource']['create']({'name':_0x2b1b6f[_0x4e33('0x41')],'resourceId':_0x2b1b6f['id'],'type':_0x37aedc[_0x4e33('0x41')],'sectionId':_0x37aedc['id']},{})[_0x4e33('0x25')](function(){return _0x4b25f3;});}else{return _0x4b25f3;}})[_0x4e33('0x5f')](function(_0x4ba5a6){logger['error'](_0x4e33('0x68'),_0x4ba5a6);throw _0x4ba5a6;});}return _0x4b25f3;})[_0x4e33('0x25')](respondWithResult(_0xa78a18,0xc9))[_0x4e33('0x5f')](handleError(_0xa78a18,null));};exports[_0x4e33('0x3b')]=function(_0x26b231,_0x4c007b){if(_0x26b231[_0x4e33('0x69')]['id']){delete _0x26b231[_0x4e33('0x69')]['id'];}return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x26b231[_0x4e33('0x61')]['id']},'include':[{'model':db[_0x4e33('0x44')],'as':_0x4e33('0x45')}]})[_0x4e33('0x25')](handleEntityNotFound(_0x4c007b,null))[_0x4e33('0x25')](saveUpdates(_0x26b231[_0x4e33('0x69')],null))['then'](respondWithResult(_0x4c007b,null))[_0x4e33('0x5f')](handleError(_0x4c007b,null));};exports[_0x4e33('0x3c')]=function(_0xda6f3c,_0x38ef62){return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0xda6f3c[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x38ef62,null))['then'](removeEntity(_0x38ef62,null))[_0x4e33('0x5f')](handleError(_0x38ef62,null));};exports[_0x4e33('0x6a')]=function(_0x206c7a,_0x5c8d87){return db[_0x4e33('0x46')][_0x4e33('0x6a')]()[_0x4e33('0x25')](respondWithResult(_0x5c8d87,null))['catch'](handleError(_0x5c8d87,null));};exports[_0x4e33('0x6b')]=function(_0x2391c3,_0x5a69ac,_0x40fcbc){if(_0x2391c3['body']['id']){delete _0x2391c3['body']['id'];}return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x2391c3['params']['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x5a69ac,null))[_0x4e33('0x25')](function(_0x37c700){if(_0x37c700){_0x2391c3[_0x4e33('0x69')][_0x4e33('0x6c')]=_0x37c700['id'];return db[_0x4e33('0x6d')]['create'](_0x2391c3[_0x4e33('0x69')]);}})['then'](respondWithResult(_0x5a69ac,null))[_0x4e33('0x5f')](handleError(_0x5a69ac,null));};exports[_0x4e33('0x6e')]=function(_0x47be86,_0x3aed25,_0x28040e){var _0x2287fd={'raw':![],'where':{}};var _0x1f133e={};var _0x25fe50={'count':0x0,'rows':[]};return db[_0x4e33('0x46')][_0x4e33('0x6f')]({'where':{'id':_0x47be86[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x3aed25,null))[_0x4e33('0x25')](function(_0x5153ce){if(_0x5153ce){_0x1f133e[_0x4e33('0x4b')]=_[_0x4e33('0x4d')](db[_0x4e33('0x6d')][_0x4e33('0x47')]);_0x1f133e['query']=_[_0x4e33('0x4d')](_0x47be86['query']);_0x1f133e[_0x4e33('0x4e')]=_['intersection'](_0x1f133e[_0x4e33('0x4b')],_0x1f133e[_0x4e33('0x50')]);_0x2287fd[_0x4e33('0x51')]=_['intersection'](_0x1f133e[_0x4e33('0x4b')],qs['fields'](_0x47be86[_0x4e33('0x50')]['fields']));_0x2287fd[_0x4e33('0x51')]=_0x2287fd[_0x4e33('0x51')][_0x4e33('0x53')]?_0x2287fd[_0x4e33('0x51')]:_0x1f133e[_0x4e33('0x4b')];if(!_0x47be86[_0x4e33('0x50')]['hasOwnProperty'](_0x4e33('0x54'))){_0x2287fd[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x47be86['query']['limit']);_0x2287fd[_0x4e33('0x34')]=qs['offset'](_0x47be86[_0x4e33('0x50')][_0x4e33('0x34')]);}_0x2287fd[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x47be86[_0x4e33('0x50')][_0x4e33('0x56')]);_0x2287fd['where']=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x47be86['query'],_0x1f133e[_0x4e33('0x4e')]));_0x2287fd[_0x4e33('0x57')]['ChatWebsiteId']=_0x5153ce['id'];if(_0x47be86[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x2287fd[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x2287fd[_0x4e33('0x57')],{'$or':_[_0x4e33('0x4c')](_0x2287fd[_0x4e33('0x51')],function(_0x3a9bc4){var _0x352198={};_0x352198[_0x3a9bc4]={'$like':'%'+_0x47be86[_0x4e33('0x50')][_0x4e33('0x5b')]+'%'};return _0x352198;})});}_0x2287fd=_[_0x4e33('0x59')]({},_0x2287fd,_0x47be86[_0x4e33('0x5c')]);return db['Disposition']['count']({'where':_0x2287fd[_0x4e33('0x57')]})[_0x4e33('0x25')](function(_0x5298a3){_0x25fe50[_0x4e33('0x33')]=_0x5298a3;if(_0x47be86[_0x4e33('0x50')][_0x4e33('0x5d')]){_0x2287fd[_0x4e33('0x5e')]=[{'all':!![]}];}return db[_0x4e33('0x6d')][_0x4e33('0x70')](_0x2287fd);})[_0x4e33('0x25')](function(_0x3007b0){_0x25fe50['rows']=_0x3007b0;return _0x25fe50;});}})[_0x4e33('0x25')](respondWithFilteredResult(_0x3aed25,_0x2287fd))['catch'](handleError(_0x3aed25,null));};exports[_0x4e33('0x71')]=function(_0x4a4b80,_0x5b3574,_0x449dba){return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x4a4b80[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x5b3574,null))[_0x4e33('0x25')](function(_0x3c2a29){if(_0x3c2a29){return _0x3c2a29['removeDispositions'](_0x4a4b80[_0x4e33('0x50')]['ids']);}})[_0x4e33('0x25')](respondWithStatusCode(_0x5b3574,null))[_0x4e33('0x5f')](handleError(_0x5b3574,null));};exports[_0x4e33('0x72')]=function(_0x390885,_0x446eca,_0x2625c6){if(_0x390885['body']['id']){delete _0x390885[_0x4e33('0x69')]['id'];}return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x390885[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x446eca,null))[_0x4e33('0x25')](function(_0x2d61ad){if(_0x2d61ad){_0x390885[_0x4e33('0x69')][_0x4e33('0x6c')]=_0x2d61ad['id'];return db[_0x4e33('0x73')][_0x4e33('0x63')](_0x390885['body']);}})['then'](respondWithResult(_0x446eca,null))[_0x4e33('0x5f')](handleError(_0x446eca,null));};exports['getAnswers']=function(_0x42966d,_0x2c7712,_0x471f0d){var _0x2e5226={'raw':![],'where':{}};var _0x586ea9={};var _0x568a73={'count':0x0,'rows':[]};return db[_0x4e33('0x46')][_0x4e33('0x6f')]({'where':{'id':_0x42966d[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x2c7712,null))[_0x4e33('0x25')](function(_0x11aef7){if(_0x11aef7){_0x586ea9[_0x4e33('0x4b')]=_[_0x4e33('0x4d')](db[_0x4e33('0x73')][_0x4e33('0x47')]);_0x586ea9['query']=_[_0x4e33('0x4d')](_0x42966d[_0x4e33('0x50')]);_0x586ea9['filters']=_[_0x4e33('0x4f')](_0x586ea9['model'],_0x586ea9[_0x4e33('0x50')]);_0x2e5226['attributes']=_['intersection'](_0x586ea9['model'],qs[_0x4e33('0x52')](_0x42966d[_0x4e33('0x50')][_0x4e33('0x52')]));_0x2e5226[_0x4e33('0x51')]=_0x2e5226[_0x4e33('0x51')]['length']?_0x2e5226[_0x4e33('0x51')]:_0x586ea9[_0x4e33('0x4b')];if(!_0x42966d[_0x4e33('0x50')][_0x4e33('0x74')](_0x4e33('0x54'))){_0x2e5226[_0x4e33('0x35')]=qs['limit'](_0x42966d[_0x4e33('0x50')][_0x4e33('0x35')]);_0x2e5226['offset']=qs['offset'](_0x42966d[_0x4e33('0x50')][_0x4e33('0x34')]);}_0x2e5226[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x42966d[_0x4e33('0x50')][_0x4e33('0x56')]);_0x2e5226[_0x4e33('0x57')]=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x42966d[_0x4e33('0x50')],_0x586ea9[_0x4e33('0x4e')]));_0x2e5226['where'][_0x4e33('0x6c')]=_0x11aef7['id'];if(_0x42966d[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x2e5226[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x2e5226[_0x4e33('0x57')],{'$or':_[_0x4e33('0x4c')](_0x2e5226[_0x4e33('0x51')],function(_0x3f460c){var _0x26a4e6={};_0x26a4e6[_0x3f460c]={'$like':'%'+_0x42966d[_0x4e33('0x50')][_0x4e33('0x5b')]+'%'};return _0x26a4e6;})});}_0x2e5226=_[_0x4e33('0x59')]({},_0x2e5226,_0x42966d[_0x4e33('0x5c')]);return db['CannedAnswer'][_0x4e33('0x33')]({'where':_0x2e5226[_0x4e33('0x57')]})[_0x4e33('0x25')](function(_0x202d9d){_0x568a73[_0x4e33('0x33')]=_0x202d9d;if(_0x42966d[_0x4e33('0x50')][_0x4e33('0x5d')]){_0x2e5226['include']=[{'all':!![]}];}return db[_0x4e33('0x73')][_0x4e33('0x70')](_0x2e5226);})[_0x4e33('0x25')](function(_0x5a092b){_0x568a73[_0x4e33('0x75')]=_0x5a092b;return _0x568a73;});}})[_0x4e33('0x25')](respondWithFilteredResult(_0x2c7712,_0x2e5226))[_0x4e33('0x5f')](handleError(_0x2c7712,null));};exports[_0x4e33('0x76')]=function(_0x2d8ced,_0x3d1c74,_0x2808a4){return db['ChatWebsite'][_0x4e33('0x62')]({'where':{'id':_0x2d8ced[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x3d1c74,null))[_0x4e33('0x25')](function(_0x3274c4){if(_0x3274c4){return _0x3274c4[_0x4e33('0x76')](_0x2d8ced[_0x4e33('0x50')]['ids']);}})[_0x4e33('0x25')](respondWithStatusCode(_0x3d1c74,null))[_0x4e33('0x5f')](handleError(_0x3d1c74,null));};exports[_0x4e33('0x77')]=function(_0x509a3f,_0x291864,_0x56fa18){_0x509a3f[_0x4e33('0x69')][_0x4e33('0x78')]=_0x509a3f['file']['filename'];return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x509a3f['params']['id']}})['then'](handleEntityNotFound(_0x291864,null))[_0x4e33('0x25')](saveUpdates(_0x509a3f['body'],null))[_0x4e33('0x25')](respondWithResult(_0x291864,null))[_0x4e33('0x5f')](handleError(_0x291864,null));};exports[_0x4e33('0x79')]=function(_0xf10cbb,_0x28c319,_0x138821){_0xf10cbb['body']['agentAvatar']=_0xf10cbb[_0x4e33('0x7a')]['filename'];return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0xf10cbb[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x28c319,null))[_0x4e33('0x25')](saveUpdates(_0xf10cbb[_0x4e33('0x69')],null))[_0x4e33('0x25')](respondWithResult(_0x28c319,null))[_0x4e33('0x5f')](handleError(_0x28c319,null));};exports['addCustomerAvatar']=function(_0x529342,_0x404554,_0x2940df){_0x529342[_0x4e33('0x69')]['customerAvatar']=_0x529342[_0x4e33('0x7a')][_0x4e33('0x7b')];return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x529342[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x404554,null))[_0x4e33('0x25')](saveUpdates(_0x529342[_0x4e33('0x69')],null))['then'](respondWithResult(_0x404554,null))[_0x4e33('0x5f')](handleError(_0x404554,null));};exports[_0x4e33('0x7c')]=function(_0x33f946,_0x201b88,_0x132bb0){_0x33f946[_0x4e33('0x69')]['systemAvatar']=_0x33f946[_0x4e33('0x7a')][_0x4e33('0x7b')];return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x33f946[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x201b88,null))[_0x4e33('0x25')](saveUpdates(_0x33f946[_0x4e33('0x69')],null))[_0x4e33('0x25')](respondWithResult(_0x201b88,null))[_0x4e33('0x5f')](handleError(_0x201b88,null));};exports[_0x4e33('0x7d')]=function(_0x1f3c32,_0x3ec698,_0x41bd90){var _0x3f16c5=path[_0x4e33('0x7e')](config['root'],_0x4e33('0x7f'));var _0x7e83c5={'where':{'id':_0x1f3c32[_0x4e33('0x61')]['id']},'attributes':['id',_0x4e33('0x78')],'raw':!![]};var _0x521dcd=![];return require(_0x4e33('0x1a'))[_0x4e33('0x80')]()['then'](function(_0x2c2652){if(_0x2c2652){_0x521dcd=_0x2c2652['custom'];}})[_0x4e33('0x25')](function(){return db[_0x4e33('0x46')][_0x4e33('0x62')](_0x7e83c5);})[_0x4e33('0x25')](handleEntityNotFound(_0x3ec698,null))[_0x4e33('0x25')](function(_0x3f0751){if(_0x3f0751){if(!_[_0x4e33('0x81')](_0x3f0751[_0x4e33('0x78')])){if(fs[_0x4e33('0x82')](path[_0x4e33('0x7e')](config[_0x4e33('0x83')],_0x4e33('0x84'),_0x3f0751[_0x4e33('0x78')]))&&_0x521dcd){_0x3f16c5=path[_0x4e33('0x7e')](config['root'],_0x4e33('0x84'),_0x3f0751['sitepic']);}}return _0x3ec698['download'](_0x3f16c5);}})['catch'](handleError(_0x3ec698,null));};exports[_0x4e33('0x85')]=function(_0x3dd9b9,_0x4cf110,_0x1fb1d9){var _0x276d6d=path[_0x4e33('0x7e')](config[_0x4e33('0x83')],'server/files/images/avatars/default_avatar.png');var _0x4662d3={'where':{'id':_0x3dd9b9[_0x4e33('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x4e33('0x62')](_0x4662d3)[_0x4e33('0x25')](handleEntityNotFound(_0x4cf110,null))[_0x4e33('0x25')](function(_0x2d3359){if(_0x2d3359){if(!_[_0x4e33('0x81')](_0x2d3359[_0x4e33('0x86')])){if(fs[_0x4e33('0x82')](path['join'](config[_0x4e33('0x83')],_0x4e33('0x87'),_0x2d3359[_0x4e33('0x86')]))){_0x276d6d=path[_0x4e33('0x7e')](config['root'],'server/files/images/avatars/',_0x2d3359[_0x4e33('0x86')]);}}return _0x4cf110[_0x4e33('0x88')](_0x276d6d);}})[_0x4e33('0x5f')](handleError(_0x4cf110,null));};exports[_0x4e33('0x89')]=function(_0x5c0124,_0x5a410d,_0x205b99){var _0x552505=path[_0x4e33('0x7e')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x44cb6f={'where':{'id':_0x5c0124[_0x4e33('0x61')]['id']},'attributes':['id',_0x4e33('0x8a'),_0x4e33('0x8b')],'raw':!![]};return db[_0x4e33('0x46')][_0x4e33('0x62')](_0x44cb6f)['then'](handleEntityNotFound(_0x5a410d,null))[_0x4e33('0x25')](function(_0x4e8b9c){if(_0x4e8b9c){if(!_['isNil'](_0x4e8b9c[_0x4e33('0x8a')])){if(fs[_0x4e33('0x82')](path[_0x4e33('0x7e')](config[_0x4e33('0x83')],'server/files/images/avatars/',_0x4e8b9c[_0x4e33('0x8a')]))&&_0x4e8b9c[_0x4e33('0x8b')]){_0x552505=path['join'](config['root'],_0x4e33('0x87'),_0x4e8b9c[_0x4e33('0x8a')]);}}return _0x5a410d[_0x4e33('0x88')](_0x552505);}})['catch'](handleError(_0x5a410d,null));};exports['getSystemAvatar']=function(_0x2ca6de,_0x2e7155,_0x225aaf){var _0x41df91=path[_0x4e33('0x7e')](config['root'],_0x4e33('0x8c'));var _0x58cb86={'where':{'id':_0x2ca6de[_0x4e33('0x61')]['id']},'attributes':['id',_0x4e33('0x8d')],'raw':!![]};return db[_0x4e33('0x46')][_0x4e33('0x62')](_0x58cb86)[_0x4e33('0x25')](handleEntityNotFound(_0x2e7155,null))['then'](function(_0x1cd88a){if(_0x1cd88a){if(!_[_0x4e33('0x81')](_0x1cd88a[_0x4e33('0x8d')])){if(fs['existsSync'](path[_0x4e33('0x7e')](config['root'],_0x4e33('0x87'),_0x1cd88a[_0x4e33('0x8d')]))){_0x41df91=path['join'](config[_0x4e33('0x83')],_0x4e33('0x87'),_0x1cd88a[_0x4e33('0x8d')]);}}return _0x2e7155[_0x4e33('0x88')](_0x41df91);}})[_0x4e33('0x5f')](handleError(_0x2e7155,null));};exports[_0x4e33('0x8e')]=function(_0x17af89,_0x31008d,_0x43d3da){var _0x1a9540=require('user-agent-parser');var _0x3df358=new _0x1a9540();var _0x56ecda=_0x3df358[_0x4e33('0x8f')](_0x17af89[_0x4e33('0x90')][_0x4e33('0x91')])['getResult']();var _0x52d8f0={'body':_0x17af89['body'],'channel':_0x4e33('0x92')};var _0x5a28d5=[];var _0x4aaacd=[];var _0x5a39f7={};var _0x104162=![];return db[_0x4e33('0x93')][_0x4e33('0x6a')]()['then'](function(_0x2a2d69){if(!_0x2a2d69){throw new db[(_0x4e33('0x94'))][(_0x4e33('0x95'))](_0x4e33('0x96'));}_0x5a28d5=_[_0x4e33('0x97')](_[_0x4e33('0x4d')](_0x2a2d69),[_0x4e33('0x98'),'updatedAt']);_0x4aaacd=_[_0x4e33('0x97')](_[_0x4e33('0x4d')](_0x2a2d69),[_0x4e33('0x98'),'updatedAt',_0x4e33('0x99'),_0x4e33('0x9a')]);if(_0x17af89[_0x4e33('0x69')]['id']){delete _0x17af89['body']['id'];}if(_[_0x4e33('0x81')](_0x17af89[_0x4e33('0x69')][_0x4e33('0x9b')])){throw new db[(_0x4e33('0x94'))][(_0x4e33('0x95'))]('from\x20is\x20mandatory');}if(_[_0x4e33('0x81')](_0x17af89[_0x4e33('0x69')][_0x4e33('0x69')])||_0x17af89[_0x4e33('0x69')][_0x4e33('0x69')]===''){throw new db['Sequelize'][(_0x4e33('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4e33('0x81')](_0x17af89[_0x4e33('0x69')]['mapKey'])){throw new db[(_0x4e33('0x94'))]['ValidationError'](_0x4e33('0x9c')+_0x4aaacd);}if(!_[_0x4e33('0x9d')](_0x4aaacd,_0x17af89['body'][_0x4e33('0x9e')])){throw new db[(_0x4e33('0x94'))]['ValidationError'](_0x4e33('0x9f')+_0x4aaacd);}_0x5a39f7[_0x17af89[_0x4e33('0x69')][_0x4e33('0x9e')]]=_0x17af89[_0x4e33('0x69')]['from'];})[_0x4e33('0x25')](function(){return db[_0x4e33('0x46')]['find']({'where':{'id':_0x17af89[_0x4e33('0x61')]['id']},'include':[{'model':db[_0x4e33('0xa0')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5a39f7,'limit':0x1,'order':[['updatedAt',_0x4e33('0xa1')]]}]},{'model':db[_0x4e33('0xa2')],'as':_0x4e33('0xa3')}]});})[_0x4e33('0x25')](handleEntityNotFound(_0x31008d,null))['then'](function(_0x442c91){if(_0x442c91&&_0x442c91[_0x4e33('0xa4')]){_0x52d8f0[_0x4e33('0xa5')]=_0x442c91;_0x52d8f0[_0x4e33('0xa6')]=_0x442c91[_0x4e33('0xa3')];_0x52d8f0['list']=_0x442c91[_0x4e33('0xa4')];_0x52d8f0[_0x4e33('0xa6')]=_[_0x4e33('0xa7')](_0x52d8f0[_0x4e33('0xa6')],['priority'],['asc']);if(_0x52d8f0[_0x4e33('0xa5')]['Applications']){delete _0x52d8f0[_0x4e33('0xa5')][_0x4e33('0xa3')];}if(_0x52d8f0['account'][_0x4e33('0xa4')]&&_0x52d8f0[_0x4e33('0xa5')][_0x4e33('0xa4')][_0x4e33('0xa8')]['length']){return _0x52d8f0[_0x4e33('0xa5')][_0x4e33('0xa4')][_0x4e33('0xa8')][0x0];}var _0x10dc4f=_[_0x4e33('0x1d')](_0x17af89['body'],{'firstName':_0x17af89[_0x4e33('0x69')][_0x4e33('0x9b')],'ListId':_0x442c91[_0x4e33('0x9a')]});_0x10dc4f[_0x17af89['body'][_0x4e33('0x9e')]]=_0x17af89[_0x4e33('0x69')][_0x4e33('0x9b')];return db[_0x4e33('0x93')]['create'](_0x10dc4f,{'fields':_0x5a28d5,'raw':!![]});}})[_0x4e33('0x25')](handleEntityNotFound(_0x31008d,null))['then'](function(_0x16e0f5){_0x52d8f0['contact']=_0x16e0f5;var _0x30ed83=_0x17af89[_0x4e33('0x69')][_0x4e33('0xa9')];if(_0x17af89[_0x4e33('0x90')][_0x4e33('0xaa')]){_0x30ed83=_0x17af89['headers']['cf-connecting-ip'];}else if(_0x17af89['headers'][_0x4e33('0xab')]){_0x30ed83=_[_0x4e33('0xac')](_0x17af89[_0x4e33('0x90')][_0x4e33('0xab')][_0x4e33('0xad')](','));}if(_0x16e0f5){var _0x4d94bc={'ContactId':_0x16e0f5['id'],'ChatWebsiteId':_0x17af89[_0x4e33('0x61')]['id'],'from':(_0x16e0f5[_0x4e33('0xae')]||'')+'\x20'+(_0x16e0f5[_0x4e33('0xaf')]||''),'customerIp':_0x30ed83,'customerPort':_0x17af89[_0x4e33('0x90')][_0x4e33('0xb0')]?_0x17af89['headers'][_0x4e33('0xb0')]:null,'referer':_0x17af89[_0x4e33('0x69')][_0x4e33('0xb1')],'browserName':_0x56ecda[_0x4e33('0xb2')]['name']&&_0x56ecda[_0x4e33('0xb2')]['version']?util['format'](_0x4e33('0xb3'),_0x56ecda[_0x4e33('0xb2')][_0x4e33('0x41')],_0x56ecda[_0x4e33('0xb2')][_0x4e33('0xb4')]):_0x4e33('0xb5'),'browserVersion':_0x56ecda[_0x4e33('0xb2')]['version']||'unknown','osName':util[_0x4e33('0xb6')](_0x4e33('0xb3'),_0x56ecda['os'][_0x4e33('0x41')],_0x56ecda['os']['version']),'osVersion':_0x56ecda['os'][_0x4e33('0xb4')],'deviceModel':_0x56ecda[_0x4e33('0xb7')][_0x4e33('0x4b')]&&_0x56ecda[_0x4e33('0xb7')][_0x4e33('0xb8')]?util[_0x4e33('0xb6')]('%s\x20%s\x20%s',_0x56ecda['device'][_0x4e33('0x4b')],_0x56ecda['device'][_0x4e33('0xb8')],_0x56ecda[_0x4e33('0xb7')][_0x4e33('0x49')]):null,'deviceVendor':_0x56ecda[_0x4e33('0xb7')][_0x4e33('0xb8')],'deviceType':_0x56ecda[_0x4e33('0xb7')]['type'],'formData':JSON[_0x4e33('0x2a')](_0x17af89[_0x4e33('0x69')])};var _0x5d9676={'ChatWebsiteId':_0x17af89[_0x4e33('0x61')]['id'],'closed':![]};if(_0x17af89[_0x4e33('0x69')]['threadId']){_0x5d9676['threadId']=_0x17af89[_0x4e33('0x69')][_0x4e33('0xb9')];return db['ChatInteraction']['find']({'where':_0x5d9676})[_0x4e33('0x25')](function(_0xf90c27){if(_0xf90c27){return[_0xf90c27,![]];}_0x4d94bc[_0x4e33('0xb9')]=_0x17af89['body'][_0x4e33('0xb9')];_0x4d94bc[_0x4e33('0xba')]=_0x17af89[_0x4e33('0x69')][_0x4e33('0xba')];return db[_0x4e33('0xbb')]['create'](_0x4d94bc)[_0x4e33('0x25')](function(_0x32a12c){return[_0x32a12c,!![]];});});}_0x5d9676[_0x4e33('0xbc')]=_0x16e0f5['id'];if(_0x17af89[_0x4e33('0x69')][_0x4e33('0xbd')]&&_0x17af89['body'][_0x4e33('0xbd')]['id']){_0x5d9676['id']=_0x17af89[_0x4e33('0x69')]['interaction']['id'];return db[_0x4e33('0xbb')][_0x4e33('0x62')]({'where':_0x5d9676})[_0x4e33('0x25')](function(_0xdb5e35){if(_0xdb5e35){return[_0xdb5e35,![]];}return db[_0x4e33('0xbb')][_0x4e33('0x63')](_0x4d94bc)[_0x4e33('0x25')](function(_0x15d045){return[_0x15d045,!![]];});});}return db['ChatInteraction'][_0x4e33('0x63')](_0x4d94bc)[_0x4e33('0x25')](function(_0x1e7071){return[_0x1e7071,!![]];});}})[_0x4e33('0xbe')](function(_0x251c6a,_0x23f613){if(_0x251c6a){_0x104162=_0x23f613;if(!_0x23f613){var _0x48263b={'from':(_0x52d8f0[_0x4e33('0xbf')]['firstName']||'')+'\x20'+(_0x52d8f0['contact'][_0x4e33('0xaf')]||'')};if(_0x17af89[_0x4e33('0x69')][_0x4e33('0xb9')]&&_0x17af89[_0x4e33('0x69')]['messageId']&&_0x17af89[_0x4e33('0x69')][_0x4e33('0xb9')]!=_0x17af89[_0x4e33('0x69')][_0x4e33('0xc0')]){_0x48263b[_0x4e33('0xb9')]=_0x17af89['body'][_0x4e33('0xc0')];}return _0x251c6a[_0x4e33('0x3b')](_0x48263b);}else{return _0x251c6a;}}})[_0x4e33('0x25')](function(_0x446476){_0x52d8f0['interaction']=_0x446476[_0x4e33('0x3d')]({'plain':!![]});_0x52d8f0['interaction'][_0x4e33('0xc1')]=_0x104162;if(_0x52d8f0[_0x4e33('0xbd')]['created']){if(_0x52d8f0[_0x4e33('0xa5')]['autoclose']){_0x52d8f0[_0x4e33('0xa6')][_0x4e33('0xc2')]({'id':0x0,'priority':_0x52d8f0[_0x4e33('0xa6')][_0x4e33('0x53')]+0x1,'app':_0x4e33('0xc3'),'appdata':_0x4e33('0xc4'),'interval':_0x4e33('0xc5')});}}return db['ChatMessage']['create']({'body':_0x17af89[_0x4e33('0x69')][_0x4e33('0x69')],'ChatWebsiteId':_0x17af89[_0x4e33('0x61')]['id'],'ChatInteractionId':_0x446476['id'],'direction':'in','ContactId':_0x52d8f0[_0x4e33('0xbf')]['id'],'AttachmentId':_0x17af89[_0x4e33('0x69')]['AttachmentId']});})[_0x4e33('0x25')](function(_0x3a20de){_0x52d8f0[_0x4e33('0x2d')]=_0x3a20de;if(_0x52d8f0[_0x4e33('0xbd')][_0x4e33('0xc6')]){return db[_0x4e33('0xc7')][_0x4e33('0x62')]({'attributes':['id',_0x4e33('0x41')],'where':{'id':_0x52d8f0[_0x4e33('0xbd')][_0x4e33('0xc6')]}})[_0x4e33('0x25')](function(_0x478250){if(_0x478250){_0x52d8f0['applications'][_0x4e33('0xc8')]({'id':0x0,'priority':0x0,'app':_0x4e33('0xc9'),'appdata':_0x478250[_0x4e33('0x41')]+','+(_0x52d8f0[_0x4e33('0xa5')][_0x4e33('0xca')]||0xa),'interval':_0x4e33('0xc5')});_0x52d8f0[_0x4e33('0xcb')]=!![];}return respondWithRpcPromise(_0x4e33('0xcc'),'startRouting',_0x52d8f0);});}return respondWithRpcPromise(_0x4e33('0xcc'),_0x4e33('0xcd'),_0x52d8f0);})['then'](function(_0x18ee39){respondWithRpcPromise(_0x4e33('0xce'),_0x4e33('0xce'),{'event':_0x4e33('0x8e'),'message':_0x18ee39},client9002);return _0x18ee39;})['then'](respondWithResult(_0x31008d,null))[_0x4e33('0x5f')](handleError(_0x31008d,null));};exports[_0x4e33('0xcf')]=function(_0x489a5b,_0x5e70d6,_0x5b256a){var _0x36ff7f,_0x5d15b3,_0xecb1ec;var _0x4be756=[];var _0x5e6589=[];var _0x593cf8={};var _0x2dbb7b=_0x489a5b['files']||[];var _0x50e38f=[];var _0x5d4bdd;return db['CmContact'][_0x4e33('0x6a')]()[_0x4e33('0x25')](function(_0x18cc15){if(!_0x18cc15){throw new db['Sequelize'][(_0x4e33('0x95'))]('no\x20available\x20attributes');}_0x5e6589=_[_0x4e33('0x97')](_['keys'](_0x18cc15),['createdAt',_0x4e33('0xd0')]);_0x4be756=_[_0x4e33('0x97')](_[_0x4e33('0x4d')](_0x18cc15),[_0x4e33('0x98'),_0x4e33('0xd0'),_0x4e33('0x99'),_0x4e33('0x9a')]);if(_0x489a5b[_0x4e33('0x69')]['id']){delete _0x489a5b[_0x4e33('0x69')]['id'];}if(_[_0x4e33('0x81')](_0x489a5b[_0x4e33('0x69')]['from'])){throw _0x5e70d6['status'](0x1f4)['send'](new db[(_0x4e33('0x94'))]['ValidationError'](_0x4e33('0xd1')));}if(_[_0x4e33('0x81')](_0x489a5b['body'][_0x4e33('0x69')])||_0x489a5b['body'][_0x4e33('0x69')]===''){throw _0x5e70d6[_0x4e33('0x30')](0x1f4)[_0x4e33('0x42')](new db['Sequelize']['ValidationError'](_0x4e33('0xd2')));}if(_[_0x4e33('0x81')](_0x489a5b['body'][_0x4e33('0xd3')])){throw _0x5e70d6[_0x4e33('0x30')](0x1f4)[_0x4e33('0x42')](new db[(_0x4e33('0x94'))][(_0x4e33('0x95'))](_0x4e33('0xd4')+_0x4be756));}if(!_['includes'](_0x4be756,_0x489a5b[_0x4e33('0x69')][_0x4e33('0xd3')])){throw _0x5e70d6[_0x4e33('0x30')](0x1f4)['send'](new db[(_0x4e33('0x94'))][(_0x4e33('0x95'))](_0x4e33('0xd5')+_0x4be756));}_0x593cf8[_0x489a5b[_0x4e33('0x69')][_0x4e33('0xd3')]]=_0x489a5b['body'][_0x4e33('0x9b')];})[_0x4e33('0x25')](function(){return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x489a5b[_0x4e33('0x61')]['id']},'include':[{'model':db[_0x4e33('0xa0')],'as':_0x4e33('0xa4')},{'model':db['MailAccount'],'as':_0x4e33('0xd6')}]});})[_0x4e33('0x25')](handleEntityNotFound(_0x5e70d6,null))[_0x4e33('0x25')](function(_0x4d0bff){if(_0x4d0bff&&_0x4d0bff[_0x4e33('0xa4')]){_0x5d15b3=_0x4d0bff;var _0x2c83e9=_[_0x4e33('0x1d')](_0x489a5b['body'],{'firstName':_0x489a5b[_0x4e33('0x69')]['from'],'phone':_0x489a5b[_0x4e33('0x69')][_0x4e33('0x9b')],'ListId':_0x4d0bff[_0x4e33('0x9a')]});_0x2c83e9[_0x489a5b[_0x4e33('0x69')][_0x4e33('0xd3')]]=_0x489a5b[_0x4e33('0x69')][_0x4e33('0x9b')];return db[_0x4e33('0x93')][_0x4e33('0xd7')]({'where':_0x593cf8,'defaults':_0x2c83e9});}})[_0x4e33('0xbe')](function(_0x457b7a){if(_0x457b7a){_0xecb1ec=_0x457b7a;var _0x2fc2dc=fs[_0x4e33('0xd8')](path[_0x4e33('0x7e')](config['root'],_0x4e33('0xd9')),'utf8');var _0x3d1d0c=ejs[_0x4e33('0xda')](_0x2fc2dc,{'body':_['toPairs'](_0x489a5b[_0x4e33('0x69')][_0x4e33('0x69')]),'bodyTitle':_0x5d15b3[_0x4e33('0xdb')]});return db[_0x4e33('0xdc')]['create']({'body':_0x3d1d0c,'ContactId':_0x457b7a['id'],'ChatWebsiteId':_0x5d15b3['id']});}})['then'](function(_0x164ea4){_0x5d4bdd=_0x164ea4;if(_0x2dbb7b[_0x4e33('0x53')]){var _0x2a7337=_0x2dbb7b[_0x4e33('0x4c')](function(_0x1ee0a7){return{'name':_0x1ee0a7['originalname'],'basename':_0x1ee0a7[_0x4e33('0x7b')],'type':_0x1ee0a7[_0x4e33('0xdd')],'ChatOfflineMessageId':_0x164ea4['id']};});_0x50e38f=_0x2a7337[_0x4e33('0x4c')](_0x5f5696=>{var _0x258967={'filename':_0x5f5696[_0x4e33('0x41')],'path':path[_0x4e33('0x7e')](config[_0x4e33('0x83')],'server',_0x4e33('0xde'),_0x4e33('0xdf'),'offline-chat',_0x5f5696['basename'])};return _0x258967;});if(!_0x5d15b3['openNewInteraction']){return db[_0x4e33('0xe0')][_0x4e33('0xe1')](function(_0x545746){return db[_0x4e33('0xe2')][_0x4e33('0xe3')](_0x2a7337,{'transaction':_0x545746});});}}})[_0x4e33('0x25')](function(){if(_0x5d4bdd){_0x36ff7f=_0x5d4bdd;return db[_0x4e33('0xd6')][_0x4e33('0x6f')]({'where':{'active':!![]},'include':[{'model':db[_0x4e33('0xe4')],'as':_0x4e33('0xe5'),'raw':!![]}]});}})['then'](function(_0x28e5ed){if(_0x28e5ed&&_0x28e5ed[_0x4e33('0xe5')]&&_0x5d15b3[_0x4e33('0xe6')]&&_0x5d15b3[_0x4e33('0xe7')]){var _0x163069={'tls':{'rejectUnauthorized':![]}};if(_0x28e5ed[_0x4e33('0xe5')][_0x4e33('0xe8')]){_0x163069[_0x4e33('0xe8')]=_0x28e5ed['Smtp'][_0x4e33('0xe8')];}else{_0x163069['host']=_0x28e5ed[_0x4e33('0xe5')][_0x4e33('0xe9')];_0x163069[_0x4e33('0xea')]=_0x28e5ed[_0x4e33('0xe5')]['port'];_0x163069[_0x4e33('0xeb')]=_0x28e5ed[_0x4e33('0xe5')]['secure'];}if(_0x28e5ed['Smtp'][_0x4e33('0xec')]){_0x163069[_0x4e33('0xed')]={'user':_0x28e5ed[_0x4e33('0xe5')]['user'],'pass':_0x28e5ed[_0x4e33('0xe5')]['pass']};}return respondWithRpcPromise(_0x4e33('0xee'),_0x4e33('0xef'),{'account':_0x163069,'message':{'from':util['format'](_0x4e33('0xf0'),_0x28e5ed[_0x4e33('0x41')],_0x28e5ed[_0x4e33('0xf1')]||_0x28e5ed['Smtp'][_0x4e33('0x65')]),'to':_0x5d15b3[_0x4e33('0xe7')],'subject':_0x5d15b3[_0x4e33('0xf2')],'html':_0x36ff7f['body'],'attachments':_0x50e38f}},client9003)['then'](function(){return _0x36ff7f;})[_0x4e33('0x5f')](function(_0x3fb823){console[_0x4e33('0x2b')](_0x3fb823);});}})[_0x4e33('0x25')](function(){if(_0x5d15b3&&_0x5d15b3[_0x4e33('0xf3')]&&_0x5d15b3[_0x4e33('0xf4')]){var _0x21e9f0=[];if(_0x2dbb7b['length']){_0x21e9f0=_0x2dbb7b['map'](function(_0x43fddc){return{'name':_0x43fddc[_0x4e33('0xf5')],'basename':_0x43fddc['filename'],'type':_0x43fddc[_0x4e33('0xdd')],'ChatOfflineMessageId':_0x5d4bdd['id']};});}var _0x154a1e;if(!_[_0x4e33('0x81')](_0x5d15b3[_0x4e33('0xf6')])){var _0x356eba=_[_0x4e33('0x4c')](_0x489a5b[_0x4e33('0x69')],function(_0x44c560){return _0x44c560;});var _0x2e936e=_[_0x4e33('0xf7')](_0x356eba)[0x0];var _0x30f765=_[_0x4e33('0xf8')](_0x2e936e,function(_0x565cb7){return _0x565cb7;});_0x154a1e=_0x30f765[0x1][_0x5d15b3[_0x4e33('0xf6')]];}var _0x3e2d93={'from':_0xecb1ec[_0x4e33('0xf1')],'firstName':_0xecb1ec[_0x4e33('0xae')],'lastName':_0xecb1ec[_0x4e33('0xaf')],'mapKey':'email','message':{'from':_0xecb1ec[_0x4e33('0xf1')],'to':_0x5d15b3[_0x4e33('0xd6')][_0x4e33('0xf1')],'cc':'','subject':_[_0x4e33('0x81')](_0x154a1e)?_0x5d15b3[_0x4e33('0xf2')]:_0x154a1e,'messageId':'','sentAt':new Date(),'attach':_0x21e9f0[_0x4e33('0x53')],'attachments':_0x21e9f0,'originChannel':_0x4e33('0xf9'),'ChatWebsiteId':_0x5d15b3['id'],'ChatOfflineMessageId':_0x36ff7f['id'],'originTo':_0x5d15b3[_0x4e33('0xd6')]['email']},'body':_0x36ff7f['body']};var _0x4a8fa9={'account':{'id':_0x5d15b3[_0x4e33('0xf4')]},'body':_0x3e2d93,'log':_0x4e33('0xfa')};return respondWithRpcPromise(_0x4e33('0xfa'),'notifyMail',_0x4a8fa9,client9001)[_0x4e33('0x25')](function(){return _0x36ff7f;})[_0x4e33('0x5f')](function(_0x1d86d8){console[_0x4e33('0x2b')](_0x1d86d8);});}return;})['then'](function(){if(_0x36ff7f){return _0x36ff7f;}})['then'](respondWithResult(_0x5e70d6,null))[_0x4e33('0x5f')](function(_0x1ad96c){console['error']('catch',_0x1ad96c);for(var _0x41272f of _0x2dbb7b){var _0x3a8594=path[_0x4e33('0x7e')](config[_0x4e33('0x83')],_0x4e33('0xfb'),_0x4e33('0xde'),_0x4e33('0xdf'),_0x4e33('0xfc'),_0x41272f['filename']);fs_extra[_0x4e33('0xfd')](_0x3a8594)['catch'](function(_0x1d88a9){console[_0x4e33('0x2b')](_0x4e33('0xfe'),_0x3a8594,_0x1d88a9);});}});};exports[_0x4e33('0xff')]=function(_0x24345c,_0x25a538,_0x27682c){return db[_0x4e33('0xbb')][_0x4e33('0x62')]({'where':{'id':_0x24345c[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x25a538,null))[_0x4e33('0x25')](function(_0x1ca4f7){if(_0x1ca4f7){return _0x1ca4f7[_0x4e33('0xff')](_0x24345c[_0x4e33('0x69')][_0x4e33('0x100')],_[_0x4e33('0x101')](_0x24345c['body'],[_0x4e33('0x100'),'id'])||{});}})[_0x4e33('0x25')](respondWithResult(_0x25a538,null))[_0x4e33('0x5f')](handleError(_0x25a538,null));};exports[_0x4e33('0x102')]=function(_0x4a8c10,_0x1095f8,_0x1a62ca){var _0x234499={'raw':![],'where':{}};var _0x3ace54={};var _0x42aa40={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4e33('0x6f')]({'where':{'id':_0x4a8c10[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x1095f8,null))[_0x4e33('0x25')](function(_0x17929d){if(_0x17929d){_0x3ace54['model']=_[_0x4e33('0x4d')](db['ChatInteraction'][_0x4e33('0x47')]);_0x3ace54[_0x4e33('0x50')]=_[_0x4e33('0x4d')](_0x4a8c10[_0x4e33('0x50')]);_0x3ace54['filters']=_['intersection'](_0x3ace54[_0x4e33('0x4b')],_0x3ace54[_0x4e33('0x50')]);_0x234499[_0x4e33('0x51')]=_[_0x4e33('0x4f')](_0x3ace54[_0x4e33('0x4b')],qs['fields'](_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x52')]));_0x234499[_0x4e33('0x51')]=_0x234499['attributes'][_0x4e33('0x53')]?_0x234499[_0x4e33('0x51')]:_0x3ace54[_0x4e33('0x4b')];if(!_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x74')](_0x4e33('0x54'))){_0x234499[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x35')]);_0x234499['offset']=qs[_0x4e33('0x34')](_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x34')]);}_0x234499[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x4a8c10['query']['sort']);_0x234499[_0x4e33('0x57')]=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x4a8c10[_0x4e33('0x50')],_0x3ace54['filters']));_0x234499[_0x4e33('0x57')][_0x4e33('0x6c')]=_0x17929d['id'];if(_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x234499[_0x4e33('0x57')]=_['merge'](_0x234499[_0x4e33('0x57')],{'$or':_[_0x4e33('0x4c')](_0x234499[_0x4e33('0x51')],function(_0xa5d543){var _0x56e13e={};_0x56e13e[_0xa5d543]={'$like':'%'+_0x4a8c10[_0x4e33('0x50')]['filter']+'%'};return _0x56e13e;})});}_0x234499=_[_0x4e33('0x59')]({},_0x234499,_0x4a8c10[_0x4e33('0x5c')]);return db[_0x4e33('0xbb')][_0x4e33('0x33')]({'where':_0x234499['where']})[_0x4e33('0x25')](function(_0x4c3dec){_0x42aa40['count']=_0x4c3dec;if(_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x5d')]){_0x234499[_0x4e33('0x5e')]=[{'model':db['CmContact'],'as':_0x4e33('0x103'),'required':![]},{'model':db[_0x4e33('0xc7')],'as':_0x4e33('0x104'),'attributes':[_0x4e33('0x41'),_0x4e33('0x105'),'internal'],'required':![]},{'model':db[_0x4e33('0x106')],'as':_0x4e33('0x107'),'attributes':['id','name','color'],'where':_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x108')]?{'id':_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x108')]}:undefined,'required':_0x4a8c10[_0x4e33('0x50')][_0x4e33('0x108')]?!![]:![]}];}return db[_0x4e33('0xbb')][_0x4e33('0x70')](_0x234499);})[_0x4e33('0x25')](function(_0x2bf22c){_0x42aa40[_0x4e33('0x75')]=_0x2bf22c;return _0x42aa40;});}})[_0x4e33('0x25')](respondWithFilteredResult(_0x1095f8,_0x234499))[_0x4e33('0x5f')](handleError(_0x1095f8,null));};function iftimePromise(_0x513a27,_0x209010){return respondWithRpcPromise('Command',_0x4e33('0x109'),{'command':_0x209010[_0x4e33('0x10a')]?util[_0x4e33('0xb6')](_0x4e33('0x10b'),_0x513a27[_0x4e33('0x10c')],_0x209010[_0x4e33('0x10a')]):util[_0x4e33('0xb6')](_0x4e33('0x10d'),_0x513a27['interval'])},client9002)[_0x4e33('0x25')](function(_0x421b2a){var _0x49da5d=_0x421b2a&&_0x421b2a[_0x4e33('0x10e')](_0x4e33('0x10f'))>=0x0?!![]:![];logger[_0x4e33('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x209010['id'],_0x513a27['id'],_0x513a27[_0x4e33('0x10c')],_0x49da5d?_0x4e33('0x110'):'OFFLINE',_0x209010[_0x4e33('0x10a')]?_0x209010[_0x4e33('0x10a')]:_0x4e33('0x111'));return _0x49da5d;})[_0x4e33('0x5f')](function(_0x20ca01){logger[_0x4e33('0x2b')](_0x4e33('0x112'),_0x209010['id'],_0x513a27['id'],_0x513a27[_0x4e33('0x10c')],util[_0x4e33('0x113')](_0x20ca01,{'showHidden':![],'depth':null}),_0x209010[_0x4e33('0x10a')]?_0x209010[_0x4e33('0x10a')]:_0x4e33('0x111'));return![];});}exports['getSnippet']=function(_0x5b4243,_0x2ec6e6,_0x282b78){var _0x1fd159=0x0;var _0x457ed1=0x0;var _0x4fae25=![];var _0x37749e;var _0x421de8;return db['ChatWebsite'][_0x4e33('0x62')]({'where':{'id':_0x5b4243[_0x4e33('0x61')]['id']},'include':[{'model':db[_0x4e33('0x114')],'as':_0x4e33('0x114'),'include':[{'model':db[_0x4e33('0x114')],'as':_0x4e33('0x115'),'attributes':['id',_0x4e33('0x10c')],'raw':!![]}]}]})[_0x4e33('0x25')](handleEntityNotFound(_0x2ec6e6,null))[_0x4e33('0x25')](function(_0x6435cd){if(_0x6435cd){_0x37749e=_0x6435cd;return _0x6435cd['getProactiveActions']({'raw':!![]});}})['then'](function(_0x10feab){if(_0x37749e){if(_0x10feab){_0x421de8=_0x10feab;}}return require('../../config/license/util')[_0x4e33('0x80')]();})[_0x4e33('0x25')](function(_0x30ad7d){if(_0x30ad7d){_0x457ed1=_0x30ad7d['virtual'];_0x4fae25=_0x30ad7d['custom'];}})[_0x4e33('0x25')](function(){return db[_0x4e33('0xbb')]['count']({'where':{'closed':![]}});})[_0x4e33('0x25')](function(_0x39e9b8){_0x1fd159=_0x39e9b8;if(_0x457ed1&&_0x39e9b8>_0x457ed1){return db[_0x4e33('0x116')][_0x4e33('0x6f')]({'where':{'id':0x1}})[_0x4e33('0x25')](function(_0x18b063){if(_0x18b063){_0x18b063['increment'](_0x4e33('0x117'));}});}})[_0x4e33('0x25')](function(){if(_0x37749e[_0x4e33('0x114')]&&_0x37749e['Interval'][_0x4e33('0x115')]){var _0x52c5ea=[];for(var _0x4abd76=0x0;_0x4abd76<_0x37749e[_0x4e33('0x114')][_0x4e33('0x115')][_0x4e33('0x53')];_0x4abd76++){var _0x12f0f8=_0x37749e[_0x4e33('0x114')][_0x4e33('0x115')][_0x4abd76][_0x4e33('0x3d')]({'plain':!![]});_0x52c5ea[_0x4e33('0xc2')](iftimePromise(_0x12f0f8,_0x37749e));}return BPromise[_0x4e33('0x118')](_0x52c5ea)[_0x4e33('0x25')](function(_0x4e90f6){return _[_0x4e33('0x119')](_0x4e90f6);});}else{return!![];}})[_0x4e33('0x25')](function(_0x13256b){var _0x9c6c35=fs[_0x4e33('0xd8')](path['join'](config[_0x4e33('0x83')],_0x4e33('0x11a')),_0x4e33('0x11b'));var _0xd0ec19={'remote':_0x37749e[_0x4e33('0x11c')],'query':querystring[_0x4e33('0x2a')](_[_0x4e33('0x59')](_0x37749e['get']({'plain':!![]}),{'customerIp':_0x5b4243[_0x4e33('0x90')][_0x4e33('0xab')]||_0x5b4243[_0x4e33('0x90')][_0x4e33('0x11d')]||_0x5b4243['connection'][_0x4e33('0x11e')]||_0x5b4243['ip'],'referer':_0x5b4243[_0x4e33('0x90')][_0x4e33('0xb1')],'openedInteractions':_0x1fd159,'maxInteractions':_0x457ed1,'virtual':_0x4fae25[_0x4e33('0x11f')],'online':_0x13256b,'custom':_0x4fae25}))[_0x4e33('0x120')](/'/g,'\x5c\x27')};_0x2ec6e6[_0x4e33('0x42')](ejs[_0x4e33('0xda')](Mustache[_0x4e33('0xda')](_0x9c6c35,_0xd0ec19),{'proactiveActions':_0x421de8,'alignment':_0x37749e[_0x4e33('0x121')],'verticalAlignment':_0x37749e['verticalAlignment'],'div_color':_0x37749e[_0x4e33('0x122')],'text_color':_0x37749e[_0x4e33('0x123')],'button_color':_0x37749e[_0x4e33('0x124')],'background_color':_0x37749e[_0x4e33('0x125')]}));})[_0x4e33('0x5f')](handleError(_0x2ec6e6,null));};exports[_0x4e33('0x126')]=function(_0x231d97,_0x3dd80f,_0xb19f38){return db[_0x4e33('0x46')]['findOne']({'where':{'id':_0x231d97[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x3dd80f,null))[_0x4e33('0x25')](function(_0x216a82){if(_0x216a82){return db[_0x4e33('0xe0')]['transaction'](function(_0x19e37a){return db[_0x4e33('0xa2')][_0x4e33('0x3c')]({'where':{'ChatWebsiteId':_0x231d97[_0x4e33('0x61')]['id']},'transaction':_0x19e37a})[_0x4e33('0x25')](function(_0x23716f){var _0x4837d8=_[_0x4e33('0x4c')](_0x231d97[_0x4e33('0x69')],function(_0x4e93f0){_0x4e93f0[_0x4e33('0x6c')]=_0x231d97[_0x4e33('0x61')]['id'];return _0x4e93f0;});return db[_0x4e33('0xa2')][_0x4e33('0xe3')](_0x4837d8,{'transaction':_0x19e37a});});})[_0x4e33('0x25')](function(){return db[_0x4e33('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x231d97[_0x4e33('0x61')]['id']},'order':_0x4e33('0x127')});});}})[_0x4e33('0x25')](respondWithResult(_0x3dd80f,null))[_0x4e33('0x5f')](handleError(_0x3dd80f,null));};exports[_0x4e33('0x128')]=function(_0x3776c7,_0x2b7129,_0x407a69){var _0x98c24f={};var _0x17974d={};var _0x34214e;var _0x84a9b9;return db[_0x4e33('0x46')][_0x4e33('0x6f')]({'where':{'id':_0x3776c7[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x2b7129,null))[_0x4e33('0x25')](function(_0x2fa660){if(_0x2fa660){_0x34214e=_0x2fa660;_0x17974d[_0x4e33('0x4b')]=_[_0x4e33('0x4d')](db[_0x4e33('0xa2')]['rawAttributes']);_0x17974d[_0x4e33('0x50')]=_[_0x4e33('0x4d')](_0x3776c7[_0x4e33('0x50')]);_0x17974d[_0x4e33('0x4e')]=_[_0x4e33('0x4f')](_0x17974d[_0x4e33('0x4b')],_0x17974d[_0x4e33('0x50')]);_0x98c24f['attributes']=_[_0x4e33('0x4f')](_0x17974d['model'],qs['fields'](_0x3776c7[_0x4e33('0x50')][_0x4e33('0x52')]));_0x98c24f['attributes']=_0x98c24f[_0x4e33('0x51')][_0x4e33('0x53')]?_0x98c24f['attributes']:_0x17974d['model'];_0x98c24f['order']=qs[_0x4e33('0x56')](_0x3776c7[_0x4e33('0x50')][_0x4e33('0x56')]);_0x98c24f[_0x4e33('0x57')]=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x3776c7[_0x4e33('0x50')],_0x17974d[_0x4e33('0x4e')]));if(_0x3776c7[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x98c24f[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x98c24f[_0x4e33('0x57')],{'$or':_[_0x4e33('0x4c')](_0x98c24f[_0x4e33('0x51')],function(_0x122e64){var _0x128a56={};_0x128a56[_0x122e64]={'$like':'%'+_0x3776c7['query']['filter']+'%'};return _0x128a56;})});}_0x98c24f=_[_0x4e33('0x59')]({},_0x98c24f,_0x3776c7[_0x4e33('0x5c')]);return _0x34214e[_0x4e33('0x128')](_0x98c24f);}})['then'](function(_0x5b2952){if(_0x5b2952){_0x84a9b9=_0x5b2952[_0x4e33('0x53')];if(!_0x3776c7['query'][_0x4e33('0x74')](_0x4e33('0x54'))){_0x98c24f[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x3776c7[_0x4e33('0x50')]['limit']);_0x98c24f['offset']=qs[_0x4e33('0x34')](_0x3776c7[_0x4e33('0x50')][_0x4e33('0x34')]);}return _0x34214e['getApplications'](_0x98c24f);}})[_0x4e33('0x25')](function(_0x19828f){if(_0x19828f){return _0x19828f?{'count':_0x84a9b9,'rows':_0x19828f}:null;}})[_0x4e33('0x25')](respondWithResult(_0x2b7129,null))[_0x4e33('0x5f')](handleError(_0x2b7129,null));};exports[_0x4e33('0x129')]=function(_0x53c16c,_0x4e1ab0,_0x3d31ff){return db[_0x4e33('0x12a')][_0x4e33('0x62')]({'where':{'id':_0x53c16c[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x4e1ab0,null))[_0x4e33('0x25')](function(_0x2597de){if(_0x2597de){return _0x2597de[_0x4e33('0x129')](_0x53c16c['body']['ids'],_[_0x4e33('0x101')](_0x53c16c[_0x4e33('0x69')],[_0x4e33('0x100'),'id'])||{});}})[_0x4e33('0x25')](respondWithResult(_0x4e1ab0,null))[_0x4e33('0x5f')](handleError(_0x4e1ab0,null));};exports[_0x4e33('0x12b')]=function(_0x1db2d2,_0x57a6d0,_0xedcce8){var _0x5a755e={};var _0x309cc8={};var _0x131d9a;var _0x51d2f1;return db['ChatWebsite'][_0x4e33('0x6f')]({'where':{'id':_0x1db2d2[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x57a6d0,null))['then'](function(_0x396896){if(_0x396896){_0x131d9a=_0x396896;_0x309cc8[_0x4e33('0x4b')]=_['keys'](db[_0x4e33('0x12c')][_0x4e33('0x47')]);_0x309cc8[_0x4e33('0x50')]=_[_0x4e33('0x4d')](_0x1db2d2[_0x4e33('0x50')]);_0x309cc8['filters']=_['intersection'](_0x309cc8['model'],_0x309cc8[_0x4e33('0x50')]);_0x5a755e[_0x4e33('0x51')]=_['intersection'](_0x309cc8['model'],qs[_0x4e33('0x52')](_0x1db2d2[_0x4e33('0x50')]['fields']));_0x5a755e[_0x4e33('0x51')]=_0x5a755e[_0x4e33('0x51')][_0x4e33('0x53')]?_0x5a755e[_0x4e33('0x51')]:_0x309cc8[_0x4e33('0x4b')];_0x5a755e[_0x4e33('0x55')]=qs['sort'](_0x1db2d2[_0x4e33('0x50')][_0x4e33('0x56')]);_0x5a755e['where']=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x1db2d2[_0x4e33('0x50')],_0x309cc8[_0x4e33('0x4e')]));if(_0x1db2d2[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x5a755e[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x5a755e[_0x4e33('0x57')],{'$or':_[_0x4e33('0x4c')](_0x5a755e['attributes'],function(_0x1f3242){var _0x3c27f3={};_0x3c27f3[_0x1f3242]={'$like':'%'+_0x1db2d2[_0x4e33('0x50')][_0x4e33('0x5b')]+'%'};return _0x3c27f3;})});}_0x5a755e=_['merge']({},_0x5a755e,_0x1db2d2[_0x4e33('0x5c')]);return _0x131d9a[_0x4e33('0x12b')](_0x5a755e);}})['then'](function(_0x1e1664){if(_0x1e1664){_0x51d2f1=_0x1e1664[_0x4e33('0x53')];if(!_0x1db2d2['query'][_0x4e33('0x74')]('nolimit')){_0x5a755e['limit']=qs[_0x4e33('0x35')](_0x1db2d2[_0x4e33('0x50')][_0x4e33('0x35')]);_0x5a755e['offset']=qs['offset'](_0x1db2d2[_0x4e33('0x50')][_0x4e33('0x34')]);}return _0x131d9a['getProactiveActions'](_0x5a755e);}})[_0x4e33('0x25')](function(_0x1c0488){if(_0x1c0488){return _0x1c0488?{'count':_0x51d2f1,'rows':_0x1c0488}:null;}})[_0x4e33('0x25')](respondWithResult(_0x57a6d0,null))['catch'](handleError(_0x57a6d0,null));};exports['getFields']=function(_0x52bb0e,_0xc765c7,_0x31114){var _0x5db4f0=_0x52bb0e[_0x4e33('0x50')]['online']===_0x4e33('0x12d')?'offlineForm':_0x4e33('0x12e');return db[_0x4e33('0x46')][_0x4e33('0x62')]({'attributes':['id',_0x5db4f0],'where':{'id':_0x52bb0e[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0xc765c7,null))[_0x4e33('0x25')](function(_0x2eb5ce){if(_0x2eb5ce){var _0x38d67c=_0x2eb5ce[_0x5db4f0];var _0x36cbda=_0x38d67c&&_0x38d67c[_0x4e33('0x12f')]?_0x38d67c[_0x4e33('0x12f')]:[];_0xc765c7['send']({'fromKey':_[_0x4e33('0x81')](_0x38d67c[_0x4e33('0x130')])?undefined:_0x38d67c[_0x4e33('0x130')],'count':_0x36cbda[_0x4e33('0x53')],'rows':_0x36cbda});}})[_0x4e33('0x5f')](handleError(_0xc765c7,null));};exports[_0x4e33('0x131')]=function(_0x4d610d,_0x232b88,_0x5b6003){var _0x506d07={'raw':![],'where':{}};var _0x3cca2e={};var _0x16c87e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4e33('0x6f')]({'where':{'id':_0x4d610d[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x232b88,null))[_0x4e33('0x25')](function(_0x107302){if(_0x107302){_0x3cca2e[_0x4e33('0x4b')]=_['keys'](db[_0x4e33('0xdc')][_0x4e33('0x47')]);_0x3cca2e[_0x4e33('0x50')]=_[_0x4e33('0x4d')](_0x4d610d[_0x4e33('0x50')]);_0x3cca2e[_0x4e33('0x4e')]=_[_0x4e33('0x4f')](_0x3cca2e[_0x4e33('0x4b')],_0x3cca2e[_0x4e33('0x50')]);_0x506d07[_0x4e33('0x51')]=_[_0x4e33('0x4f')](_0x3cca2e['model'],qs[_0x4e33('0x52')](_0x4d610d[_0x4e33('0x50')]['fields']));_0x506d07['attributes']=_0x506d07['attributes']['length']?_0x506d07[_0x4e33('0x51')]:_0x3cca2e[_0x4e33('0x4b')];if(!_0x4d610d['query'][_0x4e33('0x74')](_0x4e33('0x54'))){_0x506d07[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x4d610d['query']['limit']);_0x506d07[_0x4e33('0x34')]=qs[_0x4e33('0x34')](_0x4d610d['query'][_0x4e33('0x34')]);}_0x506d07[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x4d610d[_0x4e33('0x50')]['sort']);_0x506d07[_0x4e33('0x57')]=qs['filters'](_[_0x4e33('0x58')](_0x4d610d[_0x4e33('0x50')],_0x3cca2e['filters']));_0x506d07[_0x4e33('0x57')][_0x4e33('0x6c')]=_0x107302['id'];if(_0x4d610d['query'][_0x4e33('0x5b')]){_0x506d07[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x506d07[_0x4e33('0x57')],{'$or':_['map'](_0x506d07['attributes'],function(_0xff4ef){var _0x269bd5={};_0x269bd5[_0xff4ef]={'$like':'%'+_0x4d610d[_0x4e33('0x50')]['filter']+'%'};return _0x269bd5;})});}_0x506d07=_[_0x4e33('0x59')]({},_0x506d07,_0x4d610d[_0x4e33('0x5c')]);return db[_0x4e33('0xdc')][_0x4e33('0x33')]({'where':_0x506d07[_0x4e33('0x57')]})[_0x4e33('0x25')](function(_0x219da9){_0x16c87e['count']=_0x219da9;if(_0x4d610d[_0x4e33('0x50')][_0x4e33('0x5d')]){_0x506d07[_0x4e33('0x5e')]=[{'all':!![]}];}else{_0x506d07[_0x4e33('0x5e')]=[{'model':db[_0x4e33('0x93')],'as':_0x4e33('0x103'),'required':![]},{'model':db[_0x4e33('0xe2')],'as':_0x4e33('0x132'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x506d07);})['then'](function(_0x481069){_0x16c87e[_0x4e33('0x75')]=_0x481069;return _0x16c87e;});}})[_0x4e33('0x25')](respondWithFilteredResult(_0x232b88,_0x506d07))['catch'](handleError(_0x232b88,null));};exports[_0x4e33('0x133')]=function(_0x5736c2,_0x3bfe34,_0x16c696){return db[_0x4e33('0x46')][_0x4e33('0x62')]({'where':{'id':_0x5736c2['params']['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x3bfe34,null))[_0x4e33('0x25')](function(_0x3d7672){if(_0x3d7672){return _0x3d7672[_0x4e33('0x133')](_0x5736c2[_0x4e33('0x69')]['ids'],_[_0x4e33('0x101')](_0x5736c2[_0x4e33('0x69')],['ids','id'])||{})[_0x4e33('0xbe')](function(_0x3ba6e9){for(var _0x342b65=0x0;_0x342b65<_0x5736c2[_0x4e33('0x69')][_0x4e33('0x100')][_0x4e33('0x53')];_0x342b65+=0x1){socket[_0x4e33('0x134')]('userChatWebsite:save',{'UserId':Number(_0x5736c2[_0x4e33('0x69')][_0x4e33('0x100')][_0x342b65]),'ChatWebsiteId':Number(_0x5736c2['params']['id'])});}return _0x3ba6e9;});}})['then'](respondWithResult(_0x3bfe34,null))['catch'](handleError(_0x3bfe34,null));};exports['removeAgents']=function(_0x2da2cc,_0x3064f2,_0x4b02d4){return db[_0x4e33('0x46')]['find']({'where':{'id':_0x2da2cc[_0x4e33('0x61')]['id']}})['then'](handleEntityNotFound(_0x3064f2,null))['then'](function(_0xd9d304){if(_0xd9d304){return _0xd9d304[_0x4e33('0x135')](_0x2da2cc['query'][_0x4e33('0x100')])[_0x4e33('0x25')](function(){if(_['isArray'](_0x2da2cc['query']['ids'])){for(var _0x5b43d7=0x0;_0x5b43d7<_0x2da2cc[_0x4e33('0x50')][_0x4e33('0x100')][_0x4e33('0x53')];_0x5b43d7+=0x1){socket[_0x4e33('0x134')]('userChatWebsite:remove',{'UserId':Number(_0x2da2cc[_0x4e33('0x50')][_0x4e33('0x100')][_0x5b43d7]),'ChatWebsiteId':Number(_0x2da2cc['params']['id'])});}}else{socket[_0x4e33('0x134')](_0x4e33('0x136'),{'UserId':Number(_0x2da2cc[_0x4e33('0x50')][_0x4e33('0x100')]),'ChatWebsiteId':Number(_0x2da2cc[_0x4e33('0x61')]['id'])});}});}})[_0x4e33('0x25')](respondWithStatusCode(_0x3064f2,null))[_0x4e33('0x5f')](handleError(_0x3064f2,null));};exports[_0x4e33('0x137')]=function(_0x3197e2,_0x27f3de,_0x361018){var _0x522904={};var _0x584742={};var _0xbc83ff;var _0x37cc14;return db['ChatWebsite'][_0x4e33('0x6f')]({'where':{'id':_0x3197e2[_0x4e33('0x61')]['id']}})[_0x4e33('0x25')](handleEntityNotFound(_0x27f3de,null))[_0x4e33('0x25')](function(_0x871c73){if(_0x871c73){_0xbc83ff=_0x871c73;_0x584742[_0x4e33('0x4b')]=_[_0x4e33('0x4d')](db[_0x4e33('0xc7')][_0x4e33('0x47')]);_0x584742[_0x4e33('0x50')]=_[_0x4e33('0x4d')](_0x3197e2[_0x4e33('0x50')]);_0x584742[_0x4e33('0x4e')]=_['intersection'](_0x584742[_0x4e33('0x4b')],_0x584742[_0x4e33('0x50')]);_0x522904['attributes']=_[_0x4e33('0x4f')](_0x584742[_0x4e33('0x4b')],qs['fields'](_0x3197e2[_0x4e33('0x50')][_0x4e33('0x52')]));_0x522904[_0x4e33('0x51')]=_0x522904[_0x4e33('0x51')]['length']?_0x522904[_0x4e33('0x51')]:_0x584742[_0x4e33('0x4b')];_0x522904[_0x4e33('0x55')]=qs[_0x4e33('0x56')](_0x3197e2['query'][_0x4e33('0x56')]);_0x522904[_0x4e33('0x57')]=qs[_0x4e33('0x4e')](_[_0x4e33('0x58')](_0x3197e2[_0x4e33('0x50')],_0x584742[_0x4e33('0x4e')]));if(_0x3197e2[_0x4e33('0x50')][_0x4e33('0x5b')]){_0x522904[_0x4e33('0x57')]=_[_0x4e33('0x59')](_0x522904['where'],{'$or':_[_0x4e33('0x4c')](_0x522904[_0x4e33('0x51')],function(_0x357ca6){var _0x5a0b39={};_0x5a0b39[_0x357ca6]={'$like':'%'+_0x3197e2['query'][_0x4e33('0x5b')]+'%'};return _0x5a0b39;})});}_0x522904=_[_0x4e33('0x59')]({},_0x522904,_0x3197e2[_0x4e33('0x5c')]);return _0xbc83ff[_0x4e33('0x137')](_0x522904);}})['then'](function(_0x185704){if(_0x185704){_0x37cc14=_0x185704[_0x4e33('0x53')];if(!_0x3197e2[_0x4e33('0x50')][_0x4e33('0x74')]('nolimit')){_0x522904[_0x4e33('0x35')]=qs[_0x4e33('0x35')](_0x3197e2['query'][_0x4e33('0x35')]);_0x522904['offset']=qs[_0x4e33('0x34')](_0x3197e2[_0x4e33('0x50')][_0x4e33('0x34')]);}return _0xbc83ff[_0x4e33('0x137')](_0x522904);}})['then'](function(_0x25e3cd){if(_0x25e3cd){return _0x25e3cd?{'count':_0x37cc14,'rows':_0x25e3cd}:null;}})[_0x4e33('0x25')](respondWithResult(_0x27f3de,null))[_0x4e33('0x5f')](handleError(_0x27f3de,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1589292..3a0a91c 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 _0xa4ba=['setMaxListeners','save','remove','emit','hook','../../mysqldb','ChatWebsite'];(function(_0x494e83,_0x32efc6){var _0x42f4e7=function(_0x206a45){while(--_0x206a45){_0x494e83['push'](_0x494e83['shift']());}};_0x42f4e7(++_0x32efc6);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa4ba[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xaa4b('0x0'))['db'][_0xaa4b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xaa4b('0x2')](0x0);var events={'afterCreate':_0xaa4b('0x3'),'afterUpdate':'update','afterDestroy':_0xaa4b('0x4')};function emitEvent(_0x5e7bce){return function(_0x54f0ce,_0xeb83b1,_0x1b2ee8){ChatWebsiteEvents[_0xaa4b('0x5')](_0x5e7bce+':'+_0x54f0ce['id'],_0x54f0ce);ChatWebsiteEvents[_0xaa4b('0x5')](_0x5e7bce,_0x54f0ce);_0x1b2ee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xaa4b('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x379e=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x4c922c,_0x54a49e){var _0x504ddc=function(_0x4dbed6){while(--_0x4dbed6){_0x4c922c['push'](_0x4c922c['shift']());}};_0x504ddc(++_0x54a49e);}(_0x379e,0x104));var _0xe379=function(_0x53f1c1,_0x6f6512){_0x53f1c1=_0x53f1c1-0x0;var _0x464d14=_0x379e[_0x53f1c1];return _0x464d14;};'use strict';var EventEmitter=require(_0xe379('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe379('0x1'),'afterUpdate':_0xe379('0x2'),'afterDestroy':_0xe379('0x3')};function emitEvent(_0x4387fd){return function(_0x3db31a,_0x475418,_0x3ed6c8){ChatWebsiteEvents['emit'](_0x4387fd+':'+_0x3db31a['id'],_0x3db31a);ChatWebsiteEvents[_0xe379('0x4')](_0x4387fd,_0x3db31a);_0x3ed6c8(null);};}for(var e in events){if(events[_0xe379('0x5')](e)){var event=events[e];ChatWebsite[_0xe379('0x6')](e,emitEvent(event));}}module[_0xe379('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 f14d043..4bd12c8 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 _0x28b7=['util','../../config/logger','api','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','lodash'];(function(_0x518a20,_0x168794){var _0x106249=function(_0x4ac3e7){while(--_0x4ac3e7){_0x518a20['push'](_0x518a20['shift']());}};_0x106249(++_0x168794);}(_0x28b7,0x77));var _0x728b=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x28b7[_0x228a4a];return _0x3d3937;};'use strict';var _=require(_0x728b('0x0'));var util=require(_0x728b('0x1'));var logger=require(_0x728b('0x2'))(_0x728b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x728b('0x4'));var fs=require('fs');var path=require(_0x728b('0x5'));var rimraf=require(_0x728b('0x6'));var config=require('../../config/environment');var attributes=require(_0x728b('0x7'));module[_0x728b('0x8')]=function(_0x162df9,_0x26bf56){return _0x162df9[_0x728b('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fe3=['ChatWebsite','chat_websites','api','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x3b27b9,_0x1a250f){var _0x2bb8b=function(_0x3c1af2){while(--_0x3c1af2){_0x3b27b9['push'](_0x3b27b9['shift']());}};_0x2bb8b(++_0x1a250f);}(_0x7fe3,0x1ce));var _0x37fe=function(_0x4fd64c,_0x1b1b4f){_0x4fd64c=_0x4fd64c-0x0;var _0x54b3cb=_0x7fe3[_0x4fd64c];return _0x54b3cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x37fe('0x0'));var moment=require('moment');var BPromise=require(_0x37fe('0x1'));var rp=require(_0x37fe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37fe('0x3'));var config=require(_0x37fe('0x4'));var attributes=require(_0x37fe('0x5'));module[_0x37fe('0x6')]=function(_0xa0f312,_0x572b78){return _0xa0f312[_0x37fe('0x7')](_0x37fe('0x8'),attributes,{'tableName':_0x37fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 4888ec4..e20cf0e 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 _0xa5d4=['ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then'];(function(_0x4fe1b3,_0x5b11a9){var _0x22eae0=function(_0x353234){while(--_0x353234){_0x4fe1b3['push'](_0x4fe1b3['shift']());}};_0x22eae0(++_0x5b11a9);}(_0xa5d4,0x1ec));var _0x4a5d=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa5d4[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x4a5d('0x0'));var util=require('util');var moment=require(_0x4a5d('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a5d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a5d('0x3'))['db'];var utils=require(_0x4a5d('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a5d('0x5')][_0x4a5d('0x6')]({'port':0x232a});config[_0x4a5d('0x7')]=_[_0x4a5d('0x8')](config[_0x4a5d('0x7')],{'host':_0x4a5d('0x9'),'port':0x18eb});var socket=require(_0x4a5d('0xa'))(new Redis(config[_0x4a5d('0x7')]));require(_0x4a5d('0xb'))[_0x4a5d('0xc')](socket);function respondWithRpcPromise(_0x263154,_0x2c29f8,_0x25dc27){return new BPromise(function(_0x1526bd,_0x222bd5){return client['request'](_0x263154,_0x25dc27)[_0x4a5d('0xd')](function(_0x5ba8c9){logger['info'](_0x4a5d('0xe'),_0x2c29f8,_0x4a5d('0xf'));logger[_0x4a5d('0x10')](_0x4a5d('0x11'),_0x2c29f8,'request\x20sent',JSON['stringify'](_0x5ba8c9));if(_0x5ba8c9[_0x4a5d('0x12')]){if(_0x5ba8c9[_0x4a5d('0x12')][_0x4a5d('0x13')]===0x1f4){logger['error'](_0x4a5d('0xe'),_0x2c29f8,_0x5ba8c9[_0x4a5d('0x12')][_0x4a5d('0x14')]);return _0x222bd5(_0x5ba8c9[_0x4a5d('0x12')][_0x4a5d('0x14')]);}logger['error'](_0x4a5d('0xe'),_0x2c29f8,_0x5ba8c9['error'][_0x4a5d('0x14')]);return _0x1526bd(_0x5ba8c9[_0x4a5d('0x12')][_0x4a5d('0x14')]);}else{logger[_0x4a5d('0x15')](_0x4a5d('0xe'),_0x2c29f8,'request\x20sent');_0x1526bd(_0x5ba8c9['result'][_0x4a5d('0x14')]);}})[_0x4a5d('0x16')](function(_0x183d4c){logger[_0x4a5d('0x12')](_0x4a5d('0xe'),_0x2c29f8,_0x183d4c);_0x222bd5(_0x183d4c);});});}
\ No newline at end of file
+var _0x9316=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xde12c4,_0x17a24a){var _0x470888=function(_0x349764){while(--_0x349764){_0xde12c4['push'](_0xde12c4['shift']());}};_0x470888(++_0x17a24a);}(_0x9316,0x1b0));var _0x6931=function(_0x2972a8,_0x32d64f){_0x2972a8=_0x2972a8-0x0;var _0x107e8b=_0x9316[_0x2972a8];return _0x107e8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6931('0x0'));var fs=require('fs');var Redis=require(_0x6931('0x1'));var db=require(_0x6931('0x2'))['db'];var utils=require(_0x6931('0x3'));var logger=require('../../config/logger')(_0x6931('0x4'));var config=require('../../config/environment');var jayson=require(_0x6931('0x5'));var client=jayson[_0x6931('0x6')][_0x6931('0x7')]({'port':0x232a});config[_0x6931('0x8')]=_['defaults'](config[_0x6931('0x8')],{'host':_0x6931('0x9'),'port':0x18eb});var socket=require(_0x6931('0xa'))(new Redis(config[_0x6931('0x8')]));require(_0x6931('0xb'))[_0x6931('0xc')](socket);function respondWithRpcPromise(_0x3a52d8,_0x52e110,_0x2edbd2){return new BPromise(function(_0x19dd52,_0x26106e){return client[_0x6931('0xd')](_0x3a52d8,_0x2edbd2)['then'](function(_0x3c3b42){logger[_0x6931('0xe')](_0x6931('0xf'),_0x52e110,'request\x20sent');logger['debug'](_0x6931('0x10'),_0x52e110,_0x6931('0x11'),JSON[_0x6931('0x12')](_0x3c3b42));if(_0x3c3b42[_0x6931('0x13')]){if(_0x3c3b42[_0x6931('0x13')][_0x6931('0x14')]===0x1f4){logger[_0x6931('0x13')](_0x6931('0xf'),_0x52e110,_0x3c3b42[_0x6931('0x13')][_0x6931('0x15')]);return _0x26106e(_0x3c3b42[_0x6931('0x13')]['message']);}logger['error'](_0x6931('0xf'),_0x52e110,_0x3c3b42['error'][_0x6931('0x15')]);return _0x19dd52(_0x3c3b42[_0x6931('0x13')][_0x6931('0x15')]);}else{logger[_0x6931('0xe')](_0x6931('0xf'),_0x52e110,'request\x20sent');_0x19dd52(_0x3c3b42[_0x6931('0x16')][_0x6931('0x15')]);}})['catch'](function(_0x2743c7){logger[_0x6931('0x13')](_0x6931('0xf'),_0x52e110,_0x2743c7);_0x26106e(_0x2743c7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ddba936..2dc0b1f 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 _0x33f6=['save','remove','update','emit','register','length','./chatWebsite.events'];(function(_0x529709,_0xa9145a){var _0x151a7f=function(_0x57d9a6){while(--_0x57d9a6){_0x529709['push'](_0x529709['shift']());}};_0x151a7f(++_0xa9145a);}(_0x33f6,0x117));var _0x633f=function(_0x35ae0a,_0x1f395e){_0x35ae0a=_0x35ae0a-0x0;var _0x1c8d41=_0x33f6[_0x35ae0a];return _0x1c8d41;};'use strict';var ChatWebsiteEvents=require(_0x633f('0x0'));var events=[_0x633f('0x1'),_0x633f('0x2'),_0x633f('0x3')];function createListener(_0x3fbe05,_0x39091e){return function(_0x5138a1){_0x39091e[_0x633f('0x4')](_0x3fbe05,_0x5138a1);};}function removeListener(_0x651cca,_0x186302){return function(){ChatWebsiteEvents['removeListener'](_0x651cca,_0x186302);};}exports[_0x633f('0x5')]=function(_0x204283){for(var _0x80410d=0x0,_0x3fa62b=events[_0x633f('0x6')];_0x80410d<_0x3fa62b;_0x80410d++){var _0x5532fa=events[_0x80410d];var _0x2c06f2=createListener('chatWebsite:'+_0x5532fa,_0x204283);ChatWebsiteEvents['on'](_0x5532fa,_0x2c06f2);}};
\ No newline at end of file
+var _0xa140=['chatWebsite:','./chatWebsite.events','save','removeListener','register','length'];(function(_0x5acc28,_0x41932d){var _0x2bc2a4=function(_0x1e39ed){while(--_0x1e39ed){_0x5acc28['push'](_0x5acc28['shift']());}};_0x2bc2a4(++_0x41932d);}(_0xa140,0x8b));var _0x0a14=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xa140[_0x5317b5];return _0x3b7ce2;};'use strict';var ChatWebsiteEvents=require(_0x0a14('0x0'));var events=[_0x0a14('0x1'),'remove','update'];function createListener(_0x11c128,_0x417fe9){return function(_0x3cb75e){_0x417fe9['emit'](_0x11c128,_0x3cb75e);};}function removeListener(_0x5db6fb,_0x3e4199){return function(){ChatWebsiteEvents[_0x0a14('0x2')](_0x5db6fb,_0x3e4199);};}exports[_0x0a14('0x3')]=function(_0x311e72){for(var _0x389918=0x0,_0x16ce64=events[_0x0a14('0x4')];_0x389918<_0x16ce64;_0x389918++){var _0x5f453e=events[_0x389918];var _0x68c249=createListener(_0x0a14('0x5')+_0x5f453e,_0x311e72);ChatWebsiteEvents['on'](_0x5f453e,_0x68c249);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 6cfeb60..61c0965 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 _0xe085=['getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','format','%s-%s','now','originalname','single','file','addLogo','root','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/:id','show','/:id/dispositions','isAuthenticated'];(function(_0x393795,_0x20d238){var _0xfd99fc=function(_0xf8522a){while(--_0xf8522a){_0x393795['push'](_0x393795['shift']());}};_0xfd99fc(++_0x20d238);}(_0xe085,0x86));var _0x5e08=function(_0x312302,_0x208bab){_0x312302=_0x312302-0x0;var _0x197616=_0xe085[_0x312302];return _0x197616;};'use strict';var multer=require(_0x5e08('0x0'));var util=require('util');var path=require(_0x5e08('0x1'));var timeout=require('connect-timeout');var express=require(_0x5e08('0x2'));var router=express[_0x5e08('0x3')]();var fs_extra=require(_0x5e08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e08('0x5'));var config=require(_0x5e08('0x6'));var controller=require(_0x5e08('0x7'));router[_0x5e08('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e08('0x9')]);router[_0x5e08('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x5e08('0xa'),auth['isAuthenticated'](),controller[_0x5e08('0xb')]);router['get'](_0x5e08('0xc'),auth[_0x5e08('0xd')](),controller[_0x5e08('0xe')]);router[_0x5e08('0x8')](_0x5e08('0xf'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x10')]);router['get'](_0x5e08('0x11'),controller[_0x5e08('0x12')]);router[_0x5e08('0x8')](_0x5e08('0x13'),controller[_0x5e08('0x14')]);router[_0x5e08('0x8')](_0x5e08('0x15'),controller[_0x5e08('0x16')]);router[_0x5e08('0x8')](_0x5e08('0x17'),controller[_0x5e08('0x18')]);router[_0x5e08('0x8')](_0x5e08('0x19'),auth['isAuthenticated'](),controller[_0x5e08('0x1a')]);router[_0x5e08('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x5e08('0x8')]('/:id/applications',auth[_0x5e08('0xd')](),controller[_0x5e08('0x1b')]);router['get'](_0x5e08('0x1c'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x1d')]);router[_0x5e08('0x8')](_0x5e08('0x1e'),controller[_0x5e08('0x1f')]);router[_0x5e08('0x8')](_0x5e08('0x20'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x21')]);router[_0x5e08('0x8')]('/:id/users',auth[_0x5e08('0xd')](),controller[_0x5e08('0x22')]);router[_0x5e08('0x23')]('/',auth[_0x5e08('0xd')](),controller[_0x5e08('0x24')]);router['post'](_0x5e08('0xc'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x25')]);router['post'](_0x5e08('0xf'),auth['isAuthenticated'](),controller[_0x5e08('0x26')]);var upload=multer({'storage':multer[_0x5e08('0x27')]({'destination':function(_0x3ab04d,_0x18f51b,_0xc2e2a4){_0xc2e2a4(null,path[_0x5e08('0x28')](config['root'],'server/files/images/logos/'));},'filename':function(_0x124bc1,_0xf6ec5a,_0x4b9c9b){_0x4b9c9b(null,util[_0x5e08('0x29')](_0x5e08('0x2a'),Date[_0x5e08('0x2b')](),_0xf6ec5a[_0x5e08('0x2c')]));}})});router[_0x5e08('0x23')]('/:id/logo',upload[_0x5e08('0x2d')](_0x5e08('0x2e')),controller[_0x5e08('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4eefaa,_0x2c6ecc,_0x44cb33){_0x44cb33(null,path[_0x5e08('0x28')](config[_0x5e08('0x30')],'server/files/images/avatars/'));},'filename':function(_0x2513de,_0x96b33b,_0x209afa){_0x209afa(null,util[_0x5e08('0x29')]('%s-%s',Date['now'](),_0x96b33b[_0x5e08('0x2c')]));}})});router[_0x5e08('0x23')](_0x5e08('0x13'),upload[_0x5e08('0x2d')](_0x5e08('0x2e')),controller[_0x5e08('0x31')]);var upload=multer({'storage':multer[_0x5e08('0x27')]({'destination':function(_0x189221,_0x106a9d,_0x1eb698){_0x1eb698(null,path[_0x5e08('0x28')](config['root'],_0x5e08('0x32')));},'filename':function(_0x20c3f9,_0x456800,_0x177085){_0x177085(null,util[_0x5e08('0x29')](_0x5e08('0x2a'),Date[_0x5e08('0x2b')](),_0x456800['originalname']));}})});router[_0x5e08('0x23')](_0x5e08('0x15'),upload['single'](_0x5e08('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5e08('0x27')]({'destination':function(_0x3ecf7a,_0xdeda79,_0x19f034){_0x19f034(null,path[_0x5e08('0x28')](config[_0x5e08('0x30')],_0x5e08('0x32')));},'filename':function(_0x49f383,_0x486b43,_0x6ef667){_0x6ef667(null,util['format'](_0x5e08('0x2a'),Date[_0x5e08('0x2b')](),_0x486b43[_0x5e08('0x2c')]));}})});router[_0x5e08('0x23')](_0x5e08('0x17'),upload[_0x5e08('0x2d')](_0x5e08('0x2e')),controller[_0x5e08('0x33')]);router[_0x5e08('0x23')](_0x5e08('0x34'),controller[_0x5e08('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x5e08('0x27')]({'destination':function(_0x5c2375,_0x1c0405,_0x39f881){const _0x1859be=path[_0x5e08('0x28')](config['root'],_0x5e08('0x36'),_0x5e08('0x37'),_0x5e08('0x38'));fs_extra[_0x5e08('0x39')](_0x1859be,function(){_0x39f881(null,_0x1859be);});},'filename':function(_0x1d25d5,_0x334576,_0x533650){const _0x45dfe7=_0x334576[_0x5e08('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a8de7=path[_0x5e08('0x3a')](_0x45dfe7);const _0x7a03a5=Date[_0x5e08('0x2b')]()+'-'+_0x45dfe7[_0x5e08('0x3b')](_0x4a8de7,'')+_0x4a8de7;_0x533650(null,_0x7a03a5);}})});router['post'](_0x5e08('0x3c'),offlineUploadMulter[_0x5e08('0x3d')](),controller[_0x5e08('0x3e')]);router[_0x5e08('0x23')](_0x5e08('0x19'),auth['isAuthenticated'](),controller[_0x5e08('0x3f')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x5e08('0x40')]);router[_0x5e08('0x23')](_0x5e08('0x1c'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x41')]);router[_0x5e08('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x5e08('0x42')]);router[_0x5e08('0x43')](_0x5e08('0xa'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x44')]);router['delete'](_0x5e08('0xa'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x45')]);router[_0x5e08('0x46')](_0x5e08('0xc'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x47')]);router[_0x5e08('0x46')](_0x5e08('0xf'),auth[_0x5e08('0xd')](),controller[_0x5e08('0x48')]);router[_0x5e08('0x46')]('/:id/users',auth[_0x5e08('0xd')](),controller[_0x5e08('0x49')]);module['exports']=router;
\ No newline at end of file
+var _0x3eb6=['get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','single','file','join','root','server/files/images/avatars/','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addApplications','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','describe'];(function(_0x574475,_0x3370f6){var _0x2e78fe=function(_0x2d079c){while(--_0x2d079c){_0x574475['push'](_0x574475['shift']());}};_0x2e78fe(++_0x3370f6);}(_0x3eb6,0xcb));var _0x63eb=function(_0x4f7014,_0x3649ef){_0x4f7014=_0x4f7014-0x0;var _0x8fa130=_0x3eb6[_0x4f7014];return _0x8fa130;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x63eb('0x0'));var express=require(_0x63eb('0x1'));var router=express[_0x63eb('0x2')]();var fs_extra=require(_0x63eb('0x3'));var auth=require(_0x63eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x63eb('0x5'));var controller=require(_0x63eb('0x6'));router['get']('/',auth[_0x63eb('0x7')](),controller['index']);router['get'](_0x63eb('0x8'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x9')]);router[_0x63eb('0xa')]('/:id',auth[_0x63eb('0x7')](),controller[_0x63eb('0xb')]);router[_0x63eb('0xa')](_0x63eb('0xc'),auth[_0x63eb('0x7')](),controller[_0x63eb('0xd')]);router['get'](_0x63eb('0xe'),auth[_0x63eb('0x7')](),controller[_0x63eb('0xf')]);router[_0x63eb('0xa')](_0x63eb('0x10'),controller[_0x63eb('0x11')]);router[_0x63eb('0xa')]('/:id/avatar',controller['getAvatar']);router['get']('/:id/customer_avatar',controller[_0x63eb('0x12')]);router[_0x63eb('0xa')](_0x63eb('0x13'),controller['getSystemAvatar']);router['get'](_0x63eb('0x14'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x15')]);router[_0x63eb('0xa')](_0x63eb('0x16'),controller[_0x63eb('0x17')]);router[_0x63eb('0xa')]('/:id/applications',auth[_0x63eb('0x7')](),controller[_0x63eb('0x18')]);router[_0x63eb('0xa')](_0x63eb('0x19'),auth[_0x63eb('0x7')](),controller['getProactiveActions']);router[_0x63eb('0xa')](_0x63eb('0x1a'),controller[_0x63eb('0x1b')]);router[_0x63eb('0xa')](_0x63eb('0x1c'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x1d')]);router[_0x63eb('0xa')](_0x63eb('0x1e'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x1f')]);router[_0x63eb('0x20')]('/',auth[_0x63eb('0x7')](),controller['create']);router[_0x63eb('0x20')](_0x63eb('0xc'),auth['isAuthenticated'](),controller[_0x63eb('0x21')]);router['post'](_0x63eb('0xe'),auth['isAuthenticated'](),controller[_0x63eb('0x22')]);var upload=multer({'storage':multer[_0x63eb('0x23')]({'destination':function(_0x391c6d,_0x444620,_0x23843a){_0x23843a(null,path['join'](config['root'],_0x63eb('0x24')));},'filename':function(_0x17a16c,_0x47e02d,_0x4e70d6){_0x4e70d6(null,util[_0x63eb('0x25')](_0x63eb('0x26'),Date[_0x63eb('0x27')](),_0x47e02d['originalname']));}})});router['post']('/:id/logo',upload[_0x63eb('0x28')](_0x63eb('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x63eb('0x23')]({'destination':function(_0x375594,_0x216564,_0xb0120c){_0xb0120c(null,path[_0x63eb('0x2a')](config[_0x63eb('0x2b')],_0x63eb('0x2c')));},'filename':function(_0xbd593c,_0x141f51,_0x2a7aaf){_0x2a7aaf(null,util[_0x63eb('0x25')](_0x63eb('0x26'),Date[_0x63eb('0x27')](),_0x141f51[_0x63eb('0x2d')]));}})});router[_0x63eb('0x20')](_0x63eb('0x2e'),upload['single'](_0x63eb('0x29')),controller[_0x63eb('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fb043,_0x2b4363,_0x8416f1){_0x8416f1(null,path[_0x63eb('0x2a')](config[_0x63eb('0x2b')],_0x63eb('0x2c')));},'filename':function(_0x429ff9,_0x3d2651,_0x4e6081){_0x4e6081(null,util[_0x63eb('0x25')](_0x63eb('0x26'),Date[_0x63eb('0x27')](),_0x3d2651[_0x63eb('0x2d')]));}})});router[_0x63eb('0x20')](_0x63eb('0x30'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x63eb('0x23')]({'destination':function(_0x534842,_0x846939,_0x114e26){_0x114e26(null,path['join'](config['root'],_0x63eb('0x2c')));},'filename':function(_0x13a1e9,_0x22dfaf,_0x550694){_0x550694(null,util[_0x63eb('0x25')]('%s-%s',Date[_0x63eb('0x27')](),_0x22dfaf[_0x63eb('0x2d')]));}})});router[_0x63eb('0x20')](_0x63eb('0x13'),upload['single'](_0x63eb('0x29')),controller[_0x63eb('0x31')]);router[_0x63eb('0x20')](_0x63eb('0x32'),controller[_0x63eb('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x24a422,_0x33183c,_0x5519a3){const _0x20396e=path[_0x63eb('0x2a')](config['root'],_0x63eb('0x34'),_0x63eb('0x35'),_0x63eb('0x36'));fs_extra[_0x63eb('0x37')](_0x20396e,function(){_0x5519a3(null,_0x20396e);});},'filename':function(_0xe588da,_0x429a80,_0x43544c){const _0x54fb6a=_0x429a80[_0x63eb('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x16b003=path[_0x63eb('0x38')](_0x54fb6a);const _0x35a999=Date[_0x63eb('0x27')]()+'-'+_0x54fb6a[_0x63eb('0x39')](_0x16b003,'')+_0x16b003;_0x43544c(null,_0x35a999);}})});router[_0x63eb('0x20')](_0x63eb('0x3a'),offlineUploadMulter[_0x63eb('0x3b')](),controller[_0x63eb('0x3c')]);router[_0x63eb('0x20')]('/:id/interactions',auth[_0x63eb('0x7')](),controller['addInteraction']);router[_0x63eb('0x20')]('/:id/applications',auth['isAuthenticated'](),controller[_0x63eb('0x3d')]);router[_0x63eb('0x20')](_0x63eb('0x19'),auth[_0x63eb('0x7')](),controller['addProactiveActions']);router['post'](_0x63eb('0x1e'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x3e')]);router[_0x63eb('0x3f')](_0x63eb('0x40'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x41')]);router[_0x63eb('0x42')](_0x63eb('0x40'),auth[_0x63eb('0x7')](),controller['destroy']);router[_0x63eb('0x42')](_0x63eb('0xc'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x43')]);router[_0x63eb('0x42')](_0x63eb('0xe'),auth[_0x63eb('0x7')](),controller[_0x63eb('0x44')]);router['delete'](_0x63eb('0x1e'),auth['isAuthenticated'](),controller[_0x63eb('0x45')]);module[_0x63eb('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5206dfa..86007d5 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 _0xe2fe=['Google','STRING','sequelize','ENUM'];(function(_0x16a58f,_0x27c24d){var _0x24afb4=function(_0x462a80){while(--_0x462a80){_0x16a58f['push'](_0x16a58f['shift']());}};_0x24afb4(++_0x27c24d);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xee2f('0x1')]('AmazonAWS',_0xee2f('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xee2f('0x3')]},'data2':{'type':Sequelize[_0xee2f('0x3')]}};
\ No newline at end of file
+var _0x5a5a=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x202f99,_0x5f1897){_0x202f99=_0x202f99-0x0;var _0x44c111=_0x5a5a[_0x202f99];return _0x44c111;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'name':{'type':Sequelize[_0xa5a5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa5a5('0x2')](_0xa5a5('0x3'),_0xa5a5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xa5a5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index de1fd8f..7f16dd6 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x19d0d0,_0x580bf5){var _0xc23db3=function(_0x360119){while(--_0x360119){_0x19d0d0['push'](_0x19d0d0['shift']());}};_0xc23db3(++_0x580bf5);}(_0xdb28,0x106));var _0x8db2=function(_0x399d1f,_0x4d1563){_0x399d1f=_0x399d1f-0x0;var _0x11d481=_0xdb28[_0x399d1f];return _0x11d481;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
+var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x520fbd,_0x22269f){var _0x2830bc=function(_0x2ec1af){while(--_0x2ec1af){_0x520fbd['push'](_0x520fbd['shift']());}};_0x2830bc(++_0x22269f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5540f28..13e530a 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 _0xb749=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','path','rimraf','exports'];(function(_0x1ad93b,_0x56bee2){var _0x5c83a3=function(_0x425765){while(--_0x425765){_0x1ad93b['push'](_0x1ad93b['shift']());}};_0x5c83a3(++_0x56bee2);}(_0xb749,0xd5));var _0x9b74=function(_0x53c52d,_0x207d70){_0x53c52d=_0x53c52d-0x0;var _0x4e6598=_0xb749[_0x53c52d];return _0x4e6598;};'use strict';var _=require(_0x9b74('0x0'));var util=require(_0x9b74('0x1'));var logger=require(_0x9b74('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b74('0x4'));var rimraf=require(_0x9b74('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x9b74('0x6')]=function(_0x4ea1b5,_0x477add){return _0x4ea1b5[_0x9b74('0x7')](_0x9b74('0x8'),attributes,{'tableName':_0x9b74('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x905a=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x184be6,_0x5435fd){var _0x1212cb=function(_0x25228c){while(--_0x25228c){_0x184be6['push'](_0x184be6['shift']());}};_0x1212cb(++_0x5435fd);}(_0x905a,0xb9));var _0xa905=function(_0x40b1f0,_0x4fa792){_0x40b1f0=_0x40b1f0-0x0;var _0x174263=_0x905a[_0x40b1f0];return _0x174263;};'use strict';var _=require(_0xa905('0x0'));var util=require(_0xa905('0x1'));var logger=require(_0xa905('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa905('0x3'));var rp=require(_0xa905('0x4'));var fs=require('fs');var path=require(_0xa905('0x5'));var rimraf=require(_0xa905('0x6'));var config=require(_0xa905('0x7'));var attributes=require(_0xa905('0x8'));module[_0xa905('0x9')]=function(_0x11e68e,_0x228f75){return _0x11e68e[_0xa905('0xa')](_0xa905('0xb'),attributes,{'tableName':_0xa905('0xc'),'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 d28adee..d64acfd 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 _0x4d5a=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x342e2d,_0x4a4f2b){var _0x20f148=function(_0x22443a){while(--_0x22443a){_0x342e2d['push'](_0x342e2d['shift']());}};_0x20f148(++_0x4a4f2b);}(_0x4d5a,0x15e));var _0xa4d5=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4d5a[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var moment=require(_0xa4d5('0x1'));var BPromise=require(_0xa4d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x3'));var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require(_0xa4d5('0x6'))('rpc');var config=require(_0xa4d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856aa,_0x166db3,_0x318315){return new BPromise(function(_0x408db0,_0x3bed6b){return client[_0xa4d5('0x9')](_0x1856aa,_0x318315)['then'](function(_0x5586de){logger[_0xa4d5('0xa')](_0xa4d5('0xb'),_0x166db3,_0xa4d5('0xc'));logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x166db3,_0xa4d5('0xc'),JSON[_0xa4d5('0xf')](_0x5586de));if(_0x5586de[_0xa4d5('0x10')]){if(_0x5586de['error']['code']===0x1f4){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x3bed6b(_0x5586de['error']['message']);}logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x408db0(_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x166db3,_0xa4d5('0xc'));_0x408db0(_0x5586de[_0xa4d5('0x12')]['message']);}})[_0xa4d5('0x13')](function(_0x31eed7){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x31eed7);_0x3bed6b(_0x31eed7);});});}
\ No newline at end of file
+var _0x707d=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5b808b,_0x23089e){var _0xc3b25=function(_0x47fca4){while(--_0x47fca4){_0x5b808b['push'](_0x5b808b['shift']());}};_0xc3b25(++_0x23089e);}(_0x707d,0x18b));var _0xd707=function(_0x3ab55e,_0xe34fb9){_0x3ab55e=_0x3ab55e-0x0;var _0x8a25bf=_0x707d[_0x3ab55e];return _0x8a25bf;};'use strict';var _=require(_0xd707('0x0'));var util=require(_0xd707('0x1'));var moment=require(_0xd707('0x2'));var BPromise=require(_0xd707('0x3'));var rs=require(_0xd707('0x4'));var fs=require('fs');var Redis=require(_0xd707('0x5'));var db=require(_0xd707('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd707('0x7'))(_0xd707('0x8'));var config=require(_0xd707('0x9'));var jayson=require(_0xd707('0xa'));var client=jayson['client'][_0xd707('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3de790,_0x5661e6,_0x4af63f){return new BPromise(function(_0xf596b4,_0x11edc8){return client['request'](_0x3de790,_0x4af63f)[_0xd707('0xc')](function(_0x249b0d){logger['info'](_0xd707('0xd'),_0x5661e6,_0xd707('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'),JSON[_0xd707('0xf')](_0x249b0d));if(_0x249b0d[_0xd707('0x10')]){if(_0x249b0d['error'][_0xd707('0x11')]===0x1f4){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x249b0d['error']['message']);return _0x11edc8(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}logger['error'](_0xd707('0xd'),_0x5661e6,_0x249b0d[_0xd707('0x10')]['message']);return _0xf596b4(_0x249b0d[_0xd707('0x10')][_0xd707('0x12')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x5661e6,_0xd707('0xe'));_0xf596b4(_0x249b0d['result'][_0xd707('0x12')]);}})[_0xd707('0x13')](function(_0x479aea){logger[_0xd707('0x10')](_0xd707('0xd'),_0x5661e6,_0x479aea);_0x11edc8(_0x479aea);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f778a1e..91c6d30 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 _0xdc6f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x3d8163,_0x5470c4){_0x3d8163=_0x3d8163-0x0;var _0x49db86=_0xdc6f[_0x3d8163];return _0x49db86;};'use strict';var multer=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var path=require(_0xfdc6('0x2'));var timeout=require(_0xfdc6('0x3'));var express=require(_0xfdc6('0x4'));var router=express[_0xfdc6('0x5')]();var fs_extra=require(_0xfdc6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfdc6('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0xfdc6('0x8')](),controller[_0xfdc6('0x9')]);router[_0xfdc6('0xa')]('/:id',auth[_0xfdc6('0x8')](),controller[_0xfdc6('0xb')]);router[_0xfdc6('0xc')]('/',auth[_0xfdc6('0x8')](),controller[_0xfdc6('0xd')]);router[_0xfdc6('0xe')](_0xfdc6('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfdc6('0xf'),auth[_0xfdc6('0x8')](),controller[_0xfdc6('0x10')]);module[_0xfdc6('0x11')]=router;
\ No newline at end of file
+var _0x8654=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','util','path'];(function(_0x1bb80c,_0x26d406){var _0x368f16=function(_0x4e37e5){while(--_0x4e37e5){_0x1bb80c['push'](_0x1bb80c['shift']());}};_0x368f16(++_0x26d406);}(_0x8654,0xfa));var _0x4865=function(_0x397488,_0x3cff58){_0x397488=_0x397488-0x0;var _0x3e3608=_0x8654[_0x397488];return _0x3e3608;};'use strict';var multer=require('multer');var util=require(_0x4865('0x0'));var path=require(_0x4865('0x1'));var timeout=require(_0x4865('0x2'));var express=require(_0x4865('0x3'));var router=express[_0x4865('0x4')]();var fs_extra=require(_0x4865('0x5'));var auth=require(_0x4865('0x6'));var interaction=require(_0x4865('0x7'));var config=require(_0x4865('0x8'));var controller=require(_0x4865('0x9'));router['get']('/',auth[_0x4865('0xa')](),controller[_0x4865('0xb')]);router[_0x4865('0xc')](_0x4865('0xd'),auth['isAuthenticated'](),controller[_0x4865('0xe')]);router[_0x4865('0xf')]('/',auth[_0x4865('0xa')](),controller[_0x4865('0x10')]);router[_0x4865('0x11')](_0x4865('0xd'),auth[_0x4865('0xa')](),controller[_0x4865('0x12')]);router['delete'](_0x4865('0xd'),auth[_0x4865('0xa')](),controller[_0x4865('0x13')]);module[_0x4865('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index bda1895..1261f59 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 _0x3bca=['exports','STRING','name'];(function(_0x18b344,_0x271f68){var _0x5ef6bb=function(_0x3345b3){while(--_0x3345b3){_0x18b344['push'](_0x18b344['shift']());}};_0x5ef6bb(++_0x271f68);}(_0x3bca,0x1d1));var _0xa3bc=function(_0x18690a,_0x28c3f2){_0x18690a=_0x18690a-0x0;var _0x5e2cba=_0x3bca[_0x18690a];return _0x5e2cba;};'use strict';var Sequelize=require('sequelize');module[_0xa3bc('0x0')]={'name':{'type':Sequelize[_0xa3bc('0x1')],'unique':_0xa3bc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa3bc('0x1')]},'companyId':{'type':Sequelize[_0xa3bc('0x1')]},'website':{'type':Sequelize[_0xa3bc('0x1')]},'phone':{'type':Sequelize[_0xa3bc('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa3bc('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa3bc('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa3bc('0x1')]},'email':{'type':Sequelize[_0xa3bc('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa3bc('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xa3bc('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xa3bc('0x1')]},'description':{'type':Sequelize[_0xa3bc('0x1')]}};
\ No newline at end of file
+var _0x903b=['STRING'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x903b,0x104));var _0xb903=function(_0x26045e,_0x2723f9){_0x26045e=_0x26045e-0x0;var _0x13483e=_0x903b[_0x26045e];return _0x13483e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb903('0x0')]},'companyId':{'type':Sequelize[_0xb903('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb903('0x0')]},'type':{'type':Sequelize[_0xb903('0x0')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb903('0x0')]},'city':{'type':Sequelize[_0xb903('0x0')]},'country':{'type':Sequelize[_0xb903('0x0')]},'email':{'type':Sequelize[_0xb903('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb903('0x0')]},'sCity':{'type':Sequelize[_0xb903('0x0')]},'sCountry':{'type':Sequelize[_0xb903('0x0')]},'description':{'type':Sequelize[_0xb903('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 4875258..51638f8 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 _0x50c8=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','stack','send','CmCompany','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','ids','getContacts','findOne','CmContact','rawAttributes','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x14041e,_0x4ce45d){var _0x4105ff=function(_0x10f92d){while(--_0x10f92d){_0x14041e['push'](_0x14041e['shift']());}};_0x4105ff(++_0x4ce45d);}(_0x50c8,0x1e9));var _0x850c=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x50c8[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x850c('0x0'));var jsonpatch=require(_0x850c('0x1'));var rp=require(_0x850c('0x2'));var moment=require('moment');var BPromise=require(_0x850c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x850c('0x4'));var csv=require('to-csv');var ejs=require(_0x850c('0x5'));var fs=require('fs');var fs_extra=require(_0x850c('0x6'));var _=require(_0x850c('0x7'));var squel=require(_0x850c('0x8'));var crypto=require(_0x850c('0x9'));var jsforce=require(_0x850c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x850c('0xb'));var querystring=require(_0x850c('0xc'));var Papa=require(_0x850c('0xd'));var Redis=require('ioredis');var authService=require(_0x850c('0xe'));var qs=require(_0x850c('0xf'));var as=require(_0x850c('0x10'));var hardwareService=require(_0x850c('0x11'));var logger=require(_0x850c('0x12'))(_0x850c('0x13'));var utils=require(_0x850c('0x14'));var config=require(_0x850c('0x15'));var licenseUtil=require(_0x850c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e839c,_0x28c609){_0x28c609=_0x28c609||0xcc;return function(_0x9a6642){if(_0x9a6642){return _0x4e839c[_0x850c('0x17')](_0x28c609);}return _0x4e839c[_0x850c('0x18')](_0x28c609)[_0x850c('0x19')]();};}function respondWithResult(_0x37be80,_0x383513){_0x383513=_0x383513||0xc8;return function(_0x255853){if(_0x255853){return _0x37be80[_0x850c('0x18')](_0x383513)[_0x850c('0x1a')](_0x255853);}};}function respondWithFilteredResult(_0xc3baca,_0x40fe2b){return function(_0x3e8d6f){if(_0x3e8d6f){var _0x350377=typeof _0x40fe2b['offset']===_0x850c('0x1b')&&typeof _0x40fe2b['limit']===_0x850c('0x1b');var _0x2df1fd=_0x3e8d6f[_0x850c('0x1c')];var _0x33f552=_0x350377?0x0:_0x40fe2b['offset'];var _0x3ca760=_0x350377?_0x3e8d6f[_0x850c('0x1c')]:_0x40fe2b[_0x850c('0x1d')]+_0x40fe2b['limit'];var _0x2b35cc;if(_0x3ca760>=_0x2df1fd){_0x3ca760=_0x2df1fd;_0x2b35cc=0xc8;}else{_0x2b35cc=0xce;}_0xc3baca[_0x850c('0x18')](_0x2b35cc);return _0xc3baca[_0x850c('0x1e')](_0x850c('0x1f'),_0x33f552+'-'+_0x3ca760+'/'+_0x2df1fd)[_0x850c('0x1a')](_0x3e8d6f);}return null;};}function patchUpdates(_0x2e2d9e){return function(_0x3f1971){try{jsonpatch[_0x850c('0x20')](_0x3f1971,_0x2e2d9e,!![]);}catch(_0x6bab18){return BPromise[_0x850c('0x21')](_0x6bab18);}return _0x3f1971[_0x850c('0x22')]();};}function saveUpdates(_0x49917d,_0x586be0){return function(_0x42ea74){if(_0x42ea74){return _0x42ea74[_0x850c('0x23')](_0x49917d)[_0x850c('0x24')](function(_0x2add8e){return _0x2add8e;});}return null;};}function removeEntity(_0x3e4876,_0x2e276d){return function(_0x3ae861){if(_0x3ae861){return _0x3ae861[_0x850c('0x25')]()[_0x850c('0x24')](function(){var _0x52167f=_0x3ae861['get']({'plain':!![]});var _0x44fe89=_0x850c('0x26');return db[_0x850c('0x27')][_0x850c('0x25')]({'where':{'type':_0x44fe89,'resourceId':_0x52167f['id']}})['then'](function(){return _0x3ae861;});})['then'](function(){_0x3e4876[_0x850c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eaf8f,_0x2d4cf9){return function(_0x62b093){if(!_0x62b093){_0x2eaf8f[_0x850c('0x17')](0x194);}return _0x62b093;};}function handleError(_0x2239a6,_0x52e11e){_0x52e11e=_0x52e11e||0x1f4;return function(_0x31ff53){logger['error'](_0x31ff53[_0x850c('0x28')]);if(_0x31ff53['name']){delete _0x31ff53['name'];}_0x2239a6[_0x850c('0x18')](_0x52e11e)[_0x850c('0x29')](_0x31ff53);};}exports['index']=function(_0x49904b,_0x59e090){var _0x321297={},_0x3eaf71={},_0x31df72={'count':0x0,'rows':[]};return db[_0x850c('0x2a')]['describe']()['then'](function(_0x42f691){_0x3eaf71['model']=_[_0x850c('0x2b')](_0x42f691);_0x3eaf71[_0x850c('0x2c')]=_[_0x850c('0x2b')](_0x49904b[_0x850c('0x2c')]);_0x3eaf71['filters']=_[_0x850c('0x2d')](_0x3eaf71['model'],_0x3eaf71[_0x850c('0x2c')]);_0x321297[_0x850c('0x2e')]=_[_0x850c('0x2d')](_0x3eaf71[_0x850c('0x2f')],qs[_0x850c('0x30')](_0x49904b['query']['fields']));_0x321297['attributes']=_0x321297[_0x850c('0x2e')][_0x850c('0x31')]?_0x321297[_0x850c('0x2e')]:_0x3eaf71[_0x850c('0x2f')];if(!_0x49904b[_0x850c('0x2c')][_0x850c('0x32')](_0x850c('0x33'))){_0x321297[_0x850c('0x34')]=qs[_0x850c('0x34')](_0x49904b[_0x850c('0x2c')][_0x850c('0x34')]);_0x321297[_0x850c('0x1d')]=qs[_0x850c('0x1d')](_0x49904b[_0x850c('0x2c')]['offset']);}_0x321297[_0x850c('0x35')]=qs[_0x850c('0x36')](_0x49904b[_0x850c('0x2c')]['sort']);_0x321297[_0x850c('0x37')]=qs[_0x850c('0x38')](_[_0x850c('0x39')](_0x49904b['query'],_0x3eaf71[_0x850c('0x38')]),_0x42f691);if(_0x49904b[_0x850c('0x2c')][_0x850c('0x3a')]){_0x321297[_0x850c('0x37')]=_[_0x850c('0x3b')](_0x321297[_0x850c('0x37')],{'$or':_[_0x850c('0x3c')](_0x321297['attributes'],function(_0x52f761){var _0x529433={};_0x529433[_0x52f761]={'$like':'%'+_0x49904b['query'][_0x850c('0x3a')]+'%'};return _0x529433;})});}_0x321297=_[_0x850c('0x3b')]({},_0x321297,_0x49904b[_0x850c('0x3d')]);var _0x5ad235={'where':_0x321297[_0x850c('0x37')]};return db[_0x850c('0x2a')][_0x850c('0x1c')](_0x5ad235)[_0x850c('0x24')](function(_0xd94eb7){_0x31df72[_0x850c('0x1c')]=_0xd94eb7;if(_0x49904b[_0x850c('0x2c')][_0x850c('0x3e')]){_0x321297[_0x850c('0x3f')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x321297);})[_0x850c('0x24')](function(_0x1b8288){_0x31df72[_0x850c('0x40')]=_0x1b8288;return _0x31df72;})[_0x850c('0x24')](respondWithFilteredResult(_0x59e090,_0x321297))['catch'](handleError(_0x59e090,null));})[_0x850c('0x41')](handleError(_0x59e090,null));};exports[_0x850c('0x42')]=function(_0x41993d,_0x2da730){var _0x5ec079={'raw':![],'where':{'id':_0x41993d['params']['id']}},_0x52662f={};_0x52662f['model']=_[_0x850c('0x2b')](db[_0x850c('0x2a')]['rawAttributes']);_0x52662f[_0x850c('0x2c')]=_[_0x850c('0x2b')](_0x41993d[_0x850c('0x2c')]);_0x52662f[_0x850c('0x38')]=_[_0x850c('0x2d')](_0x52662f[_0x850c('0x2f')],_0x52662f[_0x850c('0x2c')]);_0x5ec079[_0x850c('0x2e')]=_[_0x850c('0x2d')](_0x52662f[_0x850c('0x2f')],qs[_0x850c('0x30')](_0x41993d[_0x850c('0x2c')]['fields']));_0x5ec079['attributes']=_0x5ec079[_0x850c('0x2e')][_0x850c('0x31')]?_0x5ec079[_0x850c('0x2e')]:_0x52662f[_0x850c('0x2f')];if(_0x41993d['query']['includeAll']){_0x5ec079['include']=[{'all':!![]}];}_0x5ec079=_[_0x850c('0x3b')]({},_0x5ec079,_0x41993d[_0x850c('0x3d')]);return db[_0x850c('0x2a')][_0x850c('0x43')](_0x5ec079)[_0x850c('0x24')](handleEntityNotFound(_0x2da730,null))['then'](respondWithResult(_0x2da730,null))['catch'](handleError(_0x2da730,null));};exports[_0x850c('0x44')]=function(_0xa4173e,_0x433a46){return db[_0x850c('0x2a')][_0x850c('0x44')](_0xa4173e[_0x850c('0x45')],{})[_0x850c('0x24')](function(_0x34695c){var _0x597ba9=_0xa4173e[_0x850c('0x46')]['get']({'plain':!![]});if(!_0x597ba9)throw new Error(_0x850c('0x47'));if(_0x597ba9[_0x850c('0x48')]===_0x850c('0x46')){var _0x5e2e67=_0x34695c['get']({'plain':!![]});var _0x3f1c97=_0x850c('0x26');return db['UserProfileSection'][_0x850c('0x43')]({'where':{'name':_0x3f1c97,'userProfileId':_0x597ba9[_0x850c('0x49')]},'raw':!![]})['then'](function(_0x27fba5){if(_0x27fba5&&_0x27fba5['autoAssociation']===0x0){return db[_0x850c('0x27')]['create']({'name':_0x5e2e67[_0x850c('0x4a')],'resourceId':_0x5e2e67['id'],'type':_0x27fba5[_0x850c('0x4a')],'sectionId':_0x27fba5['id']},{})[_0x850c('0x24')](function(){return _0x34695c;});}else{return _0x34695c;}})[_0x850c('0x41')](function(_0x5c51af){logger[_0x850c('0x4b')](_0x850c('0x4c'),_0x5c51af);throw _0x5c51af;});}return _0x34695c;})[_0x850c('0x24')](respondWithResult(_0x433a46,0xc9))[_0x850c('0x41')](handleError(_0x433a46,null));};exports['update']=function(_0x1f4a56,_0x1dac93){if(_0x1f4a56[_0x850c('0x45')]['id']){delete _0x1f4a56[_0x850c('0x45')]['id'];}return db['CmCompany'][_0x850c('0x43')]({'where':{'id':_0x1f4a56['params']['id']}})[_0x850c('0x24')](handleEntityNotFound(_0x1dac93,null))[_0x850c('0x24')](saveUpdates(_0x1f4a56[_0x850c('0x45')],null))[_0x850c('0x24')](respondWithResult(_0x1dac93,null))[_0x850c('0x41')](handleError(_0x1dac93,null));};exports[_0x850c('0x25')]=function(_0x3875c3,_0x551250){return db[_0x850c('0x2a')]['find']({'where':{'id':_0x3875c3[_0x850c('0x4d')]['id']}})[_0x850c('0x24')](handleEntityNotFound(_0x551250,null))[_0x850c('0x24')](removeEntity(_0x551250,null))[_0x850c('0x41')](handleError(_0x551250,null));};exports[_0x850c('0x4e')]=function(_0x31b1b3,_0x46f01d){return db[_0x850c('0x2a')]['describe']()['then'](respondWithResult(_0x46f01d,null))[_0x850c('0x41')](handleError(_0x46f01d,null));};exports[_0x850c('0x4f')]=function(_0x15e31e,_0x2ae8eb,_0x26155a){return db['CmContact'][_0x850c('0x43')]({'where':{'id':_0x15e31e[_0x850c('0x4d')]['id']}})[_0x850c('0x24')](handleEntityNotFound(_0x2ae8eb,null))[_0x850c('0x24')](function(_0x5bdf9f){if(_0x5bdf9f){return _0x5bdf9f[_0x850c('0x4f')](_0x15e31e['body'][_0x850c('0x50')],_['omit'](_0x15e31e[_0x850c('0x45')],[_0x850c('0x50'),'id'])||{});}})[_0x850c('0x24')](respondWithResult(_0x2ae8eb,null))[_0x850c('0x41')](handleError(_0x2ae8eb,null));};exports[_0x850c('0x51')]=function(_0x3f140d,_0x45f46c,_0x1ee498){var _0xc043f7={};var _0x16bd28={};var _0xf1ac7c;var _0x4aa2f2;return db[_0x850c('0x2a')][_0x850c('0x52')]({'where':{'id':_0x3f140d[_0x850c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x45f46c,null))[_0x850c('0x24')](function(_0x1090f0){if(_0x1090f0){_0xf1ac7c=_0x1090f0;_0x16bd28[_0x850c('0x2f')]=_['keys'](db[_0x850c('0x53')][_0x850c('0x54')]);_0x16bd28[_0x850c('0x2c')]=_[_0x850c('0x2b')](_0x3f140d[_0x850c('0x2c')]);_0x16bd28['filters']=_[_0x850c('0x2d')](_0x16bd28[_0x850c('0x2f')],_0x16bd28['query']);_0xc043f7[_0x850c('0x2e')]=_[_0x850c('0x2d')](_0x16bd28[_0x850c('0x2f')],qs[_0x850c('0x30')](_0x3f140d[_0x850c('0x2c')][_0x850c('0x30')]));_0xc043f7['attributes']=_0xc043f7[_0x850c('0x2e')][_0x850c('0x31')]?_0xc043f7['attributes']:_0x16bd28['model'];_0xc043f7['order']=qs[_0x850c('0x36')](_0x3f140d[_0x850c('0x2c')][_0x850c('0x36')]);_0xc043f7[_0x850c('0x37')]=qs[_0x850c('0x38')](_[_0x850c('0x39')](_0x3f140d['query'],_0x16bd28[_0x850c('0x38')]));if(_0x3f140d[_0x850c('0x2c')]['filter']){_0xc043f7['where']=_[_0x850c('0x3b')](_0xc043f7['where'],{'$or':_[_0x850c('0x3c')](_0xc043f7[_0x850c('0x2e')],function(_0x2940e4){var _0xef4e60={};_0xef4e60[_0x2940e4]={'$like':'%'+_0x3f140d[_0x850c('0x2c')]['filter']+'%'};return _0xef4e60;})});}_0xc043f7=_['merge']({},_0xc043f7,_0x3f140d['options']);return _0xf1ac7c[_0x850c('0x51')](_0xc043f7);}})[_0x850c('0x24')](function(_0x2b0dc8){if(_0x2b0dc8){_0x4aa2f2=_0x2b0dc8[_0x850c('0x31')];if(!_0x3f140d['query'][_0x850c('0x32')](_0x850c('0x33'))){_0xc043f7[_0x850c('0x34')]=qs[_0x850c('0x34')](_0x3f140d['query']['limit']);_0xc043f7[_0x850c('0x1d')]=qs[_0x850c('0x1d')](_0x3f140d['query'][_0x850c('0x1d')]);}return _0xf1ac7c[_0x850c('0x51')](_0xc043f7);}})[_0x850c('0x24')](function(_0x44ccb3){if(_0x44ccb3){return _0x44ccb3?{'count':_0x4aa2f2,'rows':_0x44ccb3}:null;}})[_0x850c('0x24')](respondWithResult(_0x45f46c,null))[_0x850c('0x41')](handleError(_0x45f46c,null));};
\ No newline at end of file
+var _0xc0fc=['undefined','count','limit','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','CmCompany','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','order','pick','map','getContacts','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3d94ea,_0x43066f){var _0x2b7615=function(_0x563eda){while(--_0x563eda){_0x3d94ea['push'](_0x3d94ea['shift']());}};_0x2b7615(++_0x43066f);}(_0xc0fc,0xef));var _0xcc0f=function(_0x400b71,_0x416c4a){_0x400b71=_0x400b71-0x0;var _0x2ee694=_0xc0fc[_0x400b71];return _0x2ee694;};'use strict';var emlformat=require(_0xcc0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc0f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc0f('0x2'));var moment=require(_0xcc0f('0x3'));var BPromise=require(_0xcc0f('0x4'));var Mustache=require(_0xcc0f('0x5'));var util=require(_0xcc0f('0x6'));var path=require(_0xcc0f('0x7'));var sox=require(_0xcc0f('0x8'));var csv=require(_0xcc0f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc0f('0xa'));var _=require(_0xcc0f('0xb'));var squel=require(_0xcc0f('0xc'));var crypto=require('crypto');var jsforce=require(_0xcc0f('0xd'));var deskjs=require(_0xcc0f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcc0f('0xf'));var Papa=require(_0xcc0f('0x10'));var Redis=require(_0xcc0f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcc0f('0x12'));var hardwareService=require(_0xcc0f('0x13'));var logger=require(_0xcc0f('0x14'))(_0xcc0f('0x15'));var utils=require(_0xcc0f('0x16'));var config=require(_0xcc0f('0x17'));var licenseUtil=require(_0xcc0f('0x18'));var db=require(_0xcc0f('0x19'))['db'];function respondWithStatusCode(_0x29b99e,_0x557cd7){_0x557cd7=_0x557cd7||0xcc;return function(_0x36ae8c){if(_0x36ae8c){return _0x29b99e[_0xcc0f('0x1a')](_0x557cd7);}return _0x29b99e[_0xcc0f('0x1b')](_0x557cd7)[_0xcc0f('0x1c')]();};}function respondWithResult(_0x634829,_0x32a06b){_0x32a06b=_0x32a06b||0xc8;return function(_0x171d69){if(_0x171d69){return _0x634829['status'](_0x32a06b)[_0xcc0f('0x1d')](_0x171d69);}};}function respondWithFilteredResult(_0x411bfd,_0xb42803){return function(_0x180743){if(_0x180743){var _0x2917c5=typeof _0xb42803[_0xcc0f('0x1e')]==='undefined'&&typeof _0xb42803['limit']===_0xcc0f('0x1f');var _0x1a1110=_0x180743[_0xcc0f('0x20')];var _0x5526d4=_0x2917c5?0x0:_0xb42803[_0xcc0f('0x1e')];var _0x545eaf=_0x2917c5?_0x180743[_0xcc0f('0x20')]:_0xb42803[_0xcc0f('0x1e')]+_0xb42803[_0xcc0f('0x21')];var _0x416a3c;if(_0x545eaf>=_0x1a1110){_0x545eaf=_0x1a1110;_0x416a3c=0xc8;}else{_0x416a3c=0xce;}_0x411bfd[_0xcc0f('0x1b')](_0x416a3c);return _0x411bfd[_0xcc0f('0x22')]('Content-Range',_0x5526d4+'-'+_0x545eaf+'/'+_0x1a1110)['json'](_0x180743);}return null;};}function patchUpdates(_0x24cbbf){return function(_0x2f17a5){try{jsonpatch[_0xcc0f('0x23')](_0x2f17a5,_0x24cbbf,!![]);}catch(_0x315d72){return BPromise[_0xcc0f('0x24')](_0x315d72);}return _0x2f17a5[_0xcc0f('0x25')]();};}function saveUpdates(_0x590b25,_0x59793f){return function(_0x1b2fe9){if(_0x1b2fe9){return _0x1b2fe9['update'](_0x590b25)[_0xcc0f('0x26')](function(_0x31885c){return _0x31885c;});}return null;};}function removeEntity(_0x49d58d,_0x4a58cd){return function(_0x5a7cc6){if(_0x5a7cc6){return _0x5a7cc6[_0xcc0f('0x27')]()['then'](function(){var _0x2232c2=_0x5a7cc6[_0xcc0f('0x28')]({'plain':!![]});var _0x508055=_0xcc0f('0x29');return db[_0xcc0f('0x2a')][_0xcc0f('0x27')]({'where':{'type':_0x508055,'resourceId':_0x2232c2['id']}})[_0xcc0f('0x26')](function(){return _0x5a7cc6;});})[_0xcc0f('0x26')](function(){_0x49d58d[_0xcc0f('0x1b')](0xcc)[_0xcc0f('0x1c')]();});}};}function handleEntityNotFound(_0x58460e,_0x2db22d){return function(_0x20ee42){if(!_0x20ee42){_0x58460e[_0xcc0f('0x1a')](0x194);}return _0x20ee42;};}function handleError(_0x1b924c,_0x5078e4){_0x5078e4=_0x5078e4||0x1f4;return function(_0x29e908){logger[_0xcc0f('0x2b')](_0x29e908[_0xcc0f('0x2c')]);if(_0x29e908[_0xcc0f('0x2d')]){delete _0x29e908[_0xcc0f('0x2d')];}_0x1b924c[_0xcc0f('0x1b')](_0x5078e4)[_0xcc0f('0x2e')](_0x29e908);};}exports[_0xcc0f('0x2f')]=function(_0x2dc8fe,_0x555154){var _0x1d32e5={},_0x33b1b2={},_0x344bb0={'count':0x0,'rows':[]};return db['CmCompany'][_0xcc0f('0x30')]()['then'](function(_0x46a7c0){_0x33b1b2[_0xcc0f('0x31')]=_['keys'](_0x46a7c0);_0x33b1b2['query']=_[_0xcc0f('0x32')](_0x2dc8fe[_0xcc0f('0x33')]);_0x33b1b2[_0xcc0f('0x34')]=_[_0xcc0f('0x35')](_0x33b1b2[_0xcc0f('0x31')],_0x33b1b2[_0xcc0f('0x33')]);_0x1d32e5[_0xcc0f('0x36')]=_[_0xcc0f('0x35')](_0x33b1b2[_0xcc0f('0x31')],qs[_0xcc0f('0x37')](_0x2dc8fe['query'][_0xcc0f('0x37')]));_0x1d32e5[_0xcc0f('0x36')]=_0x1d32e5['attributes'][_0xcc0f('0x38')]?_0x1d32e5[_0xcc0f('0x36')]:_0x33b1b2['model'];if(!_0x2dc8fe[_0xcc0f('0x33')][_0xcc0f('0x39')](_0xcc0f('0x3a'))){_0x1d32e5['limit']=qs[_0xcc0f('0x21')](_0x2dc8fe[_0xcc0f('0x33')]['limit']);_0x1d32e5[_0xcc0f('0x1e')]=qs['offset'](_0x2dc8fe[_0xcc0f('0x33')][_0xcc0f('0x1e')]);}_0x1d32e5['order']=qs[_0xcc0f('0x3b')](_0x2dc8fe[_0xcc0f('0x33')][_0xcc0f('0x3b')]);_0x1d32e5[_0xcc0f('0x3c')]=qs[_0xcc0f('0x34')](_['pick'](_0x2dc8fe[_0xcc0f('0x33')],_0x33b1b2[_0xcc0f('0x34')]),_0x46a7c0);if(_0x2dc8fe['query'][_0xcc0f('0x3d')]){_0x1d32e5[_0xcc0f('0x3c')]=_[_0xcc0f('0x3e')](_0x1d32e5[_0xcc0f('0x3c')],{'$or':_['map'](_0x1d32e5[_0xcc0f('0x36')],function(_0x2c1d4c){var _0x255d3f={};_0x255d3f[_0x2c1d4c]={'$like':'%'+_0x2dc8fe[_0xcc0f('0x33')][_0xcc0f('0x3d')]+'%'};return _0x255d3f;})});}_0x1d32e5=_[_0xcc0f('0x3e')]({},_0x1d32e5,_0x2dc8fe[_0xcc0f('0x3f')]);var _0x396c79={'where':_0x1d32e5[_0xcc0f('0x3c')]};return db[_0xcc0f('0x40')][_0xcc0f('0x20')](_0x396c79)[_0xcc0f('0x26')](function(_0x116386){_0x344bb0[_0xcc0f('0x20')]=_0x116386;if(_0x2dc8fe[_0xcc0f('0x33')][_0xcc0f('0x41')]){_0x1d32e5['include']=[{'all':!![]}];}return db[_0xcc0f('0x40')][_0xcc0f('0x42')](_0x1d32e5);})[_0xcc0f('0x26')](function(_0x1491e5){_0x344bb0['rows']=_0x1491e5;return _0x344bb0;})[_0xcc0f('0x26')](respondWithFilteredResult(_0x555154,_0x1d32e5))['catch'](handleError(_0x555154,null));})[_0xcc0f('0x43')](handleError(_0x555154,null));};exports[_0xcc0f('0x44')]=function(_0x243538,_0x3f073f){var _0x226daa={'raw':![],'where':{'id':_0x243538[_0xcc0f('0x45')]['id']}},_0x1a3583={};_0x1a3583[_0xcc0f('0x31')]=_[_0xcc0f('0x32')](db[_0xcc0f('0x40')][_0xcc0f('0x46')]);_0x1a3583[_0xcc0f('0x33')]=_['keys'](_0x243538['query']);_0x1a3583[_0xcc0f('0x34')]=_['intersection'](_0x1a3583[_0xcc0f('0x31')],_0x1a3583[_0xcc0f('0x33')]);_0x226daa[_0xcc0f('0x36')]=_['intersection'](_0x1a3583[_0xcc0f('0x31')],qs[_0xcc0f('0x37')](_0x243538['query'][_0xcc0f('0x37')]));_0x226daa[_0xcc0f('0x36')]=_0x226daa[_0xcc0f('0x36')][_0xcc0f('0x38')]?_0x226daa[_0xcc0f('0x36')]:_0x1a3583[_0xcc0f('0x31')];if(_0x243538['query'][_0xcc0f('0x41')]){_0x226daa[_0xcc0f('0x47')]=[{'all':!![]}];}_0x226daa=_[_0xcc0f('0x3e')]({},_0x226daa,_0x243538[_0xcc0f('0x3f')]);return db[_0xcc0f('0x40')][_0xcc0f('0x48')](_0x226daa)[_0xcc0f('0x26')](handleEntityNotFound(_0x3f073f,null))['then'](respondWithResult(_0x3f073f,null))[_0xcc0f('0x43')](handleError(_0x3f073f,null));};exports['create']=function(_0x5418a6,_0x9ff7e8){return db[_0xcc0f('0x40')][_0xcc0f('0x49')](_0x5418a6[_0xcc0f('0x4a')],{})[_0xcc0f('0x26')](function(_0x365c8f){var _0x4acf47=_0x5418a6[_0xcc0f('0x4b')]['get']({'plain':!![]});if(!_0x4acf47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4acf47['role']===_0xcc0f('0x4b')){var _0x1b54aa=_0x365c8f[_0xcc0f('0x28')]({'plain':!![]});var _0x4c48f0='Companies';return db[_0xcc0f('0x4c')][_0xcc0f('0x48')]({'where':{'name':_0x4c48f0,'userProfileId':_0x4acf47[_0xcc0f('0x4d')]},'raw':!![]})['then'](function(_0x5a0cd3){if(_0x5a0cd3&&_0x5a0cd3[_0xcc0f('0x4e')]===0x0){return db[_0xcc0f('0x2a')][_0xcc0f('0x49')]({'name':_0x1b54aa[_0xcc0f('0x2d')],'resourceId':_0x1b54aa['id'],'type':_0x5a0cd3[_0xcc0f('0x2d')],'sectionId':_0x5a0cd3['id']},{})['then'](function(){return _0x365c8f;});}else{return _0x365c8f;}})['catch'](function(_0x27bbd9){logger[_0xcc0f('0x2b')](_0xcc0f('0x4f'),_0x27bbd9);throw _0x27bbd9;});}return _0x365c8f;})['then'](respondWithResult(_0x9ff7e8,0xc9))[_0xcc0f('0x43')](handleError(_0x9ff7e8,null));};exports[_0xcc0f('0x50')]=function(_0x35166a,_0x4efe5f){if(_0x35166a[_0xcc0f('0x4a')]['id']){delete _0x35166a[_0xcc0f('0x4a')]['id'];}return db[_0xcc0f('0x40')][_0xcc0f('0x48')]({'where':{'id':_0x35166a[_0xcc0f('0x45')]['id']}})[_0xcc0f('0x26')](handleEntityNotFound(_0x4efe5f,null))[_0xcc0f('0x26')](saveUpdates(_0x35166a[_0xcc0f('0x4a')],null))['then'](respondWithResult(_0x4efe5f,null))[_0xcc0f('0x43')](handleError(_0x4efe5f,null));};exports[_0xcc0f('0x27')]=function(_0x3f69a7,_0x7ebda7){return db[_0xcc0f('0x40')][_0xcc0f('0x48')]({'where':{'id':_0x3f69a7[_0xcc0f('0x45')]['id']}})[_0xcc0f('0x26')](handleEntityNotFound(_0x7ebda7,null))[_0xcc0f('0x26')](removeEntity(_0x7ebda7,null))[_0xcc0f('0x43')](handleError(_0x7ebda7,null));};exports[_0xcc0f('0x30')]=function(_0x2df426,_0x4f3299){return db['CmCompany']['describe']()['then'](respondWithResult(_0x4f3299,null))[_0xcc0f('0x43')](handleError(_0x4f3299,null));};exports[_0xcc0f('0x51')]=function(_0x3cd303,_0x1020f4,_0x463606){return db[_0xcc0f('0x52')][_0xcc0f('0x48')]({'where':{'id':_0x3cd303['params']['id']}})[_0xcc0f('0x26')](handleEntityNotFound(_0x1020f4,null))[_0xcc0f('0x26')](function(_0x52f39a){if(_0x52f39a){return _0x52f39a[_0xcc0f('0x51')](_0x3cd303['body'][_0xcc0f('0x53')],_[_0xcc0f('0x54')](_0x3cd303[_0xcc0f('0x4a')],[_0xcc0f('0x53'),'id'])||{});}})['then'](respondWithResult(_0x1020f4,null))[_0xcc0f('0x43')](handleError(_0x1020f4,null));};exports['getContacts']=function(_0x429235,_0x574c79,_0x344c5d){var _0x40d24f={};var _0x33837b={};var _0x20c649;var _0x650957;return db['CmCompany'][_0xcc0f('0x55')]({'where':{'id':_0x429235[_0xcc0f('0x45')]['id']}})['then'](handleEntityNotFound(_0x574c79,null))[_0xcc0f('0x26')](function(_0x7d7fae){if(_0x7d7fae){_0x20c649=_0x7d7fae;_0x33837b[_0xcc0f('0x31')]=_[_0xcc0f('0x32')](db[_0xcc0f('0x52')][_0xcc0f('0x46')]);_0x33837b[_0xcc0f('0x33')]=_[_0xcc0f('0x32')](_0x429235[_0xcc0f('0x33')]);_0x33837b[_0xcc0f('0x34')]=_['intersection'](_0x33837b['model'],_0x33837b[_0xcc0f('0x33')]);_0x40d24f[_0xcc0f('0x36')]=_[_0xcc0f('0x35')](_0x33837b[_0xcc0f('0x31')],qs['fields'](_0x429235['query']['fields']));_0x40d24f[_0xcc0f('0x36')]=_0x40d24f[_0xcc0f('0x36')][_0xcc0f('0x38')]?_0x40d24f['attributes']:_0x33837b['model'];_0x40d24f[_0xcc0f('0x56')]=qs['sort'](_0x429235[_0xcc0f('0x33')][_0xcc0f('0x3b')]);_0x40d24f['where']=qs[_0xcc0f('0x34')](_[_0xcc0f('0x57')](_0x429235[_0xcc0f('0x33')],_0x33837b[_0xcc0f('0x34')]));if(_0x429235[_0xcc0f('0x33')]['filter']){_0x40d24f[_0xcc0f('0x3c')]=_[_0xcc0f('0x3e')](_0x40d24f[_0xcc0f('0x3c')],{'$or':_[_0xcc0f('0x58')](_0x40d24f[_0xcc0f('0x36')],function(_0xaf8050){var _0x5114dc={};_0x5114dc[_0xaf8050]={'$like':'%'+_0x429235[_0xcc0f('0x33')]['filter']+'%'};return _0x5114dc;})});}_0x40d24f=_[_0xcc0f('0x3e')]({},_0x40d24f,_0x429235[_0xcc0f('0x3f')]);return _0x20c649[_0xcc0f('0x59')](_0x40d24f);}})[_0xcc0f('0x26')](function(_0x2ccd3a){if(_0x2ccd3a){_0x650957=_0x2ccd3a[_0xcc0f('0x38')];if(!_0x429235['query'][_0xcc0f('0x39')](_0xcc0f('0x3a'))){_0x40d24f['limit']=qs[_0xcc0f('0x21')](_0x429235[_0xcc0f('0x33')]['limit']);_0x40d24f['offset']=qs[_0xcc0f('0x1e')](_0x429235[_0xcc0f('0x33')]['offset']);}return _0x20c649[_0xcc0f('0x59')](_0x40d24f);}})[_0xcc0f('0x26')](function(_0x58650a){if(_0x58650a){return _0x58650a?{'count':_0x650957,'rows':_0x58650a}:null;}})[_0xcc0f('0x26')](respondWithResult(_0x574c79,null))['catch'](handleError(_0x574c79,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 1766018..97b82f8 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 _0xf642=['define','lodash','util','moment','path','../../config/environment','./cmCompany.attributes','exports'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xf642,0x141));var _0x2f64=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0xf642[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0x2f64('0x0'));var util=require(_0x2f64('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2f64('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f64('0x3'));var rimraf=require('rimraf');var config=require(_0x2f64('0x4'));var attributes=require(_0x2f64('0x5'));module[_0x2f64('0x6')]=function(_0x2600d8,_0x1b5e3c){return _0x2600d8[_0x2f64('0x7')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07b9=['moment','bluebird','request-promise','rimraf','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger'];(function(_0x27c233,_0x70027){var _0x264d6d=function(_0x47d122){while(--_0x47d122){_0x27c233['push'](_0x27c233['shift']());}};_0x264d6d(++_0x70027);}(_0x07b9,0x133));var _0x907b=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x07b9[_0x349367];return _0x14179b;};'use strict';var _=require(_0x907b('0x0'));var util=require(_0x907b('0x1'));var logger=require(_0x907b('0x2'))('api');var moment=require(_0x907b('0x3'));var BPromise=require(_0x907b('0x4'));var rp=require(_0x907b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x907b('0x6'));var config=require('../../config/environment');var attributes=require(_0x907b('0x7'));module['exports']=function(_0x6c5538,_0x1d649e){return _0x6c5538[_0x907b('0x8')](_0x907b('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 1f5cec9..731ea01 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 _0x5519=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s'];(function(_0x106789,_0x5389d8){var _0x251f43=function(_0x588c5f){while(--_0x588c5f){_0x106789['push'](_0x106789['shift']());}};_0x251f43(++_0x5389d8);}(_0x5519,0x9d));var _0x9551=function(_0x39c545,_0x4a7b5c){_0x39c545=_0x39c545-0x0;var _0x2ceed9=_0x5519[_0x39c545];return _0x2ceed9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9551('0x0'));var BPromise=require(_0x9551('0x1'));var rs=require(_0x9551('0x2'));var fs=require('fs');var Redis=require(_0x9551('0x3'));var db=require(_0x9551('0x4'))['db'];var utils=require(_0x9551('0x5'));var logger=require(_0x9551('0x6'))('rpc');var config=require(_0x9551('0x7'));var jayson=require(_0x9551('0x8'));var client=jayson[_0x9551('0x9')][_0x9551('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57c478,_0x59f329,_0x2a9e67){return new BPromise(function(_0x276d75,_0x210c17){return client[_0x9551('0xb')](_0x57c478,_0x2a9e67)['then'](function(_0x25b201){logger[_0x9551('0xc')]('CmCompany,\x20%s,\x20%s',_0x59f329,_0x9551('0xd'));logger['debug'](_0x9551('0xe'),_0x59f329,_0x9551('0xd'),JSON[_0x9551('0xf')](_0x25b201));if(_0x25b201[_0x9551('0x10')]){if(_0x25b201[_0x9551('0x10')][_0x9551('0x11')]===0x1f4){logger[_0x9551('0x10')](_0x9551('0x12'),_0x59f329,_0x25b201[_0x9551('0x10')][_0x9551('0x13')]);return _0x210c17(_0x25b201[_0x9551('0x10')]['message']);}logger[_0x9551('0x10')](_0x9551('0x12'),_0x59f329,_0x25b201[_0x9551('0x10')][_0x9551('0x13')]);return _0x276d75(_0x25b201[_0x9551('0x10')][_0x9551('0x13')]);}else{logger[_0x9551('0xc')](_0x9551('0x12'),_0x59f329,_0x9551('0xd'));_0x276d75(_0x25b201[_0x9551('0x14')][_0x9551('0x13')]);}})[_0x9551('0x15')](function(_0x172ff5){logger[_0x9551('0x10')](_0x9551('0x12'),_0x59f329,_0x172ff5);_0x210c17(_0x172ff5);});});}
\ No newline at end of file
+var _0x602f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring'];(function(_0x1758fd,_0x18d1ce){var _0x47c480=function(_0x5174da){while(--_0x5174da){_0x1758fd['push'](_0x1758fd['shift']());}};_0x47c480(++_0x18d1ce);}(_0x602f,0xfa));var _0xf602=function(_0x4e212b,_0x36a910){_0x4e212b=_0x4e212b-0x0;var _0x3e5556=_0x602f[_0x4e212b];return _0x3e5556;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf602('0x0'));var BPromise=require(_0xf602('0x1'));var rs=require(_0xf602('0x2'));var fs=require('fs');var Redis=require(_0xf602('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf602('0x4'));var logger=require(_0xf602('0x5'))(_0xf602('0x6'));var config=require(_0xf602('0x7'));var jayson=require(_0xf602('0x8'));var client=jayson['client'][_0xf602('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d57a2,_0x26fa20,_0xb80e5d){return new BPromise(function(_0x3e9164,_0x47ee60){return client[_0xf602('0xa')](_0x2d57a2,_0xb80e5d)[_0xf602('0xb')](function(_0x49ada1){logger[_0xf602('0xc')]('CmCompany,\x20%s,\x20%s',_0x26fa20,_0xf602('0xd'));logger[_0xf602('0xe')](_0xf602('0xf'),_0x26fa20,_0xf602('0xd'),JSON[_0xf602('0x10')](_0x49ada1));if(_0x49ada1['error']){if(_0x49ada1[_0xf602('0x11')][_0xf602('0x12')]===0x1f4){logger[_0xf602('0x11')](_0xf602('0x13'),_0x26fa20,_0x49ada1[_0xf602('0x11')][_0xf602('0x14')]);return _0x47ee60(_0x49ada1[_0xf602('0x11')][_0xf602('0x14')]);}logger[_0xf602('0x11')](_0xf602('0x13'),_0x26fa20,_0x49ada1['error'][_0xf602('0x14')]);return _0x3e9164(_0x49ada1[_0xf602('0x11')]['message']);}else{logger[_0xf602('0xc')](_0xf602('0x13'),_0x26fa20,_0xf602('0xd'));_0x3e9164(_0x49ada1[_0xf602('0x15')]['message']);}})[_0xf602('0x16')](function(_0xbf7cdb){logger[_0xf602('0x11')]('CmCompany,\x20%s,\x20%s',_0x26fa20,_0xbf7cdb);_0x47ee60(_0xbf7cdb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index a23e017..e23275d 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 _0x60f5=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x60f5,0x8b));var _0x560f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x60f5[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x560f('0x0'));var util=require(_0x560f('0x1'));var path=require(_0x560f('0x2'));var timeout=require(_0x560f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x560f('0x4'));var auth=require(_0x560f('0x5'));var interaction=require(_0x560f('0x6'));var config=require(_0x560f('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x560f('0x8')]);router[_0x560f('0x9')](_0x560f('0xa'),auth[_0x560f('0xb')](),controller['describe']);router[_0x560f('0x9')](_0x560f('0xc'),auth[_0x560f('0xb')](),controller['show']);router[_0x560f('0x9')](_0x560f('0xd'),auth[_0x560f('0xb')](),controller[_0x560f('0xe')]);router['post']('/',auth[_0x560f('0xb')](),controller[_0x560f('0xf')]);router[_0x560f('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x560f('0x11')]);router[_0x560f('0x12')](_0x560f('0xc'),auth['isAuthenticated'](),controller[_0x560f('0x13')]);router[_0x560f('0x14')](_0x560f('0xc'),auth[_0x560f('0xb')](),controller[_0x560f('0x15')]);module[_0x560f('0x16')]=router;
\ No newline at end of file
+var _0x6857=['/describe','describe','get','/:id','show','post','/:id/contacts','addContacts','put','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x49c4c9,_0x1d0d96){var _0x47e932=function(_0xc6da76){while(--_0xc6da76){_0x49c4c9['push'](_0x49c4c9['shift']());}};_0x47e932(++_0x1d0d96);}(_0x6857,0x198));var _0x7685=function(_0x1d7341,_0x70ffa7){_0x1d7341=_0x1d7341-0x0;var _0x4cd14a=_0x6857[_0x1d7341];return _0x4cd14a;};'use strict';var multer=require(_0x7685('0x0'));var util=require(_0x7685('0x1'));var path=require(_0x7685('0x2'));var timeout=require('connect-timeout');var express=require(_0x7685('0x3'));var router=express[_0x7685('0x4')]();var fs_extra=require(_0x7685('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7685('0x6'));var config=require(_0x7685('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x7685('0x8')](),controller[_0x7685('0x9')]);router['get'](_0x7685('0xa'),auth[_0x7685('0x8')](),controller[_0x7685('0xb')]);router[_0x7685('0xc')](_0x7685('0xd'),auth[_0x7685('0x8')](),controller[_0x7685('0xe')]);router[_0x7685('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x7685('0xf')]('/',auth[_0x7685('0x8')](),controller['create']);router[_0x7685('0xf')](_0x7685('0x10'),auth[_0x7685('0x8')](),controller[_0x7685('0x11')]);router[_0x7685('0x12')](_0x7685('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x7685('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 49e210b..7be9630 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 _0x6b01=['STRING','TEXT','INTEGER','NOW','lodash','sequelize'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x6b01,0xa0));var _0x16b0=function(_0x1f1e5f,_0x376859){_0x1f1e5f=_0x1f1e5f-0x0;var _0x13b7ea=_0x6b01[_0x1f1e5f];return _0x13b7ea;};'use strict';var _=require(_0x16b0('0x0'));var Sequelize=require(_0x16b0('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x16b0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x16b0('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x16b0('0x2')]},'city':{'type':Sequelize[_0x16b0('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x16b0('0x2')]},'description':{'type':Sequelize[_0x16b0('0x3')]},'phone':{'type':Sequelize[_0x16b0('0x2')]},'mobile':{'type':Sequelize[_0x16b0('0x2')]},'fax':{'type':Sequelize[_0x16b0('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x16b0('0x2')]},'twitter':{'type':Sequelize[_0x16b0('0x2')]},'skype':{'type':Sequelize[_0x16b0('0x2')]},'teams':{'type':Sequelize[_0x16b0('0x2')]},'viber':{'type':Sequelize[_0x16b0('0x2')]},'line':{'type':Sequelize[_0x16b0('0x2')]},'wechat':{'type':Sequelize[_0x16b0('0x2')]},'telegram':{'type':Sequelize[_0x16b0('0x2')]},'UserId':{'type':Sequelize[_0x16b0('0x4')]},'priority':{'type':Sequelize[_0x16b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x16b0('0x5')]}};
\ No newline at end of file
+var _0x657b=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x657b,0x143));var _0xb657=function(_0x59a0f0,_0x2e37ae){_0x59a0f0=_0x59a0f0-0x0;var _0x184a22=_0x657b[_0x59a0f0];return _0x184a22;};'use strict';var _=require(_0xb657('0x0'));var Sequelize=require(_0xb657('0x1'));module[_0xb657('0x2')]={'firstName':{'type':Sequelize[_0xb657('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb657('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb657('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb657('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb657('0x3')]},'email':{'type':Sequelize[_0xb657('0x3')]},'url':{'type':Sequelize[_0xb657('0x3')]},'facebook':{'type':Sequelize[_0xb657('0x3')]},'fb_data':{'type':Sequelize[_0xb657('0x3')]},'twitter':{'type':Sequelize[_0xb657('0x3')]},'skype':{'type':Sequelize[_0xb657('0x3')]},'teams':{'type':Sequelize[_0xb657('0x3')]},'viber':{'type':Sequelize[_0xb657('0x3')]},'line':{'type':Sequelize[_0xb657('0x3')]},'wechat':{'type':Sequelize[_0xb657('0x3')]},'telegram':{'type':Sequelize[_0xb657('0x3')]},'UserId':{'type':Sequelize[_0xb657('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb657('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb657('0x7')],'defaultValue':Sequelize[_0xb657('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e601c5c..70d4da5 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 _0x6057=['closedAt','disposition','thirdDisposition','Owner','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','threadId','flatten','slice','moment','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','length','keys','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','search','parseSearch','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','filter','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','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.phone\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','isEmpty','resolve','user','some','c.ListId\x20IS\x20NULL','role','agent','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','catch','find','describe','tags','startsWith','displayName','columnName','alias','values','body','findAll','get','[CmContact][merge]\x20to\x20%s\x20from\x20%s','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','join','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','isNil','$and','omit','cf_%d','pickBy','format','table','setFields','text','phone','getTags','rawAttributes','pick','options','nolimit','setTags','ids','getHoppers','ContactId','includeAll','include','CmHopper','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','child_process','fork','binding_values','File\x20uploaded\x20correctly!','pid','createReadStream','path','parse','meta','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','source','callerid','starttime','endtime','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','VoiceCallReport','findAndCountAll','fullname','startCase','chat','Website','Account'];(function(_0xeaaf6c,_0x8cd898){var _0x2cee50=function(_0x4e321e){while(--_0x4e321e){_0xeaaf6c['push'](_0xeaaf6c['shift']());}};_0x2cee50(++_0x8cd898);}(_0x6057,0x12c));var _0x7605=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6057[_0x173441];return _0x2423a8;};'use strict';var moment=require(_0x7605('0x0'));var BPromise=require('bluebird');var util=require(_0x7605('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x7605('0x2'));var squel=require(_0x7605('0x3'));var Papa=require(_0x7605('0x4'));var Redis=require(_0x7605('0x5'));var qs=require(_0x7605('0x6'));var as=require(_0x7605('0x7'));var logger=require(_0x7605('0x8'))(_0x7605('0x9'));var config=require('../../config/environment');var db=require(_0x7605('0xa'))['db'];config[_0x7605('0xb')]=_[_0x7605('0xc')](config[_0x7605('0xb')],{'host':_0x7605('0xd'),'port':0x18eb});var socket=require(_0x7605('0xe'))(new Redis(config[_0x7605('0xb')]));require(_0x7605('0xf'))['register'](socket);function respondWithResult(_0x101648,_0x386e21){_0x386e21=_0x386e21||0xc8;return function(_0x39af35){if(_0x39af35){return _0x101648[_0x7605('0x10')](_0x386e21)[_0x7605('0x11')](_0x39af35);}};}function respondWithFilteredResult(_0x1473ee,_0x148758){return function(_0x53ce2d){if(_0x53ce2d){var _0x41c85f=typeof _0x148758[_0x7605('0x12')]===_0x7605('0x13')&&typeof _0x148758[_0x7605('0x14')]===_0x7605('0x13');var _0x27d81a=_0x53ce2d[_0x7605('0x15')];var _0x555e87=_0x41c85f?0x0:_0x148758[_0x7605('0x12')];var _0x437144=_0x41c85f?_0x53ce2d['count']:_0x148758[_0x7605('0x12')]+_0x148758[_0x7605('0x14')];var _0x5ace4d;if(_0x437144>=_0x27d81a){_0x437144=_0x27d81a;_0x5ace4d=0xc8;}else{_0x5ace4d=0xce;}_0x1473ee[_0x7605('0x10')](_0x5ace4d);return _0x1473ee[_0x7605('0x16')](_0x7605('0x17'),_0x555e87+'-'+_0x437144+'/'+_0x27d81a)[_0x7605('0x11')](_0x53ce2d);}return null;};}function saveUpdates(_0x11dbd9){return function(_0x562fc4){if(_0x562fc4){return _0x562fc4[_0x7605('0x18')](_0x11dbd9)[_0x7605('0x19')](function(_0x4a9977){return _0x4a9977;});}return null;};}function removeEntity(_0x18fdb7){return function(_0x4581df){if(_0x4581df){return _0x4581df['destroy']()[_0x7605('0x19')](function(){_0x18fdb7[_0x7605('0x10')](0xcc)[_0x7605('0x1a')]();});}};}function handleEntityNotFound(_0x2ce7d4){return function(_0x3bf61a){if(!_0x3bf61a){_0x2ce7d4[_0x7605('0x1b')](0x194);}return _0x3bf61a;};}function handleError(_0x441d4f,_0x279c4a){_0x279c4a=_0x279c4a||0x1f4;return function(_0x27eda1){logger[_0x7605('0x1c')](_0x27eda1[_0x7605('0x1d')]);if(_0x27eda1['name']){delete _0x27eda1[_0x7605('0x1e')];}_0x441d4f[_0x7605('0x10')](_0x279c4a)[_0x7605('0x1f')](_0x27eda1);};}exports[_0x7605('0x20')]=function(_0x3b5a1b,_0x23167e){var _0x2849cf={},_0x5e1aa7={},_0x3043f0={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x7605('0x19')](function(_0x458d2f){var _0x270585=[];for(var _0x3da84b=0x0;_0x3da84b
','Attachments','Data','getHost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01db,0x171));var _0xb01d=function(_0x409c85,_0x2b8ae9){_0x409c85=_0x409c85-0x0;var _0x17773b=_0x01db[_0x409c85];return _0x17773b;};'use strict';var _=require(_0xb01d('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xb01d('0x1'));var util=require(_0xb01d('0x2'));var tnef=require(_0xb01d('0x3'));var logger=require('../../../config/logger')(_0xb01d('0x4'));var config=require('../../../config/environment');function getAddress(_0x4cc905){var _0x267f09=_[_0xb01d('0x5')](_0x4cc905[_0xb01d('0x6')]);return _0x267f09&&_0x267f09[_0xb01d('0x7')]?_0x267f09[_0xb01d('0x7')]:_0xb01d('0x8')+random[_0xb01d('0x9')](0x6)+_0xb01d('0xa');}function getFirstName(_0x518609){var _0x4c96d5=_[_0xb01d('0x5')](_0x518609[_0xb01d('0x6')]);if(_0x4c96d5&&_0x4c96d5[_0xb01d('0xb')]){if(_0x4c96d5[_0xb01d('0xb')]==_0x4c96d5[_0xb01d('0x7')]){return _0x4c96d5[_0xb01d('0xb')]['substring'](0x0,_0x4c96d5['name'][_0xb01d('0xc')]('@'));}var _0x1b59b9=_0x4c96d5[_0xb01d('0xb')][_0xb01d('0xd')](/\s+/);return _0x1b59b9[_0xb01d('0xe')]>0x1?_0x1b59b9[_0xb01d('0xf')](0x0,-0x1)[_0xb01d('0x10')]('\x20'):_0x4c96d5['name'];}return'Anonymous';}function getLastName(_0x1ddffd){var _0x5ef36c=_[_0xb01d('0x5')](_0x1ddffd[_0xb01d('0x6')]);if(_0x5ef36c&&_0x5ef36c['name']){var _0x28ee78=_0x5ef36c[_0xb01d('0xb')][_0xb01d('0xd')](/\s+/);return _0x28ee78[_0xb01d('0xe')]>0x1?_0x28ee78['pop']():'';}return'';}function getMails(_0x135604,_0x507930){var _0xd9c0b0='';for(var _0x9a96e=0x0;_0x9a96e<_0x507930[_0xb01d('0x6')][_0xb01d('0xe')];_0x9a96e+=0x1){if(_0x507930['value'][_0x9a96e][_0xb01d('0x7')]!==_0x135604){if(!_[_0xb01d('0x11')](_0xd9c0b0)){_0xd9c0b0+=',';}_0xd9c0b0+=_0x507930[_0xb01d('0x6')][_0x9a96e]['name']||_0x507930[_0xb01d('0x6')][_0x9a96e]['address']||'';_0xd9c0b0+='\x20<';_0xd9c0b0+=_0x507930[_0xb01d('0x6')][_0x9a96e][_0xb01d('0x7')]?_0x507930[_0xb01d('0x6')][_0x9a96e][_0xb01d('0x7')]:_0xb01d('0x8')+random['generate'](0x6)+_0xb01d('0xa');_0xd9c0b0+='>';}}return _0xd9c0b0;}function parseEmail(_0x34e9fb,_0x149b50,_0x113d5b){if(_0x149b50[_0xb01d('0x12')]){var _0x7de0a2=/