From 47536dd0a17207dd75d42885cfb09f9b9cee4ed2 Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Fri, 8 Oct 2021 15:06:34 +0200
Subject: [PATCH] Built motion from commit 0d7cdd56.|2.5.36
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/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/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 ae38788..839ceb3 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-08T09:16:04.527Z",
+ "time": "2021-10-08T12:53:04.799Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 54ce375..a43254d 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-08T09:16:04.527Z",
+ "time": "2021-10-08T12:53:04.799Z",
"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 eb21530..6ba9d5c 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 _0x3411=['script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x5eb307,_0x580bef){var _0x5c5862=function(_0x311b41){while(--_0x311b41){_0x5eb307['push'](_0x5eb307['shift']());}};_0x5c5862(++_0x580bef);}(_0x3411,0x1c7));var _0x1341=function(_0x1a3429,_0x2ef9cf){_0x1a3429=_0x1a3429-0x0;var _0xf1981d=_0x3411[_0x1a3429];return _0xf1981d;};'use strict';var Sequelize=require(_0x1341('0x0'));module[_0x1341('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5ea50b){return this[_0x1341('0x2')](_0x1341('0x3'));}},'action':{'type':Sequelize[_0x1341('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1341('0x5'),_0x1341('0x6'),_0x1341('0x7'),_0x1341('0x8'),'urlForward','browser','bot',_0x1341('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xa')},'data2':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xb')},'data3':{'type':Sequelize[_0x1341('0x4')](0x1000),'comment':_0x1341('0xc')},'data4':{'type':Sequelize[_0x1341('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x1341('0xd')},'data6':{'type':Sequelize[_0x1341('0x4')],'comments':_0x1341('0xe')},'data7':{'type':Sequelize[_0x1341('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xeb73=['urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x3fe05c,_0x325126){var _0x166aac=function(_0x35ef44){while(--_0x35ef44){_0x3fe05c['push'](_0x3fe05c['shift']());}};_0x166aac(++_0x325126);}(_0xeb73,0x131));var _0x3eb7=function(_0x46012c,_0x66bacf){_0x46012c=_0x46012c-0x0;var _0x26d30f=_0xeb73[_0x46012c];return _0x26d30f;};'use strict';var Sequelize=require(_0x3eb7('0x0'));module[_0x3eb7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x22dc6c){return this[_0x3eb7('0x2')](_0x3eb7('0x3'));}},'action':{'type':Sequelize[_0x3eb7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3eb7('0x5'),_0x3eb7('0x6'),_0x3eb7('0x7'),_0x3eb7('0x8'),_0x3eb7('0x9'),_0x3eb7('0xa'),'bot',_0x3eb7('0xb')]],'msg':_0x3eb7('0xc')}},'comment':_0x3eb7('0xc')},'data1':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xd')},'data3':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xe')},'data4':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comments':_0x3eb7('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3eb7('0x4')],'comments':_0x3eb7('0x10')},'data7':{'type':Sequelize[_0x3eb7('0x11')],'comments':_0x3eb7('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index abed405..786af8e 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 _0xec9b=['params','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','status','apply','reject','update','then','destroy','error','stack','name','send','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec9b,0xa6));var _0xbec9=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0xec9b[_0x54da5b];return _0x285d3b;};'use strict';var emlformat=require(_0xbec9('0x0'));var rimraf=require(_0xbec9('0x1'));var zipdir=require(_0xbec9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec9('0x3'));var moment=require('moment');var BPromise=require(_0xbec9('0x4'));var Mustache=require('mustache');var util=require(_0xbec9('0x5'));var path=require('path');var sox=require(_0xbec9('0x6'));var csv=require(_0xbec9('0x7'));var ejs=require(_0xbec9('0x8'));var fs=require('fs');var fs_extra=require(_0xbec9('0x9'));var _=require(_0xbec9('0xa'));var squel=require(_0xbec9('0xb'));var crypto=require(_0xbec9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbec9('0xd'));var toCsv=require(_0xbec9('0x7'));var querystring=require(_0xbec9('0xe'));var Papa=require('papaparse');var Redis=require(_0xbec9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbec9('0x10'));var as=require(_0xbec9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbec9('0x12'))('api');var utils=require(_0xbec9('0x13'));var config=require(_0xbec9('0x14'));var licenseUtil=require(_0xbec9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55cf0b,_0x87cb61){_0x87cb61=_0x87cb61||0xcc;return function(_0x335d89){if(_0x335d89){return _0x55cf0b[_0xbec9('0x16')](_0x87cb61);}return _0x55cf0b['status'](_0x87cb61)[_0xbec9('0x17')]();};}function respondWithResult(_0x5d3bb7,_0xf3c927){_0xf3c927=_0xf3c927||0xc8;return function(_0x10ba6e){if(_0x10ba6e){return _0x5d3bb7['status'](_0xf3c927)[_0xbec9('0x18')](_0x10ba6e);}};}function respondWithFilteredResult(_0x29aeaf,_0x3b9627){return function(_0xced470){if(_0xced470){var _0x8f9b5e=typeof _0x3b9627[_0xbec9('0x19')]==='undefined'&&typeof _0x3b9627['limit']===_0xbec9('0x1a');var _0x56b291=_0xced470['count'];var _0x21fe5c=_0x8f9b5e?0x0:_0x3b9627[_0xbec9('0x19')];var _0x13a982=_0x8f9b5e?_0xced470['count']:_0x3b9627[_0xbec9('0x19')]+_0x3b9627[_0xbec9('0x1b')];var _0x17ccda;if(_0x13a982>=_0x56b291){_0x13a982=_0x56b291;_0x17ccda=0xc8;}else{_0x17ccda=0xce;}_0x29aeaf[_0xbec9('0x1c')](_0x17ccda);return _0x29aeaf['set']('Content-Range',_0x21fe5c+'-'+_0x13a982+'/'+_0x56b291)[_0xbec9('0x18')](_0xced470);}return null;};}function patchUpdates(_0x41fd58){return function(_0x59f045){try{jsonpatch[_0xbec9('0x1d')](_0x59f045,_0x41fd58,!![]);}catch(_0x6e9259){return BPromise[_0xbec9('0x1e')](_0x6e9259);}return _0x59f045['save']();};}function saveUpdates(_0x35c2fe,_0x44dbeb){return function(_0x422cec){if(_0x422cec){return _0x422cec[_0xbec9('0x1f')](_0x35c2fe)[_0xbec9('0x20')](function(_0x5b8e14){return _0x5b8e14;});}return null;};}function removeEntity(_0x3c6923,_0x984064){return function(_0x10583a){if(_0x10583a){return _0x10583a[_0xbec9('0x21')]()[_0xbec9('0x20')](function(){_0x3c6923[_0xbec9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e2ef,_0x2a33bf){return function(_0x2c1780){if(!_0x2c1780){_0x22e2ef['sendStatus'](0x194);}return _0x2c1780;};}function handleError(_0x21d2bf,_0x36ce62){_0x36ce62=_0x36ce62||0x1f4;return function(_0x43ec8c){logger[_0xbec9('0x22')](_0x43ec8c[_0xbec9('0x23')]);if(_0x43ec8c[_0xbec9('0x24')]){delete _0x43ec8c['name'];}_0x21d2bf[_0xbec9('0x1c')](_0x36ce62)[_0xbec9('0x25')](_0x43ec8c);};}exports[_0xbec9('0x1f')]=function(_0x4c4fee,_0x5c65de){if(_0x4c4fee[_0xbec9('0x26')]['id']){delete _0x4c4fee[_0xbec9('0x26')]['id'];}return db['Action']['find']({'where':{'id':_0x4c4fee[_0xbec9('0x27')]['id']}})[_0xbec9('0x20')](handleEntityNotFound(_0x5c65de,null))['then'](saveUpdates(_0x4c4fee[_0xbec9('0x26')],null))['then'](respondWithResult(_0x5c65de,null))[_0xbec9('0x28')](handleError(_0x5c65de,null));};exports[_0xbec9('0x21')]=function(_0x1b40fe,_0x3eb2c0){return db['Action']['find']({'where':{'id':_0x1b40fe[_0xbec9('0x27')]['id']}})[_0xbec9('0x20')](handleEntityNotFound(_0x3eb2c0,null))[_0xbec9('0x20')](removeEntity(_0x3eb2c0,null))[_0xbec9('0x28')](handleError(_0x3eb2c0,null));};
\ No newline at end of file
+var _0x0b74=['path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','mustache','util'];(function(_0x1517b6,_0x172069){var _0xb9d140=function(_0x41da44){while(--_0x41da44){_0x1517b6['push'](_0x1517b6['shift']());}};_0xb9d140(++_0x172069);}(_0x0b74,0x1da));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x40b7('0x0'));var rimraf=require(_0x40b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40b7('0x2'));var rp=require(_0x40b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40b7('0x4'));var util=require(_0x40b7('0x5'));var path=require(_0x40b7('0x6'));var sox=require(_0x40b7('0x7'));var csv=require('to-csv');var ejs=require(_0x40b7('0x8'));var fs=require('fs');var fs_extra=require(_0x40b7('0x9'));var _=require(_0x40b7('0xa'));var squel=require('squel');var crypto=require(_0x40b7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40b7('0xc'));var toCsv=require(_0x40b7('0xd'));var querystring=require(_0x40b7('0xe'));var Papa=require(_0x40b7('0xf'));var Redis=require(_0x40b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40b7('0x11'));var as=require(_0x40b7('0x12'));var hardwareService=require(_0x40b7('0x13'));var logger=require(_0x40b7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x40b7('0x15'));var licenseUtil=require(_0x40b7('0x16'));var db=require(_0x40b7('0x17'))['db'];function respondWithStatusCode(_0x562f60,_0x5ab69c){_0x5ab69c=_0x5ab69c||0xcc;return function(_0x8184ca){if(_0x8184ca){return _0x562f60[_0x40b7('0x18')](_0x5ab69c);}return _0x562f60['status'](_0x5ab69c)[_0x40b7('0x19')]();};}function respondWithResult(_0x2a2df9,_0x17c582){_0x17c582=_0x17c582||0xc8;return function(_0x514229){if(_0x514229){return _0x2a2df9[_0x40b7('0x1a')](_0x17c582)[_0x40b7('0x1b')](_0x514229);}};}function respondWithFilteredResult(_0x253199,_0x4c31d0){return function(_0x1fa69e){if(_0x1fa69e){var _0x429c17=typeof _0x4c31d0[_0x40b7('0x1c')]===_0x40b7('0x1d')&&typeof _0x4c31d0[_0x40b7('0x1e')]==='undefined';var _0x40f6cb=_0x1fa69e[_0x40b7('0x1f')];var _0xb9eb8b=_0x429c17?0x0:_0x4c31d0[_0x40b7('0x1c')];var _0x50507f=_0x429c17?_0x1fa69e['count']:_0x4c31d0[_0x40b7('0x1c')]+_0x4c31d0[_0x40b7('0x1e')];var _0x409ce3;if(_0x50507f>=_0x40f6cb){_0x50507f=_0x40f6cb;_0x409ce3=0xc8;}else{_0x409ce3=0xce;}_0x253199[_0x40b7('0x1a')](_0x409ce3);return _0x253199['set'](_0x40b7('0x20'),_0xb9eb8b+'-'+_0x50507f+'/'+_0x40f6cb)['json'](_0x1fa69e);}return null;};}function patchUpdates(_0x226ab7){return function(_0x3ae0b9){try{jsonpatch[_0x40b7('0x21')](_0x3ae0b9,_0x226ab7,!![]);}catch(_0x21c51e){return BPromise[_0x40b7('0x22')](_0x21c51e);}return _0x3ae0b9[_0x40b7('0x23')]();};}function saveUpdates(_0x343a09,_0x5e9711){return function(_0x3a77ab){if(_0x3a77ab){return _0x3a77ab[_0x40b7('0x24')](_0x343a09)[_0x40b7('0x25')](function(_0x41e114){return _0x41e114;});}return null;};}function removeEntity(_0x1be214,_0x15814a){return function(_0x3c58b1){if(_0x3c58b1){return _0x3c58b1[_0x40b7('0x26')]()[_0x40b7('0x25')](function(){_0x1be214['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x508231,_0x4da132){return function(_0x227ae3){if(!_0x227ae3){_0x508231[_0x40b7('0x18')](0x194);}return _0x227ae3;};}function handleError(_0x5b7b1a,_0xa7e845){_0xa7e845=_0xa7e845||0x1f4;return function(_0xdb5b10){logger[_0x40b7('0x27')](_0xdb5b10[_0x40b7('0x28')]);if(_0xdb5b10[_0x40b7('0x29')]){delete _0xdb5b10['name'];}_0x5b7b1a['status'](_0xa7e845)[_0x40b7('0x2a')](_0xdb5b10);};}exports[_0x40b7('0x24')]=function(_0x4e146b,_0x2a0dbe){if(_0x4e146b[_0x40b7('0x2b')]['id']){delete _0x4e146b['body']['id'];}return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x4e146b[_0x40b7('0x2e')]['id']}})[_0x40b7('0x25')](handleEntityNotFound(_0x2a0dbe,null))[_0x40b7('0x25')](saveUpdates(_0x4e146b[_0x40b7('0x2b')],null))['then'](respondWithResult(_0x2a0dbe,null))[_0x40b7('0x2f')](handleError(_0x2a0dbe,null));};exports[_0x40b7('0x26')]=function(_0x3966ea,_0x3a7f48){return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x3966ea[_0x40b7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3a7f48,null))['then'](removeEntity(_0x3a7f48,null))[_0x40b7('0x2f')](handleError(_0x3a7f48,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4a3c3fa..043379c 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 _0x3aa7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x152350,_0x3b0fe2){var _0x23a26b=function(_0x5148ca){while(--_0x5148ca){_0x152350['push'](_0x152350['shift']());}};_0x23a26b(++_0x3b0fe2);}(_0x3aa7,0x18d));var _0x73aa=function(_0x2af6e0,_0x4ceb6f){_0x2af6e0=_0x2af6e0-0x0;var _0x31938d=_0x3aa7[_0x2af6e0];return _0x31938d;};'use strict';var _=require(_0x73aa('0x0'));var util=require(_0x73aa('0x1'));var logger=require(_0x73aa('0x2'))('api');var moment=require('moment');var BPromise=require(_0x73aa('0x3'));var rp=require(_0x73aa('0x4'));var fs=require('fs');var path=require(_0x73aa('0x5'));var rimraf=require(_0x73aa('0x6'));var config=require(_0x73aa('0x7'));var attributes=require('./action.attributes');module[_0x73aa('0x8')]=function(_0x766401,_0x3d53c0){return _0x766401[_0x73aa('0x9')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf61c=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','util','../../config/logger','api','moment','bluebird'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0xf61c,0x1c3));var _0xcf61=function(_0x28a9aa,_0x3f054f){_0x28a9aa=_0x28a9aa-0x0;var _0x532458=_0xf61c[_0x28a9aa];return _0x532458;};'use strict';var _=require('lodash');var util=require(_0xcf61('0x0'));var logger=require(_0xcf61('0x1'))(_0xcf61('0x2'));var moment=require(_0xcf61('0x3'));var BPromise=require(_0xcf61('0x4'));var rp=require(_0xcf61('0x5'));var fs=require('fs');var path=require(_0xcf61('0x6'));var rimraf=require(_0xcf61('0x7'));var config=require(_0xcf61('0x8'));var attributes=require(_0xcf61('0x9'));module[_0xcf61('0xa')]=function(_0x7764ec,_0x2f9b93){return _0x7764ec['define'](_0xcf61('0xb'),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 b71b552..ee94b72 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 _0x7a54=['info','Action,\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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea60d,_0x36cd19){_0x4ea60d=_0x4ea60d-0x0;var _0x4130fe=_0x7a54[_0x4ea60d];return _0x4130fe;};'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')]('Action,\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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x10ecd6,_0x26d87b){var _0x516301=function(_0x51c59a){while(--_0x51c59a){_0x10ecd6['push'](_0x10ecd6['shift']());}};_0x516301(++_0x26d87b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x7fbe[_0xd29c88];return _0x375635;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 637b5b3..f36cf29 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 _0x2308=['express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path'];(function(_0x1ab91c,_0x14e58d){var _0x327b58=function(_0x19c481){while(--_0x19c481){_0x1ab91c['push'](_0x1ab91c['shift']());}};_0x327b58(++_0x14e58d);}(_0x2308,0x1b8));var _0x8230=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x2308[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x8230('0x0'));var util=require('util');var path=require(_0x8230('0x1'));var timeout=require('connect-timeout');var express=require(_0x8230('0x2'));var router=express[_0x8230('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8230('0x4'));var config=require(_0x8230('0x5'));var controller=require('./action.controller');router[_0x8230('0x6')](_0x8230('0x7'),auth[_0x8230('0x8')](),controller[_0x8230('0x9')]);router[_0x8230('0xa')](_0x8230('0x7'),auth[_0x8230('0x8')](),controller[_0x8230('0xb')]);module[_0x8230('0xc')]=router;
\ No newline at end of file
+var _0xe3cb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3cb,0x1cb));var _0xbe3c=function(_0x22783e,_0x591a8e){_0x22783e=_0x22783e-0x0;var _0x40887a=_0xe3cb[_0x22783e];return _0x40887a;};'use strict';var multer=require(_0xbe3c('0x0'));var util=require('util');var path=require(_0xbe3c('0x1'));var timeout=require(_0xbe3c('0x2'));var express=require(_0xbe3c('0x3'));var router=express[_0xbe3c('0x4')]();var fs_extra=require(_0xbe3c('0x5'));var auth=require(_0xbe3c('0x6'));var interaction=require(_0xbe3c('0x7'));var config=require(_0xbe3c('0x8'));var controller=require(_0xbe3c('0x9'));router['put'](_0xbe3c('0xa'),auth['isAuthenticated'](),controller[_0xbe3c('0xb')]);router[_0xbe3c('0xc')]('/:id',auth[_0xbe3c('0xd')](),controller[_0xbe3c('0xe')]);module[_0xbe3c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index cdaa1d5..32bf193 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x4b477a,_0x3e3f1e){var _0x291072=function(_0x2539a9){while(--_0x2539a9){_0x4b477a['push'](_0x4b477a['shift']());}};_0x291072(++_0x3e3f1e);}(_0xac9d,0x14d));var _0xdac9=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xac9d[_0x5e3701];return _0x345dcf;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x3e2423,_0x5554c6){var _0x26c422=function(_0x5b23e7){while(--_0x5b23e7){_0x3e2423['push'](_0x3e2423['shift']());}};_0x26c422(++_0x5554c6);}(_0x5496,0x175));var _0x6549=function(_0x510218,_0x3d8b2e){_0x510218=_0x510218-0x0;var _0x3e80bd=_0x5496[_0x510218];return _0x3e80bd;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f9244b7..b0e22e8 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 _0xdcde=['save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','include','findAll','params','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','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','operator','group','field','condition','value','merge','options','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','parentKey','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x26b1a5,_0x3ffb3e){var _0xb21c93=function(_0x1578dd){while(--_0x1578dd){_0x26b1a5['push'](_0x26b1a5['shift']());}};_0xb21c93(++_0x3ffb3e);}(_0xdcde,0x1d0));var _0xedcd=function(_0x6b942a,_0x311643){_0x6b942a=_0x6b942a-0x0;var _0x22129d=_0xdcde[_0x6b942a];return _0x22129d;};'use strict';var emlformat=require(_0xedcd('0x0'));var rimraf=require(_0xedcd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedcd('0x2'));var rp=require(_0xedcd('0x3'));var moment=require(_0xedcd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xedcd('0x5'));var sox=require(_0xedcd('0x6'));var csv=require(_0xedcd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedcd('0x8'));var _=require(_0xedcd('0x9'));var squel=require(_0xedcd('0xa'));var crypto=require(_0xedcd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xedcd('0xc'));var toCsv=require(_0xedcd('0x7'));var querystring=require(_0xedcd('0xd'));var Papa=require(_0xedcd('0xe'));var Redis=require(_0xedcd('0xf'));var authService=require(_0xedcd('0x10'));var qs=require(_0xedcd('0x11'));var as=require(_0xedcd('0x12'));var hardwareService=require(_0xedcd('0x13'));var logger=require(_0xedcd('0x14'))(_0xedcd('0x15'));var utils=require(_0xedcd('0x16'));var config=require(_0xedcd('0x17'));var licenseUtil=require(_0xedcd('0x18'));var db=require(_0xedcd('0x19'))['db'];var dbH=require(_0xedcd('0x19'))['dbH'];function respondWithStatusCode(_0x219b4a,_0x2f521a){_0x2f521a=_0x2f521a||0xcc;return function(_0x590620){if(_0x590620){return _0x219b4a[_0xedcd('0x1a')](_0x2f521a);}return _0x219b4a[_0xedcd('0x1b')](_0x2f521a)['end']();};}function respondWithResult(_0x4a9390,_0x3fb712){_0x3fb712=_0x3fb712||0xc8;return function(_0x599981){if(_0x599981){return _0x4a9390['status'](_0x3fb712)[_0xedcd('0x1c')](_0x599981);}};}function respondWithFilteredResult(_0x39a87a,_0x48a5f7){return function(_0x543628){if(_0x543628){var _0x981b01=typeof _0x48a5f7[_0xedcd('0x1d')]==='undefined'&&typeof _0x48a5f7[_0xedcd('0x1e')]===_0xedcd('0x1f');var _0x2e0095=_0x543628[_0xedcd('0x20')];var _0x4b7365=_0x981b01?0x0:_0x48a5f7['offset'];var _0x329f94=_0x981b01?_0x543628[_0xedcd('0x20')]:_0x48a5f7[_0xedcd('0x1d')]+_0x48a5f7[_0xedcd('0x1e')];var _0x5b33d8;if(_0x329f94>=_0x2e0095){_0x329f94=_0x2e0095;_0x5b33d8=0xc8;}else{_0x5b33d8=0xce;}_0x39a87a[_0xedcd('0x1b')](_0x5b33d8);return _0x39a87a[_0xedcd('0x21')](_0xedcd('0x22'),_0x4b7365+'-'+_0x329f94+'/'+_0x2e0095)['json'](_0x543628);}return null;};}function patchUpdates(_0x3e84d5){return function(_0x506c11){try{jsonpatch[_0xedcd('0x23')](_0x506c11,_0x3e84d5,!![]);}catch(_0x251b49){return BPromise[_0xedcd('0x24')](_0x251b49);}return _0x506c11[_0xedcd('0x25')]();};}function saveUpdates(_0x3267ba,_0x5aba2b){return function(_0x4e7360){if(_0x4e7360){return _0x4e7360[_0xedcd('0x26')](_0x3267ba)[_0xedcd('0x27')](function(_0x1b51d9){return _0x1b51d9;});}return null;};}function removeEntity(_0x4b3e3d,_0xd70440){return function(_0x516c49){if(_0x516c49){return _0x516c49[_0xedcd('0x28')]()[_0xedcd('0x27')](function(){var _0xa7558e=_0x516c49[_0xedcd('0x29')]({'plain':!![]});var _0xdbd925='CustomReports';return db[_0xedcd('0x2a')]['destroy']({'where':{'type':_0xdbd925,'resourceId':_0xa7558e['id']}})[_0xedcd('0x27')](function(){return _0x516c49;});})[_0xedcd('0x27')](function(){_0x4b3e3d[_0xedcd('0x1b')](0xcc)[_0xedcd('0x2b')]();});}};}function handleEntityNotFound(_0x379f6f,_0x202068){return function(_0x3e6aab){if(!_0x3e6aab){_0x379f6f[_0xedcd('0x1a')](0x194);}return _0x3e6aab;};}function handleError(_0x46110e,_0x359e1b){_0x359e1b=_0x359e1b||0x1f4;return function(_0x7d81f8){logger['error'](_0x7d81f8[_0xedcd('0x2c')]);if(_0x7d81f8[_0xedcd('0x2d')]){delete _0x7d81f8[_0xedcd('0x2d')];}_0x46110e['status'](_0x359e1b)[_0xedcd('0x2e')](_0x7d81f8);};}exports[_0xedcd('0x2f')]=function(_0x16554e,_0x5d93ad){var _0x39e327={},_0x4d86a3={},_0x4251fe={'count':0x0,'rows':[]};var _0xb2e186=_[_0xedcd('0x30')](db[_0xedcd('0x31')][_0xedcd('0x32')],function(_0x16c9c0){return{'name':_0x16c9c0['fieldName'],'type':_0x16c9c0[_0xedcd('0x33')][_0xedcd('0x34')]};});_0x4d86a3[_0xedcd('0x35')]=_[_0xedcd('0x30')](_0xb2e186,_0xedcd('0x2d'));_0x4d86a3['query']=_['keys'](_0x16554e[_0xedcd('0x36')]);_0x4d86a3[_0xedcd('0x37')]=_[_0xedcd('0x38')](_0x4d86a3[_0xedcd('0x35')],_0x4d86a3[_0xedcd('0x36')]);_0x39e327[_0xedcd('0x39')]=_[_0xedcd('0x38')](_0x4d86a3['model'],qs[_0xedcd('0x3a')](_0x16554e[_0xedcd('0x36')]['fields']));_0x39e327[_0xedcd('0x39')]=_0x39e327[_0xedcd('0x39')][_0xedcd('0x3b')]?_0x39e327[_0xedcd('0x39')]:_0x4d86a3[_0xedcd('0x35')];if(!_0x16554e[_0xedcd('0x36')][_0xedcd('0x3c')](_0xedcd('0x3d'))){_0x39e327['limit']=qs['limit'](_0x16554e[_0xedcd('0x36')][_0xedcd('0x1e')]);_0x39e327[_0xedcd('0x1d')]=qs['offset'](_0x16554e[_0xedcd('0x36')]['offset']);}_0x39e327[_0xedcd('0x3e')]=qs[_0xedcd('0x3f')](_0x16554e[_0xedcd('0x36')]['sort']);_0x39e327[_0xedcd('0x40')]=qs[_0xedcd('0x37')](_[_0xedcd('0x41')](_0x16554e[_0xedcd('0x36')],_0x4d86a3[_0xedcd('0x37')]),_0xb2e186);if(_0x16554e[_0xedcd('0x36')][_0xedcd('0x42')]){_0x39e327[_0xedcd('0x40')]=_['merge'](_0x39e327[_0xedcd('0x40')],{'$or':_[_0xedcd('0x30')](_0xb2e186,function(_0x32506c){if(_0x32506c['type']!=='VIRTUAL'){var _0x40a8bc={};_0x40a8bc[_0x32506c['name']]={'$like':'%'+_0x16554e[_0xedcd('0x36')][_0xedcd('0x42')]+'%'};return _0x40a8bc;}})});}_0x39e327=_['merge']({},_0x39e327,_0x16554e['options']);var _0x202258={'where':_0x39e327[_0xedcd('0x40')]};return db[_0xedcd('0x31')][_0xedcd('0x20')](_0x202258)[_0xedcd('0x27')](function(_0xf78174){_0x4251fe[_0xedcd('0x20')]=_0xf78174;if(_0x16554e[_0xedcd('0x36')]['includeAll']){_0x39e327[_0xedcd('0x43')]=[{'all':!![]}];}return db[_0xedcd('0x31')][_0xedcd('0x44')](_0x39e327);})[_0xedcd('0x27')](function(_0xfc44b1){_0x4251fe['rows']=_0xfc44b1;return _0x4251fe;})[_0xedcd('0x27')](respondWithFilteredResult(_0x5d93ad,_0x39e327))['catch'](handleError(_0x5d93ad,null));};exports['show']=function(_0x3dd8b3,_0x4a5aa7){var _0x580568={'raw':![],'where':{'id':_0x3dd8b3[_0xedcd('0x45')]['id']}},_0x5d4744={};_0x5d4744['model']=_['keys'](db[_0xedcd('0x31')][_0xedcd('0x32')]);_0x5d4744[_0xedcd('0x36')]=_['keys'](_0x3dd8b3[_0xedcd('0x36')]);_0x5d4744[_0xedcd('0x37')]=_[_0xedcd('0x38')](_0x5d4744[_0xedcd('0x35')],_0x5d4744['query']);_0x580568[_0xedcd('0x39')]=_[_0xedcd('0x38')](_0x5d4744['model'],qs[_0xedcd('0x3a')](_0x3dd8b3[_0xedcd('0x36')][_0xedcd('0x3a')]));_0x580568[_0xedcd('0x39')]=_0x580568[_0xedcd('0x39')][_0xedcd('0x3b')]?_0x580568[_0xedcd('0x39')]:_0x5d4744[_0xedcd('0x35')];if(_0x3dd8b3['query'][_0xedcd('0x46')]){_0x580568['include']=[{'all':!![]}];}_0x580568=_['merge']({},_0x580568,_0x3dd8b3['options']);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x580568)[_0xedcd('0x27')](handleEntityNotFound(_0x4a5aa7,null))[_0xedcd('0x27')](respondWithResult(_0x4a5aa7,null))[_0xedcd('0x48')](handleError(_0x4a5aa7,null));};exports[_0xedcd('0x49')]=function(_0x5755ed,_0x29647d){return db[_0xedcd('0x31')][_0xedcd('0x49')](_0x5755ed[_0xedcd('0x4a')],{})[_0xedcd('0x27')](function(_0x79890f){var _0x443e4e=_0x5755ed[_0xedcd('0x4b')][_0xedcd('0x29')]({'plain':!![]});if(!_0x443e4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x443e4e[_0xedcd('0x4c')]===_0xedcd('0x4b')){var _0xdc975a=_0x79890f[_0xedcd('0x29')]({'plain':!![]});var _0x1e67a0='Reports';return db[_0xedcd('0x4d')][_0xedcd('0x47')]({'where':{'name':_0x1e67a0,'userProfileId':_0x443e4e[_0xedcd('0x4e')]},'raw':!![]})['then'](function(_0x1072f6){if(_0x1072f6&&_0x1072f6[_0xedcd('0x4f')]===0x0){return db['UserProfileResource'][_0xedcd('0x49')]({'name':_0xdc975a['name'],'resourceId':_0xdc975a['id'],'type':_0xedcd('0x50'),'sectionId':_0x1072f6['id']},{})['then'](function(){return _0x79890f;});}else{return _0x79890f;}})['catch'](function(_0x307d8b){logger[_0xedcd('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x307d8b);throw _0x307d8b;});}return _0x79890f;})[_0xedcd('0x27')](respondWithResult(_0x29647d,0xc9))[_0xedcd('0x48')](handleError(_0x29647d,null));};exports[_0xedcd('0x26')]=function(_0x12dafb,_0x407dad){if(_0x12dafb[_0xedcd('0x4a')]['id']){delete _0x12dafb['body']['id'];}return db[_0xedcd('0x31')][_0xedcd('0x47')]({'where':{'id':_0x12dafb['params']['id']}})[_0xedcd('0x27')](handleEntityNotFound(_0x407dad,null))[_0xedcd('0x27')](saveUpdates(_0x12dafb['body'],null))[_0xedcd('0x27')](respondWithResult(_0x407dad,null))['catch'](handleError(_0x407dad,null));};exports[_0xedcd('0x28')]=function(_0x3551b9,_0x2ab786){return db[_0xedcd('0x31')][_0xedcd('0x47')]({'where':{'id':_0x3551b9['params']['id']}})[_0xedcd('0x27')](handleEntityNotFound(_0x2ab786,null))['then'](removeEntity(_0x2ab786,null))[_0xedcd('0x48')](handleError(_0x2ab786,null));};exports[_0xedcd('0x52')]=function(_0x5ca493,_0x2540a3){var _0x279185=0xa;var _0x2a3358=[_0xedcd('0x53'),_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x5af447={'SUM':_0xedcd('0x57'),'COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xedcd('0x5b')};var _0x2e02c7={'SEC_TO_TIME':_0xedcd('0x5c'),'DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':_0xedcd('0x60')};var _0x305e6f=function(_0x5e05f2){return!_[_0xedcd('0x61')]([_0xedcd('0x62'),_0xedcd('0x63'),_0xedcd('0x64'),_0xedcd('0x65')],_0x5e05f2);};var _0x4ee1be=function(_0x4ebb41){if(!_0x4ebb41||!_0x4ebb41[_0xedcd('0x66')]['length']){return'';}for(var _0x4d0305='(',_0x50ea42=0x0;_0x50ea42<_0x4ebb41['rules']['length'];_0x50ea42+=0x1){_0x50ea42>0x0&&(_0x4d0305+='\x20'+_0x4ebb41[_0xedcd('0x67')]+'\x20');_0x4d0305+=_0x4ebb41['rules'][_0x50ea42][_0xedcd('0x68')]?_0x4ee1be(_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x68')]):_0x4ebb41['rules'][_0x50ea42][_0xedcd('0x69')]+'\x20'+_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x6a')]+(_0x305e6f(_0x4ebb41[_0xedcd('0x66')][_0x50ea42]['condition'])?'\x20'+_0x4ebb41[_0xedcd('0x66')][_0x50ea42][_0xedcd('0x6b')]:'');}return _0x4d0305+')';};var _0x2ec2db={'where':{'id':_0x5ca493['params']['id']}},_0x177bbf,_0x274de0,_0x1a11d2,_0x52a901,_0x10b757;_0x2ec2db=_[_0xedcd('0x6c')]({},_0x2ec2db,_0x5ca493[_0xedcd('0x6d')]);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x2ec2db)['then'](function(_0x4eff26){if(_0x4eff26){_0x177bbf=_0x4eff26;return _0x4eff26['getFields']();}return null;})[_0xedcd('0x27')](function(_0x58fd12){if(_0x58fd12){if(!_0x58fd12[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))][(_0xedcd('0x6f'))](_0xedcd('0x70'),0x193);}_0x274de0=_0x58fd12;return db[_0xedcd('0x71')][_0xedcd('0x44')]({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0x1bff43){if(_0x1bff43){_0x1a11d2=_[_0xedcd('0x72')](_0x1bff43,'id');var _0x5de8fa;var _0x3bd228=squel[_0xedcd('0x73')]();_0x3bd228[_0xedcd('0x74')](_0x177bbf[_0xedcd('0x75')]);for(var _0xa51eca=0x0;_0xa51eca<_0x274de0[_0xedcd('0x3b')];_0xa51eca+=0x1){_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x76')]?_0x1a11d2[_0x274de0[_0xa51eca]['MetricId']]['metric']:_0x274de0[_0xa51eca][_0xedcd('0x69')];_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x5af447[_0x274de0[_0xa51eca][_0xedcd('0x77')]],'%s',_0x5de8fa):_0x5de8fa;_0x5de8fa=_0x274de0[_0xa51eca][_0xedcd('0x79')]?_[_0xedcd('0x78')](_0x2e02c7[_0x274de0[_0xa51eca][_0xedcd('0x79')]],'%s',_0x5de8fa):_0x5de8fa;if(_0x274de0[_0xa51eca][_0xedcd('0x7a')]){_0x3bd228[_0xedcd('0x68')](_0x5de8fa);}_0x274de0[_0xa51eca][_0xedcd('0x7b')]&&_0x3bd228[_0xedcd('0x3e')](_0x5de8fa,_0x274de0[_0xa51eca][_0xedcd('0x7b')]===_0xedcd('0x7c')?![]:!![]);_0x3bd228[_0xedcd('0x69')](_0x5de8fa,_0x274de0[_0xa51eca][_0xedcd('0x7d')]||_0x5de8fa);}if(_0x177bbf[_0xedcd('0x7e')]){_0x177bbf[_0xedcd('0x7e')]=JSON[_0xedcd('0x7f')](_0x177bbf[_0xedcd('0x7e')]);for(var _0x26239b=0x0;_0x26239b<_0x177bbf[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x26239b+=0x1){if(_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')]&&_[_0xedcd('0x61')](_0x2a3358,_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')])&&_0x177bbf['joins'][_0x26239b]['parentKey']&&_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')]&&_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x81')]){_0x3bd228[_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x33')]](_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x177bbf[_0xedcd('0x75')],_0x177bbf[_0xedcd('0x7e')][_0x26239b]['parentKey'],_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x80')],_0x177bbf[_0xedcd('0x7e')][_0x26239b][_0xedcd('0x81')]));}}}if(_0x177bbf[_0xedcd('0x83')]){_0x177bbf[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x177bbf['conditions']);_0x3bd228[_0xedcd('0x40')](_0x4ee1be(_0x177bbf[_0xedcd('0x83')][_0xedcd('0x68')]));}_0x10b757=_0x3bd228['clone']();_0x3bd228[_0xedcd('0x1e')](_0x279185);_0x3bd228[_0xedcd('0x1d')](0x0);logger[_0xedcd('0x84')](_0xedcd('0x85'),_0x3bd228[_0xedcd('0x86')]());return dbH[_0xedcd('0x87')][_0xedcd('0x36')](_0x3bd228['toString'](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')][_0xedcd('0x89')]});}})[_0xedcd('0x27')](respondWithResult(_0x2540a3,null))['catch'](handleError(_0x2540a3,null));};function runReport(_0x124a23,_0x249b9f,_0x8963ea){var _0x14113a=_0x249b9f['name'];var _0x5f4a84=0xa;var _0x441917=[_0xedcd('0x53'),_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x2dbdb4={'SUM':_0xedcd('0x57'),'COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':_0xedcd('0x8a'),'AVG':_0xedcd('0x8b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xedcd('0x8c'),'GROUP_CONCAT DESC':_0xedcd('0x5b')};var _0xa0034b={'SEC_TO_TIME':_0xedcd('0x5c'),'DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3fcc70=function(_0xcf840d){return!_['includes'](['IS\x20NULL',_0xedcd('0x63'),_0xedcd('0x64'),_0xedcd('0x65')],_0xcf840d);};var _0x50dcb5=function(_0x3425db){if(!_0x3425db||!_0x3425db[_0xedcd('0x66')][_0xedcd('0x3b')]){return'';}for(var _0x5aa4f1='(',_0x3c65f6=0x0;_0x3c65f6<_0x3425db[_0xedcd('0x66')][_0xedcd('0x3b')];_0x3c65f6+=0x1){_0x3c65f6>0x0&&(_0x5aa4f1+='\x20'+_0x3425db[_0xedcd('0x67')]+'\x20');_0x5aa4f1+=_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x68')]?_0x50dcb5(_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x68')]):_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x69')]+'\x20'+_0x3425db['rules'][_0x3c65f6][_0xedcd('0x6a')]+(_0x3fcc70(_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x6a')])?'\x20'+_0x3425db[_0xedcd('0x66')][_0x3c65f6][_0xedcd('0x6b')]:'');}return _0x5aa4f1+')';};var _0x5ab59a={'where':{'id':_0x124a23['id']}},_0x19185c,_0x42f1af,_0x147b86,_0x457e5a,_0x20f54c;_0x5ab59a=_[_0xedcd('0x6c')]({},_0x5ab59a,_0x8963ea);return db[_0xedcd('0x31')][_0xedcd('0x47')](_0x5ab59a)['then'](function(_0x3894a8){if(_0x3894a8){_0x19185c=_0x3894a8;return _0x3894a8[_0xedcd('0x8d')]();}return null;})[_0xedcd('0x27')](function(_0x3769cf){if(_0x3769cf){if(!_0x3769cf[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))]['ValidationErrorItem'](_0xedcd('0x70'),0x193);}_0x42f1af=_0x3769cf;return db[_0xedcd('0x71')][_0xedcd('0x44')]({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0x485513){if(_0x485513){_0x147b86=_['keyBy'](_0x485513,'id');var _0x53f476;var _0x6de9af=squel['select']();_0x6de9af[_0xedcd('0x74')](_0x19185c[_0xedcd('0x75')]);for(var _0x992ba3=0x0;_0x992ba3<_0x42f1af[_0xedcd('0x3b')];_0x992ba3+=0x1){_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x76')]?_0x147b86[_0x42f1af[_0x992ba3][_0xedcd('0x76')]]['metric']:_0x42f1af[_0x992ba3][_0xedcd('0x69')];_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x2dbdb4[_0x42f1af[_0x992ba3][_0xedcd('0x77')]],'%s',_0x53f476):_0x53f476;_0x53f476=_0x42f1af[_0x992ba3][_0xedcd('0x79')]?_['replace'](_0xa0034b[_0x42f1af[_0x992ba3]['format']],'%s',_0x53f476):_0x53f476;if(_0x42f1af[_0x992ba3][_0xedcd('0x7a')]){_0x6de9af[_0xedcd('0x68')](_0x53f476);}_0x42f1af[_0x992ba3][_0xedcd('0x7b')]&&_0x6de9af[_0xedcd('0x3e')](_0x53f476,_0x42f1af[_0x992ba3][_0xedcd('0x7b')]==='DESC'?![]:!![]);_0x6de9af[_0xedcd('0x69')](_0x53f476,_0x42f1af[_0x992ba3]['alias']||_0x53f476);}if(_0x19185c[_0xedcd('0x7e')]){_0x19185c[_0xedcd('0x7e')]=JSON[_0xedcd('0x7f')](_0x19185c[_0xedcd('0x7e')]);for(var _0x1cecaa=0x0;_0x1cecaa<_0x19185c[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x1cecaa+=0x1){if(_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x33')]&&_[_0xedcd('0x61')](_0x441917,_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x33')])&&_0x19185c[_0xedcd('0x7e')][_0x1cecaa]['parentKey']&&_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')]&&_0x19185c['joins'][_0x1cecaa][_0xedcd('0x81')]){_0x6de9af[_0x19185c['joins'][_0x1cecaa]['type']](_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x19185c[_0xedcd('0x75')],_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x8e')],_0x19185c[_0xedcd('0x7e')][_0x1cecaa][_0xedcd('0x80')],_0x19185c['joins'][_0x1cecaa][_0xedcd('0x81')]));}}}if(_0x19185c[_0xedcd('0x83')]){_0x19185c[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x19185c['conditions']);_0x6de9af['where'](_0x50dcb5(_0x19185c[_0xedcd('0x83')][_0xedcd('0x68')]));}_0x20f54c=_0x6de9af[_0xedcd('0x8f')]();_0x6de9af[_0xedcd('0x1e')](_0x5f4a84);_0x6de9af['offset'](0x0);return;}})['then'](function(){if(_0x249b9f['output']===_0xedcd('0x90')){return null;}var _0xdf23=_['merge'](_0x249b9f,{'name':_0x249b9f[_0xedcd('0x91')]||_0x249b9f[_0xedcd('0x2d')]||_0x19185c['name'],'basename':_0x14113a,'savename':util[_0xedcd('0x79')](_0xedcd('0x92'),_0x249b9f[_0xedcd('0x2d')]||_0x19185c[_0xedcd('0x2d')],require(_0xedcd('0x93'))[_0xedcd('0x94')](0x4),_0x249b9f[_0xedcd('0x95')]||'csv'),'reportId':_0x19185c['id'],'reportType':_0xedcd('0x96')});return db[_0xedcd('0x97')][_0xedcd('0x49')](_0xdf23,{'raw':!![]});})[_0xedcd('0x27')](function(_0x74ba12){if(_0x19185c[_0xedcd('0x75')]===_0xedcd('0x98')){_0x20f54c['where'](_0x19185c[_0xedcd('0x75')]+_0xedcd('0x99'),_0x249b9f[_0xedcd('0x9a')],_0x249b9f[_0xedcd('0x9b')]);}else{_0x20f54c[_0xedcd('0x40')](_0x19185c[_0xedcd('0x75')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x249b9f[_0xedcd('0x9a')],_0x249b9f[_0xedcd('0x9b')]);}if(_0x74ba12){logger[_0xedcd('0x9c')](_0xedcd('0x9d'),_0x20f54c[_0xedcd('0x86')]());require(_0xedcd('0x9e'))[_0xedcd('0x9f')](path[_0xedcd('0x53')](__dirname,'../../components/export/',_0x74ba12['output']),[_0x74ba12['id'],_0x20f54c[_0xedcd('0x86')](),path[_0xedcd('0x53')](__dirname,_0xedcd('0xa0'),_0x74ba12[_0xedcd('0xa1')]),_0x14113a]);return _0x74ba12;}else{var _0x11e3bc=squel[_0xedcd('0x73')]();_0x11e3bc[_0xedcd('0x74')]('('+_0x20f54c[_0xedcd('0x86')]()+')',_0xedcd('0xa2'));_0x11e3bc['field'](_0xedcd('0xa3'),_0xedcd('0x20'));_0x20f54c[_0xedcd('0x1e')](_0x249b9f['limit']||_0x5f4a84);_0x20f54c[_0xedcd('0x1d')](_0x249b9f[_0xedcd('0x1d')]||0x0);return dbH[_0xedcd('0x87')]['query'](_0x11e3bc['toString'](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')][_0xedcd('0x89')]})[_0xedcd('0x27')](function(_0x4e67ab){if(!_0x4e67ab[_0xedcd('0x3b')]){_0x457e5a=0x0;}else{_0x457e5a=_0x4e67ab[0x0]['count']||0x0;}return dbH[_0xedcd('0x87')][_0xedcd('0x36')](_0x20f54c[_0xedcd('0x86')](),{'type':dbH[_0xedcd('0x87')][_0xedcd('0x88')]['SELECT']});})[_0xedcd('0x27')](function(_0x3a9c48){return{'rows':_0x3a9c48||[],'count':_0x457e5a};});}});}exports[_0xedcd('0xa4')]=function(_0x15624b,_0x50d069){return runReport(_0x15624b['params'],_0x15624b['query'],_0x15624b['options'])[_0xedcd('0x27')](respondWithResult(_0x50d069,null))[_0xedcd('0x48')](handleError(_0x50d069,null));};exports[_0xedcd('0xa5')]=runReport;exports['query']=function(_0x272cc3,_0x482663){var _0x214efe=0xa;var _0x51a69a=['join',_0xedcd('0x54'),_0xedcd('0x55'),_0xedcd('0x56')];var _0x2ea0a2={'SUM':'SUM(%s)','COUNT':_0xedcd('0x58'),'COUNT DISTINCT':_0xedcd('0x59'),'MAX':_0xedcd('0x5a'),'MIN':_0xedcd('0x8a'),'AVG':_0xedcd('0x8b'),'GROUP_CONCAT':_0xedcd('0xa6'),'GROUP_CONCAT ASC':_0xedcd('0x8c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x8aaf73={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xedcd('0x5d'),'HOUR':_0xedcd('0x5e'),'ROUND':_0xedcd('0x5f'),'UNIX_TIMESTAMP':_0xedcd('0x60')};var _0x408f54=function(_0x150802){return!_[_0xedcd('0x61')]([_0xedcd('0x62'),'IS\x20NOT\x20NULL',_0xedcd('0x64'),_0xedcd('0x65')],_0x150802);};var _0x12355e=function(_0x1275bd){if(!_0x1275bd||!_0x1275bd[_0xedcd('0x66')][_0xedcd('0x3b')]){return'';}for(var _0x5ae020='(',_0x29a1a2=0x0;_0x29a1a2<_0x1275bd[_0xedcd('0x66')]['length'];_0x29a1a2+=0x1){_0x29a1a2>0x0&&(_0x5ae020+='\x20'+_0x1275bd[_0xedcd('0x67')]+'\x20');_0x5ae020+=_0x1275bd['rules'][_0x29a1a2][_0xedcd('0x68')]?_0x12355e(_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x68')]):_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x69')]+'\x20'+_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x6a')]+(_0x408f54(_0x1275bd[_0xedcd('0x66')][_0x29a1a2]['condition'])?'\x20'+_0x1275bd[_0xedcd('0x66')][_0x29a1a2][_0xedcd('0x6b')]:'');}return _0x5ae020+')';};var _0x358e11={'where':{'id':_0x272cc3[_0xedcd('0x45')]['id']}},_0x139fbf,_0x4c902e,_0x7019c5,_0x18df84,_0x2cc929;_0x358e11=_[_0xedcd('0x6c')]({},_0x358e11,_0x272cc3[_0xedcd('0x6d')]);return db[_0xedcd('0x31')]['find'](_0x358e11)['then'](function(_0x4c51fd){if(_0x4c51fd){_0x139fbf=_0x4c51fd;return _0x4c51fd[_0xedcd('0x8d')]();}return null;})[_0xedcd('0x27')](function(_0xca8b18){if(_0xca8b18){if(!_0xca8b18[_0xedcd('0x3b')]){throw new db[(_0xedcd('0x6e'))][(_0xedcd('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4c902e=_0xca8b18;return db[_0xedcd('0x71')]['findAll']({'raw':!![]});}return null;})[_0xedcd('0x27')](function(_0xac03f7){if(_0xac03f7){_0x7019c5=_['keyBy'](_0xac03f7,'id');var _0x31234f;var _0x1e4301=squel[_0xedcd('0x73')]();_0x1e4301[_0xedcd('0x74')](_0x139fbf['table']);for(var _0x2662b4=0x0;_0x2662b4<_0x4c902e[_0xedcd('0x3b')];_0x2662b4+=0x1){_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x76')]?_0x7019c5[_0x4c902e[_0x2662b4]['MetricId']]['metric']:_0x4c902e[_0x2662b4]['field'];_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x77')]?_[_0xedcd('0x78')](_0x2ea0a2[_0x4c902e[_0x2662b4][_0xedcd('0x77')]],'%s',_0x31234f):_0x31234f;_0x31234f=_0x4c902e[_0x2662b4][_0xedcd('0x79')]?_['replace'](_0x8aaf73[_0x4c902e[_0x2662b4][_0xedcd('0x79')]],'%s',_0x31234f):_0x31234f;if(_0x4c902e[_0x2662b4][_0xedcd('0x7a')]){_0x1e4301[_0xedcd('0x68')](_0x31234f);}_0x4c902e[_0x2662b4]['orderBy']&&_0x1e4301[_0xedcd('0x3e')](_0x31234f,_0x4c902e[_0x2662b4][_0xedcd('0x7b')]==='DESC'?![]:!![]);_0x1e4301[_0xedcd('0x69')](_0x31234f,_0x4c902e[_0x2662b4][_0xedcd('0x7d')]||_0x31234f);}if(_0x139fbf[_0xedcd('0x7e')]){_0x139fbf['joins']=JSON[_0xedcd('0x7f')](_0x139fbf[_0xedcd('0x7e')]);for(var _0x210532=0x0;_0x210532<_0x139fbf[_0xedcd('0x7e')][_0xedcd('0x3b')];_0x210532+=0x1){if(_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x33')]&&_['includes'](_0x51a69a,_0x139fbf['joins'][_0x210532]['type'])&&_0x139fbf['joins'][_0x210532][_0xedcd('0x8e')]&&_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')]&&_0x139fbf['joins'][_0x210532]['foreignKey']){_0x1e4301[_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x33')]](_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')],null,util[_0xedcd('0x79')](_0xedcd('0x82'),_0x139fbf[_0xedcd('0x75')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x8e')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x80')],_0x139fbf[_0xedcd('0x7e')][_0x210532][_0xedcd('0x81')]));}}}if(_0x139fbf[_0xedcd('0x83')]){_0x139fbf[_0xedcd('0x83')]=JSON[_0xedcd('0x7f')](_0x139fbf[_0xedcd('0x83')]);_0x1e4301['where'](_0x12355e(_0x139fbf['conditions'][_0xedcd('0x68')]));}_0x2cc929=_0x1e4301[_0xedcd('0x8f')]();_0x1e4301[_0xedcd('0x1e')](_0x214efe);_0x1e4301[_0xedcd('0x1d')](0x0);logger[_0xedcd('0x84')](_0xedcd('0x85'),_0x1e4301[_0xedcd('0x86')]());return dbH[_0xedcd('0x87')]['query'](_0x1e4301['toString'](),{'type':dbH[_0xedcd('0x87')]['QueryTypes']['SELECT']});}})[_0xedcd('0x27')](function(){return{'sql':_0x2cc929[_0xedcd('0x86')]()};})['then'](respondWithResult(_0x482663,null))[_0xedcd('0x48')](handleError(_0x482663,null));};
\ No newline at end of file
+var _0xc448=['getFields','select','from','metric','groupBy','clone','output','fullPath','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','countTable','COUNT(*)','SELECT','run','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','show','params','keys','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0xd0746a,_0x726b2b){var _0x36985b=function(_0x252b45){while(--_0x252b45){_0xd0746a['push'](_0xd0746a['shift']());}};_0x36985b(++_0x726b2b);}(_0xc448,0xbc));var _0x8c44=function(_0x4c4edd,_0x31cce5){_0x4c4edd=_0x4c4edd-0x0;var _0x329a8a=_0xc448[_0x4c4edd];return _0x329a8a;};'use strict';var emlformat=require(_0x8c44('0x0'));var rimraf=require(_0x8c44('0x1'));var zipdir=require(_0x8c44('0x2'));var jsonpatch=require(_0x8c44('0x3'));var rp=require(_0x8c44('0x4'));var moment=require(_0x8c44('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c44('0x6'));var util=require(_0x8c44('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8c44('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c44('0x9'));var _=require(_0x8c44('0xa'));var squel=require(_0x8c44('0xb'));var crypto=require(_0x8c44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8c44('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8c44('0xe'));var Papa=require(_0x8c44('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c44('0x11'))(_0x8c44('0x12'));var utils=require(_0x8c44('0x13'));var config=require(_0x8c44('0x14'));var licenseUtil=require(_0x8c44('0x15'));var db=require(_0x8c44('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5ad87f,_0x361606){_0x361606=_0x361606||0xcc;return function(_0x472eef){if(_0x472eef){return _0x5ad87f[_0x8c44('0x17')](_0x361606);}return _0x5ad87f['status'](_0x361606)[_0x8c44('0x18')]();};}function respondWithResult(_0x2769a2,_0x1e6fb2){_0x1e6fb2=_0x1e6fb2||0xc8;return function(_0x4db10c){if(_0x4db10c){return _0x2769a2[_0x8c44('0x19')](_0x1e6fb2)[_0x8c44('0x1a')](_0x4db10c);}};}function respondWithFilteredResult(_0x569cb6,_0x19e564){return function(_0x286cbe){if(_0x286cbe){var _0x2c4178=typeof _0x19e564[_0x8c44('0x1b')]==='undefined'&&typeof _0x19e564[_0x8c44('0x1c')]==='undefined';var _0x1b8146=_0x286cbe[_0x8c44('0x1d')];var _0x1e86e0=_0x2c4178?0x0:_0x19e564[_0x8c44('0x1b')];var _0x27876e=_0x2c4178?_0x286cbe['count']:_0x19e564[_0x8c44('0x1b')]+_0x19e564[_0x8c44('0x1c')];var _0x889282;if(_0x27876e>=_0x1b8146){_0x27876e=_0x1b8146;_0x889282=0xc8;}else{_0x889282=0xce;}_0x569cb6['status'](_0x889282);return _0x569cb6[_0x8c44('0x1e')](_0x8c44('0x1f'),_0x1e86e0+'-'+_0x27876e+'/'+_0x1b8146)[_0x8c44('0x1a')](_0x286cbe);}return null;};}function patchUpdates(_0xce1595){return function(_0xc43a48){try{jsonpatch['apply'](_0xc43a48,_0xce1595,!![]);}catch(_0x247303){return BPromise[_0x8c44('0x20')](_0x247303);}return _0xc43a48[_0x8c44('0x21')]();};}function saveUpdates(_0x2ae733,_0xec2324){return function(_0x2b9c7a){if(_0x2b9c7a){return _0x2b9c7a[_0x8c44('0x22')](_0x2ae733)['then'](function(_0x3d4c5f){return _0x3d4c5f;});}return null;};}function removeEntity(_0x203e05,_0x7a70a4){return function(_0x51dc47){if(_0x51dc47){return _0x51dc47[_0x8c44('0x23')]()[_0x8c44('0x24')](function(){var _0x55a290=_0x51dc47[_0x8c44('0x25')]({'plain':!![]});var _0x1ba2b2='CustomReports';return db[_0x8c44('0x26')][_0x8c44('0x23')]({'where':{'type':_0x1ba2b2,'resourceId':_0x55a290['id']}})[_0x8c44('0x24')](function(){return _0x51dc47;});})[_0x8c44('0x24')](function(){_0x203e05['status'](0xcc)[_0x8c44('0x18')]();});}};}function handleEntityNotFound(_0x1db34c,_0x4c3c41){return function(_0x531def){if(!_0x531def){_0x1db34c[_0x8c44('0x17')](0x194);}return _0x531def;};}function handleError(_0x1f8a83,_0x35b828){_0x35b828=_0x35b828||0x1f4;return function(_0x3ecc1a){logger[_0x8c44('0x27')](_0x3ecc1a[_0x8c44('0x28')]);if(_0x3ecc1a[_0x8c44('0x29')]){delete _0x3ecc1a[_0x8c44('0x29')];}_0x1f8a83[_0x8c44('0x19')](_0x35b828)['send'](_0x3ecc1a);};}exports['index']=function(_0x2effcd,_0x407d7a){var _0x235a1a={},_0x547d5e={},_0x252d76={'count':0x0,'rows':[]};var _0xd060d5=_['map'](db[_0x8c44('0x2a')][_0x8c44('0x2b')],function(_0x1c2355){return{'name':_0x1c2355[_0x8c44('0x2c')],'type':_0x1c2355[_0x8c44('0x2d')][_0x8c44('0x2e')]};});_0x547d5e[_0x8c44('0x2f')]=_['map'](_0xd060d5,'name');_0x547d5e[_0x8c44('0x30')]=_['keys'](_0x2effcd[_0x8c44('0x30')]);_0x547d5e[_0x8c44('0x31')]=_['intersection'](_0x547d5e[_0x8c44('0x2f')],_0x547d5e[_0x8c44('0x30')]);_0x235a1a[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x547d5e['model'],qs[_0x8c44('0x34')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x34')]));_0x235a1a[_0x8c44('0x32')]=_0x235a1a[_0x8c44('0x32')][_0x8c44('0x35')]?_0x235a1a[_0x8c44('0x32')]:_0x547d5e['model'];if(!_0x2effcd['query'][_0x8c44('0x36')](_0x8c44('0x37'))){_0x235a1a[_0x8c44('0x1c')]=qs[_0x8c44('0x1c')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1c')]);_0x235a1a['offset']=qs['offset'](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1b')]);}_0x235a1a[_0x8c44('0x38')]=qs[_0x8c44('0x39')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x39')]);_0x235a1a[_0x8c44('0x3a')]=qs[_0x8c44('0x31')](_[_0x8c44('0x3b')](_0x2effcd[_0x8c44('0x30')],_0x547d5e[_0x8c44('0x31')]),_0xd060d5);if(_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]){_0x235a1a[_0x8c44('0x3a')]=_[_0x8c44('0x3d')](_0x235a1a['where'],{'$or':_[_0x8c44('0x3e')](_0xd060d5,function(_0x5e2c16){if(_0x5e2c16[_0x8c44('0x2d')]!==_0x8c44('0x3f')){var _0x4cf1d2={};_0x4cf1d2[_0x5e2c16[_0x8c44('0x29')]]={'$like':'%'+_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]+'%'};return _0x4cf1d2;}})});}_0x235a1a=_[_0x8c44('0x3d')]({},_0x235a1a,_0x2effcd['options']);var _0x1ccaa2={'where':_0x235a1a[_0x8c44('0x3a')]};return db['AnalyticCustomReport'][_0x8c44('0x1d')](_0x1ccaa2)[_0x8c44('0x24')](function(_0x81fa4e){_0x252d76[_0x8c44('0x1d')]=_0x81fa4e;if(_0x2effcd[_0x8c44('0x30')]['includeAll']){_0x235a1a[_0x8c44('0x40')]=[{'all':!![]}];}return db[_0x8c44('0x2a')][_0x8c44('0x41')](_0x235a1a);})['then'](function(_0x352a39){_0x252d76[_0x8c44('0x42')]=_0x352a39;return _0x252d76;})['then'](respondWithFilteredResult(_0x407d7a,_0x235a1a))['catch'](handleError(_0x407d7a,null));};exports[_0x8c44('0x43')]=function(_0x4628a4,_0x522d19){var _0x142d15={'raw':![],'where':{'id':_0x4628a4[_0x8c44('0x44')]['id']}},_0x2c2d23={};_0x2c2d23[_0x8c44('0x2f')]=_[_0x8c44('0x45')](db['AnalyticCustomReport'][_0x8c44('0x2b')]);_0x2c2d23['query']=_['keys'](_0x4628a4[_0x8c44('0x30')]);_0x2c2d23['filters']=_[_0x8c44('0x33')](_0x2c2d23[_0x8c44('0x2f')],_0x2c2d23['query']);_0x142d15[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x2c2d23['model'],qs[_0x8c44('0x34')](_0x4628a4['query'][_0x8c44('0x34')]));_0x142d15[_0x8c44('0x32')]=_0x142d15[_0x8c44('0x32')][_0x8c44('0x35')]?_0x142d15[_0x8c44('0x32')]:_0x2c2d23['model'];if(_0x4628a4[_0x8c44('0x30')][_0x8c44('0x46')]){_0x142d15[_0x8c44('0x40')]=[{'all':!![]}];}_0x142d15=_[_0x8c44('0x3d')]({},_0x142d15,_0x4628a4[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x142d15)[_0x8c44('0x24')](handleEntityNotFound(_0x522d19,null))['then'](respondWithResult(_0x522d19,null))[_0x8c44('0x49')](handleError(_0x522d19,null));};exports[_0x8c44('0x4a')]=function(_0x33cfb0,_0xfb831d){return db[_0x8c44('0x2a')]['create'](_0x33cfb0[_0x8c44('0x4b')],{})[_0x8c44('0x24')](function(_0x5e7d4a){var _0x48e72d=_0x33cfb0[_0x8c44('0x4c')]['get']({'plain':!![]});if(!_0x48e72d)throw new Error(_0x8c44('0x4d'));if(_0x48e72d[_0x8c44('0x4e')]==='user'){var _0x2445eb=_0x5e7d4a['get']({'plain':!![]});var _0xcceb0c=_0x8c44('0x4f');return db[_0x8c44('0x50')]['find']({'where':{'name':_0xcceb0c,'userProfileId':_0x48e72d[_0x8c44('0x51')]},'raw':!![]})[_0x8c44('0x24')](function(_0x32bd3d){if(_0x32bd3d&&_0x32bd3d[_0x8c44('0x52')]===0x0){return db[_0x8c44('0x26')][_0x8c44('0x4a')]({'name':_0x2445eb[_0x8c44('0x29')],'resourceId':_0x2445eb['id'],'type':_0x8c44('0x53'),'sectionId':_0x32bd3d['id']},{})[_0x8c44('0x24')](function(){return _0x5e7d4a;});}else{return _0x5e7d4a;}})[_0x8c44('0x49')](function(_0x18805a){logger[_0x8c44('0x27')](_0x8c44('0x54'),_0x18805a);throw _0x18805a;});}return _0x5e7d4a;})[_0x8c44('0x24')](respondWithResult(_0xfb831d,0xc9))['catch'](handleError(_0xfb831d,null));};exports['update']=function(_0x3f15b6,_0x2bd7c2){if(_0x3f15b6[_0x8c44('0x4b')]['id']){delete _0x3f15b6[_0x8c44('0x4b')]['id'];}return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x3f15b6['params']['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x2bd7c2,null))['then'](saveUpdates(_0x3f15b6[_0x8c44('0x4b')],null))[_0x8c44('0x24')](respondWithResult(_0x2bd7c2,null))['catch'](handleError(_0x2bd7c2,null));};exports[_0x8c44('0x23')]=function(_0x441e54,_0x5194c0){return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x441e54[_0x8c44('0x44')]['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x5194c0,null))[_0x8c44('0x24')](removeEntity(_0x5194c0,null))['catch'](handleError(_0x5194c0,null));};exports[_0x8c44('0x55')]=function(_0x5c4523,_0x384d79){var _0x3b0436=0xa;var _0x258f66=[_0x8c44('0x56'),_0x8c44('0x57'),_0x8c44('0x58'),_0x8c44('0x59')];var _0x348080={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ec0d0={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x18cdac=function(_0x4b6375){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),_0x8c44('0x64'),_0x8c44('0x65')],_0x4b6375);};var _0x39dd88=function(_0x5f5347){if(!_0x5f5347||!_0x5f5347['rules'][_0x8c44('0x35')]){return'';}for(var _0x43ae35='(',_0x43363d=0x0;_0x43363d<_0x5f5347[_0x8c44('0x66')][_0x8c44('0x35')];_0x43363d+=0x1){_0x43363d>0x0&&(_0x43ae35+='\x20'+_0x5f5347['operator']+'\x20');_0x43ae35+=_0x5f5347[_0x8c44('0x66')][_0x43363d]['group']?_0x39dd88(_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x67')]):_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x68')]+'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x69')]+(_0x18cdac(_0x5f5347['rules'][_0x43363d][_0x8c44('0x69')])?'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x6a')]:'');}return _0x43ae35+')';};var _0x38f929={'where':{'id':_0x5c4523[_0x8c44('0x44')]['id']}},_0x384015,_0x6fbeb0,_0x58653b,_0x54e07c,_0x4496fa;_0x38f929=_[_0x8c44('0x3d')]({},_0x38f929,_0x5c4523[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x38f929)[_0x8c44('0x24')](function(_0x334eea){if(_0x334eea){_0x384015=_0x334eea;return _0x334eea['getFields']();}return null;})[_0x8c44('0x24')](function(_0x550e3e){if(_0x550e3e){if(!_0x550e3e[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x6fbeb0=_0x550e3e;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x7d282d){if(_0x7d282d){_0x58653b=_[_0x8c44('0x6f')](_0x7d282d,'id');var _0x3f3486;var _0x87cbfd=squel['select']();_0x87cbfd['from'](_0x384015[_0x8c44('0x70')]);for(var _0x1e6750=0x0;_0x1e6750<_0x6fbeb0[_0x8c44('0x35')];_0x1e6750+=0x1){_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]?_0x58653b[_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]]['metric']:_0x6fbeb0[_0x1e6750]['field'];_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x72')]?_[_0x8c44('0x73')](_0x348080[_0x6fbeb0[_0x1e6750]['function']],'%s',_0x3f3486):_0x3f3486;_0x3f3486=_0x6fbeb0[_0x1e6750]['format']?_[_0x8c44('0x73')](_0x1ec0d0[_0x6fbeb0[_0x1e6750][_0x8c44('0x74')]],'%s',_0x3f3486):_0x3f3486;if(_0x6fbeb0[_0x1e6750]['groupBy']){_0x87cbfd[_0x8c44('0x67')](_0x3f3486);}_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]&&_0x87cbfd[_0x8c44('0x38')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x87cbfd[_0x8c44('0x68')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x77')]||_0x3f3486);}if(_0x384015[_0x8c44('0x78')]){_0x384015[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x384015['joins']);for(var _0x178a26=0x0;_0x178a26<_0x384015['joins'][_0x8c44('0x35')];_0x178a26+=0x1){if(_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x258f66,_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')])&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')]&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')]&&_0x384015[_0x8c44('0x78')][_0x178a26]['foreignKey']){_0x87cbfd[_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]](_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')],null,util[_0x8c44('0x74')](_0x8c44('0x7c'),_0x384015[_0x8c44('0x70')],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')],_0x384015[_0x8c44('0x78')][_0x178a26]['foreignTable'],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7d')]));}}}if(_0x384015[_0x8c44('0x7e')]){_0x384015[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x384015[_0x8c44('0x7e')]);_0x87cbfd[_0x8c44('0x3a')](_0x39dd88(_0x384015[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x4496fa=_0x87cbfd['clone']();_0x87cbfd[_0x8c44('0x1c')](_0x3b0436);_0x87cbfd[_0x8c44('0x1b')](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x87cbfd[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x87cbfd[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](respondWithResult(_0x384d79,null))[_0x8c44('0x49')](handleError(_0x384d79,null));};function runReport(_0x52b284,_0x1683e4,_0x190279){var _0x54f781=_0x1683e4[_0x8c44('0x29')];var _0x29e337=0xa;var _0x2b919e=[_0x8c44('0x56'),'left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x59af2b={'SUM':_0x8c44('0x84'),'COUNT':_0x8c44('0x85'),'COUNT DISTINCT':_0x8c44('0x86'),'MAX':_0x8c44('0x5a'),'MIN':_0x8c44('0x87'),'AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x490771={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d1172=function(_0x464eb2){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x464eb2);};var _0x2779e3=function(_0x432cbc){if(!_0x432cbc||!_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0xf06ab8='(',_0x4a1f39=0x0;_0x4a1f39<_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')];_0x4a1f39+=0x1){_0x4a1f39>0x0&&(_0xf06ab8+='\x20'+_0x432cbc['operator']+'\x20');_0xf06ab8+=_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]?_0x2779e3(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]):_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x68')]+'\x20'+_0x432cbc['rules'][_0x4a1f39][_0x8c44('0x69')]+(_0x2d1172(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x69')])?'\x20'+_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x6a')]:'');}return _0xf06ab8+')';};var _0x36392e={'where':{'id':_0x52b284['id']}},_0x1d7f49,_0x29d551,_0x14d747,_0x2a05cd,_0x5f5310;_0x36392e=_[_0x8c44('0x3d')]({},_0x36392e,_0x190279);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x36392e)[_0x8c44('0x24')](function(_0x15b389){if(_0x15b389){_0x1d7f49=_0x15b389;return _0x15b389[_0x8c44('0x8a')]();}return null;})[_0x8c44('0x24')](function(_0xb8a6bf){if(_0xb8a6bf){if(!_0xb8a6bf[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x29d551=_0xb8a6bf;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x1ef2da){if(_0x1ef2da){_0x14d747=_['keyBy'](_0x1ef2da,'id');var _0x3a57f4;var _0x1d6030=squel[_0x8c44('0x8b')]();_0x1d6030[_0x8c44('0x8c')](_0x1d7f49[_0x8c44('0x70')]);for(var _0x69f34b=0x0;_0x69f34b<_0x29d551[_0x8c44('0x35')];_0x69f34b+=0x1){_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x71')]?_0x14d747[_0x29d551[_0x69f34b]['MetricId']][_0x8c44('0x8d')]:_0x29d551[_0x69f34b][_0x8c44('0x68')];_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x72')]?_['replace'](_0x59af2b[_0x29d551[_0x69f34b][_0x8c44('0x72')]],'%s',_0x3a57f4):_0x3a57f4;_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x74')]?_['replace'](_0x490771[_0x29d551[_0x69f34b][_0x8c44('0x74')]],'%s',_0x3a57f4):_0x3a57f4;if(_0x29d551[_0x69f34b][_0x8c44('0x8e')]){_0x1d6030[_0x8c44('0x67')](_0x3a57f4);}_0x29d551[_0x69f34b]['orderBy']&&_0x1d6030[_0x8c44('0x38')](_0x3a57f4,_0x29d551[_0x69f34b]['orderBy']===_0x8c44('0x76')?![]:!![]);_0x1d6030[_0x8c44('0x68')](_0x3a57f4,_0x29d551[_0x69f34b][_0x8c44('0x77')]||_0x3a57f4);}if(_0x1d7f49[_0x8c44('0x78')]){_0x1d7f49['joins']=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x78')]);for(var _0x5cda5f=0x0;_0x5cda5f<_0x1d7f49[_0x8c44('0x78')]['length'];_0x5cda5f+=0x1){if(_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x2b919e,_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')])&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')]&&_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')]&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]){_0x1d6030[_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]](_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1d7f49[_0x8c44('0x70')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7b')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]));}}}if(_0x1d7f49[_0x8c44('0x7e')]){_0x1d7f49[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x7e')]);_0x1d6030[_0x8c44('0x3a')](_0x2779e3(_0x1d7f49[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x5f5310=_0x1d6030[_0x8c44('0x8f')]();_0x1d6030[_0x8c44('0x1c')](_0x29e337);_0x1d6030[_0x8c44('0x1b')](0x0);return;}})['then'](function(){if(_0x1683e4[_0x8c44('0x90')]==='web'){return null;}var _0x3e443a=_[_0x8c44('0x3d')](_0x1683e4,{'name':_0x1683e4[_0x8c44('0x91')]||_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],'basename':_0x54f781,'savename':util[_0x8c44('0x74')]('%s-%s.%s',_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],require('randomstring')[_0x8c44('0x92')](0x4),_0x1683e4[_0x8c44('0x90')]||_0x8c44('0x93')),'reportId':_0x1d7f49['id'],'reportType':_0x8c44('0x94')});return db[_0x8c44('0x95')][_0x8c44('0x4a')](_0x3e443a,{'raw':!![]});})[_0x8c44('0x24')](function(_0x32567b){if(_0x1d7f49['table']==='cdr'){_0x5f5310[_0x8c44('0x3a')](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x96'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}else{_0x5f5310['where'](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x99'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}if(_0x32567b){logger['info'](_0x8c44('0x9a'),_0x5f5310[_0x8c44('0x81')]());require('child_process')[_0x8c44('0x9b')](path['join'](__dirname,_0x8c44('0x9c'),_0x32567b[_0x8c44('0x90')]),[_0x32567b['id'],_0x5f5310[_0x8c44('0x81')](),path['join'](__dirname,'../../files/reports',_0x32567b['savename']),_0x54f781]);return _0x32567b;}else{var _0x4720a8=squel[_0x8c44('0x8b')]();_0x4720a8[_0x8c44('0x8c')]('('+_0x5f5310[_0x8c44('0x81')]()+')',_0x8c44('0x9d'));_0x4720a8['field'](_0x8c44('0x9e'),_0x8c44('0x1d'));_0x5f5310[_0x8c44('0x1c')](_0x1683e4['limit']||_0x29e337);_0x5f5310[_0x8c44('0x1b')](_0x1683e4[_0x8c44('0x1b')]||0x0);return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x4720a8['toString'](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]})[_0x8c44('0x24')](function(_0x18be19){if(!_0x18be19[_0x8c44('0x35')]){_0x2a05cd=0x0;}else{_0x2a05cd=_0x18be19[0x0][_0x8c44('0x1d')]||0x0;}return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x5f5310[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]});})[_0x8c44('0x24')](function(_0x3a27ba){return{'rows':_0x3a27ba||[],'count':_0x2a05cd};});}});}exports[_0x8c44('0xa0')]=function(_0x453929,_0xc5c110){return runReport(_0x453929[_0x8c44('0x44')],_0x453929[_0x8c44('0x30')],_0x453929[_0x8c44('0x47')])[_0x8c44('0x24')](respondWithResult(_0xc5c110,null))[_0x8c44('0x49')](handleError(_0xc5c110,null));};exports[_0x8c44('0xa1')]=runReport;exports[_0x8c44('0x30')]=function(_0x10d43e,_0x20679d){var _0x1c013e=0xa;var _0x23b957=['join','left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x4ccdbc={'SUM':_0x8c44('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x570cfb={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x23fde8=function(_0x1ea945){return!_['includes'](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY',_0x8c44('0x65')],_0x1ea945);};var _0x1df086=function(_0x2427fa){if(!_0x2427fa||!_0x2427fa[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0x25a9c7='(',_0x5ab2fb=0x0;_0x5ab2fb<_0x2427fa['rules'][_0x8c44('0x35')];_0x5ab2fb+=0x1){_0x5ab2fb>0x0&&(_0x25a9c7+='\x20'+_0x2427fa[_0x8c44('0xa2')]+'\x20');_0x25a9c7+=_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['group']?_0x1df086(_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x67')]):_0x2427fa[_0x8c44('0x66')][_0x5ab2fb][_0x8c44('0x68')]+'\x20'+_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x69')]+(_0x23fde8(_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['condition'])?'\x20'+_0x2427fa['rules'][_0x5ab2fb]['value']:'');}return _0x25a9c7+')';};var _0x22072b={'where':{'id':_0x10d43e[_0x8c44('0x44')]['id']}},_0x31675d,_0x54dc77,_0x394a08,_0x36231f,_0x1a30fa;_0x22072b=_[_0x8c44('0x3d')]({},_0x22072b,_0x10d43e[_0x8c44('0x47')]);return db['AnalyticCustomReport'][_0x8c44('0x48')](_0x22072b)['then'](function(_0x4bddd8){if(_0x4bddd8){_0x31675d=_0x4bddd8;return _0x4bddd8['getFields']();}return null;})['then'](function(_0x481df5){if(_0x481df5){if(!_0x481df5[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x54dc77=_0x481df5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x21c745){if(_0x21c745){_0x394a08=_[_0x8c44('0x6f')](_0x21c745,'id');var _0x4ce2d6;var _0x1a696d=squel[_0x8c44('0x8b')]();_0x1a696d[_0x8c44('0x8c')](_0x31675d[_0x8c44('0x70')]);for(var _0x58859b=0x0;_0x58859b<_0x54dc77[_0x8c44('0x35')];_0x58859b+=0x1){_0x4ce2d6=_0x54dc77[_0x58859b]['MetricId']?_0x394a08[_0x54dc77[_0x58859b]['MetricId']][_0x8c44('0x8d')]:_0x54dc77[_0x58859b][_0x8c44('0x68')];_0x4ce2d6=_0x54dc77[_0x58859b]['function']?_[_0x8c44('0x73')](_0x4ccdbc[_0x54dc77[_0x58859b][_0x8c44('0x72')]],'%s',_0x4ce2d6):_0x4ce2d6;_0x4ce2d6=_0x54dc77[_0x58859b][_0x8c44('0x74')]?_[_0x8c44('0x73')](_0x570cfb[_0x54dc77[_0x58859b][_0x8c44('0x74')]],'%s',_0x4ce2d6):_0x4ce2d6;if(_0x54dc77[_0x58859b][_0x8c44('0x8e')]){_0x1a696d[_0x8c44('0x67')](_0x4ce2d6);}_0x54dc77[_0x58859b][_0x8c44('0x75')]&&_0x1a696d[_0x8c44('0x38')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x1a696d[_0x8c44('0x68')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x77')]||_0x4ce2d6);}if(_0x31675d[_0x8c44('0x78')]){_0x31675d[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x78')]);for(var _0x35cb8c=0x0;_0x35cb8c<_0x31675d[_0x8c44('0x78')][_0x8c44('0x35')];_0x35cb8c+=0x1){if(_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x23b957,_0x31675d['joins'][_0x35cb8c][_0x8c44('0x2d')])&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7a')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7b')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]){_0x1a696d[_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]](_0x31675d[_0x8c44('0x78')][_0x35cb8c]['foreignTable'],null,util[_0x8c44('0x74')]('%s.%s\x20=\x20%s.%s',_0x31675d[_0x8c44('0x70')],_0x31675d['joins'][_0x35cb8c]['parentKey'],_0x31675d['joins'][_0x35cb8c][_0x8c44('0x7b')],_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]));}}}if(_0x31675d[_0x8c44('0x7e')]){_0x31675d['conditions']=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x7e')]);_0x1a696d[_0x8c44('0x3a')](_0x1df086(_0x31675d['conditions'][_0x8c44('0x67')]));}_0x1a30fa=_0x1a696d[_0x8c44('0x8f')]();_0x1a696d[_0x8c44('0x1c')](_0x1c013e);_0x1a696d['offset'](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x1a696d[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x1a696d[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](function(){return{'sql':_0x1a30fa[_0x8c44('0x81')]()};})['then'](respondWithResult(_0x20679d,null))[_0x8c44('0x49')](handleError(_0x20679d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 951019a..4f45295 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 _0x1078=['AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x57a4f3,_0xa978ac){var _0x16e7d2=function(_0x214142){while(--_0x214142){_0x57a4f3['push'](_0x57a4f3['shift']());}};_0x16e7d2(++_0xa978ac);}(_0x1078,0xff));var _0x8107=function(_0x3e8b0d,_0x42a07a){_0x3e8b0d=_0x3e8b0d-0x0;var _0x82951f=_0x1078[_0x3e8b0d];return _0x82951f;};'use strict';var _=require(_0x8107('0x0'));var util=require('util');var logger=require(_0x8107('0x1'))('api');var moment=require(_0x8107('0x2'));var BPromise=require(_0x8107('0x3'));var rp=require(_0x8107('0x4'));var fs=require('fs');var path=require(_0x8107('0x5'));var rimraf=require(_0x8107('0x6'));var config=require(_0x8107('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x8107('0x8')]=function(_0x4412b2,_0x4b0392){return _0x4412b2['define'](_0x8107('0x9'),attributes,{'tableName':_0x8107('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x703e=['AnalyticCustomReport','../../config/logger','api','request-promise','./analyticCustomReport.attributes','exports','define'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x703e,0xfd));var _0xe703=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x703e[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe703('0x0'))(_0xe703('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe703('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe703('0x3'));module[_0xe703('0x4')]=function(_0x26a166,_0x49cca5){return _0x26a166[_0xe703('0x5')](_0xe703('0x6'),attributes,{'tableName':'analytics_custom_reports','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 dbb2229..d6c72fc 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 _0x71a1=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x26b00e,_0x245a09){var _0x3764c3=function(_0x30fe77){while(--_0x30fe77){_0x26b00e['push'](_0x26b00e['shift']());}};_0x3764c3(++_0x245a09);}(_0x71a1,0x11c));var _0x171a=function(_0x49081c,_0x45d068){_0x49081c=_0x49081c-0x0;var _0x2da921=_0x71a1[_0x49081c];return _0x2da921;};'use strict';var _=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var moment=require(_0x171a('0x2'));var BPromise=require(_0x171a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x171a('0x4'));var db=require(_0x171a('0x5'))['db'];var utils=require(_0x171a('0x6'));var logger=require(_0x171a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x171a('0x8'));var client=jayson[_0x171a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d7f8c,_0x5e8980,_0x1a4570){return new BPromise(function(_0x5dae66,_0x496d70){return client[_0x171a('0xa')](_0x2d7f8c,_0x1a4570)[_0x171a('0xb')](function(_0x20b3f6){logger[_0x171a('0xc')](_0x171a('0xd'),_0x5e8980,_0x171a('0xe'));logger[_0x171a('0xf')](_0x171a('0x10'),_0x5e8980,_0x171a('0xe'),JSON[_0x171a('0x11')](_0x20b3f6));if(_0x20b3f6[_0x171a('0x12')]){if(_0x20b3f6[_0x171a('0x12')]['code']===0x1f4){logger['error'](_0x171a('0xd'),_0x5e8980,_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);return _0x496d70(_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);}logger[_0x171a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e8980,_0x20b3f6['error'][_0x171a('0x13')]);return _0x5dae66(_0x20b3f6[_0x171a('0x12')][_0x171a('0x13')]);}else{logger['info'](_0x171a('0xd'),_0x5e8980,_0x171a('0xe'));_0x5dae66(_0x20b3f6['result'][_0x171a('0x13')]);}})[_0x171a('0x14')](function(_0x364611){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5e8980,_0x364611);_0x496d70(_0x364611);});});}
\ No newline at end of file
+var _0x59c3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x50604e,_0x28e40f){var _0x5bf0fa=function(_0x406aa2){while(--_0x406aa2){_0x50604e['push'](_0x50604e['shift']());}};_0x5bf0fa(++_0x28e40f);}(_0x59c3,0x110));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var moment=require(_0x359c('0x2'));var BPromise=require(_0x359c('0x3'));var rs=require(_0x359c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x359c('0x5'))['db'];var utils=require(_0x359c('0x6'));var logger=require(_0x359c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x359c('0x8'));var client=jayson[_0x359c('0x9')][_0x359c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4706,_0x3e0430,_0x483aa3){return new BPromise(function(_0x4a530f,_0x599d44){return client['request'](_0x2e4706,_0x483aa3)['then'](function(_0x405254){logger[_0x359c('0xb')](_0x359c('0xc'),_0x3e0430,_0x359c('0xd'));logger[_0x359c('0xe')](_0x359c('0xf'),_0x3e0430,'request\x20sent',JSON[_0x359c('0x10')](_0x405254));if(_0x405254[_0x359c('0x11')]){if(_0x405254[_0x359c('0x11')][_0x359c('0x12')]===0x1f4){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254[_0x359c('0x11')][_0x359c('0x13')]);return _0x599d44(_0x405254['error']['message']);}logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254['error'][_0x359c('0x13')]);return _0x4a530f(_0x405254['error']['message']);}else{logger[_0x359c('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3e0430,_0x359c('0xd'));_0x4a530f(_0x405254[_0x359c('0x14')]['message']);}})['catch'](function(_0xc8ddc9){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0xc8ddc9);_0x599d44(_0xc8ddc9);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index e552358..d4ebd8f 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 _0x93f7=['/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x93f7,0x1c5));var _0x793f=function(_0x1a9aec,_0x21b537){_0x1a9aec=_0x1a9aec-0x0;var _0x375a51=_0x93f7[_0x1a9aec];return _0x375a51;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x793f('0x0'));var timeout=require('connect-timeout');var express=require(_0x793f('0x1'));var router=express[_0x793f('0x2')]();var fs_extra=require(_0x793f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x793f('0x4'));var controller=require(_0x793f('0x5'));router[_0x793f('0x6')]('/',auth[_0x793f('0x7')](),controller[_0x793f('0x8')]);router[_0x793f('0x6')](_0x793f('0x9'),auth[_0x793f('0x7')](),controller[_0x793f('0xa')]);router['get'](_0x793f('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x793f('0x6')](_0x793f('0xc'),auth[_0x793f('0x7')](),controller[_0x793f('0xd')]);router['get'](_0x793f('0xe'),auth[_0x793f('0x7')](),controller[_0x793f('0xf')]);router[_0x793f('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x793f('0x11')](_0x793f('0x9'),auth[_0x793f('0x7')](),controller['update']);router[_0x793f('0x12')]('/:id',auth[_0x793f('0x7')](),controller[_0x793f('0x13')]);module[_0x793f('0x14')]=router;
\ No newline at end of file
+var _0xd80d=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete'];(function(_0x40fec9,_0x2dac70){var _0x5842c2=function(_0x3dc0a2){while(--_0x3dc0a2){_0x40fec9['push'](_0x40fec9['shift']());}};_0x5842c2(++_0x2dac70);}(_0xd80d,0x147));var _0xdd80=function(_0x5d8a87,_0xec0615){_0x5d8a87=_0x5d8a87-0x0;var _0x3c2448=_0xd80d[_0x5d8a87];return _0x3c2448;};'use strict';var multer=require(_0xdd80('0x0'));var util=require(_0xdd80('0x1'));var path=require(_0xdd80('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd80('0x3'));var router=express[_0xdd80('0x4')]();var fs_extra=require(_0xdd80('0x5'));var auth=require(_0xdd80('0x6'));var interaction=require(_0xdd80('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xdd80('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd80('0x9')]);router[_0xdd80('0x8')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xc')]);router[_0xdd80('0x8')](_0xdd80('0xd'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xe')]);router[_0xdd80('0x8')](_0xdd80('0xf'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x10')]);router[_0xdd80('0x8')](_0xdd80('0x11'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x12')]);router[_0xdd80('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd80('0x14')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x15')]);router[_0xdd80('0x16')](_0xdd80('0xa'),auth['isAuthenticated'](),controller[_0xdd80('0x17')]);module[_0xdd80('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index c29e8a5..cced836 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 _0xae24=['sequelize','STRING'];(function(_0x86c459,_0x426bd0){var _0xefa9ff=function(_0x168c67){while(--_0x168c67){_0x86c459['push'](_0x86c459['shift']());}};_0xefa9ff(++_0x426bd0);}(_0xae24,0x182));var _0x4ae2=function(_0xe35036,_0x529e36){_0xe35036=_0xe35036-0x0;var _0x4e47f0=_0xae24[_0xe35036];return _0x4e47f0;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x30ec42,_0x3639e1){var _0x2d8415=function(_0x4dcb3c){while(--_0x4dcb3c){_0x30ec42['push'](_0x30ec42['shift']());}};_0x2d8415(++_0x3639e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x2eb2[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index c13472b..2b07641 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 _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x2869c1,_0x34d7ec){var _0x522a30=function(_0x2af3e7){while(--_0x2af3e7){_0x2869c1['push'](_0x2869c1['shift']());}};_0x522a30(++_0x34d7ec);}(_0x187d,0x93));var _0xd187=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x187d[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x1e332e,_0x4e3356){var _0x5dfe80=function(_0x3ba1cd){while(--_0x3ba1cd){_0x1e332e['push'](_0x1e332e['shift']());}};_0x5dfe80(++_0x4e3356);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'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 _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0a7bd2f..e5face4 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 _0xbe2a=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x386858,_0x26deda){var _0x104a60=function(_0x499286){while(--_0x499286){_0x386858['push'](_0x386858['shift']());}};_0x104a60(++_0x26deda);}(_0xbe2a,0x93));var _0xabe2=function(_0x5b6c71,_0x578194){_0x5b6c71=_0x5b6c71-0x0;var _0x35029b=_0xbe2a[_0x5b6c71];return _0x35029b;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var logger=require(_0xabe2('0x2'))(_0xabe2('0x3'));var moment=require(_0xabe2('0x4'));var BPromise=require(_0xabe2('0x5'));var rp=require(_0xabe2('0x6'));var fs=require('fs');var path=require(_0xabe2('0x7'));var rimraf=require('rimraf');var config=require(_0xabe2('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xabe2('0x9')]=function(_0x3edb35,_0x3f08c8){return _0x3edb35[_0xabe2('0xa')](_0xabe2('0xb'),attributes,{'tableName':_0xabe2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad10=['AnalyticDefaultReport','analytics_default_reports','lodash','api','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x57eb92,_0x224768){var _0x13945e=function(_0x53fa51){while(--_0x53fa51){_0x57eb92['push'](_0x57eb92['shift']());}};_0x13945e(++_0x224768);}(_0xad10,0x156));var _0x0ad1=function(_0x5f99e1,_0x1ac016){_0x5f99e1=_0x5f99e1-0x0;var _0x3871a5=_0xad10[_0x5f99e1];return _0x3871a5;};'use strict';var _=require(_0x0ad1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad1('0x2'));var rimraf=require(_0x0ad1('0x3'));var config=require(_0x0ad1('0x4'));var attributes=require(_0x0ad1('0x5'));module[_0x0ad1('0x6')]=function(_0x19d9fd,_0x22898c){return _0x19d9fd[_0x0ad1('0x7')](_0x0ad1('0x8'),attributes,{'tableName':_0x0ad1('0x9'),'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 12c8003..a72b03c 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 _0xf25b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util'];(function(_0x34793f,_0x59a6af){var _0x3a7e23=function(_0x29de0f){while(--_0x29de0f){_0x34793f['push'](_0x34793f['shift']());}};_0x3a7e23(++_0x59a6af);}(_0xf25b,0xc4));var _0xbf25=function(_0x450b29,_0x187d77){_0x450b29=_0x450b29-0x0;var _0x28df4f=_0xf25b[_0x450b29];return _0x28df4f;};'use strict';var _=require(_0xbf25('0x0'));var util=require(_0xbf25('0x1'));var moment=require('moment');var BPromise=require(_0xbf25('0x2'));var rs=require(_0xbf25('0x3'));var fs=require('fs');var Redis=require(_0xbf25('0x4'));var db=require(_0xbf25('0x5'))['db'];var utils=require(_0xbf25('0x6'));var logger=require('../../config/logger')(_0xbf25('0x7'));var config=require(_0xbf25('0x8'));var jayson=require(_0xbf25('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x140857,_0x30c468,_0x31f78e){return new BPromise(function(_0x5e6fd2,_0x783b18){return client[_0xbf25('0xa')](_0x140857,_0x31f78e)[_0xbf25('0xb')](function(_0x145ff2){logger[_0xbf25('0xc')](_0xbf25('0xd'),_0x30c468,_0xbf25('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x30c468,_0xbf25('0xe'),JSON['stringify'](_0x145ff2));if(_0x145ff2[_0xbf25('0xf')]){if(_0x145ff2['error'][_0xbf25('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x30c468,_0x145ff2['error'][_0xbf25('0x11')]);return _0x783b18(_0x145ff2['error']['message']);}logger[_0xbf25('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x30c468,_0x145ff2[_0xbf25('0xf')]['message']);return _0x5e6fd2(_0x145ff2[_0xbf25('0xf')][_0xbf25('0x11')]);}else{logger[_0xbf25('0xc')](_0xbf25('0xd'),_0x30c468,_0xbf25('0xe'));_0x5e6fd2(_0x145ff2['result'][_0xbf25('0x11')]);}})['catch'](function(_0x4cdd99){logger[_0xbf25('0xf')](_0xbf25('0xd'),_0x30c468,_0x4cdd99);_0x783b18(_0x4cdd99);});});}
\ No newline at end of file
+var _0xb115=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x4570d5,_0x115f91){var _0x314a34=function(_0x100d84){while(--_0x100d84){_0x4570d5['push'](_0x4570d5['shift']());}};_0x314a34(++_0x115f91);}(_0xb115,0x1c2));var _0x5b11=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb115[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5b11('0x0'));var util=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var rs=require(_0x5b11('0x4'));var fs=require('fs');var Redis=require(_0x5b11('0x5'));var db=require(_0x5b11('0x6'))['db'];var utils=require(_0x5b11('0x7'));var logger=require(_0x5b11('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b11('0x9'));var client=jayson[_0x5b11('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572f47,_0x489366,_0x33a530){return new BPromise(function(_0x2a737a,_0x4d94dc){return client[_0x5b11('0xb')](_0x572f47,_0x33a530)[_0x5b11('0xc')](function(_0x1627c8){logger[_0x5b11('0xd')](_0x5b11('0xe'),_0x489366,'request\x20sent');logger[_0x5b11('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'),JSON[_0x5b11('0x11')](_0x1627c8));if(_0x1627c8['error']){if(_0x1627c8[_0x5b11('0x12')][_0x5b11('0x13')]===0x1f4){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x4d94dc(_0x1627c8[_0x5b11('0x12')]['message']);}logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x2a737a(_0x1627c8['error'][_0x5b11('0x14')]);}else{logger[_0x5b11('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'));_0x2a737a(_0x1627c8['result']['message']);}})[_0x5b11('0x15')](function(_0x45bf30){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x45bf30);_0x4d94dc(_0x45bf30);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index cd1ca94..006367c 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 _0x5295=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','preview','run','/:id/query','query','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x5295,0x6c));var _0x5529=function(_0x23b93f,_0xbd249c){_0x23b93f=_0x23b93f-0x0;var _0x5794bc=_0x5295[_0x23b93f];return _0x5794bc;};'use strict';var multer=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var path=require(_0x5529('0x2'));var timeout=require(_0x5529('0x3'));var express=require(_0x5529('0x4'));var router=express[_0x5529('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5529('0x6'));var interaction=require(_0x5529('0x7'));var config=require(_0x5529('0x8'));var controller=require(_0x5529('0x9'));router[_0x5529('0xa')]('/',auth[_0x5529('0xb')](),controller['index']);router[_0x5529('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5529('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x5529('0xc')]);router[_0x5529('0xa')]('/:id/run',auth[_0x5529('0xb')](),controller[_0x5529('0xd')]);router[_0x5529('0xa')](_0x5529('0xe'),auth[_0x5529('0xb')](),controller[_0x5529('0xf')]);router[_0x5529('0x10')]('/',auth['isAuthenticated'](),controller[_0x5529('0x11')]);router[_0x5529('0x12')](_0x5529('0x13'),auth[_0x5529('0xb')](),controller[_0x5529('0x14')]);router[_0x5529('0x15')](_0x5529('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x5529('0x16')]=router;
\ No newline at end of file
+var _0xd6d1=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xd6d1,0x14a));var _0x1d6d=function(_0x294d69,_0xe46345){_0x294d69=_0x294d69-0x0;var _0x449951=_0xd6d1[_0x294d69];return _0x449951;};'use strict';var multer=require(_0x1d6d('0x0'));var util=require(_0x1d6d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d6d('0x2'));var router=express[_0x1d6d('0x3')]();var fs_extra=require(_0x1d6d('0x4'));var auth=require(_0x1d6d('0x5'));var interaction=require(_0x1d6d('0x6'));var config=require(_0x1d6d('0x7'));var controller=require(_0x1d6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d6d('0x9')](_0x1d6d('0xa'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xc')]);router[_0x1d6d('0x9')](_0x1d6d('0xd'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xe')]);router['get'](_0x1d6d('0xf'),auth[_0x1d6d('0xb')](),controller['run']);router[_0x1d6d('0x9')](_0x1d6d('0x10'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x11')]);router[_0x1d6d('0x12')]('/',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x13')]);router[_0x1d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1d6d('0x15')]);router[_0x1d6d('0x16')]('/:id',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x17')]);module[_0x1d6d('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 cb929d7..9af8a2e 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 _0xcb2f=['manual','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x4b3b5f,_0x2b3d54){var _0xfb1baf=function(_0x6ba288){while(--_0x6ba288){_0x4b3b5f['push'](_0x4b3b5f['shift']());}};_0xfb1baf(++_0x2b3d54);}(_0xcb2f,0x10f));var _0xfcb2=function(_0x34c00e,_0x4873a9){_0x34c00e=_0x34c00e-0x0;var _0x1e9548=_0xcb2f[_0x34c00e];return _0x1e9548;};'use strict';var Sequelize=require(_0xfcb2('0x0'));var moment=require('moment');module[_0xfcb2('0x1')]={'name':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfcb2('0x3')](_0xfcb2('0x4'),_0xfcb2('0x5'),_0xfcb2('0x6')),'allowNull':![],'defaultValue':_0xfcb2('0x4')},'savename':{'type':Sequelize[_0xfcb2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfcb2('0x7')]},'endDate':{'type':Sequelize[_0xfcb2('0x7')]},'status':{'type':Sequelize[_0xfcb2('0x2')],'defaultValue':_0xfcb2('0x8')},'type':{'type':Sequelize[_0xfcb2('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xfcb2('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xfcb2('0x2')]}};
\ No newline at end of file
+var _0xef46=['ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xef46,0x1b2));var _0x6ef4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xef46[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x6ef4('0x0'));var moment=require(_0x6ef4('0x1'));module[_0x6ef4('0x2')]={'name':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6ef4('0x4'),_0x6ef4('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x6ef4('0x4')},'savename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6ef4('0x6')]},'endDate':{'type':Sequelize[_0x6ef4('0x6')]},'status':{'type':Sequelize[_0x6ef4('0x3')],'defaultValue':_0x6ef4('0x7')},'type':{'type':Sequelize[_0x6ef4('0x8')](_0x6ef4('0x9'),_0x6ef4('0xa')),'allowNull':![],'defaultValue':_0x6ef4('0x9')},'reportId':{'type':Sequelize[_0x6ef4('0xb')](0xb)[_0x6ef4('0xc')]},'reportType':{'type':Sequelize[_0x6ef4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 5cecfdc..f538d3d 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 _0x2f28=['merge','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','output','existsSync','join','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','%s.%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter'];(function(_0x5c585c,_0x284a29){var _0x14ea80=function(_0xe7bbec){while(--_0xe7bbec){_0x5c585c['push'](_0x5c585c['shift']());}};_0x14ea80(++_0x284a29);}(_0x2f28,0x192));var _0x82f2=function(_0x1d38be,_0x5a9cc6){_0x1d38be=_0x1d38be-0x0;var _0x254ab4=_0x2f28[_0x1d38be];return _0x254ab4;};'use strict';var emlformat=require(_0x82f2('0x0'));var rimraf=require(_0x82f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f2('0x2'));var rp=require('request-promise');var moment=require(_0x82f2('0x3'));var BPromise=require(_0x82f2('0x4'));var Mustache=require(_0x82f2('0x5'));var util=require('util');var path=require(_0x82f2('0x6'));var sox=require(_0x82f2('0x7'));var csv=require(_0x82f2('0x8'));var ejs=require(_0x82f2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82f2('0xa'));var squel=require(_0x82f2('0xb'));var crypto=require(_0x82f2('0xc'));var jsforce=require(_0x82f2('0xd'));var deskjs=require(_0x82f2('0xe'));var toCsv=require(_0x82f2('0x8'));var querystring=require(_0x82f2('0xf'));var Papa=require(_0x82f2('0x10'));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(_0x82f2('0x11'));var logger=require(_0x82f2('0x12'))(_0x82f2('0x13'));var utils=require(_0x82f2('0x14'));var config=require(_0x82f2('0x15'));var licenseUtil=require(_0x82f2('0x16'));var db=require(_0x82f2('0x17'))['db'];function respondWithStatusCode(_0x1ef00d,_0x4ff9ec){_0x4ff9ec=_0x4ff9ec||0xcc;return function(_0x463823){if(_0x463823){return _0x1ef00d[_0x82f2('0x18')](_0x4ff9ec);}return _0x1ef00d[_0x82f2('0x19')](_0x4ff9ec)[_0x82f2('0x1a')]();};}function respondWithResult(_0x494809,_0x17ca12){_0x17ca12=_0x17ca12||0xc8;return function(_0x1af885){if(_0x1af885){return _0x494809['status'](_0x17ca12)[_0x82f2('0x1b')](_0x1af885);}};}function respondWithFilteredResult(_0x399ead,_0x10a07d){return function(_0x17c434){if(_0x17c434){var _0x5ed86f=typeof _0x10a07d[_0x82f2('0x1c')]==='undefined'&&typeof _0x10a07d[_0x82f2('0x1d')]==='undefined';var _0x4d7980=_0x17c434[_0x82f2('0x1e')];var _0x38946a=_0x5ed86f?0x0:_0x10a07d[_0x82f2('0x1c')];var _0x4da754=_0x5ed86f?_0x17c434[_0x82f2('0x1e')]:_0x10a07d[_0x82f2('0x1c')]+_0x10a07d[_0x82f2('0x1d')];var _0x222958;if(_0x4da754>=_0x4d7980){_0x4da754=_0x4d7980;_0x222958=0xc8;}else{_0x222958=0xce;}_0x399ead[_0x82f2('0x19')](_0x222958);return _0x399ead[_0x82f2('0x1f')]('Content-Range',_0x38946a+'-'+_0x4da754+'/'+_0x4d7980)['json'](_0x17c434);}return null;};}function patchUpdates(_0x549134){return function(_0x23a1fa){try{jsonpatch[_0x82f2('0x20')](_0x23a1fa,_0x549134,!![]);}catch(_0x54c84e){return BPromise[_0x82f2('0x21')](_0x54c84e);}return _0x23a1fa[_0x82f2('0x22')]();};}function saveUpdates(_0x120834,_0x1fba22){return function(_0x1b396b){if(_0x1b396b){return _0x1b396b[_0x82f2('0x23')](_0x120834)[_0x82f2('0x24')](function(_0x2b08b3){return _0x2b08b3;});}return null;};}function removeEntity(_0x4a0f4d,_0x56c5dd){return function(_0x364067){if(_0x364067){return _0x364067[_0x82f2('0x25')]()[_0x82f2('0x24')](function(){var _0x123620=_0x364067[_0x82f2('0x26')]({'plain':!![]});var _0x4b61cf='ExtractedReports';return db['UserProfileResource'][_0x82f2('0x25')]({'where':{'type':_0x4b61cf,'resourceId':_0x123620['id']}})[_0x82f2('0x24')](function(){return _0x364067;});})[_0x82f2('0x24')](function(){_0x4a0f4d['status'](0xcc)[_0x82f2('0x1a')]();});}};}function handleEntityNotFound(_0x215d9e,_0xc53486){return function(_0x4cf013){if(!_0x4cf013){_0x215d9e['sendStatus'](0x194);}return _0x4cf013;};}function handleError(_0x40c8b3,_0x3ec7f9){_0x3ec7f9=_0x3ec7f9||0x1f4;return function(_0x43a5e4){logger[_0x82f2('0x27')](_0x43a5e4[_0x82f2('0x28')]);if(_0x43a5e4[_0x82f2('0x29')]){delete _0x43a5e4['name'];}_0x40c8b3[_0x82f2('0x19')](_0x3ec7f9)[_0x82f2('0x2a')](_0x43a5e4);};}exports['index']=function(_0x5a0720,_0x1d8917){var _0x51a381={},_0x1b475f={},_0x27d7fe={'count':0x0,'rows':[]};var _0xf89ae4=_[_0x82f2('0x2b')](db['AnalyticExtractedReport'][_0x82f2('0x2c')],function(_0x4b9ebd){return{'name':_0x4b9ebd[_0x82f2('0x2d')],'type':_0x4b9ebd[_0x82f2('0x2e')][_0x82f2('0x2f')]};});_0x1b475f[_0x82f2('0x30')]=_['map'](_0xf89ae4,'name');_0x1b475f[_0x82f2('0x31')]=_[_0x82f2('0x32')](_0x5a0720[_0x82f2('0x31')]);_0x1b475f[_0x82f2('0x33')]=_[_0x82f2('0x34')](_0x1b475f[_0x82f2('0x30')],_0x1b475f['query']);_0x51a381[_0x82f2('0x35')]=_['intersection'](_0x1b475f[_0x82f2('0x30')],qs['fields'](_0x5a0720[_0x82f2('0x31')]['fields']));_0x51a381[_0x82f2('0x35')]=_0x51a381[_0x82f2('0x35')][_0x82f2('0x36')]?_0x51a381[_0x82f2('0x35')]:_0x1b475f[_0x82f2('0x30')];if(!_0x5a0720['query']['hasOwnProperty']('nolimit')){_0x51a381[_0x82f2('0x1d')]=qs[_0x82f2('0x1d')](_0x5a0720['query'][_0x82f2('0x1d')]);_0x51a381[_0x82f2('0x1c')]=qs[_0x82f2('0x1c')](_0x5a0720[_0x82f2('0x31')][_0x82f2('0x1c')]);}_0x51a381['order']=qs[_0x82f2('0x37')](_0x5a0720[_0x82f2('0x31')][_0x82f2('0x37')]);_0x51a381[_0x82f2('0x38')]=qs['filters'](_['pick'](_0x5a0720[_0x82f2('0x31')],_0x1b475f[_0x82f2('0x33')]),_0xf89ae4);if(_0x5a0720[_0x82f2('0x31')][_0x82f2('0x39')]){_0x51a381['where']=_[_0x82f2('0x3a')](_0x51a381[_0x82f2('0x38')],{'$or':_[_0x82f2('0x2b')](_0xf89ae4,function(_0xef74e2){if(_0xef74e2[_0x82f2('0x2e')]!=='VIRTUAL'){var _0x6fae50={};_0x6fae50[_0xef74e2[_0x82f2('0x29')]]={'$like':'%'+_0x5a0720[_0x82f2('0x31')][_0x82f2('0x39')]+'%'};return _0x6fae50;}})});}_0x51a381=_[_0x82f2('0x3a')]({},_0x51a381,_0x5a0720['options']);var _0x51e77e={'where':_0x51a381['where']};return db[_0x82f2('0x3b')][_0x82f2('0x1e')](_0x51e77e)['then'](function(_0x1eda7b){_0x27d7fe[_0x82f2('0x1e')]=_0x1eda7b;if(_0x5a0720['query'][_0x82f2('0x3c')]){_0x51a381[_0x82f2('0x3d')]=[{'all':!![]}];}return db[_0x82f2('0x3b')][_0x82f2('0x3e')](_0x51a381);})[_0x82f2('0x24')](function(_0x2a765){_0x27d7fe['rows']=_0x2a765;return _0x27d7fe;})[_0x82f2('0x24')](respondWithFilteredResult(_0x1d8917,_0x51a381))[_0x82f2('0x3f')](handleError(_0x1d8917,null));};exports[_0x82f2('0x40')]=function(_0x2c076a,_0x57f035){var _0x2fb4b9={'raw':!![],'where':{'id':_0x2c076a[_0x82f2('0x41')]['id']}},_0x56dd6f={};_0x56dd6f['model']=_['keys'](db[_0x82f2('0x3b')]['rawAttributes']);_0x56dd6f[_0x82f2('0x31')]=_['keys'](_0x2c076a[_0x82f2('0x31')]);_0x56dd6f['filters']=_[_0x82f2('0x34')](_0x56dd6f['model'],_0x56dd6f[_0x82f2('0x31')]);_0x2fb4b9[_0x82f2('0x35')]=_[_0x82f2('0x34')](_0x56dd6f[_0x82f2('0x30')],qs['fields'](_0x2c076a[_0x82f2('0x31')][_0x82f2('0x42')]));_0x2fb4b9[_0x82f2('0x35')]=_0x2fb4b9[_0x82f2('0x35')]['length']?_0x2fb4b9[_0x82f2('0x35')]:_0x56dd6f[_0x82f2('0x30')];if(_0x2c076a[_0x82f2('0x31')][_0x82f2('0x3c')]){_0x2fb4b9['include']=[{'all':!![]}];}_0x2fb4b9=_['merge']({},_0x2fb4b9,_0x2c076a[_0x82f2('0x43')]);return db['AnalyticExtractedReport'][_0x82f2('0x44')](_0x2fb4b9)[_0x82f2('0x24')](handleEntityNotFound(_0x57f035,null))[_0x82f2('0x24')](respondWithResult(_0x57f035,null))[_0x82f2('0x3f')](handleError(_0x57f035,null));};exports[_0x82f2('0x45')]=function(_0x53cec8,_0xc0daf9){return db[_0x82f2('0x3b')][_0x82f2('0x45')](_0x53cec8[_0x82f2('0x46')],{})['then'](function(_0x5739d9){var _0x313222=_0x53cec8['user'][_0x82f2('0x26')]({'plain':!![]});if(!_0x313222)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x313222[_0x82f2('0x47')]===_0x82f2('0x48')){var _0x100a60=_0x5739d9[_0x82f2('0x26')]({'plain':!![]});var _0xb9dbb4=_0x82f2('0x49');return db[_0x82f2('0x4a')][_0x82f2('0x44')]({'where':{'name':_0xb9dbb4,'userProfileId':_0x313222[_0x82f2('0x4b')]},'raw':!![]})[_0x82f2('0x24')](function(_0x495bcf){if(_0x495bcf&&_0x495bcf[_0x82f2('0x4c')]===0x0){return db[_0x82f2('0x4d')][_0x82f2('0x45')]({'name':_0x100a60[_0x82f2('0x29')],'resourceId':_0x100a60['id'],'type':_0x495bcf[_0x82f2('0x29')],'sectionId':_0x495bcf['id']},{})[_0x82f2('0x24')](function(){return _0x5739d9;});}else{return _0x5739d9;}})[_0x82f2('0x3f')](function(_0x344c97){logger[_0x82f2('0x27')](_0x82f2('0x4e'),_0x344c97);throw _0x344c97;});}return _0x5739d9;})['then'](respondWithResult(_0xc0daf9,0xc9))[_0x82f2('0x3f')](handleError(_0xc0daf9,null));};exports[_0x82f2('0x23')]=function(_0x3d656a,_0x5ccf2c){if(_0x3d656a[_0x82f2('0x46')]['id']){delete _0x3d656a['body']['id'];}return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x3d656a[_0x82f2('0x41')]['id']}})[_0x82f2('0x24')](handleEntityNotFound(_0x5ccf2c,null))[_0x82f2('0x24')](saveUpdates(_0x3d656a[_0x82f2('0x46')],null))[_0x82f2('0x24')](respondWithResult(_0x5ccf2c,null))[_0x82f2('0x3f')](handleError(_0x5ccf2c,null));};exports[_0x82f2('0x25')]=function(_0x4cc342,_0x1f6572){return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x4cc342['params']['id']}})[_0x82f2('0x24')](handleEntityNotFound(_0x1f6572,null))[_0x82f2('0x24')](removeEntity(_0x1f6572,null))[_0x82f2('0x3f')](handleError(_0x1f6572,null));};exports['download']=function(_0x1df177,_0xffb473,_0x30b993){return db[_0x82f2('0x3b')][_0x82f2('0x44')]({'where':{'id':_0x1df177[_0x82f2('0x41')]['id']},'attributes':[_0x82f2('0x29'),_0x82f2('0x4f'),'savename',_0x82f2('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0xffb473,null))[_0x82f2('0x24')](function(_0x47c93d){if(_0x47c93d){if(!fs[_0x82f2('0x51')](path[_0x82f2('0x52')](config['root'],_0x82f2('0x53'),_0x47c93d[_0x82f2('0x54')]))){throw new db['Sequelize'][(_0x82f2('0x55'))](_0x82f2('0x56'));}if(_0x1df177[_0x82f2('0x31')][_0x82f2('0x57')]){return _0xffb473[_0x82f2('0x18')](0xc8);}return _0xffb473[_0x82f2('0x58')](path[_0x82f2('0x52')](config[_0x82f2('0x59')],_0x82f2('0x53'),_0x47c93d[_0x82f2('0x54')]),util[_0x82f2('0x5a')](_0x82f2('0x5b'),_0x47c93d[_0x82f2('0x4f')]||_0x47c93d[_0x82f2('0x29')],_0x47c93d[_0x82f2('0x50')]['toLowerCase']()));}})[_0x82f2('0x3f')](handleError(_0xffb473,null));};
\ No newline at end of file
+var _0xa42d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','basename','eml-format','zip-dir'];(function(_0x579711,_0x389871){var _0x2d8333=function(_0x25b06d){while(--_0x25b06d){_0x579711['push'](_0x579711['shift']());}};_0x2d8333(++_0x389871);}(_0xa42d,0x18a));var _0xda42=function(_0x41c5b9,_0xdbbeb7){_0x41c5b9=_0x41c5b9-0x0;var _0x2c3ab2=_0xa42d[_0x41c5b9];return _0x2c3ab2;};'use strict';var emlformat=require(_0xda42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda42('0x2'));var moment=require(_0xda42('0x3'));var BPromise=require(_0xda42('0x4'));var Mustache=require(_0xda42('0x5'));var util=require(_0xda42('0x6'));var path=require(_0xda42('0x7'));var sox=require(_0xda42('0x8'));var csv=require(_0xda42('0x9'));var ejs=require(_0xda42('0xa'));var fs=require('fs');var fs_extra=require(_0xda42('0xb'));var _=require('lodash');var squel=require(_0xda42('0xc'));var crypto=require(_0xda42('0xd'));var jsforce=require(_0xda42('0xe'));var deskjs=require(_0xda42('0xf'));var toCsv=require(_0xda42('0x9'));var querystring=require(_0xda42('0x10'));var Papa=require(_0xda42('0x11'));var Redis=require(_0xda42('0x12'));var authService=require(_0xda42('0x13'));var qs=require(_0xda42('0x14'));var as=require(_0xda42('0x15'));var hardwareService=require(_0xda42('0x16'));var logger=require(_0xda42('0x17'))(_0xda42('0x18'));var utils=require(_0xda42('0x19'));var config=require(_0xda42('0x1a'));var licenseUtil=require(_0xda42('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545661,_0x45d3c9){_0x45d3c9=_0x45d3c9||0xcc;return function(_0x53105d){if(_0x53105d){return _0x545661[_0xda42('0x1c')](_0x45d3c9);}return _0x545661[_0xda42('0x1d')](_0x45d3c9)['end']();};}function respondWithResult(_0x18cad0,_0x50ecd6){_0x50ecd6=_0x50ecd6||0xc8;return function(_0x3c689b){if(_0x3c689b){return _0x18cad0[_0xda42('0x1d')](_0x50ecd6)[_0xda42('0x1e')](_0x3c689b);}};}function respondWithFilteredResult(_0x409325,_0x2c24ec){return function(_0x3e282c){if(_0x3e282c){var _0xe8cc03=typeof _0x2c24ec[_0xda42('0x1f')]===_0xda42('0x20')&&typeof _0x2c24ec[_0xda42('0x21')]==='undefined';var _0xfc85ce=_0x3e282c['count'];var _0x24a5a4=_0xe8cc03?0x0:_0x2c24ec['offset'];var _0x1636ec=_0xe8cc03?_0x3e282c[_0xda42('0x22')]:_0x2c24ec[_0xda42('0x1f')]+_0x2c24ec[_0xda42('0x21')];var _0x4856a0;if(_0x1636ec>=_0xfc85ce){_0x1636ec=_0xfc85ce;_0x4856a0=0xc8;}else{_0x4856a0=0xce;}_0x409325['status'](_0x4856a0);return _0x409325[_0xda42('0x23')]('Content-Range',_0x24a5a4+'-'+_0x1636ec+'/'+_0xfc85ce)['json'](_0x3e282c);}return null;};}function patchUpdates(_0x11277c){return function(_0x10217c){try{jsonpatch[_0xda42('0x24')](_0x10217c,_0x11277c,!![]);}catch(_0x30b395){return BPromise['reject'](_0x30b395);}return _0x10217c['save']();};}function saveUpdates(_0x13093c,_0xe65842){return function(_0x2fffc2){if(_0x2fffc2){return _0x2fffc2[_0xda42('0x25')](_0x13093c)[_0xda42('0x26')](function(_0x3c913a){return _0x3c913a;});}return null;};}function removeEntity(_0x30eba5,_0x225b78){return function(_0x386569){if(_0x386569){return _0x386569[_0xda42('0x27')]()['then'](function(){var _0x28b18b=_0x386569[_0xda42('0x28')]({'plain':!![]});var _0x4411c9=_0xda42('0x29');return db[_0xda42('0x2a')][_0xda42('0x27')]({'where':{'type':_0x4411c9,'resourceId':_0x28b18b['id']}})[_0xda42('0x26')](function(){return _0x386569;});})['then'](function(){_0x30eba5[_0xda42('0x1d')](0xcc)[_0xda42('0x2b')]();});}};}function handleEntityNotFound(_0x8f8238,_0x232c74){return function(_0x1be843){if(!_0x1be843){_0x8f8238['sendStatus'](0x194);}return _0x1be843;};}function handleError(_0x314d8a,_0x1fa61c){_0x1fa61c=_0x1fa61c||0x1f4;return function(_0x5e466d){logger[_0xda42('0x2c')](_0x5e466d[_0xda42('0x2d')]);if(_0x5e466d['name']){delete _0x5e466d[_0xda42('0x2e')];}_0x314d8a[_0xda42('0x1d')](_0x1fa61c)[_0xda42('0x2f')](_0x5e466d);};}exports[_0xda42('0x30')]=function(_0x51f4b8,_0x3c04a6){var _0x5d3785={},_0x27351f={},_0x26fe9c={'count':0x0,'rows':[]};var _0x3cf235=_['map'](db[_0xda42('0x31')][_0xda42('0x32')],function(_0x3ed591){return{'name':_0x3ed591[_0xda42('0x33')],'type':_0x3ed591[_0xda42('0x34')][_0xda42('0x35')]};});_0x27351f[_0xda42('0x36')]=_[_0xda42('0x37')](_0x3cf235,_0xda42('0x2e'));_0x27351f[_0xda42('0x38')]=_['keys'](_0x51f4b8[_0xda42('0x38')]);_0x27351f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],_0x27351f[_0xda42('0x38')]);_0x5d3785[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],qs['fields'](_0x51f4b8['query'][_0xda42('0x3c')]));_0x5d3785[_0xda42('0x3b')]=_0x5d3785[_0xda42('0x3b')][_0xda42('0x3d')]?_0x5d3785[_0xda42('0x3b')]:_0x27351f[_0xda42('0x36')];if(!_0x51f4b8['query'][_0xda42('0x3e')](_0xda42('0x3f'))){_0x5d3785[_0xda42('0x21')]=qs[_0xda42('0x21')](_0x51f4b8[_0xda42('0x38')]['limit']);_0x5d3785[_0xda42('0x1f')]=qs[_0xda42('0x1f')](_0x51f4b8[_0xda42('0x38')][_0xda42('0x1f')]);}_0x5d3785[_0xda42('0x40')]=qs[_0xda42('0x41')](_0x51f4b8[_0xda42('0x38')]['sort']);_0x5d3785[_0xda42('0x42')]=qs['filters'](_[_0xda42('0x43')](_0x51f4b8[_0xda42('0x38')],_0x27351f[_0xda42('0x39')]),_0x3cf235);if(_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]){_0x5d3785[_0xda42('0x42')]=_[_0xda42('0x45')](_0x5d3785[_0xda42('0x42')],{'$or':_[_0xda42('0x37')](_0x3cf235,function(_0x1db34f){if(_0x1db34f[_0xda42('0x34')]!==_0xda42('0x46')){var _0x4336f7={};_0x4336f7[_0x1db34f[_0xda42('0x2e')]]={'$like':'%'+_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]+'%'};return _0x4336f7;}})});}_0x5d3785=_[_0xda42('0x45')]({},_0x5d3785,_0x51f4b8[_0xda42('0x47')]);var _0x2d60d2={'where':_0x5d3785[_0xda42('0x42')]};return db['AnalyticExtractedReport'][_0xda42('0x22')](_0x2d60d2)[_0xda42('0x26')](function(_0x1bdf76){_0x26fe9c[_0xda42('0x22')]=_0x1bdf76;if(_0x51f4b8[_0xda42('0x38')]['includeAll']){_0x5d3785['include']=[{'all':!![]}];}return db[_0xda42('0x31')][_0xda42('0x48')](_0x5d3785);})[_0xda42('0x26')](function(_0x242ddc){_0x26fe9c['rows']=_0x242ddc;return _0x26fe9c;})[_0xda42('0x26')](respondWithFilteredResult(_0x3c04a6,_0x5d3785))[_0xda42('0x49')](handleError(_0x3c04a6,null));};exports[_0xda42('0x4a')]=function(_0x52b409,_0x544d26){var _0x4d0f37={'raw':!![],'where':{'id':_0x52b409[_0xda42('0x4b')]['id']}},_0xbdaf3f={};_0xbdaf3f['model']=_[_0xda42('0x4c')](db['AnalyticExtractedReport'][_0xda42('0x32')]);_0xbdaf3f[_0xda42('0x38')]=_[_0xda42('0x4c')](_0x52b409[_0xda42('0x38')]);_0xbdaf3f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0xbdaf3f['model'],_0xbdaf3f[_0xda42('0x38')]);_0x4d0f37[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0xbdaf3f[_0xda42('0x36')],qs[_0xda42('0x3c')](_0x52b409[_0xda42('0x38')][_0xda42('0x3c')]));_0x4d0f37['attributes']=_0x4d0f37[_0xda42('0x3b')]['length']?_0x4d0f37[_0xda42('0x3b')]:_0xbdaf3f['model'];if(_0x52b409[_0xda42('0x38')][_0xda42('0x4d')]){_0x4d0f37[_0xda42('0x4e')]=[{'all':!![]}];}_0x4d0f37=_[_0xda42('0x45')]({},_0x4d0f37,_0x52b409[_0xda42('0x47')]);return db[_0xda42('0x31')][_0xda42('0x4f')](_0x4d0f37)['then'](handleEntityNotFound(_0x544d26,null))[_0xda42('0x26')](respondWithResult(_0x544d26,null))['catch'](handleError(_0x544d26,null));};exports[_0xda42('0x50')]=function(_0x5e0e0f,_0x5150fd){return db[_0xda42('0x31')][_0xda42('0x50')](_0x5e0e0f[_0xda42('0x51')],{})['then'](function(_0x4e01cf){var _0x5c80b7=_0x5e0e0f[_0xda42('0x52')]['get']({'plain':!![]});if(!_0x5c80b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c80b7[_0xda42('0x53')]===_0xda42('0x52')){var _0x293304=_0x4e01cf[_0xda42('0x28')]({'plain':!![]});var _0x333101='ExtractedReports';return db[_0xda42('0x54')][_0xda42('0x4f')]({'where':{'name':_0x333101,'userProfileId':_0x5c80b7[_0xda42('0x55')]},'raw':!![]})[_0xda42('0x26')](function(_0x11fe55){if(_0x11fe55&&_0x11fe55[_0xda42('0x56')]===0x0){return db['UserProfileResource'][_0xda42('0x50')]({'name':_0x293304[_0xda42('0x2e')],'resourceId':_0x293304['id'],'type':_0x11fe55[_0xda42('0x2e')],'sectionId':_0x11fe55['id']},{})[_0xda42('0x26')](function(){return _0x4e01cf;});}else{return _0x4e01cf;}})[_0xda42('0x49')](function(_0x50bb8a){logger['error'](_0xda42('0x57'),_0x50bb8a);throw _0x50bb8a;});}return _0x4e01cf;})[_0xda42('0x26')](respondWithResult(_0x5150fd,0xc9))['catch'](handleError(_0x5150fd,null));};exports['update']=function(_0x7e9273,_0xe4e51e){if(_0x7e9273[_0xda42('0x51')]['id']){delete _0x7e9273[_0xda42('0x51')]['id'];}return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x7e9273[_0xda42('0x4b')]['id']}})[_0xda42('0x26')](handleEntityNotFound(_0xe4e51e,null))['then'](saveUpdates(_0x7e9273[_0xda42('0x51')],null))['then'](respondWithResult(_0xe4e51e,null))['catch'](handleError(_0xe4e51e,null));};exports['destroy']=function(_0x5bfce2,_0x502124){return db['AnalyticExtractedReport'][_0xda42('0x4f')]({'where':{'id':_0x5bfce2[_0xda42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x502124,null))['then'](removeEntity(_0x502124,null))[_0xda42('0x49')](handleError(_0x502124,null));};exports[_0xda42('0x58')]=function(_0x33adb6,_0x299a4c,_0x3474ab){return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x33adb6[_0xda42('0x4b')]['id']},'attributes':['name','basename',_0xda42('0x59'),_0xda42('0x5a')],'raw':!![]})[_0xda42('0x26')](handleEntityNotFound(_0x299a4c,null))[_0xda42('0x26')](function(_0x5e70a9){if(_0x5e70a9){if(!fs['existsSync'](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']))){throw new db[(_0xda42('0x5d'))][(_0xda42('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x33adb6[_0xda42('0x38')][_0xda42('0x5f')]){return _0x299a4c[_0xda42('0x1c')](0xc8);}return _0x299a4c[_0xda42('0x58')](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']),util[_0xda42('0x60')](_0xda42('0x61'),_0x5e70a9[_0xda42('0x62')]||_0x5e70a9[_0xda42('0x2e')],_0x5e70a9[_0xda42('0x5a')]['toLowerCase']()));}})[_0xda42('0x49')](handleError(_0x299a4c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 3263b57..9f4a342 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 _0x010b=['../../config/logger','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4b9459,_0x4460b2){var _0x21717b=function(_0x53b39a){while(--_0x53b39a){_0x4b9459['push'](_0x4b9459['shift']());}};_0x21717b(++_0x4460b2);}(_0x010b,0x127));var _0xb010=function(_0x5cbc9f,_0x75250b){_0x5cbc9f=_0x5cbc9f-0x0;var _0x21e0a7=_0x010b[_0x5cbc9f];return _0x21e0a7;};'use strict';var _=require(_0xb010('0x0'));var util=require(_0xb010('0x1'));var logger=require(_0xb010('0x2'))('api');var moment=require(_0xb010('0x3'));var BPromise=require('bluebird');var rp=require(_0xb010('0x4'));var fs=require('fs');var path=require(_0xb010('0x5'));var rimraf=require(_0xb010('0x6'));var config=require('../../config/environment');var attributes=require(_0xb010('0x7'));module['exports']=function(_0x1f5d05,_0x50658c){return _0x1f5d05[_0xb010('0x8')](_0xb010('0x9'),attributes,{'tableName':_0xb010('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5748=['moment','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x4ec80b,_0x324203){var _0x187bc7=function(_0x4a8e8a){while(--_0x4a8e8a){_0x4ec80b['push'](_0x4ec80b['shift']());}};_0x187bc7(++_0x324203);}(_0x5748,0x1d2));var _0x8574=function(_0x56b7dc,_0x5a2857){_0x56b7dc=_0x56b7dc-0x0;var _0x31a8dd=_0x5748[_0x56b7dc];return _0x31a8dd;};'use strict';var _=require(_0x8574('0x0'));var util=require(_0x8574('0x1'));var logger=require(_0x8574('0x2'))(_0x8574('0x3'));var moment=require(_0x8574('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8574('0x5'));var config=require(_0x8574('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x8574('0x7')]=function(_0x40738f,_0x4c419d){return _0x40738f['define'](_0x8574('0x8'),attributes,{'tableName':_0x8574('0x9'),'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 03a0ed0..74e1dcd 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 _0x8ca9=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0x238cec,_0x2ad1ad){var _0x654aa9=function(_0x2a00c0){while(--_0x2a00c0){_0x238cec['push'](_0x238cec['shift']());}};_0x654aa9(++_0x2ad1ad);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x8d0f51,_0x386e61){_0x8d0f51=_0x8d0f51-0x0;var _0x3166e7=_0x8ca9[_0x8d0f51];return _0x3166e7;};'use strict';var _=require('lodash');var util=require(_0x98ca('0x0'));var moment=require(_0x98ca('0x1'));var BPromise=require(_0x98ca('0x2'));var rs=require(_0x98ca('0x3'));var fs=require('fs');var Redis=require(_0x98ca('0x4'));var db=require(_0x98ca('0x5'))['db'];var utils=require(_0x98ca('0x6'));var logger=require('../../config/logger')(_0x98ca('0x7'));var config=require('../../config/environment');var jayson=require(_0x98ca('0x8'));var client=jayson[_0x98ca('0x9')][_0x98ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55aa2e,_0x5f57b3,_0x58aa49){return new BPromise(function(_0x29f20d,_0x7166c6){return client['request'](_0x55aa2e,_0x58aa49)[_0x98ca('0xb')](function(_0xfd452b){logger[_0x98ca('0xc')](_0x98ca('0xd'),_0x5f57b3,_0x98ca('0xe'));logger[_0x98ca('0xf')](_0x98ca('0x10'),_0x5f57b3,_0x98ca('0xe'),JSON['stringify'](_0xfd452b));if(_0xfd452b[_0x98ca('0x11')]){if(_0xfd452b[_0x98ca('0x11')][_0x98ca('0x12')]===0x1f4){logger[_0x98ca('0x11')](_0x98ca('0xd'),_0x5f57b3,_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);return _0x7166c6(_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);}logger[_0x98ca('0x11')](_0x98ca('0xd'),_0x5f57b3,_0xfd452b[_0x98ca('0x11')][_0x98ca('0x13')]);return _0x29f20d(_0xfd452b['error'][_0x98ca('0x13')]);}else{logger[_0x98ca('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5f57b3,'request\x20sent');_0x29f20d(_0xfd452b['result']['message']);}})[_0x98ca('0x14')](function(_0x4f176b){logger['error'](_0x98ca('0xd'),_0x5f57b3,_0x4f176b);_0x7166c6(_0x4f176b);});});}
\ No newline at end of file
+var _0x4ed8=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x50ba3a,_0x2afbd0){var _0x5a8554=function(_0x26e2d8){while(--_0x26e2d8){_0x50ba3a['push'](_0x50ba3a['shift']());}};_0x5a8554(++_0x2afbd0);}(_0x4ed8,0xc9));var _0x84ed=function(_0x323658,_0xe37515){_0x323658=_0x323658-0x0;var _0x4ad32c=_0x4ed8[_0x323658];return _0x4ad32c;};'use strict';var _=require(_0x84ed('0x0'));var util=require('util');var moment=require(_0x84ed('0x1'));var BPromise=require(_0x84ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84ed('0x4'));var logger=require(_0x84ed('0x5'))(_0x84ed('0x6'));var config=require(_0x84ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84ed('0x8')][_0x84ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4281dc,_0x14dbe2,_0x56a26a){return new BPromise(function(_0x4243c1,_0x2511cd){return client[_0x84ed('0xa')](_0x4281dc,_0x56a26a)['then'](function(_0x16c096){logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));logger[_0x84ed('0xe')](_0x84ed('0xf'),_0x14dbe2,_0x84ed('0xd'),JSON[_0x84ed('0x10')](_0x16c096));if(_0x16c096[_0x84ed('0x11')]){if(_0x16c096[_0x84ed('0x11')]['code']===0x1f4){logger['error'](_0x84ed('0xc'),_0x14dbe2,_0x16c096[_0x84ed('0x11')]['message']);return _0x2511cd(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}logger[_0x84ed('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x14dbe2,_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);return _0x4243c1(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}else{logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));_0x4243c1(_0x16c096[_0x84ed('0x13')]['message']);}})[_0x84ed('0x14')](function(_0x14a6d0){logger[_0x84ed('0x11')](_0x84ed('0xc'),_0x14dbe2,_0x14a6d0);_0x2511cd(_0x14a6d0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index bce2d68..cf26cbf 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 _0x06ee=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post'];(function(_0x2704cc,_0x5157bc){var _0x14e16e=function(_0x5c26de){while(--_0x5c26de){_0x2704cc['push'](_0x2704cc['shift']());}};_0x14e16e(++_0x5157bc);}(_0x06ee,0x110));var _0xe06e=function(_0x2c8be4,_0x380f0e){_0x2c8be4=_0x2c8be4-0x0;var _0x442531=_0x06ee[_0x2c8be4];return _0x442531;};'use strict';var multer=require('multer');var util=require(_0xe06e('0x0'));var path=require(_0xe06e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe06e('0x2'));var router=express[_0xe06e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe06e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe06e('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0xe06e('0x6')]('/',auth[_0xe06e('0x7')](),controller[_0xe06e('0x8')]);router[_0xe06e('0x6')](_0xe06e('0x9'),auth['isAuthenticated'](),controller[_0xe06e('0xa')]);router[_0xe06e('0x6')]('/:id/download',auth[_0xe06e('0x7')](),controller[_0xe06e('0xb')]);router[_0xe06e('0xc')]('/',auth['isAuthenticated'](),controller[_0xe06e('0xd')]);router[_0xe06e('0xe')](_0xe06e('0x9'),auth['isAuthenticated'](),controller[_0xe06e('0xf')]);router[_0xe06e('0x10')](_0xe06e('0x9'),auth[_0xe06e('0x7')](),controller[_0xe06e('0x11')]);module[_0xe06e('0x12')]=router;
\ No newline at end of file
+var _0xfa9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/download','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4adaf2,_0x4a7b4c){var _0x42080f=function(_0x146a50){while(--_0x146a50){_0x4adaf2['push'](_0x4adaf2['shift']());}};_0x42080f(++_0x4a7b4c);}(_0xfa9e,0x8e));var _0xefa9=function(_0x5c172,_0x343986){_0x5c172=_0x5c172-0x0;var _0x5526f3=_0xfa9e[_0x5c172];return _0x5526f3;};'use strict';var multer=require(_0xefa9('0x0'));var util=require(_0xefa9('0x1'));var path=require(_0xefa9('0x2'));var timeout=require(_0xefa9('0x3'));var express=require(_0xefa9('0x4'));var router=express[_0xefa9('0x5')]();var fs_extra=require(_0xefa9('0x6'));var auth=require(_0xefa9('0x7'));var interaction=require(_0xefa9('0x8'));var config=require(_0xefa9('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0xefa9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefa9('0xb')]);router['get']('/:id',auth[_0xefa9('0xc')](),controller[_0xefa9('0xd')]);router[_0xefa9('0xa')](_0xefa9('0xe'),auth[_0xefa9('0xc')](),controller['download']);router[_0xefa9('0xf')]('/',auth['isAuthenticated'](),controller[_0xefa9('0x10')]);router[_0xefa9('0x11')](_0xefa9('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xefa9('0x13')](_0xefa9('0x12'),auth['isAuthenticated'](),controller[_0xefa9('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 04f4f4d..1621876 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 _0x746e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x451429,_0x542d1b){var _0x52194c=function(_0x583990){while(--_0x583990){_0x451429['push'](_0x451429['shift']());}};_0x52194c(++_0x542d1b);}(_0x746e,0xf6));var _0xe746=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x746e[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xe746('0x0'));module[_0xe746('0x1')]={'field':{'type':Sequelize[_0xe746('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe746('0x3')]},'format':{'type':Sequelize[_0xe746('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe746('0x3')]},'custom':{'type':Sequelize[_0xe746('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xeffe=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2f0274,_0x2dd966){var _0x188cca=function(_0x28e7b1){while(--_0x28e7b1){_0x2f0274['push'](_0x2f0274['shift']());}};_0x188cca(++_0x2dd966);}(_0xeffe,0x1e9));var _0xeeff=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xeffe[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xeeff('0x0'));module[_0xeeff('0x1')]={'field':{'type':Sequelize[_0xeeff('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xeeff('0x3')]},'format':{'type':Sequelize[_0xeeff('0x3')]},'groupBy':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xeeff('0x3')]},'custom':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index cc63e26..ddc460a 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 _0xbe39=['body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','params','sequelize','CustomReportId','findAll','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','AnalyticFieldReport','fieldName','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','rows','catch','keys','rawAttributes','fields','includeAll','include','find','create'];(function(_0x538175,_0xec25f3){var _0x5464bc=function(_0x1d568f){while(--_0x1d568f){_0x538175['push'](_0x538175['shift']());}};_0x5464bc(++_0xec25f3);}(_0xbe39,0x196));var _0x9be3=function(_0x49b06a,_0x38699b){_0x49b06a=_0x49b06a-0x0;var _0x77a508=_0xbe39[_0x49b06a];return _0x77a508;};'use strict';var emlformat=require(_0x9be3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9be3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9be3('0x2'));var util=require(_0x9be3('0x3'));var path=require(_0x9be3('0x4'));var sox=require(_0x9be3('0x5'));var csv=require(_0x9be3('0x6'));var ejs=require(_0x9be3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9be3('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9be3('0x9'));var toCsv=require(_0x9be3('0x6'));var querystring=require(_0x9be3('0xa'));var Papa=require(_0x9be3('0xb'));var Redis=require(_0x9be3('0xc'));var authService=require(_0x9be3('0xd'));var qs=require(_0x9be3('0xe'));var as=require(_0x9be3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9be3('0x10'))(_0x9be3('0x11'));var utils=require(_0x9be3('0x12'));var config=require(_0x9be3('0x13'));var licenseUtil=require(_0x9be3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496471,_0x256f50){_0x256f50=_0x256f50||0xcc;return function(_0x153adc){if(_0x153adc){return _0x496471['sendStatus'](_0x256f50);}return _0x496471['status'](_0x256f50)['end']();};}function respondWithResult(_0x454e8f,_0x575f2c){_0x575f2c=_0x575f2c||0xc8;return function(_0x428e7d){if(_0x428e7d){return _0x454e8f[_0x9be3('0x15')](_0x575f2c)[_0x9be3('0x16')](_0x428e7d);}};}function respondWithFilteredResult(_0x391891,_0x3fb740){return function(_0x3e58a4){if(_0x3e58a4){var _0x477139=typeof _0x3fb740[_0x9be3('0x17')]===_0x9be3('0x18')&&typeof _0x3fb740['limit']===_0x9be3('0x18');var _0xe93937=_0x3e58a4[_0x9be3('0x19')];var _0x3f3637=_0x477139?0x0:_0x3fb740[_0x9be3('0x17')];var _0x4d09c2=_0x477139?_0x3e58a4[_0x9be3('0x19')]:_0x3fb740[_0x9be3('0x17')]+_0x3fb740[_0x9be3('0x1a')];var _0x42734d;if(_0x4d09c2>=_0xe93937){_0x4d09c2=_0xe93937;_0x42734d=0xc8;}else{_0x42734d=0xce;}_0x391891[_0x9be3('0x15')](_0x42734d);return _0x391891[_0x9be3('0x1b')](_0x9be3('0x1c'),_0x3f3637+'-'+_0x4d09c2+'/'+_0xe93937)[_0x9be3('0x16')](_0x3e58a4);}return null;};}function patchUpdates(_0x23dd78){return function(_0x557eb5){try{jsonpatch[_0x9be3('0x1d')](_0x557eb5,_0x23dd78,!![]);}catch(_0x3b34aa){return BPromise[_0x9be3('0x1e')](_0x3b34aa);}return _0x557eb5[_0x9be3('0x1f')]();};}function saveUpdates(_0x4fcac7,_0x315056){return function(_0x4f65e2){if(_0x4f65e2){return _0x4f65e2[_0x9be3('0x20')](_0x4fcac7)[_0x9be3('0x21')](function(_0x507fc6){return _0x507fc6;});}return null;};}function removeEntity(_0x14d077,_0x33df60){return function(_0x14bfc2){if(_0x14bfc2){return _0x14bfc2['destroy']()['then'](function(){_0x14d077['status'](0xcc)[_0x9be3('0x22')]();});}};}function handleEntityNotFound(_0x38ecc8,_0x39bde9){return function(_0x73292b){if(!_0x73292b){_0x38ecc8[_0x9be3('0x23')](0x194);}return _0x73292b;};}function handleError(_0x1287c9,_0x449c0b){_0x449c0b=_0x449c0b||0x1f4;return function(_0x2e8c52){logger[_0x9be3('0x24')](_0x2e8c52[_0x9be3('0x25')]);if(_0x2e8c52[_0x9be3('0x26')]){delete _0x2e8c52[_0x9be3('0x26')];}_0x1287c9[_0x9be3('0x15')](_0x449c0b)[_0x9be3('0x27')](_0x2e8c52);};}exports['index']=function(_0x3b2eec,_0x4fa5f2){var _0x49f4e3={},_0x5ed091={},_0x15e32b={'count':0x0,'rows':[]};var _0x38625b=_['map'](db[_0x9be3('0x28')]['rawAttributes'],function(_0x450df5){return{'name':_0x450df5[_0x9be3('0x29')],'type':_0x450df5['type'][_0x9be3('0x2a')]};});_0x5ed091[_0x9be3('0x2b')]=_[_0x9be3('0x2c')](_0x38625b,'name');_0x5ed091[_0x9be3('0x2d')]=_['keys'](_0x3b2eec[_0x9be3('0x2d')]);_0x5ed091[_0x9be3('0x2e')]=_['intersection'](_0x5ed091['model'],_0x5ed091[_0x9be3('0x2d')]);_0x49f4e3['attributes']=_[_0x9be3('0x2f')](_0x5ed091[_0x9be3('0x2b')],qs['fields'](_0x3b2eec[_0x9be3('0x2d')]['fields']));_0x49f4e3[_0x9be3('0x30')]=_0x49f4e3[_0x9be3('0x30')][_0x9be3('0x31')]?_0x49f4e3[_0x9be3('0x30')]:_0x5ed091['model'];if(!_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x32')]('nolimit')){_0x49f4e3[_0x9be3('0x1a')]=qs[_0x9be3('0x1a')](_0x3b2eec['query'][_0x9be3('0x1a')]);_0x49f4e3[_0x9be3('0x17')]=qs[_0x9be3('0x17')](_0x3b2eec['query'][_0x9be3('0x17')]);}_0x49f4e3[_0x9be3('0x33')]=qs[_0x9be3('0x34')](_0x3b2eec['query'][_0x9be3('0x34')]);_0x49f4e3[_0x9be3('0x35')]=qs['filters'](_[_0x9be3('0x36')](_0x3b2eec[_0x9be3('0x2d')],_0x5ed091[_0x9be3('0x2e')]),_0x38625b);if(_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x37')]){_0x49f4e3['where']=_[_0x9be3('0x38')](_0x49f4e3[_0x9be3('0x35')],{'$or':_['map'](_0x38625b,function(_0x49d692){if(_0x49d692[_0x9be3('0x39')]!==_0x9be3('0x3a')){var _0x5a0823={};_0x5a0823[_0x49d692[_0x9be3('0x26')]]={'$like':'%'+_0x3b2eec[_0x9be3('0x2d')][_0x9be3('0x37')]+'%'};return _0x5a0823;}})});}_0x49f4e3=_[_0x9be3('0x38')]({},_0x49f4e3,_0x3b2eec['options']);var _0x449870={'where':_0x49f4e3['where']};return db[_0x9be3('0x28')][_0x9be3('0x19')](_0x449870)['then'](function(_0x1a711e){_0x15e32b[_0x9be3('0x19')]=_0x1a711e;if(_0x3b2eec[_0x9be3('0x2d')]['includeAll']){_0x49f4e3['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x49f4e3);})[_0x9be3('0x21')](function(_0x51a451){_0x15e32b[_0x9be3('0x3b')]=_0x51a451;return _0x15e32b;})['then'](respondWithFilteredResult(_0x4fa5f2,_0x49f4e3))[_0x9be3('0x3c')](handleError(_0x4fa5f2,null));};exports['show']=function(_0x3c13ce,_0x5f3a45){var _0x192552={'raw':![],'where':{'id':_0x3c13ce['params']['id']}},_0x4bf943={};_0x4bf943['model']=_[_0x9be3('0x3d')](db[_0x9be3('0x28')][_0x9be3('0x3e')]);_0x4bf943[_0x9be3('0x2d')]=_[_0x9be3('0x3d')](_0x3c13ce[_0x9be3('0x2d')]);_0x4bf943[_0x9be3('0x2e')]=_['intersection'](_0x4bf943[_0x9be3('0x2b')],_0x4bf943['query']);_0x192552[_0x9be3('0x30')]=_[_0x9be3('0x2f')](_0x4bf943[_0x9be3('0x2b')],qs[_0x9be3('0x3f')](_0x3c13ce[_0x9be3('0x2d')][_0x9be3('0x3f')]));_0x192552[_0x9be3('0x30')]=_0x192552[_0x9be3('0x30')][_0x9be3('0x31')]?_0x192552[_0x9be3('0x30')]:_0x4bf943['model'];if(_0x3c13ce['query'][_0x9be3('0x40')]){_0x192552[_0x9be3('0x41')]=[{'all':!![]}];}_0x192552=_[_0x9be3('0x38')]({},_0x192552,_0x3c13ce['options']);return db[_0x9be3('0x28')][_0x9be3('0x42')](_0x192552)[_0x9be3('0x21')](handleEntityNotFound(_0x5f3a45,null))['then'](respondWithResult(_0x5f3a45,null))[_0x9be3('0x3c')](handleError(_0x5f3a45,null));};exports[_0x9be3('0x43')]=function(_0x465111,_0xff0281){return db[_0x9be3('0x28')]['create'](_0x465111[_0x9be3('0x44')],{})['then'](respondWithResult(_0xff0281,0xc9))['catch'](handleError(_0xff0281,null));};exports[_0x9be3('0x45')]=function(_0x21a524,_0x20523b){return db['AnalyticFieldReport'][_0x9be3('0x45')](_0x21a524[_0x9be3('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20523b,0xc9))[_0x9be3('0x3c')](handleError(_0x20523b,null));};exports[_0x9be3('0x20')]=function(_0x23fe06,_0x22bd07){if(_0x23fe06['body']['id']){delete _0x23fe06[_0x9be3('0x44')]['id'];}return db[_0x9be3('0x28')][_0x9be3('0x42')]({'where':{'id':_0x23fe06['params']['id']}})[_0x9be3('0x21')](handleEntityNotFound(_0x22bd07,null))[_0x9be3('0x21')](saveUpdates(_0x23fe06[_0x9be3('0x44')],null))[_0x9be3('0x21')](respondWithResult(_0x22bd07,null))[_0x9be3('0x3c')](handleError(_0x22bd07,null));};exports[_0x9be3('0x46')]=function(_0x17bf05,_0x14debf){return db[_0x9be3('0x28')][_0x9be3('0x42')]({'where':{'id':_0x17bf05['params']['id']}})['then'](handleEntityNotFound(_0x14debf,null))['then'](removeEntity(_0x14debf,null))[_0x9be3('0x3c')](handleError(_0x14debf,null));};exports[_0x9be3('0x47')]=function(_0xc98161,_0x23313d){return db[_0x9be3('0x28')]['destroy']({'where':{'id':_0xc98161[_0x9be3('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x9be3('0x21')](respondWithResult(_0x23313d,0xcc))[_0x9be3('0x3c')](handleError(_0x23313d,null));};exports[_0x9be3('0x48')]=function(_0xc5e5c1,_0x8fbfff,_0x5753b3){return db[_0x9be3('0x49')][_0x9be3('0x4a')]({'where':{'id':_0xc5e5c1[_0x9be3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8fbfff,null))['then'](function(_0x429321){if(_0x429321){return db[_0x9be3('0x4c')]['transaction'](function(_0x2457c4){return db[_0x9be3('0x28')][_0x9be3('0x46')]({'where':{'CustomReportId':_0xc5e5c1[_0x9be3('0x4b')]['id']},'transaction':_0x2457c4})[_0x9be3('0x21')](function(_0x566e58){var _0xae6ddc=_[_0x9be3('0x2c')](_0xc5e5c1[_0x9be3('0x44')],function(_0x2f8f8f){delete _0x2f8f8f['id'];_0x2f8f8f[_0x9be3('0x4d')]=_0xc5e5c1[_0x9be3('0x4b')]['id'];return _0x2f8f8f;});return db[_0x9be3('0x28')]['bulkCreate'](_0xae6ddc,{'transaction':_0x2457c4});});})[_0x9be3('0x21')](function(){return db[_0x9be3('0x28')][_0x9be3('0x4e')]({'where':{'CustomReportId':_0xc5e5c1['params']['id']}});});}})[_0x9be3('0x21')](respondWithResult(_0x8fbfff,null))[_0x9be3('0x3c')](handleError(_0x8fbfff,null));};
\ No newline at end of file
+var _0xf0e5=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','sendStatus','error','stack','name','send','map','AnalyticFieldReport','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','params','intersection','include','find','create','bulkCreate','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf0e5,0x185));var _0x5f0e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf0e5[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x5f0e('0x0'));var rimraf=require(_0x5f0e('0x1'));var zipdir=require(_0x5f0e('0x2'));var jsonpatch=require(_0x5f0e('0x3'));var rp=require(_0x5f0e('0x4'));var moment=require(_0x5f0e('0x5'));var BPromise=require(_0x5f0e('0x6'));var Mustache=require(_0x5f0e('0x7'));var util=require(_0x5f0e('0x8'));var path=require('path');var sox=require(_0x5f0e('0x9'));var csv=require(_0x5f0e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f0e('0xb'));var _=require(_0x5f0e('0xc'));var squel=require(_0x5f0e('0xd'));var crypto=require('crypto');var jsforce=require(_0x5f0e('0xe'));var deskjs=require(_0x5f0e('0xf'));var toCsv=require(_0x5f0e('0xa'));var querystring=require(_0x5f0e('0x10'));var Papa=require(_0x5f0e('0x11'));var Redis=require(_0x5f0e('0x12'));var authService=require(_0x5f0e('0x13'));var qs=require(_0x5f0e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f0e('0x15'));var utils=require(_0x5f0e('0x16'));var config=require(_0x5f0e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f0e('0x18'))['db'];function respondWithStatusCode(_0x64a9b2,_0x4cf23f){_0x4cf23f=_0x4cf23f||0xcc;return function(_0x1fd2be){if(_0x1fd2be){return _0x64a9b2['sendStatus'](_0x4cf23f);}return _0x64a9b2[_0x5f0e('0x19')](_0x4cf23f)[_0x5f0e('0x1a')]();};}function respondWithResult(_0x30a30e,_0x287939){_0x287939=_0x287939||0xc8;return function(_0x17df17){if(_0x17df17){return _0x30a30e[_0x5f0e('0x19')](_0x287939)[_0x5f0e('0x1b')](_0x17df17);}};}function respondWithFilteredResult(_0xbf2f2a,_0x21f168){return function(_0x15a587){if(_0x15a587){var _0x40af2b=typeof _0x21f168[_0x5f0e('0x1c')]===_0x5f0e('0x1d')&&typeof _0x21f168[_0x5f0e('0x1e')]===_0x5f0e('0x1d');var _0x40e4ab=_0x15a587[_0x5f0e('0x1f')];var _0x542c5d=_0x40af2b?0x0:_0x21f168[_0x5f0e('0x1c')];var _0x38d7a8=_0x40af2b?_0x15a587[_0x5f0e('0x1f')]:_0x21f168[_0x5f0e('0x1c')]+_0x21f168[_0x5f0e('0x1e')];var _0x4bdf42;if(_0x38d7a8>=_0x40e4ab){_0x38d7a8=_0x40e4ab;_0x4bdf42=0xc8;}else{_0x4bdf42=0xce;}_0xbf2f2a[_0x5f0e('0x19')](_0x4bdf42);return _0xbf2f2a[_0x5f0e('0x20')]('Content-Range',_0x542c5d+'-'+_0x38d7a8+'/'+_0x40e4ab)[_0x5f0e('0x1b')](_0x15a587);}return null;};}function patchUpdates(_0x20be4c){return function(_0xf70efa){try{jsonpatch[_0x5f0e('0x21')](_0xf70efa,_0x20be4c,!![]);}catch(_0x26b03b){return BPromise['reject'](_0x26b03b);}return _0xf70efa['save']();};}function saveUpdates(_0x3ace8c,_0x1a5045){return function(_0x4faa9b){if(_0x4faa9b){return _0x4faa9b[_0x5f0e('0x22')](_0x3ace8c)['then'](function(_0x373077){return _0x373077;});}return null;};}function removeEntity(_0xd2a027,_0x55eb49){return function(_0xf9ca5e){if(_0xf9ca5e){return _0xf9ca5e[_0x5f0e('0x23')]()['then'](function(){_0xd2a027[_0x5f0e('0x19')](0xcc)[_0x5f0e('0x1a')]();});}};}function handleEntityNotFound(_0x2f50a5,_0x11e761){return function(_0xc7c07e){if(!_0xc7c07e){_0x2f50a5[_0x5f0e('0x24')](0x194);}return _0xc7c07e;};}function handleError(_0x2c63ab,_0x306652){_0x306652=_0x306652||0x1f4;return function(_0x55f5dd){logger[_0x5f0e('0x25')](_0x55f5dd[_0x5f0e('0x26')]);if(_0x55f5dd[_0x5f0e('0x27')]){delete _0x55f5dd[_0x5f0e('0x27')];}_0x2c63ab['status'](_0x306652)[_0x5f0e('0x28')](_0x55f5dd);};}exports['index']=function(_0x2a47e9,_0x2d0c9f){var _0x1a1bcf={},_0x171e3c={},_0x336618={'count':0x0,'rows':[]};var _0x118ccb=_[_0x5f0e('0x29')](db[_0x5f0e('0x2a')]['rawAttributes'],function(_0x211766){return{'name':_0x211766['fieldName'],'type':_0x211766[_0x5f0e('0x2b')][_0x5f0e('0x2c')]};});_0x171e3c[_0x5f0e('0x2d')]=_[_0x5f0e('0x29')](_0x118ccb,_0x5f0e('0x27'));_0x171e3c['query']=_[_0x5f0e('0x2e')](_0x2a47e9[_0x5f0e('0x2f')]);_0x171e3c[_0x5f0e('0x30')]=_['intersection'](_0x171e3c[_0x5f0e('0x2d')],_0x171e3c['query']);_0x1a1bcf['attributes']=_['intersection'](_0x171e3c['model'],qs[_0x5f0e('0x31')](_0x2a47e9['query'][_0x5f0e('0x31')]));_0x1a1bcf[_0x5f0e('0x32')]=_0x1a1bcf[_0x5f0e('0x32')][_0x5f0e('0x33')]?_0x1a1bcf[_0x5f0e('0x32')]:_0x171e3c['model'];if(!_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x34')](_0x5f0e('0x35'))){_0x1a1bcf['limit']=qs[_0x5f0e('0x1e')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x1e')]);_0x1a1bcf[_0x5f0e('0x1c')]=qs[_0x5f0e('0x1c')](_0x2a47e9[_0x5f0e('0x2f')]['offset']);}_0x1a1bcf[_0x5f0e('0x36')]=qs[_0x5f0e('0x37')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x37')]);_0x1a1bcf[_0x5f0e('0x38')]=qs['filters'](_[_0x5f0e('0x39')](_0x2a47e9['query'],_0x171e3c[_0x5f0e('0x30')]),_0x118ccb);if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]){_0x1a1bcf[_0x5f0e('0x38')]=_[_0x5f0e('0x3b')](_0x1a1bcf[_0x5f0e('0x38')],{'$or':_[_0x5f0e('0x29')](_0x118ccb,function(_0x3b1572){if(_0x3b1572['type']!==_0x5f0e('0x3c')){var _0x2a112f={};_0x2a112f[_0x3b1572[_0x5f0e('0x27')]]={'$like':'%'+_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]+'%'};return _0x2a112f;}})});}_0x1a1bcf=_[_0x5f0e('0x3b')]({},_0x1a1bcf,_0x2a47e9[_0x5f0e('0x3d')]);var _0x2e7eaf={'where':_0x1a1bcf[_0x5f0e('0x38')]};return db[_0x5f0e('0x2a')][_0x5f0e('0x1f')](_0x2e7eaf)[_0x5f0e('0x3e')](function(_0x4cf602){_0x336618[_0x5f0e('0x1f')]=_0x4cf602;if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x1a1bcf['include']=[{'all':!![]}];}return db[_0x5f0e('0x2a')]['findAll'](_0x1a1bcf);})[_0x5f0e('0x3e')](function(_0x2eb5f6){_0x336618[_0x5f0e('0x40')]=_0x2eb5f6;return _0x336618;})[_0x5f0e('0x3e')](respondWithFilteredResult(_0x2d0c9f,_0x1a1bcf))[_0x5f0e('0x41')](handleError(_0x2d0c9f,null));};exports['show']=function(_0x300b66,_0x18ed0e){var _0x326c8c={'raw':![],'where':{'id':_0x300b66[_0x5f0e('0x42')]['id']}},_0x386858={};_0x386858[_0x5f0e('0x2d')]=_['keys'](db[_0x5f0e('0x2a')]['rawAttributes']);_0x386858[_0x5f0e('0x2f')]=_[_0x5f0e('0x2e')](_0x300b66[_0x5f0e('0x2f')]);_0x386858['filters']=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],_0x386858[_0x5f0e('0x2f')]);_0x326c8c[_0x5f0e('0x32')]=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],qs[_0x5f0e('0x31')](_0x300b66['query'][_0x5f0e('0x31')]));_0x326c8c[_0x5f0e('0x32')]=_0x326c8c['attributes'][_0x5f0e('0x33')]?_0x326c8c[_0x5f0e('0x32')]:_0x386858['model'];if(_0x300b66[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x326c8c[_0x5f0e('0x44')]=[{'all':!![]}];}_0x326c8c=_[_0x5f0e('0x3b')]({},_0x326c8c,_0x300b66[_0x5f0e('0x3d')]);return db[_0x5f0e('0x2a')][_0x5f0e('0x45')](_0x326c8c)[_0x5f0e('0x3e')](handleEntityNotFound(_0x18ed0e,null))['then'](respondWithResult(_0x18ed0e,null))['catch'](handleError(_0x18ed0e,null));};exports[_0x5f0e('0x46')]=function(_0x5c5f3f,_0x517a47){return db['AnalyticFieldReport']['create'](_0x5c5f3f['body'],{})[_0x5f0e('0x3e')](respondWithResult(_0x517a47,0xc9))[_0x5f0e('0x41')](handleError(_0x517a47,null));};exports[_0x5f0e('0x47')]=function(_0x265d01,_0x3ea3da){return db['AnalyticFieldReport']['bulkCreate'](_0x265d01[_0x5f0e('0x48')],{'raw':![],'individualHooks':!![]})[_0x5f0e('0x3e')](respondWithResult(_0x3ea3da,0xc9))[_0x5f0e('0x41')](handleError(_0x3ea3da,null));};exports[_0x5f0e('0x22')]=function(_0x30fc72,_0x3747c6){if(_0x30fc72[_0x5f0e('0x48')]['id']){delete _0x30fc72[_0x5f0e('0x48')]['id'];}return db[_0x5f0e('0x2a')][_0x5f0e('0x45')]({'where':{'id':_0x30fc72[_0x5f0e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3747c6,null))[_0x5f0e('0x3e')](saveUpdates(_0x30fc72[_0x5f0e('0x48')],null))['then'](respondWithResult(_0x3747c6,null))[_0x5f0e('0x41')](handleError(_0x3747c6,null));};exports[_0x5f0e('0x23')]=function(_0xd0650c,_0xb29786){return db[_0x5f0e('0x2a')]['find']({'where':{'id':_0xd0650c[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0xb29786,null))[_0x5f0e('0x3e')](removeEntity(_0xb29786,null))[_0x5f0e('0x41')](handleError(_0xb29786,null));};exports[_0x5f0e('0x49')]=function(_0x1b10a,_0x20ff95){return db[_0x5f0e('0x2a')][_0x5f0e('0x23')]({'where':{'id':_0x1b10a[_0x5f0e('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20ff95,0xcc))[_0x5f0e('0x41')](handleError(_0x20ff95,null));};exports['addFields']=function(_0x3a3b32,_0x413671,_0x58cd9a){return db[_0x5f0e('0x4a')][_0x5f0e('0x4b')]({'where':{'id':_0x3a3b32[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0x413671,null))['then'](function(_0x5c4d0c){if(_0x5c4d0c){return db[_0x5f0e('0x4c')]['transaction'](function(_0x1bdf43){return db[_0x5f0e('0x2a')]['destroy']({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']},'transaction':_0x1bdf43})[_0x5f0e('0x3e')](function(_0x1f34d8){var _0x42cd3b=_[_0x5f0e('0x29')](_0x3a3b32['body'],function(_0x2acff2){delete _0x2acff2['id'];_0x2acff2[_0x5f0e('0x4d')]=_0x3a3b32['params']['id'];return _0x2acff2;});return db[_0x5f0e('0x2a')][_0x5f0e('0x47')](_0x42cd3b,{'transaction':_0x1bdf43});});})[_0x5f0e('0x3e')](function(){return db['AnalyticFieldReport'][_0x5f0e('0x4e')]({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']}});});}})[_0x5f0e('0x3e')](respondWithResult(_0x413671,null))[_0x5f0e('0x41')](handleError(_0x413671,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 526259f..4796da4 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 _0xbf5d=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x136d15,_0x50f7e5){var _0xcde364=function(_0x18ee22){while(--_0x18ee22){_0x136d15['push'](_0x136d15['shift']());}};_0xcde364(++_0x50f7e5);}(_0xbf5d,0xbc));var _0xdbf5=function(_0x4569fb,_0x1952f2){_0x4569fb=_0x4569fb-0x0;var _0x19f7b9=_0xbf5d[_0x4569fb];return _0x19f7b9;};'use strict';var _=require(_0xdbf5('0x0'));var util=require(_0xdbf5('0x1'));var logger=require(_0xdbf5('0x2'))(_0xdbf5('0x3'));var moment=require(_0xdbf5('0x4'));var BPromise=require(_0xdbf5('0x5'));var rp=require(_0xdbf5('0x6'));var fs=require('fs');var path=require(_0xdbf5('0x7'));var rimraf=require(_0xdbf5('0x8'));var config=require(_0xdbf5('0x9'));var attributes=require(_0xdbf5('0xa'));module[_0xdbf5('0xb')]=function(_0x15c29d,_0x114b9a){return _0x15c29d['define'](_0xdbf5('0xc'),attributes,{'tableName':_0xdbf5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf913=['exports','define','analytics_report_fields','lodash','util','api','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x22d543,_0xdfa138){var _0x14fee8=function(_0x5cac0f){while(--_0x5cac0f){_0x22d543['push'](_0x22d543['shift']());}};_0x14fee8(++_0xdfa138);}(_0xf913,0x121));var _0x3f91=function(_0x25aa8f,_0x47ae2c){_0x25aa8f=_0x25aa8f-0x0;var _0x11a4ed=_0xf913[_0x25aa8f];return _0x11a4ed;};'use strict';var _=require(_0x3f91('0x0'));var util=require(_0x3f91('0x1'));var logger=require('../../config/logger')(_0x3f91('0x2'));var moment=require(_0x3f91('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f91('0x4'));var rimraf=require(_0x3f91('0x5'));var config=require(_0x3f91('0x6'));var attributes=require(_0x3f91('0x7'));module[_0x3f91('0x8')]=function(_0x4eb80d,_0x3d59c6){return _0x4eb80d[_0x3f91('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x3f91('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 ebf06a7..ac82c31 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 _0xf661=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x4f60a7,_0x41a500){var _0x300253=function(_0x17d5ec){while(--_0x17d5ec){_0x4f60a7['push'](_0x4f60a7['shift']());}};_0x300253(++_0x41a500);}(_0xf661,0x65));var _0x1f66=function(_0x494e0f,_0xd8adfe){_0x494e0f=_0x494e0f-0x0;var _0x39f102=_0xf661[_0x494e0f];return _0x39f102;};'use strict';var _=require(_0x1f66('0x0'));var util=require(_0x1f66('0x1'));var moment=require(_0x1f66('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f66('0x4'))['db'];var utils=require(_0x1f66('0x5'));var logger=require(_0x1f66('0x6'))(_0x1f66('0x7'));var config=require(_0x1f66('0x8'));var jayson=require(_0x1f66('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7f04,_0x22b1f9,_0x483e85){return new BPromise(function(_0x213590,_0x41826f){return client[_0x1f66('0xa')](_0x2f7f04,_0x483e85)[_0x1f66('0xb')](function(_0xeb77e3){logger[_0x1f66('0xc')](_0x1f66('0xd'),_0x22b1f9,'request\x20sent');logger[_0x1f66('0xe')](_0x1f66('0xf'),_0x22b1f9,_0x1f66('0x10'),JSON[_0x1f66('0x11')](_0xeb77e3));if(_0xeb77e3[_0x1f66('0x12')]){if(_0xeb77e3['error'][_0x1f66('0x13')]===0x1f4){logger[_0x1f66('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22b1f9,_0xeb77e3['error']['message']);return _0x41826f(_0xeb77e3[_0x1f66('0x12')][_0x1f66('0x14')]);}logger[_0x1f66('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x22b1f9,_0xeb77e3['error'][_0x1f66('0x14')]);return _0x213590(_0xeb77e3['error']['message']);}else{logger['info'](_0x1f66('0xd'),_0x22b1f9,_0x1f66('0x10'));_0x213590(_0xeb77e3[_0x1f66('0x15')][_0x1f66('0x14')]);}})[_0x1f66('0x16')](function(_0x382fd9){logger['error'](_0x1f66('0xd'),_0x22b1f9,_0x382fd9);_0x41826f(_0x382fd9);});});}
\ No newline at end of file
+var _0x436c=['ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','randomstring'];(function(_0x1b44e2,_0x32103e){var _0x428122=function(_0x3985d0){while(--_0x3985d0){_0x1b44e2['push'](_0x1b44e2['shift']());}};_0x428122(++_0x32103e);}(_0x436c,0xd9));var _0xc436=function(_0x772992,_0x5fce1e){_0x772992=_0x772992-0x0;var _0x37a9ea=_0x436c[_0x772992];return _0x37a9ea;};'use strict';var _=require('lodash');var util=require(_0xc436('0x0'));var moment=require(_0xc436('0x1'));var BPromise=require('bluebird');var rs=require(_0xc436('0x2'));var fs=require('fs');var Redis=require(_0xc436('0x3'));var db=require(_0xc436('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc436('0x5'));var client=jayson[_0xc436('0x6')][_0xc436('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b39bd,_0x1490bd,_0x23c66c){return new BPromise(function(_0x55aeea,_0x1e6aed){return client[_0xc436('0x8')](_0x1b39bd,_0x23c66c)[_0xc436('0x9')](function(_0x10002f){logger[_0xc436('0xa')](_0xc436('0xb'),_0x1490bd,_0xc436('0xc'));logger[_0xc436('0xd')](_0xc436('0xe'),_0x1490bd,_0xc436('0xc'),JSON[_0xc436('0xf')](_0x10002f));if(_0x10002f['error']){if(_0x10002f['error'][_0xc436('0x10')]===0x1f4){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x1e6aed(_0x10002f[_0xc436('0x11')]['message']);}logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x55aeea(_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);}else{logger[_0xc436('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1490bd,_0xc436('0xc'));_0x55aeea(_0x10002f[_0xc436('0x13')][_0xc436('0x12')]);}})['catch'](function(_0x1c6815){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x1c6815);_0x1e6aed(_0x1c6815);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 7ceaf59..4459f5e 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(_0xc6800a,_0x4eac70){var _0x4919d3=function(_0x1ccfa6){while(--_0x1ccfa6){_0xc6800a['push'](_0xc6800a['shift']());}};_0x4919d3(++_0x4eac70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x5fa0bf,_0x38661b){var _0x636f63=function(_0x2986dc){while(--_0x2986dc){_0x5fa0bf['push'](_0x5fa0bf['shift']());}};_0x636f63(++_0x38661b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 083fd0c..b355593 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 _0x9780=['STRING','name','TEXT'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x9780,0x1d4));var _0x0978=function(_0x255036,_0xf94145){_0x255036=_0x255036-0x0;var _0x3c4c56=_0x9780[_0x255036];return _0x3c4c56;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'unique':_0x0978('0x1')},'table':{'type':Sequelize[_0x0978('0x0')]},'metric':{'type':Sequelize[_0x0978('0x2')]},'description':{'type':Sequelize[_0x0978('0x0')]}};
\ No newline at end of file
+var _0x9703=['name','STRING'];(function(_0x452109,_0x4b63c1){var _0x3c2ffd=function(_0x57b320){while(--_0x57b320){_0x452109['push'](_0x452109['shift']());}};_0x3c2ffd(++_0x4b63c1);}(_0x9703,0xdb));var _0x3970=function(_0xaee241,_0x26d77f){_0xaee241=_0xaee241-0x0;var _0x42384c=_0x9703[_0xaee241];return _0x42384c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3970('0x0')],'allowNull':![],'unique':_0x3970('0x1')},'table':{'type':Sequelize[_0x3970('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3970('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index d847fbc..cffa330 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2576b0,_0x3fb339){var _0x2a6658=function(_0x3b5908){while(--_0x3b5908){_0x2576b0['push'](_0x2576b0['shift']());}};_0x2a6658(++_0x3fb339);}(_0xe5b3,0x133));var _0x3e5b=function(_0x59622b,_0x26e364){_0x59622b=_0x59622b-0x0;var _0x453424=_0xe5b3[_0x59622b];return _0x453424;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x008c,0x188));var _0xc008=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x008c[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2fb9752..dcfaecc 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 _0x2178=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x515ab1,_0x133504){var _0x2589ba=function(_0x430cf9){while(--_0x430cf9){_0x515ab1['push'](_0x515ab1['shift']());}};_0x2589ba(++_0x133504);}(_0x2178,0x1b0));var _0x8217=function(_0x155a36,_0x4bf39){_0x155a36=_0x155a36-0x0;var _0x3c99d0=_0x2178[_0x155a36];return _0x3c99d0;};'use strict';var _=require(_0x8217('0x0'));var util=require('util');var logger=require(_0x8217('0x1'))(_0x8217('0x2'));var moment=require(_0x8217('0x3'));var BPromise=require('bluebird');var rp=require(_0x8217('0x4'));var fs=require('fs');var path=require(_0x8217('0x5'));var rimraf=require('rimraf');var config=require(_0x8217('0x6'));var attributes=require(_0x8217('0x7'));module[_0x8217('0x8')]=function(_0x16da6e,_0x18f4bd){return _0x16da6e[_0x8217('0x9')](_0x8217('0xa'),attributes,{'tableName':_0x8217('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde81=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x389c94,_0x2a93d9){var _0x1455cb=function(_0x5903d6){while(--_0x5903d6){_0x389c94['push'](_0x389c94['shift']());}};_0x1455cb(++_0x2a93d9);}(_0xde81,0x109));var _0x1de8=function(_0x1bc13c,_0x4483a0){_0x1bc13c=_0x1bc13c-0x0;var _0x4a7ceb=_0xde81[_0x1bc13c];return _0x4a7ceb;};'use strict';var _=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var logger=require(_0x1de8('0x2'))(_0x1de8('0x3'));var moment=require(_0x1de8('0x4'));var BPromise=require(_0x1de8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x1de8('0x7'));module[_0x1de8('0x8')]=function(_0x42801a,_0x3ae723){return _0x42801a[_0x1de8('0x9')](_0x1de8('0xa'),attributes,{'tableName':_0x1de8('0xb'),'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 fe4d50e..859d541 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 _0x91fa=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c0f4c,_0x43faf6){var _0x129b93=function(_0x51b101){while(--_0x51b101){_0x5c0f4c['push'](_0x5c0f4c['shift']());}};_0x129b93(++_0x43faf6);}(_0x91fa,0x183));var _0xa91f=function(_0x390143,_0x2b54ac){_0x390143=_0x390143-0x0;var _0x11361b=_0x91fa[_0x390143];return _0x11361b;};'use strict';var _=require(_0xa91f('0x0'));var util=require('util');var moment=require(_0xa91f('0x1'));var BPromise=require(_0xa91f('0x2'));var rs=require(_0xa91f('0x3'));var fs=require('fs');var Redis=require(_0xa91f('0x4'));var db=require(_0xa91f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa91f('0x6'))(_0xa91f('0x7'));var config=require(_0xa91f('0x8'));var jayson=require(_0xa91f('0x9'));var client=jayson[_0xa91f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42ee7e,_0x8617c6,_0x32274b){return new BPromise(function(_0x1da2b6,_0x458653){return client[_0xa91f('0xb')](_0x42ee7e,_0x32274b)[_0xa91f('0xc')](function(_0x175961){logger[_0xa91f('0xd')](_0xa91f('0xe'),_0x8617c6,'request\x20sent');logger[_0xa91f('0xf')](_0xa91f('0x10'),_0x8617c6,_0xa91f('0x11'),JSON[_0xa91f('0x12')](_0x175961));if(_0x175961[_0xa91f('0x13')]){if(_0x175961['error'][_0xa91f('0x14')]===0x1f4){logger[_0xa91f('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x8617c6,_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);return _0x458653(_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);}logger[_0xa91f('0x13')](_0xa91f('0xe'),_0x8617c6,_0x175961[_0xa91f('0x13')][_0xa91f('0x15')]);return _0x1da2b6(_0x175961[_0xa91f('0x13')]['message']);}else{logger[_0xa91f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x8617c6,_0xa91f('0x11'));_0x1da2b6(_0x175961[_0xa91f('0x16')][_0xa91f('0x15')]);}})[_0xa91f('0x17')](function(_0x25cb92){logger[_0xa91f('0x13')](_0xa91f('0xe'),_0x8617c6,_0x25cb92);_0x458653(_0x25cb92);});});}
\ No newline at end of file
+var _0x8dcb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0xf0d2ff,_0x3b2df0){var _0x3b06db=function(_0x41d314){while(--_0x41d314){_0xf0d2ff['push'](_0xf0d2ff['shift']());}};_0x3b06db(++_0x3b2df0);}(_0x8dcb,0x6b));var _0xb8dc=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x8dcb[_0x3a73bc];return _0x32891b;};'use strict';var _=require('lodash');var util=require(_0xb8dc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8dc('0x1'));var fs=require('fs');var Redis=require(_0xb8dc('0x2'));var db=require(_0xb8dc('0x3'))['db'];var utils=require(_0xb8dc('0x4'));var logger=require(_0xb8dc('0x5'))(_0xb8dc('0x6'));var config=require(_0xb8dc('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x949d20,_0x588f94,_0x3d793f){return new BPromise(function(_0x2774af,_0x2996b7){return client[_0xb8dc('0x8')](_0x949d20,_0x3d793f)['then'](function(_0x54542e){logger[_0xb8dc('0x9')](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));logger['debug'](_0xb8dc('0xc'),_0x588f94,_0xb8dc('0xb'),JSON[_0xb8dc('0xd')](_0x54542e));if(_0x54542e[_0xb8dc('0xe')]){if(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0xf')]===0x1f4){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x54542e['error']['message']);return _0x2996b7(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}logger['error'](_0xb8dc('0xa'),_0x588f94,_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);return _0x2774af(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}else{logger['info'](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));_0x2774af(_0x54542e[_0xb8dc('0x11')][_0xb8dc('0x10')]);}})['catch'](function(_0x3933fd){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x3933fd);_0x2996b7(_0x3933fd);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cdbacfb..4bfd87f 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 _0x0fda=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x55ffdb,_0x295851){_0x55ffdb=_0x55ffdb-0x0;var _0x15bf09=_0x0fda[_0x55ffdb];return _0x15bf09;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var timeout=require(_0xa0fd('0x2'));var express=require(_0xa0fd('0x3'));var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xa0fd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0fd('0x8')](_0xa0fd('0x9'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xb')]);router['post']('/',auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xc')]);router[_0xa0fd('0xd')](_0xa0fd('0x9'),auth['isAuthenticated'](),controller[_0xa0fd('0xe')]);router[_0xa0fd('0xf')](_0xa0fd('0x9'),auth['isAuthenticated'](),controller[_0xa0fd('0x10')]);module[_0xa0fd('0x11')]=router;
\ No newline at end of file
+var _0x448a=['path','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x4bf89c,_0x1632bc){var _0x3bf7b6=function(_0x5b021f){while(--_0x5b021f){_0x4bf89c['push'](_0x4bf89c['shift']());}};_0x3bf7b6(++_0x1632bc);}(_0x448a,0x1ef));var _0xa448=function(_0x4a3f30,_0x44ad1c){_0x4a3f30=_0x4a3f30-0x0;var _0x1b03eb=_0x448a[_0x4a3f30];return _0x1b03eb;};'use strict';var multer=require('multer');var util=require(_0xa448('0x0'));var path=require(_0xa448('0x1'));var timeout=require('connect-timeout');var express=require(_0xa448('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa448('0x3'));var interaction=require(_0xa448('0x4'));var config=require('../../config/environment');var controller=require(_0xa448('0x5'));router[_0xa448('0x6')]('/',auth[_0xa448('0x7')](),controller[_0xa448('0x8')]);router[_0xa448('0x6')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller['show']);router['post']('/',auth[_0xa448('0x7')](),controller[_0xa448('0xa')]);router[_0xa448('0xb')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller[_0xa448('0xc')]);router[_0xa448('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa448('0xe')]);module[_0xa448('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ae45cda..90a7d9e 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 _0x0717=['exports','sequelize'];(function(_0x545cd3,_0x56761a){var _0x663f8b=function(_0x364458){while(--_0x364458){_0x545cd3['push'](_0x545cd3['shift']());}};_0x663f8b(++_0x56761a);}(_0x0717,0x7d));var _0x7071=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0717[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x7071('0x0'));module[_0x7071('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x0d06=['TEXT','sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0d06,0x94));var _0x60d0=function(_0x460264,_0x51ddff){_0x460264=_0x460264-0x0;var _0x2d75a1=_0x0d06[_0x460264];return _0x2d75a1;};'use strict';var Sequelize=require(_0x60d0('0x0'));module[_0x60d0('0x1')]={'tree':{'type':Sequelize[_0x60d0('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 6e37b09..93fec37 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 _0xc96d=['filters','intersection','fields','attributes','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','type','key','map','query'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xc96d,0x1e4));var _0xdc96=function(_0x364e40,_0x83d809){_0x364e40=_0x364e40-0x0;var _0x4fed2a=_0xc96d[_0x364e40];return _0x4fed2a;};'use strict';var emlformat=require(_0xdc96('0x0'));var rimraf=require(_0xdc96('0x1'));var zipdir=require(_0xdc96('0x2'));var jsonpatch=require(_0xdc96('0x3'));var rp=require(_0xdc96('0x4'));var moment=require(_0xdc96('0x5'));var BPromise=require(_0xdc96('0x6'));var Mustache=require(_0xdc96('0x7'));var util=require(_0xdc96('0x8'));var path=require(_0xdc96('0x9'));var sox=require('sox');var csv=require(_0xdc96('0xa'));var ejs=require(_0xdc96('0xb'));var fs=require('fs');var fs_extra=require(_0xdc96('0xc'));var _=require(_0xdc96('0xd'));var squel=require(_0xdc96('0xe'));var crypto=require(_0xdc96('0xf'));var jsforce=require(_0xdc96('0x10'));var deskjs=require(_0xdc96('0x11'));var toCsv=require(_0xdc96('0xa'));var querystring=require(_0xdc96('0x12'));var Papa=require(_0xdc96('0x13'));var Redis=require('ioredis');var authService=require(_0xdc96('0x14'));var qs=require(_0xdc96('0x15'));var as=require(_0xdc96('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdc96('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc96('0x18'))['db'];function respondWithStatusCode(_0x25cdba,_0x3d38a9){_0x3d38a9=_0x3d38a9||0xcc;return function(_0x3bc79e){if(_0x3bc79e){return _0x25cdba[_0xdc96('0x19')](_0x3d38a9);}return _0x25cdba[_0xdc96('0x1a')](_0x3d38a9)[_0xdc96('0x1b')]();};}function respondWithResult(_0x8c040e,_0x5c0ba5){_0x5c0ba5=_0x5c0ba5||0xc8;return function(_0x1e1183){if(_0x1e1183){return _0x8c040e['status'](_0x5c0ba5)[_0xdc96('0x1c')](_0x1e1183);}};}function respondWithFilteredResult(_0x32a48a,_0x40eb6d){return function(_0x5488eb){if(_0x5488eb){var _0x5f3a9c=typeof _0x40eb6d['offset']===_0xdc96('0x1d')&&typeof _0x40eb6d[_0xdc96('0x1e')]===_0xdc96('0x1d');var _0x47b4a9=_0x5488eb[_0xdc96('0x1f')];var _0x3a38d4=_0x5f3a9c?0x0:_0x40eb6d[_0xdc96('0x20')];var _0x4bf0ae=_0x5f3a9c?_0x5488eb[_0xdc96('0x1f')]:_0x40eb6d[_0xdc96('0x20')]+_0x40eb6d[_0xdc96('0x1e')];var _0x4943b7;if(_0x4bf0ae>=_0x47b4a9){_0x4bf0ae=_0x47b4a9;_0x4943b7=0xc8;}else{_0x4943b7=0xce;}_0x32a48a['status'](_0x4943b7);return _0x32a48a[_0xdc96('0x21')](_0xdc96('0x22'),_0x3a38d4+'-'+_0x4bf0ae+'/'+_0x47b4a9)[_0xdc96('0x1c')](_0x5488eb);}return null;};}function patchUpdates(_0x48b11e){return function(_0x3957ff){try{jsonpatch['apply'](_0x3957ff,_0x48b11e,!![]);}catch(_0x1acc4f){return BPromise[_0xdc96('0x23')](_0x1acc4f);}return _0x3957ff[_0xdc96('0x24')]();};}function saveUpdates(_0x4625fb,_0x5418c6){return function(_0x4e5124){if(_0x4e5124){return _0x4e5124['update'](_0x4625fb)[_0xdc96('0x25')](function(_0x4947d3){return _0x4947d3;});}return null;};}function removeEntity(_0x18abed,_0x2b95dc){return function(_0x249d58){if(_0x249d58){return _0x249d58[_0xdc96('0x26')]()[_0xdc96('0x25')](function(){_0x18abed[_0xdc96('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466086,_0x4052fd){return function(_0x583fff){if(!_0x583fff){_0x466086[_0xdc96('0x19')](0x194);}return _0x583fff;};}function handleError(_0x5639ea,_0x3b8561){_0x3b8561=_0x3b8561||0x1f4;return function(_0xbffd29){logger[_0xdc96('0x27')](_0xbffd29[_0xdc96('0x28')]);if(_0xbffd29[_0xdc96('0x29')]){delete _0xbffd29['name'];}_0x5639ea[_0xdc96('0x1a')](_0x3b8561)[_0xdc96('0x2a')](_0xbffd29);};}exports['index']=function(_0x2de094,_0x463ff8){var _0x2617ce={},_0x3592b1={},_0x15d94d={'count':0x0,'rows':[]};var _0x1990f1=_['map'](db['AnalyticTreeReport'][_0xdc96('0x2b')],function(_0x3b8258){return{'name':_0x3b8258['fieldName'],'type':_0x3b8258[_0xdc96('0x2c')][_0xdc96('0x2d')]};});_0x3592b1['model']=_[_0xdc96('0x2e')](_0x1990f1,'name');_0x3592b1[_0xdc96('0x2f')]=_['keys'](_0x2de094[_0xdc96('0x2f')]);_0x3592b1[_0xdc96('0x30')]=_[_0xdc96('0x31')](_0x3592b1['model'],_0x3592b1[_0xdc96('0x2f')]);_0x2617ce['attributes']=_['intersection'](_0x3592b1['model'],qs[_0xdc96('0x32')](_0x2de094['query']['fields']));_0x2617ce[_0xdc96('0x33')]=_0x2617ce[_0xdc96('0x33')]['length']?_0x2617ce[_0xdc96('0x33')]:_0x3592b1[_0xdc96('0x34')];if(!_0x2de094['query'][_0xdc96('0x35')]('nolimit')){_0x2617ce[_0xdc96('0x1e')]=qs['limit'](_0x2de094[_0xdc96('0x2f')]['limit']);_0x2617ce[_0xdc96('0x20')]=qs[_0xdc96('0x20')](_0x2de094[_0xdc96('0x2f')][_0xdc96('0x20')]);}_0x2617ce[_0xdc96('0x36')]=qs[_0xdc96('0x37')](_0x2de094['query'][_0xdc96('0x37')]);_0x2617ce[_0xdc96('0x38')]=qs[_0xdc96('0x30')](_[_0xdc96('0x39')](_0x2de094['query'],_0x3592b1[_0xdc96('0x30')]),_0x1990f1);if(_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3a')]){_0x2617ce['where']=_[_0xdc96('0x3b')](_0x2617ce['where'],{'$or':_[_0xdc96('0x2e')](_0x1990f1,function(_0x3fed23){if(_0x3fed23[_0xdc96('0x2c')]!==_0xdc96('0x3c')){var _0x3e7f50={};_0x3e7f50[_0x3fed23[_0xdc96('0x29')]]={'$like':'%'+_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3a')]+'%'};return _0x3e7f50;}})});}_0x2617ce=_['merge']({},_0x2617ce,_0x2de094[_0xdc96('0x3d')]);var _0x2cb1ca={'where':_0x2617ce[_0xdc96('0x38')]};return db[_0xdc96('0x3e')]['count'](_0x2cb1ca)[_0xdc96('0x25')](function(_0x477c23){_0x15d94d[_0xdc96('0x1f')]=_0x477c23;if(_0x2de094[_0xdc96('0x2f')][_0xdc96('0x3f')]){_0x2617ce[_0xdc96('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xdc96('0x41')](_0x2617ce);})[_0xdc96('0x25')](function(_0x26b6fe){_0x15d94d[_0xdc96('0x42')]=_0x26b6fe;return _0x15d94d;})[_0xdc96('0x25')](respondWithFilteredResult(_0x463ff8,_0x2617ce))['catch'](handleError(_0x463ff8,null));};exports[_0xdc96('0x43')]=function(_0x1ae9cb,_0x5347cd){var _0x21ff11={'raw':!![],'where':{'id':_0x1ae9cb['params']['id']}},_0x5d7021={};_0x5d7021[_0xdc96('0x34')]=_['keys'](db[_0xdc96('0x3e')]['rawAttributes']);_0x5d7021[_0xdc96('0x2f')]=_[_0xdc96('0x44')](_0x1ae9cb[_0xdc96('0x2f')]);_0x5d7021[_0xdc96('0x30')]=_[_0xdc96('0x31')](_0x5d7021['model'],_0x5d7021[_0xdc96('0x2f')]);_0x21ff11[_0xdc96('0x33')]=_['intersection'](_0x5d7021[_0xdc96('0x34')],qs[_0xdc96('0x32')](_0x1ae9cb[_0xdc96('0x2f')][_0xdc96('0x32')]));_0x21ff11[_0xdc96('0x33')]=_0x21ff11[_0xdc96('0x33')][_0xdc96('0x45')]?_0x21ff11['attributes']:_0x5d7021[_0xdc96('0x34')];if(_0x1ae9cb[_0xdc96('0x2f')][_0xdc96('0x3f')]){_0x21ff11[_0xdc96('0x40')]=[{'all':!![]}];}_0x21ff11=_[_0xdc96('0x3b')]({},_0x21ff11,_0x1ae9cb[_0xdc96('0x3d')]);return db['AnalyticTreeReport'][_0xdc96('0x46')](_0x21ff11)[_0xdc96('0x25')](handleEntityNotFound(_0x5347cd,null))['then'](respondWithResult(_0x5347cd,null))[_0xdc96('0x47')](handleError(_0x5347cd,null));};exports['create']=function(_0x4c6557,_0x5d76c6){return db['AnalyticTreeReport'][_0xdc96('0x48')](_0x4c6557[_0xdc96('0x49')],{})[_0xdc96('0x25')](respondWithResult(_0x5d76c6,0xc9))['catch'](handleError(_0x5d76c6,null));};exports[_0xdc96('0x4a')]=function(_0x4a00f7,_0x5c7cf6){if(_0x4a00f7[_0xdc96('0x49')]['id']){delete _0x4a00f7[_0xdc96('0x49')]['id'];}return db[_0xdc96('0x3e')]['find']({'where':{'id':_0x4a00f7[_0xdc96('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c7cf6,null))[_0xdc96('0x25')](saveUpdates(_0x4a00f7['body'],null))['then'](respondWithResult(_0x5c7cf6,null))[_0xdc96('0x47')](handleError(_0x5c7cf6,null));};exports['destroy']=function(_0x48337e,_0x266f1e){return db[_0xdc96('0x3e')]['find']({'where':{'id':_0x48337e[_0xdc96('0x4b')]['id']}})[_0xdc96('0x25')](handleEntityNotFound(_0x266f1e,null))['then'](removeEntity(_0x266f1e,null))[_0xdc96('0x47')](handleError(_0x266f1e,null));};
\ No newline at end of file
+var _0x3417=['rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','AnalyticTreeReport'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3417,0x6a));var _0x7341=function(_0x3c51b1,_0x1fdd45){_0x3c51b1=_0x3c51b1-0x0;var _0x1b2bc2=_0x3417[_0x3c51b1];return _0x1b2bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7341('0x0'));var zipdir=require(_0x7341('0x1'));var jsonpatch=require(_0x7341('0x2'));var rp=require(_0x7341('0x3'));var moment=require(_0x7341('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7341('0x5'));var path=require(_0x7341('0x6'));var sox=require(_0x7341('0x7'));var csv=require('to-csv');var ejs=require(_0x7341('0x8'));var fs=require('fs');var fs_extra=require(_0x7341('0x9'));var _=require('lodash');var squel=require(_0x7341('0xa'));var crypto=require(_0x7341('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7341('0xc'));var toCsv=require(_0x7341('0xd'));var querystring=require(_0x7341('0xe'));var Papa=require('papaparse');var Redis=require(_0x7341('0xf'));var authService=require(_0x7341('0x10'));var qs=require(_0x7341('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7341('0x12'));var logger=require(_0x7341('0x13'))(_0x7341('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7341('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c7c8a,_0x30e0a2){_0x30e0a2=_0x30e0a2||0xcc;return function(_0xfcf74d){if(_0xfcf74d){return _0x3c7c8a['sendStatus'](_0x30e0a2);}return _0x3c7c8a[_0x7341('0x16')](_0x30e0a2)[_0x7341('0x17')]();};}function respondWithResult(_0x3b8842,_0x2dc22e){_0x2dc22e=_0x2dc22e||0xc8;return function(_0x460afe){if(_0x460afe){return _0x3b8842[_0x7341('0x16')](_0x2dc22e)[_0x7341('0x18')](_0x460afe);}};}function respondWithFilteredResult(_0x1d6d1d,_0x4cbcb5){return function(_0x104b8d){if(_0x104b8d){var _0x3f74d2=typeof _0x4cbcb5[_0x7341('0x19')]===_0x7341('0x1a')&&typeof _0x4cbcb5['limit']===_0x7341('0x1a');var _0x7ae82b=_0x104b8d[_0x7341('0x1b')];var _0xc204f5=_0x3f74d2?0x0:_0x4cbcb5[_0x7341('0x19')];var _0x305657=_0x3f74d2?_0x104b8d[_0x7341('0x1b')]:_0x4cbcb5[_0x7341('0x19')]+_0x4cbcb5['limit'];var _0x4214f3;if(_0x305657>=_0x7ae82b){_0x305657=_0x7ae82b;_0x4214f3=0xc8;}else{_0x4214f3=0xce;}_0x1d6d1d[_0x7341('0x16')](_0x4214f3);return _0x1d6d1d[_0x7341('0x1c')](_0x7341('0x1d'),_0xc204f5+'-'+_0x305657+'/'+_0x7ae82b)[_0x7341('0x18')](_0x104b8d);}return null;};}function patchUpdates(_0x405d47){return function(_0x1b83b7){try{jsonpatch[_0x7341('0x1e')](_0x1b83b7,_0x405d47,!![]);}catch(_0x167847){return BPromise['reject'](_0x167847);}return _0x1b83b7[_0x7341('0x1f')]();};}function saveUpdates(_0x214f59,_0x46d4bd){return function(_0xedb8f6){if(_0xedb8f6){return _0xedb8f6[_0x7341('0x20')](_0x214f59)[_0x7341('0x21')](function(_0x1be382){return _0x1be382;});}return null;};}function removeEntity(_0x52f9d4,_0x2a78d7){return function(_0x242074){if(_0x242074){return _0x242074[_0x7341('0x22')]()[_0x7341('0x21')](function(){_0x52f9d4[_0x7341('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50b152,_0x17b3e4){return function(_0x12a06e){if(!_0x12a06e){_0x50b152[_0x7341('0x23')](0x194);}return _0x12a06e;};}function handleError(_0xcd88bd,_0x40916b){_0x40916b=_0x40916b||0x1f4;return function(_0xb8829e){logger[_0x7341('0x24')](_0xb8829e['stack']);if(_0xb8829e[_0x7341('0x25')]){delete _0xb8829e[_0x7341('0x25')];}_0xcd88bd[_0x7341('0x16')](_0x40916b)['send'](_0xb8829e);};}exports[_0x7341('0x26')]=function(_0x5f5da0,_0xf96ac4){var _0x5b5b0d={},_0x209733={},_0x5c129c={'count':0x0,'rows':[]};var _0x3e1873=_['map'](db[_0x7341('0x27')][_0x7341('0x28')],function(_0x27ff50){return{'name':_0x27ff50[_0x7341('0x29')],'type':_0x27ff50[_0x7341('0x2a')][_0x7341('0x2b')]};});_0x209733['model']=_[_0x7341('0x2c')](_0x3e1873,_0x7341('0x25'));_0x209733[_0x7341('0x2d')]=_[_0x7341('0x2e')](_0x5f5da0[_0x7341('0x2d')]);_0x209733[_0x7341('0x2f')]=_['intersection'](_0x209733[_0x7341('0x30')],_0x209733['query']);_0x5b5b0d[_0x7341('0x31')]=_[_0x7341('0x32')](_0x209733['model'],qs['fields'](_0x5f5da0['query'][_0x7341('0x33')]));_0x5b5b0d['attributes']=_0x5b5b0d[_0x7341('0x31')]['length']?_0x5b5b0d[_0x7341('0x31')]:_0x209733[_0x7341('0x30')];if(!_0x5f5da0[_0x7341('0x2d')][_0x7341('0x34')](_0x7341('0x35'))){_0x5b5b0d[_0x7341('0x36')]=qs[_0x7341('0x36')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x36')]);_0x5b5b0d[_0x7341('0x19')]=qs['offset'](_0x5f5da0['query']['offset']);}_0x5b5b0d[_0x7341('0x37')]=qs[_0x7341('0x38')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x38')]);_0x5b5b0d[_0x7341('0x39')]=qs[_0x7341('0x2f')](_[_0x7341('0x3a')](_0x5f5da0[_0x7341('0x2d')],_0x209733['filters']),_0x3e1873);if(_0x5f5da0['query'][_0x7341('0x3b')]){_0x5b5b0d['where']=_[_0x7341('0x3c')](_0x5b5b0d[_0x7341('0x39')],{'$or':_[_0x7341('0x2c')](_0x3e1873,function(_0x815383){if(_0x815383['type']!==_0x7341('0x3d')){var _0x9dd907={};_0x9dd907[_0x815383[_0x7341('0x25')]]={'$like':'%'+_0x5f5da0['query'][_0x7341('0x3b')]+'%'};return _0x9dd907;}})});}_0x5b5b0d=_[_0x7341('0x3c')]({},_0x5b5b0d,_0x5f5da0[_0x7341('0x3e')]);var _0x28d076={'where':_0x5b5b0d[_0x7341('0x39')]};return db[_0x7341('0x27')][_0x7341('0x1b')](_0x28d076)[_0x7341('0x21')](function(_0x3e5ffb){_0x5c129c[_0x7341('0x1b')]=_0x3e5ffb;if(_0x5f5da0[_0x7341('0x2d')][_0x7341('0x3f')]){_0x5b5b0d[_0x7341('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x7341('0x41')](_0x5b5b0d);})['then'](function(_0x3e2a18){_0x5c129c[_0x7341('0x42')]=_0x3e2a18;return _0x5c129c;})[_0x7341('0x21')](respondWithFilteredResult(_0xf96ac4,_0x5b5b0d))['catch'](handleError(_0xf96ac4,null));};exports[_0x7341('0x43')]=function(_0xf62635,_0xd34c72){var _0x3588ff={'raw':!![],'where':{'id':_0xf62635[_0x7341('0x44')]['id']}},_0x519f12={};_0x519f12[_0x7341('0x30')]=_[_0x7341('0x2e')](db[_0x7341('0x27')][_0x7341('0x28')]);_0x519f12[_0x7341('0x2d')]=_['keys'](_0xf62635['query']);_0x519f12[_0x7341('0x2f')]=_['intersection'](_0x519f12[_0x7341('0x30')],_0x519f12[_0x7341('0x2d')]);_0x3588ff[_0x7341('0x31')]=_[_0x7341('0x32')](_0x519f12[_0x7341('0x30')],qs[_0x7341('0x33')](_0xf62635['query'][_0x7341('0x33')]));_0x3588ff[_0x7341('0x31')]=_0x3588ff[_0x7341('0x31')]['length']?_0x3588ff[_0x7341('0x31')]:_0x519f12[_0x7341('0x30')];if(_0xf62635[_0x7341('0x2d')][_0x7341('0x3f')]){_0x3588ff[_0x7341('0x40')]=[{'all':!![]}];}_0x3588ff=_['merge']({},_0x3588ff,_0xf62635[_0x7341('0x3e')]);return db['AnalyticTreeReport']['find'](_0x3588ff)[_0x7341('0x21')](handleEntityNotFound(_0xd34c72,null))[_0x7341('0x21')](respondWithResult(_0xd34c72,null))[_0x7341('0x45')](handleError(_0xd34c72,null));};exports[_0x7341('0x46')]=function(_0x1a2290,_0x430c00){return db[_0x7341('0x27')][_0x7341('0x46')](_0x1a2290[_0x7341('0x47')],{})[_0x7341('0x21')](respondWithResult(_0x430c00,0xc9))[_0x7341('0x45')](handleError(_0x430c00,null));};exports[_0x7341('0x20')]=function(_0x44605f,_0x3c8927){if(_0x44605f[_0x7341('0x47')]['id']){delete _0x44605f[_0x7341('0x47')]['id'];}return db[_0x7341('0x27')][_0x7341('0x48')]({'where':{'id':_0x44605f['params']['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x3c8927,null))['then'](saveUpdates(_0x44605f[_0x7341('0x47')],null))['then'](respondWithResult(_0x3c8927,null))[_0x7341('0x45')](handleError(_0x3c8927,null));};exports['destroy']=function(_0x4b198b,_0x4dedd6){return db[_0x7341('0x27')]['find']({'where':{'id':_0x4b198b[_0x7341('0x44')]['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x4dedd6,null))[_0x7341('0x21')](removeEntity(_0x4dedd6,null))[_0x7341('0x45')](handleError(_0x4dedd6,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 457cf3c..65ab224 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 _0x1ff6=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x4a567a,_0x9c9416){var _0x5bc161=function(_0x2c11d0){while(--_0x2c11d0){_0x4a567a['push'](_0x4a567a['shift']());}};_0x5bc161(++_0x9c9416);}(_0x1ff6,0x17b));var _0x61ff=function(_0x5b8c2b,_0x155bc3){_0x5b8c2b=_0x5b8c2b-0x0;var _0xe1ff56=_0x1ff6[_0x5b8c2b];return _0xe1ff56;};'use strict';var _=require(_0x61ff('0x0'));var util=require(_0x61ff('0x1'));var logger=require(_0x61ff('0x2'))(_0x61ff('0x3'));var moment=require(_0x61ff('0x4'));var BPromise=require(_0x61ff('0x5'));var rp=require(_0x61ff('0x6'));var fs=require('fs');var path=require(_0x61ff('0x7'));var rimraf=require(_0x61ff('0x8'));var config=require(_0x61ff('0x9'));var attributes=require(_0x61ff('0xa'));module[_0x61ff('0xb')]=function(_0x41888a,_0x82f97e){return _0x41888a['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabeb=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0xabeb,0x153));var _0xbabe=function(_0x5c6bc9,_0x4276f7){_0x5c6bc9=_0x5c6bc9-0x0;var _0x5b1fa5=_0xabeb[_0x5c6bc9];return _0x5b1fa5;};'use strict';var _=require('lodash');var util=require(_0xbabe('0x0'));var logger=require(_0xbabe('0x1'))(_0xbabe('0x2'));var moment=require('moment');var BPromise=require(_0xbabe('0x3'));var rp=require(_0xbabe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbabe('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xbabe('0x6')]=function(_0x13c5de,_0x2f9e91){return _0x13c5de[_0xbabe('0x7')](_0xbabe('0x8'),attributes,{'tableName':_0xbabe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index eea84c5..3b5ac47 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x55571d,_0x3f8d26){var _0x361198=function(_0x273ffd){while(--_0x273ffd){_0x55571d['push'](_0x55571d['shift']());}};_0x361198(++_0x3f8d26);}(_0x1261,0x144));var _0x1126=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x1261[_0x30c649];return _0x3edfb9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x59628a,_0x701f80){var _0x3899e4=function(_0xab737c){while(--_0xab737c){_0x59628a['push'](_0x59628a['shift']());}};_0x3899e4(++_0x701f80);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 9319957..18e7431 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 _0x8522=['create','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0x18becc,_0x1600ef){var _0xf6760f=function(_0x4c8a2d){while(--_0x4c8a2d){_0x18becc['push'](_0x18becc['shift']());}};_0xf6760f(++_0x1600ef);}(_0x8522,0x124));var _0x2852=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x8522[_0x28fbbf];return _0x543af6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2852('0x0'));var timeout=require(_0x2852('0x1'));var express=require(_0x2852('0x2'));var router=express[_0x2852('0x3')]();var fs_extra=require(_0x2852('0x4'));var auth=require(_0x2852('0x5'));var interaction=require(_0x2852('0x6'));var config=require(_0x2852('0x7'));var controller=require(_0x2852('0x8'));router['get']('/',auth[_0x2852('0x9')](),controller[_0x2852('0xa')]);router[_0x2852('0xb')](_0x2852('0xc'),auth[_0x2852('0x9')](),controller[_0x2852('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2852('0xe')]);router[_0x2852('0xf')](_0x2852('0xc'),auth['isAuthenticated'](),controller[_0x2852('0x10')]);router['delete'](_0x2852('0xc'),auth['isAuthenticated'](),controller[_0x2852('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb58b=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x503c6a,_0x738a9d){var _0x5f591e=function(_0x5d080c){while(--_0x5d080c){_0x503c6a['push'](_0x503c6a['shift']());}};_0x5f591e(++_0x738a9d);}(_0xb58b,0x1e8));var _0xbb58=function(_0x4797f8,_0x2ebab8){_0x4797f8=_0x4797f8-0x0;var _0x4062be=_0xb58b[_0x4797f8];return _0x4062be;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require(_0xbb58('0x3'));var router=express['Router']();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require(_0xbb58('0x6'));var controller=require(_0xbb58('0x7'));router[_0xbb58('0x8')]('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x8')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xc')]);router['post']('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xd')]);router['put'](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xf')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0x10')]);module[_0xbb58('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index d0c68ff..5b40364 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 _0x85d8=['sequelize','exports','STRING'];(function(_0x58a2d1,_0x704141){var _0x5833db=function(_0x2af0b2){while(--_0x2af0b2){_0x58a2d1['push'](_0x58a2d1['shift']());}};_0x5833db(++_0x704141);}(_0x85d8,0x1b0));var _0x885d=function(_0x238d72,_0x5b9350){_0x238d72=_0x238d72-0x0;var _0x29e624=_0x85d8[_0x238d72];return _0x29e624;};'use strict';var Sequelize=require(_0x885d('0x0'));module[_0x885d('0x1')]={'name':{'type':Sequelize[_0x885d('0x2')]},'basename':{'type':Sequelize[_0x885d('0x2')]},'type':{'type':Sequelize[_0x885d('0x2')]}};
\ No newline at end of file
+var _0x097c=['STRING','sequelize','exports'];(function(_0x74e775,_0x1c394f){var _0x1b0bd1=function(_0x3ac740){while(--_0x3ac740){_0x74e775['push'](_0x74e775['shift']());}};_0x1b0bd1(++_0x1c394f);}(_0x097c,0x1d5));var _0xc097=function(_0x1241aa,_0x323da9){_0x1241aa=_0x1241aa-0x0;var _0x44d356=_0x097c[_0x1241aa];return _0x44d356;};'use strict';var Sequelize=require(_0xc097('0x0'));module[_0xc097('0x1')]={'name':{'type':Sequelize[_0xc097('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc097('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index d8f8e4b..7cf4eb6 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 _0xfd1b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','rows','catch','show','params','length','find','get','createdAt','updatedAt','body','omit','create','destroy','file','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x57b3f9,_0x5a4ef5){var _0xbc5579=function(_0x4f67a0){while(--_0x4f67a0){_0x57b3f9['push'](_0x57b3f9['shift']());}};_0xbc5579(++_0x5a4ef5);}(_0xfd1b,0x1ab));var _0xbfd1=function(_0x2e3dd1,_0x29b549){_0x2e3dd1=_0x2e3dd1-0x0;var _0x39de59=_0xfd1b[_0x2e3dd1];return _0x39de59;};'use strict';var emlformat=require(_0xbfd1('0x0'));var rimraf=require(_0xbfd1('0x1'));var zipdir=require(_0xbfd1('0x2'));var jsonpatch=require(_0xbfd1('0x3'));var rp=require(_0xbfd1('0x4'));var moment=require('moment');var BPromise=require(_0xbfd1('0x5'));var Mustache=require(_0xbfd1('0x6'));var util=require('util');var path=require(_0xbfd1('0x7'));var sox=require(_0xbfd1('0x8'));var csv=require(_0xbfd1('0x9'));var ejs=require(_0xbfd1('0xa'));var fs=require('fs');var fs_extra=require(_0xbfd1('0xb'));var _=require(_0xbfd1('0xc'));var squel=require(_0xbfd1('0xd'));var crypto=require(_0xbfd1('0xe'));var jsforce=require(_0xbfd1('0xf'));var deskjs=require(_0xbfd1('0x10'));var toCsv=require(_0xbfd1('0x9'));var querystring=require('querystring');var Papa=require(_0xbfd1('0x11'));var Redis=require('ioredis');var authService=require(_0xbfd1('0x12'));var qs=require(_0xbfd1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfd1('0x14'));var logger=require(_0xbfd1('0x15'))('api');var utils=require(_0xbfd1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfd1('0x17'))['db'];function respondWithStatusCode(_0x36ab7a,_0x1ec7c5){_0x1ec7c5=_0x1ec7c5||0xcc;return function(_0x5cee80){if(_0x5cee80){return _0x36ab7a[_0xbfd1('0x18')](_0x1ec7c5);}return _0x36ab7a[_0xbfd1('0x19')](_0x1ec7c5)[_0xbfd1('0x1a')]();};}function respondWithResult(_0x258fde,_0x1e15df){_0x1e15df=_0x1e15df||0xc8;return function(_0x49fa53){if(_0x49fa53){return _0x258fde[_0xbfd1('0x19')](_0x1e15df)[_0xbfd1('0x1b')](_0x49fa53);}};}function respondWithFilteredResult(_0x50a2ea,_0x4be34d){return function(_0x3e96ca){if(_0x3e96ca){var _0x240654=typeof _0x4be34d['offset']===_0xbfd1('0x1c')&&typeof _0x4be34d[_0xbfd1('0x1d')]==='undefined';var _0x5a5f33=_0x3e96ca[_0xbfd1('0x1e')];var _0x57b2f2=_0x240654?0x0:_0x4be34d[_0xbfd1('0x1f')];var _0x36d79b=_0x240654?_0x3e96ca[_0xbfd1('0x1e')]:_0x4be34d[_0xbfd1('0x1f')]+_0x4be34d[_0xbfd1('0x1d')];var _0x29fcfe;if(_0x36d79b>=_0x5a5f33){_0x36d79b=_0x5a5f33;_0x29fcfe=0xc8;}else{_0x29fcfe=0xce;}_0x50a2ea[_0xbfd1('0x19')](_0x29fcfe);return _0x50a2ea[_0xbfd1('0x20')](_0xbfd1('0x21'),_0x57b2f2+'-'+_0x36d79b+'/'+_0x5a5f33)[_0xbfd1('0x1b')](_0x3e96ca);}return null;};}function patchUpdates(_0xe11483){return function(_0x4a6419){try{jsonpatch['apply'](_0x4a6419,_0xe11483,!![]);}catch(_0x1ce5d4){return BPromise[_0xbfd1('0x22')](_0x1ce5d4);}return _0x4a6419[_0xbfd1('0x23')]();};}function saveUpdates(_0x436f45,_0x45b4a4){return function(_0x2a77c6){if(_0x2a77c6){return _0x2a77c6[_0xbfd1('0x24')](_0x436f45)['then'](function(_0x42b616){return _0x42b616;});}return null;};}function removeEntity(_0x337f34,_0xd1ccc4){return function(_0x4a981a){if(_0x4a981a){return _0x4a981a['destroy']()['then'](function(){_0x337f34['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8151,_0x283cdd){return function(_0x4ea1fe){if(!_0x4ea1fe){_0x4e8151[_0xbfd1('0x18')](0x194);}return _0x4ea1fe;};}function handleError(_0x36f07e,_0x2bf725){_0x2bf725=_0x2bf725||0x1f4;return function(_0xeda9d0){logger[_0xbfd1('0x25')](_0xeda9d0['stack']);if(_0xeda9d0[_0xbfd1('0x26')]){delete _0xeda9d0[_0xbfd1('0x26')];}_0x36f07e[_0xbfd1('0x19')](_0x2bf725)[_0xbfd1('0x27')](_0xeda9d0);};}exports[_0xbfd1('0x28')]=function(_0xd0fab8,_0x15533d){var _0x1febe6={},_0x890073={},_0x22df43={'count':0x0,'rows':[]};var _0x281bc8=_[_0xbfd1('0x29')](db[_0xbfd1('0x2a')][_0xbfd1('0x2b')],function(_0x3e2df4){return{'name':_0x3e2df4[_0xbfd1('0x2c')],'type':_0x3e2df4[_0xbfd1('0x2d')][_0xbfd1('0x2e')]};});_0x890073[_0xbfd1('0x2f')]=_[_0xbfd1('0x29')](_0x281bc8,_0xbfd1('0x26'));_0x890073[_0xbfd1('0x30')]=_[_0xbfd1('0x31')](_0xd0fab8[_0xbfd1('0x30')]);_0x890073[_0xbfd1('0x32')]=_[_0xbfd1('0x33')](_0x890073[_0xbfd1('0x2f')],_0x890073['query']);_0x1febe6[_0xbfd1('0x34')]=_[_0xbfd1('0x33')](_0x890073['model'],qs[_0xbfd1('0x35')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x35')]));_0x1febe6[_0xbfd1('0x34')]=_0x1febe6[_0xbfd1('0x34')]['length']?_0x1febe6[_0xbfd1('0x34')]:_0x890073['model'];if(!_0xd0fab8['query'][_0xbfd1('0x36')]('nolimit')){_0x1febe6['limit']=qs[_0xbfd1('0x1d')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x1d')]);_0x1febe6[_0xbfd1('0x1f')]=qs[_0xbfd1('0x1f')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x1f')]);}_0x1febe6['order']=qs[_0xbfd1('0x37')](_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x37')]);_0x1febe6[_0xbfd1('0x38')]=qs['filters'](_[_0xbfd1('0x39')](_0xd0fab8['query'],_0x890073[_0xbfd1('0x32')]),_0x281bc8);if(_0xd0fab8[_0xbfd1('0x30')]['filter']){_0x1febe6['where']=_[_0xbfd1('0x3a')](_0x1febe6['where'],{'$or':_[_0xbfd1('0x29')](_0x281bc8,function(_0x11fc76){if(_0x11fc76[_0xbfd1('0x2d')]!==_0xbfd1('0x3b')){var _0x1916d1={};_0x1916d1[_0x11fc76[_0xbfd1('0x26')]]={'$like':'%'+_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x3c')]+'%'};return _0x1916d1;}})});}_0x1febe6=_[_0xbfd1('0x3a')]({},_0x1febe6,_0xd0fab8[_0xbfd1('0x3d')]);var _0x3d025c={'where':_0x1febe6[_0xbfd1('0x38')]};return db[_0xbfd1('0x2a')]['count'](_0x3d025c)[_0xbfd1('0x3e')](function(_0x5ad8f4){_0x22df43['count']=_0x5ad8f4;if(_0xd0fab8[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x1febe6[_0xbfd1('0x40')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1febe6);})[_0xbfd1('0x3e')](function(_0x25303a){_0x22df43[_0xbfd1('0x41')]=_0x25303a;return _0x22df43;})[_0xbfd1('0x3e')](respondWithFilteredResult(_0x15533d,_0x1febe6))[_0xbfd1('0x42')](handleError(_0x15533d,null));};exports[_0xbfd1('0x43')]=function(_0x265abb,_0x434b27){var _0x4d8c5d={'raw':!![],'where':{'id':_0x265abb[_0xbfd1('0x44')]['id']}},_0x380185={};_0x380185[_0xbfd1('0x2f')]=_[_0xbfd1('0x31')](db[_0xbfd1('0x2a')]['rawAttributes']);_0x380185['query']=_[_0xbfd1('0x31')](_0x265abb[_0xbfd1('0x30')]);_0x380185['filters']=_['intersection'](_0x380185[_0xbfd1('0x2f')],_0x380185['query']);_0x4d8c5d[_0xbfd1('0x34')]=_[_0xbfd1('0x33')](_0x380185['model'],qs['fields'](_0x265abb[_0xbfd1('0x30')][_0xbfd1('0x35')]));_0x4d8c5d[_0xbfd1('0x34')]=_0x4d8c5d[_0xbfd1('0x34')][_0xbfd1('0x45')]?_0x4d8c5d['attributes']:_0x380185[_0xbfd1('0x2f')];if(_0x265abb[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x4d8c5d[_0xbfd1('0x40')]=[{'all':!![]}];}_0x4d8c5d=_[_0xbfd1('0x3a')]({},_0x4d8c5d,_0x265abb[_0xbfd1('0x3d')]);return db[_0xbfd1('0x2a')][_0xbfd1('0x46')](_0x4d8c5d)[_0xbfd1('0x3e')](handleEntityNotFound(_0x434b27,null))[_0xbfd1('0x3e')](respondWithResult(_0x434b27,null))[_0xbfd1('0x42')](handleError(_0x434b27,null));};exports['clone']=function(_0xc29bc2,_0x1efc64){var _0x2184f8={'where':{'id':_0xc29bc2[_0xbfd1('0x44')]['id']}},_0x3cf05c={};_0x3cf05c[_0xbfd1('0x2f')]=_[_0xbfd1('0x31')](db[_0xbfd1('0x2a')][_0xbfd1('0x2b')]);_0x2184f8['attributes']=_[_0xbfd1('0x33')](_0x3cf05c[_0xbfd1('0x2f')],qs['fields'](_0xc29bc2['query']['fields']));_0x2184f8[_0xbfd1('0x34')]=_0x2184f8[_0xbfd1('0x34')][_0xbfd1('0x45')]?_0x2184f8[_0xbfd1('0x34')]:_0x3cf05c[_0xbfd1('0x2f')];if(_0xc29bc2[_0xbfd1('0x30')][_0xbfd1('0x3f')]){_0x2184f8['include']=[{'all':!![]}];}_0x2184f8=_[_0xbfd1('0x3a')]({},_0x2184f8,_0xc29bc2[_0xbfd1('0x3d')]);return db[_0xbfd1('0x2a')][_0xbfd1('0x46')](_0x2184f8)[_0xbfd1('0x3e')](handleEntityNotFound(_0x1efc64,null))[_0xbfd1('0x3e')](function(_0x24bbb6){if(_0x24bbb6){var _0x358a5d=_0x24bbb6[_0xbfd1('0x47')]({'plain':!![]});_0x358a5d=qs['omit'](_0x358a5d,['id',_0xbfd1('0x48'),_0xbfd1('0x49')]);_0xc29bc2[_0xbfd1('0x4a')]=_[_0xbfd1('0x4b')](_0xc29bc2['body'],['id',_0xbfd1('0x48'),_0xbfd1('0x49')]);return db['Attachment'][_0xbfd1('0x4c')](_[_0xbfd1('0x3a')](_0x358a5d,_0xc29bc2['body']),{'include':_0xc29bc2['query'][_0xbfd1('0x3f')]?[{'all':!![]}]:undefined});}})[_0xbfd1('0x3e')](respondWithResult(_0x1efc64,0xc9))[_0xbfd1('0x42')](handleError(_0x1efc64,null));};exports[_0xbfd1('0x24')]=function(_0x8f22a1,_0x3a4d78){if(_0x8f22a1[_0xbfd1('0x4a')]['id']){delete _0x8f22a1[_0xbfd1('0x4a')]['id'];}return db[_0xbfd1('0x2a')]['find']({'where':{'id':_0x8f22a1[_0xbfd1('0x44')]['id']}})[_0xbfd1('0x3e')](handleEntityNotFound(_0x3a4d78,null))['then'](saveUpdates(_0x8f22a1['body'],null))['then'](respondWithResult(_0x3a4d78,null))['catch'](handleError(_0x3a4d78,null));};exports[_0xbfd1('0x4d')]=function(_0x517dfa,_0x264ecf){return db[_0xbfd1('0x2a')][_0xbfd1('0x46')]({'where':{'id':_0x517dfa['params']['id']}})['then'](handleEntityNotFound(_0x264ecf,null))['then'](removeEntity(_0x264ecf,null))[_0xbfd1('0x42')](handleError(_0x264ecf,null));};exports[_0xbfd1('0x4c')]=function(_0x4c8dfe,_0x3ffb30,_0x1d9e6a){_0x4c8dfe[_0xbfd1('0x4a')][_0xbfd1('0x26')]=_0x4c8dfe[_0xbfd1('0x4e')]['originalname'];_0x4c8dfe[_0xbfd1('0x4a')][_0xbfd1('0x4f')]=_0x4c8dfe[_0xbfd1('0x4e')][_0xbfd1('0x50')];_0x4c8dfe[_0xbfd1('0x4a')]['type']=_0x4c8dfe[_0xbfd1('0x4e')][_0xbfd1('0x51')];return db[_0xbfd1('0x2a')]['create'](_0x4c8dfe[_0xbfd1('0x4a')])[_0xbfd1('0x3e')](respondWithResult(_0x3ffb30,0xc9))[_0xbfd1('0x42')](handleError(_0x3ffb30,null));};exports['download']=function(_0x22b08e,_0x4484da,_0x46c44b){return db[_0xbfd1('0x2a')][_0xbfd1('0x52')]({'where':{'id':_0x22b08e[_0xbfd1('0x44')]['id']},'raw':!![]})[_0xbfd1('0x3e')](handleEntityNotFound(_0x4484da,null))[_0xbfd1('0x3e')](function(_0x377387){if(_0x377387){var _0x5df941=_0x377387[_0xbfd1('0x53')]!==null;var _0x138b1d=path['join'](config[_0xbfd1('0x54')],'server/files/attachments/');if(_0x5df941){_0x138b1d=path[_0xbfd1('0x55')](_0x138b1d,_0xbfd1('0x56'));}var _0x446b55=path[_0xbfd1('0x55')](_0x138b1d,_0x377387[_0xbfd1('0x4f')]);return _0x4484da['download'](_0x446b55);}})[_0xbfd1('0x42')](handleError(_0x4484da,null));};
\ No newline at end of file
+var _0xaa4c=['join','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Attachment','findAll','catch','show','find','clone','params','includeAll','get','createdAt','omit','body','updatedAt','create','update','destroy','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xaa4c,0x1b6));var _0xcaa4=function(_0x9ded82,_0xca5381){_0x9ded82=_0x9ded82-0x0;var _0x30c7a6=_0xaa4c[_0x9ded82];return _0x30c7a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcaa4('0x0'));var jsonpatch=require(_0xcaa4('0x1'));var rp=require(_0xcaa4('0x2'));var moment=require(_0xcaa4('0x3'));var BPromise=require(_0xcaa4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcaa4('0x5'));var sox=require(_0xcaa4('0x6'));var csv=require(_0xcaa4('0x7'));var ejs=require(_0xcaa4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa4('0x9'));var squel=require('squel');var crypto=require(_0xcaa4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcaa4('0xb'));var toCsv=require(_0xcaa4('0x7'));var querystring=require(_0xcaa4('0xc'));var Papa=require('papaparse');var Redis=require(_0xcaa4('0xd'));var authService=require(_0xcaa4('0xe'));var qs=require(_0xcaa4('0xf'));var as=require(_0xcaa4('0x10'));var hardwareService=require(_0xcaa4('0x11'));var logger=require(_0xcaa4('0x12'))(_0xcaa4('0x13'));var utils=require(_0xcaa4('0x14'));var config=require(_0xcaa4('0x15'));var licenseUtil=require(_0xcaa4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c167,_0x46752f){_0x46752f=_0x46752f||0xcc;return function(_0x4ec7b9){if(_0x4ec7b9){return _0x18c167[_0xcaa4('0x17')](_0x46752f);}return _0x18c167[_0xcaa4('0x18')](_0x46752f)[_0xcaa4('0x19')]();};}function respondWithResult(_0xdccc15,_0x5170cb){_0x5170cb=_0x5170cb||0xc8;return function(_0x278a14){if(_0x278a14){return _0xdccc15[_0xcaa4('0x18')](_0x5170cb)[_0xcaa4('0x1a')](_0x278a14);}};}function respondWithFilteredResult(_0x282f16,_0x5c6f4c){return function(_0x4d31d5){if(_0x4d31d5){var _0x47875a=typeof _0x5c6f4c[_0xcaa4('0x1b')]===_0xcaa4('0x1c')&&typeof _0x5c6f4c[_0xcaa4('0x1d')]===_0xcaa4('0x1c');var _0x541793=_0x4d31d5[_0xcaa4('0x1e')];var _0x4b96e6=_0x47875a?0x0:_0x5c6f4c[_0xcaa4('0x1b')];var _0x442d46=_0x47875a?_0x4d31d5[_0xcaa4('0x1e')]:_0x5c6f4c[_0xcaa4('0x1b')]+_0x5c6f4c[_0xcaa4('0x1d')];var _0x3f26fa;if(_0x442d46>=_0x541793){_0x442d46=_0x541793;_0x3f26fa=0xc8;}else{_0x3f26fa=0xce;}_0x282f16[_0xcaa4('0x18')](_0x3f26fa);return _0x282f16[_0xcaa4('0x1f')](_0xcaa4('0x20'),_0x4b96e6+'-'+_0x442d46+'/'+_0x541793)['json'](_0x4d31d5);}return null;};}function patchUpdates(_0x100870){return function(_0x3a222a){try{jsonpatch['apply'](_0x3a222a,_0x100870,!![]);}catch(_0x45da81){return BPromise['reject'](_0x45da81);}return _0x3a222a[_0xcaa4('0x21')]();};}function saveUpdates(_0x44f8cb,_0x4d52c9){return function(_0x1ea7bb){if(_0x1ea7bb){return _0x1ea7bb['update'](_0x44f8cb)[_0xcaa4('0x22')](function(_0x3b51f4){return _0x3b51f4;});}return null;};}function removeEntity(_0x2f8f8d,_0x40c79d){return function(_0x4c5e8f){if(_0x4c5e8f){return _0x4c5e8f['destroy']()['then'](function(){_0x2f8f8d[_0xcaa4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bfe9,_0x5b15dd){return function(_0x2d6f82){if(!_0x2d6f82){_0x11bfe9[_0xcaa4('0x17')](0x194);}return _0x2d6f82;};}function handleError(_0x1b750b,_0x24509e){_0x24509e=_0x24509e||0x1f4;return function(_0x4d6a78){logger[_0xcaa4('0x23')](_0x4d6a78[_0xcaa4('0x24')]);if(_0x4d6a78[_0xcaa4('0x25')]){delete _0x4d6a78[_0xcaa4('0x25')];}_0x1b750b['status'](_0x24509e)['send'](_0x4d6a78);};}exports['index']=function(_0x45d51c,_0x5a3713){var _0x2cb0f6={},_0x10028a={},_0x4aae7c={'count':0x0,'rows':[]};var _0x5e3307=_[_0xcaa4('0x26')](db['Attachment'][_0xcaa4('0x27')],function(_0x3d6462){return{'name':_0x3d6462['fieldName'],'type':_0x3d6462[_0xcaa4('0x28')][_0xcaa4('0x29')]};});_0x10028a[_0xcaa4('0x2a')]=_[_0xcaa4('0x26')](_0x5e3307,'name');_0x10028a['query']=_[_0xcaa4('0x2b')](_0x45d51c[_0xcaa4('0x2c')]);_0x10028a[_0xcaa4('0x2d')]=_[_0xcaa4('0x2e')](_0x10028a['model'],_0x10028a[_0xcaa4('0x2c')]);_0x2cb0f6[_0xcaa4('0x2f')]=_[_0xcaa4('0x2e')](_0x10028a[_0xcaa4('0x2a')],qs[_0xcaa4('0x30')](_0x45d51c[_0xcaa4('0x2c')]['fields']));_0x2cb0f6[_0xcaa4('0x2f')]=_0x2cb0f6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x2cb0f6[_0xcaa4('0x2f')]:_0x10028a['model'];if(!_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x32')](_0xcaa4('0x33'))){_0x2cb0f6['limit']=qs[_0xcaa4('0x1d')](_0x45d51c[_0xcaa4('0x2c')]['limit']);_0x2cb0f6[_0xcaa4('0x1b')]=qs['offset'](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x1b')]);}_0x2cb0f6[_0xcaa4('0x34')]=qs[_0xcaa4('0x35')](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x35')]);_0x2cb0f6[_0xcaa4('0x36')]=qs[_0xcaa4('0x2d')](_[_0xcaa4('0x37')](_0x45d51c[_0xcaa4('0x2c')],_0x10028a[_0xcaa4('0x2d')]),_0x5e3307);if(_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x38')]){_0x2cb0f6[_0xcaa4('0x36')]=_[_0xcaa4('0x39')](_0x2cb0f6['where'],{'$or':_['map'](_0x5e3307,function(_0x3b4209){if(_0x3b4209['type']!==_0xcaa4('0x3a')){var _0xe4afc7={};_0xe4afc7[_0x3b4209['name']]={'$like':'%'+_0x45d51c[_0xcaa4('0x2c')]['filter']+'%'};return _0xe4afc7;}})});}_0x2cb0f6=_[_0xcaa4('0x39')]({},_0x2cb0f6,_0x45d51c[_0xcaa4('0x3b')]);var _0x4d6f9a={'where':_0x2cb0f6[_0xcaa4('0x36')]};return db['Attachment']['count'](_0x4d6f9a)['then'](function(_0x50561e){_0x4aae7c[_0xcaa4('0x1e')]=_0x50561e;if(_0x45d51c[_0xcaa4('0x2c')]['includeAll']){_0x2cb0f6[_0xcaa4('0x3c')]=[{'all':!![]}];}return db[_0xcaa4('0x3d')][_0xcaa4('0x3e')](_0x2cb0f6);})[_0xcaa4('0x22')](function(_0x1da855){_0x4aae7c['rows']=_0x1da855;return _0x4aae7c;})['then'](respondWithFilteredResult(_0x5a3713,_0x2cb0f6))[_0xcaa4('0x3f')](handleError(_0x5a3713,null));};exports[_0xcaa4('0x40')]=function(_0x4a20d8,_0xc7f2c1){var _0x1bd3b6={'raw':!![],'where':{'id':_0x4a20d8['params']['id']}},_0x13e749={};_0x13e749[_0xcaa4('0x2a')]=_[_0xcaa4('0x2b')](db[_0xcaa4('0x3d')]['rawAttributes']);_0x13e749[_0xcaa4('0x2c')]=_[_0xcaa4('0x2b')](_0x4a20d8[_0xcaa4('0x2c')]);_0x13e749[_0xcaa4('0x2d')]=_['intersection'](_0x13e749[_0xcaa4('0x2a')],_0x13e749[_0xcaa4('0x2c')]);_0x1bd3b6['attributes']=_[_0xcaa4('0x2e')](_0x13e749['model'],qs[_0xcaa4('0x30')](_0x4a20d8[_0xcaa4('0x2c')]['fields']));_0x1bd3b6[_0xcaa4('0x2f')]=_0x1bd3b6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x1bd3b6['attributes']:_0x13e749[_0xcaa4('0x2a')];if(_0x4a20d8[_0xcaa4('0x2c')]['includeAll']){_0x1bd3b6[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x1bd3b6=_[_0xcaa4('0x39')]({},_0x1bd3b6,_0x4a20d8[_0xcaa4('0x3b')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x1bd3b6)['then'](handleEntityNotFound(_0xc7f2c1,null))['then'](respondWithResult(_0xc7f2c1,null))[_0xcaa4('0x3f')](handleError(_0xc7f2c1,null));};exports[_0xcaa4('0x42')]=function(_0x2749dc,_0x562cc8){var _0x283ec5={'where':{'id':_0x2749dc[_0xcaa4('0x43')]['id']}},_0x513762={};_0x513762['model']=_[_0xcaa4('0x2b')](db['Attachment'][_0xcaa4('0x27')]);_0x283ec5['attributes']=_[_0xcaa4('0x2e')](_0x513762['model'],qs[_0xcaa4('0x30')](_0x2749dc[_0xcaa4('0x2c')]['fields']));_0x283ec5[_0xcaa4('0x2f')]=_0x283ec5['attributes']['length']?_0x283ec5[_0xcaa4('0x2f')]:_0x513762['model'];if(_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]){_0x283ec5[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x283ec5=_['merge']({},_0x283ec5,_0x2749dc['options']);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x283ec5)[_0xcaa4('0x22')](handleEntityNotFound(_0x562cc8,null))[_0xcaa4('0x22')](function(_0x2eb83d){if(_0x2eb83d){var _0x379dec=_0x2eb83d[_0xcaa4('0x45')]({'plain':!![]});_0x379dec=qs['omit'](_0x379dec,['id',_0xcaa4('0x46'),'updatedAt']);_0x2749dc['body']=_[_0xcaa4('0x47')](_0x2749dc[_0xcaa4('0x48')],['id',_0xcaa4('0x46'),_0xcaa4('0x49')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_[_0xcaa4('0x39')](_0x379dec,_0x2749dc[_0xcaa4('0x48')]),{'include':_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]?[{'all':!![]}]:undefined});}})[_0xcaa4('0x22')](respondWithResult(_0x562cc8,0xc9))[_0xcaa4('0x3f')](handleError(_0x562cc8,null));};exports[_0xcaa4('0x4b')]=function(_0x10054b,_0x2c681c){if(_0x10054b['body']['id']){delete _0x10054b[_0xcaa4('0x48')]['id'];}return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x10054b[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x2c681c,null))['then'](saveUpdates(_0x10054b[_0xcaa4('0x48')],null))[_0xcaa4('0x22')](respondWithResult(_0x2c681c,null))[_0xcaa4('0x3f')](handleError(_0x2c681c,null));};exports[_0xcaa4('0x4c')]=function(_0x5ca145,_0x404d8b){return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x5ca145[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x404d8b,null))[_0xcaa4('0x22')](removeEntity(_0x404d8b,null))[_0xcaa4('0x3f')](handleError(_0x404d8b,null));};exports[_0xcaa4('0x4a')]=function(_0x253a3f,_0x2e5641,_0x5c830b){_0x253a3f[_0xcaa4('0x48')]['name']=_0x253a3f[_0xcaa4('0x4d')]['originalname'];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x4e')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x4f')];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x28')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x50')];return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_0x253a3f[_0xcaa4('0x48')])[_0xcaa4('0x22')](respondWithResult(_0x2e5641,0xc9))[_0xcaa4('0x3f')](handleError(_0x2e5641,null));};exports[_0xcaa4('0x51')]=function(_0x4d28c4,_0x1d3030,_0x31d2e1){return db[_0xcaa4('0x3d')][_0xcaa4('0x52')]({'where':{'id':_0x4d28c4[_0xcaa4('0x43')]['id']},'raw':!![]})[_0xcaa4('0x22')](handleEntityNotFound(_0x1d3030,null))['then'](function(_0x4c5e00){if(_0x4c5e00){var _0x18ddc0=_0x4c5e00[_0xcaa4('0x53')]!==null;var _0xdc3206=path[_0xcaa4('0x54')](config['root'],_0xcaa4('0x55'));if(_0x18ddc0){_0xdc3206=path[_0xcaa4('0x54')](_0xdc3206,_0xcaa4('0x56'));}var _0x12e2d9=path['join'](_0xdc3206,_0x4c5e00[_0xcaa4('0x4e')]);return _0x1d3030[_0xcaa4('0x51')](_0x12e2d9);}})[_0xcaa4('0x3f')](handleError(_0x1d3030,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e209036..5cd788d 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 _0xe7fa=['../../config/environment','exports','define','attachments','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x152ba8,_0x56f0cc){var _0x2759dc=function(_0x48a9cd){while(--_0x48a9cd){_0x152ba8['push'](_0x152ba8['shift']());}};_0x2759dc(++_0x56f0cc);}(_0xe7fa,0xd5));var _0xae7f=function(_0x2743ad,_0x5669b6){_0x2743ad=_0x2743ad-0x0;var _0x15a93b=_0xe7fa[_0x2743ad];return _0x15a93b;};'use strict';var _=require('lodash');var util=require(_0xae7f('0x0'));var logger=require('../../config/logger')(_0xae7f('0x1'));var moment=require(_0xae7f('0x2'));var BPromise=require(_0xae7f('0x3'));var rp=require(_0xae7f('0x4'));var fs=require('fs');var path=require(_0xae7f('0x5'));var rimraf=require(_0xae7f('0x6'));var config=require(_0xae7f('0x7'));var attributes=require('./attachment.attributes');module[_0xae7f('0x8')]=function(_0x347f98,_0x352ad5){return _0x347f98[_0xae7f('0x9')]('Attachment',attributes,{'tableName':_0xae7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x207d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger'];(function(_0x19c483,_0x3b63fc){var _0x47ae32=function(_0x5fd5a0){while(--_0x5fd5a0){_0x19c483['push'](_0x19c483['shift']());}};_0x47ae32(++_0x3b63fc);}(_0x207d,0x177));var _0xd207=function(_0x3615f8,_0x5652c6){_0x3615f8=_0x3615f8-0x0;var _0x11ff59=_0x207d[_0x3615f8];return _0x11ff59;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require(_0xd207('0x1'))(_0xd207('0x2'));var moment=require(_0xd207('0x3'));var BPromise=require(_0xd207('0x4'));var rp=require(_0xd207('0x5'));var fs=require('fs');var path=require(_0xd207('0x6'));var rimraf=require(_0xd207('0x7'));var config=require(_0xd207('0x8'));var attributes=require(_0xd207('0x9'));module['exports']=function(_0x54af97,_0x15b43a){return _0x54af97[_0xd207('0xa')](_0xd207('0xb'),attributes,{'tableName':_0xd207('0xc'),'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 0c91b15..ad6d5b9 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 _0x3667=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc9e63e,_0x85efd1){var _0x2c224a=function(_0x5cca5b){while(--_0x5cca5b){_0xc9e63e['push'](_0xc9e63e['shift']());}};_0x2c224a(++_0x85efd1);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});}exports[_0x7366('0x19')]=function(_0x1a71f5){var _0x49e50b=this;return new Promise(function(_0x208ac8,_0x4ffbc7){return db[_0x7366('0x1a')][_0x7366('0x1b')](_0x1a71f5[_0x7366('0x1c')],{'raw':_0x1a71f5['options']?_0x1a71f5[_0x7366('0x1d')][_0x7366('0x1e')]===undefined?!![]:![]:!![]})[_0x7366('0xd')](function(_0x532ce2){logger[_0x7366('0xe')](_0x7366('0x19'),_0x1a71f5);logger['debug'](_0x7366('0x19'),_0x1a71f5,JSON[_0x7366('0x13')](_0x532ce2));_0x208ac8(_0x532ce2);})[_0x7366('0x18')](function(_0x1a12d2){logger[_0x7366('0x14')](_0x7366('0x19'),_0x1a12d2[_0x7366('0x16')],_0x1a71f5);_0x4ffbc7(_0x49e50b[_0x7366('0x14')](0x1f4,_0x1a12d2[_0x7366('0x16')]));});});};
\ No newline at end of file
+var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','lodash'];(function(_0x3de6f6,_0x5cbf81){var _0x47050d=function(_0x2c983b){while(--_0x2c983b){_0x3de6f6['push'](_0x3de6f6['shift']());}};_0x47050d(++_0x5cbf81);}(_0x20ce,0x10d));var _0xe20c=function(_0x47965b,_0x228ce8){_0x47965b=_0x47965b-0x0;var _0x1eb7e2=_0x20ce[_0x47965b];return _0x1eb7e2;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a336926..db4ea2e 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x462f5e,_0x39c6fb){var _0xb96df2=function(_0x4259c4){while(--_0x4259c4){_0x462f5e['push'](_0x462f5e['shift']());}};_0xb96df2(++_0x39c6fb);}(_0xb10b,0x12a));var _0xbb10=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xb10b[_0xef4fc0];return _0x57dade;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+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(_0xfaa8d,_0x1f7240){_0xfaa8d=_0xfaa8d-0x0;var _0x2e3407=_0xdb28[_0xfaa8d];return _0x2e3407;};'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
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 647dae3..47fdf77 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 _0xa112=['passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','/login','profile','email','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','getLicense','catch','lodash'];(function(_0x37e85c,_0x1a26f7){var _0x1a7ccc=function(_0x3b018f){while(--_0x3b018f){_0x37e85c['push'](_0x37e85c['shift']());}};_0x1a7ccc(++_0x1a26f7);}(_0xa112,0x153));var _0x2a11=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa112[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x2a11('0x0'));var passport=require(_0x2a11('0x1'));var GoogleStrategy=require(_0x2a11('0x2'))[_0x2a11('0x3')];var moment=require(_0x2a11('0x4'));var db=require(_0x2a11('0x5'))['db'];var config=require(_0x2a11('0x6'));var signToken=require(_0x2a11('0x7'))['signToken'];var utils=require(_0x2a11('0x8'));exports['login']=passport[_0x2a11('0x9')](_0x2a11('0xa'),{'failureRedirect':_0x2a11('0xb'),'scope':[_0x2a11('0xc'),_0x2a11('0xd')],'session':![]});exports['callback']=passport['authenticate'](_0x2a11('0xa'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x2a11('0xa')]?config[_0x2a11('0xa')][_0x2a11('0xe')]:'id','clientSecret':config[_0x2a11('0xa')]?config[_0x2a11('0xa')]['clientSecret']:_0x2a11('0xf'),'callbackURL':config[_0x2a11('0xa')]?config[_0x2a11('0xa')][_0x2a11('0x10')]:''},function(_0x16b7e3,_0x22f378,_0x520c47,_0x395d3f){var _0x512568,_0x32d040;return db[_0x2a11('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x2a11('0x12'),_0x2a11('0x13')],'raw':!![]})[_0x2a11('0x14')](function(_0x1092bc){_0x512568=_0x1092bc;return db[_0x2a11('0x15')]['find']({'where':{'email':_['map'](_0x520c47[_0x2a11('0x16')],_0x2a11('0x17')),'role':{'$or':[_0x2a11('0x18'),_0x2a11('0x19'),_0x2a11('0x1a')]}}});})[_0x2a11('0x14')](function(_0x5e0110){_0x32d040=_0x5e0110;if(_0x32d040){if(_0x32d040[_0x2a11('0x1b')]){return _0x395d3f(_0x2a11('0x1c'));}else if(_0x512568[_0x2a11('0x13')]>0x0){if(_0x32d040[_0x2a11('0x1d')]){if(moment(_0x32d040[_0x2a11('0x1e')])['add'](_0x512568[_0x2a11('0x13')],_0x2a11('0x1f'))>moment()){return _0x395d3f(_0x2a11('0x1c'));}else{return utils['clearBlockUser'](_0x32d040,0x0,![],null)[_0x2a11('0x14')](function(){return utils['getLicense'](_0x32d040);})[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}else{return utils[_0x2a11('0x20')](_0x32d040)[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}else{return utils[_0x2a11('0x20')](_0x32d040)[_0x2a11('0x14')](function(){return _0x395d3f(null,_0x32d040);});}}return _0x395d3f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2a11('0x21')](function(_0x4a334c){_0x395d3f(_0x4a334c);});}));
\ No newline at end of file
+var _0xd492=['google','/login','profile','email','callback','use','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','../../config/utils','login','authenticate'];(function(_0x48fc52,_0x5cb557){var _0x10233e=function(_0x282d39){while(--_0x282d39){_0x48fc52['push'](_0x48fc52['shift']());}};_0x10233e(++_0x5cb557);}(_0xd492,0x11f));var _0x2d49=function(_0x43b318,_0x301079){_0x43b318=_0x43b318-0x0;var _0x5bd2ec=_0xd492[_0x43b318];return _0x5bd2ec;};'use strict';var _=require(_0x2d49('0x0'));var passport=require(_0x2d49('0x1'));var GoogleStrategy=require(_0x2d49('0x2'))[_0x2d49('0x3')];var moment=require(_0x2d49('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x2d49('0x5'))['signToken'];var utils=require(_0x2d49('0x6'));exports[_0x2d49('0x7')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'scope':[_0x2d49('0xb'),_0x2d49('0xc')],'session':![]});exports[_0x2d49('0xd')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'session':![]});passport[_0x2d49('0xe')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0xf')]:_0x2d49('0x10'),'callbackURL':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0x11')]:''},function(_0x48817c,_0x65b811,_0x1a43d8,_0x5482f8){var _0x1d5edc,_0x232e98;return db['Setting'][_0x2d49('0x12')]({'where':{'id':0x1},'attributes':[_0x2d49('0x13'),_0x2d49('0x14')],'raw':!![]})[_0x2d49('0x15')](function(_0x473a25){_0x1d5edc=_0x473a25;return db[_0x2d49('0x16')][_0x2d49('0x17')]({'where':{'email':_['map'](_0x1a43d8[_0x2d49('0x18')],_0x2d49('0x19')),'role':{'$or':[_0x2d49('0x1a'),_0x2d49('0x1b'),_0x2d49('0x1c')]}}});})[_0x2d49('0x15')](function(_0xffa649){_0x232e98=_0xffa649;if(_0x232e98){if(_0x232e98[_0x2d49('0x1d')]){return _0x5482f8(_0x2d49('0x1e'));}else if(_0x1d5edc[_0x2d49('0x14')]>0x0){if(_0x232e98[_0x2d49('0x1f')]){if(moment(_0x232e98[_0x2d49('0x20')])[_0x2d49('0x21')](_0x1d5edc[_0x2d49('0x14')],'minutes')>moment()){return _0x5482f8(_0x2d49('0x1e'));}else{return utils[_0x2d49('0x22')](_0x232e98,0x0,![],null)['then'](function(){return utils[_0x2d49('0x23')](_0x232e98);})[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}return _0x5482f8(_0x2d49('0x1e'));})[_0x2d49('0x24')](function(_0x3f301f){_0x5482f8(_0x3f301f);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index a7f8fbc..4ded2ec 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 _0x56d8=['/callback','setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x935fc8,_0x2e6376){var _0x2bd2e4=function(_0x35a00f){while(--_0x35a00f){_0x935fc8['push'](_0x935fc8['shift']());}};_0x2bd2e4(++_0x2e6376);}(_0x56d8,0x1a1));var _0x856d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x56d8[_0x9df060];return _0x338dfe;};'use strict';var express=require(_0x856d('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x856d('0x1'));var userController=require(_0x856d('0x2'));var authService=require(_0x856d('0x3'));router[_0x856d('0x4')]('/',controller[_0x856d('0x5')]);router[_0x856d('0x4')](_0x856d('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x856d('0x5')],authService[_0x856d('0x7')]);module[_0x856d('0x8')]=router;
\ No newline at end of file
+var _0x4369=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x1d1da3,_0x387863){var _0x4ea3b1=function(_0x4ee207){while(--_0x4ee207){_0x1d1da3['push'](_0x1d1da3['shift']());}};_0x4ea3b1(++_0x387863);}(_0x4369,0x147));var _0x9436=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x4369[_0x5ad07c];return _0x204bae;};'use strict';var express=require(_0x9436('0x0'));var passport=require(_0x9436('0x1'));var router=express[_0x9436('0x2')]();var controller=require(_0x9436('0x3'));var userController=require(_0x9436('0x4'));var authService=require(_0x9436('0x5'));router[_0x9436('0x6')]('/',controller[_0x9436('0x7')]);router[_0x9436('0x6')]('/callback',controller[_0x9436('0x8')],authService[_0x9436('0x9')],userController['login'],authService[_0x9436('0xa')]);module[_0x9436('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1357b53..010441f 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 _0x75c5=['../../components/auth/service','client','http','Setting','findOne','blockDuration','then','name','salt','disabled','blocked','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb'];(function(_0x44d2a1,_0x22c302){var _0x319606=function(_0x397b82){while(--_0x397b82){_0x44d2a1['push'](_0x44d2a1['shift']());}};_0x319606(++_0x22c302);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x575c('0x0'));var passport=require(_0x575c('0x1'));var LocalStrategy=require(_0x575c('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x575c('0x3'));var rs=require(_0x575c('0x4'));var moment=require(_0x575c('0x5'));var db=require(_0x575c('0x6'))['db'];var authService=require(_0x575c('0x7'));var utils=require('../../config/utils');var client=jayson[_0x575c('0x8')][_0x575c('0x9')]({'port':0x232b});function localAuthenticate(_0x62e644,_0xc786e7,_0x2d0629,_0x204764){var _0x163b31,_0x207199;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x54767d){_0x163b31=_0x54767d;return _0x62e644[_0x575c('0xb')]({'attributes':['id',_0x575c('0xe'),'password',_0x575c('0xf'),'role',_0x575c('0x10'),_0x575c('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0xc786e7,'role':{'$or':['admin',_0x575c('0x12'),_0x575c('0x13')]}}});})[_0x575c('0xd')](function(_0x1d71bb){if(!_0x1d71bb||_0x1d71bb&&_0x1d71bb[_0x575c('0xe')]!==_0xc786e7){throw new Error(_0x575c('0x14'));}else{_0x207199=_0x1d71bb;return _0x207199;}})['then'](function(){_0x207199[_0x575c('0x15')](_0x2d0629,function(_0x40a57c,_0xa2cd02){var _0x41edcb=_0x207199[_0x575c('0x16')]+0x1;if(_0x40a57c){return _0x204764(_0x40a57c);}else if(!_0xa2cd02){if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31[_0x575c('0x17')]>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31[_0x575c('0xc')],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{if(_0x41edcb>=_0x163b31[_0x575c('0x17')]){return utils[_0x575c('0x1a')](_0x207199,0x0,!![],moment())[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)['then'](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}}else{return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31['allowedLoginAttempts']>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31['blockDuration'],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);})['catch'](function(_0x32c038){return _0x204764(null,![],_0x32c038);});}}else{if(_0x207199[_0x575c('0x11')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1b')](_0x207199)[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}}});})[_0x575c('0x1c')](function(_0x41497a){return _0x204764(null,![],_0x41497a);});}function sendServiceMail(_0x17b1cd){return db[_0x575c('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x575c('0x1e')],'as':'Smtp'}]})[_0x575c('0xd')](function(_0x1bcd11){if(!_0x1bcd11){throw new Error(_0x575c('0x1f'));}var _0x594575={'tls':{'rejectUnauthorized':![]}};if(_0x1bcd11['Smtp'][_0x575c('0x20')]){_0x594575['service']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x20')];}else{_0x594575['host']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x22')];_0x594575[_0x575c('0x23')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x23')];_0x594575[_0x575c('0x24')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x24')];}if(_0x1bcd11[_0x575c('0x21')][_0x575c('0x25')]){_0x594575[_0x575c('0x26')]={'user':_0x1bcd11[_0x575c('0x21')]['user'],'pass':_0x1bcd11['Smtp']['pass']};}var _0x18f0ec={'account':_0x594575,'message':_['merge']({'from':util[_0x575c('0x27')]('\x22%s\x22\x20<%s>',_0x1bcd11[_0x575c('0xe')],_0x1bcd11['email']||_0x1bcd11[_0x575c('0x21')][_0x575c('0x12')])},_0x17b1cd)};return client[_0x575c('0x28')]('SendMail',_0x18f0ec);})[_0x575c('0xd')](function(_0x1e694e){if(_0x1e694e[_0x575c('0x29')]){throw new Error(util['format'](_0x575c('0x2a'),_0x1e694e[_0x575c('0x29')][_0x575c('0x2b')]||JSON[_0x575c('0x2c')](_0x1e694e[_0x575c('0x29')])));}return!![];});}function handleError(_0x3bdd1b,_0x50f9f1,_0x441865){return _0x3bdd1b[_0x575c('0x2d')](_0x50f9f1||0x1f4)[_0x575c('0x2e')]({'message':_0x441865?_0x441865[_0x575c('0x2b')]||_0x441865:''});}exports[_0x575c('0x2f')]=function(_0x1503dd,_0x5ca678,_0x5005f6){passport[_0x575c('0x15')](_0x575c('0x30'),function(_0x38c7c1,_0x59ea5e,_0x34acf5){var _0x4bbea=_0x38c7c1||_0x34acf5;if(_0x4bbea){return handleError(_0x5ca678,0x191,_0x4bbea);}if(!_0x59ea5e){return handleError(_0x5ca678,0x194,{'message':_0x575c('0x31')});}else{var _0x13e11f={'payload':{'id':_0x59ea5e['id'],'role':_0x59ea5e[_0x575c('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x13e11f)[_0x575c('0xd')](function(_0x563913){_0x5ca678[_0x575c('0x33')]({'id':_0x59ea5e['id'],'token':_0x563913,'statusCall':'','isAlreadyLogged':_0x59ea5e['online']});});}})(_0x1503dd,_0x5ca678,_0x5005f6);};exports['forgot']=function(_0x246816,_0x2a8c06,_0x13a789){if(!_0x246816['body'][_0x575c('0x34')]){return handleError(_0x2a8c06,0x1f4,{'message':_0x575c('0x35')});}var _0x76fe12=rs[_0x575c('0x36')]();_0x246816[_0x575c('0x37')][_0x575c('0x34')]=_0x246816[_0x575c('0x37')][_0x575c('0x34')][_0x575c('0x38')]()[_0x575c('0x39')]();var _0x245666;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x10b9d2){_0x245666=_0x10b9d2;return db[_0x575c('0x3a')][_0x575c('0x3b')]({'where':{'email':_0x246816[_0x575c('0x37')][_0x575c('0x34')]}});})[_0x575c('0xd')](function(_0x56315a){if(!_0x56315a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56315a[_0x575c('0x10')]){throw new Error(_0x575c('0x3c'));}if(_0x56315a[_0x575c('0x11')]){if(moment(_0x56315a[_0x575c('0x3d')])['add'](_0x245666[_0x575c('0xc')],_0x575c('0x19'))>moment()){throw new Error(_0x575c('0x3e'));}else{_0x56315a[_0x575c('0x11')]=![];_0x56315a['blockedAt']=null;}}_0x56315a[_0x575c('0x3f')]=_0x76fe12;_0x56315a[_0x575c('0x40')]=Date['now']()+0x36ee80;return _0x56315a[_0x575c('0x41')]();})[_0x575c('0xd')](function(){return sendServiceMail({'to':_0x246816['body'][_0x575c('0x34')],'subject':_0x575c('0x42'),'text':_0x575c('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x575c('0x44')+_0x246816[_0x575c('0x45')][_0x575c('0x22')]+_0x575c('0x46')+_0x76fe12+'\x0a\x0a'+_0x575c('0x47')});})[_0x575c('0xd')](function(){_0x2a8c06[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x48')});})[_0x575c('0x1c')](function(_0x4fa6cc){return handleError(_0x2a8c06,0x1f4,_0x4fa6cc);});};exports[_0x575c('0x49')]=function(_0x3bf240,_0xf04b49,_0x7af69f){return db['User']['find']({'where':{'resetPasswordToken':_0x3bf240[_0x575c('0x4a')][_0x575c('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x575c('0xd')](function(_0x2419b5){if(!_0x2419b5){throw new Error(_0x575c('0x4c'));}return db[_0x575c('0xa')][_0x575c('0xb')]({'attributes':['id',_0x575c('0x4d'),_0x575c('0x4e'),_0x575c('0x4f')]})[_0x575c('0xd')](function(_0x116bed){if(_0x116bed[_0x575c('0x4d')])authService[_0x575c('0x50')](_0x3bf240['body'][_0x575c('0x51')]);if(!_0x116bed['enforcePasswordHistory']||!_0x2419b5[_0x575c('0x52')])return _0x2419b5;authService[_0x575c('0x53')](_0x3bf240[_0x575c('0x37')][_0x575c('0x51')],_0x2419b5[_0x575c('0x52')],_0x116bed[_0x575c('0x4f')]);return _0x2419b5;})[_0x575c('0xd')](function(){_0x2419b5[_0x575c('0x51')]=_0x3bf240[_0x575c('0x37')][_0x575c('0x51')];_0x2419b5['resetPasswordToken']=null;_0x2419b5[_0x575c('0x40')]=null;return _0x2419b5[_0x575c('0x41')]();});})[_0x575c('0xd')](function(){_0xf04b49[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x54')});})[_0x575c('0x1c')](function(_0x3defd2){return handleError(_0xf04b49,0x1f4,_0x3defd2);});};passport[_0x575c('0x55')](new LocalStrategy({'usernameField':'name','passwordField':_0x575c('0x51')},function(_0x2b2999,_0x1226a1,_0x2392e6){return localAuthenticate(db['User'],_0x2b2999,_0x1226a1,_0x2392e6);}));
\ No newline at end of file
+var _0x9f80=['Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport-local','randomstring','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','loginAttempts','admin','user','agent','name','authenticate','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','getLicense','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','login','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x48c938,_0x14ac2c){var _0x5625b2=function(_0x3edffd){while(--_0x3edffd){_0x48c938['push'](_0x48c938['shift']());}};_0x5625b2(++_0x14ac2c);}(_0x9f80,0x105));var _0x09f8=function(_0x18ae7c,_0x51e930){_0x18ae7c=_0x18ae7c-0x0;var _0x28057f=_0x9f80[_0x18ae7c];return _0x28057f;};'use strict';var util=require(_0x09f8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x09f8('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x09f8('0x2'));var moment=require('moment');var db=require(_0x09f8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x09f8('0x4'));var client=jayson[_0x09f8('0x5')][_0x09f8('0x6')]({'port':0x232b});function localAuthenticate(_0x3b573d,_0x2dcff1,_0x406409,_0x4e3ce5){var _0x1ea626,_0x2fe8b1;return db[_0x09f8('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})[_0x09f8('0xa')](function(_0x446224){_0x1ea626=_0x446224;return _0x3b573d[_0x09f8('0xb')]({'attributes':['id','name',_0x09f8('0xc'),_0x09f8('0xd'),_0x09f8('0xe'),_0x09f8('0xf'),'blocked','blockedAt',_0x09f8('0x10')],'where':{'name':_0x2dcff1,'role':{'$or':[_0x09f8('0x11'),_0x09f8('0x12'),_0x09f8('0x13')]}}});})[_0x09f8('0xa')](function(_0x7fc5ee){if(!_0x7fc5ee||_0x7fc5ee&&_0x7fc5ee[_0x09f8('0x14')]!==_0x2dcff1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2fe8b1=_0x7fc5ee;return _0x2fe8b1;}})[_0x09f8('0xa')](function(){_0x2fe8b1[_0x09f8('0x15')](_0x406409,function(_0x5eda69,_0xc009bf){var _0x169bf1=_0x2fe8b1[_0x09f8('0x10')]+0x1;if(_0x5eda69){return _0x4e3ce5(_0x5eda69);}else if(!_0xc009bf){if(_0x2fe8b1['disabled']){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1ea626['allowedLoginAttempts']>0x0){if(_0x2fe8b1['blocked']){if(_0x1ea626[_0x09f8('0x9')]>0x0){if(moment(_0x2fe8b1[_0x09f8('0x16')])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x169bf1>=_0x1ea626[_0x09f8('0x8')]){return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,!![],moment())['then'](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}else{return utils['clearBlockUser'](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x2fe8b1[_0x09f8('0xf')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else if(_0x1ea626[_0x09f8('0x8')]>0x0){if(_0x2fe8b1[_0x09f8('0x1b')]){if(_0x1ea626['blockDuration']>0x0){if(moment(_0x2fe8b1['blockedAt'])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils[_0x09f8('0x1c')](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils['getLicense'](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);})['catch'](function(_0x15bd75){return _0x4e3ce5(null,![],_0x15bd75);});}}else{if(_0x2fe8b1[_0x09f8('0x1b')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1c')](_0x2fe8b1)['then'](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}}});})[_0x09f8('0x1d')](function(_0x4f600b){return _0x4e3ce5(null,![],_0x4f600b);});}function sendServiceMail(_0x45e2f1){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x09f8('0x14'),_0x09f8('0x1e')],'include':[{'model':db[_0x09f8('0x1f')],'as':'Smtp'}]})[_0x09f8('0xa')](function(_0x2fde04){if(!_0x2fde04){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x349e1e={'tls':{'rejectUnauthorized':![]}};if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')]){_0x349e1e[_0x09f8('0x21')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')];}else{_0x349e1e[_0x09f8('0x22')]=_0x2fde04[_0x09f8('0x20')]['host'];_0x349e1e[_0x09f8('0x23')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x23')];_0x349e1e[_0x09f8('0x24')]=_0x2fde04[_0x09f8('0x20')]['secure'];}if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x25')]){_0x349e1e[_0x09f8('0x26')]={'user':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x12')],'pass':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x27')]};}var _0x17ff53={'account':_0x349e1e,'message':_[_0x09f8('0x28')]({'from':util[_0x09f8('0x29')](_0x09f8('0x2a'),_0x2fde04[_0x09f8('0x14')],_0x2fde04[_0x09f8('0x1e')]||_0x2fde04['Smtp'][_0x09f8('0x12')])},_0x45e2f1)};return client[_0x09f8('0x2b')](_0x09f8('0x2c'),_0x17ff53);})[_0x09f8('0xa')](function(_0x4081b6){if(_0x4081b6[_0x09f8('0x2d')]){throw new Error(util[_0x09f8('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4081b6[_0x09f8('0x2d')]['message']||JSON[_0x09f8('0x2e')](_0x4081b6[_0x09f8('0x2d')])));}return!![];});}function handleError(_0x53a864,_0x58f20c,_0x10b8ee){return _0x53a864[_0x09f8('0x2f')](_0x58f20c||0x1f4)[_0x09f8('0x30')]({'message':_0x10b8ee?_0x10b8ee[_0x09f8('0x31')]||_0x10b8ee:''});}exports[_0x09f8('0x32')]=function(_0x458e74,_0x443050,_0xe23a14){passport[_0x09f8('0x15')](_0x09f8('0x33'),function(_0x361988,_0x25a23b,_0x540554){var _0x4dcca2=_0x361988||_0x540554;if(_0x4dcca2){return handleError(_0x443050,0x191,_0x4dcca2);}if(!_0x25a23b){return handleError(_0x443050,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xe2ae9f={'payload':{'id':_0x25a23b['id'],'role':_0x25a23b[_0x09f8('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x09f8('0x34')](_0xe2ae9f)[_0x09f8('0xa')](function(_0x14b6c2){_0x443050[_0x09f8('0x35')]({'id':_0x25a23b['id'],'token':_0x14b6c2,'statusCall':'','isAlreadyLogged':_0x25a23b[_0x09f8('0x36')]});});}})(_0x458e74,_0x443050,_0xe23a14);};exports[_0x09f8('0x37')]=function(_0x3ffafc,_0x113245,_0x198750){if(!_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]){return handleError(_0x113245,0x1f4,{'message':_0x09f8('0x39')});}var _0x3c6282=rs[_0x09f8('0x3a')]();_0x3ffafc[_0x09f8('0x38')]['email']=_0x3ffafc[_0x09f8('0x38')]['email']['trim']()[_0x09f8('0x3b')]();var _0x58c81a;return db[_0x09f8('0x7')][_0x09f8('0xb')]({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})['then'](function(_0x37c2bf){_0x58c81a=_0x37c2bf;return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'email':_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]}});})['then'](function(_0x93e483){if(!_0x93e483){throw new Error(_0x09f8('0x3e'));}if(_0x93e483[_0x09f8('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x93e483[_0x09f8('0x1b')]){if(moment(_0x93e483[_0x09f8('0x16')])['add'](_0x58c81a[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x93e483[_0x09f8('0x1b')]=![];_0x93e483[_0x09f8('0x16')]=null;}}_0x93e483[_0x09f8('0x3f')]=_0x3c6282;_0x93e483['resetPasswordExpires']=Date[_0x09f8('0x40')]()+0x36ee80;return _0x93e483[_0x09f8('0x41')]();})[_0x09f8('0xa')](function(){return sendServiceMail({'to':_0x3ffafc['body']['email'],'subject':_0x09f8('0x42'),'text':_0x09f8('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x09f8('0x44')+_0x3ffafc[_0x09f8('0x45')][_0x09f8('0x22')]+'/reset/'+_0x3c6282+'\x0a\x0a'+_0x09f8('0x46')});})[_0x09f8('0xa')](function(){_0x113245[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x47')});})['catch'](function(_0xbe4ee1){return handleError(_0x113245,0x1f4,_0xbe4ee1);});};exports[_0x09f8('0x48')]=function(_0x456287,_0x4b48a3,_0x52d85d){return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'resetPasswordToken':_0x456287['params'][_0x09f8('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x09f8('0xa')](function(_0x458ba6){if(!_0x458ba6){throw new Error(_0x09f8('0x4a'));}return db[_0x09f8('0x7')][_0x09f8('0xb')]({'attributes':['id',_0x09f8('0x4b'),_0x09f8('0x4c'),'passwordHistoryLimit']})[_0x09f8('0xa')](function(_0x3685a5){if(_0x3685a5[_0x09f8('0x4b')])authService['validatePasswordPattern'](_0x456287[_0x09f8('0x38')]['password']);if(!_0x3685a5[_0x09f8('0x4c')]||!_0x458ba6[_0x09f8('0x4d')])return _0x458ba6;authService[_0x09f8('0x4e')](_0x456287[_0x09f8('0x38')][_0x09f8('0xc')],_0x458ba6[_0x09f8('0x4d')],_0x3685a5[_0x09f8('0x4f')]);return _0x458ba6;})[_0x09f8('0xa')](function(){_0x458ba6['password']=_0x456287[_0x09f8('0x38')][_0x09f8('0xc')];_0x458ba6[_0x09f8('0x3f')]=null;_0x458ba6[_0x09f8('0x50')]=null;return _0x458ba6[_0x09f8('0x41')]();});})[_0x09f8('0xa')](function(){_0x4b48a3[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x51')});})['catch'](function(_0x181a04){return handleError(_0x4b48a3,0x1f4,_0x181a04);});};passport[_0x09f8('0x52')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4466ba,_0x51fe21,_0x300686){return localAuthenticate(db[_0x09f8('0x3c')],_0x4466ba,_0x51fe21,_0x300686);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3fc3291..9be22d4 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 _0xa8a8=['/forgot','/reset/:token','exports','./authLocal.controller','login','post'];(function(_0x153cdb,_0x440c79){var _0xa3085f=function(_0x55d65e){while(--_0x55d65e){_0x153cdb['push'](_0x153cdb['shift']());}};_0xa3085f(++_0x440c79);}(_0xa8a8,0x9f));var _0x8a8a=function(_0x384131,_0x41a880){_0x384131=_0x384131-0x0;var _0x1fd8e1=_0xa8a8[_0x384131];return _0x1fd8e1;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x8a8a('0x0'));router['post']('/',controller[_0x8a8a('0x1')]);router[_0x8a8a('0x2')](_0x8a8a('0x3'),controller['forgot']);router[_0x8a8a('0x2')](_0x8a8a('0x4'),controller['reset']);module[_0x8a8a('0x5')]=router;
\ No newline at end of file
+var _0xb768=['/reset/:token','exports','Router','./authLocal.controller','login','post','/forgot','forgot'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xb768,0x16a));var _0x8b76=function(_0x408e10,_0x560479){_0x408e10=_0x408e10-0x0;var _0x228eeb=_0xb768[_0x408e10];return _0x228eeb;};'use strict';var express=require('express');var router=express[_0x8b76('0x0')]();var controller=require(_0x8b76('0x1'));router['post']('/',controller[_0x8b76('0x2')]);router[_0x8b76('0x3')](_0x8b76('0x4'),controller[_0x8b76('0x5')]);router[_0x8b76('0x3')](_0x8b76('0x6'),controller['reset']);module[_0x8b76('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index be507bf..4479efe 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 _0x7fe3=['sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7fe3,0x81));var _0x37fe=function(_0x3fd49e,_0x268790){_0x3fd49e=_0x3fd49e-0x0;var _0x12f9da=_0x7fe3[_0x3fd49e];return _0x12f9da;};'use strict';var Sequelize=require(_0x37fe('0x0'));module[_0x37fe('0x1')]={'name':{'type':Sequelize[_0x37fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x37fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x4875=['BOOLEAN','sequelize','exports','STRING'];(function(_0x12566a,_0x448050){var _0x15f53f=function(_0x31eac9){while(--_0x31eac9){_0x12566a['push'](_0x12566a['shift']());}};_0x15f53f(++_0x448050);}(_0x4875,0x171));var _0x5487=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0x4875[_0x519de3];return _0x3e21d9;};'use strict';var Sequelize=require(_0x5487('0x0'));module[_0x5487('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5487('0x2')]},'status':{'type':Sequelize[_0x5487('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 3e423c8..eec4bdd 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 _0xa0e8=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','Automation','fieldName','type','model','query','intersection','fields','attributes','length','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','count','then','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format'];(function(_0xb01aa9,_0xf6be7d){var _0x23c06c=function(_0x102f03){while(--_0x102f03){_0xb01aa9['push'](_0xb01aa9['shift']());}};_0x23c06c(++_0xf6be7d);}(_0xa0e8,0x1a8));var _0x8a0e=function(_0x26075f,_0x5b1d30){_0x26075f=_0x26075f-0x0;var _0xeb85bf=_0xa0e8[_0x26075f];return _0xeb85bf;};'use strict';var emlformat=require(_0x8a0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a0e('0x2'));var moment=require(_0x8a0e('0x3'));var BPromise=require(_0x8a0e('0x4'));var Mustache=require(_0x8a0e('0x5'));var util=require('util');var path=require(_0x8a0e('0x6'));var sox=require(_0x8a0e('0x7'));var csv=require(_0x8a0e('0x8'));var ejs=require(_0x8a0e('0x9'));var fs=require('fs');var fs_extra=require(_0x8a0e('0xa'));var _=require(_0x8a0e('0xb'));var squel=require(_0x8a0e('0xc'));var crypto=require(_0x8a0e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a0e('0xe'));var toCsv=require(_0x8a0e('0x8'));var querystring=require(_0x8a0e('0xf'));var Papa=require(_0x8a0e('0x10'));var Redis=require(_0x8a0e('0x11'));var authService=require(_0x8a0e('0x12'));var qs=require(_0x8a0e('0x13'));var as=require(_0x8a0e('0x14'));var hardwareService=require(_0x8a0e('0x15'));var logger=require(_0x8a0e('0x16'))(_0x8a0e('0x17'));var utils=require(_0x8a0e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8a0e('0x19'));var db=require(_0x8a0e('0x1a'))['db'];function respondWithStatusCode(_0x320b1f,_0x3972ef){_0x3972ef=_0x3972ef||0xcc;return function(_0x273edd){if(_0x273edd){return _0x320b1f[_0x8a0e('0x1b')](_0x3972ef);}return _0x320b1f[_0x8a0e('0x1c')](_0x3972ef)['end']();};}function respondWithResult(_0x294bc1,_0x28dd53){_0x28dd53=_0x28dd53||0xc8;return function(_0xe0ab2){if(_0xe0ab2){return _0x294bc1[_0x8a0e('0x1c')](_0x28dd53)[_0x8a0e('0x1d')](_0xe0ab2);}};}function respondWithFilteredResult(_0x2b5af5,_0xf251d6){return function(_0x56633c){if(_0x56633c){var _0x63411e=typeof _0xf251d6[_0x8a0e('0x1e')]===_0x8a0e('0x1f')&&typeof _0xf251d6[_0x8a0e('0x20')]==='undefined';var _0x181b2b=_0x56633c['count'];var _0x4c5b2a=_0x63411e?0x0:_0xf251d6[_0x8a0e('0x1e')];var _0x300f57=_0x63411e?_0x56633c['count']:_0xf251d6[_0x8a0e('0x1e')]+_0xf251d6[_0x8a0e('0x20')];var _0x507546;if(_0x300f57>=_0x181b2b){_0x300f57=_0x181b2b;_0x507546=0xc8;}else{_0x507546=0xce;}_0x2b5af5[_0x8a0e('0x1c')](_0x507546);return _0x2b5af5[_0x8a0e('0x21')]('Content-Range',_0x4c5b2a+'-'+_0x300f57+'/'+_0x181b2b)[_0x8a0e('0x1d')](_0x56633c);}return null;};}function patchUpdates(_0x41af1c){return function(_0x30b494){try{jsonpatch[_0x8a0e('0x22')](_0x30b494,_0x41af1c,!![]);}catch(_0x5d309e){return BPromise[_0x8a0e('0x23')](_0x5d309e);}return _0x30b494[_0x8a0e('0x24')]();};}function saveUpdates(_0xa49dae,_0x1363e8){return function(_0x486705){if(_0x486705){return _0x486705[_0x8a0e('0x25')](_0xa49dae)['then'](function(_0x5e93d1){return _0x5e93d1;});}return null;};}function removeEntity(_0x54e2b9,_0x4e2edf){return function(_0x57b3b9){if(_0x57b3b9){return _0x57b3b9[_0x8a0e('0x26')]()['then'](function(){_0x54e2b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47958f,_0x516db4){return function(_0x52ff2c){if(!_0x52ff2c){_0x47958f[_0x8a0e('0x1b')](0x194);}return _0x52ff2c;};}function handleError(_0x384dfd,_0x2fb4c5){_0x2fb4c5=_0x2fb4c5||0x1f4;return function(_0xba2ab4){logger[_0x8a0e('0x27')](_0xba2ab4[_0x8a0e('0x28')]);if(_0xba2ab4[_0x8a0e('0x29')]){delete _0xba2ab4[_0x8a0e('0x29')];}_0x384dfd[_0x8a0e('0x1c')](_0x2fb4c5)[_0x8a0e('0x2a')](_0xba2ab4);};}exports[_0x8a0e('0x2b')]=function(_0x48aad2,_0x5bfdc9){var _0xfadf56={},_0x25aef1={},_0x44232d={'count':0x0,'rows':[]};var _0x4177ca=_[_0x8a0e('0x2c')](db[_0x8a0e('0x2d')]['rawAttributes'],function(_0x3df4d5){return{'name':_0x3df4d5[_0x8a0e('0x2e')],'type':_0x3df4d5[_0x8a0e('0x2f')]['key']};});_0x25aef1[_0x8a0e('0x30')]=_[_0x8a0e('0x2c')](_0x4177ca,_0x8a0e('0x29'));_0x25aef1['query']=_['keys'](_0x48aad2[_0x8a0e('0x31')]);_0x25aef1['filters']=_[_0x8a0e('0x32')](_0x25aef1[_0x8a0e('0x30')],_0x25aef1[_0x8a0e('0x31')]);_0xfadf56['attributes']=_['intersection'](_0x25aef1[_0x8a0e('0x30')],qs[_0x8a0e('0x33')](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x33')]));_0xfadf56[_0x8a0e('0x34')]=_0xfadf56[_0x8a0e('0x34')][_0x8a0e('0x35')]?_0xfadf56[_0x8a0e('0x34')]:_0x25aef1[_0x8a0e('0x30')];if(!_0x48aad2['query']['hasOwnProperty']('nolimit')){_0xfadf56['limit']=qs['limit'](_0x48aad2[_0x8a0e('0x31')]['limit']);_0xfadf56['offset']=qs[_0x8a0e('0x1e')](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x1e')]);}_0xfadf56[_0x8a0e('0x36')]=qs['sort'](_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0xfadf56[_0x8a0e('0x38')]=qs['filters'](_[_0x8a0e('0x39')](_0x48aad2['query'],_0x25aef1[_0x8a0e('0x3a')]),_0x4177ca);if(_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x3b')]){_0xfadf56['where']=_['merge'](_0xfadf56[_0x8a0e('0x38')],{'$or':_[_0x8a0e('0x2c')](_0x4177ca,function(_0x58d5a8){if(_0x58d5a8[_0x8a0e('0x2f')]!==_0x8a0e('0x3c')){var _0x3eb2ec={};_0x3eb2ec[_0x58d5a8[_0x8a0e('0x29')]]={'$like':'%'+_0x48aad2[_0x8a0e('0x31')]['filter']+'%'};return _0x3eb2ec;}})});}_0xfadf56=_[_0x8a0e('0x3d')]({},_0xfadf56,_0x48aad2[_0x8a0e('0x3e')]);var _0xfa8632={'where':_0xfadf56['where']};return db[_0x8a0e('0x2d')][_0x8a0e('0x3f')](_0xfa8632)[_0x8a0e('0x40')](function(_0x8390da){_0x44232d[_0x8a0e('0x3f')]=_0x8390da;if(_0x48aad2[_0x8a0e('0x31')][_0x8a0e('0x41')]){_0xfadf56[_0x8a0e('0x42')]=[{'all':!![]}];}return db[_0x8a0e('0x2d')]['findAll'](_0xfadf56);})['then'](function(_0x4dfc47){_0x44232d[_0x8a0e('0x43')]=_0x4dfc47;return _0x44232d;})[_0x8a0e('0x40')](respondWithFilteredResult(_0x5bfdc9,_0xfadf56))[_0x8a0e('0x44')](handleError(_0x5bfdc9,null));};exports['show']=function(_0x308d2b,_0x12ff29){var _0x18701c={'raw':![],'where':{'id':_0x308d2b[_0x8a0e('0x45')]['id']}},_0x5d686d={};_0x5d686d[_0x8a0e('0x30')]=_[_0x8a0e('0x46')](db[_0x8a0e('0x2d')][_0x8a0e('0x47')]);_0x5d686d[_0x8a0e('0x31')]=_[_0x8a0e('0x46')](_0x308d2b['query']);_0x5d686d[_0x8a0e('0x3a')]=_[_0x8a0e('0x32')](_0x5d686d['model'],_0x5d686d[_0x8a0e('0x31')]);_0x18701c[_0x8a0e('0x34')]=_['intersection'](_0x5d686d[_0x8a0e('0x30')],qs[_0x8a0e('0x33')](_0x308d2b[_0x8a0e('0x31')][_0x8a0e('0x33')]));_0x18701c[_0x8a0e('0x34')]=_0x18701c['attributes'][_0x8a0e('0x35')]?_0x18701c[_0x8a0e('0x34')]:_0x5d686d[_0x8a0e('0x30')];if(_0x308d2b['query'][_0x8a0e('0x41')]){_0x18701c['include']=[{'all':!![]}];}_0x18701c=_['merge']({},_0x18701c,_0x308d2b[_0x8a0e('0x3e')]);return db[_0x8a0e('0x2d')][_0x8a0e('0x48')](_0x18701c)[_0x8a0e('0x40')](handleEntityNotFound(_0x12ff29,null))[_0x8a0e('0x40')](respondWithResult(_0x12ff29,null))[_0x8a0e('0x44')](handleError(_0x12ff29,null));};exports[_0x8a0e('0x49')]=function(_0x195796,_0x465b7a){return db['Automation']['create'](_0x195796[_0x8a0e('0x4a')],{})[_0x8a0e('0x40')](respondWithResult(_0x465b7a,0xc9))[_0x8a0e('0x44')](handleError(_0x465b7a,null));};exports[_0x8a0e('0x25')]=function(_0x110fe8,_0x372f3f){if(_0x110fe8['body']['id']){delete _0x110fe8[_0x8a0e('0x4a')]['id'];}return db[_0x8a0e('0x2d')][_0x8a0e('0x48')]({'where':{'id':_0x110fe8['params']['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x372f3f,null))['then'](saveUpdates(_0x110fe8[_0x8a0e('0x4a')],null))['then'](respondWithResult(_0x372f3f,null))[_0x8a0e('0x44')](handleError(_0x372f3f,null));};exports[_0x8a0e('0x26')]=function(_0x140fb3,_0x192c3c){return db[_0x8a0e('0x2d')][_0x8a0e('0x48')]({'where':{'id':_0x140fb3['params']['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x192c3c,null))[_0x8a0e('0x40')](removeEntity(_0x192c3c,null))[_0x8a0e('0x44')](handleError(_0x192c3c,null));};exports[_0x8a0e('0x4b')]=function(_0x52b8ed,_0x51a524,_0xcf2ab1){return db[_0x8a0e('0x4c')][_0x8a0e('0x48')]({'where':{'id':_0x52b8ed[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x51a524,null))[_0x8a0e('0x40')](function(_0x230304){if(_0x230304){return _0x230304['addConditions'](_0x52b8ed[_0x8a0e('0x4a')][_0x8a0e('0x4d')],_[_0x8a0e('0x4e')](_0x52b8ed[_0x8a0e('0x4a')],[_0x8a0e('0x4d'),'id'])||{});}})[_0x8a0e('0x40')](respondWithResult(_0x51a524,null))[_0x8a0e('0x44')](handleError(_0x51a524,null));};exports[_0x8a0e('0x4f')]=function(_0x251ad5,_0x27fcf4,_0x54e90e){var _0x446991={};var _0x4dcc51={};var _0x3cad27;var _0x578032;return db[_0x8a0e('0x2d')][_0x8a0e('0x50')]({'where':{'id':_0x251ad5[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x27fcf4,null))[_0x8a0e('0x40')](function(_0x35803d){if(_0x35803d){_0x3cad27=_0x35803d;_0x4dcc51['model']=_[_0x8a0e('0x46')](db[_0x8a0e('0x4c')]['rawAttributes']);_0x4dcc51['query']=_[_0x8a0e('0x46')](_0x251ad5[_0x8a0e('0x31')]);_0x4dcc51['filters']=_[_0x8a0e('0x32')](_0x4dcc51[_0x8a0e('0x30')],_0x4dcc51[_0x8a0e('0x31')]);_0x446991[_0x8a0e('0x34')]=_['intersection'](_0x4dcc51['model'],qs[_0x8a0e('0x33')](_0x251ad5['query']['fields']));_0x446991['attributes']=_0x446991['attributes'][_0x8a0e('0x35')]?_0x446991['attributes']:_0x4dcc51[_0x8a0e('0x30')];_0x446991['order']=qs[_0x8a0e('0x37')](_0x251ad5[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0x446991['where']=qs['filters'](_[_0x8a0e('0x39')](_0x251ad5[_0x8a0e('0x31')],_0x4dcc51[_0x8a0e('0x3a')]));if(_0x251ad5['query'][_0x8a0e('0x3b')]){_0x446991[_0x8a0e('0x38')]=_[_0x8a0e('0x3d')](_0x446991['where'],{'$or':_[_0x8a0e('0x2c')](_0x446991[_0x8a0e('0x34')],function(_0x350f89){var _0x55f3cf={};_0x55f3cf[_0x350f89]={'$like':'%'+_0x251ad5['query']['filter']+'%'};return _0x55f3cf;})});}_0x446991=_['merge']({},_0x446991,_0x251ad5[_0x8a0e('0x3e')]);return _0x3cad27[_0x8a0e('0x4f')](_0x446991);}})[_0x8a0e('0x40')](function(_0x59a903){if(_0x59a903){_0x578032=_0x59a903[_0x8a0e('0x35')];if(!_0x251ad5[_0x8a0e('0x31')]['hasOwnProperty'](_0x8a0e('0x51'))){_0x446991[_0x8a0e('0x20')]=qs[_0x8a0e('0x20')](_0x251ad5[_0x8a0e('0x31')][_0x8a0e('0x20')]);_0x446991[_0x8a0e('0x1e')]=qs[_0x8a0e('0x1e')](_0x251ad5['query'][_0x8a0e('0x1e')]);}return _0x3cad27[_0x8a0e('0x4f')](_0x446991);}})[_0x8a0e('0x40')](function(_0x26dafc){if(_0x26dafc){return _0x26dafc?{'count':_0x578032,'rows':_0x26dafc}:null;}})[_0x8a0e('0x40')](respondWithResult(_0x27fcf4,null))['catch'](handleError(_0x27fcf4,null));};exports[_0x8a0e('0x52')]=function(_0x46df62,_0x48f9b4,_0x137eab){return db[_0x8a0e('0x53')][_0x8a0e('0x48')]({'where':{'id':_0x46df62[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x48f9b4,null))[_0x8a0e('0x40')](function(_0x55a358){if(_0x55a358){return _0x55a358[_0x8a0e('0x52')](_0x46df62['body'][_0x8a0e('0x4d')],_[_0x8a0e('0x4e')](_0x46df62[_0x8a0e('0x4a')],[_0x8a0e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x48f9b4,null))['catch'](handleError(_0x48f9b4,null));};exports[_0x8a0e('0x54')]=function(_0x54bd2c,_0x1848b8,_0x1ac8c5){var _0x33a2da={};var _0x623404={};var _0x3e6f82;var _0x2be170;return db[_0x8a0e('0x2d')][_0x8a0e('0x50')]({'where':{'id':_0x54bd2c[_0x8a0e('0x45')]['id']}})[_0x8a0e('0x40')](handleEntityNotFound(_0x1848b8,null))[_0x8a0e('0x40')](function(_0x49a9f0){if(_0x49a9f0){_0x3e6f82=_0x49a9f0;_0x623404[_0x8a0e('0x30')]=_[_0x8a0e('0x46')](db['Action']['rawAttributes']);_0x623404['query']=_['keys'](_0x54bd2c['query']);_0x623404[_0x8a0e('0x3a')]=_[_0x8a0e('0x32')](_0x623404[_0x8a0e('0x30')],_0x623404['query']);_0x33a2da[_0x8a0e('0x34')]=_[_0x8a0e('0x32')](_0x623404['model'],qs[_0x8a0e('0x33')](_0x54bd2c['query'][_0x8a0e('0x33')]));_0x33a2da[_0x8a0e('0x34')]=_0x33a2da[_0x8a0e('0x34')]['length']?_0x33a2da[_0x8a0e('0x34')]:_0x623404[_0x8a0e('0x30')];_0x33a2da['order']=qs['sort'](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x37')]);_0x33a2da[_0x8a0e('0x38')]=qs[_0x8a0e('0x3a')](_[_0x8a0e('0x39')](_0x54bd2c[_0x8a0e('0x31')],_0x623404[_0x8a0e('0x3a')]));if(_0x54bd2c[_0x8a0e('0x31')]['filter']){_0x33a2da[_0x8a0e('0x38')]=_[_0x8a0e('0x3d')](_0x33a2da[_0x8a0e('0x38')],{'$or':_[_0x8a0e('0x2c')](_0x33a2da[_0x8a0e('0x34')],function(_0x56245a){var _0x4adcea={};_0x4adcea[_0x56245a]={'$like':'%'+_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x3b')]+'%'};return _0x4adcea;})});}_0x33a2da=_[_0x8a0e('0x3d')]({},_0x33a2da,_0x54bd2c['options']);return _0x3e6f82['getActions'](_0x33a2da);}})['then'](function(_0x25b73b){if(_0x25b73b){_0x2be170=_0x25b73b['length'];if(!_0x54bd2c['query']['hasOwnProperty'](_0x8a0e('0x51'))){_0x33a2da['limit']=qs['limit'](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x20')]);_0x33a2da['offset']=qs[_0x8a0e('0x1e')](_0x54bd2c[_0x8a0e('0x31')][_0x8a0e('0x1e')]);}return _0x3e6f82['getActions'](_0x33a2da);}})[_0x8a0e('0x40')](function(_0x4577d0){if(_0x4577d0){return _0x4577d0?{'count':_0x2be170,'rows':_0x4577d0}:null;}})[_0x8a0e('0x40')](respondWithResult(_0x1848b8,null))['catch'](handleError(_0x1848b8,null));};
\ No newline at end of file
+var _0x740e=['key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','show','params','keys','intersection','includeAll','options','find','create','catch','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x740e,0x179));var _0xe740=function(_0x12de57,_0x3a3edc){_0x12de57=_0x12de57-0x0;var _0x3f668f=_0x740e[_0x12de57];return _0x3f668f;};'use strict';var emlformat=require(_0xe740('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe740('0x1'));var rp=require(_0xe740('0x2'));var moment=require(_0xe740('0x3'));var BPromise=require(_0xe740('0x4'));var Mustache=require(_0xe740('0x5'));var util=require(_0xe740('0x6'));var path=require(_0xe740('0x7'));var sox=require('sox');var csv=require(_0xe740('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe740('0x9'));var _=require(_0xe740('0xa'));var squel=require(_0xe740('0xb'));var crypto=require(_0xe740('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe740('0xd'));var toCsv=require(_0xe740('0x8'));var querystring=require(_0xe740('0xe'));var Papa=require(_0xe740('0xf'));var Redis=require(_0xe740('0x10'));var authService=require(_0xe740('0x11'));var qs=require(_0xe740('0x12'));var as=require(_0xe740('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe740('0x14'))(_0xe740('0x15'));var utils=require(_0xe740('0x16'));var config=require(_0xe740('0x17'));var licenseUtil=require(_0xe740('0x18'));var db=require(_0xe740('0x19'))['db'];function respondWithStatusCode(_0x53e7c1,_0x2a50cc){_0x2a50cc=_0x2a50cc||0xcc;return function(_0xbe8b7b){if(_0xbe8b7b){return _0x53e7c1[_0xe740('0x1a')](_0x2a50cc);}return _0x53e7c1[_0xe740('0x1b')](_0x2a50cc)[_0xe740('0x1c')]();};}function respondWithResult(_0x35ff3f,_0x57dc45){_0x57dc45=_0x57dc45||0xc8;return function(_0x247183){if(_0x247183){return _0x35ff3f[_0xe740('0x1b')](_0x57dc45)[_0xe740('0x1d')](_0x247183);}};}function respondWithFilteredResult(_0x519b5,_0x38b6db){return function(_0x26adfd){if(_0x26adfd){var _0x121bec=typeof _0x38b6db[_0xe740('0x1e')]===_0xe740('0x1f')&&typeof _0x38b6db[_0xe740('0x20')]==='undefined';var _0x446b4b=_0x26adfd['count'];var _0x41e781=_0x121bec?0x0:_0x38b6db[_0xe740('0x1e')];var _0x3b8a6f=_0x121bec?_0x26adfd[_0xe740('0x21')]:_0x38b6db[_0xe740('0x1e')]+_0x38b6db[_0xe740('0x20')];var _0x158db4;if(_0x3b8a6f>=_0x446b4b){_0x3b8a6f=_0x446b4b;_0x158db4=0xc8;}else{_0x158db4=0xce;}_0x519b5['status'](_0x158db4);return _0x519b5[_0xe740('0x22')]('Content-Range',_0x41e781+'-'+_0x3b8a6f+'/'+_0x446b4b)[_0xe740('0x1d')](_0x26adfd);}return null;};}function patchUpdates(_0x1c9c3c){return function(_0x5ccc88){try{jsonpatch[_0xe740('0x23')](_0x5ccc88,_0x1c9c3c,!![]);}catch(_0x2060d5){return BPromise['reject'](_0x2060d5);}return _0x5ccc88['save']();};}function saveUpdates(_0x27d305,_0x39578d){return function(_0x2b092d){if(_0x2b092d){return _0x2b092d[_0xe740('0x24')](_0x27d305)[_0xe740('0x25')](function(_0x16f648){return _0x16f648;});}return null;};}function removeEntity(_0x42a23d,_0x371c03){return function(_0x367418){if(_0x367418){return _0x367418[_0xe740('0x26')]()[_0xe740('0x25')](function(){_0x42a23d['status'](0xcc)[_0xe740('0x1c')]();});}};}function handleEntityNotFound(_0x19fe3c,_0x426250){return function(_0xcbe053){if(!_0xcbe053){_0x19fe3c[_0xe740('0x1a')](0x194);}return _0xcbe053;};}function handleError(_0x3f0878,_0x4e74fb){_0x4e74fb=_0x4e74fb||0x1f4;return function(_0x43c7fa){logger[_0xe740('0x27')](_0x43c7fa[_0xe740('0x28')]);if(_0x43c7fa[_0xe740('0x29')]){delete _0x43c7fa[_0xe740('0x29')];}_0x3f0878[_0xe740('0x1b')](_0x4e74fb)[_0xe740('0x2a')](_0x43c7fa);};}exports[_0xe740('0x2b')]=function(_0x1795c1,_0x3d192b){var _0x52c106={},_0x52675b={},_0x264631={'count':0x0,'rows':[]};var _0x425944=_[_0xe740('0x2c')](db[_0xe740('0x2d')][_0xe740('0x2e')],function(_0x5ded98){return{'name':_0x5ded98['fieldName'],'type':_0x5ded98[_0xe740('0x2f')][_0xe740('0x30')]};});_0x52675b[_0xe740('0x31')]=_[_0xe740('0x2c')](_0x425944,_0xe740('0x29'));_0x52675b[_0xe740('0x32')]=_['keys'](_0x1795c1['query']);_0x52675b[_0xe740('0x33')]=_['intersection'](_0x52675b['model'],_0x52675b[_0xe740('0x32')]);_0x52c106[_0xe740('0x34')]=_['intersection'](_0x52675b[_0xe740('0x31')],qs[_0xe740('0x35')](_0x1795c1[_0xe740('0x32')][_0xe740('0x35')]));_0x52c106[_0xe740('0x34')]=_0x52c106['attributes'][_0xe740('0x36')]?_0x52c106[_0xe740('0x34')]:_0x52675b[_0xe740('0x31')];if(!_0x1795c1[_0xe740('0x32')][_0xe740('0x37')]('nolimit')){_0x52c106[_0xe740('0x20')]=qs[_0xe740('0x20')](_0x1795c1['query'][_0xe740('0x20')]);_0x52c106[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x1795c1['query'][_0xe740('0x1e')]);}_0x52c106[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x1795c1['query'][_0xe740('0x39')]);_0x52c106['where']=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x1795c1[_0xe740('0x32')],_0x52675b['filters']),_0x425944);if(_0x1795c1[_0xe740('0x32')][_0xe740('0x3b')]){_0x52c106[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x52c106[_0xe740('0x3c')],{'$or':_['map'](_0x425944,function(_0x4d5d16){if(_0x4d5d16['type']!==_0xe740('0x3e')){var _0x5b52f5={};_0x5b52f5[_0x4d5d16[_0xe740('0x29')]]={'$like':'%'+_0x1795c1[_0xe740('0x32')]['filter']+'%'};return _0x5b52f5;}})});}_0x52c106=_['merge']({},_0x52c106,_0x1795c1['options']);var _0xb8bcc9={'where':_0x52c106[_0xe740('0x3c')]};return db[_0xe740('0x2d')][_0xe740('0x21')](_0xb8bcc9)[_0xe740('0x25')](function(_0x15b0a4){_0x264631[_0xe740('0x21')]=_0x15b0a4;if(_0x1795c1[_0xe740('0x32')]['includeAll']){_0x52c106['include']=[{'all':!![]}];}return db[_0xe740('0x2d')][_0xe740('0x3f')](_0x52c106);})[_0xe740('0x25')](function(_0x35f6ba){_0x264631[_0xe740('0x40')]=_0x35f6ba;return _0x264631;})['then'](respondWithFilteredResult(_0x3d192b,_0x52c106))['catch'](handleError(_0x3d192b,null));};exports[_0xe740('0x41')]=function(_0x298735,_0x502ef2){var _0x4f67bd={'raw':![],'where':{'id':_0x298735[_0xe740('0x42')]['id']}},_0x3d4192={};_0x3d4192['model']=_[_0xe740('0x43')](db[_0xe740('0x2d')][_0xe740('0x2e')]);_0x3d4192[_0xe740('0x32')]=_[_0xe740('0x43')](_0x298735[_0xe740('0x32')]);_0x3d4192[_0xe740('0x33')]=_[_0xe740('0x44')](_0x3d4192['model'],_0x3d4192[_0xe740('0x32')]);_0x4f67bd['attributes']=_[_0xe740('0x44')](_0x3d4192[_0xe740('0x31')],qs[_0xe740('0x35')](_0x298735['query']['fields']));_0x4f67bd['attributes']=_0x4f67bd['attributes']['length']?_0x4f67bd['attributes']:_0x3d4192['model'];if(_0x298735[_0xe740('0x32')][_0xe740('0x45')]){_0x4f67bd['include']=[{'all':!![]}];}_0x4f67bd=_[_0xe740('0x3d')]({},_0x4f67bd,_0x298735[_0xe740('0x46')]);return db[_0xe740('0x2d')][_0xe740('0x47')](_0x4f67bd)['then'](handleEntityNotFound(_0x502ef2,null))[_0xe740('0x25')](respondWithResult(_0x502ef2,null))['catch'](handleError(_0x502ef2,null));};exports[_0xe740('0x48')]=function(_0x2c5d16,_0x47c960){return db[_0xe740('0x2d')][_0xe740('0x48')](_0x2c5d16['body'],{})[_0xe740('0x25')](respondWithResult(_0x47c960,0xc9))[_0xe740('0x49')](handleError(_0x47c960,null));};exports[_0xe740('0x24')]=function(_0x8989fd,_0x17f55e){if(_0x8989fd[_0xe740('0x4a')]['id']){delete _0x8989fd[_0xe740('0x4a')]['id'];}return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x8989fd[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x17f55e,null))['then'](saveUpdates(_0x8989fd[_0xe740('0x4a')],null))[_0xe740('0x25')](respondWithResult(_0x17f55e,null))['catch'](handleError(_0x17f55e,null));};exports[_0xe740('0x26')]=function(_0x108b9b,_0x2f7675){return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x108b9b[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x2f7675,null))[_0xe740('0x25')](removeEntity(_0x2f7675,null))[_0xe740('0x49')](handleError(_0x2f7675,null));};exports[_0xe740('0x4b')]=function(_0x57a22e,_0x55d19a,_0x1e2915){return db[_0xe740('0x4c')][_0xe740('0x47')]({'where':{'id':_0x57a22e['params']['id']}})['then'](handleEntityNotFound(_0x55d19a,null))['then'](function(_0x5b3697){if(_0x5b3697){return _0x5b3697[_0xe740('0x4b')](_0x57a22e[_0xe740('0x4a')][_0xe740('0x4d')],_[_0xe740('0x4e')](_0x57a22e[_0xe740('0x4a')],['ids','id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x55d19a,null))['catch'](handleError(_0x55d19a,null));};exports[_0xe740('0x4f')]=function(_0x34a276,_0x5868fa,_0x2bc6c6){var _0x4c51c6={};var _0x163e49={};var _0x6baac7;var _0x2fb841;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x34a276[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x5868fa,null))['then'](function(_0x5f45ea){if(_0x5f45ea){_0x6baac7=_0x5f45ea;_0x163e49['model']=_[_0xe740('0x43')](db[_0xe740('0x4c')][_0xe740('0x2e')]);_0x163e49['query']=_[_0xe740('0x43')](_0x34a276[_0xe740('0x32')]);_0x163e49[_0xe740('0x33')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],_0x163e49['query']);_0x4c51c6[_0xe740('0x34')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],qs[_0xe740('0x35')](_0x34a276[_0xe740('0x32')][_0xe740('0x35')]));_0x4c51c6[_0xe740('0x34')]=_0x4c51c6['attributes'][_0xe740('0x36')]?_0x4c51c6[_0xe740('0x34')]:_0x163e49[_0xe740('0x31')];_0x4c51c6[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x34a276[_0xe740('0x32')][_0xe740('0x39')]);_0x4c51c6[_0xe740('0x3c')]=qs['filters'](_[_0xe740('0x3a')](_0x34a276['query'],_0x163e49[_0xe740('0x33')]));if(_0x34a276[_0xe740('0x32')][_0xe740('0x3b')]){_0x4c51c6[_0xe740('0x3c')]=_['merge'](_0x4c51c6['where'],{'$or':_[_0xe740('0x2c')](_0x4c51c6['attributes'],function(_0x259576){var _0x2df1a5={};_0x2df1a5[_0x259576]={'$like':'%'+_0x34a276['query']['filter']+'%'};return _0x2df1a5;})});}_0x4c51c6=_[_0xe740('0x3d')]({},_0x4c51c6,_0x34a276[_0xe740('0x46')]);return _0x6baac7[_0xe740('0x4f')](_0x4c51c6);}})['then'](function(_0x494117){if(_0x494117){_0x2fb841=_0x494117['length'];if(!_0x34a276[_0xe740('0x32')][_0xe740('0x37')](_0xe740('0x51'))){_0x4c51c6[_0xe740('0x20')]=qs['limit'](_0x34a276[_0xe740('0x32')][_0xe740('0x20')]);_0x4c51c6['offset']=qs[_0xe740('0x1e')](_0x34a276[_0xe740('0x32')][_0xe740('0x1e')]);}return _0x6baac7['getConditions'](_0x4c51c6);}})[_0xe740('0x25')](function(_0x2a9381){if(_0x2a9381){return _0x2a9381?{'count':_0x2fb841,'rows':_0x2a9381}:null;}})[_0xe740('0x25')](respondWithResult(_0x5868fa,null))[_0xe740('0x49')](handleError(_0x5868fa,null));};exports[_0xe740('0x52')]=function(_0x42ad66,_0x504e29,_0x5a7145){return db[_0xe740('0x53')][_0xe740('0x47')]({'where':{'id':_0x42ad66[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x504e29,null))[_0xe740('0x25')](function(_0x1db76d){if(_0x1db76d){return _0x1db76d['addActions'](_0x42ad66[_0xe740('0x4a')][_0xe740('0x4d')],_['omit'](_0x42ad66[_0xe740('0x4a')],[_0xe740('0x4d'),'id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x504e29,null))[_0xe740('0x49')](handleError(_0x504e29,null));};exports[_0xe740('0x54')]=function(_0x37f482,_0x8df0e4,_0x16b686){var _0x25371a={};var _0x586310={};var _0x40fdf0;var _0x23bed4;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x37f482['params']['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x8df0e4,null))[_0xe740('0x25')](function(_0x568724){if(_0x568724){_0x40fdf0=_0x568724;_0x586310[_0xe740('0x31')]=_[_0xe740('0x43')](db[_0xe740('0x53')][_0xe740('0x2e')]);_0x586310[_0xe740('0x32')]=_[_0xe740('0x43')](_0x37f482[_0xe740('0x32')]);_0x586310[_0xe740('0x33')]=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],_0x586310[_0xe740('0x32')]);_0x25371a['attributes']=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],qs['fields'](_0x37f482[_0xe740('0x32')][_0xe740('0x35')]));_0x25371a[_0xe740('0x34')]=_0x25371a['attributes'][_0xe740('0x36')]?_0x25371a[_0xe740('0x34')]:_0x586310[_0xe740('0x31')];_0x25371a[_0xe740('0x38')]=qs['sort'](_0x37f482[_0xe740('0x32')][_0xe740('0x39')]);_0x25371a[_0xe740('0x3c')]=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x37f482[_0xe740('0x32')],_0x586310[_0xe740('0x33')]));if(_0x37f482[_0xe740('0x32')][_0xe740('0x3b')]){_0x25371a[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x25371a['where'],{'$or':_[_0xe740('0x2c')](_0x25371a['attributes'],function(_0x4eca8c){var _0x2121eb={};_0x2121eb[_0x4eca8c]={'$like':'%'+_0x37f482['query'][_0xe740('0x3b')]+'%'};return _0x2121eb;})});}_0x25371a=_[_0xe740('0x3d')]({},_0x25371a,_0x37f482[_0xe740('0x46')]);return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x4c04d3){if(_0x4c04d3){_0x23bed4=_0x4c04d3['length'];if(!_0x37f482[_0xe740('0x32')]['hasOwnProperty']('nolimit')){_0x25371a['limit']=qs[_0xe740('0x20')](_0x37f482[_0xe740('0x32')][_0xe740('0x20')]);_0x25371a[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x37f482['query']['offset']);}return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x5e5657){if(_0x5e5657){return _0x5e5657?{'count':_0x23bed4,'rows':_0x5e5657}:null;}})[_0xe740('0x25')](respondWithResult(_0x8df0e4,null))[_0xe740('0x49')](handleError(_0x8df0e4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index a7c10a5..c9b5e4a 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 _0x4996=['api','moment','bluebird','path','../../config/environment','define','util'];(function(_0x81c1ef,_0x5a49ea){var _0x4b83d6=function(_0x4d6706){while(--_0x4d6706){_0x81c1ef['push'](_0x81c1ef['shift']());}};_0x4b83d6(++_0x5a49ea);}(_0x4996,0xbc));var _0x6499=function(_0x55214a,_0x30f5ac){_0x55214a=_0x55214a-0x0;var _0x58cb5b=_0x4996[_0x55214a];return _0x58cb5b;};'use strict';var _=require('lodash');var util=require(_0x6499('0x0'));var logger=require('../../config/logger')(_0x6499('0x1'));var moment=require(_0x6499('0x2'));var BPromise=require(_0x6499('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6499('0x4'));var rimraf=require('rimraf');var config=require(_0x6499('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x269d75,_0x119f29){return _0x269d75[_0x6499('0x6')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06b3=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Automation','lodash'];(function(_0x2299c8,_0xacd528){var _0x151013=function(_0x270d0b){while(--_0x270d0b){_0x2299c8['push'](_0x2299c8['shift']());}};_0x151013(++_0xacd528);}(_0x06b3,0x15f));var _0x306b=function(_0x30040c,_0x2f8c29){_0x30040c=_0x30040c-0x0;var _0x5b0204=_0x06b3[_0x30040c];return _0x5b0204;};'use strict';var _=require(_0x306b('0x0'));var util=require(_0x306b('0x1'));var logger=require(_0x306b('0x2'))(_0x306b('0x3'));var moment=require('moment');var BPromise=require(_0x306b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x306b('0x5'));var rimraf=require(_0x306b('0x6'));var config=require(_0x306b('0x7'));var attributes=require('./automation.attributes');module[_0x306b('0x8')]=function(_0x249d02,_0x12814c){return _0x249d02[_0x306b('0x9')](_0x306b('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 692ad70..f4a8e89 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 _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xb4c1f4,_0x10648f){var _0x443ccc=function(_0x16a69a){while(--_0x16a69a){_0xb4c1f4['push'](_0xb4c1f4['shift']());}};_0x443ccc(++_0x10648f);}(_0x70e3,0x9d));var _0x370e=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x70e3[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});}
\ No newline at end of file
+var _0x5454=['stringify','error','code','message','result','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5454,0x15b));var _0x4545=function(_0x281ea8,_0x46e40c){_0x281ea8=_0x281ea8-0x0;var _0x786282=_0x5454[_0x281ea8];return _0x786282;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4545('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4545('0x1'));var logger=require(_0x4545('0x2'))(_0x4545('0x3'));var config=require(_0x4545('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4545('0x5')][_0x4545('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x6fd3bb,_0xc79c57,_0x3f1134){return new BPromise(function(_0x1fd7e5,_0x1c5649){return client[_0x4545('0x7')](_0x6fd3bb,_0x3f1134)[_0x4545('0x8')](function(_0x3e2526){logger[_0x4545('0x9')](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));logger['debug'](_0x4545('0xc'),_0xc79c57,_0x4545('0xb'),JSON[_0x4545('0xd')](_0x3e2526));if(_0x3e2526[_0x4545('0xe')]){if(_0x3e2526[_0x4545('0xe')][_0x4545('0xf')]===0x1f4){logger['error'](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1c5649(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1fd7e5(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}else{logger['info'](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));_0x1fd7e5(_0x3e2526[_0x4545('0x11')][_0x4545('0x10')]);}})['catch'](function(_0x4a5bdf){logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x4a5bdf);_0x1c5649(_0x4a5bdf);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index a284468..44d0ed1 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 _0xd847=['../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x41a6f4,_0x2a5df9){var _0x40785e=function(_0x2ad2a8){while(--_0x2ad2a8){_0x41a6f4['push'](_0x41a6f4['shift']());}};_0x40785e(++_0x2a5df9);}(_0xd847,0x18a));var _0x7d84=function(_0x300cdb,_0x88b46){_0x300cdb=_0x300cdb-0x0;var _0x54e47f=_0xd847[_0x300cdb];return _0x54e47f;};'use strict';var multer=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var path=require(_0x7d84('0x2'));var timeout=require(_0x7d84('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7d84('0x4'));var auth=require(_0x7d84('0x5'));var interaction=require(_0x7d84('0x6'));var config=require(_0x7d84('0x7'));var controller=require(_0x7d84('0x8'));router['get']('/',auth[_0x7d84('0x9')](),controller['index']);router[_0x7d84('0xa')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0xc')]);router[_0x7d84('0xa')](_0x7d84('0xd'),auth['isAuthenticated'](),controller[_0x7d84('0xe')]);router['get']('/:id/actions',auth[_0x7d84('0x9')](),controller[_0x7d84('0xf')]);router[_0x7d84('0x10')]('/',auth[_0x7d84('0x9')](),controller[_0x7d84('0x11')]);router[_0x7d84('0x10')](_0x7d84('0xd'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x12')]);router[_0x7d84('0x10')](_0x7d84('0x13'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x14')]);router[_0x7d84('0x15')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x16')]);router[_0x7d84('0x17')](_0x7d84('0xb'),auth[_0x7d84('0x9')](),controller[_0x7d84('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x1fdc=['put','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x3806e8,_0x5f43ce){var _0x35bc99=function(_0xf5e039){while(--_0xf5e039){_0x3806e8['push'](_0x3806e8['shift']());}};_0x35bc99(++_0x5f43ce);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x1fdc[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var path=require('path');var timeout=require(_0xc1fd('0x2'));var express=require(_0xc1fd('0x3'));var router=express[_0xc1fd('0x4')]();var fs_extra=require(_0xc1fd('0x5'));var auth=require(_0xc1fd('0x6'));var interaction=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var controller=require('./automation.controller');router[_0xc1fd('0x9')]('/',auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xb')]);router[_0xc1fd('0x9')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xd')]);router[_0xc1fd('0x9')](_0xc1fd('0xe'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xf')]);router[_0xc1fd('0x9')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x11')]);router[_0xc1fd('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1fd('0x13')]);router['post'](_0xc1fd('0xe'),auth['isAuthenticated'](),controller[_0xc1fd('0x14')]);router[_0xc1fd('0x12')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x15')]);router[_0xc1fd('0x16')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['update']);router['delete'](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 7bf3be7..ba79688 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 _0x2581=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x4845cd,_0x4e7997){var _0x38d59a=function(_0x4bb7e3){while(--_0x4bb7e3){_0x4845cd['push'](_0x4845cd['shift']());}};_0x38d59a(++_0x4e7997);}(_0x2581,0x72));var _0x1258=function(_0x21ef4c,_0x3dbb09){_0x21ef4c=_0x21ef4c-0x0;var _0xf4326=_0x2581[_0x21ef4c];return _0xf4326;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'unique':_0x1258('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x5')),'allowNull':![],'defaultValue':_0x1258('0x5')},'description':{'type':Sequelize[_0x1258('0x2')]},'active':{'type':Sequelize[_0x1258('0x6')],'defaultValue':0x0,'comment':_0x1258('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1258('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1258('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1258('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1258('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'comment':_0x1258('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1258('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1258('0x2')],'defaultValue':_0x1258('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x1258('0x4')](_0x1258('0x11'),'never',_0x1258('0x12')),'defaultValue':_0x1258('0x11')},'dialAMDActive':{'type':Sequelize[_0x1258('0x6')],'defaultValue':0x0,'comment':_0x1258('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1258('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1258('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1258('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1258('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1258('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1258('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1258('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1258('0xa')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1258('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1258('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1258('0xa')](0x9)[_0x1258('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1258('0x1a'),_0x1258('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1258('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'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':_0x1258('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)[_0x1258('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)[_0x1258('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1258('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1258('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1258('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1258('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xc0b1=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr'];(function(_0x17bcc8,_0x3dac2f){var _0x5854aa=function(_0x2fb8a9){while(--_0x2fb8a9){_0x17bcc8['push'](_0x17bcc8['shift']());}};_0x5854aa(++_0x3dac2f);}(_0xc0b1,0x1b3));var _0x1c0b=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0xc0b1[_0x260ce2];return _0x16b105;};'use strict';var Sequelize=require('sequelize');module[_0x1c0b('0x0')]={'name':{'type':Sequelize[_0x1c0b('0x1')],'unique':_0x1c0b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x4')),'allowNull':![],'defaultValue':_0x1c0b('0x4')},'description':{'type':Sequelize[_0x1c0b('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1c0b('0x5')},'limitCalls':{'type':Sequelize[_0x1c0b('0x6')](0x4)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1c0b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c0b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1c0b('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c0b('0xe')},'dialTimezone':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':_0x1c0b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x10'),_0x1c0b('0x11'),_0x1c0b('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1c0b('0x13')],'defaultValue':0x0,'comment':_0x1c0b('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c0b('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c0b('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1c0b('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c0b('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c0b('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1c0b('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1c0b('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c0b('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1c0b('0x3')]('DESC',_0x1c0b('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c0b('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1e')},'dialCutDigit':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 44d2147..f15b219 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 _0x6526=['phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','cm_contacts','select','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','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','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','Campaign','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0x6526,0xa2));var _0x6652=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x6526[_0x553a87];return _0x12d1e6;};'use strict';var emlformat=require(_0x6652('0x0'));var rimraf=require(_0x6652('0x1'));var zipdir=require(_0x6652('0x2'));var jsonpatch=require(_0x6652('0x3'));var rp=require(_0x6652('0x4'));var moment=require(_0x6652('0x5'));var BPromise=require(_0x6652('0x6'));var Mustache=require('mustache');var util=require(_0x6652('0x7'));var path=require('path');var sox=require(_0x6652('0x8'));var csv=require(_0x6652('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6652('0xa'));var _=require('lodash');var squel=require(_0x6652('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6652('0xc'));var toCsv=require(_0x6652('0x9'));var querystring=require(_0x6652('0xd'));var Papa=require(_0x6652('0xe'));var Redis=require(_0x6652('0xf'));var authService=require(_0x6652('0x10'));var qs=require(_0x6652('0x11'));var as=require(_0x6652('0x12'));var hardwareService=require(_0x6652('0x13'));var logger=require(_0x6652('0x14'))('api');var utils=require(_0x6652('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6652('0x16'));var db=require(_0x6652('0x17'))['db'];function respondWithStatusCode(_0x31ef0b,_0x209674){_0x209674=_0x209674||0xcc;return function(_0x386c30){if(_0x386c30){return _0x31ef0b['sendStatus'](_0x209674);}return _0x31ef0b[_0x6652('0x18')](_0x209674)[_0x6652('0x19')]();};}function respondWithResult(_0x3b04b3,_0x296531){_0x296531=_0x296531||0xc8;return function(_0x4b4f84){if(_0x4b4f84){return _0x3b04b3[_0x6652('0x18')](_0x296531)[_0x6652('0x1a')](_0x4b4f84);}};}function respondWithFilteredResult(_0x43547c,_0x435da9){return function(_0x5b010c){if(_0x5b010c){var _0x49859e=typeof _0x435da9[_0x6652('0x1b')]==='undefined'&&typeof _0x435da9[_0x6652('0x1c')]===_0x6652('0x1d');var _0x281f41=_0x5b010c['count'];var _0x31a6ca=_0x49859e?0x0:_0x435da9[_0x6652('0x1b')];var _0x453c65=_0x49859e?_0x5b010c[_0x6652('0x1e')]:_0x435da9[_0x6652('0x1b')]+_0x435da9[_0x6652('0x1c')];var _0x2b0740;if(_0x453c65>=_0x281f41){_0x453c65=_0x281f41;_0x2b0740=0xc8;}else{_0x2b0740=0xce;}_0x43547c['status'](_0x2b0740);return _0x43547c[_0x6652('0x1f')](_0x6652('0x20'),_0x31a6ca+'-'+_0x453c65+'/'+_0x281f41)[_0x6652('0x1a')](_0x5b010c);}return null;};}function patchUpdates(_0x20699b){return function(_0x911b6e){try{jsonpatch[_0x6652('0x21')](_0x911b6e,_0x20699b,!![]);}catch(_0x1c0f19){return BPromise['reject'](_0x1c0f19);}return _0x911b6e[_0x6652('0x22')]();};}function saveUpdates(_0x580fe5,_0x1f9d27){return function(_0x21441d){if(_0x21441d){return _0x21441d['update'](_0x580fe5)[_0x6652('0x23')](function(_0x4761c5){return _0x4761c5;});}return null;};}function removeEntity(_0x4e4102,_0x5cb432){return function(_0x294f99){if(_0x294f99){return _0x294f99[_0x6652('0x24')]()[_0x6652('0x23')](function(){var _0x4f0c24=_0x294f99[_0x6652('0x25')]({'plain':!![]});var _0x5eb5eb='IvrCampaigns';return db[_0x6652('0x26')][_0x6652('0x24')]({'where':{'type':_0x5eb5eb,'resourceId':_0x4f0c24['id']}})[_0x6652('0x23')](function(){return _0x294f99;});})[_0x6652('0x23')](function(){_0x4e4102[_0x6652('0x18')](0xcc)[_0x6652('0x19')]();});}};}function handleEntityNotFound(_0x50d035,_0x30209c){return function(_0xd8bd18){if(!_0xd8bd18){_0x50d035[_0x6652('0x27')](0x194);}return _0xd8bd18;};}function handleError(_0x5ceece,_0x3c3958){_0x3c3958=_0x3c3958||0x1f4;return function(_0x2fb2f0){logger[_0x6652('0x28')](_0x2fb2f0[_0x6652('0x29')]);if(_0x2fb2f0[_0x6652('0x2a')]){delete _0x2fb2f0[_0x6652('0x2a')];}_0x5ceece[_0x6652('0x18')](_0x3c3958)[_0x6652('0x2b')](_0x2fb2f0);};}exports['index']=function(_0x4ffb2b,_0x583d7a){var _0x444cb1={},_0x894c3={},_0x2d8e95={'count':0x0,'rows':[]};var _0x358b55=_[_0x6652('0x2c')](db[_0x6652('0x2d')]['rawAttributes'],function(_0x23deda){return{'name':_0x23deda[_0x6652('0x2e')],'type':_0x23deda[_0x6652('0x2f')][_0x6652('0x30')]};});_0x894c3[_0x6652('0x31')]=_[_0x6652('0x2c')](_0x358b55,_0x6652('0x2a'));_0x894c3[_0x6652('0x32')]=_[_0x6652('0x33')](_0x4ffb2b[_0x6652('0x32')]);_0x894c3[_0x6652('0x34')]=_['intersection'](_0x894c3[_0x6652('0x31')],_0x894c3['query']);_0x444cb1[_0x6652('0x35')]=_[_0x6652('0x36')](_0x894c3[_0x6652('0x31')],qs[_0x6652('0x37')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x37')]));_0x444cb1[_0x6652('0x35')]=_0x444cb1['attributes'][_0x6652('0x38')]?_0x444cb1['attributes']:_0x894c3['model'];if(!_0x4ffb2b[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x444cb1[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x1c')]);_0x444cb1['offset']=qs[_0x6652('0x1b')](_0x4ffb2b[_0x6652('0x32')][_0x6652('0x1b')]);}_0x444cb1[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x4ffb2b[_0x6652('0x32')]['sort']);_0x444cb1[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x4ffb2b[_0x6652('0x32')],_0x894c3[_0x6652('0x34')]),_0x358b55);if(_0x4ffb2b[_0x6652('0x32')][_0x6652('0x3f')]){_0x444cb1[_0x6652('0x3d')]=_['merge'](_0x444cb1[_0x6652('0x3d')],{'$or':_['map'](_0x358b55,function(_0x599a23){if(_0x599a23[_0x6652('0x2f')]!==_0x6652('0x40')){var _0x5c1c4d={};_0x5c1c4d[_0x599a23[_0x6652('0x2a')]]={'$like':'%'+_0x4ffb2b[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x5c1c4d;}})});}_0x444cb1=_['merge']({},_0x444cb1,_0x4ffb2b[_0x6652('0x41')]);var _0xdb942a={'where':_0x444cb1['where']};return db[_0x6652('0x2d')]['count'](_0xdb942a)[_0x6652('0x23')](function(_0x20bab0){_0x2d8e95[_0x6652('0x1e')]=_0x20bab0;if(_0x4ffb2b['query'][_0x6652('0x42')]){_0x444cb1[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x2d')][_0x6652('0x44')](_0x444cb1);})[_0x6652('0x23')](function(_0x1980e5){_0x2d8e95['rows']=_0x1980e5;return _0x2d8e95;})[_0x6652('0x23')](respondWithFilteredResult(_0x583d7a,_0x444cb1))[_0x6652('0x45')](handleError(_0x583d7a,null));};exports[_0x6652('0x46')]=function(_0xb7bcd3,_0x2ab18b){var _0xb3cdca={'raw':![],'where':{'id':_0xb7bcd3[_0x6652('0x47')]['id']}},_0x3c3388={};_0x3c3388[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x2d')][_0x6652('0x48')]);_0x3c3388['query']=_[_0x6652('0x33')](_0xb7bcd3['query']);_0x3c3388[_0x6652('0x34')]=_[_0x6652('0x36')](_0x3c3388['model'],_0x3c3388[_0x6652('0x32')]);_0xb3cdca[_0x6652('0x35')]=_[_0x6652('0x36')](_0x3c3388[_0x6652('0x31')],qs[_0x6652('0x37')](_0xb7bcd3[_0x6652('0x32')][_0x6652('0x37')]));_0xb3cdca[_0x6652('0x35')]=_0xb3cdca[_0x6652('0x35')][_0x6652('0x38')]?_0xb3cdca[_0x6652('0x35')]:_0x3c3388['model'];if(_0xb7bcd3[_0x6652('0x32')][_0x6652('0x42')]){_0xb3cdca[_0x6652('0x43')]=[{'all':!![]}];}_0xb3cdca=_[_0x6652('0x49')]({},_0xb3cdca,_0xb7bcd3[_0x6652('0x41')]);return db[_0x6652('0x2d')][_0x6652('0x4a')](_0xb3cdca)[_0x6652('0x23')](handleEntityNotFound(_0x2ab18b,null))[_0x6652('0x23')](respondWithResult(_0x2ab18b,null))[_0x6652('0x45')](handleError(_0x2ab18b,null));};exports[_0x6652('0x4b')]=function(_0xda945a,_0x4f3b94){return db['Campaign'][_0x6652('0x4b')](_0xda945a[_0x6652('0x4c')],{})['then'](function(_0x6d105a){var _0x4dfb54=_0xda945a[_0x6652('0x4d')][_0x6652('0x25')]({'plain':!![]});if(!_0x4dfb54)throw new Error(_0x6652('0x4e'));if(_0x4dfb54[_0x6652('0x4f')]===_0x6652('0x4d')){var _0x340d03=_0x6d105a['get']({'plain':!![]});var _0x623f6b=_0x6652('0x50');return db[_0x6652('0x51')][_0x6652('0x4a')]({'where':{'name':_0x623f6b,'userProfileId':_0x4dfb54[_0x6652('0x52')]},'raw':!![]})[_0x6652('0x23')](function(_0x33d714){if(_0x33d714&&_0x33d714['autoAssociation']===0x0){return db[_0x6652('0x26')]['create']({'name':_0x340d03[_0x6652('0x2a')],'resourceId':_0x340d03['id'],'type':_0x33d714['name'],'sectionId':_0x33d714['id']},{})[_0x6652('0x23')](function(){return _0x6d105a;});}else{return _0x6d105a;}})[_0x6652('0x45')](function(_0x444163){logger[_0x6652('0x28')](_0x6652('0x53'),_0x444163);throw _0x444163;});}return _0x6d105a;})['then'](respondWithResult(_0x4f3b94,0xc9))['catch'](handleError(_0x4f3b94,null));};exports[_0x6652('0x54')]=function(_0x48cbae,_0x32c82f){var _0x5944e8={'where':{'id':_0x48cbae[_0x6652('0x47')]['id']}},_0x1390d2={};_0x1390d2[_0x6652('0x31')]=_['keys'](db[_0x6652('0x2d')][_0x6652('0x48')]);_0x5944e8[_0x6652('0x35')]=_['intersection'](_0x1390d2['model'],qs[_0x6652('0x37')](_0x48cbae[_0x6652('0x32')][_0x6652('0x37')]));_0x5944e8['attributes']=_0x5944e8[_0x6652('0x35')]['length']?_0x5944e8[_0x6652('0x35')]:_0x1390d2[_0x6652('0x31')];if(_0x48cbae[_0x6652('0x32')][_0x6652('0x42')]){_0x5944e8[_0x6652('0x43')]=[{'all':!![]}];}_0x5944e8=_['merge']({},_0x5944e8,_0x48cbae['options']);return db[_0x6652('0x2d')]['find'](_0x5944e8)[_0x6652('0x23')](handleEntityNotFound(_0x32c82f,null))['then'](function(_0x399919){if(_0x399919){var _0x2b65e9=_0x399919[_0x6652('0x25')]({'plain':!![]});_0x2b65e9=qs[_0x6652('0x55')](_0x2b65e9,['id','createdAt',_0x6652('0x56')]);_0x48cbae[_0x6652('0x4c')]=_[_0x6652('0x55')](_0x48cbae[_0x6652('0x4c')],['id',_0x6652('0x57'),_0x6652('0x56')]);return db[_0x6652('0x2d')][_0x6652('0x4b')](_[_0x6652('0x49')](_0x2b65e9,_0x48cbae[_0x6652('0x4c')]),{'include':_0x48cbae['query'][_0x6652('0x42')]?[{'all':!![]}]:undefined})[_0x6652('0x23')](function(_0x116c95){var _0x46e273=_0x48cbae[_0x6652('0x4d')][_0x6652('0x25')]({'plain':!![]});if(!_0x46e273)throw new Error(_0x6652('0x4e'));if(_0x46e273[_0x6652('0x4f')]===_0x6652('0x4d')){var _0x3ba822=_0x116c95[_0x6652('0x25')]({'plain':!![]});var _0x3b7156=_0x6652('0x50');return db[_0x6652('0x51')]['find']({'where':{'name':_0x3b7156,'userProfileId':_0x46e273[_0x6652('0x52')]},'raw':!![]})[_0x6652('0x23')](function(_0xfe2e2){if(_0xfe2e2&&_0xfe2e2[_0x6652('0x58')]===0x0){return db[_0x6652('0x26')][_0x6652('0x4b')]({'name':_0x3ba822['name'],'resourceId':_0x3ba822['id'],'type':_0xfe2e2[_0x6652('0x2a')],'sectionId':_0xfe2e2['id']},{})['then'](function(){return _0x116c95;});}else{return _0x116c95;}})[_0x6652('0x45')](function(_0x52caab){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52caab);throw _0x52caab;});}return _0x116c95;});}})[_0x6652('0x23')](respondWithResult(_0x32c82f,0xc9))[_0x6652('0x45')](handleError(_0x32c82f,null));};exports['update']=function(_0x70b025,_0x4e4480){if(_0x70b025['body']['id']){delete _0x70b025[_0x6652('0x4c')]['id'];}return db[_0x6652('0x2d')]['find']({'where':{'id':_0x70b025['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x4e4480,null))[_0x6652('0x23')](saveUpdates(_0x70b025[_0x6652('0x4c')],null))[_0x6652('0x23')](respondWithResult(_0x4e4480,null))['catch'](handleError(_0x4e4480,null));};exports[_0x6652('0x24')]=function(_0x441e6c,_0x3f48c8){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x441e6c[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x3f48c8,null))[_0x6652('0x23')](removeEntity(_0x3f48c8,null))[_0x6652('0x45')](handleError(_0x3f48c8,null));};exports[_0x6652('0x59')]=function(_0x506c89,_0x417c89,_0x22e190){var _0x27bdc3={'raw':!![],'where':{}};var _0x2be797={};var _0x486194={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x506c89[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x417c89,null))[_0x6652('0x23')](function(_0x3b3cac){if(_0x3b3cac){_0x2be797['model']=_['keys'](db[_0x6652('0x5b')][_0x6652('0x48')]);_0x2be797[_0x6652('0x32')]=_[_0x6652('0x33')](_0x506c89[_0x6652('0x32')]);_0x2be797[_0x6652('0x34')]=_['intersection'](_0x2be797[_0x6652('0x31')],_0x2be797[_0x6652('0x32')]);_0x27bdc3[_0x6652('0x35')]=_['intersection'](_0x2be797['model'],qs['fields'](_0x506c89[_0x6652('0x32')][_0x6652('0x37')]));_0x27bdc3[_0x6652('0x35')]=_0x27bdc3[_0x6652('0x35')]['length']?_0x27bdc3[_0x6652('0x35')]:_0x2be797[_0x6652('0x31')];if(!_0x506c89['query'][_0x6652('0x39')](_0x6652('0x3a'))){_0x27bdc3[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x506c89['query'][_0x6652('0x1c')]);_0x27bdc3[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x506c89[_0x6652('0x32')]['offset']);}_0x27bdc3[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x506c89[_0x6652('0x32')][_0x6652('0x3c')]);_0x27bdc3[_0x6652('0x3d')]=qs['filters'](_[_0x6652('0x3e')](_0x506c89[_0x6652('0x32')],_0x2be797['filters']));_0x27bdc3['where'][_0x6652('0x5c')]=_0x3b3cac['id'];if(_0x506c89[_0x6652('0x32')][_0x6652('0x3f')]){_0x27bdc3[_0x6652('0x3d')]=_[_0x6652('0x49')](_0x27bdc3[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x27bdc3[_0x6652('0x35')],function(_0x5fd026){var _0x5f0560={};_0x5f0560[_0x5fd026]={'$like':'%'+_0x506c89['query'][_0x6652('0x3f')]+'%'};return _0x5f0560;})});}_0x27bdc3=_['merge']({},_0x27bdc3,_0x506c89['options']);return db[_0x6652('0x5b')][_0x6652('0x1e')]({'where':_0x27bdc3['where']})[_0x6652('0x23')](function(_0x1b3751){_0x486194[_0x6652('0x1e')]=_0x1b3751;if(_0x506c89[_0x6652('0x32')]['includeAll']){_0x27bdc3[_0x6652('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0x6652('0x44')](_0x27bdc3);})[_0x6652('0x23')](function(_0x44b760){_0x486194['rows']=_0x44b760;return _0x486194;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x417c89,_0x27bdc3))['catch'](handleError(_0x417c89,null));};exports['getHopperHistories']=function(_0x541909,_0x512bf7,_0x1802d6){var _0x9ace91={'raw':!![],'where':{}};var _0x542667={};var _0x4253e9={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x541909[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x512bf7,null))[_0x6652('0x23')](function(_0x401124){if(_0x401124){_0x542667['model']=_[_0x6652('0x33')](db['CmHopperHistory'][_0x6652('0x48')]);_0x542667[_0x6652('0x32')]=_[_0x6652('0x33')](_0x541909[_0x6652('0x32')]);_0x542667['filters']=_[_0x6652('0x36')](_0x542667[_0x6652('0x31')],_0x542667[_0x6652('0x32')]);_0x9ace91['attributes']=_[_0x6652('0x36')](_0x542667['model'],qs['fields'](_0x541909['query']['fields']));_0x9ace91[_0x6652('0x35')]=_0x9ace91[_0x6652('0x35')][_0x6652('0x38')]?_0x9ace91['attributes']:_0x542667[_0x6652('0x31')];if(!_0x541909[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x9ace91[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x541909[_0x6652('0x32')][_0x6652('0x1c')]);_0x9ace91[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x541909[_0x6652('0x32')][_0x6652('0x1b')]);}_0x9ace91[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x541909[_0x6652('0x32')][_0x6652('0x3c')]);_0x9ace91[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x541909[_0x6652('0x32')],_0x542667[_0x6652('0x34')]));_0x9ace91[_0x6652('0x3d')][_0x6652('0x5c')]=_0x401124['id'];if(_0x541909[_0x6652('0x32')][_0x6652('0x3f')]){_0x9ace91[_0x6652('0x3d')]=_[_0x6652('0x49')](_0x9ace91[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x9ace91['attributes'],function(_0x45d20b){var _0x17e180={};_0x17e180[_0x45d20b]={'$like':'%'+_0x541909[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x17e180;})});}_0x9ace91=_[_0x6652('0x49')]({},_0x9ace91,_0x541909[_0x6652('0x41')]);return db['CmHopperHistory'][_0x6652('0x1e')]({'where':_0x9ace91[_0x6652('0x3d')]})[_0x6652('0x23')](function(_0x27363c){_0x4253e9[_0x6652('0x1e')]=_0x27363c;if(_0x541909[_0x6652('0x32')][_0x6652('0x42')]){_0x9ace91[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x5d')]['findAll'](_0x9ace91);})['then'](function(_0xe168f4){_0x4253e9[_0x6652('0x5e')]=_0xe168f4;return _0x4253e9;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x512bf7,_0x9ace91))[_0x6652('0x45')](handleError(_0x512bf7,null));};exports[_0x6652('0x5f')]=function(_0x30d2e2,_0x254837,_0x377fb2){var _0x7c638f={'raw':!![],'where':{}};var _0x301133={};var _0x22f870={'count':0x0,'rows':[]};return db[_0x6652('0x2d')]['findOne']({'where':{'id':_0x30d2e2[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x254837,null))[_0x6652('0x23')](function(_0x322adc){if(_0x322adc){_0x301133[_0x6652('0x31')]=_['keys'](db[_0x6652('0x60')][_0x6652('0x48')]);_0x301133[_0x6652('0x32')]=_[_0x6652('0x33')](_0x30d2e2[_0x6652('0x32')]);_0x301133[_0x6652('0x34')]=_[_0x6652('0x36')](_0x301133[_0x6652('0x31')],_0x301133[_0x6652('0x32')]);_0x7c638f[_0x6652('0x35')]=_['intersection'](_0x301133[_0x6652('0x31')],qs['fields'](_0x30d2e2[_0x6652('0x32')][_0x6652('0x37')]));_0x7c638f[_0x6652('0x35')]=_0x7c638f['attributes'][_0x6652('0x38')]?_0x7c638f['attributes']:_0x301133[_0x6652('0x31')];if(!_0x30d2e2[_0x6652('0x32')][_0x6652('0x39')]('nolimit')){_0x7c638f[_0x6652('0x1c')]=qs['limit'](_0x30d2e2[_0x6652('0x32')][_0x6652('0x1c')]);_0x7c638f[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x30d2e2['query']['offset']);}_0x7c638f[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x30d2e2[_0x6652('0x32')][_0x6652('0x3c')]);_0x7c638f[_0x6652('0x3d')]=qs[_0x6652('0x34')](_['pick'](_0x30d2e2[_0x6652('0x32')],_0x301133[_0x6652('0x34')]));_0x7c638f['where']['CampaignId']=_0x322adc['id'];if(_0x30d2e2['query'][_0x6652('0x3f')]){_0x7c638f['where']=_[_0x6652('0x49')](_0x7c638f[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0x7c638f[_0x6652('0x35')],function(_0x1dd439){var _0x15781e={};_0x15781e[_0x1dd439]={'$like':'%'+_0x30d2e2['query'][_0x6652('0x3f')]+'%'};return _0x15781e;})});}_0x7c638f=_[_0x6652('0x49')]({},_0x7c638f,_0x30d2e2['options']);return db[_0x6652('0x60')][_0x6652('0x1e')]({'where':_0x7c638f['where']})[_0x6652('0x23')](function(_0x18b396){_0x22f870['count']=_0x18b396;if(_0x30d2e2[_0x6652('0x32')][_0x6652('0x42')]){_0x7c638f[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x60')][_0x6652('0x44')](_0x7c638f);})['then'](function(_0x16994d){_0x22f870[_0x6652('0x5e')]=_0x16994d;return _0x22f870;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x254837,_0x7c638f))[_0x6652('0x45')](handleError(_0x254837,null));};exports['getHopperBlacks']=function(_0x3d48e5,_0x30c32f,_0x1da683){var _0x3b8225={'raw':!![],'where':{}};var _0x16f648={};var _0x13bc9d={'count':0x0,'rows':[]};return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3d48e5[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x30c32f,null))['then'](function(_0x52caf5){if(_0x52caf5){_0x16f648[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x61')][_0x6652('0x48')]);_0x16f648[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3d48e5[_0x6652('0x32')]);_0x16f648['filters']=_[_0x6652('0x36')](_0x16f648['model'],_0x16f648[_0x6652('0x32')]);_0x3b8225['attributes']=_['intersection'](_0x16f648[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x37')]));_0x3b8225[_0x6652('0x35')]=_0x3b8225[_0x6652('0x35')][_0x6652('0x38')]?_0x3b8225[_0x6652('0x35')]:_0x16f648[_0x6652('0x31')];if(!_0x3d48e5[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x3b8225[_0x6652('0x1c')]=qs[_0x6652('0x1c')](_0x3d48e5['query']['limit']);_0x3b8225[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x1b')]);}_0x3b8225[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x3d48e5[_0x6652('0x32')][_0x6652('0x3c')]);_0x3b8225['where']=qs['filters'](_[_0x6652('0x3e')](_0x3d48e5[_0x6652('0x32')],_0x16f648[_0x6652('0x34')]));_0x3b8225[_0x6652('0x3d')][_0x6652('0x5c')]=_0x52caf5['id'];if(_0x3d48e5[_0x6652('0x32')][_0x6652('0x3f')]){_0x3b8225[_0x6652('0x3d')]=_['merge'](_0x3b8225['where'],{'$or':_[_0x6652('0x2c')](_0x3b8225['attributes'],function(_0x3e2371){var _0x61272b={};_0x61272b[_0x3e2371]={'$like':'%'+_0x3d48e5[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x61272b;})});}_0x3b8225=_[_0x6652('0x49')]({},_0x3b8225,_0x3d48e5[_0x6652('0x41')]);return db[_0x6652('0x61')]['count']({'where':_0x3b8225['where']})['then'](function(_0x430386){_0x13bc9d[_0x6652('0x1e')]=_0x430386;if(_0x3d48e5[_0x6652('0x32')][_0x6652('0x42')]){_0x3b8225[_0x6652('0x43')]=[{'all':!![]}];}return db[_0x6652('0x61')][_0x6652('0x44')](_0x3b8225);})[_0x6652('0x23')](function(_0x5aaace){_0x13bc9d[_0x6652('0x5e')]=_0x5aaace;return _0x13bc9d;});}})[_0x6652('0x23')](respondWithFilteredResult(_0x30c32f,_0x3b8225))[_0x6652('0x45')](handleError(_0x30c32f,null));};exports[_0x6652('0x62')]=function(_0x3f9dc0,_0x4bc4da,_0x314a8b){var _0x4de1fd={};var _0xd82e5d={};var _0x7ed149;var _0x450ffc;return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3f9dc0['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x4bc4da,null))[_0x6652('0x23')](function(_0x5530eb){if(_0x5530eb){_0x7ed149=_0x5530eb;_0xd82e5d[_0x6652('0x31')]=_[_0x6652('0x33')](db[_0x6652('0x63')]['rawAttributes']);_0xd82e5d[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3f9dc0['query']);_0xd82e5d[_0x6652('0x34')]=_[_0x6652('0x36')](_0xd82e5d[_0x6652('0x31')],_0xd82e5d[_0x6652('0x32')]);_0x4de1fd[_0x6652('0x35')]=_[_0x6652('0x36')](_0xd82e5d[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3f9dc0[_0x6652('0x32')][_0x6652('0x37')]));_0x4de1fd[_0x6652('0x35')]=_0x4de1fd[_0x6652('0x35')]['length']?_0x4de1fd[_0x6652('0x35')]:_0xd82e5d[_0x6652('0x31')];_0x4de1fd[_0x6652('0x3b')]=qs[_0x6652('0x3c')](_0x3f9dc0['query']['sort']);_0x4de1fd[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x3f9dc0[_0x6652('0x32')],_0xd82e5d[_0x6652('0x34')]));if(_0x3f9dc0['query']['filter']){_0x4de1fd[_0x6652('0x3d')]=_['merge'](_0x4de1fd['where'],{'$or':_[_0x6652('0x2c')](_0x4de1fd['attributes'],function(_0x12e996){var _0x494e88={};_0x494e88[_0x12e996]={'$like':'%'+_0x3f9dc0[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x494e88;})});}_0x4de1fd=_['merge']({},_0x4de1fd,_0x3f9dc0[_0x6652('0x41')]);return _0x7ed149[_0x6652('0x62')](_0x4de1fd);}})['then'](function(_0x1c95cb){if(_0x1c95cb){_0x450ffc=_0x1c95cb[_0x6652('0x38')];if(!_0x3f9dc0[_0x6652('0x32')][_0x6652('0x39')](_0x6652('0x3a'))){_0x4de1fd[_0x6652('0x1c')]=qs['limit'](_0x3f9dc0[_0x6652('0x32')]['limit']);_0x4de1fd[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3f9dc0[_0x6652('0x32')]['offset']);}return _0x7ed149[_0x6652('0x62')](_0x4de1fd);}})['then'](function(_0x498302){if(_0x498302){return _0x498302?{'count':_0x450ffc,'rows':_0x498302}:null;}})[_0x6652('0x23')](respondWithResult(_0x4bc4da,null))['catch'](handleError(_0x4bc4da,null));};exports[_0x6652('0x64')]=function(_0x4476f9,_0x428576,_0x22e1b2){var _0x5ddb77,_0x52a842;return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x4476f9['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x428576,null))[_0x6652('0x23')](function(_0x1496e8){if(_0x1496e8){_0x52a842=_0x1496e8;return _0x1496e8[_0x6652('0x64')](_0x4476f9[_0x6652('0x4c')][_0x6652('0x65')],_[_0x6652('0x55')](_0x4476f9['body'],[_0x6652('0x65'),'id'])||{});}return null;})[_0x6652('0x66')](function(_0x2e74e3){var _0x330f16;_0x5ddb77=_0x2e74e3||[];var _0x51ab11=[];if(_0x2e74e3){for(var _0x4aaca3=0x0;_0x4aaca3<_0x2e74e3[_0x6652('0x38')];_0x4aaca3+=0x1){var _0x3b47d6=_0x2e74e3[_0x4aaca3]['get']({'plain':!![]});_0x52a842[_0x6652('0x67')]=_0x4476f9['body'][_0x6652('0x67')]?_0x4476f9[_0x6652('0x4c')]['dialCheckDuplicateType']:_0x52a842[_0x6652('0x67')];switch(_0x52a842[_0x6652('0x67')]){case _0x6652('0x68'):_0x330f16=squel['insert']()[_0x6652('0x69')](_0x6652('0x6a'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),'CampaignId',_0x6652('0x57'),_0x6652('0x56')],squel['select']()[_0x6652('0x70')]('phone','phone')[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x6d'))[_0x6652('0x70')]('id',_0x6652('0x6e'))[_0x6652('0x70')](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),_0x6652('0x6f'))[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')](),_0x6652('0x5c'))['field'](_0x6652('0x71'),'createdAt')[_0x6652('0x70')](_0x6652('0x71'),'updatedAt')['from']('cm_contacts')[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')](_0x6652('0x75'),_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')]())['where'](_0x6652('0x76'))[_0x6652('0x3d')](_0x6652('0x77'),squel['select']()[_0x6652('0x70')](_0x6652('0x78'))[_0x6652('0x79')](_0x6652('0x7a'))[_0x6652('0x3d')](_0x6652('0x7b'),_0x4476f9['params']['id'][_0x6652('0x73')]()))[_0x6652('0x3d')](_0x6652('0x77'),squel['select']()[_0x6652('0x70')](_0x6652('0x7c'))[_0x6652('0x79')](_0x6652('0x6a'))['where']('CampaignId\x20=\x20?',_0x4476f9['params']['id']['toString']())))[_0x6652('0x73')]();break;case'onlyIfOpen':_0x330f16=squel[_0x6652('0x7d')]()[_0x6652('0x69')](_0x6652('0x6a'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel['select']()[_0x6652('0x70')](_0x6652('0x6c'),_0x6652('0x6c'))[_0x6652('0x70')]('NOW()',_0x6652('0x6d'))[_0x6652('0x70')]('id',_0x6652('0x6e'))[_0x6652('0x70')](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),'ListId')[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id']['toString'](),_0x6652('0x5c'))['field'](_0x6652('0x71'),_0x6652('0x57'))[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x56'))['from'](_0x6652('0x7e'))[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')]('ListId\x20=\x20?',_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')]())[_0x6652('0x3d')](_0x6652('0x76'))[_0x6652('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x7c'))[_0x6652('0x79')]('cm_hopper')[_0x6652('0x3d')](_0x6652('0x7b'),_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')]())))[_0x6652('0x73')]();break;default:_0x330f16=squel['insert']()[_0x6652('0x69')]('cm_hopper')['fromQuery'](['phone',_0x6652('0x6d'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x6c'),'phone')['field'](_0x6652('0x71'),_0x6652('0x6d'))['field']('id',_0x6652('0x6e'))['field'](_0x3b47d6[_0x6652('0x72')][_0x6652('0x73')](),'ListId')[_0x6652('0x70')](_0x4476f9[_0x6652('0x47')]['id'][_0x6652('0x73')](),_0x6652('0x5c'))[_0x6652('0x70')]('NOW()','createdAt')[_0x6652('0x70')]('NOW()',_0x6652('0x56'))[_0x6652('0x79')]('cm_contacts')[_0x6652('0x3d')](_0x6652('0x74'))[_0x6652('0x3d')](_0x6652('0x75'),_0x3b47d6['CmListId'][_0x6652('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x51ab11[_0x6652('0x80')](db['sequelize'][_0x6652('0x32')](_0x330f16));}return BPromise[_0x6652('0x81')](_0x51ab11);}})[_0x6652('0x23')](function(){return _0x5ddb77;})[_0x6652('0x23')](respondWithResult(_0x428576,null))[_0x6652('0x45')](handleError(_0x428576,null));};exports[_0x6652('0x82')]=function(_0xb1d39e,_0x49368c,_0x4d8267){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0xb1d39e['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x49368c,null))['then'](function(_0xaff0c){if(_0xaff0c){return _0xaff0c[_0x6652('0x82')](_0xb1d39e[_0x6652('0x32')][_0x6652('0x65')]);}})['then'](function(_0x49990d){if(_0x49990d){return db['CmHopper'][_0x6652('0x24')]({'where':{'ListId':_0xb1d39e[_0x6652('0x32')][_0x6652('0x65')],'CampaignId':_0xb1d39e[_0x6652('0x47')]['id']}})[_0x6652('0x23')](function(){return _0x49990d;});}})[_0x6652('0x23')](respondWithStatusCode(_0x49368c,null))[_0x6652('0x45')](handleError(_0x49368c,null));};exports[_0x6652('0x83')]=function(_0x3f0a9c,_0x52fdb5,_0x3f9128){var _0xd4db6e={};var _0x39cbc5={};var _0x51832d;var _0xe17d31;return db[_0x6652('0x2d')][_0x6652('0x5a')]({'where':{'id':_0x3f0a9c[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x52fdb5,null))[_0x6652('0x23')](function(_0x24707a){if(_0x24707a){_0x51832d=_0x24707a;_0x39cbc5[_0x6652('0x31')]=_['keys'](db[_0x6652('0x63')][_0x6652('0x48')]);_0x39cbc5[_0x6652('0x32')]=_[_0x6652('0x33')](_0x3f0a9c[_0x6652('0x32')]);_0x39cbc5[_0x6652('0x34')]=_[_0x6652('0x36')](_0x39cbc5['model'],_0x39cbc5[_0x6652('0x32')]);_0xd4db6e[_0x6652('0x35')]=_[_0x6652('0x36')](_0x39cbc5[_0x6652('0x31')],qs[_0x6652('0x37')](_0x3f0a9c[_0x6652('0x32')][_0x6652('0x37')]));_0xd4db6e['attributes']=_0xd4db6e[_0x6652('0x35')][_0x6652('0x38')]?_0xd4db6e[_0x6652('0x35')]:_0x39cbc5['model'];_0xd4db6e[_0x6652('0x3b')]=qs['sort'](_0x3f0a9c['query'][_0x6652('0x3c')]);_0xd4db6e[_0x6652('0x3d')]=qs[_0x6652('0x34')](_[_0x6652('0x3e')](_0x3f0a9c[_0x6652('0x32')],_0x39cbc5[_0x6652('0x34')]));if(_0x3f0a9c[_0x6652('0x32')]['filter']){_0xd4db6e[_0x6652('0x3d')]=_[_0x6652('0x49')](_0xd4db6e[_0x6652('0x3d')],{'$or':_[_0x6652('0x2c')](_0xd4db6e[_0x6652('0x35')],function(_0x566793){var _0x1012af={};_0x1012af[_0x566793]={'$like':'%'+_0x3f0a9c[_0x6652('0x32')][_0x6652('0x3f')]+'%'};return _0x1012af;})});}_0xd4db6e=_[_0x6652('0x49')]({},_0xd4db6e,_0x3f0a9c[_0x6652('0x41')]);return _0x51832d[_0x6652('0x83')](_0xd4db6e);}})[_0x6652('0x23')](function(_0x5d844e){if(_0x5d844e){_0xe17d31=_0x5d844e[_0x6652('0x38')];if(!_0x3f0a9c[_0x6652('0x32')][_0x6652('0x39')]('nolimit')){_0xd4db6e[_0x6652('0x1c')]=qs['limit'](_0x3f0a9c['query'][_0x6652('0x1c')]);_0xd4db6e[_0x6652('0x1b')]=qs[_0x6652('0x1b')](_0x3f0a9c[_0x6652('0x32')][_0x6652('0x1b')]);}return _0x51832d[_0x6652('0x83')](_0xd4db6e);}})['then'](function(_0x57d355){if(_0x57d355){return _0x57d355?{'count':_0xe17d31,'rows':_0x57d355}:null;}})[_0x6652('0x23')](respondWithResult(_0x52fdb5,null))['catch'](handleError(_0x52fdb5,null));};exports[_0x6652('0x84')]=function(_0x202586,_0x167ba3,_0x37215b){var _0x238a21,_0xbfbfdd;return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x202586['params']['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x167ba3,null))[_0x6652('0x23')](function(_0x4767b7){if(_0x4767b7){_0xbfbfdd=_0x4767b7;return _0x4767b7['addBlackLists'](_0x202586['body'][_0x6652('0x65')],_[_0x6652('0x55')](_0x202586[_0x6652('0x4c')],[_0x6652('0x65'),'id'])||{});}return null;})['spread'](function(_0x37f18e){var _0x48ac53;_0x238a21=_0x37f18e||[];var _0x40dc76=[];if(_0x37f18e){for(var _0x418402=0x0;_0x418402<_0x37f18e[_0x6652('0x38')];_0x418402+=0x1){var _0x4dec79=_0x37f18e[_0x418402][_0x6652('0x25')]({'plain':!![]});_0x48ac53=squel['insert']()['into'](_0x6652('0x85'))[_0x6652('0x6b')]([_0x6652('0x6c'),_0x6652('0x6e'),_0x6652('0x6f'),_0x6652('0x5c'),_0x6652('0x57'),_0x6652('0x56')],squel[_0x6652('0x7f')]()[_0x6652('0x70')](_0x6652('0x6c'),'phone')[_0x6652('0x70')]('id',_0x6652('0x6e'))['field'](_0x4dec79[_0x6652('0x72')][_0x6652('0x73')](),_0x6652('0x6f'))[_0x6652('0x70')](_0x202586[_0x6652('0x47')]['id']['toString'](),_0x6652('0x5c'))[_0x6652('0x70')](_0x6652('0x71'),_0x6652('0x57'))['field'](_0x6652('0x71'),_0x6652('0x56'))[_0x6652('0x79')](_0x6652('0x7e'))['where']('deletedAt\x20IS\x20NULL')[_0x6652('0x3d')]('ListId\x20=\x20?',_0x4dec79[_0x6652('0x72')]['toString']())[_0x6652('0x3d')](_0x6652('0x76')))[_0x6652('0x73')]();_0x40dc76['push'](db['sequelize'][_0x6652('0x32')](_0x48ac53));}return BPromise['all'](_0x40dc76);}})[_0x6652('0x23')](function(){return _0x238a21;})[_0x6652('0x23')](respondWithResult(_0x167ba3,null))[_0x6652('0x45')](handleError(_0x167ba3,null));};exports[_0x6652('0x86')]=function(_0x255ad3,_0x1e07b5,_0xace7f6){return db[_0x6652('0x2d')][_0x6652('0x4a')]({'where':{'id':_0x255ad3[_0x6652('0x47')]['id']}})[_0x6652('0x23')](handleEntityNotFound(_0x1e07b5,null))['then'](function(_0x27f859){if(_0x27f859){return _0x27f859[_0x6652('0x86')](_0x255ad3[_0x6652('0x32')]['ids']);}})['then'](function(_0x28b2ae){if(_0x28b2ae){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x255ad3['query'][_0x6652('0x65')],'CampaignId':_0x255ad3[_0x6652('0x47')]['id']}})[_0x6652('0x23')](function(){return _0x28b2ae;});}})['then'](respondWithStatusCode(_0x1e07b5,null))[_0x6652('0x45')](handleError(_0x1e07b5,null));};
\ No newline at end of file
+var _0x87e4=['CampaignId\x20=\x20?','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','Campaign','include','findAll','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','user','IvrCampaigns','userProfileId','getHoppers','findOne','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)'];(function(_0x55d089,_0x52aa76){var _0x1406de=function(_0x4d68ca){while(--_0x4d68ca){_0x55d089['push'](_0x55d089['shift']());}};_0x1406de(++_0x52aa76);}(_0x87e4,0x8e));var _0x487e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x87e4[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x487e('0x0'));var rimraf=require(_0x487e('0x1'));var zipdir=require(_0x487e('0x2'));var jsonpatch=require(_0x487e('0x3'));var rp=require(_0x487e('0x4'));var moment=require(_0x487e('0x5'));var BPromise=require(_0x487e('0x6'));var Mustache=require(_0x487e('0x7'));var util=require(_0x487e('0x8'));var path=require(_0x487e('0x9'));var sox=require(_0x487e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x487e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x487e('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x487e('0xd'));var qs=require(_0x487e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x487e('0xf'))(_0x487e('0x10'));var utils=require(_0x487e('0x11'));var config=require(_0x487e('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ffba,_0x2ee4d5){_0x2ee4d5=_0x2ee4d5||0xcc;return function(_0x286794){if(_0x286794){return _0x20ffba['sendStatus'](_0x2ee4d5);}return _0x20ffba[_0x487e('0x13')](_0x2ee4d5)[_0x487e('0x14')]();};}function respondWithResult(_0x95af3d,_0x1c5fc4){_0x1c5fc4=_0x1c5fc4||0xc8;return function(_0x2a5a43){if(_0x2a5a43){return _0x95af3d[_0x487e('0x13')](_0x1c5fc4)[_0x487e('0x15')](_0x2a5a43);}};}function respondWithFilteredResult(_0x6dcae,_0x574d4e){return function(_0xa0611a){if(_0xa0611a){var _0x2a9e33=typeof _0x574d4e[_0x487e('0x16')]===_0x487e('0x17')&&typeof _0x574d4e[_0x487e('0x18')]==='undefined';var _0x493b28=_0xa0611a[_0x487e('0x19')];var _0x1daa1a=_0x2a9e33?0x0:_0x574d4e[_0x487e('0x16')];var _0xc5a457=_0x2a9e33?_0xa0611a[_0x487e('0x19')]:_0x574d4e[_0x487e('0x16')]+_0x574d4e['limit'];var _0x1dc264;if(_0xc5a457>=_0x493b28){_0xc5a457=_0x493b28;_0x1dc264=0xc8;}else{_0x1dc264=0xce;}_0x6dcae[_0x487e('0x13')](_0x1dc264);return _0x6dcae['set'](_0x487e('0x1a'),_0x1daa1a+'-'+_0xc5a457+'/'+_0x493b28)[_0x487e('0x15')](_0xa0611a);}return null;};}function patchUpdates(_0x30bc7d){return function(_0xe34c5c){try{jsonpatch['apply'](_0xe34c5c,_0x30bc7d,!![]);}catch(_0x284e01){return BPromise[_0x487e('0x1b')](_0x284e01);}return _0xe34c5c['save']();};}function saveUpdates(_0x3f5ae5,_0x223b32){return function(_0xa67cdc){if(_0xa67cdc){return _0xa67cdc[_0x487e('0x1c')](_0x3f5ae5)[_0x487e('0x1d')](function(_0x1e1410){return _0x1e1410;});}return null;};}function removeEntity(_0x558471,_0x2cd4ba){return function(_0x29f2ff){if(_0x29f2ff){return _0x29f2ff[_0x487e('0x1e')]()[_0x487e('0x1d')](function(){var _0x3afd18=_0x29f2ff['get']({'plain':!![]});var _0x20dc6c='IvrCampaigns';return db['UserProfileResource'][_0x487e('0x1e')]({'where':{'type':_0x20dc6c,'resourceId':_0x3afd18['id']}})[_0x487e('0x1d')](function(){return _0x29f2ff;});})[_0x487e('0x1d')](function(){_0x558471[_0x487e('0x13')](0xcc)[_0x487e('0x14')]();});}};}function handleEntityNotFound(_0xfa5a26,_0x7913a1){return function(_0x38d513){if(!_0x38d513){_0xfa5a26['sendStatus'](0x194);}return _0x38d513;};}function handleError(_0x2af344,_0x284822){_0x284822=_0x284822||0x1f4;return function(_0x756839){logger[_0x487e('0x1f')](_0x756839[_0x487e('0x20')]);if(_0x756839[_0x487e('0x21')]){delete _0x756839[_0x487e('0x21')];}_0x2af344['status'](_0x284822)['send'](_0x756839);};}exports[_0x487e('0x22')]=function(_0x4c31e2,_0x1d7807){var _0x5b9ba0={},_0x3ea044={},_0x165ae3={'count':0x0,'rows':[]};var _0x27253c=_[_0x487e('0x23')](db['Campaign'][_0x487e('0x24')],function(_0x572514){return{'name':_0x572514[_0x487e('0x25')],'type':_0x572514['type'][_0x487e('0x26')]};});_0x3ea044['model']=_[_0x487e('0x23')](_0x27253c,'name');_0x3ea044['query']=_[_0x487e('0x27')](_0x4c31e2[_0x487e('0x28')]);_0x3ea044[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],_0x3ea044[_0x487e('0x28')]);_0x5b9ba0[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x4c31e2['query'][_0x487e('0x2d')]));_0x5b9ba0[_0x487e('0x2c')]=_0x5b9ba0[_0x487e('0x2c')][_0x487e('0x2e')]?_0x5b9ba0[_0x487e('0x2c')]:_0x3ea044[_0x487e('0x2b')];if(!_0x4c31e2[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x5b9ba0[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4c31e2[_0x487e('0x28')][_0x487e('0x18')]);_0x5b9ba0[_0x487e('0x16')]=qs['offset'](_0x4c31e2[_0x487e('0x28')]['offset']);}_0x5b9ba0['order']=qs[_0x487e('0x31')](_0x4c31e2[_0x487e('0x28')]['sort']);_0x5b9ba0[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4c31e2['query'],_0x3ea044['filters']),_0x27253c);if(_0x4c31e2[_0x487e('0x28')]['filter']){_0x5b9ba0[_0x487e('0x32')]=_[_0x487e('0x34')](_0x5b9ba0[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x27253c,function(_0x51b138){if(_0x51b138[_0x487e('0x35')]!==_0x487e('0x36')){var _0x4cb9a6={};_0x4cb9a6[_0x51b138['name']]={'$like':'%'+_0x4c31e2['query']['filter']+'%'};return _0x4cb9a6;}})});}_0x5b9ba0=_[_0x487e('0x34')]({},_0x5b9ba0,_0x4c31e2[_0x487e('0x37')]);var _0x1b4a78={'where':_0x5b9ba0[_0x487e('0x32')]};return db[_0x487e('0x38')]['count'](_0x1b4a78)[_0x487e('0x1d')](function(_0x34c842){_0x165ae3[_0x487e('0x19')]=_0x34c842;if(_0x4c31e2[_0x487e('0x28')]['includeAll']){_0x5b9ba0[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x38')][_0x487e('0x3a')](_0x5b9ba0);})['then'](function(_0x1d92f4){_0x165ae3[_0x487e('0x3b')]=_0x1d92f4;return _0x165ae3;})[_0x487e('0x1d')](respondWithFilteredResult(_0x1d7807,_0x5b9ba0))['catch'](handleError(_0x1d7807,null));};exports[_0x487e('0x3c')]=function(_0x1ec6b0,_0x55cfd6){var _0x35f1cd={'raw':![],'where':{'id':_0x1ec6b0[_0x487e('0x3d')]['id']}},_0x216709={};_0x216709['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x216709['query']=_[_0x487e('0x27')](_0x1ec6b0['query']);_0x216709[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],_0x216709[_0x487e('0x28')]);_0x35f1cd[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x1ec6b0[_0x487e('0x28')][_0x487e('0x2d')]));_0x35f1cd[_0x487e('0x2c')]=_0x35f1cd[_0x487e('0x2c')][_0x487e('0x2e')]?_0x35f1cd['attributes']:_0x216709[_0x487e('0x2b')];if(_0x1ec6b0[_0x487e('0x28')][_0x487e('0x3e')]){_0x35f1cd[_0x487e('0x39')]=[{'all':!![]}];}_0x35f1cd=_[_0x487e('0x34')]({},_0x35f1cd,_0x1ec6b0['options']);return db[_0x487e('0x38')][_0x487e('0x3f')](_0x35f1cd)[_0x487e('0x1d')](handleEntityNotFound(_0x55cfd6,null))[_0x487e('0x1d')](respondWithResult(_0x55cfd6,null))[_0x487e('0x40')](handleError(_0x55cfd6,null));};exports[_0x487e('0x41')]=function(_0x4482ee,_0x25fab7){return db[_0x487e('0x38')][_0x487e('0x41')](_0x4482ee['body'],{})['then'](function(_0x12fe88){var _0x1cd66d=_0x4482ee['user'][_0x487e('0x42')]({'plain':!![]});if(!_0x1cd66d)throw new Error(_0x487e('0x43'));if(_0x1cd66d[_0x487e('0x44')]==='user'){var _0x3791d9=_0x12fe88['get']({'plain':!![]});var _0x23c54c='IvrCampaigns';return db[_0x487e('0x45')][_0x487e('0x3f')]({'where':{'name':_0x23c54c,'userProfileId':_0x1cd66d['userProfileId']},'raw':!![]})[_0x487e('0x1d')](function(_0x543a2e){if(_0x543a2e&&_0x543a2e[_0x487e('0x46')]===0x0){return db[_0x487e('0x47')][_0x487e('0x41')]({'name':_0x3791d9[_0x487e('0x21')],'resourceId':_0x3791d9['id'],'type':_0x543a2e[_0x487e('0x21')],'sectionId':_0x543a2e['id']},{})['then'](function(){return _0x12fe88;});}else{return _0x12fe88;}})[_0x487e('0x40')](function(_0x1e4c23){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x1e4c23);throw _0x1e4c23;});}return _0x12fe88;})['then'](respondWithResult(_0x25fab7,0xc9))[_0x487e('0x40')](handleError(_0x25fab7,null));};exports[_0x487e('0x49')]=function(_0x6334b4,_0x121e3c){var _0x512af7={'where':{'id':_0x6334b4[_0x487e('0x3d')]['id']}},_0x2da6de={};_0x2da6de['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x512af7[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x2da6de['model'],qs[_0x487e('0x2d')](_0x6334b4[_0x487e('0x28')]['fields']));_0x512af7[_0x487e('0x2c')]=_0x512af7[_0x487e('0x2c')]['length']?_0x512af7[_0x487e('0x2c')]:_0x2da6de['model'];if(_0x6334b4[_0x487e('0x28')]['includeAll']){_0x512af7[_0x487e('0x39')]=[{'all':!![]}];}_0x512af7=_['merge']({},_0x512af7,_0x6334b4[_0x487e('0x37')]);return db['Campaign']['find'](_0x512af7)[_0x487e('0x1d')](handleEntityNotFound(_0x121e3c,null))[_0x487e('0x1d')](function(_0x58c2a3){if(_0x58c2a3){var _0x4b6c32=_0x58c2a3['get']({'plain':!![]});_0x4b6c32=qs['omit'](_0x4b6c32,['id','createdAt',_0x487e('0x4a')]);_0x6334b4[_0x487e('0x4b')]=_[_0x487e('0x4c')](_0x6334b4[_0x487e('0x4b')],['id',_0x487e('0x4d'),'updatedAt']);return db[_0x487e('0x38')][_0x487e('0x41')](_[_0x487e('0x34')](_0x4b6c32,_0x6334b4[_0x487e('0x4b')]),{'include':_0x6334b4[_0x487e('0x28')]['includeAll']?[{'all':!![]}]:undefined})[_0x487e('0x1d')](function(_0x1c9de2){var _0xceac80=_0x6334b4['user']['get']({'plain':!![]});if(!_0xceac80)throw new Error(_0x487e('0x43'));if(_0xceac80[_0x487e('0x44')]===_0x487e('0x4e')){var _0x204fa9=_0x1c9de2[_0x487e('0x42')]({'plain':!![]});var _0xc5202f=_0x487e('0x4f');return db[_0x487e('0x45')]['find']({'where':{'name':_0xc5202f,'userProfileId':_0xceac80[_0x487e('0x50')]},'raw':!![]})[_0x487e('0x1d')](function(_0x140d7b){if(_0x140d7b&&_0x140d7b[_0x487e('0x46')]===0x0){return db['UserProfileResource'][_0x487e('0x41')]({'name':_0x204fa9[_0x487e('0x21')],'resourceId':_0x204fa9['id'],'type':_0x140d7b[_0x487e('0x21')],'sectionId':_0x140d7b['id']},{})[_0x487e('0x1d')](function(){return _0x1c9de2;});}else{return _0x1c9de2;}})[_0x487e('0x40')](function(_0x18d24b){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x18d24b);throw _0x18d24b;});}return _0x1c9de2;});}})[_0x487e('0x1d')](respondWithResult(_0x121e3c,0xc9))['catch'](handleError(_0x121e3c,null));};exports[_0x487e('0x1c')]=function(_0x486a10,_0x431370){if(_0x486a10['body']['id']){delete _0x486a10[_0x487e('0x4b')]['id'];}return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x486a10[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x431370,null))[_0x487e('0x1d')](saveUpdates(_0x486a10[_0x487e('0x4b')],null))[_0x487e('0x1d')](respondWithResult(_0x431370,null))[_0x487e('0x40')](handleError(_0x431370,null));};exports['destroy']=function(_0x3f30de,_0x211d2e){return db['Campaign'][_0x487e('0x3f')]({'where':{'id':_0x3f30de[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x211d2e,null))[_0x487e('0x1d')](removeEntity(_0x211d2e,null))[_0x487e('0x40')](handleError(_0x211d2e,null));};exports[_0x487e('0x51')]=function(_0x4cb3f6,_0x1ab190,_0x18898f){var _0x57ecb5={'raw':!![],'where':{}};var _0x1d672b={};var _0x14e0d7={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x4cb3f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x1ab190,null))['then'](function(_0x26ae67){if(_0x26ae67){_0x1d672b[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmHopper'][_0x487e('0x24')]);_0x1d672b[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4cb3f6[_0x487e('0x28')]);_0x1d672b['filters']=_[_0x487e('0x2a')](_0x1d672b[_0x487e('0x2b')],_0x1d672b[_0x487e('0x28')]);_0x57ecb5[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x1d672b['model'],qs['fields'](_0x4cb3f6[_0x487e('0x28')]['fields']));_0x57ecb5[_0x487e('0x2c')]=_0x57ecb5['attributes'][_0x487e('0x2e')]?_0x57ecb5[_0x487e('0x2c')]:_0x1d672b[_0x487e('0x2b')];if(!_0x4cb3f6[_0x487e('0x28')][_0x487e('0x2f')]('nolimit')){_0x57ecb5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x18')]);_0x57ecb5[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x16')]);}_0x57ecb5['order']=qs[_0x487e('0x31')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x31')]);_0x57ecb5[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4cb3f6['query'],_0x1d672b[_0x487e('0x29')]));_0x57ecb5[_0x487e('0x32')][_0x487e('0x53')]=_0x26ae67['id'];if(_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]){_0x57ecb5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x57ecb5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x57ecb5['attributes'],function(_0x18d66b){var _0x546671={};_0x546671[_0x18d66b]={'$like':'%'+_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x546671;})});}_0x57ecb5=_[_0x487e('0x34')]({},_0x57ecb5,_0x4cb3f6['options']);return db[_0x487e('0x55')][_0x487e('0x19')]({'where':_0x57ecb5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x5a70fc){_0x14e0d7[_0x487e('0x19')]=_0x5a70fc;if(_0x4cb3f6['query'][_0x487e('0x3e')]){_0x57ecb5['include']=[{'all':!![]}];}return db[_0x487e('0x55')]['findAll'](_0x57ecb5);})[_0x487e('0x1d')](function(_0x19b4a8){_0x14e0d7[_0x487e('0x3b')]=_0x19b4a8;return _0x14e0d7;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x1ab190,_0x57ecb5))[_0x487e('0x40')](handleError(_0x1ab190,null));};exports[_0x487e('0x56')]=function(_0x4c3d0a,_0x592caf,_0x90a262){var _0x227b83={'raw':!![],'where':{}};var _0x3a9b4e={};var _0x10d8d3={'count':0x0,'rows':[]};return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x4c3d0a[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x592caf,null))[_0x487e('0x1d')](function(_0xa73d47){if(_0xa73d47){_0x3a9b4e[_0x487e('0x2b')]=_['keys'](db['CmHopperHistory'][_0x487e('0x24')]);_0x3a9b4e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4c3d0a[_0x487e('0x28')]);_0x3a9b4e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],_0x3a9b4e[_0x487e('0x28')]);_0x227b83[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],qs[_0x487e('0x2d')](_0x4c3d0a['query'][_0x487e('0x2d')]));_0x227b83[_0x487e('0x2c')]=_0x227b83[_0x487e('0x2c')][_0x487e('0x2e')]?_0x227b83[_0x487e('0x2c')]:_0x3a9b4e['model'];if(!_0x4c3d0a[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x227b83['limit']=qs[_0x487e('0x18')](_0x4c3d0a['query'][_0x487e('0x18')]);_0x227b83[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4c3d0a['query'][_0x487e('0x16')]);}_0x227b83['order']=qs[_0x487e('0x31')](_0x4c3d0a[_0x487e('0x28')][_0x487e('0x31')]);_0x227b83[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x4c3d0a['query'],_0x3a9b4e[_0x487e('0x29')]));_0x227b83['where'][_0x487e('0x53')]=_0xa73d47['id'];if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]){_0x227b83['where']=_[_0x487e('0x34')](_0x227b83['where'],{'$or':_[_0x487e('0x23')](_0x227b83[_0x487e('0x2c')],function(_0xa6e4df){var _0x18ca4e={};_0x18ca4e[_0xa6e4df]={'$like':'%'+_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x18ca4e;})});}_0x227b83=_[_0x487e('0x34')]({},_0x227b83,_0x4c3d0a[_0x487e('0x37')]);return db[_0x487e('0x57')]['count']({'where':_0x227b83[_0x487e('0x32')]})['then'](function(_0x2a28ea){_0x10d8d3[_0x487e('0x19')]=_0x2a28ea;if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x3e')]){_0x227b83['include']=[{'all':!![]}];}return db[_0x487e('0x57')]['findAll'](_0x227b83);})[_0x487e('0x1d')](function(_0x1ead74){_0x10d8d3[_0x487e('0x3b')]=_0x1ead74;return _0x10d8d3;});}})['then'](respondWithFilteredResult(_0x592caf,_0x227b83))[_0x487e('0x40')](handleError(_0x592caf,null));};exports['getHopperFinals']=function(_0x3895fe,_0xf74805,_0x55e384){var _0x46e123={'raw':!![],'where':{}};var _0xc7c207={};var _0x18887e={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x3895fe[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xf74805,null))[_0x487e('0x1d')](function(_0x4c95d6){if(_0x4c95d6){_0xc7c207[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x58')]['rawAttributes']);_0xc7c207['query']=_[_0x487e('0x27')](_0x3895fe[_0x487e('0x28')]);_0xc7c207[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xc7c207['model'],_0xc7c207['query']);_0x46e123['attributes']=_[_0x487e('0x2a')](_0xc7c207[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x3895fe[_0x487e('0x28')][_0x487e('0x2d')]));_0x46e123[_0x487e('0x2c')]=_0x46e123[_0x487e('0x2c')]['length']?_0x46e123[_0x487e('0x2c')]:_0xc7c207['model'];if(!_0x3895fe[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x46e123[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x3895fe[_0x487e('0x28')][_0x487e('0x18')]);_0x46e123[_0x487e('0x16')]=qs['offset'](_0x3895fe['query'][_0x487e('0x16')]);}_0x46e123[_0x487e('0x59')]=qs['sort'](_0x3895fe[_0x487e('0x28')][_0x487e('0x31')]);_0x46e123['where']=qs['filters'](_[_0x487e('0x33')](_0x3895fe[_0x487e('0x28')],_0xc7c207[_0x487e('0x29')]));_0x46e123['where'][_0x487e('0x53')]=_0x4c95d6['id'];if(_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]){_0x46e123[_0x487e('0x32')]=_[_0x487e('0x34')](_0x46e123['where'],{'$or':_[_0x487e('0x23')](_0x46e123['attributes'],function(_0x202b4b){var _0x337c09={};_0x337c09[_0x202b4b]={'$like':'%'+_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x337c09;})});}_0x46e123=_[_0x487e('0x34')]({},_0x46e123,_0x3895fe[_0x487e('0x37')]);return db[_0x487e('0x58')]['count']({'where':_0x46e123[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x583d4a){_0x18887e[_0x487e('0x19')]=_0x583d4a;if(_0x3895fe[_0x487e('0x28')][_0x487e('0x3e')]){_0x46e123[_0x487e('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x487e('0x3a')](_0x46e123);})[_0x487e('0x1d')](function(_0x54abdd){_0x18887e[_0x487e('0x3b')]=_0x54abdd;return _0x18887e;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0xf74805,_0x46e123))['catch'](handleError(_0xf74805,null));};exports[_0x487e('0x5a')]=function(_0x18bf9e,_0x446d6d,_0x4ec48d){var _0x3392f5={'raw':!![],'where':{}};var _0x5d57da={};var _0x44c231={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x18bf9e[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x446d6d,null))['then'](function(_0x34990a){if(_0x34990a){_0x5d57da[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5b')][_0x487e('0x24')]);_0x5d57da[_0x487e('0x28')]=_[_0x487e('0x27')](_0x18bf9e['query']);_0x5d57da['filters']=_['intersection'](_0x5d57da[_0x487e('0x2b')],_0x5d57da[_0x487e('0x28')]);_0x3392f5[_0x487e('0x2c')]=_['intersection'](_0x5d57da[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x18bf9e['query'][_0x487e('0x2d')]));_0x3392f5[_0x487e('0x2c')]=_0x3392f5[_0x487e('0x2c')][_0x487e('0x2e')]?_0x3392f5[_0x487e('0x2c')]:_0x5d57da[_0x487e('0x2b')];if(!_0x18bf9e['query']['hasOwnProperty']('nolimit')){_0x3392f5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x18bf9e[_0x487e('0x28')]['limit']);_0x3392f5['offset']=qs[_0x487e('0x16')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x16')]);}_0x3392f5[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x31')]);_0x3392f5[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x18bf9e[_0x487e('0x28')],_0x5d57da[_0x487e('0x29')]));_0x3392f5[_0x487e('0x32')]['CampaignId']=_0x34990a['id'];if(_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]){_0x3392f5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x3392f5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x3392f5[_0x487e('0x2c')],function(_0x38b707){var _0x47b7c8={};_0x47b7c8[_0x38b707]={'$like':'%'+_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x47b7c8;})});}_0x3392f5=_[_0x487e('0x34')]({},_0x3392f5,_0x18bf9e[_0x487e('0x37')]);return db[_0x487e('0x5b')][_0x487e('0x19')]({'where':_0x3392f5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x3679d5){_0x44c231['count']=_0x3679d5;if(_0x18bf9e['query'][_0x487e('0x3e')]){_0x3392f5[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x5b')][_0x487e('0x3a')](_0x3392f5);})['then'](function(_0x355dc1){_0x44c231[_0x487e('0x3b')]=_0x355dc1;return _0x44c231;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x446d6d,_0x3392f5))[_0x487e('0x40')](handleError(_0x446d6d,null));};exports['getLists']=function(_0x2f2acc,_0xc987cc,_0x267cb8){var _0x13a0a1={};var _0xdf251e={};var _0x37cd63;var _0x2fddbf;return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x2f2acc[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xc987cc,null))[_0x487e('0x1d')](function(_0x5564e8){if(_0x5564e8){_0x37cd63=_0x5564e8;_0xdf251e[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5c')][_0x487e('0x24')]);_0xdf251e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x2f2acc[_0x487e('0x28')]);_0xdf251e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xdf251e[_0x487e('0x2b')],_0xdf251e[_0x487e('0x28')]);_0x13a0a1[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0xdf251e['model'],qs[_0x487e('0x2d')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x2d')]));_0x13a0a1[_0x487e('0x2c')]=_0x13a0a1[_0x487e('0x2c')][_0x487e('0x2e')]?_0x13a0a1[_0x487e('0x2c')]:_0xdf251e['model'];_0x13a0a1[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x31')]);_0x13a0a1[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x2f2acc['query'],_0xdf251e['filters']));if(_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]){_0x13a0a1[_0x487e('0x32')]=_['merge'](_0x13a0a1[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x13a0a1[_0x487e('0x2c')],function(_0x49b9b2){var _0x352a85={};_0x352a85[_0x49b9b2]={'$like':'%'+_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x352a85;})});}_0x13a0a1=_['merge']({},_0x13a0a1,_0x2f2acc[_0x487e('0x37')]);return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x39ea4f){if(_0x39ea4f){_0x2fddbf=_0x39ea4f[_0x487e('0x2e')];if(!_0x2f2acc[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x13a0a1[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x18')]);_0x13a0a1[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x2f2acc[_0x487e('0x28')]['offset']);}return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x7edc37){if(_0x7edc37){return _0x7edc37?{'count':_0x2fddbf,'rows':_0x7edc37}:null;}})[_0x487e('0x1d')](respondWithResult(_0xc987cc,null))[_0x487e('0x40')](handleError(_0xc987cc,null));};exports[_0x487e('0x5e')]=function(_0x5324ad,_0x2299ac,_0x9a14b5){var _0x595db6,_0x462c1f;return db[_0x487e('0x38')]['find']({'where':{'id':_0x5324ad[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x2299ac,null))[_0x487e('0x1d')](function(_0xdcbc84){if(_0xdcbc84){_0x462c1f=_0xdcbc84;return _0xdcbc84['addLists'](_0x5324ad[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0x5324ad[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})['spread'](function(_0x38d8a7){var _0x2b1561;_0x595db6=_0x38d8a7||[];var _0x5b0625=[];if(_0x38d8a7){for(var _0x2de04d=0x0;_0x2de04d<_0x38d8a7[_0x487e('0x2e')];_0x2de04d+=0x1){var _0x124204=_0x38d8a7[_0x2de04d][_0x487e('0x42')]({'plain':!![]});_0x462c1f['dialCheckDuplicateType']=_0x5324ad['body'][_0x487e('0x60')]?_0x5324ad[_0x487e('0x4b')][_0x487e('0x60')]:_0x462c1f[_0x487e('0x60')];switch(_0x462c1f[_0x487e('0x60')]){case _0x487e('0x61'):_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x67'))[_0x487e('0x6b')]('id',_0x487e('0x68'))['field'](_0x124204['CmListId']['toString'](),_0x487e('0x69'))[_0x487e('0x6b')](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),'createdAt')['field'](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')]('deletedAt\x20IS\x20NULL')[_0x487e('0x32')]('ListId\x20=\x20?',_0x124204['CmListId'][_0x487e('0x6d')]())[_0x487e('0x32')](_0x487e('0x70'))[_0x487e('0x32')](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x487e('0x6e')](_0x487e('0x72'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]()))[_0x487e('0x32')](_0x487e('0x71'),squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x73'))['from']('cm_hopper')[_0x487e('0x32')](_0x487e('0x74'),_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]())))[_0x487e('0x6d')]();break;case'onlyIfOpen':_0x2b1561=squel[_0x487e('0x62')]()['into'](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),'ContactId',_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))['field'](_0x487e('0x6c'),'scheduledAt')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),'ListId')['field'](_0x5324ad['params']['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')]('NOW()',_0x487e('0x4d'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204['CmListId']['toString']())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')](_0x487e('0x73'))[_0x487e('0x6e')](_0x487e('0x64'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad['params']['id'][_0x487e('0x6d')]())))['toString']();break;default:_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')]('cm_hopper')[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),_0x487e('0x4d'),_0x487e('0x4a')],squel['select']()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('NOW()','scheduledAt')[_0x487e('0x6b')]('id','ContactId')[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),_0x487e('0x69'))['field'](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')]('cm_contacts')['where'](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204[_0x487e('0x75')][_0x487e('0x6d')]())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x5b0625[_0x487e('0x78')](db['sequelize']['query'](_0x2b1561));}return BPromise[_0x487e('0x79')](_0x5b0625);}})[_0x487e('0x1d')](function(){return _0x595db6;})[_0x487e('0x1d')](respondWithResult(_0x2299ac,null))['catch'](handleError(_0x2299ac,null));};exports['removeLists']=function(_0x3cc4f6,_0x196458,_0xd8c9c0){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x3cc4f6['params']['id']}})['then'](handleEntityNotFound(_0x196458,null))['then'](function(_0x2f4767){if(_0x2f4767){return _0x2f4767[_0x487e('0x7a')](_0x3cc4f6[_0x487e('0x28')][_0x487e('0x5f')]);}})[_0x487e('0x1d')](function(_0x40a701){if(_0x40a701){return db[_0x487e('0x55')][_0x487e('0x1e')]({'where':{'ListId':_0x3cc4f6['query']['ids'],'CampaignId':_0x3cc4f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x40a701;});}})[_0x487e('0x1d')](respondWithStatusCode(_0x196458,null))[_0x487e('0x40')](handleError(_0x196458,null));};exports[_0x487e('0x7b')]=function(_0x37c57b,_0x13feca,_0x57af49){var _0x1726b3={};var _0x4ac702={};var _0x38e5d2;var _0x7081eb;return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x37c57b['params']['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x13feca,null))[_0x487e('0x1d')](function(_0x4db0d5){if(_0x4db0d5){_0x38e5d2=_0x4db0d5;_0x4ac702[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmList'][_0x487e('0x24')]);_0x4ac702['query']=_[_0x487e('0x27')](_0x37c57b[_0x487e('0x28')]);_0x4ac702[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x4ac702['model'],_0x4ac702[_0x487e('0x28')]);_0x1726b3['attributes']=_[_0x487e('0x2a')](_0x4ac702[_0x487e('0x2b')],qs['fields'](_0x37c57b[_0x487e('0x28')]['fields']));_0x1726b3['attributes']=_0x1726b3['attributes'][_0x487e('0x2e')]?_0x1726b3[_0x487e('0x2c')]:_0x4ac702[_0x487e('0x2b')];_0x1726b3['order']=qs[_0x487e('0x31')](_0x37c57b[_0x487e('0x28')][_0x487e('0x31')]);_0x1726b3[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x37c57b[_0x487e('0x28')],_0x4ac702[_0x487e('0x29')]));if(_0x37c57b[_0x487e('0x28')]['filter']){_0x1726b3['where']=_[_0x487e('0x34')](_0x1726b3[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x1726b3['attributes'],function(_0x3d9230){var _0x3fdf6a={};_0x3fdf6a[_0x3d9230]={'$like':'%'+_0x37c57b['query'][_0x487e('0x54')]+'%'};return _0x3fdf6a;})});}_0x1726b3=_['merge']({},_0x1726b3,_0x37c57b[_0x487e('0x37')]);return _0x38e5d2[_0x487e('0x7b')](_0x1726b3);}})[_0x487e('0x1d')](function(_0x263f2c){if(_0x263f2c){_0x7081eb=_0x263f2c[_0x487e('0x2e')];if(!_0x37c57b[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x1726b3[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x37c57b[_0x487e('0x28')]['limit']);_0x1726b3[_0x487e('0x16')]=qs['offset'](_0x37c57b[_0x487e('0x28')]['offset']);}return _0x38e5d2['getBlackLists'](_0x1726b3);}})[_0x487e('0x1d')](function(_0x584443){if(_0x584443){return _0x584443?{'count':_0x7081eb,'rows':_0x584443}:null;}})[_0x487e('0x1d')](respondWithResult(_0x13feca,null))['catch'](handleError(_0x13feca,null));};exports['addBlackLists']=function(_0xa10b08,_0x41dd4e,_0x49606a){var _0x27ceed,_0x43b470;return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0xa10b08[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x41dd4e,null))[_0x487e('0x1d')](function(_0x561a2b){if(_0x561a2b){_0x43b470=_0x561a2b;return _0x561a2b[_0x487e('0x7c')](_0xa10b08[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0xa10b08[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})[_0x487e('0x7d')](function(_0x2272e3){var _0x3c3d10;_0x27ceed=_0x2272e3||[];var _0x5cf7a3=[];if(_0x2272e3){for(var _0x44b027=0x0;_0x44b027<_0x2272e3[_0x487e('0x2e')];_0x44b027+=0x1){var _0x6f9a2d=_0x2272e3[_0x44b027][_0x487e('0x42')]({'plain':!![]});_0x3c3d10=squel['insert']()['into'](_0x487e('0x7e'))[_0x487e('0x65')](['phone',_0x487e('0x68'),'ListId',_0x487e('0x53'),_0x487e('0x4d'),'updatedAt'],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x6f9a2d['CmListId']['toString'](),_0x487e('0x69'))['field'](_0xa10b08['params']['id'][_0x487e('0x6d')](),_0x487e('0x53'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')]('ListId\x20=\x20?',_0x6f9a2d[_0x487e('0x75')][_0x487e('0x6d')]())['where'](_0x487e('0x70')))[_0x487e('0x6d')]();_0x5cf7a3[_0x487e('0x78')](db[_0x487e('0x7f')]['query'](_0x3c3d10));}return BPromise['all'](_0x5cf7a3);}})[_0x487e('0x1d')](function(){return _0x27ceed;})['then'](respondWithResult(_0x41dd4e,null))[_0x487e('0x40')](handleError(_0x41dd4e,null));};exports[_0x487e('0x80')]=function(_0x110c49,_0x190d48,_0x15c7ce){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x190d48,null))[_0x487e('0x1d')](function(_0x113563){if(_0x113563){return _0x113563[_0x487e('0x80')](_0x110c49[_0x487e('0x28')][_0x487e('0x5f')]);}})['then'](function(_0x5aad32){if(_0x5aad32){return db[_0x487e('0x5b')]['destroy']({'where':{'ListId':_0x110c49[_0x487e('0x28')][_0x487e('0x5f')],'CampaignId':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x5aad32;});}})['then'](respondWithStatusCode(_0x190d48,null))[_0x487e('0x40')](handleError(_0x190d48,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index a1da653..0e45ee5 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3d391b,_0x139db6){var _0x34adb6=function(_0x464b1e){while(--_0x464b1e){_0x3d391b['push'](_0x3d391b['shift']());}};_0x34adb6(++_0x139db6);}(_0x7a54,0x106));var _0x47a5=function(_0x3bdbe6,_0x484bbf){_0x3bdbe6=_0x3bdbe6-0x0;var _0xe7b61d=_0x7a54[_0x3bdbe6];return _0xe7b61d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a07fae8..bcd5238 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 _0xa477=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x404f01,_0x365b18){var _0x16201a=function(_0x258c37){while(--_0x258c37){_0x404f01['push'](_0x404f01['shift']());}};_0x16201a(++_0x365b18);}(_0xa477,0xe6));var _0x7a47=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa477[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require('moment');var BPromise=require(_0x7a47('0x2'));var rs=require(_0x7a47('0x3'));var fs=require('fs');var Redis=require(_0x7a47('0x4'));var db=require(_0x7a47('0x5'))['db'];var utils=require(_0x7a47('0x6'));var logger=require(_0x7a47('0x7'))(_0x7a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x7a47('0x9'));var client=jayson[_0x7a47('0xa')][_0x7a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e0e,_0x54e9aa,_0x47f594){return new BPromise(function(_0x4276ed,_0x49db4c){return client[_0x7a47('0xc')](_0x4c6e0e,_0x47f594)[_0x7a47('0xd')](function(_0x52eb49){logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,_0x7a47('0x10'));logger[_0x7a47('0x11')](_0x7a47('0x12'),_0x54e9aa,'request\x20sent',JSON[_0x7a47('0x13')](_0x52eb49));if(_0x52eb49[_0x7a47('0x14')]){if(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x15')]===0x1f4){logger['error'](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);return _0x49db4c(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x52eb49[_0x7a47('0x14')]['message']);return _0x4276ed(_0x52eb49[_0x7a47('0x14')][_0x7a47('0x16')]);}else{logger[_0x7a47('0xe')](_0x7a47('0xf'),_0x54e9aa,'request\x20sent');_0x4276ed(_0x52eb49[_0x7a47('0x17')][_0x7a47('0x16')]);}})['catch'](function(_0x4a81fb){logger[_0x7a47('0x14')](_0x7a47('0xf'),_0x54e9aa,_0x4a81fb);_0x49db4c(_0x4a81fb);});});}exports[_0x7a47('0x18')]=function(_0x5a4e79){var _0x444c48=this;return new Promise(function(_0x4a24b6,_0x203ab4){return db[_0x7a47('0x19')][_0x7a47('0x1a')]({'raw':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1d')]||null:null,'attributes':_0x5a4e79['options']?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1e')]||null:null,'limit':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x1f')]||null:null,'include':_0x5a4e79[_0x7a47('0x1b')]?_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')]?_[_0x7a47('0x21')](_0x5a4e79[_0x7a47('0x1b')][_0x7a47('0x20')],function(_0xe9bb12){return{'model':db[_0xe9bb12['model']],'as':_0xe9bb12['as'],'attributes':_0xe9bb12['attributes'],'include':_0xe9bb12[_0x7a47('0x20')]?_[_0x7a47('0x21')](_0xe9bb12[_0x7a47('0x20')],function(_0x3e598b){return{'model':db[_0x3e598b['model']],'as':_0x3e598b['as'],'attributes':_0x3e598b[_0x7a47('0x1e')],'include':_0x3e598b[_0x7a47('0x20')]?_['map'](_0x3e598b[_0x7a47('0x20')],function(_0x324a85){return{'model':db[_0x324a85[_0x7a47('0x22')]],'as':_0x324a85['as'],'attributes':_0x324a85[_0x7a47('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a47('0xd')](function(_0x5b2a0c){logger[_0x7a47('0xe')](_0x7a47('0x18'),_0x5a4e79);logger[_0x7a47('0x11')](_0x7a47('0x18'),_0x5a4e79,JSON['stringify'](_0x5b2a0c));_0x4a24b6(_0x5b2a0c);})['catch'](function(_0x5d4b9c){logger[_0x7a47('0x14')](_0x7a47('0x18'),_0x5d4b9c[_0x7a47('0x16')],_0x5a4e79);_0x203ab4(_0x444c48[_0x7a47('0x14')](0x1f4,_0x5d4b9c[_0x7a47('0x16')]));});});};
\ No newline at end of file
+var _0x4e83=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x4e83,0x88));var _0x34e8=function(_0x38230,_0x148d0c){_0x38230=_0x38230-0x0;var _0x522ec9=_0x4e83[_0x38230];return _0x522ec9;};'use strict';var _=require('lodash');var util=require(_0x34e8('0x0'));var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34e8('0x4'))['db'];var utils=require(_0x34e8('0x5'));var logger=require(_0x34e8('0x6'))(_0x34e8('0x7'));var config=require(_0x34e8('0x8'));var jayson=require(_0x34e8('0x9'));var client=jayson[_0x34e8('0xa')][_0x34e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x320b00,_0x146a1f,_0x188f11){return new BPromise(function(_0x18e178,_0x3ace57){return client['request'](_0x320b00,_0x188f11)[_0x34e8('0xc')](function(_0x200425){logger[_0x34e8('0xd')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0x34e8('0xe'));logger[_0x34e8('0xf')](_0x34e8('0x10'),_0x146a1f,_0x34e8('0xe'),JSON[_0x34e8('0x11')](_0x200425));if(_0x200425['error']){if(_0x200425[_0x34e8('0x12')]['code']===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x13'),_0x146a1f,_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);return _0x3ace57(_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);}logger['error'](_0x34e8('0x13'),_0x146a1f,_0x200425['error'][_0x34e8('0x14')]);return _0x18e178(_0x200425['error'][_0x34e8('0x14')]);}else{logger[_0x34e8('0xd')](_0x34e8('0x13'),_0x146a1f,'request\x20sent');_0x18e178(_0x200425[_0x34e8('0x15')]['message']);}})[_0x34e8('0x16')](function(_0xed8219){logger[_0x34e8('0x12')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0xed8219);_0x3ace57(_0xed8219);});});}exports[_0x34e8('0x17')]=function(_0x1a2fa7){var _0x3b83bb=this;return new Promise(function(_0x38edda,_0x326416){return db[_0x34e8('0x18')][_0x34e8('0x19')]({'raw':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a2fa7['options']?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1c')]||null:null,'attributes':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1d')]||null:null,'limit':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1e')]||null:null,'include':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')],function(_0x2e04f8){return{'model':db[_0x2e04f8[_0x34e8('0x21')]],'as':_0x2e04f8['as'],'attributes':_0x2e04f8[_0x34e8('0x1d')],'include':_0x2e04f8[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x2e04f8[_0x34e8('0x1f')],function(_0x4d8780){return{'model':db[_0x4d8780['model']],'as':_0x4d8780['as'],'attributes':_0x4d8780['attributes'],'include':_0x4d8780[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x4d8780[_0x34e8('0x1f')],function(_0x2b1179){return{'model':db[_0x2b1179['model']],'as':_0x2b1179['as'],'attributes':_0x2b1179[_0x34e8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1440d0){logger['info'](_0x34e8('0x17'),_0x1a2fa7);logger['debug'](_0x34e8('0x17'),_0x1a2fa7,JSON[_0x34e8('0x11')](_0x1440d0));_0x38edda(_0x1440d0);})[_0x34e8('0x16')](function(_0x1bb4f3){logger['error'](_0x34e8('0x17'),_0x1bb4f3[_0x34e8('0x14')],_0x1a2fa7);_0x326416(_0x3b83bb[_0x34e8('0x12')](0x1f4,_0x1bb4f3['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index d1cb38e..acd47be 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 _0xaf23=['destroy','removeLists','multer','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','get','isAuthenticated','/:id','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','/:id/blacklists','addBlackLists','put','delete'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf23,0x106));var _0x3af2=function(_0xa16401,_0x9a9949){_0xa16401=_0xa16401-0x0;var _0x3d5676=_0xaf23[_0xa16401];return _0x3d5676;};'use strict';var multer=require(_0x3af2('0x0'));var util=require('util');var path=require(_0x3af2('0x1'));var timeout=require(_0x3af2('0x2'));var express=require(_0x3af2('0x3'));var router=express[_0x3af2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3af2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3af2('0x6'));router[_0x3af2('0x7')]('/',auth[_0x3af2('0x8')](),controller['index']);router['get'](_0x3af2('0x9'),auth[_0x3af2('0x8')](),controller['show']);router['get']('/:id/hoppers',auth[_0x3af2('0x8')](),controller[_0x3af2('0xa')]);router[_0x3af2('0x7')]('/:id/hopper_histories',auth[_0x3af2('0x8')](),controller[_0x3af2('0xb')]);router[_0x3af2('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x3af2('0x7')](_0x3af2('0xc'),auth[_0x3af2('0x8')](),controller[_0x3af2('0xd')]);router[_0x3af2('0x7')](_0x3af2('0xe'),auth[_0x3af2('0x8')](),controller[_0x3af2('0xf')]);router[_0x3af2('0x7')]('/:id/blacklists',auth[_0x3af2('0x8')](),controller[_0x3af2('0x10')]);router[_0x3af2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3af2('0x12'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x13')]);router['post'](_0x3af2('0xe'),auth['isAuthenticated'](),controller['addLists']);router['post'](_0x3af2('0x14'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x15')]);router[_0x3af2('0x16')]('/:id',auth[_0x3af2('0x8')](),controller['update']);router[_0x3af2('0x17')](_0x3af2('0x9'),auth[_0x3af2('0x8')](),controller[_0x3af2('0x18')]);router[_0x3af2('0x17')]('/:id/lists',auth[_0x3af2('0x8')](),controller[_0x3af2('0x19')]);router[_0x3af2('0x17')](_0x3af2('0x14'),auth[_0x3af2('0x8')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x7800=['path','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x8e6768,_0x997aad){var _0x4db9e9=function(_0x530ccb){while(--_0x530ccb){_0x8e6768['push'](_0x8e6768['shift']());}};_0x4db9e9(++_0x997aad);}(_0x7800,0x1ee));var _0x0780=function(_0x529287,_0x23957c){_0x529287=_0x529287-0x0;var _0x10936e=_0x7800[_0x529287];return _0x10936e;};'use strict';var multer=require(_0x0780('0x0'));var util=require(_0x0780('0x1'));var path=require(_0x0780('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0780('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0780('0x4'));var config=require(_0x0780('0x5'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0780('0x6')]);router[_0x0780('0x7')](_0x0780('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0780('0x7')](_0x0780('0x9'),auth[_0x0780('0xa')](),controller[_0x0780('0xb')]);router[_0x0780('0x7')](_0x0780('0xc'),auth[_0x0780('0xa')](),controller['getHopperHistories']);router[_0x0780('0x7')](_0x0780('0xd'),auth['isAuthenticated'](),controller[_0x0780('0xe')]);router[_0x0780('0x7')](_0x0780('0xf'),auth[_0x0780('0xa')](),controller[_0x0780('0x10')]);router[_0x0780('0x7')]('/:id/lists',auth[_0x0780('0xa')](),controller[_0x0780('0x11')]);router[_0x0780('0x7')](_0x0780('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x0780('0x13')]('/',auth[_0x0780('0xa')](),controller['create']);router[_0x0780('0x13')]('/:id/clone',auth[_0x0780('0xa')](),controller[_0x0780('0x14')]);router[_0x0780('0x13')](_0x0780('0x15'),auth['isAuthenticated'](),controller[_0x0780('0x16')]);router[_0x0780('0x13')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x17')]);router[_0x0780('0x18')]('/:id',auth[_0x0780('0xa')](),controller[_0x0780('0x19')]);router[_0x0780('0x1a')](_0x0780('0x8'),auth['isAuthenticated'](),controller[_0x0780('0x1b')]);router['delete'](_0x0780('0x15'),auth[_0x0780('0xa')](),controller[_0x0780('0x1c')]);router[_0x0780('0x1a')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x1d')]);module[_0x0780('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 753848f..d01e760 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 _0x482b=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x31b591,_0x11d791){var _0x5040ff=function(_0x544cc5){while(--_0x544cc5){_0x31b591['push'](_0x31b591['shift']());}};_0x5040ff(++_0x11d791);}(_0x482b,0x89));var _0xb482=function(_0x3de54a,_0x43c911){_0x3de54a=_0x3de54a-0x0;var _0x9f02e2=_0x482b[_0x3de54a];return _0x9f02e2;};'use strict';var Sequelize=require(_0xb482('0x0'));module['exports']={'key':{'type':Sequelize[_0xb482('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb482('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb482('0x1')]},'name':{'type':Sequelize[_0xb482('0x3')],'get':function(){return this[_0xb482('0x4')](_0xb482('0x5'));}}};
\ No newline at end of file
+var _0x5399=['sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x5399,0xeb));var _0x9539=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x5399[_0x44ceee];return _0x1a065c;};'use strict';var Sequelize=require(_0x9539('0x0'));module[_0x9539('0x1')]={'key':{'type':Sequelize[_0x9539('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9539('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9539('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9539('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9b0350b..3cf4531 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 _0x29d6=['ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','CannedAnswer','includeAll','rows','catch','show','params','keys','include','merge','options','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x14845b,_0x5d8458){var _0x50998b=function(_0x324776){while(--_0x324776){_0x14845b['push'](_0x14845b['shift']());}};_0x50998b(++_0x5d8458);}(_0x29d6,0x11a));var _0x629d=function(_0x56a176,_0x298477){_0x56a176=_0x56a176-0x0;var _0x539ef2=_0x29d6[_0x56a176];return _0x539ef2;};'use strict';var emlformat=require(_0x629d('0x0'));var rimraf=require(_0x629d('0x1'));var zipdir=require(_0x629d('0x2'));var jsonpatch=require(_0x629d('0x3'));var rp=require(_0x629d('0x4'));var moment=require(_0x629d('0x5'));var BPromise=require(_0x629d('0x6'));var Mustache=require(_0x629d('0x7'));var util=require(_0x629d('0x8'));var path=require(_0x629d('0x9'));var sox=require(_0x629d('0xa'));var csv=require(_0x629d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x629d('0xc'));var _=require(_0x629d('0xd'));var squel=require(_0x629d('0xe'));var crypto=require(_0x629d('0xf'));var jsforce=require(_0x629d('0x10'));var deskjs=require(_0x629d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x629d('0x12'));var Redis=require(_0x629d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x629d('0x14'));var as=require(_0x629d('0x15'));var hardwareService=require(_0x629d('0x16'));var logger=require(_0x629d('0x17'))(_0x629d('0x18'));var utils=require(_0x629d('0x19'));var config=require(_0x629d('0x1a'));var licenseUtil=require(_0x629d('0x1b'));var db=require(_0x629d('0x1c'))['db'];function respondWithStatusCode(_0xd1b214,_0x51b95a){_0x51b95a=_0x51b95a||0xcc;return function(_0x29ca50){if(_0x29ca50){return _0xd1b214[_0x629d('0x1d')](_0x51b95a);}return _0xd1b214[_0x629d('0x1e')](_0x51b95a)[_0x629d('0x1f')]();};}function respondWithResult(_0x40c3ea,_0x547a26){_0x547a26=_0x547a26||0xc8;return function(_0x10a370){if(_0x10a370){return _0x40c3ea[_0x629d('0x1e')](_0x547a26)[_0x629d('0x20')](_0x10a370);}};}function respondWithFilteredResult(_0x596821,_0x2f0d3e){return function(_0x30c3e8){if(_0x30c3e8){var _0x1003c9=typeof _0x2f0d3e[_0x629d('0x21')]===_0x629d('0x22')&&typeof _0x2f0d3e[_0x629d('0x23')]===_0x629d('0x22');var _0x45d71c=_0x30c3e8[_0x629d('0x24')];var _0x125435=_0x1003c9?0x0:_0x2f0d3e[_0x629d('0x21')];var _0x596404=_0x1003c9?_0x30c3e8[_0x629d('0x24')]:_0x2f0d3e[_0x629d('0x21')]+_0x2f0d3e['limit'];var _0x417505;if(_0x596404>=_0x45d71c){_0x596404=_0x45d71c;_0x417505=0xc8;}else{_0x417505=0xce;}_0x596821[_0x629d('0x1e')](_0x417505);return _0x596821[_0x629d('0x25')](_0x629d('0x26'),_0x125435+'-'+_0x596404+'/'+_0x45d71c)['json'](_0x30c3e8);}return null;};}function patchUpdates(_0x3f37e4){return function(_0x51d3b0){try{jsonpatch[_0x629d('0x27')](_0x51d3b0,_0x3f37e4,!![]);}catch(_0x40eafe){return BPromise[_0x629d('0x28')](_0x40eafe);}return _0x51d3b0[_0x629d('0x29')]();};}function saveUpdates(_0x8d43b,_0x3aaad3){return function(_0x2e5375){if(_0x2e5375){return _0x2e5375[_0x629d('0x2a')](_0x8d43b)['then'](function(_0x47ed7b){return _0x47ed7b;});}return null;};}function removeEntity(_0x3e5097,_0x2929cd){return function(_0x28ef28){if(_0x28ef28){return _0x28ef28[_0x629d('0x2b')]()['then'](function(){var _0x38104a=_0x28ef28[_0x629d('0x2c')]({'plain':!![]});var _0x594115=_0x629d('0x2d');return db[_0x629d('0x2e')][_0x629d('0x2b')]({'where':{'type':_0x594115,'resourceId':_0x38104a['id']}})[_0x629d('0x2f')](function(){return _0x28ef28;});})[_0x629d('0x2f')](function(){_0x3e5097[_0x629d('0x1e')](0xcc)[_0x629d('0x1f')]();});}};}function handleEntityNotFound(_0x31a4bb,_0x440a03){return function(_0x5d85d1){if(!_0x5d85d1){_0x31a4bb[_0x629d('0x1d')](0x194);}return _0x5d85d1;};}function handleError(_0x22b08e,_0x5c5af7){_0x5c5af7=_0x5c5af7||0x1f4;return function(_0x10caed){logger['error'](_0x10caed[_0x629d('0x30')]);if(_0x10caed['name']){delete _0x10caed[_0x629d('0x31')];}_0x22b08e['status'](_0x5c5af7)[_0x629d('0x32')](_0x10caed);};}exports['index']=function(_0x28db49,_0x230c5a){var _0x556684={},_0x3d0933={},_0x4d8f4f={'count':0x0,'rows':[]};var _0x4fea8c=_[_0x629d('0x33')](db['CannedAnswer'][_0x629d('0x34')],function(_0x3d1b44){return{'name':_0x3d1b44[_0x629d('0x35')],'type':_0x3d1b44[_0x629d('0x36')][_0x629d('0x37')]};});_0x3d0933[_0x629d('0x38')]=_[_0x629d('0x33')](_0x4fea8c,_0x629d('0x31'));_0x3d0933['query']=_['keys'](_0x28db49[_0x629d('0x39')]);_0x3d0933[_0x629d('0x3a')]=_[_0x629d('0x3b')](_0x3d0933[_0x629d('0x38')],_0x3d0933['query']);_0x556684[_0x629d('0x3c')]=_['intersection'](_0x3d0933['model'],qs[_0x629d('0x3d')](_0x28db49[_0x629d('0x39')][_0x629d('0x3d')]));_0x556684[_0x629d('0x3c')]=_0x556684['attributes'][_0x629d('0x3e')]?_0x556684[_0x629d('0x3c')]:_0x3d0933[_0x629d('0x38')];if(!_0x28db49[_0x629d('0x39')]['hasOwnProperty'](_0x629d('0x3f'))){_0x556684[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x28db49[_0x629d('0x39')]['limit']);_0x556684['offset']=qs[_0x629d('0x21')](_0x28db49[_0x629d('0x39')][_0x629d('0x21')]);}_0x556684[_0x629d('0x40')]=qs[_0x629d('0x41')](_0x28db49[_0x629d('0x39')][_0x629d('0x41')]);_0x556684[_0x629d('0x42')]=qs[_0x629d('0x3a')](_[_0x629d('0x43')](_0x28db49[_0x629d('0x39')],_0x3d0933[_0x629d('0x3a')]),_0x4fea8c);if(_0x28db49[_0x629d('0x39')]['filter']){_0x556684[_0x629d('0x42')]=_['merge'](_0x556684[_0x629d('0x42')],{'$or':[{'key':{'$like':'%'+_0x28db49['query'][_0x629d('0x44')]+'%'}},{'value':{'$like':'%'+_0x28db49[_0x629d('0x39')][_0x629d('0x44')]+'%'}}]});}_0x556684=_['merge']({},_0x556684,_0x28db49['options']);var _0x42e1e4={'where':_0x556684['where']};return db[_0x629d('0x45')][_0x629d('0x24')](_0x42e1e4)['then'](function(_0x4bc6e0){_0x4d8f4f[_0x629d('0x24')]=_0x4bc6e0;if(_0x28db49['query'][_0x629d('0x46')]){_0x556684['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x556684);})['then'](function(_0x43e926){_0x4d8f4f[_0x629d('0x47')]=_0x43e926;return _0x4d8f4f;})[_0x629d('0x2f')](respondWithFilteredResult(_0x230c5a,_0x556684))[_0x629d('0x48')](handleError(_0x230c5a,null));};exports[_0x629d('0x49')]=function(_0x472a40,_0x4fc6da){var _0x3177a4={'raw':!![],'where':{'id':_0x472a40[_0x629d('0x4a')]['id']}},_0x130df1={};_0x130df1[_0x629d('0x38')]=_[_0x629d('0x4b')](db[_0x629d('0x45')]['rawAttributes']);_0x130df1['query']=_['keys'](_0x472a40[_0x629d('0x39')]);_0x130df1[_0x629d('0x3a')]=_[_0x629d('0x3b')](_0x130df1[_0x629d('0x38')],_0x130df1[_0x629d('0x39')]);_0x3177a4['attributes']=_[_0x629d('0x3b')](_0x130df1[_0x629d('0x38')],qs[_0x629d('0x3d')](_0x472a40[_0x629d('0x39')][_0x629d('0x3d')]));_0x3177a4[_0x629d('0x3c')]=_0x3177a4[_0x629d('0x3c')][_0x629d('0x3e')]?_0x3177a4[_0x629d('0x3c')]:_0x130df1[_0x629d('0x38')];if(_0x472a40[_0x629d('0x39')][_0x629d('0x46')]){_0x3177a4[_0x629d('0x4c')]=[{'all':!![]}];}_0x3177a4=_[_0x629d('0x4d')]({},_0x3177a4,_0x472a40[_0x629d('0x4e')]);return db[_0x629d('0x45')]['find'](_0x3177a4)[_0x629d('0x2f')](handleEntityNotFound(_0x4fc6da,null))[_0x629d('0x2f')](respondWithResult(_0x4fc6da,null))[_0x629d('0x48')](handleError(_0x4fc6da,null));};exports['update']=function(_0x3a8367,_0x341e2e){if(_0x3a8367[_0x629d('0x4f')]['id']){delete _0x3a8367[_0x629d('0x4f')]['id'];}return db[_0x629d('0x45')][_0x629d('0x50')]({'where':{'id':_0x3a8367[_0x629d('0x4a')]['id']}})[_0x629d('0x2f')](handleEntityNotFound(_0x341e2e,null))[_0x629d('0x2f')](saveUpdates(_0x3a8367[_0x629d('0x4f')],null))[_0x629d('0x2f')](respondWithResult(_0x341e2e,null))[_0x629d('0x48')](handleError(_0x341e2e,null));};exports[_0x629d('0x2b')]=function(_0x894a3c,_0x463b8e){return db[_0x629d('0x45')][_0x629d('0x50')]({'where':{'id':_0x894a3c[_0x629d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x463b8e,null))[_0x629d('0x2f')](removeEntity(_0x463b8e,null))[_0x629d('0x48')](handleError(_0x463b8e,null));};exports['create']=function(_0x4991d1,_0x13df96){var _0x37f611={'key':_0x4991d1[_0x629d('0x4f')]['key']};if(_0x4991d1['body'][_0x629d('0x51')]){_0x37f611['MailAccountId']=_0x4991d1[_0x629d('0x4f')][_0x629d('0x51')];}else if(_0x4991d1['body'][_0x629d('0x52')]){_0x37f611[_0x629d('0x52')]=_0x4991d1[_0x629d('0x4f')][_0x629d('0x52')];}else if(_0x4991d1[_0x629d('0x4f')]['OpenchannelAccountId']){_0x37f611['OpenchannelAccountId']=_0x4991d1[_0x629d('0x4f')][_0x629d('0x53')];}else if(_0x4991d1[_0x629d('0x4f')]['ChatWebsiteId']){_0x37f611[_0x629d('0x54')]=_0x4991d1[_0x629d('0x4f')][_0x629d('0x54')];}return db['CannedAnswer'][_0x629d('0x50')]({'where':_0x37f611})[_0x629d('0x2f')](function(_0x539dd1){if(_0x539dd1){throw new db[(_0x629d('0x55'))][(_0x629d('0x56'))](_0x629d('0x57'));}return db[_0x629d('0x45')]['create'](_0x4991d1[_0x629d('0x4f')]);})[_0x629d('0x2f')](function(_0xc2a0a0){var _0x3da611=_0x4991d1[_0x629d('0x58')][_0x629d('0x2c')]({'plain':!![]});if(!_0x3da611)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da611['role']===_0x629d('0x58')){var _0x2f814a=_0xc2a0a0[_0x629d('0x2c')]({'plain':!![]});return db[_0x629d('0x59')]['find']({'where':{'name':_0x629d('0x2d'),'userProfileId':_0x3da611['userProfileId']},'raw':!![]})[_0x629d('0x2f')](function(_0x549376){if(_0x549376&&_0x549376[_0x629d('0x5a')]===0x0){return db[_0x629d('0x2e')][_0x629d('0x5b')]({'name':_0x2f814a[_0x629d('0x31')],'resourceId':_0x2f814a['id'],'type':_0x549376['name'],'sectionId':_0x549376['id']},{})[_0x629d('0x2f')](function(){return _0xc2a0a0;});}else{return _0xc2a0a0;}})['catch'](function(_0x36c943){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c943);throw _0x36c943;});}return _0xc2a0a0;})['then'](respondWithResult(_0x13df96,0xc9))[_0x629d('0x48')](handleError(_0x13df96,null));};
\ No newline at end of file
+var _0x258b=['rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','CannedAnswer','includeAll','include','catch','show','params','keys','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','mustache','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x1e7d26,_0x208a83){var _0x26d190=function(_0x15f3d3){while(--_0x15f3d3){_0x1e7d26['push'](_0x1e7d26['shift']());}};_0x26d190(++_0x208a83);}(_0x258b,0x81));var _0xb258=function(_0x12e32e,_0x158771){_0x12e32e=_0x12e32e-0x0;var _0x306637=_0x258b[_0x12e32e];return _0x306637;};'use strict';var emlformat=require(_0xb258('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb258('0x1'));var util=require(_0xb258('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb258('0x3'));var squel=require(_0xb258('0x4'));var crypto=require(_0xb258('0x5'));var jsforce=require(_0xb258('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xb258('0x7'));var querystring=require(_0xb258('0x8'));var Papa=require(_0xb258('0x9'));var Redis=require(_0xb258('0xa'));var authService=require(_0xb258('0xb'));var qs=require(_0xb258('0xc'));var as=require(_0xb258('0xd'));var hardwareService=require(_0xb258('0xe'));var logger=require(_0xb258('0xf'))(_0xb258('0x10'));var utils=require('../../config/utils');var config=require(_0xb258('0x11'));var licenseUtil=require(_0xb258('0x12'));var db=require(_0xb258('0x13'))['db'];function respondWithStatusCode(_0x251617,_0x53008a){_0x53008a=_0x53008a||0xcc;return function(_0x2a7d5e){if(_0x2a7d5e){return _0x251617['sendStatus'](_0x53008a);}return _0x251617['status'](_0x53008a)[_0xb258('0x14')]();};}function respondWithResult(_0x46bce1,_0x581d34){_0x581d34=_0x581d34||0xc8;return function(_0x56144e){if(_0x56144e){return _0x46bce1[_0xb258('0x15')](_0x581d34)['json'](_0x56144e);}};}function respondWithFilteredResult(_0x44b235,_0x2d33a9){return function(_0x4f937f){if(_0x4f937f){var _0x32b69a=typeof _0x2d33a9[_0xb258('0x16')]===_0xb258('0x17')&&typeof _0x2d33a9[_0xb258('0x18')]===_0xb258('0x17');var _0x36586e=_0x4f937f[_0xb258('0x19')];var _0x78fe6d=_0x32b69a?0x0:_0x2d33a9[_0xb258('0x16')];var _0x1ac322=_0x32b69a?_0x4f937f[_0xb258('0x19')]:_0x2d33a9[_0xb258('0x16')]+_0x2d33a9[_0xb258('0x18')];var _0x2bb02c;if(_0x1ac322>=_0x36586e){_0x1ac322=_0x36586e;_0x2bb02c=0xc8;}else{_0x2bb02c=0xce;}_0x44b235[_0xb258('0x15')](_0x2bb02c);return _0x44b235[_0xb258('0x1a')](_0xb258('0x1b'),_0x78fe6d+'-'+_0x1ac322+'/'+_0x36586e)[_0xb258('0x1c')](_0x4f937f);}return null;};}function patchUpdates(_0x5851c4){return function(_0x1c80c2){try{jsonpatch[_0xb258('0x1d')](_0x1c80c2,_0x5851c4,!![]);}catch(_0x2b8fa9){return BPromise[_0xb258('0x1e')](_0x2b8fa9);}return _0x1c80c2[_0xb258('0x1f')]();};}function saveUpdates(_0x42a14b,_0x1458ac){return function(_0xb4069f){if(_0xb4069f){return _0xb4069f[_0xb258('0x20')](_0x42a14b)[_0xb258('0x21')](function(_0x32aaea){return _0x32aaea;});}return null;};}function removeEntity(_0x19514e,_0xe2fc8a){return function(_0xe4ddf0){if(_0xe4ddf0){return _0xe4ddf0[_0xb258('0x22')]()[_0xb258('0x21')](function(){var _0x3dd7c6=_0xe4ddf0[_0xb258('0x23')]({'plain':!![]});var _0x215416=_0xb258('0x24');return db[_0xb258('0x25')][_0xb258('0x22')]({'where':{'type':_0x215416,'resourceId':_0x3dd7c6['id']}})['then'](function(){return _0xe4ddf0;});})[_0xb258('0x21')](function(){_0x19514e[_0xb258('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420e48,_0x2c649a){return function(_0x52011e){if(!_0x52011e){_0x420e48[_0xb258('0x26')](0x194);}return _0x52011e;};}function handleError(_0x32633c,_0x24ea6e){_0x24ea6e=_0x24ea6e||0x1f4;return function(_0x39f68e){logger[_0xb258('0x27')](_0x39f68e[_0xb258('0x28')]);if(_0x39f68e[_0xb258('0x29')]){delete _0x39f68e[_0xb258('0x29')];}_0x32633c[_0xb258('0x15')](_0x24ea6e)['send'](_0x39f68e);};}exports[_0xb258('0x2a')]=function(_0x56db73,_0x164900){var _0x6e43c5={},_0x31507b={},_0x505b76={'count':0x0,'rows':[]};var _0x41be0a=_['map'](db['CannedAnswer'][_0xb258('0x2b')],function(_0x1fd5da){return{'name':_0x1fd5da[_0xb258('0x2c')],'type':_0x1fd5da['type'][_0xb258('0x2d')]};});_0x31507b[_0xb258('0x2e')]=_[_0xb258('0x2f')](_0x41be0a,_0xb258('0x29'));_0x31507b[_0xb258('0x30')]=_['keys'](_0x56db73[_0xb258('0x30')]);_0x31507b['filters']=_[_0xb258('0x31')](_0x31507b[_0xb258('0x2e')],_0x31507b[_0xb258('0x30')]);_0x6e43c5['attributes']=_[_0xb258('0x31')](_0x31507b['model'],qs[_0xb258('0x32')](_0x56db73[_0xb258('0x30')]['fields']));_0x6e43c5[_0xb258('0x33')]=_0x6e43c5[_0xb258('0x33')][_0xb258('0x34')]?_0x6e43c5[_0xb258('0x33')]:_0x31507b[_0xb258('0x2e')];if(!_0x56db73[_0xb258('0x30')][_0xb258('0x35')](_0xb258('0x36'))){_0x6e43c5['limit']=qs[_0xb258('0x18')](_0x56db73[_0xb258('0x30')][_0xb258('0x18')]);_0x6e43c5['offset']=qs['offset'](_0x56db73[_0xb258('0x30')]['offset']);}_0x6e43c5[_0xb258('0x37')]=qs['sort'](_0x56db73[_0xb258('0x30')][_0xb258('0x38')]);_0x6e43c5[_0xb258('0x39')]=qs[_0xb258('0x3a')](_[_0xb258('0x3b')](_0x56db73[_0xb258('0x30')],_0x31507b[_0xb258('0x3a')]),_0x41be0a);if(_0x56db73['query']['filter']){_0x6e43c5[_0xb258('0x39')]=_[_0xb258('0x3c')](_0x6e43c5[_0xb258('0x39')],{'$or':[{'key':{'$like':'%'+_0x56db73[_0xb258('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x56db73[_0xb258('0x30')][_0xb258('0x3d')]+'%'}}]});}_0x6e43c5=_['merge']({},_0x6e43c5,_0x56db73[_0xb258('0x3e')]);var _0x2db763={'where':_0x6e43c5['where']};return db[_0xb258('0x3f')][_0xb258('0x19')](_0x2db763)[_0xb258('0x21')](function(_0x53168b){_0x505b76['count']=_0x53168b;if(_0x56db73[_0xb258('0x30')][_0xb258('0x40')]){_0x6e43c5[_0xb258('0x41')]=[{'all':!![]}];}return db[_0xb258('0x3f')]['findAll'](_0x6e43c5);})['then'](function(_0xc35bf9){_0x505b76['rows']=_0xc35bf9;return _0x505b76;})[_0xb258('0x21')](respondWithFilteredResult(_0x164900,_0x6e43c5))[_0xb258('0x42')](handleError(_0x164900,null));};exports[_0xb258('0x43')]=function(_0x255969,_0x561487){var _0x2a3df6={'raw':!![],'where':{'id':_0x255969[_0xb258('0x44')]['id']}},_0x2a4689={};_0x2a4689['model']=_[_0xb258('0x45')](db[_0xb258('0x3f')][_0xb258('0x2b')]);_0x2a4689[_0xb258('0x30')]=_[_0xb258('0x45')](_0x255969[_0xb258('0x30')]);_0x2a4689[_0xb258('0x3a')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],_0x2a4689[_0xb258('0x30')]);_0x2a3df6[_0xb258('0x33')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],qs[_0xb258('0x32')](_0x255969[_0xb258('0x30')][_0xb258('0x32')]));_0x2a3df6[_0xb258('0x33')]=_0x2a3df6[_0xb258('0x33')][_0xb258('0x34')]?_0x2a3df6[_0xb258('0x33')]:_0x2a4689[_0xb258('0x2e')];if(_0x255969[_0xb258('0x30')]['includeAll']){_0x2a3df6[_0xb258('0x41')]=[{'all':!![]}];}_0x2a3df6=_[_0xb258('0x3c')]({},_0x2a3df6,_0x255969[_0xb258('0x3e')]);return db[_0xb258('0x3f')][_0xb258('0x46')](_0x2a3df6)[_0xb258('0x21')](handleEntityNotFound(_0x561487,null))['then'](respondWithResult(_0x561487,null))[_0xb258('0x42')](handleError(_0x561487,null));};exports[_0xb258('0x20')]=function(_0x12c5a1,_0x2b0f56){if(_0x12c5a1[_0xb258('0x47')]['id']){delete _0x12c5a1[_0xb258('0x47')]['id'];}return db[_0xb258('0x3f')]['find']({'where':{'id':_0x12c5a1[_0xb258('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b0f56,null))[_0xb258('0x21')](saveUpdates(_0x12c5a1[_0xb258('0x47')],null))[_0xb258('0x21')](respondWithResult(_0x2b0f56,null))[_0xb258('0x42')](handleError(_0x2b0f56,null));};exports[_0xb258('0x22')]=function(_0x3dc865,_0x282b89){return db[_0xb258('0x3f')][_0xb258('0x46')]({'where':{'id':_0x3dc865[_0xb258('0x44')]['id']}})[_0xb258('0x21')](handleEntityNotFound(_0x282b89,null))['then'](removeEntity(_0x282b89,null))[_0xb258('0x42')](handleError(_0x282b89,null));};exports['create']=function(_0x16776c,_0x16f6bb){var _0x1bb3f5={'key':_0x16776c[_0xb258('0x47')]['key']};if(_0x16776c[_0xb258('0x47')]['MailAccountId']){_0x1bb3f5[_0xb258('0x48')]=_0x16776c[_0xb258('0x47')][_0xb258('0x48')];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x49')]){_0x1bb3f5[_0xb258('0x49')]=_0x16776c[_0xb258('0x47')]['SmsAccountId'];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x4a')]){_0x1bb3f5['OpenchannelAccountId']=_0x16776c[_0xb258('0x47')][_0xb258('0x4a')];}else if(_0x16776c[_0xb258('0x47')]['ChatWebsiteId']){_0x1bb3f5[_0xb258('0x4b')]=_0x16776c['body'][_0xb258('0x4b')];}return db[_0xb258('0x3f')]['find']({'where':_0x1bb3f5})[_0xb258('0x21')](function(_0x581a2d){if(_0x581a2d){throw new db['Sequelize'][(_0xb258('0x4c'))](_0xb258('0x4d'));}return db[_0xb258('0x3f')][_0xb258('0x4e')](_0x16776c[_0xb258('0x47')]);})['then'](function(_0xb8539b){var _0x465545=_0x16776c[_0xb258('0x4f')][_0xb258('0x23')]({'plain':!![]});if(!_0x465545)throw new Error(_0xb258('0x50'));if(_0x465545[_0xb258('0x51')]===_0xb258('0x4f')){var _0x5333cf=_0xb8539b[_0xb258('0x23')]({'plain':!![]});return db[_0xb258('0x52')][_0xb258('0x46')]({'where':{'name':_0xb258('0x24'),'userProfileId':_0x465545[_0xb258('0x53')]},'raw':!![]})['then'](function(_0x32cb34){if(_0x32cb34&&_0x32cb34[_0xb258('0x54')]===0x0){return db[_0xb258('0x25')][_0xb258('0x4e')]({'name':_0x5333cf['name'],'resourceId':_0x5333cf['id'],'type':_0x32cb34[_0xb258('0x29')],'sectionId':_0x32cb34['id']},{})[_0xb258('0x21')](function(){return _0xb8539b;});}else{return _0xb8539b;}})[_0xb258('0x42')](function(_0x2b557e){logger[_0xb258('0x27')](_0xb258('0x55'),_0x2b557e);throw _0x2b557e;});}return _0xb8539b;})[_0xb258('0x21')](respondWithResult(_0x16f6bb,0xc9))['catch'](handleError(_0x16f6bb,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e814745..6425379 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 _0xb6e6=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x2e1fe2,_0x4dc62a){var _0x4d7447=function(_0x5f1896){while(--_0x5f1896){_0x2e1fe2['push'](_0x2e1fe2['shift']());}};_0x4d7447(++_0x4dc62a);}(_0xb6e6,0xbf));var _0x6b6e=function(_0x2ff6ea,_0x4e373a){_0x2ff6ea=_0x2ff6ea-0x0;var _0x24a11c=_0xb6e6[_0x2ff6ea];return _0x24a11c;};'use strict';var _=require(_0x6b6e('0x0'));var util=require('util');var logger=require(_0x6b6e('0x1'))(_0x6b6e('0x2'));var moment=require(_0x6b6e('0x3'));var BPromise=require(_0x6b6e('0x4'));var rp=require(_0x6b6e('0x5'));var fs=require('fs');var path=require(_0x6b6e('0x6'));var rimraf=require(_0x6b6e('0x7'));var config=require(_0x6b6e('0x8'));var attributes=require(_0x6b6e('0x9'));module[_0x6b6e('0xa')]=function(_0x319018,_0x29ab81){return _0x319018[_0x6b6e('0xb')](_0x6b6e('0xc'),attributes,{'tableName':_0x6b6e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b6e('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8eef=['moment','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x373ac3,_0x4d7851){var _0x11b344=function(_0x40caff){while(--_0x40caff){_0x373ac3['push'](_0x373ac3['shift']());}};_0x11b344(++_0x4d7851);}(_0x8eef,0xb2));var _0xf8ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8eef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf8ee('0x0'));var util=require(_0xf8ee('0x1'));var logger=require(_0xf8ee('0x2'))(_0xf8ee('0x3'));var moment=require(_0xf8ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xf8ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ee('0x6'));var config=require('../../config/environment');var attributes=require(_0xf8ee('0x7'));module[_0xf8ee('0x8')]=function(_0x5cb281,_0x3c8258){return _0x5cb281[_0xf8ee('0x9')](_0xf8ee('0xa'),attributes,{'tableName':_0xf8ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ee('0xc'),'collate':_0xf8ee('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a002664..92aa659 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(_0x586128,_0x223852){var _0x8acfc6=function(_0x274d7c){while(--_0x274d7c){_0x586128['push'](_0x586128['shift']());}};_0x8acfc6(++_0x223852);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x35bd13,_0x50086d){var _0x4ee8a0=function(_0x566bd6){while(--_0x566bd6){_0x35bd13['push'](_0x35bd13['shift']());}};_0x4ee8a0(++_0x50086d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 cb8f917..0b68d26 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 _0x382c=['post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show'];(function(_0x3744ba,_0x5e13bc){var _0x21e749=function(_0xf88887){while(--_0xf88887){_0x3744ba['push'](_0x3744ba['shift']());}};_0x21e749(++_0x5e13bc);}(_0x382c,0x126));var _0xc382=function(_0x3a604a,_0x1b5e07){_0x3a604a=_0x3a604a-0x0;var _0xde7ac9=_0x382c[_0x3a604a];return _0xde7ac9;};'use strict';var multer=require(_0xc382('0x0'));var util=require('util');var path=require(_0xc382('0x1'));var timeout=require(_0xc382('0x2'));var express=require(_0xc382('0x3'));var router=express['Router']();var fs_extra=require(_0xc382('0x4'));var auth=require(_0xc382('0x5'));var interaction=require(_0xc382('0x6'));var config=require('../../config/environment');var controller=require(_0xc382('0x7'));router[_0xc382('0x8')]('/',auth[_0xc382('0x9')](),controller['index']);router[_0xc382('0x8')](_0xc382('0xa'),auth['isAuthenticated'](),controller[_0xc382('0xb')]);router[_0xc382('0xc')]('/',auth['isAuthenticated'](),controller[_0xc382('0xd')]);router[_0xc382('0xe')](_0xc382('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc382('0xf')]('/:id',auth[_0xc382('0x9')](),controller[_0xc382('0x10')]);module[_0xc382('0x11')]=router;
\ No newline at end of file
+var _0x1824=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xb6b5b4,_0x174061){var _0x1187a6=function(_0x59ba44){while(--_0x59ba44){_0xb6b5b4['push'](_0xb6b5b4['shift']());}};_0x1187a6(++_0x174061);}(_0x1824,0x1b3));var _0x4182=function(_0x31045e,_0x39f65a){_0x31045e=_0x31045e-0x0;var _0x3a31b1=_0x1824[_0x31045e];return _0x3a31b1;};'use strict';var multer=require('multer');var util=require(_0x4182('0x0'));var path=require('path');var timeout=require(_0x4182('0x1'));var express=require(_0x4182('0x2'));var router=express[_0x4182('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4182('0x4'));var interaction=require(_0x4182('0x5'));var config=require(_0x4182('0x6'));var controller=require(_0x4182('0x7'));router[_0x4182('0x8')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xa')]);router[_0x4182('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4182('0xb')]);router[_0x4182('0xc')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xd')]);router[_0x4182('0xe')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x10')]);router[_0x4182('0x11')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x12')]);module[_0x4182('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 9e6d31f..daf1a28 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 _0x0f61=['INTEGER','exports','STRING'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0x0f61,0xa6));var _0x10f6=function(_0x2a2dfc,_0x33b59c){_0x2a2dfc=_0x2a2dfc-0x0;var _0x124c3f=_0x0f61[_0x2a2dfc];return _0x124c3f;};'use strict';var Sequelize=require('sequelize');module[_0x10f6('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x10f6('0x1')]},'src':{'type':Sequelize[_0x10f6('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x10f6('0x1')]},'channel':{'type':Sequelize[_0x10f6('0x1')]},'dstchannel':{'type':Sequelize[_0x10f6('0x1')]},'lastapp':{'type':Sequelize[_0x10f6('0x1')]},'lastdata':{'type':Sequelize[_0x10f6('0x1')]},'duration':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x10f6('0x1')]},'amaflags':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x10f6('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x10f6('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x10f6('0x1')]},'peeraccount':{'type':Sequelize[_0x10f6('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x10f6('0x1')]}};
\ No newline at end of file
+var _0x765e=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1246ea,_0x5e9190){var _0x486c50=function(_0x20fa12){while(--_0x20fa12){_0x1246ea['push'](_0x1246ea['shift']());}};_0x486c50(++_0x5e9190);}(_0x765e,0x131));var _0xe765=function(_0x13082,_0x3a8a83){_0x13082=_0x13082-0x0;var _0x415358=_0x765e[_0x13082];return _0x415358;};'use strict';var Sequelize=require(_0xe765('0x0'));module[_0xe765('0x1')]={'calldate':{'type':Sequelize[_0xe765('0x2')],'allowNull':![],'defaultValue':_0xe765('0x3')},'clid':{'type':Sequelize[_0xe765('0x4')]},'src':{'type':Sequelize[_0xe765('0x4')]},'dst':{'type':Sequelize[_0xe765('0x4')]},'dcontext':{'type':Sequelize[_0xe765('0x4')]},'channel':{'type':Sequelize[_0xe765('0x4')]},'dstchannel':{'type':Sequelize[_0xe765('0x4')]},'lastapp':{'type':Sequelize[_0xe765('0x4')]},'lastdata':{'type':Sequelize[_0xe765('0x4')]},'duration':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe765('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe765('0x4')]},'userfield':{'type':Sequelize[_0xe765('0x4')]},'uniqueid':{'type':Sequelize[_0xe765('0x4')]},'linkedid':{'type':Sequelize[_0xe765('0x4')]},'sequence':{'type':Sequelize[_0xe765('0x4')]},'peeraccount':{'type':Sequelize[_0xe765('0x4')]},'type':{'type':Sequelize[_0xe765('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 72a6ff4..fad15c8 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 _0x8ce1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x8ce1,0x183));var _0x18ce=function(_0x489c86,_0x3b80e5){_0x489c86=_0x489c86-0x0;var _0x4ee191=_0x8ce1[_0x489c86];return _0x4ee191;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require(_0x18ce('0x7'));var util=require(_0x18ce('0x8'));var path=require(_0x18ce('0x9'));var sox=require(_0x18ce('0xa'));var csv=require(_0x18ce('0xb'));var ejs=require(_0x18ce('0xc'));var fs=require('fs');var fs_extra=require(_0x18ce('0xd'));var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xb'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var licenseUtil=require(_0x18ce('0x1a'));var db=require(_0x18ce('0x1b'))['db'];function respondWithStatusCode(_0x5e8c23,_0xbd514b){_0xbd514b=_0xbd514b||0xcc;return function(_0x402ba4){if(_0x402ba4){return _0x5e8c23[_0x18ce('0x1c')](_0xbd514b);}return _0x5e8c23[_0x18ce('0x1d')](_0xbd514b)[_0x18ce('0x1e')]();};}function respondWithResult(_0x5daf04,_0x176797){_0x176797=_0x176797||0xc8;return function(_0xdd4626){if(_0xdd4626){return _0x5daf04[_0x18ce('0x1d')](_0x176797)[_0x18ce('0x1f')](_0xdd4626);}};}function respondWithFilteredResult(_0x46e346,_0x36b5da){return function(_0x17460e){if(_0x17460e){var _0x4a934f=typeof _0x36b5da[_0x18ce('0x20')]===_0x18ce('0x21')&&typeof _0x36b5da[_0x18ce('0x22')]===_0x18ce('0x21');var _0x1edc10=_0x17460e[_0x18ce('0x23')];var _0x482458=_0x4a934f?0x0:_0x36b5da[_0x18ce('0x20')];var _0x29c691=_0x4a934f?_0x17460e[_0x18ce('0x23')]:_0x36b5da['offset']+_0x36b5da[_0x18ce('0x22')];var _0x2fa3d4;if(_0x29c691>=_0x1edc10){_0x29c691=_0x1edc10;_0x2fa3d4=0xc8;}else{_0x2fa3d4=0xce;}_0x46e346[_0x18ce('0x1d')](_0x2fa3d4);return _0x46e346['set'](_0x18ce('0x24'),_0x482458+'-'+_0x29c691+'/'+_0x1edc10)[_0x18ce('0x1f')](_0x17460e);}return null;};}function patchUpdates(_0x5d22cd){return function(_0x29c1ab){try{jsonpatch[_0x18ce('0x25')](_0x29c1ab,_0x5d22cd,!![]);}catch(_0x16802e){return BPromise[_0x18ce('0x26')](_0x16802e);}return _0x29c1ab[_0x18ce('0x27')]();};}function saveUpdates(_0xd41f29,_0x35abf9){return function(_0x545459){if(_0x545459){return _0x545459[_0x18ce('0x28')](_0xd41f29)['then'](function(_0x482c90){return _0x482c90;});}return null;};}function removeEntity(_0x5d2299,_0x32e910){return function(_0x576ecc){if(_0x576ecc){return _0x576ecc[_0x18ce('0x29')]()[_0x18ce('0x2a')](function(){_0x5d2299[_0x18ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53abbd,_0x55e17c){return function(_0x317812){if(!_0x317812){_0x53abbd[_0x18ce('0x1c')](0x194);}return _0x317812;};}function handleError(_0x12dbd2,_0x461113){_0x461113=_0x461113||0x1f4;return function(_0x62b2bd){logger[_0x18ce('0x2b')](_0x62b2bd['stack']);if(_0x62b2bd['name']){delete _0x62b2bd['name'];}_0x12dbd2[_0x18ce('0x1d')](_0x461113)[_0x18ce('0x2c')](_0x62b2bd);};}exports[_0x18ce('0x2d')]=function(_0x5f3ec2,_0x1a87f6){var _0xf2683f={},_0x1988e4={},_0x5ef96c={'count':0x0,'rows':[]};var _0x56d296=_['map'](db[_0x18ce('0x2e')][_0x18ce('0x2f')],function(_0x5c2d96){return{'name':_0x5c2d96['fieldName'],'type':_0x5c2d96[_0x18ce('0x30')][_0x18ce('0x31')]};});_0x1988e4[_0x18ce('0x32')]=_['map'](_0x56d296,'name');_0x1988e4[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x5f3ec2[_0x18ce('0x33')]);_0x1988e4[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x1988e4[_0x18ce('0x32')],_0x1988e4[_0x18ce('0x33')]);_0xf2683f[_0x18ce('0x37')]=_['intersection'](_0x1988e4['model'],qs[_0x18ce('0x38')](_0x5f3ec2[_0x18ce('0x33')]['fields']));_0xf2683f[_0x18ce('0x37')]=_0xf2683f['attributes'][_0x18ce('0x39')]?_0xf2683f['attributes']:_0x1988e4[_0x18ce('0x32')];if(!_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3a')]('nolimit')){_0xf2683f['limit']=qs[_0x18ce('0x22')](_0x5f3ec2[_0x18ce('0x33')]['limit']);_0xf2683f['offset']=qs[_0x18ce('0x20')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x20')]);}_0xf2683f[_0x18ce('0x3b')]=qs[_0x18ce('0x3c')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3c')]);_0xf2683f[_0x18ce('0x3d')]=qs[_0x18ce('0x35')](_[_0x18ce('0x3e')](_0x5f3ec2[_0x18ce('0x33')],_0x1988e4[_0x18ce('0x35')]),_0x56d296);if(_0x5f3ec2[_0x18ce('0x33')]['filter']){_0xf2683f[_0x18ce('0x3d')]=_[_0x18ce('0x3f')](_0xf2683f[_0x18ce('0x3d')],{'$or':_[_0x18ce('0x40')](_0x56d296,function(_0x1e67dd){if(_0x1e67dd[_0x18ce('0x30')]!==_0x18ce('0x41')){var _0x27c55a={};_0x27c55a[_0x1e67dd[_0x18ce('0x42')]]={'$like':'%'+_0x5f3ec2[_0x18ce('0x33')]['filter']+'%'};return _0x27c55a;}})});}_0xf2683f=_['merge']({},_0xf2683f,_0x5f3ec2[_0x18ce('0x43')]);var _0x23486c={'where':_0xf2683f[_0x18ce('0x3d')]};return db[_0x18ce('0x2e')][_0x18ce('0x23')](_0x23486c)[_0x18ce('0x2a')](function(_0x2eba88){_0x5ef96c['count']=_0x2eba88;if(_0x5f3ec2['query'][_0x18ce('0x44')]){_0xf2683f[_0x18ce('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x18ce('0x46')](_0xf2683f);})[_0x18ce('0x2a')](function(_0x2941ce){_0x5ef96c[_0x18ce('0x47')]=_0x2941ce;return _0x5ef96c;})[_0x18ce('0x2a')](respondWithFilteredResult(_0x1a87f6,_0xf2683f))[_0x18ce('0x48')](handleError(_0x1a87f6,null));};exports[_0x18ce('0x49')]=function(_0x2a96a7,_0x33b409){var _0x1d6d5f={'raw':!![],'where':{'id':_0x2a96a7[_0x18ce('0x4a')]['id']}},_0x3885e6={};_0x3885e6['model']=_[_0x18ce('0x34')](db[_0x18ce('0x2e')][_0x18ce('0x2f')]);_0x3885e6[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x2a96a7[_0x18ce('0x33')]);_0x3885e6[_0x18ce('0x35')]=_['intersection'](_0x3885e6['model'],_0x3885e6[_0x18ce('0x33')]);_0x1d6d5f[_0x18ce('0x37')]=_[_0x18ce('0x36')](_0x3885e6[_0x18ce('0x32')],qs['fields'](_0x2a96a7[_0x18ce('0x33')][_0x18ce('0x38')]));_0x1d6d5f[_0x18ce('0x37')]=_0x1d6d5f['attributes']['length']?_0x1d6d5f[_0x18ce('0x37')]:_0x3885e6[_0x18ce('0x32')];if(_0x2a96a7['query'][_0x18ce('0x44')]){_0x1d6d5f[_0x18ce('0x45')]=[{'all':!![]}];}_0x1d6d5f=_[_0x18ce('0x3f')]({},_0x1d6d5f,_0x2a96a7[_0x18ce('0x43')]);return db[_0x18ce('0x2e')][_0x18ce('0x4b')](_0x1d6d5f)[_0x18ce('0x2a')](handleEntityNotFound(_0x33b409,null))['then'](respondWithResult(_0x33b409,null))[_0x18ce('0x48')](handleError(_0x33b409,null));};exports[_0x18ce('0x4c')]=function(_0x476c6a,_0x1e445d){return db[_0x18ce('0x2e')][_0x18ce('0x4c')](_0x476c6a[_0x18ce('0x4d')],{})[_0x18ce('0x2a')](respondWithResult(_0x1e445d,0xc9))[_0x18ce('0x48')](handleError(_0x1e445d,null));};exports[_0x18ce('0x28')]=function(_0x1211d0,_0x3f9960){if(_0x1211d0[_0x18ce('0x4d')]['id']){delete _0x1211d0[_0x18ce('0x4d')]['id'];}return db['Cdr'][_0x18ce('0x4b')]({'where':{'id':_0x1211d0[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f9960,null))[_0x18ce('0x2a')](saveUpdates(_0x1211d0['body'],null))[_0x18ce('0x2a')](respondWithResult(_0x3f9960,null))['catch'](handleError(_0x3f9960,null));};exports[_0x18ce('0x29')]=function(_0x188f57,_0x3d5b1b){return db[_0x18ce('0x2e')]['find']({'where':{'id':_0x188f57[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d5b1b,null))['then'](removeEntity(_0x3d5b1b,null))[_0x18ce('0x48')](handleError(_0x3d5b1b,null));};exports[_0x18ce('0x4e')]=function(_0x8aa4a7,_0x5f164a){return db['Cdr'][_0x18ce('0x4e')]()[_0x18ce('0x2a')](respondWithResult(_0x5f164a,null))[_0x18ce('0x48')](handleError(_0x5f164a,null));};
\ No newline at end of file
+var _0x5fc3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','Cdr','fieldName','type','model','query','keys','filters'];(function(_0x2b5a7c,_0x223e71){var _0x1a407c=function(_0x341466){while(--_0x341466){_0x2b5a7c['push'](_0x2b5a7c['shift']());}};_0x1a407c(++_0x223e71);}(_0x5fc3,0xa8));var _0x35fc=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x5fc3[_0x334599];return _0x4cdff2;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26'));_0x9f3c8a[_0x35fc('0x2d')]=_[_0x35fc('0x2e')](_0x26b7cb[_0x35fc('0x2d')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x9f3c8a[_0x35fc('0x2c')],_0x9f3c8a[_0x35fc('0x2d')]);_0x383837['attributes']=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs['fields'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x31')]));_0x383837[_0x35fc('0x32')]=_0x383837[_0x35fc('0x32')][_0x35fc('0x33')]?_0x383837[_0x35fc('0x32')]:_0x9f3c8a['model'];if(!_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x34')](_0x35fc('0x35'))){_0x383837[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x26b7cb[_0x35fc('0x2d')]['limit']);_0x383837[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x26b7cb[_0x35fc('0x2d')]['offset']);}_0x383837[_0x35fc('0x36')]=qs['sort'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x37')]);_0x383837[_0x35fc('0x38')]=qs[_0x35fc('0x2f')](_['pick'](_0x26b7cb['query'],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2d')]['filter']){_0x383837[_0x35fc('0x38')]=_['merge'](_0x383837[_0x35fc('0x38')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x2ca9ac){if(_0x2ca9ac[_0x35fc('0x2b')]!==_0x35fc('0x39')){var _0x3313fa={};_0x3313fa[_0x2ca9ac[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb['query'][_0x35fc('0x3a')]+'%'};return _0x3313fa;}})});}_0x383837=_[_0x35fc('0x3b')]({},_0x383837,_0x26b7cb['options']);var _0x1feda5={'where':_0x383837[_0x35fc('0x38')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1feda5)[_0x35fc('0x24')](function(_0x31d926){_0x3735da['count']=_0x31d926;if(_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x3c')]){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x35fc('0x3e')](_0x383837);})[_0x35fc('0x24')](function(_0x596919){_0x3735da[_0x35fc('0x3f')]=_0x596919;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x40')](handleError(_0x645eac,null));};exports[_0x35fc('0x41')]=function(_0x331439,_0x2a1cf6){var _0x211b70={'raw':!![],'where':{'id':_0x331439['params']['id']}},_0x3ec51f={};_0x3ec51f['model']=_[_0x35fc('0x2e')](db[_0x35fc('0x29')]['rawAttributes']);_0x3ec51f['query']=_['keys'](_0x331439[_0x35fc('0x2d')]);_0x3ec51f[_0x35fc('0x2f')]=_['intersection'](_0x3ec51f[_0x35fc('0x2c')],_0x3ec51f[_0x35fc('0x2d')]);_0x211b70[_0x35fc('0x32')]=_[_0x35fc('0x30')](_0x3ec51f['model'],qs['fields'](_0x331439['query']['fields']));_0x211b70['attributes']=_0x211b70[_0x35fc('0x32')][_0x35fc('0x33')]?_0x211b70['attributes']:_0x3ec51f[_0x35fc('0x2c')];if(_0x331439['query'][_0x35fc('0x3c')]){_0x211b70[_0x35fc('0x3d')]=[{'all':!![]}];}_0x211b70=_[_0x35fc('0x3b')]({},_0x211b70,_0x331439[_0x35fc('0x42')]);return db[_0x35fc('0x29')]['find'](_0x211b70)[_0x35fc('0x24')](handleEntityNotFound(_0x2a1cf6,null))[_0x35fc('0x24')](respondWithResult(_0x2a1cf6,null))['catch'](handleError(_0x2a1cf6,null));};exports[_0x35fc('0x43')]=function(_0x298b7b,_0x2a8a09){return db[_0x35fc('0x29')]['create'](_0x298b7b[_0x35fc('0x44')],{})['then'](respondWithResult(_0x2a8a09,0xc9))['catch'](handleError(_0x2a8a09,null));};exports[_0x35fc('0x23')]=function(_0x9db7e8,_0x18dc78){if(_0x9db7e8[_0x35fc('0x44')]['id']){delete _0x9db7e8[_0x35fc('0x44')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x9db7e8[_0x35fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x24')](saveUpdates(_0x9db7e8[_0x35fc('0x44')],null))[_0x35fc('0x24')](respondWithResult(_0x18dc78,null))[_0x35fc('0x40')](handleError(_0x18dc78,null));};exports[_0x35fc('0x25')]=function(_0x1e3221,_0x1b8229){return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x1e3221[_0x35fc('0x46')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x1b8229,null))[_0x35fc('0x24')](removeEntity(_0x1b8229,null))[_0x35fc('0x40')](handleError(_0x1b8229,null));};exports[_0x35fc('0x47')]=function(_0x59c666,_0x553ed6){return db[_0x35fc('0x29')][_0x35fc('0x47')]()[_0x35fc('0x24')](respondWithResult(_0x553ed6,null))[_0x35fc('0x40')](handleError(_0x553ed6,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f194d4a..e40201d 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4a7f34,_0x246929){var _0x5b0d32=function(_0x4ae36d){while(--_0x4ae36d){_0x4a7f34['push'](_0x4a7f34['shift']());}};_0x5b0d32(++_0x246929);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x54b82a,_0x3ea2d3){var _0x3447ed=function(_0x3e0a42){while(--_0x3e0a42){_0x54b82a['push'](_0x54b82a['shift']());}};_0x3447ed(++_0x3ea2d3);}(_0x7a54,0x106));var _0x47a5=function(_0x2b987c,_0x17b58e){_0x2b987c=_0x2b987c-0x0;var _0x258c25=_0x7a54[_0x2b987c];return _0x258c25;};'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 0c886d4..4bdf7ca 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 _0xee51=['debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1964eb,_0x5bb316){var _0x2c74c3=function(_0x55e8e6){while(--_0x55e8e6){_0x1964eb['push'](_0x1964eb['shift']());}};_0x2c74c3(++_0x5bb316);}(_0xee51,0x16e));var _0x1ee5=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0xee51[_0x2867a6];return _0x4afc2b;};'use strict';var _=require(_0x1ee5('0x0'));var util=require(_0x1ee5('0x1'));var moment=require(_0x1ee5('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ee5('0x3'));var fs=require('fs');var Redis=require(_0x1ee5('0x4'));var db=require(_0x1ee5('0x5'))['db'];var utils=require(_0x1ee5('0x6'));var logger=require(_0x1ee5('0x7'))('rpc');var config=require(_0x1ee5('0x8'));var jayson=require(_0x1ee5('0x9'));var client=jayson[_0x1ee5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58d3a1,_0x5c4a7d,_0x4564da){return new BPromise(function(_0x50709b,_0x413dcd){return client[_0x1ee5('0xb')](_0x58d3a1,_0x4564da)['then'](function(_0x413c96){logger['info'](_0x1ee5('0xc'),_0x5c4a7d,_0x1ee5('0xd'));logger[_0x1ee5('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5c4a7d,_0x1ee5('0xd'),JSON[_0x1ee5('0xf')](_0x413c96));if(_0x413c96[_0x1ee5('0x10')]){if(_0x413c96['error'][_0x1ee5('0x11')]===0x1f4){logger[_0x1ee5('0x10')](_0x1ee5('0xc'),_0x5c4a7d,_0x413c96[_0x1ee5('0x10')][_0x1ee5('0x12')]);return _0x413dcd(_0x413c96[_0x1ee5('0x10')]['message']);}logger[_0x1ee5('0x10')](_0x1ee5('0xc'),_0x5c4a7d,_0x413c96['error'][_0x1ee5('0x12')]);return _0x50709b(_0x413c96[_0x1ee5('0x10')]['message']);}else{logger['info'](_0x1ee5('0xc'),_0x5c4a7d,_0x1ee5('0xd'));_0x50709b(_0x413c96[_0x1ee5('0x13')][_0x1ee5('0x12')]);}})['catch'](function(_0x26a781){logger[_0x1ee5('0x10')]('Cdr,\x20%s,\x20%s',_0x5c4a7d,_0x26a781);_0x413dcd(_0x26a781);});});}
\ No newline at end of file
+var _0xf8f7=['Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x565472,_0x56f47){var _0x34d5ef=function(_0x2150f6){while(--_0x2150f6){_0x565472['push'](_0x565472['shift']());}};_0x34d5ef(++_0x56f47);}(_0xf8f7,0x163));var _0x7f8f=function(_0x32a3d4,_0x2779f1){_0x32a3d4=_0x32a3d4-0x0;var _0x332a6f=_0xf8f7[_0x32a3d4];return _0x332a6f;};'use strict';var _=require('lodash');var util=require(_0x7f8f('0x0'));var moment=require('moment');var BPromise=require(_0x7f8f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f8f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f8f('0x3'));var logger=require(_0x7f8f('0x4'))(_0x7f8f('0x5'));var config=require(_0x7f8f('0x6'));var jayson=require(_0x7f8f('0x7'));var client=jayson[_0x7f8f('0x8')][_0x7f8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53a4c4,_0x7e95d1,_0x1ed517){return new BPromise(function(_0x3aa327,_0x1c2284){return client[_0x7f8f('0xa')](_0x53a4c4,_0x1ed517)[_0x7f8f('0xb')](function(_0x224f52){logger[_0x7f8f('0xc')](_0x7f8f('0xd'),_0x7e95d1,'request\x20sent');logger[_0x7f8f('0xe')](_0x7f8f('0xf'),_0x7e95d1,_0x7f8f('0x10'),JSON[_0x7f8f('0x11')](_0x224f52));if(_0x224f52[_0x7f8f('0x12')]){if(_0x224f52['error'][_0x7f8f('0x13')]===0x1f4){logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);return _0x1c2284(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52['error'][_0x7f8f('0x14')]);return _0x3aa327(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}else{logger['info'](_0x7f8f('0xd'),_0x7e95d1,_0x7f8f('0x10'));_0x3aa327(_0x224f52[_0x7f8f('0x15')][_0x7f8f('0x14')]);}})[_0x7f8f('0x16')](function(_0x3c0b71){logger['error']('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x3c0b71);_0x1c2284(_0x3c0b71);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3879ae0..cc883db 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x40c5e0,_0x3b77ad){var _0x47ee12=function(_0x3c7009){while(--_0x3c7009){_0x40c5e0['push'](_0x40c5e0['shift']());}};_0x47ee12(++_0x3b77ad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x524021,_0x25d5ea){var _0x269c3e=function(_0x2418a5){while(--_0x2418a5){_0x524021['push'](_0x524021['shift']());}};_0x269c3e(++_0x25d5ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b1b36c1..45eed2f 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 _0x1790=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x48d7a0,_0x1e2ba8){var _0x28a502=function(_0x3dc381){while(--_0x3dc381){_0x48d7a0['push'](_0x48d7a0['shift']());}};_0x28a502(++_0x1e2ba8);}(_0x1790,0x1a4));var _0x0179=function(_0x522279,_0x385259){_0x522279=_0x522279-0x0;var _0x477f7c=_0x1790[_0x522279];return _0x477f7c;};'use strict';var Sequelize=require('sequelize');module[_0x0179('0x0')]={'priority':{'type':Sequelize[_0x0179('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0179('0x2')],'allowNull':![],'defaultValue':_0x0179('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0179('0x2')],'defaultValue':_0x0179('0x4')}};
\ No newline at end of file
+var _0x2dfb=['TEXT','STRING','exports','INTEGER','noop'];(function(_0x39f3dc,_0x535b20){var _0x1362af=function(_0x4d4870){while(--_0x4d4870){_0x39f3dc['push'](_0x39f3dc['shift']());}};_0x1362af(++_0x535b20);}(_0x2dfb,0x16f));var _0xb2df=function(_0xbf84f7,_0x26643b){_0xbf84f7=_0xbf84f7-0x0;var _0x55ef36=_0x2dfb[_0xbf84f7];return _0x55ef36;};'use strict';var Sequelize=require('sequelize');module[_0xb2df('0x0')]={'priority':{'type':Sequelize[_0xb2df('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2df('0x2')},'appdata':{'type':Sequelize[_0xb2df('0x3')]()},'description':{'type':Sequelize[_0xb2df('0x4')]},'interval':{'type':Sequelize[_0xb2df('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2181d21..1f6b6c8 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 _0x85b5=['attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','params','destroy','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','show','model','keys','rawAttributes','query','filters','intersection'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x85b5,0x7f));var _0x585b=function(_0x190f8e,_0x4919b9){_0x190f8e=_0x190f8e-0x0;var _0x11819f=_0x85b5[_0x190f8e];return _0x11819f;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={'raw':!![],'where':{'id':_0x205ffe['params']['id']}},_0x5dad9a={};_0x5dad9a[_0x585b('0x26')]=_[_0x585b('0x27')](db['ChatApplication'][_0x585b('0x28')]);_0x5dad9a[_0x585b('0x29')]=_['keys'](_0x205ffe[_0x585b('0x29')]);_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],_0x5dad9a[_0x585b('0x29')]);_0x2cf48a[_0x585b('0x2c')]=_[_0x585b('0x2b')](_0x5dad9a[_0x585b('0x26')],qs[_0x585b('0x2d')](_0x205ffe[_0x585b('0x29')]['fields']));_0x2cf48a[_0x585b('0x2c')]=_0x2cf48a[_0x585b('0x2c')][_0x585b('0x2e')]?_0x2cf48a['attributes']:_0x5dad9a[_0x585b('0x26')];if(_0x205ffe[_0x585b('0x29')][_0x585b('0x2f')]){_0x2cf48a['include']=[{'all':!![]}];}_0x2cf48a=_[_0x585b('0x30')]({},_0x2cf48a,_0x205ffe[_0x585b('0x31')]);return db[_0x585b('0x32')][_0x585b('0x33')](_0x2cf48a)['then'](handleEntityNotFound(_0x19786,null))['then'](respondWithResult(_0x19786,null))[_0x585b('0x34')](handleError(_0x19786,null));};exports[_0x585b('0x35')]=function(_0x411914,_0x31918f){if(_0x411914[_0x585b('0x36')]['id']){delete _0x411914['body']['id'];}return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x411914[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x31918f,null))[_0x585b('0x20')](saveUpdates(_0x411914['body'],null))['then'](respondWithResult(_0x31918f,null))['catch'](handleError(_0x31918f,null));};exports[_0x585b('0x38')]=function(_0x199e54,_0x2c4b9f){return db[_0x585b('0x32')][_0x585b('0x33')]({'where':{'id':_0x199e54[_0x585b('0x37')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x2c4b9f,null))[_0x585b('0x20')](removeEntity(_0x2c4b9f,null))[_0x585b('0x34')](handleError(_0x2c4b9f,null));};
\ No newline at end of file
+var _0x5f6a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','update','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','name','send'];(function(_0xa149e2,_0x571fff){var _0x556c0c=function(_0x5aca0a){while(--_0x5aca0a){_0xa149e2['push'](_0xa149e2['shift']());}};_0x556c0c(++_0x571fff);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x2a4cdc,_0x45c9cb){_0x2a4cdc=_0x2a4cdc-0x0;var _0x14de55=_0x5f6a[_0x2a4cdc];return _0x14de55;};'use strict';var emlformat=require(_0xa5f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f6('0x1'));var rp=require(_0xa5f6('0x2'));var moment=require(_0xa5f6('0x3'));var BPromise=require(_0xa5f6('0x4'));var Mustache=require('mustache');var util=require(_0xa5f6('0x5'));var path=require(_0xa5f6('0x6'));var sox=require(_0xa5f6('0x7'));var csv=require(_0xa5f6('0x8'));var ejs=require(_0xa5f6('0x9'));var fs=require('fs');var fs_extra=require(_0xa5f6('0xa'));var _=require(_0xa5f6('0xb'));var squel=require(_0xa5f6('0xc'));var crypto=require(_0xa5f6('0xd'));var jsforce=require(_0xa5f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5f6('0xf'));var Redis=require(_0xa5f6('0x10'));var authService=require(_0xa5f6('0x11'));var qs=require(_0xa5f6('0x12'));var as=require(_0xa5f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5f6('0x14'))(_0xa5f6('0x15'));var utils=require('../../config/utils');var config=require(_0xa5f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5f6('0x17'))['db'];function respondWithStatusCode(_0x483f66,_0x13c988){_0x13c988=_0x13c988||0xcc;return function(_0xc8eb34){if(_0xc8eb34){return _0x483f66['sendStatus'](_0x13c988);}return _0x483f66[_0xa5f6('0x18')](_0x13c988)[_0xa5f6('0x19')]();};}function respondWithResult(_0x2919fd,_0xd8faf3){_0xd8faf3=_0xd8faf3||0xc8;return function(_0x5c507e){if(_0x5c507e){return _0x2919fd[_0xa5f6('0x18')](_0xd8faf3)[_0xa5f6('0x1a')](_0x5c507e);}};}function respondWithFilteredResult(_0x17f7f7,_0x5dc17b){return function(_0x3b4780){if(_0x3b4780){var _0x3b2b23=typeof _0x5dc17b[_0xa5f6('0x1b')]===_0xa5f6('0x1c')&&typeof _0x5dc17b[_0xa5f6('0x1d')]==='undefined';var _0x2cc215=_0x3b4780[_0xa5f6('0x1e')];var _0x4ee2cc=_0x3b2b23?0x0:_0x5dc17b[_0xa5f6('0x1b')];var _0x20f35d=_0x3b2b23?_0x3b4780[_0xa5f6('0x1e')]:_0x5dc17b['offset']+_0x5dc17b['limit'];var _0x57a416;if(_0x20f35d>=_0x2cc215){_0x20f35d=_0x2cc215;_0x57a416=0xc8;}else{_0x57a416=0xce;}_0x17f7f7[_0xa5f6('0x18')](_0x57a416);return _0x17f7f7['set'](_0xa5f6('0x1f'),_0x4ee2cc+'-'+_0x20f35d+'/'+_0x2cc215)[_0xa5f6('0x1a')](_0x3b4780);}return null;};}function patchUpdates(_0x29f8fb){return function(_0x5b2a48){try{jsonpatch[_0xa5f6('0x20')](_0x5b2a48,_0x29f8fb,!![]);}catch(_0x55f457){return BPromise[_0xa5f6('0x21')](_0x55f457);}return _0x5b2a48[_0xa5f6('0x22')]();};}function saveUpdates(_0x30caba,_0x471628){return function(_0x37ff20){if(_0x37ff20){return _0x37ff20['update'](_0x30caba)['then'](function(_0x41b66b){return _0x41b66b;});}return null;};}function removeEntity(_0x49e609,_0x4441cc){return function(_0x50e9ba){if(_0x50e9ba){return _0x50e9ba[_0xa5f6('0x23')]()[_0xa5f6('0x24')](function(){_0x49e609[_0xa5f6('0x18')](0xcc)[_0xa5f6('0x19')]();});}};}function handleEntityNotFound(_0x3ef9fb,_0x220992){return function(_0x7613c4){if(!_0x7613c4){_0x3ef9fb[_0xa5f6('0x25')](0x194);}return _0x7613c4;};}function handleError(_0x1c08d3,_0x1ded63){_0x1ded63=_0x1ded63||0x1f4;return function(_0x1e02d9){logger['error'](_0x1e02d9['stack']);if(_0x1e02d9[_0xa5f6('0x26')]){delete _0x1e02d9[_0xa5f6('0x26')];}_0x1c08d3[_0xa5f6('0x18')](_0x1ded63)[_0xa5f6('0x27')](_0x1e02d9);};}exports[_0xa5f6('0x28')]=function(_0x8cab41,_0x5ac06e){var _0x273192={'raw':!![],'where':{'id':_0x8cab41[_0xa5f6('0x29')]['id']}},_0x43fe1d={};_0x43fe1d[_0xa5f6('0x2a')]=_[_0xa5f6('0x2b')](db[_0xa5f6('0x2c')][_0xa5f6('0x2d')]);_0x43fe1d[_0xa5f6('0x2e')]=_['keys'](_0x8cab41[_0xa5f6('0x2e')]);_0x43fe1d[_0xa5f6('0x2f')]=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],_0x43fe1d[_0xa5f6('0x2e')]);_0x273192['attributes']=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],qs[_0xa5f6('0x31')](_0x8cab41['query'][_0xa5f6('0x31')]));_0x273192[_0xa5f6('0x32')]=_0x273192[_0xa5f6('0x32')][_0xa5f6('0x33')]?_0x273192[_0xa5f6('0x32')]:_0x43fe1d['model'];if(_0x8cab41[_0xa5f6('0x2e')][_0xa5f6('0x34')]){_0x273192[_0xa5f6('0x35')]=[{'all':!![]}];}_0x273192=_[_0xa5f6('0x36')]({},_0x273192,_0x8cab41['options']);return db[_0xa5f6('0x2c')][_0xa5f6('0x37')](_0x273192)[_0xa5f6('0x24')](handleEntityNotFound(_0x5ac06e,null))[_0xa5f6('0x24')](respondWithResult(_0x5ac06e,null))['catch'](handleError(_0x5ac06e,null));};exports[_0xa5f6('0x38')]=function(_0x42bba2,_0x3ff708){if(_0x42bba2[_0xa5f6('0x39')]['id']){delete _0x42bba2[_0xa5f6('0x39')]['id'];}return db[_0xa5f6('0x2c')]['find']({'where':{'id':_0x42bba2[_0xa5f6('0x29')]['id']}})['then'](handleEntityNotFound(_0x3ff708,null))[_0xa5f6('0x24')](saveUpdates(_0x42bba2['body'],null))['then'](respondWithResult(_0x3ff708,null))[_0xa5f6('0x3a')](handleError(_0x3ff708,null));};exports['destroy']=function(_0x115a73,_0x357dee){return db['ChatApplication'][_0xa5f6('0x37')]({'where':{'id':_0x115a73['params']['id']}})['then'](handleEntityNotFound(_0x357dee,null))['then'](removeEntity(_0x357dee,null))[_0xa5f6('0x3a')](handleError(_0x357dee,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 5f449b2..57c002a 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 _0x7576=['exports','chat_applications','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes'];(function(_0x59c568,_0x29bff0){var _0x48c741=function(_0xccde92){while(--_0xccde92){_0x59c568['push'](_0x59c568['shift']());}};_0x48c741(++_0x29bff0);}(_0x7576,0x1d8));var _0x6757=function(_0x144bb0,_0xfcf538){_0x144bb0=_0x144bb0-0x0;var _0x526122=_0x7576[_0x144bb0];return _0x526122;};'use strict';var _=require(_0x6757('0x0'));var util=require('util');var logger=require(_0x6757('0x1'))('api');var moment=require(_0x6757('0x2'));var BPromise=require(_0x6757('0x3'));var rp=require(_0x6757('0x4'));var fs=require('fs');var path=require(_0x6757('0x5'));var rimraf=require(_0x6757('0x6'));var config=require('../../config/environment');var attributes=require(_0x6757('0x7'));module[_0x6757('0x8')]=function(_0x217dfc,_0x1d9431){return _0x217dfc['define']('ChatApplication',attributes,{'tableName':_0x6757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3c75=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x57f2f4,_0x4addf1){var _0x4d147b=function(_0x171249){while(--_0x171249){_0x57f2f4['push'](_0x57f2f4['shift']());}};_0x4d147b(++_0x4addf1);}(_0x3c75,0xa8));var _0x53c7=function(_0x9fc983,_0xc0a1af){_0x9fc983=_0x9fc983-0x0;var _0x5d8ed9=_0x3c75[_0x9fc983];return _0x5d8ed9;};'use strict';var _=require('lodash');var util=require(_0x53c7('0x0'));var logger=require(_0x53c7('0x1'))(_0x53c7('0x2'));var moment=require(_0x53c7('0x3'));var BPromise=require(_0x53c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c7('0x5'));var rimraf=require(_0x53c7('0x6'));var config=require(_0x53c7('0x7'));var attributes=require(_0x53c7('0x8'));module[_0x53c7('0x9')]=function(_0x1c3e5a,_0x3238da){return _0x1c3e5a['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53c7('0xa'),'collate':_0x53c7('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index cb42a67..690eb6b 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 _0x8b3f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x13ca07,_0x22b8ef){var _0x48782e=function(_0x1c7850){while(--_0x1c7850){_0x13ca07['push'](_0x13ca07['shift']());}};_0x48782e(++_0x22b8ef);}(_0x8b3f,0x14c));var _0xf8b3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8b3f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf8b3('0x0'));var util=require(_0xf8b3('0x1'));var moment=require(_0xf8b3('0x2'));var BPromise=require(_0xf8b3('0x3'));var rs=require(_0xf8b3('0x4'));var fs=require('fs');var Redis=require(_0xf8b3('0x5'));var db=require(_0xf8b3('0x6'))['db'];var utils=require(_0xf8b3('0x7'));var logger=require(_0xf8b3('0x8'))('rpc');var config=require(_0xf8b3('0x9'));var jayson=require(_0xf8b3('0xa'));var client=jayson[_0xf8b3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4eb3,_0x2b2d55,_0x455ecd){return new BPromise(function(_0x41c5b7,_0x24c3b1){return client['request'](_0x4f4eb3,_0x455ecd)[_0xf8b3('0xc')](function(_0x3509b){logger[_0xf8b3('0xd')](_0xf8b3('0xe'),_0x2b2d55,_0xf8b3('0xf'));logger[_0xf8b3('0x10')](_0xf8b3('0x11'),_0x2b2d55,_0xf8b3('0xf'),JSON[_0xf8b3('0x12')](_0x3509b));if(_0x3509b[_0xf8b3('0x13')]){if(_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x14')]===0x1f4){logger[_0xf8b3('0x13')](_0xf8b3('0xe'),_0x2b2d55,_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);return _0x24c3b1(_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);}logger[_0xf8b3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2b2d55,_0x3509b[_0xf8b3('0x13')][_0xf8b3('0x15')]);return _0x41c5b7(_0x3509b[_0xf8b3('0x13')]['message']);}else{logger[_0xf8b3('0xd')](_0xf8b3('0xe'),_0x2b2d55,_0xf8b3('0xf'));_0x41c5b7(_0x3509b[_0xf8b3('0x16')][_0xf8b3('0x15')]);}})[_0xf8b3('0x17')](function(_0x5d6039){logger[_0xf8b3('0x13')](_0xf8b3('0xe'),_0x2b2d55,_0x5d6039);_0x24c3b1(_0x5d6039);});});}
\ No newline at end of file
+var _0x5c81=['request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5a5848,_0x3b8fb2){var _0x9fe6d7=function(_0x5aac17){while(--_0x5aac17){_0x5a5848['push'](_0x5a5848['shift']());}};_0x9fe6d7(++_0x3b8fb2);}(_0x5c81,0x7e));var _0x15c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c81[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x15c8('0x0'));var util=require(_0x15c8('0x1'));var moment=require(_0x15c8('0x2'));var BPromise=require(_0x15c8('0x3'));var rs=require(_0x15c8('0x4'));var fs=require('fs');var Redis=require(_0x15c8('0x5'));var db=require(_0x15c8('0x6'))['db'];var utils=require(_0x15c8('0x7'));var logger=require(_0x15c8('0x8'))(_0x15c8('0x9'));var config=require(_0x15c8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x15c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc685b0,_0x19d851,_0x39bcd9){return new BPromise(function(_0x2c0ab0,_0x3e6435){return client[_0x15c8('0xc')](_0xc685b0,_0x39bcd9)[_0x15c8('0xd')](function(_0x3bb956){logger[_0x15c8('0xe')]('ChatApplication,\x20%s,\x20%s',_0x19d851,_0x15c8('0xf'));logger[_0x15c8('0x10')](_0x15c8('0x11'),_0x19d851,_0x15c8('0xf'),JSON[_0x15c8('0x12')](_0x3bb956));if(_0x3bb956[_0x15c8('0x13')]){if(_0x3bb956['error']['code']===0x1f4){logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);return _0x3e6435(_0x3bb956[_0x15c8('0x13')]['message']);}logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')]['message']);return _0x2c0ab0(_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);}else{logger[_0x15c8('0xe')](_0x15c8('0x14'),_0x19d851,_0x15c8('0xf'));_0x2c0ab0(_0x3bb956[_0x15c8('0x16')][_0x15c8('0x15')]);}})['catch'](function(_0xe891a9){logger[_0x15c8('0x13')](_0x15c8('0x14'),_0x19d851,_0xe891a9);_0x3e6435(_0xe891a9);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3a10e50..9eb57bd 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 _0xdcaa=['connect-timeout','express','Router','fs-extra','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','util','path'];(function(_0x6a3773,_0x2ddb5d){var _0x51d80a=function(_0x4c77fa){while(--_0x4c77fa){_0x6a3773['push'](_0x6a3773['shift']());}};_0x51d80a(++_0x2ddb5d);}(_0xdcaa,0x14e));var _0xadca=function(_0xc08b7,_0x28a0d9){_0xc08b7=_0xc08b7-0x0;var _0x1da626=_0xdcaa[_0xc08b7];return _0x1da626;};'use strict';var multer=require('multer');var util=require(_0xadca('0x0'));var path=require(_0xadca('0x1'));var timeout=require(_0xadca('0x2'));var express=require(_0xadca('0x3'));var router=express[_0xadca('0x4')]();var fs_extra=require(_0xadca('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xadca('0x6'));router[_0xadca('0x7')](_0xadca('0x8'),auth[_0xadca('0x9')](),controller[_0xadca('0xa')]);router[_0xadca('0xb')]('/:id',auth[_0xadca('0x9')](),controller['update']);router[_0xadca('0xc')](_0xadca('0x8'),auth[_0xadca('0x9')](),controller['destroy']);module[_0xadca('0xd')]=router;
\ No newline at end of file
+var _0x4cc7=['put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4cc7,0x134));var _0x74cc=function(_0x580f5e,_0x2b92fd){_0x580f5e=_0x580f5e-0x0;var _0x5b7812=_0x4cc7[_0x580f5e];return _0x5b7812;};'use strict';var multer=require(_0x74cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x74cc('0x1'));var express=require(_0x74cc('0x2'));var router=express[_0x74cc('0x3')]();var fs_extra=require(_0x74cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x74cc('0x5'));var config=require(_0x74cc('0x6'));var controller=require(_0x74cc('0x7'));router[_0x74cc('0x8')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xb')]);router[_0x74cc('0xc')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller['update']);router[_0x74cc('0xd')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xe')]);module[_0x74cc('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 47de148..5205047 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 _0xb1d2=['STRING','BOOLEAN'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb1d2,0x116));var _0x2b1d=function(_0x1bc368,_0x3900b8){_0x1bc368=_0x1bc368-0x0;var _0x18808d=_0xb1d2[_0x1bc368];return _0x18808d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b1d('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x2b1d('0x0')]},'write':{'type':Sequelize[_0x2b1d('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4b36=['STRING','BOOLEAN','sequelize'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4b36,0xcb));var _0x64b3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4b36[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x64b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x64b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x64b3('0x1')]},'write':{'type':Sequelize[_0x64b3('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 8daf782..9181857 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 _0x3229=['sort','nolimit','removeMembers','ChatGroupId','findOne','pick','$gte','format','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers'];(function(_0x228058,_0x5f30e8){var _0x2ad92d=function(_0x459963){while(--_0x459963){_0x228058['push'](_0x228058['shift']());}};_0x2ad92d(++_0x5f30e8);}(_0x3229,0x17d));var _0x9322=function(_0x32a7f8,_0x1bbc99){_0x32a7f8=_0x32a7f8-0x0;var _0x399dc2=_0x3229[_0x32a7f8];return _0x399dc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9322('0x0'));var zipdir=require(_0x9322('0x1'));var jsonpatch=require(_0x9322('0x2'));var rp=require(_0x9322('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9322('0x4'));var util=require(_0x9322('0x5'));var path=require('path');var sox=require(_0x9322('0x6'));var csv=require(_0x9322('0x7'));var ejs=require(_0x9322('0x8'));var fs=require('fs');var fs_extra=require(_0x9322('0x9'));var _=require(_0x9322('0xa'));var squel=require(_0x9322('0xb'));var crypto=require(_0x9322('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9322('0xd'));var toCsv=require(_0x9322('0x7'));var querystring=require('querystring');var Papa=require(_0x9322('0xe'));var Redis=require(_0x9322('0xf'));var authService=require(_0x9322('0x10'));var qs=require(_0x9322('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9322('0x12'));var logger=require(_0x9322('0x13'))(_0x9322('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9322('0x15')]=_[_0x9322('0x16')](config[_0x9322('0x15')],{'host':_0x9322('0x17'),'port':0x18eb});var socket=require(_0x9322('0x18'))(new Redis(config[_0x9322('0x15')]));require('./chatGroup.socket')[_0x9322('0x19')](socket);function respondWithStatusCode(_0x2b191a,_0x2e0e83){_0x2e0e83=_0x2e0e83||0xcc;return function(_0x1ff072){if(_0x1ff072){return _0x2b191a[_0x9322('0x1a')](_0x2e0e83);}return _0x2b191a[_0x9322('0x1b')](_0x2e0e83)[_0x9322('0x1c')]();};}function respondWithResult(_0x3b3a47,_0x221336){_0x221336=_0x221336||0xc8;return function(_0xa29a68){if(_0xa29a68){return _0x3b3a47[_0x9322('0x1b')](_0x221336)['json'](_0xa29a68);}};}function respondWithFilteredResult(_0x19c8f7,_0x7f0e59){return function(_0x18b09e){if(_0x18b09e){var _0x198456=typeof _0x7f0e59[_0x9322('0x1d')]===_0x9322('0x1e')&&typeof _0x7f0e59['limit']===_0x9322('0x1e');var _0x33bd18=_0x18b09e['count'];var _0xd033ea=_0x198456?0x0:_0x7f0e59[_0x9322('0x1d')];var _0x5e192c=_0x198456?_0x18b09e[_0x9322('0x1f')]:_0x7f0e59[_0x9322('0x1d')]+_0x7f0e59[_0x9322('0x20')];var _0x4b4dfe;if(_0x5e192c>=_0x33bd18){_0x5e192c=_0x33bd18;_0x4b4dfe=0xc8;}else{_0x4b4dfe=0xce;}_0x19c8f7['status'](_0x4b4dfe);return _0x19c8f7[_0x9322('0x21')](_0x9322('0x22'),_0xd033ea+'-'+_0x5e192c+'/'+_0x33bd18)[_0x9322('0x23')](_0x18b09e);}return null;};}function patchUpdates(_0x308ac1){return function(_0x841ab9){try{jsonpatch[_0x9322('0x24')](_0x841ab9,_0x308ac1,!![]);}catch(_0x5af7ab){return BPromise[_0x9322('0x25')](_0x5af7ab);}return _0x841ab9[_0x9322('0x26')]();};}function saveUpdates(_0x4cce0b,_0x3ad72d){return function(_0x9239fb){if(_0x9239fb){return _0x9239fb[_0x9322('0x27')](_0x4cce0b)['then'](function(_0x1e92cb){return _0x1e92cb;});}return null;};}function removeEntity(_0x53bfe2,_0x779295){return function(_0x509bd1){if(_0x509bd1){return _0x509bd1[_0x9322('0x28')]()[_0x9322('0x29')](function(){_0x53bfe2[_0x9322('0x1b')](0xcc)[_0x9322('0x1c')]();});}};}function handleEntityNotFound(_0x5ff0f9,_0x3418a7){return function(_0x2d26d8){if(!_0x2d26d8){_0x5ff0f9[_0x9322('0x1a')](0x194);}return _0x2d26d8;};}function handleError(_0x4fb3df,_0x2e3334){_0x2e3334=_0x2e3334||0x1f4;return function(_0x47fe63){logger[_0x9322('0x2a')](_0x47fe63[_0x9322('0x2b')]);if(_0x47fe63[_0x9322('0x2c')]){delete _0x47fe63[_0x9322('0x2c')];}_0x4fb3df[_0x9322('0x1b')](_0x2e3334)['send'](_0x47fe63);};}exports[_0x9322('0x2d')]=function(_0x41d8f8,_0x721d91){var _0x324096={},_0x3bdd8f={},_0x2ed329={'count':0x0,'rows':[]};var _0x84642d=_[_0x9322('0x2e')](db[_0x9322('0x2f')][_0x9322('0x30')],function(_0x52e25e){return{'name':_0x52e25e[_0x9322('0x31')],'type':_0x52e25e[_0x9322('0x32')]['key']};});_0x3bdd8f[_0x9322('0x33')]=_['map'](_0x84642d,_0x9322('0x2c'));_0x3bdd8f[_0x9322('0x34')]=_[_0x9322('0x35')](_0x41d8f8[_0x9322('0x34')]);_0x3bdd8f[_0x9322('0x36')]=_['intersection'](_0x3bdd8f[_0x9322('0x33')],_0x3bdd8f[_0x9322('0x34')]);_0x324096[_0x9322('0x37')]=_[_0x9322('0x38')](_0x3bdd8f['model'],qs[_0x9322('0x39')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x39')]));_0x324096[_0x9322('0x37')]=_0x324096[_0x9322('0x37')]['length']?_0x324096[_0x9322('0x37')]:_0x3bdd8f[_0x9322('0x33')];if(!_0x41d8f8[_0x9322('0x34')][_0x9322('0x3a')]('nolimit')){_0x324096[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x20')]);_0x324096[_0x9322('0x1d')]=qs[_0x9322('0x1d')](_0x41d8f8[_0x9322('0x34')][_0x9322('0x1d')]);}_0x324096[_0x9322('0x3b')]=qs['sort'](_0x41d8f8['query']['sort']);_0x324096[_0x9322('0x3c')]=qs['filters'](_['pick'](_0x41d8f8[_0x9322('0x34')],_0x3bdd8f[_0x9322('0x36')]),_0x84642d);if(_0x41d8f8[_0x9322('0x34')][_0x9322('0x3d')]){_0x324096[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x324096['where'],{'$or':_[_0x9322('0x2e')](_0x84642d,function(_0x364cad){if(_0x364cad[_0x9322('0x32')]!==_0x9322('0x3f')){var _0x1aa8fe={};_0x1aa8fe[_0x364cad[_0x9322('0x2c')]]={'$like':'%'+_0x41d8f8[_0x9322('0x34')]['filter']+'%'};return _0x1aa8fe;}})});}_0x324096=_['merge']({},_0x324096,_0x41d8f8[_0x9322('0x40')]);var _0x5cc57f={'where':_0x324096[_0x9322('0x3c')]};return db[_0x9322('0x2f')][_0x9322('0x1f')](_0x5cc57f)[_0x9322('0x29')](function(_0x31f970){_0x2ed329[_0x9322('0x1f')]=_0x31f970;if(_0x41d8f8[_0x9322('0x34')][_0x9322('0x41')]){_0x324096['include']=[{'all':!![]}];}return db[_0x9322('0x2f')][_0x9322('0x42')](_0x324096);})[_0x9322('0x29')](function(_0x320a35){_0x2ed329[_0x9322('0x43')]=_0x320a35;return _0x2ed329;})[_0x9322('0x29')](respondWithFilteredResult(_0x721d91,_0x324096))['catch'](handleError(_0x721d91,null));};exports['show']=function(_0x38c28b,_0xaf6745){var _0x57993c={'raw':!![],'where':{'id':_0x38c28b[_0x9322('0x44')]['id']}},_0xf4db25={};_0xf4db25[_0x9322('0x33')]=_[_0x9322('0x35')](db[_0x9322('0x2f')]['rawAttributes']);_0xf4db25[_0x9322('0x34')]=_[_0x9322('0x35')](_0x38c28b[_0x9322('0x34')]);_0xf4db25[_0x9322('0x36')]=_[_0x9322('0x38')](_0xf4db25[_0x9322('0x33')],_0xf4db25[_0x9322('0x34')]);_0x57993c[_0x9322('0x37')]=_['intersection'](_0xf4db25['model'],qs['fields'](_0x38c28b[_0x9322('0x34')][_0x9322('0x39')]));_0x57993c[_0x9322('0x37')]=_0x57993c[_0x9322('0x37')][_0x9322('0x45')]?_0x57993c[_0x9322('0x37')]:_0xf4db25[_0x9322('0x33')];if(_0x38c28b[_0x9322('0x34')]['includeAll']){_0x57993c[_0x9322('0x46')]=[{'all':!![]}];}_0x57993c=_[_0x9322('0x3e')]({},_0x57993c,_0x38c28b[_0x9322('0x40')]);return db[_0x9322('0x2f')][_0x9322('0x47')](_0x57993c)['then'](handleEntityNotFound(_0xaf6745,null))[_0x9322('0x29')](respondWithResult(_0xaf6745,null))[_0x9322('0x48')](handleError(_0xaf6745,null));};exports[_0x9322('0x49')]=function(_0xf058dd,_0x5ce7f1){return db[_0x9322('0x2f')][_0x9322('0x49')](_0xf058dd[_0x9322('0x4a')],{})[_0x9322('0x29')](respondWithResult(_0x5ce7f1,0xc9))[_0x9322('0x48')](handleError(_0x5ce7f1,null));};exports[_0x9322('0x27')]=function(_0x232fa0,_0x43ced9){if(_0x232fa0[_0x9322('0x4a')]['id']){delete _0x232fa0[_0x9322('0x4a')]['id'];}return db[_0x9322('0x2f')]['find']({'where':{'id':_0x232fa0['params']['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x43ced9,null))[_0x9322('0x29')](saveUpdates(_0x232fa0['body'],null))[_0x9322('0x29')](respondWithResult(_0x43ced9,null))[_0x9322('0x48')](handleError(_0x43ced9,null));};exports[_0x9322('0x28')]=function(_0x5e0b58,_0x13bfe0){return db['ChatGroup'][_0x9322('0x47')]({'where':{'id':_0x5e0b58[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x13bfe0,null))[_0x9322('0x29')](removeEntity(_0x13bfe0,null))['catch'](handleError(_0x13bfe0,null));};exports['describe']=function(_0x2e902a,_0x1703b8){return db[_0x9322('0x2f')][_0x9322('0x4b')]()['then'](respondWithResult(_0x1703b8,null))['catch'](handleError(_0x1703b8,null));};exports[_0x9322('0x4c')]=function(_0x5aca32,_0x1f8d90,_0x3f511e){return db[_0x9322('0x4d')][_0x9322('0x1f')]({'where':{'ChatGroupId':_0x5aca32[_0x9322('0x44')]['id'],'ToId':_0x5aca32[_0x9322('0x4e')]['id'],'read':![]}})[_0x9322('0x29')](function(_0x576b97){return{'id':_[_0x9322('0x4f')](_0x5aca32[_0x9322('0x44')]['id']),'count':_0x576b97};})[_0x9322('0x29')](respondWithResult(_0x1f8d90,null))[_0x9322('0x48')](handleError(_0x1f8d90,null));};exports[_0x9322('0x50')]=function(_0x290e4f,_0x51af7f,_0x50914a){return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x290e4f[_0x9322('0x44')]['id']}})['then'](handleEntityNotFound(_0x51af7f,null))[_0x9322('0x29')](function(_0x12b8e7){if(_0x12b8e7){return _0x12b8e7['addMembers'](_0x290e4f[_0x9322('0x4a')]['ids'],_[_0x9322('0x51')](_0x290e4f[_0x9322('0x4a')],[_0x9322('0x52'),'id'])||{});}})['then'](respondWithResult(_0x51af7f,null))['catch'](handleError(_0x51af7f,null));};exports[_0x9322('0x53')]=function(_0x318c8f,_0x4569fc,_0x223062){var _0x49f458={};var _0x172433={};var _0x4b17c3;var _0x185145;return db[_0x9322('0x2f')]['findOne']({'where':{'id':_0x318c8f['params']['id']}})['then'](handleEntityNotFound(_0x4569fc,null))['then'](function(_0x565575){if(_0x565575){_0x4b17c3=_0x565575;_0x172433[_0x9322('0x33')]=_[_0x9322('0x35')](db['User'][_0x9322('0x30')]);_0x172433[_0x9322('0x34')]=_['keys'](_0x318c8f[_0x9322('0x34')]);_0x172433[_0x9322('0x36')]=_['intersection'](_0x172433[_0x9322('0x33')],_0x172433[_0x9322('0x34')]);_0x49f458[_0x9322('0x37')]=_[_0x9322('0x38')](_0x172433[_0x9322('0x33')],qs['fields'](_0x318c8f[_0x9322('0x34')][_0x9322('0x39')]));_0x49f458[_0x9322('0x37')]=_0x49f458[_0x9322('0x37')][_0x9322('0x45')]?_0x49f458[_0x9322('0x37')]:_0x172433['model'];_0x49f458['order']=qs[_0x9322('0x54')](_0x318c8f[_0x9322('0x34')][_0x9322('0x54')]);_0x49f458[_0x9322('0x3c')]=qs[_0x9322('0x36')](_['pick'](_0x318c8f['query'],_0x172433[_0x9322('0x36')]));if(_0x318c8f['query'][_0x9322('0x3d')]){_0x49f458['where']=_[_0x9322('0x3e')](_0x49f458[_0x9322('0x3c')],{'$or':_['map'](_0x49f458[_0x9322('0x37')],function(_0x1e8462){var _0x236059={};_0x236059[_0x1e8462]={'$like':'%'+_0x318c8f[_0x9322('0x34')][_0x9322('0x3d')]+'%'};return _0x236059;})});}_0x49f458=_[_0x9322('0x3e')]({},_0x49f458,_0x318c8f['options']);return _0x4b17c3[_0x9322('0x53')](_0x49f458);}})[_0x9322('0x29')](function(_0x470e9b){if(_0x470e9b){_0x185145=_0x470e9b[_0x9322('0x45')];if(!_0x318c8f[_0x9322('0x34')][_0x9322('0x3a')](_0x9322('0x55'))){_0x49f458[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x318c8f[_0x9322('0x34')]['limit']);_0x49f458[_0x9322('0x1d')]=qs['offset'](_0x318c8f['query'][_0x9322('0x1d')]);}return _0x4b17c3['getMembers'](_0x49f458);}})['then'](function(_0x163647){if(_0x163647){return _0x163647?{'count':_0x185145,'rows':_0x163647}:null;}})[_0x9322('0x29')](respondWithResult(_0x4569fc,null))[_0x9322('0x48')](handleError(_0x4569fc,null));};exports[_0x9322('0x56')]=function(_0x606e4b,_0x5939ca,_0x22f7bd){return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x606e4b['params']['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x5939ca,null))[_0x9322('0x29')](function(_0x1be0f5){if(_0x1be0f5){return _0x1be0f5[_0x9322('0x56')](_0x606e4b['query'][_0x9322('0x52')]);}})['then'](respondWithStatusCode(_0x5939ca,null))[_0x9322('0x48')](handleError(_0x5939ca,null));};exports['addMessage']=function(_0x152c22,_0x1ee132,_0x2d8c1d){if(_0x152c22[_0x9322('0x4a')]['id']){delete _0x152c22[_0x9322('0x4a')]['id'];}return db[_0x9322('0x2f')][_0x9322('0x47')]({'where':{'id':_0x152c22[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x1ee132,null))[_0x9322('0x29')](function(_0xb93ab){if(_0xb93ab){_0x152c22[_0x9322('0x4a')][_0x9322('0x57')]=_0xb93ab['id'];return db['ChatInternalMessage'][_0x9322('0x49')](_0x152c22[_0x9322('0x4a')]);}})[_0x9322('0x29')](respondWithResult(_0x1ee132,null))[_0x9322('0x48')](handleError(_0x1ee132,null));};exports['getMessages']=function(_0x3588d1,_0x38290b,_0x1e99fd){var _0x4d17b4={};var _0x1bf68a={};var _0x4d189b;var _0x50fa22;return db[_0x9322('0x2f')][_0x9322('0x58')]({'where':{'id':_0x3588d1[_0x9322('0x44')]['id']}})[_0x9322('0x29')](handleEntityNotFound(_0x38290b,null))[_0x9322('0x29')](function(_0xfa3837){if(_0xfa3837){_0x4d189b=_0xfa3837;_0x1bf68a[_0x9322('0x33')]=_[_0x9322('0x35')](db[_0x9322('0x4d')]['rawAttributes']);_0x1bf68a['query']=_[_0x9322('0x35')](_0x3588d1[_0x9322('0x34')]);_0x1bf68a['filters']=_[_0x9322('0x38')](_0x1bf68a[_0x9322('0x33')],_0x1bf68a['query']);_0x4d17b4['attributes']=_[_0x9322('0x38')](_0x1bf68a[_0x9322('0x33')],qs[_0x9322('0x39')](_0x3588d1['query']['fields']));_0x4d17b4[_0x9322('0x37')]=_0x4d17b4['attributes']['length']?_0x4d17b4[_0x9322('0x37')]:_0x1bf68a[_0x9322('0x33')];_0x4d17b4[_0x9322('0x3b')]=qs['sort'](_0x3588d1['query'][_0x9322('0x54')]);_0x4d17b4[_0x9322('0x3c')]=qs[_0x9322('0x36')](_[_0x9322('0x59')](_0x3588d1['query'],_0x1bf68a[_0x9322('0x36')]));if(_0x3588d1[_0x9322('0x34')][_0x9322('0x3d')]){_0x4d17b4[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x4d17b4[_0x9322('0x3c')],{'$or':_[_0x9322('0x2e')](_0x4d17b4[_0x9322('0x37')],function(_0x3e8c6c){var _0x24213d={};_0x24213d[_0x3e8c6c]={'$like':'%'+_0x3588d1['query'][_0x9322('0x3d')]+'%'};return _0x24213d;})});}if(_0x3588d1[_0x9322('0x34')][_0x9322('0x5a')]){var _0x4214c0=_0x3588d1[_0x9322('0x34')]['$gte']['split'](',');var _0x5053dc={};_0x5053dc[_0x4214c0[0x0]]={'$gte':moment(_0x4214c0[0x1])[_0x9322('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d17b4[_0x9322('0x3c')]=_[_0x9322('0x3e')](_0x4d17b4['where'],_0x5053dc);}_0x4d17b4=_[_0x9322('0x3e')]({},_0x4d17b4,_0x3588d1[_0x9322('0x40')]);return _0x4d189b[_0x9322('0x5c')](_0x4d17b4);}})[_0x9322('0x29')](function(_0x1846ea){if(_0x1846ea){_0x50fa22=_0x1846ea['length'];if(!_0x3588d1[_0x9322('0x34')][_0x9322('0x3a')](_0x9322('0x55'))){_0x4d17b4[_0x9322('0x20')]=qs[_0x9322('0x20')](_0x3588d1['query']['limit']);_0x4d17b4[_0x9322('0x1d')]=qs['offset'](_0x3588d1[_0x9322('0x34')]['offset']);}return _0x4d189b[_0x9322('0x5c')](_0x4d17b4);}})[_0x9322('0x29')](function(_0x1eccd3){if(_0x1eccd3){return _0x1eccd3?{'count':_0x50fa22,'rows':_0x1eccd3}:null;}})[_0x9322('0x29')](respondWithResult(_0x38290b,null))[_0x9322('0x48')](handleError(_0x38290b,null));};
\ No newline at end of file
+var _0x304b=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model'];(function(_0x4592de,_0x4233e6){var _0x27a791=function(_0x2d0f98){while(--_0x2d0f98){_0x4592de['push'](_0x4592de['shift']());}};_0x27a791(++_0x4233e6);}(_0x304b,0x15e));var _0xb304=function(_0x3a1695,_0x5a565d){_0x3a1695=_0x3a1695-0x0;var _0x5ddbb5=_0x304b[_0x3a1695];return _0x5ddbb5;};'use strict';var emlformat=require(_0xb304('0x0'));var rimraf=require(_0xb304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb304('0x2'));var rp=require(_0xb304('0x3'));var moment=require('moment');var BPromise=require(_0xb304('0x4'));var Mustache=require(_0xb304('0x5'));var util=require(_0xb304('0x6'));var path=require(_0xb304('0x7'));var sox=require(_0xb304('0x8'));var csv=require(_0xb304('0x9'));var ejs=require(_0xb304('0xa'));var fs=require('fs');var fs_extra=require(_0xb304('0xb'));var _=require(_0xb304('0xc'));var squel=require(_0xb304('0xd'));var crypto=require(_0xb304('0xe'));var jsforce=require(_0xb304('0xf'));var deskjs=require(_0xb304('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb304('0x11'));var Redis=require(_0xb304('0x12'));var authService=require(_0xb304('0x13'));var qs=require(_0xb304('0x14'));var as=require(_0xb304('0x15'));var hardwareService=require(_0xb304('0x16'));var logger=require(_0xb304('0x17'))(_0xb304('0x18'));var utils=require('../../config/utils');var config=require(_0xb304('0x19'));var licenseUtil=require(_0xb304('0x1a'));var db=require(_0xb304('0x1b'))['db'];config['redis']=_[_0xb304('0x1c')](config[_0xb304('0x1d')],{'host':_0xb304('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb304('0x1f'))[_0xb304('0x20')](socket);function respondWithStatusCode(_0x335bf8,_0x2a93be){_0x2a93be=_0x2a93be||0xcc;return function(_0x34aeff){if(_0x34aeff){return _0x335bf8[_0xb304('0x21')](_0x2a93be);}return _0x335bf8[_0xb304('0x22')](_0x2a93be)[_0xb304('0x23')]();};}function respondWithResult(_0x52c186,_0x5d8f05){_0x5d8f05=_0x5d8f05||0xc8;return function(_0x21967a){if(_0x21967a){return _0x52c186[_0xb304('0x22')](_0x5d8f05)[_0xb304('0x24')](_0x21967a);}};}function respondWithFilteredResult(_0x3a5401,_0x25abbf){return function(_0x36e7f7){if(_0x36e7f7){var _0x59b2a1=typeof _0x25abbf['offset']===_0xb304('0x25')&&typeof _0x25abbf[_0xb304('0x26')]===_0xb304('0x25');var _0xa9ea8f=_0x36e7f7['count'];var _0x9395f3=_0x59b2a1?0x0:_0x25abbf[_0xb304('0x27')];var _0x5d2c72=_0x59b2a1?_0x36e7f7[_0xb304('0x28')]:_0x25abbf[_0xb304('0x27')]+_0x25abbf[_0xb304('0x26')];var _0x4978da;if(_0x5d2c72>=_0xa9ea8f){_0x5d2c72=_0xa9ea8f;_0x4978da=0xc8;}else{_0x4978da=0xce;}_0x3a5401[_0xb304('0x22')](_0x4978da);return _0x3a5401[_0xb304('0x29')]('Content-Range',_0x9395f3+'-'+_0x5d2c72+'/'+_0xa9ea8f)[_0xb304('0x24')](_0x36e7f7);}return null;};}function patchUpdates(_0x54c94f){return function(_0x5994c1){try{jsonpatch[_0xb304('0x2a')](_0x5994c1,_0x54c94f,!![]);}catch(_0x28278c){return BPromise['reject'](_0x28278c);}return _0x5994c1[_0xb304('0x2b')]();};}function saveUpdates(_0x124b23,_0x897ffa){return function(_0x2d9066){if(_0x2d9066){return _0x2d9066[_0xb304('0x2c')](_0x124b23)['then'](function(_0xfb6ecc){return _0xfb6ecc;});}return null;};}function removeEntity(_0x2f5b6c,_0x1adb2a){return function(_0x1d500b){if(_0x1d500b){return _0x1d500b[_0xb304('0x2d')]()[_0xb304('0x2e')](function(){_0x2f5b6c[_0xb304('0x22')](0xcc)[_0xb304('0x23')]();});}};}function handleEntityNotFound(_0x37dfe6,_0x3b61e4){return function(_0x5d6fd8){if(!_0x5d6fd8){_0x37dfe6[_0xb304('0x21')](0x194);}return _0x5d6fd8;};}function handleError(_0x1ded80,_0x754bb8){_0x754bb8=_0x754bb8||0x1f4;return function(_0x2e1a01){logger[_0xb304('0x2f')](_0x2e1a01[_0xb304('0x30')]);if(_0x2e1a01[_0xb304('0x31')]){delete _0x2e1a01[_0xb304('0x31')];}_0x1ded80['status'](_0x754bb8)[_0xb304('0x32')](_0x2e1a01);};}exports[_0xb304('0x33')]=function(_0x5f1d6b,_0x39ae9d){var _0x65a5f1={},_0xe3bab={},_0xf18cd8={'count':0x0,'rows':[]};var _0x3b15af=_[_0xb304('0x34')](db[_0xb304('0x35')][_0xb304('0x36')],function(_0x538285){return{'name':_0x538285[_0xb304('0x37')],'type':_0x538285['type'][_0xb304('0x38')]};});_0xe3bab[_0xb304('0x39')]=_[_0xb304('0x34')](_0x3b15af,'name');_0xe3bab[_0xb304('0x3a')]=_['keys'](_0x5f1d6b[_0xb304('0x3a')]);_0xe3bab[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0xe3bab['model'],_0xe3bab['query']);_0x65a5f1[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0xe3bab[_0xb304('0x39')],qs['fields'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x3e')]));_0x65a5f1[_0xb304('0x3d')]=_0x65a5f1['attributes'][_0xb304('0x3f')]?_0x65a5f1['attributes']:_0xe3bab[_0xb304('0x39')];if(!_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x65a5f1[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x26')]);_0x65a5f1[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x27')]);}_0x65a5f1['order']=qs['sort'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x42')]);_0x65a5f1[_0xb304('0x43')]=qs[_0xb304('0x3b')](_['pick'](_0x5f1d6b[_0xb304('0x3a')],_0xe3bab[_0xb304('0x3b')]),_0x3b15af);if(_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]){_0x65a5f1[_0xb304('0x43')]=_[_0xb304('0x45')](_0x65a5f1[_0xb304('0x43')],{'$or':_['map'](_0x3b15af,function(_0x5d2dd9){if(_0x5d2dd9['type']!==_0xb304('0x46')){var _0x1f2ac3={};_0x1f2ac3[_0x5d2dd9[_0xb304('0x31')]]={'$like':'%'+_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]+'%'};return _0x1f2ac3;}})});}_0x65a5f1=_[_0xb304('0x45')]({},_0x65a5f1,_0x5f1d6b[_0xb304('0x47')]);var _0x48284e={'where':_0x65a5f1[_0xb304('0x43')]};return db[_0xb304('0x35')][_0xb304('0x28')](_0x48284e)[_0xb304('0x2e')](function(_0x13c72d){_0xf18cd8[_0xb304('0x28')]=_0x13c72d;if(_0x5f1d6b['query']['includeAll']){_0x65a5f1['include']=[{'all':!![]}];}return db[_0xb304('0x35')][_0xb304('0x48')](_0x65a5f1);})[_0xb304('0x2e')](function(_0x1cb582){_0xf18cd8[_0xb304('0x49')]=_0x1cb582;return _0xf18cd8;})[_0xb304('0x2e')](respondWithFilteredResult(_0x39ae9d,_0x65a5f1))[_0xb304('0x4a')](handleError(_0x39ae9d,null));};exports[_0xb304('0x4b')]=function(_0x2228bd,_0x20ab6e){var _0x20b295={'raw':!![],'where':{'id':_0x2228bd['params']['id']}},_0x17019e={};_0x17019e['model']=_[_0xb304('0x4c')](db[_0xb304('0x35')][_0xb304('0x36')]);_0x17019e[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2228bd[_0xb304('0x3a')]);_0x17019e['filters']=_['intersection'](_0x17019e[_0xb304('0x39')],_0x17019e[_0xb304('0x3a')]);_0x20b295['attributes']=_[_0xb304('0x3c')](_0x17019e[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x2228bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x20b295[_0xb304('0x3d')]=_0x20b295[_0xb304('0x3d')][_0xb304('0x3f')]?_0x20b295[_0xb304('0x3d')]:_0x17019e['model'];if(_0x2228bd[_0xb304('0x3a')][_0xb304('0x4d')]){_0x20b295[_0xb304('0x4e')]=[{'all':!![]}];}_0x20b295=_['merge']({},_0x20b295,_0x2228bd[_0xb304('0x47')]);return db[_0xb304('0x35')][_0xb304('0x4f')](_0x20b295)['then'](handleEntityNotFound(_0x20ab6e,null))[_0xb304('0x2e')](respondWithResult(_0x20ab6e,null))[_0xb304('0x4a')](handleError(_0x20ab6e,null));};exports[_0xb304('0x50')]=function(_0x2f1b45,_0x1158c3){return db[_0xb304('0x35')]['create'](_0x2f1b45[_0xb304('0x51')],{})['then'](respondWithResult(_0x1158c3,0xc9))[_0xb304('0x4a')](handleError(_0x1158c3,null));};exports[_0xb304('0x2c')]=function(_0x2bb54f,_0x37d74d){if(_0x2bb54f[_0xb304('0x51')]['id']){delete _0x2bb54f[_0xb304('0x51')]['id'];}return db[_0xb304('0x35')]['find']({'where':{'id':_0x2bb54f['params']['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x37d74d,null))['then'](saveUpdates(_0x2bb54f[_0xb304('0x51')],null))[_0xb304('0x2e')](respondWithResult(_0x37d74d,null))['catch'](handleError(_0x37d74d,null));};exports[_0xb304('0x2d')]=function(_0x6d1e2e,_0x36c76c){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x6d1e2e[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x36c76c,null))[_0xb304('0x2e')](removeEntity(_0x36c76c,null))['catch'](handleError(_0x36c76c,null));};exports[_0xb304('0x53')]=function(_0x1956b4,_0x35a1f7){return db[_0xb304('0x35')][_0xb304('0x53')]()[_0xb304('0x2e')](respondWithResult(_0x35a1f7,null))[_0xb304('0x4a')](handleError(_0x35a1f7,null));};exports[_0xb304('0x54')]=function(_0x36e942,_0x70563f,_0x8dd461){return db[_0xb304('0x55')][_0xb304('0x28')]({'where':{'ChatGroupId':_0x36e942[_0xb304('0x52')]['id'],'ToId':_0x36e942['user']['id'],'read':![]}})['then'](function(_0x42bf41){return{'id':_[_0xb304('0x56')](_0x36e942[_0xb304('0x52')]['id']),'count':_0x42bf41};})['then'](respondWithResult(_0x70563f,null))[_0xb304('0x4a')](handleError(_0x70563f,null));};exports[_0xb304('0x57')]=function(_0x4bd0d2,_0x58b67b,_0x2e2912){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x4bd0d2[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x58b67b,null))[_0xb304('0x2e')](function(_0x5537de){if(_0x5537de){return _0x5537de[_0xb304('0x57')](_0x4bd0d2['body'][_0xb304('0x58')],_['omit'](_0x4bd0d2[_0xb304('0x51')],[_0xb304('0x58'),'id'])||{});}})[_0xb304('0x2e')](respondWithResult(_0x58b67b,null))['catch'](handleError(_0x58b67b,null));};exports[_0xb304('0x59')]=function(_0x31f214,_0xb22ed3,_0x3fcf6a){var _0x420df8={};var _0x201094={};var _0x4c67e4;var _0x1ee244;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x31f214[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0xb22ed3,null))['then'](function(_0x1bcb54){if(_0x1bcb54){_0x4c67e4=_0x1bcb54;_0x201094[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x5b')][_0xb304('0x36')]);_0x201094[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x31f214['query']);_0x201094['filters']=_['intersection'](_0x201094[_0xb304('0x39')],_0x201094[_0xb304('0x3a')]);_0x420df8['attributes']=_[_0xb304('0x3c')](_0x201094[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x31f214['query'][_0xb304('0x3e')]));_0x420df8[_0xb304('0x3d')]=_0x420df8[_0xb304('0x3d')][_0xb304('0x3f')]?_0x420df8[_0xb304('0x3d')]:_0x201094['model'];_0x420df8[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x31f214[_0xb304('0x3a')][_0xb304('0x42')]);_0x420df8[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x31f214[_0xb304('0x3a')],_0x201094[_0xb304('0x3b')]));if(_0x31f214[_0xb304('0x3a')][_0xb304('0x44')]){_0x420df8['where']=_[_0xb304('0x45')](_0x420df8[_0xb304('0x43')],{'$or':_[_0xb304('0x34')](_0x420df8[_0xb304('0x3d')],function(_0xfc8164){var _0xc6db3f={};_0xc6db3f[_0xfc8164]={'$like':'%'+_0x31f214[_0xb304('0x3a')]['filter']+'%'};return _0xc6db3f;})});}_0x420df8=_[_0xb304('0x45')]({},_0x420df8,_0x31f214['options']);return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0x49621a){if(_0x49621a){_0x1ee244=_0x49621a['length'];if(!_0x31f214[_0xb304('0x3a')]['hasOwnProperty'](_0xb304('0x41'))){_0x420df8['limit']=qs[_0xb304('0x26')](_0x31f214[_0xb304('0x3a')][_0xb304('0x26')]);_0x420df8[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x31f214[_0xb304('0x3a')][_0xb304('0x27')]);}return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0xf0d979){if(_0xf0d979){return _0xf0d979?{'count':_0x1ee244,'rows':_0xf0d979}:null;}})[_0xb304('0x2e')](respondWithResult(_0xb22ed3,null))[_0xb304('0x4a')](handleError(_0xb22ed3,null));};exports[_0xb304('0x5e')]=function(_0x27272b,_0x35c99c,_0x45ec35){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x27272b[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x35c99c,null))[_0xb304('0x2e')](function(_0x4b71ad){if(_0x4b71ad){return _0x4b71ad[_0xb304('0x5e')](_0x27272b[_0xb304('0x3a')][_0xb304('0x58')]);}})[_0xb304('0x2e')](respondWithStatusCode(_0x35c99c,null))[_0xb304('0x4a')](handleError(_0x35c99c,null));};exports[_0xb304('0x5f')]=function(_0xf09f2a,_0x542fd8,_0x17613b){if(_0xf09f2a[_0xb304('0x51')]['id']){delete _0xf09f2a['body']['id'];}return db['ChatGroup'][_0xb304('0x4f')]({'where':{'id':_0xf09f2a[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x542fd8,null))[_0xb304('0x2e')](function(_0x2b34d4){if(_0x2b34d4){_0xf09f2a[_0xb304('0x51')][_0xb304('0x60')]=_0x2b34d4['id'];return db[_0xb304('0x55')][_0xb304('0x50')](_0xf09f2a['body']);}})[_0xb304('0x2e')](respondWithResult(_0x542fd8,null))['catch'](handleError(_0x542fd8,null));};exports['getMessages']=function(_0x2785bd,_0x30e20a,_0xbd4262){var _0x8cfe73={};var _0x437471={};var _0x585e13;var _0x177d16;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x2785bd[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x30e20a,null))[_0xb304('0x2e')](function(_0x34f811){if(_0x34f811){_0x585e13=_0x34f811;_0x437471[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x55')][_0xb304('0x36')]);_0x437471[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2785bd['query']);_0x437471[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0x437471[_0xb304('0x39')],_0x437471[_0xb304('0x3a')]);_0x8cfe73[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0x437471['model'],qs['fields'](_0x2785bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x8cfe73[_0xb304('0x3d')]=_0x8cfe73[_0xb304('0x3d')][_0xb304('0x3f')]?_0x8cfe73[_0xb304('0x3d')]:_0x437471[_0xb304('0x39')];_0x8cfe73[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x2785bd[_0xb304('0x3a')]['sort']);_0x8cfe73[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x2785bd['query'],_0x437471['filters']));if(_0x2785bd[_0xb304('0x3a')][_0xb304('0x44')]){_0x8cfe73['where']=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],{'$or':_['map'](_0x8cfe73[_0xb304('0x3d')],function(_0x2080c2){var _0xbb2636={};_0xbb2636[_0x2080c2]={'$like':'%'+_0x2785bd['query'][_0xb304('0x44')]+'%'};return _0xbb2636;})});}if(_0x2785bd['query'][_0xb304('0x61')]){var _0x53e355=_0x2785bd[_0xb304('0x3a')][_0xb304('0x61')][_0xb304('0x62')](',');var _0x591cf6={};_0x591cf6[_0x53e355[0x0]]={'$gte':moment(_0x53e355[0x1])[_0xb304('0x63')](_0xb304('0x64'))};_0x8cfe73[_0xb304('0x43')]=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],_0x591cf6);}_0x8cfe73=_[_0xb304('0x45')]({},_0x8cfe73,_0x2785bd[_0xb304('0x47')]);return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x2355fd){if(_0x2355fd){_0x177d16=_0x2355fd['length'];if(!_0x2785bd[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x8cfe73[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x2785bd[_0xb304('0x3a')]['limit']);_0x8cfe73[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x2785bd['query'][_0xb304('0x27')]);}return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x507f06){if(_0x507f06){return _0x507f06?{'count':_0x177d16,'rows':_0x507f06}:null;}})[_0xb304('0x2e')](respondWithResult(_0x30e20a,null))[_0xb304('0x4a')](handleError(_0x30e20a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a90a65d..457059f 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 _0x8357=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x2c9e54,_0x178247){var _0x25d074=function(_0x14e87e){while(--_0x14e87e){_0x2c9e54['push'](_0x2c9e54['shift']());}};_0x25d074(++_0x178247);}(_0x8357,0x140));var _0x7835=function(_0x5c5b95,_0x3994b4){_0x5c5b95=_0x5c5b95-0x0;var _0x26a867=_0x8357[_0x5c5b95];return _0x26a867;};'use strict';var EventEmitter=require(_0x7835('0x0'));var ChatGroup=require(_0x7835('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7835('0x2')](0x0);var events={'afterCreate':_0x7835('0x3'),'afterUpdate':_0x7835('0x4'),'afterDestroy':'remove'};function emitEvent(_0x468407){return function(_0x2f2cbe,_0x5e12bb,_0x2b1a89){ChatGroupEvents[_0x7835('0x5')](_0x468407+':'+_0x2f2cbe['id'],_0x2f2cbe);ChatGroupEvents[_0x7835('0x5')](_0x468407,_0x2f2cbe);_0x2b1a89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7835('0x6')](e,emitEvent(event));}}module[_0x7835('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x582b=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','save'];(function(_0x5dca91,_0x3e6d9a){var _0x24ce62=function(_0x5d8a40){while(--_0x5d8a40){_0x5dca91['push'](_0x5dca91['shift']());}};_0x24ce62(++_0x3e6d9a);}(_0x582b,0x185));var _0xb582=function(_0x4bad9a,_0x2547bc){_0x4bad9a=_0x4bad9a-0x0;var _0x326988=_0x582b[_0x4bad9a];return _0x326988;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xb582('0x0'))['db'][_0xb582('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb582('0x2'),'afterUpdate':'update','afterDestroy':_0xb582('0x3')};function emitEvent(_0x13f2bd){return function(_0x43b5ac,_0x223f44,_0xfe601a){ChatGroupEvents[_0xb582('0x4')](_0x13f2bd+':'+_0x43b5ac['id'],_0x43b5ac);ChatGroupEvents[_0xb582('0x4')](_0x13f2bd,_0x43b5ac);_0xfe601a(null);};}for(var e in events){if(events[_0xb582('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xb582('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c9f4bbd..2c78a73 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 _0x971a=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x971a,0x177));var _0xa971=function(_0x18cabd,_0x4c086d){_0x18cabd=_0x18cabd-0x0;var _0x737f87=_0x971a[_0x18cabd];return _0x737f87;};'use strict';var _=require('lodash');var util=require(_0xa971('0x0'));var logger=require(_0xa971('0x1'))(_0xa971('0x2'));var moment=require('moment');var BPromise=require(_0xa971('0x3'));var rp=require(_0xa971('0x4'));var fs=require('fs');var path=require(_0xa971('0x5'));var rimraf=require(_0xa971('0x6'));var config=require(_0xa971('0x7'));var attributes=require(_0xa971('0x8'));module[_0xa971('0x9')]=function(_0x536b51,_0x449d8b){return _0x536b51[_0xa971('0xa')](_0xa971('0xb'),attributes,{'tableName':_0xa971('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec47=['path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xec47,0x102));var _0x7ec4=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xec47[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x7ec4('0x0'));var util=require(_0x7ec4('0x1'));var logger=require(_0x7ec4('0x2'))(_0x7ec4('0x3'));var moment=require(_0x7ec4('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ec4('0x5'));var fs=require('fs');var path=require(_0x7ec4('0x6'));var rimraf=require(_0x7ec4('0x7'));var config=require(_0x7ec4('0x8'));var attributes=require('./chatGroup.attributes');module[_0x7ec4('0x9')]=function(_0x45333f,_0x531638){return _0x45333f[_0x7ec4('0xa')](_0x7ec4('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 651a181..80ce822 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 _0x3d5d=['util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x224d08,_0xce2e9f){var _0x24c699=function(_0x2a851f){while(--_0x2a851f){_0x224d08['push'](_0x224d08['shift']());}};_0x24c699(++_0xce2e9f);}(_0x3d5d,0x104));var _0xd3d5=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x3d5d[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd3d5('0x2'));var fs=require('fs');var Redis=require(_0xd3d5('0x3'));var db=require(_0xd3d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});config['redis']=_[_0xd3d5('0xa')](config[_0xd3d5('0xb')],{'host':_0xd3d5('0xc'),'port':0x18eb});var socket=require(_0xd3d5('0xd'))(new Redis(config['redis']));require(_0xd3d5('0xe'))[_0xd3d5('0xf')](socket);function respondWithRpcPromise(_0x209305,_0x5c66cf,_0x3e64c4){return new BPromise(function(_0x3fba26,_0x5a2468){return client[_0xd3d5('0x10')](_0x209305,_0x3e64c4)[_0xd3d5('0x11')](function(_0x3e8301){logger[_0xd3d5('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,'request\x20sent');logger[_0xd3d5('0x13')](_0xd3d5('0x14'),_0x5c66cf,_0xd3d5('0x15'),JSON[_0xd3d5('0x16')](_0x3e8301));if(_0x3e8301[_0xd3d5('0x17')]){if(_0x3e8301['error'][_0xd3d5('0x18')]===0x1f4){logger[_0xd3d5('0x17')](_0xd3d5('0x19'),_0x5c66cf,_0x3e8301['error'][_0xd3d5('0x1a')]);return _0x5a2468(_0x3e8301['error']['message']);}logger[_0xd3d5('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,_0x3e8301[_0xd3d5('0x17')][_0xd3d5('0x1a')]);return _0x3fba26(_0x3e8301[_0xd3d5('0x17')]['message']);}else{logger[_0xd3d5('0x12')](_0xd3d5('0x19'),_0x5c66cf,_0xd3d5('0x15'));_0x3fba26(_0x3e8301[_0xd3d5('0x1b')][_0xd3d5('0x1a')]);}})[_0xd3d5('0x1c')](function(_0x42e079){logger[_0xd3d5('0x17')]('ChatGroup,\x20%s,\x20%s',_0x5c66cf,_0x42e079);_0x5a2468(_0x42e079);});});}
\ No newline at end of file
+var _0xd765=['request\x20sent','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x22d7bb,_0x4c158e){var _0x40a737=function(_0xd85bab){while(--_0xd85bab){_0x22d7bb['push'](_0x22d7bb['shift']());}};_0x40a737(++_0x4c158e);}(_0xd765,0xdf));var _0x5d76=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd765[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var moment=require(_0x5d76('0x2'));var BPromise=require(_0x5d76('0x3'));var rs=require(_0x5d76('0x4'));var fs=require('fs');var Redis=require(_0x5d76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d76('0x6'));var logger=require('../../config/logger')(_0x5d76('0x7'));var config=require(_0x5d76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5d76('0x9')][_0x5d76('0xa')]({'port':0x232a});config[_0x5d76('0xb')]=_[_0x5d76('0xc')](config[_0x5d76('0xb')],{'host':_0x5d76('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5d76('0xe'))[_0x5d76('0xf')](socket);function respondWithRpcPromise(_0x339e41,_0x31c85f,_0x48f1db){return new BPromise(function(_0x504b8b,_0x7345d5){return client[_0x5d76('0x10')](_0x339e41,_0x48f1db)[_0x5d76('0x11')](function(_0x545dfd){logger['info']('ChatGroup,\x20%s,\x20%s',_0x31c85f,'request\x20sent');logger[_0x5d76('0x12')](_0x5d76('0x13'),_0x31c85f,_0x5d76('0x14'),JSON['stringify'](_0x545dfd));if(_0x545dfd[_0x5d76('0x15')]){if(_0x545dfd[_0x5d76('0x15')]['code']===0x1f4){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);return _0x7345d5(_0x545dfd[_0x5d76('0x15')]['message']);}logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')]['message']);return _0x504b8b(_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);}else{logger[_0x5d76('0x18')]('ChatGroup,\x20%s,\x20%s',_0x31c85f,_0x5d76('0x14'));_0x504b8b(_0x545dfd[_0x5d76('0x19')]['message']);}})[_0x5d76('0x1a')](function(_0x335ee0){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x335ee0);_0x7345d5(_0x335ee0);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 76466f3..7ae010c 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 _0xa0ae=['chatGroup:','./chatGroup.events','update','emit','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa0ae,0xe7));var _0xea0a=function(_0x28e4ec,_0x22f691){_0x28e4ec=_0x28e4ec-0x0;var _0x161a64=_0xa0ae[_0x28e4ec];return _0x161a64;};'use strict';var ChatGroupEvents=require(_0xea0a('0x0'));var events=['save','remove',_0xea0a('0x1')];function createListener(_0x3b624f,_0x57a0f4){return function(_0x4d9058){_0x57a0f4[_0xea0a('0x2')](_0x3b624f,_0x4d9058);};}function removeListener(_0x1ef389,_0x6891b9){return function(){ChatGroupEvents['removeListener'](_0x1ef389,_0x6891b9);};}exports[_0xea0a('0x3')]=function(_0x7489cd){for(var _0x2590b8=0x0,_0x158447=events['length'];_0x2590b8<_0x158447;_0x2590b8++){var _0x57376b=events[_0x2590b8];var _0x55d26f=createListener(_0xea0a('0x4')+_0x57376b,_0x7489cd);ChatGroupEvents['on'](_0x57376b,_0x55d26f);}};
\ No newline at end of file
+var _0xf1cd=['removeListener','register','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x4f03c3,_0x205978){var _0x2b82d1=function(_0xc5038b){while(--_0xc5038b){_0x4f03c3['push'](_0x4f03c3['shift']());}};_0x2b82d1(++_0x205978);}(_0xf1cd,0x100));var _0xdf1c=function(_0x3a3527,_0x1e6c15){_0x3a3527=_0x3a3527-0x0;var _0x4fcf4e=_0xf1cd[_0x3a3527];return _0x4fcf4e;};'use strict';var ChatGroupEvents=require(_0xdf1c('0x0'));var events=[_0xdf1c('0x1'),'remove','update'];function createListener(_0x431bdf,_0x466960){return function(_0x119407){_0x466960[_0xdf1c('0x2')](_0x431bdf,_0x119407);};}function removeListener(_0x395f11,_0x1c0c26){return function(){ChatGroupEvents[_0xdf1c('0x3')](_0x395f11,_0x1c0c26);};}exports[_0xdf1c('0x4')]=function(_0x456b69){for(var _0x576e8e=0x0,_0x4e9adc=events[_0xdf1c('0x5')];_0x576e8e<_0x4e9adc;_0x576e8e++){var _0x3bfb49=events[_0x576e8e];var _0x29eb66=createListener(_0xdf1c('0x6')+_0x3bfb49,_0x456b69);ChatGroupEvents['on'](_0x3bfb49,_0x29eb66);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0afe456..fd81aee 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 _0x8e03=['create','/:id/members','addMessage','put','update','destroy','delete','removeMembers','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post'];(function(_0x5983f3,_0x216373){var _0x1c597f=function(_0x1fb2a7){while(--_0x1fb2a7){_0x5983f3['push'](_0x5983f3['shift']());}};_0x1c597f(++_0x216373);}(_0x8e03,0x74));var _0x38e0=function(_0x26006e,_0x19c18c){_0x26006e=_0x26006e-0x0;var _0x669312=_0x8e03[_0x26006e];return _0x669312;};'use strict';var multer=require(_0x38e0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38e0('0x1'));var router=express[_0x38e0('0x2')]();var fs_extra=require(_0x38e0('0x3'));var auth=require(_0x38e0('0x4'));var interaction=require(_0x38e0('0x5'));var config=require(_0x38e0('0x6'));var controller=require('./chatGroup.controller');router[_0x38e0('0x7')]('/',auth[_0x38e0('0x8')](),controller[_0x38e0('0x9')]);router['get'](_0x38e0('0xa'),auth['isAuthenticated'](),controller[_0x38e0('0xb')]);router[_0x38e0('0x7')](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller['show']);router['get'](_0x38e0('0xd'),auth[_0x38e0('0x8')](),controller[_0x38e0('0xe')]);router[_0x38e0('0x7')]('/:id/members',auth[_0x38e0('0x8')](),controller[_0x38e0('0xf')]);router[_0x38e0('0x7')](_0x38e0('0x10'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x11')]);router[_0x38e0('0x12')]('/',auth[_0x38e0('0x8')](),controller[_0x38e0('0x13')]);router[_0x38e0('0x12')](_0x38e0('0x14'),auth[_0x38e0('0x8')](),controller['addMembers']);router['post'](_0x38e0('0x10'),auth['isAuthenticated'](),controller[_0x38e0('0x15')]);router[_0x38e0('0x16')](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x17')]);router['delete'](_0x38e0('0xc'),auth[_0x38e0('0x8')](),controller[_0x38e0('0x18')]);router[_0x38e0('0x19')](_0x38e0('0x14'),auth['isAuthenticated'](),controller[_0x38e0('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x7c16=['addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x5b3a6a,_0x11d9e2){var _0x5315c3=function(_0xd781b){while(--_0xd781b){_0x5b3a6a['push'](_0x5b3a6a['shift']());}};_0x5315c3(++_0x11d9e2);}(_0x7c16,0x1c7));var _0x67c1=function(_0x36bab3,_0x19ce33){_0x36bab3=_0x36bab3-0x0;var _0x2d3989=_0x7c16[_0x36bab3];return _0x2d3989;};'use strict';var multer=require(_0x67c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x67c1('0x1'));var express=require(_0x67c1('0x2'));var router=express[_0x67c1('0x3')]();var fs_extra=require(_0x67c1('0x4'));var auth=require(_0x67c1('0x5'));var interaction=require(_0x67c1('0x6'));var config=require('../../config/environment');var controller=require(_0x67c1('0x7'));router[_0x67c1('0x8')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0xa')]);router[_0x67c1('0x8')](_0x67c1('0xb'),auth['isAuthenticated'](),controller[_0x67c1('0xc')]);router['get'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller['show']);router['get'](_0x67c1('0xe'),auth[_0x67c1('0x9')](),controller[_0x67c1('0xf')]);router[_0x67c1('0x8')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller['getMembers']);router['get'](_0x67c1('0x11'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x12')]);router[_0x67c1('0x13')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0x14')]);router[_0x67c1('0x13')](_0x67c1('0x10'),auth['isAuthenticated'](),controller[_0x67c1('0x15')]);router[_0x67c1('0x13')]('/:id/messages',auth[_0x67c1('0x9')](),controller[_0x67c1('0x16')]);router['put'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x17')]);router[_0x67c1('0x18')](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x19')]);router[_0x67c1('0x18')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x1a')]);module[_0x67c1('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 8f42e62..44d0fe1 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 _0x0db9=['long','DATE','BOOLEAN','sequelize','ENUM','star','TEXT','STRING'];(function(_0x50cd58,_0x563fa0){var _0x15594a=function(_0x145cc9){while(--_0x145cc9){_0x50cd58['push'](_0x50cd58['shift']());}};_0x15594a(++_0x563fa0);}(_0x0db9,0xa3));var _0x90db=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x0db9[_0x289a67];return _0x572b49;};'use strict';var Sequelize=require(_0x90db('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x90db('0x1')](_0x90db('0x2'),'thumb'),'defaultValue':_0x90db('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x90db('0x3')]},'mailTranscript':{'type':Sequelize[_0x90db('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x90db('0x4')]},'secondDisposition':{'type':Sequelize[_0x90db('0x4')]},'thirdDisposition':{'type':Sequelize[_0x90db('0x4')]},'note':{'type':Sequelize[_0x90db('0x4')]},'browserName':{'type':Sequelize[_0x90db('0x4')]},'browserVersion':{'type':Sequelize[_0x90db('0x4')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x90db('0x4')]},'deviceModel':{'type':Sequelize[_0x90db('0x4')]},'deviceVendor':{'type':Sequelize[_0x90db('0x4')]},'deviceType':{'type':Sequelize[_0x90db('0x4')]},'referer':{'type':Sequelize[_0x90db('0x3')]},'customerIp':{'type':Sequelize[_0x90db('0x4')]},'formData':{'type':Sequelize[_0x90db('0x3')](_0x90db('0x5'))},'read1stAt':{'type':Sequelize[_0x90db('0x6')]},'lastMsgAt':{'type':Sequelize[_0x90db('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x90db('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x90db('0x4')]},'customerPort':{'type':Sequelize[_0x90db('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x90db('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x90db('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3de3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x11e346,_0x1ba6d1){var _0x3b9dbd=function(_0xadaf5a){while(--_0xadaf5a){_0x11e346['push'](_0x11e346['shift']());}};_0x3b9dbd(++_0x1ba6d1);}(_0x3de3,0x1ce));var _0x33de=function(_0x1440ec,_0x4b6aff){_0x1440ec=_0x1440ec-0x0;var _0x13203b=_0x3de3[_0x1440ec];return _0x13203b;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'closed':{'type':Sequelize[_0x33de('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33de('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x33de('0x3'),_0x33de('0x4')),'defaultValue':_0x33de('0x3')},'ratingMessage':{'type':Sequelize[_0x33de('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x33de('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33de('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33de('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x33de('0x6')]},'browserName':{'type':Sequelize[_0x33de('0x6')]},'browserVersion':{'type':Sequelize[_0x33de('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x33de('0x6')]},'deviceModel':{'type':Sequelize[_0x33de('0x6')]},'deviceVendor':{'type':Sequelize[_0x33de('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33de('0x5')]},'customerIp':{'type':Sequelize[_0x33de('0x6')]},'formData':{'type':Sequelize[_0x33de('0x5')](_0x33de('0x8'))},'read1stAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x33de('0x9')]('in',_0x33de('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x33de('0x6')]},'customerPort':{'type':Sequelize[_0x33de('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x33de('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f6f0941..140cc33 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 _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(_0x2fc67b,_0x404917){var _0x2ca4b4=function(_0x39a5ba){while(--_0x39a5ba){_0x2fc67b['push'](_0x2fc67b['shift']());}};_0x2ca4b4(++_0x404917);}(_0xef0f,0x168));var _0xfef0=function(_0x4917de,_0x4cca9b){_0x4917de=_0x4917de-0x0;var _0x11d892=_0xef0f[_0x4917de];return _0x11d892;};'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
+var _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x43bc8f,_0x24a26a){_0x43bc8f=_0x43bc8f-0x0;var _0x34f552=_0xd7d1[_0x43bc8f];return _0x34f552;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 4dbd23c..d40ed4e 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 _0x6eec=['setMaxListeners','save','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x3dda1e,_0x17a46c){var _0x4b8cee=function(_0x7b86e6){while(--_0x7b86e6){_0x3dda1e['push'](_0x3dda1e['shift']());}};_0x4b8cee(++_0x17a46c);}(_0x6eec,0x106));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc6ee('0x0'));var ChatInteraction=require(_0xc6ee('0x1'))['db'][_0xc6ee('0x2')];var ChatMessage=require(_0xc6ee('0x1'))['db'][_0xc6ee('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc6ee('0x4')](0x0);var events={'afterCreate':_0xc6ee('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21c022){return function(_0x2be781,_0x38ca93,_0x1a3bbd){_0x2be781[_0xc6ee('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e9732){_0x2be781[_0xc6ee('0x7')](_0xc6ee('0x8'),_0x5e9732[_0xc6ee('0x9')](function(_0x4a9edf){return{'id':_0x4a9edf['id']};}));return ChatMessage[_0xc6ee('0xa')]({'where':{'ChatInteractionId':_0x2be781['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc6ee('0xb')](function(_0x3f4276){_0x2be781[_0xc6ee('0x7')](_0xc6ee('0xc'),_0x3f4276[_0xc6ee('0xd')]);ChatInteractionEvents[_0xc6ee('0xe')](_0x21c022+':'+_0x2be781['id'],_0x2be781);ChatInteractionEvents['emit'](_0x21c022,_0x2be781);_0x1a3bbd(null);})[_0xc6ee('0xf')](_0x1a3bbd(null));};}for(var e in events){if(events[_0xc6ee('0x10')](e)){var event=events[e];ChatInteraction[_0xc6ee('0x11')](e,emitEvent(event));}}module[_0xc6ee('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xf12d=['Users','map','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue'];(function(_0x5efbce,_0x3d9ebd){var _0x28f15c=function(_0x20045b){while(--_0x20045b){_0x5efbce['push'](_0x5efbce['shift']());}};_0x28f15c(++_0x3d9ebd);}(_0xf12d,0x119));var _0xdf12=function(_0x35f3d4,_0x1ab86d){_0x35f3d4=_0x35f3d4-0x0;var _0x27c69b=_0xf12d[_0x35f3d4];return _0x27c69b;};'use strict';var EventEmitter=require(_0xdf12('0x0'));var ChatInteraction=require(_0xdf12('0x1'))['db'][_0xdf12('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xdf12('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf12('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf12('0x5'),'afterDestroy':'remove'};function emitEvent(_0x376365){return function(_0x115a71,_0x3061d9,_0x109355){_0x115a71[_0xdf12('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x877239){_0x115a71[_0xdf12('0x7')](_0xdf12('0x8'),_0x877239[_0xdf12('0x9')](function(_0xdf393b){return{'id':_0xdf393b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x115a71['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf12('0xa')](function(_0x1c254d){_0x115a71[_0xdf12('0x7')](_0xdf12('0xb'),_0x1c254d[_0xdf12('0xc')]);ChatInteractionEvents['emit'](_0x376365+':'+_0x115a71['id'],_0x115a71);ChatInteractionEvents[_0xdf12('0xd')](_0x376365,_0x115a71);_0x109355(null);})[_0xdf12('0xe')](_0x109355(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdf12('0xf')](e,emitEvent(event));}}module[_0xdf12('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 2d6554f..1003461 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 _0xa446=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions'];(function(_0x2cefd2,_0x3eed48){var _0x528537=function(_0x4a529b){while(--_0x4a529b){_0x2cefd2['push'](_0x2cefd2['shift']());}};_0x528537(++_0x3eed48);}(_0xa446,0x185));var _0x6a44=function(_0xc59fc6,_0x1938fd){_0xc59fc6=_0xc59fc6-0x0;var _0xd96754=_0xa446[_0xc59fc6];return _0xd96754;};'use strict';var _=require(_0x6a44('0x0'));var util=require(_0x6a44('0x1'));var logger=require(_0x6a44('0x2'))('api');var moment=require(_0x6a44('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a44('0x4'));var rimraf=require(_0x6a44('0x5'));var config=require(_0x6a44('0x6'));var attributes=require(_0x6a44('0x7'));module[_0x6a44('0x8')]=function(_0x3c3252,_0x5e4f23){return _0x3c3252['define'](_0x6a44('0x9'),attributes,{'tableName':_0x6a44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46fdb2,_0x51a29c,_0x36cf42){if(_0x46fdb2['changed'](_0x6a44('0xb'))){_0x46fdb2[_0x6a44('0xc')]=moment()[_0x6a44('0xd')](_0x6a44('0xe'));}_0x36cf42(null,_0x46fdb2);}},'charset':'utf8mb4','collate':_0x6a44('0xf')});};
\ No newline at end of file
+var _0x867a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x867a,0x1b4));var _0xa867=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x867a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa867('0x0'));var logger=require(_0xa867('0x1'))(_0xa867('0x2'));var moment=require(_0xa867('0x3'));var BPromise=require(_0xa867('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa867('0x5'));var rimraf=require(_0xa867('0x6'));var config=require(_0xa867('0x7'));var attributes=require(_0xa867('0x8'));module[_0xa867('0x9')]=function(_0x13997b,_0x2d6c4f){return _0x13997b[_0xa867('0xa')]('ChatInteraction',attributes,{'tableName':_0xa867('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48fa8f,_0x52297f,_0xa27cd5){if(_0x48fa8f['changed']('closed')){_0x48fa8f[_0xa867('0xc')]=moment()[_0xa867('0xd')](_0xa867('0xe'));}_0xa27cd5(null,_0x48fa8f);}},'charset':'utf8mb4','collate':_0xa867('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index a757226..c39665a 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 _0x113b=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatInteraction.socket','then'];(function(_0x30fa58,_0x51af0e){var _0x4598a8=function(_0x5d9e1f){while(--_0x5d9e1f){_0x30fa58['push'](_0x30fa58['shift']());}};_0x4598a8(++_0x51af0e);}(_0x113b,0x15f));var _0xb113=function(_0x211f5f,_0xc6daac){_0x211f5f=_0x211f5f-0x0;var _0x4feb86=_0x113b[_0x211f5f];return _0x4feb86;};'use strict';var _=require(_0xb113('0x0'));var util=require(_0xb113('0x1'));var moment=require(_0xb113('0x2'));var BPromise=require(_0xb113('0x3'));var rs=require(_0xb113('0x4'));var fs=require('fs');var Redis=require(_0xb113('0x5'));var db=require(_0xb113('0x6'))['db'];var utils=require(_0xb113('0x7'));var logger=require(_0xb113('0x8'))(_0xb113('0x9'));var config=require(_0xb113('0xa'));var jayson=require(_0xb113('0xb'));var client=jayson['client'][_0xb113('0xc')]({'port':0x232a});config['redis']=_[_0xb113('0xd')](config[_0xb113('0xe')],{'host':_0xb113('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb113('0xe')]));require(_0xb113('0x10'))['register'](socket);function respondWithRpcPromise(_0x562c62,_0x313e00,_0xa33b64){return new BPromise(function(_0x148bde,_0x58ad74){return client['request'](_0x562c62,_0xa33b64)[_0xb113('0x11')](function(_0x1e69b0){logger['info'](_0xb113('0x12'),_0x313e00,_0xb113('0x13'));logger[_0xb113('0x14')](_0xb113('0x15'),_0x313e00,_0xb113('0x13'),JSON[_0xb113('0x16')](_0x1e69b0));if(_0x1e69b0[_0xb113('0x17')]){if(_0x1e69b0[_0xb113('0x17')]['code']===0x1f4){logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x1e69b0['error'][_0xb113('0x18')]);return _0x58ad74(_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);}logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);return _0x148bde(_0x1e69b0[_0xb113('0x17')][_0xb113('0x18')]);}else{logger[_0xb113('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x313e00,_0xb113('0x13'));_0x148bde(_0x1e69b0['result']['message']);}})[_0xb113('0x1a')](function(_0x44e629){logger[_0xb113('0x17')](_0xb113('0x12'),_0x313e00,_0x44e629);_0x58ad74(_0x44e629);});});}exports[_0xb113('0x1b')]=function(_0x3fa7cd){var _0x12c467=this;return new Promise(function(_0x362ad1,_0x53a476){return db[_0xb113('0x1c')]['update'](_0x3fa7cd[_0xb113('0x1d')],{'raw':_0x3fa7cd['options']?_0x3fa7cd[_0xb113('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa7cd['options']?_0x3fa7cd[_0xb113('0x1e')]['where']||null:null,'attributes':_0x3fa7cd[_0xb113('0x1e')]?_0x3fa7cd[_0xb113('0x1e')][_0xb113('0x1f')]||null:null,'limit':_0x3fa7cd[_0xb113('0x1e')]?_0x3fa7cd[_0xb113('0x1e')][_0xb113('0x20')]||null:null})['then'](function(_0x58b1ff){logger[_0xb113('0x19')](_0xb113('0x1b'),_0x3fa7cd);logger[_0xb113('0x14')](_0xb113('0x1b'),_0x3fa7cd,JSON[_0xb113('0x16')](_0x58b1ff));_0x362ad1(_0x58b1ff);})[_0xb113('0x1a')](function(_0x370945){logger[_0xb113('0x17')](_0xb113('0x1b'),_0x370945[_0xb113('0x18')],_0x3fa7cd);_0x53a476(_0x12c467[_0xb113('0x17')](0x1f4,_0x370945[_0xb113('0x18')]));});});};exports[_0xb113('0x21')]=function(_0x1f6c13){return new Promise(function(_0x1cbd8c,_0x4b7685){return db['ChatInteraction'][_0xb113('0x22')]({'where':_0x1f6c13[_0xb113('0x1e')]?_0x1f6c13[_0xb113('0x1e')][_0xb113('0x23')]||null:null})[_0xb113('0x11')](function(_0x1f0a01){if(_0x1f0a01){return _0x1f0a01[_0xb113('0x24')](_0x1f6c13[_0xb113('0x1d')][_0xb113('0x25')],_[_0xb113('0x26')](_0x1f6c13[_0xb113('0x1d')],[_0xb113('0x25'),'id'])||{});}})[_0xb113('0x27')](function(_0x379651){logger[_0xb113('0x19')](_0xb113('0x28'),_0x1f6c13);logger[_0xb113('0x14')]('AddTags',_0x1f6c13,JSON[_0xb113('0x16')](_0x379651));_0x1cbd8c(_0x379651);})[_0xb113('0x1a')](function(_0x3601d3){logger[_0xb113('0x17')](_0xb113('0x28'),_0x3601d3['message'],_0x1f6c13);_0x4b7685(_this[_0xb113('0x17')](0x1f4,_0x3601d3[_0xb113('0x18')]));});});};
\ No newline at end of file
+var _0xdafe=['stringify','catch','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes'];(function(_0x150961,_0x211501){var _0x5e210c=function(_0x186414){while(--_0x186414){_0x150961['push'](_0x150961['shift']());}};_0x5e210c(++_0x211501);}(_0xdafe,0x182));var _0xedaf=function(_0x209609,_0x31ef4e){_0x209609=_0x209609-0x0;var _0x4aa468=_0xdafe[_0x209609];return _0x4aa468;};'use strict';var _=require(_0xedaf('0x0'));var util=require('util');var moment=require(_0xedaf('0x1'));var BPromise=require(_0xedaf('0x2'));var rs=require(_0xedaf('0x3'));var fs=require('fs');var Redis=require(_0xedaf('0x4'));var db=require(_0xedaf('0x5'))['db'];var utils=require(_0xedaf('0x6'));var logger=require(_0xedaf('0x7'))(_0xedaf('0x8'));var config=require(_0xedaf('0x9'));var jayson=require(_0xedaf('0xa'));var client=jayson[_0xedaf('0xb')][_0xedaf('0xc')]({'port':0x232a});config[_0xedaf('0xd')]=_['defaults'](config[_0xedaf('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xedaf('0xe'))(new Redis(config[_0xedaf('0xd')]));require(_0xedaf('0xf'))[_0xedaf('0x10')](socket);function respondWithRpcPromise(_0x4869f9,_0x32603c,_0x1a6df9){return new BPromise(function(_0x4a5a9b,_0x4bfafe){return client['request'](_0x4869f9,_0x1a6df9)[_0xedaf('0x11')](function(_0x134a28){logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));logger[_0xedaf('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x32603c,_0xedaf('0x14'),JSON['stringify'](_0x134a28));if(_0x134a28[_0xedaf('0x16')]){if(_0x134a28['error'][_0xedaf('0x17')]===0x1f4){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);return _0x4bfafe(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')]['message']);return _0x4a5a9b(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}else{logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));_0x4a5a9b(_0x134a28[_0xedaf('0x19')]['message']);}})['catch'](function(_0x233617){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x233617);_0x4bfafe(_0x233617);});});}exports[_0xedaf('0x1a')]=function(_0x4633ae){var _0x45a5b2=this;return new Promise(function(_0x5445f7,_0x33138d){return db[_0xedaf('0x1b')][_0xedaf('0x1c')](_0x4633ae[_0xedaf('0x1d')],{'raw':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null,'attributes':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae['options'][_0xedaf('0x21')]||null:null,'limit':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')]['limit']||null:null})['then'](function(_0x4ee380){logger[_0xedaf('0x12')](_0xedaf('0x1a'),_0x4633ae);logger['debug'](_0xedaf('0x1a'),_0x4633ae,JSON[_0xedaf('0x22')](_0x4ee380));_0x5445f7(_0x4ee380);})[_0xedaf('0x23')](function(_0x4a780f){logger['error'](_0xedaf('0x1a'),_0x4a780f[_0xedaf('0x18')],_0x4633ae);_0x33138d(_0x45a5b2['error'](0x1f4,_0x4a780f[_0xedaf('0x18')]));});});};exports[_0xedaf('0x24')]=function(_0x23f02e){return new Promise(function(_0x5c375f,_0x2a8b7d){return db[_0xedaf('0x1b')]['find']({'where':_0x23f02e[_0xedaf('0x1e')]?_0x23f02e[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null})[_0xedaf('0x11')](function(_0x3c0347){if(_0x3c0347){return _0x3c0347[_0xedaf('0x25')](_0x23f02e['body'][_0xedaf('0x26')],_[_0xedaf('0x27')](_0x23f02e[_0xedaf('0x1d')],[_0xedaf('0x26'),'id'])||{});}})[_0xedaf('0x28')](function(_0x4b41a3){logger['info']('AddTags',_0x23f02e);logger[_0xedaf('0x15')](_0xedaf('0x29'),_0x23f02e,JSON['stringify'](_0x4b41a3));_0x5c375f(_0x4b41a3);})[_0xedaf('0x23')](function(_0xfbb947){logger[_0xedaf('0x16')](_0xedaf('0x29'),_0xfbb947['message'],_0x23f02e);_0x2a8b7d(_this[_0xedaf('0x16')](0x1f4,_0xfbb947[_0xedaf('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index e49d1bf..e60a67f 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 _0x9500=['chatInteraction:','./chatInteraction.events','save','update','register','length'];(function(_0x5870c1,_0x173ba3){var _0x344685=function(_0x1984be){while(--_0x1984be){_0x5870c1['push'](_0x5870c1['shift']());}};_0x344685(++_0x173ba3);}(_0x9500,0x8b));var _0x0950=function(_0x1808f9,_0x322e07){_0x1808f9=_0x1808f9-0x0;var _0x2ffc89=_0x9500[_0x1808f9];return _0x2ffc89;};'use strict';var ChatInteractionEvents=require(_0x0950('0x0'));var events=[_0x0950('0x1'),'remove',_0x0950('0x2')];function createListener(_0x11f820,_0x49838d){return function(_0x1f6a8c){_0x49838d['emit'](_0x11f820,_0x1f6a8c);};}function removeListener(_0x388800,_0x1dd076){return function(){ChatInteractionEvents['removeListener'](_0x388800,_0x1dd076);};}exports[_0x0950('0x3')]=function(_0x2d1b1b){for(var _0xe88794=0x0,_0x228bdb=events[_0x0950('0x4')];_0xe88794<_0x228bdb;_0xe88794++){var _0x213e67=events[_0xe88794];var _0x53f009=createListener(_0x0950('0x5')+_0x213e67,_0x2d1b1b);ChatInteractionEvents['on'](_0x213e67,_0x53f009);}};
\ No newline at end of file
+var _0x9865=['emit','removeListener','register','./chatInteraction.events','save','remove'];(function(_0x459cd7,_0x3a1c34){var _0x125653=function(_0x26c7e0){while(--_0x26c7e0){_0x459cd7['push'](_0x459cd7['shift']());}};_0x125653(++_0x3a1c34);}(_0x9865,0x1dd));var _0x5986=function(_0x12be85,_0x4a5721){_0x12be85=_0x12be85-0x0;var _0x5a1135=_0x9865[_0x12be85];return _0x5a1135;};'use strict';var ChatInteractionEvents=require(_0x5986('0x0'));var events=[_0x5986('0x1'),_0x5986('0x2'),'update'];function createListener(_0x2fac99,_0x13474e){return function(_0x16ba5f){_0x13474e[_0x5986('0x3')](_0x2fac99,_0x16ba5f);};}function removeListener(_0x38b430,_0xe8aa39){return function(){ChatInteractionEvents[_0x5986('0x4')](_0x38b430,_0xe8aa39);};}exports[_0x5986('0x5')]=function(_0x1f5e19){for(var _0x5757e5=0x0,_0x4c53ff=events['length'];_0x5757e5<_0x4c53ff;_0x5757e5++){var _0x5c3e3c=events[_0x5757e5];var _0x3ebd8b=createListener('chatInteraction:'+_0x5c3e3c,_0x1f5e19);ChatInteractionEvents['on'](_0x5c3e3c,_0x3ebd8b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 4b9a1d0..a5ad6e4 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 _0xeb0d=['format','%s-%s','now','originalname','replace','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','show','isAuthenticated','getMessages','/:id/my_messages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xeb0d,0x17e));var _0xdeb0=function(_0x587a71,_0x332e22){_0x587a71=_0x587a71-0x0;var _0x4b9fea=_0xeb0d[_0x587a71];return _0x4b9fea;};'use strict';var multer=require(_0xdeb0('0x0'));var util=require(_0xdeb0('0x1'));var path=require(_0xdeb0('0x2'));var timeout=require(_0xdeb0('0x3'));var express=require(_0xdeb0('0x4'));var router=express['Router']();var fs_extra=require(_0xdeb0('0x5'));var auth=require(_0xdeb0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdeb0('0x7'));var controller=require(_0xdeb0('0x8'));router[_0xdeb0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdeb0('0x9')](_0xdeb0('0xa'),auth['isAuthenticated'](),controller[_0xdeb0('0xb')]);router[_0xdeb0('0x9')](_0xdeb0('0xc'),auth[_0xdeb0('0xd')](),controller[_0xdeb0('0xe')]);router['get']('/:id/attachment_download',auth[_0xdeb0('0xd')](),controller['attachmentDownload']);router[_0xdeb0('0x9')]('/:id/messages',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x10')]);router[_0xdeb0('0x9')](_0xdeb0('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get']('/:id/download',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x12')]);router[_0xdeb0('0x13')]('/',auth[_0xdeb0('0xf')](),controller[_0xdeb0('0x14')]);router[_0xdeb0('0x13')](_0xdeb0('0x15'),auth['isAuthenticated'](),controller[_0xdeb0('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf33cc,_0x2eaeae,_0x201eb3){_0x201eb3(null,path[_0xdeb0('0x17')](config[_0xdeb0('0x18')],_0xdeb0('0x19')));},'filename':function(_0x3b1bc0,_0x1f99ad,_0x4e3799){_0x4e3799(null,util[_0xdeb0('0x1a')](_0xdeb0('0x1b'),Date[_0xdeb0('0x1c')](),_0x1f99ad[_0xdeb0('0x1d')][_0xdeb0('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdeb0('0x13')]('/:id/attachment_upload',upload[_0xdeb0('0x1f')]('file'),controller[_0xdeb0('0x20')]);router['post'](_0xdeb0('0x21'),auth[_0xdeb0('0xd')](),controller[_0xdeb0('0x22')]);router[_0xdeb0('0x13')]('/:id/tags',auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')](_0xdeb0('0x24'),_0xdeb0('0x25')),controller[_0xdeb0('0x26')]);router[_0xdeb0('0x27')](_0xdeb0('0xc'),auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')](_0xdeb0('0x24'),_0xdeb0('0x28')),controller['update']);router[_0xdeb0('0x27')](_0xdeb0('0x29'),controller[_0xdeb0('0x2a')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xdeb0('0x2b')]);router['put'](_0xdeb0('0x2c'),controller[_0xdeb0('0x2d')]);router[_0xdeb0('0x2e')](_0xdeb0('0xc'),auth[_0xdeb0('0xf')](),interaction[_0xdeb0('0x23')]('chat',_0xdeb0('0x2f')),controller[_0xdeb0('0x30')]);router['delete'](_0xdeb0('0x31'),auth[_0xdeb0('0xf')](),controller['removeTags']);module[_0xdeb0('0x32')]=router;
\ No newline at end of file
+var _0xf6f6=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','destroy','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated'];(function(_0x1ecdaa,_0x32a5f5){var _0x141bb7=function(_0x496b1a){while(--_0x496b1a){_0x1ecdaa['push'](_0x1ecdaa['shift']());}};_0x141bb7(++_0x32a5f5);}(_0xf6f6,0xaf));var _0x6f6f=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xf6f6[_0x4c7935];return _0x30651d;};'use strict';var multer=require(_0x6f6f('0x0'));var util=require('util');var path=require(_0x6f6f('0x1'));var timeout=require(_0x6f6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f6f('0x3'));var auth=require(_0x6f6f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f6f('0x5'));var controller=require(_0x6f6f('0x6'));router[_0x6f6f('0x7')]('/',auth[_0x6f6f('0x8')](),controller['index']);router[_0x6f6f('0x7')]('/describe',auth[_0x6f6f('0x8')](),controller['describe']);router[_0x6f6f('0x7')](_0x6f6f('0x9'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xb')]);router[_0x6f6f('0x7')](_0x6f6f('0xc'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xd')]);router[_0x6f6f('0x7')](_0x6f6f('0xe'),auth['isAuthenticated'](),controller[_0x6f6f('0xf')]);router[_0x6f6f('0x7')](_0x6f6f('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x11')]);router['get'](_0x6f6f('0x12'),auth[_0x6f6f('0x8')](),controller[_0x6f6f('0x13')]);router[_0x6f6f('0x14')]('/',auth[_0x6f6f('0x8')](),controller['create']);router[_0x6f6f('0x14')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x6f6f('0x15')]);var upload=multer({'storage':multer[_0x6f6f('0x16')]({'destination':function(_0x44fa82,_0x4c855e,_0x47bad1){_0x47bad1(null,path['join'](config[_0x6f6f('0x17')],_0x6f6f('0x18')));},'filename':function(_0x280c8f,_0x396ba6,_0x29a2b8){_0x29a2b8(null,util[_0x6f6f('0x19')](_0x6f6f('0x1a'),Date[_0x6f6f('0x1b')](),_0x396ba6['originalname'][_0x6f6f('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6f6f('0x14')](_0x6f6f('0x1d'),upload['single'](_0x6f6f('0x1e')),controller[_0x6f6f('0x1f')]);router[_0x6f6f('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x20')]);router[_0x6f6f('0x14')](_0x6f6f('0x21'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:addtags'),controller['addTags']);router[_0x6f6f('0x24')](_0x6f6f('0x9'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:update'),controller[_0x6f6f('0x25')]);router[_0x6f6f('0x24')](_0x6f6f('0x26'),controller[_0x6f6f('0x27')]);router[_0x6f6f('0x24')]('/:id/abandon',auth[_0x6f6f('0xa')](),controller[_0x6f6f('0x28')]);router[_0x6f6f('0x24')](_0x6f6f('0x29'),controller['close']);router[_0x6f6f('0x2a')](_0x6f6f('0x9'),auth['isAuthenticated'](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:destroy'),controller[_0x6f6f('0x2b')]);router[_0x6f6f('0x2a')](_0x6f6f('0x21'),auth['isAuthenticated'](),controller[_0x6f6f('0x2c')]);module[_0x6f6f('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ca540b5..b7c6451 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 _0xac2d=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xac2d,0x1f4));var _0xdac2=function(_0x2f0f05,_0x2ef4e2){_0x2f0f05=_0x2f0f05-0x0;var _0x59ce36=_0xac2d[_0x2f0f05];return _0x59ce36;};'use strict';var Sequelize=require('sequelize');module[_0xdac2('0x0')]={'body':{'type':Sequelize[_0xdac2('0x1')](_0xdac2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdac2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdac2('0x4')]}};
\ No newline at end of file
+var _0x75b2=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e14b7,_0x405dbc){var _0x4570f6=function(_0x29d285){while(--_0x29d285){_0x3e14b7['push'](_0x3e14b7['shift']());}};_0x4570f6(++_0x405dbc);}(_0x75b2,0x1c0));var _0x275b=function(_0x125597,_0x1d5ddd){_0x125597=_0x125597-0x0;var _0x5a6818=_0x75b2[_0x125597];return _0x5a6818;};'use strict';var Sequelize=require(_0x275b('0x0'));module[_0x275b('0x1')]={'body':{'type':Sequelize[_0x275b('0x2')](_0x275b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x275b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x275b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9f9242f..9bd14be 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 _0x3bc8=['fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','ChatInternalMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','describe','messages','lastMessageAt','lastMessage','getUsers','User','agent','admin','user'];(function(_0x4dba31,_0x3ce4c5){var _0x35cec6=function(_0x2f272d){while(--_0x2f272d){_0x4dba31['push'](_0x4dba31['shift']());}};_0x35cec6(++_0x3ce4c5);}(_0x3bc8,0x160));var _0x83bc=function(_0x5d7ff4,_0x1384c1){_0x5d7ff4=_0x5d7ff4-0x0;var _0x3edd41=_0x3bc8[_0x5d7ff4];return _0x3edd41;};'use strict';var emlformat=require(_0x83bc('0x0'));var rimraf=require(_0x83bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x83bc('0x2'));var moment=require(_0x83bc('0x3'));var BPromise=require(_0x83bc('0x4'));var Mustache=require(_0x83bc('0x5'));var util=require(_0x83bc('0x6'));var path=require(_0x83bc('0x7'));var sox=require(_0x83bc('0x8'));var csv=require('to-csv');var ejs=require(_0x83bc('0x9'));var fs=require('fs');var fs_extra=require(_0x83bc('0xa'));var _=require(_0x83bc('0xb'));var squel=require(_0x83bc('0xc'));var crypto=require(_0x83bc('0xd'));var jsforce=require(_0x83bc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x83bc('0xf'));var querystring=require(_0x83bc('0x10'));var Papa=require('papaparse');var Redis=require(_0x83bc('0x11'));var authService=require(_0x83bc('0x12'));var qs=require(_0x83bc('0x13'));var as=require(_0x83bc('0x14'));var hardwareService=require(_0x83bc('0x15'));var logger=require(_0x83bc('0x16'))(_0x83bc('0x17'));var utils=require('../../config/utils');var config=require(_0x83bc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x83bc('0x19'))['db'];config[_0x83bc('0x1a')]=_['defaults'](config[_0x83bc('0x1a')],{'host':_0x83bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83bc('0x1a')]));require(_0x83bc('0x1c'))[_0x83bc('0x1d')](socket);function respondWithStatusCode(_0x2dca73,_0x43ef1b){_0x43ef1b=_0x43ef1b||0xcc;return function(_0xe95bef){if(_0xe95bef){return _0x2dca73[_0x83bc('0x1e')](_0x43ef1b);}return _0x2dca73['status'](_0x43ef1b)[_0x83bc('0x1f')]();};}function respondWithResult(_0xfcb918,_0x4aa4eb){_0x4aa4eb=_0x4aa4eb||0xc8;return function(_0x34a759){if(_0x34a759){return _0xfcb918[_0x83bc('0x20')](_0x4aa4eb)[_0x83bc('0x21')](_0x34a759);}};}function respondWithFilteredResult(_0x22fdf3,_0x19f246){return function(_0x2b7afa){if(_0x2b7afa){var _0x381642=typeof _0x19f246[_0x83bc('0x22')]===_0x83bc('0x23')&&typeof _0x19f246[_0x83bc('0x24')]==='undefined';var _0x1272f4=_0x2b7afa[_0x83bc('0x25')];var _0x424d65=_0x381642?0x0:_0x19f246[_0x83bc('0x22')];var _0x2216f4=_0x381642?_0x2b7afa[_0x83bc('0x25')]:_0x19f246[_0x83bc('0x22')]+_0x19f246[_0x83bc('0x24')];var _0x526014;if(_0x2216f4>=_0x1272f4){_0x2216f4=_0x1272f4;_0x526014=0xc8;}else{_0x526014=0xce;}_0x22fdf3['status'](_0x526014);return _0x22fdf3[_0x83bc('0x26')](_0x83bc('0x27'),_0x424d65+'-'+_0x2216f4+'/'+_0x1272f4)[_0x83bc('0x21')](_0x2b7afa);}return null;};}function patchUpdates(_0x134ab2){return function(_0x298a99){try{jsonpatch['apply'](_0x298a99,_0x134ab2,!![]);}catch(_0x3b606c){return BPromise[_0x83bc('0x28')](_0x3b606c);}return _0x298a99['save']();};}function saveUpdates(_0x1c4246,_0x14a684){return function(_0x381d17){if(_0x381d17){return _0x381d17[_0x83bc('0x29')](_0x1c4246)[_0x83bc('0x2a')](function(_0x3a6d8d){return _0x3a6d8d;});}return null;};}function removeEntity(_0x43ae7f,_0x10bd13){return function(_0x3a4b90){if(_0x3a4b90){return _0x3a4b90[_0x83bc('0x2b')]()['then'](function(){_0x43ae7f[_0x83bc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4330ec,_0x148709){return function(_0x2f01ef){if(!_0x2f01ef){_0x4330ec[_0x83bc('0x1e')](0x194);}return _0x2f01ef;};}function handleError(_0x162960,_0x2ca0c6){_0x2ca0c6=_0x2ca0c6||0x1f4;return function(_0x1a5de){logger[_0x83bc('0x2c')](_0x1a5de['stack']);if(_0x1a5de['name']){delete _0x1a5de[_0x83bc('0x2d')];}_0x162960['status'](_0x2ca0c6)[_0x83bc('0x2e')](_0x1a5de);};}exports['index']=function(_0x4daa60,_0x369b88){var _0x5724ff={},_0x2d0c01={},_0x4ce7ea={'count':0x0,'rows':[]};var _0x37faf2=_['map'](db[_0x83bc('0x2f')][_0x83bc('0x30')],function(_0x160900){return{'name':_0x160900['fieldName'],'type':_0x160900[_0x83bc('0x31')][_0x83bc('0x32')]};});_0x2d0c01[_0x83bc('0x33')]=_[_0x83bc('0x34')](_0x37faf2,_0x83bc('0x2d'));_0x2d0c01['query']=_[_0x83bc('0x35')](_0x4daa60[_0x83bc('0x36')]);_0x2d0c01[_0x83bc('0x37')]=_[_0x83bc('0x38')](_0x2d0c01['model'],_0x2d0c01[_0x83bc('0x36')]);_0x5724ff[_0x83bc('0x39')]=_['intersection'](_0x2d0c01[_0x83bc('0x33')],qs[_0x83bc('0x3a')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x3a')]));_0x5724ff[_0x83bc('0x39')]=_0x5724ff['attributes'][_0x83bc('0x3b')]?_0x5724ff[_0x83bc('0x39')]:_0x2d0c01[_0x83bc('0x33')];if(!_0x4daa60['query'][_0x83bc('0x3c')](_0x83bc('0x3d'))){_0x5724ff['limit']=qs['limit'](_0x4daa60['query'][_0x83bc('0x24')]);_0x5724ff[_0x83bc('0x22')]=qs[_0x83bc('0x22')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x22')]);}_0x5724ff[_0x83bc('0x3e')]=qs[_0x83bc('0x3f')](_0x4daa60[_0x83bc('0x36')][_0x83bc('0x3f')]);_0x5724ff[_0x83bc('0x40')]=qs[_0x83bc('0x37')](_[_0x83bc('0x41')](_0x4daa60[_0x83bc('0x36')],_0x2d0c01[_0x83bc('0x37')]),_0x37faf2);if(_0x4daa60[_0x83bc('0x36')][_0x83bc('0x42')]){_0x5724ff[_0x83bc('0x40')]=_[_0x83bc('0x43')](_0x5724ff['where'],{'$or':_['map'](_0x37faf2,function(_0x5202ca){if(_0x5202ca[_0x83bc('0x31')]!==_0x83bc('0x44')){var _0x5fcc26={};_0x5fcc26[_0x5202ca[_0x83bc('0x2d')]]={'$like':'%'+_0x4daa60[_0x83bc('0x36')][_0x83bc('0x42')]+'%'};return _0x5fcc26;}})});}_0x5724ff=_['merge']({},_0x5724ff,_0x4daa60['options']);var _0x3925dc={'where':_0x5724ff[_0x83bc('0x40')]};return db[_0x83bc('0x2f')]['count'](_0x3925dc)[_0x83bc('0x2a')](function(_0x2c7f62){_0x4ce7ea[_0x83bc('0x25')]=_0x2c7f62;if(_0x4daa60[_0x83bc('0x36')][_0x83bc('0x45')]){_0x5724ff[_0x83bc('0x46')]=[{'all':!![]}];}return db[_0x83bc('0x2f')][_0x83bc('0x47')](_0x5724ff);})[_0x83bc('0x2a')](function(_0xaef749){_0x4ce7ea[_0x83bc('0x48')]=_0xaef749;return _0x4ce7ea;})[_0x83bc('0x2a')](respondWithFilteredResult(_0x369b88,_0x5724ff))[_0x83bc('0x49')](handleError(_0x369b88,null));};exports[_0x83bc('0x4a')]=function(_0x5f0cd5,_0x1ea4fb){var _0x3328e9={'raw':!![],'where':{'id':_0x5f0cd5['params']['id']}},_0x36a1b2={};_0x36a1b2[_0x83bc('0x33')]=_[_0x83bc('0x35')](db[_0x83bc('0x2f')][_0x83bc('0x30')]);_0x36a1b2[_0x83bc('0x36')]=_[_0x83bc('0x35')](_0x5f0cd5[_0x83bc('0x36')]);_0x36a1b2['filters']=_[_0x83bc('0x38')](_0x36a1b2[_0x83bc('0x33')],_0x36a1b2[_0x83bc('0x36')]);_0x3328e9['attributes']=_[_0x83bc('0x38')](_0x36a1b2[_0x83bc('0x33')],qs['fields'](_0x5f0cd5[_0x83bc('0x36')]['fields']));_0x3328e9[_0x83bc('0x39')]=_0x3328e9[_0x83bc('0x39')][_0x83bc('0x3b')]?_0x3328e9['attributes']:_0x36a1b2['model'];if(_0x5f0cd5['query']['includeAll']){_0x3328e9['include']=[{'all':!![]}];}_0x3328e9=_[_0x83bc('0x43')]({},_0x3328e9,_0x5f0cd5[_0x83bc('0x4b')]);return db[_0x83bc('0x2f')][_0x83bc('0x4c')](_0x3328e9)[_0x83bc('0x2a')](handleEntityNotFound(_0x1ea4fb,null))[_0x83bc('0x2a')](respondWithResult(_0x1ea4fb,null))[_0x83bc('0x49')](handleError(_0x1ea4fb,null));};exports['create']=function(_0x43cf9e,_0x1dc7bb){return db[_0x83bc('0x2f')][_0x83bc('0x4d')](_0x43cf9e[_0x83bc('0x4e')],{})[_0x83bc('0x2a')](respondWithResult(_0x1dc7bb,0xc9))[_0x83bc('0x49')](handleError(_0x1dc7bb,null));};exports[_0x83bc('0x29')]=function(_0x4a9eb7,_0x3774de){if(_0x4a9eb7[_0x83bc('0x4e')]['id']){delete _0x4a9eb7['body']['id'];}return db[_0x83bc('0x2f')]['find']({'where':{'id':_0x4a9eb7['params']['id']}})[_0x83bc('0x2a')](handleEntityNotFound(_0x3774de,null))[_0x83bc('0x2a')](saveUpdates(_0x4a9eb7[_0x83bc('0x4e')],null))[_0x83bc('0x2a')](respondWithResult(_0x3774de,null))[_0x83bc('0x49')](handleError(_0x3774de,null));};exports[_0x83bc('0x2b')]=function(_0x47464a,_0x2529c9){return db['ChatInternalMessage']['find']({'where':{'id':_0x47464a['params']['id']}})[_0x83bc('0x2a')](handleEntityNotFound(_0x2529c9,null))['then'](removeEntity(_0x2529c9,null))[_0x83bc('0x49')](handleError(_0x2529c9,null));};exports[_0x83bc('0x4f')]=function(_0x3ffd6c,_0xc3887d){return db['ChatInternalMessage'][_0x83bc('0x4f')]()[_0x83bc('0x2a')](respondWithResult(_0xc3887d,null))[_0x83bc('0x49')](handleError(_0xc3887d,null));};function wrapUser(_0x384135){return function(_0x3dd356){var _0x389f55=_0x384135['get']({'plain':!![]});_0x389f55[_0x83bc('0x50')]=[];if(_0x3dd356){_0x389f55[_0x83bc('0x51')]=_0x3dd356['createdAt'];_0x389f55['lastMessage']=_0x3dd356;}else{_0x389f55[_0x83bc('0x51')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x389f55[_0x83bc('0x52')]={};}return _0x389f55;};}exports[_0x83bc('0x53')]=function(_0x19993b,_0x4a66b5,_0x14afbc){var _0x2151a5=[];return db[_0x83bc('0x54')][_0x83bc('0x47')]({'where':{'role':[_0x83bc('0x55'),_0x83bc('0x56'),_0x83bc('0x57')]},'attributes':['id',_0x83bc('0x58'),_0x83bc('0x2d'),_0x83bc('0x59'),'userpic',_0x83bc('0x5a'),'online',_0x83bc('0x5b'),_0x83bc('0x5c'),_0x83bc('0x5d')],'order':qs[_0x83bc('0x3f')](_0x83bc('0x5e')),'include':[{'model':db[_0x83bc('0x5f')],'as':_0x83bc('0x60'),'attributes':['id',_0x83bc('0x2d'),_0x83bc('0x31')],'through':{'attributes':[]}}]})[_0x83bc('0x2a')](function(_0x211b09){if(_0x211b09){var _0x11e988=_0x19993b['user']['get']({'plain':!![]});if(!_0x11e988)throw new Error(_0x83bc('0x61'));if(_0x11e988['role']===_0x83bc('0x57')){return db[_0x83bc('0x62')][_0x83bc('0x4c')]({'where':{'name':_0x83bc('0x63'),'userProfileId':_0x11e988[_0x83bc('0x64')]},'raw':!![]})[_0x83bc('0x2a')](function(_0x176e08){if(_0x176e08){if(_0x176e08[_0x83bc('0x65')]===0x0){return db[_0x83bc('0x66')][_0x83bc('0x47')]({'where':{'sectionId':_0x176e08['id']},'raw':!![]})[_0x83bc('0x2a')](function(_0x2c4495){var _0x5e65cf=[];if(_['isEmpty'](_0x2c4495)){_0x5e65cf=_[_0x83bc('0x42')](_0x211b09,function(_0x59fa74){if(_0x59fa74['role']!==_0x83bc('0x55')){return _0x59fa74;}});return _0x5e65cf;}else{for(var _0x5837bf=0x0;_0x5837bf<_0x211b09['length'];_0x5837bf++){var _0x5bd859=_0x211b09[_0x5837bf];if(_0x5bd859[_0x83bc('0x59')]===_0x83bc('0x55')){var _0x4665ad=_[_0x83bc('0x4c')](_0x2c4495,function(_0x40d219){return _0x40d219[_0x83bc('0x67')]===_0x5bd859['id'];});if(_0x4665ad)_0x5e65cf[_0x83bc('0x68')](_0x5bd859);}else{_0x5e65cf[_0x83bc('0x68')](_0x5bd859);}}return _0x5e65cf;}});}else{return _0x211b09;}}else{var _0x3c8eb4=_[_0x83bc('0x42')](_0x211b09,function(_0xa3610b){if(_0xa3610b['role']!=='agent'){return _0xa3610b;}});return _0x3c8eb4;}});}else{return _0x211b09;}}})[_0x83bc('0x2a')](function(_0x4ee8c4){var _0x196ba2=[];if(_0x4ee8c4){_0x2151a5=_0x4ee8c4;for(var _0x2fbc3d=0x0;_0x2fbc3d<_0x4ee8c4[_0x83bc('0x3b')];_0x2fbc3d+=0x1){_0x2151a5[_0x2fbc3d]['messages']=[];_0x196ba2[_0x83bc('0x68')](db[_0x83bc('0x2f')]['find']({'where':{'FromId':[_0x19993b[_0x83bc('0x57')]['id'],_0x4ee8c4[_0x2fbc3d]['id']],'ToId':[_0x19993b['user']['id'],_0x4ee8c4[_0x2fbc3d]['id']],'ChatGroupId':null},'attributes':['id',_0x83bc('0x69'),_0x83bc('0x6a'),'ToId',_0x83bc('0x6b'),'body'],'order':qs['sort'](_0x83bc('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x83bc('0x2a')](wrapUser(_0x4ee8c4[_0x2fbc3d])));}return BPromise[_0x83bc('0x6d')](_0x196ba2);}return[];})[_0x83bc('0x2a')](function(_0x1a12f7){return{'rows':_0x1a12f7,'count':_0x1a12f7[_0x83bc('0x3b')]};})[_0x83bc('0x2a')](respondWithResult(_0x4a66b5,null))['catch'](handleError(_0x4a66b5,null));};
\ No newline at end of file
+var _0xe3cb=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','describe','get','messages','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatInternalMessage','type','model'];(function(_0x14e26d,_0x124ef0){var _0xef0fe2=function(_0x3103db){while(--_0x3103db){_0x14e26d['push'](_0x14e26d['shift']());}};_0xef0fe2(++_0x124ef0);}(_0xe3cb,0x11c));var _0xbe3c=function(_0x3ccd94,_0x3d8018){_0x3ccd94=_0x3ccd94-0x0;var _0x49686c=_0xe3cb[_0x3ccd94];return _0x49686c;};'use strict';var emlformat=require(_0xbe3c('0x0'));var rimraf=require(_0xbe3c('0x1'));var zipdir=require(_0xbe3c('0x2'));var jsonpatch=require(_0xbe3c('0x3'));var rp=require('request-promise');var moment=require(_0xbe3c('0x4'));var BPromise=require(_0xbe3c('0x5'));var Mustache=require(_0xbe3c('0x6'));var util=require(_0xbe3c('0x7'));var path=require(_0xbe3c('0x8'));var sox=require(_0xbe3c('0x9'));var csv=require('to-csv');var ejs=require(_0xbe3c('0xa'));var fs=require('fs');var fs_extra=require(_0xbe3c('0xb'));var _=require(_0xbe3c('0xc'));var squel=require(_0xbe3c('0xd'));var crypto=require(_0xbe3c('0xe'));var jsforce=require(_0xbe3c('0xf'));var deskjs=require(_0xbe3c('0x10'));var toCsv=require(_0xbe3c('0x11'));var querystring=require(_0xbe3c('0x12'));var Papa=require(_0xbe3c('0x13'));var Redis=require(_0xbe3c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xbe3c('0x15'));var as=require(_0xbe3c('0x16'));var hardwareService=require(_0xbe3c('0x17'));var logger=require('../../config/logger')(_0xbe3c('0x18'));var utils=require('../../config/utils');var config=require(_0xbe3c('0x19'));var licenseUtil=require(_0xbe3c('0x1a'));var db=require(_0xbe3c('0x1b'))['db'];config[_0xbe3c('0x1c')]=_[_0xbe3c('0x1d')](config['redis'],{'host':_0xbe3c('0x1e'),'port':0x18eb});var socket=require(_0xbe3c('0x1f'))(new Redis(config[_0xbe3c('0x1c')]));require('./chatInternalMessage.socket')[_0xbe3c('0x20')](socket);function respondWithStatusCode(_0x502029,_0x128858){_0x128858=_0x128858||0xcc;return function(_0x15172f){if(_0x15172f){return _0x502029[_0xbe3c('0x21')](_0x128858);}return _0x502029[_0xbe3c('0x22')](_0x128858)[_0xbe3c('0x23')]();};}function respondWithResult(_0x75609f,_0x1aff71){_0x1aff71=_0x1aff71||0xc8;return function(_0x1d2b38){if(_0x1d2b38){return _0x75609f['status'](_0x1aff71)[_0xbe3c('0x24')](_0x1d2b38);}};}function respondWithFilteredResult(_0x55a3a9,_0x5b762e){return function(_0x19afc2){if(_0x19afc2){var _0xb33d7b=typeof _0x5b762e['offset']===_0xbe3c('0x25')&&typeof _0x5b762e[_0xbe3c('0x26')]===_0xbe3c('0x25');var _0x2219ca=_0x19afc2[_0xbe3c('0x27')];var _0x326745=_0xb33d7b?0x0:_0x5b762e[_0xbe3c('0x28')];var _0x1b0470=_0xb33d7b?_0x19afc2[_0xbe3c('0x27')]:_0x5b762e[_0xbe3c('0x28')]+_0x5b762e[_0xbe3c('0x26')];var _0x4a09b8;if(_0x1b0470>=_0x2219ca){_0x1b0470=_0x2219ca;_0x4a09b8=0xc8;}else{_0x4a09b8=0xce;}_0x55a3a9[_0xbe3c('0x22')](_0x4a09b8);return _0x55a3a9['set'](_0xbe3c('0x29'),_0x326745+'-'+_0x1b0470+'/'+_0x2219ca)[_0xbe3c('0x24')](_0x19afc2);}return null;};}function patchUpdates(_0x7ebad7){return function(_0x117d15){try{jsonpatch[_0xbe3c('0x2a')](_0x117d15,_0x7ebad7,!![]);}catch(_0x1ace9d){return BPromise[_0xbe3c('0x2b')](_0x1ace9d);}return _0x117d15[_0xbe3c('0x2c')]();};}function saveUpdates(_0x507368,_0x5a5643){return function(_0x4a61c4){if(_0x4a61c4){return _0x4a61c4[_0xbe3c('0x2d')](_0x507368)[_0xbe3c('0x2e')](function(_0x2e005c){return _0x2e005c;});}return null;};}function removeEntity(_0x17657f,_0x48abb9){return function(_0x331566){if(_0x331566){return _0x331566[_0xbe3c('0x2f')]()[_0xbe3c('0x2e')](function(){_0x17657f[_0xbe3c('0x22')](0xcc)[_0xbe3c('0x23')]();});}};}function handleEntityNotFound(_0x433665,_0x5b152c){return function(_0x3dfde7){if(!_0x3dfde7){_0x433665[_0xbe3c('0x21')](0x194);}return _0x3dfde7;};}function handleError(_0xc79910,_0x161cf1){_0x161cf1=_0x161cf1||0x1f4;return function(_0x1928f4){logger[_0xbe3c('0x30')](_0x1928f4[_0xbe3c('0x31')]);if(_0x1928f4[_0xbe3c('0x32')]){delete _0x1928f4['name'];}_0xc79910['status'](_0x161cf1)['send'](_0x1928f4);};}exports['index']=function(_0x4bf8d4,_0x410113){var _0x1ee5e8={},_0x24804e={},_0x1ece8d={'count':0x0,'rows':[]};var _0x9f2d1e=_[_0xbe3c('0x33')](db[_0xbe3c('0x34')]['rawAttributes'],function(_0x42707d){return{'name':_0x42707d['fieldName'],'type':_0x42707d[_0xbe3c('0x35')]['key']};});_0x24804e[_0xbe3c('0x36')]=_[_0xbe3c('0x33')](_0x9f2d1e,_0xbe3c('0x32'));_0x24804e[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x4bf8d4[_0xbe3c('0x37')]);_0x24804e[_0xbe3c('0x39')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],_0x24804e[_0xbe3c('0x37')]);_0x1ee5e8[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],qs['fields'](_0x4bf8d4['query'][_0xbe3c('0x3c')]));_0x1ee5e8[_0xbe3c('0x3b')]=_0x1ee5e8['attributes'][_0xbe3c('0x3d')]?_0x1ee5e8[_0xbe3c('0x3b')]:_0x24804e[_0xbe3c('0x36')];if(!_0x4bf8d4['query'][_0xbe3c('0x3e')](_0xbe3c('0x3f'))){_0x1ee5e8[_0xbe3c('0x26')]=qs[_0xbe3c('0x26')](_0x4bf8d4['query'][_0xbe3c('0x26')]);_0x1ee5e8[_0xbe3c('0x28')]=qs[_0xbe3c('0x28')](_0x4bf8d4[_0xbe3c('0x37')]['offset']);}_0x1ee5e8[_0xbe3c('0x40')]=qs[_0xbe3c('0x41')](_0x4bf8d4['query'][_0xbe3c('0x41')]);_0x1ee5e8['where']=qs['filters'](_[_0xbe3c('0x42')](_0x4bf8d4[_0xbe3c('0x37')],_0x24804e['filters']),_0x9f2d1e);if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x43')]){_0x1ee5e8['where']=_[_0xbe3c('0x44')](_0x1ee5e8[_0xbe3c('0x45')],{'$or':_[_0xbe3c('0x33')](_0x9f2d1e,function(_0xd84bdf){if(_0xd84bdf[_0xbe3c('0x35')]!==_0xbe3c('0x46')){var _0x3b24bb={};_0x3b24bb[_0xd84bdf[_0xbe3c('0x32')]]={'$like':'%'+_0x4bf8d4['query']['filter']+'%'};return _0x3b24bb;}})});}_0x1ee5e8=_['merge']({},_0x1ee5e8,_0x4bf8d4[_0xbe3c('0x47')]);var _0x30db93={'where':_0x1ee5e8['where']};return db[_0xbe3c('0x34')]['count'](_0x30db93)['then'](function(_0x47ae32){_0x1ece8d[_0xbe3c('0x27')]=_0x47ae32;if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x1ee5e8[_0xbe3c('0x49')]=[{'all':!![]}];}return db[_0xbe3c('0x34')][_0xbe3c('0x4a')](_0x1ee5e8);})[_0xbe3c('0x2e')](function(_0x53ef9b){_0x1ece8d[_0xbe3c('0x4b')]=_0x53ef9b;return _0x1ece8d;})[_0xbe3c('0x2e')](respondWithFilteredResult(_0x410113,_0x1ee5e8))[_0xbe3c('0x4c')](handleError(_0x410113,null));};exports['show']=function(_0x3d62ff,_0x216f85){var _0x40c542={'raw':!![],'where':{'id':_0x3d62ff[_0xbe3c('0x4d')]['id']}},_0x435493={};_0x435493['model']=_[_0xbe3c('0x38')](db[_0xbe3c('0x34')][_0xbe3c('0x4e')]);_0x435493[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x3d62ff['query']);_0x435493['filters']=_[_0xbe3c('0x3a')](_0x435493['model'],_0x435493[_0xbe3c('0x37')]);_0x40c542[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x435493[_0xbe3c('0x36')],qs[_0xbe3c('0x3c')](_0x3d62ff['query'][_0xbe3c('0x3c')]));_0x40c542[_0xbe3c('0x3b')]=_0x40c542['attributes'][_0xbe3c('0x3d')]?_0x40c542['attributes']:_0x435493[_0xbe3c('0x36')];if(_0x3d62ff[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x40c542['include']=[{'all':!![]}];}_0x40c542=_[_0xbe3c('0x44')]({},_0x40c542,_0x3d62ff['options']);return db['ChatInternalMessage']['find'](_0x40c542)['then'](handleEntityNotFound(_0x216f85,null))['then'](respondWithResult(_0x216f85,null))[_0xbe3c('0x4c')](handleError(_0x216f85,null));};exports[_0xbe3c('0x4f')]=function(_0x2a6bdb,_0x5b5d78){return db['ChatInternalMessage']['create'](_0x2a6bdb[_0xbe3c('0x50')],{})[_0xbe3c('0x2e')](respondWithResult(_0x5b5d78,0xc9))[_0xbe3c('0x4c')](handleError(_0x5b5d78,null));};exports[_0xbe3c('0x2d')]=function(_0x33bac2,_0x2d66f4){if(_0x33bac2['body']['id']){delete _0x33bac2['body']['id'];}return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x33bac2[_0xbe3c('0x4d')]['id']}})[_0xbe3c('0x2e')](handleEntityNotFound(_0x2d66f4,null))['then'](saveUpdates(_0x33bac2['body'],null))[_0xbe3c('0x2e')](respondWithResult(_0x2d66f4,null))['catch'](handleError(_0x2d66f4,null));};exports[_0xbe3c('0x2f')]=function(_0x5336d0,_0x36d4b5){return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x5336d0[_0xbe3c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36d4b5,null))[_0xbe3c('0x2e')](removeEntity(_0x36d4b5,null))[_0xbe3c('0x4c')](handleError(_0x36d4b5,null));};exports[_0xbe3c('0x51')]=function(_0x1ad725,_0x1bc3b5){return db[_0xbe3c('0x34')][_0xbe3c('0x51')]()[_0xbe3c('0x2e')](respondWithResult(_0x1bc3b5,null))['catch'](handleError(_0x1bc3b5,null));};function wrapUser(_0x33fdd0){return function(_0x35fc4a){var _0x380501=_0x33fdd0[_0xbe3c('0x52')]({'plain':!![]});_0x380501[_0xbe3c('0x53')]=[];if(_0x35fc4a){_0x380501['lastMessageAt']=_0x35fc4a[_0xbe3c('0x54')];_0x380501[_0xbe3c('0x55')]=_0x35fc4a;}else{_0x380501['lastMessageAt']=moment(0x0)[_0xbe3c('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x380501[_0xbe3c('0x55')]={};}return _0x380501;};}exports[_0xbe3c('0x57')]=function(_0x41af49,_0x2c2439,_0x5e7164){var _0x4c7012=[];return db[_0xbe3c('0x58')][_0xbe3c('0x4a')]({'where':{'role':[_0xbe3c('0x59'),_0xbe3c('0x5a'),'user']},'attributes':['id',_0xbe3c('0x5b'),_0xbe3c('0x32'),'role','userpic',_0xbe3c('0x5c'),_0xbe3c('0x5d'),_0xbe3c('0x5e'),_0xbe3c('0x5f'),'showWebBar'],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x60')),'include':[{'model':db[_0xbe3c('0x61')],'as':'VoiceQueues','attributes':['id',_0xbe3c('0x32'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x31572f){if(_0x31572f){var _0x114473=_0x41af49[_0xbe3c('0x62')]['get']({'plain':!![]});if(!_0x114473)throw new Error(_0xbe3c('0x63'));if(_0x114473[_0xbe3c('0x64')]===_0xbe3c('0x62')){return db[_0xbe3c('0x65')][_0xbe3c('0x66')]({'where':{'name':_0xbe3c('0x67'),'userProfileId':_0x114473['userProfileId']},'raw':!![]})[_0xbe3c('0x2e')](function(_0x389dbd){if(_0x389dbd){if(_0x389dbd[_0xbe3c('0x68')]===0x0){return db[_0xbe3c('0x69')][_0xbe3c('0x4a')]({'where':{'sectionId':_0x389dbd['id']},'raw':!![]})['then'](function(_0x577e87){var _0x52eed0=[];if(_[_0xbe3c('0x6a')](_0x577e87)){_0x52eed0=_[_0xbe3c('0x43')](_0x31572f,function(_0x916437){if(_0x916437[_0xbe3c('0x64')]!==_0xbe3c('0x59')){return _0x916437;}});return _0x52eed0;}else{for(var _0x4473e8=0x0;_0x4473e8<_0x31572f['length'];_0x4473e8++){var _0x3fe62b=_0x31572f[_0x4473e8];if(_0x3fe62b[_0xbe3c('0x64')]===_0xbe3c('0x59')){var _0x9d6caf=_['find'](_0x577e87,function(_0x1f5d0e){return _0x1f5d0e[_0xbe3c('0x6b')]===_0x3fe62b['id'];});if(_0x9d6caf)_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}else{_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}}return _0x52eed0;}});}else{return _0x31572f;}}else{var _0xcf8a7f=_['filter'](_0x31572f,function(_0x28171a){if(_0x28171a['role']!==_0xbe3c('0x59')){return _0x28171a;}});return _0xcf8a7f;}});}else{return _0x31572f;}}})[_0xbe3c('0x2e')](function(_0x359d94){var _0x504af7=[];if(_0x359d94){_0x4c7012=_0x359d94;for(var _0x12b923=0x0;_0x12b923<_0x359d94[_0xbe3c('0x3d')];_0x12b923+=0x1){_0x4c7012[_0x12b923][_0xbe3c('0x53')]=[];_0x504af7[_0xbe3c('0x6c')](db['ChatInternalMessage'][_0xbe3c('0x66')]({'where':{'FromId':[_0x41af49['user']['id'],_0x359d94[_0x12b923]['id']],'ToId':[_0x41af49[_0xbe3c('0x62')]['id'],_0x359d94[_0x12b923]['id']],'ChatGroupId':null},'attributes':['id',_0xbe3c('0x54'),'FromId',_0xbe3c('0x6d'),_0xbe3c('0x6e'),_0xbe3c('0x50')],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbe3c('0x2e')](wrapUser(_0x359d94[_0x12b923])));}return BPromise[_0xbe3c('0x70')](_0x504af7);}return[];})[_0xbe3c('0x2e')](function(_0x1ba77c){return{'rows':_0x1ba77c,'count':_0x1ba77c[_0xbe3c('0x3d')]};})[_0xbe3c('0x2e')](respondWithResult(_0x2c2439,null))[_0xbe3c('0x4c')](handleError(_0x2c2439,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7fd5ef0..546ff8e 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 _0xed53=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x9c9f1c,_0x326a86){var _0x7e30d2=function(_0x44d78e){while(--_0x44d78e){_0x9c9f1c['push'](_0x9c9f1c['shift']());}};_0x7e30d2(++_0x326a86);}(_0xed53,0xf9));var _0x3ed5=function(_0x1bc9b0,_0x3ff7fe){_0x1bc9b0=_0x1bc9b0-0x0;var _0xb8efcc=_0xed53[_0x1bc9b0];return _0xb8efcc;};'use strict';var EventEmitter=require(_0x3ed5('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3ed5('0x1')](0x0);var events={'afterCreate':_0x3ed5('0x2'),'afterUpdate':_0x3ed5('0x3'),'afterDestroy':_0x3ed5('0x4')};function emitEvent(_0x38d682){return function(_0x185c13,_0x439f64,_0x2485a9){ChatInternalMessageEvents[_0x3ed5('0x5')](_0x38d682+':'+_0x185c13['id'],_0x185c13);ChatInternalMessageEvents[_0x3ed5('0x5')](_0x38d682,_0x185c13);_0x2485a9(null);};}for(var e in events){if(events[_0x3ed5('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3ed5('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3bc0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3bc0,0xec));var _0x03bc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x3bc0[_0xe73080];return _0x12cbc4;};'use strict';var EventEmitter=require(_0x03bc('0x0'));var ChatInternalMessage=require(_0x03bc('0x1'))['db'][_0x03bc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03bc('0x3')](0x0);var events={'afterCreate':_0x03bc('0x4'),'afterUpdate':_0x03bc('0x5'),'afterDestroy':_0x03bc('0x6')};function emitEvent(_0x4a7840){return function(_0x59a8a0,_0x2caa44,_0x4668d3){ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840+':'+_0x59a8a0['id'],_0x59a8a0);ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840,_0x59a8a0);_0x4668d3(null);};}for(var e in events){if(events[_0x03bc('0x8')](e)){var event=events[e];ChatInternalMessage[_0x03bc('0x9')](e,emitEvent(event));}}module[_0x03bc('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 7ed06d0..b0ec637 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 _0xb080=['utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4'];(function(_0x1c052f,_0xc383d3){var _0x1829b1=function(_0x1d31c2){while(--_0x1d31c2){_0x1c052f['push'](_0x1c052f['shift']());}};_0x1829b1(++_0xc383d3);}(_0xb080,0xfe));var _0x0b08=function(_0x361600,_0x2934b2){_0x361600=_0x361600-0x0;var _0x4c3bfe=_0xb080[_0x361600];return _0x4c3bfe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b08('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0b08('0x1'));var rp=require(_0x0b08('0x2'));var fs=require('fs');var path=require(_0x0b08('0x3'));var rimraf=require('rimraf');var config=require(_0x0b08('0x4'));var attributes=require(_0x0b08('0x5'));module[_0x0b08('0x6')]=function(_0x3a546b,_0xd78b82){return _0x3a546b[_0x0b08('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x0b08('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b08('0x9'),'collate':_0x0b08('0xa')});};
\ No newline at end of file
+var _0xa85b=['exports','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x19708b,_0xe342c1){var _0xebb783=function(_0x1fa024){while(--_0x1fa024){_0x19708b['push'](_0x19708b['shift']());}};_0xebb783(++_0xe342c1);}(_0xa85b,0x1ce));var _0xba85=function(_0x5da099,_0x4c0874){_0x5da099=_0x5da099-0x0;var _0x2336db=_0xa85b[_0x5da099];return _0x2336db;};'use strict';var _=require(_0xba85('0x0'));var util=require('util');var logger=require(_0xba85('0x1'))(_0xba85('0x2'));var moment=require(_0xba85('0x3'));var BPromise=require('bluebird');var rp=require(_0xba85('0x4'));var fs=require('fs');var path=require(_0xba85('0x5'));var rimraf=require(_0xba85('0x6'));var config=require('../../config/environment');var attributes=require(_0xba85('0x7'));module[_0xba85('0x8')]=function(_0x5e0bf5,_0x3fb318){return _0x5e0bf5['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba85('0x9'),'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 6dd92d7..85cf001 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 _0x24f5=['http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x24f5,0x1ee));var _0x524f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x24f5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x524f('0x0'));var util=require(_0x524f('0x1'));var moment=require(_0x524f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x524f('0x3'));var db=require(_0x524f('0x4'))['db'];var utils=require(_0x524f('0x5'));var logger=require(_0x524f('0x6'))(_0x524f('0x7'));var config=require(_0x524f('0x8'));var jayson=require(_0x524f('0x9'));var client=jayson['client'][_0x524f('0xa')]({'port':0x232a});config[_0x524f('0xb')]=_['defaults'](config['redis'],{'host':_0x524f('0xc'),'port':0x18eb});var socket=require(_0x524f('0xd'))(new Redis(config[_0x524f('0xb')]));require(_0x524f('0xe'))['register'](socket);function respondWithRpcPromise(_0x2543bc,_0x6a84e2,_0x7d62ad){return new BPromise(function(_0x5b1328,_0x39b202){return client[_0x524f('0xf')](_0x2543bc,_0x7d62ad)[_0x524f('0x10')](function(_0x5c9580){logger[_0x524f('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x6a84e2,_0x524f('0x12'));logger[_0x524f('0x13')](_0x524f('0x14'),_0x6a84e2,_0x524f('0x12'),JSON[_0x524f('0x15')](_0x5c9580));if(_0x5c9580[_0x524f('0x16')]){if(_0x5c9580['error'][_0x524f('0x17')]===0x1f4){logger[_0x524f('0x16')](_0x524f('0x18'),_0x6a84e2,_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);return _0x39b202(_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);}logger[_0x524f('0x16')](_0x524f('0x18'),_0x6a84e2,_0x5c9580[_0x524f('0x16')][_0x524f('0x19')]);return _0x5b1328(_0x5c9580[_0x524f('0x16')]['message']);}else{logger[_0x524f('0x11')](_0x524f('0x18'),_0x6a84e2,_0x524f('0x12'));_0x5b1328(_0x5c9580[_0x524f('0x1a')]['message']);}})[_0x524f('0x1b')](function(_0x23e594){logger['error'](_0x524f('0x18'),_0x6a84e2,_0x23e594);_0x39b202(_0x23e594);});});}
\ No newline at end of file
+var _0x7fac=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x223394,_0x2a99ca){var _0x2eb43b=function(_0xfddc3d){while(--_0xfddc3d){_0x223394['push'](_0x223394['shift']());}};_0x2eb43b(++_0x2a99ca);}(_0x7fac,0x137));var _0xc7fa=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x7fac[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xc7fa('0x0'));var util=require('util');var moment=require(_0xc7fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7fa('0x2'));var fs=require('fs');var Redis=require(_0xc7fa('0x3'));var db=require(_0xc7fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7fa('0x5'))(_0xc7fa('0x6'));var config=require(_0xc7fa('0x7'));var jayson=require(_0xc7fa('0x8'));var client=jayson[_0xc7fa('0x9')][_0xc7fa('0xa')]({'port':0x232a});config[_0xc7fa('0xb')]=_[_0xc7fa('0xc')](config[_0xc7fa('0xb')],{'host':_0xc7fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7fa('0xb')]));require(_0xc7fa('0xe'))[_0xc7fa('0xf')](socket);function respondWithRpcPromise(_0x30aa72,_0x58b60a,_0x40ad16){return new BPromise(function(_0x8c070c,_0x882892){return client[_0xc7fa('0x10')](_0x30aa72,_0x40ad16)[_0xc7fa('0x11')](function(_0x1e78a2){logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));logger['debug'](_0xc7fa('0x15'),_0x58b60a,_0xc7fa('0x14'),JSON[_0xc7fa('0x16')](_0x1e78a2));if(_0x1e78a2[_0xc7fa('0x17')]){if(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x18')]===0x1f4){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);return _0x882892(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);}logger[_0xc7fa('0x17')](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2['error'][_0xc7fa('0x19')]);return _0x8c070c(_0x1e78a2['error'][_0xc7fa('0x19')]);}else{logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));_0x8c070c(_0x1e78a2['result'][_0xc7fa('0x19')]);}})[_0xc7fa('0x1a')](function(_0x922fa2){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x922fa2);_0x882892(_0x922fa2);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index add7062..2406ad2 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 _0xc0ff=['update','emit','removeListener','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x44433d,_0xf56466){var _0x2a5fce=function(_0x4d1d79){while(--_0x4d1d79){_0x44433d['push'](_0x44433d['shift']());}};_0x2a5fce(++_0xf56466);}(_0xc0ff,0x1d2));var _0xfc0f=function(_0x2acd64,_0x4e8ce8){_0x2acd64=_0x2acd64-0x0;var _0x3d3fce=_0xc0ff[_0x2acd64];return _0x3d3fce;};'use strict';var ChatInternalMessageEvents=require(_0xfc0f('0x0'));var events=[_0xfc0f('0x1'),'remove',_0xfc0f('0x2')];function createListener(_0x3535d6,_0x5b67e1){return function(_0x430e47){_0x5b67e1[_0xfc0f('0x3')](_0x3535d6,_0x430e47);};}function removeListener(_0x3a0713,_0x2d36db){return function(){ChatInternalMessageEvents[_0xfc0f('0x4')](_0x3a0713,_0x2d36db);};}exports['register']=function(_0x1956fc){for(var _0x7b5341=0x0,_0x558b6e=events['length'];_0x7b5341<_0x558b6e;_0x7b5341++){var _0x3d46ca=events[_0x7b5341];var _0x109e67=createListener(_0xfc0f('0x5')+_0x3d46ca,_0x1956fc);ChatInternalMessageEvents['on'](_0x3d46ca,_0x109e67);}};
\ No newline at end of file
+var _0x534c=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','length'];(function(_0x15c80a,_0xa0a750){var _0x153e1f=function(_0x15dca1){while(--_0x15dca1){_0x15c80a['push'](_0x15c80a['shift']());}};_0x153e1f(++_0xa0a750);}(_0x534c,0xfd));var _0xc534=function(_0xfe3bae,_0x5d97fa){_0xfe3bae=_0xfe3bae-0x0;var _0x5c3f54=_0x534c[_0xfe3bae];return _0x5c3f54;};'use strict';var ChatInternalMessageEvents=require(_0xc534('0x0'));var events=[_0xc534('0x1'),_0xc534('0x2'),'update'];function createListener(_0x10b2b5,_0x598e66){return function(_0x2ef186){_0x598e66[_0xc534('0x3')](_0x10b2b5,_0x2ef186);};}function removeListener(_0x5ad847,_0x5cd356){return function(){ChatInternalMessageEvents['removeListener'](_0x5ad847,_0x5cd356);};}exports['register']=function(_0x3a9138){for(var _0x456655=0x0,_0x78c61e=events[_0xc534('0x4')];_0x456655<_0x78c61e;_0x456655++){var _0x309685=events[_0x456655];var _0x467fd7=createListener(_0xc534('0x5')+_0x309685,_0x3a9138);ChatInternalMessageEvents['on'](_0x309685,_0x467fd7);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5f18c97..17da2ec 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 _0x3436=['isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','index','/describe'];(function(_0x58f1c7,_0x1f2630){var _0x57adbe=function(_0x110138){while(--_0x110138){_0x58f1c7['push'](_0x58f1c7['shift']());}};_0x57adbe(++_0x1f2630);}(_0x3436,0x1b6));var _0x6343=function(_0x337eb3,_0x399261){_0x337eb3=_0x337eb3-0x0;var _0x2877a6=_0x3436[_0x337eb3];return _0x2877a6;};'use strict';var multer=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var path=require(_0x6343('0x2'));var timeout=require(_0x6343('0x3'));var express=require(_0x6343('0x4'));var router=express[_0x6343('0x5')]();var fs_extra=require(_0x6343('0x6'));var auth=require(_0x6343('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6343('0x8'));router[_0x6343('0x9')]('/',auth['isAuthenticated'](),controller[_0x6343('0xa')]);router[_0x6343('0x9')](_0x6343('0xb'),auth[_0x6343('0xc')](),controller[_0x6343('0xd')]);router[_0x6343('0x9')](_0x6343('0xe'),auth[_0x6343('0xc')](),controller[_0x6343('0xf')]);router[_0x6343('0x9')](_0x6343('0x10'),auth[_0x6343('0xc')](),controller[_0x6343('0x11')]);router[_0x6343('0x12')]('/',auth[_0x6343('0xc')](),controller[_0x6343('0x13')]);router[_0x6343('0x14')](_0x6343('0x10'),controller[_0x6343('0x15')]);router[_0x6343('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6343('0x17')]);module[_0x6343('0x18')]=router;
\ No newline at end of file
+var _0xf197=['path','Router','../../config/environment','isAuthenticated','index','get','/describe','describe','getUsers','show','post','put','update','delete','/:id','exports','multer','util'];(function(_0x4cf8a9,_0xb488cf){var _0x3528e2=function(_0x4c065d){while(--_0x4c065d){_0x4cf8a9['push'](_0x4cf8a9['shift']());}};_0x3528e2(++_0xb488cf);}(_0xf197,0x130));var _0x7f19=function(_0x442435,_0x57c938){_0x442435=_0x442435-0x0;var _0x459823=_0xf197[_0x442435];return _0x459823;};'use strict';var multer=require(_0x7f19('0x0'));var util=require(_0x7f19('0x1'));var path=require(_0x7f19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f19('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f19('0x4'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x7f19('0x5')](),controller[_0x7f19('0x6')]);router[_0x7f19('0x7')](_0x7f19('0x8'),auth[_0x7f19('0x5')](),controller[_0x7f19('0x9')]);router[_0x7f19('0x7')]('/users',auth[_0x7f19('0x5')](),controller[_0x7f19('0xa')]);router[_0x7f19('0x7')]('/:id',auth[_0x7f19('0x5')](),controller[_0x7f19('0xb')]);router[_0x7f19('0xc')]('/',auth[_0x7f19('0x5')](),controller['create']);router[_0x7f19('0xd')]('/:id',controller[_0x7f19('0xe')]);router[_0x7f19('0xf')](_0x7f19('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f19('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 76af87c..4e5c2e1 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 _0x351d=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x4744b1,_0x1f53ed){var _0xa1e07=function(_0x3a1e89){while(--_0x3a1e89){_0x4744b1['push'](_0x4744b1['shift']());}};_0xa1e07(++_0x1f53ed);}(_0x351d,0x90));var _0xd351=function(_0x4c533d,_0x3cc214){_0x4c533d=_0x4c533d-0x0;var _0x49b304=_0x351d[_0x4c533d];return _0x49b304;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'body':{'type':Sequelize[_0xd351('0x1')](_0xd351('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd351('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd351('0x4')]('in','out'),'defaultValue':_0xd351('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd351('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd351('0x1')]}};
\ No newline at end of file
+var _0x1cc3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0x1cc3,0x11b));var _0x31cc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1cc3[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x31cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x31cc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x31cc('0x4')]('in',_0x31cc('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x31cc('0x6')]},'providerName':{'type':Sequelize[_0x31cc('0x7')]},'providerResponse':{'type':Sequelize[_0x31cc('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6ff3f20..4bcf98a 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 _0x3ea5=['../../config/license/util','redis','defaults','./chatMessage.socket','register','http','client','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','length','find','create','body','params','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x37b507,_0x10c37c){var _0x3a5aca=function(_0x82557f){while(--_0x82557f){_0x37b507['push'](_0x37b507['shift']());}};_0x3a5aca(++_0x10c37c);}(_0x3ea5,0x6b));var _0x53ea=function(_0x1c6c83,_0x2b099c){_0x1c6c83=_0x1c6c83-0x0;var _0x2d7849=_0x3ea5[_0x1c6c83];return _0x2d7849;};'use strict';var emlformat=require(_0x53ea('0x0'));var rimraf=require(_0x53ea('0x1'));var zipdir=require(_0x53ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53ea('0x3'));var moment=require(_0x53ea('0x4'));var BPromise=require(_0x53ea('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53ea('0x7'));var fs=require('fs');var fs_extra=require(_0x53ea('0x8'));var _=require(_0x53ea('0x9'));var squel=require(_0x53ea('0xa'));var crypto=require(_0x53ea('0xb'));var jsforce=require(_0x53ea('0xc'));var deskjs=require(_0x53ea('0xd'));var toCsv=require(_0x53ea('0xe'));var querystring=require(_0x53ea('0xf'));var Papa=require(_0x53ea('0x10'));var Redis=require(_0x53ea('0x11'));var authService=require(_0x53ea('0x12'));var qs=require(_0x53ea('0x13'));var as=require(_0x53ea('0x14'));var hardwareService=require(_0x53ea('0x15'));var logger=require(_0x53ea('0x16'))(_0x53ea('0x17'));var utils=require(_0x53ea('0x18'));var config=require(_0x53ea('0x19'));var licenseUtil=require(_0x53ea('0x1a'));var db=require('../../mysqldb')['db'];config[_0x53ea('0x1b')]=_[_0x53ea('0x1c')](config[_0x53ea('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53ea('0x1b')]));require(_0x53ea('0x1d'))[_0x53ea('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x53ea('0x1f')]({'port':0x232c});var client9002=jayson[_0x53ea('0x20')][_0x53ea('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4a65b1,_0x7e227e,_0x56534a,_0xa1747a){return new BPromise(function(_0x4bce34,_0xd79bc3){var _0x20a17d=_0xa1747a||client;return _0x20a17d['request'](_0x4a65b1,_0x56534a)[_0x53ea('0x21')](function(_0x224da9){logger[_0x53ea('0x22')](_0x53ea('0x23'),_0x7e227e,'request\x20sent');logger[_0x53ea('0x24')](_0x53ea('0x25'),_0x7e227e,_0x53ea('0x26'),JSON[_0x53ea('0x27')](_0x224da9));if(_0x224da9[_0x53ea('0x28')]){if(_0x224da9[_0x53ea('0x28')][_0x53ea('0x29')]===0x1f4){logger[_0x53ea('0x28')](_0x53ea('0x23'),_0x7e227e,_0x224da9['error'][_0x53ea('0x2a')]);return _0xd79bc3(_0x224da9[_0x53ea('0x28')][_0x53ea('0x2a')]);}logger[_0x53ea('0x28')]('ChatMessage,\x20%s,\x20%s',_0x7e227e,_0x224da9[_0x53ea('0x28')][_0x53ea('0x2a')]);return _0x4bce34(_0x224da9[_0x53ea('0x28')]['message']);}else{logger[_0x53ea('0x22')](_0x53ea('0x23'),_0x7e227e,_0x53ea('0x26'));_0x4bce34(_0x224da9[_0x53ea('0x2b')][_0x53ea('0x2a')]);}})[_0x53ea('0x2c')](function(_0x1fbecd){logger['error'](_0x53ea('0x23'),_0x7e227e,_0x1fbecd);_0xd79bc3(_0x1fbecd);});});}function respondWithStatusCode(_0x32e820,_0x4e3505){_0x4e3505=_0x4e3505||0xcc;return function(_0x16ef01){if(_0x16ef01){return _0x32e820['sendStatus'](_0x4e3505);}return _0x32e820[_0x53ea('0x2d')](_0x4e3505)[_0x53ea('0x2e')]();};}function respondWithResult(_0x4bc7d7,_0x4d7b12){_0x4d7b12=_0x4d7b12||0xc8;return function(_0x333a70){if(_0x333a70){return _0x4bc7d7[_0x53ea('0x2d')](_0x4d7b12)['json'](_0x333a70);}};}function respondWithFilteredResult(_0x47fcac,_0x5e69c2){return function(_0x8236b3){if(_0x8236b3){var _0x2cac2a=typeof _0x5e69c2[_0x53ea('0x2f')]===_0x53ea('0x30')&&typeof _0x5e69c2['limit']==='undefined';var _0x54da81=_0x8236b3['count'];var _0x5ea80f=_0x2cac2a?0x0:_0x5e69c2[_0x53ea('0x2f')];var _0x2a32de=_0x2cac2a?_0x8236b3[_0x53ea('0x31')]:_0x5e69c2[_0x53ea('0x2f')]+_0x5e69c2[_0x53ea('0x32')];var _0x23dcfb;if(_0x2a32de>=_0x54da81){_0x2a32de=_0x54da81;_0x23dcfb=0xc8;}else{_0x23dcfb=0xce;}_0x47fcac['status'](_0x23dcfb);return _0x47fcac['set'](_0x53ea('0x33'),_0x5ea80f+'-'+_0x2a32de+'/'+_0x54da81)[_0x53ea('0x34')](_0x8236b3);}return null;};}function patchUpdates(_0x37b641){return function(_0x418340){try{jsonpatch[_0x53ea('0x35')](_0x418340,_0x37b641,!![]);}catch(_0x24f441){return BPromise[_0x53ea('0x36')](_0x24f441);}return _0x418340[_0x53ea('0x37')]();};}function saveUpdates(_0xa78cdd,_0x31be8a){return function(_0x2c1b2b){if(_0x2c1b2b){return _0x2c1b2b[_0x53ea('0x38')](_0xa78cdd)[_0x53ea('0x21')](function(_0x3e78cf){return _0x3e78cf;});}return null;};}function removeEntity(_0x37118a,_0x2d6526){return function(_0xa57c37){if(_0xa57c37){return _0xa57c37[_0x53ea('0x39')]()[_0x53ea('0x21')](function(){_0x37118a[_0x53ea('0x2d')](0xcc)[_0x53ea('0x2e')]();});}};}function handleEntityNotFound(_0x217e2a,_0x1db91f){return function(_0xf5c0d1){if(!_0xf5c0d1){_0x217e2a[_0x53ea('0x3a')](0x194);}return _0xf5c0d1;};}function handleError(_0x125609,_0x53a666){_0x53a666=_0x53a666||0x1f4;return function(_0xd17c12){logger[_0x53ea('0x28')](_0xd17c12[_0x53ea('0x3b')]);if(_0xd17c12[_0x53ea('0x3c')]){delete _0xd17c12['name'];}_0x125609[_0x53ea('0x2d')](_0x53a666)[_0x53ea('0x3d')](_0xd17c12);};}exports[_0x53ea('0x3e')]=function(_0x2236c1,_0x2818dc){var _0x56f3bd={},_0xab010e={},_0x545c9b={'count':0x0,'rows':[]};var _0x311ad9=_[_0x53ea('0x3f')](db[_0x53ea('0x40')][_0x53ea('0x41')],function(_0x197f6c){return{'name':_0x197f6c['fieldName'],'type':_0x197f6c[_0x53ea('0x42')][_0x53ea('0x43')]};});_0xab010e['model']=_[_0x53ea('0x3f')](_0x311ad9,_0x53ea('0x3c'));_0xab010e[_0x53ea('0x44')]=_[_0x53ea('0x45')](_0x2236c1[_0x53ea('0x44')]);_0xab010e[_0x53ea('0x46')]=_[_0x53ea('0x47')](_0xab010e[_0x53ea('0x48')],_0xab010e[_0x53ea('0x44')]);_0x56f3bd['attributes']=_[_0x53ea('0x47')](_0xab010e[_0x53ea('0x48')],qs[_0x53ea('0x49')](_0x2236c1[_0x53ea('0x44')][_0x53ea('0x49')]));_0x56f3bd[_0x53ea('0x4a')]=_0x56f3bd['attributes']['length']?_0x56f3bd['attributes']:_0xab010e[_0x53ea('0x48')];if(!_0x2236c1[_0x53ea('0x44')][_0x53ea('0x4b')]('nolimit')){_0x56f3bd[_0x53ea('0x32')]=qs[_0x53ea('0x32')](_0x2236c1[_0x53ea('0x44')][_0x53ea('0x32')]);_0x56f3bd['offset']=qs[_0x53ea('0x2f')](_0x2236c1['query'][_0x53ea('0x2f')]);}_0x56f3bd['order']=qs[_0x53ea('0x4c')](_0x2236c1[_0x53ea('0x44')]['sort']);_0x56f3bd['where']=qs[_0x53ea('0x46')](_['pick'](_0x2236c1[_0x53ea('0x44')],_0xab010e[_0x53ea('0x46')]),_0x311ad9);if(_0x2236c1['query'][_0x53ea('0x4d')]){_0x56f3bd[_0x53ea('0x4e')]=_[_0x53ea('0x4f')](_0x56f3bd[_0x53ea('0x4e')],{'$or':_[_0x53ea('0x3f')](_0x311ad9,function(_0x47919c){if(_0x47919c[_0x53ea('0x42')]!=='VIRTUAL'){var _0x2685ad={};_0x2685ad[_0x47919c['name']]={'$like':'%'+_0x2236c1[_0x53ea('0x44')]['filter']+'%'};return _0x2685ad;}})});}_0x56f3bd=_['merge']({},_0x56f3bd,_0x2236c1[_0x53ea('0x50')]);var _0x3ad9b3={'where':_0x56f3bd['where']};return db[_0x53ea('0x40')][_0x53ea('0x31')](_0x3ad9b3)[_0x53ea('0x21')](function(_0xf15658){_0x545c9b['count']=_0xf15658;if(_0x2236c1['query'][_0x53ea('0x51')]){_0x56f3bd[_0x53ea('0x52')]=[{'all':!![]}];}return db[_0x53ea('0x40')][_0x53ea('0x53')](_0x56f3bd);})[_0x53ea('0x21')](function(_0xcd8cd5){_0x545c9b[_0x53ea('0x54')]=_0xcd8cd5;return _0x545c9b;})[_0x53ea('0x21')](respondWithFilteredResult(_0x2818dc,_0x56f3bd))[_0x53ea('0x2c')](handleError(_0x2818dc,null));};exports[_0x53ea('0x55')]=function(_0x2967df,_0x3eec17){var _0x1f20d7={'raw':!![],'where':{'id':_0x2967df['params']['id']}},_0x4cbd3d={};_0x4cbd3d[_0x53ea('0x48')]=_[_0x53ea('0x45')](db[_0x53ea('0x40')]['rawAttributes']);_0x4cbd3d[_0x53ea('0x44')]=_[_0x53ea('0x45')](_0x2967df[_0x53ea('0x44')]);_0x4cbd3d[_0x53ea('0x46')]=_[_0x53ea('0x47')](_0x4cbd3d[_0x53ea('0x48')],_0x4cbd3d[_0x53ea('0x44')]);_0x1f20d7['attributes']=_[_0x53ea('0x47')](_0x4cbd3d[_0x53ea('0x48')],qs[_0x53ea('0x49')](_0x2967df[_0x53ea('0x44')][_0x53ea('0x49')]));_0x1f20d7[_0x53ea('0x4a')]=_0x1f20d7['attributes'][_0x53ea('0x56')]?_0x1f20d7[_0x53ea('0x4a')]:_0x4cbd3d[_0x53ea('0x48')];if(_0x2967df[_0x53ea('0x44')][_0x53ea('0x51')]){_0x1f20d7[_0x53ea('0x52')]=[{'all':!![]}];}_0x1f20d7=_['merge']({},_0x1f20d7,_0x2967df[_0x53ea('0x50')]);return db[_0x53ea('0x40')][_0x53ea('0x57')](_0x1f20d7)['then'](handleEntityNotFound(_0x3eec17,null))[_0x53ea('0x21')](respondWithResult(_0x3eec17,null))[_0x53ea('0x2c')](handleError(_0x3eec17,null));};exports[_0x53ea('0x58')]=function(_0x1df92d,_0x2bd0e2){return db[_0x53ea('0x40')][_0x53ea('0x58')](_0x1df92d[_0x53ea('0x59')],{})[_0x53ea('0x21')](respondWithResult(_0x2bd0e2,0xc9))['catch'](handleError(_0x2bd0e2,null));};exports[_0x53ea('0x38')]=function(_0x2facc0,_0x95e93a){if(_0x2facc0[_0x53ea('0x59')]['id']){delete _0x2facc0['body']['id'];}return db[_0x53ea('0x40')]['find']({'where':{'id':_0x2facc0[_0x53ea('0x5a')]['id']}})[_0x53ea('0x21')](handleEntityNotFound(_0x95e93a,null))[_0x53ea('0x21')](saveUpdates(_0x2facc0[_0x53ea('0x59')],null))[_0x53ea('0x21')](respondWithResult(_0x95e93a,null))['catch'](handleError(_0x95e93a,null));};exports[_0x53ea('0x39')]=function(_0x25bdf1,_0x32d668){return db['ChatMessage'][_0x53ea('0x57')]({'where':{'id':_0x25bdf1[_0x53ea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x32d668,null))[_0x53ea('0x21')](removeEntity(_0x32d668,null))[_0x53ea('0x2c')](handleError(_0x32d668,null));};exports[_0x53ea('0x5b')]=function(_0x4ee1b4,_0x52b6c8){return db[_0x53ea('0x40')][_0x53ea('0x5b')]()[_0x53ea('0x21')](respondWithResult(_0x52b6c8,null))['catch'](handleError(_0x52b6c8,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x53ea('0x5c')]=function(_0x2f549c,_0x1b8eae,_0xb05a8d){var _0x203a7e={'agent':{},'channel':_0x53ea('0x5d')};if(_0x2f549c[_0x53ea('0x59')]['id']){delete _0x2f549c[_0x53ea('0x59')]['id'];}_0x2f549c['body']['read']=!![];_0x2f549c[_0x53ea('0x59')][_0x53ea('0x5e')]=moment()[_0x53ea('0x5f')](_0x53ea('0x60'));_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')]=_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')]||_0x2f549c['user']['id'];_0x203a7e['agent']['id']=_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')];return db[_0x53ea('0x40')][_0x53ea('0x57')]({'where':{'id':_0x2f549c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b8eae,null))[_0x53ea('0x21')](saveUpdates(_0x2f549c[_0x53ea('0x59')],null))['then'](function(_0x17e103){if(_0x17e103){_0x203a7e[_0x53ea('0x2a')]=_0x17e103['get']({'plain':!![]});return db['ChatInteraction'][_0x53ea('0x57')]({'where':{'id':_0x17e103[_0x53ea('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1b8eae,null))[_0x53ea('0x21')](function(_0x49073e){if(_0x49073e){return _0x49073e['update']({'UserId':_0x2f549c[_0x53ea('0x59')][_0x53ea('0x61')],'read1stAt':_[_0x53ea('0x63')](_0x49073e[_0x53ea('0x64')])?moment()[_0x53ea('0x5f')](_0x53ea('0x60')):undefined});}return null;})[_0x53ea('0x21')](function(_0x2d86a1){if(_0x2d86a1){_0x203a7e[_0x53ea('0x65')]=_0x2d86a1[_0x53ea('0x66')]({'plain':!![]});interaction_log[_0x53ea('0x22')](_0x53ea('0x67'),_0x2f549c[_0x53ea('0x68')]['id'],_0x2f549c[_0x53ea('0x68')][_0x53ea('0x3c')],_0x2f549c[_0x53ea('0x68')][_0x53ea('0x69')],_0x203a7e[_0x53ea('0x65')]['id'],_0x2f549c[_0x53ea('0x59')]?JSON['stringify'](_0x2f549c[_0x53ea('0x59')]):'null');return respondWithRpcPromise(_0x53ea('0x6a'),_0x53ea('0x6b'),_0x203a7e);}return null;})[_0x53ea('0x21')](function(_0x18a3df){var _0x2b3a50=_0x53ea('0x6c')+_0x18a3df[_0x53ea('0x2a')]['ContactId'];return db[_0x53ea('0x6d')][_0x53ea('0x44')](_0x2b3a50,{'type':db[_0x53ea('0x6e')][_0x53ea('0x6f')][_0x53ea('0x70')],'raw':!![]})['then'](function(_0x31e0a3){return _0x31e0a3;});})[_0x53ea('0x21')](function(_0x5565d4){if(_0x5565d4){_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x71')]=_0x5565d4[0x0];if(!_0x2f549c['body'][_0x53ea('0x61')])return;return db[_0x53ea('0x72')]['find']({'where':{'id':_0x2f549c['body'][_0x53ea('0x61')],'role':_0x53ea('0x73')},'attributes':['id',_0x53ea('0x3c'),_0x53ea('0x74'),_0x53ea('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x414196){if(!_0x414196)return null;_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x73')]=_0x414196;return _0x203a7e;})[_0x53ea('0x21')](function(_0x355393){if(_0x355393){if(_0x2f549c[_0x53ea('0x59')][_0x53ea('0x76')]){_0x203a7e['message'][_0x53ea('0x77')]=util[_0x53ea('0x5f')]('SIP/%s',_0x2f549c[_0x53ea('0x68')][_0x53ea('0x3c')]);_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x78')]=_0x203a7e[_0x53ea('0x78')];_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x79')]=_0x203a7e[_0x53ea('0x78')];_0x203a7e[_0x53ea('0x2a')][_0x53ea('0x7a')]=_0x53ea('0x5c');return respondWithRpcPromise(_0x53ea('0x7b'),_0x53ea('0x7b'),{'event':_0x53ea('0x7c'),'message':_[_0x53ea('0x4f')](_0x203a7e[_0x53ea('0x2a')],JSON['parse'](_0x203a7e[_0x53ea('0x65')][_0x53ea('0x7d')]))},client9002)[_0x53ea('0x21')](function(){return _0x203a7e;});}return _0x203a7e;}return null;})['then'](respondWithResult(_0x1b8eae,null))[_0x53ea('0x2c')](handleError(_0x1b8eae,null));};var interaction_log=require(_0x53ea('0x16'))(_0x53ea('0x7e'));exports['reject']=function(_0x31f3cc,_0x540625,_0x831c19){var _0x427e49={'agent':{},'channel':'chat'};if(_0x31f3cc[_0x53ea('0x59')]['id']){delete _0x31f3cc['body']['id'];}_0x31f3cc['body'][_0x53ea('0x61')]=_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')]||_0x31f3cc['user']['id'];_0x427e49[_0x53ea('0x73')]['id']=_0x31f3cc[_0x53ea('0x59')]['UserId'];return db[_0x53ea('0x40')][_0x53ea('0x57')]({'where':{'id':_0x31f3cc['params']['id'],'UserId':null}})[_0x53ea('0x21')](handleEntityNotFound(_0x540625,null))[_0x53ea('0x21')](function(_0xf3bced){if(_0xf3bced){_0x427e49[_0x53ea('0x2a')]=_0xf3bced[_0x53ea('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x53ea('0x57')]({'where':{'id':_0xf3bced[_0x53ea('0x62')]}});}return null;})[_0x53ea('0x21')](handleEntityNotFound(_0x540625,null))['then'](function(_0x1da709){if(_0x1da709){_0x427e49['interaction']=_0x1da709['get']({'plain':!![]});interaction_log[_0x53ea('0x22')](_0x53ea('0x7f'),_0x31f3cc[_0x53ea('0x68')]['id'],_0x31f3cc['user']['name'],_0x31f3cc[_0x53ea('0x68')][_0x53ea('0x69')],_0x427e49[_0x53ea('0x65')]['id'],_0x31f3cc['body']?JSON[_0x53ea('0x27')](_0x31f3cc[_0x53ea('0x59')]):_0x53ea('0x80'));return respondWithRpcPromise('RejectMessage',_0x53ea('0x81'),_0x427e49);}return null;})[_0x53ea('0x21')](function(_0x5f1239){var _0x5b9067=_0x53ea('0x6c')+_0x5f1239[_0x53ea('0x2a')][_0x53ea('0x82')];return db[_0x53ea('0x6d')]['query'](_0x5b9067,{'type':db[_0x53ea('0x6e')][_0x53ea('0x6f')][_0x53ea('0x70')],'raw':!![]})[_0x53ea('0x21')](function(_0x5b4f96){return _0x5b4f96;});})['then'](function(_0x48457a){if(_0x48457a){_0x427e49[_0x53ea('0x2a')][_0x53ea('0x71')]=_0x48457a[0x0];if(!_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')])return;return db[_0x53ea('0x72')]['find']({'where':{'id':_0x31f3cc[_0x53ea('0x59')][_0x53ea('0x61')],'role':_0x53ea('0x73')},'attributes':['id','name','fullname',_0x53ea('0x75'),'internal'],'raw':!![]});}return null;})[_0x53ea('0x21')](function(_0x1867e6){if(!_0x1867e6)return null;_0x427e49['message'][_0x53ea('0x73')]=_0x1867e6;return _0x427e49;})[_0x53ea('0x21')](function(_0x31b769){if(_0x31b769){_0x31b769[_0x53ea('0x2a')]['interface']=util[_0x53ea('0x5f')](_0x53ea('0x83'),_0x31f3cc[_0x53ea('0x68')][_0x53ea('0x3c')]);_0x31b769['message'][_0x53ea('0x78')]=_0x427e49[_0x53ea('0x78')];_0x31b769[_0x53ea('0x2a')]['motionChannel']=_0x427e49['channel'];_0x31b769[_0x53ea('0x2a')][_0x53ea('0x7a')]='reject';respondWithRpcPromise(_0x53ea('0x7b'),_0x53ea('0x7b'),{'event':_0x53ea('0x84'),'message':_[_0x53ea('0x4f')](_0x427e49[_0x53ea('0x2a')],JSON['parse'](_0x427e49['interaction'][_0x53ea('0x7d')]))},client9002);return _0x427e49;}return null;})[_0x53ea('0x21')](respondWithResult(_0x540625,null))[_0x53ea('0x2c')](handleError(_0x540625,null));};
\ No newline at end of file
+var _0xc73e=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','find','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','fullname','internal','interface','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','params','create','body','destroy','describe','chat-interactions','accept','read','format'];(function(_0x59fc33,_0x2e182d){var _0x39066f=function(_0x4d843d){while(--_0x4d843d){_0x59fc33['push'](_0x59fc33['shift']());}};_0x39066f(++_0x2e182d);}(_0xc73e,0xaf));var _0xec73=function(_0x55b351,_0x1bb062){_0x55b351=_0x55b351-0x0;var _0x3f684f=_0xc73e[_0x55b351];return _0x3f684f;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec73('0x1'));var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require(_0xec73('0x4'));var BPromise=require(_0xec73('0x5'));var Mustache=require(_0xec73('0x6'));var util=require(_0xec73('0x7'));var path=require(_0xec73('0x8'));var sox=require(_0xec73('0x9'));var csv=require(_0xec73('0xa'));var ejs=require(_0xec73('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec73('0xc'));var squel=require(_0xec73('0xd'));var crypto=require('crypto');var jsforce=require(_0xec73('0xe'));var deskjs=require(_0xec73('0xf'));var toCsv=require(_0xec73('0xa'));var querystring=require(_0xec73('0x10'));var Papa=require('papaparse');var Redis=require(_0xec73('0x11'));var authService=require(_0xec73('0x12'));var qs=require(_0xec73('0x13'));var as=require(_0xec73('0x14'));var hardwareService=require(_0xec73('0x15'));var logger=require(_0xec73('0x16'))(_0xec73('0x17'));var utils=require(_0xec73('0x18'));var config=require(_0xec73('0x19'));var licenseUtil=require(_0xec73('0x1a'));var db=require(_0xec73('0x1b'))['db'];config[_0xec73('0x1c')]=_[_0xec73('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec73('0x1e'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xec73('0x1f')](socket);var jayson=require(_0xec73('0x20'));var client=jayson['client'][_0xec73('0x21')]({'port':0x232c});var client9002=jayson[_0xec73('0x22')][_0xec73('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3311fa,_0x2e8afc,_0x5e09a4,_0x47eaf9){return new BPromise(function(_0x15dedc,_0x1ec343){var _0xf4a610=_0x47eaf9||client;return _0xf4a610['request'](_0x3311fa,_0x5e09a4)[_0xec73('0x23')](function(_0x24223c){logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2e8afc,_0xec73('0x26'),JSON['stringify'](_0x24223c));if(_0x24223c['error']){if(_0x24223c[_0xec73('0x27')]['code']===0x1f4){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x1ec343(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x15dedc(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}else{logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));_0x15dedc(_0x24223c[_0xec73('0x29')][_0xec73('0x28')]);}})[_0xec73('0x2a')](function(_0x4ada95){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x4ada95);_0x1ec343(_0x4ada95);});});}function respondWithStatusCode(_0x4ea73e,_0x580114){_0x580114=_0x580114||0xcc;return function(_0x4eb256){if(_0x4eb256){return _0x4ea73e[_0xec73('0x2b')](_0x580114);}return _0x4ea73e['status'](_0x580114)[_0xec73('0x2c')]();};}function respondWithResult(_0x50b9df,_0x2e427b){_0x2e427b=_0x2e427b||0xc8;return function(_0x5c73cc){if(_0x5c73cc){return _0x50b9df[_0xec73('0x2d')](_0x2e427b)[_0xec73('0x2e')](_0x5c73cc);}};}function respondWithFilteredResult(_0x1a6b16,_0x63aa){return function(_0x3eaf78){if(_0x3eaf78){var _0x21e957=typeof _0x63aa[_0xec73('0x2f')]===_0xec73('0x30')&&typeof _0x63aa[_0xec73('0x31')]===_0xec73('0x30');var _0x19ff12=_0x3eaf78[_0xec73('0x32')];var _0x474efc=_0x21e957?0x0:_0x63aa[_0xec73('0x2f')];var _0x10d863=_0x21e957?_0x3eaf78[_0xec73('0x32')]:_0x63aa[_0xec73('0x2f')]+_0x63aa[_0xec73('0x31')];var _0x31f287;if(_0x10d863>=_0x19ff12){_0x10d863=_0x19ff12;_0x31f287=0xc8;}else{_0x31f287=0xce;}_0x1a6b16[_0xec73('0x2d')](_0x31f287);return _0x1a6b16[_0xec73('0x33')](_0xec73('0x34'),_0x474efc+'-'+_0x10d863+'/'+_0x19ff12)['json'](_0x3eaf78);}return null;};}function patchUpdates(_0x607075){return function(_0x3cf268){try{jsonpatch[_0xec73('0x35')](_0x3cf268,_0x607075,!![]);}catch(_0x3b042b){return BPromise['reject'](_0x3b042b);}return _0x3cf268[_0xec73('0x36')]();};}function saveUpdates(_0x1ad54b,_0x2acc15){return function(_0x4699a0){if(_0x4699a0){return _0x4699a0[_0xec73('0x37')](_0x1ad54b)[_0xec73('0x23')](function(_0x6944b1){return _0x6944b1;});}return null;};}function removeEntity(_0x4cfa86,_0x334c44){return function(_0x397334){if(_0x397334){return _0x397334['destroy']()[_0xec73('0x23')](function(){_0x4cfa86[_0xec73('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a11a8,_0x133772){return function(_0x3494aa){if(!_0x3494aa){_0x4a11a8['sendStatus'](0x194);}return _0x3494aa;};}function handleError(_0x208055,_0x169865){_0x169865=_0x169865||0x1f4;return function(_0x1b3302){logger['error'](_0x1b3302[_0xec73('0x38')]);if(_0x1b3302['name']){delete _0x1b3302[_0xec73('0x39')];}_0x208055[_0xec73('0x2d')](_0x169865)['send'](_0x1b3302);};}exports[_0xec73('0x3a')]=function(_0x1a3a67,_0x527758){var _0x889c14={},_0x59b3d9={},_0x438a3f={'count':0x0,'rows':[]};var _0x58d3f0=_[_0xec73('0x3b')](db[_0xec73('0x3c')][_0xec73('0x3d')],function(_0x351044){return{'name':_0x351044[_0xec73('0x3e')],'type':_0x351044[_0xec73('0x3f')][_0xec73('0x40')]};});_0x59b3d9[_0xec73('0x41')]=_[_0xec73('0x3b')](_0x58d3f0,_0xec73('0x39'));_0x59b3d9[_0xec73('0x42')]=_[_0xec73('0x43')](_0x1a3a67[_0xec73('0x42')]);_0x59b3d9['filters']=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],_0x59b3d9['query']);_0x889c14[_0xec73('0x45')]=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],qs['fields'](_0x1a3a67['query']['fields']));_0x889c14['attributes']=_0x889c14[_0xec73('0x45')][_0xec73('0x46')]?_0x889c14[_0xec73('0x45')]:_0x59b3d9[_0xec73('0x41')];if(!_0x1a3a67[_0xec73('0x42')]['hasOwnProperty'](_0xec73('0x47'))){_0x889c14[_0xec73('0x31')]=qs[_0xec73('0x31')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x31')]);_0x889c14[_0xec73('0x2f')]=qs[_0xec73('0x2f')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x2f')]);}_0x889c14['order']=qs[_0xec73('0x48')](_0x1a3a67['query'][_0xec73('0x48')]);_0x889c14['where']=qs[_0xec73('0x49')](_[_0xec73('0x4a')](_0x1a3a67[_0xec73('0x42')],_0x59b3d9['filters']),_0x58d3f0);if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]){_0x889c14[_0xec73('0x4c')]=_[_0xec73('0x4d')](_0x889c14['where'],{'$or':_[_0xec73('0x3b')](_0x58d3f0,function(_0x30d90c){if(_0x30d90c[_0xec73('0x3f')]!=='VIRTUAL'){var _0x31790a={};_0x31790a[_0x30d90c[_0xec73('0x39')]]={'$like':'%'+_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]+'%'};return _0x31790a;}})});}_0x889c14=_[_0xec73('0x4d')]({},_0x889c14,_0x1a3a67[_0xec73('0x4e')]);var _0x26e6a7={'where':_0x889c14[_0xec73('0x4c')]};return db[_0xec73('0x3c')][_0xec73('0x32')](_0x26e6a7)[_0xec73('0x23')](function(_0x37a835){_0x438a3f[_0xec73('0x32')]=_0x37a835;if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4f')]){_0x889c14[_0xec73('0x50')]=[{'all':!![]}];}return db[_0xec73('0x3c')]['findAll'](_0x889c14);})[_0xec73('0x23')](function(_0x19321d){_0x438a3f[_0xec73('0x51')]=_0x19321d;return _0x438a3f;})[_0xec73('0x23')](respondWithFilteredResult(_0x527758,_0x889c14))[_0xec73('0x2a')](handleError(_0x527758,null));};exports['show']=function(_0x4bca59,_0x4a9cd5){var _0x1ed829={'raw':!![],'where':{'id':_0x4bca59[_0xec73('0x52')]['id']}},_0x2266f6={};_0x2266f6[_0xec73('0x41')]=_[_0xec73('0x43')](db[_0xec73('0x3c')][_0xec73('0x3d')]);_0x2266f6['query']=_[_0xec73('0x43')](_0x4bca59[_0xec73('0x42')]);_0x2266f6[_0xec73('0x49')]=_[_0xec73('0x44')](_0x2266f6[_0xec73('0x41')],_0x2266f6[_0xec73('0x42')]);_0x1ed829[_0xec73('0x45')]=_['intersection'](_0x2266f6[_0xec73('0x41')],qs['fields'](_0x4bca59[_0xec73('0x42')]['fields']));_0x1ed829[_0xec73('0x45')]=_0x1ed829[_0xec73('0x45')][_0xec73('0x46')]?_0x1ed829['attributes']:_0x2266f6[_0xec73('0x41')];if(_0x4bca59[_0xec73('0x42')][_0xec73('0x4f')]){_0x1ed829[_0xec73('0x50')]=[{'all':!![]}];}_0x1ed829=_[_0xec73('0x4d')]({},_0x1ed829,_0x4bca59[_0xec73('0x4e')]);return db['ChatMessage']['find'](_0x1ed829)['then'](handleEntityNotFound(_0x4a9cd5,null))[_0xec73('0x23')](respondWithResult(_0x4a9cd5,null))[_0xec73('0x2a')](handleError(_0x4a9cd5,null));};exports[_0xec73('0x53')]=function(_0x8922cf,_0x5bb3c8){return db[_0xec73('0x3c')]['create'](_0x8922cf[_0xec73('0x54')],{})[_0xec73('0x23')](respondWithResult(_0x5bb3c8,0xc9))[_0xec73('0x2a')](handleError(_0x5bb3c8,null));};exports[_0xec73('0x37')]=function(_0xf335dd,_0x371061){if(_0xf335dd[_0xec73('0x54')]['id']){delete _0xf335dd[_0xec73('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xf335dd[_0xec73('0x52')]['id']}})['then'](handleEntityNotFound(_0x371061,null))[_0xec73('0x23')](saveUpdates(_0xf335dd[_0xec73('0x54')],null))[_0xec73('0x23')](respondWithResult(_0x371061,null))[_0xec73('0x2a')](handleError(_0x371061,null));};exports[_0xec73('0x55')]=function(_0x1d40d3,_0x229e28){return db[_0xec73('0x3c')]['find']({'where':{'id':_0x1d40d3['params']['id']}})['then'](handleEntityNotFound(_0x229e28,null))['then'](removeEntity(_0x229e28,null))[_0xec73('0x2a')](handleError(_0x229e28,null));};exports[_0xec73('0x56')]=function(_0x594163,_0x443b39){return db[_0xec73('0x3c')][_0xec73('0x56')]()[_0xec73('0x23')](respondWithResult(_0x443b39,null))[_0xec73('0x2a')](handleError(_0x443b39,null));};var interaction_log=require(_0xec73('0x16'))(_0xec73('0x57'));exports[_0xec73('0x58')]=function(_0x438c27,_0x496e57,_0x2e1295){var _0x3168bd={'agent':{},'channel':'chat'};if(_0x438c27[_0xec73('0x54')]['id']){delete _0x438c27['body']['id'];}_0x438c27[_0xec73('0x54')][_0xec73('0x59')]=!![];_0x438c27[_0xec73('0x54')]['readAt']=moment()[_0xec73('0x5a')](_0xec73('0x5b'));_0x438c27['body'][_0xec73('0x5c')]=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')]||_0x438c27[_0xec73('0x5d')]['id'];_0x3168bd[_0xec73('0x5e')]['id']=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')]['find']({'where':{'id':_0x438c27['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x496e57,null))[_0xec73('0x23')](saveUpdates(_0x438c27[_0xec73('0x54')],null))[_0xec73('0x23')](function(_0x154054){if(_0x154054){_0x3168bd['message']=_0x154054[_0xec73('0x5f')]({'plain':!![]});return db[_0xec73('0x60')]['find']({'where':{'id':_0x154054[_0xec73('0x61')]}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x496e57,null))['then'](function(_0x419603){if(_0x419603){return _0x419603['update']({'UserId':_0x438c27[_0xec73('0x54')]['UserId'],'read1stAt':_[_0xec73('0x62')](_0x419603['read1stAt'])?moment()[_0xec73('0x5a')](_0xec73('0x5b')):undefined});}return null;})[_0xec73('0x23')](function(_0x1cb479){if(_0x1cb479){_0x3168bd[_0xec73('0x63')]=_0x1cb479[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x64'),_0x438c27['user']['id'],_0x438c27[_0xec73('0x5d')][_0xec73('0x39')],_0x438c27[_0xec73('0x5d')][_0xec73('0x65')],_0x3168bd['interaction']['id'],_0x438c27[_0xec73('0x54')]?JSON[_0xec73('0x66')](_0x438c27[_0xec73('0x54')]):_0xec73('0x67'));return respondWithRpcPromise(_0xec73('0x68'),_0xec73('0x69'),_0x3168bd);}return null;})[_0xec73('0x23')](function(_0x262a34){var _0x2f3527=_0xec73('0x6a')+_0x262a34['message']['ContactId'];return db[_0xec73('0x6b')][_0xec73('0x42')](_0x2f3527,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')][_0xec73('0x6e')],'raw':!![]})['then'](function(_0x305898){return _0x305898;});})['then'](function(_0x437ac4){if(_0x437ac4){_0x3168bd[_0xec73('0x28')][_0xec73('0x6f')]=_0x437ac4[0x0];if(!_0x438c27[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x438c27[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id','name','fullname',_0xec73('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4fa439){if(!_0x4fa439)return null;_0x3168bd[_0xec73('0x28')]['agent']=_0x4fa439;return _0x3168bd;})[_0xec73('0x23')](function(_0x5070e9){if(_0x5070e9){if(_0x438c27['body'][_0xec73('0x73')]){_0x3168bd[_0xec73('0x28')]['interface']=util[_0xec73('0x5a')](_0xec73('0x74'),_0x438c27[_0xec73('0x5d')][_0xec73('0x39')]);_0x3168bd[_0xec73('0x28')][_0xec73('0x75')]=_0x3168bd[_0xec73('0x75')];_0x3168bd[_0xec73('0x28')]['motionChannel']=_0x3168bd[_0xec73('0x75')];_0x3168bd['message'][_0xec73('0x76')]=_0xec73('0x58');return respondWithRpcPromise('EventManager',_0xec73('0x77'),{'event':_0xec73('0x78'),'message':_['merge'](_0x3168bd[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3168bd[_0xec73('0x63')][_0xec73('0x7a')]))},client9002)[_0xec73('0x23')](function(){return _0x3168bd;});}return _0x3168bd;}return null;})[_0xec73('0x23')](respondWithResult(_0x496e57,null))['catch'](handleError(_0x496e57,null));};var interaction_log=require(_0xec73('0x16'))('chat-interactions');exports[_0xec73('0x7b')]=function(_0x25c0a5,_0x34901a,_0x89984c){var _0x3ca2d3={'agent':{},'channel':_0xec73('0x7c')};if(_0x25c0a5['body']['id']){delete _0x25c0a5['body']['id'];}_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')]=_0x25c0a5['body'][_0xec73('0x5c')]||_0x25c0a5[_0xec73('0x5d')]['id'];_0x3ca2d3[_0xec73('0x5e')]['id']=_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x52')]['id'],'UserId':null}})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x4b1d0c){if(_0x4b1d0c){_0x3ca2d3[_0xec73('0x28')]=_0x4b1d0c['get']({'plain':!![]});return db[_0xec73('0x60')][_0xec73('0x71')]({'where':{'id':_0x4b1d0c['ChatInteractionId']}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x488b63){if(_0x488b63){_0x3ca2d3[_0xec73('0x63')]=_0x488b63[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x7d'),_0x25c0a5[_0xec73('0x5d')]['id'],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x65')],_0x3ca2d3[_0xec73('0x63')]['id'],_0x25c0a5[_0xec73('0x54')]?JSON['stringify'](_0x25c0a5[_0xec73('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xec73('0x7e'),_0x3ca2d3);}return null;})[_0xec73('0x23')](function(_0x1b7e9d){var _0x46c9a7=_0xec73('0x6a')+_0x1b7e9d['message'][_0xec73('0x7f')];return db['sequelize']['query'](_0x46c9a7,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5a9d39){return _0x5a9d39;});})[_0xec73('0x23')](function(_0x569b1d){if(_0x569b1d){_0x3ca2d3[_0xec73('0x28')]['contact']=_0x569b1d[0x0];if(!_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id',_0xec73('0x39'),_0xec73('0x80'),_0xec73('0x72'),_0xec73('0x81')],'raw':!![]});}return null;})[_0xec73('0x23')](function(_0x50f9cc){if(!_0x50f9cc)return null;_0x3ca2d3['message'][_0xec73('0x5e')]=_0x50f9cc;return _0x3ca2d3;})[_0xec73('0x23')](function(_0x45e3e0){if(_0x45e3e0){_0x45e3e0[_0xec73('0x28')][_0xec73('0x82')]=util['format'](_0xec73('0x74'),_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')]);_0x45e3e0[_0xec73('0x28')][_0xec73('0x75')]=_0x3ca2d3['channel'];_0x45e3e0[_0xec73('0x28')][_0xec73('0x83')]=_0x3ca2d3[_0xec73('0x75')];_0x45e3e0[_0xec73('0x28')][_0xec73('0x76')]=_0xec73('0x7b');respondWithRpcPromise('EventManager','EventManager',{'event':_0xec73('0x84'),'message':_[_0xec73('0x4d')](_0x3ca2d3[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3ca2d3[_0xec73('0x63')][_0xec73('0x7a')]))},client9002);return _0x3ca2d3;}return null;})[_0xec73('0x23')](respondWithResult(_0x34901a,null))[_0xec73('0x2a')](handleError(_0x34901a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 611f63b..debfe73 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 _0xa606=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3e32d6,_0x37c0bb){var _0x52af90=function(_0x185bc1){while(--_0x185bc1){_0x3e32d6['push'](_0x3e32d6['shift']());}};_0x52af90(++_0x37c0bb);}(_0xa606,0x1c2));var _0x6a60=function(_0xb5b334,_0x5ac5db){_0xb5b334=_0xb5b334-0x0;var _0x33f163=_0xa606[_0xb5b334];return _0x33f163;};'use strict';var EventEmitter=require(_0x6a60('0x0'));var ChatMessage=require(_0x6a60('0x1'))['db'][_0x6a60('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6a60('0x3')](0x0);var events={'afterCreate':_0x6a60('0x4'),'afterUpdate':_0x6a60('0x5'),'afterDestroy':'remove'};function emitEvent(_0x183c5f){return function(_0x1906d1,_0x2ba824,_0x400e83){ChatMessageEvents[_0x6a60('0x6')](_0x183c5f+':'+_0x1906d1['id'],_0x1906d1);ChatMessageEvents['emit'](_0x183c5f,_0x1906d1);_0x400e83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6a60('0x7')](e,emitEvent(event));}}module[_0x6a60('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3b79=['hasOwnProperty','events','../../mysqldb','ChatMessage','save','update','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b79,0x112));var _0x93b7=function(_0x7538f2,_0x3f02cb){_0x7538f2=_0x7538f2-0x0;var _0x3e34c0=_0x3b79[_0x7538f2];return _0x3e34c0;};'use strict';var EventEmitter=require(_0x93b7('0x0'));var ChatMessage=require(_0x93b7('0x1'))['db'][_0x93b7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b7('0x3'),'afterUpdate':_0x93b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x64dc6a){return function(_0x315c84,_0x300c6b,_0x50b17c){ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a+':'+_0x315c84['id'],_0x315c84);ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a,_0x315c84);_0x50b17c(null);};}for(var e in events){if(events[_0x93b7('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 672e0ea..f050514 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 _0x1340=['createdAt','error','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update'];(function(_0x5da3fa,_0x3ebbe2){var _0x23f911=function(_0x2cc4b7){while(--_0x2cc4b7){_0x5da3fa['push'](_0x5da3fa['shift']());}};_0x23f911(++_0x3ebbe2);}(_0x1340,0xab));var _0x0134=function(_0x346cf3,_0x567c74){_0x346cf3=_0x346cf3-0x0;var _0x5e70ca=_0x1340[_0x346cf3];return _0x5e70ca;};'use strict';var _=require(_0x0134('0x0'));var util=require('util');var logger=require(_0x0134('0x1'))('api');var moment=require(_0x0134('0x2'));var BPromise=require(_0x0134('0x3'));var rp=require(_0x0134('0x4'));var fs=require('fs');var path=require(_0x0134('0x5'));var rimraf=require(_0x0134('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x3c1d6b,_0x4020b2){return _0x3c1d6b[_0x0134('0x7')]('ChatMessage',attributes,{'tableName':_0x0134('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x0134('0x9')],'type':_0x0134('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x19afd9,_0x2fa26f,_0x7c9059){var _0x5c0476=_0x3c1d6b[_0x0134('0xb')];var _0x2954dd=_0x19afd9[_0x0134('0xc')]({'plain':!![]});if(_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()==='in'||_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()==='out'&&!_0x2954dd[_0x0134('0xf')]&&!_[_0x0134('0x10')](_0x2954dd[_0x0134('0x11')])){_0x5c0476['ChatInteraction'][_0x0134('0x12')]({'where':{'id':_0x2954dd['ChatInteractionId']}})[_0x0134('0x13')](function(_0x1546b8){if(_0x1546b8){_0x1546b8[_0x0134('0x14')]({'lastMsgAt':_0x2954dd[_0x0134('0x15')],'lastMsgDirection':_0x2954dd[_0x0134('0xd')][_0x0134('0xe')]()});}})['catch'](function(_0x30f748){console[_0x0134('0x16')](_0x30f748);});}_0x7c9059();}},'charset':_0x0134('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xda72=['direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','toLowerCase'];(function(_0x161530,_0x2d2f6d){var _0x5d58e6=function(_0x1ef75e){while(--_0x1ef75e){_0x161530['push'](_0x161530['shift']());}};_0x5d58e6(++_0x2d2f6d);}(_0xda72,0x7e));var _0x2da7=function(_0x293b44,_0x47fe5d){_0x293b44=_0x293b44-0x0;var _0x4a42eb=_0xda72[_0x293b44];return _0x4a42eb;};'use strict';var _=require('lodash');var util=require(_0x2da7('0x0'));var logger=require(_0x2da7('0x1'))(_0x2da7('0x2'));var moment=require('moment');var BPromise=require(_0x2da7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2da7('0x4'));var rimraf=require(_0x2da7('0x5'));var config=require(_0x2da7('0x6'));var attributes=require('./chatMessage.attributes');module[_0x2da7('0x7')]=function(_0x1bf00a,_0x5e5adb){return _0x1bf00a['define'](_0x2da7('0x8'),attributes,{'tableName':_0x2da7('0x9'),'paranoid':![],'indexes':[{'name':_0x2da7('0xa'),'fields':['body'],'type':_0x2da7('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d4de7,_0x1e9847,_0x4f56de){var _0x5f12f3=_0x1bf00a['models'];var _0x305f24=_0x4d4de7[_0x2da7('0xc')]({'plain':!![]});if(_0x305f24['direction'][_0x2da7('0xd')]()==='in'||_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()===_0x2da7('0xf')&&!_0x305f24['secret']&&!_[_0x2da7('0x10')](_0x305f24[_0x2da7('0x11')])){_0x5f12f3[_0x2da7('0x12')][_0x2da7('0x13')]({'where':{'id':_0x305f24[_0x2da7('0x14')]}})[_0x2da7('0x15')](function(_0x44b814){if(_0x44b814){_0x44b814[_0x2da7('0x16')]({'lastMsgAt':_0x305f24[_0x2da7('0x17')],'lastMsgDirection':_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()});}})[_0x2da7('0x18')](function(_0x4be0a9){console[_0x2da7('0x19')](_0x4be0a9);});}_0x4f56de();}},'charset':_0x2da7('0x1a'),'collate':_0x2da7('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index f5d696f..2c65316 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 _0x14f1=['ChatMessage','create','body','options','CreateChatMessage','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x14f1,0x71));var _0x114f=function(_0x2e2234,_0x5240a0){_0x2e2234=_0x2e2234-0x0;var _0x44f2d6=_0x14f1[_0x2e2234];return _0x44f2d6;};'use strict';var _=require(_0x114f('0x0'));var util=require('util');var moment=require(_0x114f('0x1'));var BPromise=require(_0x114f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x114f('0x3'));var db=require(_0x114f('0x4'))['db'];var utils=require(_0x114f('0x5'));var logger=require(_0x114f('0x6'))(_0x114f('0x7'));var config=require(_0x114f('0x8'));var jayson=require(_0x114f('0x9'));var client=jayson[_0x114f('0xa')][_0x114f('0xb')]({'port':0x232a});config[_0x114f('0xc')]=_[_0x114f('0xd')](config[_0x114f('0xc')],{'host':_0x114f('0xe'),'port':0x18eb});var socket=require(_0x114f('0xf'))(new Redis(config[_0x114f('0xc')]));require(_0x114f('0x10'))[_0x114f('0x11')](socket);function respondWithRpcPromise(_0x49593b,_0x22dd83,_0x18a0de){return new BPromise(function(_0x2fce4d,_0x4cf410){return client[_0x114f('0x12')](_0x49593b,_0x18a0de)[_0x114f('0x13')](function(_0x4f6f91){logger[_0x114f('0x14')](_0x114f('0x15'),_0x22dd83,'request\x20sent');logger[_0x114f('0x16')](_0x114f('0x17'),_0x22dd83,_0x114f('0x18'),JSON[_0x114f('0x19')](_0x4f6f91));if(_0x4f6f91[_0x114f('0x1a')]){if(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1b')]===0x1f4){logger[_0x114f('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);return _0x4cf410(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);}logger[_0x114f('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x4f6f91[_0x114f('0x1a')]['message']);return _0x2fce4d(_0x4f6f91[_0x114f('0x1a')][_0x114f('0x1c')]);}else{logger[_0x114f('0x14')]('ChatMessage,\x20%s,\x20%s',_0x22dd83,_0x114f('0x18'));_0x2fce4d(_0x4f6f91[_0x114f('0x1d')][_0x114f('0x1c')]);}})[_0x114f('0x1e')](function(_0x562637){logger[_0x114f('0x1a')](_0x114f('0x15'),_0x22dd83,_0x562637);_0x4cf410(_0x562637);});});}exports['CreateChatMessage']=function(_0x5970be){var _0x140f42=this;return new Promise(function(_0x24e0d3,_0x50244f){return db[_0x114f('0x1f')][_0x114f('0x20')](_0x5970be[_0x114f('0x21')],{'raw':_0x5970be[_0x114f('0x22')]?_0x5970be['options']['raw']===undefined?!![]:![]:!![]})[_0x114f('0x13')](function(_0x4dae99){logger[_0x114f('0x14')](_0x114f('0x23'),_0x5970be);logger[_0x114f('0x16')]('CreateChatMessage',_0x5970be,JSON[_0x114f('0x19')](_0x4dae99));_0x24e0d3(_0x4dae99);})[_0x114f('0x1e')](function(_0x3b747d){logger[_0x114f('0x1a')](_0x114f('0x23'),_0x3b747d[_0x114f('0x1c')],_0x5970be);_0x50244f(_0x140f42[_0x114f('0x1a')](0x1f4,_0x3b747d[_0x114f('0x1c')]));});});};
\ No newline at end of file
+var _0xc52c=['body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc52c,0x144));var _0xcc52=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xc52c[_0xf2662b];return _0x257dc7;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var rs=require(_0xcc52('0x4'));var fs=require('fs');var Redis=require(_0xcc52('0x5'));var db=require(_0xcc52('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var jayson=require(_0xcc52('0x9'));var client=jayson['client'][_0xcc52('0xa')]({'port':0x232a});config[_0xcc52('0xb')]=_[_0xcc52('0xc')](config[_0xcc52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xcc52('0xd')](socket);function respondWithRpcPromise(_0x463999,_0x139154,_0xc44204){return new BPromise(function(_0x38bf62,_0x4242b7){return client['request'](_0x463999,_0xc44204)[_0xcc52('0xe')](function(_0x1af4dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x139154,'request\x20sent');logger[_0xcc52('0xf')](_0xcc52('0x10'),_0x139154,_0xcc52('0x11'),JSON[_0xcc52('0x12')](_0x1af4dd));if(_0x1af4dd[_0xcc52('0x13')]){if(_0x1af4dd['error']['code']===0x1f4){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd[_0xcc52('0x13')][_0xcc52('0x15')]);return _0x4242b7(_0x1af4dd[_0xcc52('0x13')]['message']);}logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd['error'][_0xcc52('0x15')]);return _0x38bf62(_0x1af4dd[_0xcc52('0x13')]['message']);}else{logger['info'](_0xcc52('0x14'),_0x139154,_0xcc52('0x11'));_0x38bf62(_0x1af4dd['result'][_0xcc52('0x15')]);}})['catch'](function(_0x4015ed){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x4015ed);_0x4242b7(_0x4015ed);});});}exports[_0xcc52('0x16')]=function(_0x1072c6){var _0x40ea65=this;return new Promise(function(_0x1c3206,_0x2805e5){return db['ChatMessage'][_0xcc52('0x17')](_0x1072c6[_0xcc52('0x18')],{'raw':_0x1072c6[_0xcc52('0x19')]?_0x1072c6[_0xcc52('0x19')][_0xcc52('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30c328){logger[_0xcc52('0x1b')](_0xcc52('0x16'),_0x1072c6);logger[_0xcc52('0xf')]('CreateChatMessage',_0x1072c6,JSON[_0xcc52('0x12')](_0x30c328));_0x1c3206(_0x30c328);})[_0xcc52('0x1c')](function(_0x425d76){logger['error']('CreateChatMessage',_0x425d76[_0xcc52('0x15')],_0x1072c6);_0x2805e5(_0x40ea65[_0xcc52('0x13')](0x1f4,_0x425d76[_0xcc52('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index f681725..8b27cc5 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 _0x37c5=['remove','update','emit','removeListener','chatMessage:','save'];(function(_0x4dc4a9,_0x30d8bd){var _0x4cde6c=function(_0x16d036){while(--_0x16d036){_0x4dc4a9['push'](_0x4dc4a9['shift']());}};_0x4cde6c(++_0x30d8bd);}(_0x37c5,0xa7));var _0x537c=function(_0x147136,_0x503ee8){_0x147136=_0x147136-0x0;var _0x36638e=_0x37c5[_0x147136];return _0x36638e;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x537c('0x0'),_0x537c('0x1'),_0x537c('0x2')];function createListener(_0x11f076,_0x1c5b5f){return function(_0x183b59){_0x1c5b5f[_0x537c('0x3')](_0x11f076,_0x183b59);};}function removeListener(_0x42bd15,_0x2c0854){return function(){ChatMessageEvents[_0x537c('0x4')](_0x42bd15,_0x2c0854);};}exports['register']=function(_0x42c86a){for(var _0x1156f4=0x0,_0x336920=events['length'];_0x1156f4<_0x336920;_0x1156f4++){var _0x36bf4a=events[_0x1156f4];var _0x67f986=createListener(_0x537c('0x5')+_0x36bf4a,_0x42c86a);ChatMessageEvents['on'](_0x36bf4a,_0x67f986);}};
\ No newline at end of file
+var _0xa9b1=['chatMessage:','remove','update','emit','register','length'];(function(_0x27ff37,_0x2f9194){var _0x525816=function(_0x59fdaa){while(--_0x59fdaa){_0x27ff37['push'](_0x27ff37['shift']());}};_0x525816(++_0x2f9194);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x1a9b('0x0'),_0x1a9b('0x1')];function createListener(_0x11c1ff,_0x3f42db){return function(_0xc88712){_0x3f42db[_0x1a9b('0x2')](_0x11c1ff,_0xc88712);};}function removeListener(_0x52f55f,_0x57b453){return function(){ChatMessageEvents['removeListener'](_0x52f55f,_0x57b453);};}exports[_0x1a9b('0x3')]=function(_0x15861d){for(var _0x1a78b6=0x0,_0xc55657=events[_0x1a9b('0x4')];_0x1a78b6<_0xc55657;_0x1a78b6++){var _0x16c344=events[_0x1a78b6];var _0x263b84=createListener(_0x1a9b('0x5')+_0x16c344,_0x15861d);ChatMessageEvents['on'](_0x16c344,_0x263b84);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7b788f6..6fc6b92 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 _0x35ab=['accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0x35ab,0x101));var _0xb35a=function(_0x56d49a,_0x419ef9){_0x56d49a=_0x56d49a-0x0;var _0x2fe15f=_0x35ab[_0x56d49a];return _0x2fe15f;};'use strict';var multer=require('multer');var util=require(_0xb35a('0x0'));var path=require(_0xb35a('0x1'));var timeout=require(_0xb35a('0x2'));var express=require(_0xb35a('0x3'));var router=express[_0xb35a('0x4')]();var fs_extra=require(_0xb35a('0x5'));var auth=require(_0xb35a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb35a('0x7'));var controller=require(_0xb35a('0x8'));router['get']('/',auth[_0xb35a('0x9')](),controller[_0xb35a('0xa')]);router[_0xb35a('0xb')](_0xb35a('0xc'),auth[_0xb35a('0x9')](),controller['describe']);router['get'](_0xb35a('0xd'),auth[_0xb35a('0x9')](),controller[_0xb35a('0xe')]);router[_0xb35a('0xf')]('/',auth[_0xb35a('0x9')](),interaction[_0xb35a('0x10')](_0xb35a('0x11'),_0xb35a('0x12')),controller[_0xb35a('0x13')]);router['put'](_0xb35a('0xd'),controller[_0xb35a('0x14')]);router[_0xb35a('0x15')](_0xb35a('0x16'),auth[_0xb35a('0x9')](),controller[_0xb35a('0x17')]);router[_0xb35a('0x15')](_0xb35a('0x18'),auth[_0xb35a('0x9')](),controller[_0xb35a('0x19')]);router[_0xb35a('0x1a')]('/:id',auth[_0xb35a('0x9')](),controller[_0xb35a('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x6df0=['chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','post','tracked'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0x6df0,0x8c));var _0x06df=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x6df0[_0x2aee2f];return _0x19337f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06df('0x0'));var timeout=require(_0x06df('0x1'));var express=require('express');var router=express[_0x06df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x06df('0x3'));var interaction=require(_0x06df('0x4'));var config=require(_0x06df('0x5'));var controller=require(_0x06df('0x6'));router[_0x06df('0x7')]('/',auth['isAuthenticated'](),controller[_0x06df('0x8')]);router[_0x06df('0x7')](_0x06df('0x9'),auth[_0x06df('0xa')](),controller['describe']);router[_0x06df('0x7')](_0x06df('0xb'),auth[_0x06df('0xa')](),controller['show']);router[_0x06df('0xc')]('/',auth['isAuthenticated'](),interaction[_0x06df('0xd')]('chat',_0x06df('0xe')),controller[_0x06df('0xf')]);router[_0x06df('0x10')]('/:id',controller[_0x06df('0x11')]);router[_0x06df('0x10')](_0x06df('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x06df('0x13'),auth[_0x06df('0xa')](),controller[_0x06df('0x14')]);router[_0x06df('0x15')](_0x06df('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 47fdf6a..6704ffe 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 _0xc8c5=['sequelize','exports','TEXT','medium'];(function(_0x3358e5,_0x382eea){var _0x405068=function(_0x515a35){while(--_0x515a35){_0x3358e5['push'](_0x3358e5['shift']());}};_0x405068(++_0x382eea);}(_0xc8c5,0x120));var _0x5c8c=function(_0x3a44e4,_0x3ab711){_0x3a44e4=_0x3a44e4-0x0;var _0x2c94c1=_0xc8c5[_0x3a44e4];return _0x2c94c1;};'use strict';var Sequelize=require(_0x5c8c('0x0'));module[_0x5c8c('0x1')]={'body':{'type':Sequelize[_0x5c8c('0x2')](_0x5c8c('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x5fcc=['sequelize','TEXT','medium'];(function(_0x5b2002,_0x1a5b3c){var _0x54683f=function(_0x552edc){while(--_0x552edc){_0x5b2002['push'](_0x5b2002['shift']());}};_0x54683f(++_0x1a5b3c);}(_0x5fcc,0x12c));var _0xc5fc=function(_0x1b5463,_0x5716f8){_0x1b5463=_0x1b5463-0x0;var _0x33a19d=_0x5fcc[_0x1b5463];return _0x33a19d;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module['exports']={'body':{'type':Sequelize[_0xc5fc('0x1')](_0xc5fc('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 9642397..a7c1902 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1dcd0e,_0x47e39d){var _0xf97eb9=function(_0x1b1b92){while(--_0x1b1b92){_0x1dcd0e['push'](_0x1dcd0e['shift']());}};_0xf97eb9(++_0x47e39d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x7a54,0x106));var _0x47a5=function(_0x366ab2,_0x1ac782){_0x366ab2=_0x366ab2-0x0;var _0x12f965=_0x7a54[_0x366ab2];return _0x12f965;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 0525f19..883e5d4 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 _0xea55=['util','api','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x883c67,_0x36280e){var _0x5cabbb=function(_0x13a1cb){while(--_0x13a1cb){_0x883c67['push'](_0x883c67['shift']());}};_0x5cabbb(++_0x36280e);}(_0xea55,0x9b));var _0x5ea5=function(_0x29d2c4,_0x388d74){_0x29d2c4=_0x29d2c4-0x0;var _0x367d36=_0xea55[_0x29d2c4];return _0x367d36;};'use strict';var _=require(_0x5ea5('0x0'));var util=require(_0x5ea5('0x1'));var logger=require('../../config/logger')(_0x5ea5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ea5('0x3'));var rimraf=require(_0x5ea5('0x4'));var config=require(_0x5ea5('0x5'));var attributes=require(_0x5ea5('0x6'));module[_0x5ea5('0x7')]=function(_0x557ea6,_0x52edaf){return _0x557ea6[_0x5ea5('0x8')](_0x5ea5('0x9'),attributes,{'tableName':_0x5ea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5ea5('0xb')});};
\ No newline at end of file
+var _0x0679=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x1cb715,_0x41950d){var _0x37dfff=function(_0xfccda1){while(--_0xfccda1){_0x1cb715['push'](_0x1cb715['shift']());}};_0x37dfff(++_0x41950d);}(_0x0679,0x7f));var _0x9067=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0679[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9067('0x2'));var fs=require('fs');var path=require(_0x9067('0x3'));var rimraf=require(_0x9067('0x4'));var config=require(_0x9067('0x5'));var attributes=require(_0x9067('0x6'));module[_0x9067('0x7')]=function(_0x141c3c,_0x39d74c){return _0x141c3c[_0x9067('0x8')](_0x9067('0x9'),attributes,{'tableName':_0x9067('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9067('0xb'),'collate':_0x9067('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 4a78199..9d40973 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 _0x45a0=['result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x19de1d,_0x260b0d){var _0x4b7411=function(_0x3e38d3){while(--_0x3e38d3){_0x19de1d['push'](_0x19de1d['shift']());}};_0x4b7411(++_0x260b0d);}(_0x45a0,0x1e8));var _0x045a=function(_0xd31f7b,_0x4f1ede){_0xd31f7b=_0xd31f7b-0x0;var _0xfdf0f1=_0x45a0[_0xd31f7b];return _0xfdf0f1;};'use strict';var _=require(_0x045a('0x0'));var util=require(_0x045a('0x1'));var moment=require('moment');var BPromise=require(_0x045a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x045a('0x3'));var logger=require(_0x045a('0x4'))(_0x045a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x045a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2af007,_0x9bc14b,_0x31014f){return new BPromise(function(_0x35cad9,_0x104ba2){return client[_0x045a('0x7')](_0x2af007,_0x31014f)['then'](function(_0xb9ac24){logger[_0x045a('0x8')](_0x045a('0x9'),_0x9bc14b,_0x045a('0xa'));logger[_0x045a('0xb')](_0x045a('0xc'),_0x9bc14b,_0x045a('0xa'),JSON[_0x045a('0xd')](_0xb9ac24));if(_0xb9ac24[_0x045a('0xe')]){if(_0xb9ac24['error']['code']===0x1f4){logger[_0x045a('0xe')](_0x045a('0x9'),_0x9bc14b,_0xb9ac24[_0x045a('0xe')]['message']);return _0x104ba2(_0xb9ac24[_0x045a('0xe')][_0x045a('0xf')]);}logger['error'](_0x045a('0x9'),_0x9bc14b,_0xb9ac24[_0x045a('0xe')]['message']);return _0x35cad9(_0xb9ac24['error']['message']);}else{logger[_0x045a('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9bc14b,_0x045a('0xa'));_0x35cad9(_0xb9ac24[_0x045a('0x10')][_0x045a('0xf')]);}})[_0x045a('0x11')](function(_0x52025c){logger['error'](_0x045a('0x9'),_0x9bc14b,_0x52025c);_0x104ba2(_0x52025c);});});}
\ No newline at end of file
+var _0x3b2a=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0xe96a60,_0x5756e9){var _0x1da175=function(_0x4b3a8e){while(--_0x4b3a8e){_0xe96a60['push'](_0xe96a60['shift']());}};_0x1da175(++_0x5756e9);}(_0x3b2a,0x90));var _0xa3b2=function(_0x55a345,_0x5d3188){_0x55a345=_0x55a345-0x0;var _0xd74d62=_0x3b2a[_0x55a345];return _0xd74d62;};'use strict';var _=require('lodash');var util=require(_0xa3b2('0x0'));var moment=require('moment');var BPromise=require(_0xa3b2('0x1'));var rs=require(_0xa3b2('0x2'));var fs=require('fs');var Redis=require(_0xa3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa3b2('0x4'))(_0xa3b2('0x5'));var config=require(_0xa3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3b2('0x7')][_0xa3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59dc01,_0xc01ac1,_0x42a74c){return new BPromise(function(_0xa63d94,_0xe1ef79){return client[_0xa3b2('0x9')](_0x59dc01,_0x42a74c)[_0xa3b2('0xa')](function(_0x198b5a){logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));logger[_0xa3b2('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xc01ac1,_0xa3b2('0xd'),JSON[_0xa3b2('0xf')](_0x198b5a));if(_0x198b5a[_0xa3b2('0x10')]){if(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x11')]===0x1f4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a['error']['message']);return _0xe1ef79(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}logger[_0xa3b2('0x10')](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);return _0xa63d94(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}else{logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));_0xa63d94(_0x198b5a[_0xa3b2('0x13')][_0xa3b2('0x12')]);}})[_0xa3b2('0x14')](function(_0x5132e4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x5132e4);_0xe1ef79(_0x5132e4);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 57633c9..d79605a 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 _0xe340=['index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./chatOfflineMessage.controller','isAuthenticated'];(function(_0x1fae35,_0x385d6a){var _0x22f1a7=function(_0x181ef9){while(--_0x181ef9){_0x1fae35['push'](_0x1fae35['shift']());}};_0x22f1a7(++_0x385d6a);}(_0xe340,0xb5));var _0x0e34=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe340[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0e34('0x0'));var util=require('util');var path=require(_0x0e34('0x1'));var timeout=require(_0x0e34('0x2'));var express=require('express');var router=express[_0x0e34('0x3')]();var fs_extra=require(_0x0e34('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e34('0x5'));var controller=require(_0x0e34('0x6'));router['get']('/',auth[_0x0e34('0x7')](),controller[_0x0e34('0x8')]);router['get'](_0x0e34('0x9'),auth[_0x0e34('0x7')](),controller[_0x0e34('0xa')]);router[_0x0e34('0xb')](_0x0e34('0xc'),auth[_0x0e34('0x7')](),controller[_0x0e34('0xd')]);router[_0x0e34('0xe')]('/',auth[_0x0e34('0x7')](),controller[_0x0e34('0xf')]);router[_0x0e34('0x10')](_0x0e34('0xc'),auth['isAuthenticated'](),controller[_0x0e34('0x11')]);router[_0x0e34('0x12')](_0x0e34('0xc'),auth[_0x0e34('0x7')](),controller[_0x0e34('0x13')]);module[_0x0e34('0x14')]=router;
\ No newline at end of file
+var _0x5a48=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5a48,0x64));var _0x85a4=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x5a48[_0x591781];return _0x315bd9;};'use strict';var multer=require(_0x85a4('0x0'));var util=require('util');var path=require(_0x85a4('0x1'));var timeout=require(_0x85a4('0x2'));var express=require(_0x85a4('0x3'));var router=express[_0x85a4('0x4')]();var fs_extra=require(_0x85a4('0x5'));var auth=require(_0x85a4('0x6'));var interaction=require(_0x85a4('0x7'));var config=require(_0x85a4('0x8'));var controller=require(_0x85a4('0x9'));router[_0x85a4('0xa')]('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xc')]);router['get']('/describe',auth[_0x85a4('0xb')](),controller['describe']);router['get'](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller['show']);router['post']('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xe')]);router[_0x85a4('0xf')]('/:id',auth[_0x85a4('0xb')](),controller[_0x85a4('0x10')]);router[_0x85a4('0x11')](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller[_0x85a4('0x12')]);module[_0x85a4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 770d824..13aaa24 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 _0xff8e=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xff8e,0x170));var _0xeff8=function(_0x4b8d30,_0x3a0870){_0x4b8d30=_0x4b8d30-0x0;var _0xd1a650=_0xff8e[_0x4b8d30];return _0xd1a650;};'use strict';var Sequelize=require('sequelize');module[_0xeff8('0x0')]={'name':{'type':Sequelize[_0xeff8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeff8('0x2')](_0xeff8('0x3'),_0xeff8('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xeff8('0x1')]},'timeout':{'type':Sequelize[_0xeff8('0x5')]}};
\ No newline at end of file
+var _0x2c57=['STRING','mouseOver','timeout','sequelize','exports'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0x2c57,0xc6));var _0x72c5=function(_0x10ab93,_0x1fcb57){_0x10ab93=_0x10ab93-0x0;var _0x1a8a68=_0x2c57[_0x10ab93];return _0x1a8a68;};'use strict';var Sequelize=require(_0x72c5('0x0'));module[_0x72c5('0x1')]={'name':{'type':Sequelize[_0x72c5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x72c5('0x3'),_0x72c5('0x4')),'defaultValue':_0x72c5('0x3')},'selector':{'type':Sequelize[_0x72c5('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 34441e4..6fba67b 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 _0x41d9=['find','create','body','catch','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','then','sendStatus','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options'];(function(_0x43f5f3,_0x3c0f41){var _0x53dc4c=function(_0x2031e0){while(--_0x2031e0){_0x43f5f3['push'](_0x43f5f3['shift']());}};_0x53dc4c(++_0x3c0f41);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require(_0x941d('0x6'));var Mustache=require('mustache');var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require('sox');var csv=require(_0x941d('0x9'));var ejs=require(_0x941d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x941d('0xb'));var squel=require('squel');var crypto=require(_0x941d('0xc'));var jsforce=require(_0x941d('0xd'));var deskjs=require(_0x941d('0xe'));var toCsv=require(_0x941d('0x9'));var querystring=require(_0x941d('0xf'));var Papa=require('papaparse');var Redis=require(_0x941d('0x10'));var authService=require(_0x941d('0x11'));var qs=require(_0x941d('0x12'));var as=require(_0x941d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x14'))(_0x941d('0x15'));var utils=require(_0x941d('0x16'));var config=require(_0x941d('0x17'));var licenseUtil=require(_0x941d('0x18'));var db=require(_0x941d('0x19'))['db'];function respondWithStatusCode(_0x4d93c4,_0x192331){_0x192331=_0x192331||0xcc;return function(_0x55c5aa){if(_0x55c5aa){return _0x4d93c4['sendStatus'](_0x192331);}return _0x4d93c4[_0x941d('0x1a')](_0x192331)[_0x941d('0x1b')]();};}function respondWithResult(_0xbd3711,_0x2aa972){_0x2aa972=_0x2aa972||0xc8;return function(_0x20a6ab){if(_0x20a6ab){return _0xbd3711[_0x941d('0x1a')](_0x2aa972)[_0x941d('0x1c')](_0x20a6ab);}};}function respondWithFilteredResult(_0x45d85d,_0x369b0b){return function(_0x1f1aeb){if(_0x1f1aeb){var _0x7df80e=typeof _0x369b0b['offset']===_0x941d('0x1d')&&typeof _0x369b0b[_0x941d('0x1e')]===_0x941d('0x1d');var _0x2e5c4f=_0x1f1aeb[_0x941d('0x1f')];var _0x3ac25f=_0x7df80e?0x0:_0x369b0b[_0x941d('0x20')];var _0x2c6ce5=_0x7df80e?_0x1f1aeb[_0x941d('0x1f')]:_0x369b0b['offset']+_0x369b0b[_0x941d('0x1e')];var _0x57f5e6;if(_0x2c6ce5>=_0x2e5c4f){_0x2c6ce5=_0x2e5c4f;_0x57f5e6=0xc8;}else{_0x57f5e6=0xce;}_0x45d85d[_0x941d('0x1a')](_0x57f5e6);return _0x45d85d[_0x941d('0x21')]('Content-Range',_0x3ac25f+'-'+_0x2c6ce5+'/'+_0x2e5c4f)[_0x941d('0x1c')](_0x1f1aeb);}return null;};}function patchUpdates(_0x5ac2e6){return function(_0x526708){try{jsonpatch[_0x941d('0x22')](_0x526708,_0x5ac2e6,!![]);}catch(_0xf6636){return BPromise[_0x941d('0x23')](_0xf6636);}return _0x526708['save']();};}function saveUpdates(_0x1309af,_0x3baf0b){return function(_0xc19c76){if(_0xc19c76){return _0xc19c76['update'](_0x1309af)['then'](function(_0x520bb2){return _0x520bb2;});}return null;};}function removeEntity(_0x306557,_0x26b7b6){return function(_0xd72c49){if(_0xd72c49){return _0xd72c49[_0x941d('0x24')]()[_0x941d('0x25')](function(){_0x306557['status'](0xcc)[_0x941d('0x1b')]();});}};}function handleEntityNotFound(_0x43a443,_0x11c2c9){return function(_0x48baff){if(!_0x48baff){_0x43a443[_0x941d('0x26')](0x194);}return _0x48baff;};}function handleError(_0x1ce2fe,_0x3190d4){_0x3190d4=_0x3190d4||0x1f4;return function(_0x3a72d7){logger[_0x941d('0x27')](_0x3a72d7[_0x941d('0x28')]);if(_0x3a72d7[_0x941d('0x29')]){delete _0x3a72d7[_0x941d('0x29')];}_0x1ce2fe[_0x941d('0x1a')](_0x3190d4)[_0x941d('0x2a')](_0x3a72d7);};}exports[_0x941d('0x2b')]=function(_0x1cacc4,_0x4cf929){var _0x30615a={'raw':!![],'where':{'id':_0x1cacc4['params']['id']}},_0x42050d={};_0x42050d[_0x941d('0x2c')]=_[_0x941d('0x2d')](db[_0x941d('0x2e')][_0x941d('0x2f')]);_0x42050d[_0x941d('0x30')]=_[_0x941d('0x2d')](_0x1cacc4[_0x941d('0x30')]);_0x42050d['filters']=_['intersection'](_0x42050d[_0x941d('0x2c')],_0x42050d[_0x941d('0x30')]);_0x30615a[_0x941d('0x31')]=_['intersection'](_0x42050d['model'],qs[_0x941d('0x32')](_0x1cacc4[_0x941d('0x30')][_0x941d('0x32')]));_0x30615a['attributes']=_0x30615a[_0x941d('0x31')][_0x941d('0x33')]?_0x30615a[_0x941d('0x31')]:_0x42050d[_0x941d('0x2c')];if(_0x1cacc4['query'][_0x941d('0x34')]){_0x30615a[_0x941d('0x35')]=[{'all':!![]}];}_0x30615a=_[_0x941d('0x36')]({},_0x30615a,_0x1cacc4[_0x941d('0x37')]);return db[_0x941d('0x2e')][_0x941d('0x38')](_0x30615a)['then'](handleEntityNotFound(_0x4cf929,null))['then'](respondWithResult(_0x4cf929,null))['catch'](handleError(_0x4cf929,null));};exports[_0x941d('0x39')]=function(_0x558846,_0x204259){return db[_0x941d('0x2e')][_0x941d('0x39')](_0x558846[_0x941d('0x3a')],{})[_0x941d('0x25')](respondWithResult(_0x204259,0xc9))[_0x941d('0x3b')](handleError(_0x204259,null));};exports[_0x941d('0x3c')]=function(_0x32d072,_0x202c89){if(_0x32d072[_0x941d('0x3a')]['id']){delete _0x32d072['body']['id'];}return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0x32d072[_0x941d('0x3d')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x202c89,null))[_0x941d('0x25')](saveUpdates(_0x32d072[_0x941d('0x3a')],null))[_0x941d('0x25')](respondWithResult(_0x202c89,null))[_0x941d('0x3b')](handleError(_0x202c89,null));};exports[_0x941d('0x24')]=function(_0xcdd784,_0x37b04c){return db[_0x941d('0x2e')][_0x941d('0x38')]({'where':{'id':_0xcdd784['params']['id']}})['then'](handleEntityNotFound(_0x37b04c,null))[_0x941d('0x25')](removeEntity(_0x37b04c,null))[_0x941d('0x3b')](handleError(_0x37b04c,null));};
\ No newline at end of file
+var _0x556b=['ChatProactiveAction','rawAttributes','query','intersection','model','fields','attributes','includeAll','merge','options','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','send','show'];(function(_0x4ada2b,_0x129e77){var _0x27b275=function(_0x90cf7b){while(--_0x90cf7b){_0x4ada2b['push'](_0x4ada2b['shift']());}};_0x27b275(++_0x129e77);}(_0x556b,0x1d7));var _0xb556=function(_0x4ae509,_0x27c36a){_0x4ae509=_0x4ae509-0x0;var _0x10e96e=_0x556b[_0x4ae509];return _0x10e96e;};'use strict';var emlformat=require(_0xb556('0x0'));var rimraf=require(_0xb556('0x1'));var zipdir=require(_0xb556('0x2'));var jsonpatch=require(_0xb556('0x3'));var rp=require(_0xb556('0x4'));var moment=require('moment');var BPromise=require(_0xb556('0x5'));var Mustache=require(_0xb556('0x6'));var util=require(_0xb556('0x7'));var path=require(_0xb556('0x8'));var sox=require(_0xb556('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb556('0xa'));var squel=require(_0xb556('0xb'));var crypto=require(_0xb556('0xc'));var jsforce=require(_0xb556('0xd'));var deskjs=require(_0xb556('0xe'));var toCsv=require(_0xb556('0xf'));var querystring=require(_0xb556('0x10'));var Papa=require(_0xb556('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb556('0x13'));var logger=require(_0xb556('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb556('0x15'));var licenseUtil=require(_0xb556('0x16'));var db=require(_0xb556('0x17'))['db'];function respondWithStatusCode(_0x40d9f2,_0xef593){_0xef593=_0xef593||0xcc;return function(_0x383401){if(_0x383401){return _0x40d9f2['sendStatus'](_0xef593);}return _0x40d9f2['status'](_0xef593)[_0xb556('0x18')]();};}function respondWithResult(_0x5a002a,_0x29fa7e){_0x29fa7e=_0x29fa7e||0xc8;return function(_0x52ff5e){if(_0x52ff5e){return _0x5a002a['status'](_0x29fa7e)['json'](_0x52ff5e);}};}function respondWithFilteredResult(_0x39305f,_0x9c69d9){return function(_0xffd07){if(_0xffd07){var _0x329bd0=typeof _0x9c69d9[_0xb556('0x19')]===_0xb556('0x1a')&&typeof _0x9c69d9[_0xb556('0x1b')]===_0xb556('0x1a');var _0xcfaa19=_0xffd07['count'];var _0x475808=_0x329bd0?0x0:_0x9c69d9[_0xb556('0x19')];var _0xb378b2=_0x329bd0?_0xffd07[_0xb556('0x1c')]:_0x9c69d9['offset']+_0x9c69d9[_0xb556('0x1b')];var _0x355b15;if(_0xb378b2>=_0xcfaa19){_0xb378b2=_0xcfaa19;_0x355b15=0xc8;}else{_0x355b15=0xce;}_0x39305f[_0xb556('0x1d')](_0x355b15);return _0x39305f[_0xb556('0x1e')]('Content-Range',_0x475808+'-'+_0xb378b2+'/'+_0xcfaa19)[_0xb556('0x1f')](_0xffd07);}return null;};}function patchUpdates(_0x3f1f30){return function(_0xa840e7){try{jsonpatch[_0xb556('0x20')](_0xa840e7,_0x3f1f30,!![]);}catch(_0x49d0b5){return BPromise[_0xb556('0x21')](_0x49d0b5);}return _0xa840e7[_0xb556('0x22')]();};}function saveUpdates(_0x21a3b6,_0x126af6){return function(_0x420ddb){if(_0x420ddb){return _0x420ddb[_0xb556('0x23')](_0x21a3b6)[_0xb556('0x24')](function(_0x5f10a5){return _0x5f10a5;});}return null;};}function removeEntity(_0x33797a,_0x3d5ae7){return function(_0x12b195){if(_0x12b195){return _0x12b195[_0xb556('0x25')]()[_0xb556('0x24')](function(){_0x33797a[_0xb556('0x1d')](0xcc)[_0xb556('0x18')]();});}};}function handleEntityNotFound(_0x442264,_0x22abed){return function(_0x184e87){if(!_0x184e87){_0x442264[_0xb556('0x26')](0x194);}return _0x184e87;};}function handleError(_0x3a328c,_0xb89dbe){_0xb89dbe=_0xb89dbe||0x1f4;return function(_0x1962b1){logger['error'](_0x1962b1[_0xb556('0x27')]);if(_0x1962b1['name']){delete _0x1962b1['name'];}_0x3a328c['status'](_0xb89dbe)[_0xb556('0x28')](_0x1962b1);};}exports[_0xb556('0x29')]=function(_0x27fd7e,_0x58180c){var _0x19544e={'raw':!![],'where':{'id':_0x27fd7e['params']['id']}},_0x3c9a87={};_0x3c9a87['model']=_['keys'](db[_0xb556('0x2a')][_0xb556('0x2b')]);_0x3c9a87['query']=_['keys'](_0x27fd7e[_0xb556('0x2c')]);_0x3c9a87['filters']=_[_0xb556('0x2d')](_0x3c9a87['model'],_0x3c9a87[_0xb556('0x2c')]);_0x19544e['attributes']=_[_0xb556('0x2d')](_0x3c9a87[_0xb556('0x2e')],qs['fields'](_0x27fd7e['query'][_0xb556('0x2f')]));_0x19544e[_0xb556('0x30')]=_0x19544e[_0xb556('0x30')]['length']?_0x19544e[_0xb556('0x30')]:_0x3c9a87[_0xb556('0x2e')];if(_0x27fd7e[_0xb556('0x2c')][_0xb556('0x31')]){_0x19544e['include']=[{'all':!![]}];}_0x19544e=_[_0xb556('0x32')]({},_0x19544e,_0x27fd7e[_0xb556('0x33')]);return db['ChatProactiveAction']['find'](_0x19544e)[_0xb556('0x24')](handleEntityNotFound(_0x58180c,null))[_0xb556('0x24')](respondWithResult(_0x58180c,null))[_0xb556('0x34')](handleError(_0x58180c,null));};exports['create']=function(_0x272ffe,_0x2af3fa){return db['ChatProactiveAction'][_0xb556('0x35')](_0x272ffe[_0xb556('0x36')],{})[_0xb556('0x24')](respondWithResult(_0x2af3fa,0xc9))['catch'](handleError(_0x2af3fa,null));};exports['update']=function(_0x34273c,_0x2db02e){if(_0x34273c[_0xb556('0x36')]['id']){delete _0x34273c['body']['id'];}return db[_0xb556('0x2a')][_0xb556('0x37')]({'where':{'id':_0x34273c['params']['id']}})['then'](handleEntityNotFound(_0x2db02e,null))[_0xb556('0x24')](saveUpdates(_0x34273c[_0xb556('0x36')],null))['then'](respondWithResult(_0x2db02e,null))['catch'](handleError(_0x2db02e,null));};exports[_0xb556('0x25')]=function(_0x13d1d5,_0x38c26d){return db[_0xb556('0x2a')]['find']({'where':{'id':_0x13d1d5[_0xb556('0x38')]['id']}})['then'](handleEntityNotFound(_0x38c26d,null))['then'](removeEntity(_0x38c26d,null))[_0xb556('0x34')](handleError(_0x38c26d,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b2ee2b8..475d323 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 _0x2a63=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xe8f1f9,_0x212021){var _0x16995e=function(_0x11cd04){while(--_0x11cd04){_0xe8f1f9['push'](_0xe8f1f9['shift']());}};_0x16995e(++_0x212021);}(_0x2a63,0x87));var _0x32a6=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x2a63[_0x14915a];return _0x2f683c;};'use strict';var _=require(_0x32a6('0x0'));var util=require(_0x32a6('0x1'));var logger=require(_0x32a6('0x2'))(_0x32a6('0x3'));var moment=require(_0x32a6('0x4'));var BPromise=require(_0x32a6('0x5'));var rp=require(_0x32a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32a6('0x7'));var attributes=require(_0x32a6('0x8'));module[_0x32a6('0x9')]=function(_0x5a1e3b,_0x103b18){return _0x5a1e3b[_0x32a6('0xa')](_0x32a6('0xb'),attributes,{'tableName':_0x32a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6140=['bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','../../config/logger'];(function(_0x34a459,_0x136cd9){var _0x500f8b=function(_0xdcad7f){while(--_0xdcad7f){_0x34a459['push'](_0x34a459['shift']());}};_0x500f8b(++_0x136cd9);}(_0x6140,0x1d6));var _0x0614=function(_0x4345be,_0x1e1dd6){_0x4345be=_0x4345be-0x0;var _0xf851a1=_0x6140[_0x4345be];return _0xf851a1;};'use strict';var _=require('lodash');var util=require(_0x0614('0x0'));var logger=require(_0x0614('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0614('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0614('0x3'));var attributes=require(_0x0614('0x4'));module[_0x0614('0x5')]=function(_0x324dde,_0x4dd7f1){return _0x324dde[_0x0614('0x6')](_0x0614('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index c32ef84..969b2c8 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 _0x26a1=['code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31c32e,_0x4c2442){var _0x3d39b1=function(_0x5e3c03){while(--_0x5e3c03){_0x31c32e['push'](_0x31c32e['shift']());}};_0x3d39b1(++_0x4c2442);}(_0x26a1,0x115));var _0x126a=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x26a1[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x126a('0x0'));var BPromise=require('bluebird');var rs=require(_0x126a('0x1'));var fs=require('fs');var Redis=require(_0x126a('0x2'));var db=require(_0x126a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x126a('0x4'))(_0x126a('0x5'));var config=require(_0x126a('0x6'));var jayson=require(_0x126a('0x7'));var client=jayson['client'][_0x126a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2de2d9,_0x552442,_0x5d0659){return new BPromise(function(_0x176594,_0x1b45d2){return client[_0x126a('0x9')](_0x2de2d9,_0x5d0659)[_0x126a('0xa')](function(_0x4925be){logger[_0x126a('0xb')](_0x126a('0xc'),_0x552442,_0x126a('0xd'));logger['debug'](_0x126a('0xe'),_0x552442,_0x126a('0xd'),JSON[_0x126a('0xf')](_0x4925be));if(_0x4925be[_0x126a('0x10')]){if(_0x4925be['error'][_0x126a('0x11')]===0x1f4){logger[_0x126a('0x10')](_0x126a('0xc'),_0x552442,_0x4925be[_0x126a('0x10')]['message']);return _0x1b45d2(_0x4925be[_0x126a('0x10')][_0x126a('0x12')]);}logger[_0x126a('0x10')](_0x126a('0xc'),_0x552442,_0x4925be['error']['message']);return _0x176594(_0x4925be[_0x126a('0x10')][_0x126a('0x12')]);}else{logger['info'](_0x126a('0xc'),_0x552442,'request\x20sent');_0x176594(_0x4925be[_0x126a('0x13')][_0x126a('0x12')]);}})[_0x126a('0x14')](function(_0x3c06f3){logger['error'](_0x126a('0xc'),_0x552442,_0x3c06f3);_0x1b45d2(_0x3c06f3);});});}
\ No newline at end of file
+var _0xff7e=['../../config/logger','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0xff7e,0x163));var _0xeff7=function(_0x4ac7f3,_0x580162){_0x4ac7f3=_0x4ac7f3-0x0;var _0x5690f1=_0xff7e[_0x4ac7f3];return _0x5690f1;};'use strict';var _=require(_0xeff7('0x0'));var util=require(_0xeff7('0x1'));var moment=require(_0xeff7('0x2'));var BPromise=require(_0xeff7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeff7('0x4'));var logger=require(_0xeff7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeff7('0x6'));var client=jayson['client'][_0xeff7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45a825,_0x422243,_0x16876c){return new BPromise(function(_0x392f3f,_0x136a47){return client[_0xeff7('0x8')](_0x45a825,_0x16876c)['then'](function(_0xc61a7f){logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');logger[_0xeff7('0xb')](_0xeff7('0xc'),_0x422243,_0xeff7('0xd'),JSON[_0xeff7('0xe')](_0xc61a7f));if(_0xc61a7f[_0xeff7('0xf')]){if(_0xc61a7f[_0xeff7('0xf')]['code']===0x1f4){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')]['message']);return _0x136a47(_0xc61a7f['error'][_0xeff7('0x10')]);}logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);return _0x392f3f(_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);}else{logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');_0x392f3f(_0xc61a7f[_0xeff7('0x11')][_0xeff7('0x10')]);}})['catch'](function(_0x5f3b6d){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0x5f3b6d);_0x136a47(_0x5f3b6d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c6eae9e..c13d473 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x54eb07,_0x335479){var _0x2b1bbb=function(_0x726a1e){while(--_0x726a1e){_0x54eb07['push'](_0x54eb07['shift']());}};_0x2b1bbb(++_0x335479);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4c56ad,_0x58b96f){_0x4c56ad=_0x4c56ad-0x0;var _0x216c05=_0xd8fb[_0x4c56ad];return _0x216c05;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
+var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x370c84,_0x1163e0){var _0x4cca44=function(_0x3b53a7){while(--_0x3b53a7){_0x370c84['push'](_0x370c84['shift']());}};_0x4cca44(++_0x1163e0);}(_0x53ec,0x192));var _0xc53e=function(_0x3d3d96,_0x28998e){_0x3d3d96=_0x3d3d96-0x0;var _0x2e479a=_0x53ec[_0x3d3d96];return _0x2e479a;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 8a6d35b..fc31f52 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 _0x2628=['exports','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x5afa3a,_0x886fc7){var _0x43b612=function(_0xac89ec){while(--_0xac89ec){_0x5afa3a['push'](_0x5afa3a['shift']());}};_0x43b612(++_0x886fc7);}(_0x2628,0x15c));var _0x8262=function(_0x2693e7,_0x5c450b){_0x2693e7=_0x2693e7-0x0;var _0x1944c9=_0x2628[_0x2693e7];return _0x1944c9;};'use strict';var Sequelize=require('sequelize');module[_0x8262('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8262('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8262('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8262('0x3')](_0x8262('0x4'),'beepall',_0x8262('0x5'))}};
\ No newline at end of file
+var _0x948b=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x61711c,_0x5b2962){var _0x4cf0e9=function(_0x179352){while(--_0x179352){_0x61711c['push'](_0x61711c['shift']());}};_0x4cf0e9(++_0x5b2962);}(_0x948b,0x15c));var _0xb948=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x948b[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb948('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb948('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb948('0x2')](_0xb948('0x3'),_0xb948('0x4'),_0xb948('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ab701ce..1ac4930 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 _0x6c20=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','query','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','createdAt','format','%s/%s','chatPause','Team','getTeams','hasOwnProperty','User','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','userChatQueue:save','getAgents','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x569ea2,_0x4857f1){var _0xda711=function(_0xcada49){while(--_0xcada49){_0x569ea2['push'](_0x569ea2['shift']());}};_0xda711(++_0x4857f1);}(_0x6c20,0x88));var _0x06c2=function(_0x2775f4,_0x10ddd4){_0x2775f4=_0x2775f4-0x0;var _0x377a51=_0x6c20[_0x2775f4];return _0x377a51;};'use strict';var emlformat=require(_0x06c2('0x0'));var rimraf=require(_0x06c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x06c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x06c2('0x3'));var util=require(_0x06c2('0x4'));var path=require(_0x06c2('0x5'));var sox=require(_0x06c2('0x6'));var csv=require(_0x06c2('0x7'));var ejs=require(_0x06c2('0x8'));var fs=require('fs');var fs_extra=require(_0x06c2('0x9'));var _=require(_0x06c2('0xa'));var squel=require(_0x06c2('0xb'));var crypto=require('crypto');var jsforce=require(_0x06c2('0xc'));var deskjs=require(_0x06c2('0xd'));var toCsv=require(_0x06c2('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06c2('0xe'));var qs=require(_0x06c2('0xf'));var as=require(_0x06c2('0x10'));var hardwareService=require(_0x06c2('0x11'));var logger=require(_0x06c2('0x12'))(_0x06c2('0x13'));var utils=require(_0x06c2('0x14'));var config=require(_0x06c2('0x15'));var licenseUtil=require(_0x06c2('0x16'));var db=require(_0x06c2('0x17'))['db'];config['redis']=_[_0x06c2('0x18')](config[_0x06c2('0x19')],{'host':_0x06c2('0x1a'),'port':0x18eb});var socket=require(_0x06c2('0x1b'))(new Redis(config['redis']));require(_0x06c2('0x1c'))['register'](socket);var jayson=require(_0x06c2('0x1d'));var client=jayson[_0x06c2('0x1e')][_0x06c2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3ca58e,_0x574a8b,_0x946f15,_0x224baa){return new BPromise(function(_0x112ab2,_0x1df697){var _0x5cec76=_0x224baa||client;return _0x5cec76['request'](_0x3ca58e,_0x946f15)['then'](function(_0x4bf48d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x574a8b,_0x06c2('0x20'));logger[_0x06c2('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x574a8b,'request\x20sent',JSON['stringify'](_0x4bf48d));if(_0x4bf48d[_0x06c2('0x22')]){if(_0x4bf48d[_0x06c2('0x22')][_0x06c2('0x23')]===0x1f4){logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x4bf48d[_0x06c2('0x22')][_0x06c2('0x25')]);return _0x1df697(_0x4bf48d['error'][_0x06c2('0x25')]);}logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x4bf48d[_0x06c2('0x22')]['message']);return _0x112ab2(_0x4bf48d['error'][_0x06c2('0x25')]);}else{logger['info'](_0x06c2('0x24'),_0x574a8b,_0x06c2('0x20'));_0x112ab2(_0x4bf48d[_0x06c2('0x26')][_0x06c2('0x25')]);}})['catch'](function(_0x2d8373){logger[_0x06c2('0x22')](_0x06c2('0x24'),_0x574a8b,_0x2d8373);_0x1df697(_0x2d8373);});});}function respondWithStatusCode(_0xb56c17,_0x86da7a){_0x86da7a=_0x86da7a||0xcc;return function(_0x30bece){if(_0x30bece){return _0xb56c17[_0x06c2('0x27')](_0x86da7a);}return _0xb56c17[_0x06c2('0x28')](_0x86da7a)[_0x06c2('0x29')]();};}function respondWithResult(_0x413125,_0x391f87){_0x391f87=_0x391f87||0xc8;return function(_0x4c12ca){if(_0x4c12ca){return _0x413125[_0x06c2('0x28')](_0x391f87)[_0x06c2('0x2a')](_0x4c12ca);}};}function respondWithFilteredResult(_0x23ea70,_0x222124){return function(_0xe2b961){if(_0xe2b961){var _0x2c6a15=typeof _0x222124[_0x06c2('0x2b')]==='undefined'&&typeof _0x222124[_0x06c2('0x2c')]===_0x06c2('0x2d');var _0x2425ad=_0xe2b961[_0x06c2('0x2e')];var _0xe6b93c=_0x2c6a15?0x0:_0x222124['offset'];var _0x3e4d7f=_0x2c6a15?_0xe2b961[_0x06c2('0x2e')]:_0x222124['offset']+_0x222124[_0x06c2('0x2c')];var _0x5bd948;if(_0x3e4d7f>=_0x2425ad){_0x3e4d7f=_0x2425ad;_0x5bd948=0xc8;}else{_0x5bd948=0xce;}_0x23ea70[_0x06c2('0x28')](_0x5bd948);return _0x23ea70[_0x06c2('0x2f')](_0x06c2('0x30'),_0xe6b93c+'-'+_0x3e4d7f+'/'+_0x2425ad)['json'](_0xe2b961);}return null;};}function patchUpdates(_0x30fb98){return function(_0x414cc3){try{jsonpatch[_0x06c2('0x31')](_0x414cc3,_0x30fb98,!![]);}catch(_0x5be2cd){return BPromise[_0x06c2('0x32')](_0x5be2cd);}return _0x414cc3[_0x06c2('0x33')]();};}function saveUpdates(_0x5a69c1,_0x5bb12a){return function(_0x286ba4){if(_0x286ba4){return _0x286ba4['update'](_0x5a69c1)[_0x06c2('0x34')](function(_0x445a18){return _0x445a18;});}return null;};}function removeEntity(_0x2e5d4c,_0x5eee96){return function(_0xfd4e47){if(_0xfd4e47){return _0xfd4e47[_0x06c2('0x35')]()[_0x06c2('0x34')](function(){var _0x232c15=_0xfd4e47[_0x06c2('0x36')]({'plain':!![]});var _0x5dec20=_0x06c2('0x37');return db[_0x06c2('0x38')][_0x06c2('0x35')]({'where':{'type':_0x5dec20,'resourceId':_0x232c15['id']}})[_0x06c2('0x34')](function(){return _0xfd4e47;});})[_0x06c2('0x34')](function(){_0x2e5d4c[_0x06c2('0x28')](0xcc)[_0x06c2('0x29')]();});}};}function handleEntityNotFound(_0x1ad475,_0x1fe07a){return function(_0x110415){if(!_0x110415){_0x1ad475['sendStatus'](0x194);}return _0x110415;};}function handleError(_0x21a593,_0x2ccc33){_0x2ccc33=_0x2ccc33||0x1f4;return function(_0x1e053f){logger[_0x06c2('0x22')](_0x1e053f[_0x06c2('0x39')]);if(_0x1e053f[_0x06c2('0x3a')]){delete _0x1e053f['name'];}_0x21a593['status'](_0x2ccc33)['send'](_0x1e053f);};}exports[_0x06c2('0x3b')]=function(_0x22bd8c,_0x15260b){var _0x3c1bc0={},_0x271c20={},_0x1a5abf={'count':0x0,'rows':[]};var _0x5d5f19=_[_0x06c2('0x3c')](db[_0x06c2('0x3d')][_0x06c2('0x3e')],function(_0x315d89){return{'name':_0x315d89[_0x06c2('0x3f')],'type':_0x315d89[_0x06c2('0x40')]['key']};});_0x271c20['model']=_[_0x06c2('0x3c')](_0x5d5f19,_0x06c2('0x3a'));_0x271c20[_0x06c2('0x41')]=_['keys'](_0x22bd8c[_0x06c2('0x41')]);_0x271c20['filters']=_[_0x06c2('0x42')](_0x271c20['model'],_0x271c20[_0x06c2('0x41')]);_0x3c1bc0[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x271c20[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x22bd8c[_0x06c2('0x41')]['fields']));_0x3c1bc0['attributes']=_0x3c1bc0['attributes']['length']?_0x3c1bc0[_0x06c2('0x43')]:_0x271c20[_0x06c2('0x44')];if(!_0x22bd8c['query']['hasOwnProperty'](_0x06c2('0x46'))){_0x3c1bc0[_0x06c2('0x2c')]=qs[_0x06c2('0x2c')](_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x3c1bc0[_0x06c2('0x2b')]=qs[_0x06c2('0x2b')](_0x22bd8c['query'][_0x06c2('0x2b')]);}_0x3c1bc0[_0x06c2('0x47')]=qs[_0x06c2('0x48')](_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x48')]);_0x3c1bc0[_0x06c2('0x49')]=qs['filters'](_[_0x06c2('0x4a')](_0x22bd8c[_0x06c2('0x41')],_0x271c20[_0x06c2('0x4b')]),_0x5d5f19);if(_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x4c')]){_0x3c1bc0[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0x3c1bc0[_0x06c2('0x49')],{'$or':_[_0x06c2('0x3c')](_0x5d5f19,function(_0x1168b5){if(_0x1168b5['type']!==_0x06c2('0x4e')){var _0x23e01e={};_0x23e01e[_0x1168b5[_0x06c2('0x3a')]]={'$like':'%'+_0x22bd8c[_0x06c2('0x41')]['filter']+'%'};return _0x23e01e;}})});}_0x3c1bc0=_[_0x06c2('0x4d')]({},_0x3c1bc0,_0x22bd8c[_0x06c2('0x4f')]);var _0x2ce4b6={'where':_0x3c1bc0['where']};return db['ChatQueue']['count'](_0x2ce4b6)[_0x06c2('0x34')](function(_0x13929e){_0x1a5abf[_0x06c2('0x2e')]=_0x13929e;if(_0x22bd8c[_0x06c2('0x41')][_0x06c2('0x50')]){_0x3c1bc0[_0x06c2('0x51')]=[{'all':!![]}];}return db[_0x06c2('0x3d')][_0x06c2('0x52')](_0x3c1bc0);})[_0x06c2('0x34')](function(_0x4d1cad){_0x1a5abf[_0x06c2('0x53')]=_0x4d1cad;return _0x1a5abf;})['then'](respondWithFilteredResult(_0x15260b,_0x3c1bc0))[_0x06c2('0x54')](handleError(_0x15260b,null));};exports['show']=function(_0x5f0168,_0x23434a){var _0x1c53ef={'raw':!![],'where':{'id':_0x5f0168[_0x06c2('0x55')]['id']}},_0x38290e={};_0x38290e['model']=_['keys'](db[_0x06c2('0x3d')][_0x06c2('0x3e')]);_0x38290e[_0x06c2('0x41')]=_[_0x06c2('0x56')](_0x5f0168['query']);_0x38290e[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x38290e[_0x06c2('0x44')],_0x38290e[_0x06c2('0x41')]);_0x1c53ef[_0x06c2('0x43')]=_['intersection'](_0x38290e[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x5f0168['query'][_0x06c2('0x45')]));_0x1c53ef[_0x06c2('0x43')]=_0x1c53ef['attributes'][_0x06c2('0x57')]?_0x1c53ef[_0x06c2('0x43')]:_0x38290e[_0x06c2('0x44')];if(_0x5f0168['query'][_0x06c2('0x50')]){_0x1c53ef[_0x06c2('0x51')]=[{'all':!![]}];}_0x1c53ef=_[_0x06c2('0x4d')]({},_0x1c53ef,_0x5f0168['options']);return db[_0x06c2('0x3d')][_0x06c2('0x58')](_0x1c53ef)['then'](handleEntityNotFound(_0x23434a,null))['then'](respondWithResult(_0x23434a,null))[_0x06c2('0x54')](handleError(_0x23434a,null));};exports[_0x06c2('0x59')]=function(_0x4cd26a,_0x2c4bf0){return db[_0x06c2('0x3d')]['create'](_0x4cd26a[_0x06c2('0x5a')],{})[_0x06c2('0x34')](function(_0x55a9f4){var _0x3d10b5=_0x4cd26a[_0x06c2('0x5b')][_0x06c2('0x36')]({'plain':!![]});if(!_0x3d10b5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d10b5[_0x06c2('0x5c')]===_0x06c2('0x5b')){var _0x151571=_0x55a9f4[_0x06c2('0x36')]({'plain':!![]});var _0x1f1fbc=_0x06c2('0x37');return db[_0x06c2('0x5d')][_0x06c2('0x58')]({'where':{'name':_0x1f1fbc,'userProfileId':_0x3d10b5[_0x06c2('0x5e')]},'raw':!![]})[_0x06c2('0x34')](function(_0x3e9d4b){if(_0x3e9d4b&&_0x3e9d4b[_0x06c2('0x5f')]===0x0){return db[_0x06c2('0x38')]['create']({'name':_0x151571[_0x06c2('0x3a')],'resourceId':_0x151571['id'],'type':_0x3e9d4b[_0x06c2('0x3a')],'sectionId':_0x3e9d4b['id']},{})[_0x06c2('0x34')](function(){return _0x55a9f4;});}else{return _0x55a9f4;}})['catch'](function(_0x46b368){logger[_0x06c2('0x22')](_0x06c2('0x60'),_0x46b368);throw _0x46b368;});}return _0x55a9f4;})['then'](respondWithResult(_0x2c4bf0,0xc9))[_0x06c2('0x54')](handleError(_0x2c4bf0,null));};exports['update']=function(_0x1c1676,_0x48f88d){if(_0x1c1676['body']['id']){delete _0x1c1676['body']['id'];}return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x1c1676['params']['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x48f88d,null))[_0x06c2('0x34')](saveUpdates(_0x1c1676[_0x06c2('0x5a')],null))['then'](respondWithResult(_0x48f88d,null))[_0x06c2('0x54')](handleError(_0x48f88d,null));};exports[_0x06c2('0x35')]=function(_0x1a9e22,_0x3e02a6){return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x1a9e22[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x3e02a6,null))[_0x06c2('0x34')](removeEntity(_0x3e02a6,null))['catch'](handleError(_0x3e02a6,null));};exports[_0x06c2('0x61')]=function(_0x56a045,_0xf7d689){return db[_0x06c2('0x3d')]['describe']()[_0x06c2('0x34')](respondWithResult(_0xf7d689,null))[_0x06c2('0x54')](handleError(_0xf7d689,null));};exports[_0x06c2('0x62')]=function(_0x120669,_0x417b31,_0x5aa919){var _0x3244b8={'raw':!![],'where':{}},_0x2b41e9={},_0x60887e;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x120669['params']['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x417b31,null))[_0x06c2('0x34')](function(_0x27484d){if(_0x27484d){_0x60887e=_0x27484d[_0x06c2('0x36')]({'plain':!![]});_0x2b41e9['model']=_[_0x06c2('0x56')](db[_0x06c2('0x64')]['rawAttributes']);_0x2b41e9[_0x06c2('0x41')]=_[_0x06c2('0x56')](_0x120669[_0x06c2('0x41')]);_0x2b41e9['filters']=_[_0x06c2('0x42')](_0x2b41e9[_0x06c2('0x44')],_0x2b41e9['query']);_0x3244b8[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x2b41e9[_0x06c2('0x44')],qs['fields'](_0x120669[_0x06c2('0x41')][_0x06c2('0x45')]));_0x3244b8['attributes']=_0x3244b8['attributes']['length']?_0x3244b8[_0x06c2('0x43')]:_0x2b41e9[_0x06c2('0x44')];if(!_0x120669[_0x06c2('0x41')]['hasOwnProperty']('nolimit')){_0x3244b8[_0x06c2('0x2c')]=qs[_0x06c2('0x2c')](_0x120669[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x3244b8['offset']=qs[_0x06c2('0x2b')](_0x120669[_0x06c2('0x41')][_0x06c2('0x2b')]);}_0x3244b8[_0x06c2('0x47')]=qs['sort'](_0x120669[_0x06c2('0x41')][_0x06c2('0x48')]);_0x3244b8[_0x06c2('0x49')]=qs[_0x06c2('0x4b')](_[_0x06c2('0x4a')](_0x120669[_0x06c2('0x41')],_0x2b41e9[_0x06c2('0x4b')]));_0x3244b8[_0x06c2('0x49')][_0x06c2('0x65')]=_0x27484d['id'];if(_0x120669[_0x06c2('0x41')]['filter']){_0x3244b8['where']=_[_0x06c2('0x4d')](_0x3244b8[_0x06c2('0x49')],{'$or':_[_0x06c2('0x3c')](_0x3244b8['attributes'],function(_0x21950b){var _0x1adce9={};_0x1adce9[_0x21950b]={'$like':'%'+_0x120669[_0x06c2('0x41')][_0x06c2('0x4c')]+'%'};return _0x1adce9;})});}_0x3244b8=_[_0x06c2('0x4d')]({},_0x3244b8,_0x120669[_0x06c2('0x4f')]);return db['UserChatQueue']['findAll'](_0x3244b8);}})[_0x06c2('0x34')](function(_0x5f409b){if(_0x5f409b){return db['User'][_0x06c2('0x66')]({'where':{'id':_[_0x06c2('0x3c')](_0x5f409b,_0x06c2('0x67')),'role':_0x06c2('0x68')},'attributes':['id',_0x06c2('0x3a'),'chatPause','updatedAt',_0x06c2('0x69')]});}})[_0x06c2('0x34')](function(_0x26e380){if(_0x26e380){return{'count':_0x26e380[_0x06c2('0x2e')],'rows':_[_0x06c2('0x3c')](_0x26e380['rows'],function(_0x232ff2){return{'membername':_0x232ff2[_0x06c2('0x3a')],'UserId':_0x232ff2['id'],'queue_name':_0x60887e[_0x06c2('0x3a')],'ChatQueueId':_0x60887e['id'],'interface':util[_0x06c2('0x6a')](_0x06c2('0x6b'),'SIP',_0x232ff2[_0x06c2('0x3a')]),'penalty':0x0,'paused':_0x232ff2[_0x06c2('0x6c')],'createdAt':_0x232ff2[_0x06c2('0x69')],'updatedAt':_0x232ff2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x417b31,_0x3244b8))[_0x06c2('0x54')](handleError(_0x417b31,null));};exports['getTeams']=function(_0x7f8da1,_0x597918,_0x4ebea2){var _0xdd9b03={};var _0x21e6a1={};var _0x3729e6;var _0x2f7523;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x7f8da1[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x597918,null))['then'](function(_0x27ea45){if(_0x27ea45){_0x3729e6=_0x27ea45;_0x21e6a1[_0x06c2('0x44')]=_[_0x06c2('0x56')](db[_0x06c2('0x6d')][_0x06c2('0x3e')]);_0x21e6a1['query']=_[_0x06c2('0x56')](_0x7f8da1[_0x06c2('0x41')]);_0x21e6a1[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x21e6a1[_0x06c2('0x44')],_0x21e6a1[_0x06c2('0x41')]);_0xdd9b03['attributes']=_['intersection'](_0x21e6a1[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x45')]));_0xdd9b03['attributes']=_0xdd9b03[_0x06c2('0x43')][_0x06c2('0x57')]?_0xdd9b03[_0x06c2('0x43')]:_0x21e6a1['model'];_0xdd9b03['order']=qs[_0x06c2('0x48')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x48')]);_0xdd9b03['where']=qs[_0x06c2('0x4b')](_[_0x06c2('0x4a')](_0x7f8da1[_0x06c2('0x41')],_0x21e6a1['filters']));if(_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x4c')]){_0xdd9b03[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0xdd9b03['where'],{'$or':_[_0x06c2('0x3c')](_0xdd9b03[_0x06c2('0x43')],function(_0x3a099d){var _0x1f4346={};_0x1f4346[_0x3a099d]={'$like':'%'+_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x4c')]+'%'};return _0x1f4346;})});}_0xdd9b03=_[_0x06c2('0x4d')]({},_0xdd9b03,_0x7f8da1[_0x06c2('0x4f')]);return _0x3729e6[_0x06c2('0x6e')](_0xdd9b03);}})['then'](function(_0x4d7cd){if(_0x4d7cd){_0x2f7523=_0x4d7cd[_0x06c2('0x57')];if(!_0x7f8da1['query'][_0x06c2('0x6f')]('nolimit')){_0xdd9b03['limit']=qs[_0x06c2('0x2c')](_0x7f8da1['query'][_0x06c2('0x2c')]);_0xdd9b03[_0x06c2('0x2b')]=qs[_0x06c2('0x2b')](_0x7f8da1[_0x06c2('0x41')][_0x06c2('0x2b')]);}return _0x3729e6[_0x06c2('0x6e')](_0xdd9b03);}})[_0x06c2('0x34')](function(_0x47a31f){if(_0x47a31f){return _0x47a31f?{'count':_0x2f7523,'rows':_0x47a31f}:null;}})[_0x06c2('0x34')](respondWithResult(_0x597918,null))[_0x06c2('0x54')](handleError(_0x597918,null));};exports['addTeams']=function(_0x495be6,_0x3aadcd,_0x606986){var _0x50543a=_0x495be6[_0x06c2('0x5a')]['ids'];return db[_0x06c2('0x6d')][_0x06c2('0x52')]({'where':{'id':_0x50543a},'attributes':['id'],'include':[{'model':db[_0x06c2('0x70')],'as':_0x06c2('0x71'),'attributes':['id',_0x06c2('0x3a'),_0x06c2('0x72'),_0x06c2('0x73'),'interface'],'raw':!![]}]})[_0x06c2('0x34')](function(_0x5b2845){if(_0x5b2845){var _0x1c5ca9=_[_0x06c2('0x74')](_0x5b2845,function(_0x5479f){var _0x5813a9=_0x5479f['get']({'plain':!![]});return _0x5813a9[_0x06c2('0x71')];});return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x495be6[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](function(_0x2ee3ee){return db[_0x06c2('0x75')][_0x06c2('0x76')](function(_0x405f1c){return _0x2ee3ee[_0x06c2('0x77')](_0x50543a,{'transaction':_0x405f1c})['then'](function(){return BPromise[_0x06c2('0x78')](_0x1c5ca9,function(_0x22d245){return db[_0x06c2('0x64')][_0x06c2('0x79')]({'where':{'UserId':_0x22d245['id'],'ChatQueueId':_0x495be6[_0x06c2('0x55')]['id']},'transaction':_0x405f1c});});})[_0x06c2('0x34')](function(){_0x1c5ca9['forEach'](function(_0x18c54f){socket[_0x06c2('0x7a')]('userChatQueue:save',{'UserId':_0x18c54f['id'],'ChatQueueId':_0x2ee3ee['id']});});});});});}})[_0x06c2('0x34')](respondWithStatusCode(_0x3aadcd,null))[_0x06c2('0x54')](handleError(_0x3aadcd,null));};exports[_0x06c2('0x7b')]=function(_0x25c4ad,_0x47f407,_0xf757af){return db[_0x06c2('0x6d')][_0x06c2('0x52')]({'where':{'id':_0x25c4ad['query'][_0x06c2('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x06c2('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x06c2('0x34')](handleEntityNotFound(_0x47f407,null))[_0x06c2('0x34')](function(_0x4930bb){var _0x27cd20=_['map'](_0x4930bb,'id');var _0x35e575=[];var _0x328cbe=[];var _0x2ecf6b=squel[_0x06c2('0x7d')]();_0x2ecf6b[_0x06c2('0x7e')](_0x06c2('0x7f'))[_0x06c2('0x80')](_0x06c2('0x81'),'tq')[_0x06c2('0x82')](_0x06c2('0x83'),'ut',_0x06c2('0x84'))[_0x06c2('0x49')](_0x06c2('0x85'),_0x25c4ad[_0x06c2('0x55')]['id']);for(var _0x2c6746=0x0;_0x2c6746<_0x4930bb[_0x06c2('0x57')];_0x2c6746+=0x1){let _0x1989ac=_0x4930bb[_0x2c6746];for(var _0x3ae042=0x0;_0x3ae042<_0x1989ac['Agents'][_0x06c2('0x57')];_0x3ae042+=0x1){let _0x377885=_0x1989ac[_0x06c2('0x71')][_0x3ae042];var _0xc753c2=_0x2ecf6b[_0x06c2('0x86')]();_0xc753c2['where'](_0x06c2('0x87'),_0x377885['id']);_0x328cbe[_0x06c2('0x88')](db['sequelize']['query'](_0xc753c2[_0x06c2('0x89')](),{'type':db['sequelize'][_0x06c2('0x8a')][_0x06c2('0x8b')]})['then'](function(_0x44ad5f){if(_0x44ad5f[_0x06c2('0x57')]===0x1){return _0x377885['id'];}else{var _0xb6f3a0=_['every'](_['map'](_0x44ad5f,'TeamId'),function(_0x9579b7){return _[_0x06c2('0x8c')](_0x27cd20,_0x9579b7);});if(_0xb6f3a0){return _0x377885['id'];}}}));}}return BPromise[_0x06c2('0x8d')](_0x328cbe)[_0x06c2('0x34')](function(_0x269f57){_0x35e575=_(_0x35e575)[_0x06c2('0x8e')](_0x269f57)['compact']()[_0x06c2('0x8f')]();return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x25c4ad[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](function(_0x509780){return db['sequelize'][_0x06c2('0x76')](function(_0xd95746){return _0x509780[_0x06c2('0x7b')](_0x25c4ad[_0x06c2('0x41')][_0x06c2('0x7c')],{'transaction':_0xd95746})['then'](function(){if(!_[_0x06c2('0x90')](_0x35e575)){return _0x509780[_0x06c2('0x91')](_0x35e575,{'transaction':_0xd95746});}})[_0x06c2('0x34')](function(){_0x35e575[_0x06c2('0x92')](function(_0x5e39e6){socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':_0x5e39e6,'ChatQueueId':_0x509780['id']});});});});});});})[_0x06c2('0x34')](respondWithStatusCode(_0x47f407,null))[_0x06c2('0x54')](handleError(_0x47f407,null));};exports['addAgents']=function(_0x2cd3c2,_0x2dd6c0,_0x957c56){return db['ChatQueue'][_0x06c2('0x58')]({'where':{'id':_0x2cd3c2[_0x06c2('0x55')]['id']}})['then'](handleEntityNotFound(_0x2dd6c0,null))['then'](function(_0x544e55){if(_0x544e55){return _0x544e55[_0x06c2('0x94')](_0x2cd3c2[_0x06c2('0x5a')][_0x06c2('0x7c')],_['omit'](_0x2cd3c2[_0x06c2('0x5a')],[_0x06c2('0x7c'),'id'])||{})[_0x06c2('0x95')](function(_0x677295){for(var _0x37906e=0x0;_0x37906e<_0x2cd3c2['body'][_0x06c2('0x7c')][_0x06c2('0x57')];_0x37906e+=0x1){socket['emit'](_0x06c2('0x96'),{'UserId':Number(_0x2cd3c2[_0x06c2('0x5a')][_0x06c2('0x7c')][_0x37906e]),'ChatQueueId':Number(_0x2cd3c2[_0x06c2('0x55')]['id'])});}return _0x677295;});}})['then'](respondWithResult(_0x2dd6c0,null))[_0x06c2('0x54')](handleError(_0x2dd6c0,null));};exports[_0x06c2('0x91')]=function(_0x20ece4,_0x1388f9,_0x13ba26){return db[_0x06c2('0x3d')][_0x06c2('0x58')]({'where':{'id':_0x20ece4[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x1388f9,null))['then'](function(_0x15d832){if(_0x15d832){return _0x15d832[_0x06c2('0x91')](_0x20ece4[_0x06c2('0x41')]['ids'])[_0x06c2('0x34')](function(){if(_['isArray'](_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')])){for(var _0x2f008a=0x0;_0x2f008a<_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')][_0x06c2('0x57')];_0x2f008a+=0x1){socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':Number(_0x20ece4[_0x06c2('0x41')]['ids'][_0x2f008a]),'ChatQueueId':Number(_0x20ece4[_0x06c2('0x55')]['id'])});}}else{socket[_0x06c2('0x7a')](_0x06c2('0x93'),{'UserId':Number(_0x20ece4[_0x06c2('0x41')][_0x06c2('0x7c')]),'ChatQueueId':Number(_0x20ece4['params']['id'])});}});}})[_0x06c2('0x34')](respondWithStatusCode(_0x1388f9,null))['catch'](handleError(_0x1388f9,null));};exports['getAgents']=function(_0x28a0dc,_0x48a717,_0x4b7fc5){var _0x19a592={};var _0x3d16a7={};var _0xde813d;var _0x392502;return db[_0x06c2('0x3d')][_0x06c2('0x63')]({'where':{'id':_0x28a0dc[_0x06c2('0x55')]['id']}})[_0x06c2('0x34')](handleEntityNotFound(_0x48a717,null))[_0x06c2('0x34')](function(_0x55229c){if(_0x55229c){_0xde813d=_0x55229c;_0x3d16a7[_0x06c2('0x44')]=_['keys'](db[_0x06c2('0x70')]['rawAttributes']);_0x3d16a7['query']=_[_0x06c2('0x56')](_0x28a0dc[_0x06c2('0x41')]);_0x3d16a7[_0x06c2('0x4b')]=_[_0x06c2('0x42')](_0x3d16a7[_0x06c2('0x44')],_0x3d16a7[_0x06c2('0x41')]);_0x19a592[_0x06c2('0x43')]=_[_0x06c2('0x42')](_0x3d16a7[_0x06c2('0x44')],qs[_0x06c2('0x45')](_0x28a0dc['query']['fields']));_0x19a592[_0x06c2('0x43')]=_0x19a592[_0x06c2('0x43')]['length']?_0x19a592[_0x06c2('0x43')]:_0x3d16a7[_0x06c2('0x44')];_0x19a592[_0x06c2('0x47')]=qs[_0x06c2('0x48')](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x48')]);_0x19a592[_0x06c2('0x49')]=qs[_0x06c2('0x4b')](_['pick'](_0x28a0dc['query'],_0x3d16a7['filters']));if(_0x28a0dc['query'][_0x06c2('0x4c')]){_0x19a592[_0x06c2('0x49')]=_[_0x06c2('0x4d')](_0x19a592['where'],{'$or':_[_0x06c2('0x3c')](_0x19a592[_0x06c2('0x43')],function(_0x59c9bc){var _0x202801={};_0x202801[_0x59c9bc]={'$like':'%'+_0x28a0dc[_0x06c2('0x41')]['filter']+'%'};return _0x202801;})});}_0x19a592=_['merge']({},_0x19a592,_0x28a0dc[_0x06c2('0x4f')]);return _0xde813d[_0x06c2('0x97')](_0x19a592);}})[_0x06c2('0x34')](function(_0x5ced2e){if(_0x5ced2e){_0x392502=_0x5ced2e['length'];if(!_0x28a0dc['query']['hasOwnProperty'](_0x06c2('0x46'))){_0x19a592[_0x06c2('0x2c')]=qs['limit'](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x2c')]);_0x19a592[_0x06c2('0x2b')]=qs['offset'](_0x28a0dc[_0x06c2('0x41')][_0x06c2('0x2b')]);}return _0xde813d[_0x06c2('0x97')](_0x19a592);}})['then'](function(_0x44aee2){if(_0x44aee2){return _0x44aee2?{'count':_0x392502,'rows':_0x44aee2}:null;}})[_0x06c2('0x34')](respondWithResult(_0x48a717,null))[_0x06c2('0x54')](handleError(_0x48a717,null));};
\ No newline at end of file
+var _0x6ddb=['options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','UserId','chatPause','rows','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','transaction','findOrCreate','emit','userChatQueue:save','field','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','compact','removeTeams','removeAgents','forEach','userChatQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','destroy','get','end','stack','send','index','map','ChatQueue','rawAttributes','key','model','name','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ddb,0x1d1));var _0xb6dd=function(_0x2f4445,_0x5ced13){_0x2f4445=_0x2f4445-0x0;var _0x570b2e=_0x6ddb[_0x2f4445];return _0x570b2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6dd('0x0'));var zipdir=require(_0xb6dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb6dd('0x3'));var sox=require('sox');var csv=require(_0xb6dd('0x4'));var ejs=require(_0xb6dd('0x5'));var fs=require('fs');var fs_extra=require(_0xb6dd('0x6'));var _=require(_0xb6dd('0x7'));var squel=require(_0xb6dd('0x8'));var crypto=require(_0xb6dd('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb6dd('0xa'));var toCsv=require(_0xb6dd('0x4'));var querystring=require(_0xb6dd('0xb'));var Papa=require('papaparse');var Redis=require(_0xb6dd('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb6dd('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6dd('0xe'));var logger=require(_0xb6dd('0xf'))('api');var utils=require(_0xb6dd('0x10'));var config=require(_0xb6dd('0x11'));var licenseUtil=require(_0xb6dd('0x12'));var db=require(_0xb6dd('0x13'))['db'];config[_0xb6dd('0x14')]=_[_0xb6dd('0x15')](config[_0xb6dd('0x14')],{'host':_0xb6dd('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6dd('0x14')]));require(_0xb6dd('0x17'))[_0xb6dd('0x18')](socket);var jayson=require(_0xb6dd('0x19'));var client=jayson['client'][_0xb6dd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x980006,_0x30de7e,_0x5ce4e4,_0xbf1fdb){return new BPromise(function(_0x519132,_0x2b9178){var _0x2adf59=_0xbf1fdb||client;return _0x2adf59[_0xb6dd('0x1b')](_0x980006,_0x5ce4e4)[_0xb6dd('0x1c')](function(_0x530d48){logger[_0xb6dd('0x1d')](_0xb6dd('0x1e'),_0x30de7e,_0xb6dd('0x1f'));logger[_0xb6dd('0x20')](_0xb6dd('0x21'),_0x30de7e,_0xb6dd('0x1f'),JSON['stringify'](_0x530d48));if(_0x530d48[_0xb6dd('0x22')]){if(_0x530d48[_0xb6dd('0x22')]['code']===0x1f4){logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x2b9178(_0x530d48['error'][_0xb6dd('0x23')]);}logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x519132(_0x530d48[_0xb6dd('0x22')][_0xb6dd('0x23')]);}else{logger[_0xb6dd('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x30de7e,_0xb6dd('0x1f'));_0x519132(_0x530d48[_0xb6dd('0x24')][_0xb6dd('0x23')]);}})[_0xb6dd('0x25')](function(_0x21da18){logger['error'](_0xb6dd('0x1e'),_0x30de7e,_0x21da18);_0x2b9178(_0x21da18);});});}function respondWithStatusCode(_0x6f4209,_0x56fd6f){_0x56fd6f=_0x56fd6f||0xcc;return function(_0x123d65){if(_0x123d65){return _0x6f4209[_0xb6dd('0x26')](_0x56fd6f);}return _0x6f4209[_0xb6dd('0x27')](_0x56fd6f)['end']();};}function respondWithResult(_0x4e8b67,_0x5dd003){_0x5dd003=_0x5dd003||0xc8;return function(_0x4e2113){if(_0x4e2113){return _0x4e8b67[_0xb6dd('0x27')](_0x5dd003)[_0xb6dd('0x28')](_0x4e2113);}};}function respondWithFilteredResult(_0x3b9548,_0x27a391){return function(_0x154f08){if(_0x154f08){var _0x2c792e=typeof _0x27a391['offset']===_0xb6dd('0x29')&&typeof _0x27a391[_0xb6dd('0x2a')]===_0xb6dd('0x29');var _0xc3dddc=_0x154f08[_0xb6dd('0x2b')];var _0x590f9=_0x2c792e?0x0:_0x27a391['offset'];var _0x48cdbc=_0x2c792e?_0x154f08['count']:_0x27a391[_0xb6dd('0x2c')]+_0x27a391['limit'];var _0x492d51;if(_0x48cdbc>=_0xc3dddc){_0x48cdbc=_0xc3dddc;_0x492d51=0xc8;}else{_0x492d51=0xce;}_0x3b9548[_0xb6dd('0x27')](_0x492d51);return _0x3b9548[_0xb6dd('0x2d')]('Content-Range',_0x590f9+'-'+_0x48cdbc+'/'+_0xc3dddc)[_0xb6dd('0x28')](_0x154f08);}return null;};}function patchUpdates(_0x2fb15f){return function(_0x16d1a4){try{jsonpatch[_0xb6dd('0x2e')](_0x16d1a4,_0x2fb15f,!![]);}catch(_0x2d5d41){return BPromise[_0xb6dd('0x2f')](_0x2d5d41);}return _0x16d1a4['save']();};}function saveUpdates(_0x54651e,_0x4d9ea1){return function(_0x455b48){if(_0x455b48){return _0x455b48['update'](_0x54651e)[_0xb6dd('0x1c')](function(_0x36452a){return _0x36452a;});}return null;};}function removeEntity(_0x3be45f,_0xdb9101){return function(_0x303670){if(_0x303670){return _0x303670[_0xb6dd('0x30')]()[_0xb6dd('0x1c')](function(){var _0x5dfb20=_0x303670[_0xb6dd('0x31')]({'plain':!![]});var _0x2a0865='ChatQueues';return db['UserProfileResource'][_0xb6dd('0x30')]({'where':{'type':_0x2a0865,'resourceId':_0x5dfb20['id']}})[_0xb6dd('0x1c')](function(){return _0x303670;});})[_0xb6dd('0x1c')](function(){_0x3be45f[_0xb6dd('0x27')](0xcc)[_0xb6dd('0x32')]();});}};}function handleEntityNotFound(_0x1ec873,_0x4d7faf){return function(_0x2ea282){if(!_0x2ea282){_0x1ec873['sendStatus'](0x194);}return _0x2ea282;};}function handleError(_0x15707f,_0x25d182){_0x25d182=_0x25d182||0x1f4;return function(_0x126fac){logger[_0xb6dd('0x22')](_0x126fac[_0xb6dd('0x33')]);if(_0x126fac['name']){delete _0x126fac['name'];}_0x15707f[_0xb6dd('0x27')](_0x25d182)[_0xb6dd('0x34')](_0x126fac);};}exports[_0xb6dd('0x35')]=function(_0x12f9f8,_0x3081b5){var _0x2c6052={},_0x44b1a3={},_0x41b267={'count':0x0,'rows':[]};var _0x3f5565=_[_0xb6dd('0x36')](db[_0xb6dd('0x37')][_0xb6dd('0x38')],function(_0x14079f){return{'name':_0x14079f['fieldName'],'type':_0x14079f['type'][_0xb6dd('0x39')]};});_0x44b1a3[_0xb6dd('0x3a')]=_['map'](_0x3f5565,_0xb6dd('0x3b'));_0x44b1a3['query']=_[_0xb6dd('0x3c')](_0x12f9f8['query']);_0x44b1a3[_0xb6dd('0x3d')]=_['intersection'](_0x44b1a3[_0xb6dd('0x3a')],_0x44b1a3[_0xb6dd('0x3e')]);_0x2c6052[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x44b1a3[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x2c6052[_0xb6dd('0x3f')]=_0x2c6052[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x2c6052[_0xb6dd('0x3f')]:_0x44b1a3[_0xb6dd('0x3a')];if(!_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x2c6052[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x2c6052[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x12f9f8[_0xb6dd('0x3e')]['offset']);}_0x2c6052['order']=qs[_0xb6dd('0x45')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x2c6052[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x12f9f8[_0xb6dd('0x3e')],_0x44b1a3['filters']),_0x3f5565);if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x2c6052[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x2c6052[_0xb6dd('0x46')],{'$or':_['map'](_0x3f5565,function(_0x2fc37f){if(_0x2fc37f[_0xb6dd('0x4a')]!=='VIRTUAL'){var _0x3eacaf={};_0x3eacaf[_0x2fc37f[_0xb6dd('0x3b')]]={'$like':'%'+_0x12f9f8['query'][_0xb6dd('0x48')]+'%'};return _0x3eacaf;}})});}_0x2c6052=_[_0xb6dd('0x49')]({},_0x2c6052,_0x12f9f8[_0xb6dd('0x4b')]);var _0x45b423={'where':_0x2c6052[_0xb6dd('0x46')]};return db[_0xb6dd('0x37')][_0xb6dd('0x2b')](_0x45b423)['then'](function(_0x1381a0){_0x41b267[_0xb6dd('0x2b')]=_0x1381a0;if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x2c6052[_0xb6dd('0x4d')]=[{'all':!![]}];}return db[_0xb6dd('0x37')][_0xb6dd('0x4e')](_0x2c6052);})[_0xb6dd('0x1c')](function(_0x1cbe17){_0x41b267['rows']=_0x1cbe17;return _0x41b267;})['then'](respondWithFilteredResult(_0x3081b5,_0x2c6052))['catch'](handleError(_0x3081b5,null));};exports[_0xb6dd('0x4f')]=function(_0x42cfe6,_0x311964){var _0x5cb8dd={'raw':!![],'where':{'id':_0x42cfe6[_0xb6dd('0x50')]['id']}},_0x331319={};_0x331319['model']=_['keys'](db['ChatQueue'][_0xb6dd('0x38')]);_0x331319[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x42cfe6[_0xb6dd('0x3e')]);_0x331319[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],_0x331319[_0xb6dd('0x3e')]);_0x5cb8dd[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x42cfe6[_0xb6dd('0x3e')]['fields']));_0x5cb8dd[_0xb6dd('0x3f')]=_0x5cb8dd[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x5cb8dd['attributes']:_0x331319[_0xb6dd('0x3a')];if(_0x42cfe6[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x5cb8dd[_0xb6dd('0x4d')]=[{'all':!![]}];}_0x5cb8dd=_[_0xb6dd('0x49')]({},_0x5cb8dd,_0x42cfe6['options']);return db[_0xb6dd('0x37')][_0xb6dd('0x51')](_0x5cb8dd)[_0xb6dd('0x1c')](handleEntityNotFound(_0x311964,null))[_0xb6dd('0x1c')](respondWithResult(_0x311964,null))[_0xb6dd('0x25')](handleError(_0x311964,null));};exports['create']=function(_0x3a8cec,_0x3a74d4){return db['ChatQueue'][_0xb6dd('0x52')](_0x3a8cec[_0xb6dd('0x53')],{})['then'](function(_0x4e0bb7){var _0x13bb69=_0x3a8cec[_0xb6dd('0x54')][_0xb6dd('0x31')]({'plain':!![]});if(!_0x13bb69)throw new Error(_0xb6dd('0x55'));if(_0x13bb69[_0xb6dd('0x56')]===_0xb6dd('0x54')){var _0x15e262=_0x4e0bb7['get']({'plain':!![]});var _0xbc31a6=_0xb6dd('0x57');return db[_0xb6dd('0x58')][_0xb6dd('0x51')]({'where':{'name':_0xbc31a6,'userProfileId':_0x13bb69[_0xb6dd('0x59')]},'raw':!![]})[_0xb6dd('0x1c')](function(_0x5a5ef9){if(_0x5a5ef9&&_0x5a5ef9[_0xb6dd('0x5a')]===0x0){return db[_0xb6dd('0x5b')][_0xb6dd('0x52')]({'name':_0x15e262[_0xb6dd('0x3b')],'resourceId':_0x15e262['id'],'type':_0x5a5ef9['name'],'sectionId':_0x5a5ef9['id']},{})[_0xb6dd('0x1c')](function(){return _0x4e0bb7;});}else{return _0x4e0bb7;}})[_0xb6dd('0x25')](function(_0x5af82d){logger['error'](_0xb6dd('0x5c'),_0x5af82d);throw _0x5af82d;});}return _0x4e0bb7;})['then'](respondWithResult(_0x3a74d4,0xc9))[_0xb6dd('0x25')](handleError(_0x3a74d4,null));};exports['update']=function(_0x11b558,_0x31476b){if(_0x11b558[_0xb6dd('0x53')]['id']){delete _0x11b558[_0xb6dd('0x53')]['id'];}return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x11b558[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x31476b,null))['then'](saveUpdates(_0x11b558[_0xb6dd('0x53')],null))[_0xb6dd('0x1c')](respondWithResult(_0x31476b,null))[_0xb6dd('0x25')](handleError(_0x31476b,null));};exports[_0xb6dd('0x30')]=function(_0xdde89c,_0xec0e54){return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0xdde89c[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0xec0e54,null))[_0xb6dd('0x1c')](removeEntity(_0xec0e54,null))[_0xb6dd('0x25')](handleError(_0xec0e54,null));};exports[_0xb6dd('0x5d')]=function(_0x40008a,_0x2b0caa){return db[_0xb6dd('0x37')]['describe']()[_0xb6dd('0x1c')](respondWithResult(_0x2b0caa,null))[_0xb6dd('0x25')](handleError(_0x2b0caa,null));};exports[_0xb6dd('0x5e')]=function(_0x913d32,_0x2dc156,_0x14cb41){var _0x37da2c={'raw':!![],'where':{}},_0x35afef={},_0xb512b9;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x913d32[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x2dc156,null))[_0xb6dd('0x1c')](function(_0x3fb06f){if(_0x3fb06f){_0xb512b9=_0x3fb06f[_0xb6dd('0x31')]({'plain':!![]});_0x35afef['model']=_[_0xb6dd('0x3c')](db[_0xb6dd('0x60')][_0xb6dd('0x38')]);_0x35afef[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x913d32[_0xb6dd('0x3e')]);_0x35afef['filters']=_[_0xb6dd('0x40')](_0x35afef[_0xb6dd('0x3a')],_0x35afef[_0xb6dd('0x3e')]);_0x37da2c[_0xb6dd('0x3f')]=_['intersection'](_0x35afef[_0xb6dd('0x3a')],qs['fields'](_0x913d32[_0xb6dd('0x3e')]['fields']));_0x37da2c[_0xb6dd('0x3f')]=_0x37da2c['attributes'][_0xb6dd('0x42')]?_0x37da2c['attributes']:_0x35afef['model'];if(!_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x37da2c[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x37da2c[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}_0x37da2c[_0xb6dd('0x61')]=qs[_0xb6dd('0x45')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x37da2c[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x913d32['query'],_0x35afef['filters']));_0x37da2c[_0xb6dd('0x46')][_0xb6dd('0x62')]=_0x3fb06f['id'];if(_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x37da2c[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x37da2c['where'],{'$or':_[_0xb6dd('0x36')](_0x37da2c['attributes'],function(_0x59af98){var _0x34ef6e={};_0x34ef6e[_0x59af98]={'$like':'%'+_0x913d32['query'][_0xb6dd('0x48')]+'%'};return _0x34ef6e;})});}_0x37da2c=_[_0xb6dd('0x49')]({},_0x37da2c,_0x913d32[_0xb6dd('0x4b')]);return db[_0xb6dd('0x60')][_0xb6dd('0x4e')](_0x37da2c);}})[_0xb6dd('0x1c')](function(_0x3293d5){if(_0x3293d5){return db[_0xb6dd('0x63')]['findAndCountAll']({'where':{'id':_[_0xb6dd('0x36')](_0x3293d5,_0xb6dd('0x64')),'role':'agent'},'attributes':['id','name',_0xb6dd('0x65'),'updatedAt','createdAt']});}})[_0xb6dd('0x1c')](function(_0x1ab21c){if(_0x1ab21c){return{'count':_0x1ab21c[_0xb6dd('0x2b')],'rows':_[_0xb6dd('0x36')](_0x1ab21c[_0xb6dd('0x66')],function(_0x391bc0){return{'membername':_0x391bc0[_0xb6dd('0x3b')],'UserId':_0x391bc0['id'],'queue_name':_0xb512b9[_0xb6dd('0x3b')],'ChatQueueId':_0xb512b9['id'],'interface':util['format'](_0xb6dd('0x67'),_0xb6dd('0x68'),_0x391bc0['name']),'penalty':0x0,'paused':_0x391bc0[_0xb6dd('0x65')],'createdAt':_0x391bc0['createdAt'],'updatedAt':_0x391bc0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb6dd('0x1c')](respondWithFilteredResult(_0x2dc156,_0x37da2c))[_0xb6dd('0x25')](handleError(_0x2dc156,null));};exports[_0xb6dd('0x69')]=function(_0xd5d37a,_0x58d620,_0x5c098a){var _0x50221d={};var _0x56306b={};var _0x50d296;var _0x5f4d0b;return db[_0xb6dd('0x37')]['findOne']({'where':{'id':_0xd5d37a[_0xb6dd('0x50')]['id']}})['then'](handleEntityNotFound(_0x58d620,null))[_0xb6dd('0x1c')](function(_0x4be74a){if(_0x4be74a){_0x50d296=_0x4be74a;_0x56306b[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db['Team'][_0xb6dd('0x38')]);_0x56306b['query']=_[_0xb6dd('0x3c')](_0xd5d37a[_0xb6dd('0x3e')]);_0x56306b[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x56306b[_0xb6dd('0x3a')],_0x56306b[_0xb6dd('0x3e')]);_0x50221d[_0xb6dd('0x3f')]=_['intersection'](_0x56306b[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x50221d[_0xb6dd('0x3f')]=_0x50221d[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x50221d['attributes']:_0x56306b[_0xb6dd('0x3a')];_0x50221d['order']=qs[_0xb6dd('0x45')](_0xd5d37a[_0xb6dd('0x3e')]['sort']);_0x50221d[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0xd5d37a[_0xb6dd('0x3e')],_0x56306b['filters']));if(_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x50221d[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x50221d['where'],{'$or':_[_0xb6dd('0x36')](_0x50221d[_0xb6dd('0x3f')],function(_0x39489b){var _0x1ad1c6={};_0x1ad1c6[_0x39489b]={'$like':'%'+_0xd5d37a[_0xb6dd('0x3e')]['filter']+'%'};return _0x1ad1c6;})});}_0x50221d=_[_0xb6dd('0x49')]({},_0x50221d,_0xd5d37a[_0xb6dd('0x4b')]);return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x23358c){if(_0x23358c){_0x5f4d0b=_0x23358c['length'];if(!_0xd5d37a['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x50221d[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x50221d[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x46c12a){if(_0x46c12a){return _0x46c12a?{'count':_0x5f4d0b,'rows':_0x46c12a}:null;}})['then'](respondWithResult(_0x58d620,null))['catch'](handleError(_0x58d620,null));};exports[_0xb6dd('0x6a')]=function(_0x460028,_0x1fafe9,_0x20ad37){var _0x3ad4fc=_0x460028[_0xb6dd('0x53')][_0xb6dd('0x6b')];return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x3ad4fc},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':_0xb6dd('0x6d'),'attributes':['id',_0xb6dd('0x3b'),'online',_0xb6dd('0x6e'),_0xb6dd('0x6f')],'raw':!![]}]})[_0xb6dd('0x1c')](function(_0x515f90){if(_0x515f90){var _0xd0d196=_['flatMap'](_0x515f90,function(_0x23f927){var _0x45d812=_0x23f927[_0xb6dd('0x31')]({'plain':!![]});return _0x45d812[_0xb6dd('0x6d')];});return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x460028[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](function(_0x10c044){return db[_0xb6dd('0x70')][_0xb6dd('0x71')](function(_0xbe871a){return _0x10c044[_0xb6dd('0x6a')](_0x3ad4fc,{'transaction':_0xbe871a})['then'](function(){return BPromise['each'](_0xd0d196,function(_0x14ec80){return db[_0xb6dd('0x60')][_0xb6dd('0x72')]({'where':{'UserId':_0x14ec80['id'],'ChatQueueId':_0x460028['params']['id']},'transaction':_0xbe871a});});})[_0xb6dd('0x1c')](function(){_0xd0d196['forEach'](function(_0x5156de){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':_0x5156de['id'],'ChatQueueId':_0x10c044['id']});});});});});}})['then'](respondWithStatusCode(_0x1fafe9,null))[_0xb6dd('0x25')](handleError(_0x1fafe9,null));};exports['removeTeams']=function(_0x21b78c,_0x46c7e2,_0x1d2be9){return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x21b78c[_0xb6dd('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46c7e2,null))['then'](function(_0x1006e1){var _0x310222=_[_0xb6dd('0x36')](_0x1006e1,'id');var _0x1dabba=[];var _0xcd75d7=[];var _0x1c92ec=squel['select']();_0x1c92ec[_0xb6dd('0x75')](_0xb6dd('0x76'))['from']('team_has_chat_queues','tq')[_0xb6dd('0x77')](_0xb6dd('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb6dd('0x46')](_0xb6dd('0x79'),_0x21b78c[_0xb6dd('0x50')]['id']);for(var _0x35d5f7=0x0;_0x35d5f7<_0x1006e1[_0xb6dd('0x42')];_0x35d5f7+=0x1){let _0x4f9a7=_0x1006e1[_0x35d5f7];for(var _0x2dc497=0x0;_0x2dc497<_0x4f9a7['Agents'][_0xb6dd('0x42')];_0x2dc497+=0x1){let _0x4d2909=_0x4f9a7[_0xb6dd('0x6d')][_0x2dc497];var _0x41cee7=_0x1c92ec['clone']();_0x41cee7[_0xb6dd('0x46')](_0xb6dd('0x7a'),_0x4d2909['id']);_0xcd75d7[_0xb6dd('0x7b')](db['sequelize']['query'](_0x41cee7['toString'](),{'type':db[_0xb6dd('0x70')][_0xb6dd('0x7c')]['SELECT']})[_0xb6dd('0x1c')](function(_0x39c09b){if(_0x39c09b[_0xb6dd('0x42')]===0x1){return _0x4d2909['id'];}else{var _0x33b2e4=_['every'](_[_0xb6dd('0x36')](_0x39c09b,_0xb6dd('0x7d')),function(_0x4419f0){return _[_0xb6dd('0x7e')](_0x310222,_0x4419f0);});if(_0x33b2e4){return _0x4d2909['id'];}}}));}}return BPromise['all'](_0xcd75d7)['then'](function(_0x4871b9){_0x1dabba=_(_0x1dabba)['union'](_0x4871b9)[_0xb6dd('0x7f')]()['value']();return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x21b78c['params']['id']}})[_0xb6dd('0x1c')](function(_0x3fd1c5){return db['sequelize'][_0xb6dd('0x71')](function(_0x1d61b6){return _0x3fd1c5[_0xb6dd('0x80')](_0x21b78c[_0xb6dd('0x3e')][_0xb6dd('0x6b')],{'transaction':_0x1d61b6})['then'](function(){if(!_['isEmpty'](_0x1dabba)){return _0x3fd1c5[_0xb6dd('0x81')](_0x1dabba,{'transaction':_0x1d61b6});}})['then'](function(){_0x1dabba[_0xb6dd('0x82')](function(_0x26cd8d){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':_0x26cd8d,'ChatQueueId':_0x3fd1c5['id']});});});});});});})[_0xb6dd('0x1c')](respondWithStatusCode(_0x46c7e2,null))[_0xb6dd('0x25')](handleError(_0x46c7e2,null));};exports[_0xb6dd('0x84')]=function(_0x993cbd,_0x52688a,_0x540f73){return db[_0xb6dd('0x37')]['find']({'where':{'id':_0x993cbd[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x52688a,null))['then'](function(_0x42b31e){if(_0x42b31e){return _0x42b31e[_0xb6dd('0x84')](_0x993cbd[_0xb6dd('0x53')]['ids'],_['omit'](_0x993cbd[_0xb6dd('0x53')],[_0xb6dd('0x6b'),'id'])||{})[_0xb6dd('0x85')](function(_0xfbfc6d){for(var _0x197c8c=0x0;_0x197c8c<_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x197c8c+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':Number(_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0x197c8c]),'ChatQueueId':Number(_0x993cbd[_0xb6dd('0x50')]['id'])});}return _0xfbfc6d;});}})[_0xb6dd('0x1c')](respondWithResult(_0x52688a,null))[_0xb6dd('0x25')](handleError(_0x52688a,null));};exports[_0xb6dd('0x81')]=function(_0x1a0309,_0x230619,_0x3ea4e3){return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x1a0309[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x230619,null))[_0xb6dd('0x1c')](function(_0x375f4d){if(_0x375f4d){return _0x375f4d[_0xb6dd('0x81')](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])[_0xb6dd('0x1c')](function(){if(_['isArray'](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])){for(var _0x3dd365=0x0;_0x3dd365<_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x3dd365+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309['query']['ids'][_0x3dd365]),'ChatQueueId':Number(_0x1a0309['params']['id'])});}}else{socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')]),'ChatQueueId':Number(_0x1a0309[_0xb6dd('0x50')]['id'])});}});}})[_0xb6dd('0x1c')](respondWithStatusCode(_0x230619,null))[_0xb6dd('0x25')](handleError(_0x230619,null));};exports[_0xb6dd('0x86')]=function(_0x6a6cb3,_0x39185d,_0x439247){var _0x3343cb={};var _0x3345f5={};var _0x49f929;var _0x38816f;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x6a6cb3[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x39185d,null))[_0xb6dd('0x1c')](function(_0x5ced20){if(_0x5ced20){_0x49f929=_0x5ced20;_0x3345f5[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db[_0xb6dd('0x63')][_0xb6dd('0x38')]);_0x3345f5[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x6a6cb3[_0xb6dd('0x3e')]);_0x3345f5[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x3345f5[_0xb6dd('0x3a')],_0x3345f5['query']);_0x3343cb[_0xb6dd('0x3f')]=_['intersection'](_0x3345f5[_0xb6dd('0x3a')],qs['fields'](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x3343cb[_0xb6dd('0x3f')]=_0x3343cb['attributes'][_0xb6dd('0x42')]?_0x3343cb[_0xb6dd('0x3f')]:_0x3345f5[_0xb6dd('0x3a')];_0x3343cb['order']=qs[_0xb6dd('0x45')](_0x6a6cb3[_0xb6dd('0x3e')]['sort']);_0x3343cb['where']=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x6a6cb3['query'],_0x3345f5['filters']));if(_0x6a6cb3[_0xb6dd('0x3e')]['filter']){_0x3343cb[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x3343cb['where'],{'$or':_[_0xb6dd('0x36')](_0x3343cb[_0xb6dd('0x3f')],function(_0x35b745){var _0x254592={};_0x254592[_0x35b745]={'$like':'%'+_0x6a6cb3['query'][_0xb6dd('0x48')]+'%'};return _0x254592;})});}_0x3343cb=_['merge']({},_0x3343cb,_0x6a6cb3[_0xb6dd('0x4b')]);return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})['then'](function(_0x5bd415){if(_0x5bd415){_0x38816f=_0x5bd415[_0xb6dd('0x42')];if(!_0x6a6cb3['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x3343cb[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x6a6cb3['query'][_0xb6dd('0x2a')]);_0x3343cb[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})[_0xb6dd('0x1c')](function(_0x3764ac){if(_0x3764ac){return _0x3764ac?{'count':_0x38816f,'rows':_0x3764ac}:null;}})[_0xb6dd('0x1c')](respondWithResult(_0x39185d,null))[_0xb6dd('0x25')](handleError(_0x39185d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 55bbd1c..e35ff64 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 _0x049e=['hasOwnProperty','hook','events','setMaxListeners','save','remove','emit'];(function(_0x3dd8cf,_0x1e1219){var _0x13a125=function(_0x544297){while(--_0x544297){_0x3dd8cf['push'](_0x3dd8cf['shift']());}};_0x13a125(++_0x1e1219);}(_0x049e,0x72));var _0xe049=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x049e[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0xe049('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe049('0x1')](0x0);var events={'afterCreate':_0xe049('0x2'),'afterUpdate':'update','afterDestroy':_0xe049('0x3')};function emitEvent(_0x22c752){return function(_0x14fa69,_0x23a950,_0x1379cb){ChatQueueEvents[_0xe049('0x4')](_0x22c752+':'+_0x14fa69['id'],_0x14fa69);ChatQueueEvents[_0xe049('0x4')](_0x22c752,_0x14fa69);_0x1379cb(null);};}for(var e in events){if(events[_0xe049('0x5')](e)){var event=events[e];ChatQueue[_0xe049('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xa31c=['update','remove','emit','hook','exports','../../mysqldb','save'];(function(_0x50bffc,_0x8eb3ac){var _0x36747b=function(_0x283736){while(--_0x283736){_0x50bffc['push'](_0x50bffc['shift']());}};_0x36747b(++_0x8eb3ac);}(_0xa31c,0x11d));var _0xca31=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0xa31c[_0x219fa0];return _0xc603fb;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xca31('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca31('0x1'),'afterUpdate':_0xca31('0x2'),'afterDestroy':_0xca31('0x3')};function emitEvent(_0x234c47){return function(_0x95fe68,_0x36282a,_0x21cb6a){ChatQueueEvents[_0xca31('0x4')](_0x234c47+':'+_0x95fe68['id'],_0x95fe68);ChatQueueEvents[_0xca31('0x4')](_0x234c47,_0x95fe68);_0x21cb6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xca31('0x5')](e,emitEvent(event));}}module[_0xca31('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 9c198e8..7485c01 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 _0xcf0f=['api','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x4b4027,_0x282103){var _0x1544c7=function(_0x556639){while(--_0x556639){_0x4b4027['push'](_0x4b4027['shift']());}};_0x1544c7(++_0x282103);}(_0xcf0f,0x99));var _0xfcf0=function(_0x44f9a5,_0x5952a1){_0x44f9a5=_0x44f9a5-0x0;var _0x41ca9a=_0xcf0f[_0x44f9a5];return _0x41ca9a;};'use strict';var _=require(_0xfcf0('0x0'));var util=require(_0xfcf0('0x1'));var logger=require(_0xfcf0('0x2'))(_0xfcf0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcf0('0x4'));var fs=require('fs');var path=require(_0xfcf0('0x5'));var rimraf=require(_0xfcf0('0x6'));var config=require(_0xfcf0('0x7'));var attributes=require(_0xfcf0('0x8'));module[_0xfcf0('0x9')]=function(_0x684f86,_0x3c3fb6){return _0x684f86[_0xfcf0('0xa')](_0xfcf0('0xb'),attributes,{'tableName':_0xfcf0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ecb=['./chatQueue.attributes','exports','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x224523,_0x4a351a){var _0x4a1a35=function(_0x342cd1){while(--_0x342cd1){_0x224523['push'](_0x224523['shift']());}};_0x4a1a35(++_0x4a351a);}(_0x5ecb,0x87));var _0xb5ec=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x5ecb[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xb5ec('0x0'));var util=require(_0xb5ec('0x1'));var logger=require(_0xb5ec('0x2'))(_0xb5ec('0x3'));var moment=require(_0xb5ec('0x4'));var BPromise=require(_0xb5ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ec('0x6'));var rimraf=require(_0xb5ec('0x7'));var config=require(_0xb5ec('0x8'));var attributes=require(_0xb5ec('0x9'));module[_0xb5ec('0xa')]=function(_0x165383,_0x5a706e){return _0x165383['define'](_0xb5ec('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index a612b96..fe292b9 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 _0xa81d=['include','map','model','GetChatQueue','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes'];(function(_0xf8c877,_0x149b7c){var _0x31c063=function(_0x5e089f){while(--_0x5e089f){_0xf8c877['push'](_0xf8c877['shift']());}};_0x31c063(++_0x149b7c);}(_0xa81d,0x11e));var _0xda81=function(_0x382f44,_0x3a1b12){_0x382f44=_0x382f44-0x0;var _0x2fe454=_0xa81d[_0x382f44];return _0x2fe454;};'use strict';var _=require(_0xda81('0x0'));var util=require(_0xda81('0x1'));var moment=require('moment');var BPromise=require(_0xda81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda81('0x3'));var db=require(_0xda81('0x4'))['db'];var utils=require(_0xda81('0x5'));var logger=require(_0xda81('0x6'))(_0xda81('0x7'));var config=require(_0xda81('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda81('0x9')]({'port':0x232a});config['redis']=_[_0xda81('0xa')](config[_0xda81('0xb')],{'host':_0xda81('0xc'),'port':0x18eb});var socket=require(_0xda81('0xd'))(new Redis(config[_0xda81('0xb')]));require(_0xda81('0xe'))['register'](socket);function respondWithRpcPromise(_0x4db7f3,_0xd1bd2a,_0x5af9c5){return new BPromise(function(_0xb545b5,_0x21afe9){return client[_0xda81('0xf')](_0x4db7f3,_0x5af9c5)[_0xda81('0x10')](function(_0x420c67){logger[_0xda81('0x11')](_0xda81('0x12'),_0xd1bd2a,_0xda81('0x13'));logger[_0xda81('0x14')](_0xda81('0x15'),_0xd1bd2a,'request\x20sent',JSON[_0xda81('0x16')](_0x420c67));if(_0x420c67[_0xda81('0x17')]){if(_0x420c67['error'][_0xda81('0x18')]===0x1f4){logger['error'](_0xda81('0x12'),_0xd1bd2a,_0x420c67['error'][_0xda81('0x19')]);return _0x21afe9(_0x420c67[_0xda81('0x17')][_0xda81('0x19')]);}logger[_0xda81('0x17')](_0xda81('0x12'),_0xd1bd2a,_0x420c67[_0xda81('0x17')]['message']);return _0xb545b5(_0x420c67[_0xda81('0x17')][_0xda81('0x19')]);}else{logger[_0xda81('0x11')](_0xda81('0x12'),_0xd1bd2a,_0xda81('0x13'));_0xb545b5(_0x420c67[_0xda81('0x1a')][_0xda81('0x19')]);}})[_0xda81('0x1b')](function(_0x415465){logger[_0xda81('0x17')](_0xda81('0x12'),_0xd1bd2a,_0x415465);_0x21afe9(_0x415465);});});}exports['GetChatQueue']=function(_0x186539){var _0x50b080=this;return new Promise(function(_0x291b6d,_0x2353bd){return db[_0xda81('0x1c')][_0xda81('0x1d')]({'raw':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x1f')]===undefined?!![]:![]:!![],'where':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x20')]||null:null,'attributes':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x21')]||null:null,'limit':_0x186539[_0xda81('0x1e')]?_0x186539['options']['limit']||null:null,'include':_0x186539[_0xda81('0x1e')]?_0x186539[_0xda81('0x1e')][_0xda81('0x22')]?_[_0xda81('0x23')](_0x186539[_0xda81('0x1e')]['include'],function(_0x2caa71){return{'model':db[_0x2caa71[_0xda81('0x24')]],'as':_0x2caa71['as'],'attributes':_0x2caa71[_0xda81('0x21')],'include':_0x2caa71[_0xda81('0x22')]?_[_0xda81('0x23')](_0x2caa71[_0xda81('0x22')],function(_0x3e8a14){return{'model':db[_0x3e8a14[_0xda81('0x24')]],'as':_0x3e8a14['as'],'attributes':_0x3e8a14[_0xda81('0x21')],'include':_0x3e8a14[_0xda81('0x22')]?_[_0xda81('0x23')](_0x3e8a14['include'],function(_0x3948af){return{'model':db[_0x3948af[_0xda81('0x24')]],'as':_0x3948af['as'],'attributes':_0x3948af[_0xda81('0x21')]};}):[]};}):[]};}):[]:[]})[_0xda81('0x10')](function(_0x3d2e9b){logger[_0xda81('0x11')](_0xda81('0x25'),_0x186539);logger[_0xda81('0x14')](_0xda81('0x25'),_0x186539,JSON[_0xda81('0x16')](_0x3d2e9b));_0x291b6d(_0x3d2e9b);})[_0xda81('0x1b')](function(_0x3337f6){logger[_0xda81('0x17')](_0xda81('0x25'),_0x3337f6['message'],_0x186539);_0x2353bd(_0x50b080[_0xda81('0x17')](0x1f4,_0x3337f6[_0xda81('0x19')]));});});};exports[_0xda81('0x26')]=function(_0x5d939b){var _0x39d43f=this;return new Promise(function(_0x23edc3,_0x3d656c){return db[_0xda81('0x1c')][_0xda81('0x27')]({'raw':_0x5d939b[_0xda81('0x1e')]?_0x5d939b[_0xda81('0x1e')][_0xda81('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d939b['options']?_0x5d939b[_0xda81('0x1e')][_0xda81('0x20')]||null:null,'attributes':_0x5d939b['options']?_0x5d939b['options'][_0xda81('0x21')]||null:null,'include':_0x5d939b['options']?_0x5d939b[_0xda81('0x1e')][_0xda81('0x22')]?_[_0xda81('0x23')](_0x5d939b[_0xda81('0x1e')][_0xda81('0x22')],function(_0x58d4e3){return{'model':db[_0x58d4e3[_0xda81('0x24')]],'as':_0x58d4e3['as'],'attributes':_0x58d4e3[_0xda81('0x21')],'include':_0x58d4e3['include']?_['map'](_0x58d4e3[_0xda81('0x22')],function(_0x46b8b3){return{'model':db[_0x46b8b3[_0xda81('0x24')]],'as':_0x46b8b3['as'],'attributes':_0x46b8b3[_0xda81('0x21')],'include':_0x46b8b3[_0xda81('0x22')]?_[_0xda81('0x23')](_0x46b8b3['include'],function(_0x5acdeb){return{'model':db[_0x5acdeb[_0xda81('0x24')]],'as':_0x5acdeb['as'],'attributes':_0x5acdeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xda81('0x10')](function(_0x3c8648){logger['info'](_0xda81('0x26'),_0x5d939b);logger['debug'](_0xda81('0x26'),_0x5d939b,JSON[_0xda81('0x16')](_0x3c8648));_0x23edc3(_0x3c8648);})[_0xda81('0x1b')](function(_0x1b9090){logger[_0xda81('0x17')](_0xda81('0x26'),_0x1b9090['message'],_0x5d939b);_0x3d656c(_0x39d43f[_0xda81('0x17')](0x1f4,_0x1b9090[_0xda81('0x19')]));});});};
\ No newline at end of file
+var _0x71af=['attributes','GetChatQueue','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','include','map','model'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0x71af,0x194));var _0xf71a=function(_0x1cb354,_0x5f057d){_0x1cb354=_0x1cb354-0x0;var _0x4f9b3c=_0x71af[_0x1cb354];return _0x4f9b3c;};'use strict';var _=require(_0xf71a('0x0'));var util=require(_0xf71a('0x1'));var moment=require('moment');var BPromise=require(_0xf71a('0x2'));var rs=require(_0xf71a('0x3'));var fs=require('fs');var Redis=require(_0xf71a('0x4'));var db=require(_0xf71a('0x5'))['db'];var utils=require(_0xf71a('0x6'));var logger=require(_0xf71a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf71a('0x8'));var client=jayson[_0xf71a('0x9')][_0xf71a('0xa')]({'port':0x232a});config[_0xf71a('0xb')]=_[_0xf71a('0xc')](config[_0xf71a('0xb')],{'host':_0xf71a('0xd'),'port':0x18eb});var socket=require(_0xf71a('0xe'))(new Redis(config[_0xf71a('0xb')]));require(_0xf71a('0xf'))['register'](socket);function respondWithRpcPromise(_0x318a72,_0xbac86d,_0x53869b){return new BPromise(function(_0x331793,_0x42802f){return client[_0xf71a('0x10')](_0x318a72,_0x53869b)[_0xf71a('0x11')](function(_0x1d9575){logger['info'](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));logger[_0xf71a('0x14')](_0xf71a('0x15'),_0xbac86d,_0xf71a('0x13'),JSON[_0xf71a('0x16')](_0x1d9575));if(_0x1d9575[_0xf71a('0x17')]){if(_0x1d9575[_0xf71a('0x17')][_0xf71a('0x18')]===0x1f4){logger['error'](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x42802f(_0x1d9575[_0xf71a('0x17')]['message']);}logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x331793(_0x1d9575['error'][_0xf71a('0x19')]);}else{logger[_0xf71a('0x1a')](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));_0x331793(_0x1d9575['result'][_0xf71a('0x19')]);}})[_0xf71a('0x1b')](function(_0x3e61a9){logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x3e61a9);_0x42802f(_0x3e61a9);});});}exports['GetChatQueue']=function(_0x189e22){var _0x566b6d=this;return new Promise(function(_0x51ecda,_0x40d8ac){return db[_0xf71a('0x1c')][_0xf71a('0x1d')]({'raw':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x189e22['options']?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')]['attributes']||null:null,'limit':_0x189e22[_0xf71a('0x1e')]?_0x189e22['options']['limit']||null:null,'include':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x189e22[_0xf71a('0x1e')]['include'],function(_0x596a8a){return{'model':db[_0x596a8a[_0xf71a('0x23')]],'as':_0x596a8a['as'],'attributes':_0x596a8a[_0xf71a('0x24')],'include':_0x596a8a[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x596a8a[_0xf71a('0x21')],function(_0x1351a6){return{'model':db[_0x1351a6[_0xf71a('0x23')]],'as':_0x1351a6['as'],'attributes':_0x1351a6[_0xf71a('0x24')],'include':_0x1351a6[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x1351a6[_0xf71a('0x21')],function(_0x17980a){return{'model':db[_0x17980a['model']],'as':_0x17980a['as'],'attributes':_0x17980a[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x41cdef){logger[_0xf71a('0x1a')]('GetChatQueue',_0x189e22);logger['debug']('GetChatQueue',_0x189e22,JSON['stringify'](_0x41cdef));_0x51ecda(_0x41cdef);})[_0xf71a('0x1b')](function(_0x2836a6){logger[_0xf71a('0x17')](_0xf71a('0x25'),_0x2836a6[_0xf71a('0x19')],_0x189e22);_0x40d8ac(_0x566b6d[_0xf71a('0x17')](0x1f4,_0x2836a6[_0xf71a('0x19')]));});});};exports[_0xf71a('0x26')]=function(_0x5841ea){var _0x470eeb=this;return new Promise(function(_0x213b36,_0x38fde9){return db[_0xf71a('0x1c')][_0xf71a('0x27')]({'raw':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x24')]||null:null,'include':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')],function(_0xbb7507){return{'model':db[_0xbb7507['model']],'as':_0xbb7507['as'],'attributes':_0xbb7507['attributes'],'include':_0xbb7507[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0xbb7507[_0xf71a('0x21')],function(_0x4d4188){return{'model':db[_0x4d4188[_0xf71a('0x23')]],'as':_0x4d4188['as'],'attributes':_0x4d4188['attributes'],'include':_0x4d4188[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x4d4188[_0xf71a('0x21')],function(_0x1073ca){return{'model':db[_0x1073ca['model']],'as':_0x1073ca['as'],'attributes':_0x1073ca[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x591347){logger[_0xf71a('0x1a')]('ShowChatQueue',_0x5841ea);logger[_0xf71a('0x14')](_0xf71a('0x26'),_0x5841ea,JSON[_0xf71a('0x16')](_0x591347));_0x213b36(_0x591347);})[_0xf71a('0x1b')](function(_0x352336){logger[_0xf71a('0x17')]('ShowChatQueue',_0x352336[_0xf71a('0x19')],_0x5841ea);_0x38fde9(_0x470eeb[_0xf71a('0x17')](0x1f4,_0x352336['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 3aa7c0c..c89a189 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x72b1,0x16e));var _0x172b=function(_0x29fe42,_0x5d2482){_0x29fe42=_0x29fe42-0x0;var _0xd286f7=_0x72b1[_0x29fe42];return _0xd286f7;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x2252dd,_0x170894){var _0x30244f=function(_0x4c20bc){while(--_0x4c20bc){_0x2252dd['push'](_0x2252dd['shift']());}};_0x30244f(++_0x170894);}(_0x8ce3,0xc3));var _0x38ce=function(_0xc84cea,_0x7058f1){_0xc84cea=_0xc84cea-0x0;var _0x572c6c=_0x8ce3[_0xc84cea];return _0x572c6c;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 5323254..37f2657 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f4157,_0x27aa4c){var _0x23a1b1=function(_0x24212f){while(--_0x24212f){_0x4f4157['push'](_0x4f4157['shift']());}};_0x23a1b1(++_0x27aa4c);}(_0x55ca,0x126));var _0xa55c=function(_0x50ce0c,_0x541b68){_0x50ce0c=_0x50ce0c-0x0;var _0x3c988c=_0x55ca[_0x50ce0c];return _0x3c988c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x221b5d,_0x3705c7){_0x221b5d=_0x221b5d-0x0;var _0x3b970a=_0x3e74[_0x221b5d];return _0x3b970a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index a32b919..39cc382 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 _0x37b4=['moment','sequelize','exports','STRING','DATE'];(function(_0x5af32b,_0x518fde){var _0x4e59b1=function(_0x3c5d2a){while(--_0x3c5d2a){_0x5af32b['push'](_0x5af32b['shift']());}};_0x4e59b1(++_0x518fde);}(_0x37b4,0x16d));var _0x437b=function(_0x319a03,_0x4456d4){_0x319a03=_0x319a03-0x0;var _0x3b6704=_0x37b4[_0x319a03];return _0x3b6704;};'use strict';var moment=require(_0x437b('0x0'));var Sequelize=require(_0x437b('0x1'));module[_0x437b('0x2')]={'uniqueid':{'type':Sequelize[_0x437b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x437b('0x3')]},'joinAt':{'type':Sequelize[_0x437b('0x4')]},'leaveAt':{'type':Sequelize[_0x437b('0x4')]},'acceptAt':{'type':Sequelize[_0x437b('0x4')]},'exitAt':{'type':Sequelize[_0x437b('0x4')]},'reason':{'type':Sequelize[_0x437b('0x3')]}};
\ No newline at end of file
+var _0x75e2=['moment','exports','STRING','DATE'];(function(_0x43f707,_0x5b4f4e){var _0x364654=function(_0xc8e531){while(--_0xc8e531){_0x43f707['push'](_0x43f707['shift']());}};_0x364654(++_0x5b4f4e);}(_0x75e2,0x16c));var _0x275e=function(_0x497d6d,_0xff7558){_0x497d6d=_0x497d6d-0x0;var _0x4a1d9a=_0x75e2[_0x497d6d];return _0x4a1d9a;};'use strict';var moment=require(_0x275e('0x0'));var Sequelize=require('sequelize');module[_0x275e('0x1')]={'uniqueid':{'type':Sequelize[_0x275e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x275e('0x2')]},'joinAt':{'type':Sequelize[_0x275e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x275e('0x3')]},'exitAt':{'type':Sequelize[_0x275e('0x3')]},'reason':{'type':Sequelize[_0x275e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9ce3f72..4f4a65f 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 _0xd48e=['create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','error','name','index','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','ChatQueueReport','count','includeAll','include','rows','catch','show','params','keys','find'];(function(_0x564aa8,_0x4a5555){var _0x50a6ca=function(_0x319001){while(--_0x319001){_0x564aa8['push'](_0x564aa8['shift']());}};_0x50a6ca(++_0x4a5555);}(_0xd48e,0x93));var _0xed48=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xd48e[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed48('0x0'));var zipdir=require(_0xed48('0x1'));var jsonpatch=require(_0xed48('0x2'));var rp=require(_0xed48('0x3'));var moment=require(_0xed48('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed48('0x5'));var util=require(_0xed48('0x6'));var path=require(_0xed48('0x7'));var sox=require('sox');var csv=require(_0xed48('0x8'));var ejs=require(_0xed48('0x9'));var fs=require('fs');var fs_extra=require(_0xed48('0xa'));var _=require('lodash');var squel=require(_0xed48('0xb'));var crypto=require(_0xed48('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed48('0xd'));var Papa=require(_0xed48('0xe'));var Redis=require(_0xed48('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed48('0x10'));var hardwareService=require(_0xed48('0x11'));var logger=require(_0xed48('0x12'))('api');var utils=require(_0xed48('0x13'));var config=require(_0xed48('0x14'));var licenseUtil=require(_0xed48('0x15'));var db=require(_0xed48('0x16'))['db'];function respondWithStatusCode(_0x7ee238,_0xaf4b6d){_0xaf4b6d=_0xaf4b6d||0xcc;return function(_0x30bb80){if(_0x30bb80){return _0x7ee238[_0xed48('0x17')](_0xaf4b6d);}return _0x7ee238[_0xed48('0x18')](_0xaf4b6d)[_0xed48('0x19')]();};}function respondWithResult(_0x408ce8,_0x24e67c){_0x24e67c=_0x24e67c||0xc8;return function(_0x429024){if(_0x429024){return _0x408ce8['status'](_0x24e67c)[_0xed48('0x1a')](_0x429024);}};}function respondWithFilteredResult(_0x4a0296,_0x3bf0b7){return function(_0x4d23d9){if(_0x4d23d9){var _0x4d896f=typeof _0x3bf0b7[_0xed48('0x1b')]===_0xed48('0x1c')&&typeof _0x3bf0b7[_0xed48('0x1d')]===_0xed48('0x1c');var _0x1d0d94=_0x4d23d9['count'];var _0x355224=_0x4d896f?0x0:_0x3bf0b7['offset'];var _0x10c4a8=_0x4d896f?_0x4d23d9['count']:_0x3bf0b7[_0xed48('0x1b')]+_0x3bf0b7[_0xed48('0x1d')];var _0x122bf1;if(_0x10c4a8>=_0x1d0d94){_0x10c4a8=_0x1d0d94;_0x122bf1=0xc8;}else{_0x122bf1=0xce;}_0x4a0296['status'](_0x122bf1);return _0x4a0296['set'](_0xed48('0x1e'),_0x355224+'-'+_0x10c4a8+'/'+_0x1d0d94)[_0xed48('0x1a')](_0x4d23d9);}return null;};}function patchUpdates(_0x225d0f){return function(_0x54288f){try{jsonpatch[_0xed48('0x1f')](_0x54288f,_0x225d0f,!![]);}catch(_0x35f451){return BPromise[_0xed48('0x20')](_0x35f451);}return _0x54288f['save']();};}function saveUpdates(_0x277efb,_0x1bda45){return function(_0x13cb25){if(_0x13cb25){return _0x13cb25[_0xed48('0x21')](_0x277efb)[_0xed48('0x22')](function(_0x17a39b){return _0x17a39b;});}return null;};}function removeEntity(_0x4a6d93,_0x2683e4){return function(_0x4b829b){if(_0x4b829b){return _0x4b829b[_0xed48('0x23')]()[_0xed48('0x22')](function(){_0x4a6d93[_0xed48('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b460f,_0x51f67f){return function(_0x350c3c){if(!_0x350c3c){_0x4b460f[_0xed48('0x17')](0x194);}return _0x350c3c;};}function handleError(_0x277ef8,_0x26bff5){_0x26bff5=_0x26bff5||0x1f4;return function(_0x28dbf6){logger[_0xed48('0x24')](_0x28dbf6['stack']);if(_0x28dbf6[_0xed48('0x25')]){delete _0x28dbf6[_0xed48('0x25')];}_0x277ef8[_0xed48('0x18')](_0x26bff5)['send'](_0x28dbf6);};}exports[_0xed48('0x26')]=function(_0x2352a4,_0x5c66e4){var _0x2baff3={},_0x5ed24d={},_0x52a315={'count':0x0,'rows':[]};var _0x391e46=_['map'](db['ChatQueueReport'][_0xed48('0x27')],function(_0x982fdd){return{'name':_0x982fdd[_0xed48('0x28')],'type':_0x982fdd['type'][_0xed48('0x29')]};});_0x5ed24d[_0xed48('0x2a')]=_[_0xed48('0x2b')](_0x391e46,_0xed48('0x25'));_0x5ed24d['query']=_['keys'](_0x2352a4[_0xed48('0x2c')]);_0x5ed24d['filters']=_[_0xed48('0x2d')](_0x5ed24d[_0xed48('0x2a')],_0x5ed24d[_0xed48('0x2c')]);_0x2baff3[_0xed48('0x2e')]=_['intersection'](_0x5ed24d['model'],qs[_0xed48('0x2f')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x2f')]));_0x2baff3[_0xed48('0x2e')]=_0x2baff3[_0xed48('0x2e')][_0xed48('0x30')]?_0x2baff3[_0xed48('0x2e')]:_0x5ed24d[_0xed48('0x2a')];if(!_0x2352a4[_0xed48('0x2c')][_0xed48('0x31')](_0xed48('0x32'))){_0x2baff3[_0xed48('0x1d')]=qs['limit'](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1d')]);_0x2baff3[_0xed48('0x1b')]=qs[_0xed48('0x1b')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x1b')]);}_0x2baff3[_0xed48('0x33')]=qs[_0xed48('0x34')](_0x2352a4[_0xed48('0x2c')][_0xed48('0x34')]);_0x2baff3['where']=qs[_0xed48('0x35')](_[_0xed48('0x36')](_0x2352a4[_0xed48('0x2c')],_0x5ed24d[_0xed48('0x35')]),_0x391e46);if(_0x2352a4['query'][_0xed48('0x37')]){_0x2baff3[_0xed48('0x38')]=_['merge'](_0x2baff3[_0xed48('0x38')],{'$or':_[_0xed48('0x2b')](_0x391e46,function(_0x104f65){if(_0x104f65['type']!=='VIRTUAL'){var _0x3281c2={};_0x3281c2[_0x104f65['name']]={'$like':'%'+_0x2352a4[_0xed48('0x2c')][_0xed48('0x37')]+'%'};return _0x3281c2;}})});}_0x2baff3=_[_0xed48('0x39')]({},_0x2baff3,_0x2352a4[_0xed48('0x3a')]);var _0x2a3bfc={'where':_0x2baff3[_0xed48('0x38')]};return db[_0xed48('0x3b')][_0xed48('0x3c')](_0x2a3bfc)[_0xed48('0x22')](function(_0x5b1b8c){_0x52a315[_0xed48('0x3c')]=_0x5b1b8c;if(_0x2352a4[_0xed48('0x2c')][_0xed48('0x3d')]){_0x2baff3[_0xed48('0x3e')]=[{'all':!![]}];}return db[_0xed48('0x3b')]['findAll'](_0x2baff3);})[_0xed48('0x22')](function(_0x1af81d){_0x52a315[_0xed48('0x3f')]=_0x1af81d;return _0x52a315;})[_0xed48('0x22')](respondWithFilteredResult(_0x5c66e4,_0x2baff3))[_0xed48('0x40')](handleError(_0x5c66e4,null));};exports[_0xed48('0x41')]=function(_0x13d84b,_0x1af430){var _0x1d4d1d={'raw':!![],'where':{'id':_0x13d84b[_0xed48('0x42')]['id']}},_0x28014f={};_0x28014f[_0xed48('0x2a')]=_[_0xed48('0x43')](db[_0xed48('0x3b')][_0xed48('0x27')]);_0x28014f[_0xed48('0x2c')]=_[_0xed48('0x43')](_0x13d84b[_0xed48('0x2c')]);_0x28014f['filters']=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],_0x28014f[_0xed48('0x2c')]);_0x1d4d1d[_0xed48('0x2e')]=_[_0xed48('0x2d')](_0x28014f[_0xed48('0x2a')],qs['fields'](_0x13d84b[_0xed48('0x2c')]['fields']));_0x1d4d1d[_0xed48('0x2e')]=_0x1d4d1d[_0xed48('0x2e')]['length']?_0x1d4d1d['attributes']:_0x28014f[_0xed48('0x2a')];if(_0x13d84b['query'][_0xed48('0x3d')]){_0x1d4d1d['include']=[{'all':!![]}];}_0x1d4d1d=_['merge']({},_0x1d4d1d,_0x13d84b['options']);return db[_0xed48('0x3b')][_0xed48('0x44')](_0x1d4d1d)[_0xed48('0x22')](handleEntityNotFound(_0x1af430,null))[_0xed48('0x22')](respondWithResult(_0x1af430,null))[_0xed48('0x40')](handleError(_0x1af430,null));};exports[_0xed48('0x45')]=function(_0x5b02a0,_0x51d9d6){return db[_0xed48('0x3b')][_0xed48('0x45')](_0x5b02a0[_0xed48('0x46')],{})[_0xed48('0x22')](respondWithResult(_0x51d9d6,0xc9))[_0xed48('0x40')](handleError(_0x51d9d6,null));};exports[_0xed48('0x21')]=function(_0x505ef9,_0x25fee5){if(_0x505ef9['body']['id']){delete _0x505ef9['body']['id'];}return db['ChatQueueReport'][_0xed48('0x44')]({'where':{'id':_0x505ef9[_0xed48('0x42')]['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x25fee5,null))[_0xed48('0x22')](saveUpdates(_0x505ef9[_0xed48('0x46')],null))[_0xed48('0x22')](respondWithResult(_0x25fee5,null))[_0xed48('0x40')](handleError(_0x25fee5,null));};exports[_0xed48('0x23')]=function(_0x16b21e,_0x3d62a2){return db[_0xed48('0x3b')][_0xed48('0x44')]({'where':{'id':_0x16b21e['params']['id']}})[_0xed48('0x22')](handleEntityNotFound(_0x3d62a2,null))[_0xed48('0x22')](removeEntity(_0x3d62a2,null))[_0xed48('0x40')](handleError(_0x3d62a2,null));};exports[_0xed48('0x47')]=function(_0x1f30ec,_0x143920){return db[_0xed48('0x3b')][_0xed48('0x47')]()[_0xed48('0x22')](respondWithResult(_0x143920,null))[_0xed48('0x40')](handleError(_0x143920,null));};
\ No newline at end of file
+var _0xbe3b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','type','key','map','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','ChatQueueReport','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1586c6,_0x59e7da){_0x1586c6=_0x1586c6-0x0;var _0x957ef1=_0xbe3b[_0x1586c6];return _0x957ef1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbe3('0x0'));var zipdir=require(_0xbbe3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbe3('0x3'));var util=require('util');var path=require('path');var sox=require(_0xbbe3('0x4'));var csv=require(_0xbbe3('0x5'));var ejs=require(_0xbbe3('0x6'));var fs=require('fs');var fs_extra=require(_0xbbe3('0x7'));var _=require('lodash');var squel=require(_0xbbe3('0x8'));var crypto=require(_0xbbe3('0x9'));var jsforce=require(_0xbbe3('0xa'));var deskjs=require(_0xbbe3('0xb'));var toCsv=require(_0xbbe3('0x5'));var querystring=require('querystring');var Papa=require(_0xbbe3('0xc'));var Redis=require(_0xbbe3('0xd'));var authService=require(_0xbbe3('0xe'));var qs=require(_0xbbe3('0xf'));var as=require(_0xbbe3('0x10'));var hardwareService=require(_0xbbe3('0x11'));var logger=require(_0xbbe3('0x12'))(_0xbbe3('0x13'));var utils=require('../../config/utils');var config=require(_0xbbe3('0x14'));var licenseUtil=require(_0xbbe3('0x15'));var db=require(_0xbbe3('0x16'))['db'];function respondWithStatusCode(_0x464538,_0x5ea5b7){_0x5ea5b7=_0x5ea5b7||0xcc;return function(_0x5bd27e){if(_0x5bd27e){return _0x464538[_0xbbe3('0x17')](_0x5ea5b7);}return _0x464538[_0xbbe3('0x18')](_0x5ea5b7)[_0xbbe3('0x19')]();};}function respondWithResult(_0x32b786,_0x1e1552){_0x1e1552=_0x1e1552||0xc8;return function(_0x2df26d){if(_0x2df26d){return _0x32b786['status'](_0x1e1552)[_0xbbe3('0x1a')](_0x2df26d);}};}function respondWithFilteredResult(_0x5ba69a,_0x41b8ba){return function(_0x12a90c){if(_0x12a90c){var _0x46c91b=typeof _0x41b8ba[_0xbbe3('0x1b')]===_0xbbe3('0x1c')&&typeof _0x41b8ba[_0xbbe3('0x1d')]===_0xbbe3('0x1c');var _0x14b84a=_0x12a90c[_0xbbe3('0x1e')];var _0x2ad70e=_0x46c91b?0x0:_0x41b8ba[_0xbbe3('0x1b')];var _0x3de02e=_0x46c91b?_0x12a90c['count']:_0x41b8ba['offset']+_0x41b8ba['limit'];var _0x39d104;if(_0x3de02e>=_0x14b84a){_0x3de02e=_0x14b84a;_0x39d104=0xc8;}else{_0x39d104=0xce;}_0x5ba69a[_0xbbe3('0x18')](_0x39d104);return _0x5ba69a[_0xbbe3('0x1f')](_0xbbe3('0x20'),_0x2ad70e+'-'+_0x3de02e+'/'+_0x14b84a)[_0xbbe3('0x1a')](_0x12a90c);}return null;};}function patchUpdates(_0x4d13da){return function(_0x25f694){try{jsonpatch[_0xbbe3('0x21')](_0x25f694,_0x4d13da,!![]);}catch(_0x46cb49){return BPromise[_0xbbe3('0x22')](_0x46cb49);}return _0x25f694['save']();};}function saveUpdates(_0x545084,_0x4a5d39){return function(_0x5e78dc){if(_0x5e78dc){return _0x5e78dc[_0xbbe3('0x23')](_0x545084)[_0xbbe3('0x24')](function(_0x1e2464){return _0x1e2464;});}return null;};}function removeEntity(_0x4997bf,_0x224bad){return function(_0x190611){if(_0x190611){return _0x190611['destroy']()['then'](function(){_0x4997bf[_0xbbe3('0x18')](0xcc)[_0xbbe3('0x19')]();});}};}function handleEntityNotFound(_0x4df833,_0x2dd461){return function(_0xa09178){if(!_0xa09178){_0x4df833[_0xbbe3('0x17')](0x194);}return _0xa09178;};}function handleError(_0x20988d,_0x541b28){_0x541b28=_0x541b28||0x1f4;return function(_0x1784a4){logger[_0xbbe3('0x25')](_0x1784a4[_0xbbe3('0x26')]);if(_0x1784a4['name']){delete _0x1784a4[_0xbbe3('0x27')];}_0x20988d['status'](_0x541b28)[_0xbbe3('0x28')](_0x1784a4);};}exports[_0xbbe3('0x29')]=function(_0x3e9cf9,_0x158fef){var _0x15b311={},_0x503ba5={},_0x57d480={'count':0x0,'rows':[]};var _0x46fcb3=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0xf29abc){return{'name':_0xf29abc['fieldName'],'type':_0xf29abc[_0xbbe3('0x2a')][_0xbbe3('0x2b')]};});_0x503ba5['model']=_[_0xbbe3('0x2c')](_0x46fcb3,_0xbbe3('0x27'));_0x503ba5['query']=_[_0xbbe3('0x2d')](_0x3e9cf9[_0xbbe3('0x2e')]);_0x503ba5['filters']=_['intersection'](_0x503ba5[_0xbbe3('0x2f')],_0x503ba5['query']);_0x15b311[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x503ba5['model'],qs[_0xbbe3('0x32')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x15b311[_0xbbe3('0x30')]=_0x15b311[_0xbbe3('0x30')][_0xbbe3('0x33')]?_0x15b311['attributes']:_0x503ba5[_0xbbe3('0x2f')];if(!_0x3e9cf9['query'][_0xbbe3('0x34')](_0xbbe3('0x35'))){_0x15b311['limit']=qs[_0xbbe3('0x1d')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1d')]);_0x15b311['offset']=qs[_0xbbe3('0x1b')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1b')]);}_0x15b311['order']=qs[_0xbbe3('0x36')](_0x3e9cf9['query'][_0xbbe3('0x36')]);_0x15b311[_0xbbe3('0x37')]=qs[_0xbbe3('0x38')](_[_0xbbe3('0x39')](_0x3e9cf9[_0xbbe3('0x2e')],_0x503ba5[_0xbbe3('0x38')]),_0x46fcb3);if(_0x3e9cf9[_0xbbe3('0x2e')]['filter']){_0x15b311[_0xbbe3('0x37')]=_[_0xbbe3('0x3a')](_0x15b311[_0xbbe3('0x37')],{'$or':_[_0xbbe3('0x2c')](_0x46fcb3,function(_0x55f88a){if(_0x55f88a[_0xbbe3('0x2a')]!=='VIRTUAL'){var _0x45fff0={};_0x45fff0[_0x55f88a['name']]={'$like':'%'+_0x3e9cf9['query'][_0xbbe3('0x3b')]+'%'};return _0x45fff0;}})});}_0x15b311=_[_0xbbe3('0x3a')]({},_0x15b311,_0x3e9cf9[_0xbbe3('0x3c')]);var _0x10091f={'where':_0x15b311[_0xbbe3('0x37')]};return db[_0xbbe3('0x3d')][_0xbbe3('0x1e')](_0x10091f)[_0xbbe3('0x24')](function(_0x704ecf){_0x57d480[_0xbbe3('0x1e')]=_0x704ecf;if(_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x3e')]){_0x15b311[_0xbbe3('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbbe3('0x40')](_0x15b311);})['then'](function(_0x579a42){_0x57d480[_0xbbe3('0x41')]=_0x579a42;return _0x57d480;})[_0xbbe3('0x24')](respondWithFilteredResult(_0x158fef,_0x15b311))['catch'](handleError(_0x158fef,null));};exports['show']=function(_0x52e815,_0x163dd2){var _0x24e080={'raw':!![],'where':{'id':_0x52e815[_0xbbe3('0x42')]['id']}},_0x22a62c={};_0x22a62c[_0xbbe3('0x2f')]=_[_0xbbe3('0x2d')](db[_0xbbe3('0x3d')][_0xbbe3('0x43')]);_0x22a62c[_0xbbe3('0x2e')]=_['keys'](_0x52e815['query']);_0x22a62c[_0xbbe3('0x38')]=_[_0xbbe3('0x31')](_0x22a62c['model'],_0x22a62c[_0xbbe3('0x2e')]);_0x24e080[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x22a62c[_0xbbe3('0x2f')],qs[_0xbbe3('0x32')](_0x52e815[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x24e080['attributes']=_0x24e080['attributes']['length']?_0x24e080['attributes']:_0x22a62c['model'];if(_0x52e815[_0xbbe3('0x2e')]['includeAll']){_0x24e080[_0xbbe3('0x3f')]=[{'all':!![]}];}_0x24e080=_['merge']({},_0x24e080,_0x52e815[_0xbbe3('0x3c')]);return db[_0xbbe3('0x3d')][_0xbbe3('0x44')](_0x24e080)['then'](handleEntityNotFound(_0x163dd2,null))[_0xbbe3('0x24')](respondWithResult(_0x163dd2,null))[_0xbbe3('0x45')](handleError(_0x163dd2,null));};exports[_0xbbe3('0x46')]=function(_0x560e57,_0x4b9b51){return db[_0xbbe3('0x3d')]['create'](_0x560e57[_0xbbe3('0x47')],{})['then'](respondWithResult(_0x4b9b51,0xc9))[_0xbbe3('0x45')](handleError(_0x4b9b51,null));};exports[_0xbbe3('0x23')]=function(_0x291f1a,_0x1ddc51){if(_0x291f1a[_0xbbe3('0x47')]['id']){delete _0x291f1a[_0xbbe3('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x291f1a[_0xbbe3('0x42')]['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x1ddc51,null))[_0xbbe3('0x24')](saveUpdates(_0x291f1a[_0xbbe3('0x47')],null))[_0xbbe3('0x24')](respondWithResult(_0x1ddc51,null))[_0xbbe3('0x45')](handleError(_0x1ddc51,null));};exports['destroy']=function(_0x4da713,_0x449beb){return db['ChatQueueReport']['find']({'where':{'id':_0x4da713['params']['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x449beb,null))[_0xbbe3('0x24')](removeEntity(_0x449beb,null))['catch'](handleError(_0x449beb,null));};exports[_0xbbe3('0x48')]=function(_0x1cc61b,_0x454bb7){return db['ChatQueueReport'][_0xbbe3('0x48')]()[_0xbbe3('0x24')](respondWithResult(_0x454bb7,null))['catch'](handleError(_0x454bb7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 7a3ac95..5d6f94a 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4077c1,_0x8e99bf){var _0x37a8f1=function(_0x2bf4aa){while(--_0x2bf4aa){_0x4077c1['push'](_0x4077c1['shift']());}};_0x37a8f1(++_0x8e99bf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xcb91[_0x204ad4];return _0x50675f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x179ea1,_0x367ffc){var _0x314d33=function(_0x2b94a7){while(--_0x2b94a7){_0x179ea1['push'](_0x179ea1['shift']());}};_0x314d33(++_0x367ffc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 c53855a..6e5f65e 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 _0x31a3=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','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'];(function(_0x5aa9a9,_0x5ac877){var _0x277581=function(_0x2d5f1d){while(--_0x2d5f1d){_0x5aa9a9['push'](_0x5aa9a9['shift']());}};_0x277581(++_0x5ac877);}(_0x31a3,0x183));var _0x331a=function(_0xb9c2da,_0x5e481a){_0xb9c2da=_0xb9c2da-0x0;var _0x195d1d=_0x31a3[_0xb9c2da];return _0x195d1d;};'use strict';var _=require(_0x331a('0x0'));var util=require(_0x331a('0x1'));var moment=require(_0x331a('0x2'));var BPromise=require(_0x331a('0x3'));var rs=require(_0x331a('0x4'));var fs=require('fs');var Redis=require(_0x331a('0x5'));var db=require(_0x331a('0x6'))['db'];var utils=require(_0x331a('0x7'));var logger=require(_0x331a('0x8'))(_0x331a('0x9'));var config=require(_0x331a('0xa'));var jayson=require(_0x331a('0xb'));var client=jayson[_0x331a('0xc')][_0x331a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x435bbd,_0x27a66f,_0x30de49){return new BPromise(function(_0x300633,_0x51aad5){return client['request'](_0x435bbd,_0x30de49)[_0x331a('0xe')](function(_0x27b061){logger[_0x331a('0xf')](_0x331a('0x10'),_0x27a66f,_0x331a('0x11'));logger[_0x331a('0x12')](_0x331a('0x13'),_0x27a66f,_0x331a('0x11'),JSON['stringify'](_0x27b061));if(_0x27b061[_0x331a('0x14')]){if(_0x27b061[_0x331a('0x14')][_0x331a('0x15')]===0x1f4){logger[_0x331a('0x14')](_0x331a('0x10'),_0x27a66f,_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);return _0x51aad5(_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);}logger[_0x331a('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x27a66f,_0x27b061[_0x331a('0x14')][_0x331a('0x16')]);return _0x300633(_0x27b061['error'][_0x331a('0x16')]);}else{logger['info'](_0x331a('0x10'),_0x27a66f,_0x331a('0x11'));_0x300633(_0x27b061[_0x331a('0x17')][_0x331a('0x16')]);}})[_0x331a('0x18')](function(_0x56e04e){logger[_0x331a('0x14')](_0x331a('0x10'),_0x27a66f,_0x56e04e);_0x51aad5(_0x56e04e);});});}exports[_0x331a('0x19')]=function(_0x12e44f){var _0x50c44d=this;return new Promise(function(_0x471e66,_0x3d134c){return db[_0x331a('0x1a')][_0x331a('0x1b')](_0x12e44f[_0x331a('0x1c')],{'raw':_0x12e44f['options']?_0x12e44f[_0x331a('0x1d')][_0x331a('0x1e')]===undefined?!![]:![]:!![]})[_0x331a('0xe')](function(_0x1a60ce){logger[_0x331a('0xf')](_0x331a('0x19'),_0x12e44f);logger[_0x331a('0x12')](_0x331a('0x19'),_0x12e44f,JSON[_0x331a('0x1f')](_0x1a60ce));_0x471e66(_0x1a60ce);})[_0x331a('0x18')](function(_0x194114){logger[_0x331a('0x14')](_0x331a('0x19'),_0x194114[_0x331a('0x16')],_0x12e44f);_0x3d134c(_0x50c44d[_0x331a('0x14')](0x1f4,_0x194114[_0x331a('0x16')]));});});};exports[_0x331a('0x20')]=function(_0x651d19){var _0x1714ab=this;return new Promise(function(_0x23a8de,_0xde0c39){return db[_0x331a('0x1a')][_0x331a('0x21')](_0x651d19[_0x331a('0x1c')],{'raw':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x22')]||null:null,'attributes':_0x651d19['options']?_0x651d19[_0x331a('0x1d')][_0x331a('0x23')]||null:null,'limit':_0x651d19[_0x331a('0x1d')]?_0x651d19[_0x331a('0x1d')][_0x331a('0x24')]||null:null})[_0x331a('0xe')](function(_0x53869f){logger[_0x331a('0xf')](_0x331a('0x20'),_0x651d19);logger[_0x331a('0x12')](_0x331a('0x20'),_0x651d19,JSON[_0x331a('0x1f')](_0x53869f));_0x23a8de(_0x53869f);})[_0x331a('0x18')](function(_0x1e3a84){logger['error'](_0x331a('0x20'),_0x1e3a84[_0x331a('0x16')],_0x651d19);_0xde0c39(_0x1714ab['error'](0x1f4,_0x1e3a84[_0x331a('0x16')]));});});};
\ No newline at end of file
+var _0x9007=['info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','options','raw','ChatQueueReport','update','where','limit','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x59a5f4,_0x2b1063){var _0x3d3a6f=function(_0x630d89){while(--_0x630d89){_0x59a5f4['push'](_0x59a5f4['shift']());}};_0x3d3a6f(++_0x2b1063);}(_0x9007,0x1db));var _0x7900=function(_0x2c9cf9,_0x2bed45){_0x2c9cf9=_0x2c9cf9-0x0;var _0x560d6d=_0x9007[_0x2c9cf9];return _0x560d6d;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var moment=require(_0x7900('0x2'));var BPromise=require('bluebird');var rs=require(_0x7900('0x3'));var fs=require('fs');var Redis=require(_0x7900('0x4'));var db=require(_0x7900('0x5'))['db'];var utils=require(_0x7900('0x6'));var logger=require(_0x7900('0x7'))(_0x7900('0x8'));var config=require(_0x7900('0x9'));var jayson=require(_0x7900('0xa'));var client=jayson[_0x7900('0xb')][_0x7900('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x537274,_0x237967,_0x5a75ab){return new BPromise(function(_0x39508a,_0x385913){return client[_0x7900('0xd')](_0x537274,_0x5a75ab)[_0x7900('0xe')](function(_0x32be3f){logger[_0x7900('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x7900('0x10'));logger[_0x7900('0x11')](_0x7900('0x12'),_0x237967,_0x7900('0x10'),JSON[_0x7900('0x13')](_0x32be3f));if(_0x32be3f[_0x7900('0x14')]){if(_0x32be3f[_0x7900('0x14')][_0x7900('0x15')]===0x1f4){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x32be3f['error'][_0x7900('0x17')]);return _0x385913(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);return _0x39508a(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}else{logger[_0x7900('0xf')](_0x7900('0x16'),_0x237967,_0x7900('0x10'));_0x39508a(_0x32be3f[_0x7900('0x18')]['message']);}})[_0x7900('0x19')](function(_0x45e83c){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x45e83c);_0x385913(_0x45e83c);});});}exports[_0x7900('0x1a')]=function(_0x1baf93){var _0xd3645c=this;return new Promise(function(_0x12fb13,_0x2fcf84){return db['ChatQueueReport'][_0x7900('0x1b')](_0x1baf93['body'],{'raw':_0x1baf93[_0x7900('0x1c')]?_0x1baf93[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x318e13){logger[_0x7900('0xf')](_0x7900('0x1a'),_0x1baf93);logger['debug'](_0x7900('0x1a'),_0x1baf93,JSON[_0x7900('0x13')](_0x318e13));_0x12fb13(_0x318e13);})[_0x7900('0x19')](function(_0x4795f1){logger[_0x7900('0x14')](_0x7900('0x1a'),_0x4795f1[_0x7900('0x17')],_0x1baf93);_0x2fcf84(_0xd3645c[_0x7900('0x14')](0x1f4,_0x4795f1[_0x7900('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0xeebcda){var _0x3e43ca=this;return new Promise(function(_0x19ae4f,_0x3fb249){return db[_0x7900('0x1e')][_0x7900('0x1f')](_0xeebcda['body'],{'raw':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeebcda[_0x7900('0x1c')]?_0xeebcda['options'][_0x7900('0x20')]||null:null,'attributes':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')]['attributes']||null:null,'limit':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x21')]||null:null})['then'](function(_0x11d0fd){logger[_0x7900('0xf')](_0x7900('0x22'),_0xeebcda);logger[_0x7900('0x11')](_0x7900('0x22'),_0xeebcda,JSON[_0x7900('0x13')](_0x11d0fd));_0x19ae4f(_0x11d0fd);})['catch'](function(_0x5d4a48){logger[_0x7900('0x14')]('UpdateChatQueueReport',_0x5d4a48[_0x7900('0x17')],_0xeebcda);_0x3fb249(_0x3e43ca[_0x7900('0x14')](0x1f4,_0x5d4a48[_0x7900('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index ba3f7a8..244b109 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 _0x18ac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x245cbf,_0x4ff281){var _0x1f3c4b=function(_0x29b237){while(--_0x29b237){_0x245cbf['push'](_0x245cbf['shift']());}};_0x1f3c4b(++_0x4ff281);}(_0x18ac,0xa3));var _0xc18a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x18ac[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xc18a('0x0'));var util=require(_0xc18a('0x1'));var path=require(_0xc18a('0x2'));var timeout=require(_0xc18a('0x3'));var express=require(_0xc18a('0x4'));var router=express[_0xc18a('0x5')]();var fs_extra=require(_0xc18a('0x6'));var auth=require(_0xc18a('0x7'));var interaction=require(_0xc18a('0x8'));var config=require(_0xc18a('0x9'));var controller=require('./chatQueueReport.controller');router[_0xc18a('0xa')]('/',auth[_0xc18a('0xb')](),controller[_0xc18a('0xc')]);router[_0xc18a('0xa')](_0xc18a('0xd'),auth['isAuthenticated'](),controller[_0xc18a('0xe')]);router[_0xc18a('0xa')](_0xc18a('0xf'),auth[_0xc18a('0xb')](),controller['show']);router[_0xc18a('0x10')]('/',auth[_0xc18a('0xb')](),controller['create']);router[_0xc18a('0x11')](_0xc18a('0xf'),auth['isAuthenticated'](),controller[_0xc18a('0x12')]);router[_0xc18a('0x13')](_0xc18a('0xf'),auth['isAuthenticated'](),controller[_0xc18a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x75dc=['describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x36d9b5,_0x38491f){var _0x2ec0bb=function(_0x378da9){while(--_0x378da9){_0x36d9b5['push'](_0x36d9b5['shift']());}};_0x2ec0bb(++_0x38491f);}(_0x75dc,0x1db));var _0xc75d=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0x75dc[_0x44e7b9];return _0x1de7ac;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require(_0xc75d('0x2'));var express=require(_0xc75d('0x3'));var router=express[_0xc75d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc75d('0x5'));var controller=require(_0xc75d('0x6'));router[_0xc75d('0x7')]('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0x9')]);router[_0xc75d('0x7')](_0xc75d('0xa'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xb')]);router[_0xc75d('0x7')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xd')]);router['post']('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0xe')]);router[_0xc75d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc75d('0x10')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ae16080..cc67038 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1812a0,_0x10afb1){var _0x52783a=function(_0x49d34e){while(--_0x49d34e){_0x1812a0['push'](_0x1812a0['shift']());}};_0x52783a(++_0x10afb1);}(_0xe706,0xa3));var _0x6e70=function(_0x40c402,_0x42ee7d){_0x40c402=_0x40c402-0x0;var _0x4e7680=_0xe706[_0x40c402];return _0x4e7680;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5d1caf,_0x1fc81e){var _0xc452cf=function(_0x5c36fb){while(--_0x5c36fb){_0x5d1caf['push'](_0x5d1caf['shift']());}};_0xc452cf(++_0x1fc81e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x608daf,_0x589a32){_0x608daf=_0x608daf-0x0;var _0x1bc560=_0xf4eb[_0x608daf];return _0x1bc560;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7ce8566..80de743 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 _0xe741=['../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x22816e,_0x4651e){var _0x86babe=function(_0x47cd1c){while(--_0x47cd1c){_0x22816e['push'](_0x22816e['shift']());}};_0x86babe(++_0x4651e);}(_0xe741,0x7c));var _0x1e74=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xe741[_0x26462c];return _0x509a42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e74('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e74('0x1'));var rp=require(_0x1e74('0x2'));var moment=require(_0x1e74('0x3'));var BPromise=require(_0x1e74('0x4'));var Mustache=require(_0x1e74('0x5'));var util=require(_0x1e74('0x6'));var path=require(_0x1e74('0x7'));var sox=require('sox');var csv=require(_0x1e74('0x8'));var ejs=require(_0x1e74('0x9'));var fs=require('fs');var fs_extra=require(_0x1e74('0xa'));var _=require(_0x1e74('0xb'));var squel=require('squel');var crypto=require(_0x1e74('0xc'));var jsforce=require(_0x1e74('0xd'));var deskjs=require(_0x1e74('0xe'));var toCsv=require(_0x1e74('0x8'));var querystring=require(_0x1e74('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e74('0x10'));var authService=require(_0x1e74('0x11'));var qs=require(_0x1e74('0x12'));var as=require(_0x1e74('0x13'));var hardwareService=require(_0x1e74('0x14'));var logger=require('../../config/logger')(_0x1e74('0x15'));var utils=require('../../config/utils');var config=require(_0x1e74('0x16'));var licenseUtil=require(_0x1e74('0x17'));var db=require(_0x1e74('0x18'))['db'];function respondWithStatusCode(_0x121aa2,_0x4a7ad3){_0x4a7ad3=_0x4a7ad3||0xcc;return function(_0x329490){if(_0x329490){return _0x121aa2[_0x1e74('0x19')](_0x4a7ad3);}return _0x121aa2[_0x1e74('0x1a')](_0x4a7ad3)[_0x1e74('0x1b')]();};}function respondWithResult(_0x1b8031,_0x86733f){_0x86733f=_0x86733f||0xc8;return function(_0x465fc6){if(_0x465fc6){return _0x1b8031[_0x1e74('0x1a')](_0x86733f)[_0x1e74('0x1c')](_0x465fc6);}};}function respondWithFilteredResult(_0x300b05,_0x35f983){return function(_0x360aab){if(_0x360aab){var _0x55daf6=typeof _0x35f983['offset']==='undefined'&&typeof _0x35f983[_0x1e74('0x1d')]===_0x1e74('0x1e');var _0x5e264e=_0x360aab[_0x1e74('0x1f')];var _0x3872a0=_0x55daf6?0x0:_0x35f983[_0x1e74('0x20')];var _0x131091=_0x55daf6?_0x360aab[_0x1e74('0x1f')]:_0x35f983['offset']+_0x35f983[_0x1e74('0x1d')];var _0x14e403;if(_0x131091>=_0x5e264e){_0x131091=_0x5e264e;_0x14e403=0xc8;}else{_0x14e403=0xce;}_0x300b05[_0x1e74('0x1a')](_0x14e403);return _0x300b05['set']('Content-Range',_0x3872a0+'-'+_0x131091+'/'+_0x5e264e)['json'](_0x360aab);}return null;};}function patchUpdates(_0x50f19a){return function(_0x2ebabf){try{jsonpatch[_0x1e74('0x21')](_0x2ebabf,_0x50f19a,!![]);}catch(_0x4dbc18){return BPromise[_0x1e74('0x22')](_0x4dbc18);}return _0x2ebabf['save']();};}function saveUpdates(_0x11bafa,_0x11c4c8){return function(_0x1813cc){if(_0x1813cc){return _0x1813cc[_0x1e74('0x23')](_0x11bafa)[_0x1e74('0x24')](function(_0x33c8c3){return _0x33c8c3;});}return null;};}function removeEntity(_0x294e97,_0x20d086){return function(_0x2cecdc){if(_0x2cecdc){return _0x2cecdc[_0x1e74('0x25')]()[_0x1e74('0x24')](function(){_0x294e97[_0x1e74('0x1a')](0xcc)[_0x1e74('0x1b')]();});}};}function handleEntityNotFound(_0x585afa,_0x300258){return function(_0x49bd26){if(!_0x49bd26){_0x585afa['sendStatus'](0x194);}return _0x49bd26;};}function handleError(_0x2b1692,_0x56c4b4){_0x56c4b4=_0x56c4b4||0x1f4;return function(_0x278b2c){logger[_0x1e74('0x26')](_0x278b2c[_0x1e74('0x27')]);if(_0x278b2c[_0x1e74('0x28')]){delete _0x278b2c[_0x1e74('0x28')];}_0x2b1692[_0x1e74('0x1a')](_0x56c4b4)[_0x1e74('0x29')](_0x278b2c);};}exports[_0x1e74('0x2a')]=function(_0x47213e,_0x2b20b2){var _0x200e1a={},_0x2c6f4b={},_0x32da80={'count':0x0,'rows':[]};var _0x2d7381=_[_0x1e74('0x2b')](db[_0x1e74('0x2c')]['rawAttributes'],function(_0x59d415){return{'name':_0x59d415['fieldName'],'type':_0x59d415[_0x1e74('0x2d')][_0x1e74('0x2e')]};});_0x2c6f4b[_0x1e74('0x2f')]=_[_0x1e74('0x2b')](_0x2d7381,_0x1e74('0x28'));_0x2c6f4b['query']=_[_0x1e74('0x30')](_0x47213e[_0x1e74('0x31')]);_0x2c6f4b[_0x1e74('0x32')]=_[_0x1e74('0x33')](_0x2c6f4b['model'],_0x2c6f4b['query']);_0x200e1a[_0x1e74('0x34')]=_[_0x1e74('0x33')](_0x2c6f4b[_0x1e74('0x2f')],qs[_0x1e74('0x35')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x35')]));_0x200e1a[_0x1e74('0x34')]=_0x200e1a[_0x1e74('0x34')][_0x1e74('0x36')]?_0x200e1a['attributes']:_0x2c6f4b[_0x1e74('0x2f')];if(!_0x47213e[_0x1e74('0x31')][_0x1e74('0x37')]('nolimit')){_0x200e1a[_0x1e74('0x1d')]=qs[_0x1e74('0x1d')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x1d')]);_0x200e1a['offset']=qs[_0x1e74('0x20')](_0x47213e[_0x1e74('0x31')][_0x1e74('0x20')]);}_0x200e1a[_0x1e74('0x38')]=qs[_0x1e74('0x39')](_0x47213e[_0x1e74('0x31')]['sort']);_0x200e1a[_0x1e74('0x3a')]=qs[_0x1e74('0x32')](_[_0x1e74('0x3b')](_0x47213e[_0x1e74('0x31')],_0x2c6f4b[_0x1e74('0x32')]),_0x2d7381);if(_0x47213e[_0x1e74('0x31')]['filter']){_0x200e1a[_0x1e74('0x3a')]=_[_0x1e74('0x3c')](_0x200e1a['where'],{'$or':_[_0x1e74('0x2b')](_0x2d7381,function(_0x4a4d1d){if(_0x4a4d1d[_0x1e74('0x2d')]!==_0x1e74('0x3d')){var _0x3bfb3e={};_0x3bfb3e[_0x4a4d1d[_0x1e74('0x28')]]={'$like':'%'+_0x47213e[_0x1e74('0x31')]['filter']+'%'};return _0x3bfb3e;}})});}_0x200e1a=_[_0x1e74('0x3c')]({},_0x200e1a,_0x47213e['options']);var _0x5afa22={'where':_0x200e1a['where']};return db['ChatTransferReport'][_0x1e74('0x1f')](_0x5afa22)[_0x1e74('0x24')](function(_0x44ce35){_0x32da80['count']=_0x44ce35;if(_0x47213e[_0x1e74('0x31')][_0x1e74('0x3e')]){_0x200e1a[_0x1e74('0x3f')]=[{'all':!![]}];}return db[_0x1e74('0x2c')][_0x1e74('0x40')](_0x200e1a);})[_0x1e74('0x24')](function(_0x43a84c){_0x32da80[_0x1e74('0x41')]=_0x43a84c;return _0x32da80;})[_0x1e74('0x24')](respondWithFilteredResult(_0x2b20b2,_0x200e1a))[_0x1e74('0x42')](handleError(_0x2b20b2,null));};exports['show']=function(_0x4f7b7b,_0x59d190){var _0x536812={'raw':!![],'where':{'id':_0x4f7b7b[_0x1e74('0x43')]['id']}},_0x5775d0={};_0x5775d0[_0x1e74('0x2f')]=_[_0x1e74('0x30')](db[_0x1e74('0x2c')]['rawAttributes']);_0x5775d0[_0x1e74('0x31')]=_[_0x1e74('0x30')](_0x4f7b7b[_0x1e74('0x31')]);_0x5775d0['filters']=_[_0x1e74('0x33')](_0x5775d0[_0x1e74('0x2f')],_0x5775d0[_0x1e74('0x31')]);_0x536812[_0x1e74('0x34')]=_[_0x1e74('0x33')](_0x5775d0[_0x1e74('0x2f')],qs[_0x1e74('0x35')](_0x4f7b7b['query'][_0x1e74('0x35')]));_0x536812['attributes']=_0x536812[_0x1e74('0x34')]['length']?_0x536812[_0x1e74('0x34')]:_0x5775d0[_0x1e74('0x2f')];if(_0x4f7b7b[_0x1e74('0x31')][_0x1e74('0x3e')]){_0x536812[_0x1e74('0x3f')]=[{'all':!![]}];}_0x536812=_['merge']({},_0x536812,_0x4f7b7b['options']);return db[_0x1e74('0x2c')]['find'](_0x536812)[_0x1e74('0x24')](handleEntityNotFound(_0x59d190,null))[_0x1e74('0x24')](respondWithResult(_0x59d190,null))['catch'](handleError(_0x59d190,null));};exports[_0x1e74('0x44')]=function(_0x2ee30a,_0x4d3a11){return db[_0x1e74('0x2c')][_0x1e74('0x44')](_0x2ee30a[_0x1e74('0x45')],{})[_0x1e74('0x24')](respondWithResult(_0x4d3a11,0xc9))[_0x1e74('0x42')](handleError(_0x4d3a11,null));};exports['update']=function(_0x1feedd,_0x2d6a87){if(_0x1feedd[_0x1e74('0x45')]['id']){delete _0x1feedd[_0x1e74('0x45')]['id'];}return db[_0x1e74('0x2c')][_0x1e74('0x46')]({'where':{'id':_0x1feedd[_0x1e74('0x43')]['id']}})[_0x1e74('0x24')](handleEntityNotFound(_0x2d6a87,null))['then'](saveUpdates(_0x1feedd[_0x1e74('0x45')],null))[_0x1e74('0x24')](respondWithResult(_0x2d6a87,null))[_0x1e74('0x42')](handleError(_0x2d6a87,null));};exports[_0x1e74('0x25')]=function(_0x286c32,_0x4aa5f4){return db[_0x1e74('0x2c')]['find']({'where':{'id':_0x286c32[_0x1e74('0x43')]['id']}})[_0x1e74('0x24')](handleEntityNotFound(_0x4aa5f4,null))['then'](removeEntity(_0x4aa5f4,null))[_0x1e74('0x42')](handleError(_0x4aa5f4,null));};exports['describe']=function(_0x3996c8,_0x2d7dca){return db['ChatTransferReport'][_0x1e74('0x47')]()[_0x1e74('0x24')](respondWithResult(_0x2d7dca,null))[_0x1e74('0x42')](handleError(_0x2d7dca,null));};
\ No newline at end of file
+var _0x7919=['order','sort','where','pick','type','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x469346,_0x4ee770){var _0x3b1b6d=function(_0x2bea74){while(--_0x2bea74){_0x469346['push'](_0x469346['shift']());}};_0x3b1b6d(++_0x4ee770);}(_0x7919,0x1db));var _0x9791=function(_0x53b0d1,_0xffa3c9){_0x53b0d1=_0x53b0d1-0x0;var _0x37bc3d=_0x7919[_0x53b0d1];return _0x37bc3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9791('0x0'));var zipdir=require(_0x9791('0x1'));var jsonpatch=require(_0x9791('0x2'));var rp=require(_0x9791('0x3'));var moment=require(_0x9791('0x4'));var BPromise=require(_0x9791('0x5'));var Mustache=require(_0x9791('0x6'));var util=require(_0x9791('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9791('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9791('0x9'));var squel=require(_0x9791('0xa'));var crypto=require(_0x9791('0xb'));var jsforce=require(_0x9791('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9791('0xd'));var Papa=require(_0x9791('0xe'));var Redis=require(_0x9791('0xf'));var authService=require(_0x9791('0x10'));var qs=require(_0x9791('0x11'));var as=require(_0x9791('0x12'));var hardwareService=require(_0x9791('0x13'));var logger=require(_0x9791('0x14'))(_0x9791('0x15'));var utils=require(_0x9791('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8b6ef5,_0x1f2e63){_0x1f2e63=_0x1f2e63||0xcc;return function(_0x51d8e0){if(_0x51d8e0){return _0x8b6ef5[_0x9791('0x17')](_0x1f2e63);}return _0x8b6ef5[_0x9791('0x18')](_0x1f2e63)[_0x9791('0x19')]();};}function respondWithResult(_0x40f5cc,_0x535652){_0x535652=_0x535652||0xc8;return function(_0xd2bdd3){if(_0xd2bdd3){return _0x40f5cc[_0x9791('0x18')](_0x535652)[_0x9791('0x1a')](_0xd2bdd3);}};}function respondWithFilteredResult(_0x2fafe6,_0x308117){return function(_0xf9f120){if(_0xf9f120){var _0x4c9a8c=typeof _0x308117[_0x9791('0x1b')]===_0x9791('0x1c')&&typeof _0x308117[_0x9791('0x1d')]===_0x9791('0x1c');var _0x2e48a2=_0xf9f120['count'];var _0x5c4ab8=_0x4c9a8c?0x0:_0x308117[_0x9791('0x1b')];var _0x19b151=_0x4c9a8c?_0xf9f120[_0x9791('0x1e')]:_0x308117[_0x9791('0x1b')]+_0x308117[_0x9791('0x1d')];var _0x594ec2;if(_0x19b151>=_0x2e48a2){_0x19b151=_0x2e48a2;_0x594ec2=0xc8;}else{_0x594ec2=0xce;}_0x2fafe6[_0x9791('0x18')](_0x594ec2);return _0x2fafe6[_0x9791('0x1f')](_0x9791('0x20'),_0x5c4ab8+'-'+_0x19b151+'/'+_0x2e48a2)[_0x9791('0x1a')](_0xf9f120);}return null;};}function patchUpdates(_0xe3da4f){return function(_0x2eb577){try{jsonpatch[_0x9791('0x21')](_0x2eb577,_0xe3da4f,!![]);}catch(_0x164ca3){return BPromise[_0x9791('0x22')](_0x164ca3);}return _0x2eb577['save']();};}function saveUpdates(_0x4bcbd6,_0x1fcf42){return function(_0x1eb66e){if(_0x1eb66e){return _0x1eb66e[_0x9791('0x23')](_0x4bcbd6)[_0x9791('0x24')](function(_0x3294a9){return _0x3294a9;});}return null;};}function removeEntity(_0x392a87,_0x1ea05b){return function(_0x46cf2f){if(_0x46cf2f){return _0x46cf2f[_0x9791('0x25')]()[_0x9791('0x24')](function(){_0x392a87[_0x9791('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1338,_0xe032a){return function(_0x481845){if(!_0x481845){_0x2b1338[_0x9791('0x17')](0x194);}return _0x481845;};}function handleError(_0x2adf38,_0x1c70af){_0x1c70af=_0x1c70af||0x1f4;return function(_0x1b4ace){logger[_0x9791('0x26')](_0x1b4ace[_0x9791('0x27')]);if(_0x1b4ace[_0x9791('0x28')]){delete _0x1b4ace['name'];}_0x2adf38[_0x9791('0x18')](_0x1c70af)['send'](_0x1b4ace);};}exports[_0x9791('0x29')]=function(_0x2e9fbb,_0x1bafe3){var _0x55d741={},_0x2ed874={},_0x5e0d68={'count':0x0,'rows':[]};var _0x3c453b=_[_0x9791('0x2a')](db[_0x9791('0x2b')][_0x9791('0x2c')],function(_0x2cd647){return{'name':_0x2cd647[_0x9791('0x2d')],'type':_0x2cd647['type'][_0x9791('0x2e')]};});_0x2ed874['model']=_[_0x9791('0x2a')](_0x3c453b,_0x9791('0x28'));_0x2ed874[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x2e9fbb['query']);_0x2ed874[_0x9791('0x31')]=_['intersection'](_0x2ed874[_0x9791('0x32')],_0x2ed874[_0x9791('0x2f')]);_0x55d741[_0x9791('0x33')]=_[_0x9791('0x34')](_0x2ed874['model'],qs[_0x9791('0x35')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x35')]));_0x55d741[_0x9791('0x33')]=_0x55d741[_0x9791('0x33')][_0x9791('0x36')]?_0x55d741[_0x9791('0x33')]:_0x2ed874[_0x9791('0x32')];if(!_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x37')](_0x9791('0x38'))){_0x55d741['limit']=qs['limit'](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1d')]);_0x55d741['offset']=qs[_0x9791('0x1b')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1b')]);}_0x55d741[_0x9791('0x39')]=qs[_0x9791('0x3a')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x3a')]);_0x55d741[_0x9791('0x3b')]=qs[_0x9791('0x31')](_[_0x9791('0x3c')](_0x2e9fbb[_0x9791('0x2f')],_0x2ed874[_0x9791('0x31')]),_0x3c453b);if(_0x2e9fbb[_0x9791('0x2f')]['filter']){_0x55d741[_0x9791('0x3b')]=_['merge'](_0x55d741[_0x9791('0x3b')],{'$or':_[_0x9791('0x2a')](_0x3c453b,function(_0x48e1b3){if(_0x48e1b3[_0x9791('0x3d')]!=='VIRTUAL'){var _0x206f14={};_0x206f14[_0x48e1b3[_0x9791('0x28')]]={'$like':'%'+_0x2e9fbb['query'][_0x9791('0x3e')]+'%'};return _0x206f14;}})});}_0x55d741=_[_0x9791('0x3f')]({},_0x55d741,_0x2e9fbb[_0x9791('0x40')]);var _0x349cbd={'where':_0x55d741[_0x9791('0x3b')]};return db[_0x9791('0x2b')]['count'](_0x349cbd)[_0x9791('0x24')](function(_0x5cb980){_0x5e0d68[_0x9791('0x1e')]=_0x5cb980;if(_0x2e9fbb['query']['includeAll']){_0x55d741[_0x9791('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9791('0x42')](_0x55d741);})[_0x9791('0x24')](function(_0x2c4511){_0x5e0d68[_0x9791('0x43')]=_0x2c4511;return _0x5e0d68;})[_0x9791('0x24')](respondWithFilteredResult(_0x1bafe3,_0x55d741))[_0x9791('0x44')](handleError(_0x1bafe3,null));};exports[_0x9791('0x45')]=function(_0x21242e,_0x6512a8){var _0x5de9d8={'raw':!![],'where':{'id':_0x21242e[_0x9791('0x46')]['id']}},_0x4deca1={};_0x4deca1['model']=_[_0x9791('0x30')](db['ChatTransferReport'][_0x9791('0x2c')]);_0x4deca1[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x21242e[_0x9791('0x2f')]);_0x4deca1[_0x9791('0x31')]=_[_0x9791('0x34')](_0x4deca1[_0x9791('0x32')],_0x4deca1['query']);_0x5de9d8[_0x9791('0x33')]=_['intersection'](_0x4deca1['model'],qs[_0x9791('0x35')](_0x21242e[_0x9791('0x2f')][_0x9791('0x35')]));_0x5de9d8[_0x9791('0x33')]=_0x5de9d8[_0x9791('0x33')][_0x9791('0x36')]?_0x5de9d8[_0x9791('0x33')]:_0x4deca1['model'];if(_0x21242e['query'][_0x9791('0x47')]){_0x5de9d8['include']=[{'all':!![]}];}_0x5de9d8=_[_0x9791('0x3f')]({},_0x5de9d8,_0x21242e[_0x9791('0x40')]);return db[_0x9791('0x2b')]['find'](_0x5de9d8)[_0x9791('0x24')](handleEntityNotFound(_0x6512a8,null))[_0x9791('0x24')](respondWithResult(_0x6512a8,null))[_0x9791('0x44')](handleError(_0x6512a8,null));};exports['create']=function(_0x230522,_0x29dc19){return db[_0x9791('0x2b')][_0x9791('0x48')](_0x230522[_0x9791('0x49')],{})[_0x9791('0x24')](respondWithResult(_0x29dc19,0xc9))['catch'](handleError(_0x29dc19,null));};exports[_0x9791('0x23')]=function(_0x239682,_0x227314){if(_0x239682[_0x9791('0x49')]['id']){delete _0x239682[_0x9791('0x49')]['id'];}return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x239682[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x227314,null))[_0x9791('0x24')](saveUpdates(_0x239682[_0x9791('0x49')],null))[_0x9791('0x24')](respondWithResult(_0x227314,null))[_0x9791('0x44')](handleError(_0x227314,null));};exports['destroy']=function(_0x5d836c,_0x2affe5){return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x5d836c[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x2affe5,null))['then'](removeEntity(_0x2affe5,null))[_0x9791('0x44')](handleError(_0x2affe5,null));};exports[_0x9791('0x4b')]=function(_0x411208,_0x10aeff){return db[_0x9791('0x2b')][_0x9791('0x4b')]()[_0x9791('0x24')](respondWithResult(_0x10aeff,null))[_0x9791('0x44')](handleError(_0x10aeff,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index d7f305e..278fb20 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 _0xcdc9=['../../config/environment','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x188dbb,_0x1d7d93){var _0x5d6e30=function(_0x4748e2){while(--_0x4748e2){_0x188dbb['push'](_0x188dbb['shift']());}};_0x5d6e30(++_0x1d7d93);}(_0xcdc9,0x19f));var _0x9cdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdc9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x9cdc('0x0'));var util=require(_0x9cdc('0x1'));var logger=require(_0x9cdc('0x2'))('api');var moment=require(_0x9cdc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cdc('0x4'));var rimraf=require('rimraf');var config=require(_0x9cdc('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0x9cdc('0x6')]=function(_0x57a088,_0x2331d8){return _0x57a088[_0x9cdc('0x7')]('ChatTransferReport',attributes,{'tableName':_0x9cdc('0x8'),'paranoid':![],'indexes':[{'name':_0x9cdc('0x9'),'fields':[_0x9cdc('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xece2=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x4b41d7,_0x281be8){var _0x52eecd=function(_0x491658){while(--_0x491658){_0x4b41d7['push'](_0x4b41d7['shift']());}};_0x52eecd(++_0x281be8);}(_0xece2,0x79));var _0x2ece=function(_0x3b3e4c,_0x1a90b7){_0x3b3e4c=_0x3b3e4c-0x0;var _0x53f518=_0xece2[_0x3b3e4c];return _0x53f518;};'use strict';var _=require(_0x2ece('0x0'));var util=require('util');var logger=require(_0x2ece('0x1'))('api');var moment=require(_0x2ece('0x2'));var BPromise=require('bluebird');var rp=require(_0x2ece('0x3'));var fs=require('fs');var path=require(_0x2ece('0x4'));var rimraf=require(_0x2ece('0x5'));var config=require(_0x2ece('0x6'));var attributes=require(_0x2ece('0x7'));module[_0x2ece('0x8')]=function(_0x142ffd,_0x45e030){return _0x142ffd[_0x2ece('0x9')](_0x2ece('0xa'),attributes,{'tableName':_0x2ece('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ece('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 a85cfe6..59fd3ac 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 _0x4e3b=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4cf8ff,_0x48eafe){var _0x13fa12=function(_0x270923){while(--_0x270923){_0x4cf8ff['push'](_0x4cf8ff['shift']());}};_0x13fa12(++_0x48eafe);}(_0x4e3b,0x15c));var _0xb4e3=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x4e3b[_0x29632e];return _0x426e04;};'use strict';var _=require(_0xb4e3('0x0'));var util=require(_0xb4e3('0x1'));var moment=require(_0xb4e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4e3('0x4'))['db'];var utils=require(_0xb4e3('0x5'));var logger=require('../../config/logger')(_0xb4e3('0x6'));var config=require(_0xb4e3('0x7'));var jayson=require(_0xb4e3('0x8'));var client=jayson['client'][_0xb4e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16ee9a,_0x25cd72,_0x5e91df){return new BPromise(function(_0x4dd862,_0x48d9b3){return client[_0xb4e3('0xa')](_0x16ee9a,_0x5e91df)[_0xb4e3('0xb')](function(_0x3784bb){logger[_0xb4e3('0xc')](_0xb4e3('0xd'),_0x25cd72,_0xb4e3('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x25cd72,'request\x20sent',JSON[_0xb4e3('0xf')](_0x3784bb));if(_0x3784bb[_0xb4e3('0x10')]){if(_0x3784bb[_0xb4e3('0x10')]['code']===0x1f4){logger[_0xb4e3('0x10')](_0xb4e3('0xd'),_0x25cd72,_0x3784bb['error']['message']);return _0x48d9b3(_0x3784bb[_0xb4e3('0x10')][_0xb4e3('0x11')]);}logger[_0xb4e3('0x10')](_0xb4e3('0xd'),_0x25cd72,_0x3784bb[_0xb4e3('0x10')][_0xb4e3('0x11')]);return _0x4dd862(_0x3784bb['error'][_0xb4e3('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x25cd72,'request\x20sent');_0x4dd862(_0x3784bb[_0xb4e3('0x12')][_0xb4e3('0x11')]);}})[_0xb4e3('0x13')](function(_0x464628){logger[_0xb4e3('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x25cd72,_0x464628);_0x48d9b3(_0x464628);});});}
\ No newline at end of file
+var _0xcd89=['debug','stringify','error','code','message','catch','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xcd89,0xde));var _0x9cd8=function(_0x5a2e1d,_0x301293){_0x5a2e1d=_0x5a2e1d-0x0;var _0xdde36f=_0xcd89[_0x5a2e1d];return _0xdde36f;};'use strict';var _=require(_0x9cd8('0x0'));var util=require('util');var moment=require(_0x9cd8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cd8('0x2'))['db'];var utils=require(_0x9cd8('0x3'));var logger=require('../../config/logger')(_0x9cd8('0x4'));var config=require(_0x9cd8('0x5'));var jayson=require(_0x9cd8('0x6'));var client=jayson['client'][_0x9cd8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d87ac,_0x5b47d1,_0xab85ad){return new BPromise(function(_0x456420,_0x19b443){return client[_0x9cd8('0x8')](_0x3d87ac,_0xab85ad)[_0x9cd8('0x9')](function(_0x2041b7){logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));logger[_0x9cd8('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b47d1,'request\x20sent',JSON[_0x9cd8('0xd')](_0x2041b7));if(_0x2041b7[_0x9cd8('0xe')]){if(_0x2041b7['error'][_0x9cd8('0xf')]===0x1f4){logger[_0x9cd8('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5b47d1,_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);return _0x19b443(_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);}logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x2041b7[_0x9cd8('0xe')]['message']);return _0x456420(_0x2041b7[_0x9cd8('0xe')]['message']);}else{logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));_0x456420(_0x2041b7['result'][_0x9cd8('0x10')]);}})[_0x9cd8('0x11')](function(_0x5b1061){logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x5b1061);_0x19b443(_0x5b1061);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 4fcb91e..436e6c1 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 _0xd0be=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','delete','destroy'];(function(_0x572bc3,_0xc1b9e1){var _0x1d6401=function(_0x5bfb49){while(--_0x5bfb49){_0x572bc3['push'](_0x572bc3['shift']());}};_0x1d6401(++_0xc1b9e1);}(_0xd0be,0x155));var _0xed0b=function(_0x164d16,_0x2f39a9){_0x164d16=_0x164d16-0x0;var _0x2cff6b=_0xd0be[_0x164d16];return _0x2cff6b;};'use strict';var multer=require(_0xed0b('0x0'));var util=require(_0xed0b('0x1'));var path=require(_0xed0b('0x2'));var timeout=require(_0xed0b('0x3'));var express=require(_0xed0b('0x4'));var router=express[_0xed0b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed0b('0x7'));var controller=require(_0xed0b('0x8'));router[_0xed0b('0x9')]('/',auth['isAuthenticated'](),controller[_0xed0b('0xa')]);router[_0xed0b('0x9')]('/describe',auth[_0xed0b('0xb')](),controller[_0xed0b('0xc')]);router['get'](_0xed0b('0xd'),auth[_0xed0b('0xb')](),controller[_0xed0b('0xe')]);router[_0xed0b('0xf')]('/',auth[_0xed0b('0xb')](),controller['create']);router['put'](_0xed0b('0xd'),auth[_0xed0b('0xb')](),controller[_0xed0b('0x10')]);router[_0xed0b('0x11')](_0xed0b('0xd'),auth['isAuthenticated'](),controller[_0xed0b('0x12')]);module[_0xed0b('0x13')]=router;
\ No newline at end of file
+var _0x3fee=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x2c398d,_0x1fc888){var _0x29e856=function(_0x149dc4){while(--_0x149dc4){_0x2c398d['push'](_0x2c398d['shift']());}};_0x29e856(++_0x1fc888);}(_0x3fee,0x11f));var _0xe3fe=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3fee[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xe3fe('0x0'));var util=require(_0xe3fe('0x1'));var path=require(_0xe3fe('0x2'));var timeout=require(_0xe3fe('0x3'));var express=require(_0xe3fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe3fe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xe3fe('0x6')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x8')]);router[_0xe3fe('0x6')](_0xe3fe('0x9'),auth['isAuthenticated'](),controller[_0xe3fe('0xa')]);router[_0xe3fe('0x6')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xc')]);router[_0xe3fe('0xd')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xe')]);router[_0xe3fe('0xf')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x10')]);router[_0xe3fe('0x11')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller['destroy']);module[_0xe3fe('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 589e130..ed4959c 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 _0xf93e=['STRING','address','email','#011F6A','#ffffff','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','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!','BOOLEAN','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xf93e,0x94));var _0xef93=function(_0xa58627,_0x55cd20){_0xa58627=_0xa58627-0x0;var _0x581f40=_0xf93e[_0xa58627];return _0x581f40;};'use strict';var Sequelize=require(_0xef93('0x0'));var rs=require('randomstring');module[_0xef93('0x1')]={'name':{'type':Sequelize[_0xef93('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'unique':_0xef93('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x4')},'mapKeyOffline':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x4')},'key':{'type':Sequelize[_0xef93('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef93('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xef93('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xef93('0x7')]('rounded',_0xef93('0x8')),'defaultValue':_0xef93('0x9')},'header_online':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0xb')},'offline_chat_button':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xef93('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x14')},'placeholderMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x15')},'closingMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x16')},'closingMessageButton':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0xc')},'skipMessageButton':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x18')},'ratingType':{'type':Sequelize[_0xef93('0x7')](_0xef93('0x19'),_0xef93('0x1a')),'defaultValue':_0xef93('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return JSON[_0xef93('0x1b')]({'items':[{'type':_0xef93('0x1c'),'variable':null,'config':{'placeholder':_0xef93('0x1d'),'type':_0xef93('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xef93('0x1c'),'props':{'title':_0xef93('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xef93('0x4'),'type':_0xef93('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xef93('0x1f')](_0xef93('0x20'))?JSON[_0xef93('0x21')](this[_0xef93('0x1f')](_0xef93('0x20'))):{};},'set':function(_0x4f93fe){return this['setDataValue']('onlineForm',JSON[_0xef93('0x1b')](_0x4f93fe));}},'offlineForm':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xef93('0x1c'),'props':{'title':_0xef93('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xef93('0x4'),'type':_0xef93('0x4')},'variable':null},{'type':_0xef93('0x22'),'config':{'placeholder':_0xef93('0x23')},'props':{'title':'Comments','helpText':_0xef93('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xef93('0x1f')](_0xef93('0x25'))?JSON[_0xef93('0x21')](this['getDataValue']('offlineForm')):{};},'set':function(_0x549b5e){return this[_0xef93('0x26')](_0xef93('0x25'),JSON['stringify'](_0x549b5e));}},'token':{'type':Sequelize[_0xef93('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xef93('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xef93('0x2')]},'waitingTitle':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x28')},'offlineMessageBody':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xef93('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xef93('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xef93('0x2')]},'notificationTemplate':{'type':Sequelize[_0xef93('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xef93('0x17')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xef93('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xef93('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xef93('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef93('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xef93('0x2')],'defaultValue':_0xef93('0x2c')},'systemAvatar':{'type':Sequelize[_0xef93('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef93('0xe')],'comment':_0xef93('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef93('0x2e'),'set':function(_0x29c470){if(!_0x29c470)this['setDataValue'](_0xef93('0x2f'),null);this[_0xef93('0x26')](_0xef93('0x30'),_0x29c470);}},'vidaooEscalation':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xef93('0x2')]},'vidaooTopic':{'type':Sequelize[_0xef93('0x2')],'allowNull':![],'defaultValue':_0xef93('0x31')},'vidaooNote':{'type':Sequelize[_0xef93('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xef93('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xef93('0x17')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xef93('0x10')]}};
\ No newline at end of file
+var _0x16dd=['Chat','Send','Contact\x20us','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','TEXT','name','text','input','getDataValue','onlineForm','parse','stringify','textarea','Comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','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}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!'];(function(_0x4f0b97,_0x3ff57b){var _0x4d24b3=function(_0x5333fe){while(--_0x5333fe){_0x4f0b97['push'](_0x4f0b97['shift']());}};_0x4d24b3(++_0x3ff57b);}(_0x16dd,0x144));var _0xd16d=function(_0x4cb048,_0x3eeba5){_0x4cb048=_0x4cb048-0x0;var _0x278aaf=_0x16dd[_0x4cb048];return _0x278aaf;};'use strict';var Sequelize=require(_0xd16d('0x0'));var rs=require('randomstring');module[_0xd16d('0x1')]={'name':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![],'unique':_0xd16d('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'key':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x5')},'customerAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd16d('0xa')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xe')},'download_transcript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xf')},'closingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x10')},'closingMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'skipMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0x11')},'ratingType':{'type':Sequelize[_0xd16d('0xa')]('star',_0xd16d('0x12')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd16d('0x14'),'type':_0xd16d('0x15'),'required':!![]},'props':{'title':_0xd16d('0x14'),'helpText':''}},{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':_0xd16d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd16d('0x17')](_0xd16d('0x18'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x18'))):{};},'set':function(_0x27d3e4){return this['setDataValue'](_0xd16d('0x18'),JSON[_0xd16d('0x1a')](_0x27d3e4));}},'offlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON[_0xd16d('0x1a')]({'items':[{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':'email'},'variable':null},{'type':_0xd16d('0x1b'),'config':{'placeholder':_0xd16d('0x1c')},'props':{'title':_0xd16d('0x1c'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd16d('0x1d'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x1d'))):{};},'set':function(_0x1d5e0c){return this[_0xd16d('0x1e')](_0xd16d('0x1d'),JSON[_0xd16d('0x1a')](_0x1d5e0c));}},'token':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd16d('0x2')]},'forwardOffline':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd16d('0x2')]},'waitingTitle':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x1f')},'waitingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x21')},'offlineMessageBody':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x23')},'skipUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x24')},'sendUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd16d('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd16d('0x25');}},'notificationSound':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x27')},'verticalAlignment':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x28')},'defaultTitle':{'type':Sequelize[_0xd16d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x2a')},'systemAvatar':{'type':Sequelize[_0xd16d('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd16d('0x8')],'comment':_0xd16d('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd16d('0x2c'),'set':function(_0x4a33ba){if(!_0x4a33ba)this[_0xd16d('0x1e')]('mandatoryDispositionPauseId',null);this[_0xd16d('0x1e')](_0xd16d('0x2d'),_0x4a33ba);}},'vidaooEscalation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd16d('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x2e')},'vidaooNote':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return _0xd16d('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd16d('0x13')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index e6a038b..3013270 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 _0xf43e=['Applications','account','applications','list','orderBy','customerIp','headers','cf-connecting-ip','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','contact','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-forwarded-for','connection','remoteAddress','replace','render','alignment','color','textColor','color_button','backgroundColor','addApplications','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../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','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','findOne','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','user-agent-parser','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0xf43e,0x1c7));var _0xef43=function(_0x3c980f,_0x7c2386){_0x3c980f=_0x3c980f-0x0;var _0x10733f=_0xf43e[_0x3c980f];return _0x10733f;};'use strict';var emlformat=require(_0xef43('0x0'));var rimraf=require(_0xef43('0x1'));var zipdir=require(_0xef43('0x2'));var jsonpatch=require(_0xef43('0x3'));var rp=require(_0xef43('0x4'));var moment=require(_0xef43('0x5'));var BPromise=require(_0xef43('0x6'));var Mustache=require(_0xef43('0x7'));var util=require('util');var path=require(_0xef43('0x8'));var sox=require(_0xef43('0x9'));var csv=require(_0xef43('0xa'));var ejs=require(_0xef43('0xb'));var fs=require('fs');var fs_extra=require(_0xef43('0xc'));var _=require('lodash');var squel=require(_0xef43('0xd'));var crypto=require('crypto');var jsforce=require(_0xef43('0xe'));var deskjs=require(_0xef43('0xf'));var toCsv=require(_0xef43('0xa'));var querystring=require(_0xef43('0x10'));var Papa=require(_0xef43('0x11'));var Redis=require(_0xef43('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xef43('0x13'));var hardwareService=require(_0xef43('0x14'));var logger=require(_0xef43('0x15'))(_0xef43('0x16'));var utils=require(_0xef43('0x17'));var config=require(_0xef43('0x18'));var licenseUtil=require(_0xef43('0x19'));var db=require(_0xef43('0x1a'))['db'];config[_0xef43('0x1b')]=_[_0xef43('0x1c')](config[_0xef43('0x1b')],{'host':_0xef43('0x1d'),'port':0x18eb});var socket=require(_0xef43('0x1e'))(new Redis(config[_0xef43('0x1b')]));require(_0xef43('0x1f'))[_0xef43('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xef43('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0xef43('0x22')]({'port':0x232a});var client9003=jayson[_0xef43('0x21')]['http']({'port':0x232b});var client9001=jayson[_0xef43('0x21')][_0xef43('0x22')]({'port':0x2329});function respondWithRpcPromise(_0xacc112,_0x1f4c3,_0x5b30a6,_0x1b1bc3){return new BPromise(function(_0x2157ca,_0x260c75){var _0x565c81=_0x1b1bc3||client;return _0x565c81['request'](_0xacc112,_0x5b30a6)[_0xef43('0x23')](function(_0x5646f7){logger[_0xef43('0x24')](_0xef43('0x25'),_0x1f4c3,_0xef43('0x26'));logger['debug'](_0xef43('0x27'),_0x1f4c3,'request\x20sent',JSON[_0xef43('0x28')](_0x5646f7));if(_0x5646f7[_0xef43('0x29')]){if(_0x5646f7[_0xef43('0x29')][_0xef43('0x2a')]===0x1f4){logger[_0xef43('0x29')](_0xef43('0x25'),_0x1f4c3,_0x5646f7[_0xef43('0x29')]['message']);return _0x260c75(_0x5646f7[_0xef43('0x29')][_0xef43('0x2b')]);}logger['error'](_0xef43('0x25'),_0x1f4c3,_0x5646f7[_0xef43('0x29')][_0xef43('0x2b')]);return _0x2157ca(_0x5646f7[_0xef43('0x29')]['message']);}else{logger[_0xef43('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1f4c3,_0xef43('0x26'));_0x2157ca(_0x5646f7[_0xef43('0x2c')][_0xef43('0x2b')]);}})[_0xef43('0x2d')](function(_0x200aaf){logger['error'](_0xef43('0x25'),_0x1f4c3,_0x200aaf);_0x260c75(_0x200aaf);});});}function respondWithStatusCode(_0x2f9979,_0x3eff93){_0x3eff93=_0x3eff93||0xcc;return function(_0xfb9cab){if(_0xfb9cab){return _0x2f9979[_0xef43('0x2e')](_0x3eff93);}return _0x2f9979[_0xef43('0x2f')](_0x3eff93)[_0xef43('0x30')]();};}function respondWithResult(_0x49f132,_0x27a1d9){_0x27a1d9=_0x27a1d9||0xc8;return function(_0x1b0ed9){if(_0x1b0ed9){return _0x49f132['status'](_0x27a1d9)[_0xef43('0x31')](_0x1b0ed9);}};}function respondWithFilteredResult(_0x158e7b,_0x23575c){return function(_0x5b5918){if(_0x5b5918){var _0x36c018=typeof _0x23575c['offset']===_0xef43('0x32')&&typeof _0x23575c[_0xef43('0x33')]===_0xef43('0x32');var _0xefd7f9=_0x5b5918['count'];var _0x370807=_0x36c018?0x0:_0x23575c[_0xef43('0x34')];var _0x3bbda0=_0x36c018?_0x5b5918[_0xef43('0x35')]:_0x23575c[_0xef43('0x34')]+_0x23575c['limit'];var _0x228a4f;if(_0x3bbda0>=_0xefd7f9){_0x3bbda0=_0xefd7f9;_0x228a4f=0xc8;}else{_0x228a4f=0xce;}_0x158e7b['status'](_0x228a4f);return _0x158e7b[_0xef43('0x36')]('Content-Range',_0x370807+'-'+_0x3bbda0+'/'+_0xefd7f9)['json'](_0x5b5918);}return null;};}function patchUpdates(_0xd558a0){return function(_0x30ee25){try{jsonpatch[_0xef43('0x37')](_0x30ee25,_0xd558a0,!![]);}catch(_0x26bac4){return BPromise[_0xef43('0x38')](_0x26bac4);}return _0x30ee25[_0xef43('0x39')]();};}function saveUpdates(_0x274c91,_0x49117c){return function(_0x2bc110){if(_0x2bc110){return _0x2bc110[_0xef43('0x3a')](_0x274c91)[_0xef43('0x23')](function(_0x177f47){return _0x177f47;});}return null;};}function removeEntity(_0x2d9d9a,_0x20f7a){return function(_0x47b6af){if(_0x47b6af){return _0x47b6af[_0xef43('0x3b')]()['then'](function(){var _0x17162f=_0x47b6af['get']({'plain':!![]});var _0x323442=_0xef43('0x3c');return db[_0xef43('0x3d')]['destroy']({'where':{'type':_0x323442,'resourceId':_0x17162f['id']}})[_0xef43('0x23')](function(){return _0x47b6af;});})[_0xef43('0x23')](function(){_0x2d9d9a[_0xef43('0x2f')](0xcc)[_0xef43('0x30')]();});}};}function handleEntityNotFound(_0x4585b9,_0x58fde9){return function(_0x226e2f){if(!_0x226e2f){_0x4585b9['sendStatus'](0x194);}return _0x226e2f;};}function handleError(_0x29f89f,_0x13904c){_0x13904c=_0x13904c||0x1f4;return function(_0x15ba4a){logger['error'](_0x15ba4a['stack']);if(_0x15ba4a[_0xef43('0x3e')]){delete _0x15ba4a[_0xef43('0x3e')];}_0x29f89f['status'](_0x13904c)[_0xef43('0x3f')](_0x15ba4a);};}exports[_0xef43('0x40')]=function(_0x1d7374,_0x280632){var _0x47e894={'include':[{'model':db[_0xef43('0x41')],'as':_0xef43('0x42')}]},_0x5bd1ff={},_0x34dd4f={'count':0x0,'rows':[]};var _0x4c0a84=_[_0xef43('0x43')](db[_0xef43('0x44')][_0xef43('0x45')],function(_0x5000cd){return{'name':_0x5000cd[_0xef43('0x46')],'type':_0x5000cd[_0xef43('0x47')][_0xef43('0x48')]};});_0x5bd1ff[_0xef43('0x49')]=_[_0xef43('0x43')](_0x4c0a84,_0xef43('0x3e'));_0x5bd1ff['query']=_['keys'](_0x1d7374[_0xef43('0x4a')]);_0x5bd1ff[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x5bd1ff[_0xef43('0x49')],_0x5bd1ff['query']);_0x47e894[_0xef43('0x4d')]=_['intersection'](_0x5bd1ff['model'],qs[_0xef43('0x4e')](_0x1d7374['query']['fields']));_0x47e894[_0xef43('0x4d')]=_0x47e894['attributes'][_0xef43('0x4f')]?_0x47e894[_0xef43('0x4d')]:_0x5bd1ff['model'];if(!_0x1d7374[_0xef43('0x4a')]['hasOwnProperty'](_0xef43('0x50'))){_0x47e894[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x1d7374[_0xef43('0x4a')]['limit']);_0x47e894[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x1d7374[_0xef43('0x4a')]['offset']);}_0x47e894[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x1d7374['query'][_0xef43('0x52')]);_0x47e894['where']=qs['filters'](_[_0xef43('0x53')](_0x1d7374[_0xef43('0x4a')],_0x5bd1ff[_0xef43('0x4b')]),_0x4c0a84);if(_0x1d7374[_0xef43('0x4a')][_0xef43('0x54')]){_0x47e894[_0xef43('0x55')]=_['merge'](_0x47e894[_0xef43('0x55')],{'$or':_['map'](_0x4c0a84,function(_0x35f00f){if(_0x35f00f[_0xef43('0x47')]!=='VIRTUAL'){var _0x3e9a05={};_0x3e9a05[_0x35f00f['name']]={'$like':'%'+_0x1d7374[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x3e9a05;}})});}_0x47e894=_[_0xef43('0x56')]({},_0x47e894,_0x1d7374[_0xef43('0x57')]);var _0x3d6731={'where':_0x47e894[_0xef43('0x55')]};return db[_0xef43('0x44')]['count'](_0x3d6731)[_0xef43('0x23')](function(_0xa929c2){_0x34dd4f[_0xef43('0x35')]=_0xa929c2;if(_0x1d7374[_0xef43('0x4a')][_0xef43('0x58')]){_0x47e894[_0xef43('0x59')]=[{'all':!![]}];}return db[_0xef43('0x44')]['findAll'](_0x47e894);})[_0xef43('0x23')](function(_0x406d21){_0x34dd4f[_0xef43('0x5a')]=_0x406d21;return _0x34dd4f;})['then'](respondWithFilteredResult(_0x280632,_0x47e894))[_0xef43('0x2d')](handleError(_0x280632,null));};exports['show']=function(_0x36cfe0,_0x2b59bb){var _0x542428={'raw':![],'where':{'id':_0x36cfe0[_0xef43('0x5b')]['id']},'include':[{'model':db[_0xef43('0x41')],'as':_0xef43('0x42')}]},_0xf5cce9={};_0xf5cce9[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x44')][_0xef43('0x45')]);_0xf5cce9[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x36cfe0[_0xef43('0x4a')]);_0xf5cce9['filters']=_['intersection'](_0xf5cce9[_0xef43('0x49')],_0xf5cce9[_0xef43('0x4a')]);_0x542428[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0xf5cce9['model'],qs['fields'](_0x36cfe0['query'][_0xef43('0x4e')]));_0x542428[_0xef43('0x4d')]=_0x542428[_0xef43('0x4d')][_0xef43('0x4f')]?_0x542428[_0xef43('0x4d')]:_0xf5cce9[_0xef43('0x49')];if(_0x36cfe0[_0xef43('0x4a')]['includeAll']){_0x542428['include']=[{'all':!![]}];}_0x542428=_['merge']({},_0x542428,_0x36cfe0['options']);return db[_0xef43('0x44')]['find'](_0x542428)[_0xef43('0x23')](handleEntityNotFound(_0x2b59bb,null))[_0xef43('0x23')](respondWithResult(_0x2b59bb,null))[_0xef43('0x2d')](handleError(_0x2b59bb,null));};exports[_0xef43('0x5d')]=function(_0x48fc9d,_0x2e0c60){return db['ChatWebsite'][_0xef43('0x5d')](_0x48fc9d[_0xef43('0x5e')],{})[_0xef43('0x23')](function(_0x4fca79){var _0x373910=_0x48fc9d[_0xef43('0x5f')][_0xef43('0x60')]({'plain':!![]});if(!_0x373910)throw new Error(_0xef43('0x61'));if(_0x373910[_0xef43('0x62')]===_0xef43('0x5f')){var _0x5b77ee=_0x4fca79[_0xef43('0x60')]({'plain':!![]});var _0x39ae9e=_0xef43('0x3c');return db[_0xef43('0x63')][_0xef43('0x64')]({'where':{'name':_0x39ae9e,'userProfileId':_0x373910[_0xef43('0x65')]},'raw':!![]})[_0xef43('0x23')](function(_0x4bd50b){if(_0x4bd50b&&_0x4bd50b[_0xef43('0x66')]===0x0){return db[_0xef43('0x3d')][_0xef43('0x5d')]({'name':_0x5b77ee[_0xef43('0x3e')],'resourceId':_0x5b77ee['id'],'type':_0x4bd50b[_0xef43('0x3e')],'sectionId':_0x4bd50b['id']},{})[_0xef43('0x23')](function(){return _0x4fca79;});}else{return _0x4fca79;}})[_0xef43('0x2d')](function(_0x1b8248){logger[_0xef43('0x29')](_0xef43('0x67'),_0x1b8248);throw _0x1b8248;});}return _0x4fca79;})[_0xef43('0x23')](respondWithResult(_0x2e0c60,0xc9))[_0xef43('0x2d')](handleError(_0x2e0c60,null));};exports['update']=function(_0x3485a5,_0x2752ac){if(_0x3485a5[_0xef43('0x5e')]['id']){delete _0x3485a5[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x3485a5[_0xef43('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2752ac,null))['then'](saveUpdates(_0x3485a5[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x2752ac,null))['catch'](handleError(_0x2752ac,null));};exports['destroy']=function(_0x18af37,_0x3995d7){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x18af37[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x3995d7,null))[_0xef43('0x23')](removeEntity(_0x3995d7,null))[_0xef43('0x2d')](handleError(_0x3995d7,null));};exports[_0xef43('0x68')]=function(_0x348735,_0x32814f){return db[_0xef43('0x44')][_0xef43('0x68')]()[_0xef43('0x23')](respondWithResult(_0x32814f,null))[_0xef43('0x2d')](handleError(_0x32814f,null));};exports['addDisposition']=function(_0xaa160f,_0x4f8e75,_0x3c4e15){if(_0xaa160f[_0xef43('0x5e')]['id']){delete _0xaa160f[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')]['find']({'where':{'id':_0xaa160f['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x4f8e75,null))['then'](function(_0x28fe29){if(_0x28fe29){_0xaa160f[_0xef43('0x5e')][_0xef43('0x69')]=_0x28fe29['id'];return db[_0xef43('0x6a')][_0xef43('0x5d')](_0xaa160f[_0xef43('0x5e')]);}})[_0xef43('0x23')](respondWithResult(_0x4f8e75,null))[_0xef43('0x2d')](handleError(_0x4f8e75,null));};exports['getDispositions']=function(_0x268949,_0x16fb58,_0x292f1f){var _0x4d3f87={'raw':![],'where':{}};var _0x14e9ad={};var _0x1a1a65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xef43('0x6b')]({'where':{'id':_0x268949[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16fb58,null))['then'](function(_0x29c304){if(_0x29c304){_0x14e9ad[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x6a')][_0xef43('0x45')]);_0x14e9ad[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x268949[_0xef43('0x4a')]);_0x14e9ad[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x14e9ad[_0xef43('0x49')],_0x14e9ad[_0xef43('0x4a')]);_0x4d3f87['attributes']=_['intersection'](_0x14e9ad['model'],qs[_0xef43('0x4e')](_0x268949[_0xef43('0x4a')][_0xef43('0x4e')]));_0x4d3f87[_0xef43('0x4d')]=_0x4d3f87['attributes'][_0xef43('0x4f')]?_0x4d3f87['attributes']:_0x14e9ad['model'];if(!_0x268949[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x4d3f87[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x268949[_0xef43('0x4a')]['limit']);_0x4d3f87[_0xef43('0x34')]=qs['offset'](_0x268949[_0xef43('0x4a')][_0xef43('0x34')]);}_0x4d3f87[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x268949[_0xef43('0x4a')][_0xef43('0x52')]);_0x4d3f87[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x268949[_0xef43('0x4a')],_0x14e9ad[_0xef43('0x4b')]));_0x4d3f87[_0xef43('0x55')][_0xef43('0x69')]=_0x29c304['id'];if(_0x268949['query']['filter']){_0x4d3f87[_0xef43('0x55')]=_[_0xef43('0x56')](_0x4d3f87['where'],{'$or':_[_0xef43('0x43')](_0x4d3f87[_0xef43('0x4d')],function(_0x39d243){var _0x31fe79={};_0x31fe79[_0x39d243]={'$like':'%'+_0x268949[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x31fe79;})});}_0x4d3f87=_[_0xef43('0x56')]({},_0x4d3f87,_0x268949[_0xef43('0x57')]);return db['Disposition']['count']({'where':_0x4d3f87[_0xef43('0x55')]})[_0xef43('0x23')](function(_0x34c9ac){_0x1a1a65['count']=_0x34c9ac;if(_0x268949[_0xef43('0x4a')][_0xef43('0x58')]){_0x4d3f87[_0xef43('0x59')]=[{'all':!![]}];}return db[_0xef43('0x6a')][_0xef43('0x6d')](_0x4d3f87);})[_0xef43('0x23')](function(_0x11f004){_0x1a1a65[_0xef43('0x5a')]=_0x11f004;return _0x1a1a65;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x16fb58,_0x4d3f87))['catch'](handleError(_0x16fb58,null));};exports['removeDispositions']=function(_0x5727c6,_0x622dba,_0x5067d9){return db['ChatWebsite']['find']({'where':{'id':_0x5727c6[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x622dba,null))[_0xef43('0x23')](function(_0xd23b94){if(_0xd23b94){return _0xd23b94[_0xef43('0x6e')](_0x5727c6[_0xef43('0x4a')][_0xef43('0x6f')]);}})[_0xef43('0x23')](respondWithStatusCode(_0x622dba,null))[_0xef43('0x2d')](handleError(_0x622dba,null));};exports[_0xef43('0x70')]=function(_0x4fe2b7,_0x26e360,_0x3ed7bf){if(_0x4fe2b7[_0xef43('0x5e')]['id']){delete _0x4fe2b7[_0xef43('0x5e')]['id'];}return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x4fe2b7['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x26e360,null))['then'](function(_0x24710f){if(_0x24710f){_0x4fe2b7[_0xef43('0x5e')][_0xef43('0x69')]=_0x24710f['id'];return db['CannedAnswer']['create'](_0x4fe2b7[_0xef43('0x5e')]);}})['then'](respondWithResult(_0x26e360,null))[_0xef43('0x2d')](handleError(_0x26e360,null));};exports[_0xef43('0x71')]=function(_0x275a44,_0x886a70,_0xb2af9){var _0x29034b={'raw':![],'where':{}};var _0x64b2b4={};var _0x4e3342={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x275a44[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x886a70,null))[_0xef43('0x23')](function(_0x26988a){if(_0x26988a){_0x64b2b4[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x72')][_0xef43('0x45')]);_0x64b2b4[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0x275a44[_0xef43('0x4a')]);_0x64b2b4[_0xef43('0x4b')]=_['intersection'](_0x64b2b4[_0xef43('0x49')],_0x64b2b4[_0xef43('0x4a')]);_0x29034b[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x64b2b4[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x275a44[_0xef43('0x4a')][_0xef43('0x4e')]));_0x29034b[_0xef43('0x4d')]=_0x29034b['attributes']['length']?_0x29034b[_0xef43('0x4d')]:_0x64b2b4[_0xef43('0x49')];if(!_0x275a44[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x29034b['limit']=qs[_0xef43('0x33')](_0x275a44[_0xef43('0x4a')][_0xef43('0x33')]);_0x29034b[_0xef43('0x34')]=qs['offset'](_0x275a44[_0xef43('0x4a')][_0xef43('0x34')]);}_0x29034b[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x275a44['query'][_0xef43('0x52')]);_0x29034b[_0xef43('0x55')]=qs['filters'](_['pick'](_0x275a44[_0xef43('0x4a')],_0x64b2b4[_0xef43('0x4b')]));_0x29034b[_0xef43('0x55')][_0xef43('0x69')]=_0x26988a['id'];if(_0x275a44['query'][_0xef43('0x54')]){_0x29034b['where']=_['merge'](_0x29034b[_0xef43('0x55')],{'$or':_['map'](_0x29034b['attributes'],function(_0x204686){var _0x13d5e8={};_0x13d5e8[_0x204686]={'$like':'%'+_0x275a44[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x13d5e8;})});}_0x29034b=_[_0xef43('0x56')]({},_0x29034b,_0x275a44[_0xef43('0x57')]);return db['CannedAnswer']['count']({'where':_0x29034b[_0xef43('0x55')]})[_0xef43('0x23')](function(_0x221382){_0x4e3342['count']=_0x221382;if(_0x275a44[_0xef43('0x4a')][_0xef43('0x58')]){_0x29034b[_0xef43('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0xef43('0x6d')](_0x29034b);})['then'](function(_0x4ed227){_0x4e3342[_0xef43('0x5a')]=_0x4ed227;return _0x4e3342;});}})['then'](respondWithFilteredResult(_0x886a70,_0x29034b))[_0xef43('0x2d')](handleError(_0x886a70,null));};exports[_0xef43('0x73')]=function(_0x2532b2,_0x2dbde3,_0x38b70d){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x2532b2[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x2dbde3,null))['then'](function(_0xf72e20){if(_0xf72e20){return _0xf72e20[_0xef43('0x73')](_0x2532b2[_0xef43('0x4a')]['ids']);}})[_0xef43('0x23')](respondWithStatusCode(_0x2dbde3,null))['catch'](handleError(_0x2dbde3,null));};exports['addLogo']=function(_0x52fec6,_0x49c602,_0x4d80f9){_0x52fec6[_0xef43('0x5e')][_0xef43('0x74')]=_0x52fec6[_0xef43('0x75')][_0xef43('0x76')];return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x52fec6[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x49c602,null))[_0xef43('0x23')](saveUpdates(_0x52fec6[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x49c602,null))[_0xef43('0x2d')](handleError(_0x49c602,null));};exports[_0xef43('0x77')]=function(_0x36fe72,_0x16aebf,_0x15a268){_0x36fe72[_0xef43('0x5e')][_0xef43('0x78')]=_0x36fe72[_0xef43('0x75')][_0xef43('0x76')];return db['ChatWebsite']['find']({'where':{'id':_0x36fe72[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x16aebf,null))['then'](saveUpdates(_0x36fe72[_0xef43('0x5e')],null))['then'](respondWithResult(_0x16aebf,null))[_0xef43('0x2d')](handleError(_0x16aebf,null));};exports[_0xef43('0x79')]=function(_0x40babe,_0x3dd709,_0x4ea999){_0x40babe[_0xef43('0x5e')][_0xef43('0x7a')]=_0x40babe['file'][_0xef43('0x76')];return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x40babe[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3dd709,null))['then'](saveUpdates(_0x40babe[_0xef43('0x5e')],null))['then'](respondWithResult(_0x3dd709,null))[_0xef43('0x2d')](handleError(_0x3dd709,null));};exports[_0xef43('0x7b')]=function(_0x86ea3c,_0x55bb4f,_0x2ca233){_0x86ea3c[_0xef43('0x5e')]['systemAvatar']=_0x86ea3c['file'][_0xef43('0x76')];return db[_0xef43('0x44')]['find']({'where':{'id':_0x86ea3c[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55bb4f,null))[_0xef43('0x23')](saveUpdates(_0x86ea3c[_0xef43('0x5e')],null))[_0xef43('0x23')](respondWithResult(_0x55bb4f,null))[_0xef43('0x2d')](handleError(_0x55bb4f,null));};exports[_0xef43('0x7c')]=function(_0xe4139f,_0x315b5d,_0x57b1cc){var _0x2f026c=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x7f'));var _0x4b1ec2={'where':{'id':_0xe4139f[_0xef43('0x5b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x46f5ba=![];return require(_0xef43('0x19'))[_0xef43('0x80')]()['then'](function(_0x27d269){if(_0x27d269){_0x46f5ba=_0x27d269[_0xef43('0x81')];}})['then'](function(){return db['ChatWebsite'][_0xef43('0x64')](_0x4b1ec2);})['then'](handleEntityNotFound(_0x315b5d,null))['then'](function(_0x297e07){if(_0x297e07){if(!_[_0xef43('0x82')](_0x297e07[_0xef43('0x74')])){if(fs[_0xef43('0x83')](path[_0xef43('0x7d')](config['root'],'server/files/images/logos/',_0x297e07[_0xef43('0x74')]))&&_0x46f5ba){_0x2f026c=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x84'),_0x297e07[_0xef43('0x74')]);}}return _0x315b5d[_0xef43('0x85')](_0x2f026c);}})[_0xef43('0x2d')](handleError(_0x315b5d,null));};exports[_0xef43('0x86')]=function(_0x1de6ff,_0x2c99ea,_0x4e9c3a){var _0x3ec9ae=path['join'](config[_0xef43('0x7e')],'server/files/images/avatars/default_avatar.png');var _0x2ea535={'where':{'id':_0x1de6ff[_0xef43('0x5b')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x2ea535)[_0xef43('0x23')](handleEntityNotFound(_0x2c99ea,null))[_0xef43('0x23')](function(_0x5b3637){if(_0x5b3637){if(!_[_0xef43('0x82')](_0x5b3637[_0xef43('0x78')])){if(fs['existsSync'](path['join'](config[_0xef43('0x7e')],_0xef43('0x87'),_0x5b3637[_0xef43('0x78')]))){_0x3ec9ae=path[_0xef43('0x7d')](config['root'],_0xef43('0x87'),_0x5b3637[_0xef43('0x78')]);}}return _0x2c99ea[_0xef43('0x85')](_0x3ec9ae);}})[_0xef43('0x2d')](handleError(_0x2c99ea,null));};exports[_0xef43('0x88')]=function(_0x169c11,_0x10c19d,_0x3c911f){var _0x48807f=path['join'](config[_0xef43('0x7e')],_0xef43('0x89'));var _0x3fea5c={'where':{'id':_0x169c11[_0xef43('0x5b')]['id']},'attributes':['id',_0xef43('0x7a'),_0xef43('0x8a')],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x3fea5c)['then'](handleEntityNotFound(_0x10c19d,null))[_0xef43('0x23')](function(_0x41a641){if(_0x41a641){if(!_[_0xef43('0x82')](_0x41a641['customerAvatar'])){if(fs[_0xef43('0x83')](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x41a641[_0xef43('0x7a')]))&&_0x41a641[_0xef43('0x8a')]){_0x48807f=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x41a641[_0xef43('0x7a')]);}}return _0x10c19d[_0xef43('0x85')](_0x48807f);}})[_0xef43('0x2d')](handleError(_0x10c19d,null));};exports['getSystemAvatar']=function(_0x1a8add,_0x39bbef,_0x18c8c3){var _0x1bc8d7=path[_0xef43('0x7d')](config[_0xef43('0x7e')],'server/files/images/avatars/system_avatar.png');var _0x329a85={'where':{'id':_0x1a8add[_0xef43('0x5b')]['id']},'attributes':['id',_0xef43('0x8b')],'raw':!![]};return db[_0xef43('0x44')][_0xef43('0x64')](_0x329a85)[_0xef43('0x23')](handleEntityNotFound(_0x39bbef,null))['then'](function(_0x32b1dd){if(_0x32b1dd){if(!_[_0xef43('0x82')](_0x32b1dd[_0xef43('0x8b')])){if(fs[_0xef43('0x83')](path['join'](config[_0xef43('0x7e')],_0xef43('0x87'),_0x32b1dd[_0xef43('0x8b')]))){_0x1bc8d7=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x87'),_0x32b1dd['systemAvatar']);}}return _0x39bbef[_0xef43('0x85')](_0x1bc8d7);}})[_0xef43('0x2d')](handleError(_0x39bbef,null));};exports['notify']=function(_0x1dd6ef,_0x277fc1,_0xa08434){var _0x44665b=require(_0xef43('0x8c'));var _0x130336=new _0x44665b();var _0x46fe9c=_0x130336['setUA'](_0x1dd6ef['headers']['user-agent'])[_0xef43('0x8d')]();var _0x5cd84f={'body':_0x1dd6ef['body'],'channel':_0xef43('0x8e')};var _0x400cd0=[];var _0x27f67b=[];var _0x4b1635={};var _0x36dbae=![];return db[_0xef43('0x8f')][_0xef43('0x68')]()[_0xef43('0x23')](function(_0x2633dd){if(!_0x2633dd){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x92'));}_0x400cd0=_[_0xef43('0x93')](_['keys'](_0x2633dd),['createdAt',_0xef43('0x94')]);_0x27f67b=_['difference'](_[_0xef43('0x5c')](_0x2633dd),[_0xef43('0x95'),_0xef43('0x94'),_0xef43('0x96'),_0xef43('0x97')]);if(_0x1dd6ef[_0xef43('0x5e')]['id']){delete _0x1dd6ef['body']['id'];}if(_[_0xef43('0x82')](_0x1dd6ef['body'][_0xef43('0x98')])){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x99'));}if(_[_0xef43('0x82')](_0x1dd6ef[_0xef43('0x5e')]['body'])||_0x1dd6ef['body'][_0xef43('0x5e')]===''){throw new db[(_0xef43('0x90'))][(_0xef43('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xef43('0x82')](_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x9a')])){throw new db[(_0xef43('0x90'))]['ValidationError'](_0xef43('0x9b')+_0x27f67b);}if(!_[_0xef43('0x9c')](_0x27f67b,_0x1dd6ef[_0xef43('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0xef43('0x91'))](_0xef43('0x9d')+_0x27f67b);}_0x4b1635[_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x9a')]]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0x98')];})[_0xef43('0x23')](function(){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x1dd6ef[_0xef43('0x5b')]['id']},'include':[{'model':db[_0xef43('0x9e')],'as':_0xef43('0x9f'),'include':[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xa0'),'where':_0x4b1635,'limit':0x1,'order':[[_0xef43('0x94'),_0xef43('0xa1')]]}]},{'model':db[_0xef43('0xa2')],'as':_0xef43('0xa3')}]});})[_0xef43('0x23')](handleEntityNotFound(_0x277fc1,null))[_0xef43('0x23')](function(_0x4de32e){if(_0x4de32e&&_0x4de32e['List']){_0x5cd84f[_0xef43('0xa4')]=_0x4de32e;_0x5cd84f[_0xef43('0xa5')]=_0x4de32e[_0xef43('0xa3')];_0x5cd84f[_0xef43('0xa6')]=_0x4de32e[_0xef43('0x9f')];_0x5cd84f[_0xef43('0xa5')]=_[_0xef43('0xa7')](_0x5cd84f['applications'],['priority'],['asc']);if(_0x5cd84f[_0xef43('0xa4')][_0xef43('0xa3')]){delete _0x5cd84f[_0xef43('0xa4')][_0xef43('0xa3')];}if(_0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')]&&_0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')][_0xef43('0xa0')][_0xef43('0x4f')]){return _0x5cd84f[_0xef43('0xa4')][_0xef43('0x9f')]['Contacts'][0x0];}var _0xf7c850=_[_0xef43('0x1c')](_0x1dd6ef[_0xef43('0x5e')],{'firstName':_0x1dd6ef[_0xef43('0x5e')]['from'],'ListId':_0x4de32e[_0xef43('0x97')]});_0xf7c850[_0x1dd6ef['body'][_0xef43('0x9a')]]=_0x1dd6ef['body'][_0xef43('0x98')];return db[_0xef43('0x8f')][_0xef43('0x5d')](_0xf7c850,{'fields':_0x400cd0,'raw':!![]});}})[_0xef43('0x23')](handleEntityNotFound(_0x277fc1,null))[_0xef43('0x23')](function(_0x5b6cd5){_0x5cd84f['contact']=_0x5b6cd5;var _0x17f862=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xa8')];if(_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xaa')]){_0x17f862=_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xaa')];}else if(_0x1dd6ef[_0xef43('0xa9')]['x-forwarded-for']){_0x17f862=_['first'](_0x1dd6ef[_0xef43('0xa9')]['x-forwarded-for']['split'](','));}if(_0x5b6cd5){var _0x9e8494={'ContactId':_0x5b6cd5['id'],'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'from':(_0x5b6cd5[_0xef43('0xab')]||'')+'\x20'+(_0x5b6cd5[_0xef43('0xac')]||''),'customerIp':_0x17f862,'customerPort':_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xad')]?_0x1dd6ef[_0xef43('0xa9')][_0xef43('0xad')]:null,'referer':_0x1dd6ef[_0xef43('0x5e')]['referer'],'browserName':_0x46fe9c[_0xef43('0xae')][_0xef43('0x3e')]&&_0x46fe9c[_0xef43('0xae')][_0xef43('0xaf')]?util[_0xef43('0xb0')]('%s\x20%s',_0x46fe9c[_0xef43('0xae')][_0xef43('0x3e')],_0x46fe9c[_0xef43('0xae')][_0xef43('0xaf')]):_0xef43('0xb1'),'browserVersion':_0x46fe9c['browser']['version']||_0xef43('0xb1'),'osName':util[_0xef43('0xb0')](_0xef43('0xb2'),_0x46fe9c['os'][_0xef43('0x3e')],_0x46fe9c['os'][_0xef43('0xaf')]),'osVersion':_0x46fe9c['os'][_0xef43('0xaf')],'deviceModel':_0x46fe9c['device'][_0xef43('0x49')]&&_0x46fe9c[_0xef43('0xb3')]['vendor']?util[_0xef43('0xb0')](_0xef43('0xb4'),_0x46fe9c[_0xef43('0xb3')][_0xef43('0x49')],_0x46fe9c['device'][_0xef43('0xb5')],_0x46fe9c['device'][_0xef43('0x47')]):null,'deviceVendor':_0x46fe9c[_0xef43('0xb3')][_0xef43('0xb5')],'deviceType':_0x46fe9c[_0xef43('0xb3')][_0xef43('0x47')],'formData':JSON[_0xef43('0x28')](_0x1dd6ef[_0xef43('0x5e')])};var _0x27d1a={'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'closed':![]};if(_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')]){_0x27d1a[_0xef43('0xb6')]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')];return db['ChatInteraction'][_0xef43('0x64')]({'where':_0x27d1a})[_0xef43('0x23')](function(_0xbb04de){if(_0xbb04de){return[_0xbb04de,![]];}_0x9e8494[_0xef43('0xb6')]=_0x1dd6ef['body'][_0xef43('0xb6')];_0x9e8494[_0xef43('0xb7')]=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb7')];return db[_0xef43('0xb8')]['create'](_0x9e8494)[_0xef43('0x23')](function(_0x3760b8){return[_0x3760b8,!![]];});});}_0x27d1a[_0xef43('0xb9')]=_0x5b6cd5['id'];if(_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xba')]&&_0x1dd6ef[_0xef43('0x5e')]['interaction']['id']){_0x27d1a['id']=_0x1dd6ef[_0xef43('0x5e')]['interaction']['id'];return db[_0xef43('0xb8')][_0xef43('0x64')]({'where':_0x27d1a})[_0xef43('0x23')](function(_0x1261d6){if(_0x1261d6){return[_0x1261d6,![]];}return db[_0xef43('0xb8')]['create'](_0x9e8494)[_0xef43('0x23')](function(_0x158dc8){return[_0x158dc8,!![]];});});}return db[_0xef43('0xb8')][_0xef43('0x5d')](_0x9e8494)['then'](function(_0x3db783){return[_0x3db783,!![]];});}})['spread'](function(_0x238de5,_0x185d6a){if(_0x238de5){_0x36dbae=_0x185d6a;if(!_0x185d6a){var _0x314a68={'from':(_0x5cd84f[_0xef43('0xbb')][_0xef43('0xab')]||'')+'\x20'+(_0x5cd84f[_0xef43('0xbb')][_0xef43('0xac')]||'')};if(_0x1dd6ef[_0xef43('0x5e')]['threadId']&&_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xbc')]&&_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xb6')]!=_0x1dd6ef[_0xef43('0x5e')][_0xef43('0xbc')]){_0x314a68[_0xef43('0xb6')]=_0x1dd6ef[_0xef43('0x5e')]['messageId'];}return _0x238de5[_0xef43('0x3a')](_0x314a68);}else{return _0x238de5;}}})[_0xef43('0x23')](function(_0x2b0425){_0x5cd84f[_0xef43('0xba')]=_0x2b0425[_0xef43('0x60')]({'plain':!![]});_0x5cd84f[_0xef43('0xba')][_0xef43('0xbd')]=_0x36dbae;if(_0x5cd84f[_0xef43('0xba')][_0xef43('0xbd')]){if(_0x5cd84f[_0xef43('0xa4')]['autoclose']){_0x5cd84f[_0xef43('0xa5')]['push']({'id':0x0,'priority':_0x5cd84f[_0xef43('0xa5')][_0xef43('0x4f')]+0x1,'app':_0xef43('0xbe'),'appdata':_0xef43('0xbf'),'interval':_0xef43('0xc0')});}}return db[_0xef43('0xc1')]['create']({'body':_0x1dd6ef[_0xef43('0x5e')]['body'],'ChatWebsiteId':_0x1dd6ef[_0xef43('0x5b')]['id'],'ChatInteractionId':_0x2b0425['id'],'direction':'in','ContactId':_0x5cd84f[_0xef43('0xbb')]['id'],'AttachmentId':_0x1dd6ef[_0xef43('0x5e')]['AttachmentId']});})[_0xef43('0x23')](function(_0x1d6c6e){_0x5cd84f['message']=_0x1d6c6e;if(_0x5cd84f['interaction'][_0xef43('0xc2')]){return db['User'][_0xef43('0x64')]({'attributes':['id',_0xef43('0x3e')],'where':{'id':_0x5cd84f[_0xef43('0xba')][_0xef43('0xc2')]}})[_0xef43('0x23')](function(_0x179ba8){if(_0x179ba8){_0x5cd84f[_0xef43('0xa5')][_0xef43('0xc3')]({'id':0x0,'priority':0x0,'app':_0xef43('0xc4'),'appdata':_0x179ba8[_0xef43('0x3e')]+','+(_0x5cd84f[_0xef43('0xa4')][_0xef43('0xc5')]||0xa),'interval':_0xef43('0xc0')});_0x5cd84f[_0xef43('0xc6')]=!![];}return respondWithRpcPromise(_0xef43('0xc7'),_0xef43('0xc8'),_0x5cd84f);});}return respondWithRpcPromise(_0xef43('0xc7'),_0xef43('0xc8'),_0x5cd84f);})[_0xef43('0x23')](function(_0x34f43c){respondWithRpcPromise(_0xef43('0xc9'),_0xef43('0xc9'),{'event':_0xef43('0xca'),'message':_0x34f43c},client9002);return _0x34f43c;})['then'](respondWithResult(_0x277fc1,null))[_0xef43('0x2d')](handleError(_0x277fc1,null));};exports[_0xef43('0xcb')]=function(_0xbb5bbb,_0x18d960,_0x599797){var _0x11d576,_0x4bc60d,_0x46f8ae;var _0x1a9c63=[];var _0x329fdb=[];var _0x559c54={};var _0x2f282b=_0xbb5bbb[_0xef43('0xcc')]||[];var _0x48b23d=[];var _0x18d6ac;return db[_0xef43('0x8f')][_0xef43('0x68')]()[_0xef43('0x23')](function(_0x171007){if(!_0x171007){throw new db['Sequelize'][(_0xef43('0x91'))]('no\x20available\x20attributes');}_0x329fdb=_[_0xef43('0x93')](_[_0xef43('0x5c')](_0x171007),['createdAt',_0xef43('0x94')]);_0x1a9c63=_[_0xef43('0x93')](_[_0xef43('0x5c')](_0x171007),['createdAt','updatedAt','CompanyId',_0xef43('0x97')]);if(_0xbb5bbb['body']['id']){delete _0xbb5bbb[_0xef43('0x5e')]['id'];}if(_[_0xef43('0x82')](_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x98')])){throw _0x18d960[_0xef43('0x2f')](0x1f4)[_0xef43('0x3f')](new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0x99')));}if(_['isNil'](_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x5e')])||_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x5e')]===''){throw _0x18d960[_0xef43('0x2f')](0x1f4)['send'](new db[(_0xef43('0x90'))][(_0xef43('0x91'))](_0xef43('0xcd')));}if(_[_0xef43('0x82')](_0xbb5bbb['body']['mapKeyOffline'])){throw _0x18d960[_0xef43('0x2f')](0x1f4)[_0xef43('0x3f')](new db['Sequelize'][(_0xef43('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1a9c63));}if(!_['includes'](_0x1a9c63,_0xbb5bbb['body'][_0xef43('0xce')])){throw _0x18d960['status'](0x1f4)[_0xef43('0x3f')](new db['Sequelize'][(_0xef43('0x91'))](_0xef43('0xcf')+_0x1a9c63));}_0x559c54[_0xbb5bbb[_0xef43('0x5e')][_0xef43('0xce')]]=_0xbb5bbb['body'][_0xef43('0x98')];})[_0xef43('0x23')](function(){return db[_0xef43('0x44')]['find']({'where':{'id':_0xbb5bbb[_0xef43('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xef43('0x9f')},{'model':db[_0xef43('0xd0')],'as':_0xef43('0xd0')}]});})[_0xef43('0x23')](handleEntityNotFound(_0x18d960,null))[_0xef43('0x23')](function(_0x16a801){if(_0x16a801&&_0x16a801[_0xef43('0x9f')]){_0x4bc60d=_0x16a801;var _0x47dd00=_[_0xef43('0x1c')](_0xbb5bbb[_0xef43('0x5e')],{'firstName':_0xbb5bbb['body']['from'],'phone':_0xbb5bbb[_0xef43('0x5e')][_0xef43('0x98')],'ListId':_0x16a801[_0xef43('0x97')]});_0x47dd00[_0xbb5bbb[_0xef43('0x5e')]['mapKeyOffline']]=_0xbb5bbb[_0xef43('0x5e')]['from'];return db[_0xef43('0x8f')][_0xef43('0xd1')]({'where':_0x559c54,'defaults':_0x47dd00});}})['spread'](function(_0x40a5b3){if(_0x40a5b3){_0x46f8ae=_0x40a5b3;var _0x50a555=fs['readFileSync'](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd2')),_0xef43('0xd3'));var _0x42155d=ejs['render'](_0x50a555,{'body':_['toPairs'](_0xbb5bbb[_0xef43('0x5e')]['body']),'bodyTitle':_0x4bc60d[_0xef43('0xd4')]});return db[_0xef43('0xd5')][_0xef43('0x5d')]({'body':_0x42155d,'ContactId':_0x40a5b3['id'],'ChatWebsiteId':_0x4bc60d['id']});}})['then'](function(_0x3259fb){_0x18d6ac=_0x3259fb;if(_0x2f282b['length']){var _0x41bec6=_0x2f282b[_0xef43('0x43')](function(_0x577cc2){return{'name':_0x577cc2[_0xef43('0xd6')],'basename':_0x577cc2['filename'],'type':_0x577cc2[_0xef43('0xd7')],'ChatOfflineMessageId':_0x3259fb['id']};});_0x48b23d=_0x41bec6[_0xef43('0x43')](_0x3e2e9a=>{var _0x51f683={'filename':_0x3e2e9a[_0xef43('0x3e')],'path':path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd8'),'files',_0xef43('0xd9'),'offline-chat',_0x3e2e9a[_0xef43('0xda')])};return _0x51f683;});if(!_0x4bc60d[_0xef43('0xdb')]){return db[_0xef43('0xdc')][_0xef43('0xdd')](function(_0x9968e4){return db[_0xef43('0xde')][_0xef43('0xdf')](_0x41bec6,{'transaction':_0x9968e4});});}}})[_0xef43('0x23')](function(){if(_0x18d6ac){_0x11d576=_0x18d6ac;return db[_0xef43('0xd0')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xef43('0xe0')],'as':_0xef43('0xe1'),'raw':!![]}]});}})[_0xef43('0x23')](function(_0x3c7fa0){if(_0x3c7fa0&&_0x3c7fa0[_0xef43('0xe1')]&&_0x4bc60d[_0xef43('0xe2')]&&_0x4bc60d[_0xef43('0xe3')]){var _0x2e8a1b={'tls':{'rejectUnauthorized':![]}};if(_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe4')]){_0x2e8a1b[_0xef43('0xe4')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe4')];}else{_0x2e8a1b[_0xef43('0xe5')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe5')];_0x2e8a1b[_0xef43('0xe6')]=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe6')];_0x2e8a1b['secure']=_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe7')];}if(_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xe8')]){_0x2e8a1b[_0xef43('0xe9')]={'user':_0x3c7fa0[_0xef43('0xe1')]['user'],'pass':_0x3c7fa0[_0xef43('0xe1')][_0xef43('0xea')]};}return respondWithRpcPromise(_0xef43('0xeb'),_0xef43('0xec'),{'account':_0x2e8a1b,'message':{'from':util[_0xef43('0xb0')]('\x22%s\x22\x20<%s>',_0x3c7fa0[_0xef43('0x3e')],_0x3c7fa0[_0xef43('0xed')]||_0x3c7fa0[_0xef43('0xe1')][_0xef43('0x5f')]),'to':_0x4bc60d[_0xef43('0xe3')],'subject':_0x4bc60d['offlineMessageSubject'],'html':_0x11d576[_0xef43('0x5e')],'attachments':_0x48b23d}},client9003)[_0xef43('0x23')](function(){return _0x11d576;})[_0xef43('0x2d')](function(_0x5cc67f){console[_0xef43('0x29')](_0x5cc67f);});}})[_0xef43('0x23')](function(){if(_0x4bc60d&&_0x4bc60d[_0xef43('0xdb')]&&_0x4bc60d[_0xef43('0xee')]){var _0xfb52d7=[];if(_0x2f282b[_0xef43('0x4f')]){_0xfb52d7=_0x2f282b['map'](function(_0x127984){return{'name':_0x127984[_0xef43('0xd6')],'basename':_0x127984['filename'],'type':_0x127984['mimetype'],'ChatOfflineMessageId':_0x18d6ac['id']};});}var _0x468ff7;if(!_[_0xef43('0x82')](_0x4bc60d[_0xef43('0xef')])){var _0x58cb90=_['map'](_0xbb5bbb[_0xef43('0x5e')],function(_0x1fc5df){return _0x1fc5df;});var _0x2b960c=_[_0xef43('0xf0')](_0x58cb90)[0x0];var _0x41795e=_['mapValues'](_0x2b960c,function(_0x2c273e){return _0x2c273e;});_0x468ff7=_0x41795e[0x1][_0x4bc60d['subjectOffline']];}var _0x5d7919={'from':_0x46f8ae[_0xef43('0xed')],'firstName':_0x46f8ae[_0xef43('0xab')],'lastName':_0x46f8ae['lastName'],'mapKey':_0xef43('0xed'),'message':{'from':_0x46f8ae[_0xef43('0xed')],'to':_0x4bc60d[_0xef43('0xd0')][_0xef43('0xed')],'cc':'','subject':_['isNil'](_0x468ff7)?_0x4bc60d[_0xef43('0xf1')]:_0x468ff7,'messageId':'','sentAt':new Date(),'attach':_0xfb52d7[_0xef43('0x4f')],'attachments':_0xfb52d7,'originChannel':_0xef43('0xf2'),'ChatWebsiteId':_0x4bc60d['id'],'ChatOfflineMessageId':_0x11d576['id'],'originTo':_0x4bc60d[_0xef43('0xd0')][_0xef43('0xed')]},'body':_0x11d576[_0xef43('0x5e')]};var _0x5bb369={'account':{'id':_0x4bc60d[_0xef43('0xee')]},'body':_0x5d7919,'log':_0xef43('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0xef43('0xf4'),_0x5bb369,client9001)[_0xef43('0x23')](function(){return _0x11d576;})['catch'](function(_0x573525){console[_0xef43('0x29')](_0x573525);});}return;})[_0xef43('0x23')](function(){if(_0x11d576){return _0x11d576;}})[_0xef43('0x23')](respondWithResult(_0x18d960,null))[_0xef43('0x2d')](function(_0x3c0b3c){console[_0xef43('0x29')](_0xef43('0x2d'),_0x3c0b3c);for(var _0x2bc0ab of _0x2f282b){var _0x336d2b=path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0xd8'),_0xef43('0xcc'),_0xef43('0xd9'),'offline-chat',_0x2bc0ab[_0xef43('0x76')]);fs_extra[_0xef43('0xf5')](_0x336d2b)[_0xef43('0x2d')](function(_0x2fdc13){console[_0xef43('0x29')](_0xef43('0xf6'),_0x336d2b,_0x2fdc13);});}});};exports[_0xef43('0xf7')]=function(_0x301758,_0x4cd5aa,_0x35e1fe){return db[_0xef43('0xb8')]['find']({'where':{'id':_0x301758['params']['id']}})['then'](handleEntityNotFound(_0x4cd5aa,null))[_0xef43('0x23')](function(_0x103277){if(_0x103277){return _0x103277[_0xef43('0xf7')](_0x301758[_0xef43('0x5e')][_0xef43('0x6f')],_[_0xef43('0xf8')](_0x301758[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{});}})[_0xef43('0x23')](respondWithResult(_0x4cd5aa,null))[_0xef43('0x2d')](handleError(_0x4cd5aa,null));};exports[_0xef43('0xf9')]=function(_0xf1449b,_0x23605a,_0x1f4680){var _0x18c3cf={'raw':![],'where':{}};var _0x1f392f={};var _0x9cbf76={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0xf1449b[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x23605a,null))[_0xef43('0x23')](function(_0x2ec982){if(_0x2ec982){_0x1f392f[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0xb8')][_0xef43('0x45')]);_0x1f392f[_0xef43('0x4a')]=_[_0xef43('0x5c')](_0xf1449b['query']);_0x1f392f[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x1f392f['model'],_0x1f392f[_0xef43('0x4a')]);_0x18c3cf[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x1f392f[_0xef43('0x49')],qs[_0xef43('0x4e')](_0xf1449b['query']['fields']));_0x18c3cf[_0xef43('0x4d')]=_0x18c3cf[_0xef43('0x4d')][_0xef43('0x4f')]?_0x18c3cf[_0xef43('0x4d')]:_0x1f392f[_0xef43('0x49')];if(!_0xf1449b[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x18c3cf['limit']=qs[_0xef43('0x33')](_0xf1449b[_0xef43('0x4a')][_0xef43('0x33')]);_0x18c3cf['offset']=qs['offset'](_0xf1449b['query'][_0xef43('0x34')]);}_0x18c3cf[_0xef43('0x51')]=qs[_0xef43('0x52')](_0xf1449b[_0xef43('0x4a')][_0xef43('0x52')]);_0x18c3cf[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0xf1449b[_0xef43('0x4a')],_0x1f392f[_0xef43('0x4b')]));_0x18c3cf[_0xef43('0x55')][_0xef43('0x69')]=_0x2ec982['id'];if(_0xf1449b['query'][_0xef43('0x54')]){_0x18c3cf[_0xef43('0x55')]=_[_0xef43('0x56')](_0x18c3cf[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x18c3cf['attributes'],function(_0x3faa30){var _0x332eea={};_0x332eea[_0x3faa30]={'$like':'%'+_0xf1449b[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x332eea;})});}_0x18c3cf=_[_0xef43('0x56')]({},_0x18c3cf,_0xf1449b[_0xef43('0x57')]);return db[_0xef43('0xb8')][_0xef43('0x35')]({'where':_0x18c3cf['where']})[_0xef43('0x23')](function(_0x160991){_0x9cbf76[_0xef43('0x35')]=_0x160991;if(_0xf1449b['query']['includeAll']){_0x18c3cf[_0xef43('0x59')]=[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xfa'),'required':![]},{'model':db['User'],'as':_0xef43('0xfb'),'attributes':[_0xef43('0x3e'),_0xef43('0xfc'),_0xef43('0xfd')],'required':![]},{'model':db[_0xef43('0xfe')],'as':_0xef43('0xff'),'attributes':['id','name','color'],'where':_0xf1449b['query'][_0xef43('0x100')]?{'id':_0xf1449b[_0xef43('0x4a')][_0xef43('0x100')]}:undefined,'required':_0xf1449b[_0xef43('0x4a')][_0xef43('0x100')]?!![]:![]}];}return db['ChatInteraction'][_0xef43('0x6d')](_0x18c3cf);})[_0xef43('0x23')](function(_0x3d0662){_0x9cbf76[_0xef43('0x5a')]=_0x3d0662;return _0x9cbf76;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x23605a,_0x18c3cf))['catch'](handleError(_0x23605a,null));};function iftimePromise(_0x52ce76,_0x2d4e17){return respondWithRpcPromise(_0xef43('0x101'),_0xef43('0x102'),{'command':_0x2d4e17[_0xef43('0x103')]?util['format'](_0xef43('0x104'),_0x52ce76[_0xef43('0x105')],_0x2d4e17[_0xef43('0x103')]):util[_0xef43('0xb0')](_0xef43('0x106'),_0x52ce76[_0xef43('0x105')])},client9002)[_0xef43('0x23')](function(_0x4835b5){var _0x22a933=_0x4835b5&&_0x4835b5[_0xef43('0x107')]('true')>=0x0?!![]:![];logger[_0xef43('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2d4e17['id'],_0x52ce76['id'],_0x52ce76[_0xef43('0x105')],_0x22a933?_0xef43('0x108'):_0xef43('0x109'),_0x2d4e17[_0xef43('0x103')]?_0x2d4e17[_0xef43('0x103')]:_0xef43('0x10a'));return _0x22a933;})[_0xef43('0x2d')](function(_0x1aa895){logger[_0xef43('0x29')](_0xef43('0x10b'),_0x2d4e17['id'],_0x52ce76['id'],_0x52ce76[_0xef43('0x105')],util['inspect'](_0x1aa895,{'showHidden':![],'depth':null}),_0x2d4e17['timezone']?_0x2d4e17[_0xef43('0x103')]:_0xef43('0x10a'));return![];});}exports[_0xef43('0x102')]=function(_0x24649a,_0xecfe2b,_0xe35f95){var _0x160853=0x0;var _0x37dee9=0x0;var _0x2eb6d1=![];var _0x3c34a3;var _0x40f07d;return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x24649a['params']['id']},'include':[{'model':db[_0xef43('0x10c')],'as':_0xef43('0x10c'),'include':[{'model':db[_0xef43('0x10c')],'as':_0xef43('0x10d'),'attributes':['id',_0xef43('0x105')],'raw':!![]}]}]})[_0xef43('0x23')](handleEntityNotFound(_0xecfe2b,null))[_0xef43('0x23')](function(_0x14c96c){if(_0x14c96c){_0x3c34a3=_0x14c96c;return _0x14c96c[_0xef43('0x10e')]({'raw':!![]});}})[_0xef43('0x23')](function(_0x3c680e){if(_0x3c34a3){if(_0x3c680e){_0x40f07d=_0x3c680e;}}return require(_0xef43('0x19'))['getLicense']();})[_0xef43('0x23')](function(_0x294169){if(_0x294169){_0x37dee9=_0x294169[_0xef43('0x10f')];_0x2eb6d1=_0x294169[_0xef43('0x81')];}})[_0xef43('0x23')](function(){return db[_0xef43('0xb8')][_0xef43('0x35')]({'where':{'closed':![]}});})[_0xef43('0x23')](function(_0x393691){_0x160853=_0x393691;if(_0x37dee9&&_0x393691>_0x37dee9){return db[_0xef43('0x110')][_0xef43('0x6b')]({'where':{'id':0x1}})[_0xef43('0x23')](function(_0x51a13a){if(_0x51a13a){_0x51a13a['increment'](_0xef43('0x111'));}});}})['then'](function(){if(_0x3c34a3[_0xef43('0x10c')]&&_0x3c34a3[_0xef43('0x10c')][_0xef43('0x10d')]){var _0x46aa09=[];for(var _0x952e87=0x0;_0x952e87<_0x3c34a3[_0xef43('0x10c')]['Intervals'][_0xef43('0x4f')];_0x952e87++){var _0x2d2229=_0x3c34a3[_0xef43('0x10c')][_0xef43('0x10d')][_0x952e87][_0xef43('0x60')]({'plain':!![]});_0x46aa09['push'](iftimePromise(_0x2d2229,_0x3c34a3));}return BPromise[_0xef43('0x112')](_0x46aa09)[_0xef43('0x23')](function(_0x521314){return _[_0xef43('0x113')](_0x521314);});}else{return!![];}})['then'](function(_0x4530b8){var _0x51796c=fs[_0xef43('0x114')](path[_0xef43('0x7d')](config[_0xef43('0x7e')],_0xef43('0x115')),'utf8');var _0x3072f6={'remote':_0x3c34a3[_0xef43('0x116')],'query':querystring[_0xef43('0x28')](_[_0xef43('0x56')](_0x3c34a3['get']({'plain':!![]}),{'customerIp':_0x24649a[_0xef43('0xa9')][_0xef43('0x117')]||_0x24649a[_0xef43('0xa9')]['x-real-ip']||_0x24649a[_0xef43('0x118')][_0xef43('0x119')]||_0x24649a['ip'],'referer':_0x24649a[_0xef43('0xa9')]['referer'],'openedInteractions':_0x160853,'maxInteractions':_0x37dee9,'virtual':_0x2eb6d1[_0xef43('0x10f')],'online':_0x4530b8,'custom':_0x2eb6d1}))[_0xef43('0x11a')](/'/g,'\x5c\x27')};_0xecfe2b[_0xef43('0x3f')](ejs[_0xef43('0x11b')](Mustache[_0xef43('0x11b')](_0x51796c,_0x3072f6),{'proactiveActions':_0x40f07d,'alignment':_0x3c34a3[_0xef43('0x11c')],'verticalAlignment':_0x3c34a3['verticalAlignment'],'div_color':_0x3c34a3[_0xef43('0x11d')],'text_color':_0x3c34a3[_0xef43('0x11e')],'button_color':_0x3c34a3[_0xef43('0x11f')],'background_color':_0x3c34a3[_0xef43('0x120')]}));})['catch'](handleError(_0xecfe2b,null));};exports[_0xef43('0x121')]=function(_0x1d1fca,_0x246354,_0x5617a7){return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x1d1fca['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x246354,null))[_0xef43('0x23')](function(_0x88a076){if(_0x88a076){return db['sequelize'][_0xef43('0xdd')](function(_0x28031b){return db[_0xef43('0xa2')][_0xef43('0x3b')]({'where':{'ChatWebsiteId':_0x1d1fca['params']['id']},'transaction':_0x28031b})[_0xef43('0x23')](function(_0x323aee){var _0x54dcec=_['map'](_0x1d1fca[_0xef43('0x5e')],function(_0x339349){_0x339349[_0xef43('0x69')]=_0x1d1fca[_0xef43('0x5b')]['id'];return _0x339349;});return db[_0xef43('0xa2')][_0xef43('0xdf')](_0x54dcec,{'transaction':_0x28031b});});})[_0xef43('0x23')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x1d1fca[_0xef43('0x5b')]['id']},'order':_0xef43('0x122')});});}})[_0xef43('0x23')](respondWithResult(_0x246354,null))[_0xef43('0x2d')](handleError(_0x246354,null));};exports['getApplications']=function(_0x33435f,_0x406308,_0x540380){var _0x551961={};var _0x59cd56={};var _0x3079c0;var _0x69f270;return db['ChatWebsite'][_0xef43('0x6b')]({'where':{'id':_0x33435f[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x406308,null))[_0xef43('0x23')](function(_0xb8c45d){if(_0xb8c45d){_0x3079c0=_0xb8c45d;_0x59cd56[_0xef43('0x49')]=_['keys'](db[_0xef43('0xa2')][_0xef43('0x45')]);_0x59cd56[_0xef43('0x4a')]=_['keys'](_0x33435f[_0xef43('0x4a')]);_0x59cd56[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x59cd56[_0xef43('0x49')],_0x59cd56[_0xef43('0x4a')]);_0x551961['attributes']=_[_0xef43('0x4c')](_0x59cd56[_0xef43('0x49')],qs['fields'](_0x33435f['query'][_0xef43('0x4e')]));_0x551961[_0xef43('0x4d')]=_0x551961['attributes'][_0xef43('0x4f')]?_0x551961[_0xef43('0x4d')]:_0x59cd56[_0xef43('0x49')];_0x551961['order']=qs['sort'](_0x33435f[_0xef43('0x4a')]['sort']);_0x551961['where']=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x33435f[_0xef43('0x4a')],_0x59cd56['filters']));if(_0x33435f['query']['filter']){_0x551961[_0xef43('0x55')]=_['merge'](_0x551961[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x551961[_0xef43('0x4d')],function(_0x3449b8){var _0x5e0fad={};_0x5e0fad[_0x3449b8]={'$like':'%'+_0x33435f[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x5e0fad;})});}_0x551961=_[_0xef43('0x56')]({},_0x551961,_0x33435f['options']);return _0x3079c0[_0xef43('0x123')](_0x551961);}})[_0xef43('0x23')](function(_0x295b00){if(_0x295b00){_0x69f270=_0x295b00['length'];if(!_0x33435f['query'][_0xef43('0x6c')]('nolimit')){_0x551961[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x33435f[_0xef43('0x4a')]['limit']);_0x551961[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x33435f[_0xef43('0x4a')][_0xef43('0x34')]);}return _0x3079c0[_0xef43('0x123')](_0x551961);}})['then'](function(_0x147aef){if(_0x147aef){return _0x147aef?{'count':_0x69f270,'rows':_0x147aef}:null;}})['then'](respondWithResult(_0x406308,null))[_0xef43('0x2d')](handleError(_0x406308,null));};exports[_0xef43('0x124')]=function(_0x4734e7,_0x26e821,_0x25cae3){return db['chatProactiveAction'][_0xef43('0x64')]({'where':{'id':_0x4734e7[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x26e821,null))[_0xef43('0x23')](function(_0x2d11fa){if(_0x2d11fa){return _0x2d11fa[_0xef43('0x124')](_0x4734e7[_0xef43('0x5e')][_0xef43('0x6f')],_['omit'](_0x4734e7[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{});}})[_0xef43('0x23')](respondWithResult(_0x26e821,null))[_0xef43('0x2d')](handleError(_0x26e821,null));};exports[_0xef43('0x10e')]=function(_0x571f84,_0x489123,_0x2aaa14){var _0x41dab1={};var _0x4de597={};var _0x11b5f0;var _0x409157;return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x571f84[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x489123,null))['then'](function(_0x540c83){if(_0x540c83){_0x11b5f0=_0x540c83;_0x4de597['model']=_['keys'](db[_0xef43('0x125')][_0xef43('0x45')]);_0x4de597[_0xef43('0x4a')]=_['keys'](_0x571f84[_0xef43('0x4a')]);_0x4de597['filters']=_[_0xef43('0x4c')](_0x4de597['model'],_0x4de597[_0xef43('0x4a')]);_0x41dab1[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x4de597[_0xef43('0x49')],qs['fields'](_0x571f84[_0xef43('0x4a')][_0xef43('0x4e')]));_0x41dab1[_0xef43('0x4d')]=_0x41dab1[_0xef43('0x4d')][_0xef43('0x4f')]?_0x41dab1[_0xef43('0x4d')]:_0x4de597[_0xef43('0x49')];_0x41dab1[_0xef43('0x51')]=qs[_0xef43('0x52')](_0x571f84[_0xef43('0x4a')]['sort']);_0x41dab1[_0xef43('0x55')]=qs[_0xef43('0x4b')](_[_0xef43('0x53')](_0x571f84[_0xef43('0x4a')],_0x4de597[_0xef43('0x4b')]));if(_0x571f84['query'][_0xef43('0x54')]){_0x41dab1[_0xef43('0x55')]=_[_0xef43('0x56')](_0x41dab1['where'],{'$or':_[_0xef43('0x43')](_0x41dab1[_0xef43('0x4d')],function(_0x2fec3f){var _0x49362c={};_0x49362c[_0x2fec3f]={'$like':'%'+_0x571f84['query']['filter']+'%'};return _0x49362c;})});}_0x41dab1=_[_0xef43('0x56')]({},_0x41dab1,_0x571f84['options']);return _0x11b5f0[_0xef43('0x10e')](_0x41dab1);}})[_0xef43('0x23')](function(_0x406571){if(_0x406571){_0x409157=_0x406571[_0xef43('0x4f')];if(!_0x571f84[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x41dab1[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x571f84[_0xef43('0x4a')][_0xef43('0x33')]);_0x41dab1[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x571f84['query']['offset']);}return _0x11b5f0[_0xef43('0x10e')](_0x41dab1);}})[_0xef43('0x23')](function(_0x2ec050){if(_0x2ec050){return _0x2ec050?{'count':_0x409157,'rows':_0x2ec050}:null;}})[_0xef43('0x23')](respondWithResult(_0x489123,null))[_0xef43('0x2d')](handleError(_0x489123,null));};exports[_0xef43('0x126')]=function(_0x1a44cd,_0x9a97c,_0x596e27){var _0x2089b8=_0x1a44cd['query'][_0xef43('0x127')]==='false'?_0xef43('0x128'):_0xef43('0x129');return db[_0xef43('0x44')][_0xef43('0x64')]({'attributes':['id',_0x2089b8],'where':{'id':_0x1a44cd[_0xef43('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9a97c,null))[_0xef43('0x23')](function(_0x47d53f){if(_0x47d53f){var _0x5e1a6e=_0x47d53f[_0x2089b8];var _0x126ea5=_0x5e1a6e&&_0x5e1a6e[_0xef43('0x12a')]?_0x5e1a6e[_0xef43('0x12a')]:[];_0x9a97c[_0xef43('0x3f')]({'fromKey':_[_0xef43('0x82')](_0x5e1a6e[_0xef43('0x12b')])?undefined:_0x5e1a6e['fromKey'],'count':_0x126ea5['length'],'rows':_0x126ea5});}})['catch'](handleError(_0x9a97c,null));};exports[_0xef43('0x12c')]=function(_0x56614e,_0x57834a,_0x535f5d){var _0x3c9407={'raw':![],'where':{}};var _0x3d9a5c={};var _0x2ad057={'count':0x0,'rows':[]};return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x56614e['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x57834a,null))['then'](function(_0x27e951){if(_0x27e951){_0x3d9a5c['model']=_['keys'](db['ChatOfflineMessage'][_0xef43('0x45')]);_0x3d9a5c['query']=_['keys'](_0x56614e[_0xef43('0x4a')]);_0x3d9a5c[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x3d9a5c[_0xef43('0x49')],_0x3d9a5c[_0xef43('0x4a')]);_0x3c9407[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x3d9a5c[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x56614e[_0xef43('0x4a')][_0xef43('0x4e')]));_0x3c9407[_0xef43('0x4d')]=_0x3c9407['attributes'][_0xef43('0x4f')]?_0x3c9407['attributes']:_0x3d9a5c[_0xef43('0x49')];if(!_0x56614e[_0xef43('0x4a')]['hasOwnProperty'](_0xef43('0x50'))){_0x3c9407[_0xef43('0x33')]=qs[_0xef43('0x33')](_0x56614e[_0xef43('0x4a')][_0xef43('0x33')]);_0x3c9407[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x56614e['query'][_0xef43('0x34')]);}_0x3c9407['order']=qs[_0xef43('0x52')](_0x56614e[_0xef43('0x4a')]['sort']);_0x3c9407[_0xef43('0x55')]=qs['filters'](_[_0xef43('0x53')](_0x56614e[_0xef43('0x4a')],_0x3d9a5c[_0xef43('0x4b')]));_0x3c9407[_0xef43('0x55')][_0xef43('0x69')]=_0x27e951['id'];if(_0x56614e[_0xef43('0x4a')][_0xef43('0x54')]){_0x3c9407['where']=_[_0xef43('0x56')](_0x3c9407[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x3c9407['attributes'],function(_0x23deec){var _0x198197={};_0x198197[_0x23deec]={'$like':'%'+_0x56614e[_0xef43('0x4a')][_0xef43('0x54')]+'%'};return _0x198197;})});}_0x3c9407=_[_0xef43('0x56')]({},_0x3c9407,_0x56614e[_0xef43('0x57')]);return db[_0xef43('0xd5')][_0xef43('0x35')]({'where':_0x3c9407['where']})[_0xef43('0x23')](function(_0x55f789){_0x2ad057['count']=_0x55f789;if(_0x56614e[_0xef43('0x4a')]['includeAll']){_0x3c9407['include']=[{'all':!![]}];}else{_0x3c9407[_0xef43('0x59')]=[{'model':db[_0xef43('0x8f')],'as':_0xef43('0xfa'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xef43('0xd5')]['findAll'](_0x3c9407);})[_0xef43('0x23')](function(_0xd5eb1a){_0x2ad057['rows']=_0xd5eb1a;return _0x2ad057;});}})[_0xef43('0x23')](respondWithFilteredResult(_0x57834a,_0x3c9407))[_0xef43('0x2d')](handleError(_0x57834a,null));};exports[_0xef43('0x12d')]=function(_0x38fd26,_0x1553ba,_0x2394f0){return db[_0xef43('0x44')][_0xef43('0x64')]({'where':{'id':_0x38fd26['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x1553ba,null))[_0xef43('0x23')](function(_0x83e63c){if(_0x83e63c){return _0x83e63c[_0xef43('0x12d')](_0x38fd26[_0xef43('0x5e')][_0xef43('0x6f')],_['omit'](_0x38fd26[_0xef43('0x5e')],[_0xef43('0x6f'),'id'])||{})[_0xef43('0x12e')](function(_0x3fd086){for(var _0x4eb7e6=0x0;_0x4eb7e6<_0x38fd26['body']['ids'][_0xef43('0x4f')];_0x4eb7e6+=0x1){socket[_0xef43('0x12f')](_0xef43('0x130'),{'UserId':Number(_0x38fd26['body']['ids'][_0x4eb7e6]),'ChatWebsiteId':Number(_0x38fd26['params']['id'])});}return _0x3fd086;});}})[_0xef43('0x23')](respondWithResult(_0x1553ba,null))[_0xef43('0x2d')](handleError(_0x1553ba,null));};exports['removeAgents']=function(_0x23cf0e,_0x48040d,_0x17c674){return db[_0xef43('0x44')]['find']({'where':{'id':_0x23cf0e['params']['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x48040d,null))['then'](function(_0x26c87a){if(_0x26c87a){return _0x26c87a['removeAgents'](_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')])[_0xef43('0x23')](function(){if(_[_0xef43('0x131')](_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')])){for(var _0x5a9f34=0x0;_0x5a9f34<_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')]['length'];_0x5a9f34+=0x1){socket[_0xef43('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')][_0x5a9f34]),'ChatWebsiteId':Number(_0x23cf0e[_0xef43('0x5b')]['id'])});}}else{socket[_0xef43('0x12f')](_0xef43('0x132'),{'UserId':Number(_0x23cf0e[_0xef43('0x4a')][_0xef43('0x6f')]),'ChatWebsiteId':Number(_0x23cf0e['params']['id'])});}});}})[_0xef43('0x23')](respondWithStatusCode(_0x48040d,null))['catch'](handleError(_0x48040d,null));};exports[_0xef43('0x133')]=function(_0x92122e,_0x126454,_0x439a42){var _0x53cbd3={};var _0x57527d={};var _0x2542c3;var _0x4a04df;return db[_0xef43('0x44')][_0xef43('0x6b')]({'where':{'id':_0x92122e[_0xef43('0x5b')]['id']}})[_0xef43('0x23')](handleEntityNotFound(_0x126454,null))['then'](function(_0xe169ca){if(_0xe169ca){_0x2542c3=_0xe169ca;_0x57527d[_0xef43('0x49')]=_[_0xef43('0x5c')](db[_0xef43('0x134')]['rawAttributes']);_0x57527d[_0xef43('0x4a')]=_['keys'](_0x92122e['query']);_0x57527d[_0xef43('0x4b')]=_[_0xef43('0x4c')](_0x57527d['model'],_0x57527d[_0xef43('0x4a')]);_0x53cbd3[_0xef43('0x4d')]=_[_0xef43('0x4c')](_0x57527d[_0xef43('0x49')],qs[_0xef43('0x4e')](_0x92122e[_0xef43('0x4a')][_0xef43('0x4e')]));_0x53cbd3['attributes']=_0x53cbd3[_0xef43('0x4d')][_0xef43('0x4f')]?_0x53cbd3[_0xef43('0x4d')]:_0x57527d[_0xef43('0x49')];_0x53cbd3['order']=qs['sort'](_0x92122e[_0xef43('0x4a')]['sort']);_0x53cbd3[_0xef43('0x55')]=qs[_0xef43('0x4b')](_['pick'](_0x92122e[_0xef43('0x4a')],_0x57527d[_0xef43('0x4b')]));if(_0x92122e[_0xef43('0x4a')][_0xef43('0x54')]){_0x53cbd3['where']=_['merge'](_0x53cbd3[_0xef43('0x55')],{'$or':_[_0xef43('0x43')](_0x53cbd3[_0xef43('0x4d')],function(_0x1d5d1a){var _0x320068={};_0x320068[_0x1d5d1a]={'$like':'%'+_0x92122e['query']['filter']+'%'};return _0x320068;})});}_0x53cbd3=_[_0xef43('0x56')]({},_0x53cbd3,_0x92122e['options']);return _0x2542c3['getAgents'](_0x53cbd3);}})[_0xef43('0x23')](function(_0x568eb7){if(_0x568eb7){_0x4a04df=_0x568eb7[_0xef43('0x4f')];if(!_0x92122e[_0xef43('0x4a')][_0xef43('0x6c')](_0xef43('0x50'))){_0x53cbd3['limit']=qs[_0xef43('0x33')](_0x92122e[_0xef43('0x4a')]['limit']);_0x53cbd3[_0xef43('0x34')]=qs[_0xef43('0x34')](_0x92122e['query'][_0xef43('0x34')]);}return _0x2542c3[_0xef43('0x133')](_0x53cbd3);}})['then'](function(_0x1c5693){if(_0x1c5693){return _0x1c5693?{'count':_0x4a04df,'rows':_0x1c5693}:null;}})[_0xef43('0x23')](respondWithResult(_0x126454,null))[_0xef43('0x2d')](handleError(_0x126454,null));};
\ No newline at end of file
+var _0xc04f=['color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','findOne','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','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','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','ChatWebsite','rows','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','asc','from','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','sendMail','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags'];(function(_0x160085,_0x5c8fd2){var _0x2f61d3=function(_0x374fba){while(--_0x374fba){_0x160085['push'](_0x160085['shift']());}};_0x2f61d3(++_0x5c8fd2);}(_0xc04f,0x165));var _0xfc04=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0xc04f[_0x2331f8];return _0x244773;};'use strict';var emlformat=require(_0xfc04('0x0'));var rimraf=require(_0xfc04('0x1'));var zipdir=require(_0xfc04('0x2'));var jsonpatch=require(_0xfc04('0x3'));var rp=require(_0xfc04('0x4'));var moment=require(_0xfc04('0x5'));var BPromise=require(_0xfc04('0x6'));var Mustache=require(_0xfc04('0x7'));var util=require('util');var path=require('path');var sox=require(_0xfc04('0x8'));var csv=require(_0xfc04('0x9'));var ejs=require(_0xfc04('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc04('0xb'));var squel=require(_0xfc04('0xc'));var crypto=require('crypto');var jsforce=require(_0xfc04('0xd'));var deskjs=require(_0xfc04('0xe'));var toCsv=require(_0xfc04('0x9'));var querystring=require(_0xfc04('0xf'));var Papa=require(_0xfc04('0x10'));var Redis=require(_0xfc04('0x11'));var authService=require(_0xfc04('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc04('0x13'));var logger=require('../../config/logger')(_0xfc04('0x14'));var utils=require(_0xfc04('0x15'));var config=require(_0xfc04('0x16'));var licenseUtil=require(_0xfc04('0x17'));var db=require(_0xfc04('0x18'))['db'];config[_0xfc04('0x19')]=_[_0xfc04('0x1a')](config[_0xfc04('0x19')],{'host':_0xfc04('0x1b'),'port':0x18eb});var socket=require(_0xfc04('0x1c'))(new Redis(config[_0xfc04('0x19')]));require(_0xfc04('0x1d'))[_0xfc04('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfc04('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xfc04('0x1f')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0xfc04('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5df5bb,_0x5e8c00,_0x39b177,_0x3e1aa1){return new BPromise(function(_0x13f951,_0x403f70){var _0x46162d=_0x3e1aa1||client;return _0x46162d[_0xfc04('0x21')](_0x5df5bb,_0x39b177)[_0xfc04('0x22')](function(_0x31d2e5){logger[_0xfc04('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5e8c00,_0xfc04('0x24'));logger[_0xfc04('0x25')](_0xfc04('0x26'),_0x5e8c00,_0xfc04('0x24'),JSON['stringify'](_0x31d2e5));if(_0x31d2e5[_0xfc04('0x27')]){if(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x28')]===0x1f4){logger['error'](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x403f70(_0x31d2e5[_0xfc04('0x27')]['message']);}logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x13f951(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x2a')]);}else{logger['info'](_0xfc04('0x29'),_0x5e8c00,'request\x20sent');_0x13f951(_0x31d2e5[_0xfc04('0x2b')][_0xfc04('0x2a')]);}})[_0xfc04('0x2c')](function(_0x3579f1){logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x3579f1);_0x403f70(_0x3579f1);});});}function respondWithStatusCode(_0x7224d0,_0x2ae4a2){_0x2ae4a2=_0x2ae4a2||0xcc;return function(_0x5f09ba){if(_0x5f09ba){return _0x7224d0['sendStatus'](_0x2ae4a2);}return _0x7224d0[_0xfc04('0x2d')](_0x2ae4a2)[_0xfc04('0x2e')]();};}function respondWithResult(_0x3fdbed,_0x2b8264){_0x2b8264=_0x2b8264||0xc8;return function(_0x1fd986){if(_0x1fd986){return _0x3fdbed[_0xfc04('0x2d')](_0x2b8264)[_0xfc04('0x2f')](_0x1fd986);}};}function respondWithFilteredResult(_0x5ea5d1,_0x42525e){return function(_0x5d2b36){if(_0x5d2b36){var _0x44b659=typeof _0x42525e[_0xfc04('0x30')]===_0xfc04('0x31')&&typeof _0x42525e[_0xfc04('0x32')]===_0xfc04('0x31');var _0x3bbd4f=_0x5d2b36[_0xfc04('0x33')];var _0x48c848=_0x44b659?0x0:_0x42525e[_0xfc04('0x30')];var _0x202c61=_0x44b659?_0x5d2b36[_0xfc04('0x33')]:_0x42525e[_0xfc04('0x30')]+_0x42525e['limit'];var _0x5bbbc2;if(_0x202c61>=_0x3bbd4f){_0x202c61=_0x3bbd4f;_0x5bbbc2=0xc8;}else{_0x5bbbc2=0xce;}_0x5ea5d1[_0xfc04('0x2d')](_0x5bbbc2);return _0x5ea5d1['set'](_0xfc04('0x34'),_0x48c848+'-'+_0x202c61+'/'+_0x3bbd4f)[_0xfc04('0x2f')](_0x5d2b36);}return null;};}function patchUpdates(_0x390d1d){return function(_0x2e0d36){try{jsonpatch[_0xfc04('0x35')](_0x2e0d36,_0x390d1d,!![]);}catch(_0xab5f87){return BPromise[_0xfc04('0x36')](_0xab5f87);}return _0x2e0d36[_0xfc04('0x37')]();};}function saveUpdates(_0x530af7,_0x833d8){return function(_0x18f868){if(_0x18f868){return _0x18f868[_0xfc04('0x38')](_0x530af7)['then'](function(_0x142e54){return _0x142e54;});}return null;};}function removeEntity(_0x1b80f0,_0x29b787){return function(_0x5ebfce){if(_0x5ebfce){return _0x5ebfce[_0xfc04('0x39')]()[_0xfc04('0x22')](function(){var _0x29fc1d=_0x5ebfce[_0xfc04('0x3a')]({'plain':!![]});var _0x5abaaa='ChatWebsites';return db[_0xfc04('0x3b')][_0xfc04('0x39')]({'where':{'type':_0x5abaaa,'resourceId':_0x29fc1d['id']}})[_0xfc04('0x22')](function(){return _0x5ebfce;});})[_0xfc04('0x22')](function(){_0x1b80f0[_0xfc04('0x2d')](0xcc)[_0xfc04('0x2e')]();});}};}function handleEntityNotFound(_0x3e050e,_0x10adf4){return function(_0xf8870c){if(!_0xf8870c){_0x3e050e[_0xfc04('0x3c')](0x194);}return _0xf8870c;};}function handleError(_0x52576e,_0x34c3fe){_0x34c3fe=_0x34c3fe||0x1f4;return function(_0xacb3de){logger['error'](_0xacb3de[_0xfc04('0x3d')]);if(_0xacb3de[_0xfc04('0x3e')]){delete _0xacb3de[_0xfc04('0x3e')];}_0x52576e[_0xfc04('0x2d')](_0x34c3fe)[_0xfc04('0x3f')](_0xacb3de);};}exports[_0xfc04('0x40')]=function(_0x20863d,_0x57cef0){var _0x2b0a7e={'include':[{'model':db[_0xfc04('0x41')],'as':'mandatoryDispositionPause'}]},_0x120424={},_0x4b539b={'count':0x0,'rows':[]};var _0x4a6285=_[_0xfc04('0x42')](db['ChatWebsite'][_0xfc04('0x43')],function(_0x38309e){return{'name':_0x38309e[_0xfc04('0x44')],'type':_0x38309e['type'][_0xfc04('0x45')]};});_0x120424[_0xfc04('0x46')]=_['map'](_0x4a6285,_0xfc04('0x3e'));_0x120424[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x20863d[_0xfc04('0x47')]);_0x120424[_0xfc04('0x49')]=_['intersection'](_0x120424[_0xfc04('0x46')],_0x120424[_0xfc04('0x47')]);_0x2b0a7e['attributes']=_[_0xfc04('0x4a')](_0x120424['model'],qs[_0xfc04('0x4b')](_0x20863d['query'][_0xfc04('0x4b')]));_0x2b0a7e[_0xfc04('0x4c')]=_0x2b0a7e['attributes'][_0xfc04('0x4d')]?_0x2b0a7e['attributes']:_0x120424[_0xfc04('0x46')];if(!_0x20863d[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x2b0a7e[_0xfc04('0x32')]=qs['limit'](_0x20863d['query'][_0xfc04('0x32')]);_0x2b0a7e[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x20863d[_0xfc04('0x47')]['offset']);}_0x2b0a7e[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x20863d[_0xfc04('0x47')][_0xfc04('0x51')]);_0x2b0a7e[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x20863d[_0xfc04('0x47')],_0x120424[_0xfc04('0x49')]),_0x4a6285);if(_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x2b0a7e[_0xfc04('0x52')]=_['merge'](_0x2b0a7e['where'],{'$or':_[_0xfc04('0x42')](_0x4a6285,function(_0x4bd8cf){if(_0x4bd8cf[_0xfc04('0x55')]!==_0xfc04('0x56')){var _0x137b2c={};_0x137b2c[_0x4bd8cf[_0xfc04('0x3e')]]={'$like':'%'+_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x137b2c;}})});}_0x2b0a7e=_[_0xfc04('0x57')]({},_0x2b0a7e,_0x20863d[_0xfc04('0x58')]);var _0x57ee42={'where':_0x2b0a7e[_0xfc04('0x52')]};return db['ChatWebsite'][_0xfc04('0x33')](_0x57ee42)[_0xfc04('0x22')](function(_0x4eb103){_0x4b539b['count']=_0x4eb103;if(_0x20863d['query'][_0xfc04('0x59')]){_0x2b0a7e['include']=[{'all':!![]}];}return db[_0xfc04('0x5a')]['findAll'](_0x2b0a7e);})['then'](function(_0x586975){_0x4b539b[_0xfc04('0x5b')]=_0x586975;return _0x4b539b;})[_0xfc04('0x22')](respondWithFilteredResult(_0x57cef0,_0x2b0a7e))[_0xfc04('0x2c')](handleError(_0x57cef0,null));};exports[_0xfc04('0x5c')]=function(_0x19ca83,_0x5e090a){var _0x3ec12b={'raw':![],'where':{'id':_0x19ca83[_0xfc04('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2300a0={};_0x2300a0[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x5a')][_0xfc04('0x43')]);_0x2300a0[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x19ca83['query']);_0x2300a0['filters']=_['intersection'](_0x2300a0['model'],_0x2300a0['query']);_0x3ec12b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2300a0['model'],qs[_0xfc04('0x4b')](_0x19ca83['query']['fields']));_0x3ec12b[_0xfc04('0x4c')]=_0x3ec12b[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x3ec12b['attributes']:_0x2300a0[_0xfc04('0x46')];if(_0x19ca83[_0xfc04('0x47')][_0xfc04('0x59')]){_0x3ec12b[_0xfc04('0x5e')]=[{'all':!![]}];}_0x3ec12b=_[_0xfc04('0x57')]({},_0x3ec12b,_0x19ca83['options']);return db[_0xfc04('0x5a')]['find'](_0x3ec12b)[_0xfc04('0x22')](handleEntityNotFound(_0x5e090a,null))['then'](respondWithResult(_0x5e090a,null))['catch'](handleError(_0x5e090a,null));};exports[_0xfc04('0x5f')]=function(_0x171ced,_0x7445de){return db['ChatWebsite'][_0xfc04('0x5f')](_0x171ced['body'],{})[_0xfc04('0x22')](function(_0x1d2d66){var _0x10f94a=_0x171ced[_0xfc04('0x60')]['get']({'plain':!![]});if(!_0x10f94a)throw new Error(_0xfc04('0x61'));if(_0x10f94a[_0xfc04('0x62')]===_0xfc04('0x60')){var _0x5854c0=_0x1d2d66[_0xfc04('0x3a')]({'plain':!![]});var _0x1ed749='ChatWebsites';return db['UserProfileSection'][_0xfc04('0x63')]({'where':{'name':_0x1ed749,'userProfileId':_0x10f94a[_0xfc04('0x64')]},'raw':!![]})[_0xfc04('0x22')](function(_0x51569e){if(_0x51569e&&_0x51569e[_0xfc04('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x5854c0[_0xfc04('0x3e')],'resourceId':_0x5854c0['id'],'type':_0x51569e[_0xfc04('0x3e')],'sectionId':_0x51569e['id']},{})[_0xfc04('0x22')](function(){return _0x1d2d66;});}else{return _0x1d2d66;}})[_0xfc04('0x2c')](function(_0x47f75c){logger[_0xfc04('0x27')](_0xfc04('0x66'),_0x47f75c);throw _0x47f75c;});}return _0x1d2d66;})[_0xfc04('0x22')](respondWithResult(_0x7445de,0xc9))[_0xfc04('0x2c')](handleError(_0x7445de,null));};exports[_0xfc04('0x38')]=function(_0x2f879f,_0x460a82){if(_0x2f879f[_0xfc04('0x67')]['id']){delete _0x2f879f['body']['id'];}return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x2f879f['params']['id']},'include':[{'model':db[_0xfc04('0x41')],'as':_0xfc04('0x68')}]})[_0xfc04('0x22')](handleEntityNotFound(_0x460a82,null))[_0xfc04('0x22')](saveUpdates(_0x2f879f['body'],null))['then'](respondWithResult(_0x460a82,null))[_0xfc04('0x2c')](handleError(_0x460a82,null));};exports[_0xfc04('0x39')]=function(_0xde6582,_0x4239a2){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xde6582[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x4239a2,null))['then'](removeEntity(_0x4239a2,null))[_0xfc04('0x2c')](handleError(_0x4239a2,null));};exports['describe']=function(_0x2ad72c,_0x10d275){return db['ChatWebsite'][_0xfc04('0x69')]()[_0xfc04('0x22')](respondWithResult(_0x10d275,null))[_0xfc04('0x2c')](handleError(_0x10d275,null));};exports[_0xfc04('0x6a')]=function(_0x530320,_0x20bb9a,_0x18e662){if(_0x530320[_0xfc04('0x67')]['id']){delete _0x530320[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x530320[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x20bb9a,null))[_0xfc04('0x22')](function(_0x3d8971){if(_0x3d8971){_0x530320['body'][_0xfc04('0x6b')]=_0x3d8971['id'];return db[_0xfc04('0x6c')][_0xfc04('0x5f')](_0x530320[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x20bb9a,null))[_0xfc04('0x2c')](handleError(_0x20bb9a,null));};exports[_0xfc04('0x6d')]=function(_0x60be3d,_0x5d8ba8,_0x327db7){var _0x5c20bf={'raw':![],'where':{}};var _0x223e4f={};var _0x504750={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0x60be3d[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x5d8ba8,null))[_0xfc04('0x22')](function(_0x1362a7){if(_0x1362a7){_0x223e4f[_0xfc04('0x46')]=_['keys'](db['Disposition'][_0xfc04('0x43')]);_0x223e4f[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x60be3d[_0xfc04('0x47')]);_0x223e4f['filters']=_[_0xfc04('0x4a')](_0x223e4f[_0xfc04('0x46')],_0x223e4f[_0xfc04('0x47')]);_0x5c20bf[_0xfc04('0x4c')]=_['intersection'](_0x223e4f[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x60be3d[_0xfc04('0x47')]['fields']));_0x5c20bf['attributes']=_0x5c20bf[_0xfc04('0x4c')]['length']?_0x5c20bf[_0xfc04('0x4c')]:_0x223e4f[_0xfc04('0x46')];if(!_0x60be3d['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x5c20bf[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x60be3d[_0xfc04('0x47')]['limit']);_0x5c20bf['offset']=qs[_0xfc04('0x30')](_0x60be3d[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x5c20bf['order']=qs[_0xfc04('0x51')](_0x60be3d[_0xfc04('0x47')]['sort']);_0x5c20bf[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x60be3d[_0xfc04('0x47')],_0x223e4f[_0xfc04('0x49')]));_0x5c20bf['where']['ChatWebsiteId']=_0x1362a7['id'];if(_0x60be3d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x5c20bf['where']=_[_0xfc04('0x57')](_0x5c20bf['where'],{'$or':_['map'](_0x5c20bf[_0xfc04('0x4c')],function(_0x2e473e){var _0x413268={};_0x413268[_0x2e473e]={'$like':'%'+_0x60be3d[_0xfc04('0x47')]['filter']+'%'};return _0x413268;})});}_0x5c20bf=_[_0xfc04('0x57')]({},_0x5c20bf,_0x60be3d['options']);return db[_0xfc04('0x6c')]['count']({'where':_0x5c20bf['where']})[_0xfc04('0x22')](function(_0x38cee5){_0x504750[_0xfc04('0x33')]=_0x38cee5;if(_0x60be3d['query'][_0xfc04('0x59')]){_0x5c20bf['include']=[{'all':!![]}];}return db[_0xfc04('0x6c')][_0xfc04('0x6e')](_0x5c20bf);})[_0xfc04('0x22')](function(_0x59a2e3){_0x504750['rows']=_0x59a2e3;return _0x504750;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x5d8ba8,_0x5c20bf))[_0xfc04('0x2c')](handleError(_0x5d8ba8,null));};exports['removeDispositions']=function(_0xfa1bc3,_0x4719d0,_0x295f3a){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xfa1bc3[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4719d0,null))[_0xfc04('0x22')](function(_0x3cb129){if(_0x3cb129){return _0x3cb129[_0xfc04('0x6f')](_0xfa1bc3[_0xfc04('0x47')][_0xfc04('0x70')]);}})[_0xfc04('0x22')](respondWithStatusCode(_0x4719d0,null))['catch'](handleError(_0x4719d0,null));};exports[_0xfc04('0x71')]=function(_0x23ce7a,_0x4ab686,_0x24c0bd){if(_0x23ce7a[_0xfc04('0x67')]['id']){delete _0x23ce7a[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x23ce7a[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4ab686,null))[_0xfc04('0x22')](function(_0x552d6e){if(_0x552d6e){_0x23ce7a[_0xfc04('0x67')][_0xfc04('0x6b')]=_0x552d6e['id'];return db[_0xfc04('0x72')][_0xfc04('0x5f')](_0x23ce7a[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x4ab686,null))[_0xfc04('0x2c')](handleError(_0x4ab686,null));};exports[_0xfc04('0x73')]=function(_0x79dd9e,_0x19e961,_0x4c5a1b){var _0x23df0a={'raw':![],'where':{}};var _0x4a71b5={};var _0x328ec6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x79dd9e[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19e961,null))['then'](function(_0x5852fa){if(_0x5852fa){_0x4a71b5[_0xfc04('0x46')]=_['keys'](db['CannedAnswer'][_0xfc04('0x43')]);_0x4a71b5['query']=_[_0xfc04('0x48')](_0x79dd9e[_0xfc04('0x47')]);_0x4a71b5[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x4a71b5[_0xfc04('0x46')],_0x4a71b5[_0xfc04('0x47')]);_0x23df0a[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x4a71b5['model'],qs['fields'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x23df0a[_0xfc04('0x4c')]=_0x23df0a['attributes'][_0xfc04('0x4d')]?_0x23df0a['attributes']:_0x4a71b5['model'];if(!_0x79dd9e['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x23df0a[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x32')]);_0x23df0a[_0xfc04('0x30')]=qs['offset'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x23df0a[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x51')]);_0x23df0a[_0xfc04('0x52')]=qs['filters'](_[_0xfc04('0x53')](_0x79dd9e[_0xfc04('0x47')],_0x4a71b5[_0xfc04('0x49')]));_0x23df0a[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x5852fa['id'];if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]){_0x23df0a['where']=_[_0xfc04('0x57')](_0x23df0a[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x23df0a[_0xfc04('0x4c')],function(_0x3f46a7){var _0x1a0120={};_0x1a0120[_0x3f46a7]={'$like':'%'+_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x1a0120;})});}_0x23df0a=_['merge']({},_0x23df0a,_0x79dd9e['options']);return db['CannedAnswer'][_0xfc04('0x33')]({'where':_0x23df0a['where']})[_0xfc04('0x22')](function(_0x18be60){_0x328ec6['count']=_0x18be60;if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x59')]){_0x23df0a[_0xfc04('0x5e')]=[{'all':!![]}];}return db[_0xfc04('0x72')][_0xfc04('0x6e')](_0x23df0a);})[_0xfc04('0x22')](function(_0x448655){_0x328ec6[_0xfc04('0x5b')]=_0x448655;return _0x328ec6;});}})['then'](respondWithFilteredResult(_0x19e961,_0x23df0a))[_0xfc04('0x2c')](handleError(_0x19e961,null));};exports[_0xfc04('0x74')]=function(_0x242562,_0xf75fb6,_0x56470c){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x242562[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xf75fb6,null))[_0xfc04('0x22')](function(_0x45302c){if(_0x45302c){return _0x45302c[_0xfc04('0x74')](_0x242562[_0xfc04('0x47')][_0xfc04('0x70')]);}})['then'](respondWithStatusCode(_0xf75fb6,null))[_0xfc04('0x2c')](handleError(_0xf75fb6,null));};exports[_0xfc04('0x75')]=function(_0x2554f3,_0x21684b,_0x36cd28){_0x2554f3[_0xfc04('0x67')][_0xfc04('0x76')]=_0x2554f3[_0xfc04('0x77')][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x2554f3[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x21684b,null))[_0xfc04('0x22')](saveUpdates(_0x2554f3['body'],null))[_0xfc04('0x22')](respondWithResult(_0x21684b,null))[_0xfc04('0x2c')](handleError(_0x21684b,null));};exports[_0xfc04('0x79')]=function(_0x115469,_0xdb620d,_0x1fe7c2){_0x115469[_0xfc04('0x67')][_0xfc04('0x7a')]=_0x115469[_0xfc04('0x77')][_0xfc04('0x78')];return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x115469[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xdb620d,null))[_0xfc04('0x22')](saveUpdates(_0x115469[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0xdb620d,null))[_0xfc04('0x2c')](handleError(_0xdb620d,null));};exports['addCustomerAvatar']=function(_0x1c11ca,_0x49179e,_0x335315){_0x1c11ca['body'][_0xfc04('0x7b')]=_0x1c11ca[_0xfc04('0x77')]['filename'];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x1c11ca[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x49179e,null))[_0xfc04('0x22')](saveUpdates(_0x1c11ca['body'],null))[_0xfc04('0x22')](respondWithResult(_0x49179e,null))[_0xfc04('0x2c')](handleError(_0x49179e,null));};exports[_0xfc04('0x7c')]=function(_0x15a5f1,_0x3a3d1a,_0x40db3f){_0x15a5f1[_0xfc04('0x67')]['systemAvatar']=_0x15a5f1['file'][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x15a5f1['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3a3d1a,null))[_0xfc04('0x22')](saveUpdates(_0x15a5f1[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0x3a3d1a,null))[_0xfc04('0x2c')](handleError(_0x3a3d1a,null));};exports[_0xfc04('0x7d')]=function(_0x50fa63,_0x3fa8d1,_0x209946){var _0x1c34c3=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x80'));var _0x3d603e={'where':{'id':_0x50fa63[_0xfc04('0x5d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33a855=![];return require(_0xfc04('0x17'))[_0xfc04('0x81')]()[_0xfc04('0x22')](function(_0x365b24){if(_0x365b24){_0x33a855=_0x365b24[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x3d603e);})[_0xfc04('0x22')](handleEntityNotFound(_0x3fa8d1,null))[_0xfc04('0x22')](function(_0x5e5a7a){if(_0x5e5a7a){if(!_['isNil'](_0x5e5a7a[_0xfc04('0x76')])){if(fs['existsSync'](path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]))&&_0x33a855){_0x1c34c3=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]);}}return _0x3fa8d1['download'](_0x1c34c3);}})['catch'](handleError(_0x3fa8d1,null));};exports[_0xfc04('0x84')]=function(_0x2742cd,_0x1d2cc3,_0x1bdd4f){var _0x5f195a=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x85'));var _0x517954={'where':{'id':_0x2742cd[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7a')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x517954)[_0xfc04('0x22')](handleEntityNotFound(_0x1d2cc3,null))[_0xfc04('0x22')](function(_0x14e4fe){if(_0x14e4fe){if(!_[_0xfc04('0x86')](_0x14e4fe[_0xfc04('0x7a')])){if(fs[_0xfc04('0x87')](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]))){_0x5f195a=path['join'](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]);}}return _0x1d2cc3[_0xfc04('0x89')](_0x5f195a);}})[_0xfc04('0x2c')](handleError(_0x1d2cc3,null));};exports[_0xfc04('0x8a')]=function(_0x1c5dae,_0x1c40fc,_0x3f7094){var _0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x8b'));var _0x427a80={'where':{'id':_0x1c5dae[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7b'),_0xfc04('0x8c')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x427a80)[_0xfc04('0x22')](handleEntityNotFound(_0x1c40fc,null))['then'](function(_0xb07993){if(_0xb07993){if(!_[_0xfc04('0x86')](_0xb07993['customerAvatar'])){if(fs['existsSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]))&&_0xb07993[_0xfc04('0x8c')]){_0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]);}}return _0x1c40fc[_0xfc04('0x89')](_0x34806b);}})[_0xfc04('0x2c')](handleError(_0x1c40fc,null));};exports['getSystemAvatar']=function(_0x3c3516,_0x344d5f,_0x32f04d){var _0x3c84a5=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x1a20fd={'where':{'id':_0x3c3516[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x8d')],'raw':!![]};return db['ChatWebsite'][_0xfc04('0x63')](_0x1a20fd)[_0xfc04('0x22')](handleEntityNotFound(_0x344d5f,null))['then'](function(_0x332c55){if(_0x332c55){if(!_[_0xfc04('0x86')](_0x332c55[_0xfc04('0x8d')])){if(fs['existsSync'](path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55['systemAvatar']))){_0x3c84a5=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55[_0xfc04('0x8d')]);}}return _0x344d5f[_0xfc04('0x89')](_0x3c84a5);}})[_0xfc04('0x2c')](handleError(_0x344d5f,null));};exports[_0xfc04('0x8e')]=function(_0x3610cd,_0x2ef341,_0x1ae391){var _0x5e9092=require('user-agent-parser');var _0x156611=new _0x5e9092();var _0x461408=_0x156611[_0xfc04('0x8f')](_0x3610cd[_0xfc04('0x90')][_0xfc04('0x91')])[_0xfc04('0x92')]();var _0x48a19f={'body':_0x3610cd[_0xfc04('0x67')],'channel':'chat'};var _0x4eaac9=[];var _0x1fcf7c=[];var _0x4240c5={};var _0x56e5bf=![];return db[_0xfc04('0x93')][_0xfc04('0x69')]()[_0xfc04('0x22')](function(_0xecb567){if(!_0xecb567){throw new db['Sequelize'][(_0xfc04('0x94'))]('no\x20available\x20attributes');}_0x4eaac9=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x1fcf7c=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3610cd[_0xfc04('0x67')]['id']){delete _0x3610cd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')]['from'])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')])||_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')]===''){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9e')+_0x1fcf7c);}if(!_['includes'](_0x1fcf7c,_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fcf7c);}_0x4240c5[_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')]]=_0x3610cd[_0xfc04('0x67')]['from'];})['then'](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3610cd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':'List','include':[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xa0'),'where':_0x4240c5,'limit':0x1,'order':[[_0xfc04('0x97'),_0xfc04('0xa1')]]}]},{'model':db[_0xfc04('0xa2')],'as':_0xfc04('0xa3')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))[_0xfc04('0x22')](function(_0x414bf7){if(_0x414bf7&&_0x414bf7[_0xfc04('0xa4')]){_0x48a19f[_0xfc04('0xa5')]=_0x414bf7;_0x48a19f['applications']=_0x414bf7['Applications'];_0x48a19f[_0xfc04('0xa6')]=_0x414bf7[_0xfc04('0xa4')];_0x48a19f[_0xfc04('0xa7')]=_[_0xfc04('0xa8')](_0x48a19f[_0xfc04('0xa7')],['priority'],[_0xfc04('0xa9')]);if(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa3')]){delete _0x48a19f[_0xfc04('0xa5')]['Applications'];}if(_0x48a19f[_0xfc04('0xa5')]['List']&&_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa4')][_0xfc04('0xa0')][_0xfc04('0x4d')]){return _0x48a19f['account'][_0xfc04('0xa4')]['Contacts'][0x0];}var _0x35588e=_[_0xfc04('0x1a')](_0x3610cd['body'],{'firstName':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x414bf7['ListId']});_0x35588e[_0x3610cd['body'][_0xfc04('0x9d')]]=_0x3610cd['body'][_0xfc04('0xaa')];return db['CmContact'][_0xfc04('0x5f')](_0x35588e,{'fields':_0x4eaac9,'raw':!![]});}})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))['then'](function(_0x19d902){_0x48a19f['contact']=_0x19d902;var _0x2fbeb8=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xab')];if(_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')]){_0x2fbeb8=_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')];}else if(_0x3610cd['headers']['x-forwarded-for']){_0x2fbeb8=_[_0xfc04('0xad')](_0x3610cd['headers'][_0xfc04('0xae')][_0xfc04('0xaf')](','));}if(_0x19d902){var _0x268065={'ContactId':_0x19d902['id'],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'from':(_0x19d902[_0xfc04('0xb0')]||'')+'\x20'+(_0x19d902[_0xfc04('0xb1')]||''),'customerIp':_0x2fbeb8,'customerPort':_0x3610cd['headers'][_0xfc04('0xb2')]?_0x3610cd[_0xfc04('0x90')][_0xfc04('0xb2')]:null,'referer':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xb3')],'browserName':_0x461408['browser'][_0xfc04('0x3e')]&&_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]?util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408[_0xfc04('0xb4')][_0xfc04('0x3e')],_0x461408['browser'][_0xfc04('0xb5')]):_0xfc04('0xb8'),'browserVersion':_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]||_0xfc04('0xb8'),'osName':util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408['os'][_0xfc04('0x3e')],_0x461408['os'][_0xfc04('0xb5')]),'osVersion':_0x461408['os'][_0xfc04('0xb5')],'deviceModel':_0x461408['device']['model']&&_0x461408[_0xfc04('0xb9')]['vendor']?util[_0xfc04('0xb6')](_0xfc04('0xba'),_0x461408[_0xfc04('0xb9')]['model'],_0x461408[_0xfc04('0xb9')]['vendor'],_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')]):null,'deviceVendor':_0x461408[_0xfc04('0xb9')][_0xfc04('0xbb')],'deviceType':_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')],'formData':JSON['stringify'](_0x3610cd[_0xfc04('0x67')])};var _0x2ca0af={'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'closed':![]};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]){_0x2ca0af['threadId']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')];return db[_0xfc04('0xbd')]['find']({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x17d1ea){if(_0x17d1ea){return[_0x17d1ea,![]];}_0x268065[_0xfc04('0xbc')]=_0x3610cd['body']['threadId'];_0x268065['externalUrl']=_0x3610cd['body'][_0xfc04('0xbe')];return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x226f0a){return[_0x226f0a,!![]];});});}_0x2ca0af[_0xfc04('0xbf')]=_0x19d902['id'];if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id']){_0x2ca0af['id']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id'];return db[_0xfc04('0xbd')][_0xfc04('0x63')]({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x3cb86a){if(_0x3cb86a){return[_0x3cb86a,![]];}return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)['then'](function(_0xd2b3de){return[_0xd2b3de,!![]];});});}return db['ChatInteraction'][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x161d95){return[_0x161d95,!![]];});}})[_0xfc04('0xc1')](function(_0x49958c,_0x2fd701){if(_0x49958c){_0x56e5bf=_0x2fd701;if(!_0x2fd701){var _0x1d25dc={'from':(_0x48a19f[_0xfc04('0xc2')]['firstName']||'')+'\x20'+(_0x48a19f[_0xfc04('0xc2')][_0xfc04('0xb1')]||'')};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]&&_0x3610cd['body']['threadId']!=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]){_0x1d25dc[_0xfc04('0xbc')]=_0x3610cd['body'][_0xfc04('0xc3')];}return _0x49958c[_0xfc04('0x38')](_0x1d25dc);}else{return _0x49958c;}}})[_0xfc04('0x22')](function(_0x29f6b8){_0x48a19f['interaction']=_0x29f6b8[_0xfc04('0x3a')]({'plain':!![]});_0x48a19f['interaction'][_0xfc04('0xc4')]=_0x56e5bf;if(_0x48a19f['interaction'][_0xfc04('0xc4')]){if(_0x48a19f[_0xfc04('0xa5')]['autoclose']){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xc5')]({'id':0x0,'priority':_0x48a19f[_0xfc04('0xa7')][_0xfc04('0x4d')]+0x1,'app':_0xfc04('0xc6'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xfc04('0xc7')][_0xfc04('0x5f')]({'body':_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'ChatInteractionId':_0x29f6b8['id'],'direction':'in','ContactId':_0x48a19f[_0xfc04('0xc2')]['id'],'AttachmentId':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc8')]});})[_0xfc04('0x22')](function(_0x532a74){_0x48a19f[_0xfc04('0x2a')]=_0x532a74;if(_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]){return db[_0xfc04('0xca')][_0xfc04('0x63')]({'attributes':['id','name'],'where':{'id':_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]}})[_0xfc04('0x22')](function(_0x586a3f){if(_0x586a3f){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x586a3f[_0xfc04('0x3e')]+','+(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xcc')]||0xa),'interval':_0xfc04('0xcd')});_0x48a19f['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfc04('0xce'),_0xfc04('0xcf'),_0x48a19f);});}return respondWithRpcPromise(_0xfc04('0xce'),'startRouting',_0x48a19f);})[_0xfc04('0x22')](function(_0x5c2e16){respondWithRpcPromise('EventManager',_0xfc04('0xd0'),{'event':_0xfc04('0x8e'),'message':_0x5c2e16},client9002);return _0x5c2e16;})['then'](respondWithResult(_0x2ef341,null))[_0xfc04('0x2c')](handleError(_0x2ef341,null));};exports['offline']=function(_0x3ab9dd,_0x332d6b,_0x515444){var _0x3a53b6,_0x295b34,_0xca2025;var _0x37cb57=[];var _0x843d8b=[];var _0x2f2231={};var _0x2b64cd=_0x3ab9dd[_0xfc04('0xd1')]||[];var _0x4ba4a3=[];var _0x375e57;return db[_0xfc04('0x93')][_0xfc04('0x69')]()['then'](function(_0x3e717d){if(!_0x3e717d){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd2'));}_0x843d8b=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x37cb57=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3ab9dd[_0xfc04('0x67')]['id']){delete _0x3ab9dd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0xaa')])){throw _0x332d6b['status'](0x1f4)['send'](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b')));}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0x67')])||_0x3ab9dd['body']['body']===''){throw _0x332d6b[_0xfc04('0x2d')](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c')));}if(_[_0xfc04('0x86')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd4')+_0x37cb57));}if(!_[_0xfc04('0xd5')](_0x37cb57,_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))]['ValidationError'](_0xfc04('0xd6')+_0x37cb57));}_0x2f2231[_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')]]=_0x3ab9dd[_0xfc04('0x67')]['from'];})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3ab9dd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':_0xfc04('0xa4')},{'model':db['MailAccount'],'as':_0xfc04('0xd7')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x332d6b,null))[_0xfc04('0x22')](function(_0x1cbc51){if(_0x1cbc51&&_0x1cbc51[_0xfc04('0xa4')]){_0x295b34=_0x1cbc51;var _0x3e3c46=_[_0xfc04('0x1a')](_0x3ab9dd[_0xfc04('0x67')],{'firstName':_0x3ab9dd[_0xfc04('0x67')]['from'],'phone':_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x1cbc51[_0xfc04('0x99')]});_0x3e3c46[_0x3ab9dd[_0xfc04('0x67')]['mapKeyOffline']]=_0x3ab9dd[_0xfc04('0x67')]['from'];return db['CmContact'][_0xfc04('0xd8')]({'where':_0x2f2231,'defaults':_0x3e3c46});}})[_0xfc04('0xc1')](function(_0x1fbc9b){if(_0x1fbc9b){_0xca2025=_0x1fbc9b;var _0x6d08a0=fs[_0xfc04('0xd9')](path[_0xfc04('0x7e')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xfc04('0xda'));var _0x5d9c9c=ejs[_0xfc04('0xdb')](_0x6d08a0,{'body':_[_0xfc04('0xdc')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0x67')]),'bodyTitle':_0x295b34[_0xfc04('0xdd')]});return db[_0xfc04('0xde')][_0xfc04('0x5f')]({'body':_0x5d9c9c,'ContactId':_0x1fbc9b['id'],'ChatWebsiteId':_0x295b34['id']});}})[_0xfc04('0x22')](function(_0xb159a1){_0x375e57=_0xb159a1;if(_0x2b64cd['length']){var _0x3234b3=_0x2b64cd[_0xfc04('0x42')](function(_0x33aa84){return{'name':_0x33aa84['originalname'],'basename':_0x33aa84[_0xfc04('0x78')],'type':_0x33aa84[_0xfc04('0xdf')],'ChatOfflineMessageId':_0xb159a1['id']};});_0x4ba4a3=_0x3234b3[_0xfc04('0x42')](_0x5cc30d=>{var _0x50c124={'filename':_0x5cc30d['name'],'path':path[_0xfc04('0x7e')](config['root'],_0xfc04('0xe0'),'files',_0xfc04('0xe1'),_0xfc04('0xe2'),_0x5cc30d[_0xfc04('0xe3')])};return _0x50c124;});if(!_0x295b34[_0xfc04('0xe4')]){return db['sequelize'][_0xfc04('0xe5')](function(_0x5d07a4){return db['Attachment'][_0xfc04('0xe6')](_0x3234b3,{'transaction':_0x5d07a4});});}}})['then'](function(){if(_0x375e57){_0x3a53b6=_0x375e57;return db[_0xfc04('0xd7')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xfc04('0xe7')],'as':_0xfc04('0xe8'),'raw':!![]}]});}})['then'](function(_0x51cf68){if(_0x51cf68&&_0x51cf68['Smtp']&&_0x295b34['forwardOffline']&&_0x295b34[_0xfc04('0xe9')]){var _0xc222b3={'tls':{'rejectUnauthorized':![]}};if(_0x51cf68[_0xfc04('0xe8')]['service']){_0xc222b3[_0xfc04('0xea')]=_0x51cf68['Smtp'][_0xfc04('0xea')];}else{_0xc222b3[_0xfc04('0xeb')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xeb')];_0xc222b3[_0xfc04('0xec')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xec')];_0xc222b3['secure']=_0x51cf68['Smtp'][_0xfc04('0xed')];}if(_0x51cf68[_0xfc04('0xe8')]['authentication']){_0xc222b3[_0xfc04('0xee')]={'user':_0x51cf68['Smtp'][_0xfc04('0x60')],'pass':_0x51cf68['Smtp'][_0xfc04('0xef')]};}return respondWithRpcPromise('SendMail',_0xfc04('0xf0'),{'account':_0xc222b3,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x51cf68[_0xfc04('0x3e')],_0x51cf68[_0xfc04('0xf1')]||_0x51cf68['Smtp'][_0xfc04('0x60')]),'to':_0x295b34['forwardOfflineAddress'],'subject':_0x295b34['offlineMessageSubject'],'html':_0x3a53b6['body'],'attachments':_0x4ba4a3}},client9003)[_0xfc04('0x22')](function(){return _0x3a53b6;})['catch'](function(_0x13ad14){console['error'](_0x13ad14);});}})['then'](function(){if(_0x295b34&&_0x295b34[_0xfc04('0xe4')]&&_0x295b34['MailAccountId']){var _0x26b203=[];if(_0x2b64cd['length']){_0x26b203=_0x2b64cd[_0xfc04('0x42')](function(_0x56d1a8){return{'name':_0x56d1a8['originalname'],'basename':_0x56d1a8[_0xfc04('0x78')],'type':_0x56d1a8['mimetype'],'ChatOfflineMessageId':_0x375e57['id']};});}var _0x4e9fae;if(!_['isNil'](_0x295b34[_0xfc04('0xf2')])){var _0x3c9f73=_['map'](_0x3ab9dd[_0xfc04('0x67')],function(_0x1e736f){return _0x1e736f;});var _0x2f215e=_[_0xfc04('0xf3')](_0x3c9f73)[0x0];var _0x2cfd60=_[_0xfc04('0xf4')](_0x2f215e,function(_0x27d3f4){return _0x27d3f4;});_0x4e9fae=_0x2cfd60[0x1][_0x295b34[_0xfc04('0xf2')]];}var _0x218341={'from':_0xca2025['email'],'firstName':_0xca2025[_0xfc04('0xb0')],'lastName':_0xca2025[_0xfc04('0xb1')],'mapKey':_0xfc04('0xf1'),'message':{'from':_0xca2025[_0xfc04('0xf1')],'to':_0x295b34[_0xfc04('0xd7')][_0xfc04('0xf1')],'cc':'','subject':_[_0xfc04('0x86')](_0x4e9fae)?_0x295b34[_0xfc04('0xf5')]:_0x4e9fae,'messageId':'','sentAt':new Date(),'attach':_0x26b203[_0xfc04('0x4d')],'attachments':_0x26b203,'originChannel':_0xfc04('0xf6'),'ChatWebsiteId':_0x295b34['id'],'ChatOfflineMessageId':_0x3a53b6['id'],'originTo':_0x295b34[_0xfc04('0xd7')]['email']},'body':_0x3a53b6[_0xfc04('0x67')]};var _0x5c1924={'account':{'id':_0x295b34[_0xfc04('0xf7')]},'body':_0x218341,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xfc04('0xf8'),_0x5c1924,client9001)[_0xfc04('0x22')](function(){return _0x3a53b6;})[_0xfc04('0x2c')](function(_0x58e085){console[_0xfc04('0x27')](_0x58e085);});}return;})['then'](function(){if(_0x3a53b6){return _0x3a53b6;}})['then'](respondWithResult(_0x332d6b,null))[_0xfc04('0x2c')](function(_0x2fb138){console['error'](_0xfc04('0x2c'),_0x2fb138);for(var _0x14dfc3 of _0x2b64cd){var _0x1d6b67=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0xe0'),_0xfc04('0xd1'),'attachments','offline-chat',_0x14dfc3[_0xfc04('0x78')]);fs_extra['remove'](_0x1d6b67)[_0xfc04('0x2c')](function(_0x921364){console[_0xfc04('0x27')](_0xfc04('0xf9'),_0x1d6b67,_0x921364);});}});};exports[_0xfc04('0xfa')]=function(_0x279702,_0x560b65,_0x19ce19){return db[_0xfc04('0xbd')]['find']({'where':{'id':_0x279702[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x560b65,null))['then'](function(_0x4bba70){if(_0x4bba70){return _0x4bba70[_0xfc04('0xfa')](_0x279702[_0xfc04('0x67')][_0xfc04('0x70')],_[_0xfc04('0xfb')](_0x279702[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})[_0xfc04('0x22')](respondWithResult(_0x560b65,null))['catch'](handleError(_0x560b65,null));};exports[_0xfc04('0xfc')]=function(_0xd11fb,_0x2d3dda,_0x590501){var _0x4de7b7={'raw':![],'where':{}};var _0x3abe26={};var _0x284ab9={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0xd11fb[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2d3dda,null))[_0xfc04('0x22')](function(_0x43160c){if(_0x43160c){_0x3abe26[_0xfc04('0x46')]=_[_0xfc04('0x48')](db['ChatInteraction'][_0xfc04('0x43')]);_0x3abe26['query']=_['keys'](_0xd11fb[_0xfc04('0x47')]);_0x3abe26[_0xfc04('0x49')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],_0x3abe26[_0xfc04('0x47')]);_0x4de7b7[_0xfc04('0x4c')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x4de7b7[_0xfc04('0x4c')]=_0x4de7b7[_0xfc04('0x4c')]['length']?_0x4de7b7[_0xfc04('0x4c')]:_0x3abe26[_0xfc04('0x46')];if(!_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x4de7b7[_0xfc04('0x32')]=qs['limit'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4de7b7[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x4de7b7[_0xfc04('0x50')]=qs['sort'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4de7b7[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0xd11fb[_0xfc04('0x47')],_0x3abe26[_0xfc04('0x49')]));_0x4de7b7[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x43160c['id'];if(_0xd11fb['query'][_0xfc04('0x54')]){_0x4de7b7[_0xfc04('0x52')]=_['merge'](_0x4de7b7[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x4de7b7['attributes'],function(_0x435600){var _0x5731c0={};_0x5731c0[_0x435600]={'$like':'%'+_0xd11fb[_0xfc04('0x47')]['filter']+'%'};return _0x5731c0;})});}_0x4de7b7=_[_0xfc04('0x57')]({},_0x4de7b7,_0xd11fb[_0xfc04('0x58')]);return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':_0x4de7b7[_0xfc04('0x52')]})[_0xfc04('0x22')](function(_0x45ce8c){_0x284ab9['count']=_0x45ce8c;if(_0xd11fb['query'][_0xfc04('0x59')]){_0x4de7b7[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xfd'),'required':![]},{'model':db[_0xfc04('0xca')],'as':_0xfc04('0xfe'),'attributes':[_0xfc04('0x3e'),_0xfc04('0xff'),_0xfc04('0x100')],'required':![]},{'model':db[_0xfc04('0x101')],'as':_0xfc04('0x102'),'attributes':['id',_0xfc04('0x3e'),_0xfc04('0x103')],'where':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?{'id':_0xd11fb['query'][_0xfc04('0x104')]}:undefined,'required':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?!![]:![]}];}return db[_0xfc04('0xbd')][_0xfc04('0x6e')](_0x4de7b7);})[_0xfc04('0x22')](function(_0x4f2dca){_0x284ab9['rows']=_0x4f2dca;return _0x284ab9;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x2d3dda,_0x4de7b7))[_0xfc04('0x2c')](handleError(_0x2d3dda,null));};function iftimePromise(_0x49b35c,_0x423b1a){return respondWithRpcPromise(_0xfc04('0x105'),_0xfc04('0x106'),{'command':_0x423b1a[_0xfc04('0x107')]?util[_0xfc04('0xb6')](_0xfc04('0x108'),_0x49b35c[_0xfc04('0x109')],_0x423b1a[_0xfc04('0x107')]):util[_0xfc04('0xb6')](_0xfc04('0x10a'),_0x49b35c['interval'])},client9002)[_0xfc04('0x22')](function(_0x37e748){var _0x4dfcdf=_0x37e748&&_0x37e748[_0xfc04('0x10b')]('true')>=0x0?!![]:![];logger[_0xfc04('0x23')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c['interval'],_0x4dfcdf?_0xfc04('0x10d'):'OFFLINE',_0x423b1a[_0xfc04('0x107')]?_0x423b1a[_0xfc04('0x107')]:_0xfc04('0x10e'));return _0x4dfcdf;})[_0xfc04('0x2c')](function(_0x18a6b4){logger[_0xfc04('0x27')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c[_0xfc04('0x109')],util[_0xfc04('0x10f')](_0x18a6b4,{'showHidden':![],'depth':null}),_0x423b1a['timezone']?_0x423b1a['timezone']:'No\x20timezone');return![];});}exports[_0xfc04('0x106')]=function(_0x18c462,_0x1afa9f,_0x22ed68){var _0x22c8cf=0x0;var _0x2ed40b=0x0;var _0x1b8422=![];var _0x528e8f;var _0x4ba54c;return db['ChatWebsite']['find']({'where':{'id':_0x18c462['params']['id']},'include':[{'model':db['Interval'],'as':_0xfc04('0x110'),'include':[{'model':db[_0xfc04('0x110')],'as':_0xfc04('0x111'),'attributes':['id',_0xfc04('0x109')],'raw':!![]}]}]})[_0xfc04('0x22')](handleEntityNotFound(_0x1afa9f,null))[_0xfc04('0x22')](function(_0x110b18){if(_0x110b18){_0x528e8f=_0x110b18;return _0x110b18['getProactiveActions']({'raw':!![]});}})[_0xfc04('0x22')](function(_0x344550){if(_0x528e8f){if(_0x344550){_0x4ba54c=_0x344550;}}return require(_0xfc04('0x17'))[_0xfc04('0x81')]();})['then'](function(_0x39fc75){if(_0x39fc75){_0x2ed40b=_0x39fc75['virtual'];_0x1b8422=_0x39fc75[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':{'closed':![]}});})['then'](function(_0x381e8f){_0x22c8cf=_0x381e8f;if(_0x2ed40b&&_0x381e8f>_0x2ed40b){return db['License']['findOne']({'where':{'id':0x1}})[_0xfc04('0x22')](function(_0x21d0a6){if(_0x21d0a6){_0x21d0a6[_0xfc04('0x112')](_0xfc04('0x113'));}});}})['then'](function(){if(_0x528e8f['Interval']&&_0x528e8f[_0xfc04('0x110')][_0xfc04('0x111')]){var _0x525a37=[];for(var _0xcec488=0x0;_0xcec488<_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xfc04('0x4d')];_0xcec488++){var _0x40e63c=_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xcec488][_0xfc04('0x3a')]({'plain':!![]});_0x525a37[_0xfc04('0xc5')](iftimePromise(_0x40e63c,_0x528e8f));}return BPromise['all'](_0x525a37)['then'](function(_0x553a9d){return _['some'](_0x553a9d);});}else{return!![];}})[_0xfc04('0x22')](function(_0x7fe9a5){var _0x17f5b0=fs['readFileSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x114')),_0xfc04('0xda'));var _0x4e0bc4={'remote':_0x528e8f[_0xfc04('0x115')],'query':querystring['stringify'](_['merge'](_0x528e8f[_0xfc04('0x3a')]({'plain':!![]}),{'customerIp':_0x18c462['headers'][_0xfc04('0xae')]||_0x18c462[_0xfc04('0x90')][_0xfc04('0x116')]||_0x18c462[_0xfc04('0x117')][_0xfc04('0x118')]||_0x18c462['ip'],'referer':_0x18c462[_0xfc04('0x90')][_0xfc04('0xb3')],'openedInteractions':_0x22c8cf,'maxInteractions':_0x2ed40b,'virtual':_0x1b8422['virtual'],'online':_0x7fe9a5,'custom':_0x1b8422}))[_0xfc04('0x119')](/'/g,'\x5c\x27')};_0x1afa9f[_0xfc04('0x3f')](ejs[_0xfc04('0xdb')](Mustache[_0xfc04('0xdb')](_0x17f5b0,_0x4e0bc4),{'proactiveActions':_0x4ba54c,'alignment':_0x528e8f[_0xfc04('0x11a')],'verticalAlignment':_0x528e8f[_0xfc04('0x11b')],'div_color':_0x528e8f[_0xfc04('0x103')],'text_color':_0x528e8f[_0xfc04('0x11c')],'button_color':_0x528e8f[_0xfc04('0x11d')],'background_color':_0x528e8f[_0xfc04('0x11e')]}));})[_0xfc04('0x2c')](handleError(_0x1afa9f,null));};exports[_0xfc04('0x11f')]=function(_0x3a59e9,_0x39056d,_0x2c70be){return db['ChatWebsite']['findOne']({'where':{'id':_0x3a59e9['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x39056d,null))[_0xfc04('0x22')](function(_0x24c2e3){if(_0x24c2e3){return db[_0xfc04('0x120')][_0xfc04('0xe5')](function(_0x5cb436){return db[_0xfc04('0xa2')][_0xfc04('0x39')]({'where':{'ChatWebsiteId':_0x3a59e9[_0xfc04('0x5d')]['id']},'transaction':_0x5cb436})['then'](function(_0x2a0a3){var _0x19cd20=_['map'](_0x3a59e9[_0xfc04('0x67')],function(_0x21f5cf){_0x21f5cf[_0xfc04('0x6b')]=_0x3a59e9['params']['id'];return _0x21f5cf;});return db['ChatApplication'][_0xfc04('0xe6')](_0x19cd20,{'transaction':_0x5cb436});});})['then'](function(){return db['ChatApplication'][_0xfc04('0x121')]({'where':{'ChatWebsiteId':_0x3a59e9['params']['id']},'order':'priority'});});}})[_0xfc04('0x22')](respondWithResult(_0x39056d,null))[_0xfc04('0x2c')](handleError(_0x39056d,null));};exports['getApplications']=function(_0x3898e5,_0x21430d,_0x5b5c22){var _0x3cf178={};var _0xa638a7={};var _0x574cae;var _0x28925b;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x3898e5['params']['id']}})['then'](handleEntityNotFound(_0x21430d,null))['then'](function(_0x6facfe){if(_0x6facfe){_0x574cae=_0x6facfe;_0xa638a7[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0xa2')]['rawAttributes']);_0xa638a7[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x3898e5[_0xfc04('0x47')]);_0xa638a7[_0xfc04('0x49')]=_['intersection'](_0xa638a7[_0xfc04('0x46')],_0xa638a7['query']);_0x3cf178[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0xa638a7[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x3cf178[_0xfc04('0x4c')]=_0x3cf178['attributes']['length']?_0x3cf178['attributes']:_0xa638a7['model'];_0x3cf178[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x51')]);_0x3cf178[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_['pick'](_0x3898e5[_0xfc04('0x47')],_0xa638a7[_0xfc04('0x49')]));if(_0x3898e5['query'][_0xfc04('0x54')]){_0x3cf178[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x3cf178[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x3cf178[_0xfc04('0x4c')],function(_0x56f0f5){var _0x50cf7c={};_0x50cf7c[_0x56f0f5]={'$like':'%'+_0x3898e5[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x50cf7c;})});}_0x3cf178=_[_0xfc04('0x57')]({},_0x3cf178,_0x3898e5['options']);return _0x574cae['getApplications'](_0x3cf178);}})['then'](function(_0x339aca){if(_0x339aca){_0x28925b=_0x339aca[_0xfc04('0x4d')];if(!_0x3898e5['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x3cf178['limit']=qs[_0xfc04('0x32')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x32')]);_0x3cf178['offset']=qs[_0xfc04('0x30')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x574cae['getApplications'](_0x3cf178);}})[_0xfc04('0x22')](function(_0x34a2ba){if(_0x34a2ba){return _0x34a2ba?{'count':_0x28925b,'rows':_0x34a2ba}:null;}})[_0xfc04('0x22')](respondWithResult(_0x21430d,null))[_0xfc04('0x2c')](handleError(_0x21430d,null));};exports[_0xfc04('0x123')]=function(_0x339192,_0x3d08ae,_0x1e7fae){return db[_0xfc04('0x124')][_0xfc04('0x63')]({'where':{'id':_0x339192[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3d08ae,null))[_0xfc04('0x22')](function(_0x344a3d){if(_0x344a3d){return _0x344a3d['addProactiveActions'](_0x339192[_0xfc04('0x67')][_0xfc04('0x70')],_['omit'](_0x339192[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3d08ae,null))[_0xfc04('0x2c')](handleError(_0x3d08ae,null));};exports[_0xfc04('0x125')]=function(_0x5b6193,_0x2dc7e0,_0x2f5aea){var _0x22016b={};var _0x194577={};var _0x1f9730;var _0x37ddfb;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x5b6193['params']['id']}})['then'](handleEntityNotFound(_0x2dc7e0,null))[_0xfc04('0x22')](function(_0x1792d5){if(_0x1792d5){_0x1f9730=_0x1792d5;_0x194577[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x126')][_0xfc04('0x43')]);_0x194577[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x5b6193[_0xfc04('0x47')]);_0x194577[_0xfc04('0x49')]=_['intersection'](_0x194577['model'],_0x194577[_0xfc04('0x47')]);_0x22016b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x194577[_0xfc04('0x46')],qs['fields'](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x22016b['attributes']=_0x22016b[_0xfc04('0x4c')]['length']?_0x22016b['attributes']:_0x194577[_0xfc04('0x46')];_0x22016b[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x5b6193[_0xfc04('0x47')]['sort']);_0x22016b[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x5b6193[_0xfc04('0x47')],_0x194577[_0xfc04('0x49')]));if(_0x5b6193['query'][_0xfc04('0x54')]){_0x22016b[_0xfc04('0x52')]=_['merge'](_0x22016b[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x22016b[_0xfc04('0x4c')],function(_0x265eef){var _0x5a6d92={};_0x5a6d92[_0x265eef]={'$like':'%'+_0x5b6193[_0xfc04('0x47')]['filter']+'%'};return _0x5a6d92;})});}_0x22016b=_[_0xfc04('0x57')]({},_0x22016b,_0x5b6193['options']);return _0x1f9730['getProactiveActions'](_0x22016b);}})[_0xfc04('0x22')](function(_0x442aa6){if(_0x442aa6){_0x37ddfb=_0x442aa6['length'];if(!_0x5b6193[_0xfc04('0x47')]['hasOwnProperty']('nolimit')){_0x22016b[_0xfc04('0x32')]=qs['limit'](_0x5b6193['query'][_0xfc04('0x32')]);_0x22016b[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x1f9730[_0xfc04('0x125')](_0x22016b);}})[_0xfc04('0x22')](function(_0x1086bc){if(_0x1086bc){return _0x1086bc?{'count':_0x37ddfb,'rows':_0x1086bc}:null;}})['then'](respondWithResult(_0x2dc7e0,null))['catch'](handleError(_0x2dc7e0,null));};exports[_0xfc04('0x127')]=function(_0xb28a49,_0x506bf4,_0x176f7f){var _0x3b2f7d=_0xb28a49['query'][_0xfc04('0x128')]===_0xfc04('0x129')?_0xfc04('0x12a'):'onlineForm';return db['ChatWebsite'][_0xfc04('0x63')]({'attributes':['id',_0x3b2f7d],'where':{'id':_0xb28a49['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x506bf4,null))['then'](function(_0x399679){if(_0x399679){var _0x2c0ba8=_0x399679[_0x3b2f7d];var _0x1e051c=_0x2c0ba8&&_0x2c0ba8[_0xfc04('0x12b')]?_0x2c0ba8[_0xfc04('0x12b')]:[];_0x506bf4[_0xfc04('0x3f')]({'fromKey':_[_0xfc04('0x86')](_0x2c0ba8['fromKey'])?undefined:_0x2c0ba8['fromKey'],'count':_0x1e051c['length'],'rows':_0x1e051c});}})['catch'](handleError(_0x506bf4,null));};exports[_0xfc04('0x12c')]=function(_0x496f22,_0x597cc2,_0xbb1255){var _0x4427c5={'raw':![],'where':{}};var _0x2320f0={};var _0x55d937={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x496f22[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x597cc2,null))['then'](function(_0x421152){if(_0x421152){_0x2320f0[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xde')][_0xfc04('0x43')]);_0x2320f0['query']=_[_0xfc04('0x48')](_0x496f22[_0xfc04('0x47')]);_0x2320f0[_0xfc04('0x49')]=_['intersection'](_0x2320f0[_0xfc04('0x46')],_0x2320f0[_0xfc04('0x47')]);_0x4427c5[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2320f0[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x496f22[_0xfc04('0x47')]['fields']));_0x4427c5[_0xfc04('0x4c')]=_0x4427c5[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x4427c5[_0xfc04('0x4c')]:_0x2320f0[_0xfc04('0x46')];if(!_0x496f22['query']['hasOwnProperty']('nolimit')){_0x4427c5['limit']=qs[_0xfc04('0x32')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4427c5['offset']=qs[_0xfc04('0x30')](_0x496f22['query'][_0xfc04('0x30')]);}_0x4427c5[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4427c5['where']=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x496f22[_0xfc04('0x47')],_0x2320f0[_0xfc04('0x49')]));_0x4427c5[_0xfc04('0x52')]['ChatWebsiteId']=_0x421152['id'];if(_0x496f22['query'][_0xfc04('0x54')]){_0x4427c5[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x4427c5['where'],{'$or':_['map'](_0x4427c5[_0xfc04('0x4c')],function(_0x363a99){var _0x2ca98f={};_0x2ca98f[_0x363a99]={'$like':'%'+_0x496f22[_0xfc04('0x47')]['filter']+'%'};return _0x2ca98f;})});}_0x4427c5=_['merge']({},_0x4427c5,_0x496f22[_0xfc04('0x58')]);return db['ChatOfflineMessage'][_0xfc04('0x33')]({'where':_0x4427c5['where']})['then'](function(_0x501ca1){_0x55d937['count']=_0x501ca1;if(_0x496f22[_0xfc04('0x47')][_0xfc04('0x59')]){_0x4427c5[_0xfc04('0x5e')]=[{'all':!![]}];}else{_0x4427c5[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xfc04('0xde')][_0xfc04('0x6e')](_0x4427c5);})[_0xfc04('0x22')](function(_0x24d194){_0x55d937[_0xfc04('0x5b')]=_0x24d194;return _0x55d937;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x597cc2,_0x4427c5))[_0xfc04('0x2c')](handleError(_0x597cc2,null));};exports['addAgents']=function(_0x25d77,_0x2329de,_0x5beece){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x25d77['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2329de,null))['then'](function(_0x18e5eb){if(_0x18e5eb){return _0x18e5eb[_0xfc04('0x12d')](_0x25d77[_0xfc04('0x67')]['ids'],_[_0xfc04('0xfb')](_0x25d77[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{})[_0xfc04('0xc1')](function(_0x22e36b){for(var _0x474341=0x0;_0x474341<_0x25d77[_0xfc04('0x67')]['ids'][_0xfc04('0x4d')];_0x474341+=0x1){socket['emit'](_0xfc04('0x12e'),{'UserId':Number(_0x25d77[_0xfc04('0x67')]['ids'][_0x474341]),'ChatWebsiteId':Number(_0x25d77[_0xfc04('0x5d')]['id'])});}return _0x22e36b;});}})[_0xfc04('0x22')](respondWithResult(_0x2329de,null))['catch'](handleError(_0x2329de,null));};exports[_0xfc04('0x12f')]=function(_0xb16b8f,_0x2a2e2d,_0x1f1a7a){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0xb16b8f[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2a2e2d,null))[_0xfc04('0x22')](function(_0x31f579){if(_0x31f579){return _0x31f579[_0xfc04('0x12f')](_0xb16b8f[_0xfc04('0x47')]['ids'])['then'](function(){if(_[_0xfc04('0x130')](_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')])){for(var _0x48304f=0x0;_0x48304f<_0xb16b8f[_0xfc04('0x47')]['ids']['length'];_0x48304f+=0x1){socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f['query']['ids'][_0x48304f]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}}else{socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a2e2d,null))['catch'](handleError(_0x2a2e2d,null));};exports[_0xfc04('0x133')]=function(_0x4f0ed0,_0xbb0f91,_0x4398f4){var _0x1624d0={};var _0x3e8dea={};var _0x154f95;var _0x1d15b8;return db['ChatWebsite']['findOne']({'where':{'id':_0x4f0ed0[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xbb0f91,null))['then'](function(_0x1d120b){if(_0x1d120b){_0x154f95=_0x1d120b;_0x3e8dea[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xca')][_0xfc04('0x43')]);_0x3e8dea[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x4f0ed0[_0xfc04('0x47')]);_0x3e8dea[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x3e8dea['model'],_0x3e8dea[_0xfc04('0x47')]);_0x1624d0[_0xfc04('0x4c')]=_['intersection'](_0x3e8dea[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x4f0ed0['query']['fields']));_0x1624d0[_0xfc04('0x4c')]=_0x1624d0[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x1624d0[_0xfc04('0x4c')]:_0x3e8dea[_0xfc04('0x46')];_0x1624d0[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x51')]);_0x1624d0[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x4f0ed0[_0xfc04('0x47')],_0x3e8dea[_0xfc04('0x49')]));if(_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]){_0x1624d0[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x1624d0['where'],{'$or':_[_0xfc04('0x42')](_0x1624d0[_0xfc04('0x4c')],function(_0x3f2e2e){var _0xe6baf={};_0xe6baf[_0x3f2e2e]={'$like':'%'+_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0xe6baf;})});}_0x1624d0=_[_0xfc04('0x57')]({},_0x1624d0,_0x4f0ed0['options']);return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2ae1a1){if(_0x2ae1a1){_0x1d15b8=_0x2ae1a1['length'];if(!_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x4e')]('nolimit')){_0x1624d0['limit']=qs[_0xfc04('0x32')](_0x4f0ed0[_0xfc04('0x47')]['limit']);_0x1624d0[_0xfc04('0x30')]=qs['offset'](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2599fd){if(_0x2599fd){return _0x2599fd?{'count':_0x1d15b8,'rows':_0x2599fd}:null;}})[_0xfc04('0x22')](respondWithResult(_0xbb0f91,null))['catch'](handleError(_0xbb0f91,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index fc97dbc..2705604 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 _0x35d0=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x35d0,0xf9));var _0x035d=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x35d0[_0x330723];return _0x60c546;};'use strict';var EventEmitter=require(_0x035d('0x0'));var ChatWebsite=require(_0x035d('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x035d('0x2')](0x0);var events={'afterCreate':_0x035d('0x3'),'afterUpdate':_0x035d('0x4'),'afterDestroy':_0x035d('0x5')};function emitEvent(_0x12fb05){return function(_0x16388a,_0x51fe09,_0x2a4bb2){ChatWebsiteEvents[_0x035d('0x6')](_0x12fb05+':'+_0x16388a['id'],_0x16388a);ChatWebsiteEvents[_0x035d('0x6')](_0x12fb05,_0x16388a);_0x2a4bb2(null);};}for(var e in events){if(events[_0x035d('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x035d('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe0c3=['events','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x1cdac4,_0x45db76){var _0xa4a3cb=function(_0x32a0f0){while(--_0x32a0f0){_0x1cdac4['push'](_0x1cdac4['shift']());}};_0xa4a3cb(++_0x45db76);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3e0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':_0x3e0c('0x3'),'afterUpdate':_0x3e0c('0x4'),'afterDestroy':_0x3e0c('0x5')};function emitEvent(_0x410ec4){return function(_0x31851c,_0x26c964,_0x1a026f){ChatWebsiteEvents['emit'](_0x410ec4+':'+_0x31851c['id'],_0x31851c);ChatWebsiteEvents['emit'](_0x410ec4,_0x31851c);_0x1a026f(null);};}for(var e in events){if(events[_0x3e0c('0x6')](e)){var event=events[e];ChatWebsite[_0x3e0c('0x7')](e,emitEvent(event));}}module[_0x3e0c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d044126..ff39b1c 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 _0x7825=['define','ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4f2dd0,_0x4cb95c){var _0x440de5=function(_0x977a8e){while(--_0x977a8e){_0x4f2dd0['push'](_0x4f2dd0['shift']());}};_0x440de5(++_0x4cb95c);}(_0x7825,0x122));var _0x5782=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0x7825[_0x54597a];return _0x5a764f;};'use strict';var _=require(_0x5782('0x0'));var util=require(_0x5782('0x1'));var logger=require(_0x5782('0x2'))('api');var moment=require(_0x5782('0x3'));var BPromise=require(_0x5782('0x4'));var rp=require(_0x5782('0x5'));var fs=require('fs');var path=require(_0x5782('0x6'));var rimraf=require('rimraf');var config=require(_0x5782('0x7'));var attributes=require(_0x5782('0x8'));module[_0x5782('0x9')]=function(_0x5035ee,_0x59e4f6){return _0x5035ee[_0x5782('0xa')](_0x5782('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6766=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6766,0x1f2));var _0x6676=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x6766[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x6676('0x0'));var util=require(_0x6676('0x1'));var logger=require(_0x6676('0x2'))(_0x6676('0x3'));var moment=require(_0x6676('0x4'));var BPromise=require(_0x6676('0x5'));var rp=require(_0x6676('0x6'));var fs=require('fs');var path=require(_0x6676('0x7'));var rimraf=require(_0x6676('0x8'));var config=require(_0x6676('0x9'));var attributes=require(_0x6676('0xa'));module['exports']=function(_0x14c67c,_0x319e6){return _0x14c67c[_0x6676('0xb')](_0x6676('0xc'),attributes,{'tableName':'chat_websites','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 231137e..4498946 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 _0x5a1c=['error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4ca90b,_0x21164d){var _0x55ab04=function(_0x36fe20){while(--_0x36fe20){_0x4ca90b['push'](_0x4ca90b['shift']());}};_0x55ab04(++_0x21164d);}(_0x5a1c,0xd6));var _0xc5a1=function(_0x74658d,_0x2e04ca){_0x74658d=_0x74658d-0x0;var _0x2c5d24=_0x5a1c[_0x74658d];return _0x2c5d24;};'use strict';var _=require('lodash');var util=require(_0xc5a1('0x0'));var moment=require('moment');var BPromise=require(_0xc5a1('0x1'));var rs=require(_0xc5a1('0x2'));var fs=require('fs');var Redis=require(_0xc5a1('0x3'));var db=require(_0xc5a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a1('0x7'));var client=jayson[_0xc5a1('0x8')][_0xc5a1('0x9')]({'port':0x232a});config[_0xc5a1('0xa')]=_[_0xc5a1('0xb')](config[_0xc5a1('0xa')],{'host':_0xc5a1('0xc'),'port':0x18eb});var socket=require(_0xc5a1('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xc5a1('0xe')](socket);function respondWithRpcPromise(_0x1e3032,_0x2afd71,_0x3421bc){return new BPromise(function(_0x57c2ee,_0xb6d372){return client[_0xc5a1('0xf')](_0x1e3032,_0x3421bc)[_0xc5a1('0x10')](function(_0x459e09){logger[_0xc5a1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,'request\x20sent');logger['debug'](_0xc5a1('0x12'),_0x2afd71,_0xc5a1('0x13'),JSON['stringify'](_0x459e09));if(_0x459e09['error']){if(_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x15')]===0x1f4){logger[_0xc5a1('0x14')](_0xc5a1('0x16'),_0x2afd71,_0x459e09[_0xc5a1('0x14')]['message']);return _0xb6d372(_0x459e09['error'][_0xc5a1('0x17')]);}logger[_0xc5a1('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x17')]);return _0x57c2ee(_0x459e09[_0xc5a1('0x14')][_0xc5a1('0x17')]);}else{logger[_0xc5a1('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2afd71,'request\x20sent');_0x57c2ee(_0x459e09[_0xc5a1('0x18')][_0xc5a1('0x17')]);}})[_0xc5a1('0x19')](function(_0x1a017c){logger[_0xc5a1('0x14')](_0xc5a1('0x16'),_0x2afd71,_0x1a017c);_0xb6d372(_0x1a017c);});});}
\ No newline at end of file
+var _0xaab5=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2bd5ec,_0x467020){var _0x5cebbb=function(_0x3ff0c7){while(--_0x3ff0c7){_0x2bd5ec['push'](_0x2bd5ec['shift']());}};_0x5cebbb(++_0x467020);}(_0xaab5,0x1e0));var _0x5aab=function(_0x40e65b,_0x51a4c1){_0x40e65b=_0x40e65b-0x0;var _0x329dba=_0xaab5[_0x40e65b];return _0x329dba;};'use strict';var _=require('lodash');var util=require(_0x5aab('0x0'));var moment=require(_0x5aab('0x1'));var BPromise=require(_0x5aab('0x2'));var rs=require(_0x5aab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5aab('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5aab('0x5'));var jayson=require(_0x5aab('0x6'));var client=jayson[_0x5aab('0x7')][_0x5aab('0x8')]({'port':0x232a});config[_0x5aab('0x9')]=_[_0x5aab('0xa')](config[_0x5aab('0x9')],{'host':_0x5aab('0xb'),'port':0x18eb});var socket=require(_0x5aab('0xc'))(new Redis(config[_0x5aab('0x9')]));require(_0x5aab('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ca3f3,_0x156757,_0x5f1334){return new BPromise(function(_0xb88f24,_0x128bb6){return client['request'](_0x1ca3f3,_0x5f1334)['then'](function(_0xeeaac9){logger[_0x5aab('0xe')](_0x5aab('0xf'),_0x156757,_0x5aab('0x10'));logger[_0x5aab('0x11')](_0x5aab('0x12'),_0x156757,_0x5aab('0x10'),JSON[_0x5aab('0x13')](_0xeeaac9));if(_0xeeaac9[_0x5aab('0x14')]){if(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x15')]===0x1f4){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9['error']['message']);return _0x128bb6(_0xeeaac9[_0x5aab('0x14')]['message']);}logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9[_0x5aab('0x14')]['message']);return _0xb88f24(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x16')]);}else{logger['info'](_0x5aab('0xf'),_0x156757,'request\x20sent');_0xb88f24(_0xeeaac9['result'][_0x5aab('0x16')]);}})[_0x5aab('0x17')](function(_0x2a4398){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0x2a4398);_0x128bb6(_0x2a4398);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index a719c67..cf04254 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 _0xe6a8=['removeListener','register','length','chatWebsite:','./chatWebsite.events','emit'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xe6a8,0x1c6));var _0x8e6a=function(_0x24378d,_0x253b49){_0x24378d=_0x24378d-0x0;var _0x56c4e0=_0xe6a8[_0x24378d];return _0x56c4e0;};'use strict';var ChatWebsiteEvents=require(_0x8e6a('0x0'));var events=['save','remove','update'];function createListener(_0x51fbb5,_0x1c1ff0){return function(_0x4fbe7d){_0x1c1ff0[_0x8e6a('0x1')](_0x51fbb5,_0x4fbe7d);};}function removeListener(_0x631e69,_0x32661d){return function(){ChatWebsiteEvents[_0x8e6a('0x2')](_0x631e69,_0x32661d);};}exports[_0x8e6a('0x3')]=function(_0x4a30f3){for(var _0x41d48b=0x0,_0x367889=events[_0x8e6a('0x4')];_0x41d48b<_0x367889;_0x41d48b++){var _0x403bfd=events[_0x41d48b];var _0x207977=createListener(_0x8e6a('0x5')+_0x403bfd,_0x4a30f3);ChatWebsiteEvents['on'](_0x403bfd,_0x207977);}};
\ No newline at end of file
+var _0xe9f0=['./chatWebsite.events','save','remove','update','emit','removeListener','length','chatWebsite:'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0xe9f0,0x140));var _0x0e9f=function(_0x1ee568,_0x5593b7){_0x1ee568=_0x1ee568-0x0;var _0x52c783=_0xe9f0[_0x1ee568];return _0x52c783;};'use strict';var ChatWebsiteEvents=require(_0x0e9f('0x0'));var events=[_0x0e9f('0x1'),_0x0e9f('0x2'),_0x0e9f('0x3')];function createListener(_0x4258b8,_0x36a4bc){return function(_0x1ef4e5){_0x36a4bc[_0x0e9f('0x4')](_0x4258b8,_0x1ef4e5);};}function removeListener(_0x49487e,_0x578c92){return function(){ChatWebsiteEvents[_0x0e9f('0x5')](_0x49487e,_0x578c92);};}exports['register']=function(_0x11f26c){for(var _0x9b7ee1=0x0,_0x300e9e=events[_0x0e9f('0x6')];_0x9b7ee1<_0x300e9e;_0x9b7ee1++){var _0x19e41d=events[_0x9b7ee1];var _0x28da26=createListener(_0x0e9f('0x7')+_0x19e41d,_0x11f26c);ChatWebsiteEvents['on'](_0x19e41d,_0x28da26);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index ce3f9ba..2bb364e 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 _0xa6e5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','util','connect-timeout'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa6e5,0x1a7));var _0x5a6e=function(_0xb5f5b3,_0x97d715){_0xb5f5b3=_0xb5f5b3-0x0;var _0x38d5b0=_0xa6e5[_0xb5f5b3];return _0x38d5b0;};'use strict';var multer=require(_0x5a6e('0x0'));var util=require(_0x5a6e('0x1'));var path=require('path');var timeout=require(_0x5a6e('0x2'));var express=require('express');var router=express[_0x5a6e('0x3')]();var fs_extra=require(_0x5a6e('0x4'));var auth=require(_0x5a6e('0x5'));var interaction=require(_0x5a6e('0x6'));var config=require(_0x5a6e('0x7'));var controller=require(_0x5a6e('0x8'));router[_0x5a6e('0x9')]('/',auth['isAuthenticated'](),controller[_0x5a6e('0xa')]);router[_0x5a6e('0x9')]('/describe',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0xc')]);router['get'](_0x5a6e('0xd'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5a6e('0xf')]);router['get'](_0x5a6e('0x10'),auth[_0x5a6e('0xb')](),controller['getAnswers']);router[_0x5a6e('0x9')](_0x5a6e('0x11'),controller[_0x5a6e('0x12')]);router[_0x5a6e('0x9')](_0x5a6e('0x13'),controller[_0x5a6e('0x14')]);router[_0x5a6e('0x9')](_0x5a6e('0x15'),controller[_0x5a6e('0x16')]);router[_0x5a6e('0x9')](_0x5a6e('0x17'),controller['getSystemAvatar']);router[_0x5a6e('0x9')]('/:id/interactions',auth[_0x5a6e('0xb')](),controller['getInteractions']);router['get'](_0x5a6e('0x18'),controller[_0x5a6e('0x19')]);router[_0x5a6e('0x9')](_0x5a6e('0x1a'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x1b')]);router['get'](_0x5a6e('0x1c'),auth['isAuthenticated'](),controller[_0x5a6e('0x1d')]);router[_0x5a6e('0x9')]('/:id/fields',controller[_0x5a6e('0x1e')]);router[_0x5a6e('0x9')]('/:id/offline_messages',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x1f')]);router[_0x5a6e('0x9')](_0x5a6e('0x20'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x21')]);router[_0x5a6e('0x22')]('/',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x23')]);router[_0x5a6e('0x22')](_0x5a6e('0x24'),auth['isAuthenticated'](),controller[_0x5a6e('0x25')]);router['post'](_0x5a6e('0x10'),auth['isAuthenticated'](),controller[_0x5a6e('0x26')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x3f4d5e,_0x59c536,_0x6f700f){_0x6f700f(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],'server/files/images/logos/'));},'filename':function(_0x7e65a4,_0x3fb317,_0x5d94b6){_0x5d94b6(null,util['format'](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x3fb317[_0x5a6e('0x2c')]));}})});router[_0x5a6e('0x22')](_0x5a6e('0x11'),upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x2f')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x5d7cc5,_0x1590ed,_0x4d5a64){_0x4d5a64(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0xef61e9,_0x4c4c9f,_0x16a52a){_0x16a52a(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x4c4c9f['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x5a6e('0x2e')),controller[_0x5a6e('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12904e,_0x475b76,_0x1b0965){_0x1b0965(null,path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0x419fa0,_0x2668ac,_0x46646e){_0x46646e(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date[_0x5a6e('0x2b')](),_0x2668ac[_0x5a6e('0x2c')]));}})});router[_0x5a6e('0x22')]('/:id/customer_avatar',upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x33')]);var upload=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x431b70,_0x21a147,_0x103987){_0x103987(null,path['join'](config[_0x5a6e('0x29')],_0x5a6e('0x30')));},'filename':function(_0x120af2,_0x16da75,_0xdfdee7){_0xdfdee7(null,util[_0x5a6e('0x31')](_0x5a6e('0x2a'),Date['now'](),_0x16da75[_0x5a6e('0x2c')]));}})});router['post'](_0x5a6e('0x17'),upload[_0x5a6e('0x2d')](_0x5a6e('0x2e')),controller[_0x5a6e('0x34')]);router[_0x5a6e('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5a6e('0x27')]({'destination':function(_0x321d3f,_0x1bda36,_0x5dbecb){const _0x49a0a7=path[_0x5a6e('0x28')](config[_0x5a6e('0x29')],_0x5a6e('0x35'),_0x5a6e('0x36'),_0x5a6e('0x37'));fs_extra[_0x5a6e('0x38')](_0x49a0a7,function(){_0x5dbecb(null,_0x49a0a7);});},'filename':function(_0x3a8cfc,_0x1c0184,_0x5e9685){const _0x4dbcc7=_0x1c0184['originalname'][_0x5a6e('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2fb44e=path[_0x5a6e('0x3a')](_0x4dbcc7);const _0x1106df=Date[_0x5a6e('0x2b')]()+'-'+_0x4dbcc7[_0x5a6e('0x39')](_0x2fb44e,'')+_0x2fb44e;_0x5e9685(null,_0x1106df);}})});router[_0x5a6e('0x22')]('/:id/offline',offlineUploadMulter[_0x5a6e('0x3b')](),controller[_0x5a6e('0x3c')]);router['post'](_0x5a6e('0x3d'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x5a6e('0x22')](_0x5a6e('0x1a'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x3e')]);router[_0x5a6e('0x22')](_0x5a6e('0x1c'),auth['isAuthenticated'](),controller[_0x5a6e('0x3f')]);router[_0x5a6e('0x22')]('/:id/users',auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x40')]);router[_0x5a6e('0x41')](_0x5a6e('0xd'),auth['isAuthenticated'](),controller[_0x5a6e('0x42')]);router[_0x5a6e('0x43')](_0x5a6e('0xd'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x44')]);router['delete'](_0x5a6e('0x24'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5a6e('0x43')](_0x5a6e('0x10'),auth[_0x5a6e('0xb')](),controller[_0x5a6e('0x45')]);router[_0x5a6e('0x43')]('/:id/users',auth[_0x5a6e('0xb')](),controller['removeAgents']);module[_0x5a6e('0x46')]=router;
\ No newline at end of file
+var _0x3982=['describe','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','notify','server/files','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','put','/:id','update','destroy','/:id/dispositions','removeDispositions','removeAnswers','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe'];(function(_0x331e77,_0x114123){var _0x5b1b95=function(_0x1691ae){while(--_0x1691ae){_0x331e77['push'](_0x331e77['shift']());}};_0x5b1b95(++_0x114123);}(_0x3982,0x196));var _0x2398=function(_0x2bf68c,_0x18920b){_0x2bf68c=_0x2bf68c-0x0;var _0x54c487=_0x3982[_0x2bf68c];return _0x54c487;};'use strict';var multer=require(_0x2398('0x0'));var util=require(_0x2398('0x1'));var path=require(_0x2398('0x2'));var timeout=require(_0x2398('0x3'));var express=require(_0x2398('0x4'));var router=express[_0x2398('0x5')]();var fs_extra=require(_0x2398('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2398('0x7'));var config=require(_0x2398('0x8'));var controller=require(_0x2398('0x9'));router['get']('/',auth[_0x2398('0xa')](),controller[_0x2398('0xb')]);router[_0x2398('0xc')](_0x2398('0xd'),auth[_0x2398('0xa')](),controller[_0x2398('0xe')]);router['get']('/:id',auth[_0x2398('0xa')](),controller['show']);router[_0x2398('0xc')]('/:id/dispositions',auth[_0x2398('0xa')](),controller['getDispositions']);router[_0x2398('0xc')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x10')]);router[_0x2398('0xc')](_0x2398('0x11'),controller['getLogo']);router[_0x2398('0xc')](_0x2398('0x12'),controller[_0x2398('0x13')]);router[_0x2398('0xc')](_0x2398('0x14'),controller['getCustomerAvatar']);router[_0x2398('0xc')](_0x2398('0x15'),controller['getSystemAvatar']);router[_0x2398('0xc')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2398('0x16')]);router['get'](_0x2398('0x17'),controller[_0x2398('0x18')]);router['get'](_0x2398('0x19'),auth['isAuthenticated'](),controller[_0x2398('0x1a')]);router[_0x2398('0xc')](_0x2398('0x1b'),auth[_0x2398('0xa')](),controller[_0x2398('0x1c')]);router['get'](_0x2398('0x1d'),controller[_0x2398('0x1e')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2398('0x1f')]);router[_0x2398('0xc')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller[_0x2398('0x21')]);router[_0x2398('0x22')]('/',auth[_0x2398('0xa')](),controller['create']);router[_0x2398('0x22')]('/:id/dispositions',auth[_0x2398('0xa')](),controller[_0x2398('0x23')]);router[_0x2398('0x22')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x24')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x460ecc,_0x497ad3,_0x195dbb){_0x195dbb(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x28')));},'filename':function(_0x4763d9,_0x38d99d,_0x5647d6){_0x5647d6(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x38d99d[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x11'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller[_0x2398('0x2f')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x137609,_0x47e9f4,_0x246673){_0x246673(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x2d4f45,_0x146874,_0xeb3da0){_0xeb3da0(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date['now'](),_0x146874[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x12'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x4127f8,_0x169c00,_0x1025a5){_0x1025a5(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x336bf1,_0x5e2354,_0x6b3add){_0x6b3add(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x5e2354[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x14'),upload[_0x2398('0x2d')]('file'),controller[_0x2398('0x31')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x15c7b0,_0x207d00,_0x34fc5a){_0x34fc5a(null,path['join'](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0xc03907,_0x44f176,_0x40afa2){_0x40afa2(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x44f176[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x15'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addSystemAvatar']);router[_0x2398('0x22')]('/:id/notify',controller[_0x2398('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x3a5bf7,_0x5c937d,_0x34a0c5){const _0x500dca=path['join'](config[_0x2398('0x27')],_0x2398('0x33'),'attachments',_0x2398('0x34'));fs_extra[_0x2398('0x35')](_0x500dca,function(){_0x34a0c5(null,_0x500dca);});},'filename':function(_0x158980,_0x513f8d,_0x33c658){const _0x5bde9f=_0x513f8d[_0x2398('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x57d52a=path[_0x2398('0x36')](_0x5bde9f);const _0x88d459=Date['now']()+'-'+_0x5bde9f[_0x2398('0x37')](_0x57d52a,'')+_0x57d52a;_0x33c658(null,_0x88d459);}})});router[_0x2398('0x22')](_0x2398('0x38'),offlineUploadMulter[_0x2398('0x39')](),controller[_0x2398('0x3a')]);router[_0x2398('0x22')](_0x2398('0x3b'),auth[_0x2398('0xa')](),controller[_0x2398('0x3c')]);router[_0x2398('0x22')]('/:id/applications',auth[_0x2398('0xa')](),controller['addApplications']);router[_0x2398('0x22')](_0x2398('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2398('0x22')](_0x2398('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2398('0x3d')](_0x2398('0x3e'),auth[_0x2398('0xa')](),controller[_0x2398('0x3f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2398('0x40')]);router['delete'](_0x2398('0x41'),auth[_0x2398('0xa')](),controller[_0x2398('0x42')]);router['delete'](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x43')]);router[_0x2398('0x44')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller['removeAgents']);module[_0x2398('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index aa87988..8264e56 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 _0x7d10=['AmazonAWS','Google','exports','STRING'];(function(_0x53a020,_0x5d8f62){var _0x26b9d5=function(_0x3c28aa){while(--_0x3c28aa){_0x53a020['push'](_0x53a020['shift']());}};_0x26b9d5(++_0x5d8f62);}(_0x7d10,0x1ce));var _0x07d1=function(_0x326aef,_0x57184f){_0x326aef=_0x326aef-0x0;var _0x41536e=_0x7d10[_0x326aef];return _0x41536e;};'use strict';var Sequelize=require('sequelize');module[_0x07d1('0x0')]={'name':{'type':Sequelize[_0x07d1('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x07d1('0x2'),_0x07d1('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x07d1('0x1')]}};
\ No newline at end of file
+var _0x7eff=['ENUM','Google','exports','STRING'];(function(_0x2596e6,_0x1d37fb){var _0x1d37d6=function(_0x3ce9b7){while(--_0x3ce9b7){_0x2596e6['push'](_0x2596e6['shift']());}};_0x1d37d6(++_0x1d37fb);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf7ef('0x0')]={'name':{'type':Sequelize[_0xf7ef('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf7ef('0x2')]('AmazonAWS',_0xf7ef('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf7ef('0x1')]},'data2':{'type':Sequelize[_0xf7ef('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c9f472e..f2cdbe4 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0x2abf5c,_0x4fecaf){_0x2abf5c=_0x2abf5c-0x0;var _0x3677eb=_0xadb5[_0x2abf5c];return _0x3677eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ee191,_0x2b8c91){_0x1ee191=_0x1ee191-0x0;var _0x5288bc=_0x5f2f[_0x1ee191];return _0x5288bc;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 977ef4d..21665b3 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 _0x5a60=['cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5a60,0x1f0));var _0x05a6=function(_0x325b0c,_0x33747f){_0x325b0c=_0x325b0c-0x0;var _0x8e3945=_0x5a60[_0x325b0c];return _0x8e3945;};'use strict';var _=require('lodash');var util=require(_0x05a6('0x0'));var logger=require(_0x05a6('0x1'))(_0x05a6('0x2'));var moment=require(_0x05a6('0x3'));var BPromise=require(_0x05a6('0x4'));var rp=require(_0x05a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05a6('0x6'));var config=require(_0x05a6('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x05a6('0x8')]=function(_0xd8dd87,_0xe35541){return _0xd8dd87[_0x05a6('0x9')]('CloudProvider',attributes,{'tableName':_0x05a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb85c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util'];(function(_0x33d6b0,_0x183044){var _0x41d3d9=function(_0x5aead0){while(--_0x5aead0){_0x33d6b0['push'](_0x33d6b0['shift']());}};_0x41d3d9(++_0x183044);}(_0xb85c,0x197));var _0xcb85=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb85c[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0xcb85('0x0'));var logger=require(_0xcb85('0x1'))(_0xcb85('0x2'));var moment=require(_0xcb85('0x3'));var BPromise=require(_0xcb85('0x4'));var rp=require(_0xcb85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb85('0x6'));var config=require(_0xcb85('0x7'));var attributes=require(_0xcb85('0x8'));module[_0xcb85('0x9')]=function(_0xadfd76,_0x24fd74){return _0xadfd76[_0xcb85('0xa')](_0xcb85('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 2ed6ff0..15e1c03 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 _0xcf3d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x15dc42,_0x345727){var _0x7bb3b5=function(_0x25c7d7){while(--_0x25c7d7){_0x15dc42['push'](_0x15dc42['shift']());}};_0x7bb3b5(++_0x345727);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x19f8e6,_0xaf2ce1){_0x19f8e6=_0x19f8e6-0x0;var _0x2f76d9=_0xcf3d[_0x19f8e6];return _0x2f76d9;};'use strict';var _=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var moment=require(_0xdcf3('0x2'));var BPromise=require(_0xdcf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcf3('0x5'));var logger=require(_0xdcf3('0x6'))(_0xdcf3('0x7'));var config=require(_0xdcf3('0x8'));var jayson=require(_0xdcf3('0x9'));var client=jayson[_0xdcf3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43f8d5,_0x47dde8,_0x2cd0af){return new BPromise(function(_0x45c5bd,_0x55fe3a){return client['request'](_0x43f8d5,_0x2cd0af)['then'](function(_0x4515a2){logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));logger[_0xdcf3('0xe')](_0xdcf3('0xf'),_0x47dde8,_0xdcf3('0xd'),JSON[_0xdcf3('0x10')](_0x4515a2));if(_0x4515a2[_0xdcf3('0x11')]){if(_0x4515a2['error'][_0xdcf3('0x12')]===0x1f4){logger[_0xdcf3('0x11')]('CloudProvider,\x20%s,\x20%s',_0x47dde8,_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);return _0x55fe3a(_0x4515a2[_0xdcf3('0x11')][_0xdcf3('0x13')]);}logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x4515a2[_0xdcf3('0x11')]['message']);return _0x45c5bd(_0x4515a2[_0xdcf3('0x11')]['message']);}else{logger[_0xdcf3('0xb')](_0xdcf3('0xc'),_0x47dde8,_0xdcf3('0xd'));_0x45c5bd(_0x4515a2[_0xdcf3('0x14')]['message']);}})[_0xdcf3('0x15')](function(_0x24cce5){logger['error'](_0xdcf3('0xc'),_0x47dde8,_0x24cce5);_0x55fe3a(_0x24cce5);});});}
\ No newline at end of file
+var _0x531a=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x19fabd,_0x4cf7d5){var _0x2fa7d8=function(_0x121c85){while(--_0x121c85){_0x19fabd['push'](_0x19fabd['shift']());}};_0x2fa7d8(++_0x4cf7d5);}(_0x531a,0x100));var _0xa531=function(_0x3e6aed,_0x97a2f1){_0x3e6aed=_0x3e6aed-0x0;var _0x3220dd=_0x531a[_0x3e6aed];return _0x3220dd;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 0b0f788..4fd9bfe 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 _0x41ca=['../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','fs-extra'];(function(_0x308f6d,_0x9277bc){var _0xb3921e=function(_0x1b4e22){while(--_0x1b4e22){_0x308f6d['push'](_0x308f6d['shift']());}};_0xb3921e(++_0x9277bc);}(_0x41ca,0x195));var _0xa41c=function(_0x152c88,_0x5949dd){_0x152c88=_0x152c88-0x0;var _0x3fa8b6=_0x41ca[_0x152c88];return _0x3fa8b6;};'use strict';var multer=require(_0xa41c('0x0'));var util=require(_0xa41c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa41c('0x2'));var auth=require(_0xa41c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa41c('0x4'));router[_0xa41c('0x5')]('/',auth[_0xa41c('0x6')](),controller[_0xa41c('0x7')]);router['get'](_0xa41c('0x8'),auth['isAuthenticated'](),controller[_0xa41c('0x9')]);router[_0xa41c('0xa')]('/',auth[_0xa41c('0x6')](),controller[_0xa41c('0xb')]);router[_0xa41c('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa41c('0xd')]);router[_0xa41c('0xe')](_0xa41c('0x8'),auth[_0xa41c('0x6')](),controller[_0xa41c('0xf')]);module[_0xa41c('0x10')]=router;
\ No newline at end of file
+var _0x4ba1=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x1ef49c,_0x55c959){var _0x1936ef=function(_0x1d23d4){while(--_0x1d23d4){_0x1ef49c['push'](_0x1ef49c['shift']());}};_0x1936ef(++_0x55c959);}(_0x4ba1,0x159));var _0x14ba=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4ba1[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var path=require(_0x14ba('0x2'));var timeout=require(_0x14ba('0x3'));var express=require(_0x14ba('0x4'));var router=express['Router']();var fs_extra=require(_0x14ba('0x5'));var auth=require(_0x14ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x14ba('0x7'));var controller=require(_0x14ba('0x8'));router[_0x14ba('0x9')]('/',auth[_0x14ba('0xa')](),controller[_0x14ba('0xb')]);router[_0x14ba('0x9')](_0x14ba('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x14ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x14ba('0xe')]);router[_0x14ba('0xf')](_0x14ba('0xc'),auth['isAuthenticated'](),controller[_0x14ba('0x10')]);router[_0x14ba('0x11')](_0x14ba('0xc'),auth[_0x14ba('0xa')](),controller[_0x14ba('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8fbbdf2..374aef4 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 _0xe68d=['name','sequelize','STRING'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0xe68d,0xcd));var _0xde68=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0xe68d[_0x8e8ca7];return _0x561381;};'use strict';var Sequelize=require(_0xde68('0x0'));module['exports']={'name':{'type':Sequelize[_0xde68('0x1')],'unique':_0xde68('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xde68('0x1')]},'website':{'type':Sequelize[_0xde68('0x1')]},'phone':{'type':Sequelize[_0xde68('0x1')]},'fax':{'type':Sequelize[_0xde68('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xde68('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xde68('0x1')]},'email':{'type':Sequelize[_0xde68('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xde68('0x1')]},'sStreet':{'type':Sequelize[_0xde68('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xde68('0x1')]},'sCountry':{'type':Sequelize[_0xde68('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x68de=['STRING','sequelize','exports'];(function(_0x2eb067,_0x1b0899){var _0xf87aaf=function(_0x7f9ce3){while(--_0x7f9ce3){_0x2eb067['push'](_0x2eb067['shift']());}};_0xf87aaf(++_0x1b0899);}(_0x68de,0xfa));var _0xe68d=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x68de[_0x1b25c1];return _0x1e4447;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'name':{'type':Sequelize[_0xe68d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe68d('0x2')]},'companyId':{'type':Sequelize[_0xe68d('0x2')]},'website':{'type':Sequelize[_0xe68d('0x2')]},'phone':{'type':Sequelize[_0xe68d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe68d('0x2')]},'street':{'type':Sequelize[_0xe68d('0x2')]},'postalCode':{'type':Sequelize[_0xe68d('0x2')]},'city':{'type':Sequelize[_0xe68d('0x2')]},'country':{'type':Sequelize[_0xe68d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe68d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe68d('0x2')]},'sCity':{'type':Sequelize[_0xe68d('0x2')]},'sCountry':{'type':Sequelize[_0xe68d('0x2')]},'description':{'type':Sequelize[_0xe68d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6bfc426..d042390 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 _0x6abf=['apply','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x4a42f0,_0x2da65d){var _0x3dc532=function(_0xb60cdf){while(--_0xb60cdf){_0x4a42f0['push'](_0x4a42f0['shift']());}};_0x3dc532(++_0x2da65d);}(_0x6abf,0x90));var _0xf6ab=function(_0x23270f,_0x5a8ffb){_0x23270f=_0x23270f-0x0;var _0x6a062b=_0x6abf[_0x23270f];return _0x6a062b;};'use strict';var emlformat=require(_0xf6ab('0x0'));var rimraf=require(_0xf6ab('0x1'));var zipdir=require(_0xf6ab('0x2'));var jsonpatch=require(_0xf6ab('0x3'));var rp=require(_0xf6ab('0x4'));var moment=require(_0xf6ab('0x5'));var BPromise=require(_0xf6ab('0x6'));var Mustache=require(_0xf6ab('0x7'));var util=require(_0xf6ab('0x8'));var path=require('path');var sox=require(_0xf6ab('0x9'));var csv=require(_0xf6ab('0xa'));var ejs=require(_0xf6ab('0xb'));var fs=require('fs');var fs_extra=require(_0xf6ab('0xc'));var _=require(_0xf6ab('0xd'));var squel=require(_0xf6ab('0xe'));var crypto=require(_0xf6ab('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf6ab('0x10'));var toCsv=require(_0xf6ab('0xa'));var querystring=require(_0xf6ab('0x11'));var Papa=require('papaparse');var Redis=require(_0xf6ab('0x12'));var authService=require(_0xf6ab('0x13'));var qs=require(_0xf6ab('0x14'));var as=require(_0xf6ab('0x15'));var hardwareService=require(_0xf6ab('0x16'));var logger=require(_0xf6ab('0x17'))(_0xf6ab('0x18'));var utils=require(_0xf6ab('0x19'));var config=require(_0xf6ab('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6ab('0x1b'))['db'];function respondWithStatusCode(_0x2cf7b5,_0x20beb8){_0x20beb8=_0x20beb8||0xcc;return function(_0x12dd75){if(_0x12dd75){return _0x2cf7b5[_0xf6ab('0x1c')](_0x20beb8);}return _0x2cf7b5['status'](_0x20beb8)[_0xf6ab('0x1d')]();};}function respondWithResult(_0x17149a,_0x3e51ad){_0x3e51ad=_0x3e51ad||0xc8;return function(_0x4c3992){if(_0x4c3992){return _0x17149a[_0xf6ab('0x1e')](_0x3e51ad)[_0xf6ab('0x1f')](_0x4c3992);}};}function respondWithFilteredResult(_0x23e839,_0x56e36f){return function(_0x25ff20){if(_0x25ff20){var _0x3979d5=typeof _0x56e36f['offset']===_0xf6ab('0x20')&&typeof _0x56e36f[_0xf6ab('0x21')]===_0xf6ab('0x20');var _0x170bd2=_0x25ff20[_0xf6ab('0x22')];var _0x25b157=_0x3979d5?0x0:_0x56e36f['offset'];var _0x302a15=_0x3979d5?_0x25ff20[_0xf6ab('0x22')]:_0x56e36f[_0xf6ab('0x23')]+_0x56e36f[_0xf6ab('0x21')];var _0x464d34;if(_0x302a15>=_0x170bd2){_0x302a15=_0x170bd2;_0x464d34=0xc8;}else{_0x464d34=0xce;}_0x23e839[_0xf6ab('0x1e')](_0x464d34);return _0x23e839[_0xf6ab('0x24')](_0xf6ab('0x25'),_0x25b157+'-'+_0x302a15+'/'+_0x170bd2)['json'](_0x25ff20);}return null;};}function patchUpdates(_0xcba4da){return function(_0x3066da){try{jsonpatch[_0xf6ab('0x26')](_0x3066da,_0xcba4da,!![]);}catch(_0xb6b24a){return BPromise['reject'](_0xb6b24a);}return _0x3066da['save']();};}function saveUpdates(_0x5be73d,_0x2a9bfd){return function(_0x3f77b4){if(_0x3f77b4){return _0x3f77b4[_0xf6ab('0x27')](_0x5be73d)[_0xf6ab('0x28')](function(_0x1bb3d9){return _0x1bb3d9;});}return null;};}function removeEntity(_0xcf3532,_0x269a27){return function(_0x54f75e){if(_0x54f75e){return _0x54f75e[_0xf6ab('0x29')]()[_0xf6ab('0x28')](function(){var _0x28734d=_0x54f75e[_0xf6ab('0x2a')]({'plain':!![]});var _0x556076=_0xf6ab('0x2b');return db['UserProfileResource'][_0xf6ab('0x29')]({'where':{'type':_0x556076,'resourceId':_0x28734d['id']}})['then'](function(){return _0x54f75e;});})[_0xf6ab('0x28')](function(){_0xcf3532[_0xf6ab('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404493,_0x360c80){return function(_0x118391){if(!_0x118391){_0x404493[_0xf6ab('0x1c')](0x194);}return _0x118391;};}function handleError(_0xc4ab96,_0xcf814c){_0xcf814c=_0xcf814c||0x1f4;return function(_0x2b2ad2){logger[_0xf6ab('0x2c')](_0x2b2ad2[_0xf6ab('0x2d')]);if(_0x2b2ad2[_0xf6ab('0x2e')]){delete _0x2b2ad2[_0xf6ab('0x2e')];}_0xc4ab96[_0xf6ab('0x1e')](_0xcf814c)[_0xf6ab('0x2f')](_0x2b2ad2);};}exports[_0xf6ab('0x30')]=function(_0x3ab182,_0x480ee5){var _0x3501c5={},_0x4940d5={},_0x335dd5={'count':0x0,'rows':[]};return db[_0xf6ab('0x31')][_0xf6ab('0x32')]()['then'](function(_0x374a7c){_0x4940d5['model']=_[_0xf6ab('0x33')](_0x374a7c);_0x4940d5[_0xf6ab('0x34')]=_[_0xf6ab('0x33')](_0x3ab182[_0xf6ab('0x34')]);_0x4940d5[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x4940d5[_0xf6ab('0x37')],_0x4940d5[_0xf6ab('0x34')]);_0x3501c5[_0xf6ab('0x38')]=_[_0xf6ab('0x36')](_0x4940d5[_0xf6ab('0x37')],qs['fields'](_0x3ab182[_0xf6ab('0x34')]['fields']));_0x3501c5[_0xf6ab('0x38')]=_0x3501c5[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0x3501c5['attributes']:_0x4940d5[_0xf6ab('0x37')];if(!_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x3a')](_0xf6ab('0x3b'))){_0x3501c5[_0xf6ab('0x21')]=qs[_0xf6ab('0x21')](_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x21')]);_0x3501c5[_0xf6ab('0x23')]=qs[_0xf6ab('0x23')](_0x3ab182['query'][_0xf6ab('0x23')]);}_0x3501c5[_0xf6ab('0x3c')]=qs[_0xf6ab('0x3d')](_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x3d')]);_0x3501c5[_0xf6ab('0x3e')]=qs[_0xf6ab('0x35')](_['pick'](_0x3ab182[_0xf6ab('0x34')],_0x4940d5[_0xf6ab('0x35')]),_0x374a7c);if(_0x3ab182['query'][_0xf6ab('0x3f')]){_0x3501c5['where']=_[_0xf6ab('0x40')](_0x3501c5[_0xf6ab('0x3e')],{'$or':_[_0xf6ab('0x41')](_0x3501c5[_0xf6ab('0x38')],function(_0x3eb7e3){var _0xdcb9d1={};_0xdcb9d1[_0x3eb7e3]={'$like':'%'+_0x3ab182['query'][_0xf6ab('0x3f')]+'%'};return _0xdcb9d1;})});}_0x3501c5=_['merge']({},_0x3501c5,_0x3ab182[_0xf6ab('0x42')]);var _0x428c8b={'where':_0x3501c5[_0xf6ab('0x3e')]};return db['CmCompany']['count'](_0x428c8b)[_0xf6ab('0x28')](function(_0x315087){_0x335dd5[_0xf6ab('0x22')]=_0x315087;if(_0x3ab182[_0xf6ab('0x34')][_0xf6ab('0x43')]){_0x3501c5['include']=[{'all':!![]}];}return db[_0xf6ab('0x31')][_0xf6ab('0x44')](_0x3501c5);})['then'](function(_0x192151){_0x335dd5[_0xf6ab('0x45')]=_0x192151;return _0x335dd5;})[_0xf6ab('0x28')](respondWithFilteredResult(_0x480ee5,_0x3501c5))['catch'](handleError(_0x480ee5,null));})[_0xf6ab('0x46')](handleError(_0x480ee5,null));};exports[_0xf6ab('0x47')]=function(_0x14de97,_0x357fb1){var _0xff7cc4={'raw':![],'where':{'id':_0x14de97[_0xf6ab('0x48')]['id']}},_0x17247e={};_0x17247e[_0xf6ab('0x37')]=_['keys'](db[_0xf6ab('0x31')][_0xf6ab('0x49')]);_0x17247e[_0xf6ab('0x34')]=_[_0xf6ab('0x33')](_0x14de97['query']);_0x17247e[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x17247e[_0xf6ab('0x37')],_0x17247e['query']);_0xff7cc4[_0xf6ab('0x38')]=_[_0xf6ab('0x36')](_0x17247e['model'],qs[_0xf6ab('0x4a')](_0x14de97[_0xf6ab('0x34')][_0xf6ab('0x4a')]));_0xff7cc4[_0xf6ab('0x38')]=_0xff7cc4[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0xff7cc4['attributes']:_0x17247e['model'];if(_0x14de97['query'][_0xf6ab('0x43')]){_0xff7cc4[_0xf6ab('0x4b')]=[{'all':!![]}];}_0xff7cc4=_[_0xf6ab('0x40')]({},_0xff7cc4,_0x14de97['options']);return db[_0xf6ab('0x31')][_0xf6ab('0x4c')](_0xff7cc4)[_0xf6ab('0x28')](handleEntityNotFound(_0x357fb1,null))[_0xf6ab('0x28')](respondWithResult(_0x357fb1,null))[_0xf6ab('0x46')](handleError(_0x357fb1,null));};exports[_0xf6ab('0x4d')]=function(_0x208e1,_0xf67702){return db[_0xf6ab('0x31')]['create'](_0x208e1['body'],{})[_0xf6ab('0x28')](function(_0x4ffe9a){var _0x597cf0=_0x208e1[_0xf6ab('0x4e')][_0xf6ab('0x2a')]({'plain':!![]});if(!_0x597cf0)throw new Error(_0xf6ab('0x4f'));if(_0x597cf0[_0xf6ab('0x50')]===_0xf6ab('0x4e')){var _0x35b005=_0x4ffe9a['get']({'plain':!![]});var _0x17addb=_0xf6ab('0x2b');return db['UserProfileSection'][_0xf6ab('0x4c')]({'where':{'name':_0x17addb,'userProfileId':_0x597cf0[_0xf6ab('0x51')]},'raw':!![]})[_0xf6ab('0x28')](function(_0x11fb8d){if(_0x11fb8d&&_0x11fb8d[_0xf6ab('0x52')]===0x0){return db['UserProfileResource'][_0xf6ab('0x4d')]({'name':_0x35b005[_0xf6ab('0x2e')],'resourceId':_0x35b005['id'],'type':_0x11fb8d[_0xf6ab('0x2e')],'sectionId':_0x11fb8d['id']},{})[_0xf6ab('0x28')](function(){return _0x4ffe9a;});}else{return _0x4ffe9a;}})['catch'](function(_0x362a2c){logger[_0xf6ab('0x2c')](_0xf6ab('0x53'),_0x362a2c);throw _0x362a2c;});}return _0x4ffe9a;})['then'](respondWithResult(_0xf67702,0xc9))[_0xf6ab('0x46')](handleError(_0xf67702,null));};exports[_0xf6ab('0x27')]=function(_0x1dde52,_0x1231de){if(_0x1dde52[_0xf6ab('0x54')]['id']){delete _0x1dde52[_0xf6ab('0x54')]['id'];}return db[_0xf6ab('0x31')][_0xf6ab('0x4c')]({'where':{'id':_0x1dde52[_0xf6ab('0x48')]['id']}})[_0xf6ab('0x28')](handleEntityNotFound(_0x1231de,null))[_0xf6ab('0x28')](saveUpdates(_0x1dde52[_0xf6ab('0x54')],null))['then'](respondWithResult(_0x1231de,null))[_0xf6ab('0x46')](handleError(_0x1231de,null));};exports[_0xf6ab('0x29')]=function(_0x6d7349,_0x1e9903){return db['CmCompany']['find']({'where':{'id':_0x6d7349['params']['id']}})['then'](handleEntityNotFound(_0x1e9903,null))[_0xf6ab('0x28')](removeEntity(_0x1e9903,null))[_0xf6ab('0x46')](handleError(_0x1e9903,null));};exports[_0xf6ab('0x32')]=function(_0x48faa1,_0x380c3f){return db[_0xf6ab('0x31')][_0xf6ab('0x32')]()['then'](respondWithResult(_0x380c3f,null))[_0xf6ab('0x46')](handleError(_0x380c3f,null));};exports[_0xf6ab('0x55')]=function(_0x1001a1,_0x35d68c,_0x52fd77){return db[_0xf6ab('0x56')]['find']({'where':{'id':_0x1001a1[_0xf6ab('0x48')]['id']}})[_0xf6ab('0x28')](handleEntityNotFound(_0x35d68c,null))['then'](function(_0x103b16){if(_0x103b16){return _0x103b16[_0xf6ab('0x55')](_0x1001a1['body']['ids'],_[_0xf6ab('0x57')](_0x1001a1['body'],[_0xf6ab('0x58'),'id'])||{});}})[_0xf6ab('0x28')](respondWithResult(_0x35d68c,null))['catch'](handleError(_0x35d68c,null));};exports[_0xf6ab('0x59')]=function(_0x55f95c,_0x440692,_0x2af1bc){var _0x1165fb={};var _0x560fb2={};var _0x29dd16;var _0x576870;return db[_0xf6ab('0x31')][_0xf6ab('0x5a')]({'where':{'id':_0x55f95c[_0xf6ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x440692,null))[_0xf6ab('0x28')](function(_0x148cca){if(_0x148cca){_0x29dd16=_0x148cca;_0x560fb2['model']=_[_0xf6ab('0x33')](db[_0xf6ab('0x56')]['rawAttributes']);_0x560fb2['query']=_['keys'](_0x55f95c[_0xf6ab('0x34')]);_0x560fb2[_0xf6ab('0x35')]=_[_0xf6ab('0x36')](_0x560fb2[_0xf6ab('0x37')],_0x560fb2[_0xf6ab('0x34')]);_0x1165fb[_0xf6ab('0x38')]=_['intersection'](_0x560fb2[_0xf6ab('0x37')],qs['fields'](_0x55f95c[_0xf6ab('0x34')]['fields']));_0x1165fb[_0xf6ab('0x38')]=_0x1165fb[_0xf6ab('0x38')][_0xf6ab('0x39')]?_0x1165fb['attributes']:_0x560fb2['model'];_0x1165fb['order']=qs[_0xf6ab('0x3d')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x3d')]);_0x1165fb[_0xf6ab('0x3e')]=qs['filters'](_['pick'](_0x55f95c['query'],_0x560fb2[_0xf6ab('0x35')]));if(_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x3f')]){_0x1165fb[_0xf6ab('0x3e')]=_[_0xf6ab('0x40')](_0x1165fb['where'],{'$or':_[_0xf6ab('0x41')](_0x1165fb[_0xf6ab('0x38')],function(_0x36f68b){var _0x43f377={};_0x43f377[_0x36f68b]={'$like':'%'+_0x55f95c['query'][_0xf6ab('0x3f')]+'%'};return _0x43f377;})});}_0x1165fb=_['merge']({},_0x1165fb,_0x55f95c[_0xf6ab('0x42')]);return _0x29dd16[_0xf6ab('0x59')](_0x1165fb);}})[_0xf6ab('0x28')](function(_0x1c4fc7){if(_0x1c4fc7){_0x576870=_0x1c4fc7[_0xf6ab('0x39')];if(!_0x55f95c['query'][_0xf6ab('0x3a')](_0xf6ab('0x3b'))){_0x1165fb[_0xf6ab('0x21')]=qs[_0xf6ab('0x21')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x21')]);_0x1165fb[_0xf6ab('0x23')]=qs[_0xf6ab('0x23')](_0x55f95c[_0xf6ab('0x34')][_0xf6ab('0x23')]);}return _0x29dd16[_0xf6ab('0x59')](_0x1165fb);}})[_0xf6ab('0x28')](function(_0x48a197){if(_0x48a197){return _0x48a197?{'count':_0x576870,'rows':_0x48a197}:null;}})[_0xf6ab('0x28')](respondWithResult(_0x440692,null))['catch'](handleError(_0x440692,null));};
\ No newline at end of file
+var _0x20c3=['hasOwnProperty','nolimit','pick','where','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','CmCompany','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','filter','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','Companies','UserProfileResource','destroy','sendStatus','error','stack','send','index','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1e701a,_0x44b807){var _0x497de0=function(_0x1a2de6){while(--_0x1a2de6){_0x1e701a['push'](_0x1e701a['shift']());}};_0x497de0(++_0x44b807);}(_0x20c3,0x7b));var _0x320c=function(_0x5d9171,_0x5ccd64){_0x5d9171=_0x5d9171-0x0;var _0x49aa7b=_0x20c3[_0x5d9171];return _0x49aa7b;};'use strict';var emlformat=require(_0x320c('0x0'));var rimraf=require(_0x320c('0x1'));var zipdir=require(_0x320c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x320c('0x3'));var BPromise=require(_0x320c('0x4'));var Mustache=require(_0x320c('0x5'));var util=require(_0x320c('0x6'));var path=require(_0x320c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x320c('0x8'));var fs=require('fs');var fs_extra=require(_0x320c('0x9'));var _=require(_0x320c('0xa'));var squel=require(_0x320c('0xb'));var crypto=require('crypto');var jsforce=require(_0x320c('0xc'));var deskjs=require(_0x320c('0xd'));var toCsv=require(_0x320c('0xe'));var querystring=require(_0x320c('0xf'));var Papa=require('papaparse');var Redis=require(_0x320c('0x10'));var authService=require(_0x320c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x320c('0x12'))('api');var utils=require(_0x320c('0x13'));var config=require(_0x320c('0x14'));var licenseUtil=require(_0x320c('0x15'));var db=require(_0x320c('0x16'))['db'];function respondWithStatusCode(_0x2aa04e,_0x4bf946){_0x4bf946=_0x4bf946||0xcc;return function(_0x53a7c7){if(_0x53a7c7){return _0x2aa04e['sendStatus'](_0x4bf946);}return _0x2aa04e[_0x320c('0x17')](_0x4bf946)[_0x320c('0x18')]();};}function respondWithResult(_0x64752e,_0x85bdd9){_0x85bdd9=_0x85bdd9||0xc8;return function(_0x586e99){if(_0x586e99){return _0x64752e[_0x320c('0x17')](_0x85bdd9)[_0x320c('0x19')](_0x586e99);}};}function respondWithFilteredResult(_0x3832c7,_0x40ed90){return function(_0x4ef851){if(_0x4ef851){var _0x1d314f=typeof _0x40ed90['offset']===_0x320c('0x1a')&&typeof _0x40ed90['limit']==='undefined';var _0x3cf5b5=_0x4ef851[_0x320c('0x1b')];var _0x457e78=_0x1d314f?0x0:_0x40ed90[_0x320c('0x1c')];var _0x5c01a2=_0x1d314f?_0x4ef851[_0x320c('0x1b')]:_0x40ed90[_0x320c('0x1c')]+_0x40ed90[_0x320c('0x1d')];var _0xa813c;if(_0x5c01a2>=_0x3cf5b5){_0x5c01a2=_0x3cf5b5;_0xa813c=0xc8;}else{_0xa813c=0xce;}_0x3832c7[_0x320c('0x17')](_0xa813c);return _0x3832c7[_0x320c('0x1e')](_0x320c('0x1f'),_0x457e78+'-'+_0x5c01a2+'/'+_0x3cf5b5)[_0x320c('0x19')](_0x4ef851);}return null;};}function patchUpdates(_0x432efe){return function(_0x46cebb){try{jsonpatch['apply'](_0x46cebb,_0x432efe,!![]);}catch(_0x34953d){return BPromise['reject'](_0x34953d);}return _0x46cebb[_0x320c('0x20')]();};}function saveUpdates(_0x1dc3ba,_0x2be585){return function(_0x5170e6){if(_0x5170e6){return _0x5170e6[_0x320c('0x21')](_0x1dc3ba)['then'](function(_0x27cbc1){return _0x27cbc1;});}return null;};}function removeEntity(_0x42cbf4,_0x875f2){return function(_0x7bb72f){if(_0x7bb72f){return _0x7bb72f['destroy']()[_0x320c('0x22')](function(){var _0x9a3674=_0x7bb72f['get']({'plain':!![]});var _0x2dbd84=_0x320c('0x23');return db[_0x320c('0x24')][_0x320c('0x25')]({'where':{'type':_0x2dbd84,'resourceId':_0x9a3674['id']}})[_0x320c('0x22')](function(){return _0x7bb72f;});})[_0x320c('0x22')](function(){_0x42cbf4[_0x320c('0x17')](0xcc)[_0x320c('0x18')]();});}};}function handleEntityNotFound(_0x23385a,_0x45cc91){return function(_0xa70f06){if(!_0xa70f06){_0x23385a[_0x320c('0x26')](0x194);}return _0xa70f06;};}function handleError(_0xef7eca,_0x337830){_0x337830=_0x337830||0x1f4;return function(_0x564e3b){logger[_0x320c('0x27')](_0x564e3b[_0x320c('0x28')]);if(_0x564e3b['name']){delete _0x564e3b['name'];}_0xef7eca[_0x320c('0x17')](_0x337830)[_0x320c('0x29')](_0x564e3b);};}exports[_0x320c('0x2a')]=function(_0x4c8a6d,_0x155d35){var _0x5bf607={},_0x33ec2d={},_0x3abd09={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x320c('0x22')](function(_0x42a5ac){_0x33ec2d[_0x320c('0x2b')]=_[_0x320c('0x2c')](_0x42a5ac);_0x33ec2d[_0x320c('0x2d')]=_[_0x320c('0x2c')](_0x4c8a6d[_0x320c('0x2d')]);_0x33ec2d[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x33ec2d[_0x320c('0x2b')],_0x33ec2d[_0x320c('0x2d')]);_0x5bf607[_0x320c('0x30')]=_['intersection'](_0x33ec2d[_0x320c('0x2b')],qs[_0x320c('0x31')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x31')]));_0x5bf607['attributes']=_0x5bf607['attributes'][_0x320c('0x32')]?_0x5bf607['attributes']:_0x33ec2d[_0x320c('0x2b')];if(!_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x33')](_0x320c('0x34'))){_0x5bf607['limit']=qs[_0x320c('0x1d')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1d')]);_0x5bf607['offset']=qs[_0x320c('0x1c')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1c')]);}_0x5bf607['order']=qs['sort'](_0x4c8a6d[_0x320c('0x2d')]['sort']);_0x5bf607['where']=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x4c8a6d[_0x320c('0x2d')],_0x33ec2d[_0x320c('0x2e')]),_0x42a5ac);if(_0x4c8a6d[_0x320c('0x2d')]['filter']){_0x5bf607[_0x320c('0x36')]=_[_0x320c('0x37')](_0x5bf607[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x5bf607[_0x320c('0x30')],function(_0x2cd283){var _0x3afb1d={};_0x3afb1d[_0x2cd283]={'$like':'%'+_0x4c8a6d[_0x320c('0x2d')]['filter']+'%'};return _0x3afb1d;})});}_0x5bf607=_[_0x320c('0x37')]({},_0x5bf607,_0x4c8a6d[_0x320c('0x39')]);var _0x20c9e0={'where':_0x5bf607[_0x320c('0x36')]};return db['CmCompany'][_0x320c('0x1b')](_0x20c9e0)[_0x320c('0x22')](function(_0xaf3168){_0x3abd09[_0x320c('0x1b')]=_0xaf3168;if(_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x3a')]){_0x5bf607['include']=[{'all':!![]}];}return db['CmCompany'][_0x320c('0x3b')](_0x5bf607);})[_0x320c('0x22')](function(_0x1815b5){_0x3abd09[_0x320c('0x3c')]=_0x1815b5;return _0x3abd09;})[_0x320c('0x22')](respondWithFilteredResult(_0x155d35,_0x5bf607))[_0x320c('0x3d')](handleError(_0x155d35,null));})[_0x320c('0x3d')](handleError(_0x155d35,null));};exports[_0x320c('0x3e')]=function(_0x5efc34,_0x592b8e){var _0x7aa1f9={'raw':![],'where':{'id':_0x5efc34[_0x320c('0x3f')]['id']}},_0x1af88b={};_0x1af88b[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmCompany'][_0x320c('0x40')]);_0x1af88b[_0x320c('0x2d')]=_['keys'](_0x5efc34[_0x320c('0x2d')]);_0x1af88b[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x1af88b['model'],_0x1af88b[_0x320c('0x2d')]);_0x7aa1f9[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x1af88b['model'],qs['fields'](_0x5efc34[_0x320c('0x2d')][_0x320c('0x31')]));_0x7aa1f9['attributes']=_0x7aa1f9[_0x320c('0x30')]['length']?_0x7aa1f9[_0x320c('0x30')]:_0x1af88b[_0x320c('0x2b')];if(_0x5efc34[_0x320c('0x2d')]['includeAll']){_0x7aa1f9[_0x320c('0x41')]=[{'all':!![]}];}_0x7aa1f9=_[_0x320c('0x37')]({},_0x7aa1f9,_0x5efc34[_0x320c('0x39')]);return db[_0x320c('0x42')][_0x320c('0x43')](_0x7aa1f9)[_0x320c('0x22')](handleEntityNotFound(_0x592b8e,null))[_0x320c('0x22')](respondWithResult(_0x592b8e,null))[_0x320c('0x3d')](handleError(_0x592b8e,null));};exports['create']=function(_0x1a4ac9,_0x5105e0){return db[_0x320c('0x42')][_0x320c('0x44')](_0x1a4ac9[_0x320c('0x45')],{})['then'](function(_0x367f68){var _0x1a2fc4=_0x1a4ac9[_0x320c('0x46')]['get']({'plain':!![]});if(!_0x1a2fc4)throw new Error(_0x320c('0x47'));if(_0x1a2fc4['role']===_0x320c('0x46')){var _0x32e47f=_0x367f68[_0x320c('0x48')]({'plain':!![]});var _0x1b0053=_0x320c('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1b0053,'userProfileId':_0x1a2fc4[_0x320c('0x49')]},'raw':!![]})[_0x320c('0x22')](function(_0x2fe99d){if(_0x2fe99d&&_0x2fe99d[_0x320c('0x4a')]===0x0){return db[_0x320c('0x24')][_0x320c('0x44')]({'name':_0x32e47f[_0x320c('0x4b')],'resourceId':_0x32e47f['id'],'type':_0x2fe99d[_0x320c('0x4b')],'sectionId':_0x2fe99d['id']},{})[_0x320c('0x22')](function(){return _0x367f68;});}else{return _0x367f68;}})[_0x320c('0x3d')](function(_0x9c7b31){logger[_0x320c('0x27')](_0x320c('0x4c'),_0x9c7b31);throw _0x9c7b31;});}return _0x367f68;})[_0x320c('0x22')](respondWithResult(_0x5105e0,0xc9))['catch'](handleError(_0x5105e0,null));};exports[_0x320c('0x21')]=function(_0x549c74,_0x43225f){if(_0x549c74[_0x320c('0x45')]['id']){delete _0x549c74['body']['id'];}return db[_0x320c('0x42')][_0x320c('0x43')]({'where':{'id':_0x549c74[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x43225f,null))['then'](saveUpdates(_0x549c74[_0x320c('0x45')],null))[_0x320c('0x22')](respondWithResult(_0x43225f,null))[_0x320c('0x3d')](handleError(_0x43225f,null));};exports[_0x320c('0x25')]=function(_0x51b331,_0x533d3a){return db['CmCompany'][_0x320c('0x43')]({'where':{'id':_0x51b331[_0x320c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x533d3a,null))[_0x320c('0x22')](removeEntity(_0x533d3a,null))[_0x320c('0x3d')](handleError(_0x533d3a,null));};exports[_0x320c('0x4d')]=function(_0x266d76,_0x33af2b){return db[_0x320c('0x42')]['describe']()[_0x320c('0x22')](respondWithResult(_0x33af2b,null))[_0x320c('0x3d')](handleError(_0x33af2b,null));};exports[_0x320c('0x4e')]=function(_0x2177cb,_0x45d8ee,_0x115bb2){return db[_0x320c('0x4f')][_0x320c('0x43')]({'where':{'id':_0x2177cb[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x45d8ee,null))['then'](function(_0x598cb2){if(_0x598cb2){return _0x598cb2['addContacts'](_0x2177cb[_0x320c('0x45')][_0x320c('0x50')],_[_0x320c('0x51')](_0x2177cb[_0x320c('0x45')],[_0x320c('0x50'),'id'])||{});}})['then'](respondWithResult(_0x45d8ee,null))['catch'](handleError(_0x45d8ee,null));};exports[_0x320c('0x52')]=function(_0x3fbe02,_0x122af7,_0x455969){var _0x485194={};var _0x3c7c51={};var _0x12d3e9;var _0x34c50f;return db[_0x320c('0x42')][_0x320c('0x53')]({'where':{'id':_0x3fbe02[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x122af7,null))[_0x320c('0x22')](function(_0x21367b){if(_0x21367b){_0x12d3e9=_0x21367b;_0x3c7c51[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmContact'][_0x320c('0x40')]);_0x3c7c51[_0x320c('0x2d')]=_['keys'](_0x3fbe02[_0x320c('0x2d')]);_0x3c7c51[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x3c7c51[_0x320c('0x2b')],_0x3c7c51[_0x320c('0x2d')]);_0x485194[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x3c7c51['model'],qs[_0x320c('0x31')](_0x3fbe02['query'][_0x320c('0x31')]));_0x485194[_0x320c('0x30')]=_0x485194[_0x320c('0x30')][_0x320c('0x32')]?_0x485194['attributes']:_0x3c7c51[_0x320c('0x2b')];_0x485194[_0x320c('0x54')]=qs[_0x320c('0x55')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x55')]);_0x485194[_0x320c('0x36')]=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x3fbe02[_0x320c('0x2d')],_0x3c7c51['filters']));if(_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]){_0x485194['where']=_[_0x320c('0x37')](_0x485194[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x485194[_0x320c('0x30')],function(_0x3eedce){var _0x570cbb={};_0x570cbb[_0x3eedce]={'$like':'%'+_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]+'%'};return _0x570cbb;})});}_0x485194=_[_0x320c('0x37')]({},_0x485194,_0x3fbe02['options']);return _0x12d3e9['getContacts'](_0x485194);}})[_0x320c('0x22')](function(_0x53b04d){if(_0x53b04d){_0x34c50f=_0x53b04d[_0x320c('0x32')];if(!_0x3fbe02[_0x320c('0x2d')]['hasOwnProperty'](_0x320c('0x34'))){_0x485194['limit']=qs[_0x320c('0x1d')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x1d')]);_0x485194['offset']=qs[_0x320c('0x1c')](_0x3fbe02[_0x320c('0x2d')]['offset']);}return _0x12d3e9[_0x320c('0x52')](_0x485194);}})[_0x320c('0x22')](function(_0x46c3a8){if(_0x46c3a8){return _0x46c3a8?{'count':_0x34c50f,'rows':_0x46c3a8}:null;}})[_0x320c('0x22')](respondWithResult(_0x122af7,null))[_0x320c('0x3d')](handleError(_0x122af7,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 731420d..5eb8823 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 _0x641e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_companies','lodash'];(function(_0xaa66b4,_0x5bad46){var _0x1a7e0a=function(_0x134dc8){while(--_0x134dc8){_0xaa66b4['push'](_0xaa66b4['shift']());}};_0x1a7e0a(++_0x5bad46);}(_0x641e,0x78));var _0xe641=function(_0x13ce69,_0x4fea29){_0x13ce69=_0x13ce69-0x0;var _0x312d53=_0x641e[_0x13ce69];return _0x312d53;};'use strict';var _=require(_0xe641('0x0'));var util=require(_0xe641('0x1'));var logger=require(_0xe641('0x2'))('api');var moment=require(_0xe641('0x3'));var BPromise=require(_0xe641('0x4'));var rp=require(_0xe641('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe641('0x6'));var config=require(_0xe641('0x7'));var attributes=require('./cmCompany.attributes');module[_0xe641('0x8')]=function(_0x6b819c,_0x4c5d03){return _0x6b819c[_0xe641('0x9')]('CmCompany',attributes,{'tableName':_0xe641('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5872=['request-promise','path','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x17f461,_0x4ecbdd){var _0x37ec91=function(_0x161819){while(--_0x161819){_0x17f461['push'](_0x17f461['shift']());}};_0x37ec91(++_0x4ecbdd);}(_0x5872,0x1be));var _0x2587=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x5872[_0x46800d];return _0x3824cd;};'use strict';var _=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var logger=require(_0x2587('0x2'))(_0x2587('0x3'));var moment=require(_0x2587('0x4'));var BPromise=require('bluebird');var rp=require(_0x2587('0x5'));var fs=require('fs');var path=require(_0x2587('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2587('0x7'));module[_0x2587('0x8')]=function(_0x53d2de,_0x530b8c){return _0x53d2de['define'](_0x2587('0x9'),attributes,{'tableName':_0x2587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 8da7fa7..30b01c3 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 _0xb902=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x2f81ef,_0x33953a){var _0x1ca14d=function(_0x35a783){while(--_0x35a783){_0x2f81ef['push'](_0x2f81ef['shift']());}};_0x1ca14d(++_0x33953a);}(_0xb902,0xcd));var _0x2b90=function(_0x232853,_0x33464a){_0x232853=_0x232853-0x0;var _0x3d5434=_0xb902[_0x232853];return _0x3d5434;};'use strict';var _=require(_0x2b90('0x0'));var util=require(_0x2b90('0x1'));var moment=require(_0x2b90('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b90('0x3'));var db=require(_0x2b90('0x4'))['db'];var utils=require(_0x2b90('0x5'));var logger=require(_0x2b90('0x6'))(_0x2b90('0x7'));var config=require(_0x2b90('0x8'));var jayson=require(_0x2b90('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9123,_0x1131f9,_0x507e7a){return new BPromise(function(_0x2deea8,_0x2406c7){return client[_0x2b90('0xa')](_0x1d9123,_0x507e7a)[_0x2b90('0xb')](function(_0x33ed32){logger[_0x2b90('0xc')](_0x2b90('0xd'),_0x1131f9,_0x2b90('0xe'));logger[_0x2b90('0xf')](_0x2b90('0x10'),_0x1131f9,_0x2b90('0xe'),JSON[_0x2b90('0x11')](_0x33ed32));if(_0x33ed32[_0x2b90('0x12')]){if(_0x33ed32[_0x2b90('0x12')][_0x2b90('0x13')]===0x1f4){logger[_0x2b90('0x12')]('CmCompany,\x20%s,\x20%s',_0x1131f9,_0x33ed32['error'][_0x2b90('0x14')]);return _0x2406c7(_0x33ed32[_0x2b90('0x12')][_0x2b90('0x14')]);}logger[_0x2b90('0x12')](_0x2b90('0xd'),_0x1131f9,_0x33ed32[_0x2b90('0x12')][_0x2b90('0x14')]);return _0x2deea8(_0x33ed32['error'][_0x2b90('0x14')]);}else{logger[_0x2b90('0xc')]('CmCompany,\x20%s,\x20%s',_0x1131f9,_0x2b90('0xe'));_0x2deea8(_0x33ed32[_0x2b90('0x15')][_0x2b90('0x14')]);}})['catch'](function(_0x20425a){logger[_0x2b90('0x12')](_0x2b90('0xd'),_0x1131f9,_0x20425a);_0x2406c7(_0x20425a);});});}
\ No newline at end of file
+var _0xa6a5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ca72,_0x396df6){var _0x14dbc2=function(_0x5e68b3){while(--_0x5e68b3){_0x2ca72['push'](_0x2ca72['shift']());}};_0x14dbc2(++_0x396df6);}(_0xa6a5,0xd1));var _0x5a6a=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa6a5[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x5a6a('0x0'));var moment=require(_0x5a6a('0x1'));var BPromise=require(_0x5a6a('0x2'));var rs=require(_0x5a6a('0x3'));var fs=require('fs');var Redis=require(_0x5a6a('0x4'));var db=require(_0x5a6a('0x5'))['db'];var utils=require(_0x5a6a('0x6'));var logger=require(_0x5a6a('0x7'))(_0x5a6a('0x8'));var config=require(_0x5a6a('0x9'));var jayson=require(_0x5a6a('0xa'));var client=jayson[_0x5a6a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a87f2,_0x14fa40,_0x535d97){return new BPromise(function(_0x25d9a3,_0x57e0f9){return client[_0x5a6a('0xc')](_0x3a87f2,_0x535d97)[_0x5a6a('0xd')](function(_0x57b902){logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));logger[_0x5a6a('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x14fa40,_0x5a6a('0x10'),JSON[_0x5a6a('0x12')](_0x57b902));if(_0x57b902[_0x5a6a('0x13')]){if(_0x57b902['error'][_0x5a6a('0x14')]===0x1f4){logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')]['message']);return _0x57e0f9(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);return _0x25d9a3(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}else{logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));_0x25d9a3(_0x57b902[_0x5a6a('0x16')][_0x5a6a('0x15')]);}})[_0x5a6a('0x17')](function(_0x1754cb){logger[_0x5a6a('0x13')]('CmCompany,\x20%s,\x20%s',_0x14fa40,_0x1754cb);_0x57e0f9(_0x1754cb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 9ee0319..953d1b4 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 _0x3a20=['addContacts','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','post'];(function(_0x19b805,_0x22c6f0){var _0x16b28e=function(_0x1fd3ed){while(--_0x1fd3ed){_0x19b805['push'](_0x19b805['shift']());}};_0x16b28e(++_0x22c6f0);}(_0x3a20,0x1a9));var _0x03a2=function(_0x56a20e,_0x231ac3){_0x56a20e=_0x56a20e-0x0;var _0x254a55=_0x3a20[_0x56a20e];return _0x254a55;};'use strict';var multer=require(_0x03a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03a2('0x1'));var express=require(_0x03a2('0x2'));var router=express[_0x03a2('0x3')]();var fs_extra=require(_0x03a2('0x4'));var auth=require(_0x03a2('0x5'));var interaction=require(_0x03a2('0x6'));var config=require(_0x03a2('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x03a2('0x8')](_0x03a2('0x9'),auth['isAuthenticated'](),controller[_0x03a2('0xa')]);router[_0x03a2('0x8')](_0x03a2('0xb'),auth[_0x03a2('0xc')](),controller[_0x03a2('0xd')]);router[_0x03a2('0x8')](_0x03a2('0xe'),auth[_0x03a2('0xc')](),controller['getContacts']);router[_0x03a2('0xf')]('/',auth[_0x03a2('0xc')](),controller['create']);router[_0x03a2('0xf')](_0x03a2('0xe'),auth['isAuthenticated'](),controller[_0x03a2('0x10')]);router[_0x03a2('0x11')]('/:id',auth[_0x03a2('0xc')](),controller['update']);router[_0x03a2('0x12')]('/:id',auth[_0x03a2('0xc')](),controller[_0x03a2('0x13')]);module[_0x03a2('0x14')]=router;
\ No newline at end of file
+var _0xa775=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','post','addContacts','put','update','destroy','exports','multer'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0xa775,0xf6));var _0x5a77=function(_0x55a233,_0x524fb7){_0x55a233=_0x55a233-0x0;var _0x39ae55=_0xa775[_0x55a233];return _0x39ae55;};'use strict';var multer=require(_0x5a77('0x0'));var util=require('util');var path=require(_0x5a77('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a77('0x2')]();var fs_extra=require(_0x5a77('0x3'));var auth=require(_0x5a77('0x4'));var interaction=require(_0x5a77('0x5'));var config=require('../../config/environment');var controller=require(_0x5a77('0x6'));router[_0x5a77('0x7')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0x9')]);router[_0x5a77('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xb')]);router[_0x5a77('0x7')](_0x5a77('0xc'),auth[_0x5a77('0x8')](),controller['getContacts']);router[_0x5a77('0xd')]('/',auth[_0x5a77('0x8')](),controller['create']);router[_0x5a77('0xd')]('/:id/contacts',auth[_0x5a77('0x8')](),controller[_0x5a77('0xe')]);router[_0x5a77('0xf')](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x10')]);router['delete'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x11')]);module[_0x5a77('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 50d1c32..78d669d 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 _0x5c95=['STRING','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports'];(function(_0x570091,_0x37a273){var _0x5638d6=function(_0x280662){while(--_0x280662){_0x570091['push'](_0x570091['shift']());}};_0x5638d6(++_0x37a273);}(_0x5c95,0x1a8));var _0x55c9=function(_0x3214d1,_0x3c61ad){_0x3214d1=_0x3214d1-0x0;var _0x520948=_0x5c95[_0x3214d1];return _0x520948;};'use strict';var _=require(_0x55c9('0x0'));var Sequelize=require(_0x55c9('0x1'));module[_0x55c9('0x2')]={'firstName':{'type':Sequelize[_0x55c9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x55c9('0x3')]},'street':{'type':Sequelize[_0x55c9('0x3')]},'postalCode':{'type':Sequelize[_0x55c9('0x3')]},'city':{'type':Sequelize[_0x55c9('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x55c9('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x55c9('0x3')]},'mobile':{'type':Sequelize[_0x55c9('0x3')]},'fax':{'type':Sequelize[_0x55c9('0x3')]},'email':{'type':Sequelize[_0x55c9('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x55c9('0x3')]},'fb_data':{'type':Sequelize[_0x55c9('0x3')]},'twitter':{'type':Sequelize[_0x55c9('0x3')]},'skype':{'type':Sequelize[_0x55c9('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x55c9('0x3')]},'line':{'type':Sequelize[_0x55c9('0x3')]},'wechat':{'type':Sequelize[_0x55c9('0x3')]},'telegram':{'type':Sequelize[_0x55c9('0x3')]},'UserId':{'type':Sequelize[_0x55c9('0x4')]},'priority':{'type':Sequelize[_0x55c9('0x4')](0x2)[_0x55c9('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x55c9('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xfec9=['TEXT','INTEGER','UNSIGNED','NOW','lodash','exports','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xfec9,0x146));var _0x9fec=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0xfec9[_0x4dcb47];return _0x352b40;};'use strict';var _=require(_0x9fec('0x0'));var Sequelize=require('sequelize');module[_0x9fec('0x1')]={'firstName':{'type':Sequelize[_0x9fec('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9fec('0x2')]},'street':{'type':Sequelize[_0x9fec('0x2')]},'postalCode':{'type':Sequelize[_0x9fec('0x2')]},'city':{'type':Sequelize[_0x9fec('0x2')]},'country':{'type':Sequelize[_0x9fec('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9fec('0x2')]},'description':{'type':Sequelize[_0x9fec('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9fec('0x2')]},'fax':{'type':Sequelize[_0x9fec('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9fec('0x2')]},'facebook':{'type':Sequelize[_0x9fec('0x2')]},'fb_data':{'type':Sequelize[_0x9fec('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x9fec('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x9fec('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x9fec('0x2')]},'telegram':{'type':Sequelize[_0x9fec('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x9fec('0x4')](0x2)[_0x9fec('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9fec('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a53b45b..6f09f31 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 _0xd81f=['create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','join','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','options','include','getHopperHistories','includeAll','binding_keys','No\x20association\x20keys\x20specified!','binding_values','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','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','browserName','customerPort','osName','ratingType','referer','mail','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','stack','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','all','then','fieldType','type','model','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','value','datetime','castTo','DATE','buildExpression','start','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\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','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','SELECT','clone','t.id\x20IN\x20?','user','role','agent','User','c.ListId\x20IN\x20?','sequelize','toString','CmContact','c.phone','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','columnName','displayName','analytics','findAll','alias','custom','values','merge','body','get','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s'];(function(_0x3cbfe3,_0x2a1db6){var _0x2888b0=function(_0x1898ec){while(--_0x1898ec){_0x3cbfe3['push'](_0x3cbfe3['shift']());}};_0x2888b0(++_0x2a1db6);}(_0xd81f,0x86));var _0xfd81=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xd81f[_0x174ef5];return _0x1cc379;};'use strict';var moment=require(_0xfd81('0x0'));var BPromise=require(_0xfd81('0x1'));var util=require(_0xfd81('0x2'));var path=require(_0xfd81('0x3'));var fs=require('fs');var _=require(_0xfd81('0x4'));var squel=require(_0xfd81('0x5'));var Papa=require('papaparse');var Redis=require(_0xfd81('0x6'));var qs=require(_0xfd81('0x7'));var as=require(_0xfd81('0x8'));var logger=require(_0xfd81('0x9'))(_0xfd81('0xa'));var config=require(_0xfd81('0xb'));var db=require('../../mysqldb')['db'];config[_0xfd81('0xc')]=_[_0xfd81('0xd')](config[_0xfd81('0xc')],{'host':_0xfd81('0xe'),'port':0x18eb});var socket=require(_0xfd81('0xf'))(new Redis(config[_0xfd81('0xc')]));require(_0xfd81('0x10'))['register'](socket);function respondWithResult(_0x3c0a16,_0x45c1f6){_0x45c1f6=_0x45c1f6||0xc8;return function(_0xa8128c){if(_0xa8128c){return _0x3c0a16[_0xfd81('0x11')](_0x45c1f6)[_0xfd81('0x12')](_0xa8128c);}};}function respondWithFilteredResult(_0x535258,_0x3ca5a0){return function(_0x463dee){if(_0x463dee){var _0x7af2f6=typeof _0x3ca5a0[_0xfd81('0x13')]===_0xfd81('0x14')&&typeof _0x3ca5a0['limit']===_0xfd81('0x14');var _0x29d9c0=_0x463dee[_0xfd81('0x15')];var _0x4abc75=_0x7af2f6?0x0:_0x3ca5a0['offset'];var _0x316770=_0x7af2f6?_0x463dee[_0xfd81('0x15')]:_0x3ca5a0[_0xfd81('0x13')]+_0x3ca5a0['limit'];var _0x1b1ed3;if(_0x316770>=_0x29d9c0){_0x316770=_0x29d9c0;_0x1b1ed3=0xc8;}else{_0x1b1ed3=0xce;}_0x535258[_0xfd81('0x11')](_0x1b1ed3);return _0x535258[_0xfd81('0x16')](_0xfd81('0x17'),_0x4abc75+'-'+_0x316770+'/'+_0x29d9c0)[_0xfd81('0x12')](_0x463dee);}return null;};}function saveUpdates(_0x587dfe){return function(_0x572af4){if(_0x572af4){return _0x572af4[_0xfd81('0x18')](_0x587dfe)['then'](function(_0x23d264){return _0x23d264;});}return null;};}function removeEntity(_0x214283){return function(_0x1e6902){if(_0x1e6902){return _0x1e6902[_0xfd81('0x19')]()['then'](function(){_0x214283['status'](0xcc)[_0xfd81('0x1a')]();});}};}function handleEntityNotFound(_0xd22cd4){return function(_0x3ee099){if(!_0x3ee099){_0xd22cd4['sendStatus'](0x194);}return _0x3ee099;};}function handleError(_0x4fa85d,_0x3cf000){_0x3cf000=_0x3cf000||0x1f4;return function(_0x19d54e){logger['error'](_0x19d54e[_0xfd81('0x1b')]);if(_0x19d54e['name']){delete _0x19d54e[_0xfd81('0x1c')];}_0x4fa85d[_0xfd81('0x11')](_0x3cf000)[_0xfd81('0x1d')](_0x19d54e);};}exports[_0xfd81('0x1e')]=function(_0x53795e,_0xb0b8b6){var _0x1dc5b7={},_0x8b81ab={},_0x23148f={'count':0x0,'rows':[]};return db['CmContact'][_0xfd81('0x1f')]()['then'](function(_0x205b1b){var _0x1cc324=[];for(var _0x301998=0x0;_0x301998
','Attachments','Title','Data'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xad40,0xfa));var _0x0ad4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xad40[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0ad4('0x0'));var moment=require(_0x0ad4('0x1'));var random=require(_0x0ad4('0x2'));var fs=require('fs');var path=require(_0x0ad4('0x3'));var util=require('util');var tnef=require(_0x0ad4('0x4'));var logger=require(_0x0ad4('0x5'))(_0x0ad4('0x6'));var config=require(_0x0ad4('0x7'));function getAddress(_0x85c3b9){var _0x34f7cb=_[_0x0ad4('0x8')](_0x85c3b9['value']);return _0x34f7cb&&_0x34f7cb[_0x0ad4('0x9')]?_0x34f7cb[_0x0ad4('0x9')]:_0x0ad4('0xa')+random[_0x0ad4('0xb')](0x6)+_0x0ad4('0xc');}function getFirstName(_0x29f1ee){var _0x239e92=_['head'](_0x29f1ee[_0x0ad4('0xd')]);if(_0x239e92&&_0x239e92[_0x0ad4('0xe')]){if(_0x239e92[_0x0ad4('0xe')]==_0x239e92[_0x0ad4('0x9')]){return _0x239e92[_0x0ad4('0xe')][_0x0ad4('0xf')](0x0,_0x239e92[_0x0ad4('0xe')]['indexOf']('@'));}var _0x1b9921=_0x239e92[_0x0ad4('0xe')][_0x0ad4('0x10')](/\s+/);return _0x1b9921[_0x0ad4('0x11')]>0x1?_0x1b9921[_0x0ad4('0x12')](0x0,-0x1)[_0x0ad4('0x13')]('\x20'):_0x239e92[_0x0ad4('0xe')];}return _0x0ad4('0x14');}function getLastName(_0xd8cad3){var _0x3808c2=_['head'](_0xd8cad3[_0x0ad4('0xd')]);if(_0x3808c2&&_0x3808c2['name']){var _0x2286e6=_0x3808c2['name'][_0x0ad4('0x10')](/\s+/);return _0x2286e6['length']>0x1?_0x2286e6[_0x0ad4('0x15')]():'';}return'';}function getMails(_0x58397f,_0x26190d){var _0x5a611f='';for(var _0x244474=0x0;_0x244474<_0x26190d[_0x0ad4('0xd')]['length'];_0x244474+=0x1){if(_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0x9')]!==_0x58397f){if(!_['isEmpty'](_0x5a611f)){_0x5a611f+=',';}_0x5a611f+=_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0xe')]||_0x26190d[_0x0ad4('0xd')][_0x244474][_0x0ad4('0x9')]||'';_0x5a611f+='\x20<';_0x5a611f+=_0x26190d[_0x0ad4('0xd')][_0x244474]['address']?_0x26190d['value'][_0x244474][_0x0ad4('0x9')]:'anonymous'+random['generate'](0x6)+_0x0ad4('0xc');_0x5a611f+='>';}}return _0x5a611f;}function parseEmail(_0x5e3c56,_0x411acc,_0x1bb68b){if(_0x411acc[_0x0ad4('0x16')]){var _0x147361=/