From 5c4c85703d974d20222c44d906e168119a04a318 Mon Sep 17 00:00:00 2001
From: support
Date: Thu, 6 Apr 2023 15:43:46 +0000
Subject: [PATCH] Built motion from commit 1ea47bf4.|2.6.34
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
.../chatWebsite/helpers/wildcard-expressions.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailInteractionHasTag/index.js | 2 +-
.../mailInteractionHasTag.controller.js | 2 +-
.../mailInteractionHasTag/mailInteractionHasTag.js | 2 +-
.../mailInteractionHasTag.model.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/accept-message.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/project.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/voiceQueueSummary.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/realtime/utils.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/misc.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1210 files changed, 1210 insertions(+), 1210 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 49e8f0d..976cf43 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-06T15:09:26.848Z",
+ "time": "2023-04-06T15:33:16.121Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f794d4d..f4feac1 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-06T15:09:26.848Z",
+ "time": "2023-04-06T15:33:16.121Z",
"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 2dde944..48a2ed9 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 _0xabe0=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xabe0,0x182));var _0x0abe=function(_0x15601f,_0x35938f){_0x15601f=_0x15601f-0x0;var _0x15d32d=_0xabe0[_0x15601f];return _0x15d32d;};'use strict';var Sequelize=require(_0x0abe('0x0'));module[_0x0abe('0x1')]={'name':{'type':Sequelize[_0x0abe('0x2')],'get':function(_0x2f356a){return this[_0x0abe('0x3')](_0x0abe('0x4'));}},'action':{'type':Sequelize[_0x0abe('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0abe('0x6'),_0x0abe('0x7'),_0x0abe('0x8'),_0x0abe('0x9'),_0x0abe('0xa'),'browser',_0x0abe('0xb'),_0x0abe('0xc')]],'msg':_0x0abe('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x0abe('0xe')},'data2':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comment':_0x0abe('0xf')},'data3':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comment':_0x0abe('0x10')},'data4':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comments':_0x0abe('0x11')},'data5':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x0abe('0x5')],'comments':_0x0abe('0x12')},'data7':{'type':Sequelize[_0x0abe('0x13')],'comments':_0x0abe('0x14')}};
\ No newline at end of file
+var _0xf517=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize'];(function(_0x4be2ed,_0x396c5f){var _0x26ec31=function(_0x2d4121){while(--_0x2d4121){_0x4be2ed['push'](_0x4be2ed['shift']());}};_0x26ec31(++_0x396c5f);}(_0xf517,0x97));var _0x7f51=function(_0x48ca42,_0x52a695){_0x48ca42=_0x48ca42-0x0;var _0x5a17e0=_0xf517[_0x48ca42];return _0x5a17e0;};'use strict';var Sequelize=require(_0x7f51('0x0'));module[_0x7f51('0x1')]={'name':{'type':Sequelize[_0x7f51('0x2')],'get':function(_0x137a32){return this[_0x7f51('0x3')](_0x7f51('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7f51('0x5'),_0x7f51('0x6'),_0x7f51('0x7'),_0x7f51('0x8'),_0x7f51('0x9'),'browser',_0x7f51('0xa'),_0x7f51('0xb')]],'msg':_0x7f51('0xc')}},'comment':_0x7f51('0xc')},'data1':{'type':Sequelize[_0x7f51('0xd')](0x1000),'comment':_0x7f51('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7f51('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x7f51('0xd')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x7f51('0xd')](0x1000),'comments':_0x7f51('0x10')},'data6':{'type':Sequelize[_0x7f51('0xd')],'comments':_0x7f51('0x11')},'data7':{'type':Sequelize[_0x7f51('0x12')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 97e09ba..b717c29 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 _0xc216=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','body','find','params','catch'];(function(_0x2261d1,_0x514c90){var _0x36c3ce=function(_0x465c49){while(--_0x465c49){_0x2261d1['push'](_0x2261d1['shift']());}};_0x36c3ce(++_0x514c90);}(_0xc216,0xc4));var _0x6c21=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc216[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c21('0x0'));var zipdir=require(_0x6c21('0x1'));var jsonpatch=require(_0x6c21('0x2'));var rp=require(_0x6c21('0x3'));var moment=require(_0x6c21('0x4'));var BPromise=require(_0x6c21('0x5'));var Mustache=require(_0x6c21('0x6'));var util=require(_0x6c21('0x7'));var path=require('path');var sox=require(_0x6c21('0x8'));var csv=require(_0x6c21('0x9'));var ejs=require(_0x6c21('0xa'));var fs=require('fs');var fs_extra=require(_0x6c21('0xb'));var _=require(_0x6c21('0xc'));var squel=require(_0x6c21('0xd'));var crypto=require(_0x6c21('0xe'));var jsforce=require(_0x6c21('0xf'));var deskjs=require(_0x6c21('0x10'));var toCsv=require(_0x6c21('0x9'));var querystring=require(_0x6c21('0x11'));var Papa=require(_0x6c21('0x12'));var Redis=require(_0x6c21('0x13'));var authService=require(_0x6c21('0x14'));var qs=require(_0x6c21('0x15'));var as=require(_0x6c21('0x16'));var hardwareService=require(_0x6c21('0x17'));var logger=require('../../config/logger')(_0x6c21('0x18'));var utils=require(_0x6c21('0x19'));var config=require(_0x6c21('0x1a'));var licenseUtil=require(_0x6c21('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5b97,_0x17baa8){_0x17baa8=_0x17baa8||0xcc;return function(_0x552436){if(_0x552436){return _0x1e5b97[_0x6c21('0x1c')](_0x17baa8);}return _0x1e5b97[_0x6c21('0x1d')](_0x17baa8)[_0x6c21('0x1e')]();};}function respondWithResult(_0x1ec8e0,_0x7c50fd){_0x7c50fd=_0x7c50fd||0xc8;return function(_0x24030a){if(_0x24030a){return _0x1ec8e0['status'](_0x7c50fd)[_0x6c21('0x1f')](_0x24030a);}};}function respondWithFilteredResult(_0x29dfe8,_0x3284fc){return function(_0xae5259){if(_0xae5259){var _0x3e7429=typeof _0x3284fc[_0x6c21('0x20')]===_0x6c21('0x21')&&typeof _0x3284fc[_0x6c21('0x22')]===_0x6c21('0x21');var _0x4d976c=_0xae5259[_0x6c21('0x23')];var _0x38de0b=_0x3e7429?0x0:_0x3284fc['offset'];var _0x408219=_0x3e7429?_0xae5259['count']:_0x3284fc[_0x6c21('0x20')]+_0x3284fc['limit'];var _0x1637b6;if(_0x408219>=_0x4d976c){_0x408219=_0x4d976c;_0x1637b6=0xc8;}else{_0x1637b6=0xce;}_0x29dfe8[_0x6c21('0x1d')](_0x1637b6);return _0x29dfe8[_0x6c21('0x24')]('Content-Range',_0x38de0b+'-'+_0x408219+'/'+_0x4d976c)[_0x6c21('0x1f')](_0xae5259);}return null;};}function patchUpdates(_0x505dac){return function(_0x1a476d){try{jsonpatch[_0x6c21('0x25')](_0x1a476d,_0x505dac,!![]);}catch(_0x26af81){return BPromise['reject'](_0x26af81);}return _0x1a476d[_0x6c21('0x26')]();};}function saveUpdates(_0x35ad90,_0x365287){return function(_0xf24cce){if(_0xf24cce){return _0xf24cce[_0x6c21('0x27')](_0x35ad90)[_0x6c21('0x28')](function(_0x1b2c61){return _0x1b2c61;});}return null;};}function removeEntity(_0xd261a3,_0xcaf75c){return function(_0x141c09){if(_0x141c09){return _0x141c09[_0x6c21('0x29')]()[_0x6c21('0x28')](function(){_0xd261a3[_0x6c21('0x1d')](0xcc)[_0x6c21('0x1e')]();});}};}function handleEntityNotFound(_0x365d11,_0x28de92){return function(_0x40ef52){if(!_0x40ef52){_0x365d11[_0x6c21('0x1c')](0x194);}return _0x40ef52;};}function handleError(_0x24ee81,_0x2fb173){_0x2fb173=_0x2fb173||0x1f4;return function(_0x173dea){logger[_0x6c21('0x2a')](_0x173dea['stack']);if(_0x173dea['name']){delete _0x173dea[_0x6c21('0x2b')];}_0x24ee81[_0x6c21('0x1d')](_0x2fb173)[_0x6c21('0x2c')](_0x173dea);};}exports[_0x6c21('0x27')]=function(_0x5d488b,_0x5d8916){if(_0x5d488b[_0x6c21('0x2d')]['id']){delete _0x5d488b[_0x6c21('0x2d')]['id'];}return db['Action'][_0x6c21('0x2e')]({'where':{'id':_0x5d488b['params']['id']}})[_0x6c21('0x28')](handleEntityNotFound(_0x5d8916,null))[_0x6c21('0x28')](saveUpdates(_0x5d488b[_0x6c21('0x2d')],null))[_0x6c21('0x28')](respondWithResult(_0x5d8916,null))['catch'](handleError(_0x5d8916,null));};exports['destroy']=function(_0x5959d1,_0x2e8864){return db['Action'][_0x6c21('0x2e')]({'where':{'id':_0x5959d1[_0x6c21('0x2f')]['id']}})[_0x6c21('0x28')](handleEntityNotFound(_0x2e8864,null))[_0x6c21('0x28')](removeEntity(_0x2e8864,null))[_0x6c21('0x30')](handleError(_0x2e8864,null));};
\ No newline at end of file
+var _0xa731=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','send','body','Action','find','params','catch','rimraf','fast-json-patch','moment','bluebird','util'];(function(_0x4abe09,_0x319000){var _0x51c711=function(_0x4bbfcc){while(--_0x4bbfcc){_0x4abe09['push'](_0x4abe09['shift']());}};_0x51c711(++_0x319000);}(_0xa731,0x144));var _0x1a73=function(_0x234ae4,_0x1482c2){_0x234ae4=_0x234ae4-0x0;var _0x2db683=_0xa731[_0x234ae4];return _0x2db683;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a73('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a73('0x1'));var rp=require('request-promise');var moment=require(_0x1a73('0x2'));var BPromise=require(_0x1a73('0x3'));var Mustache=require('mustache');var util=require(_0x1a73('0x4'));var path=require(_0x1a73('0x5'));var sox=require(_0x1a73('0x6'));var csv=require(_0x1a73('0x7'));var ejs=require(_0x1a73('0x8'));var fs=require('fs');var fs_extra=require(_0x1a73('0x9'));var _=require(_0x1a73('0xa'));var squel=require(_0x1a73('0xb'));var crypto=require(_0x1a73('0xc'));var jsforce=require(_0x1a73('0xd'));var deskjs=require(_0x1a73('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a73('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1a73('0x10'));var as=require(_0x1a73('0x11'));var hardwareService=require(_0x1a73('0x12'));var logger=require(_0x1a73('0x13'))(_0x1a73('0x14'));var utils=require(_0x1a73('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a73('0x16'));var db=require(_0x1a73('0x17'))['db'];function respondWithStatusCode(_0x4bda29,_0x2ba3a3){_0x2ba3a3=_0x2ba3a3||0xcc;return function(_0x41933b){if(_0x41933b){return _0x4bda29[_0x1a73('0x18')](_0x2ba3a3);}return _0x4bda29[_0x1a73('0x19')](_0x2ba3a3)[_0x1a73('0x1a')]();};}function respondWithResult(_0x1d8de5,_0x30307a){_0x30307a=_0x30307a||0xc8;return function(_0x5cf4ee){if(_0x5cf4ee){return _0x1d8de5[_0x1a73('0x19')](_0x30307a)['json'](_0x5cf4ee);}};}function respondWithFilteredResult(_0x567a22,_0x2ac40b){return function(_0x5ddfaf){if(_0x5ddfaf){var _0x512392=typeof _0x2ac40b[_0x1a73('0x1b')]===_0x1a73('0x1c')&&typeof _0x2ac40b[_0x1a73('0x1d')]==='undefined';var _0x405d07=_0x5ddfaf[_0x1a73('0x1e')];var _0x5bac7d=_0x512392?0x0:_0x2ac40b[_0x1a73('0x1b')];var _0x5c6c4a=_0x512392?_0x5ddfaf[_0x1a73('0x1e')]:_0x2ac40b['offset']+_0x2ac40b[_0x1a73('0x1d')];var _0x3dbc9f;if(_0x5c6c4a>=_0x405d07){_0x5c6c4a=_0x405d07;_0x3dbc9f=0xc8;}else{_0x3dbc9f=0xce;}_0x567a22[_0x1a73('0x19')](_0x3dbc9f);return _0x567a22[_0x1a73('0x1f')]('Content-Range',_0x5bac7d+'-'+_0x5c6c4a+'/'+_0x405d07)[_0x1a73('0x20')](_0x5ddfaf);}return null;};}function patchUpdates(_0x29d1f9){return function(_0x3ff135){try{jsonpatch[_0x1a73('0x21')](_0x3ff135,_0x29d1f9,!![]);}catch(_0x11a5f7){return BPromise[_0x1a73('0x22')](_0x11a5f7);}return _0x3ff135[_0x1a73('0x23')]();};}function saveUpdates(_0x2b6cfe,_0x32da28){return function(_0x5551e2){if(_0x5551e2){return _0x5551e2[_0x1a73('0x24')](_0x2b6cfe)[_0x1a73('0x25')](function(_0x290be4){return _0x290be4;});}return null;};}function removeEntity(_0x5bc51b,_0xa002ce){return function(_0x48d7e2){if(_0x48d7e2){return _0x48d7e2[_0x1a73('0x26')]()['then'](function(){_0x5bc51b['status'](0xcc)[_0x1a73('0x1a')]();});}};}function handleEntityNotFound(_0x317c17,_0x5c31b0){return function(_0x461613){if(!_0x461613){_0x317c17[_0x1a73('0x18')](0x194);}return _0x461613;};}function handleError(_0x28aa65,_0x135ff6){_0x135ff6=_0x135ff6||0x1f4;return function(_0x3f6b18){logger[_0x1a73('0x27')](_0x3f6b18[_0x1a73('0x28')]);if(_0x3f6b18['name']){delete _0x3f6b18['name'];}_0x28aa65[_0x1a73('0x19')](_0x135ff6)[_0x1a73('0x29')](_0x3f6b18);};}exports[_0x1a73('0x24')]=function(_0x1d920a,_0x722d96){if(_0x1d920a[_0x1a73('0x2a')]['id']){delete _0x1d920a['body']['id'];}return db[_0x1a73('0x2b')][_0x1a73('0x2c')]({'where':{'id':_0x1d920a[_0x1a73('0x2d')]['id']}})[_0x1a73('0x25')](handleEntityNotFound(_0x722d96,null))[_0x1a73('0x25')](saveUpdates(_0x1d920a[_0x1a73('0x2a')],null))['then'](respondWithResult(_0x722d96,null))[_0x1a73('0x2e')](handleError(_0x722d96,null));};exports[_0x1a73('0x26')]=function(_0x2af22d,_0x4b44dc){return db[_0x1a73('0x2b')][_0x1a73('0x2c')]({'where':{'id':_0x2af22d['params']['id']}})['then'](handleEntityNotFound(_0x4b44dc,null))[_0x1a73('0x25')](removeEntity(_0x4b44dc,null))['catch'](handleError(_0x4b44dc,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 011237c..a257180 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 _0xd1d9=['request-promise','rimraf','./action.attributes','exports','tools_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd1d9,0x13b));var _0x9d1d=function(_0x154f26,_0x228c67){_0x154f26=_0x154f26-0x0;var _0x2a1b3f=_0xd1d9[_0x154f26];return _0x2a1b3f;};'use strict';var _=require(_0x9d1d('0x0'));var util=require(_0x9d1d('0x1'));var logger=require(_0x9d1d('0x2'))('api');var moment=require(_0x9d1d('0x3'));var BPromise=require(_0x9d1d('0x4'));var rp=require(_0x9d1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x9d1d('0x7'));module[_0x9d1d('0x8')]=function(_0x1bde9f,_0xad9da9){return _0x1bde9f['define']('Action',attributes,{'tableName':_0x9d1d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x173d=['./action.attributes','define','tools_actions','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x59b0c3,_0x2599d8){var _0x18c961=function(_0x3018dc){while(--_0x3018dc){_0x59b0c3['push'](_0x59b0c3['shift']());}};_0x18c961(++_0x2599d8);}(_0x173d,0x108));var _0xd173=function(_0x3f9029,_0xeb1ce6){_0x3f9029=_0x3f9029-0x0;var _0x217cc6=_0x173d[_0x3f9029];return _0x217cc6;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd173('0x1'));var BPromise=require('bluebird');var rp=require(_0xd173('0x2'));var fs=require('fs');var path=require(_0xd173('0x3'));var rimraf=require(_0xd173('0x4'));var config=require(_0xd173('0x5'));var attributes=require(_0xd173('0x6'));module['exports']=function(_0x24f796,_0x2d464b){return _0x24f796[_0xd173('0x7')]('Action',attributes,{'tableName':_0xd173('0x8'),'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 45c9a95..73edaf6 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2d5abe,_0x421434){var _0x4a603c=function(_0x196bac){while(--_0x196bac){_0x2d5abe['push'](_0x2d5abe['shift']());}};_0x4a603c(++_0x421434);}(_0x1261,0x144));var _0x1126=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x1261[_0x380307];return _0x9ea14b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x457d29,_0x37da9f){var _0x190272=function(_0x5027d3){while(--_0x5027d3){_0x457d29['push'](_0x457d29['shift']());}};_0x190272(++_0x37da9f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x5fc3[_0x40911a];return _0x27e8e3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 821edcd..45e8c01 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 _0x7600=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x4c0ca7,_0x267486){var _0x198a33=function(_0xd3c479){while(--_0xd3c479){_0x4c0ca7['push'](_0x4c0ca7['shift']());}};_0x198a33(++_0x267486);}(_0x7600,0xf3));var _0x0760=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7600[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0x0760('0x0'));var util=require(_0x0760('0x1'));var path=require(_0x0760('0x2'));var timeout=require(_0x0760('0x3'));var express=require('express');var router=express[_0x0760('0x4')]();var fs_extra=require(_0x0760('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0760('0x6'));var config=require(_0x0760('0x7'));var controller=require(_0x0760('0x8'));router[_0x0760('0x9')](_0x0760('0xa'),auth[_0x0760('0xb')](),controller[_0x0760('0xc')]);router[_0x0760('0xd')](_0x0760('0xa'),auth[_0x0760('0xb')](),controller[_0x0760('0xe')]);module[_0x0760('0xf')]=router;
\ No newline at end of file
+var _0x076e=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x076e,0x1ad));var _0xe076=function(_0x1a6e48,_0x2f14de){_0x1a6e48=_0x1a6e48-0x0;var _0x4b1025=_0x076e[_0x1a6e48];return _0x4b1025;};'use strict';var multer=require(_0xe076('0x0'));var util=require('util');var path=require(_0xe076('0x1'));var timeout=require(_0xe076('0x2'));var express=require(_0xe076('0x3'));var router=express[_0xe076('0x4')]();var fs_extra=require(_0xe076('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe076('0x6'));var config=require(_0xe076('0x7'));var controller=require(_0xe076('0x8'));router[_0xe076('0x9')](_0xe076('0xa'),auth[_0xe076('0xb')](),controller[_0xe076('0xc')]);router['delete']('/:id',auth[_0xe076('0xb')](),controller[_0xe076('0xd')]);module[_0xe076('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 922a17f..78a3736 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x17de62,_0x561f1b){var _0x1014d4=function(_0x4dd9f1){while(--_0x4dd9f1){_0x17de62['push'](_0x17de62['shift']());}};_0x1014d4(++_0x561f1b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x038b=['exports','STRING','TEXT'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x038b,0x114));var _0xb038=function(_0x509210,_0x33fb39){_0x509210=_0x509210-0x0;var _0x23f5b0=_0x038b[_0x509210];return _0x23f5b0;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f1338a5..49b9da7 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 _0x93f4=['CustomReports','UserProfileResource','sendStatus','error','stack','name','index','AnalyticCustomReport','rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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','group','field','condition','value','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(%s)','IS\x20EMPTY','operator','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MAX(%s)','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','set','apply','then','destroy','get'];(function(_0x149cbe,_0x37e5b8){var _0x70795=function(_0x4cb85c){while(--_0x4cb85c){_0x149cbe['push'](_0x149cbe['shift']());}};_0x70795(++_0x37e5b8);}(_0x93f4,0x124));var _0x493f=function(_0xb29e9b,_0x6dee8c){_0xb29e9b=_0xb29e9b-0x0;var _0x10b5dc=_0x93f4[_0xb29e9b];return _0x10b5dc;};'use strict';var emlformat=require(_0x493f('0x0'));var rimraf=require(_0x493f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x493f('0x2'));var rp=require('request-promise');var moment=require(_0x493f('0x3'));var BPromise=require(_0x493f('0x4'));var Mustache=require(_0x493f('0x5'));var util=require(_0x493f('0x6'));var path=require(_0x493f('0x7'));var sox=require(_0x493f('0x8'));var csv=require(_0x493f('0x9'));var ejs=require(_0x493f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x493f('0xb'));var squel=require(_0x493f('0xc'));var crypto=require(_0x493f('0xd'));var jsforce=require(_0x493f('0xe'));var deskjs=require(_0x493f('0xf'));var toCsv=require(_0x493f('0x9'));var querystring=require(_0x493f('0x10'));var Papa=require(_0x493f('0x11'));var Redis=require(_0x493f('0x12'));var authService=require(_0x493f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x493f('0x14'));var hardwareService=require(_0x493f('0x15'));var logger=require('../../config/logger')(_0x493f('0x16'));var utils=require(_0x493f('0x17'));var config=require(_0x493f('0x18'));var licenseUtil=require(_0x493f('0x19'));var db=require(_0x493f('0x1a'))['db'];var dbH=require(_0x493f('0x1a'))[_0x493f('0x1b')];function respondWithStatusCode(_0x4bdc5e,_0x43a352){_0x43a352=_0x43a352||0xcc;return function(_0x436b02){if(_0x436b02){return _0x4bdc5e['sendStatus'](_0x43a352);}return _0x4bdc5e[_0x493f('0x1c')](_0x43a352)[_0x493f('0x1d')]();};}function respondWithResult(_0x2e83df,_0x1e7156){_0x1e7156=_0x1e7156||0xc8;return function(_0x33a910){if(_0x33a910){return _0x2e83df[_0x493f('0x1c')](_0x1e7156)[_0x493f('0x1e')](_0x33a910);}};}function respondWithFilteredResult(_0x13884f,_0x408fe1){return function(_0x2fe523){if(_0x2fe523){var _0x6905d0=typeof _0x408fe1[_0x493f('0x1f')]==='undefined'&&typeof _0x408fe1['limit']===_0x493f('0x20');var _0x208568=_0x2fe523[_0x493f('0x21')];var _0x276eaf=_0x6905d0?0x0:_0x408fe1['offset'];var _0x571a7c=_0x6905d0?_0x2fe523[_0x493f('0x21')]:_0x408fe1['offset']+_0x408fe1[_0x493f('0x22')];var _0x36cef8;if(_0x571a7c>=_0x208568){_0x571a7c=_0x208568;_0x36cef8=0xc8;}else{_0x36cef8=0xce;}_0x13884f[_0x493f('0x1c')](_0x36cef8);return _0x13884f[_0x493f('0x23')]('Content-Range',_0x276eaf+'-'+_0x571a7c+'/'+_0x208568)[_0x493f('0x1e')](_0x2fe523);}return null;};}function patchUpdates(_0x26cd55){return function(_0x1913ef){try{jsonpatch[_0x493f('0x24')](_0x1913ef,_0x26cd55,!![]);}catch(_0x233db6){return BPromise['reject'](_0x233db6);}return _0x1913ef['save']();};}function saveUpdates(_0x43830c,_0xb21fe6){return function(_0x13c0c9){if(_0x13c0c9){return _0x13c0c9['update'](_0x43830c)[_0x493f('0x25')](function(_0x404d47){return _0x404d47;});}return null;};}function removeEntity(_0x3eb068,_0xe9b085){return function(_0x58d06){if(_0x58d06){return _0x58d06[_0x493f('0x26')]()['then'](function(){var _0x3eb381=_0x58d06[_0x493f('0x27')]({'plain':!![]});var _0x2b7108=_0x493f('0x28');return db[_0x493f('0x29')][_0x493f('0x26')]({'where':{'type':_0x2b7108,'resourceId':_0x3eb381['id']}})['then'](function(){return _0x58d06;});})[_0x493f('0x25')](function(){_0x3eb068['status'](0xcc)[_0x493f('0x1d')]();});}};}function handleEntityNotFound(_0x180052,_0x45d0be){return function(_0x4209b8){if(!_0x4209b8){_0x180052[_0x493f('0x2a')](0x194);}return _0x4209b8;};}function handleError(_0xc552c,_0x24681b){_0x24681b=_0x24681b||0x1f4;return function(_0x1dfa3e){logger[_0x493f('0x2b')](_0x1dfa3e[_0x493f('0x2c')]);if(_0x1dfa3e[_0x493f('0x2d')]){delete _0x1dfa3e['name'];}_0xc552c['status'](_0x24681b)['send'](_0x1dfa3e);};}exports[_0x493f('0x2e')]=function(_0x588180,_0x3b4bf3){var _0x4bcf53={},_0x45609b={},_0x352656={'count':0x0,'rows':[]};var _0x5d9347=_['map'](db[_0x493f('0x2f')][_0x493f('0x30')],function(_0x230d35){return{'name':_0x230d35['fieldName'],'type':_0x230d35[_0x493f('0x31')][_0x493f('0x32')]};});_0x45609b['model']=_[_0x493f('0x33')](_0x5d9347,'name');_0x45609b[_0x493f('0x34')]=_['keys'](_0x588180[_0x493f('0x34')]);_0x45609b['filters']=_[_0x493f('0x35')](_0x45609b['model'],_0x45609b['query']);_0x4bcf53['attributes']=_[_0x493f('0x35')](_0x45609b[_0x493f('0x36')],qs['fields'](_0x588180[_0x493f('0x34')][_0x493f('0x37')]));_0x4bcf53[_0x493f('0x38')]=_0x4bcf53[_0x493f('0x38')][_0x493f('0x39')]?_0x4bcf53['attributes']:_0x45609b[_0x493f('0x36')];if(!_0x588180[_0x493f('0x34')][_0x493f('0x3a')](_0x493f('0x3b'))){_0x4bcf53[_0x493f('0x22')]=qs['limit'](_0x588180[_0x493f('0x34')]['limit']);_0x4bcf53[_0x493f('0x1f')]=qs[_0x493f('0x1f')](_0x588180[_0x493f('0x34')]['offset']);}_0x4bcf53[_0x493f('0x3c')]=qs[_0x493f('0x3d')](_0x588180[_0x493f('0x34')]['sort']);_0x4bcf53[_0x493f('0x3e')]=qs['filters'](_[_0x493f('0x3f')](_0x588180[_0x493f('0x34')],_0x45609b[_0x493f('0x40')]),_0x5d9347);if(_0x588180[_0x493f('0x34')][_0x493f('0x41')]){_0x4bcf53['where']=_['merge'](_0x4bcf53[_0x493f('0x3e')],{'$or':_[_0x493f('0x33')](_0x5d9347,function(_0x4ffa01){if(_0x4ffa01[_0x493f('0x31')]!=='VIRTUAL'){var _0x5c259e={};_0x5c259e[_0x4ffa01['name']]={'$like':'%'+_0x588180[_0x493f('0x34')][_0x493f('0x41')]+'%'};return _0x5c259e;}})});}_0x4bcf53=_[_0x493f('0x42')]({},_0x4bcf53,_0x588180[_0x493f('0x43')]);var _0x4c0230={'where':_0x4bcf53[_0x493f('0x3e')]};return db['AnalyticCustomReport'][_0x493f('0x21')](_0x4c0230)[_0x493f('0x25')](function(_0x5ea662){_0x352656[_0x493f('0x21')]=_0x5ea662;if(_0x588180[_0x493f('0x34')][_0x493f('0x44')]){_0x4bcf53[_0x493f('0x45')]=[{'all':!![]}];}return db[_0x493f('0x2f')][_0x493f('0x46')](_0x4bcf53);})[_0x493f('0x25')](function(_0x25d373){_0x352656[_0x493f('0x47')]=_0x25d373;return _0x352656;})[_0x493f('0x25')](respondWithFilteredResult(_0x3b4bf3,_0x4bcf53))[_0x493f('0x48')](handleError(_0x3b4bf3,null));};exports['show']=function(_0x28b3f9,_0x3fc614){var _0x122b1f={'raw':![],'where':{'id':_0x28b3f9['params']['id']}},_0x2b1150={};_0x2b1150['model']=_['keys'](db[_0x493f('0x2f')][_0x493f('0x30')]);_0x2b1150[_0x493f('0x34')]=_['keys'](_0x28b3f9['query']);_0x2b1150[_0x493f('0x40')]=_['intersection'](_0x2b1150[_0x493f('0x36')],_0x2b1150[_0x493f('0x34')]);_0x122b1f['attributes']=_[_0x493f('0x35')](_0x2b1150[_0x493f('0x36')],qs['fields'](_0x28b3f9[_0x493f('0x34')][_0x493f('0x37')]));_0x122b1f[_0x493f('0x38')]=_0x122b1f[_0x493f('0x38')]['length']?_0x122b1f[_0x493f('0x38')]:_0x2b1150[_0x493f('0x36')];if(_0x28b3f9[_0x493f('0x34')][_0x493f('0x44')]){_0x122b1f[_0x493f('0x45')]=[{'all':!![]}];}_0x122b1f=_[_0x493f('0x42')]({},_0x122b1f,_0x28b3f9['options']);return db[_0x493f('0x2f')][_0x493f('0x49')](_0x122b1f)[_0x493f('0x25')](handleEntityNotFound(_0x3fc614,null))[_0x493f('0x25')](respondWithResult(_0x3fc614,null))['catch'](handleError(_0x3fc614,null));};exports['create']=function(_0x5ae1d2,_0x5a61f1){return db[_0x493f('0x2f')][_0x493f('0x4a')](_0x5ae1d2[_0x493f('0x4b')],{})[_0x493f('0x25')](function(_0x32075d){var _0x35dc3e=_0x5ae1d2[_0x493f('0x4c')][_0x493f('0x27')]({'plain':!![]});if(!_0x35dc3e)throw new Error(_0x493f('0x4d'));if(_0x35dc3e['role']===_0x493f('0x4c')){var _0x4ee012=_0x32075d[_0x493f('0x27')]({'plain':!![]});var _0x1dc8d4=_0x493f('0x4e');return db['UserProfileSection'][_0x493f('0x49')]({'where':{'name':_0x1dc8d4,'userProfileId':_0x35dc3e[_0x493f('0x4f')]},'raw':!![]})[_0x493f('0x25')](function(_0x1e8c9b){if(_0x1e8c9b&&_0x1e8c9b[_0x493f('0x50')]===0x0){return db[_0x493f('0x29')][_0x493f('0x4a')]({'name':_0x4ee012[_0x493f('0x2d')],'resourceId':_0x4ee012['id'],'type':'CustomReports','sectionId':_0x1e8c9b['id']},{})[_0x493f('0x25')](function(){return _0x32075d;});}else{return _0x32075d;}})['catch'](function(_0x35b104){logger[_0x493f('0x2b')](_0x493f('0x51'),_0x35b104);throw _0x35b104;});}return _0x32075d;})['then'](respondWithResult(_0x5a61f1,0xc9))[_0x493f('0x48')](handleError(_0x5a61f1,null));};exports[_0x493f('0x52')]=function(_0x414e43,_0x581704){if(_0x414e43[_0x493f('0x4b')]['id']){delete _0x414e43[_0x493f('0x4b')]['id'];}return db[_0x493f('0x2f')][_0x493f('0x49')]({'where':{'id':_0x414e43[_0x493f('0x53')]['id']}})[_0x493f('0x25')](handleEntityNotFound(_0x581704,null))[_0x493f('0x25')](saveUpdates(_0x414e43['body'],null))[_0x493f('0x25')](respondWithResult(_0x581704,null))[_0x493f('0x48')](handleError(_0x581704,null));};exports['destroy']=function(_0x1aa548,_0x565995){return db[_0x493f('0x2f')]['find']({'where':{'id':_0x1aa548[_0x493f('0x53')]['id']}})[_0x493f('0x25')](handleEntityNotFound(_0x565995,null))['then'](removeEntity(_0x565995,null))[_0x493f('0x48')](handleError(_0x565995,null));};exports['preview']=function(_0x9c6e08,_0x2db416){var _0x44ffde=0xa;var _0x5ed462=['join',_0x493f('0x54'),_0x493f('0x55'),_0x493f('0x56')];var _0x2b95d1={'SUM':_0x493f('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x493f('0x58'),'MAX':'MAX(%s)','MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':_0x493f('0x5b'),'GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':_0x493f('0x5d')};var _0x2bc93b={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':_0x493f('0x61'),'UNIX_TIMESTAMP':_0x493f('0x62')};var _0x1eb8e7=function(_0x23a273){return!_[_0x493f('0x63')]([_0x493f('0x64'),_0x493f('0x65'),'IS\x20EMPTY',_0x493f('0x66')],_0x23a273);};var _0x507376=function(_0x472a06){if(!_0x472a06||!_0x472a06[_0x493f('0x67')][_0x493f('0x39')]){return'';}for(var _0x215327='(',_0x4ebd9b=0x0;_0x4ebd9b<_0x472a06[_0x493f('0x67')]['length'];_0x4ebd9b+=0x1){_0x4ebd9b>0x0&&(_0x215327+='\x20'+_0x472a06['operator']+'\x20');_0x215327+=_0x472a06['rules'][_0x4ebd9b]['group']?_0x507376(_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x68')]):_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x69')]+'\x20'+_0x472a06['rules'][_0x4ebd9b]['condition']+(_0x1eb8e7(_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x6a')])?'\x20'+_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x6b')]:'');}return _0x215327+')';};var _0x54cdbd={'where':{'id':_0x9c6e08[_0x493f('0x53')]['id']}},_0x269988,_0x31c420,_0x276acb,_0x59a0e8,_0x28b988;_0x54cdbd=_[_0x493f('0x42')]({},_0x54cdbd,_0x9c6e08[_0x493f('0x43')]);return db['AnalyticCustomReport'][_0x493f('0x49')](_0x54cdbd)[_0x493f('0x25')](function(_0x5edc4c){if(_0x5edc4c){_0x269988=_0x5edc4c;return _0x5edc4c['getFields']();}return null;})['then'](function(_0x3c8692){if(_0x3c8692){if(!_0x3c8692['length']){throw new db[(_0x493f('0x6c'))][(_0x493f('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31c420=_0x3c8692;return db['AnalyticMetric'][_0x493f('0x46')]({'raw':!![]});}return null;})[_0x493f('0x25')](function(_0x2a192d){if(_0x2a192d){_0x276acb=_[_0x493f('0x6e')](_0x2a192d,'id');var _0x17571d;var _0x380e6d=squel[_0x493f('0x6f')]();_0x380e6d['from'](_0x269988[_0x493f('0x70')]);for(var _0x481d7e=0x0;_0x481d7e<_0x31c420[_0x493f('0x39')];_0x481d7e+=0x1){_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x71')]?_0x276acb[_0x31c420[_0x481d7e][_0x493f('0x71')]][_0x493f('0x72')]:_0x31c420[_0x481d7e][_0x493f('0x69')];_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x73')]?_[_0x493f('0x74')](_0x2b95d1[_0x31c420[_0x481d7e][_0x493f('0x73')]],'%s',_0x17571d):_0x17571d;_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x75')]?_[_0x493f('0x74')](_0x2bc93b[_0x31c420[_0x481d7e][_0x493f('0x75')]],'%s',_0x17571d):_0x17571d;if(_0x31c420[_0x481d7e]['groupBy']){_0x380e6d[_0x493f('0x68')](_0x17571d);}_0x31c420[_0x481d7e][_0x493f('0x76')]&&_0x380e6d[_0x493f('0x3c')](_0x17571d,_0x31c420[_0x481d7e]['orderBy']===_0x493f('0x77')?![]:!![]);_0x380e6d[_0x493f('0x69')](_0x17571d,_0x31c420[_0x481d7e][_0x493f('0x78')]||_0x17571d);}if(_0x269988['joins']){_0x269988[_0x493f('0x79')]=JSON['parse'](_0x269988['joins']);for(var _0x1cfa36=0x0;_0x1cfa36<_0x269988[_0x493f('0x79')][_0x493f('0x39')];_0x1cfa36+=0x1){if(_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x31')]&&_[_0x493f('0x63')](_0x5ed462,_0x269988[_0x493f('0x79')][_0x1cfa36]['type'])&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7a')]&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')]&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7c')]){_0x380e6d[_0x269988[_0x493f('0x79')][_0x1cfa36]['type']](_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')],null,util['format'](_0x493f('0x7d'),_0x269988[_0x493f('0x70')],_0x269988['joins'][_0x1cfa36]['parentKey'],_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')],_0x269988[_0x493f('0x79')][_0x1cfa36]['foreignKey']));}}}if(_0x269988[_0x493f('0x7e')]){_0x269988[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x269988[_0x493f('0x7e')]);_0x380e6d['where'](_0x507376(_0x269988[_0x493f('0x7e')]['group']));}_0x28b988=_0x380e6d[_0x493f('0x80')]();_0x380e6d['limit'](_0x44ffde);_0x380e6d[_0x493f('0x1f')](0x0);logger[_0x493f('0x81')](_0x493f('0x82'),_0x380e6d[_0x493f('0x83')]());return dbH[_0x493f('0x84')]['query'](_0x380e6d['toString'](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')][_0x493f('0x86')]});}})[_0x493f('0x25')](respondWithResult(_0x2db416,null))[_0x493f('0x48')](handleError(_0x2db416,null));};function runReport(_0x2a0a75,_0x15a0a5,_0x1a77ee){var _0x268523=_0x15a0a5['name'];var _0x41bf51=0xa;var _0x17aa99=[_0x493f('0x87'),_0x493f('0x54'),_0x493f('0x55'),'cross_join'];var _0x5b9ee3={'SUM':_0x493f('0x57'),'COUNT':_0x493f('0x88'),'COUNT DISTINCT':_0x493f('0x58'),'MAX':'MAX(%s)','MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':_0x493f('0x5b'),'GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x153bf8={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':_0x493f('0x61'),'UNIX_TIMESTAMP':_0x493f('0x62')};var _0x4eccc3=function(_0xaf934){return!_[_0x493f('0x63')]([_0x493f('0x64'),'IS\x20NOT\x20NULL',_0x493f('0x89'),'IS\x20NOT\x20EMPTY'],_0xaf934);};var _0x2b1bfe=function(_0x373ce3){if(!_0x373ce3||!_0x373ce3[_0x493f('0x67')]['length']){return'';}for(var _0x300b42='(',_0x5bab0a=0x0;_0x5bab0a<_0x373ce3[_0x493f('0x67')][_0x493f('0x39')];_0x5bab0a+=0x1){_0x5bab0a>0x0&&(_0x300b42+='\x20'+_0x373ce3[_0x493f('0x8a')]+'\x20');_0x300b42+=_0x373ce3['rules'][_0x5bab0a]['group']?_0x2b1bfe(_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x68')]):_0x373ce3['rules'][_0x5bab0a]['field']+'\x20'+_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6a')]+(_0x4eccc3(_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6a')])?'\x20'+_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6b')]:'');}return _0x300b42+')';};var _0x131b58={'where':{'id':_0x2a0a75['id']}},_0x3204dc,_0x22e77d,_0xc628d4,_0xee874b,_0xdb2949;_0x131b58=_[_0x493f('0x42')]({},_0x131b58,_0x1a77ee);return db[_0x493f('0x2f')][_0x493f('0x49')](_0x131b58)['then'](function(_0x1122e9){if(_0x1122e9){_0x3204dc=_0x1122e9;return _0x1122e9[_0x493f('0x8b')]();}return null;})['then'](function(_0xe82b58){if(_0xe82b58){if(!_0xe82b58['length']){throw new db[(_0x493f('0x6c'))][(_0x493f('0x6d'))](_0x493f('0x8c'),0x193);}_0x22e77d=_0xe82b58;return db[_0x493f('0x8d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xa46a16){if(_0xa46a16){_0xc628d4=_[_0x493f('0x6e')](_0xa46a16,'id');var _0xf24eef;var _0x5895c1=squel[_0x493f('0x6f')]();_0x5895c1[_0x493f('0x8e')](_0x3204dc['table']);for(var _0x1c55d6=0x0;_0x1c55d6<_0x22e77d[_0x493f('0x39')];_0x1c55d6+=0x1){_0xf24eef=_0x22e77d[_0x1c55d6][_0x493f('0x71')]?_0xc628d4[_0x22e77d[_0x1c55d6][_0x493f('0x71')]]['metric']:_0x22e77d[_0x1c55d6][_0x493f('0x69')];_0xf24eef=_0x22e77d[_0x1c55d6][_0x493f('0x73')]?_['replace'](_0x5b9ee3[_0x22e77d[_0x1c55d6]['function']],'%s',_0xf24eef):_0xf24eef;_0xf24eef=_0x22e77d[_0x1c55d6]['format']?_[_0x493f('0x74')](_0x153bf8[_0x22e77d[_0x1c55d6][_0x493f('0x75')]],'%s',_0xf24eef):_0xf24eef;if(_0x22e77d[_0x1c55d6][_0x493f('0x8f')]){_0x5895c1[_0x493f('0x68')](_0xf24eef);}_0x22e77d[_0x1c55d6]['orderBy']&&_0x5895c1['order'](_0xf24eef,_0x22e77d[_0x1c55d6][_0x493f('0x76')]==='DESC'?![]:!![]);_0x5895c1[_0x493f('0x69')](_0xf24eef,_0x22e77d[_0x1c55d6][_0x493f('0x78')]||_0xf24eef);}if(_0x3204dc[_0x493f('0x79')]){_0x3204dc[_0x493f('0x79')]=JSON['parse'](_0x3204dc[_0x493f('0x79')]);for(var _0x10845e=0x0;_0x10845e<_0x3204dc[_0x493f('0x79')][_0x493f('0x39')];_0x10845e+=0x1){if(_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x31')]&&_['includes'](_0x17aa99,_0x3204dc[_0x493f('0x79')][_0x10845e]['type'])&&_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7a')]&&_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignTable']&&_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7c')]){_0x5895c1[_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x31')]](_0x3204dc['joins'][_0x10845e][_0x493f('0x7b')],null,util[_0x493f('0x75')](_0x493f('0x7d'),_0x3204dc['table'],_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7a')],_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignTable'],_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignKey']));}}}if(_0x3204dc[_0x493f('0x7e')]){_0x3204dc[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x3204dc[_0x493f('0x7e')]);_0x5895c1[_0x493f('0x3e')](_0x2b1bfe(_0x3204dc[_0x493f('0x7e')]['group']));}_0xdb2949=_0x5895c1[_0x493f('0x80')]();_0x5895c1[_0x493f('0x22')](_0x41bf51);_0x5895c1[_0x493f('0x1f')](0x0);return;}})[_0x493f('0x25')](function(){if(_0x15a0a5[_0x493f('0x90')]==='web'){return null;}var _0x44ff76=_['merge'](_0x15a0a5,{'name':_0x15a0a5[_0x493f('0x91')]||_0x15a0a5['name']||_0x3204dc[_0x493f('0x2d')],'basename':_0x268523,'savename':util['format'](_0x493f('0x92'),_0x15a0a5['name']||_0x3204dc[_0x493f('0x2d')],require(_0x493f('0x93'))[_0x493f('0x94')](0x4),_0x15a0a5[_0x493f('0x90')]||_0x493f('0x95')),'reportId':_0x3204dc['id'],'reportType':_0x493f('0x96')});return db[_0x493f('0x97')][_0x493f('0x4a')](_0x44ff76,{'raw':!![]});})[_0x493f('0x25')](function(_0xe73fed){if(_0x3204dc['table']==='cdr'){_0xdb2949[_0x493f('0x3e')](_0x3204dc[_0x493f('0x70')]+_0x493f('0x98'),_0x15a0a5[_0x493f('0x99')],_0x15a0a5['endDate']);}else{_0xdb2949[_0x493f('0x3e')](_0x3204dc[_0x493f('0x70')]+_0x493f('0x9a'),_0x15a0a5['startDate'],_0x15a0a5[_0x493f('0x9b')]);}if(_0xe73fed){logger[_0x493f('0x9c')](_0x493f('0x9d'),_0xdb2949[_0x493f('0x83')]());require(_0x493f('0x9e'))['fork'](path[_0x493f('0x87')](__dirname,'../../components/export/',_0xe73fed[_0x493f('0x90')]),[_0xe73fed['id'],_0xdb2949[_0x493f('0x83')](),path[_0x493f('0x87')](__dirname,_0x493f('0x9f'),_0xe73fed[_0x493f('0xa0')]),_0x268523]);return _0xe73fed;}else{var _0x3859ef=squel[_0x493f('0x6f')]();_0x3859ef[_0x493f('0x8e')]('('+_0xdb2949[_0x493f('0x83')]()+')',_0x493f('0xa1'));_0x3859ef[_0x493f('0x69')](_0x493f('0xa2'),_0x493f('0x21'));_0xdb2949[_0x493f('0x22')](_0x15a0a5['limit']||_0x41bf51);_0xdb2949['offset'](_0x15a0a5[_0x493f('0x1f')]||0x0);return dbH[_0x493f('0x84')]['query'](_0x3859ef[_0x493f('0x83')](),{'type':dbH['sequelize'][_0x493f('0x85')]['SELECT']})[_0x493f('0x25')](function(_0x39bf78){if(!_0x39bf78[_0x493f('0x39')]){_0xee874b=0x0;}else{_0xee874b=_0x39bf78[0x0][_0x493f('0x21')]||0x0;}return dbH[_0x493f('0x84')][_0x493f('0x34')](_0xdb2949[_0x493f('0x83')](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')][_0x493f('0x86')]});})['then'](function(_0x4ab383){return{'rows':_0x4ab383||[],'count':_0xee874b};});}});}exports[_0x493f('0xa3')]=function(_0x4f232f,_0x3ac606){return runReport(_0x4f232f[_0x493f('0x53')],_0x4f232f[_0x493f('0x34')],_0x4f232f[_0x493f('0x43')])[_0x493f('0x25')](respondWithResult(_0x3ac606,null))[_0x493f('0x48')](handleError(_0x3ac606,null));};exports[_0x493f('0xa4')]=runReport;exports[_0x493f('0x34')]=function(_0x3896a3,_0x1138da){var _0x435789=0xa;var _0x3ae1ea=[_0x493f('0x87'),_0x493f('0x54'),_0x493f('0x55'),_0x493f('0x56')];var _0x35a20a={'SUM':_0x493f('0x57'),'COUNT':_0x493f('0x88'),'COUNT DISTINCT':_0x493f('0x58'),'MAX':_0x493f('0xa5'),'MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x362a15={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x493f('0x62')};var _0x5d7d13=function(_0x39aec6){return!_[_0x493f('0x63')]([_0x493f('0x64'),_0x493f('0x65'),_0x493f('0x89'),'IS\x20NOT\x20EMPTY'],_0x39aec6);};var _0x2fff0c=function(_0x521633){if(!_0x521633||!_0x521633['rules'][_0x493f('0x39')]){return'';}for(var _0x3f28fe='(',_0x54f17f=0x0;_0x54f17f<_0x521633['rules'][_0x493f('0x39')];_0x54f17f+=0x1){_0x54f17f>0x0&&(_0x3f28fe+='\x20'+_0x521633['operator']+'\x20');_0x3f28fe+=_0x521633['rules'][_0x54f17f][_0x493f('0x68')]?_0x2fff0c(_0x521633[_0x493f('0x67')][_0x54f17f][_0x493f('0x68')]):_0x521633['rules'][_0x54f17f]['field']+'\x20'+_0x521633[_0x493f('0x67')][_0x54f17f]['condition']+(_0x5d7d13(_0x521633['rules'][_0x54f17f][_0x493f('0x6a')])?'\x20'+_0x521633[_0x493f('0x67')][_0x54f17f]['value']:'');}return _0x3f28fe+')';};var _0x4dbaf8={'where':{'id':_0x3896a3[_0x493f('0x53')]['id']}},_0x1fdf35,_0x4d5cac,_0x20d5c3,_0x40ea7e,_0x5abf64;_0x4dbaf8=_[_0x493f('0x42')]({},_0x4dbaf8,_0x3896a3[_0x493f('0x43')]);return db['AnalyticCustomReport'][_0x493f('0x49')](_0x4dbaf8)['then'](function(_0x1b745f){if(_0x1b745f){_0x1fdf35=_0x1b745f;return _0x1b745f[_0x493f('0x8b')]();}return null;})[_0x493f('0x25')](function(_0x2531a6){if(_0x2531a6){if(!_0x2531a6[_0x493f('0x39')]){throw new db[(_0x493f('0x6c'))]['ValidationErrorItem'](_0x493f('0x8c'),0x193);}_0x4d5cac=_0x2531a6;return db[_0x493f('0x8d')][_0x493f('0x46')]({'raw':!![]});}return null;})[_0x493f('0x25')](function(_0x3e93a5){if(_0x3e93a5){_0x20d5c3=_['keyBy'](_0x3e93a5,'id');var _0x245265;var _0x3168d1=squel[_0x493f('0x6f')]();_0x3168d1['from'](_0x1fdf35['table']);for(var _0x5a3707=0x0;_0x5a3707<_0x4d5cac['length'];_0x5a3707+=0x1){_0x245265=_0x4d5cac[_0x5a3707][_0x493f('0x71')]?_0x20d5c3[_0x4d5cac[_0x5a3707][_0x493f('0x71')]][_0x493f('0x72')]:_0x4d5cac[_0x5a3707][_0x493f('0x69')];_0x245265=_0x4d5cac[_0x5a3707]['function']?_[_0x493f('0x74')](_0x35a20a[_0x4d5cac[_0x5a3707][_0x493f('0x73')]],'%s',_0x245265):_0x245265;_0x245265=_0x4d5cac[_0x5a3707][_0x493f('0x75')]?_[_0x493f('0x74')](_0x362a15[_0x4d5cac[_0x5a3707][_0x493f('0x75')]],'%s',_0x245265):_0x245265;if(_0x4d5cac[_0x5a3707][_0x493f('0x8f')]){_0x3168d1['group'](_0x245265);}_0x4d5cac[_0x5a3707][_0x493f('0x76')]&&_0x3168d1[_0x493f('0x3c')](_0x245265,_0x4d5cac[_0x5a3707][_0x493f('0x76')]===_0x493f('0x77')?![]:!![]);_0x3168d1[_0x493f('0x69')](_0x245265,_0x4d5cac[_0x5a3707][_0x493f('0x78')]||_0x245265);}if(_0x1fdf35[_0x493f('0x79')]){_0x1fdf35[_0x493f('0x79')]=JSON[_0x493f('0x7f')](_0x1fdf35[_0x493f('0x79')]);for(var _0x956283=0x0;_0x956283<_0x1fdf35[_0x493f('0x79')][_0x493f('0x39')];_0x956283+=0x1){if(_0x1fdf35['joins'][_0x956283]['type']&&_[_0x493f('0x63')](_0x3ae1ea,_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x31')])&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7a')]&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7b')]&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7c')]){_0x3168d1[_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x31')]](_0x1fdf35['joins'][_0x956283][_0x493f('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1fdf35['table'],_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7a')],_0x1fdf35['joins'][_0x956283][_0x493f('0x7b')],_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7c')]));}}}if(_0x1fdf35[_0x493f('0x7e')]){_0x1fdf35[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x1fdf35[_0x493f('0x7e')]);_0x3168d1['where'](_0x2fff0c(_0x1fdf35['conditions'][_0x493f('0x68')]));}_0x5abf64=_0x3168d1[_0x493f('0x80')]();_0x3168d1[_0x493f('0x22')](_0x435789);_0x3168d1['offset'](0x0);logger[_0x493f('0x81')](_0x493f('0x82'),_0x3168d1[_0x493f('0x83')]());return dbH[_0x493f('0x84')][_0x493f('0x34')](_0x3168d1['toString'](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')]['SELECT']});}})['then'](function(){return{'sql':_0x5abf64['toString']()};})[_0x493f('0x25')](respondWithResult(_0x1138da,null))[_0x493f('0x48')](handleError(_0x1138da,null));};
\ No newline at end of file
+var _0xba94=['group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(%s)','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','DESC','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','fieldName','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','get','role','user','Reports','UserProfileSection','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator'];(function(_0x561aea,_0x1f3a48){var _0x7e5dbb=function(_0x24d79b){while(--_0x24d79b){_0x561aea['push'](_0x561aea['shift']());}};_0x7e5dbb(++_0x1f3a48);}(_0xba94,0xe3));var _0x4ba9=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xba94[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require(_0x4ba9('0x0'));var rimraf=require(_0x4ba9('0x1'));var zipdir=require(_0x4ba9('0x2'));var jsonpatch=require(_0x4ba9('0x3'));var rp=require('request-promise');var moment=require(_0x4ba9('0x4'));var BPromise=require(_0x4ba9('0x5'));var Mustache=require(_0x4ba9('0x6'));var util=require(_0x4ba9('0x7'));var path=require('path');var sox=require(_0x4ba9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ba9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ba9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4ba9('0xb'));var querystring=require(_0x4ba9('0xc'));var Papa=require('papaparse');var Redis=require(_0x4ba9('0xd'));var authService=require(_0x4ba9('0xe'));var qs=require(_0x4ba9('0xf'));var as=require(_0x4ba9('0x10'));var hardwareService=require(_0x4ba9('0x11'));var logger=require(_0x4ba9('0x12'))(_0x4ba9('0x13'));var utils=require(_0x4ba9('0x14'));var config=require(_0x4ba9('0x15'));var licenseUtil=require(_0x4ba9('0x16'));var db=require(_0x4ba9('0x17'))['db'];var dbH=require(_0x4ba9('0x17'))[_0x4ba9('0x18')];function respondWithStatusCode(_0x23a998,_0x8eed89){_0x8eed89=_0x8eed89||0xcc;return function(_0x41c884){if(_0x41c884){return _0x23a998[_0x4ba9('0x19')](_0x8eed89);}return _0x23a998[_0x4ba9('0x1a')](_0x8eed89)[_0x4ba9('0x1b')]();};}function respondWithResult(_0x5923e3,_0x298600){_0x298600=_0x298600||0xc8;return function(_0x18b20a){if(_0x18b20a){return _0x5923e3[_0x4ba9('0x1a')](_0x298600)[_0x4ba9('0x1c')](_0x18b20a);}};}function respondWithFilteredResult(_0x46d6a8,_0x3e22fc){return function(_0x577d69){if(_0x577d69){var _0x530ad8=typeof _0x3e22fc[_0x4ba9('0x1d')]===_0x4ba9('0x1e')&&typeof _0x3e22fc[_0x4ba9('0x1f')]===_0x4ba9('0x1e');var _0x116424=_0x577d69[_0x4ba9('0x20')];var _0x4adb56=_0x530ad8?0x0:_0x3e22fc[_0x4ba9('0x1d')];var _0x1ea302=_0x530ad8?_0x577d69['count']:_0x3e22fc['offset']+_0x3e22fc[_0x4ba9('0x1f')];var _0x4b049d;if(_0x1ea302>=_0x116424){_0x1ea302=_0x116424;_0x4b049d=0xc8;}else{_0x4b049d=0xce;}_0x46d6a8[_0x4ba9('0x1a')](_0x4b049d);return _0x46d6a8['set'](_0x4ba9('0x21'),_0x4adb56+'-'+_0x1ea302+'/'+_0x116424)[_0x4ba9('0x1c')](_0x577d69);}return null;};}function patchUpdates(_0x365cf4){return function(_0x3f3210){try{jsonpatch[_0x4ba9('0x22')](_0x3f3210,_0x365cf4,!![]);}catch(_0x2fda4b){return BPromise[_0x4ba9('0x23')](_0x2fda4b);}return _0x3f3210[_0x4ba9('0x24')]();};}function saveUpdates(_0x1c97ca,_0x3c3bcc){return function(_0x18394c){if(_0x18394c){return _0x18394c[_0x4ba9('0x25')](_0x1c97ca)['then'](function(_0x7eb9ab){return _0x7eb9ab;});}return null;};}function removeEntity(_0x47c3e6,_0x539de4){return function(_0x6c0125){if(_0x6c0125){return _0x6c0125[_0x4ba9('0x26')]()[_0x4ba9('0x27')](function(){var _0xa11b9c=_0x6c0125['get']({'plain':!![]});var _0x4f529d='CustomReports';return db[_0x4ba9('0x28')][_0x4ba9('0x26')]({'where':{'type':_0x4f529d,'resourceId':_0xa11b9c['id']}})[_0x4ba9('0x27')](function(){return _0x6c0125;});})['then'](function(){_0x47c3e6[_0x4ba9('0x1a')](0xcc)[_0x4ba9('0x1b')]();});}};}function handleEntityNotFound(_0x1dfb8f,_0x5ca0a0){return function(_0x7b9fe0){if(!_0x7b9fe0){_0x1dfb8f[_0x4ba9('0x19')](0x194);}return _0x7b9fe0;};}function handleError(_0x97306d,_0x854ff4){_0x854ff4=_0x854ff4||0x1f4;return function(_0x50527e){logger[_0x4ba9('0x29')](_0x50527e[_0x4ba9('0x2a')]);if(_0x50527e[_0x4ba9('0x2b')]){delete _0x50527e[_0x4ba9('0x2b')];}_0x97306d[_0x4ba9('0x1a')](_0x854ff4)[_0x4ba9('0x2c')](_0x50527e);};}exports[_0x4ba9('0x2d')]=function(_0x442c79,_0x439a3b){var _0x349bde={},_0x3c6670={},_0x13e218={'count':0x0,'rows':[]};var _0x59b7c2=_['map'](db[_0x4ba9('0x2e')]['rawAttributes'],function(_0x24c3ff){return{'name':_0x24c3ff[_0x4ba9('0x2f')],'type':_0x24c3ff['type'][_0x4ba9('0x30')]};});_0x3c6670[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x59b7c2,_0x4ba9('0x2b'));_0x3c6670['query']=_['keys'](_0x442c79[_0x4ba9('0x33')]);_0x3c6670[_0x4ba9('0x34')]=_[_0x4ba9('0x35')](_0x3c6670[_0x4ba9('0x31')],_0x3c6670[_0x4ba9('0x33')]);_0x349bde['attributes']=_[_0x4ba9('0x35')](_0x3c6670[_0x4ba9('0x31')],qs[_0x4ba9('0x36')](_0x442c79[_0x4ba9('0x33')][_0x4ba9('0x36')]));_0x349bde['attributes']=_0x349bde['attributes'][_0x4ba9('0x37')]?_0x349bde[_0x4ba9('0x38')]:_0x3c6670['model'];if(!_0x442c79[_0x4ba9('0x33')][_0x4ba9('0x39')](_0x4ba9('0x3a'))){_0x349bde[_0x4ba9('0x1f')]=qs[_0x4ba9('0x1f')](_0x442c79[_0x4ba9('0x33')]['limit']);_0x349bde['offset']=qs['offset'](_0x442c79['query'][_0x4ba9('0x1d')]);}_0x349bde[_0x4ba9('0x3b')]=qs['sort'](_0x442c79[_0x4ba9('0x33')]['sort']);_0x349bde[_0x4ba9('0x3c')]=qs[_0x4ba9('0x34')](_[_0x4ba9('0x3d')](_0x442c79[_0x4ba9('0x33')],_0x3c6670[_0x4ba9('0x34')]),_0x59b7c2);if(_0x442c79[_0x4ba9('0x33')][_0x4ba9('0x3e')]){_0x349bde[_0x4ba9('0x3c')]=_['merge'](_0x349bde[_0x4ba9('0x3c')],{'$or':_[_0x4ba9('0x32')](_0x59b7c2,function(_0x213d83){if(_0x213d83[_0x4ba9('0x3f')]!==_0x4ba9('0x40')){var _0x46b41b={};_0x46b41b[_0x213d83[_0x4ba9('0x2b')]]={'$like':'%'+_0x442c79['query']['filter']+'%'};return _0x46b41b;}})});}_0x349bde=_['merge']({},_0x349bde,_0x442c79[_0x4ba9('0x41')]);var _0x141c24={'where':_0x349bde[_0x4ba9('0x3c')]};return db[_0x4ba9('0x2e')][_0x4ba9('0x20')](_0x141c24)['then'](function(_0x399527){_0x13e218[_0x4ba9('0x20')]=_0x399527;if(_0x442c79[_0x4ba9('0x33')][_0x4ba9('0x42')]){_0x349bde[_0x4ba9('0x43')]=[{'all':!![]}];}return db[_0x4ba9('0x2e')][_0x4ba9('0x44')](_0x349bde);})['then'](function(_0x2c5e11){_0x13e218[_0x4ba9('0x45')]=_0x2c5e11;return _0x13e218;})['then'](respondWithFilteredResult(_0x439a3b,_0x349bde))['catch'](handleError(_0x439a3b,null));};exports[_0x4ba9('0x46')]=function(_0x25a974,_0x213595){var _0x53d5db={'raw':![],'where':{'id':_0x25a974[_0x4ba9('0x47')]['id']}},_0x5440c7={};_0x5440c7[_0x4ba9('0x31')]=_[_0x4ba9('0x48')](db[_0x4ba9('0x2e')][_0x4ba9('0x49')]);_0x5440c7[_0x4ba9('0x33')]=_[_0x4ba9('0x48')](_0x25a974[_0x4ba9('0x33')]);_0x5440c7[_0x4ba9('0x34')]=_[_0x4ba9('0x35')](_0x5440c7[_0x4ba9('0x31')],_0x5440c7[_0x4ba9('0x33')]);_0x53d5db[_0x4ba9('0x38')]=_[_0x4ba9('0x35')](_0x5440c7['model'],qs[_0x4ba9('0x36')](_0x25a974['query']['fields']));_0x53d5db['attributes']=_0x53d5db[_0x4ba9('0x38')][_0x4ba9('0x37')]?_0x53d5db[_0x4ba9('0x38')]:_0x5440c7[_0x4ba9('0x31')];if(_0x25a974[_0x4ba9('0x33')][_0x4ba9('0x42')]){_0x53d5db[_0x4ba9('0x43')]=[{'all':!![]}];}_0x53d5db=_[_0x4ba9('0x4a')]({},_0x53d5db,_0x25a974[_0x4ba9('0x41')]);return db[_0x4ba9('0x2e')][_0x4ba9('0x4b')](_0x53d5db)[_0x4ba9('0x27')](handleEntityNotFound(_0x213595,null))[_0x4ba9('0x27')](respondWithResult(_0x213595,null))[_0x4ba9('0x4c')](handleError(_0x213595,null));};exports[_0x4ba9('0x4d')]=function(_0x41f323,_0x4031a8){return db[_0x4ba9('0x2e')]['create'](_0x41f323[_0x4ba9('0x4e')],{})['then'](function(_0x441205){var _0x49eff7=_0x41f323['user'][_0x4ba9('0x4f')]({'plain':!![]});if(!_0x49eff7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49eff7[_0x4ba9('0x50')]===_0x4ba9('0x51')){var _0x47ce71=_0x441205[_0x4ba9('0x4f')]({'plain':!![]});var _0x5063e9=_0x4ba9('0x52');return db[_0x4ba9('0x53')][_0x4ba9('0x4b')]({'where':{'name':_0x5063e9,'userProfileId':_0x49eff7['userProfileId']},'raw':!![]})['then'](function(_0x24c520){if(_0x24c520&&_0x24c520['autoAssociation']===0x0){return db[_0x4ba9('0x28')][_0x4ba9('0x4d')]({'name':_0x47ce71['name'],'resourceId':_0x47ce71['id'],'type':'CustomReports','sectionId':_0x24c520['id']},{})[_0x4ba9('0x27')](function(){return _0x441205;});}else{return _0x441205;}})[_0x4ba9('0x4c')](function(_0x4580c6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4580c6);throw _0x4580c6;});}return _0x441205;})[_0x4ba9('0x27')](respondWithResult(_0x4031a8,0xc9))[_0x4ba9('0x4c')](handleError(_0x4031a8,null));};exports['update']=function(_0x56a545,_0x54f2d8){if(_0x56a545[_0x4ba9('0x4e')]['id']){delete _0x56a545[_0x4ba9('0x4e')]['id'];}return db[_0x4ba9('0x2e')]['find']({'where':{'id':_0x56a545[_0x4ba9('0x47')]['id']}})[_0x4ba9('0x27')](handleEntityNotFound(_0x54f2d8,null))['then'](saveUpdates(_0x56a545[_0x4ba9('0x4e')],null))[_0x4ba9('0x27')](respondWithResult(_0x54f2d8,null))[_0x4ba9('0x4c')](handleError(_0x54f2d8,null));};exports['destroy']=function(_0x560ae8,_0x4fd267){return db[_0x4ba9('0x2e')][_0x4ba9('0x4b')]({'where':{'id':_0x560ae8[_0x4ba9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fd267,null))[_0x4ba9('0x27')](removeEntity(_0x4fd267,null))[_0x4ba9('0x4c')](handleError(_0x4fd267,null));};exports[_0x4ba9('0x54')]=function(_0x5c68e5,_0x164ab0){var _0x1401d4=0xa;var _0x22defb=[_0x4ba9('0x55'),_0x4ba9('0x56'),_0x4ba9('0x57'),_0x4ba9('0x58')];var _0x40c5a1={'SUM':_0x4ba9('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba9('0x5a'),'MAX':_0x4ba9('0x5b'),'MIN':_0x4ba9('0x5c'),'AVG':_0x4ba9('0x5d'),'GROUP_CONCAT':_0x4ba9('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba9('0x5f')};var _0x5a36c4={'SEC_TO_TIME':_0x4ba9('0x60'),'DATE':_0x4ba9('0x61'),'HOUR':_0x4ba9('0x62'),'ROUND':_0x4ba9('0x63'),'UNIX_TIMESTAMP':_0x4ba9('0x64')};var _0x3196c5=function(_0x2c9276){return!_[_0x4ba9('0x65')]([_0x4ba9('0x66'),_0x4ba9('0x67'),_0x4ba9('0x68'),'IS\x20NOT\x20EMPTY'],_0x2c9276);};var _0x222d8c=function(_0x1b3200){if(!_0x1b3200||!_0x1b3200[_0x4ba9('0x69')][_0x4ba9('0x37')]){return'';}for(var _0x22bad9='(',_0x1504c1=0x0;_0x1504c1<_0x1b3200[_0x4ba9('0x69')][_0x4ba9('0x37')];_0x1504c1+=0x1){_0x1504c1>0x0&&(_0x22bad9+='\x20'+_0x1b3200[_0x4ba9('0x6a')]+'\x20');_0x22bad9+=_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6b')]?_0x222d8c(_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6b')]):_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6c')]+'\x20'+_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6d')]+(_0x3196c5(_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6d')])?'\x20'+_0x1b3200[_0x4ba9('0x69')][_0x1504c1][_0x4ba9('0x6e')]:'');}return _0x22bad9+')';};var _0xffc10b={'where':{'id':_0x5c68e5['params']['id']}},_0x461fa6,_0x37b2a5,_0x22e246,_0xc78d51,_0x2d75b8;_0xffc10b=_[_0x4ba9('0x4a')]({},_0xffc10b,_0x5c68e5['options']);return db[_0x4ba9('0x2e')][_0x4ba9('0x4b')](_0xffc10b)[_0x4ba9('0x27')](function(_0x34747b){if(_0x34747b){_0x461fa6=_0x34747b;return _0x34747b[_0x4ba9('0x6f')]();}return null;})[_0x4ba9('0x27')](function(_0x42540f){if(_0x42540f){if(!_0x42540f['length']){throw new db[(_0x4ba9('0x70'))][(_0x4ba9('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x37b2a5=_0x42540f;return db[_0x4ba9('0x72')][_0x4ba9('0x44')]({'raw':!![]});}return null;})['then'](function(_0x2e0f04){if(_0x2e0f04){_0x22e246=_[_0x4ba9('0x73')](_0x2e0f04,'id');var _0x62159;var _0x434ea2=squel[_0x4ba9('0x74')]();_0x434ea2[_0x4ba9('0x75')](_0x461fa6[_0x4ba9('0x76')]);for(var _0x1761a8=0x0;_0x1761a8<_0x37b2a5[_0x4ba9('0x37')];_0x1761a8+=0x1){_0x62159=_0x37b2a5[_0x1761a8][_0x4ba9('0x77')]?_0x22e246[_0x37b2a5[_0x1761a8][_0x4ba9('0x77')]][_0x4ba9('0x78')]:_0x37b2a5[_0x1761a8][_0x4ba9('0x6c')];_0x62159=_0x37b2a5[_0x1761a8][_0x4ba9('0x79')]?_['replace'](_0x40c5a1[_0x37b2a5[_0x1761a8][_0x4ba9('0x79')]],'%s',_0x62159):_0x62159;_0x62159=_0x37b2a5[_0x1761a8][_0x4ba9('0x7a')]?_[_0x4ba9('0x7b')](_0x5a36c4[_0x37b2a5[_0x1761a8][_0x4ba9('0x7a')]],'%s',_0x62159):_0x62159;if(_0x37b2a5[_0x1761a8][_0x4ba9('0x7c')]){_0x434ea2[_0x4ba9('0x6b')](_0x62159);}_0x37b2a5[_0x1761a8][_0x4ba9('0x7d')]&&_0x434ea2[_0x4ba9('0x3b')](_0x62159,_0x37b2a5[_0x1761a8]['orderBy']==='DESC'?![]:!![]);_0x434ea2[_0x4ba9('0x6c')](_0x62159,_0x37b2a5[_0x1761a8][_0x4ba9('0x7e')]||_0x62159);}if(_0x461fa6['joins']){_0x461fa6[_0x4ba9('0x7f')]=JSON[_0x4ba9('0x80')](_0x461fa6[_0x4ba9('0x7f')]);for(var _0x278f70=0x0;_0x278f70<_0x461fa6['joins']['length'];_0x278f70+=0x1){if(_0x461fa6[_0x4ba9('0x7f')][_0x278f70]['type']&&_['includes'](_0x22defb,_0x461fa6[_0x4ba9('0x7f')][_0x278f70]['type'])&&_0x461fa6[_0x4ba9('0x7f')][_0x278f70]['parentKey']&&_0x461fa6[_0x4ba9('0x7f')][_0x278f70][_0x4ba9('0x81')]&&_0x461fa6['joins'][_0x278f70][_0x4ba9('0x82')]){_0x434ea2[_0x461fa6['joins'][_0x278f70]['type']](_0x461fa6[_0x4ba9('0x7f')][_0x278f70][_0x4ba9('0x81')],null,util[_0x4ba9('0x7a')](_0x4ba9('0x83'),_0x461fa6[_0x4ba9('0x76')],_0x461fa6[_0x4ba9('0x7f')][_0x278f70]['parentKey'],_0x461fa6[_0x4ba9('0x7f')][_0x278f70]['foreignTable'],_0x461fa6[_0x4ba9('0x7f')][_0x278f70][_0x4ba9('0x82')]));}}}if(_0x461fa6[_0x4ba9('0x84')]){_0x461fa6['conditions']=JSON['parse'](_0x461fa6[_0x4ba9('0x84')]);_0x434ea2[_0x4ba9('0x3c')](_0x222d8c(_0x461fa6[_0x4ba9('0x84')][_0x4ba9('0x6b')]));}_0x2d75b8=_0x434ea2[_0x4ba9('0x85')]();_0x434ea2['limit'](_0x1401d4);_0x434ea2[_0x4ba9('0x1d')](0x0);logger['debug'](_0x4ba9('0x86'),_0x434ea2['toString']());return dbH[_0x4ba9('0x87')][_0x4ba9('0x33')](_0x434ea2[_0x4ba9('0x88')](),{'type':dbH['sequelize'][_0x4ba9('0x89')]['SELECT']});}})[_0x4ba9('0x27')](respondWithResult(_0x164ab0,null))[_0x4ba9('0x4c')](handleError(_0x164ab0,null));};function runReport(_0x19716d,_0x5cba0e,_0x79d406){var _0x1f2353=_0x5cba0e[_0x4ba9('0x2b')];var _0x516022=0xa;var _0x267741=[_0x4ba9('0x55'),_0x4ba9('0x56'),_0x4ba9('0x57'),_0x4ba9('0x58')];var _0x492ab0={'SUM':_0x4ba9('0x59'),'COUNT':_0x4ba9('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4ba9('0x5b'),'MIN':'MIN(%s)','AVG':_0x4ba9('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba9('0x5f')};var _0x54e3b0={'SEC_TO_TIME':_0x4ba9('0x60'),'DATE':'DATE(%s)','HOUR':_0x4ba9('0x62'),'ROUND':_0x4ba9('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e5561=function(_0x34f2b3){return!_[_0x4ba9('0x65')]([_0x4ba9('0x66'),_0x4ba9('0x67'),_0x4ba9('0x68'),_0x4ba9('0x8b')],_0x34f2b3);};var _0x32bc92=function(_0x57cfa7){if(!_0x57cfa7||!_0x57cfa7[_0x4ba9('0x69')][_0x4ba9('0x37')]){return'';}for(var _0x133b07='(',_0x24df33=0x0;_0x24df33<_0x57cfa7['rules'][_0x4ba9('0x37')];_0x24df33+=0x1){_0x24df33>0x0&&(_0x133b07+='\x20'+_0x57cfa7['operator']+'\x20');_0x133b07+=_0x57cfa7[_0x4ba9('0x69')][_0x24df33][_0x4ba9('0x6b')]?_0x32bc92(_0x57cfa7[_0x4ba9('0x69')][_0x24df33]['group']):_0x57cfa7[_0x4ba9('0x69')][_0x24df33]['field']+'\x20'+_0x57cfa7[_0x4ba9('0x69')][_0x24df33]['condition']+(_0x2e5561(_0x57cfa7[_0x4ba9('0x69')][_0x24df33][_0x4ba9('0x6d')])?'\x20'+_0x57cfa7[_0x4ba9('0x69')][_0x24df33][_0x4ba9('0x6e')]:'');}return _0x133b07+')';};var _0x1377f9={'where':{'id':_0x19716d['id']}},_0x399878,_0x1869a0,_0x2c974e,_0x35efef,_0xf9408b;_0x1377f9=_[_0x4ba9('0x4a')]({},_0x1377f9,_0x79d406);return db['AnalyticCustomReport']['find'](_0x1377f9)[_0x4ba9('0x27')](function(_0x1b7549){if(_0x1b7549){_0x399878=_0x1b7549;return _0x1b7549['getFields']();}return null;})[_0x4ba9('0x27')](function(_0x50f8dd){if(_0x50f8dd){if(!_0x50f8dd[_0x4ba9('0x37')]){throw new db[(_0x4ba9('0x70'))]['ValidationErrorItem'](_0x4ba9('0x8c'),0x193);}_0x1869a0=_0x50f8dd;return db['AnalyticMetric'][_0x4ba9('0x44')]({'raw':!![]});}return null;})[_0x4ba9('0x27')](function(_0xb59654){if(_0xb59654){_0x2c974e=_[_0x4ba9('0x73')](_0xb59654,'id');var _0x2b63c4;var _0xd19d39=squel[_0x4ba9('0x74')]();_0xd19d39[_0x4ba9('0x75')](_0x399878['table']);for(var _0x30b77b=0x0;_0x30b77b<_0x1869a0[_0x4ba9('0x37')];_0x30b77b+=0x1){_0x2b63c4=_0x1869a0[_0x30b77b][_0x4ba9('0x77')]?_0x2c974e[_0x1869a0[_0x30b77b][_0x4ba9('0x77')]][_0x4ba9('0x78')]:_0x1869a0[_0x30b77b]['field'];_0x2b63c4=_0x1869a0[_0x30b77b]['function']?_[_0x4ba9('0x7b')](_0x492ab0[_0x1869a0[_0x30b77b]['function']],'%s',_0x2b63c4):_0x2b63c4;_0x2b63c4=_0x1869a0[_0x30b77b]['format']?_[_0x4ba9('0x7b')](_0x54e3b0[_0x1869a0[_0x30b77b][_0x4ba9('0x7a')]],'%s',_0x2b63c4):_0x2b63c4;if(_0x1869a0[_0x30b77b][_0x4ba9('0x7c')]){_0xd19d39[_0x4ba9('0x6b')](_0x2b63c4);}_0x1869a0[_0x30b77b]['orderBy']&&_0xd19d39['order'](_0x2b63c4,_0x1869a0[_0x30b77b][_0x4ba9('0x7d')]===_0x4ba9('0x8d')?![]:!![]);_0xd19d39[_0x4ba9('0x6c')](_0x2b63c4,_0x1869a0[_0x30b77b][_0x4ba9('0x7e')]||_0x2b63c4);}if(_0x399878['joins']){_0x399878[_0x4ba9('0x7f')]=JSON[_0x4ba9('0x80')](_0x399878[_0x4ba9('0x7f')]);for(var _0x557293=0x0;_0x557293<_0x399878[_0x4ba9('0x7f')][_0x4ba9('0x37')];_0x557293+=0x1){if(_0x399878[_0x4ba9('0x7f')][_0x557293]['type']&&_[_0x4ba9('0x65')](_0x267741,_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x3f')])&&_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x8e')]&&_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x81')]&&_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x82')]){_0xd19d39[_0x399878['joins'][_0x557293][_0x4ba9('0x3f')]](_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x81')],null,util[_0x4ba9('0x7a')](_0x4ba9('0x83'),_0x399878['table'],_0x399878[_0x4ba9('0x7f')][_0x557293]['parentKey'],_0x399878[_0x4ba9('0x7f')][_0x557293][_0x4ba9('0x81')],_0x399878[_0x4ba9('0x7f')][_0x557293]['foreignKey']));}}}if(_0x399878['conditions']){_0x399878[_0x4ba9('0x84')]=JSON[_0x4ba9('0x80')](_0x399878[_0x4ba9('0x84')]);_0xd19d39[_0x4ba9('0x3c')](_0x32bc92(_0x399878[_0x4ba9('0x84')]['group']));}_0xf9408b=_0xd19d39[_0x4ba9('0x85')]();_0xd19d39[_0x4ba9('0x1f')](_0x516022);_0xd19d39['offset'](0x0);return;}})[_0x4ba9('0x27')](function(){if(_0x5cba0e[_0x4ba9('0x8f')]===_0x4ba9('0x90')){return null;}var _0x41aaa9=_[_0x4ba9('0x4a')](_0x5cba0e,{'name':_0x5cba0e[_0x4ba9('0x91')]||_0x5cba0e[_0x4ba9('0x2b')]||_0x399878['name'],'basename':_0x1f2353,'savename':util['format'](_0x4ba9('0x92'),_0x5cba0e[_0x4ba9('0x2b')]||_0x399878[_0x4ba9('0x2b')],require(_0x4ba9('0x93'))[_0x4ba9('0x94')](0x4),_0x5cba0e['output']||_0x4ba9('0x95')),'reportId':_0x399878['id'],'reportType':_0x4ba9('0x96')});return db['AnalyticExtractedReport'][_0x4ba9('0x4d')](_0x41aaa9,{'raw':!![]});})[_0x4ba9('0x27')](function(_0x45d0b5){if(_0x399878[_0x4ba9('0x76')]===_0x4ba9('0x97')){_0xf9408b[_0x4ba9('0x3c')](_0x399878[_0x4ba9('0x76')]+_0x4ba9('0x98'),_0x5cba0e[_0x4ba9('0x99')],_0x5cba0e['endDate']);}else{_0xf9408b['where'](_0x399878['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5cba0e['startDate'],_0x5cba0e[_0x4ba9('0x9a')]);}if(_0x45d0b5){logger[_0x4ba9('0x9b')]('Run\x20Query:',_0xf9408b[_0x4ba9('0x88')]());require(_0x4ba9('0x9c'))[_0x4ba9('0x9d')](path[_0x4ba9('0x55')](__dirname,_0x4ba9('0x9e'),_0x45d0b5[_0x4ba9('0x8f')]),[_0x45d0b5['id'],_0xf9408b[_0x4ba9('0x88')](),path['join'](__dirname,_0x4ba9('0x9f'),_0x45d0b5[_0x4ba9('0xa0')]),_0x1f2353]);return _0x45d0b5;}else{var _0x59ec35=squel['select']();_0x59ec35[_0x4ba9('0x75')]('('+_0xf9408b[_0x4ba9('0x88')]()+')',_0x4ba9('0xa1'));_0x59ec35[_0x4ba9('0x6c')](_0x4ba9('0xa2'),_0x4ba9('0x20'));_0xf9408b['limit'](_0x5cba0e[_0x4ba9('0x1f')]||_0x516022);_0xf9408b[_0x4ba9('0x1d')](_0x5cba0e[_0x4ba9('0x1d')]||0x0);return dbH[_0x4ba9('0x87')][_0x4ba9('0x33')](_0x59ec35[_0x4ba9('0x88')](),{'type':dbH[_0x4ba9('0x87')]['QueryTypes']['SELECT']})[_0x4ba9('0x27')](function(_0x1872a2){if(!_0x1872a2[_0x4ba9('0x37')]){_0x35efef=0x0;}else{_0x35efef=_0x1872a2[0x0][_0x4ba9('0x20')]||0x0;}return dbH[_0x4ba9('0x87')][_0x4ba9('0x33')](_0xf9408b[_0x4ba9('0x88')](),{'type':dbH[_0x4ba9('0x87')][_0x4ba9('0x89')][_0x4ba9('0xa3')]});})[_0x4ba9('0x27')](function(_0x2717ab){return{'rows':_0x2717ab||[],'count':_0x35efef};});}});}exports[_0x4ba9('0xa4')]=function(_0x5b35b,_0x5a3ab5){return runReport(_0x5b35b[_0x4ba9('0x47')],_0x5b35b[_0x4ba9('0x33')],_0x5b35b['options'])[_0x4ba9('0x27')](respondWithResult(_0x5a3ab5,null))['catch'](handleError(_0x5a3ab5,null));};exports[_0x4ba9('0xa5')]=runReport;exports['query']=function(_0x44b7ad,_0xb7a41c){var _0x1524ce=0xa;var _0x29d2f0=[_0x4ba9('0x55'),_0x4ba9('0x56'),_0x4ba9('0x57'),_0x4ba9('0x58')];var _0x1b3648={'SUM':_0x4ba9('0x59'),'COUNT':_0x4ba9('0x8a'),'COUNT DISTINCT':_0x4ba9('0x5a'),'MAX':_0x4ba9('0x5b'),'MIN':'MIN(%s)','AVG':_0x4ba9('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba9('0x5f')};var _0x4d16d3={'SEC_TO_TIME':_0x4ba9('0x60'),'DATE':_0x4ba9('0x61'),'HOUR':_0x4ba9('0x62'),'ROUND':_0x4ba9('0x63'),'UNIX_TIMESTAMP':_0x4ba9('0x64')};var _0x38e1c4=function(_0x497379){return!_[_0x4ba9('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4ba9('0x68'),_0x4ba9('0x8b')],_0x497379);};var _0x297d89=function(_0x75afad){if(!_0x75afad||!_0x75afad[_0x4ba9('0x69')]['length']){return'';}for(var _0x58fcf5='(',_0x577fa8=0x0;_0x577fa8<_0x75afad['rules'][_0x4ba9('0x37')];_0x577fa8+=0x1){_0x577fa8>0x0&&(_0x58fcf5+='\x20'+_0x75afad[_0x4ba9('0x6a')]+'\x20');_0x58fcf5+=_0x75afad[_0x4ba9('0x69')][_0x577fa8][_0x4ba9('0x6b')]?_0x297d89(_0x75afad[_0x4ba9('0x69')][_0x577fa8][_0x4ba9('0x6b')]):_0x75afad[_0x4ba9('0x69')][_0x577fa8][_0x4ba9('0x6c')]+'\x20'+_0x75afad[_0x4ba9('0x69')][_0x577fa8]['condition']+(_0x38e1c4(_0x75afad[_0x4ba9('0x69')][_0x577fa8][_0x4ba9('0x6d')])?'\x20'+_0x75afad[_0x4ba9('0x69')][_0x577fa8]['value']:'');}return _0x58fcf5+')';};var _0x4e5df0={'where':{'id':_0x44b7ad[_0x4ba9('0x47')]['id']}},_0x141f5f,_0xe46bfa,_0x2d61a6,_0x1deda6,_0x39af1f;_0x4e5df0=_[_0x4ba9('0x4a')]({},_0x4e5df0,_0x44b7ad['options']);return db[_0x4ba9('0x2e')][_0x4ba9('0x4b')](_0x4e5df0)['then'](function(_0x37ba4d){if(_0x37ba4d){_0x141f5f=_0x37ba4d;return _0x37ba4d[_0x4ba9('0x6f')]();}return null;})[_0x4ba9('0x27')](function(_0x4db414){if(_0x4db414){if(!_0x4db414[_0x4ba9('0x37')]){throw new db[(_0x4ba9('0x70'))]['ValidationErrorItem'](_0x4ba9('0x8c'),0x193);}_0xe46bfa=_0x4db414;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba9('0x27')](function(_0x50471f){if(_0x50471f){_0x2d61a6=_[_0x4ba9('0x73')](_0x50471f,'id');var _0x337e77;var _0x17dc0f=squel[_0x4ba9('0x74')]();_0x17dc0f[_0x4ba9('0x75')](_0x141f5f[_0x4ba9('0x76')]);for(var _0x54a47c=0x0;_0x54a47c<_0xe46bfa[_0x4ba9('0x37')];_0x54a47c+=0x1){_0x337e77=_0xe46bfa[_0x54a47c][_0x4ba9('0x77')]?_0x2d61a6[_0xe46bfa[_0x54a47c][_0x4ba9('0x77')]][_0x4ba9('0x78')]:_0xe46bfa[_0x54a47c][_0x4ba9('0x6c')];_0x337e77=_0xe46bfa[_0x54a47c][_0x4ba9('0x79')]?_[_0x4ba9('0x7b')](_0x1b3648[_0xe46bfa[_0x54a47c][_0x4ba9('0x79')]],'%s',_0x337e77):_0x337e77;_0x337e77=_0xe46bfa[_0x54a47c][_0x4ba9('0x7a')]?_[_0x4ba9('0x7b')](_0x4d16d3[_0xe46bfa[_0x54a47c][_0x4ba9('0x7a')]],'%s',_0x337e77):_0x337e77;if(_0xe46bfa[_0x54a47c][_0x4ba9('0x7c')]){_0x17dc0f[_0x4ba9('0x6b')](_0x337e77);}_0xe46bfa[_0x54a47c]['orderBy']&&_0x17dc0f[_0x4ba9('0x3b')](_0x337e77,_0xe46bfa[_0x54a47c][_0x4ba9('0x7d')]===_0x4ba9('0x8d')?![]:!![]);_0x17dc0f[_0x4ba9('0x6c')](_0x337e77,_0xe46bfa[_0x54a47c][_0x4ba9('0x7e')]||_0x337e77);}if(_0x141f5f[_0x4ba9('0x7f')]){_0x141f5f[_0x4ba9('0x7f')]=JSON[_0x4ba9('0x80')](_0x141f5f['joins']);for(var _0x23d859=0x0;_0x23d859<_0x141f5f['joins'][_0x4ba9('0x37')];_0x23d859+=0x1){if(_0x141f5f['joins'][_0x23d859][_0x4ba9('0x3f')]&&_['includes'](_0x29d2f0,_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x3f')])&&_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x8e')]&&_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x81')]&&_0x141f5f['joins'][_0x23d859][_0x4ba9('0x82')]){_0x17dc0f[_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x3f')]](_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x81')],null,util[_0x4ba9('0x7a')](_0x4ba9('0x83'),_0x141f5f['table'],_0x141f5f[_0x4ba9('0x7f')][_0x23d859]['parentKey'],_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x81')],_0x141f5f[_0x4ba9('0x7f')][_0x23d859][_0x4ba9('0x82')]));}}}if(_0x141f5f[_0x4ba9('0x84')]){_0x141f5f[_0x4ba9('0x84')]=JSON[_0x4ba9('0x80')](_0x141f5f[_0x4ba9('0x84')]);_0x17dc0f[_0x4ba9('0x3c')](_0x297d89(_0x141f5f['conditions'][_0x4ba9('0x6b')]));}_0x39af1f=_0x17dc0f[_0x4ba9('0x85')]();_0x17dc0f[_0x4ba9('0x1f')](_0x1524ce);_0x17dc0f[_0x4ba9('0x1d')](0x0);logger[_0x4ba9('0xa6')](_0x4ba9('0x86'),_0x17dc0f['toString']());return dbH[_0x4ba9('0x87')]['query'](_0x17dc0f['toString'](),{'type':dbH[_0x4ba9('0x87')][_0x4ba9('0x89')][_0x4ba9('0xa3')]});}})[_0x4ba9('0x27')](function(){return{'sql':_0x39af1f[_0x4ba9('0x88')]()};})[_0x4ba9('0x27')](respondWithResult(_0xb7a41c,null))[_0x4ba9('0x4c')](handleError(_0xb7a41c,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 635aa01..4e75f52 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 _0x1052=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x4e8099,_0x1372ed){var _0x535f9e=function(_0x5238c4){while(--_0x5238c4){_0x4e8099['push'](_0x4e8099['shift']());}};_0x535f9e(++_0x1372ed);}(_0x1052,0x168));var _0x2105=function(_0x4c8779,_0x399ca4){_0x4c8779=_0x4c8779-0x0;var _0x55a207=_0x1052[_0x4c8779];return _0x55a207;};'use strict';var _=require(_0x2105('0x0'));var util=require(_0x2105('0x1'));var logger=require(_0x2105('0x2'))(_0x2105('0x3'));var moment=require('moment');var BPromise=require(_0x2105('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2105('0x5'));var rimraf=require(_0x2105('0x6'));var config=require(_0x2105('0x7'));var attributes=require(_0x2105('0x8'));module[_0x2105('0x9')]=function(_0x16f76c,_0x34e4eb){return _0x16f76c[_0x2105('0xa')](_0x2105('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8b4=['bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment'];(function(_0x1b00aa,_0x531268){var _0x319a0f=function(_0xfc7889){while(--_0xfc7889){_0x1b00aa['push'](_0x1b00aa['shift']());}};_0x319a0f(++_0x531268);}(_0xc8b4,0x98));var _0x4c8b=function(_0x58ac3e,_0x356e2c){_0x58ac3e=_0x58ac3e-0x0;var _0x50f771=_0xc8b4[_0x58ac3e];return _0x50f771;};'use strict';var _=require(_0x4c8b('0x0'));var util=require('util');var logger=require(_0x4c8b('0x1'))(_0x4c8b('0x2'));var moment=require(_0x4c8b('0x3'));var BPromise=require(_0x4c8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c8b('0x5'));var rimraf=require(_0x4c8b('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c8b('0x7'));module[_0x4c8b('0x8')]=function(_0x4a925b,_0x13f51b){return _0x4a925b[_0x4c8b('0x9')](_0x4c8b('0xa'),attributes,{'tableName':_0x4c8b('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index c9d568a..822658e 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 _0x7768=['../../config/utils','rpc','../../config/environment','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2f560e,_0x1cc398){var _0x652c1c=function(_0x320efa){while(--_0x320efa){_0x2f560e['push'](_0x2f560e['shift']());}};_0x652c1c(++_0x1cc398);}(_0x7768,0x1f0));var _0x8776=function(_0x3d9669,_0x471ea2){_0x3d9669=_0x3d9669-0x0;var _0x5c63ea=_0x7768[_0x3d9669];return _0x5c63ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8776('0x0'));var BPromise=require(_0x8776('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8776('0x2'));var db=require(_0x8776('0x3'))['db'];var utils=require(_0x8776('0x4'));var logger=require('../../config/logger')(_0x8776('0x5'));var config=require(_0x8776('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8776('0x7')][_0x8776('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f158a,_0x569785,_0xac3149){return new BPromise(function(_0x3be907,_0x5da419){return client[_0x8776('0x9')](_0x1f158a,_0xac3149)['then'](function(_0x14a348){logger[_0x8776('0xa')](_0x8776('0xb'),_0x569785,'request\x20sent');logger[_0x8776('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x569785,_0x8776('0xd'),JSON[_0x8776('0xe')](_0x14a348));if(_0x14a348[_0x8776('0xf')]){if(_0x14a348[_0x8776('0xf')][_0x8776('0x10')]===0x1f4){logger[_0x8776('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x569785,_0x14a348[_0x8776('0xf')][_0x8776('0x11')]);return _0x5da419(_0x14a348[_0x8776('0xf')]['message']);}logger[_0x8776('0xf')](_0x8776('0xb'),_0x569785,_0x14a348[_0x8776('0xf')][_0x8776('0x11')]);return _0x3be907(_0x14a348['error']['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x569785,_0x8776('0xd'));_0x3be907(_0x14a348[_0x8776('0x12')][_0x8776('0x11')]);}})[_0x8776('0x13')](function(_0xe5ac83){logger[_0x8776('0xf')](_0x8776('0xb'),_0x569785,_0xe5ac83);_0x5da419(_0xe5ac83);});});}
\ No newline at end of file
+var _0xcd79=['lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0xff5684,_0xfe6e00){var _0x41e374=function(_0x145196){while(--_0x145196){_0xff5684['push'](_0xff5684['shift']());}};_0x41e374(++_0xfe6e00);}(_0xcd79,0xd2));var _0x9cd7=function(_0x38898d,_0xf72310){_0x38898d=_0x38898d-0x0;var _0xdcc1=_0xcd79[_0x38898d];return _0xdcc1;};'use strict';var _=require(_0x9cd7('0x0'));var util=require('util');var moment=require(_0x9cd7('0x1'));var BPromise=require('bluebird');var rs=require(_0x9cd7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9cd7('0x3'));var logger=require(_0x9cd7('0x4'))(_0x9cd7('0x5'));var config=require(_0x9cd7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cd7('0x7')][_0x9cd7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25411f,_0x57e827,_0xf63fbc){return new BPromise(function(_0x3a8e1f,_0x10ac2e){return client[_0x9cd7('0x9')](_0x25411f,_0xf63fbc)[_0x9cd7('0xa')](function(_0x3dfb24){logger['info'](_0x9cd7('0xb'),_0x57e827,_0x9cd7('0xc'));logger[_0x9cd7('0xd')](_0x9cd7('0xe'),_0x57e827,_0x9cd7('0xc'),JSON[_0x9cd7('0xf')](_0x3dfb24));if(_0x3dfb24[_0x9cd7('0x10')]){if(_0x3dfb24[_0x9cd7('0x10')]['code']===0x1f4){logger[_0x9cd7('0x10')](_0x9cd7('0xb'),_0x57e827,_0x3dfb24[_0x9cd7('0x10')][_0x9cd7('0x11')]);return _0x10ac2e(_0x3dfb24[_0x9cd7('0x10')][_0x9cd7('0x11')]);}logger[_0x9cd7('0x10')](_0x9cd7('0xb'),_0x57e827,_0x3dfb24[_0x9cd7('0x10')]['message']);return _0x3a8e1f(_0x3dfb24['error'][_0x9cd7('0x11')]);}else{logger[_0x9cd7('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57e827,_0x9cd7('0xc'));_0x3a8e1f(_0x3dfb24[_0x9cd7('0x13')]['message']);}})[_0x9cd7('0x14')](function(_0x4f65cc){logger[_0x9cd7('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x57e827,_0x4f65cc);_0x10ac2e(_0x4f65cc);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a9132da..42df134 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 _0x347e=['put','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create'];(function(_0x58943d,_0x18b43e){var _0x238275=function(_0x3e0413){while(--_0x3e0413){_0x58943d['push'](_0x58943d['shift']());}};_0x238275(++_0x18b43e);}(_0x347e,0x18f));var _0xe347=function(_0x434c42,_0x4f687b){_0x434c42=_0x434c42-0x0;var _0x272e65=_0x347e[_0x434c42];return _0x272e65;};'use strict';var multer=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe347('0x2'));var router=express[_0xe347('0x3')]();var fs_extra=require(_0xe347('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe347('0x5'));var config=require(_0xe347('0x6'));var controller=require(_0xe347('0x7'));router[_0xe347('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe347('0x8')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller[_0xe347('0xb')]);router['get'](_0xe347('0xc'),auth[_0xe347('0xa')](),controller[_0xe347('0xd')]);router[_0xe347('0x8')](_0xe347('0xe'),auth[_0xe347('0xa')](),controller[_0xe347('0xf')]);router[_0xe347('0x8')](_0xe347('0x10'),auth[_0xe347('0xa')](),controller[_0xe347('0x11')]);router['post']('/',auth[_0xe347('0xa')](),controller[_0xe347('0x12')]);router[_0xe347('0x13')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller['update']);router[_0xe347('0x14')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller['destroy']);module[_0xe347('0x15')]=router;
\ No newline at end of file
+var _0xe03b=['isAuthenticated','index','get','/:id','show','preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xe03b,0xbf));var _0xbe03=function(_0x2cb13c,_0x4fc1b6){_0x2cb13c=_0x2cb13c-0x0;var _0x23613c=_0xe03b[_0x2cb13c];return _0x23613c;};'use strict';var multer=require(_0xbe03('0x0'));var util=require(_0xbe03('0x1'));var path=require(_0xbe03('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbe03('0x3'));var auth=require(_0xbe03('0x4'));var interaction=require(_0xbe03('0x5'));var config=require('../../config/environment');var controller=require(_0xbe03('0x6'));router['get']('/',auth[_0xbe03('0x7')](),controller[_0xbe03('0x8')]);router[_0xbe03('0x9')](_0xbe03('0xa'),auth[_0xbe03('0x7')](),controller[_0xbe03('0xb')]);router[_0xbe03('0x9')]('/:id/preview',auth[_0xbe03('0x7')](),controller[_0xbe03('0xc')]);router[_0xbe03('0x9')](_0xbe03('0xd'),auth[_0xbe03('0x7')](),controller[_0xbe03('0xe')]);router[_0xbe03('0x9')](_0xbe03('0xf'),auth['isAuthenticated'](),controller[_0xbe03('0x10')]);router['post']('/',auth[_0xbe03('0x7')](),controller[_0xbe03('0x11')]);router[_0xbe03('0x12')](_0xbe03('0xa'),auth[_0xbe03('0x7')](),controller[_0xbe03('0x13')]);router[_0xbe03('0x14')]('/:id',auth[_0xbe03('0x7')](),controller[_0xbe03('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 31826d4..15b1380 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x25a741,_0x5a072a){var _0x245fd3=function(_0x548856){while(--_0x548856){_0x25a741['push'](_0x25a741['shift']());}};_0x245fd3(++_0x5a072a);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x4d76b2,_0x41e6c3){var _0x3d0ff5=function(_0x155b68){while(--_0x155b68){_0x4d76b2['push'](_0x4d76b2['shift']());}};_0x3d0ff5(++_0x41e6c3);}(_0xeff8,0x186));var _0x8eff=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xeff8[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index eff830c..a92e6ed 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x39489a,_0x451b19){var _0x4490c4=function(_0x403970){while(--_0x403970){_0x39489a['push'](_0x39489a['shift']());}};_0x4490c4(++_0x451b19);}(_0x1967,0x173));var _0x7196=function(_0x4d0cf9,_0x24f340){_0x4d0cf9=_0x4d0cf9-0x0;var _0x3dfa90=_0x1967[_0x4d0cf9];return _0x3dfa90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4edec4,_0x421b1d){var _0x1f74f9=function(_0x50c1cf){while(--_0x50c1cf){_0x4edec4['push'](_0x4edec4['shift']());}};_0x1f74f9(++_0x421b1d);}(_0x4975,0x86));var _0x5497=function(_0x26fd41,_0x2a4929){_0x26fd41=_0x26fd41-0x0;var _0x498c30=_0x4975[_0x26fd41];return _0x498c30;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f45fd1f..08f3ced 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 _0xadfa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x26b9ec,_0x5363de){var _0x2321aa=function(_0x5e8458){while(--_0x5e8458){_0x26b9ec['push'](_0x26b9ec['shift']());}};_0x2321aa(++_0x5363de);}(_0xadfa,0x99));var _0xaadf=function(_0x247175,_0x7f804d){_0x247175=_0x247175-0x0;var _0x14ccf6=_0xadfa[_0x247175];return _0x14ccf6;};'use strict';var _=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var logger=require(_0xaadf('0x2'))('api');var moment=require(_0xaadf('0x3'));var BPromise=require(_0xaadf('0x4'));var rp=require(_0xaadf('0x5'));var fs=require('fs');var path=require(_0xaadf('0x6'));var rimraf=require(_0xaadf('0x7'));var config=require(_0xaadf('0x8'));var attributes=require(_0xaadf('0x9'));module[_0xaadf('0xa')]=function(_0x2db6a2,_0x1abebb){return _0x2db6a2[_0xaadf('0xb')](_0xaadf('0xc'),attributes,{'tableName':_0xaadf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7257=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7257,0x122));var _0x7725=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0x7257[_0x224dda];return _0x2987ac;};'use strict';var _=require(_0x7725('0x0'));var util=require(_0x7725('0x1'));var logger=require(_0x7725('0x2'))(_0x7725('0x3'));var moment=require('moment');var BPromise=require(_0x7725('0x4'));var rp=require(_0x7725('0x5'));var fs=require('fs');var path=require(_0x7725('0x6'));var rimraf=require('rimraf');var config=require(_0x7725('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x7725('0x8')]=function(_0x5e547f,_0x3f0170){return _0x5e547f[_0x7725('0x9')](_0x7725('0xa'),attributes,{'tableName':_0x7725('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 8a17d3f..b5b2065 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 _0x93fa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1a6d6b,_0x1c5439){var _0x170bcd=function(_0x5df420){while(--_0x5df420){_0x1a6d6b['push'](_0x1a6d6b['shift']());}};_0x170bcd(++_0x1c5439);}(_0x93fa,0x141));var _0xa93f=function(_0x56aab0,_0x4afd25){_0x56aab0=_0x56aab0-0x0;var _0xa15bf4=_0x93fa[_0x56aab0];return _0xa15bf4;};'use strict';var _=require(_0xa93f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa93f('0x1'));var rs=require(_0xa93f('0x2'));var fs=require('fs');var Redis=require(_0xa93f('0x3'));var db=require(_0xa93f('0x4'))['db'];var utils=require(_0xa93f('0x5'));var logger=require(_0xa93f('0x6'))(_0xa93f('0x7'));var config=require(_0xa93f('0x8'));var jayson=require(_0xa93f('0x9'));var client=jayson[_0xa93f('0xa')][_0xa93f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0a3e5,_0x2ff3f7,_0x1ff97e){return new BPromise(function(_0x12e311,_0x27b322){return client[_0xa93f('0xc')](_0xb0a3e5,_0x1ff97e)[_0xa93f('0xd')](function(_0x24ff06){logger[_0xa93f('0xe')](_0xa93f('0xf'),_0x2ff3f7,_0xa93f('0x10'));logger[_0xa93f('0x11')](_0xa93f('0x12'),_0x2ff3f7,_0xa93f('0x10'),JSON[_0xa93f('0x13')](_0x24ff06));if(_0x24ff06[_0xa93f('0x14')]){if(_0x24ff06[_0xa93f('0x14')][_0xa93f('0x15')]===0x1f4){logger[_0xa93f('0x14')](_0xa93f('0xf'),_0x2ff3f7,_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);return _0x27b322(_0x24ff06['error'][_0xa93f('0x16')]);}logger['error'](_0xa93f('0xf'),_0x2ff3f7,_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);return _0x12e311(_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);}else{logger[_0xa93f('0xe')](_0xa93f('0xf'),_0x2ff3f7,_0xa93f('0x10'));_0x12e311(_0x24ff06[_0xa93f('0x17')][_0xa93f('0x16')]);}})[_0xa93f('0x18')](function(_0x5d341a){logger[_0xa93f('0x14')](_0xa93f('0xf'),_0x2ff3f7,_0x5d341a);_0x27b322(_0x5d341a);});});}
\ No newline at end of file
+var _0x2520=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info'];(function(_0x1c905c,_0x836087){var _0x47de7f=function(_0x52b3fa){while(--_0x52b3fa){_0x1c905c['push'](_0x1c905c['shift']());}};_0x47de7f(++_0x836087);}(_0x2520,0xe5));var _0x0252=function(_0x49a8f2,_0x24a7a7){_0x49a8f2=_0x49a8f2-0x0;var _0x5756ce=_0x2520[_0x49a8f2];return _0x5756ce;};'use strict';var _=require(_0x0252('0x0'));var util=require('util');var moment=require(_0x0252('0x1'));var BPromise=require(_0x0252('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0252('0x3'))['db'];var utils=require(_0x0252('0x4'));var logger=require(_0x0252('0x5'))(_0x0252('0x6'));var config=require('../../config/environment');var jayson=require(_0x0252('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee178,_0x1b23b2,_0x4e3380){return new BPromise(function(_0x72381c,_0xd9f6ac){return client[_0x0252('0x8')](_0x3ee178,_0x4e3380)[_0x0252('0x9')](function(_0x271479){logger[_0x0252('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1b23b2,'request\x20sent');logger[_0x0252('0xb')](_0x0252('0xc'),_0x1b23b2,_0x0252('0xd'),JSON[_0x0252('0xe')](_0x271479));if(_0x271479['error']){if(_0x271479[_0x0252('0xf')]['code']===0x1f4){logger[_0x0252('0xf')](_0x0252('0x10'),_0x1b23b2,_0x271479[_0x0252('0xf')]['message']);return _0xd9f6ac(_0x271479['error'][_0x0252('0x11')]);}logger[_0x0252('0xf')](_0x0252('0x10'),_0x1b23b2,_0x271479[_0x0252('0xf')][_0x0252('0x11')]);return _0x72381c(_0x271479[_0x0252('0xf')][_0x0252('0x11')]);}else{logger[_0x0252('0xa')](_0x0252('0x10'),_0x1b23b2,'request\x20sent');_0x72381c(_0x271479[_0x0252('0x12')][_0x0252('0x11')]);}})[_0x0252('0x13')](function(_0x53f277){logger[_0x0252('0xf')](_0x0252('0x10'),_0x1b23b2,_0x53f277);_0xd9f6ac(_0x53f277);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 34bde10..e94fc99 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 _0x4149=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','destroy','exports','util','path'];(function(_0x2d6a5b,_0x39bb49){var _0x127cda=function(_0x5deff9){while(--_0x5deff9){_0x2d6a5b['push'](_0x2d6a5b['shift']());}};_0x127cda(++_0x39bb49);}(_0x4149,0xa6));var _0x9414=function(_0x32c7aa,_0x238e2f){_0x32c7aa=_0x32c7aa-0x0;var _0x201abc=_0x4149[_0x32c7aa];return _0x201abc;};'use strict';var multer=require('multer');var util=require(_0x9414('0x0'));var path=require(_0x9414('0x1'));var timeout=require(_0x9414('0x2'));var express=require(_0x9414('0x3'));var router=express[_0x9414('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9414('0x5'));var interaction=require(_0x9414('0x6'));var config=require('../../config/environment');var controller=require(_0x9414('0x7'));router['get']('/',auth[_0x9414('0x8')](),controller[_0x9414('0x9')]);router[_0x9414('0xa')](_0x9414('0xb'),auth[_0x9414('0x8')](),controller[_0x9414('0xc')]);router[_0x9414('0xa')](_0x9414('0xd'),auth[_0x9414('0x8')](),controller[_0x9414('0xe')]);router[_0x9414('0xa')]('/:id/run',auth[_0x9414('0x8')](),controller[_0x9414('0xf')]);router[_0x9414('0xa')](_0x9414('0x10'),auth[_0x9414('0x8')](),controller[_0x9414('0x11')]);router[_0x9414('0x12')]('/',auth[_0x9414('0x8')](),controller[_0x9414('0x13')]);router['put'](_0x9414('0xb'),auth['isAuthenticated'](),controller[_0x9414('0x14')]);router[_0x9414('0x15')]('/:id',auth[_0x9414('0x8')](),controller[_0x9414('0x16')]);module[_0x9414('0x17')]=router;
\ No newline at end of file
+var _0x7ba4=['fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','/:id/run','/:id/query','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x24563c,_0x49d7cd){var _0x14796e=function(_0x3ab3d9){while(--_0x3ab3d9){_0x24563c['push'](_0x24563c['shift']());}};_0x14796e(++_0x49d7cd);}(_0x7ba4,0x8c));var _0x47ba=function(_0x507ba0,_0x47afae){_0x507ba0=_0x507ba0-0x0;var _0x3fa6fd=_0x7ba4[_0x507ba0];return _0x3fa6fd;};'use strict';var multer=require(_0x47ba('0x0'));var util=require(_0x47ba('0x1'));var path=require('path');var timeout=require(_0x47ba('0x2'));var express=require(_0x47ba('0x3'));var router=express['Router']();var fs_extra=require(_0x47ba('0x4'));var auth=require(_0x47ba('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x47ba('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x47ba('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x47ba('0x7')](_0x47ba('0x8'),auth[_0x47ba('0x9')](),controller['show']);router[_0x47ba('0x7')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x47ba('0x7')](_0x47ba('0xa'),auth[_0x47ba('0x9')](),controller['run']);router[_0x47ba('0x7')](_0x47ba('0xb'),auth['isAuthenticated'](),controller['query']);router[_0x47ba('0xc')]('/',auth[_0x47ba('0x9')](),controller['create']);router[_0x47ba('0xd')](_0x47ba('0x8'),auth['isAuthenticated'](),controller[_0x47ba('0xe')]);router[_0x47ba('0xf')](_0x47ba('0x8'),auth['isAuthenticated'](),controller[_0x47ba('0x10')]);module[_0x47ba('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 95a1edd..de29b33 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 _0x8270=['moment','STRING','ENUM','pdf','csv','DATE','Loading','manual','scheduled'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x8270,0xb4));var _0x0827=function(_0x4e44ae,_0x51df27){_0x4e44ae=_0x4e44ae-0x0;var _0x4cb789=_0x8270[_0x4e44ae];return _0x4cb789;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0827('0x0'));module['exports']={'name':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x0827('0x2')]('csv',_0x0827('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x0827('0x4')},'savename':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0827('0x5')]},'endDate':{'type':Sequelize[_0x0827('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0827('0x6')},'type':{'type':Sequelize[_0x0827('0x2')](_0x0827('0x7'),_0x0827('0x8')),'allowNull':![],'defaultValue':_0x0827('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa6d7=['scheduled','manual','INTEGER','exports','STRING','ENUM','xlsx','csv','DATE'];(function(_0x43c5a5,_0x5398ff){var _0x25e81d=function(_0x176cfa){while(--_0x176cfa){_0x43c5a5['push'](_0x43c5a5['shift']());}};_0x25e81d(++_0x5398ff);}(_0xa6d7,0xb7));var _0x7a6d=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa6d7[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x7a6d('0x0')]={'name':{'type':Sequelize[_0x7a6d('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x7a6d('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x7a6d('0x2')]('csv','pdf',_0x7a6d('0x3')),'allowNull':![],'defaultValue':_0x7a6d('0x4')},'savename':{'type':Sequelize[_0x7a6d('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7a6d('0x5')]},'status':{'type':Sequelize[_0x7a6d('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x7a6d('0x2')]('manual',_0x7a6d('0x6')),'allowNull':![],'defaultValue':_0x7a6d('0x7')},'reportId':{'type':Sequelize[_0x7a6d('0x8')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x7a6d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e1d6fcb..4618587 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 _0x7d50=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','user','UserProfileSection','UserProfileResource','error','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','format','basename','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','ExtractedReports','destroy','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options'];(function(_0x23f44d,_0x5d6a85){var _0x16b62b=function(_0x17b8df){while(--_0x17b8df){_0x23f44d['push'](_0x23f44d['shift']());}};_0x16b62b(++_0x5d6a85);}(_0x7d50,0x7e));var _0x07d5=function(_0x20aeb5,_0x16cd11){_0x20aeb5=_0x20aeb5-0x0;var _0x325c0e=_0x7d50[_0x20aeb5];return _0x325c0e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07d5('0x0'));var jsonpatch=require(_0x07d5('0x1'));var rp=require('request-promise');var moment=require(_0x07d5('0x2'));var BPromise=require(_0x07d5('0x3'));var Mustache=require(_0x07d5('0x4'));var util=require(_0x07d5('0x5'));var path=require(_0x07d5('0x6'));var sox=require(_0x07d5('0x7'));var csv=require('to-csv');var ejs=require(_0x07d5('0x8'));var fs=require('fs');var fs_extra=require(_0x07d5('0x9'));var _=require(_0x07d5('0xa'));var squel=require('squel');var crypto=require(_0x07d5('0xb'));var jsforce=require(_0x07d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x07d5('0xd'));var querystring=require(_0x07d5('0xe'));var Papa=require(_0x07d5('0xf'));var Redis=require(_0x07d5('0x10'));var authService=require(_0x07d5('0x11'));var qs=require(_0x07d5('0x12'));var as=require(_0x07d5('0x13'));var hardwareService=require(_0x07d5('0x14'));var logger=require(_0x07d5('0x15'))(_0x07d5('0x16'));var utils=require('../../config/utils');var config=require(_0x07d5('0x17'));var licenseUtil=require(_0x07d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46f2ce,_0x5c70ae){_0x5c70ae=_0x5c70ae||0xcc;return function(_0x161e09){if(_0x161e09){return _0x46f2ce['sendStatus'](_0x5c70ae);}return _0x46f2ce[_0x07d5('0x19')](_0x5c70ae)[_0x07d5('0x1a')]();};}function respondWithResult(_0x579385,_0x5de016){_0x5de016=_0x5de016||0xc8;return function(_0x270fb6){if(_0x270fb6){return _0x579385[_0x07d5('0x19')](_0x5de016)[_0x07d5('0x1b')](_0x270fb6);}};}function respondWithFilteredResult(_0x3b3e70,_0x31b20d){return function(_0x1940f0){if(_0x1940f0){var _0x55b268=typeof _0x31b20d[_0x07d5('0x1c')]===_0x07d5('0x1d')&&typeof _0x31b20d[_0x07d5('0x1e')]==='undefined';var _0x1467fc=_0x1940f0[_0x07d5('0x1f')];var _0x2b5859=_0x55b268?0x0:_0x31b20d[_0x07d5('0x1c')];var _0x36b3fb=_0x55b268?_0x1940f0[_0x07d5('0x1f')]:_0x31b20d[_0x07d5('0x1c')]+_0x31b20d['limit'];var _0x23dd12;if(_0x36b3fb>=_0x1467fc){_0x36b3fb=_0x1467fc;_0x23dd12=0xc8;}else{_0x23dd12=0xce;}_0x3b3e70[_0x07d5('0x19')](_0x23dd12);return _0x3b3e70[_0x07d5('0x20')](_0x07d5('0x21'),_0x2b5859+'-'+_0x36b3fb+'/'+_0x1467fc)[_0x07d5('0x1b')](_0x1940f0);}return null;};}function patchUpdates(_0x345320){return function(_0x587469){try{jsonpatch[_0x07d5('0x22')](_0x587469,_0x345320,!![]);}catch(_0x2c8427){return BPromise[_0x07d5('0x23')](_0x2c8427);}return _0x587469['save']();};}function saveUpdates(_0x915e80,_0x2466f5){return function(_0x420aa3){if(_0x420aa3){return _0x420aa3[_0x07d5('0x24')](_0x915e80)[_0x07d5('0x25')](function(_0x5b6371){return _0x5b6371;});}return null;};}function removeEntity(_0x27d40b,_0x40e968){return function(_0x4f253b){if(_0x4f253b){return _0x4f253b['destroy']()[_0x07d5('0x25')](function(){var _0x2e79da=_0x4f253b['get']({'plain':!![]});var _0x2568a8=_0x07d5('0x26');return db['UserProfileResource'][_0x07d5('0x27')]({'where':{'type':_0x2568a8,'resourceId':_0x2e79da['id']}})[_0x07d5('0x25')](function(){return _0x4f253b;});})['then'](function(){_0x27d40b[_0x07d5('0x19')](0xcc)[_0x07d5('0x1a')]();});}};}function handleEntityNotFound(_0x26d527,_0x40cb54){return function(_0x4fc2d8){if(!_0x4fc2d8){_0x26d527[_0x07d5('0x28')](0x194);}return _0x4fc2d8;};}function handleError(_0x62bb73,_0x249208){_0x249208=_0x249208||0x1f4;return function(_0x228782){logger['error'](_0x228782[_0x07d5('0x29')]);if(_0x228782[_0x07d5('0x2a')]){delete _0x228782['name'];}_0x62bb73[_0x07d5('0x19')](_0x249208)[_0x07d5('0x2b')](_0x228782);};}exports[_0x07d5('0x2c')]=function(_0x5ada8c,_0x51e224){var _0x2b9f12={},_0x22a115={},_0x2e6b60={'count':0x0,'rows':[]};var _0x4f52d7=_[_0x07d5('0x2d')](db[_0x07d5('0x2e')]['rawAttributes'],function(_0x1f7507){return{'name':_0x1f7507[_0x07d5('0x2f')],'type':_0x1f7507['type'][_0x07d5('0x30')]};});_0x22a115[_0x07d5('0x31')]=_[_0x07d5('0x2d')](_0x4f52d7,_0x07d5('0x2a'));_0x22a115[_0x07d5('0x32')]=_[_0x07d5('0x33')](_0x5ada8c[_0x07d5('0x32')]);_0x22a115[_0x07d5('0x34')]=_[_0x07d5('0x35')](_0x22a115[_0x07d5('0x31')],_0x22a115[_0x07d5('0x32')]);_0x2b9f12[_0x07d5('0x36')]=_[_0x07d5('0x35')](_0x22a115[_0x07d5('0x31')],qs[_0x07d5('0x37')](_0x5ada8c['query'][_0x07d5('0x37')]));_0x2b9f12[_0x07d5('0x36')]=_0x2b9f12[_0x07d5('0x36')][_0x07d5('0x38')]?_0x2b9f12[_0x07d5('0x36')]:_0x22a115[_0x07d5('0x31')];if(!_0x5ada8c['query'][_0x07d5('0x39')](_0x07d5('0x3a'))){_0x2b9f12[_0x07d5('0x1e')]=qs['limit'](_0x5ada8c['query'][_0x07d5('0x1e')]);_0x2b9f12[_0x07d5('0x1c')]=qs[_0x07d5('0x1c')](_0x5ada8c['query'][_0x07d5('0x1c')]);}_0x2b9f12[_0x07d5('0x3b')]=qs['sort'](_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3c')]);_0x2b9f12['where']=qs[_0x07d5('0x34')](_[_0x07d5('0x3d')](_0x5ada8c[_0x07d5('0x32')],_0x22a115[_0x07d5('0x34')]),_0x4f52d7);if(_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3e')]){_0x2b9f12['where']=_[_0x07d5('0x3f')](_0x2b9f12[_0x07d5('0x40')],{'$or':_['map'](_0x4f52d7,function(_0x4ec811){if(_0x4ec811[_0x07d5('0x41')]!==_0x07d5('0x42')){var _0x393c15={};_0x393c15[_0x4ec811[_0x07d5('0x2a')]]={'$like':'%'+_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3e')]+'%'};return _0x393c15;}})});}_0x2b9f12=_[_0x07d5('0x3f')]({},_0x2b9f12,_0x5ada8c[_0x07d5('0x43')]);var _0x1a85c8={'where':_0x2b9f12['where']};return db[_0x07d5('0x2e')][_0x07d5('0x1f')](_0x1a85c8)[_0x07d5('0x25')](function(_0x166ec8){_0x2e6b60['count']=_0x166ec8;if(_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x44')]){_0x2b9f12[_0x07d5('0x45')]=[{'all':!![]}];}return db[_0x07d5('0x2e')][_0x07d5('0x46')](_0x2b9f12);})[_0x07d5('0x25')](function(_0xc39f3e){_0x2e6b60[_0x07d5('0x47')]=_0xc39f3e;return _0x2e6b60;})[_0x07d5('0x25')](respondWithFilteredResult(_0x51e224,_0x2b9f12))[_0x07d5('0x48')](handleError(_0x51e224,null));};exports[_0x07d5('0x49')]=function(_0x26787a,_0x3c2991){var _0x5950ce={'raw':!![],'where':{'id':_0x26787a[_0x07d5('0x4a')]['id']}},_0xb9b954={};_0xb9b954['model']=_[_0x07d5('0x33')](db[_0x07d5('0x2e')][_0x07d5('0x4b')]);_0xb9b954['query']=_['keys'](_0x26787a[_0x07d5('0x32')]);_0xb9b954['filters']=_[_0x07d5('0x35')](_0xb9b954[_0x07d5('0x31')],_0xb9b954[_0x07d5('0x32')]);_0x5950ce[_0x07d5('0x36')]=_[_0x07d5('0x35')](_0xb9b954[_0x07d5('0x31')],qs[_0x07d5('0x37')](_0x26787a[_0x07d5('0x32')][_0x07d5('0x37')]));_0x5950ce['attributes']=_0x5950ce[_0x07d5('0x36')]['length']?_0x5950ce[_0x07d5('0x36')]:_0xb9b954['model'];if(_0x26787a[_0x07d5('0x32')][_0x07d5('0x44')]){_0x5950ce['include']=[{'all':!![]}];}_0x5950ce=_['merge']({},_0x5950ce,_0x26787a[_0x07d5('0x43')]);return db[_0x07d5('0x2e')][_0x07d5('0x4c')](_0x5950ce)[_0x07d5('0x25')](handleEntityNotFound(_0x3c2991,null))[_0x07d5('0x25')](respondWithResult(_0x3c2991,null))[_0x07d5('0x48')](handleError(_0x3c2991,null));};exports[_0x07d5('0x4d')]=function(_0x444fab,_0x4345a4){return db[_0x07d5('0x2e')][_0x07d5('0x4d')](_0x444fab[_0x07d5('0x4e')],{})[_0x07d5('0x25')](function(_0x43db19){var _0x1f5061=_0x444fab['user'][_0x07d5('0x4f')]({'plain':!![]});if(!_0x1f5061)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5061['role']===_0x07d5('0x50')){var _0x2dac65=_0x43db19[_0x07d5('0x4f')]({'plain':!![]});var _0x2e7bee=_0x07d5('0x26');return db[_0x07d5('0x51')]['find']({'where':{'name':_0x2e7bee,'userProfileId':_0x1f5061['userProfileId']},'raw':!![]})[_0x07d5('0x25')](function(_0x27374e){if(_0x27374e&&_0x27374e['autoAssociation']===0x0){return db[_0x07d5('0x52')][_0x07d5('0x4d')]({'name':_0x2dac65[_0x07d5('0x2a')],'resourceId':_0x2dac65['id'],'type':_0x27374e[_0x07d5('0x2a')],'sectionId':_0x27374e['id']},{})[_0x07d5('0x25')](function(){return _0x43db19;});}else{return _0x43db19;}})[_0x07d5('0x48')](function(_0x456b75){logger[_0x07d5('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x456b75);throw _0x456b75;});}return _0x43db19;})[_0x07d5('0x25')](respondWithResult(_0x4345a4,0xc9))[_0x07d5('0x48')](handleError(_0x4345a4,null));};exports['update']=function(_0x332d2e,_0x181119){if(_0x332d2e[_0x07d5('0x4e')]['id']){delete _0x332d2e[_0x07d5('0x4e')]['id'];}return db[_0x07d5('0x2e')]['find']({'where':{'id':_0x332d2e[_0x07d5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x181119,null))[_0x07d5('0x25')](saveUpdates(_0x332d2e[_0x07d5('0x4e')],null))[_0x07d5('0x25')](respondWithResult(_0x181119,null))['catch'](handleError(_0x181119,null));};exports[_0x07d5('0x27')]=function(_0x12c6ec,_0x29431b){return db[_0x07d5('0x2e')][_0x07d5('0x4c')]({'where':{'id':_0x12c6ec[_0x07d5('0x4a')]['id']}})[_0x07d5('0x25')](handleEntityNotFound(_0x29431b,null))['then'](removeEntity(_0x29431b,null))[_0x07d5('0x48')](handleError(_0x29431b,null));};exports['download']=function(_0xfb1401,_0xece9bc,_0x2d4a5a){return db[_0x07d5('0x2e')][_0x07d5('0x4c')]({'where':{'id':_0xfb1401[_0x07d5('0x4a')]['id']},'attributes':[_0x07d5('0x2a'),'basename',_0x07d5('0x54'),_0x07d5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0xece9bc,null))[_0x07d5('0x25')](function(_0x1eddac){if(_0x1eddac){if(!fs[_0x07d5('0x56')](path[_0x07d5('0x57')](config[_0x07d5('0x58')],_0x07d5('0x59'),_0x1eddac[_0x07d5('0x54')]))){throw new db[(_0x07d5('0x5a'))][(_0x07d5('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xfb1401[_0x07d5('0x32')][_0x07d5('0x5c')]){return _0xece9bc[_0x07d5('0x28')](0xc8);}return _0xece9bc[_0x07d5('0x5d')](path['join'](config[_0x07d5('0x58')],'server/files/reports',_0x1eddac[_0x07d5('0x54')]),util[_0x07d5('0x5e')]('%s.%s',_0x1eddac[_0x07d5('0x5f')]||_0x1eddac['name'],_0x1eddac[_0x07d5('0x55')][_0x07d5('0x60')]()));}})['catch'](handleError(_0xece9bc,null));};
\ No newline at end of file
+var _0x1557=['save','update','then','get','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','findAll','catch','show','params','merge','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','download','basename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x5a7abb,_0x5940f9){var _0x5489d9=function(_0x209f7d){while(--_0x209f7d){_0x5a7abb['push'](_0x5a7abb['shift']());}};_0x5489d9(++_0x5940f9);}(_0x1557,0x1c4));var _0x7155=function(_0x42604b,_0x27c00a){_0x42604b=_0x42604b-0x0;var _0x579e6c=_0x1557[_0x42604b];return _0x579e6c;};'use strict';var emlformat=require(_0x7155('0x0'));var rimraf=require(_0x7155('0x1'));var zipdir=require(_0x7155('0x2'));var jsonpatch=require(_0x7155('0x3'));var rp=require(_0x7155('0x4'));var moment=require(_0x7155('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7155('0x6'));var util=require('util');var path=require(_0x7155('0x7'));var sox=require(_0x7155('0x8'));var csv=require(_0x7155('0x9'));var ejs=require(_0x7155('0xa'));var fs=require('fs');var fs_extra=require(_0x7155('0xb'));var _=require(_0x7155('0xc'));var squel=require(_0x7155('0xd'));var crypto=require(_0x7155('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7155('0xf'));var toCsv=require(_0x7155('0x9'));var querystring=require('querystring');var Papa=require(_0x7155('0x10'));var Redis=require(_0x7155('0x11'));var authService=require(_0x7155('0x12'));var qs=require(_0x7155('0x13'));var as=require(_0x7155('0x14'));var hardwareService=require(_0x7155('0x15'));var logger=require(_0x7155('0x16'))('api');var utils=require(_0x7155('0x17'));var config=require(_0x7155('0x18'));var licenseUtil=require(_0x7155('0x19'));var db=require(_0x7155('0x1a'))['db'];function respondWithStatusCode(_0x2b966d,_0x5b28f2){_0x5b28f2=_0x5b28f2||0xcc;return function(_0x3294df){if(_0x3294df){return _0x2b966d[_0x7155('0x1b')](_0x5b28f2);}return _0x2b966d[_0x7155('0x1c')](_0x5b28f2)[_0x7155('0x1d')]();};}function respondWithResult(_0x45a2fe,_0x114f4c){_0x114f4c=_0x114f4c||0xc8;return function(_0x2faf69){if(_0x2faf69){return _0x45a2fe[_0x7155('0x1c')](_0x114f4c)[_0x7155('0x1e')](_0x2faf69);}};}function respondWithFilteredResult(_0x4ebb07,_0x3801e9){return function(_0x2a810f){if(_0x2a810f){var _0x145cdd=typeof _0x3801e9['offset']===_0x7155('0x1f')&&typeof _0x3801e9[_0x7155('0x20')]===_0x7155('0x1f');var _0x3af053=_0x2a810f[_0x7155('0x21')];var _0x9c1528=_0x145cdd?0x0:_0x3801e9['offset'];var _0x4244c0=_0x145cdd?_0x2a810f[_0x7155('0x21')]:_0x3801e9[_0x7155('0x22')]+_0x3801e9['limit'];var _0x3b6acc;if(_0x4244c0>=_0x3af053){_0x4244c0=_0x3af053;_0x3b6acc=0xc8;}else{_0x3b6acc=0xce;}_0x4ebb07[_0x7155('0x1c')](_0x3b6acc);return _0x4ebb07[_0x7155('0x23')](_0x7155('0x24'),_0x9c1528+'-'+_0x4244c0+'/'+_0x3af053)['json'](_0x2a810f);}return null;};}function patchUpdates(_0x298002){return function(_0x2610af){try{jsonpatch[_0x7155('0x25')](_0x2610af,_0x298002,!![]);}catch(_0x59237d){return BPromise['reject'](_0x59237d);}return _0x2610af[_0x7155('0x26')]();};}function saveUpdates(_0x5028e5,_0x38fd6f){return function(_0x259824){if(_0x259824){return _0x259824[_0x7155('0x27')](_0x5028e5)['then'](function(_0x5e7054){return _0x5e7054;});}return null;};}function removeEntity(_0x3385b5,_0x11f116){return function(_0x1e64ba){if(_0x1e64ba){return _0x1e64ba['destroy']()[_0x7155('0x28')](function(){var _0x3805b1=_0x1e64ba[_0x7155('0x29')]({'plain':!![]});var _0x12eb61='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x12eb61,'resourceId':_0x3805b1['id']}})[_0x7155('0x28')](function(){return _0x1e64ba;});})[_0x7155('0x28')](function(){_0x3385b5[_0x7155('0x1c')](0xcc)[_0x7155('0x1d')]();});}};}function handleEntityNotFound(_0x5ab684,_0x250fa2){return function(_0x3e9b8f){if(!_0x3e9b8f){_0x5ab684['sendStatus'](0x194);}return _0x3e9b8f;};}function handleError(_0x303ee5,_0x2ecf8c){_0x2ecf8c=_0x2ecf8c||0x1f4;return function(_0x2501ce){logger[_0x7155('0x2a')](_0x2501ce['stack']);if(_0x2501ce[_0x7155('0x2b')]){delete _0x2501ce['name'];}_0x303ee5[_0x7155('0x1c')](_0x2ecf8c)[_0x7155('0x2c')](_0x2501ce);};}exports[_0x7155('0x2d')]=function(_0x44e1f9,_0x50857c){var _0x52e48d={},_0xa71dfe={},_0x178740={'count':0x0,'rows':[]};var _0x2f968b=_[_0x7155('0x2e')](db[_0x7155('0x2f')][_0x7155('0x30')],function(_0x4a1b67){return{'name':_0x4a1b67[_0x7155('0x31')],'type':_0x4a1b67[_0x7155('0x32')]['key']};});_0xa71dfe[_0x7155('0x33')]=_['map'](_0x2f968b,_0x7155('0x2b'));_0xa71dfe[_0x7155('0x34')]=_[_0x7155('0x35')](_0x44e1f9[_0x7155('0x34')]);_0xa71dfe[_0x7155('0x36')]=_['intersection'](_0xa71dfe[_0x7155('0x33')],_0xa71dfe[_0x7155('0x34')]);_0x52e48d[_0x7155('0x37')]=_[_0x7155('0x38')](_0xa71dfe[_0x7155('0x33')],qs[_0x7155('0x39')](_0x44e1f9[_0x7155('0x34')]['fields']));_0x52e48d[_0x7155('0x37')]=_0x52e48d[_0x7155('0x37')][_0x7155('0x3a')]?_0x52e48d[_0x7155('0x37')]:_0xa71dfe[_0x7155('0x33')];if(!_0x44e1f9[_0x7155('0x34')][_0x7155('0x3b')](_0x7155('0x3c'))){_0x52e48d[_0x7155('0x20')]=qs[_0x7155('0x20')](_0x44e1f9[_0x7155('0x34')][_0x7155('0x20')]);_0x52e48d[_0x7155('0x22')]=qs[_0x7155('0x22')](_0x44e1f9[_0x7155('0x34')][_0x7155('0x22')]);}_0x52e48d[_0x7155('0x3d')]=qs[_0x7155('0x3e')](_0x44e1f9['query']['sort']);_0x52e48d[_0x7155('0x3f')]=qs['filters'](_[_0x7155('0x40')](_0x44e1f9['query'],_0xa71dfe[_0x7155('0x36')]),_0x2f968b);if(_0x44e1f9[_0x7155('0x34')][_0x7155('0x41')]){_0x52e48d[_0x7155('0x3f')]=_['merge'](_0x52e48d[_0x7155('0x3f')],{'$or':_[_0x7155('0x2e')](_0x2f968b,function(_0x227fe3){if(_0x227fe3[_0x7155('0x32')]!=='VIRTUAL'){var _0x583c00={};_0x583c00[_0x227fe3[_0x7155('0x2b')]]={'$like':'%'+_0x44e1f9[_0x7155('0x34')][_0x7155('0x41')]+'%'};return _0x583c00;}})});}_0x52e48d=_['merge']({},_0x52e48d,_0x44e1f9[_0x7155('0x42')]);var _0x837c11={'where':_0x52e48d[_0x7155('0x3f')]};return db[_0x7155('0x2f')][_0x7155('0x21')](_0x837c11)['then'](function(_0x331f3a){_0x178740[_0x7155('0x21')]=_0x331f3a;if(_0x44e1f9[_0x7155('0x34')][_0x7155('0x43')]){_0x52e48d['include']=[{'all':!![]}];}return db[_0x7155('0x2f')][_0x7155('0x44')](_0x52e48d);})[_0x7155('0x28')](function(_0x5765f2){_0x178740['rows']=_0x5765f2;return _0x178740;})['then'](respondWithFilteredResult(_0x50857c,_0x52e48d))[_0x7155('0x45')](handleError(_0x50857c,null));};exports[_0x7155('0x46')]=function(_0x4aa236,_0x7fc4b8){var _0x24355b={'raw':!![],'where':{'id':_0x4aa236[_0x7155('0x47')]['id']}},_0x22c121={};_0x22c121[_0x7155('0x33')]=_[_0x7155('0x35')](db[_0x7155('0x2f')]['rawAttributes']);_0x22c121[_0x7155('0x34')]=_[_0x7155('0x35')](_0x4aa236[_0x7155('0x34')]);_0x22c121[_0x7155('0x36')]=_[_0x7155('0x38')](_0x22c121[_0x7155('0x33')],_0x22c121[_0x7155('0x34')]);_0x24355b[_0x7155('0x37')]=_[_0x7155('0x38')](_0x22c121[_0x7155('0x33')],qs[_0x7155('0x39')](_0x4aa236['query']['fields']));_0x24355b[_0x7155('0x37')]=_0x24355b[_0x7155('0x37')]['length']?_0x24355b[_0x7155('0x37')]:_0x22c121[_0x7155('0x33')];if(_0x4aa236['query'][_0x7155('0x43')]){_0x24355b['include']=[{'all':!![]}];}_0x24355b=_[_0x7155('0x48')]({},_0x24355b,_0x4aa236['options']);return db['AnalyticExtractedReport'][_0x7155('0x49')](_0x24355b)[_0x7155('0x28')](handleEntityNotFound(_0x7fc4b8,null))[_0x7155('0x28')](respondWithResult(_0x7fc4b8,null))['catch'](handleError(_0x7fc4b8,null));};exports[_0x7155('0x4a')]=function(_0x345047,_0x4c4047){return db[_0x7155('0x2f')][_0x7155('0x4a')](_0x345047[_0x7155('0x4b')],{})[_0x7155('0x28')](function(_0x4e16e8){var _0x3a9617=_0x345047[_0x7155('0x4c')]['get']({'plain':!![]});if(!_0x3a9617)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a9617[_0x7155('0x4d')]==='user'){var _0x388d95=_0x4e16e8[_0x7155('0x29')]({'plain':!![]});var _0x5db931='ExtractedReports';return db[_0x7155('0x4e')][_0x7155('0x49')]({'where':{'name':_0x5db931,'userProfileId':_0x3a9617[_0x7155('0x4f')]},'raw':!![]})[_0x7155('0x28')](function(_0x35ebba){if(_0x35ebba&&_0x35ebba['autoAssociation']===0x0){return db[_0x7155('0x50')][_0x7155('0x4a')]({'name':_0x388d95[_0x7155('0x2b')],'resourceId':_0x388d95['id'],'type':_0x35ebba[_0x7155('0x2b')],'sectionId':_0x35ebba['id']},{})[_0x7155('0x28')](function(){return _0x4e16e8;});}else{return _0x4e16e8;}})['catch'](function(_0x3b2033){logger[_0x7155('0x2a')](_0x7155('0x51'),_0x3b2033);throw _0x3b2033;});}return _0x4e16e8;})[_0x7155('0x28')](respondWithResult(_0x4c4047,0xc9))['catch'](handleError(_0x4c4047,null));};exports[_0x7155('0x27')]=function(_0x327753,_0x4880ef){if(_0x327753['body']['id']){delete _0x327753[_0x7155('0x4b')]['id'];}return db[_0x7155('0x2f')]['find']({'where':{'id':_0x327753['params']['id']}})[_0x7155('0x28')](handleEntityNotFound(_0x4880ef,null))[_0x7155('0x28')](saveUpdates(_0x327753[_0x7155('0x4b')],null))['then'](respondWithResult(_0x4880ef,null))[_0x7155('0x45')](handleError(_0x4880ef,null));};exports[_0x7155('0x52')]=function(_0x5c8787,_0x131ef4){return db['AnalyticExtractedReport'][_0x7155('0x49')]({'where':{'id':_0x5c8787[_0x7155('0x47')]['id']}})[_0x7155('0x28')](handleEntityNotFound(_0x131ef4,null))[_0x7155('0x28')](removeEntity(_0x131ef4,null))[_0x7155('0x45')](handleError(_0x131ef4,null));};exports[_0x7155('0x53')]=function(_0x2902d1,_0x1515ad,_0x2c0855){return db[_0x7155('0x2f')]['find']({'where':{'id':_0x2902d1[_0x7155('0x47')]['id']},'attributes':[_0x7155('0x2b'),_0x7155('0x54'),'savename',_0x7155('0x55')],'raw':!![]})[_0x7155('0x28')](handleEntityNotFound(_0x1515ad,null))['then'](function(_0x4c3db0){if(_0x4c3db0){if(!fs[_0x7155('0x56')](path['join'](config[_0x7155('0x57')],_0x7155('0x58'),_0x4c3db0['savename']))){throw new db[(_0x7155('0x59'))][(_0x7155('0x5a'))](_0x7155('0x5b'));}if(_0x2902d1[_0x7155('0x34')][_0x7155('0x5c')]){return _0x1515ad[_0x7155('0x1b')](0xc8);}return _0x1515ad[_0x7155('0x53')](path[_0x7155('0x5d')](config[_0x7155('0x57')],_0x7155('0x58'),_0x4c3db0[_0x7155('0x5e')]),util[_0x7155('0x5f')](_0x7155('0x60'),_0x4c3db0[_0x7155('0x54')]||_0x4c3db0[_0x7155('0x2b')],_0x4c3db0['output'][_0x7155('0x61')]()));}})[_0x7155('0x45')](handleError(_0x1515ad,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index f557dd8..1b31cfc 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 _0xfd37=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5e390e,_0x396801){var _0x34b044=function(_0x59f5d9){while(--_0x59f5d9){_0x5e390e['push'](_0x5e390e['shift']());}};_0x34b044(++_0x396801);}(_0xfd37,0x78));var _0x7fd3=function(_0x2b191e,_0x3f477d){_0x2b191e=_0x2b191e-0x0;var _0x420881=_0xfd37[_0x2b191e];return _0x420881;};'use strict';var _=require(_0x7fd3('0x0'));var util=require(_0x7fd3('0x1'));var logger=require(_0x7fd3('0x2'))(_0x7fd3('0x3'));var moment=require('moment');var BPromise=require(_0x7fd3('0x4'));var rp=require(_0x7fd3('0x5'));var fs=require('fs');var path=require(_0x7fd3('0x6'));var rimraf=require(_0x7fd3('0x7'));var config=require(_0x7fd3('0x8'));var attributes=require(_0x7fd3('0x9'));module[_0x7fd3('0xa')]=function(_0x3d24c8,_0x158d16){return _0x3d24c8[_0x7fd3('0xb')](_0x7fd3('0xc'),attributes,{'tableName':_0x7fd3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x996c=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x482956,_0x2f0908){var _0x374562=function(_0x2aa3ae){while(--_0x2aa3ae){_0x482956['push'](_0x482956['shift']());}};_0x374562(++_0x2f0908);}(_0x996c,0x1ea));var _0xc996=function(_0x5ee2b7,_0x34790f){_0x5ee2b7=_0x5ee2b7-0x0;var _0x43842d=_0x996c[_0x5ee2b7];return _0x43842d;};'use strict';var _=require(_0xc996('0x0'));var util=require(_0xc996('0x1'));var logger=require(_0xc996('0x2'))(_0xc996('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc996('0x4'));var fs=require('fs');var path=require(_0xc996('0x5'));var rimraf=require(_0xc996('0x6'));var config=require(_0xc996('0x7'));var attributes=require(_0xc996('0x8'));module['exports']=function(_0x89fdf4,_0x24fd4e){return _0x89fdf4[_0xc996('0x9')](_0xc996('0xa'),attributes,{'tableName':_0xc996('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 91124e9..96ec189 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 _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x468148,_0x50e263){var _0x2b67ab=function(_0x1baee5){while(--_0x1baee5){_0x468148['push'](_0x468148['shift']());}};_0x2b67ab(++_0x50e263);}(_0x4b39,0x133));var _0x94b3=function(_0x4b17da,_0x3b50b4){_0x4b17da=_0x4b17da-0x0;var _0x1dce95=_0x4b39[_0x4b17da];return _0x1dce95;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});}
\ No newline at end of file
+var _0xf7e0=['stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b2a59,_0x36e582){var _0x4160f3=function(_0x2f062f){while(--_0x2f062f){_0x3b2a59['push'](_0x3b2a59['shift']());}};_0x4160f3(++_0x36e582);}(_0xf7e0,0x68));var _0x0f7e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf7e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0f7e('0x0'));var util=require(_0x0f7e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f7e('0x2'));var fs=require('fs');var Redis=require(_0x0f7e('0x3'));var db=require(_0x0f7e('0x4'))['db'];var utils=require(_0x0f7e('0x5'));var logger=require(_0x0f7e('0x6'))('rpc');var config=require(_0x0f7e('0x7'));var jayson=require(_0x0f7e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8da890,_0x5aea9d,_0x57b995){return new BPromise(function(_0x2c4006,_0x2611b1){return client[_0x0f7e('0x9')](_0x8da890,_0x57b995)[_0x0f7e('0xa')](function(_0x1defe1){logger[_0x0f7e('0xb')](_0x0f7e('0xc'),_0x5aea9d,_0x0f7e('0xd'));logger[_0x0f7e('0xe')](_0x0f7e('0xf'),_0x5aea9d,_0x0f7e('0xd'),JSON[_0x0f7e('0x10')](_0x1defe1));if(_0x1defe1[_0x0f7e('0x11')]){if(_0x1defe1[_0x0f7e('0x11')]['code']===0x1f4){logger[_0x0f7e('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5aea9d,_0x1defe1['error'][_0x0f7e('0x12')]);return _0x2611b1(_0x1defe1[_0x0f7e('0x11')][_0x0f7e('0x12')]);}logger[_0x0f7e('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5aea9d,_0x1defe1[_0x0f7e('0x11')][_0x0f7e('0x12')]);return _0x2c4006(_0x1defe1['error'][_0x0f7e('0x12')]);}else{logger[_0x0f7e('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5aea9d,'request\x20sent');_0x2c4006(_0x1defe1['result']['message']);}})[_0x0f7e('0x13')](function(_0x3118c1){logger[_0x0f7e('0x11')](_0x0f7e('0xc'),_0x5aea9d,_0x3118c1);_0x2611b1(_0x3118c1);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 4233a3e..46555e9 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 _0x97c2=['./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29b65b,_0x3b7633){var _0x2d80ba=function(_0x6a7752){while(--_0x6a7752){_0x29b65b['push'](_0x29b65b['shift']());}};_0x2d80ba(++_0x3b7633);}(_0x97c2,0x138));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x297c('0x0'));var util=require(_0x297c('0x1'));var path=require(_0x297c('0x2'));var timeout=require(_0x297c('0x3'));var express=require(_0x297c('0x4'));var router=express[_0x297c('0x5')]();var fs_extra=require(_0x297c('0x6'));var auth=require(_0x297c('0x7'));var interaction=require(_0x297c('0x8'));var config=require(_0x297c('0x9'));var controller=require(_0x297c('0xa'));router[_0x297c('0xb')]('/',auth['isAuthenticated'](),controller[_0x297c('0xc')]);router['get'](_0x297c('0xd'),auth['isAuthenticated'](),controller[_0x297c('0xe')]);router[_0x297c('0xb')](_0x297c('0xf'),auth[_0x297c('0x10')](),controller[_0x297c('0x11')]);router[_0x297c('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x297c('0x13')]('/:id',auth[_0x297c('0x10')](),controller[_0x297c('0x14')]);router['delete']('/:id',auth[_0x297c('0x10')](),controller[_0x297c('0x15')]);module[_0x297c('0x16')]=router;
\ No newline at end of file
+var _0xbc5e=['/:id/download','post','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xbc5e,0xa6));var _0xebc5=function(_0x3c7996,_0x1b65a3){_0x3c7996=_0x3c7996-0x0;var _0x1d1170=_0xbc5e[_0x3c7996];return _0x1d1170;};'use strict';var multer=require('multer');var util=require(_0xebc5('0x0'));var path=require(_0xebc5('0x1'));var timeout=require(_0xebc5('0x2'));var express=require(_0xebc5('0x3'));var router=express[_0xebc5('0x4')]();var fs_extra=require(_0xebc5('0x5'));var auth=require(_0xebc5('0x6'));var interaction=require(_0xebc5('0x7'));var config=require(_0xebc5('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xebc5('0x9')]('/',auth[_0xebc5('0xa')](),controller[_0xebc5('0xb')]);router[_0xebc5('0x9')](_0xebc5('0xc'),auth[_0xebc5('0xa')](),controller[_0xebc5('0xd')]);router[_0xebc5('0x9')](_0xebc5('0xe'),auth[_0xebc5('0xa')](),controller['download']);router[_0xebc5('0xf')]('/',auth[_0xebc5('0xa')](),controller[_0xebc5('0x10')]);router['put']('/:id',auth[_0xebc5('0xa')](),controller[_0xebc5('0x11')]);router[_0xebc5('0x12')](_0xebc5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xebc5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 59c649c..e680218 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 _0x7f80=['sequelize','exports','TEXT','STRING'];(function(_0x9cae0c,_0x42b12d){var _0x45542e=function(_0x31623a){while(--_0x31623a){_0x9cae0c['push'](_0x9cae0c['shift']());}};_0x45542e(++_0x42b12d);}(_0x7f80,0xec));var _0x07f8=function(_0x51304d,_0x42c2e7){_0x51304d=_0x51304d-0x0;var _0x588e90=_0x7f80[_0x51304d];return _0x588e90;};'use strict';var Sequelize=require(_0x07f8('0x0'));module[_0x07f8('0x1')]={'field':{'type':Sequelize[_0x07f8('0x2')]},'alias':{'type':Sequelize[_0x07f8('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x07f8('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc17a=['STRING','BOOLEAN','sequelize'];(function(_0x5e9aad,_0x3582a8){var _0xb99dad=function(_0x164234){while(--_0x164234){_0x5e9aad['push'](_0x5e9aad['shift']());}};_0xb99dad(++_0x3582a8);}(_0xc17a,0xe6));var _0xac17=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc17a[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0xac17('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xac17('0x1')]},'function':{'type':Sequelize[_0xac17('0x1')]},'format':{'type':Sequelize[_0xac17('0x1')]},'groupBy':{'type':Sequelize[_0xac17('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xac17('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index e6ce079..a5c5f59 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 _0x78b9=['moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise'];(function(_0xab477c,_0x4ee058){var _0x466db2=function(_0x3b9522){while(--_0x3b9522){_0xab477c['push'](_0xab477c['shift']());}};_0x466db2(++_0x4ee058);}(_0x78b9,0x191));var _0x978b=function(_0x58df49,_0x109194){_0x58df49=_0x58df49-0x0;var _0x123dba=_0x78b9[_0x58df49];return _0x123dba;};'use strict';var emlformat=require(_0x978b('0x0'));var rimraf=require(_0x978b('0x1'));var zipdir=require(_0x978b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x978b('0x3'));var moment=require(_0x978b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x978b('0x5'));var path=require(_0x978b('0x6'));var sox=require(_0x978b('0x7'));var csv=require(_0x978b('0x8'));var ejs=require(_0x978b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x978b('0xa'));var squel=require(_0x978b('0xb'));var crypto=require('crypto');var jsforce=require(_0x978b('0xc'));var deskjs=require(_0x978b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x978b('0xe'));var Papa=require(_0x978b('0xf'));var Redis=require(_0x978b('0x10'));var authService=require(_0x978b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x978b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x978b('0x13'));var config=require(_0x978b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137c02,_0x1c200b){_0x1c200b=_0x1c200b||0xcc;return function(_0x191a39){if(_0x191a39){return _0x137c02['sendStatus'](_0x1c200b);}return _0x137c02[_0x978b('0x15')](_0x1c200b)[_0x978b('0x16')]();};}function respondWithResult(_0x5f19dc,_0x2f6d8a){_0x2f6d8a=_0x2f6d8a||0xc8;return function(_0x2f5a7f){if(_0x2f5a7f){return _0x5f19dc[_0x978b('0x15')](_0x2f6d8a)['json'](_0x2f5a7f);}};}function respondWithFilteredResult(_0x4b0165,_0x1bc253){return function(_0x439dac){if(_0x439dac){var _0x1056f2=typeof _0x1bc253[_0x978b('0x17')]===_0x978b('0x18')&&typeof _0x1bc253[_0x978b('0x19')]===_0x978b('0x18');var _0x3103aa=_0x439dac[_0x978b('0x1a')];var _0xc66865=_0x1056f2?0x0:_0x1bc253[_0x978b('0x17')];var _0x5413de=_0x1056f2?_0x439dac[_0x978b('0x1a')]:_0x1bc253[_0x978b('0x17')]+_0x1bc253['limit'];var _0x56fdd1;if(_0x5413de>=_0x3103aa){_0x5413de=_0x3103aa;_0x56fdd1=0xc8;}else{_0x56fdd1=0xce;}_0x4b0165[_0x978b('0x15')](_0x56fdd1);return _0x4b0165['set'](_0x978b('0x1b'),_0xc66865+'-'+_0x5413de+'/'+_0x3103aa)[_0x978b('0x1c')](_0x439dac);}return null;};}function patchUpdates(_0x396538){return function(_0x1808a6){try{jsonpatch['apply'](_0x1808a6,_0x396538,!![]);}catch(_0x498a50){return BPromise[_0x978b('0x1d')](_0x498a50);}return _0x1808a6[_0x978b('0x1e')]();};}function saveUpdates(_0x9f4a97,_0x343ce3){return function(_0x66c66e){if(_0x66c66e){return _0x66c66e[_0x978b('0x1f')](_0x9f4a97)[_0x978b('0x20')](function(_0x100d01){return _0x100d01;});}return null;};}function removeEntity(_0x384cd1,_0x417ad7){return function(_0x9492c9){if(_0x9492c9){return _0x9492c9[_0x978b('0x21')]()[_0x978b('0x20')](function(){_0x384cd1[_0x978b('0x15')](0xcc)[_0x978b('0x16')]();});}};}function handleEntityNotFound(_0x11208e,_0x5b8d14){return function(_0x3ffebd){if(!_0x3ffebd){_0x11208e[_0x978b('0x22')](0x194);}return _0x3ffebd;};}function handleError(_0x331948,_0x22f2a5){_0x22f2a5=_0x22f2a5||0x1f4;return function(_0x1c07d5){logger[_0x978b('0x23')](_0x1c07d5[_0x978b('0x24')]);if(_0x1c07d5[_0x978b('0x25')]){delete _0x1c07d5['name'];}_0x331948[_0x978b('0x15')](_0x22f2a5)[_0x978b('0x26')](_0x1c07d5);};}exports[_0x978b('0x27')]=function(_0x508a81,_0x40fa30){var _0xb52846={},_0x24fefb={},_0x3aa5ae={'count':0x0,'rows':[]};var _0xc55a67=_[_0x978b('0x28')](db[_0x978b('0x29')][_0x978b('0x2a')],function(_0x233525){return{'name':_0x233525['fieldName'],'type':_0x233525['type'][_0x978b('0x2b')]};});_0x24fefb[_0x978b('0x2c')]=_[_0x978b('0x28')](_0xc55a67,_0x978b('0x25'));_0x24fefb[_0x978b('0x2d')]=_[_0x978b('0x2e')](_0x508a81['query']);_0x24fefb[_0x978b('0x2f')]=_[_0x978b('0x30')](_0x24fefb[_0x978b('0x2c')],_0x24fefb[_0x978b('0x2d')]);_0xb52846['attributes']=_['intersection'](_0x24fefb[_0x978b('0x2c')],qs['fields'](_0x508a81[_0x978b('0x2d')][_0x978b('0x31')]));_0xb52846[_0x978b('0x32')]=_0xb52846[_0x978b('0x32')][_0x978b('0x33')]?_0xb52846['attributes']:_0x24fefb['model'];if(!_0x508a81['query'][_0x978b('0x34')](_0x978b('0x35'))){_0xb52846['limit']=qs[_0x978b('0x19')](_0x508a81[_0x978b('0x2d')]['limit']);_0xb52846[_0x978b('0x17')]=qs[_0x978b('0x17')](_0x508a81[_0x978b('0x2d')][_0x978b('0x17')]);}_0xb52846[_0x978b('0x36')]=qs[_0x978b('0x37')](_0x508a81['query'][_0x978b('0x37')]);_0xb52846[_0x978b('0x38')]=qs[_0x978b('0x2f')](_[_0x978b('0x39')](_0x508a81[_0x978b('0x2d')],_0x24fefb[_0x978b('0x2f')]),_0xc55a67);if(_0x508a81[_0x978b('0x2d')][_0x978b('0x3a')]){_0xb52846['where']=_[_0x978b('0x3b')](_0xb52846['where'],{'$or':_[_0x978b('0x28')](_0xc55a67,function(_0x493d75){if(_0x493d75[_0x978b('0x3c')]!==_0x978b('0x3d')){var _0x32e06b={};_0x32e06b[_0x493d75['name']]={'$like':'%'+_0x508a81[_0x978b('0x2d')]['filter']+'%'};return _0x32e06b;}})});}_0xb52846=_['merge']({},_0xb52846,_0x508a81[_0x978b('0x3e')]);var _0x218737={'where':_0xb52846['where']};return db['AnalyticFieldReport'][_0x978b('0x1a')](_0x218737)[_0x978b('0x20')](function(_0x31b771){_0x3aa5ae['count']=_0x31b771;if(_0x508a81[_0x978b('0x2d')][_0x978b('0x3f')]){_0xb52846['include']=[{'all':!![]}];}return db[_0x978b('0x29')][_0x978b('0x40')](_0xb52846);})['then'](function(_0x5e2b1d){_0x3aa5ae[_0x978b('0x41')]=_0x5e2b1d;return _0x3aa5ae;})[_0x978b('0x20')](respondWithFilteredResult(_0x40fa30,_0xb52846))['catch'](handleError(_0x40fa30,null));};exports[_0x978b('0x42')]=function(_0x433ef2,_0x1e573e){var _0x559e88={'raw':![],'where':{'id':_0x433ef2[_0x978b('0x43')]['id']}},_0x24ff3d={};_0x24ff3d[_0x978b('0x2c')]=_[_0x978b('0x2e')](db[_0x978b('0x29')][_0x978b('0x2a')]);_0x24ff3d[_0x978b('0x2d')]=_[_0x978b('0x2e')](_0x433ef2[_0x978b('0x2d')]);_0x24ff3d[_0x978b('0x2f')]=_['intersection'](_0x24ff3d[_0x978b('0x2c')],_0x24ff3d['query']);_0x559e88[_0x978b('0x32')]=_['intersection'](_0x24ff3d[_0x978b('0x2c')],qs[_0x978b('0x31')](_0x433ef2[_0x978b('0x2d')][_0x978b('0x31')]));_0x559e88['attributes']=_0x559e88[_0x978b('0x32')][_0x978b('0x33')]?_0x559e88[_0x978b('0x32')]:_0x24ff3d[_0x978b('0x2c')];if(_0x433ef2['query']['includeAll']){_0x559e88[_0x978b('0x44')]=[{'all':!![]}];}_0x559e88=_[_0x978b('0x3b')]({},_0x559e88,_0x433ef2[_0x978b('0x3e')]);return db[_0x978b('0x29')][_0x978b('0x45')](_0x559e88)[_0x978b('0x20')](handleEntityNotFound(_0x1e573e,null))[_0x978b('0x20')](respondWithResult(_0x1e573e,null))[_0x978b('0x46')](handleError(_0x1e573e,null));};exports[_0x978b('0x47')]=function(_0x3fa71f,_0x35510e){return db[_0x978b('0x29')][_0x978b('0x47')](_0x3fa71f[_0x978b('0x48')],{})[_0x978b('0x20')](respondWithResult(_0x35510e,0xc9))['catch'](handleError(_0x35510e,null));};exports['bulkCreate']=function(_0x33f857,_0x272345){return db[_0x978b('0x29')][_0x978b('0x49')](_0x33f857[_0x978b('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x272345,0xc9))['catch'](handleError(_0x272345,null));};exports[_0x978b('0x1f')]=function(_0x26a165,_0x37a24d){if(_0x26a165[_0x978b('0x48')]['id']){delete _0x26a165['body']['id'];}return db[_0x978b('0x29')][_0x978b('0x45')]({'where':{'id':_0x26a165[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x37a24d,null))[_0x978b('0x20')](saveUpdates(_0x26a165[_0x978b('0x48')],null))[_0x978b('0x20')](respondWithResult(_0x37a24d,null))['catch'](handleError(_0x37a24d,null));};exports['destroy']=function(_0x3b28c1,_0x1bc616){return db[_0x978b('0x29')][_0x978b('0x45')]({'where':{'id':_0x3b28c1[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x1bc616,null))[_0x978b('0x20')](removeEntity(_0x1bc616,null))[_0x978b('0x46')](handleError(_0x1bc616,null));};exports[_0x978b('0x4a')]=function(_0x4c2d2d,_0x10578e){return db[_0x978b('0x29')][_0x978b('0x21')]({'where':{'id':_0x4c2d2d[_0x978b('0x2d')][_0x978b('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x10578e,0xcc))['catch'](handleError(_0x10578e,null));};exports[_0x978b('0x4c')]=function(_0x292ecf,_0x1ec4c9,_0x356c40){return db[_0x978b('0x4d')]['findOne']({'where':{'id':_0x292ecf[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x1ec4c9,null))[_0x978b('0x20')](function(_0x542ff4){if(_0x542ff4){return db[_0x978b('0x4e')][_0x978b('0x4f')](function(_0x3c1b50){return db[_0x978b('0x29')][_0x978b('0x21')]({'where':{'CustomReportId':_0x292ecf[_0x978b('0x43')]['id']},'transaction':_0x3c1b50})[_0x978b('0x20')](function(_0x558489){var _0xfd41be=_[_0x978b('0x28')](_0x292ecf[_0x978b('0x48')],function(_0x4037f4){delete _0x4037f4['id'];_0x4037f4[_0x978b('0x50')]=_0x292ecf[_0x978b('0x43')]['id'];return _0x4037f4;});return db[_0x978b('0x29')][_0x978b('0x49')](_0xfd41be,{'transaction':_0x3c1b50});});})['then'](function(){return db[_0x978b('0x29')]['findAll']({'where':{'CustomReportId':_0x292ecf['params']['id']}});});}})[_0x978b('0x20')](respondWithResult(_0x1ec4c9,null))[_0x978b('0x46')](handleError(_0x1ec4c9,null));};
\ No newline at end of file
+var _0xe2b6=['include','findAll','rows','catch','show','find','create','bulkCreate','body','params','ids','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','AnalyticFieldReport','includeAll'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xe2b6,0x1d0));var _0x6e2b=function(_0x2761f7,_0x26278d){_0x2761f7=_0x2761f7-0x0;var _0x3519d1=_0xe2b6[_0x2761f7];return _0x3519d1;};'use strict';var emlformat=require(_0x6e2b('0x0'));var rimraf=require(_0x6e2b('0x1'));var zipdir=require(_0x6e2b('0x2'));var jsonpatch=require(_0x6e2b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6e2b('0x4'));var util=require(_0x6e2b('0x5'));var path=require(_0x6e2b('0x6'));var sox=require('sox');var csv=require(_0x6e2b('0x7'));var ejs=require(_0x6e2b('0x8'));var fs=require('fs');var fs_extra=require(_0x6e2b('0x9'));var _=require(_0x6e2b('0xa'));var squel=require(_0x6e2b('0xb'));var crypto=require(_0x6e2b('0xc'));var jsforce=require(_0x6e2b('0xd'));var deskjs=require(_0x6e2b('0xe'));var toCsv=require(_0x6e2b('0x7'));var querystring=require('querystring');var Papa=require(_0x6e2b('0xf'));var Redis=require(_0x6e2b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6e2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e2b('0x12'));var logger=require('../../config/logger')(_0x6e2b('0x13'));var utils=require(_0x6e2b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6e2b('0x15'))['db'];function respondWithStatusCode(_0x448c75,_0x4460f0){_0x4460f0=_0x4460f0||0xcc;return function(_0x7086e4){if(_0x7086e4){return _0x448c75[_0x6e2b('0x16')](_0x4460f0);}return _0x448c75[_0x6e2b('0x17')](_0x4460f0)[_0x6e2b('0x18')]();};}function respondWithResult(_0x3f9ba0,_0x138fb8){_0x138fb8=_0x138fb8||0xc8;return function(_0x3b79a3){if(_0x3b79a3){return _0x3f9ba0[_0x6e2b('0x17')](_0x138fb8)[_0x6e2b('0x19')](_0x3b79a3);}};}function respondWithFilteredResult(_0x49e3ea,_0x33fdf7){return function(_0x5b84b6){if(_0x5b84b6){var _0x5b63ea=typeof _0x33fdf7[_0x6e2b('0x1a')]==='undefined'&&typeof _0x33fdf7['limit']==='undefined';var _0x3fe7b8=_0x5b84b6['count'];var _0x5aefb2=_0x5b63ea?0x0:_0x33fdf7[_0x6e2b('0x1a')];var _0x15858c=_0x5b63ea?_0x5b84b6[_0x6e2b('0x1b')]:_0x33fdf7['offset']+_0x33fdf7[_0x6e2b('0x1c')];var _0x3c0287;if(_0x15858c>=_0x3fe7b8){_0x15858c=_0x3fe7b8;_0x3c0287=0xc8;}else{_0x3c0287=0xce;}_0x49e3ea['status'](_0x3c0287);return _0x49e3ea[_0x6e2b('0x1d')](_0x6e2b('0x1e'),_0x5aefb2+'-'+_0x15858c+'/'+_0x3fe7b8)[_0x6e2b('0x19')](_0x5b84b6);}return null;};}function patchUpdates(_0x29b605){return function(_0xdc2ed8){try{jsonpatch[_0x6e2b('0x1f')](_0xdc2ed8,_0x29b605,!![]);}catch(_0x153faf){return BPromise[_0x6e2b('0x20')](_0x153faf);}return _0xdc2ed8[_0x6e2b('0x21')]();};}function saveUpdates(_0x168951,_0x9632){return function(_0x1baf16){if(_0x1baf16){return _0x1baf16[_0x6e2b('0x22')](_0x168951)[_0x6e2b('0x23')](function(_0x440e19){return _0x440e19;});}return null;};}function removeEntity(_0x36239f,_0x4435f5){return function(_0x997dbb){if(_0x997dbb){return _0x997dbb[_0x6e2b('0x24')]()[_0x6e2b('0x23')](function(){_0x36239f[_0x6e2b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112e7f,_0x241c0d){return function(_0x3000b0){if(!_0x3000b0){_0x112e7f[_0x6e2b('0x16')](0x194);}return _0x3000b0;};}function handleError(_0x13ec8c,_0x77180){_0x77180=_0x77180||0x1f4;return function(_0x2c5243){logger[_0x6e2b('0x25')](_0x2c5243[_0x6e2b('0x26')]);if(_0x2c5243[_0x6e2b('0x27')]){delete _0x2c5243['name'];}_0x13ec8c['status'](_0x77180)['send'](_0x2c5243);};}exports['index']=function(_0x2fb41d,_0x7dc028){var _0x2d34ca={},_0x50d6da={},_0x1facad={'count':0x0,'rows':[]};var _0x145da6=_[_0x6e2b('0x28')](db['AnalyticFieldReport'][_0x6e2b('0x29')],function(_0x4b0190){return{'name':_0x4b0190['fieldName'],'type':_0x4b0190[_0x6e2b('0x2a')][_0x6e2b('0x2b')]};});_0x50d6da[_0x6e2b('0x2c')]=_[_0x6e2b('0x28')](_0x145da6,_0x6e2b('0x27'));_0x50d6da['query']=_[_0x6e2b('0x2d')](_0x2fb41d[_0x6e2b('0x2e')]);_0x50d6da[_0x6e2b('0x2f')]=_[_0x6e2b('0x30')](_0x50d6da[_0x6e2b('0x2c')],_0x50d6da[_0x6e2b('0x2e')]);_0x2d34ca['attributes']=_['intersection'](_0x50d6da['model'],qs[_0x6e2b('0x31')](_0x2fb41d['query']['fields']));_0x2d34ca[_0x6e2b('0x32')]=_0x2d34ca[_0x6e2b('0x32')][_0x6e2b('0x33')]?_0x2d34ca['attributes']:_0x50d6da['model'];if(!_0x2fb41d[_0x6e2b('0x2e')]['hasOwnProperty'](_0x6e2b('0x34'))){_0x2d34ca[_0x6e2b('0x1c')]=qs[_0x6e2b('0x1c')](_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x1c')]);_0x2d34ca[_0x6e2b('0x1a')]=qs[_0x6e2b('0x1a')](_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x1a')]);}_0x2d34ca['order']=qs[_0x6e2b('0x35')](_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x35')]);_0x2d34ca[_0x6e2b('0x36')]=qs[_0x6e2b('0x2f')](_[_0x6e2b('0x37')](_0x2fb41d[_0x6e2b('0x2e')],_0x50d6da[_0x6e2b('0x2f')]),_0x145da6);if(_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x38')]){_0x2d34ca[_0x6e2b('0x36')]=_[_0x6e2b('0x39')](_0x2d34ca['where'],{'$or':_[_0x6e2b('0x28')](_0x145da6,function(_0x5c3f1e){if(_0x5c3f1e[_0x6e2b('0x2a')]!=='VIRTUAL'){var _0xb1972e={};_0xb1972e[_0x5c3f1e[_0x6e2b('0x27')]]={'$like':'%'+_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x38')]+'%'};return _0xb1972e;}})});}_0x2d34ca=_['merge']({},_0x2d34ca,_0x2fb41d[_0x6e2b('0x3a')]);var _0x4feeca={'where':_0x2d34ca['where']};return db[_0x6e2b('0x3b')][_0x6e2b('0x1b')](_0x4feeca)['then'](function(_0x2ed3cc){_0x1facad['count']=_0x2ed3cc;if(_0x2fb41d[_0x6e2b('0x2e')][_0x6e2b('0x3c')]){_0x2d34ca[_0x6e2b('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x6e2b('0x3e')](_0x2d34ca);})[_0x6e2b('0x23')](function(_0x5cbd21){_0x1facad[_0x6e2b('0x3f')]=_0x5cbd21;return _0x1facad;})[_0x6e2b('0x23')](respondWithFilteredResult(_0x7dc028,_0x2d34ca))[_0x6e2b('0x40')](handleError(_0x7dc028,null));};exports[_0x6e2b('0x41')]=function(_0xacda4e,_0x4354f7){var _0x39b436={'raw':![],'where':{'id':_0xacda4e['params']['id']}},_0x1e4cd3={};_0x1e4cd3[_0x6e2b('0x2c')]=_['keys'](db[_0x6e2b('0x3b')][_0x6e2b('0x29')]);_0x1e4cd3['query']=_['keys'](_0xacda4e[_0x6e2b('0x2e')]);_0x1e4cd3[_0x6e2b('0x2f')]=_[_0x6e2b('0x30')](_0x1e4cd3[_0x6e2b('0x2c')],_0x1e4cd3['query']);_0x39b436[_0x6e2b('0x32')]=_[_0x6e2b('0x30')](_0x1e4cd3[_0x6e2b('0x2c')],qs[_0x6e2b('0x31')](_0xacda4e[_0x6e2b('0x2e')]['fields']));_0x39b436[_0x6e2b('0x32')]=_0x39b436[_0x6e2b('0x32')][_0x6e2b('0x33')]?_0x39b436[_0x6e2b('0x32')]:_0x1e4cd3[_0x6e2b('0x2c')];if(_0xacda4e[_0x6e2b('0x2e')]['includeAll']){_0x39b436[_0x6e2b('0x3d')]=[{'all':!![]}];}_0x39b436=_[_0x6e2b('0x39')]({},_0x39b436,_0xacda4e[_0x6e2b('0x3a')]);return db[_0x6e2b('0x3b')][_0x6e2b('0x42')](_0x39b436)[_0x6e2b('0x23')](handleEntityNotFound(_0x4354f7,null))[_0x6e2b('0x23')](respondWithResult(_0x4354f7,null))['catch'](handleError(_0x4354f7,null));};exports[_0x6e2b('0x43')]=function(_0x520c81,_0x3ce6b1){return db[_0x6e2b('0x3b')]['create'](_0x520c81['body'],{})[_0x6e2b('0x23')](respondWithResult(_0x3ce6b1,0xc9))[_0x6e2b('0x40')](handleError(_0x3ce6b1,null));};exports['bulkCreate']=function(_0x7ed180,_0x4da44e){return db[_0x6e2b('0x3b')][_0x6e2b('0x44')](_0x7ed180['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4da44e,0xc9))[_0x6e2b('0x40')](handleError(_0x4da44e,null));};exports['update']=function(_0x6f8f68,_0x556edd){if(_0x6f8f68[_0x6e2b('0x45')]['id']){delete _0x6f8f68[_0x6e2b('0x45')]['id'];}return db['AnalyticFieldReport'][_0x6e2b('0x42')]({'where':{'id':_0x6f8f68['params']['id']}})[_0x6e2b('0x23')](handleEntityNotFound(_0x556edd,null))['then'](saveUpdates(_0x6f8f68[_0x6e2b('0x45')],null))[_0x6e2b('0x23')](respondWithResult(_0x556edd,null))[_0x6e2b('0x40')](handleError(_0x556edd,null));};exports[_0x6e2b('0x24')]=function(_0x4bdcb9,_0x4731ca){return db[_0x6e2b('0x3b')]['find']({'where':{'id':_0x4bdcb9[_0x6e2b('0x46')]['id']}})[_0x6e2b('0x23')](handleEntityNotFound(_0x4731ca,null))[_0x6e2b('0x23')](removeEntity(_0x4731ca,null))[_0x6e2b('0x40')](handleError(_0x4731ca,null));};exports['bulkDestroy']=function(_0x57c9e9,_0x152663){return db[_0x6e2b('0x3b')][_0x6e2b('0x24')]({'where':{'id':_0x57c9e9['query'][_0x6e2b('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x6e2b('0x23')](respondWithResult(_0x152663,0xcc))[_0x6e2b('0x40')](handleError(_0x152663,null));};exports['addFields']=function(_0x5538d9,_0x285530,_0x371218){return db[_0x6e2b('0x48')]['findOne']({'where':{'id':_0x5538d9[_0x6e2b('0x46')]['id']}})[_0x6e2b('0x23')](handleEntityNotFound(_0x285530,null))[_0x6e2b('0x23')](function(_0x2769e6){if(_0x2769e6){return db['sequelize'][_0x6e2b('0x49')](function(_0x4ef055){return db['AnalyticFieldReport'][_0x6e2b('0x24')]({'where':{'CustomReportId':_0x5538d9[_0x6e2b('0x46')]['id']},'transaction':_0x4ef055})['then'](function(_0x1b2c3b){var _0x355d84=_['map'](_0x5538d9[_0x6e2b('0x45')],function(_0x276fe0){delete _0x276fe0['id'];_0x276fe0[_0x6e2b('0x4a')]=_0x5538d9['params']['id'];return _0x276fe0;});return db[_0x6e2b('0x3b')][_0x6e2b('0x44')](_0x355d84,{'transaction':_0x4ef055});});})[_0x6e2b('0x23')](function(){return db[_0x6e2b('0x3b')][_0x6e2b('0x3e')]({'where':{'CustomReportId':_0x5538d9[_0x6e2b('0x46')]['id']}});});}})[_0x6e2b('0x23')](respondWithResult(_0x285530,null))[_0x6e2b('0x40')](handleError(_0x285530,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3129142..26eee76 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 _0xe0a2=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe0a2,0x155));var _0x2e0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2e0a('0x0'));var util=require(_0x2e0a('0x1'));var logger=require(_0x2e0a('0x2'))('api');var moment=require(_0x2e0a('0x3'));var BPromise=require(_0x2e0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e0a('0x5'));var rimraf=require('rimraf');var config=require(_0x2e0a('0x6'));var attributes=require(_0x2e0a('0x7'));module[_0x2e0a('0x8')]=function(_0x32a4bd,_0xdded2a){return _0x32a4bd['define'](_0x2e0a('0x9'),attributes,{'tableName':_0x2e0a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad80=['util','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash'];(function(_0x2876f9,_0x4e9922){var _0x2d37cb=function(_0x6e9c42){while(--_0x6e9c42){_0x2876f9['push'](_0x2876f9['shift']());}};_0x2d37cb(++_0x4e9922);}(_0xad80,0x9f));var _0x0ad8=function(_0x241480,_0x47de78){_0x241480=_0x241480-0x0;var _0x181e8d=_0xad80[_0x241480];return _0x181e8d;};'use strict';var _=require(_0x0ad8('0x0'));var util=require(_0x0ad8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0ad8('0x2'));var BPromise=require(_0x0ad8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad8('0x4'));var rimraf=require(_0x0ad8('0x5'));var config=require(_0x0ad8('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x0ad8('0x7')]=function(_0x558a21,_0x19ca36){return _0x558a21[_0x0ad8('0x8')](_0x0ad8('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 8da4975..d82a54c 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 _0xe402=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x42aff9,_0xe4fd11){var _0xa54edd=function(_0x2d3190){while(--_0x2d3190){_0x42aff9['push'](_0x42aff9['shift']());}};_0xa54edd(++_0xe4fd11);}(_0xe402,0x1c5));var _0x2e40=function(_0x2aecf8,_0x22eef6){_0x2aecf8=_0x2aecf8-0x0;var _0x36b77=_0xe402[_0x2aecf8];return _0x36b77;};'use strict';var _=require(_0x2e40('0x0'));var util=require(_0x2e40('0x1'));var moment=require(_0x2e40('0x2'));var BPromise=require(_0x2e40('0x3'));var rs=require(_0x2e40('0x4'));var fs=require('fs');var Redis=require(_0x2e40('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e40('0x6'));var logger=require(_0x2e40('0x7'))('rpc');var config=require(_0x2e40('0x8'));var jayson=require(_0x2e40('0x9'));var client=jayson['client'][_0x2e40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415f63,_0x2345b1,_0x35ce24){return new BPromise(function(_0x59680a,_0x4f745f){return client[_0x2e40('0xb')](_0x415f63,_0x35ce24)[_0x2e40('0xc')](function(_0x1a4a68){logger[_0x2e40('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x2e40('0xe'));logger[_0x2e40('0xf')](_0x2e40('0x10'),_0x2345b1,_0x2e40('0xe'),JSON[_0x2e40('0x11')](_0x1a4a68));if(_0x1a4a68[_0x2e40('0x12')]){if(_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x13')]===0x1f4){logger['error'](_0x2e40('0x14'),_0x2345b1,_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);return _0x4f745f(_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);return _0x59680a(_0x1a4a68[_0x2e40('0x12')]['message']);}else{logger[_0x2e40('0xd')](_0x2e40('0x14'),_0x2345b1,_0x2e40('0xe'));_0x59680a(_0x1a4a68[_0x2e40('0x16')][_0x2e40('0x15')]);}})[_0x2e40('0x17')](function(_0x16f983){logger[_0x2e40('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x16f983);_0x4f745f(_0x16f983);});});}
\ No newline at end of file
+var _0xfe9e=['code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x477b74,_0x28657a){var _0x43cc4f=function(_0x33f74e){while(--_0x33f74e){_0x477b74['push'](_0x477b74['shift']());}};_0x43cc4f(++_0x28657a);}(_0xfe9e,0x1cf));var _0xefe9=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0xfe9e[_0x4ccf96];return _0xd103b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xefe9('0x0'));var BPromise=require(_0xefe9('0x1'));var rs=require(_0xefe9('0x2'));var fs=require('fs');var Redis=require(_0xefe9('0x3'));var db=require(_0xefe9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xefe9('0x5'))(_0xefe9('0x6'));var config=require(_0xefe9('0x7'));var jayson=require(_0xefe9('0x8'));var client=jayson['client'][_0xefe9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5caf72,_0x11b4f9,_0x1eb644){return new BPromise(function(_0x317a6c,_0xe21239){return client[_0xefe9('0xa')](_0x5caf72,_0x1eb644)['then'](function(_0x26701b){logger[_0xefe9('0xb')](_0xefe9('0xc'),_0x11b4f9,_0xefe9('0xd'));logger['debug'](_0xefe9('0xe'),_0x11b4f9,_0xefe9('0xd'),JSON[_0xefe9('0xf')](_0x26701b));if(_0x26701b[_0xefe9('0x10')]){if(_0x26701b[_0xefe9('0x10')][_0xefe9('0x11')]===0x1f4){logger[_0xefe9('0x10')](_0xefe9('0xc'),_0x11b4f9,_0x26701b[_0xefe9('0x10')]['message']);return _0xe21239(_0x26701b['error'][_0xefe9('0x12')]);}logger['error'](_0xefe9('0xc'),_0x11b4f9,_0x26701b[_0xefe9('0x10')][_0xefe9('0x12')]);return _0x317a6c(_0x26701b[_0xefe9('0x10')][_0xefe9('0x12')]);}else{logger[_0xefe9('0xb')](_0xefe9('0xc'),_0x11b4f9,_0xefe9('0xd'));_0x317a6c(_0x26701b['result']['message']);}})[_0xefe9('0x13')](function(_0x201c20){logger[_0xefe9('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x11b4f9,_0x201c20);_0xe21239(_0x201c20);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 799779c..c720b49 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(_0x5dcfe2,_0x397a20){var _0x373e3a=function(_0x54e6d7){while(--_0x54e6d7){_0x5dcfe2['push'](_0x5dcfe2['shift']());}};_0x373e3a(++_0x397a20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 ff25487..4f4d9b0 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 _0x9a1b=['TEXT','sequelize','STRING'];(function(_0x1bef23,_0x331853){var _0x2c0295=function(_0x1613eb){while(--_0x1613eb){_0x1bef23['push'](_0x1bef23['shift']());}};_0x2c0295(++_0x331853);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x293181,_0x1f01ae){_0x293181=_0x293181-0x0;var _0x20680b=_0x9a1b[_0x293181];return _0x20680b;};'use strict';var Sequelize=require(_0xb9a1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xb9a1('0x1')]},'metric':{'type':Sequelize[_0xb9a1('0x2')]},'description':{'type':Sequelize[_0xb9a1('0x1')]}};
\ No newline at end of file
+var _0xd404=['exports','name','STRING','sequelize'];(function(_0x2580dd,_0x4d6507){var _0x39de0c=function(_0x4b8992){while(--_0x4b8992){_0x2580dd['push'](_0x2580dd['shift']());}};_0x39de0c(++_0x4d6507);}(_0xd404,0x15b));var _0x4d40=function(_0x1ba4d1,_0x54fd0e){_0x1ba4d1=_0x1ba4d1-0x0;var _0x29a4a5=_0xd404[_0x1ba4d1];return _0x29a4a5;};'use strict';var Sequelize=require(_0x4d40('0x0'));module[_0x4d40('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d40('0x2')},'table':{'type':Sequelize[_0x4d40('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x4d40('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index abbbc49..18f7fb5 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x20c993,_0xca841c){var _0x3fc1e2=function(_0x1e134f){while(--_0x1e134f){_0x20c993['push'](_0x20c993['shift']());}};_0x3fc1e2(++_0xca841c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xe445b3,_0x26ae0c){_0xe445b3=_0xe445b3-0x0;var _0x266a98=_0x9c5a[_0xe445b3];return _0x266a98;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x4d9470,_0x1e85a3){var _0x2ab521=function(_0x46e8ba){while(--_0x46e8ba){_0x4d9470['push'](_0x4d9470['shift']());}};_0x2ab521(++_0x1e85a3);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 391a13a..673f882 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 _0x22da=['moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','../../config/logger','api'];(function(_0x2266e6,_0x1c781f){var _0x346c55=function(_0x43bc56){while(--_0x43bc56){_0x2266e6['push'](_0x2266e6['shift']());}};_0x346c55(++_0x1c781f);}(_0x22da,0x80));var _0xa22d=function(_0x247aa1,_0x33fd7b){_0x247aa1=_0x247aa1-0x0;var _0x433190=_0x22da[_0x247aa1];return _0x433190;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa22d('0x0'))(_0xa22d('0x1'));var moment=require(_0xa22d('0x2'));var BPromise=require(_0xa22d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa22d('0x4'));var rimraf=require(_0xa22d('0x5'));var config=require(_0xa22d('0x6'));var attributes=require(_0xa22d('0x7'));module['exports']=function(_0x4007bd,_0x9bc0eb){return _0x4007bd['define'](_0xa22d('0x8'),attributes,{'tableName':_0xa22d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6455=['request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5acd1e,_0x2267b9){var _0x164688=function(_0xc67557){while(--_0xc67557){_0x5acd1e['push'](_0x5acd1e['shift']());}};_0x164688(++_0x2267b9);}(_0x6455,0x97));var _0x5645=function(_0xdf1738,_0x5456ea){_0xdf1738=_0xdf1738-0x0;var _0x15092e=_0x6455[_0xdf1738];return _0x15092e;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'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 530dead..bf8f571 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 _0xa30d=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3f404d,_0x4210a8){var _0x3a267d=function(_0x8a6881){while(--_0x8a6881){_0x3f404d['push'](_0x3f404d['shift']());}};_0x3a267d(++_0x4210a8);}(_0xa30d,0x115));var _0xda30=function(_0x447db1,_0x11030d){_0x447db1=_0x447db1-0x0;var _0x4269d5=_0xa30d[_0x447db1];return _0x4269d5;};'use strict';var _=require(_0xda30('0x0'));var util=require(_0xda30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda30('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda30('0x3'));var config=require(_0xda30('0x4'));var jayson=require(_0xda30('0x5'));var client=jayson[_0xda30('0x6')][_0xda30('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe150d7,_0x45a108,_0x54f520){return new BPromise(function(_0x4533d0,_0x269d31){return client['request'](_0xe150d7,_0x54f520)['then'](function(_0x33644a){logger[_0xda30('0x8')](_0xda30('0x9'),_0x45a108,_0xda30('0xa'));logger[_0xda30('0xb')](_0xda30('0xc'),_0x45a108,_0xda30('0xa'),JSON[_0xda30('0xd')](_0x33644a));if(_0x33644a[_0xda30('0xe')]){if(_0x33644a[_0xda30('0xe')][_0xda30('0xf')]===0x1f4){logger['error'](_0xda30('0x9'),_0x45a108,_0x33644a[_0xda30('0xe')][_0xda30('0x10')]);return _0x269d31(_0x33644a[_0xda30('0xe')]['message']);}logger['error'](_0xda30('0x9'),_0x45a108,_0x33644a[_0xda30('0xe')][_0xda30('0x10')]);return _0x4533d0(_0x33644a[_0xda30('0xe')]['message']);}else{logger[_0xda30('0x8')](_0xda30('0x9'),_0x45a108,'request\x20sent');_0x4533d0(_0x33644a[_0xda30('0x11')]['message']);}})['catch'](function(_0x3afab3){logger[_0xda30('0xe')](_0xda30('0x9'),_0x45a108,_0x3afab3);_0x269d31(_0x3afab3);});});}
\ No newline at end of file
+var _0x1c6a=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','bluebird','ioredis'];(function(_0x508c7b,_0x517d80){var _0xd25467=function(_0x40966b){while(--_0x40966b){_0x508c7b['push'](_0x508c7b['shift']());}};_0xd25467(++_0x517d80);}(_0x1c6a,0xb0));var _0xa1c6=function(_0x50cf08,_0x5eb8c5){_0x50cf08=_0x50cf08-0x0;var _0x23a9df=_0x1c6a[_0x50cf08];return _0x23a9df;};'use strict';var _=require(_0xa1c6('0x0'));var util=require(_0xa1c6('0x1'));var moment=require('moment');var BPromise=require(_0xa1c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1c6('0x3'));var db=require(_0xa1c6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa1c6('0x5'));var config=require(_0xa1c6('0x6'));var jayson=require(_0xa1c6('0x7'));var client=jayson['client'][_0xa1c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8a00,_0x3ef0d8,_0x800597){return new BPromise(function(_0x2e1691,_0x1b64bc){return client[_0xa1c6('0x9')](_0x2a8a00,_0x800597)[_0xa1c6('0xa')](function(_0x1837fa){logger['info'](_0xa1c6('0xb'),_0x3ef0d8,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3ef0d8,_0xa1c6('0xc'),JSON['stringify'](_0x1837fa));if(_0x1837fa['error']){if(_0x1837fa[_0xa1c6('0xd')]['code']===0x1f4){logger[_0xa1c6('0xd')](_0xa1c6('0xb'),_0x3ef0d8,_0x1837fa[_0xa1c6('0xd')][_0xa1c6('0xe')]);return _0x1b64bc(_0x1837fa['error'][_0xa1c6('0xe')]);}logger[_0xa1c6('0xd')](_0xa1c6('0xb'),_0x3ef0d8,_0x1837fa['error']['message']);return _0x2e1691(_0x1837fa['error'][_0xa1c6('0xe')]);}else{logger[_0xa1c6('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3ef0d8,_0xa1c6('0xc'));_0x2e1691(_0x1837fa[_0xa1c6('0x10')]['message']);}})[_0xa1c6('0x11')](function(_0x1ec5bd){logger[_0xa1c6('0xd')](_0xa1c6('0xb'),_0x3ef0d8,_0x1ec5bd);_0x1b64bc(_0x1ec5bd);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 37d4f20..c5dd67c 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 _0x5c1f=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x5c1f[_0x3f94f9];return _0x46f84f;};'use strict';var multer=require(_0xf5c1('0x0'));var util=require('util');var path=require(_0xf5c1('0x1'));var timeout=require(_0xf5c1('0x2'));var express=require('express');var router=express[_0xf5c1('0x3')]();var fs_extra=require(_0xf5c1('0x4'));var auth=require(_0xf5c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xf5c1('0x6')]('/',auth[_0xf5c1('0x7')](),controller['index']);router[_0xf5c1('0x6')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xa')]);router[_0xf5c1('0xb')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xc')]);module[_0xf5c1('0xd')]=router;
\ No newline at end of file
+var _0xf29c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf29c,0xc7));var _0xcf29=function(_0x45cec6,_0x2d2195){_0x45cec6=_0x45cec6-0x0;var _0x25710a=_0xf29c[_0x45cec6];return _0x25710a;};'use strict';var multer=require('multer');var util=require(_0xcf29('0x0'));var path=require(_0xcf29('0x1'));var timeout=require(_0xcf29('0x2'));var express=require(_0xcf29('0x3'));var router=express[_0xcf29('0x4')]();var fs_extra=require(_0xcf29('0x5'));var auth=require(_0xcf29('0x6'));var interaction=require(_0xcf29('0x7'));var config=require(_0xcf29('0x8'));var controller=require(_0xcf29('0x9'));router[_0xcf29('0xa')]('/',auth[_0xcf29('0xb')](),controller[_0xcf29('0xc')]);router[_0xcf29('0xa')](_0xcf29('0xd'),auth[_0xcf29('0xb')](),controller['show']);router['post']('/',auth[_0xcf29('0xb')](),controller[_0xcf29('0xe')]);router[_0xcf29('0xf')](_0xcf29('0xd'),auth[_0xcf29('0xb')](),controller[_0xcf29('0x10')]);router[_0xcf29('0x11')](_0xcf29('0xd'),auth[_0xcf29('0xb')](),controller[_0xcf29('0x12')]);module[_0xcf29('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index e2e08ef..677b49d 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 _0x6b19=['sequelize','exports'];(function(_0x204acd,_0x11f6f6){var _0x2bcf2e=function(_0x418400){while(--_0x418400){_0x204acd['push'](_0x204acd['shift']());}};_0x2bcf2e(++_0x11f6f6);}(_0x6b19,0xe8));var _0x96b1=function(_0x3a726f,_0x94d6c8){_0x3a726f=_0x3a726f-0x0;var _0x3fa939=_0x6b19[_0x3a726f];return _0x3fa939;};'use strict';var Sequelize=require(_0x96b1('0x0'));module[_0x96b1('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xd1ac=['exports','sequelize'];(function(_0x33498a,_0x34b9d1){var _0x37ac48=function(_0x3342c2){while(--_0x3342c2){_0x33498a['push'](_0x33498a['shift']());}};_0x37ac48(++_0x34b9d1);}(_0xd1ac,0x18d));var _0xcd1a=function(_0x59575d,_0x3c389b){_0x59575d=_0x59575d-0x0;var _0x4a6ad4=_0xd1ac[_0x59575d];return _0x4a6ad4;};'use strict';var Sequelize=require(_0xcd1a('0x0'));module[_0xcd1a('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 659e194..3e9ff0c 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 _0xfec1=['Content-Range','reject','save','update','then','end','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','rows','catch','show','params','keys','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfec1,0x196));var _0x1fec=function(_0x332888,_0x23d697){_0x332888=_0x332888-0x0;var _0x261dff=_0xfec1[_0x332888];return _0x261dff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fec('0x0'));var zipdir=require(_0x1fec('0x1'));var jsonpatch=require(_0x1fec('0x2'));var rp=require(_0x1fec('0x3'));var moment=require(_0x1fec('0x4'));var BPromise=require(_0x1fec('0x5'));var Mustache=require(_0x1fec('0x6'));var util=require(_0x1fec('0x7'));var path=require('path');var sox=require(_0x1fec('0x8'));var csv=require(_0x1fec('0x9'));var ejs=require(_0x1fec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fec('0xb'));var squel=require(_0x1fec('0xc'));var crypto=require('crypto');var jsforce=require(_0x1fec('0xd'));var deskjs=require(_0x1fec('0xe'));var toCsv=require(_0x1fec('0x9'));var querystring=require(_0x1fec('0xf'));var Papa=require(_0x1fec('0x10'));var Redis=require(_0x1fec('0x11'));var authService=require(_0x1fec('0x12'));var qs=require(_0x1fec('0x13'));var as=require(_0x1fec('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fec('0x15'));var utils=require(_0x1fec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1fec('0x17'));var db=require(_0x1fec('0x18'))['db'];function respondWithStatusCode(_0x5f3e7b,_0x45c8e1){_0x45c8e1=_0x45c8e1||0xcc;return function(_0x4b4891){if(_0x4b4891){return _0x5f3e7b[_0x1fec('0x19')](_0x45c8e1);}return _0x5f3e7b[_0x1fec('0x1a')](_0x45c8e1)['end']();};}function respondWithResult(_0x238f49,_0x354919){_0x354919=_0x354919||0xc8;return function(_0x253264){if(_0x253264){return _0x238f49[_0x1fec('0x1a')](_0x354919)[_0x1fec('0x1b')](_0x253264);}};}function respondWithFilteredResult(_0x24d04e,_0x285672){return function(_0x56a777){if(_0x56a777){var _0x231576=typeof _0x285672[_0x1fec('0x1c')]===_0x1fec('0x1d')&&typeof _0x285672[_0x1fec('0x1e')]===_0x1fec('0x1d');var _0x5210b1=_0x56a777[_0x1fec('0x1f')];var _0x312d82=_0x231576?0x0:_0x285672['offset'];var _0x198f57=_0x231576?_0x56a777[_0x1fec('0x1f')]:_0x285672[_0x1fec('0x1c')]+_0x285672[_0x1fec('0x1e')];var _0x1b90a2;if(_0x198f57>=_0x5210b1){_0x198f57=_0x5210b1;_0x1b90a2=0xc8;}else{_0x1b90a2=0xce;}_0x24d04e[_0x1fec('0x1a')](_0x1b90a2);return _0x24d04e['set'](_0x1fec('0x20'),_0x312d82+'-'+_0x198f57+'/'+_0x5210b1)['json'](_0x56a777);}return null;};}function patchUpdates(_0x52215a){return function(_0x416da5){try{jsonpatch['apply'](_0x416da5,_0x52215a,!![]);}catch(_0x3bc737){return BPromise[_0x1fec('0x21')](_0x3bc737);}return _0x416da5[_0x1fec('0x22')]();};}function saveUpdates(_0x17fda0,_0x3cc32f){return function(_0x4f5b09){if(_0x4f5b09){return _0x4f5b09[_0x1fec('0x23')](_0x17fda0)[_0x1fec('0x24')](function(_0x5c2e60){return _0x5c2e60;});}return null;};}function removeEntity(_0x1570d3,_0x568e51){return function(_0x538fc1){if(_0x538fc1){return _0x538fc1['destroy']()[_0x1fec('0x24')](function(){_0x1570d3['status'](0xcc)[_0x1fec('0x25')]();});}};}function handleEntityNotFound(_0x525055,_0x3ea836){return function(_0x5b42c6){if(!_0x5b42c6){_0x525055['sendStatus'](0x194);}return _0x5b42c6;};}function handleError(_0x4bb3c2,_0x3d3f9e){_0x3d3f9e=_0x3d3f9e||0x1f4;return function(_0x330279){logger[_0x1fec('0x26')](_0x330279['stack']);if(_0x330279['name']){delete _0x330279['name'];}_0x4bb3c2['status'](_0x3d3f9e)[_0x1fec('0x27')](_0x330279);};}exports[_0x1fec('0x28')]=function(_0x4a7755,_0x6580f1){var _0x32e556={},_0x551df3={},_0x1750b7={'count':0x0,'rows':[]};var _0x2597ee=_[_0x1fec('0x29')](db['AnalyticTreeReport'][_0x1fec('0x2a')],function(_0x13d9d0){return{'name':_0x13d9d0[_0x1fec('0x2b')],'type':_0x13d9d0[_0x1fec('0x2c')][_0x1fec('0x2d')]};});_0x551df3[_0x1fec('0x2e')]=_[_0x1fec('0x29')](_0x2597ee,_0x1fec('0x2f'));_0x551df3[_0x1fec('0x30')]=_['keys'](_0x4a7755[_0x1fec('0x30')]);_0x551df3['filters']=_['intersection'](_0x551df3[_0x1fec('0x2e')],_0x551df3['query']);_0x32e556[_0x1fec('0x31')]=_[_0x1fec('0x32')](_0x551df3[_0x1fec('0x2e')],qs['fields'](_0x4a7755[_0x1fec('0x30')][_0x1fec('0x33')]));_0x32e556[_0x1fec('0x31')]=_0x32e556[_0x1fec('0x31')][_0x1fec('0x34')]?_0x32e556['attributes']:_0x551df3['model'];if(!_0x4a7755[_0x1fec('0x30')][_0x1fec('0x35')]('nolimit')){_0x32e556[_0x1fec('0x1e')]=qs[_0x1fec('0x1e')](_0x4a7755['query'][_0x1fec('0x1e')]);_0x32e556[_0x1fec('0x1c')]=qs[_0x1fec('0x1c')](_0x4a7755[_0x1fec('0x30')][_0x1fec('0x1c')]);}_0x32e556[_0x1fec('0x36')]=qs[_0x1fec('0x37')](_0x4a7755[_0x1fec('0x30')]['sort']);_0x32e556[_0x1fec('0x38')]=qs[_0x1fec('0x39')](_['pick'](_0x4a7755[_0x1fec('0x30')],_0x551df3[_0x1fec('0x39')]),_0x2597ee);if(_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3a')]){_0x32e556[_0x1fec('0x38')]=_[_0x1fec('0x3b')](_0x32e556[_0x1fec('0x38')],{'$or':_[_0x1fec('0x29')](_0x2597ee,function(_0x3d19f){if(_0x3d19f[_0x1fec('0x2c')]!==_0x1fec('0x3c')){var _0x21a56d={};_0x21a56d[_0x3d19f[_0x1fec('0x2f')]]={'$like':'%'+_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3a')]+'%'};return _0x21a56d;}})});}_0x32e556=_[_0x1fec('0x3b')]({},_0x32e556,_0x4a7755['options']);var _0x17aa2c={'where':_0x32e556[_0x1fec('0x38')]};return db['AnalyticTreeReport'][_0x1fec('0x1f')](_0x17aa2c)[_0x1fec('0x24')](function(_0x3a924c){_0x1750b7[_0x1fec('0x1f')]=_0x3a924c;if(_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3d')]){_0x32e556[_0x1fec('0x3e')]=[{'all':!![]}];}return db[_0x1fec('0x3f')]['findAll'](_0x32e556);})['then'](function(_0x58f4fb){_0x1750b7[_0x1fec('0x40')]=_0x58f4fb;return _0x1750b7;})[_0x1fec('0x24')](respondWithFilteredResult(_0x6580f1,_0x32e556))[_0x1fec('0x41')](handleError(_0x6580f1,null));};exports[_0x1fec('0x42')]=function(_0x2b0449,_0x345dc0){var _0x2a2b37={'raw':!![],'where':{'id':_0x2b0449[_0x1fec('0x43')]['id']}},_0x44f6c7={};_0x44f6c7[_0x1fec('0x2e')]=_[_0x1fec('0x44')](db[_0x1fec('0x3f')]['rawAttributes']);_0x44f6c7['query']=_['keys'](_0x2b0449[_0x1fec('0x30')]);_0x44f6c7[_0x1fec('0x39')]=_[_0x1fec('0x32')](_0x44f6c7[_0x1fec('0x2e')],_0x44f6c7[_0x1fec('0x30')]);_0x2a2b37[_0x1fec('0x31')]=_['intersection'](_0x44f6c7[_0x1fec('0x2e')],qs[_0x1fec('0x33')](_0x2b0449[_0x1fec('0x30')][_0x1fec('0x33')]));_0x2a2b37['attributes']=_0x2a2b37[_0x1fec('0x31')]['length']?_0x2a2b37[_0x1fec('0x31')]:_0x44f6c7[_0x1fec('0x2e')];if(_0x2b0449[_0x1fec('0x30')][_0x1fec('0x3d')]){_0x2a2b37['include']=[{'all':!![]}];}_0x2a2b37=_[_0x1fec('0x3b')]({},_0x2a2b37,_0x2b0449['options']);return db[_0x1fec('0x3f')][_0x1fec('0x45')](_0x2a2b37)[_0x1fec('0x24')](handleEntityNotFound(_0x345dc0,null))['then'](respondWithResult(_0x345dc0,null))[_0x1fec('0x41')](handleError(_0x345dc0,null));};exports[_0x1fec('0x46')]=function(_0x456625,_0x1863d3){return db['AnalyticTreeReport'][_0x1fec('0x46')](_0x456625[_0x1fec('0x47')],{})['then'](respondWithResult(_0x1863d3,0xc9))[_0x1fec('0x41')](handleError(_0x1863d3,null));};exports['update']=function(_0x2f2c10,_0x214fe5){if(_0x2f2c10['body']['id']){delete _0x2f2c10[_0x1fec('0x47')]['id'];}return db[_0x1fec('0x3f')][_0x1fec('0x45')]({'where':{'id':_0x2f2c10[_0x1fec('0x43')]['id']}})[_0x1fec('0x24')](handleEntityNotFound(_0x214fe5,null))[_0x1fec('0x24')](saveUpdates(_0x2f2c10[_0x1fec('0x47')],null))[_0x1fec('0x24')](respondWithResult(_0x214fe5,null))[_0x1fec('0x41')](handleError(_0x214fe5,null));};exports[_0x1fec('0x48')]=function(_0x358a98,_0x13b359){return db[_0x1fec('0x3f')][_0x1fec('0x45')]({'where':{'id':_0x358a98[_0x1fec('0x43')]['id']}})[_0x1fec('0x24')](handleEntityNotFound(_0x13b359,null))[_0x1fec('0x24')](removeEntity(_0x13b359,null))[_0x1fec('0x41')](handleError(_0x13b359,null));};
\ No newline at end of file
+var _0xf360=['rimraf','zip-dir','fast-json-patch','mustache','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','update','body','eml-format'];(function(_0x4c5561,_0x36eae8){var _0x5b91f9=function(_0x19a73c){while(--_0x19a73c){_0x4c5561['push'](_0x4c5561['shift']());}};_0x5b91f9(++_0x36eae8);}(_0xf360,0x158));var _0x0f36=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf360[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x0f36('0x0'));var rimraf=require(_0x0f36('0x1'));var zipdir=require(_0x0f36('0x2'));var jsonpatch=require(_0x0f36('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f36('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0f36('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f36('0x6'));var _=require(_0x0f36('0x7'));var squel=require(_0x0f36('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f36('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0f36('0xa'));var Papa=require(_0x0f36('0xb'));var Redis=require(_0x0f36('0xc'));var authService=require(_0x0f36('0xd'));var qs=require(_0x0f36('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f36('0xf'))(_0x0f36('0x10'));var utils=require(_0x0f36('0x11'));var config=require(_0x0f36('0x12'));var licenseUtil=require(_0x0f36('0x13'));var db=require(_0x0f36('0x14'))['db'];function respondWithStatusCode(_0x5cf325,_0x18cbe4){_0x18cbe4=_0x18cbe4||0xcc;return function(_0x347a02){if(_0x347a02){return _0x5cf325[_0x0f36('0x15')](_0x18cbe4);}return _0x5cf325[_0x0f36('0x16')](_0x18cbe4)[_0x0f36('0x17')]();};}function respondWithResult(_0x288491,_0x412698){_0x412698=_0x412698||0xc8;return function(_0x255d4b){if(_0x255d4b){return _0x288491[_0x0f36('0x16')](_0x412698)[_0x0f36('0x18')](_0x255d4b);}};}function respondWithFilteredResult(_0xb81f77,_0xf3d8bd){return function(_0x21671b){if(_0x21671b){var _0x1fc4b1=typeof _0xf3d8bd[_0x0f36('0x19')]==='undefined'&&typeof _0xf3d8bd[_0x0f36('0x1a')]==='undefined';var _0x325ea7=_0x21671b[_0x0f36('0x1b')];var _0x293661=_0x1fc4b1?0x0:_0xf3d8bd['offset'];var _0x39d541=_0x1fc4b1?_0x21671b['count']:_0xf3d8bd[_0x0f36('0x19')]+_0xf3d8bd['limit'];var _0x5b0276;if(_0x39d541>=_0x325ea7){_0x39d541=_0x325ea7;_0x5b0276=0xc8;}else{_0x5b0276=0xce;}_0xb81f77[_0x0f36('0x16')](_0x5b0276);return _0xb81f77['set'](_0x0f36('0x1c'),_0x293661+'-'+_0x39d541+'/'+_0x325ea7)[_0x0f36('0x18')](_0x21671b);}return null;};}function patchUpdates(_0x5c54e7){return function(_0x159fad){try{jsonpatch[_0x0f36('0x1d')](_0x159fad,_0x5c54e7,!![]);}catch(_0x232b45){return BPromise[_0x0f36('0x1e')](_0x232b45);}return _0x159fad['save']();};}function saveUpdates(_0x308d5c,_0x369e59){return function(_0x302775){if(_0x302775){return _0x302775['update'](_0x308d5c)[_0x0f36('0x1f')](function(_0x59b77f){return _0x59b77f;});}return null;};}function removeEntity(_0x655c80,_0x47603a){return function(_0x5caa74){if(_0x5caa74){return _0x5caa74[_0x0f36('0x20')]()[_0x0f36('0x1f')](function(){_0x655c80[_0x0f36('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1d03,_0xe85a53){return function(_0x4e246c){if(!_0x4e246c){_0x2d1d03[_0x0f36('0x15')](0x194);}return _0x4e246c;};}function handleError(_0x4a6d5d,_0x3101d0){_0x3101d0=_0x3101d0||0x1f4;return function(_0x2f2570){logger[_0x0f36('0x21')](_0x2f2570[_0x0f36('0x22')]);if(_0x2f2570[_0x0f36('0x23')]){delete _0x2f2570[_0x0f36('0x23')];}_0x4a6d5d[_0x0f36('0x16')](_0x3101d0)['send'](_0x2f2570);};}exports[_0x0f36('0x24')]=function(_0x1a7bcc,_0x340809){var _0x6ba308={},_0xf45b9={},_0x26c4ff={'count':0x0,'rows':[]};var _0x4b6e83=_[_0x0f36('0x25')](db[_0x0f36('0x26')][_0x0f36('0x27')],function(_0x267385){return{'name':_0x267385[_0x0f36('0x28')],'type':_0x267385['type'][_0x0f36('0x29')]};});_0xf45b9[_0x0f36('0x2a')]=_[_0x0f36('0x25')](_0x4b6e83,_0x0f36('0x23'));_0xf45b9[_0x0f36('0x2b')]=_[_0x0f36('0x2c')](_0x1a7bcc[_0x0f36('0x2b')]);_0xf45b9['filters']=_[_0x0f36('0x2d')](_0xf45b9[_0x0f36('0x2a')],_0xf45b9[_0x0f36('0x2b')]);_0x6ba308['attributes']=_[_0x0f36('0x2d')](_0xf45b9[_0x0f36('0x2a')],qs[_0x0f36('0x2e')](_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x2e')]));_0x6ba308[_0x0f36('0x2f')]=_0x6ba308[_0x0f36('0x2f')][_0x0f36('0x30')]?_0x6ba308[_0x0f36('0x2f')]:_0xf45b9[_0x0f36('0x2a')];if(!_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x31')](_0x0f36('0x32'))){_0x6ba308[_0x0f36('0x1a')]=qs['limit'](_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x1a')]);_0x6ba308['offset']=qs[_0x0f36('0x19')](_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x19')]);}_0x6ba308[_0x0f36('0x33')]=qs['sort'](_0x1a7bcc[_0x0f36('0x2b')]['sort']);_0x6ba308[_0x0f36('0x34')]=qs[_0x0f36('0x35')](_['pick'](_0x1a7bcc['query'],_0xf45b9[_0x0f36('0x35')]),_0x4b6e83);if(_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x36')]){_0x6ba308[_0x0f36('0x34')]=_[_0x0f36('0x37')](_0x6ba308[_0x0f36('0x34')],{'$or':_[_0x0f36('0x25')](_0x4b6e83,function(_0x45ede8){if(_0x45ede8['type']!==_0x0f36('0x38')){var _0x303a23={};_0x303a23[_0x45ede8[_0x0f36('0x23')]]={'$like':'%'+_0x1a7bcc[_0x0f36('0x2b')][_0x0f36('0x36')]+'%'};return _0x303a23;}})});}_0x6ba308=_[_0x0f36('0x37')]({},_0x6ba308,_0x1a7bcc[_0x0f36('0x39')]);var _0xcb7daa={'where':_0x6ba308['where']};return db[_0x0f36('0x26')][_0x0f36('0x1b')](_0xcb7daa)['then'](function(_0x5ba2c4){_0x26c4ff['count']=_0x5ba2c4;if(_0x1a7bcc[_0x0f36('0x2b')]['includeAll']){_0x6ba308['include']=[{'all':!![]}];}return db[_0x0f36('0x26')][_0x0f36('0x3a')](_0x6ba308);})[_0x0f36('0x1f')](function(_0x21420e){_0x26c4ff[_0x0f36('0x3b')]=_0x21420e;return _0x26c4ff;})['then'](respondWithFilteredResult(_0x340809,_0x6ba308))[_0x0f36('0x3c')](handleError(_0x340809,null));};exports[_0x0f36('0x3d')]=function(_0x4072a4,_0x9efdfa){var _0x114f35={'raw':!![],'where':{'id':_0x4072a4[_0x0f36('0x3e')]['id']}},_0x4ac12e={};_0x4ac12e[_0x0f36('0x2a')]=_[_0x0f36('0x2c')](db['AnalyticTreeReport'][_0x0f36('0x27')]);_0x4ac12e[_0x0f36('0x2b')]=_['keys'](_0x4072a4[_0x0f36('0x2b')]);_0x4ac12e[_0x0f36('0x35')]=_[_0x0f36('0x2d')](_0x4ac12e[_0x0f36('0x2a')],_0x4ac12e['query']);_0x114f35['attributes']=_[_0x0f36('0x2d')](_0x4ac12e[_0x0f36('0x2a')],qs['fields'](_0x4072a4['query'][_0x0f36('0x2e')]));_0x114f35[_0x0f36('0x2f')]=_0x114f35[_0x0f36('0x2f')][_0x0f36('0x30')]?_0x114f35[_0x0f36('0x2f')]:_0x4ac12e[_0x0f36('0x2a')];if(_0x4072a4[_0x0f36('0x2b')][_0x0f36('0x3f')]){_0x114f35[_0x0f36('0x40')]=[{'all':!![]}];}_0x114f35=_[_0x0f36('0x37')]({},_0x114f35,_0x4072a4['options']);return db[_0x0f36('0x26')][_0x0f36('0x41')](_0x114f35)['then'](handleEntityNotFound(_0x9efdfa,null))[_0x0f36('0x1f')](respondWithResult(_0x9efdfa,null))[_0x0f36('0x3c')](handleError(_0x9efdfa,null));};exports[_0x0f36('0x42')]=function(_0x12835f,_0x2f5dda){return db[_0x0f36('0x26')][_0x0f36('0x42')](_0x12835f['body'],{})['then'](respondWithResult(_0x2f5dda,0xc9))[_0x0f36('0x3c')](handleError(_0x2f5dda,null));};exports[_0x0f36('0x43')]=function(_0x3e24ef,_0x335409){if(_0x3e24ef[_0x0f36('0x44')]['id']){delete _0x3e24ef[_0x0f36('0x44')]['id'];}return db[_0x0f36('0x26')][_0x0f36('0x41')]({'where':{'id':_0x3e24ef[_0x0f36('0x3e')]['id']}})[_0x0f36('0x1f')](handleEntityNotFound(_0x335409,null))[_0x0f36('0x1f')](saveUpdates(_0x3e24ef[_0x0f36('0x44')],null))[_0x0f36('0x1f')](respondWithResult(_0x335409,null))[_0x0f36('0x3c')](handleError(_0x335409,null));};exports[_0x0f36('0x20')]=function(_0x3d6525,_0x3687ca){return db[_0x0f36('0x26')][_0x0f36('0x41')]({'where':{'id':_0x3d6525[_0x0f36('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3687ca,null))[_0x0f36('0x1f')](removeEntity(_0x3687ca,null))[_0x0f36('0x3c')](handleError(_0x3687ca,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index af06683..afe8d45 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 _0x62c8=['../../config/logger','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x2c4102,_0x192c7f){var _0x52e02c=function(_0x526df7){while(--_0x526df7){_0x2c4102['push'](_0x2c4102['shift']());}};_0x52e02c(++_0x192c7f);}(_0x62c8,0x169));var _0x862c=function(_0x374a81,_0x571052){_0x374a81=_0x374a81-0x0;var _0x50f580=_0x62c8[_0x374a81];return _0x50f580;};'use strict';var _=require(_0x862c('0x0'));var util=require(_0x862c('0x1'));var logger=require(_0x862c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x862c('0x3'));var rp=require(_0x862c('0x4'));var fs=require('fs');var path=require(_0x862c('0x5'));var rimraf=require(_0x862c('0x6'));var config=require('../../config/environment');var attributes=require(_0x862c('0x7'));module[_0x862c('0x8')]=function(_0x5b6067,_0xdc07c3){return _0x5b6067['define'](_0x862c('0x9'),attributes,{'tableName':_0x862c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x358b=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0x358b,0x140));var _0xb358=function(_0xdf4cdb,_0x4407ff){_0xdf4cdb=_0xdf4cdb-0x0;var _0x256475=_0x358b[_0xdf4cdb];return _0x256475;};'use strict';var _=require(_0xb358('0x0'));var util=require(_0xb358('0x1'));var logger=require(_0xb358('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb358('0x3'));var rp=require(_0xb358('0x4'));var fs=require('fs');var path=require(_0xb358('0x5'));var rimraf=require(_0xb358('0x6'));var config=require(_0xb358('0x7'));var attributes=require(_0xb358('0x8'));module[_0xb358('0x9')]=function(_0x2792c3,_0x1eb194){return _0x2792c3[_0xb358('0xa')](_0xb358('0xb'),attributes,{'tableName':_0xb358('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ff0ac7d..15304b5 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2f1ac4,_0x236a72){var _0x18e1a5=function(_0x18f34b){while(--_0x18f34b){_0x2f1ac4['push'](_0x2f1ac4['shift']());}};_0x18e1a5(++_0x236a72);}(_0x2ef3,0xba));var _0x32ef=function(_0x2af6fd,_0xb2798d){_0x2af6fd=_0x2af6fd-0x0;var _0x2da8d9=_0x2ef3[_0x2af6fd];return _0x2da8d9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xd4fb2,_0x436540){var _0x81fc39=function(_0x494802){while(--_0x494802){_0xd4fb2['push'](_0xd4fb2['shift']());}};_0x81fc39(++_0x436540);}(_0x5f2f,0x73));var _0xf5f2=function(_0x873500,_0x3f8480){_0x873500=_0x873500-0x0;var _0x5eedcb=_0x5f2f[_0x873500];return _0x5eedcb;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 1329ae2..56da71f 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 _0xc4a8=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post'];(function(_0x2d033d,_0x5bf31a){var _0x36ea6c=function(_0x22f07f){while(--_0x22f07f){_0x2d033d['push'](_0x2d033d['shift']());}};_0x36ea6c(++_0x5bf31a);}(_0xc4a8,0x193));var _0x8c4a=function(_0x346b92,_0x286185){_0x346b92=_0x346b92-0x0;var _0x5a8e1c=_0xc4a8[_0x346b92];return _0x5a8e1c;};'use strict';var multer=require(_0x8c4a('0x0'));var util=require(_0x8c4a('0x1'));var path=require(_0x8c4a('0x2'));var timeout=require(_0x8c4a('0x3'));var express=require(_0x8c4a('0x4'));var router=express[_0x8c4a('0x5')]();var fs_extra=require(_0x8c4a('0x6'));var auth=require(_0x8c4a('0x7'));var interaction=require(_0x8c4a('0x8'));var config=require(_0x8c4a('0x9'));var controller=require(_0x8c4a('0xa'));router[_0x8c4a('0xb')]('/',auth[_0x8c4a('0xc')](),controller['index']);router['get'](_0x8c4a('0xd'),auth[_0x8c4a('0xc')](),controller['show']);router[_0x8c4a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c4a('0xf')](_0x8c4a('0xd'),auth[_0x8c4a('0xc')](),controller[_0x8c4a('0x10')]);router['delete']('/:id',auth[_0x8c4a('0xc')](),controller[_0x8c4a('0x11')]);module[_0x8c4a('0x12')]=router;
\ No newline at end of file
+var _0x460c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x460c,0x160));var _0xc460=function(_0x24a6da,_0x3f7abe){_0x24a6da=_0x24a6da-0x0;var _0x1f19e6=_0x460c[_0x24a6da];return _0x1f19e6;};'use strict';var multer=require(_0xc460('0x0'));var util=require(_0xc460('0x1'));var path=require(_0xc460('0x2'));var timeout=require(_0xc460('0x3'));var express=require(_0xc460('0x4'));var router=express[_0xc460('0x5')]();var fs_extra=require(_0xc460('0x6'));var auth=require(_0xc460('0x7'));var interaction=require(_0xc460('0x8'));var config=require(_0xc460('0x9'));var controller=require(_0xc460('0xa'));router[_0xc460('0xb')]('/',auth[_0xc460('0xc')](),controller[_0xc460('0xd')]);router[_0xc460('0xb')](_0xc460('0xe'),auth[_0xc460('0xc')](),controller[_0xc460('0xf')]);router['post']('/',auth[_0xc460('0xc')](),controller[_0xc460('0x10')]);router['put'](_0xc460('0xe'),auth['isAuthenticated'](),controller[_0xc460('0x11')]);router[_0xc460('0x12')](_0xc460('0xe'),auth['isAuthenticated'](),controller[_0xc460('0x13')]);module[_0xc460('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 279c896..a96ea1c 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 _0x8bdf=['sequelize','exports','STRING'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8bdf[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'name':{'type':Sequelize[_0xf8bd('0x2')]},'basename':{'type':Sequelize[_0xf8bd('0x2')]},'type':{'type':Sequelize[_0xf8bd('0x2')]}};
\ No newline at end of file
+var _0x5db8=['STRING','sequelize','exports'];(function(_0x1978a2,_0x10284){var _0x313bf1=function(_0x30c3ba){while(--_0x30c3ba){_0x1978a2['push'](_0x1978a2['shift']());}};_0x313bf1(++_0x10284);}(_0x5db8,0xbb));var _0x85db=function(_0x28fe94,_0x120b9b){_0x28fe94=_0x28fe94-0x0;var _0x3560da=_0x5db8[_0x28fe94];return _0x3560da;};'use strict';var Sequelize=require(_0x85db('0x0'));module[_0x85db('0x1')]={'name':{'type':Sequelize[_0x85db('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x85db('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9816eba..5488536 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 _0xf1d9=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Attachment','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','clone','params','get','updatedAt','body','createdAt','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xf1d9,0x1a9));var _0x9f1d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f1d('0x0'));var rimraf=require(_0x9f1d('0x1'));var zipdir=require(_0x9f1d('0x2'));var jsonpatch=require(_0x9f1d('0x3'));var rp=require(_0x9f1d('0x4'));var moment=require(_0x9f1d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f1d('0x6'));var util=require(_0x9f1d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9f1d('0x8'));var ejs=require(_0x9f1d('0x9'));var fs=require('fs');var fs_extra=require(_0x9f1d('0xa'));var _=require(_0x9f1d('0xb'));var squel=require('squel');var crypto=require(_0x9f1d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f1d('0xd'));var toCsv=require(_0x9f1d('0x8'));var querystring=require('querystring');var Papa=require(_0x9f1d('0xe'));var Redis=require(_0x9f1d('0xf'));var authService=require(_0x9f1d('0x10'));var qs=require(_0x9f1d('0x11'));var as=require(_0x9f1d('0x12'));var hardwareService=require(_0x9f1d('0x13'));var logger=require(_0x9f1d('0x14'))(_0x9f1d('0x15'));var utils=require(_0x9f1d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9f1d('0x17'));var db=require(_0x9f1d('0x18'))['db'];function respondWithStatusCode(_0x5e28dc,_0x205f19){_0x205f19=_0x205f19||0xcc;return function(_0x58791d){if(_0x58791d){return _0x5e28dc[_0x9f1d('0x19')](_0x205f19);}return _0x5e28dc['status'](_0x205f19)[_0x9f1d('0x1a')]();};}function respondWithResult(_0x5a7564,_0x2501fd){_0x2501fd=_0x2501fd||0xc8;return function(_0x47bba3){if(_0x47bba3){return _0x5a7564[_0x9f1d('0x1b')](_0x2501fd)[_0x9f1d('0x1c')](_0x47bba3);}};}function respondWithFilteredResult(_0x4855d4,_0x5140a5){return function(_0x32d667){if(_0x32d667){var _0x4966f6=typeof _0x5140a5['offset']==='undefined'&&typeof _0x5140a5['limit']==='undefined';var _0x542ad5=_0x32d667[_0x9f1d('0x1d')];var _0x33a1d3=_0x4966f6?0x0:_0x5140a5[_0x9f1d('0x1e')];var _0x24a270=_0x4966f6?_0x32d667['count']:_0x5140a5[_0x9f1d('0x1e')]+_0x5140a5[_0x9f1d('0x1f')];var _0x431f98;if(_0x24a270>=_0x542ad5){_0x24a270=_0x542ad5;_0x431f98=0xc8;}else{_0x431f98=0xce;}_0x4855d4[_0x9f1d('0x1b')](_0x431f98);return _0x4855d4[_0x9f1d('0x20')](_0x9f1d('0x21'),_0x33a1d3+'-'+_0x24a270+'/'+_0x542ad5)[_0x9f1d('0x1c')](_0x32d667);}return null;};}function patchUpdates(_0xdadd76){return function(_0x9382af){try{jsonpatch['apply'](_0x9382af,_0xdadd76,!![]);}catch(_0x39e9b9){return BPromise[_0x9f1d('0x22')](_0x39e9b9);}return _0x9382af[_0x9f1d('0x23')]();};}function saveUpdates(_0x172803,_0x3fcdf1){return function(_0xf95710){if(_0xf95710){return _0xf95710[_0x9f1d('0x24')](_0x172803)['then'](function(_0x2cf093){return _0x2cf093;});}return null;};}function removeEntity(_0x32adbf,_0x199a03){return function(_0xec41b5){if(_0xec41b5){return _0xec41b5[_0x9f1d('0x25')]()['then'](function(){_0x32adbf[_0x9f1d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7264da,_0x5dea66){return function(_0x3a6d63){if(!_0x3a6d63){_0x7264da[_0x9f1d('0x19')](0x194);}return _0x3a6d63;};}function handleError(_0x209691,_0x29ef53){_0x29ef53=_0x29ef53||0x1f4;return function(_0x3304fc){logger[_0x9f1d('0x26')](_0x3304fc[_0x9f1d('0x27')]);if(_0x3304fc['name']){delete _0x3304fc[_0x9f1d('0x28')];}_0x209691[_0x9f1d('0x1b')](_0x29ef53)[_0x9f1d('0x29')](_0x3304fc);};}exports[_0x9f1d('0x2a')]=function(_0xbdf40d,_0x2a538a){var _0x5a1e9e={},_0x5b87e1={},_0xe5425b={'count':0x0,'rows':[]};var _0x8c25ce=_[_0x9f1d('0x2b')](db[_0x9f1d('0x2c')]['rawAttributes'],function(_0x1387a8){return{'name':_0x1387a8['fieldName'],'type':_0x1387a8['type']['key']};});_0x5b87e1[_0x9f1d('0x2d')]=_[_0x9f1d('0x2b')](_0x8c25ce,_0x9f1d('0x28'));_0x5b87e1[_0x9f1d('0x2e')]=_['keys'](_0xbdf40d[_0x9f1d('0x2e')]);_0x5b87e1[_0x9f1d('0x2f')]=_[_0x9f1d('0x30')](_0x5b87e1[_0x9f1d('0x2d')],_0x5b87e1[_0x9f1d('0x2e')]);_0x5a1e9e['attributes']=_['intersection'](_0x5b87e1[_0x9f1d('0x2d')],qs[_0x9f1d('0x31')](_0xbdf40d[_0x9f1d('0x2e')]['fields']));_0x5a1e9e['attributes']=_0x5a1e9e[_0x9f1d('0x32')][_0x9f1d('0x33')]?_0x5a1e9e[_0x9f1d('0x32')]:_0x5b87e1['model'];if(!_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x34')](_0x9f1d('0x35'))){_0x5a1e9e[_0x9f1d('0x1f')]=qs[_0x9f1d('0x1f')](_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x1f')]);_0x5a1e9e[_0x9f1d('0x1e')]=qs[_0x9f1d('0x1e')](_0xbdf40d[_0x9f1d('0x2e')]['offset']);}_0x5a1e9e[_0x9f1d('0x36')]=qs['sort'](_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x37')]);_0x5a1e9e[_0x9f1d('0x38')]=qs[_0x9f1d('0x2f')](_['pick'](_0xbdf40d[_0x9f1d('0x2e')],_0x5b87e1[_0x9f1d('0x2f')]),_0x8c25ce);if(_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x39')]){_0x5a1e9e[_0x9f1d('0x38')]=_[_0x9f1d('0x3a')](_0x5a1e9e['where'],{'$or':_[_0x9f1d('0x2b')](_0x8c25ce,function(_0x1567c2){if(_0x1567c2[_0x9f1d('0x3b')]!==_0x9f1d('0x3c')){var _0x1a3c99={};_0x1a3c99[_0x1567c2['name']]={'$like':'%'+_0xbdf40d[_0x9f1d('0x2e')]['filter']+'%'};return _0x1a3c99;}})});}_0x5a1e9e=_[_0x9f1d('0x3a')]({},_0x5a1e9e,_0xbdf40d['options']);var _0x498141={'where':_0x5a1e9e[_0x9f1d('0x38')]};return db['Attachment'][_0x9f1d('0x1d')](_0x498141)[_0x9f1d('0x3d')](function(_0xfaf88a){_0xe5425b[_0x9f1d('0x1d')]=_0xfaf88a;if(_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x3e')]){_0x5a1e9e[_0x9f1d('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x9f1d('0x40')](_0x5a1e9e);})[_0x9f1d('0x3d')](function(_0x5a1992){_0xe5425b[_0x9f1d('0x41')]=_0x5a1992;return _0xe5425b;})['then'](respondWithFilteredResult(_0x2a538a,_0x5a1e9e))[_0x9f1d('0x42')](handleError(_0x2a538a,null));};exports[_0x9f1d('0x43')]=function(_0x23ca40,_0x73260b){var _0x56cef3={'raw':!![],'where':{'id':_0x23ca40['params']['id']}},_0x383ef5={};_0x383ef5[_0x9f1d('0x2d')]=_['keys'](db[_0x9f1d('0x2c')][_0x9f1d('0x44')]);_0x383ef5['query']=_[_0x9f1d('0x45')](_0x23ca40[_0x9f1d('0x2e')]);_0x383ef5[_0x9f1d('0x2f')]=_[_0x9f1d('0x30')](_0x383ef5[_0x9f1d('0x2d')],_0x383ef5[_0x9f1d('0x2e')]);_0x56cef3[_0x9f1d('0x32')]=_['intersection'](_0x383ef5[_0x9f1d('0x2d')],qs['fields'](_0x23ca40[_0x9f1d('0x2e')][_0x9f1d('0x31')]));_0x56cef3[_0x9f1d('0x32')]=_0x56cef3['attributes'][_0x9f1d('0x33')]?_0x56cef3[_0x9f1d('0x32')]:_0x383ef5['model'];if(_0x23ca40[_0x9f1d('0x2e')][_0x9f1d('0x3e')]){_0x56cef3[_0x9f1d('0x3f')]=[{'all':!![]}];}_0x56cef3=_[_0x9f1d('0x3a')]({},_0x56cef3,_0x23ca40[_0x9f1d('0x46')]);return db[_0x9f1d('0x2c')][_0x9f1d('0x47')](_0x56cef3)[_0x9f1d('0x3d')](handleEntityNotFound(_0x73260b,null))[_0x9f1d('0x3d')](respondWithResult(_0x73260b,null))['catch'](handleError(_0x73260b,null));};exports[_0x9f1d('0x48')]=function(_0x171b4d,_0x4905a3){var _0x22a3af={'where':{'id':_0x171b4d[_0x9f1d('0x49')]['id']}},_0x29ad15={};_0x29ad15['model']=_[_0x9f1d('0x45')](db[_0x9f1d('0x2c')][_0x9f1d('0x44')]);_0x22a3af[_0x9f1d('0x32')]=_[_0x9f1d('0x30')](_0x29ad15[_0x9f1d('0x2d')],qs[_0x9f1d('0x31')](_0x171b4d[_0x9f1d('0x2e')][_0x9f1d('0x31')]));_0x22a3af[_0x9f1d('0x32')]=_0x22a3af[_0x9f1d('0x32')][_0x9f1d('0x33')]?_0x22a3af[_0x9f1d('0x32')]:_0x29ad15[_0x9f1d('0x2d')];if(_0x171b4d[_0x9f1d('0x2e')]['includeAll']){_0x22a3af[_0x9f1d('0x3f')]=[{'all':!![]}];}_0x22a3af=_[_0x9f1d('0x3a')]({},_0x22a3af,_0x171b4d['options']);return db[_0x9f1d('0x2c')][_0x9f1d('0x47')](_0x22a3af)['then'](handleEntityNotFound(_0x4905a3,null))[_0x9f1d('0x3d')](function(_0x5e414d){if(_0x5e414d){var _0x3d1f6a=_0x5e414d[_0x9f1d('0x4a')]({'plain':!![]});_0x3d1f6a=qs['omit'](_0x3d1f6a,['id','createdAt',_0x9f1d('0x4b')]);_0x171b4d[_0x9f1d('0x4c')]=_['omit'](_0x171b4d[_0x9f1d('0x4c')],['id',_0x9f1d('0x4d'),_0x9f1d('0x4b')]);return db[_0x9f1d('0x2c')][_0x9f1d('0x4e')](_[_0x9f1d('0x3a')](_0x3d1f6a,_0x171b4d[_0x9f1d('0x4c')]),{'include':_0x171b4d[_0x9f1d('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9f1d('0x3d')](respondWithResult(_0x4905a3,0xc9))[_0x9f1d('0x42')](handleError(_0x4905a3,null));};exports[_0x9f1d('0x24')]=function(_0xbf603b,_0x861258){if(_0xbf603b['body']['id']){delete _0xbf603b[_0x9f1d('0x4c')]['id'];}return db[_0x9f1d('0x2c')]['find']({'where':{'id':_0xbf603b[_0x9f1d('0x49')]['id']}})[_0x9f1d('0x3d')](handleEntityNotFound(_0x861258,null))[_0x9f1d('0x3d')](saveUpdates(_0xbf603b[_0x9f1d('0x4c')],null))[_0x9f1d('0x3d')](respondWithResult(_0x861258,null))[_0x9f1d('0x42')](handleError(_0x861258,null));};exports['destroy']=function(_0x1a4fb0,_0x197eaa){return db[_0x9f1d('0x2c')][_0x9f1d('0x47')]({'where':{'id':_0x1a4fb0[_0x9f1d('0x49')]['id']}})[_0x9f1d('0x3d')](handleEntityNotFound(_0x197eaa,null))[_0x9f1d('0x3d')](removeEntity(_0x197eaa,null))[_0x9f1d('0x42')](handleError(_0x197eaa,null));};exports['create']=function(_0xfbb8c5,_0x5cdc31,_0x30ddf7){_0xfbb8c5[_0x9f1d('0x4c')]['name']=_0xfbb8c5[_0x9f1d('0x4f')][_0x9f1d('0x50')];_0xfbb8c5['body'][_0x9f1d('0x51')]=_0xfbb8c5[_0x9f1d('0x4f')][_0x9f1d('0x52')];_0xfbb8c5[_0x9f1d('0x4c')][_0x9f1d('0x3b')]=_0xfbb8c5[_0x9f1d('0x4f')]['mimetype'];return db[_0x9f1d('0x2c')]['create'](_0xfbb8c5[_0x9f1d('0x4c')])[_0x9f1d('0x3d')](respondWithResult(_0x5cdc31,0xc9))[_0x9f1d('0x42')](handleError(_0x5cdc31,null));};exports['download']=function(_0xd6089a,_0x4568f1,_0x38bf92){return db[_0x9f1d('0x2c')][_0x9f1d('0x53')]({'where':{'id':_0xd6089a[_0x9f1d('0x49')]['id']},'raw':!![]})[_0x9f1d('0x3d')](handleEntityNotFound(_0x4568f1,null))[_0x9f1d('0x3d')](function(_0xeaa598){if(_0xeaa598){var _0x498890=_0xeaa598[_0x9f1d('0x54')]!==null;var _0x5e6163=path[_0x9f1d('0x55')](config[_0x9f1d('0x56')],_0x9f1d('0x57'));if(_0x498890){_0x5e6163=path[_0x9f1d('0x55')](_0x5e6163,'offline-chat/');}var _0x5a759e=path[_0x9f1d('0x55')](_0x5e6163,_0xeaa598[_0x9f1d('0x51')]);return _0x4568f1[_0x9f1d('0x58')](_0x5a759e);}})[_0x9f1d('0x42')](handleError(_0x4568f1,null));};
\ No newline at end of file
+var _0xe659=['mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','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','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','Attachment','include','rows','show','includeAll','options','find','catch','params','get','omit','createdAt','updatedAt','body','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','zip-dir','request-promise','moment'];(function(_0x409ad2,_0x5129c1){var _0x595b5f=function(_0x592974){while(--_0x592974){_0x409ad2['push'](_0x409ad2['shift']());}};_0x595b5f(++_0x5129c1);}(_0xe659,0xad));var _0x9e65=function(_0x2dca8c,_0x5583f5){_0x2dca8c=_0x2dca8c-0x0;var _0x1db10c=_0xe659[_0x2dca8c];return _0x1db10c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e65('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e65('0x1'));var moment=require(_0x9e65('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9e65('0x3'));var util=require(_0x9e65('0x4'));var path=require('path');var sox=require(_0x9e65('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e65('0x6'));var _=require(_0x9e65('0x7'));var squel=require('squel');var crypto=require(_0x9e65('0x8'));var jsforce=require(_0x9e65('0x9'));var deskjs=require(_0x9e65('0xa'));var toCsv=require(_0x9e65('0xb'));var querystring=require(_0x9e65('0xc'));var Papa=require(_0x9e65('0xd'));var Redis=require(_0x9e65('0xe'));var authService=require(_0x9e65('0xf'));var qs=require(_0x9e65('0x10'));var as=require(_0x9e65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e65('0x12'))(_0x9e65('0x13'));var utils=require(_0x9e65('0x14'));var config=require(_0x9e65('0x15'));var licenseUtil=require(_0x9e65('0x16'));var db=require(_0x9e65('0x17'))['db'];function respondWithStatusCode(_0x27d19d,_0x4302a7){_0x4302a7=_0x4302a7||0xcc;return function(_0x19761a){if(_0x19761a){return _0x27d19d[_0x9e65('0x18')](_0x4302a7);}return _0x27d19d[_0x9e65('0x19')](_0x4302a7)[_0x9e65('0x1a')]();};}function respondWithResult(_0x180d23,_0x15c605){_0x15c605=_0x15c605||0xc8;return function(_0x407554){if(_0x407554){return _0x180d23[_0x9e65('0x19')](_0x15c605)['json'](_0x407554);}};}function respondWithFilteredResult(_0xfd0f13,_0x2748b7){return function(_0x51fdee){if(_0x51fdee){var _0x497625=typeof _0x2748b7[_0x9e65('0x1b')]===_0x9e65('0x1c')&&typeof _0x2748b7[_0x9e65('0x1d')]===_0x9e65('0x1c');var _0x32b757=_0x51fdee[_0x9e65('0x1e')];var _0x249acf=_0x497625?0x0:_0x2748b7[_0x9e65('0x1b')];var _0x149454=_0x497625?_0x51fdee['count']:_0x2748b7['offset']+_0x2748b7[_0x9e65('0x1d')];var _0x395991;if(_0x149454>=_0x32b757){_0x149454=_0x32b757;_0x395991=0xc8;}else{_0x395991=0xce;}_0xfd0f13['status'](_0x395991);return _0xfd0f13[_0x9e65('0x1f')]('Content-Range',_0x249acf+'-'+_0x149454+'/'+_0x32b757)[_0x9e65('0x20')](_0x51fdee);}return null;};}function patchUpdates(_0x319eba){return function(_0x208d4f){try{jsonpatch[_0x9e65('0x21')](_0x208d4f,_0x319eba,!![]);}catch(_0x133766){return BPromise[_0x9e65('0x22')](_0x133766);}return _0x208d4f[_0x9e65('0x23')]();};}function saveUpdates(_0x1f898c,_0x346a8c){return function(_0x147251){if(_0x147251){return _0x147251[_0x9e65('0x24')](_0x1f898c)[_0x9e65('0x25')](function(_0x3c043d){return _0x3c043d;});}return null;};}function removeEntity(_0x1c49c2,_0x5b7eea){return function(_0x33d72b){if(_0x33d72b){return _0x33d72b[_0x9e65('0x26')]()[_0x9e65('0x25')](function(){_0x1c49c2[_0x9e65('0x19')](0xcc)[_0x9e65('0x1a')]();});}};}function handleEntityNotFound(_0x101159,_0x539758){return function(_0x3027d7){if(!_0x3027d7){_0x101159[_0x9e65('0x18')](0x194);}return _0x3027d7;};}function handleError(_0x32c370,_0x579ce7){_0x579ce7=_0x579ce7||0x1f4;return function(_0x2d0754){logger[_0x9e65('0x27')](_0x2d0754[_0x9e65('0x28')]);if(_0x2d0754[_0x9e65('0x29')]){delete _0x2d0754[_0x9e65('0x29')];}_0x32c370[_0x9e65('0x19')](_0x579ce7)['send'](_0x2d0754);};}exports[_0x9e65('0x2a')]=function(_0x166f35,_0x5efa7c){var _0x1e4193={},_0x4482d6={},_0x17599e={'count':0x0,'rows':[]};var _0x3d1aa2=_[_0x9e65('0x2b')](db['Attachment'][_0x9e65('0x2c')],function(_0x289034){return{'name':_0x289034[_0x9e65('0x2d')],'type':_0x289034[_0x9e65('0x2e')][_0x9e65('0x2f')]};});_0x4482d6[_0x9e65('0x30')]=_['map'](_0x3d1aa2,'name');_0x4482d6['query']=_[_0x9e65('0x31')](_0x166f35[_0x9e65('0x32')]);_0x4482d6[_0x9e65('0x33')]=_[_0x9e65('0x34')](_0x4482d6['model'],_0x4482d6['query']);_0x1e4193['attributes']=_[_0x9e65('0x34')](_0x4482d6['model'],qs[_0x9e65('0x35')](_0x166f35[_0x9e65('0x32')][_0x9e65('0x35')]));_0x1e4193['attributes']=_0x1e4193['attributes'][_0x9e65('0x36')]?_0x1e4193[_0x9e65('0x37')]:_0x4482d6[_0x9e65('0x30')];if(!_0x166f35[_0x9e65('0x32')][_0x9e65('0x38')](_0x9e65('0x39'))){_0x1e4193['limit']=qs['limit'](_0x166f35[_0x9e65('0x32')][_0x9e65('0x1d')]);_0x1e4193[_0x9e65('0x1b')]=qs['offset'](_0x166f35[_0x9e65('0x32')]['offset']);}_0x1e4193['order']=qs[_0x9e65('0x3a')](_0x166f35['query'][_0x9e65('0x3a')]);_0x1e4193[_0x9e65('0x3b')]=qs[_0x9e65('0x33')](_['pick'](_0x166f35[_0x9e65('0x32')],_0x4482d6[_0x9e65('0x33')]),_0x3d1aa2);if(_0x166f35[_0x9e65('0x32')][_0x9e65('0x3c')]){_0x1e4193[_0x9e65('0x3b')]=_['merge'](_0x1e4193['where'],{'$or':_[_0x9e65('0x2b')](_0x3d1aa2,function(_0x774eab){if(_0x774eab[_0x9e65('0x2e')]!=='VIRTUAL'){var _0x22c553={};_0x22c553[_0x774eab[_0x9e65('0x29')]]={'$like':'%'+_0x166f35[_0x9e65('0x32')][_0x9e65('0x3c')]+'%'};return _0x22c553;}})});}_0x1e4193=_[_0x9e65('0x3d')]({},_0x1e4193,_0x166f35['options']);var _0x5ba1e6={'where':_0x1e4193['where']};return db[_0x9e65('0x3e')][_0x9e65('0x1e')](_0x5ba1e6)['then'](function(_0x3af690){_0x17599e[_0x9e65('0x1e')]=_0x3af690;if(_0x166f35['query']['includeAll']){_0x1e4193[_0x9e65('0x3f')]=[{'all':!![]}];}return db[_0x9e65('0x3e')]['findAll'](_0x1e4193);})[_0x9e65('0x25')](function(_0xdcdc5){_0x17599e[_0x9e65('0x40')]=_0xdcdc5;return _0x17599e;})[_0x9e65('0x25')](respondWithFilteredResult(_0x5efa7c,_0x1e4193))['catch'](handleError(_0x5efa7c,null));};exports[_0x9e65('0x41')]=function(_0x3f1224,_0xfedb51){var _0xa1834a={'raw':!![],'where':{'id':_0x3f1224['params']['id']}},_0x5ed9c8={};_0x5ed9c8[_0x9e65('0x30')]=_[_0x9e65('0x31')](db[_0x9e65('0x3e')][_0x9e65('0x2c')]);_0x5ed9c8[_0x9e65('0x32')]=_['keys'](_0x3f1224[_0x9e65('0x32')]);_0x5ed9c8[_0x9e65('0x33')]=_[_0x9e65('0x34')](_0x5ed9c8[_0x9e65('0x30')],_0x5ed9c8['query']);_0xa1834a['attributes']=_[_0x9e65('0x34')](_0x5ed9c8[_0x9e65('0x30')],qs['fields'](_0x3f1224[_0x9e65('0x32')][_0x9e65('0x35')]));_0xa1834a[_0x9e65('0x37')]=_0xa1834a[_0x9e65('0x37')]['length']?_0xa1834a[_0x9e65('0x37')]:_0x5ed9c8[_0x9e65('0x30')];if(_0x3f1224['query'][_0x9e65('0x42')]){_0xa1834a['include']=[{'all':!![]}];}_0xa1834a=_[_0x9e65('0x3d')]({},_0xa1834a,_0x3f1224[_0x9e65('0x43')]);return db[_0x9e65('0x3e')][_0x9e65('0x44')](_0xa1834a)[_0x9e65('0x25')](handleEntityNotFound(_0xfedb51,null))[_0x9e65('0x25')](respondWithResult(_0xfedb51,null))[_0x9e65('0x45')](handleError(_0xfedb51,null));};exports['clone']=function(_0x37744b,_0x33b232){var _0x183b4e={'where':{'id':_0x37744b[_0x9e65('0x46')]['id']}},_0x2be8fc={};_0x2be8fc['model']=_[_0x9e65('0x31')](db['Attachment'][_0x9e65('0x2c')]);_0x183b4e[_0x9e65('0x37')]=_['intersection'](_0x2be8fc[_0x9e65('0x30')],qs[_0x9e65('0x35')](_0x37744b[_0x9e65('0x32')][_0x9e65('0x35')]));_0x183b4e[_0x9e65('0x37')]=_0x183b4e['attributes'][_0x9e65('0x36')]?_0x183b4e[_0x9e65('0x37')]:_0x2be8fc[_0x9e65('0x30')];if(_0x37744b[_0x9e65('0x32')][_0x9e65('0x42')]){_0x183b4e['include']=[{'all':!![]}];}_0x183b4e=_[_0x9e65('0x3d')]({},_0x183b4e,_0x37744b[_0x9e65('0x43')]);return db[_0x9e65('0x3e')][_0x9e65('0x44')](_0x183b4e)[_0x9e65('0x25')](handleEntityNotFound(_0x33b232,null))[_0x9e65('0x25')](function(_0x584896){if(_0x584896){var _0x3f8022=_0x584896[_0x9e65('0x47')]({'plain':!![]});_0x3f8022=qs[_0x9e65('0x48')](_0x3f8022,['id',_0x9e65('0x49'),_0x9e65('0x4a')]);_0x37744b[_0x9e65('0x4b')]=_[_0x9e65('0x48')](_0x37744b[_0x9e65('0x4b')],['id','createdAt',_0x9e65('0x4a')]);return db[_0x9e65('0x3e')]['create'](_[_0x9e65('0x3d')](_0x3f8022,_0x37744b['body']),{'include':_0x37744b[_0x9e65('0x32')][_0x9e65('0x42')]?[{'all':!![]}]:undefined});}})[_0x9e65('0x25')](respondWithResult(_0x33b232,0xc9))['catch'](handleError(_0x33b232,null));};exports[_0x9e65('0x24')]=function(_0xae2127,_0x27df3a){if(_0xae2127[_0x9e65('0x4b')]['id']){delete _0xae2127['body']['id'];}return db['Attachment'][_0x9e65('0x44')]({'where':{'id':_0xae2127[_0x9e65('0x46')]['id']}})['then'](handleEntityNotFound(_0x27df3a,null))['then'](saveUpdates(_0xae2127[_0x9e65('0x4b')],null))[_0x9e65('0x25')](respondWithResult(_0x27df3a,null))[_0x9e65('0x45')](handleError(_0x27df3a,null));};exports[_0x9e65('0x26')]=function(_0x1c69fb,_0x202a84){return db['Attachment'][_0x9e65('0x44')]({'where':{'id':_0x1c69fb[_0x9e65('0x46')]['id']}})[_0x9e65('0x25')](handleEntityNotFound(_0x202a84,null))[_0x9e65('0x25')](removeEntity(_0x202a84,null))[_0x9e65('0x45')](handleError(_0x202a84,null));};exports['create']=function(_0x7c63cb,_0x3f5d09,_0x13362f){_0x7c63cb[_0x9e65('0x4b')][_0x9e65('0x29')]=_0x7c63cb[_0x9e65('0x4c')][_0x9e65('0x4d')];_0x7c63cb[_0x9e65('0x4b')][_0x9e65('0x4e')]=_0x7c63cb['file'][_0x9e65('0x4f')];_0x7c63cb[_0x9e65('0x4b')][_0x9e65('0x2e')]=_0x7c63cb[_0x9e65('0x4c')][_0x9e65('0x50')];return db[_0x9e65('0x3e')]['create'](_0x7c63cb[_0x9e65('0x4b')])[_0x9e65('0x25')](respondWithResult(_0x3f5d09,0xc9))[_0x9e65('0x45')](handleError(_0x3f5d09,null));};exports[_0x9e65('0x51')]=function(_0x20b4b4,_0x55bd18,_0x294d03){return db[_0x9e65('0x3e')][_0x9e65('0x52')]({'where':{'id':_0x20b4b4[_0x9e65('0x46')]['id']},'raw':!![]})[_0x9e65('0x25')](handleEntityNotFound(_0x55bd18,null))['then'](function(_0x3e6446){if(_0x3e6446){var _0x589ce2=_0x3e6446[_0x9e65('0x53')]!==null;var _0x25aedb=path[_0x9e65('0x54')](config[_0x9e65('0x55')],_0x9e65('0x56'));if(_0x589ce2){_0x25aedb=path[_0x9e65('0x54')](_0x25aedb,_0x9e65('0x57'));}var _0x8f9731=path[_0x9e65('0x54')](_0x25aedb,_0x3e6446[_0x9e65('0x4e')]);return _0x55bd18['download'](_0x8f9731);}})['catch'](handleError(_0x55bd18,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5569d09..e2b224e 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 _0xc978=['request-promise','path','../../config/environment','./attachment.attributes','exports','define','lodash','api','moment','bluebird'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc978,0xce));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rp=require(_0x8c97('0x4'));var fs=require('fs');var path=require(_0x8c97('0x5'));var rimraf=require('rimraf');var config=require(_0x8c97('0x6'));var attributes=require(_0x8c97('0x7'));module[_0x8c97('0x8')]=function(_0x398d4c,_0x145a9e){return _0x398d4c[_0x8c97('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x134e=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util'];(function(_0x2cef9c,_0x31130d){var _0x20ce49=function(_0x5d508d){while(--_0x5d508d){_0x2cef9c['push'](_0x2cef9c['shift']());}};_0x20ce49(++_0x31130d);}(_0x134e,0x6b));var _0xe134=function(_0xb3b81b,_0x11beb3){_0xb3b81b=_0xb3b81b-0x0;var _0xbf27fd=_0x134e[_0xb3b81b];return _0xbf27fd;};'use strict';var _=require('lodash');var util=require(_0xe134('0x0'));var logger=require(_0xe134('0x1'))('api');var moment=require(_0xe134('0x2'));var BPromise=require('bluebird');var rp=require(_0xe134('0x3'));var fs=require('fs');var path=require(_0xe134('0x4'));var rimraf=require(_0xe134('0x5'));var config=require(_0xe134('0x6'));var attributes=require(_0xe134('0x7'));module[_0xe134('0x8')]=function(_0x56898f,_0xe1e63c){return _0x56898f[_0xe134('0x9')](_0xe134('0xa'),attributes,{'tableName':_0xe134('0xb'),'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 2cc7a6e..d8bb2b4 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 _0xeea4=['Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29e401,_0x4d374d){var _0x4d8b63=function(_0x1a3225){while(--_0x1a3225){_0x29e401['push'](_0x29e401['shift']());}};_0x4d8b63(++_0x4d374d);}(_0xeea4,0x19e));var _0x4eea=function(_0x278fd6,_0x4cd636){_0x278fd6=_0x278fd6-0x0;var _0x1d24ba=_0xeea4[_0x278fd6];return _0x1d24ba;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var moment=require(_0x4eea('0x2'));var BPromise=require(_0x4eea('0x3'));var rs=require(_0x4eea('0x4'));var fs=require('fs');var Redis=require(_0x4eea('0x5'));var db=require(_0x4eea('0x6'))['db'];var utils=require(_0x4eea('0x7'));var logger=require(_0x4eea('0x8'))('rpc');var config=require(_0x4eea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eea('0xa')][_0x4eea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5aa8,_0x48538e,_0x1a2e5e){return new BPromise(function(_0x44116a,_0x4cc630){return client[_0x4eea('0xc')](_0x3d5aa8,_0x1a2e5e)[_0x4eea('0xd')](function(_0x2bba91){logger[_0x4eea('0xe')]('Attachment,\x20%s,\x20%s',_0x48538e,_0x4eea('0xf'));logger[_0x4eea('0x10')](_0x4eea('0x11'),_0x48538e,_0x4eea('0xf'),JSON[_0x4eea('0x12')](_0x2bba91));if(_0x2bba91[_0x4eea('0x13')]){if(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x14')]===0x1f4){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91['error']['message']);return _0x4cc630(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);return _0x44116a(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}else{logger['info'](_0x4eea('0x15'),_0x48538e,_0x4eea('0xf'));_0x44116a(_0x2bba91[_0x4eea('0x17')][_0x4eea('0x16')]);}})['catch'](function(_0x446474){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x446474);_0x4cc630(_0x446474);});});}exports[_0x4eea('0x18')]=function(_0x27a227){var _0x5bd90b=this;return new Promise(function(_0x1571f3,_0x29de0e){return db['Attachment'][_0x4eea('0x19')](_0x27a227[_0x4eea('0x1a')],{'raw':_0x27a227[_0x4eea('0x1b')]?_0x27a227[_0x4eea('0x1b')][_0x4eea('0x1c')]===undefined?!![]:![]:!![]})[_0x4eea('0xd')](function(_0x56fefc){logger[_0x4eea('0xe')](_0x4eea('0x18'),_0x27a227);logger[_0x4eea('0x10')](_0x4eea('0x18'),_0x27a227,JSON[_0x4eea('0x12')](_0x56fefc));_0x1571f3(_0x56fefc);})['catch'](function(_0x4898e8){logger[_0x4eea('0x13')]('CreateAttachment',_0x4898e8['message'],_0x27a227);_0x29de0e(_0x5bd90b['error'](0x1f4,_0x4898e8[_0x4eea('0x16')]));});});};
\ No newline at end of file
+var _0x6a24=['create','body','options','raw','then','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6a24,0xd1));var _0x46a2=function(_0x5d4a41,_0x194a29){_0x5d4a41=_0x5d4a41-0x0;var _0x5587bf=_0x6a24[_0x5d4a41];return _0x5587bf;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}exports[_0x46a2('0x15')]=function(_0x577f18){var _0x27250b=this;return new Promise(function(_0x24f75f,_0x529bb5){return db[_0x46a2('0x16')][_0x46a2('0x17')](_0x577f18[_0x46a2('0x18')],{'raw':_0x577f18[_0x46a2('0x19')]?_0x577f18[_0x46a2('0x19')][_0x46a2('0x1a')]===undefined?!![]:![]:!![]})[_0x46a2('0x1b')](function(_0x202294){logger[_0x46a2('0x1c')](_0x46a2('0x15'),_0x577f18);logger[_0x46a2('0xe')](_0x46a2('0x15'),_0x577f18,JSON[_0x46a2('0x10')](_0x202294));_0x24f75f(_0x202294);})['catch'](function(_0xa37d90){logger['error'](_0x46a2('0x15'),_0xa37d90[_0x46a2('0x12')],_0x577f18);_0x529bb5(_0x27250b['error'](0x1f4,_0xa37d90[_0x46a2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index d5d41d1..0fed999 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1aece3,_0x1360b7){_0x1aece3=_0x1aece3-0x0;var _0x7f3a5a=_0xdb28[_0x1aece3];return _0x7f3a5a;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x400a90,_0x19b6ad){var _0x33e181=function(_0x2f28d8){while(--_0x2f28d8){_0x400a90['push'](_0x400a90['shift']());}};_0x33e181(++_0x19b6ad);}(_0x2032,0xd9));var _0x2203=function(_0x9b3682,_0x519be0){_0x9b3682=_0x9b3682-0x0;var _0x2d783b=_0x2032[_0x9b3682];return _0x2d783b;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 0370564..35f1ca3 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3ef=['online','User','passport','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt','admin','user','agent','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x59b589,_0x11a824){var _0x4782d6=function(_0x24aa49){while(--_0x24aa49){_0x59b589['push'](_0x59b589['shift']());}};_0x4782d6(++_0x11a824);}(_0xc3ef,0x122));var _0xfc3e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc3ef[_0x8c43de];return _0xa6591b;};'use strict';var passport=require(_0xfc3e('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfc3e('0x1'));var ActiveDirectory=require(_0xfc3e('0x2'));var BPromise=require(_0xfc3e('0x3'));var util=require('util');var db=require(_0xfc3e('0x4'))['db'];var authService=require(_0xfc3e('0x5'));var utils=require(_0xfc3e('0x6'));var config=require('../../config/environment');var logger=require(_0xfc3e('0x7'))(_0xfc3e('0x8'));function isActiveDirectoryConfigured(_0x419560){var _0x531371=![];if(typeof _0x419560[_0xfc3e('0x9')]!=='undefined'){_0x531371=_0x419560['activedirectory'][_0xfc3e('0xa')]&&_0x419560[_0xfc3e('0x9')][_0xfc3e('0xb')]&&_0x419560[_0xfc3e('0x9')][_0xfc3e('0xc')];}return _0x531371;}function adAuthenticate(_0x48acb3,_0x31f208,_0x24cfbc){return new BPromise(function(_0x5e9e92,_0x514c5e){try{var _0x3246de=new ActiveDirectory(_0x48acb3);_0x3246de[_0xfc3e('0xd')](_0x31f208,_0x24cfbc,function(_0x55e343,_0x5448e4){if(_0x55e343){logger[_0xfc3e('0xe')](_0xfc3e('0xf'),_0x31f208,util[_0xfc3e('0x10')](_0x55e343,{'showHidden':![],'depth':null}));_0x514c5e(_0xfc3e('0x11'));}else if(!_0x5448e4){logger[_0xfc3e('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x31f208);_0x514c5e(_0xfc3e('0x11'));}else{_0x5e9e92(_0x5448e4);}});}catch(_0x2eb7d2){_0x514c5e(_0x2eb7d2);}});}function ActiveDirectoryAuthenticate(_0x16bcf9,_0x4fabdf,_0x4ce346,_0x456c21){var _0x3dd3f5,_0x479d37;if(!isActiveDirectoryConfigured(config)){logger[_0xfc3e('0xe')](_0xfc3e('0x12'),_0x4fabdf);return _0x456c21(null,![],{'message':_0xfc3e('0x11')});}return db[_0xfc3e('0x13')][_0xfc3e('0x14')]({'where':{'id':0x1},'attributes':[_0xfc3e('0x15'),_0xfc3e('0x16')],'raw':!![]})[_0xfc3e('0x17')](function(_0x257cdc){_0x3dd3f5=_0x257cdc;if(!_0x3dd3f5[_0xfc3e('0x15')]){logger[_0xfc3e('0xe')](_0xfc3e('0x18'),_0x4fabdf);throw new Error(_0xfc3e('0x11'));}return _0x16bcf9[_0xfc3e('0x14')]({'attributes':['id',_0xfc3e('0x19'),_0xfc3e('0x1a'),'salt',_0xfc3e('0x1b'),_0xfc3e('0x1c'),_0xfc3e('0x1d'),_0xfc3e('0x1e'),'online'],'where':{'name':_0x4fabdf,'role':{'$or':[_0xfc3e('0x1f'),_0xfc3e('0x20'),_0xfc3e('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x4fd6f5){if(!_0x4fd6f5||_0x4fd6f5&&_0x4fd6f5['name']!==_0x4fabdf){throw new Error(_0xfc3e('0x11'));}_0x479d37=_0x4fd6f5;var _0x1ee6ca=_0x479d37['name']+'@'+config[_0xfc3e('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x1ee6ca,_0x4ce346);})['then'](function(_0x4f4401){if(_0x479d37['disabled']){throw new Error(_0xfc3e('0x11'));}if(_0x3dd3f5[_0xfc3e('0x16')]>0x0){if(_0x479d37['blocked']){if(moment(_0x479d37['blockedAt'])[_0xfc3e('0x22')](_0x3dd3f5[_0xfc3e('0x16')],_0xfc3e('0x23'))>moment()){throw new Error(_0xfc3e('0x11'));}return utils[_0xfc3e('0x24')](_0x479d37,0x0,![],null)['then'](function(){return utils[_0xfc3e('0x25')](_0x479d37);})[_0xfc3e('0x17')](function(){return _0x456c21(null,_0x479d37);});}else{return utils['getLicense'](_0x479d37)['then'](function(){return _0x456c21(null,_0x479d37);});}}else{return utils[_0xfc3e('0x25')](_0x479d37)[_0xfc3e('0x17')](function(){return _0x456c21(null,_0x479d37);});}})['catch'](function(_0x409d5a){return _0x456c21(null,![],_0x409d5a);});}function handleError(_0x18499a,_0x471801,_0x20b82e){return _0x18499a[_0xfc3e('0x26')](_0x471801||0x1f4)[_0xfc3e('0x27')]({'message':_0x20b82e?_0x20b82e[_0xfc3e('0x28')]||_0x20b82e:''});}exports[_0xfc3e('0x29')]=function(_0x5e4423,_0x5dbea8,_0x261e92){passport[_0xfc3e('0xd')](_0xfc3e('0x2a'),function(_0x5bfeb2,_0x40e8fd,_0x5e5f31){var _0x216108=_0x5bfeb2||_0x5e5f31;if(_0x216108){return handleError(_0x5dbea8,0x191,_0x216108);}if(!_0x40e8fd){return handleError(_0x5dbea8,0x194,{'message':_0xfc3e('0x2b')});}else{var _0x164da0={'payload':{'id':_0x40e8fd['id'],'role':_0x40e8fd['role']},'options':{'expiresIn':0x15180}};return authService[_0xfc3e('0x2c')](_0x164da0)[_0xfc3e('0x17')](function(_0x96a76d){_0x5dbea8[_0xfc3e('0x2d')]({'id':_0x40e8fd['id'],'token':_0x96a76d,'statusCall':'','isAlreadyLogged':_0x40e8fd[_0xfc3e('0x2e')]});});}})(_0x5e4423,_0x5dbea8,_0x261e92);};passport['use'](_0xfc3e('0x2a'),new LocalStrategy({'usernameField':_0xfc3e('0x19'),'passwordField':_0xfc3e('0x1a')},function(_0x465689,_0x498ac8,_0xb3c188){return ActiveDirectoryAuthenticate(db[_0xfc3e('0x2f')],_0x465689,_0x498ac8,_0xb3c188);}));
\ No newline at end of file
+var _0x15b3=['error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','online','user','agent','name','add','minutes','clearBlockUser','getLicense','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','authenticate'];(function(_0x517586,_0xc97d01){var _0x4d7494=function(_0x1383d8){while(--_0x1383d8){_0x517586['push'](_0x517586['shift']());}};_0x4d7494(++_0xc97d01);}(_0x15b3,0x1b5));var _0x315b=function(_0x44d36b,_0x50dc95){_0x44d36b=_0x44d36b-0x0;var _0x562b25=_0x15b3[_0x44d36b];return _0x562b25;};'use strict';var passport=require(_0x315b('0x0'));var LocalStrategy=require(_0x315b('0x1'))[_0x315b('0x2')];var moment=require(_0x315b('0x3'));var ActiveDirectory=require(_0x315b('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x315b('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x315b('0x6'));var config=require(_0x315b('0x7'));var logger=require(_0x315b('0x8'))(_0x315b('0x9'));function isActiveDirectoryConfigured(_0x3719d7){var _0x238d13=![];if(typeof _0x3719d7[_0x315b('0xa')]!==_0x315b('0xb')){_0x238d13=_0x3719d7[_0x315b('0xa')]['baseDN']&&_0x3719d7[_0x315b('0xa')]['url']&&_0x3719d7[_0x315b('0xa')]['domain'];}return _0x238d13;}function adAuthenticate(_0x2549dc,_0x5493cf,_0x1bb67d){return new BPromise(function(_0x7128ed,_0x1e3ba0){try{var _0x308258=new ActiveDirectory(_0x2549dc);_0x308258[_0x315b('0xc')](_0x5493cf,_0x1bb67d,function(_0x38f8f0,_0x498e38){if(_0x38f8f0){logger[_0x315b('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x5493cf,util[_0x315b('0xe')](_0x38f8f0,{'showHidden':![],'depth':null}));_0x1e3ba0(_0x315b('0xf'));}else if(!_0x498e38){logger['error'](_0x315b('0x10'),_0x5493cf);_0x1e3ba0(_0x315b('0xf'));}else{_0x7128ed(_0x498e38);}});}catch(_0x8fde7b){_0x1e3ba0(_0x8fde7b);}});}function ActiveDirectoryAuthenticate(_0x3c012c,_0x3bee1e,_0x12ded2,_0x1b1e4f){var _0x4ec361,_0x2d1d8b;if(!isActiveDirectoryConfigured(config)){logger[_0x315b('0xd')](_0x315b('0x11'),_0x3bee1e);return _0x1b1e4f(null,![],{'message':_0x315b('0xf')});}return db[_0x315b('0x12')][_0x315b('0x13')]({'where':{'id':0x1},'attributes':[_0x315b('0x14'),_0x315b('0x15')],'raw':!![]})[_0x315b('0x16')](function(_0xaaea9){_0x4ec361=_0xaaea9;if(!_0x4ec361[_0x315b('0x14')]){logger[_0x315b('0xd')](_0x315b('0x17'),_0x3bee1e);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3c012c[_0x315b('0x13')]({'attributes':['id','name',_0x315b('0x18'),_0x315b('0x19'),_0x315b('0x1a'),_0x315b('0x1b'),_0x315b('0x1c'),_0x315b('0x1d'),_0x315b('0x1e')],'where':{'name':_0x3bee1e,'role':{'$or':['admin',_0x315b('0x1f'),_0x315b('0x20')]},'adSsoEnabled':!![]}});})[_0x315b('0x16')](function(_0x12cdea){if(!_0x12cdea||_0x12cdea&&_0x12cdea['name']!==_0x3bee1e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2d1d8b=_0x12cdea;var _0x3c23f4=_0x2d1d8b[_0x315b('0x21')]+'@'+config[_0x315b('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x3c23f4,_0x12ded2);})[_0x315b('0x16')](function(_0x266b67){if(_0x2d1d8b[_0x315b('0x1b')]){throw new Error(_0x315b('0xf'));}if(_0x4ec361[_0x315b('0x15')]>0x0){if(_0x2d1d8b['blocked']){if(moment(_0x2d1d8b[_0x315b('0x1d')])[_0x315b('0x22')](_0x4ec361[_0x315b('0x15')],_0x315b('0x23'))>moment()){throw new Error(_0x315b('0xf'));}return utils[_0x315b('0x24')](_0x2d1d8b,0x0,![],null)[_0x315b('0x16')](function(){return utils['getLicense'](_0x2d1d8b);})['then'](function(){return _0x1b1e4f(null,_0x2d1d8b);});}else{return utils['getLicense'](_0x2d1d8b)[_0x315b('0x16')](function(){return _0x1b1e4f(null,_0x2d1d8b);});}}else{return utils[_0x315b('0x25')](_0x2d1d8b)[_0x315b('0x16')](function(){return _0x1b1e4f(null,_0x2d1d8b);});}})['catch'](function(_0xafc4d6){return _0x1b1e4f(null,![],_0xafc4d6);});}function handleError(_0x3e4dae,_0x242e57,_0x5257e8){return _0x3e4dae[_0x315b('0x26')](_0x242e57||0x1f4)['send']({'message':_0x5257e8?_0x5257e8[_0x315b('0x27')]||_0x5257e8:''});}exports['login']=function(_0x17882e,_0xee52b9,_0x32709b){passport['authenticate'](_0x315b('0x28'),function(_0x2e3984,_0xaa5f27,_0x10d069){var _0x23a58e=_0x2e3984||_0x10d069;if(_0x23a58e){return handleError(_0xee52b9,0x191,_0x23a58e);}if(!_0xaa5f27){return handleError(_0xee52b9,0x194,{'message':_0x315b('0x29')});}else{var _0x297711={'payload':{'id':_0xaa5f27['id'],'role':_0xaa5f27[_0x315b('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x315b('0x2a')](_0x297711)[_0x315b('0x16')](function(_0x5cfdc4){_0xee52b9[_0x315b('0x2b')]({'id':_0xaa5f27['id'],'token':_0x5cfdc4,'statusCall':'','isAlreadyLogged':_0xaa5f27[_0x315b('0x1e')]});});}})(_0x17882e,_0xee52b9,_0x32709b);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x315b('0x21'),'passwordField':_0x315b('0x18')},function(_0x59b0dc,_0x79c44b,_0x58a90d){return ActiveDirectoryAuthenticate(db[_0x315b('0x2c')],_0x59b0dc,_0x79c44b,_0x58a90d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 814d631..7f34e9e 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf1fc=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x5e4813,_0x21ef94){var _0x3a18b5=function(_0xe5348){while(--_0xe5348){_0x5e4813['push'](_0x5e4813['shift']());}};_0x3a18b5(++_0x21ef94);}(_0xf1fc,0xfc));var _0xcf1f=function(_0x51fdab,_0x25059f){_0x51fdab=_0x51fdab-0x0;var _0x5ddf22=_0xf1fc[_0x51fdab];return _0x5ddf22;};'use strict';var express=require(_0xcf1f('0x0'));var router=express[_0xcf1f('0x1')]();var controller=require(_0xcf1f('0x2'));router[_0xcf1f('0x3')]('/',controller[_0xcf1f('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xdf60=['./authActiveDirectory.controller','post','login','express','Router'];(function(_0x443480,_0x23b513){var _0x560f6f=function(_0x43fc9c){while(--_0x43fc9c){_0x443480['push'](_0x443480['shift']());}};_0x560f6f(++_0x23b513);}(_0xdf60,0xf3));var _0x0df6=function(_0x1f686f,_0x26a753){_0x1f686f=_0x1f686f-0x0;var _0x1973f0=_0xdf60[_0x1f686f];return _0x1973f0;};'use strict';var express=require(_0x0df6('0x0'));var router=express[_0x0df6('0x1')]();var controller=require(_0x0df6('0x2'));router[_0x0df6('0x3')]('/',controller[_0x0df6('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index eff82f2..93a37b6 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7a54,0x106));var _0x47a5=function(_0x2a1645,_0x35d23f){_0x2a1645=_0x2a1645-0x0;var _0x17f545=_0x7a54[_0x2a1645];return _0x17f545;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x18d50f,_0x124aff){var _0x8ce385=function(_0x321962){while(--_0x321962){_0x18d50f['push'](_0x18d50f['shift']());}};_0x8ce385(++_0x124aff);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 211389e..d49c692 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 _0x3dc7=['login','/callback','callback','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3dc7,0x138));var _0x73dc=function(_0x51dc0f,_0x18379f){_0x51dc0f=_0x51dc0f-0x0;var _0x3d004e=_0x3dc7[_0x51dc0f];return _0x3d004e;};'use strict';var express=require(_0x73dc('0x0'));var passport=require(_0x73dc('0x1'));var router=express[_0x73dc('0x2')]();var controller=require(_0x73dc('0x3'));var userController=require(_0x73dc('0x4'));var authService=require(_0x73dc('0x5'));router[_0x73dc('0x6')]('/',controller[_0x73dc('0x7')]);router[_0x73dc('0x6')](_0x73dc('0x8'),controller[_0x73dc('0x9')],authService['isMiddleware'],userController[_0x73dc('0x7')],authService[_0x73dc('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x4532=['isMiddleware','setTokenCookie','passport','Router','../../components/auth/service','get','login','/callback'];(function(_0x40bc32,_0x428c83){var _0x2351e3=function(_0x3ba9f0){while(--_0x3ba9f0){_0x40bc32['push'](_0x40bc32['shift']());}};_0x2351e3(++_0x428c83);}(_0x4532,0x142));var _0x2453=function(_0x23a9c7,_0x22a546){_0x23a9c7=_0x23a9c7-0x0;var _0x56a791=_0x4532[_0x23a9c7];return _0x56a791;};'use strict';var express=require('express');var passport=require(_0x2453('0x0'));var router=express[_0x2453('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x2453('0x2'));router[_0x2453('0x3')]('/',controller[_0x2453('0x4')]);router[_0x2453('0x3')](_0x2453('0x5'),controller['callback'],authService[_0x2453('0x6')],userController[_0x2453('0x4')],authService[_0x2453('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 780560a..dc49482 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 _0x8d66=['body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','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','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','name','password','salt','role','blocked','blockedAt','admin','user','agent','then','authenticate','loginAttempts','disabled','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','Smtp','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','Email\x20parameter\x20is\x20missing','generate','toLowerCase','findOne','User','find'];(function(_0x18bfdb,_0x241d43){var _0x44334c=function(_0x55e999){while(--_0x55e999){_0x18bfdb['push'](_0x18bfdb['shift']());}};_0x44334c(++_0x241d43);}(_0x8d66,0x1c0));var _0x68d6=function(_0x48bb9c,_0x34c5f4){_0x48bb9c=_0x48bb9c-0x0;var _0x31cc55=_0x8d66[_0x48bb9c];return _0x31cc55;};'use strict';var util=require(_0x68d6('0x0'));var passport=require('passport');var LocalStrategy=require(_0x68d6('0x1'))[_0x68d6('0x2')];var jayson=require(_0x68d6('0x3'));var _=require(_0x68d6('0x4'));var rs=require(_0x68d6('0x5'));var moment=require('moment');var db=require(_0x68d6('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x68d6('0x7'));var client=jayson['client'][_0x68d6('0x8')]({'port':0x232b});function localAuthenticate(_0xf9a177,_0x3a58b,_0x5b17cc,_0x1c361d){var _0x48e223,_0x40424e;return db[_0x68d6('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x68d6('0xa'),_0x68d6('0xb')],'raw':!![]})['then'](function(_0x5b0366){_0x48e223=_0x5b0366;return _0xf9a177['findOne']({'attributes':['id',_0x68d6('0xc'),_0x68d6('0xd'),_0x68d6('0xe'),_0x68d6('0xf'),'disabled',_0x68d6('0x10'),_0x68d6('0x11'),'loginAttempts'],'where':{'name':_0x3a58b,'role':{'$or':[_0x68d6('0x12'),_0x68d6('0x13'),_0x68d6('0x14')]}}});})['then'](function(_0x2a4dbf){if(!_0x2a4dbf||_0x2a4dbf&&_0x2a4dbf[_0x68d6('0xc')]!==_0x3a58b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x40424e=_0x2a4dbf;return _0x40424e;}})[_0x68d6('0x15')](function(){_0x40424e[_0x68d6('0x16')](_0x5b17cc,function(_0x183e4f,_0xd2db08){var _0x5a522a=_0x40424e[_0x68d6('0x17')]+0x1;if(_0x183e4f){return _0x1c361d(_0x183e4f);}else if(!_0xd2db08){if(_0x40424e[_0x68d6('0x18')]){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x48e223['allowedLoginAttempts']>0x0){if(_0x40424e[_0x68d6('0x10')]){if(_0x48e223[_0x68d6('0xb')]>0x0){if(moment(_0x40424e[_0x68d6('0x11')])[_0x68d6('0x19')](_0x48e223['blockDuration'],'minutes')>moment()){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else{return utils[_0x68d6('0x1b')](_0x40424e,_0x5a522a,![],null)[_0x68d6('0x15')](function(){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});});}}else{return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}}else{if(_0x5a522a>=_0x48e223[_0x68d6('0xa')]){return utils['clearBlockUser'](_0x40424e,0x0,!![],moment())[_0x68d6('0x15')](function(){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x40424e,_0x5a522a,![],null)['then'](function(){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});});}}}else{return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}}else{if(_0x40424e[_0x68d6('0x18')]){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else if(_0x48e223['allowedLoginAttempts']>0x0){if(_0x40424e['blocked']){if(_0x48e223[_0x68d6('0xb')]>0x0){if(moment(_0x40424e[_0x68d6('0x11')])[_0x68d6('0x19')](_0x48e223[_0x68d6('0xb')],_0x68d6('0x1c'))>moment()){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x68d6('0x1b')](_0x40424e,0x0,![],null)[_0x68d6('0x15')](function(){return utils['getLicense'](_0x40424e);})[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);});}}else{return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x68d6('0x1b')](_0x40424e,0x0,![],null)['then'](function(){return utils[_0x68d6('0x1d')](_0x40424e);})[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);})[_0x68d6('0x1e')](function(_0x59bb3a){return _0x1c361d(null,![],_0x59bb3a);});}}else{if(_0x40424e[_0x68d6('0x10')]){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else{return utils[_0x68d6('0x1d')](_0x40424e)[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);});}}}});})[_0x68d6('0x1e')](function(_0x583e1c){return _0x1c361d(null,![],_0x583e1c);});}function sendServiceMail(_0x6be2db){return db[_0x68d6('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x68d6('0xc'),_0x68d6('0x20')],'include':[{'model':db[_0x68d6('0x21')],'as':'Smtp','include':[{'model':db[_0x68d6('0x22')],'as':_0x68d6('0x22')}]}]})[_0x68d6('0x15')](function(_0x3a6c18){if(!_0x3a6c18){throw new Error(_0x68d6('0x23'));}var _0x125743=_0x3a6c18[_0x68d6('0x24')]();var _0x7251bc={'account':_0x125743,'message':_['merge']({'from':util[_0x68d6('0x25')]('\x22%s\x22\x20<%s>',_0x3a6c18['name'],_0x3a6c18[_0x68d6('0x20')]||_0x3a6c18[_0x68d6('0x26')][_0x68d6('0x13')])},_0x6be2db)};return client['request'](_0x68d6('0x27'),_0x7251bc);})[_0x68d6('0x15')](function(_0xc16799){if(_0xc16799['error']){throw new Error(util[_0x68d6('0x25')](_0x68d6('0x28'),_0xc16799['error'][_0x68d6('0x29')]||JSON['stringify'](_0xc16799[_0x68d6('0x2a')])));}return!![];});}function handleError(_0x15b202,_0x31d00b,_0x12067c){return _0x15b202[_0x68d6('0x2b')](_0x31d00b||0x1f4)[_0x68d6('0x2c')]({'message':_0x12067c?_0x12067c[_0x68d6('0x29')]||_0x12067c:''});}exports[_0x68d6('0x2d')]=function(_0x31781d,_0x529626,_0x512448){passport[_0x68d6('0x16')](_0x68d6('0x2e'),function(_0x103cc0,_0x1ad9d6,_0x3931dd){var _0x11c8d0=_0x103cc0||_0x3931dd;if(_0x11c8d0){return handleError(_0x529626,0x191,_0x11c8d0);}if(!_0x1ad9d6){return handleError(_0x529626,0x194,{'message':_0x68d6('0x2f')});}else{var _0x44a44c={'payload':{'id':_0x1ad9d6['id'],'role':_0x1ad9d6[_0x68d6('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x68d6('0x30')](_0x44a44c)[_0x68d6('0x15')](function(_0x356397){_0x529626['json']({'id':_0x1ad9d6['id'],'token':_0x356397,'statusCall':'','isAlreadyLogged':_0x1ad9d6['online']});});}})(_0x31781d,_0x529626,_0x512448);};exports[_0x68d6('0x31')]=function(_0x32acba,_0x141093){if(!_0x32acba['body'][_0x68d6('0x20')]){return handleError(_0x141093,0x1f4,{'message':_0x68d6('0x32')});}var _0x127908=rs[_0x68d6('0x33')]();_0x32acba['body'][_0x68d6('0x20')]=_0x32acba['body'][_0x68d6('0x20')]['trim']()[_0x68d6('0x34')]();var _0x213c7a;return db[_0x68d6('0x9')][_0x68d6('0x35')]({'where':{'id':0x1},'attributes':[_0x68d6('0xa'),_0x68d6('0xb')],'raw':!![]})[_0x68d6('0x15')](function(_0x4338ba){_0x213c7a=_0x4338ba;return db[_0x68d6('0x36')][_0x68d6('0x37')]({'where':{'email':_0x32acba[_0x68d6('0x38')]['email']}});})['then'](function(_0x47f03c){if(!_0x47f03c){throw new Error(_0x68d6('0x39'));}if(_0x47f03c[_0x68d6('0x18')]){throw new Error(_0x68d6('0x3a'));}if(_0x47f03c[_0x68d6('0x10')]){if(moment(_0x47f03c['blockedAt'])[_0x68d6('0x19')](_0x213c7a[_0x68d6('0xb')],_0x68d6('0x1c'))>moment()){throw new Error(_0x68d6('0x3b'));}else{_0x47f03c[_0x68d6('0x10')]=![];_0x47f03c[_0x68d6('0x11')]=null;}}_0x47f03c['resetPasswordToken']=_0x127908;_0x47f03c[_0x68d6('0x3c')]=Date[_0x68d6('0x3d')]()+0x36ee80;return _0x47f03c[_0x68d6('0x3e')]();})[_0x68d6('0x15')](function(){return sendServiceMail({'to':_0x32acba[_0x68d6('0x38')]['email'],'subject':_0x68d6('0x3f'),'text':_0x68d6('0x40')+_0x68d6('0x41')+_0x68d6('0x42')+_0x32acba[_0x68d6('0x43')][_0x68d6('0x44')]+'/reset/'+_0x127908+'\x0a\x0a'+_0x68d6('0x45')});})['then'](function(){_0x141093[_0x68d6('0x2b')](0xc8)[_0x68d6('0x2c')]({'message':_0x68d6('0x46')});})['catch'](function(_0x4771c0){return handleError(_0x141093,0x1f4,_0x4771c0);});};exports[_0x68d6('0x47')]=function(_0x3f266b,_0x557bbe){return db[_0x68d6('0x36')][_0x68d6('0x37')]({'where':{'resetPasswordToken':_0x3f266b[_0x68d6('0x48')][_0x68d6('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x68d6('0x15')](function(_0x398b73){if(!_0x398b73){throw new Error(_0x68d6('0x4a'));}return db['Setting'][_0x68d6('0x35')]({'attributes':['id',_0x68d6('0x4b'),_0x68d6('0x4c'),'passwordHistoryLimit']})[_0x68d6('0x15')](function(_0x127b1a){if(_0x127b1a[_0x68d6('0x4b')])authService[_0x68d6('0x4d')](_0x3f266b['body'][_0x68d6('0xd')]);if(!_0x127b1a[_0x68d6('0x4c')]||!_0x398b73[_0x68d6('0x4e')])return _0x398b73;authService[_0x68d6('0x4f')](_0x3f266b[_0x68d6('0x38')][_0x68d6('0xd')],_0x398b73[_0x68d6('0x4e')],_0x127b1a[_0x68d6('0x50')]);return _0x398b73;})[_0x68d6('0x15')](function(){_0x398b73[_0x68d6('0xd')]=_0x3f266b[_0x68d6('0x38')][_0x68d6('0xd')];_0x398b73[_0x68d6('0x51')]=null;_0x398b73[_0x68d6('0x3c')]=null;return _0x398b73[_0x68d6('0x3e')]();});})['then'](function(){_0x557bbe[_0x68d6('0x2b')](0xc8)[_0x68d6('0x2c')]({'message':_0x68d6('0x52')});})['catch'](function(_0xe75d77){return handleError(_0x557bbe,0x1f4,_0xe75d77);});};passport[_0x68d6('0x53')](_0x68d6('0x2e'),new LocalStrategy({'usernameField':_0x68d6('0xc'),'passwordField':_0x68d6('0xd')},function(_0x3e26ee,_0x297aca,_0x53bb46){return localAuthenticate(db[_0x68d6('0x36')],_0x3e26ee,_0x297aca,_0x53bb46);}));
\ No newline at end of file
+var _0x5a2f=['Password\x20reset!','use','local-login','util','passport','Strategy','jayson/promise','randomstring','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','catch','getLicense','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','login','authenticate','signToken','json','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory'];(function(_0x47ff3d,_0x5c9fd1){var _0x3fba05=function(_0x44d3ff){while(--_0x44d3ff){_0x47ff3d['push'](_0x47ff3d['shift']());}};_0x3fba05(++_0x5c9fd1);}(_0x5a2f,0x9b));var _0xf5a2=function(_0x1a950c,_0x44e719){_0x1a950c=_0x1a950c-0x0;var _0x529b82=_0x5a2f[_0x1a950c];return _0x529b82;};'use strict';var util=require(_0xf5a2('0x0'));var passport=require(_0xf5a2('0x1'));var LocalStrategy=require('passport-local')[_0xf5a2('0x2')];var jayson=require(_0xf5a2('0x3'));var _=require('lodash');var rs=require(_0xf5a2('0x4'));var moment=require('moment');var db=require(_0xf5a2('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf5a2('0x6'));var client=jayson['client'][_0xf5a2('0x7')]({'port':0x232b});function localAuthenticate(_0xd5cc62,_0x310122,_0x5500ed,_0x18437d){var _0x53c97c,_0x4d2df8;return db[_0xf5a2('0x8')][_0xf5a2('0x9')]({'where':{'id':0x1},'attributes':[_0xf5a2('0xa'),_0xf5a2('0xb')],'raw':!![]})[_0xf5a2('0xc')](function(_0x254afe){_0x53c97c=_0x254afe;return _0xd5cc62[_0xf5a2('0x9')]({'attributes':['id',_0xf5a2('0xd'),_0xf5a2('0xe'),_0xf5a2('0xf'),_0xf5a2('0x10'),_0xf5a2('0x11'),_0xf5a2('0x12'),_0xf5a2('0x13'),'loginAttempts'],'where':{'name':_0x310122,'role':{'$or':[_0xf5a2('0x14'),_0xf5a2('0x15'),_0xf5a2('0x16')]}}});})[_0xf5a2('0xc')](function(_0x4e7422){if(!_0x4e7422||_0x4e7422&&_0x4e7422[_0xf5a2('0xd')]!==_0x310122){throw new Error(_0xf5a2('0x17'));}else{_0x4d2df8=_0x4e7422;return _0x4d2df8;}})[_0xf5a2('0xc')](function(){_0x4d2df8['authenticate'](_0x5500ed,function(_0x30c63f,_0x2f376a){var _0x5b3251=_0x4d2df8[_0xf5a2('0x18')]+0x1;if(_0x30c63f){return _0x18437d(_0x30c63f);}else if(!_0x2f376a){if(_0x4d2df8[_0xf5a2('0x11')]){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}else if(_0x53c97c[_0xf5a2('0xa')]>0x0){if(_0x4d2df8[_0xf5a2('0x12')]){if(_0x53c97c[_0xf5a2('0xb')]>0x0){if(moment(_0x4d2df8['blockedAt'])['add'](_0x53c97c['blockDuration'],_0xf5a2('0x19'))>moment()){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}else{return utils[_0xf5a2('0x1a')](_0x4d2df8,_0x5b3251,![],null)[_0xf5a2('0xc')](function(){return _0x18437d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}}else{if(_0x5b3251>=_0x53c97c[_0xf5a2('0xa')]){return utils['clearBlockUser'](_0x4d2df8,0x0,!![],moment())[_0xf5a2('0xc')](function(){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});});}else{return utils[_0xf5a2('0x1a')](_0x4d2df8,_0x5b3251,![],null)[_0xf5a2('0xc')](function(){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});});}}}else{return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}}else{if(_0x4d2df8[_0xf5a2('0x11')]){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}else if(_0x53c97c[_0xf5a2('0xa')]>0x0){if(_0x4d2df8['blocked']){if(_0x53c97c[_0xf5a2('0xb')]>0x0){if(moment(_0x4d2df8[_0xf5a2('0x13')])['add'](_0x53c97c[_0xf5a2('0xb')],_0xf5a2('0x19'))>moment()){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}else{return utils[_0xf5a2('0x1a')](_0x4d2df8,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4d2df8);})[_0xf5a2('0xc')](function(){return _0x18437d(null,_0x4d2df8);});}}else{return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}}else{return utils['clearBlockUser'](_0x4d2df8,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4d2df8);})[_0xf5a2('0xc')](function(){return _0x18437d(null,_0x4d2df8);})[_0xf5a2('0x1b')](function(_0x2c9ed4){return _0x18437d(null,![],_0x2c9ed4);});}}else{if(_0x4d2df8[_0xf5a2('0x12')]){return _0x18437d(null,![],{'message':_0xf5a2('0x17')});}else{return utils[_0xf5a2('0x1c')](_0x4d2df8)[_0xf5a2('0xc')](function(){return _0x18437d(null,_0x4d2df8);});}}}});})[_0xf5a2('0x1b')](function(_0x449f19){return _0x18437d(null,![],_0x449f19);});}function sendServiceMail(_0x5a8337){return db['MailAccount'][_0xf5a2('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xf5a2('0xd'),'email'],'include':[{'model':db[_0xf5a2('0x1e')],'as':_0xf5a2('0x1f'),'include':[{'model':db[_0xf5a2('0x20')],'as':'CloudProvider'}]}]})[_0xf5a2('0xc')](function(_0x40e906){if(!_0x40e906){throw new Error(_0xf5a2('0x21'));}var _0x2ee658=_0x40e906[_0xf5a2('0x22')]();var _0x3c6b42={'account':_0x2ee658,'message':_[_0xf5a2('0x23')]({'from':util[_0xf5a2('0x24')](_0xf5a2('0x25'),_0x40e906[_0xf5a2('0xd')],_0x40e906['email']||_0x40e906[_0xf5a2('0x1f')][_0xf5a2('0x15')])},_0x5a8337)};return client[_0xf5a2('0x26')]('SendMail',_0x3c6b42);})[_0xf5a2('0xc')](function(_0x2f28c6){if(_0x2f28c6[_0xf5a2('0x27')]){throw new Error(util[_0xf5a2('0x24')](_0xf5a2('0x28'),_0x2f28c6['error']['message']||JSON['stringify'](_0x2f28c6[_0xf5a2('0x27')])));}return!![];});}function handleError(_0x4b5f2c,_0x36415e,_0x298170){return _0x4b5f2c[_0xf5a2('0x29')](_0x36415e||0x1f4)[_0xf5a2('0x2a')]({'message':_0x298170?_0x298170['message']||_0x298170:''});}exports[_0xf5a2('0x2b')]=function(_0x5f47de,_0x34086f,_0x47e3ef){passport[_0xf5a2('0x2c')]('local-login',function(_0x30b6bb,_0x1252b1,_0x6b1ce5){var _0x227c1f=_0x30b6bb||_0x6b1ce5;if(_0x227c1f){return handleError(_0x34086f,0x191,_0x227c1f);}if(!_0x1252b1){return handleError(_0x34086f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x13113d={'payload':{'id':_0x1252b1['id'],'role':_0x1252b1['role']},'options':{'expiresIn':0x15180}};return authService[_0xf5a2('0x2d')](_0x13113d)[_0xf5a2('0xc')](function(_0x538740){_0x34086f[_0xf5a2('0x2e')]({'id':_0x1252b1['id'],'token':_0x538740,'statusCall':'','isAlreadyLogged':_0x1252b1['online']});});}})(_0x5f47de,_0x34086f,_0x47e3ef);};exports['forgot']=function(_0x303263,_0x373aa8){if(!_0x303263[_0xf5a2('0x2f')][_0xf5a2('0x30')]){return handleError(_0x373aa8,0x1f4,{'message':_0xf5a2('0x31')});}var _0x56eadf=rs['generate']();_0x303263['body']['email']=_0x303263['body']['email'][_0xf5a2('0x32')]()[_0xf5a2('0x33')]();var _0x35749f;return db['Setting'][_0xf5a2('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf5a2('0xc')](function(_0x32de55){_0x35749f=_0x32de55;return db[_0xf5a2('0x34')]['find']({'where':{'email':_0x303263[_0xf5a2('0x2f')][_0xf5a2('0x30')]}});})[_0xf5a2('0xc')](function(_0xfe151f){if(!_0xfe151f){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xfe151f[_0xf5a2('0x11')]){throw new Error(_0xf5a2('0x35'));}if(_0xfe151f[_0xf5a2('0x12')]){if(moment(_0xfe151f[_0xf5a2('0x13')])['add'](_0x35749f[_0xf5a2('0xb')],_0xf5a2('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xfe151f[_0xf5a2('0x12')]=![];_0xfe151f[_0xf5a2('0x13')]=null;}}_0xfe151f[_0xf5a2('0x36')]=_0x56eadf;_0xfe151f[_0xf5a2('0x37')]=Date[_0xf5a2('0x38')]()+0x36ee80;return _0xfe151f[_0xf5a2('0x39')]();})[_0xf5a2('0xc')](function(){return sendServiceMail({'to':_0x303263['body'][_0xf5a2('0x30')],'subject':_0xf5a2('0x3a'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf5a2('0x3b')+_0x303263[_0xf5a2('0x3c')][_0xf5a2('0x3d')]+_0xf5a2('0x3e')+_0x56eadf+'\x0a\x0a'+_0xf5a2('0x3f')});})[_0xf5a2('0xc')](function(){_0x373aa8['status'](0xc8)['send']({'message':_0xf5a2('0x40')});})[_0xf5a2('0x1b')](function(_0x38878d){return handleError(_0x373aa8,0x1f4,_0x38878d);});};exports[_0xf5a2('0x41')]=function(_0x160c90,_0x4c7f19){return db['User'][_0xf5a2('0x1d')]({'where':{'resetPasswordToken':_0x160c90['params'][_0xf5a2('0x42')],'resetPasswordExpires':{'$gt':Date[_0xf5a2('0x38')]()}}})[_0xf5a2('0xc')](function(_0x5cb67c){if(!_0x5cb67c){throw new Error(_0xf5a2('0x43'));}return db['Setting'][_0xf5a2('0x9')]({'attributes':['id',_0xf5a2('0x44'),_0xf5a2('0x45'),_0xf5a2('0x46')]})['then'](function(_0x1a5c48){if(_0x1a5c48[_0xf5a2('0x44')])authService['validatePasswordPattern'](_0x160c90[_0xf5a2('0x2f')][_0xf5a2('0xe')]);if(!_0x1a5c48['enforcePasswordHistory']||!_0x5cb67c[_0xf5a2('0x47')])return _0x5cb67c;authService[_0xf5a2('0x48')](_0x160c90[_0xf5a2('0x2f')][_0xf5a2('0xe')],_0x5cb67c['previousPasswords'],_0x1a5c48[_0xf5a2('0x46')]);return _0x5cb67c;})['then'](function(){_0x5cb67c['password']=_0x160c90[_0xf5a2('0x2f')]['password'];_0x5cb67c[_0xf5a2('0x36')]=null;_0x5cb67c[_0xf5a2('0x37')]=null;return _0x5cb67c[_0xf5a2('0x39')]();});})[_0xf5a2('0xc')](function(){_0x4c7f19['status'](0xc8)['send']({'message':_0xf5a2('0x49')});})[_0xf5a2('0x1b')](function(_0x50059d){return handleError(_0x4c7f19,0x1f4,_0x50059d);});};passport[_0xf5a2('0x4a')](_0xf5a2('0x4b'),new LocalStrategy({'usernameField':_0xf5a2('0xd'),'passwordField':_0xf5a2('0xe')},function(_0x526c7a,_0x4f1f9a,_0x3bcf0b){return localAuthenticate(db[_0xf5a2('0x34')],_0x526c7a,_0x4f1f9a,_0x3bcf0b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3ae3741..15eec9e 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 _0x6914=['Router','./authLocal.controller','post','login','/reset/:token','reset','express'];(function(_0x39b8a8,_0x25ca73){var _0x34737e=function(_0x699b){while(--_0x699b){_0x39b8a8['push'](_0x39b8a8['shift']());}};_0x34737e(++_0x25ca73);}(_0x6914,0xd8));var _0x4691=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x6914[_0x12fc8d];return _0x3f9d04;};'use strict';var express=require(_0x4691('0x0'));var router=express[_0x4691('0x1')]();var controller=require(_0x4691('0x2'));router[_0x4691('0x3')]('/',controller[_0x4691('0x4')]);router[_0x4691('0x3')]('/forgot',controller['forgot']);router['post'](_0x4691('0x5'),controller[_0x4691('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x76c6=['login','/forgot','forgot','/reset/:token','reset','Router','./authLocal.controller','post'];(function(_0x10cc81,_0x172700){var _0x3bbe1e=function(_0x319ed2){while(--_0x319ed2){_0x10cc81['push'](_0x10cc81['shift']());}};_0x3bbe1e(++_0x172700);}(_0x76c6,0xed));var _0x676c=function(_0x490048,_0x32c740){_0x490048=_0x490048-0x0;var _0x34212d=_0x76c6[_0x490048];return _0x34212d;};'use strict';var express=require('express');var router=express[_0x676c('0x0')]();var controller=require(_0x676c('0x1'));router[_0x676c('0x2')]('/',controller[_0x676c('0x3')]);router[_0x676c('0x2')](_0x676c('0x4'),controller[_0x676c('0x5')]);router[_0x676c('0x2')](_0x676c('0x6'),controller[_0x676c('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9e63b8a..b4b4005 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 _0xb3eb=['exports','STRING','INTEGER','sequelize'];(function(_0x5505b7,_0x5e1ab5){var _0x4e58d1=function(_0x368e17){while(--_0x368e17){_0x5505b7['push'](_0x5505b7['shift']());}};_0x4e58d1(++_0x5e1ab5);}(_0xb3eb,0x127));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbb3e('0x0'));module[_0xbb3e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xbb3e('0x2')]},'description':{'type':Sequelize[_0xbb3e('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbb3e('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa2aa=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x4a3acd,_0x4bf641){var _0x3efdaa=function(_0x32842d){while(--_0x32842d){_0x4a3acd['push'](_0x4a3acd['shift']());}};_0x3efdaa(++_0x4bf641);}(_0xa2aa,0xdc));var _0xaa2a=function(_0x346aef,_0x1d1870){_0x346aef=_0x346aef-0x0;var _0x2eeacb=_0xa2aa[_0x346aef];return _0x2eeacb;};'use strict';var Sequelize=require(_0xaa2a('0x0'));module[_0xaa2a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa2a('0x2')]},'status':{'type':Sequelize[_0xaa2a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xaa2a('0x4')],'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 bf6e830..4c6f6c5 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 _0x5442=['to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../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','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','Automation','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','rawAttributes','length','find','create','body','update','addConditions','Condition','ids','getConditions','findOne','Action','omit','getActions','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x5442,0xf3));var _0x2544=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x5442[_0x5c7a85];return _0x35290f;};'use strict';var emlformat=require(_0x2544('0x0'));var rimraf=require(_0x2544('0x1'));var zipdir=require(_0x2544('0x2'));var jsonpatch=require(_0x2544('0x3'));var rp=require(_0x2544('0x4'));var moment=require(_0x2544('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2544('0x6'));var util=require(_0x2544('0x7'));var path=require(_0x2544('0x8'));var sox=require('sox');var csv=require(_0x2544('0x9'));var ejs=require(_0x2544('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2544('0xb'));var crypto=require(_0x2544('0xc'));var jsforce=require(_0x2544('0xd'));var deskjs=require(_0x2544('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2544('0xf'));var Redis=require('ioredis');var authService=require(_0x2544('0x10'));var qs=require(_0x2544('0x11'));var as=require(_0x2544('0x12'));var hardwareService=require(_0x2544('0x13'));var logger=require(_0x2544('0x14'))(_0x2544('0x15'));var utils=require(_0x2544('0x16'));var config=require(_0x2544('0x17'));var licenseUtil=require(_0x2544('0x18'));var db=require(_0x2544('0x19'))['db'];function respondWithStatusCode(_0x303a76,_0x472155){_0x472155=_0x472155||0xcc;return function(_0x14b1a9){if(_0x14b1a9){return _0x303a76[_0x2544('0x1a')](_0x472155);}return _0x303a76['status'](_0x472155)['end']();};}function respondWithResult(_0x3bdb47,_0x451c11){_0x451c11=_0x451c11||0xc8;return function(_0x401e97){if(_0x401e97){return _0x3bdb47[_0x2544('0x1b')](_0x451c11)[_0x2544('0x1c')](_0x401e97);}};}function respondWithFilteredResult(_0x5e5401,_0xca1d77){return function(_0x102a03){if(_0x102a03){var _0x4d934d=typeof _0xca1d77[_0x2544('0x1d')]===_0x2544('0x1e')&&typeof _0xca1d77[_0x2544('0x1f')]===_0x2544('0x1e');var _0xc19ad8=_0x102a03[_0x2544('0x20')];var _0x2870eb=_0x4d934d?0x0:_0xca1d77['offset'];var _0x96cfac=_0x4d934d?_0x102a03[_0x2544('0x20')]:_0xca1d77[_0x2544('0x1d')]+_0xca1d77['limit'];var _0x1e9110;if(_0x96cfac>=_0xc19ad8){_0x96cfac=_0xc19ad8;_0x1e9110=0xc8;}else{_0x1e9110=0xce;}_0x5e5401[_0x2544('0x1b')](_0x1e9110);return _0x5e5401['set'](_0x2544('0x21'),_0x2870eb+'-'+_0x96cfac+'/'+_0xc19ad8)[_0x2544('0x1c')](_0x102a03);}return null;};}function patchUpdates(_0x15fa11){return function(_0x1366d2){try{jsonpatch[_0x2544('0x22')](_0x1366d2,_0x15fa11,!![]);}catch(_0x2be4f8){return BPromise[_0x2544('0x23')](_0x2be4f8);}return _0x1366d2[_0x2544('0x24')]();};}function saveUpdates(_0x3928a7,_0xc0f864){return function(_0x34b1a1){if(_0x34b1a1){return _0x34b1a1['update'](_0x3928a7)[_0x2544('0x25')](function(_0x2b3d7d){return _0x2b3d7d;});}return null;};}function removeEntity(_0x14dfb2,_0x36156d){return function(_0x2dc649){if(_0x2dc649){return _0x2dc649[_0x2544('0x26')]()[_0x2544('0x25')](function(){_0x14dfb2[_0x2544('0x1b')](0xcc)[_0x2544('0x27')]();});}};}function handleEntityNotFound(_0x487b18,_0x3c17ca){return function(_0x36d6ec){if(!_0x36d6ec){_0x487b18[_0x2544('0x1a')](0x194);}return _0x36d6ec;};}function handleError(_0xeec4e6,_0x3d26a6){_0x3d26a6=_0x3d26a6||0x1f4;return function(_0x53ab39){logger['error'](_0x53ab39[_0x2544('0x28')]);if(_0x53ab39[_0x2544('0x29')]){delete _0x53ab39[_0x2544('0x29')];}_0xeec4e6[_0x2544('0x1b')](_0x3d26a6)[_0x2544('0x2a')](_0x53ab39);};}exports[_0x2544('0x2b')]=function(_0x1d289e,_0x3f55ab){var _0x42252={},_0x2029c0={},_0x427ed4={'count':0x0,'rows':[]};var _0x511d6c=_[_0x2544('0x2c')](db[_0x2544('0x2d')]['rawAttributes'],function(_0x401b84){return{'name':_0x401b84['fieldName'],'type':_0x401b84[_0x2544('0x2e')][_0x2544('0x2f')]};});_0x2029c0[_0x2544('0x30')]=_[_0x2544('0x2c')](_0x511d6c,'name');_0x2029c0[_0x2544('0x31')]=_['keys'](_0x1d289e['query']);_0x2029c0[_0x2544('0x32')]=_[_0x2544('0x33')](_0x2029c0[_0x2544('0x30')],_0x2029c0['query']);_0x42252[_0x2544('0x34')]=_[_0x2544('0x33')](_0x2029c0[_0x2544('0x30')],qs['fields'](_0x1d289e['query'][_0x2544('0x35')]));_0x42252[_0x2544('0x34')]=_0x42252[_0x2544('0x34')]['length']?_0x42252[_0x2544('0x34')]:_0x2029c0[_0x2544('0x30')];if(!_0x1d289e['query'][_0x2544('0x36')](_0x2544('0x37'))){_0x42252[_0x2544('0x1f')]=qs['limit'](_0x1d289e['query'][_0x2544('0x1f')]);_0x42252[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x1d289e[_0x2544('0x31')][_0x2544('0x1d')]);}_0x42252[_0x2544('0x38')]=qs['sort'](_0x1d289e['query']['sort']);_0x42252['where']=qs[_0x2544('0x32')](_[_0x2544('0x39')](_0x1d289e['query'],_0x2029c0[_0x2544('0x32')]),_0x511d6c);if(_0x1d289e[_0x2544('0x31')][_0x2544('0x3a')]){_0x42252[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x42252['where'],{'$or':_['map'](_0x511d6c,function(_0x4da934){if(_0x4da934[_0x2544('0x2e')]!==_0x2544('0x3d')){var _0x50bca3={};_0x50bca3[_0x4da934[_0x2544('0x29')]]={'$like':'%'+_0x1d289e[_0x2544('0x31')][_0x2544('0x3a')]+'%'};return _0x50bca3;}})});}_0x42252=_['merge']({},_0x42252,_0x1d289e[_0x2544('0x3e')]);var _0x32fedc={'where':_0x42252['where']};return db['Automation'][_0x2544('0x20')](_0x32fedc)[_0x2544('0x25')](function(_0x19951e){_0x427ed4[_0x2544('0x20')]=_0x19951e;if(_0x1d289e[_0x2544('0x31')][_0x2544('0x3f')]){_0x42252[_0x2544('0x40')]=[{'all':!![]}];}return db[_0x2544('0x2d')]['findAll'](_0x42252);})[_0x2544('0x25')](function(_0x276618){_0x427ed4['rows']=_0x276618;return _0x427ed4;})['then'](respondWithFilteredResult(_0x3f55ab,_0x42252))[_0x2544('0x41')](handleError(_0x3f55ab,null));};exports[_0x2544('0x42')]=function(_0x2a2a4d,_0x551e93){var _0x2c47c5={'raw':![],'where':{'id':_0x2a2a4d[_0x2544('0x43')]['id']}},_0x6df698={};_0x6df698[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x2d')][_0x2544('0x45')]);_0x6df698[_0x2544('0x31')]=_[_0x2544('0x44')](_0x2a2a4d[_0x2544('0x31')]);_0x6df698['filters']=_['intersection'](_0x6df698[_0x2544('0x30')],_0x6df698[_0x2544('0x31')]);_0x2c47c5[_0x2544('0x34')]=_[_0x2544('0x33')](_0x6df698[_0x2544('0x30')],qs['fields'](_0x2a2a4d[_0x2544('0x31')][_0x2544('0x35')]));_0x2c47c5['attributes']=_0x2c47c5['attributes'][_0x2544('0x46')]?_0x2c47c5['attributes']:_0x6df698[_0x2544('0x30')];if(_0x2a2a4d[_0x2544('0x31')][_0x2544('0x3f')]){_0x2c47c5[_0x2544('0x40')]=[{'all':!![]}];}_0x2c47c5=_[_0x2544('0x3c')]({},_0x2c47c5,_0x2a2a4d[_0x2544('0x3e')]);return db[_0x2544('0x2d')][_0x2544('0x47')](_0x2c47c5)[_0x2544('0x25')](handleEntityNotFound(_0x551e93,null))[_0x2544('0x25')](respondWithResult(_0x551e93,null))['catch'](handleError(_0x551e93,null));};exports[_0x2544('0x48')]=function(_0x4e8673,_0x1491ce){return db['Automation'][_0x2544('0x48')](_0x4e8673[_0x2544('0x49')],{})[_0x2544('0x25')](respondWithResult(_0x1491ce,0xc9))[_0x2544('0x41')](handleError(_0x1491ce,null));};exports[_0x2544('0x4a')]=function(_0x493331,_0x30d8d2){if(_0x493331['body']['id']){delete _0x493331[_0x2544('0x49')]['id'];}return db[_0x2544('0x2d')][_0x2544('0x47')]({'where':{'id':_0x493331[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x30d8d2,null))[_0x2544('0x25')](saveUpdates(_0x493331['body'],null))['then'](respondWithResult(_0x30d8d2,null))[_0x2544('0x41')](handleError(_0x30d8d2,null));};exports[_0x2544('0x26')]=function(_0x186b0f,_0x2aeac7){return db['Automation'][_0x2544('0x47')]({'where':{'id':_0x186b0f[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x2aeac7,null))['then'](removeEntity(_0x2aeac7,null))[_0x2544('0x41')](handleError(_0x2aeac7,null));};exports[_0x2544('0x4b')]=function(_0x5b4de5,_0x3701b2,_0x19dfa8){return db[_0x2544('0x4c')][_0x2544('0x47')]({'where':{'id':_0x5b4de5[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x3701b2,null))['then'](function(_0x419720){if(_0x419720){return _0x419720['addConditions'](_0x5b4de5[_0x2544('0x49')][_0x2544('0x4d')],_['omit'](_0x5b4de5['body'],[_0x2544('0x4d'),'id'])||{});}})[_0x2544('0x25')](respondWithResult(_0x3701b2,null))[_0x2544('0x41')](handleError(_0x3701b2,null));};exports[_0x2544('0x4e')]=function(_0x127fd3,_0x241089,_0x2c4149){var _0x46b820={};var _0x39d5d6={};var _0x2007ee;var _0x781233;return db[_0x2544('0x2d')][_0x2544('0x4f')]({'where':{'id':_0x127fd3['params']['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x241089,null))['then'](function(_0x4f0474){if(_0x4f0474){_0x2007ee=_0x4f0474;_0x39d5d6[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x4c')][_0x2544('0x45')]);_0x39d5d6[_0x2544('0x31')]=_[_0x2544('0x44')](_0x127fd3['query']);_0x39d5d6[_0x2544('0x32')]=_['intersection'](_0x39d5d6[_0x2544('0x30')],_0x39d5d6['query']);_0x46b820[_0x2544('0x34')]=_[_0x2544('0x33')](_0x39d5d6[_0x2544('0x30')],qs['fields'](_0x127fd3[_0x2544('0x31')]['fields']));_0x46b820['attributes']=_0x46b820['attributes']['length']?_0x46b820[_0x2544('0x34')]:_0x39d5d6['model'];_0x46b820['order']=qs['sort'](_0x127fd3[_0x2544('0x31')]['sort']);_0x46b820[_0x2544('0x3b')]=qs['filters'](_[_0x2544('0x39')](_0x127fd3[_0x2544('0x31')],_0x39d5d6[_0x2544('0x32')]));if(_0x127fd3[_0x2544('0x31')][_0x2544('0x3a')]){_0x46b820[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x46b820[_0x2544('0x3b')],{'$or':_[_0x2544('0x2c')](_0x46b820['attributes'],function(_0x3d98f9){var _0xa8f35d={};_0xa8f35d[_0x3d98f9]={'$like':'%'+_0x127fd3['query']['filter']+'%'};return _0xa8f35d;})});}_0x46b820=_[_0x2544('0x3c')]({},_0x46b820,_0x127fd3['options']);return _0x2007ee[_0x2544('0x4e')](_0x46b820);}})[_0x2544('0x25')](function(_0x5f4b42){if(_0x5f4b42){_0x781233=_0x5f4b42[_0x2544('0x46')];if(!_0x127fd3[_0x2544('0x31')][_0x2544('0x36')](_0x2544('0x37'))){_0x46b820[_0x2544('0x1f')]=qs[_0x2544('0x1f')](_0x127fd3[_0x2544('0x31')][_0x2544('0x1f')]);_0x46b820[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x127fd3[_0x2544('0x31')][_0x2544('0x1d')]);}return _0x2007ee[_0x2544('0x4e')](_0x46b820);}})['then'](function(_0x40d37b){if(_0x40d37b){return _0x40d37b?{'count':_0x781233,'rows':_0x40d37b}:null;}})['then'](respondWithResult(_0x241089,null))[_0x2544('0x41')](handleError(_0x241089,null));};exports['addActions']=function(_0x40a622,_0x44cd33,_0x4c4d7a){return db[_0x2544('0x50')][_0x2544('0x47')]({'where':{'id':_0x40a622[_0x2544('0x43')]['id']}})['then'](handleEntityNotFound(_0x44cd33,null))[_0x2544('0x25')](function(_0x2d60cf){if(_0x2d60cf){return _0x2d60cf['addActions'](_0x40a622[_0x2544('0x49')][_0x2544('0x4d')],_[_0x2544('0x51')](_0x40a622[_0x2544('0x49')],[_0x2544('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x44cd33,null))[_0x2544('0x41')](handleError(_0x44cd33,null));};exports[_0x2544('0x52')]=function(_0x2dbaef,_0x425275,_0x175247){var _0x1befe4={};var _0x463295={};var _0x585fc9;var _0x17cb78;return db[_0x2544('0x2d')]['findOne']({'where':{'id':_0x2dbaef[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x425275,null))[_0x2544('0x25')](function(_0x448f26){if(_0x448f26){_0x585fc9=_0x448f26;_0x463295[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x50')][_0x2544('0x45')]);_0x463295[_0x2544('0x31')]=_[_0x2544('0x44')](_0x2dbaef[_0x2544('0x31')]);_0x463295['filters']=_[_0x2544('0x33')](_0x463295['model'],_0x463295['query']);_0x1befe4['attributes']=_[_0x2544('0x33')](_0x463295[_0x2544('0x30')],qs[_0x2544('0x35')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x35')]));_0x1befe4['attributes']=_0x1befe4[_0x2544('0x34')][_0x2544('0x46')]?_0x1befe4[_0x2544('0x34')]:_0x463295[_0x2544('0x30')];_0x1befe4[_0x2544('0x38')]=qs[_0x2544('0x53')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x53')]);_0x1befe4[_0x2544('0x3b')]=qs[_0x2544('0x32')](_[_0x2544('0x39')](_0x2dbaef[_0x2544('0x31')],_0x463295[_0x2544('0x32')]));if(_0x2dbaef['query'][_0x2544('0x3a')]){_0x1befe4[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x1befe4['where'],{'$or':_[_0x2544('0x2c')](_0x1befe4[_0x2544('0x34')],function(_0x522f0f){var _0x5532c4={};_0x5532c4[_0x522f0f]={'$like':'%'+_0x2dbaef['query'][_0x2544('0x3a')]+'%'};return _0x5532c4;})});}_0x1befe4=_[_0x2544('0x3c')]({},_0x1befe4,_0x2dbaef[_0x2544('0x3e')]);return _0x585fc9[_0x2544('0x52')](_0x1befe4);}})[_0x2544('0x25')](function(_0x4f9a45){if(_0x4f9a45){_0x17cb78=_0x4f9a45[_0x2544('0x46')];if(!_0x2dbaef[_0x2544('0x31')]['hasOwnProperty']('nolimit')){_0x1befe4['limit']=qs[_0x2544('0x1f')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x1f')]);_0x1befe4[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x1d')]);}return _0x585fc9[_0x2544('0x52')](_0x1befe4);}})[_0x2544('0x25')](function(_0x2b6616){if(_0x2b6616){return _0x2b6616?{'count':_0x17cb78,'rows':_0x2b6616}:null;}})[_0x2544('0x25')](respondWithResult(_0x425275,null))['catch'](handleError(_0x425275,null));};
\ No newline at end of file
+var _0x9059=['status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','stack','name','send','index','map','Automation','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','params','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0x9059,0xda));var _0x9905=function(_0x271de1,_0x42ac41){_0x271de1=_0x271de1-0x0;var _0x5666ff=_0x9059[_0x271de1];return _0x5666ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9905('0x0'));var zipdir=require(_0x9905('0x1'));var jsonpatch=require(_0x9905('0x2'));var rp=require(_0x9905('0x3'));var moment=require(_0x9905('0x4'));var BPromise=require(_0x9905('0x5'));var Mustache=require(_0x9905('0x6'));var util=require(_0x9905('0x7'));var path=require(_0x9905('0x8'));var sox=require(_0x9905('0x9'));var csv=require(_0x9905('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9905('0xb'));var _=require(_0x9905('0xc'));var squel=require(_0x9905('0xd'));var crypto=require(_0x9905('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9905('0xf'));var toCsv=require(_0x9905('0xa'));var querystring=require(_0x9905('0x10'));var Papa=require(_0x9905('0x11'));var Redis=require(_0x9905('0x12'));var authService=require(_0x9905('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9905('0x14'));var logger=require(_0x9905('0x15'))(_0x9905('0x16'));var utils=require(_0x9905('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9905('0x18'))['db'];function respondWithStatusCode(_0x33f1b9,_0x36d8b8){_0x36d8b8=_0x36d8b8||0xcc;return function(_0x367783){if(_0x367783){return _0x33f1b9['sendStatus'](_0x36d8b8);}return _0x33f1b9[_0x9905('0x19')](_0x36d8b8)['end']();};}function respondWithResult(_0x43356f,_0x56174e){_0x56174e=_0x56174e||0xc8;return function(_0x30cce7){if(_0x30cce7){return _0x43356f[_0x9905('0x19')](_0x56174e)[_0x9905('0x1a')](_0x30cce7);}};}function respondWithFilteredResult(_0x3a849a,_0x23749a){return function(_0xde151){if(_0xde151){var _0x25c98e=typeof _0x23749a[_0x9905('0x1b')]==='undefined'&&typeof _0x23749a[_0x9905('0x1c')]===_0x9905('0x1d');var _0x548770=_0xde151[_0x9905('0x1e')];var _0x5452de=_0x25c98e?0x0:_0x23749a[_0x9905('0x1b')];var _0x12ab5d=_0x25c98e?_0xde151['count']:_0x23749a[_0x9905('0x1b')]+_0x23749a[_0x9905('0x1c')];var _0x5000e5;if(_0x12ab5d>=_0x548770){_0x12ab5d=_0x548770;_0x5000e5=0xc8;}else{_0x5000e5=0xce;}_0x3a849a['status'](_0x5000e5);return _0x3a849a[_0x9905('0x1f')](_0x9905('0x20'),_0x5452de+'-'+_0x12ab5d+'/'+_0x548770)['json'](_0xde151);}return null;};}function patchUpdates(_0x965e4a){return function(_0x43025d){try{jsonpatch['apply'](_0x43025d,_0x965e4a,!![]);}catch(_0x23351f){return BPromise[_0x9905('0x21')](_0x23351f);}return _0x43025d['save']();};}function saveUpdates(_0x20c7f4,_0x12346d){return function(_0x4ea8d0){if(_0x4ea8d0){return _0x4ea8d0[_0x9905('0x22')](_0x20c7f4)[_0x9905('0x23')](function(_0x42b175){return _0x42b175;});}return null;};}function removeEntity(_0x51ed93,_0x383736){return function(_0x2ed4e2){if(_0x2ed4e2){return _0x2ed4e2[_0x9905('0x24')]()[_0x9905('0x23')](function(){_0x51ed93[_0x9905('0x19')](0xcc)[_0x9905('0x25')]();});}};}function handleEntityNotFound(_0x4bb3a0,_0x2ebcb0){return function(_0xf71b77){if(!_0xf71b77){_0x4bb3a0['sendStatus'](0x194);}return _0xf71b77;};}function handleError(_0x3e003c,_0x4a3efb){_0x4a3efb=_0x4a3efb||0x1f4;return function(_0x4d4a1b){logger['error'](_0x4d4a1b[_0x9905('0x26')]);if(_0x4d4a1b['name']){delete _0x4d4a1b[_0x9905('0x27')];}_0x3e003c['status'](_0x4a3efb)[_0x9905('0x28')](_0x4d4a1b);};}exports[_0x9905('0x29')]=function(_0x5290ce,_0x3f5f62){var _0x5d9777={},_0x2291a0={},_0x117d5c={'count':0x0,'rows':[]};var _0x43e042=_[_0x9905('0x2a')](db[_0x9905('0x2b')][_0x9905('0x2c')],function(_0x228a36){return{'name':_0x228a36[_0x9905('0x2d')],'type':_0x228a36['type']['key']};});_0x2291a0[_0x9905('0x2e')]=_[_0x9905('0x2a')](_0x43e042,'name');_0x2291a0[_0x9905('0x2f')]=_[_0x9905('0x30')](_0x5290ce['query']);_0x2291a0['filters']=_[_0x9905('0x31')](_0x2291a0[_0x9905('0x2e')],_0x2291a0['query']);_0x5d9777[_0x9905('0x32')]=_[_0x9905('0x31')](_0x2291a0[_0x9905('0x2e')],qs[_0x9905('0x33')](_0x5290ce[_0x9905('0x2f')]['fields']));_0x5d9777[_0x9905('0x32')]=_0x5d9777[_0x9905('0x32')][_0x9905('0x34')]?_0x5d9777['attributes']:_0x2291a0['model'];if(!_0x5290ce['query'][_0x9905('0x35')](_0x9905('0x36'))){_0x5d9777[_0x9905('0x1c')]=qs[_0x9905('0x1c')](_0x5290ce['query'][_0x9905('0x1c')]);_0x5d9777[_0x9905('0x1b')]=qs[_0x9905('0x1b')](_0x5290ce['query'][_0x9905('0x1b')]);}_0x5d9777[_0x9905('0x37')]=qs[_0x9905('0x38')](_0x5290ce['query'][_0x9905('0x38')]);_0x5d9777['where']=qs[_0x9905('0x39')](_[_0x9905('0x3a')](_0x5290ce[_0x9905('0x2f')],_0x2291a0[_0x9905('0x39')]),_0x43e042);if(_0x5290ce[_0x9905('0x2f')][_0x9905('0x3b')]){_0x5d9777[_0x9905('0x3c')]=_['merge'](_0x5d9777['where'],{'$or':_['map'](_0x43e042,function(_0x33b374){if(_0x33b374[_0x9905('0x3d')]!==_0x9905('0x3e')){var _0x3c8813={};_0x3c8813[_0x33b374[_0x9905('0x27')]]={'$like':'%'+_0x5290ce['query'][_0x9905('0x3b')]+'%'};return _0x3c8813;}})});}_0x5d9777=_[_0x9905('0x3f')]({},_0x5d9777,_0x5290ce[_0x9905('0x40')]);var _0x458235={'where':_0x5d9777[_0x9905('0x3c')]};return db[_0x9905('0x2b')][_0x9905('0x1e')](_0x458235)[_0x9905('0x23')](function(_0x5c89a8){_0x117d5c[_0x9905('0x1e')]=_0x5c89a8;if(_0x5290ce[_0x9905('0x2f')][_0x9905('0x41')]){_0x5d9777[_0x9905('0x42')]=[{'all':!![]}];}return db[_0x9905('0x2b')][_0x9905('0x43')](_0x5d9777);})[_0x9905('0x23')](function(_0x368d9e){_0x117d5c['rows']=_0x368d9e;return _0x117d5c;})['then'](respondWithFilteredResult(_0x3f5f62,_0x5d9777))['catch'](handleError(_0x3f5f62,null));};exports['show']=function(_0x3b4de0,_0x5b1958){var _0x1d27eb={'raw':![],'where':{'id':_0x3b4de0[_0x9905('0x44')]['id']}},_0x5a1044={};_0x5a1044[_0x9905('0x2e')]=_['keys'](db[_0x9905('0x2b')][_0x9905('0x2c')]);_0x5a1044[_0x9905('0x2f')]=_[_0x9905('0x30')](_0x3b4de0[_0x9905('0x2f')]);_0x5a1044[_0x9905('0x39')]=_[_0x9905('0x31')](_0x5a1044[_0x9905('0x2e')],_0x5a1044['query']);_0x1d27eb[_0x9905('0x32')]=_['intersection'](_0x5a1044[_0x9905('0x2e')],qs[_0x9905('0x33')](_0x3b4de0[_0x9905('0x2f')][_0x9905('0x33')]));_0x1d27eb[_0x9905('0x32')]=_0x1d27eb[_0x9905('0x32')]['length']?_0x1d27eb[_0x9905('0x32')]:_0x5a1044['model'];if(_0x3b4de0['query'][_0x9905('0x41')]){_0x1d27eb[_0x9905('0x42')]=[{'all':!![]}];}_0x1d27eb=_['merge']({},_0x1d27eb,_0x3b4de0['options']);return db[_0x9905('0x2b')][_0x9905('0x45')](_0x1d27eb)[_0x9905('0x23')](handleEntityNotFound(_0x5b1958,null))[_0x9905('0x23')](respondWithResult(_0x5b1958,null))[_0x9905('0x46')](handleError(_0x5b1958,null));};exports[_0x9905('0x47')]=function(_0x2ecc0f,_0x53b145){return db[_0x9905('0x2b')][_0x9905('0x47')](_0x2ecc0f[_0x9905('0x48')],{})[_0x9905('0x23')](respondWithResult(_0x53b145,0xc9))[_0x9905('0x46')](handleError(_0x53b145,null));};exports[_0x9905('0x22')]=function(_0x3ee0e1,_0x5e002b){if(_0x3ee0e1[_0x9905('0x48')]['id']){delete _0x3ee0e1[_0x9905('0x48')]['id'];}return db[_0x9905('0x2b')][_0x9905('0x45')]({'where':{'id':_0x3ee0e1[_0x9905('0x44')]['id']}})[_0x9905('0x23')](handleEntityNotFound(_0x5e002b,null))[_0x9905('0x23')](saveUpdates(_0x3ee0e1['body'],null))[_0x9905('0x23')](respondWithResult(_0x5e002b,null))[_0x9905('0x46')](handleError(_0x5e002b,null));};exports[_0x9905('0x24')]=function(_0x474804,_0xa7f72b){return db[_0x9905('0x2b')][_0x9905('0x45')]({'where':{'id':_0x474804['params']['id']}})['then'](handleEntityNotFound(_0xa7f72b,null))[_0x9905('0x23')](removeEntity(_0xa7f72b,null))[_0x9905('0x46')](handleError(_0xa7f72b,null));};exports[_0x9905('0x49')]=function(_0x587ae8,_0x51262a,_0x4e7813){return db[_0x9905('0x4a')]['find']({'where':{'id':_0x587ae8['params']['id']}})[_0x9905('0x23')](handleEntityNotFound(_0x51262a,null))['then'](function(_0x381994){if(_0x381994){return _0x381994[_0x9905('0x49')](_0x587ae8['body'][_0x9905('0x4b')],_[_0x9905('0x4c')](_0x587ae8[_0x9905('0x48')],[_0x9905('0x4b'),'id'])||{});}})[_0x9905('0x23')](respondWithResult(_0x51262a,null))[_0x9905('0x46')](handleError(_0x51262a,null));};exports[_0x9905('0x4d')]=function(_0x4bfa40,_0x14a8b6,_0x2cedd2){var _0x1d9bb4={};var _0x438d7c={};var _0x2364ef;var _0x56b021;return db[_0x9905('0x2b')]['findOne']({'where':{'id':_0x4bfa40['params']['id']}})['then'](handleEntityNotFound(_0x14a8b6,null))[_0x9905('0x23')](function(_0x4b6716){if(_0x4b6716){_0x2364ef=_0x4b6716;_0x438d7c[_0x9905('0x2e')]=_[_0x9905('0x30')](db['Condition'][_0x9905('0x2c')]);_0x438d7c['query']=_[_0x9905('0x30')](_0x4bfa40[_0x9905('0x2f')]);_0x438d7c[_0x9905('0x39')]=_[_0x9905('0x31')](_0x438d7c[_0x9905('0x2e')],_0x438d7c['query']);_0x1d9bb4[_0x9905('0x32')]=_[_0x9905('0x31')](_0x438d7c[_0x9905('0x2e')],qs[_0x9905('0x33')](_0x4bfa40[_0x9905('0x2f')][_0x9905('0x33')]));_0x1d9bb4[_0x9905('0x32')]=_0x1d9bb4[_0x9905('0x32')][_0x9905('0x34')]?_0x1d9bb4[_0x9905('0x32')]:_0x438d7c[_0x9905('0x2e')];_0x1d9bb4[_0x9905('0x37')]=qs[_0x9905('0x38')](_0x4bfa40[_0x9905('0x2f')]['sort']);_0x1d9bb4[_0x9905('0x3c')]=qs[_0x9905('0x39')](_[_0x9905('0x3a')](_0x4bfa40[_0x9905('0x2f')],_0x438d7c[_0x9905('0x39')]));if(_0x4bfa40['query'][_0x9905('0x3b')]){_0x1d9bb4[_0x9905('0x3c')]=_['merge'](_0x1d9bb4['where'],{'$or':_[_0x9905('0x2a')](_0x1d9bb4[_0x9905('0x32')],function(_0x391688){var _0x27267a={};_0x27267a[_0x391688]={'$like':'%'+_0x4bfa40[_0x9905('0x2f')][_0x9905('0x3b')]+'%'};return _0x27267a;})});}_0x1d9bb4=_[_0x9905('0x3f')]({},_0x1d9bb4,_0x4bfa40['options']);return _0x2364ef[_0x9905('0x4d')](_0x1d9bb4);}})[_0x9905('0x23')](function(_0x482e2d){if(_0x482e2d){_0x56b021=_0x482e2d[_0x9905('0x34')];if(!_0x4bfa40[_0x9905('0x2f')][_0x9905('0x35')](_0x9905('0x36'))){_0x1d9bb4[_0x9905('0x1c')]=qs[_0x9905('0x1c')](_0x4bfa40[_0x9905('0x2f')][_0x9905('0x1c')]);_0x1d9bb4[_0x9905('0x1b')]=qs[_0x9905('0x1b')](_0x4bfa40[_0x9905('0x2f')][_0x9905('0x1b')]);}return _0x2364ef[_0x9905('0x4d')](_0x1d9bb4);}})['then'](function(_0x3dc31f){if(_0x3dc31f){return _0x3dc31f?{'count':_0x56b021,'rows':_0x3dc31f}:null;}})['then'](respondWithResult(_0x14a8b6,null))[_0x9905('0x46')](handleError(_0x14a8b6,null));};exports[_0x9905('0x4e')]=function(_0x546eff,_0x2db651,_0x5473e5){return db[_0x9905('0x4f')][_0x9905('0x45')]({'where':{'id':_0x546eff[_0x9905('0x44')]['id']}})[_0x9905('0x23')](handleEntityNotFound(_0x2db651,null))['then'](function(_0x470058){if(_0x470058){return _0x470058[_0x9905('0x4e')](_0x546eff[_0x9905('0x48')][_0x9905('0x4b')],_[_0x9905('0x4c')](_0x546eff[_0x9905('0x48')],[_0x9905('0x4b'),'id'])||{});}})[_0x9905('0x23')](respondWithResult(_0x2db651,null))[_0x9905('0x46')](handleError(_0x2db651,null));};exports[_0x9905('0x50')]=function(_0x5b7ef1,_0x36dddd,_0x2019e8){var _0xf546d0={};var _0x3ce036={};var _0x46aa1f;var _0x5b4531;return db[_0x9905('0x2b')]['findOne']({'where':{'id':_0x5b7ef1[_0x9905('0x44')]['id']}})[_0x9905('0x23')](handleEntityNotFound(_0x36dddd,null))[_0x9905('0x23')](function(_0x331142){if(_0x331142){_0x46aa1f=_0x331142;_0x3ce036[_0x9905('0x2e')]=_[_0x9905('0x30')](db['Action'][_0x9905('0x2c')]);_0x3ce036['query']=_[_0x9905('0x30')](_0x5b7ef1['query']);_0x3ce036['filters']=_[_0x9905('0x31')](_0x3ce036[_0x9905('0x2e')],_0x3ce036[_0x9905('0x2f')]);_0xf546d0[_0x9905('0x32')]=_[_0x9905('0x31')](_0x3ce036[_0x9905('0x2e')],qs['fields'](_0x5b7ef1[_0x9905('0x2f')]['fields']));_0xf546d0[_0x9905('0x32')]=_0xf546d0['attributes'][_0x9905('0x34')]?_0xf546d0[_0x9905('0x32')]:_0x3ce036['model'];_0xf546d0[_0x9905('0x37')]=qs['sort'](_0x5b7ef1['query'][_0x9905('0x38')]);_0xf546d0['where']=qs[_0x9905('0x39')](_[_0x9905('0x3a')](_0x5b7ef1['query'],_0x3ce036[_0x9905('0x39')]));if(_0x5b7ef1[_0x9905('0x2f')][_0x9905('0x3b')]){_0xf546d0[_0x9905('0x3c')]=_[_0x9905('0x3f')](_0xf546d0['where'],{'$or':_[_0x9905('0x2a')](_0xf546d0[_0x9905('0x32')],function(_0x3f8639){var _0x13852d={};_0x13852d[_0x3f8639]={'$like':'%'+_0x5b7ef1[_0x9905('0x2f')][_0x9905('0x3b')]+'%'};return _0x13852d;})});}_0xf546d0=_[_0x9905('0x3f')]({},_0xf546d0,_0x5b7ef1[_0x9905('0x40')]);return _0x46aa1f['getActions'](_0xf546d0);}})[_0x9905('0x23')](function(_0x103d2c){if(_0x103d2c){_0x5b4531=_0x103d2c[_0x9905('0x34')];if(!_0x5b7ef1[_0x9905('0x2f')][_0x9905('0x35')](_0x9905('0x36'))){_0xf546d0[_0x9905('0x1c')]=qs['limit'](_0x5b7ef1['query'][_0x9905('0x1c')]);_0xf546d0['offset']=qs['offset'](_0x5b7ef1['query'][_0x9905('0x1b')]);}return _0x46aa1f['getActions'](_0xf546d0);}})['then'](function(_0x31a240){if(_0x31a240){return _0x31a240?{'count':_0x5b4531,'rows':_0x31a240}:null;}})['then'](respondWithResult(_0x36dddd,null))['catch'](handleError(_0x36dddd,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 763943d..eb7ba7c 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 _0x292a=['./automation.attributes','exports','define','Automation','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x492547,_0x4cd3bc){var _0x43c08a=function(_0xbba0c5){while(--_0xbba0c5){_0x492547['push'](_0x492547['shift']());}};_0x43c08a(++_0x4cd3bc);}(_0x292a,0x68));var _0xa292=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x292a[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var util=require(_0xa292('0x0'));var logger=require(_0xa292('0x1'))(_0xa292('0x2'));var moment=require('moment');var BPromise=require(_0xa292('0x3'));var rp=require(_0xa292('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa292('0x5'));var config=require('../../config/environment');var attributes=require(_0xa292('0x6'));module[_0xa292('0x7')]=function(_0x4f8de3,_0x242c49){return _0x4f8de3[_0xa292('0x8')](_0xa292('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e0d=['moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','Automation','util','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3e0d,0xce));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3e0('0x0'));var logger=require(_0xd3e0('0x1'))(_0xd3e0('0x2'));var moment=require(_0xd3e0('0x3'));var BPromise=require(_0xd3e0('0x4'));var rp=require(_0xd3e0('0x5'));var fs=require('fs');var path=require(_0xd3e0('0x6'));var rimraf=require('rimraf');var config=require(_0xd3e0('0x7'));var attributes=require(_0xd3e0('0x8'));module[_0xd3e0('0x9')]=function(_0x51edc7,_0x519cf5){return _0x51edc7['define'](_0xd3e0('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 41a993d..ca1fc6f 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 _0x5a13=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','code','message','error'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x5a13,0x145));var _0x35a1=function(_0x11ba2d,_0xb2a851){_0x11ba2d=_0x11ba2d-0x0;var _0x5c3efd=_0x5a13[_0x11ba2d];return _0x5c3efd;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}
\ No newline at end of file
+var _0x47d6=['debug','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x10f875,_0x51f8cf){var _0x3accfa=function(_0x1918ea){while(--_0x1918ea){_0x10f875['push'](_0x10f875['shift']());}};_0x3accfa(++_0x51f8cf);}(_0x47d6,0x13f));var _0x647d=function(_0x19cd14,_0x3ef302){_0x19cd14=_0x19cd14-0x0;var _0x3382db=_0x47d6[_0x19cd14];return _0x3382db;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var moment=require(_0x647d('0x2'));var BPromise=require(_0x647d('0x3'));var rs=require(_0x647d('0x4'));var fs=require('fs');var Redis=require(_0x647d('0x5'));var db=require(_0x647d('0x6'))['db'];var utils=require(_0x647d('0x7'));var logger=require(_0x647d('0x8'))(_0x647d('0x9'));var config=require(_0x647d('0xa'));var jayson=require(_0x647d('0xb'));var client=jayson[_0x647d('0xc')][_0x647d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db1db,_0x1c6a88,_0x4baa1e){return new BPromise(function(_0x119c54,_0x348540){return client[_0x647d('0xe')](_0x1db1db,_0x4baa1e)[_0x647d('0xf')](function(_0x414518){logger[_0x647d('0x10')](_0x647d('0x11'),_0x1c6a88,_0x647d('0x12'));logger[_0x647d('0x13')](_0x647d('0x14'),_0x1c6a88,_0x647d('0x12'),JSON[_0x647d('0x15')](_0x414518));if(_0x414518['error']){if(_0x414518['error'][_0x647d('0x16')]===0x1f4){logger[_0x647d('0x17')](_0x647d('0x11'),_0x1c6a88,_0x414518[_0x647d('0x17')][_0x647d('0x18')]);return _0x348540(_0x414518[_0x647d('0x17')][_0x647d('0x18')]);}logger[_0x647d('0x17')]('Automation,\x20%s,\x20%s',_0x1c6a88,_0x414518[_0x647d('0x17')][_0x647d('0x18')]);return _0x119c54(_0x414518['error'][_0x647d('0x18')]);}else{logger[_0x647d('0x10')](_0x647d('0x11'),_0x1c6a88,'request\x20sent');_0x119c54(_0x414518['result'][_0x647d('0x18')]);}})[_0x647d('0x19')](function(_0x433cc1){logger['error'](_0x647d('0x11'),_0x1c6a88,_0x433cc1);_0x348540(_0x433cc1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8a2b500..7d9e6e6 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 _0x0cd6=['/:id/conditions','getConditions','/:id/actions','post','addConditions','addActions','/:id','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','show'];(function(_0x3c8b42,_0x3429fa){var _0x6f8135=function(_0x5e4b40){while(--_0x5e4b40){_0x3c8b42['push'](_0x3c8b42['shift']());}};_0x6f8135(++_0x3429fa);}(_0x0cd6,0x113));var _0x60cd=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x0cd6[_0x26f1b2];return _0x1624a4;};'use strict';var multer=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var path=require('path');var timeout=require(_0x60cd('0x2'));var express=require(_0x60cd('0x3'));var router=express['Router']();var fs_extra=require(_0x60cd('0x4'));var auth=require(_0x60cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60cd('0x6'));router[_0x60cd('0x7')]('/',auth[_0x60cd('0x8')](),controller['index']);router[_0x60cd('0x7')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x9')]);router[_0x60cd('0x7')](_0x60cd('0xa'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xb')]);router[_0x60cd('0x7')](_0x60cd('0xc'),auth[_0x60cd('0x8')](),controller['getActions']);router[_0x60cd('0xd')]('/',auth[_0x60cd('0x8')](),controller['create']);router[_0x60cd('0xd')]('/:id/conditions',auth[_0x60cd('0x8')](),controller[_0x60cd('0xe')]);router['post'](_0x60cd('0xc'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xf')]);router['put'](_0x60cd('0x10'),auth[_0x60cd('0x8')](),controller['update']);router[_0x60cd('0x11')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa2ae=['post','create','addConditions','addActions','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa2ae,0x1dd));var _0xea2a=function(_0x497672,_0x12ffe6){_0x497672=_0x497672-0x0;var _0x392c0b=_0xa2ae[_0x497672];return _0x392c0b;};'use strict';var multer=require('multer');var util=require(_0xea2a('0x0'));var path=require('path');var timeout=require(_0xea2a('0x1'));var express=require(_0xea2a('0x2'));var router=express[_0xea2a('0x3')]();var fs_extra=require(_0xea2a('0x4'));var auth=require(_0xea2a('0x5'));var interaction=require(_0xea2a('0x6'));var config=require('../../config/environment');var controller=require(_0xea2a('0x7'));router['get']('/',auth[_0xea2a('0x8')](),controller[_0xea2a('0x9')]);router[_0xea2a('0xa')](_0xea2a('0xb'),auth[_0xea2a('0x8')](),controller[_0xea2a('0xc')]);router[_0xea2a('0xa')](_0xea2a('0xd'),auth[_0xea2a('0x8')](),controller[_0xea2a('0xe')]);router[_0xea2a('0xa')](_0xea2a('0xf'),auth[_0xea2a('0x8')](),controller[_0xea2a('0x10')]);router[_0xea2a('0x11')]('/',auth[_0xea2a('0x8')](),controller[_0xea2a('0x12')]);router[_0xea2a('0x11')]('/:id/conditions',auth[_0xea2a('0x8')](),controller[_0xea2a('0x13')]);router['post']('/:id/actions',auth[_0xea2a('0x8')](),controller[_0xea2a('0x14')]);router[_0xea2a('0x15')](_0xea2a('0xb'),auth[_0xea2a('0x8')](),controller[_0xea2a('0x16')]);router[_0xea2a('0x17')](_0xea2a('0xb'),auth[_0xea2a('0x8')](),controller[_0xea2a('0x18')]);module[_0xea2a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 1ebdea5..bdb4be6 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 _0x6bfc=['INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','STRING'];(function(_0x14b4b2,_0x42aed0){var _0x2710fd=function(_0x2bb074){while(--_0x2bb074){_0x14b4b2['push'](_0x14b4b2['shift']());}};_0x2710fd(++_0x42aed0);}(_0x6bfc,0x1da));var _0xc6bf=function(_0x39ddf1,_0x4ddf8a){_0x39ddf1=_0x39ddf1-0x0;var _0xe30e04=_0x6bfc[_0x39ddf1];return _0xe30e04;};'use strict';var Sequelize=require(_0xc6bf('0x0'));module[_0xc6bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xc6bf('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc6bf('0x3')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc6bf('0x4')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc6bf('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc6bf('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc6bf('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'comment':_0xc6bf('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc6bf('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc6bf('0x6')],'defaultValue':_0xc6bf('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xc6bf('0xf')](_0xc6bf('0x10'),_0xc6bf('0x11'),'onlyIfOpen'),'defaultValue':_0xc6bf('0x10')},'dialAMDActive':{'type':Sequelize[_0xc6bf('0x12')],'defaultValue':0x0,'comment':_0xc6bf('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc6bf('0x4')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc6bf('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc6bf('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc6bf('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc6bf('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc6bf('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc6bf('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc6bf('0xf')](_0xc6bf('0x19'),_0xc6bf('0x1a')),'defaultValue':_0xc6bf('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc6bf('0x1b')},'dialCutDigit':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc6bf('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x758c=['sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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)'];(function(_0x5de6c9,_0x471538){var _0x4f45f6=function(_0xe0c086){while(--_0xe0c086){_0x5de6c9['push'](_0x5de6c9['shift']());}};_0x4f45f6(++_0x471538);}(_0x758c,0xac));var _0xc758=function(_0x4be2d4,_0x11f5b7){_0x4be2d4=_0x4be2d4-0x0;var _0x5f398a=_0x758c[_0x4be2d4];return _0x5f398a;};'use strict';var Sequelize=require(_0xc758('0x0'));module['exports']={'name':{'type':Sequelize[_0xc758('0x1')],'unique':_0xc758('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc758('0x3')](_0xc758('0x4')),'allowNull':![],'defaultValue':_0xc758('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc758('0x5')],'defaultValue':0x0,'comment':_0xc758('0x6')},'limitCalls':{'type':Sequelize[_0xc758('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc758('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc758('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc758('0x11')},'dialTimezone':{'type':Sequelize[_0xc758('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc758('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc758('0x13'),_0xc758('0x14'),_0xc758('0x15')),'defaultValue':_0xc758('0x13')},'dialAMDActive':{'type':Sequelize[_0xc758('0x5')],'defaultValue':0x0,'comment':_0xc758('0x16')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc758('0x17')},'dialAMDGreeting':{'type':Sequelize[_0xc758('0x7')](0x9)[_0xc758('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc758('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc758('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc758('0x7')](0x9)[_0xc758('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc758('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xc758('0x7')](0x9)[_0xc758('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc758('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc758('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc758('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc758('0x7')](0x9)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc758('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc758('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc758('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc758('0x3')](_0xc758('0x1e'),_0xc758('0x1f')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc758('0x20')},'dialCutDigit':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc758('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0x24')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0x27')},'dialMachineMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0x28')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc758('0x7')](0x3)[_0xc758('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc758('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc758('0x7')](0x5)[_0xc758('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc758('0x2a')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 522e686..b45e708 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 _0x9bb4=['clone','createdAt','omit','updatedAt','user','error','getHoppers','findOne','CmHopper','hasOwnProperty','order','pick','CampaignId','findAll','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','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?','onlyIfOpen','into','cmHopperId','h.id','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','IvrCampaigns','UserProfileResource','destroy','stack','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x157f75,_0x28cb0e){var _0x25a52d=function(_0x5b5856){while(--_0x5b5856){_0x157f75['push'](_0x157f75['shift']());}};_0x25a52d(++_0x28cb0e);}(_0x9bb4,0xd5));var _0x49bb=function(_0x41eab3,_0x2949fa){_0x41eab3=_0x41eab3-0x0;var _0x1318a3=_0x9bb4[_0x41eab3];return _0x1318a3;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){var _0x570847=_0x4eae24['get']({'plain':!![]});var _0x6dac61=_0x49bb('0x24');return db[_0x49bb('0x25')][_0x49bb('0x26')]({'where':{'type':_0x6dac61,'resourceId':_0x570847['id']}})[_0x49bb('0x23')](function(){return _0x4eae24;});})['then'](function(){_0x490c3e[_0x49bb('0x19')](0xcc)[_0x49bb('0x1a')]();});}};}function handleEntityNotFound(_0x1a6afb,_0x712959){return function(_0x5370d7){if(!_0x5370d7){_0x1a6afb[_0x49bb('0x18')](0x194);}return _0x5370d7;};}function handleError(_0x3d025d,_0x3985a6){_0x3985a6=_0x3985a6||0x1f4;return function(_0x47540c){logger['error'](_0x47540c[_0x49bb('0x27')]);if(_0x47540c[_0x49bb('0x28')]){delete _0x47540c[_0x49bb('0x28')];}_0x3d025d[_0x49bb('0x19')](_0x3985a6)['send'](_0x47540c);};}exports[_0x49bb('0x29')]=function(_0x1537ef,_0x5cd7c2){var _0x38108d={},_0x56b65b={},_0x2fbea2={'count':0x0,'rows':[]};var _0x242371=_['map'](db[_0x49bb('0x2a')][_0x49bb('0x2b')],function(_0x521e09){return{'name':_0x521e09[_0x49bb('0x2c')],'type':_0x521e09[_0x49bb('0x2d')][_0x49bb('0x2e')]};});_0x56b65b[_0x49bb('0x2f')]=_[_0x49bb('0x30')](_0x242371,_0x49bb('0x28'));_0x56b65b[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x1537ef['query']);_0x56b65b[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x56b65b[_0x49bb('0x2f')],_0x56b65b[_0x49bb('0x31')]);_0x38108d['attributes']=_[_0x49bb('0x34')](_0x56b65b['model'],qs[_0x49bb('0x35')](_0x1537ef['query'][_0x49bb('0x35')]));_0x38108d['attributes']=_0x38108d[_0x49bb('0x36')][_0x49bb('0x37')]?_0x38108d['attributes']:_0x56b65b['model'];if(!_0x1537ef['query']['hasOwnProperty']('nolimit')){_0x38108d[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x1537ef[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x38108d[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x1537ef[_0x49bb('0x31')]['offset']);}_0x38108d['order']=qs[_0x49bb('0x38')](_0x1537ef[_0x49bb('0x31')]['sort']);_0x38108d[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_['pick'](_0x1537ef['query'],_0x56b65b[_0x49bb('0x33')]),_0x242371);if(_0x1537ef['query'][_0x49bb('0x3a')]){_0x38108d[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x38108d[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x242371,function(_0x72d90e){if(_0x72d90e[_0x49bb('0x2d')]!==_0x49bb('0x3c')){var _0x783852={};_0x783852[_0x72d90e[_0x49bb('0x28')]]={'$like':'%'+_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x783852;}})});}_0x38108d=_[_0x49bb('0x3b')]({},_0x38108d,_0x1537ef[_0x49bb('0x3d')]);var _0x25c70e={'where':_0x38108d[_0x49bb('0x39')]};return db[_0x49bb('0x2a')][_0x49bb('0x1f')](_0x25c70e)[_0x49bb('0x23')](function(_0x41b969){_0x2fbea2[_0x49bb('0x1f')]=_0x41b969;if(_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x38108d['include']=[{'all':!![]}];}return db[_0x49bb('0x2a')]['findAll'](_0x38108d);})[_0x49bb('0x23')](function(_0x1eac94){_0x2fbea2[_0x49bb('0x3f')]=_0x1eac94;return _0x2fbea2;})[_0x49bb('0x23')](respondWithFilteredResult(_0x5cd7c2,_0x38108d))[_0x49bb('0x40')](handleError(_0x5cd7c2,null));};exports['show']=function(_0x445e15,_0x31aaee){var _0x138f2b={'raw':![],'where':{'id':_0x445e15[_0x49bb('0x41')]['id']}},_0x46912f={};_0x46912f['model']=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x46912f[_0x49bb('0x31')]=_['keys'](_0x445e15['query']);_0x46912f[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x46912f[_0x49bb('0x2f')],_0x46912f[_0x49bb('0x31')]);_0x138f2b[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x46912f['model'],qs[_0x49bb('0x35')](_0x445e15['query'][_0x49bb('0x35')]));_0x138f2b[_0x49bb('0x36')]=_0x138f2b['attributes']['length']?_0x138f2b['attributes']:_0x46912f['model'];if(_0x445e15[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x138f2b[_0x49bb('0x42')]=[{'all':!![]}];}_0x138f2b=_[_0x49bb('0x3b')]({},_0x138f2b,_0x445e15['options']);return db['Campaign'][_0x49bb('0x43')](_0x138f2b)[_0x49bb('0x23')](handleEntityNotFound(_0x31aaee,null))[_0x49bb('0x23')](respondWithResult(_0x31aaee,null))[_0x49bb('0x40')](handleError(_0x31aaee,null));};exports['create']=function(_0x3b0f01,_0x382bc4){return db['Campaign'][_0x49bb('0x44')](_0x3b0f01[_0x49bb('0x45')],{})[_0x49bb('0x23')](function(_0x46bb56){var _0xbad45a=_0x3b0f01['user'][_0x49bb('0x46')]({'plain':!![]});if(!_0xbad45a)throw new Error(_0x49bb('0x47'));if(_0xbad45a[_0x49bb('0x48')]==='user'){var _0x266abf=_0x46bb56[_0x49bb('0x46')]({'plain':!![]});var _0x144a77=_0x49bb('0x24');return db[_0x49bb('0x49')]['find']({'where':{'name':_0x144a77,'userProfileId':_0xbad45a[_0x49bb('0x4a')]},'raw':!![]})[_0x49bb('0x23')](function(_0xfae9ab){if(_0xfae9ab&&_0xfae9ab[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x266abf[_0x49bb('0x28')],'resourceId':_0x266abf['id'],'type':_0xfae9ab[_0x49bb('0x28')],'sectionId':_0xfae9ab['id']},{})[_0x49bb('0x23')](function(){return _0x46bb56;});}else{return _0x46bb56;}})[_0x49bb('0x40')](function(_0x2ead0f){logger['error'](_0x49bb('0x4c'),_0x2ead0f);throw _0x2ead0f;});}return _0x46bb56;})[_0x49bb('0x23')](respondWithResult(_0x382bc4,0xc9))[_0x49bb('0x40')](handleError(_0x382bc4,null));};exports[_0x49bb('0x4d')]=function(_0x10327c,_0x3fc2f1){var _0x4151c5={'where':{'id':_0x10327c[_0x49bb('0x41')]['id']}},_0x23e8bc={};_0x23e8bc[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x4151c5[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x23e8bc[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x10327c[_0x49bb('0x31')][_0x49bb('0x35')]));_0x4151c5[_0x49bb('0x36')]=_0x4151c5[_0x49bb('0x36')][_0x49bb('0x37')]?_0x4151c5[_0x49bb('0x36')]:_0x23e8bc['model'];if(_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x4151c5[_0x49bb('0x42')]=[{'all':!![]}];}_0x4151c5=_[_0x49bb('0x3b')]({},_0x4151c5,_0x10327c[_0x49bb('0x3d')]);return db[_0x49bb('0x2a')][_0x49bb('0x43')](_0x4151c5)[_0x49bb('0x23')](handleEntityNotFound(_0x3fc2f1,null))[_0x49bb('0x23')](function(_0x348da4){if(_0x348da4){var _0x48a8d6=_0x348da4['get']({'plain':!![]});_0x48a8d6=qs['omit'](_0x48a8d6,['id',_0x49bb('0x4e'),'updatedAt']);_0x10327c[_0x49bb('0x45')]=_[_0x49bb('0x4f')](_0x10327c[_0x49bb('0x45')],['id',_0x49bb('0x4e'),_0x49bb('0x50')]);return db[_0x49bb('0x2a')][_0x49bb('0x44')](_[_0x49bb('0x3b')](_0x48a8d6,_0x10327c['body']),{'include':_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]?[{'all':!![]}]:undefined})[_0x49bb('0x23')](function(_0x435761){var _0x225341=_0x10327c[_0x49bb('0x51')][_0x49bb('0x46')]({'plain':!![]});if(!_0x225341)throw new Error(_0x49bb('0x47'));if(_0x225341['role']===_0x49bb('0x51')){var _0x35bb5b=_0x435761[_0x49bb('0x46')]({'plain':!![]});var _0xb2d741='IvrCampaigns';return db[_0x49bb('0x49')][_0x49bb('0x43')]({'where':{'name':_0xb2d741,'userProfileId':_0x225341['userProfileId']},'raw':!![]})[_0x49bb('0x23')](function(_0x36ff04){if(_0x36ff04&&_0x36ff04[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x35bb5b['name'],'resourceId':_0x35bb5b['id'],'type':_0x36ff04[_0x49bb('0x28')],'sectionId':_0x36ff04['id']},{})[_0x49bb('0x23')](function(){return _0x435761;});}else{return _0x435761;}})[_0x49bb('0x40')](function(_0x1f273a){logger[_0x49bb('0x52')](_0x49bb('0x4c'),_0x1f273a);throw _0x1f273a;});}return _0x435761;});}})['then'](respondWithResult(_0x3fc2f1,0xc9))[_0x49bb('0x40')](handleError(_0x3fc2f1,null));};exports[_0x49bb('0x22')]=function(_0x56b2e7,_0x4b13e5){if(_0x56b2e7[_0x49bb('0x45')]['id']){delete _0x56b2e7[_0x49bb('0x45')]['id'];}return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x56b2e7[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b13e5,null))[_0x49bb('0x23')](saveUpdates(_0x56b2e7[_0x49bb('0x45')],null))[_0x49bb('0x23')](respondWithResult(_0x4b13e5,null))['catch'](handleError(_0x4b13e5,null));};exports[_0x49bb('0x26')]=function(_0x4a3906,_0x4478f4){return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x4a3906[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4478f4,null))[_0x49bb('0x23')](removeEntity(_0x4478f4,null))[_0x49bb('0x40')](handleError(_0x4478f4,null));};exports[_0x49bb('0x53')]=function(_0xcc062f,_0x52ac3b,_0x29a1b7){var _0x28da4a={'raw':!![],'where':{}};var _0x277e04={};var _0x193259={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0xcc062f[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x52ac3b,null))[_0x49bb('0x23')](function(_0x437d3b){if(_0x437d3b){_0x277e04['model']=_[_0x49bb('0x32')](db[_0x49bb('0x55')][_0x49bb('0x2b')]);_0x277e04[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0xcc062f[_0x49bb('0x31')]);_0x277e04[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x277e04['model'],_0x277e04[_0x49bb('0x31')]);_0x28da4a[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x277e04[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x35')]));_0x28da4a['attributes']=_0x28da4a[_0x49bb('0x36')][_0x49bb('0x37')]?_0x28da4a[_0x49bb('0x36')]:_0x277e04[_0x49bb('0x2f')];if(!_0xcc062f['query'][_0x49bb('0x56')]('nolimit')){_0x28da4a[_0x49bb('0x1e')]=qs['limit'](_0xcc062f['query']['limit']);_0x28da4a[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xcc062f['query']['offset']);}_0x28da4a[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x38')]);_0x28da4a[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0xcc062f[_0x49bb('0x31')],_0x277e04[_0x49bb('0x33')]));_0x28da4a[_0x49bb('0x39')][_0x49bb('0x59')]=_0x437d3b['id'];if(_0xcc062f['query'][_0x49bb('0x3a')]){_0x28da4a[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x28da4a[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x28da4a[_0x49bb('0x36')],function(_0x3454be){var _0x500af1={};_0x500af1[_0x3454be]={'$like':'%'+_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x500af1;})});}_0x28da4a=_['merge']({},_0x28da4a,_0xcc062f[_0x49bb('0x3d')]);return db[_0x49bb('0x55')]['count']({'where':_0x28da4a[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x37f97b){_0x193259[_0x49bb('0x1f')]=_0x37f97b;if(_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x28da4a['include']=[{'all':!![]}];}return db['CmHopper'][_0x49bb('0x5a')](_0x28da4a);})[_0x49bb('0x23')](function(_0x1499b6){_0x193259[_0x49bb('0x3f')]=_0x1499b6;return _0x193259;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x52ac3b,_0x28da4a))[_0x49bb('0x40')](handleError(_0x52ac3b,null));};exports[_0x49bb('0x5b')]=function(_0xc7016a,_0x136726,_0x36db19){var _0x3459de={'raw':!![],'where':{}};var _0x426505={};var _0x81e179={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0xc7016a['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x136726,null))['then'](function(_0x7897dd){if(_0x7897dd){_0x426505[_0x49bb('0x2f')]=_['keys'](db['CmHopperHistory'][_0x49bb('0x2b')]);_0x426505[_0x49bb('0x31')]=_['keys'](_0xc7016a[_0x49bb('0x31')]);_0x426505[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],_0x426505[_0x49bb('0x31')]);_0x3459de[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],qs['fields'](_0xc7016a[_0x49bb('0x31')]['fields']));_0x3459de[_0x49bb('0x36')]=_0x3459de[_0x49bb('0x36')][_0x49bb('0x37')]?_0x3459de['attributes']:_0x426505[_0x49bb('0x2f')];if(!_0xc7016a[_0x49bb('0x31')][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x3459de[_0x49bb('0x1e')]=qs['limit'](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x3459de[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x3459de[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x38')]);_0x3459de[_0x49bb('0x39')]=qs['filters'](_[_0x49bb('0x58')](_0xc7016a[_0x49bb('0x31')],_0x426505[_0x49bb('0x33')]));_0x3459de[_0x49bb('0x39')]['CampaignId']=_0x7897dd['id'];if(_0xc7016a[_0x49bb('0x31')]['filter']){_0x3459de[_0x49bb('0x39')]=_['merge'](_0x3459de[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x3459de[_0x49bb('0x36')],function(_0x2b953a){var _0x5d4c93={};_0x5d4c93[_0x2b953a]={'$like':'%'+_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x5d4c93;})});}_0x3459de=_[_0x49bb('0x3b')]({},_0x3459de,_0xc7016a[_0x49bb('0x3d')]);return db[_0x49bb('0x5d')]['count']({'where':_0x3459de[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x46fcc5){_0x81e179['count']=_0x46fcc5;if(_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x3459de['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x49bb('0x5a')](_0x3459de);})[_0x49bb('0x23')](function(_0x2a40aa){_0x81e179[_0x49bb('0x3f')]=_0x2a40aa;return _0x81e179;});}})['then'](respondWithFilteredResult(_0x136726,_0x3459de))[_0x49bb('0x40')](handleError(_0x136726,null));};exports[_0x49bb('0x5e')]=function(_0x535bed,_0x137965,_0x208e1b){var _0x1c9cfb={'raw':!![],'where':{}};var _0x4157ae={};var _0x1b0529={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0x535bed['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x137965,null))['then'](function(_0x36bf90){if(_0x36bf90){_0x4157ae[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x5f')][_0x49bb('0x2b')]);_0x4157ae[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x535bed['query']);_0x4157ae[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x4157ae['model'],_0x4157ae[_0x49bb('0x31')]);_0x1c9cfb[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x4157ae[_0x49bb('0x2f')],qs['fields'](_0x535bed['query'][_0x49bb('0x35')]));_0x1c9cfb['attributes']=_0x1c9cfb[_0x49bb('0x36')]['length']?_0x1c9cfb[_0x49bb('0x36')]:_0x4157ae[_0x49bb('0x2f')];if(!_0x535bed[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1c9cfb[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x535bed['query']['limit']);_0x1c9cfb[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x535bed['query'][_0x49bb('0x1c')]);}_0x1c9cfb[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x535bed['query'][_0x49bb('0x38')]);_0x1c9cfb[_0x49bb('0x39')]=qs['filters'](_['pick'](_0x535bed['query'],_0x4157ae[_0x49bb('0x33')]));_0x1c9cfb[_0x49bb('0x39')][_0x49bb('0x59')]=_0x36bf90['id'];if(_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x1c9cfb['where']=_['merge'](_0x1c9cfb[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x1c9cfb['attributes'],function(_0x5b1f07){var _0x378128={};_0x378128[_0x5b1f07]={'$like':'%'+_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x378128;})});}_0x1c9cfb=_['merge']({},_0x1c9cfb,_0x535bed[_0x49bb('0x3d')]);return db[_0x49bb('0x5f')]['count']({'where':_0x1c9cfb[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x3b7d47){_0x1b0529[_0x49bb('0x1f')]=_0x3b7d47;if(_0x535bed['query'][_0x49bb('0x3e')]){_0x1c9cfb[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x5f')][_0x49bb('0x5a')](_0x1c9cfb);})['then'](function(_0x2ccf78){_0x1b0529[_0x49bb('0x3f')]=_0x2ccf78;return _0x1b0529;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x137965,_0x1c9cfb))[_0x49bb('0x40')](handleError(_0x137965,null));};exports[_0x49bb('0x60')]=function(_0x4e6e43,_0x5a4f59,_0x251fc8){var _0x382bf9={'raw':!![],'where':{}};var _0x5bdf3d={};var _0x1dcaac={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x4e6e43[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4f59,null))['then'](function(_0xe5a2){if(_0xe5a2){_0x5bdf3d[_0x49bb('0x2f')]=_['keys'](db['CmHopperBlack'][_0x49bb('0x2b')]);_0x5bdf3d[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x4e6e43['query']);_0x5bdf3d[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],_0x5bdf3d[_0x49bb('0x31')]);_0x382bf9[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],qs['fields'](_0x4e6e43[_0x49bb('0x31')]['fields']));_0x382bf9[_0x49bb('0x36')]=_0x382bf9[_0x49bb('0x36')][_0x49bb('0x37')]?_0x382bf9['attributes']:_0x5bdf3d[_0x49bb('0x2f')];if(!_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x382bf9[_0x49bb('0x1e')]=qs['limit'](_0x4e6e43['query'][_0x49bb('0x1e')]);_0x382bf9['offset']=qs[_0x49bb('0x1c')](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x382bf9[_0x49bb('0x57')]=qs['sort'](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x38')]);_0x382bf9[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x4e6e43[_0x49bb('0x31')],_0x5bdf3d[_0x49bb('0x33')]));_0x382bf9[_0x49bb('0x39')][_0x49bb('0x59')]=_0xe5a2['id'];if(_0x4e6e43[_0x49bb('0x31')]['filter']){_0x382bf9[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x382bf9['where'],{'$or':_[_0x49bb('0x30')](_0x382bf9[_0x49bb('0x36')],function(_0x12b674){var _0x2822f7={};_0x2822f7[_0x12b674]={'$like':'%'+_0x4e6e43['query']['filter']+'%'};return _0x2822f7;})});}_0x382bf9=_[_0x49bb('0x3b')]({},_0x382bf9,_0x4e6e43[_0x49bb('0x3d')]);return db[_0x49bb('0x61')]['count']({'where':_0x382bf9['where']})[_0x49bb('0x23')](function(_0xf5c477){_0x1dcaac['count']=_0xf5c477;if(_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x382bf9[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x61')]['findAll'](_0x382bf9);})['then'](function(_0x1770bc){_0x1dcaac[_0x49bb('0x3f')]=_0x1770bc;return _0x1dcaac;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x5a4f59,_0x382bf9))['catch'](handleError(_0x5a4f59,null));};exports[_0x49bb('0x62')]=function(_0x9f2ff7,_0x3f93bd,_0x504b4f){var _0x582b42={};var _0x2948a0={};var _0x5a861f;var _0xaf6237;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x9f2ff7[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x3f93bd,null))[_0x49bb('0x23')](function(_0x59e5c1){if(_0x59e5c1){_0x5a861f=_0x59e5c1;_0x2948a0[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x63')][_0x49bb('0x2b')]);_0x2948a0[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x9f2ff7[_0x49bb('0x31')]);_0x2948a0[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],_0x2948a0['query']);_0x582b42[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x9f2ff7[_0x49bb('0x31')]['fields']));_0x582b42[_0x49bb('0x36')]=_0x582b42[_0x49bb('0x36')][_0x49bb('0x37')]?_0x582b42[_0x49bb('0x36')]:_0x2948a0[_0x49bb('0x2f')];_0x582b42[_0x49bb('0x57')]=qs['sort'](_0x9f2ff7['query']['sort']);_0x582b42[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x9f2ff7[_0x49bb('0x31')],_0x2948a0[_0x49bb('0x33')]));if(_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x582b42[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x582b42['where'],{'$or':_[_0x49bb('0x30')](_0x582b42[_0x49bb('0x36')],function(_0x42b52f){var _0x22a2e3={};_0x22a2e3[_0x42b52f]={'$like':'%'+_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x22a2e3;})});}_0x582b42=_[_0x49bb('0x3b')]({},_0x582b42,_0x9f2ff7['options']);return _0x5a861f['getLists'](_0x582b42);}})['then'](function(_0x521567){if(_0x521567){_0xaf6237=_0x521567[_0x49bb('0x37')];if(!_0x9f2ff7['query'][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x582b42[_0x49bb('0x1e')]=qs['limit'](_0x9f2ff7['query']['limit']);_0x582b42[_0x49bb('0x1c')]=qs['offset'](_0x9f2ff7['query']['offset']);}return _0x5a861f[_0x49bb('0x62')](_0x582b42);}})[_0x49bb('0x23')](function(_0x5eec09){if(_0x5eec09){return _0x5eec09?{'count':_0xaf6237,'rows':_0x5eec09}:null;}})['then'](respondWithResult(_0x3f93bd,null))['catch'](handleError(_0x3f93bd,null));};exports['addLists']=function(_0x333a64,_0x4742be,_0x3ef899){var _0x29e5f9,_0x38a3d5;var _0xd2cd1a=[];var _0x3d761d=moment()[_0x49bb('0x64')](_0x49bb('0x65'));return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x333a64[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4742be,null))[_0x49bb('0x23')](function(_0x4092df){if(_0x4092df){_0x38a3d5=_0x4092df;return _0x4092df[_0x49bb('0x66')](_0x333a64[_0x49bb('0x45')][_0x49bb('0x67')],_[_0x49bb('0x4f')](_0x333a64[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})[_0x49bb('0x68')](function(_0x534677){var _0x5b27b1;var _0x3d1da9;_0x29e5f9=_0x534677||[];var _0x20a650=[];if(_0x534677){for(var _0x33c254=0x0;_0x33c254<_0x534677[_0x49bb('0x37')];_0x33c254+=0x1){var _0x403726=_0x534677[_0x33c254]['get']({'plain':!![]});_0x38a3d5[_0x49bb('0x69')]=_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]?_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]:_0x38a3d5['dialCheckDuplicateType'];switch(_0x38a3d5[_0x49bb('0x69')]){case _0x49bb('0x6a'):_0x5b27b1=squel[_0x49bb('0x6b')]()['into'](_0x49bb('0x6c'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x6f'),'ContactId',_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),'updatedAt'],squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('phone','phone')[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))['field']('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))['from'](_0x49bb('0x77'))['where'](_0x49bb('0x78'))[_0x49bb('0x39')](_0x49bb('0x79'),_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a'))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()['field'](_0x49bb('0x7c'))[_0x49bb('0x7d')](_0x49bb('0x7e'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]()))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')[_0x49bb('0x7d')](_0x49bb('0x6c'))['where'](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())))[_0x49bb('0x76')]();break;case _0x49bb('0x80'):_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')](_0x49bb('0x6c'))[_0x49bb('0x6d')](['phone',_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x49bb('0x72')](_0x49bb('0x6e'),_0x49bb('0x6e'))['field']('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')](_0x49bb('0x77'))[_0x49bb('0x39')](_0x49bb('0x78'))['where'](_0x49bb('0x79'),_0x403726[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0x49bb('0x6c'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64['params']['id'][_0x49bb('0x76')]())))['toString']();break;default:_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper')['fromQuery']([_0x49bb('0x6e'),_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x6e'),'phone')[_0x49bb('0x72')]('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')]['toString'](),_0x49bb('0x70'))['field'](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')](_0x49bb('0x78'))[_0x49bb('0x39')]('ListId\x20=\x20?',_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();}_0x3d1da9=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper_additional_phones')[_0x49bb('0x6d')]([_0x49bb('0x82'),_0x49bb('0x6f'),_0x49bb('0x6e'),'OrderBy',_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x83'),'id')['field'](_0x49bb('0x73'),_0x49bb('0x6f'))['field']('ci.item',_0x49bb('0x6e'))[_0x49bb('0x72')]('ci.OrderBY','OrderBy')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contact_has_items','ci')[_0x49bb('0x84')](_0x49bb('0x6c'),'h',_0x49bb('0x85'))[_0x49bb('0x39')](_0x49bb('0x86'),_0x403726[_0x49bb('0x75')][_0x49bb('0x76')]())['where'](_0x49bb('0x87'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x88'),_0x3d761d))[_0x49bb('0x76')]();_0x20a650['push'](db['sequelize'][_0x49bb('0x31')](_0x5b27b1));_0xd2cd1a[_0x49bb('0x89')](db[_0x49bb('0x8a')][_0x49bb('0x31')](_0x3d1da9));}return BPromise[_0x49bb('0x8b')](_0x20a650);}})[_0x49bb('0x23')](function(){return BPromise[_0x49bb('0x8b')](_0xd2cd1a);})[_0x49bb('0x23')](function(){return _0x29e5f9;})[_0x49bb('0x23')](respondWithResult(_0x4742be,null))[_0x49bb('0x40')](handleError(_0x4742be,null));};exports[_0x49bb('0x8c')]=function(_0x463ed6,_0x4f887c,_0x6cfddb){return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4f887c,null))['then'](function(_0x2e2e87){if(_0x2e2e87){return _0x2e2e87[_0x49bb('0x8c')](_0x463ed6[_0x49bb('0x31')]['ids']);}})['then'](function(_0x45957b){if(_0x45957b){return db[_0x49bb('0x55')][_0x49bb('0x26')]({'where':{'ListId':_0x463ed6[_0x49bb('0x31')][_0x49bb('0x67')],'CampaignId':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](function(){return _0x45957b;});}})[_0x49bb('0x23')](respondWithStatusCode(_0x4f887c,null))[_0x49bb('0x40')](handleError(_0x4f887c,null));};exports[_0x49bb('0x8d')]=function(_0x5418e4,_0x4e133b,_0x460091){var _0x1346fa={};var _0x52a9d4={};var _0x7f3477;var _0x3b0592;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x5418e4[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4e133b,null))[_0x49bb('0x23')](function(_0x1036f0){if(_0x1036f0){_0x7f3477=_0x1036f0;_0x52a9d4[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db['CmList'][_0x49bb('0x2b')]);_0x52a9d4['query']=_[_0x49bb('0x32')](_0x5418e4[_0x49bb('0x31')]);_0x52a9d4[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x52a9d4[_0x49bb('0x2f')],_0x52a9d4[_0x49bb('0x31')]);_0x1346fa[_0x49bb('0x36')]=_['intersection'](_0x52a9d4[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x5418e4['query'][_0x49bb('0x35')]));_0x1346fa[_0x49bb('0x36')]=_0x1346fa[_0x49bb('0x36')][_0x49bb('0x37')]?_0x1346fa[_0x49bb('0x36')]:_0x52a9d4['model'];_0x1346fa[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x5418e4['query'][_0x49bb('0x38')]);_0x1346fa[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x5418e4[_0x49bb('0x31')],_0x52a9d4['filters']));if(_0x5418e4[_0x49bb('0x31')]['filter']){_0x1346fa['where']=_[_0x49bb('0x3b')](_0x1346fa[_0x49bb('0x39')],{'$or':_['map'](_0x1346fa[_0x49bb('0x36')],function(_0x38bac0){var _0x1021ea={};_0x1021ea[_0x38bac0]={'$like':'%'+_0x5418e4[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x1021ea;})});}_0x1346fa=_['merge']({},_0x1346fa,_0x5418e4[_0x49bb('0x3d')]);return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x162884){if(_0x162884){_0x3b0592=_0x162884[_0x49bb('0x37')];if(!_0x5418e4[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1346fa[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x1346fa[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1c')]);}return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x5bd052){if(_0x5bd052){return _0x5bd052?{'count':_0x3b0592,'rows':_0x5bd052}:null;}})[_0x49bb('0x23')](respondWithResult(_0x4e133b,null))[_0x49bb('0x40')](handleError(_0x4e133b,null));};exports[_0x49bb('0x8e')]=function(_0x5cc812,_0x308a85,_0x526469){var _0x2e4be8,_0x139929;var _0x17f942=[];var _0x4456b3=moment()[_0x49bb('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x5cc812[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x308a85,null))[_0x49bb('0x23')](function(_0xac35e6){if(_0xac35e6){_0x139929=_0xac35e6;return _0xac35e6[_0x49bb('0x8e')](_0x5cc812[_0x49bb('0x45')][_0x49bb('0x67')],_['omit'](_0x5cc812[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})['spread'](function(_0x2caab6){var _0x5cc412;var _0x34e4bb;_0x2e4be8=_0x2caab6||[];var _0x1c7a91=[];if(_0x2caab6){for(var _0x44ef98=0x0;_0x44ef98<_0x2caab6[_0x49bb('0x37')];_0x44ef98+=0x1){var _0x526e52=_0x2caab6[_0x44ef98][_0x49bb('0x46')]({'plain':!![]});_0x5cc412=squel['insert']()[_0x49bb('0x81')](_0x49bb('0x8f'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),'createdAt',_0x49bb('0x50')],squel['select']()[_0x49bb('0x72')]('phone',_0x49bb('0x6e'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x526e52[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x5cc812[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')['field']('NOW()',_0x49bb('0x4e'))[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')]('deletedAt\x20IS\x20NULL')[_0x49bb('0x39')]('ListId\x20=\x20?',_0x526e52[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();_0x1c7a91[_0x49bb('0x89')](db['sequelize']['query'](_0x5cc412));}return BPromise[_0x49bb('0x8b')](_0x1c7a91);}})[_0x49bb('0x23')](function(){return _0x2e4be8;})[_0x49bb('0x23')](respondWithResult(_0x308a85,null))['catch'](handleError(_0x308a85,null));};exports[_0x49bb('0x90')]=function(_0x423817,_0xbf83a4,_0x2084e3){return db[_0x49bb('0x2a')]['find']({'where':{'id':_0x423817[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0xbf83a4,null))[_0x49bb('0x23')](function(_0x32ebdd){if(_0x32ebdd){return _0x32ebdd[_0x49bb('0x90')](_0x423817['query']['ids']);}})[_0x49bb('0x23')](function(_0x8a44b6){if(_0x8a44b6){return db[_0x49bb('0x61')][_0x49bb('0x26')]({'where':{'ListId':_0x423817[_0x49bb('0x31')]['ids'],'CampaignId':_0x423817[_0x49bb('0x41')]['id']}})['then'](function(){return _0x8a44b6;});}})[_0x49bb('0x23')](respondWithStatusCode(_0xbf83a4,null))[_0x49bb('0x40')](handleError(_0xbf83a4,null));};
\ No newline at end of file
+var _0x8863=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','Campaign','includeAll','include','findAll','rows','catch','show','params','intersection','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ContactId','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x8863,0x1b6));var _0x3886=function(_0x1ec1fa,_0x3efb52){_0x1ec1fa=_0x1ec1fa-0x0;var _0x3e00f0=_0x8863[_0x1ec1fa];return _0x3e00f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3886('0x0'));var zipdir=require(_0x3886('0x1'));var jsonpatch=require(_0x3886('0x2'));var rp=require(_0x3886('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3886('0x4'));var sox=require(_0x3886('0x5'));var csv=require('to-csv');var ejs=require(_0x3886('0x6'));var fs=require('fs');var fs_extra=require(_0x3886('0x7'));var _=require('lodash');var squel=require(_0x3886('0x8'));var crypto=require(_0x3886('0x9'));var jsforce=require(_0x3886('0xa'));var deskjs=require(_0x3886('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3886('0xc'));var Papa=require(_0x3886('0xd'));var Redis=require(_0x3886('0xe'));var authService=require(_0x3886('0xf'));var qs=require(_0x3886('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3886('0x11'));var logger=require(_0x3886('0x12'))(_0x3886('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3886('0x14'));var db=require(_0x3886('0x15'))['db'];function respondWithStatusCode(_0x197f5c,_0x990453){_0x990453=_0x990453||0xcc;return function(_0x6bc2c2){if(_0x6bc2c2){return _0x197f5c[_0x3886('0x16')](_0x990453);}return _0x197f5c[_0x3886('0x17')](_0x990453)[_0x3886('0x18')]();};}function respondWithResult(_0x429d69,_0x1bb402){_0x1bb402=_0x1bb402||0xc8;return function(_0x23ff84){if(_0x23ff84){return _0x429d69[_0x3886('0x17')](_0x1bb402)['json'](_0x23ff84);}};}function respondWithFilteredResult(_0x1c5b7f,_0x42c20b){return function(_0x509201){if(_0x509201){var _0x27545c=typeof _0x42c20b['offset']===_0x3886('0x19')&&typeof _0x42c20b[_0x3886('0x1a')]===_0x3886('0x19');var _0x18021b=_0x509201['count'];var _0x5d4761=_0x27545c?0x0:_0x42c20b[_0x3886('0x1b')];var _0x3d4e74=_0x27545c?_0x509201[_0x3886('0x1c')]:_0x42c20b[_0x3886('0x1b')]+_0x42c20b[_0x3886('0x1a')];var _0x113c1b;if(_0x3d4e74>=_0x18021b){_0x3d4e74=_0x18021b;_0x113c1b=0xc8;}else{_0x113c1b=0xce;}_0x1c5b7f[_0x3886('0x17')](_0x113c1b);return _0x1c5b7f[_0x3886('0x1d')](_0x3886('0x1e'),_0x5d4761+'-'+_0x3d4e74+'/'+_0x18021b)[_0x3886('0x1f')](_0x509201);}return null;};}function patchUpdates(_0x1d44af){return function(_0x4ec1d0){try{jsonpatch[_0x3886('0x20')](_0x4ec1d0,_0x1d44af,!![]);}catch(_0x26e65c){return BPromise[_0x3886('0x21')](_0x26e65c);}return _0x4ec1d0['save']();};}function saveUpdates(_0x2bd588,_0x1e8a4c){return function(_0x128183){if(_0x128183){return _0x128183[_0x3886('0x22')](_0x2bd588)[_0x3886('0x23')](function(_0x3e929e){return _0x3e929e;});}return null;};}function removeEntity(_0x219c8e,_0x554d78){return function(_0x2a773b){if(_0x2a773b){return _0x2a773b[_0x3886('0x24')]()['then'](function(){var _0x116bce=_0x2a773b['get']({'plain':!![]});var _0xe75870='IvrCampaigns';return db['UserProfileResource'][_0x3886('0x24')]({'where':{'type':_0xe75870,'resourceId':_0x116bce['id']}})[_0x3886('0x23')](function(){return _0x2a773b;});})[_0x3886('0x23')](function(){_0x219c8e[_0x3886('0x17')](0xcc)[_0x3886('0x18')]();});}};}function handleEntityNotFound(_0x6e163f,_0x472a38){return function(_0x1b8a62){if(!_0x1b8a62){_0x6e163f[_0x3886('0x16')](0x194);}return _0x1b8a62;};}function handleError(_0xecca38,_0x2a822d){_0x2a822d=_0x2a822d||0x1f4;return function(_0x353d84){logger[_0x3886('0x25')](_0x353d84[_0x3886('0x26')]);if(_0x353d84[_0x3886('0x27')]){delete _0x353d84[_0x3886('0x27')];}_0xecca38[_0x3886('0x17')](_0x2a822d)[_0x3886('0x28')](_0x353d84);};}exports[_0x3886('0x29')]=function(_0x5c6331,_0x6a1bbb){var _0x2feca4={},_0x34ed81={},_0x348909={'count':0x0,'rows':[]};var _0x384e91=_[_0x3886('0x2a')](db['Campaign'][_0x3886('0x2b')],function(_0x1a390a){return{'name':_0x1a390a['fieldName'],'type':_0x1a390a[_0x3886('0x2c')][_0x3886('0x2d')]};});_0x34ed81[_0x3886('0x2e')]=_[_0x3886('0x2a')](_0x384e91,_0x3886('0x27'));_0x34ed81[_0x3886('0x2f')]=_[_0x3886('0x30')](_0x5c6331[_0x3886('0x2f')]);_0x34ed81[_0x3886('0x31')]=_['intersection'](_0x34ed81[_0x3886('0x2e')],_0x34ed81[_0x3886('0x2f')]);_0x2feca4[_0x3886('0x32')]=_['intersection'](_0x34ed81[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x5c6331['query'][_0x3886('0x33')]));_0x2feca4[_0x3886('0x32')]=_0x2feca4[_0x3886('0x32')][_0x3886('0x34')]?_0x2feca4[_0x3886('0x32')]:_0x34ed81['model'];if(!_0x5c6331['query']['hasOwnProperty']('nolimit')){_0x2feca4[_0x3886('0x1a')]=qs[_0x3886('0x1a')](_0x5c6331[_0x3886('0x2f')][_0x3886('0x1a')]);_0x2feca4[_0x3886('0x1b')]=qs[_0x3886('0x1b')](_0x5c6331['query'][_0x3886('0x1b')]);}_0x2feca4[_0x3886('0x35')]=qs[_0x3886('0x36')](_0x5c6331[_0x3886('0x2f')][_0x3886('0x36')]);_0x2feca4[_0x3886('0x37')]=qs['filters'](_[_0x3886('0x38')](_0x5c6331[_0x3886('0x2f')],_0x34ed81[_0x3886('0x31')]),_0x384e91);if(_0x5c6331[_0x3886('0x2f')][_0x3886('0x39')]){_0x2feca4[_0x3886('0x37')]=_[_0x3886('0x3a')](_0x2feca4[_0x3886('0x37')],{'$or':_['map'](_0x384e91,function(_0x2a4263){if(_0x2a4263['type']!==_0x3886('0x3b')){var _0x430899={};_0x430899[_0x2a4263[_0x3886('0x27')]]={'$like':'%'+_0x5c6331[_0x3886('0x2f')][_0x3886('0x39')]+'%'};return _0x430899;}})});}_0x2feca4=_[_0x3886('0x3a')]({},_0x2feca4,_0x5c6331['options']);var _0x4097cb={'where':_0x2feca4[_0x3886('0x37')]};return db[_0x3886('0x3c')][_0x3886('0x1c')](_0x4097cb)[_0x3886('0x23')](function(_0xb5bacb){_0x348909['count']=_0xb5bacb;if(_0x5c6331[_0x3886('0x2f')][_0x3886('0x3d')]){_0x2feca4[_0x3886('0x3e')]=[{'all':!![]}];}return db[_0x3886('0x3c')][_0x3886('0x3f')](_0x2feca4);})['then'](function(_0x19f493){_0x348909[_0x3886('0x40')]=_0x19f493;return _0x348909;})[_0x3886('0x23')](respondWithFilteredResult(_0x6a1bbb,_0x2feca4))[_0x3886('0x41')](handleError(_0x6a1bbb,null));};exports[_0x3886('0x42')]=function(_0x3e86e7,_0x4b409e){var _0x3023e3={'raw':![],'where':{'id':_0x3e86e7[_0x3886('0x43')]['id']}},_0x23bb75={};_0x23bb75[_0x3886('0x2e')]=_[_0x3886('0x30')](db['Campaign'][_0x3886('0x2b')]);_0x23bb75['query']=_[_0x3886('0x30')](_0x3e86e7[_0x3886('0x2f')]);_0x23bb75[_0x3886('0x31')]=_[_0x3886('0x44')](_0x23bb75[_0x3886('0x2e')],_0x23bb75['query']);_0x3023e3[_0x3886('0x32')]=_[_0x3886('0x44')](_0x23bb75[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x3e86e7[_0x3886('0x2f')][_0x3886('0x33')]));_0x3023e3['attributes']=_0x3023e3[_0x3886('0x32')]['length']?_0x3023e3['attributes']:_0x23bb75[_0x3886('0x2e')];if(_0x3e86e7[_0x3886('0x2f')][_0x3886('0x3d')]){_0x3023e3[_0x3886('0x3e')]=[{'all':!![]}];}_0x3023e3=_[_0x3886('0x3a')]({},_0x3023e3,_0x3e86e7[_0x3886('0x45')]);return db[_0x3886('0x3c')]['find'](_0x3023e3)[_0x3886('0x23')](handleEntityNotFound(_0x4b409e,null))['then'](respondWithResult(_0x4b409e,null))[_0x3886('0x41')](handleError(_0x4b409e,null));};exports[_0x3886('0x46')]=function(_0x1de518,_0x2f8be9){return db[_0x3886('0x3c')][_0x3886('0x46')](_0x1de518[_0x3886('0x47')],{})['then'](function(_0x1196d1){var _0x4ec22b=_0x1de518[_0x3886('0x48')][_0x3886('0x49')]({'plain':!![]});if(!_0x4ec22b)throw new Error(_0x3886('0x4a'));if(_0x4ec22b[_0x3886('0x4b')]==='user'){var _0x28b8f6=_0x1196d1[_0x3886('0x49')]({'plain':!![]});var _0x2b2b11=_0x3886('0x4c');return db[_0x3886('0x4d')][_0x3886('0x4e')]({'where':{'name':_0x2b2b11,'userProfileId':_0x4ec22b[_0x3886('0x4f')]},'raw':!![]})[_0x3886('0x23')](function(_0x45d34c){if(_0x45d34c&&_0x45d34c[_0x3886('0x50')]===0x0){return db[_0x3886('0x51')][_0x3886('0x46')]({'name':_0x28b8f6[_0x3886('0x27')],'resourceId':_0x28b8f6['id'],'type':_0x45d34c['name'],'sectionId':_0x45d34c['id']},{})[_0x3886('0x23')](function(){return _0x1196d1;});}else{return _0x1196d1;}})[_0x3886('0x41')](function(_0x47cf74){logger['error'](_0x3886('0x52'),_0x47cf74);throw _0x47cf74;});}return _0x1196d1;})[_0x3886('0x23')](respondWithResult(_0x2f8be9,0xc9))[_0x3886('0x41')](handleError(_0x2f8be9,null));};exports[_0x3886('0x53')]=function(_0x4cb1ab,_0x30e0c0){var _0x523f01={'where':{'id':_0x4cb1ab[_0x3886('0x43')]['id']}},_0x457c90={};_0x457c90[_0x3886('0x2e')]=_[_0x3886('0x30')](db[_0x3886('0x3c')][_0x3886('0x2b')]);_0x523f01['attributes']=_[_0x3886('0x44')](_0x457c90[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x4cb1ab[_0x3886('0x2f')]['fields']));_0x523f01['attributes']=_0x523f01[_0x3886('0x32')][_0x3886('0x34')]?_0x523f01[_0x3886('0x32')]:_0x457c90[_0x3886('0x2e')];if(_0x4cb1ab[_0x3886('0x2f')][_0x3886('0x3d')]){_0x523f01[_0x3886('0x3e')]=[{'all':!![]}];}_0x523f01=_[_0x3886('0x3a')]({},_0x523f01,_0x4cb1ab[_0x3886('0x45')]);return db['Campaign'][_0x3886('0x4e')](_0x523f01)[_0x3886('0x23')](handleEntityNotFound(_0x30e0c0,null))['then'](function(_0x35716f){if(_0x35716f){var _0x4adfa6=_0x35716f[_0x3886('0x49')]({'plain':!![]});_0x4adfa6=qs[_0x3886('0x54')](_0x4adfa6,['id',_0x3886('0x55'),_0x3886('0x56')]);_0x4cb1ab[_0x3886('0x47')]=_[_0x3886('0x54')](_0x4cb1ab['body'],['id',_0x3886('0x55'),_0x3886('0x56')]);return db['Campaign'][_0x3886('0x46')](_[_0x3886('0x3a')](_0x4adfa6,_0x4cb1ab['body']),{'include':_0x4cb1ab[_0x3886('0x2f')][_0x3886('0x3d')]?[{'all':!![]}]:undefined})[_0x3886('0x23')](function(_0x45bdc2){var _0x1d7c12=_0x4cb1ab[_0x3886('0x48')][_0x3886('0x49')]({'plain':!![]});if(!_0x1d7c12)throw new Error(_0x3886('0x4a'));if(_0x1d7c12['role']==='user'){var _0x148d4e=_0x45bdc2['get']({'plain':!![]});var _0x410f50=_0x3886('0x4c');return db[_0x3886('0x4d')][_0x3886('0x4e')]({'where':{'name':_0x410f50,'userProfileId':_0x1d7c12[_0x3886('0x4f')]},'raw':!![]})[_0x3886('0x23')](function(_0x5a6714){if(_0x5a6714&&_0x5a6714['autoAssociation']===0x0){return db[_0x3886('0x51')]['create']({'name':_0x148d4e[_0x3886('0x27')],'resourceId':_0x148d4e['id'],'type':_0x5a6714[_0x3886('0x27')],'sectionId':_0x5a6714['id']},{})['then'](function(){return _0x45bdc2;});}else{return _0x45bdc2;}})['catch'](function(_0x112e4a){logger[_0x3886('0x25')](_0x3886('0x52'),_0x112e4a);throw _0x112e4a;});}return _0x45bdc2;});}})[_0x3886('0x23')](respondWithResult(_0x30e0c0,0xc9))[_0x3886('0x41')](handleError(_0x30e0c0,null));};exports[_0x3886('0x22')]=function(_0x490ec3,_0x327fdb){if(_0x490ec3[_0x3886('0x47')]['id']){delete _0x490ec3['body']['id'];}return db['Campaign'][_0x3886('0x4e')]({'where':{'id':_0x490ec3[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x327fdb,null))[_0x3886('0x23')](saveUpdates(_0x490ec3['body'],null))['then'](respondWithResult(_0x327fdb,null))['catch'](handleError(_0x327fdb,null));};exports['destroy']=function(_0x5cdd86,_0x2af577){return db[_0x3886('0x3c')][_0x3886('0x4e')]({'where':{'id':_0x5cdd86[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x2af577,null))[_0x3886('0x23')](removeEntity(_0x2af577,null))[_0x3886('0x41')](handleError(_0x2af577,null));};exports[_0x3886('0x57')]=function(_0x2cf6a8,_0x46456b,_0x430768){var _0x4b0598={'raw':!![],'where':{}};var _0x5df6e4={};var _0x5a3095={'count':0x0,'rows':[]};return db[_0x3886('0x3c')][_0x3886('0x58')]({'where':{'id':_0x2cf6a8[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x46456b,null))[_0x3886('0x23')](function(_0x26ff0b){if(_0x26ff0b){_0x5df6e4['model']=_['keys'](db[_0x3886('0x59')][_0x3886('0x2b')]);_0x5df6e4[_0x3886('0x2f')]=_[_0x3886('0x30')](_0x2cf6a8[_0x3886('0x2f')]);_0x5df6e4[_0x3886('0x31')]=_[_0x3886('0x44')](_0x5df6e4[_0x3886('0x2e')],_0x5df6e4[_0x3886('0x2f')]);_0x4b0598['attributes']=_[_0x3886('0x44')](_0x5df6e4[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x2cf6a8[_0x3886('0x2f')]['fields']));_0x4b0598[_0x3886('0x32')]=_0x4b0598['attributes']['length']?_0x4b0598['attributes']:_0x5df6e4['model'];if(!_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x5a')]('nolimit')){_0x4b0598['limit']=qs[_0x3886('0x1a')](_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x1a')]);_0x4b0598[_0x3886('0x1b')]=qs[_0x3886('0x1b')](_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x1b')]);}_0x4b0598[_0x3886('0x35')]=qs['sort'](_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x36')]);_0x4b0598[_0x3886('0x37')]=qs['filters'](_[_0x3886('0x38')](_0x2cf6a8[_0x3886('0x2f')],_0x5df6e4[_0x3886('0x31')]));_0x4b0598[_0x3886('0x37')][_0x3886('0x5b')]=_0x26ff0b['id'];if(_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x39')]){_0x4b0598[_0x3886('0x37')]=_[_0x3886('0x3a')](_0x4b0598['where'],{'$or':_[_0x3886('0x2a')](_0x4b0598['attributes'],function(_0x4a1a0e){var _0x115bab={};_0x115bab[_0x4a1a0e]={'$like':'%'+_0x2cf6a8[_0x3886('0x2f')][_0x3886('0x39')]+'%'};return _0x115bab;})});}_0x4b0598=_[_0x3886('0x3a')]({},_0x4b0598,_0x2cf6a8[_0x3886('0x45')]);return db['CmHopper'][_0x3886('0x1c')]({'where':_0x4b0598[_0x3886('0x37')]})[_0x3886('0x23')](function(_0x49649c){_0x5a3095[_0x3886('0x1c')]=_0x49649c;if(_0x2cf6a8['query']['includeAll']){_0x4b0598[_0x3886('0x3e')]=[{'all':!![]}];}return db[_0x3886('0x59')][_0x3886('0x3f')](_0x4b0598);})['then'](function(_0x1697c0){_0x5a3095['rows']=_0x1697c0;return _0x5a3095;});}})['then'](respondWithFilteredResult(_0x46456b,_0x4b0598))['catch'](handleError(_0x46456b,null));};exports[_0x3886('0x5c')]=function(_0x53609a,_0x3bd8a5,_0x3f154a){var _0x2a561c={'raw':!![],'where':{}};var _0x361f0e={};var _0x1b99f6={'count':0x0,'rows':[]};return db[_0x3886('0x3c')][_0x3886('0x58')]({'where':{'id':_0x53609a['params']['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x3bd8a5,null))[_0x3886('0x23')](function(_0x13173c){if(_0x13173c){_0x361f0e[_0x3886('0x2e')]=_[_0x3886('0x30')](db['CmHopperHistory']['rawAttributes']);_0x361f0e[_0x3886('0x2f')]=_['keys'](_0x53609a[_0x3886('0x2f')]);_0x361f0e[_0x3886('0x31')]=_[_0x3886('0x44')](_0x361f0e[_0x3886('0x2e')],_0x361f0e[_0x3886('0x2f')]);_0x2a561c[_0x3886('0x32')]=_['intersection'](_0x361f0e[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x53609a[_0x3886('0x2f')]['fields']));_0x2a561c[_0x3886('0x32')]=_0x2a561c['attributes'][_0x3886('0x34')]?_0x2a561c[_0x3886('0x32')]:_0x361f0e['model'];if(!_0x53609a[_0x3886('0x2f')][_0x3886('0x5a')](_0x3886('0x5d'))){_0x2a561c['limit']=qs[_0x3886('0x1a')](_0x53609a[_0x3886('0x2f')]['limit']);_0x2a561c['offset']=qs['offset'](_0x53609a['query']['offset']);}_0x2a561c[_0x3886('0x35')]=qs[_0x3886('0x36')](_0x53609a[_0x3886('0x2f')][_0x3886('0x36')]);_0x2a561c[_0x3886('0x37')]=qs[_0x3886('0x31')](_['pick'](_0x53609a[_0x3886('0x2f')],_0x361f0e[_0x3886('0x31')]));_0x2a561c[_0x3886('0x37')][_0x3886('0x5b')]=_0x13173c['id'];if(_0x53609a[_0x3886('0x2f')]['filter']){_0x2a561c['where']=_[_0x3886('0x3a')](_0x2a561c[_0x3886('0x37')],{'$or':_[_0x3886('0x2a')](_0x2a561c[_0x3886('0x32')],function(_0x4497e6){var _0x446e70={};_0x446e70[_0x4497e6]={'$like':'%'+_0x53609a[_0x3886('0x2f')][_0x3886('0x39')]+'%'};return _0x446e70;})});}_0x2a561c=_[_0x3886('0x3a')]({},_0x2a561c,_0x53609a[_0x3886('0x45')]);return db[_0x3886('0x5e')][_0x3886('0x1c')]({'where':_0x2a561c[_0x3886('0x37')]})['then'](function(_0x45e2c4){_0x1b99f6[_0x3886('0x1c')]=_0x45e2c4;if(_0x53609a[_0x3886('0x2f')]['includeAll']){_0x2a561c['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3886('0x3f')](_0x2a561c);})['then'](function(_0x462000){_0x1b99f6[_0x3886('0x40')]=_0x462000;return _0x1b99f6;});}})[_0x3886('0x23')](respondWithFilteredResult(_0x3bd8a5,_0x2a561c))[_0x3886('0x41')](handleError(_0x3bd8a5,null));};exports[_0x3886('0x5f')]=function(_0x129ed0,_0x29bab2,_0x3b6304){var _0x1b411a={'raw':!![],'where':{}};var _0x59440f={};var _0x1c08b7={'count':0x0,'rows':[]};return db[_0x3886('0x3c')][_0x3886('0x58')]({'where':{'id':_0x129ed0['params']['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x29bab2,null))['then'](function(_0x19aef4){if(_0x19aef4){_0x59440f[_0x3886('0x2e')]=_[_0x3886('0x30')](db['CmHopperFinal'][_0x3886('0x2b')]);_0x59440f['query']=_[_0x3886('0x30')](_0x129ed0['query']);_0x59440f[_0x3886('0x31')]=_['intersection'](_0x59440f[_0x3886('0x2e')],_0x59440f['query']);_0x1b411a['attributes']=_[_0x3886('0x44')](_0x59440f[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x129ed0[_0x3886('0x2f')][_0x3886('0x33')]));_0x1b411a['attributes']=_0x1b411a[_0x3886('0x32')][_0x3886('0x34')]?_0x1b411a[_0x3886('0x32')]:_0x59440f[_0x3886('0x2e')];if(!_0x129ed0['query'][_0x3886('0x5a')](_0x3886('0x5d'))){_0x1b411a[_0x3886('0x1a')]=qs['limit'](_0x129ed0[_0x3886('0x2f')]['limit']);_0x1b411a['offset']=qs[_0x3886('0x1b')](_0x129ed0[_0x3886('0x2f')][_0x3886('0x1b')]);}_0x1b411a[_0x3886('0x35')]=qs[_0x3886('0x36')](_0x129ed0[_0x3886('0x2f')][_0x3886('0x36')]);_0x1b411a[_0x3886('0x37')]=qs[_0x3886('0x31')](_[_0x3886('0x38')](_0x129ed0['query'],_0x59440f['filters']));_0x1b411a['where'][_0x3886('0x5b')]=_0x19aef4['id'];if(_0x129ed0[_0x3886('0x2f')][_0x3886('0x39')]){_0x1b411a['where']=_[_0x3886('0x3a')](_0x1b411a[_0x3886('0x37')],{'$or':_[_0x3886('0x2a')](_0x1b411a[_0x3886('0x32')],function(_0x5e97a6){var _0x54cdfc={};_0x54cdfc[_0x5e97a6]={'$like':'%'+_0x129ed0[_0x3886('0x2f')]['filter']+'%'};return _0x54cdfc;})});}_0x1b411a=_[_0x3886('0x3a')]({},_0x1b411a,_0x129ed0[_0x3886('0x45')]);return db[_0x3886('0x60')][_0x3886('0x1c')]({'where':_0x1b411a['where']})['then'](function(_0x1ff20b){_0x1c08b7[_0x3886('0x1c')]=_0x1ff20b;if(_0x129ed0[_0x3886('0x2f')][_0x3886('0x3d')]){_0x1b411a['include']=[{'all':!![]}];}return db[_0x3886('0x60')][_0x3886('0x3f')](_0x1b411a);})[_0x3886('0x23')](function(_0x2b14b1){_0x1c08b7[_0x3886('0x40')]=_0x2b14b1;return _0x1c08b7;});}})[_0x3886('0x23')](respondWithFilteredResult(_0x29bab2,_0x1b411a))[_0x3886('0x41')](handleError(_0x29bab2,null));};exports['getHopperBlacks']=function(_0x3c508a,_0x3191e8,_0x3cde0a){var _0x17acbe={'raw':!![],'where':{}};var _0x17312c={};var _0x3197c={'count':0x0,'rows':[]};return db['Campaign'][_0x3886('0x58')]({'where':{'id':_0x3c508a[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x3191e8,null))['then'](function(_0xad4a3){if(_0xad4a3){_0x17312c['model']=_[_0x3886('0x30')](db[_0x3886('0x61')]['rawAttributes']);_0x17312c[_0x3886('0x2f')]=_[_0x3886('0x30')](_0x3c508a[_0x3886('0x2f')]);_0x17312c['filters']=_[_0x3886('0x44')](_0x17312c[_0x3886('0x2e')],_0x17312c[_0x3886('0x2f')]);_0x17acbe['attributes']=_[_0x3886('0x44')](_0x17312c[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x3c508a[_0x3886('0x2f')][_0x3886('0x33')]));_0x17acbe[_0x3886('0x32')]=_0x17acbe['attributes'][_0x3886('0x34')]?_0x17acbe[_0x3886('0x32')]:_0x17312c['model'];if(!_0x3c508a[_0x3886('0x2f')][_0x3886('0x5a')](_0x3886('0x5d'))){_0x17acbe['limit']=qs[_0x3886('0x1a')](_0x3c508a[_0x3886('0x2f')]['limit']);_0x17acbe[_0x3886('0x1b')]=qs[_0x3886('0x1b')](_0x3c508a['query']['offset']);}_0x17acbe[_0x3886('0x35')]=qs['sort'](_0x3c508a[_0x3886('0x2f')][_0x3886('0x36')]);_0x17acbe[_0x3886('0x37')]=qs[_0x3886('0x31')](_[_0x3886('0x38')](_0x3c508a[_0x3886('0x2f')],_0x17312c[_0x3886('0x31')]));_0x17acbe[_0x3886('0x37')][_0x3886('0x5b')]=_0xad4a3['id'];if(_0x3c508a[_0x3886('0x2f')][_0x3886('0x39')]){_0x17acbe[_0x3886('0x37')]=_[_0x3886('0x3a')](_0x17acbe[_0x3886('0x37')],{'$or':_[_0x3886('0x2a')](_0x17acbe[_0x3886('0x32')],function(_0x5c0ff7){var _0x6d5591={};_0x6d5591[_0x5c0ff7]={'$like':'%'+_0x3c508a[_0x3886('0x2f')][_0x3886('0x39')]+'%'};return _0x6d5591;})});}_0x17acbe=_['merge']({},_0x17acbe,_0x3c508a[_0x3886('0x45')]);return db[_0x3886('0x61')]['count']({'where':_0x17acbe[_0x3886('0x37')]})[_0x3886('0x23')](function(_0x47d2ba){_0x3197c[_0x3886('0x1c')]=_0x47d2ba;if(_0x3c508a['query']['includeAll']){_0x17acbe[_0x3886('0x3e')]=[{'all':!![]}];}return db[_0x3886('0x61')][_0x3886('0x3f')](_0x17acbe);})[_0x3886('0x23')](function(_0x10a6ed){_0x3197c['rows']=_0x10a6ed;return _0x3197c;});}})['then'](respondWithFilteredResult(_0x3191e8,_0x17acbe))[_0x3886('0x41')](handleError(_0x3191e8,null));};exports['getLists']=function(_0xdc7f0a,_0x14e00e,_0x25fbf6){var _0x579a8c={};var _0x4eac2c={};var _0x4c061c;var _0x119223;return db[_0x3886('0x3c')][_0x3886('0x58')]({'where':{'id':_0xdc7f0a[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x14e00e,null))[_0x3886('0x23')](function(_0x53db87){if(_0x53db87){_0x4c061c=_0x53db87;_0x4eac2c[_0x3886('0x2e')]=_[_0x3886('0x30')](db[_0x3886('0x62')]['rawAttributes']);_0x4eac2c[_0x3886('0x2f')]=_[_0x3886('0x30')](_0xdc7f0a[_0x3886('0x2f')]);_0x4eac2c[_0x3886('0x31')]=_[_0x3886('0x44')](_0x4eac2c[_0x3886('0x2e')],_0x4eac2c['query']);_0x579a8c[_0x3886('0x32')]=_[_0x3886('0x44')](_0x4eac2c[_0x3886('0x2e')],qs['fields'](_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x33')]));_0x579a8c[_0x3886('0x32')]=_0x579a8c[_0x3886('0x32')][_0x3886('0x34')]?_0x579a8c[_0x3886('0x32')]:_0x4eac2c[_0x3886('0x2e')];_0x579a8c[_0x3886('0x35')]=qs['sort'](_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x36')]);_0x579a8c[_0x3886('0x37')]=qs[_0x3886('0x31')](_[_0x3886('0x38')](_0xdc7f0a[_0x3886('0x2f')],_0x4eac2c[_0x3886('0x31')]));if(_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x39')]){_0x579a8c[_0x3886('0x37')]=_[_0x3886('0x3a')](_0x579a8c['where'],{'$or':_[_0x3886('0x2a')](_0x579a8c[_0x3886('0x32')],function(_0x5ff10e){var _0x5d7f0a={};_0x5d7f0a[_0x5ff10e]={'$like':'%'+_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x39')]+'%'};return _0x5d7f0a;})});}_0x579a8c=_['merge']({},_0x579a8c,_0xdc7f0a[_0x3886('0x45')]);return _0x4c061c[_0x3886('0x63')](_0x579a8c);}})['then'](function(_0x44a60d){if(_0x44a60d){_0x119223=_0x44a60d[_0x3886('0x34')];if(!_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x5a')](_0x3886('0x5d'))){_0x579a8c[_0x3886('0x1a')]=qs[_0x3886('0x1a')](_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x1a')]);_0x579a8c[_0x3886('0x1b')]=qs[_0x3886('0x1b')](_0xdc7f0a[_0x3886('0x2f')][_0x3886('0x1b')]);}return _0x4c061c['getLists'](_0x579a8c);}})[_0x3886('0x23')](function(_0x159285){if(_0x159285){return _0x159285?{'count':_0x119223,'rows':_0x159285}:null;}})['then'](respondWithResult(_0x14e00e,null))[_0x3886('0x41')](handleError(_0x14e00e,null));};exports[_0x3886('0x64')]=function(_0x31d251,_0x4fdcd9,_0x3b8523){var _0x2071d6,_0x302f70;var _0x433fc6=[];var _0x453515=moment()[_0x3886('0x65')](_0x3886('0x66'));return db['Campaign']['find']({'where':{'id':_0x31d251[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x4fdcd9,null))['then'](function(_0x57ccbb){if(_0x57ccbb){_0x302f70=_0x57ccbb;return _0x57ccbb[_0x3886('0x64')](_0x31d251[_0x3886('0x47')][_0x3886('0x67')],_[_0x3886('0x54')](_0x31d251[_0x3886('0x47')],['ids','id'])||{});}return null;})['spread'](function(_0x4422f5){var _0x163a1f;var _0x51a2c0;_0x2071d6=_0x4422f5||[];var _0x295792=[];if(_0x4422f5){for(var _0x2d7ff0=0x0;_0x2d7ff0<_0x4422f5['length'];_0x2d7ff0+=0x1){var _0x83400=_0x4422f5[_0x2d7ff0]['get']({'plain':!![]});_0x302f70[_0x3886('0x68')]=_0x31d251['body'][_0x3886('0x68')]?_0x31d251[_0x3886('0x47')][_0x3886('0x68')]:_0x302f70[_0x3886('0x68')];switch(_0x302f70['dialCheckDuplicateType']){case _0x3886('0x69'):_0x163a1f=squel['insert']()[_0x3886('0x6a')](_0x3886('0x6b'))[_0x3886('0x6c')]([_0x3886('0x6d'),'scheduledAt','ContactId',_0x3886('0x6e'),_0x3886('0x5b'),'createdAt',_0x3886('0x56')],squel[_0x3886('0x6f')]()[_0x3886('0x70')](_0x3886('0x6d'),_0x3886('0x6d'))[_0x3886('0x70')](_0x3886('0x71'),_0x3886('0x72'))[_0x3886('0x70')]('id','ContactId')[_0x3886('0x70')](_0x83400['CmListId'][_0x3886('0x73')](),'ListId')['field'](_0x31d251[_0x3886('0x43')]['id'][_0x3886('0x73')](),_0x3886('0x5b'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27',_0x3886('0x55'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27','updatedAt')[_0x3886('0x74')](_0x3886('0x75'))[_0x3886('0x37')](_0x3886('0x76'))['where'](_0x3886('0x77'),_0x83400[_0x3886('0x78')][_0x3886('0x73')]())['where'](_0x3886('0x79'))['where'](_0x3886('0x7a'),squel['select']()[_0x3886('0x70')](_0x3886('0x7b'))['from']('cm_hopper_final')[_0x3886('0x37')](_0x3886('0x7c'),_0x31d251[_0x3886('0x43')]['id'][_0x3886('0x73')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3886('0x6f')]()[_0x3886('0x70')](_0x3886('0x7d'))[_0x3886('0x74')](_0x3886('0x6b'))[_0x3886('0x37')]('CampaignId\x20=\x20?',_0x31d251[_0x3886('0x43')]['id']['toString']())))[_0x3886('0x73')]();break;case _0x3886('0x7e'):_0x163a1f=squel[_0x3886('0x7f')]()[_0x3886('0x6a')]('cm_hopper')[_0x3886('0x6c')]([_0x3886('0x6d'),_0x3886('0x72'),_0x3886('0x80'),_0x3886('0x6e'),_0x3886('0x5b'),_0x3886('0x55'),_0x3886('0x56')],squel[_0x3886('0x6f')]()[_0x3886('0x70')]('phone',_0x3886('0x6d'))['field'](_0x3886('0x71'),_0x3886('0x72'))['field']('id',_0x3886('0x80'))[_0x3886('0x70')](_0x83400[_0x3886('0x78')]['toString'](),'ListId')[_0x3886('0x70')](_0x31d251[_0x3886('0x43')]['id'][_0x3886('0x73')](),_0x3886('0x5b'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27',_0x3886('0x55'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27',_0x3886('0x56'))['from'](_0x3886('0x75'))[_0x3886('0x37')](_0x3886('0x76'))[_0x3886('0x37')]('ListId\x20=\x20?',_0x83400[_0x3886('0x78')]['toString']())[_0x3886('0x37')](_0x3886('0x79'))[_0x3886('0x37')](_0x3886('0x7a'),squel['select']()[_0x3886('0x70')]('COALESCE(phone,\x27\x27)')[_0x3886('0x74')](_0x3886('0x6b'))['where'](_0x3886('0x7c'),_0x31d251['params']['id']['toString']())))[_0x3886('0x73')]();break;default:_0x163a1f=squel[_0x3886('0x7f')]()[_0x3886('0x6a')](_0x3886('0x6b'))[_0x3886('0x6c')](['phone',_0x3886('0x72'),'ContactId','ListId',_0x3886('0x5b'),_0x3886('0x55'),'updatedAt'],squel[_0x3886('0x6f')]()[_0x3886('0x70')](_0x3886('0x6d'),_0x3886('0x6d'))[_0x3886('0x70')](_0x3886('0x71'),_0x3886('0x72'))[_0x3886('0x70')]('id',_0x3886('0x80'))[_0x3886('0x70')](_0x83400[_0x3886('0x78')]['toString'](),_0x3886('0x6e'))[_0x3886('0x70')](_0x31d251[_0x3886('0x43')]['id'][_0x3886('0x73')](),'CampaignId')[_0x3886('0x70')]('\x27'+_0x453515+'\x27',_0x3886('0x55'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27',_0x3886('0x56'))[_0x3886('0x74')]('cm_contacts')[_0x3886('0x37')](_0x3886('0x76'))[_0x3886('0x37')](_0x3886('0x77'),_0x83400[_0x3886('0x78')]['toString']())[_0x3886('0x37')](_0x3886('0x79')))[_0x3886('0x73')]();}_0x51a2c0=squel[_0x3886('0x7f')]()['into'](_0x3886('0x81'))['fromQuery']([_0x3886('0x82'),_0x3886('0x72'),_0x3886('0x6d'),_0x3886('0x83'),_0x3886('0x55'),_0x3886('0x56')],squel['select']()[_0x3886('0x70')](_0x3886('0x84'),'id')[_0x3886('0x70')](_0x3886('0x71'),_0x3886('0x72'))[_0x3886('0x70')](_0x3886('0x85'),_0x3886('0x6d'))[_0x3886('0x70')](_0x3886('0x86'),_0x3886('0x83'))[_0x3886('0x70')]('\x27'+_0x453515+'\x27','createdAt')[_0x3886('0x70')]('\x27'+_0x453515+'\x27','updatedAt')[_0x3886('0x74')](_0x3886('0x87'),'ci')[_0x3886('0x88')](_0x3886('0x6b'),'h',_0x3886('0x89'))[_0x3886('0x37')](_0x3886('0x8a'),_0x83400['CmListId'][_0x3886('0x73')]())[_0x3886('0x37')](_0x3886('0x8b'),_0x31d251['params']['id'][_0x3886('0x73')]())[_0x3886('0x37')](_0x3886('0x8c'),_0x453515))[_0x3886('0x73')]();_0x295792['push'](db[_0x3886('0x8d')][_0x3886('0x2f')](_0x163a1f));_0x433fc6['push'](db['sequelize'][_0x3886('0x2f')](_0x51a2c0));}return BPromise[_0x3886('0x8e')](_0x295792);}})[_0x3886('0x23')](function(){return BPromise[_0x3886('0x8e')](_0x433fc6);})['then'](function(){return _0x2071d6;})[_0x3886('0x23')](respondWithResult(_0x4fdcd9,null))[_0x3886('0x41')](handleError(_0x4fdcd9,null));};exports[_0x3886('0x8f')]=function(_0x1ad475,_0x9bbaff,_0x35f9c4){return db['Campaign'][_0x3886('0x4e')]({'where':{'id':_0x1ad475[_0x3886('0x43')]['id']}})['then'](handleEntityNotFound(_0x9bbaff,null))[_0x3886('0x23')](function(_0x399ed3){if(_0x399ed3){return _0x399ed3[_0x3886('0x8f')](_0x1ad475[_0x3886('0x2f')][_0x3886('0x67')]);}})[_0x3886('0x23')](function(_0x46e6a5){if(_0x46e6a5){return db['CmHopper']['destroy']({'where':{'ListId':_0x1ad475[_0x3886('0x2f')][_0x3886('0x67')],'CampaignId':_0x1ad475[_0x3886('0x43')]['id']}})[_0x3886('0x23')](function(){return _0x46e6a5;});}})[_0x3886('0x23')](respondWithStatusCode(_0x9bbaff,null))[_0x3886('0x41')](handleError(_0x9bbaff,null));};exports[_0x3886('0x90')]=function(_0x27d2ed,_0x27049d,_0x1c8e38){var _0x4212cd={};var _0x563f2b={};var _0x4d9a;var _0xaa8f6a;return db[_0x3886('0x3c')][_0x3886('0x58')]({'where':{'id':_0x27d2ed[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x27049d,null))[_0x3886('0x23')](function(_0x157b30){if(_0x157b30){_0x4d9a=_0x157b30;_0x563f2b[_0x3886('0x2e')]=_[_0x3886('0x30')](db[_0x3886('0x62')][_0x3886('0x2b')]);_0x563f2b[_0x3886('0x2f')]=_[_0x3886('0x30')](_0x27d2ed[_0x3886('0x2f')]);_0x563f2b[_0x3886('0x31')]=_[_0x3886('0x44')](_0x563f2b['model'],_0x563f2b[_0x3886('0x2f')]);_0x4212cd[_0x3886('0x32')]=_[_0x3886('0x44')](_0x563f2b[_0x3886('0x2e')],qs[_0x3886('0x33')](_0x27d2ed[_0x3886('0x2f')]['fields']));_0x4212cd[_0x3886('0x32')]=_0x4212cd[_0x3886('0x32')][_0x3886('0x34')]?_0x4212cd[_0x3886('0x32')]:_0x563f2b[_0x3886('0x2e')];_0x4212cd[_0x3886('0x35')]=qs[_0x3886('0x36')](_0x27d2ed[_0x3886('0x2f')][_0x3886('0x36')]);_0x4212cd[_0x3886('0x37')]=qs[_0x3886('0x31')](_[_0x3886('0x38')](_0x27d2ed['query'],_0x563f2b[_0x3886('0x31')]));if(_0x27d2ed[_0x3886('0x2f')][_0x3886('0x39')]){_0x4212cd[_0x3886('0x37')]=_[_0x3886('0x3a')](_0x4212cd[_0x3886('0x37')],{'$or':_['map'](_0x4212cd['attributes'],function(_0x5acaf4){var _0x19ebc2={};_0x19ebc2[_0x5acaf4]={'$like':'%'+_0x27d2ed[_0x3886('0x2f')]['filter']+'%'};return _0x19ebc2;})});}_0x4212cd=_[_0x3886('0x3a')]({},_0x4212cd,_0x27d2ed[_0x3886('0x45')]);return _0x4d9a[_0x3886('0x90')](_0x4212cd);}})[_0x3886('0x23')](function(_0x7757a3){if(_0x7757a3){_0xaa8f6a=_0x7757a3[_0x3886('0x34')];if(!_0x27d2ed[_0x3886('0x2f')]['hasOwnProperty'](_0x3886('0x5d'))){_0x4212cd[_0x3886('0x1a')]=qs[_0x3886('0x1a')](_0x27d2ed[_0x3886('0x2f')]['limit']);_0x4212cd[_0x3886('0x1b')]=qs[_0x3886('0x1b')](_0x27d2ed[_0x3886('0x2f')][_0x3886('0x1b')]);}return _0x4d9a[_0x3886('0x90')](_0x4212cd);}})['then'](function(_0x2cb4ef){if(_0x2cb4ef){return _0x2cb4ef?{'count':_0xaa8f6a,'rows':_0x2cb4ef}:null;}})[_0x3886('0x23')](respondWithResult(_0x27049d,null))[_0x3886('0x41')](handleError(_0x27049d,null));};exports[_0x3886('0x91')]=function(_0x498af3,_0x2c15ea,_0x3034e7){var _0x471b45,_0x7f7cb;var _0x5a611e=[];var _0x26574e=moment()[_0x3886('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3886('0x3c')]['find']({'where':{'id':_0x498af3[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x2c15ea,null))[_0x3886('0x23')](function(_0x4cfc5b){if(_0x4cfc5b){_0x7f7cb=_0x4cfc5b;return _0x4cfc5b[_0x3886('0x91')](_0x498af3['body']['ids'],_['omit'](_0x498af3[_0x3886('0x47')],[_0x3886('0x67'),'id'])||{});}return null;})[_0x3886('0x92')](function(_0x12c3e1){var _0x5ec338;var _0x350af0;_0x471b45=_0x12c3e1||[];var _0x14c12d=[];if(_0x12c3e1){for(var _0x274dbd=0x0;_0x274dbd<_0x12c3e1[_0x3886('0x34')];_0x274dbd+=0x1){var _0x3aa560=_0x12c3e1[_0x274dbd][_0x3886('0x49')]({'plain':!![]});_0x5ec338=squel[_0x3886('0x7f')]()[_0x3886('0x6a')](_0x3886('0x93'))['fromQuery'](['phone','ContactId',_0x3886('0x6e'),_0x3886('0x5b'),_0x3886('0x55'),_0x3886('0x56')],squel['select']()['field'](_0x3886('0x6d'),_0x3886('0x6d'))[_0x3886('0x70')]('id','ContactId')[_0x3886('0x70')](_0x3aa560[_0x3886('0x78')]['toString'](),_0x3886('0x6e'))[_0x3886('0x70')](_0x498af3[_0x3886('0x43')]['id'][_0x3886('0x73')](),'CampaignId')[_0x3886('0x70')](_0x3886('0x71'),'createdAt')[_0x3886('0x70')]('NOW()',_0x3886('0x56'))[_0x3886('0x74')](_0x3886('0x75'))['where'](_0x3886('0x76'))[_0x3886('0x37')]('ListId\x20=\x20?',_0x3aa560[_0x3886('0x78')][_0x3886('0x73')]())[_0x3886('0x37')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x14c12d[_0x3886('0x94')](db[_0x3886('0x8d')][_0x3886('0x2f')](_0x5ec338));}return BPromise[_0x3886('0x8e')](_0x14c12d);}})[_0x3886('0x23')](function(){return _0x471b45;})[_0x3886('0x23')](respondWithResult(_0x2c15ea,null))[_0x3886('0x41')](handleError(_0x2c15ea,null));};exports['removeBlackLists']=function(_0xf3032c,_0x2d93d5,_0x44b920){return db[_0x3886('0x3c')][_0x3886('0x4e')]({'where':{'id':_0xf3032c[_0x3886('0x43')]['id']}})[_0x3886('0x23')](handleEntityNotFound(_0x2d93d5,null))[_0x3886('0x23')](function(_0x343a7e){if(_0x343a7e){return _0x343a7e[_0x3886('0x95')](_0xf3032c[_0x3886('0x2f')][_0x3886('0x67')]);}})[_0x3886('0x23')](function(_0x471fa6){if(_0x471fa6){return db[_0x3886('0x61')][_0x3886('0x24')]({'where':{'ListId':_0xf3032c[_0x3886('0x2f')][_0x3886('0x67')],'CampaignId':_0xf3032c['params']['id']}})[_0x3886('0x23')](function(){return _0x471fa6;});}})[_0x3886('0x23')](respondWithStatusCode(_0x2d93d5,null))['catch'](handleError(_0x2d93d5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 93091ca..72747f3 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1730e1,_0x81c0ea){var _0x2d3b5b=function(_0x2de0e7){while(--_0x2de0e7){_0x1730e1['push'](_0x1730e1['shift']());}};_0x2d3b5b(++_0x81c0ea);}(_0x7a54,0x106));var _0x47a5=function(_0x1c6658,_0x40b509){_0x1c6658=_0x1c6658-0x0;var _0x300971=_0x7a54[_0x1c6658];return _0x300971;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 5079682..32e38b1 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 _0x37b4=['stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','request\x20sent'];(function(_0x231a02,_0x2a9e36){var _0x3ae533=function(_0xba726e){while(--_0xba726e){_0x231a02['push'](_0x231a02['shift']());}};_0x3ae533(++_0x2a9e36);}(_0x37b4,0xef));var _0x437b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x37b4[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var moment=require(_0x437b('0x1'));var BPromise=require(_0x437b('0x2'));var rs=require(_0x437b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x437b('0x4'))['db'];var utils=require(_0x437b('0x5'));var logger=require(_0x437b('0x6'))(_0x437b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x437b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7dea,_0x4aada7,_0x226e3c){return new BPromise(function(_0x5df980,_0x432b63){return client['request'](_0x3c7dea,_0x226e3c)['then'](function(_0x44bf1d){logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'),JSON[_0x437b('0xb')](_0x44bf1d));if(_0x44bf1d[_0x437b('0xc')]){if(_0x44bf1d[_0x437b('0xc')]['code']===0x1f4){logger[_0x437b('0xc')](_0x437b('0xd'),_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x432b63(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x5df980(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}else{logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));_0x5df980(_0x44bf1d[_0x437b('0xf')][_0x437b('0xe')]);}})[_0x437b('0x10')](function(_0x1d31af){logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x1d31af);_0x432b63(_0x1d31af);});});}exports[_0x437b('0x11')]=function(_0x501d8c){var _0x2b3994=this;return new Promise(function(_0x107024,_0x1c91bc){return db[_0x437b('0x12')]['findAll']({'raw':_0x501d8c['options']?_0x501d8c['options']['raw']===undefined?!![]:![]:!![],'where':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['where']||null:null,'attributes':_0x501d8c[_0x437b('0x13')]?_0x501d8c['options'][_0x437b('0x14')]||null:null,'limit':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['limit']||null:null,'include':_0x501d8c['options']?_0x501d8c['options'][_0x437b('0x15')]?_[_0x437b('0x16')](_0x501d8c[_0x437b('0x13')][_0x437b('0x15')],function(_0x8c5852){return{'model':db[_0x8c5852[_0x437b('0x17')]],'as':_0x8c5852['as'],'attributes':_0x8c5852[_0x437b('0x14')],'include':_0x8c5852[_0x437b('0x15')]?_[_0x437b('0x16')](_0x8c5852[_0x437b('0x15')],function(_0x258198){return{'model':db[_0x258198['model']],'as':_0x258198['as'],'attributes':_0x258198[_0x437b('0x14')],'include':_0x258198[_0x437b('0x15')]?_[_0x437b('0x16')](_0x258198[_0x437b('0x15')],function(_0x17092c){return{'model':db[_0x17092c['model']],'as':_0x17092c['as'],'attributes':_0x17092c[_0x437b('0x14')]};}):[]};}):[]};}):[]:[]})[_0x437b('0x18')](function(_0x4a7d0b){logger[_0x437b('0x9')]('GetCampaign',_0x501d8c);logger['debug']('GetCampaign',_0x501d8c,JSON[_0x437b('0xb')](_0x4a7d0b));_0x107024(_0x4a7d0b);})['catch'](function(_0x37a3d7){logger[_0x437b('0xc')](_0x437b('0x11'),_0x37a3d7['message'],_0x501d8c);_0x1c91bc(_0x2b3994['error'](0x1f4,_0x37a3d7[_0x437b('0xe')]));});});};
\ No newline at end of file
+var _0x7dc2=['Campaign','findAll','options','raw','include','model','map','attributes','stringify','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetCampaign'];(function(_0x53aaf8,_0x863bcb){var _0x1fedb1=function(_0x5696f4){while(--_0x5696f4){_0x53aaf8['push'](_0x53aaf8['shift']());}};_0x1fedb1(++_0x863bcb);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27dc('0x0'));var BPromise=require(_0x27dc('0x1'));var rs=require(_0x27dc('0x2'));var fs=require('fs');var Redis=require(_0x27dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27dc('0x4'));var logger=require(_0x27dc('0x5'))('rpc');var config=require(_0x27dc('0x6'));var jayson=require(_0x27dc('0x7'));var client=jayson['client'][_0x27dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2e10,_0x95bbb6,_0x3b3eee){return new BPromise(function(_0x5181ab,_0x45aa07){return client[_0x27dc('0x9')](_0x4d2e10,_0x3b3eee)[_0x27dc('0xa')](function(_0x242997){logger['info'](_0x27dc('0xb'),_0x95bbb6,'request\x20sent');logger[_0x27dc('0xc')](_0x27dc('0xd'),_0x95bbb6,_0x27dc('0xe'),JSON['stringify'](_0x242997));if(_0x242997['error']){if(_0x242997[_0x27dc('0xf')][_0x27dc('0x10')]===0x1f4){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x242997['error'][_0x27dc('0x11')]);return _0x45aa07(_0x242997['error'][_0x27dc('0x11')]);}logger['error'](_0x27dc('0xb'),_0x95bbb6,_0x242997[_0x27dc('0xf')][_0x27dc('0x11')]);return _0x5181ab(_0x242997[_0x27dc('0xf')]['message']);}else{logger[_0x27dc('0x12')](_0x27dc('0xb'),_0x95bbb6,_0x27dc('0xe'));_0x5181ab(_0x242997[_0x27dc('0x13')][_0x27dc('0x11')]);}})['catch'](function(_0x3ff8f8){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x3ff8f8);_0x45aa07(_0x3ff8f8);});});}exports[_0x27dc('0x14')]=function(_0x5d308b){var _0x5ecb19=this;return new Promise(function(_0x1ff9a2,_0x225b2c){return db[_0x27dc('0x15')][_0x27dc('0x16')]({'raw':_0x5d308b[_0x27dc('0x17')]?_0x5d308b[_0x27dc('0x17')][_0x27dc('0x18')]===undefined?!![]:![]:!![],'where':_0x5d308b[_0x27dc('0x17')]?_0x5d308b[_0x27dc('0x17')]['where']||null:null,'attributes':_0x5d308b[_0x27dc('0x17')]?_0x5d308b[_0x27dc('0x17')]['attributes']||null:null,'limit':_0x5d308b[_0x27dc('0x17')]?_0x5d308b['options']['limit']||null:null,'include':_0x5d308b[_0x27dc('0x17')]?_0x5d308b['options'][_0x27dc('0x19')]?_['map'](_0x5d308b['options'][_0x27dc('0x19')],function(_0x4a9da0){return{'model':db[_0x4a9da0[_0x27dc('0x1a')]],'as':_0x4a9da0['as'],'attributes':_0x4a9da0['attributes'],'include':_0x4a9da0[_0x27dc('0x19')]?_[_0x27dc('0x1b')](_0x4a9da0[_0x27dc('0x19')],function(_0x19db16){return{'model':db[_0x19db16['model']],'as':_0x19db16['as'],'attributes':_0x19db16[_0x27dc('0x1c')],'include':_0x19db16['include']?_['map'](_0x19db16[_0x27dc('0x19')],function(_0x25bfb7){return{'model':db[_0x25bfb7['model']],'as':_0x25bfb7['as'],'attributes':_0x25bfb7[_0x27dc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x27dc('0xa')](function(_0x2ac84c){logger[_0x27dc('0x12')](_0x27dc('0x14'),_0x5d308b);logger[_0x27dc('0xc')](_0x27dc('0x14'),_0x5d308b,JSON[_0x27dc('0x1d')](_0x2ac84c));_0x1ff9a2(_0x2ac84c);})[_0x27dc('0x1e')](function(_0xb4e273){logger[_0x27dc('0xf')]('GetCampaign',_0xb4e273[_0x27dc('0x11')],_0x5d308b);_0x225b2c(_0x5ecb19[_0x27dc('0xf')](0x1f4,_0xb4e273['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 42fb499..1805905 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 _0xf185=['/:id/lists','getLists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','addLists','addBlackLists','update','removeLists','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0xf185,0x1be));var _0x5f18=function(_0x3cd774,_0x1c01b1){_0x3cd774=_0x3cd774-0x0;var _0x1f4922=_0xf185[_0x3cd774];return _0x1f4922;};'use strict';var multer=require(_0x5f18('0x0'));var util=require('util');var path=require(_0x5f18('0x1'));var timeout=require(_0x5f18('0x2'));var express=require(_0x5f18('0x3'));var router=express[_0x5f18('0x4')]();var fs_extra=require(_0x5f18('0x5'));var auth=require(_0x5f18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f18('0x7'));var controller=require(_0x5f18('0x8'));router[_0x5f18('0x9')]('/',auth[_0x5f18('0xa')](),controller['index']);router[_0x5f18('0x9')](_0x5f18('0xb'),auth['isAuthenticated'](),controller[_0x5f18('0xc')]);router['get'](_0x5f18('0xd'),auth[_0x5f18('0xa')](),controller['getHoppers']);router[_0x5f18('0x9')](_0x5f18('0xe'),auth['isAuthenticated'](),controller[_0x5f18('0xf')]);router[_0x5f18('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x5f18('0x10')]);router[_0x5f18('0x9')](_0x5f18('0x11'),auth['isAuthenticated'](),controller[_0x5f18('0x12')]);router[_0x5f18('0x9')](_0x5f18('0x13'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x14')]);router[_0x5f18('0x9')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x16')]);router['post']('/',auth[_0x5f18('0xa')](),controller['create']);router['post'](_0x5f18('0x17'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x18')]);router[_0x5f18('0x19')](_0x5f18('0x13'),auth['isAuthenticated'](),controller[_0x5f18('0x1a')]);router[_0x5f18('0x19')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1b')]);router['put'](_0x5f18('0xb'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1c')]);router['delete'](_0x5f18('0xb'),auth[_0x5f18('0xa')](),controller['destroy']);router['delete'](_0x5f18('0x13'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1d')]);router[_0x5f18('0x1e')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0xd200=['./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','clone','addLists','update','destroy','delete','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x33f1e8,_0x21c9bd){var _0x3176ae=function(_0x2e8cb7){while(--_0x2e8cb7){_0x33f1e8['push'](_0x33f1e8['shift']());}};_0x3176ae(++_0x21c9bd);}(_0xd200,0x7d));var _0x0d20=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xd200[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0d20('0x0'));var util=require(_0x0d20('0x1'));var path=require(_0x0d20('0x2'));var timeout=require(_0x0d20('0x3'));var express=require('express');var router=express[_0x0d20('0x4')]();var fs_extra=require(_0x0d20('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0d20('0x6'));var config=require('../../config/environment');var controller=require(_0x0d20('0x7'));router[_0x0d20('0x8')]('/',auth[_0x0d20('0x9')](),controller[_0x0d20('0xa')]);router[_0x0d20('0x8')](_0x0d20('0xb'),auth['isAuthenticated'](),controller[_0x0d20('0xc')]);router[_0x0d20('0x8')](_0x0d20('0xd'),auth[_0x0d20('0x9')](),controller[_0x0d20('0xe')]);router[_0x0d20('0x8')](_0x0d20('0xf'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x10')]);router[_0x0d20('0x8')](_0x0d20('0x11'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x12')]);router[_0x0d20('0x8')](_0x0d20('0x13'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x14')]);router[_0x0d20('0x8')](_0x0d20('0x15'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x16')]);router[_0x0d20('0x8')]('/:id/blacklists',auth[_0x0d20('0x9')](),controller['getBlackLists']);router[_0x0d20('0x17')]('/',auth[_0x0d20('0x9')](),controller['create']);router['post'](_0x0d20('0x18'),auth['isAuthenticated'](),controller[_0x0d20('0x19')]);router[_0x0d20('0x17')](_0x0d20('0x15'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x1a')]);router['post']('/:id/blacklists',auth[_0x0d20('0x9')](),controller['addBlackLists']);router['put']('/:id',auth[_0x0d20('0x9')](),controller[_0x0d20('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0d20('0x1c')]);router[_0x0d20('0x1d')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x0d20('0x1e'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x1f')]);module[_0x0d20('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b784986..d8f804c 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 _0x98ee=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x236fd6,_0x55fb7d){var _0x479e14=function(_0x7488ef){while(--_0x7488ef){_0x236fd6['push'](_0x236fd6['shift']());}};_0x479e14(++_0x55fb7d);}(_0x98ee,0x144));var _0xe98e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x98ee[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xe98e('0x0'));module[_0xe98e('0x1')]={'key':{'type':Sequelize[_0xe98e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe98e('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe98e('0x4')],'get':function(){return this['getDataValue'](_0xe98e('0x5'));}}};
\ No newline at end of file
+var _0x28fe=['key','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x28fe,0x151));var _0xe28f=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x28fe[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xe28f('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xe28f('0x1')],'length':_0xe28f('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe28f('0x3')],'get':function(){return this[_0xe28f('0x4')](_0xe28f('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index cf0ff41..ca42ae6 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 _0xb65b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','then','include','findAll','rows','catch','params','CannedAnswer','rawAttributes','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb65b,0x1a1));var _0xbb65=function(_0x4acaee,_0x2a5f32){_0x4acaee=_0x4acaee-0x0;var _0x418cb3=_0xb65b[_0x4acaee];return _0x418cb3;};'use strict';var emlformat=require(_0xbb65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb65('0x1'));var jsonpatch=require(_0xbb65('0x2'));var rp=require(_0xbb65('0x3'));var moment=require(_0xbb65('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb65('0x5'));var util=require(_0xbb65('0x6'));var path=require(_0xbb65('0x7'));var sox=require(_0xbb65('0x8'));var csv=require(_0xbb65('0x9'));var ejs=require(_0xbb65('0xa'));var fs=require('fs');var fs_extra=require(_0xbb65('0xb'));var _=require(_0xbb65('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb65('0xd'));var deskjs=require(_0xbb65('0xe'));var toCsv=require(_0xbb65('0x9'));var querystring=require('querystring');var Papa=require(_0xbb65('0xf'));var Redis=require('ioredis');var authService=require(_0xbb65('0x10'));var qs=require(_0xbb65('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb65('0x12'));var logger=require(_0xbb65('0x13'))(_0xbb65('0x14'));var utils=require(_0xbb65('0x15'));var config=require(_0xbb65('0x16'));var licenseUtil=require(_0xbb65('0x17'));var db=require(_0xbb65('0x18'))['db'];function respondWithStatusCode(_0x4fe5b0,_0x19b33c){_0x19b33c=_0x19b33c||0xcc;return function(_0xbedf9c){if(_0xbedf9c){return _0x4fe5b0[_0xbb65('0x19')](_0x19b33c);}return _0x4fe5b0[_0xbb65('0x1a')](_0x19b33c)[_0xbb65('0x1b')]();};}function respondWithResult(_0x128d92,_0x36dae3){_0x36dae3=_0x36dae3||0xc8;return function(_0x2ede3f){if(_0x2ede3f){return _0x128d92[_0xbb65('0x1a')](_0x36dae3)[_0xbb65('0x1c')](_0x2ede3f);}};}function respondWithFilteredResult(_0x155859,_0x2b9e08){return function(_0xbd544a){if(_0xbd544a){var _0x4e0c59=typeof _0x2b9e08[_0xbb65('0x1d')]===_0xbb65('0x1e')&&typeof _0x2b9e08[_0xbb65('0x1f')]===_0xbb65('0x1e');var _0x55c18f=_0xbd544a[_0xbb65('0x20')];var _0x3a1994=_0x4e0c59?0x0:_0x2b9e08[_0xbb65('0x1d')];var _0x2fc420=_0x4e0c59?_0xbd544a[_0xbb65('0x20')]:_0x2b9e08[_0xbb65('0x1d')]+_0x2b9e08[_0xbb65('0x1f')];var _0x4c3439;if(_0x2fc420>=_0x55c18f){_0x2fc420=_0x55c18f;_0x4c3439=0xc8;}else{_0x4c3439=0xce;}_0x155859[_0xbb65('0x1a')](_0x4c3439);return _0x155859[_0xbb65('0x21')]('Content-Range',_0x3a1994+'-'+_0x2fc420+'/'+_0x55c18f)[_0xbb65('0x1c')](_0xbd544a);}return null;};}function patchUpdates(_0x486203){return function(_0x1e7708){try{jsonpatch['apply'](_0x1e7708,_0x486203,!![]);}catch(_0x5cf0c0){return BPromise[_0xbb65('0x22')](_0x5cf0c0);}return _0x1e7708[_0xbb65('0x23')]();};}function saveUpdates(_0x1d6653,_0x5580e5){return function(_0x1a93d3){if(_0x1a93d3){return _0x1a93d3[_0xbb65('0x24')](_0x1d6653)['then'](function(_0x5e274b){return _0x5e274b;});}return null;};}function removeEntity(_0x381390,_0x4032fb){return function(_0x427d14){if(_0x427d14){return _0x427d14[_0xbb65('0x25')]()['then'](function(){var _0xe37cee=_0x427d14[_0xbb65('0x26')]({'plain':!![]});var _0x4276ba=_0xbb65('0x27');return db[_0xbb65('0x28')][_0xbb65('0x25')]({'where':{'type':_0x4276ba,'resourceId':_0xe37cee['id']}})['then'](function(){return _0x427d14;});})['then'](function(){_0x381390['status'](0xcc)[_0xbb65('0x1b')]();});}};}function handleEntityNotFound(_0x53c926,_0x2359f2){return function(_0x55f2c5){if(!_0x55f2c5){_0x53c926[_0xbb65('0x19')](0x194);}return _0x55f2c5;};}function handleError(_0x42e90b,_0x4254ef){_0x4254ef=_0x4254ef||0x1f4;return function(_0x5867d3){logger[_0xbb65('0x29')](_0x5867d3['stack']);if(_0x5867d3['name']){delete _0x5867d3[_0xbb65('0x2a')];}_0x42e90b[_0xbb65('0x1a')](_0x4254ef)[_0xbb65('0x2b')](_0x5867d3);};}exports[_0xbb65('0x2c')]=function(_0x3d0944,_0x3e4bf9){var _0xdbd450={},_0x53ca66={},_0x3222cf={'count':0x0,'rows':[]};var _0x58825c=_[_0xbb65('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x44d4d3){return{'name':_0x44d4d3[_0xbb65('0x2e')],'type':_0x44d4d3[_0xbb65('0x2f')][_0xbb65('0x30')]};});_0x53ca66[_0xbb65('0x31')]=_[_0xbb65('0x2d')](_0x58825c,_0xbb65('0x2a'));_0x53ca66['query']=_[_0xbb65('0x32')](_0x3d0944[_0xbb65('0x33')]);_0x53ca66['filters']=_[_0xbb65('0x34')](_0x53ca66[_0xbb65('0x31')],_0x53ca66[_0xbb65('0x33')]);_0xdbd450['attributes']=_[_0xbb65('0x34')](_0x53ca66[_0xbb65('0x31')],qs[_0xbb65('0x35')](_0x3d0944[_0xbb65('0x33')]['fields']));_0xdbd450['attributes']=_0xdbd450[_0xbb65('0x36')][_0xbb65('0x37')]?_0xdbd450['attributes']:_0x53ca66['model'];if(!_0x3d0944[_0xbb65('0x33')][_0xbb65('0x38')](_0xbb65('0x39'))){_0xdbd450[_0xbb65('0x1f')]=qs[_0xbb65('0x1f')](_0x3d0944[_0xbb65('0x33')]['limit']);_0xdbd450[_0xbb65('0x1d')]=qs[_0xbb65('0x1d')](_0x3d0944[_0xbb65('0x33')][_0xbb65('0x1d')]);}_0xdbd450['order']=qs[_0xbb65('0x3a')](_0x3d0944[_0xbb65('0x33')][_0xbb65('0x3a')]);_0xdbd450[_0xbb65('0x3b')]=qs['filters'](_[_0xbb65('0x3c')](_0x3d0944[_0xbb65('0x33')],_0x53ca66[_0xbb65('0x3d')]),_0x58825c);if(_0x3d0944['query'][_0xbb65('0x3e')]){_0xdbd450[_0xbb65('0x3b')]=_[_0xbb65('0x3f')](_0xdbd450[_0xbb65('0x3b')],{'$or':[{'key':{'$like':'%'+_0x3d0944['query'][_0xbb65('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3d0944['query'][_0xbb65('0x3e')]+'%'}}]});}_0xdbd450=_[_0xbb65('0x3f')]({},_0xdbd450,_0x3d0944[_0xbb65('0x40')]);var _0x18627a={'where':_0xdbd450['where']};return db['CannedAnswer']['count'](_0x18627a)[_0xbb65('0x41')](function(_0x350d7e){_0x3222cf[_0xbb65('0x20')]=_0x350d7e;if(_0x3d0944[_0xbb65('0x33')]['includeAll']){_0xdbd450[_0xbb65('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbb65('0x43')](_0xdbd450);})['then'](function(_0x5aacd5){_0x3222cf[_0xbb65('0x44')]=_0x5aacd5;return _0x3222cf;})['then'](respondWithFilteredResult(_0x3e4bf9,_0xdbd450))[_0xbb65('0x45')](handleError(_0x3e4bf9,null));};exports['show']=function(_0x28bc05,_0x353d0e){var _0x3a72c8={'raw':!![],'where':{'id':_0x28bc05[_0xbb65('0x46')]['id']}},_0x2d4c1c={};_0x2d4c1c[_0xbb65('0x31')]=_['keys'](db[_0xbb65('0x47')][_0xbb65('0x48')]);_0x2d4c1c[_0xbb65('0x33')]=_[_0xbb65('0x32')](_0x28bc05[_0xbb65('0x33')]);_0x2d4c1c[_0xbb65('0x3d')]=_[_0xbb65('0x34')](_0x2d4c1c[_0xbb65('0x31')],_0x2d4c1c[_0xbb65('0x33')]);_0x3a72c8[_0xbb65('0x36')]=_['intersection'](_0x2d4c1c[_0xbb65('0x31')],qs[_0xbb65('0x35')](_0x28bc05[_0xbb65('0x33')][_0xbb65('0x35')]));_0x3a72c8['attributes']=_0x3a72c8['attributes'][_0xbb65('0x37')]?_0x3a72c8['attributes']:_0x2d4c1c['model'];if(_0x28bc05[_0xbb65('0x33')][_0xbb65('0x49')]){_0x3a72c8[_0xbb65('0x42')]=[{'all':!![]}];}_0x3a72c8=_[_0xbb65('0x3f')]({},_0x3a72c8,_0x28bc05[_0xbb65('0x40')]);return db[_0xbb65('0x47')][_0xbb65('0x4a')](_0x3a72c8)['then'](handleEntityNotFound(_0x353d0e,null))[_0xbb65('0x41')](respondWithResult(_0x353d0e,null))[_0xbb65('0x45')](handleError(_0x353d0e,null));};exports[_0xbb65('0x24')]=function(_0x371f08,_0x1b7f37){if(_0x371f08[_0xbb65('0x4b')]['id']){delete _0x371f08[_0xbb65('0x4b')]['id'];}return db[_0xbb65('0x47')]['find']({'where':{'id':_0x371f08['params']['id']}})[_0xbb65('0x41')](handleEntityNotFound(_0x1b7f37,null))[_0xbb65('0x41')](saveUpdates(_0x371f08[_0xbb65('0x4b')],null))[_0xbb65('0x41')](respondWithResult(_0x1b7f37,null))[_0xbb65('0x45')](handleError(_0x1b7f37,null));};exports[_0xbb65('0x25')]=function(_0x54f852,_0xd1b1bd){return db[_0xbb65('0x47')][_0xbb65('0x4a')]({'where':{'id':_0x54f852[_0xbb65('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1b1bd,null))[_0xbb65('0x41')](removeEntity(_0xd1b1bd,null))[_0xbb65('0x45')](handleError(_0xd1b1bd,null));};exports[_0xbb65('0x4c')]=function(_0x1a0245,_0x4da031){var _0xa45a9f={'key':_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x30')]};if(_0x1a0245['body']['MailAccountId']){_0xa45a9f[_0xbb65('0x4d')]=_0x1a0245['body'][_0xbb65('0x4d')];}else if(_0x1a0245['body'][_0xbb65('0x4e')]){_0xa45a9f[_0xbb65('0x4e')]=_0x1a0245['body']['SmsAccountId'];}else if(_0x1a0245['body'][_0xbb65('0x4f')]){_0xa45a9f[_0xbb65('0x4f')]=_0x1a0245['body'][_0xbb65('0x4f')];}else if(_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x50')]){_0xa45a9f[_0xbb65('0x50')]=_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x50')];}return db['CannedAnswer']['find']({'where':_0xa45a9f})[_0xbb65('0x41')](function(_0x41ca28){if(_0x41ca28){throw new db['Sequelize']['ValidationError'](_0xbb65('0x51'));}return db[_0xbb65('0x47')][_0xbb65('0x4c')](_0x1a0245[_0xbb65('0x4b')]);})[_0xbb65('0x41')](function(_0x11467c){var _0x1b619f=_0x1a0245[_0xbb65('0x52')][_0xbb65('0x26')]({'plain':!![]});if(!_0x1b619f)throw new Error(_0xbb65('0x53'));if(_0x1b619f[_0xbb65('0x54')]===_0xbb65('0x52')){var _0x7213ee=_0x11467c[_0xbb65('0x26')]({'plain':!![]});return db[_0xbb65('0x55')]['find']({'where':{'name':_0xbb65('0x27'),'userProfileId':_0x1b619f[_0xbb65('0x56')]},'raw':!![]})[_0xbb65('0x41')](function(_0x2b085e){if(_0x2b085e&&_0x2b085e['autoAssociation']===0x0){return db[_0xbb65('0x28')]['create']({'name':_0x7213ee[_0xbb65('0x2a')],'resourceId':_0x7213ee['id'],'type':_0x2b085e['name'],'sectionId':_0x2b085e['id']},{})[_0xbb65('0x41')](function(){return _0x11467c;});}else{return _0x11467c;}})[_0xbb65('0x45')](function(_0x3e2051){logger[_0xbb65('0x29')](_0xbb65('0x57'),_0x3e2051);throw _0x3e2051;});}return _0x11467c;})[_0xbb65('0x41')](respondWithResult(_0x4da031,0xc9))[_0xbb65('0x45')](handleError(_0x4da031,null));};
\ No newline at end of file
+var _0xdb0a=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','create'];(function(_0x4b1475,_0x2912a3){var _0x3457d0=function(_0x15276b){while(--_0x15276b){_0x4b1475['push'](_0x4b1475['shift']());}};_0x3457d0(++_0x2912a3);}(_0xdb0a,0xcd));var _0xadb0=function(_0x5a5bd4,_0x473f27){_0x5a5bd4=_0x5a5bd4-0x0;var _0x45c150=_0xdb0a[_0x5a5bd4];return _0x45c150;};'use strict';var emlformat=require(_0xadb0('0x0'));var rimraf=require(_0xadb0('0x1'));var zipdir=require(_0xadb0('0x2'));var jsonpatch=require(_0xadb0('0x3'));var rp=require(_0xadb0('0x4'));var moment=require(_0xadb0('0x5'));var BPromise=require(_0xadb0('0x6'));var Mustache=require(_0xadb0('0x7'));var util=require(_0xadb0('0x8'));var path=require('path');var sox=require(_0xadb0('0x9'));var csv=require(_0xadb0('0xa'));var ejs=require(_0xadb0('0xb'));var fs=require('fs');var fs_extra=require(_0xadb0('0xc'));var _=require(_0xadb0('0xd'));var squel=require(_0xadb0('0xe'));var crypto=require('crypto');var jsforce=require(_0xadb0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xadb0('0xa'));var querystring=require('querystring');var Papa=require(_0xadb0('0x10'));var Redis=require(_0xadb0('0x11'));var authService=require(_0xadb0('0x12'));var qs=require(_0xadb0('0x13'));var as=require(_0xadb0('0x14'));var hardwareService=require(_0xadb0('0x15'));var logger=require(_0xadb0('0x16'))(_0xadb0('0x17'));var utils=require(_0xadb0('0x18'));var config=require(_0xadb0('0x19'));var licenseUtil=require(_0xadb0('0x1a'));var db=require(_0xadb0('0x1b'))['db'];function respondWithStatusCode(_0x241d3f,_0x274abb){_0x274abb=_0x274abb||0xcc;return function(_0x630af0){if(_0x630af0){return _0x241d3f[_0xadb0('0x1c')](_0x274abb);}return _0x241d3f[_0xadb0('0x1d')](_0x274abb)[_0xadb0('0x1e')]();};}function respondWithResult(_0x1d20c2,_0x1b107e){_0x1b107e=_0x1b107e||0xc8;return function(_0x2ad1f0){if(_0x2ad1f0){return _0x1d20c2[_0xadb0('0x1d')](_0x1b107e)[_0xadb0('0x1f')](_0x2ad1f0);}};}function respondWithFilteredResult(_0x18492f,_0x529e8d){return function(_0x11b015){if(_0x11b015){var _0x156ac6=typeof _0x529e8d[_0xadb0('0x20')]===_0xadb0('0x21')&&typeof _0x529e8d[_0xadb0('0x22')]===_0xadb0('0x21');var _0x4d1b1f=_0x11b015[_0xadb0('0x23')];var _0x126534=_0x156ac6?0x0:_0x529e8d['offset'];var _0x162e1e=_0x156ac6?_0x11b015['count']:_0x529e8d['offset']+_0x529e8d[_0xadb0('0x22')];var _0x3a8aea;if(_0x162e1e>=_0x4d1b1f){_0x162e1e=_0x4d1b1f;_0x3a8aea=0xc8;}else{_0x3a8aea=0xce;}_0x18492f[_0xadb0('0x1d')](_0x3a8aea);return _0x18492f[_0xadb0('0x24')](_0xadb0('0x25'),_0x126534+'-'+_0x162e1e+'/'+_0x4d1b1f)[_0xadb0('0x1f')](_0x11b015);}return null;};}function patchUpdates(_0x53729f){return function(_0xa2578a){try{jsonpatch[_0xadb0('0x26')](_0xa2578a,_0x53729f,!![]);}catch(_0x362ae3){return BPromise[_0xadb0('0x27')](_0x362ae3);}return _0xa2578a[_0xadb0('0x28')]();};}function saveUpdates(_0x127be7,_0x14df58){return function(_0x27c8f0){if(_0x27c8f0){return _0x27c8f0[_0xadb0('0x29')](_0x127be7)['then'](function(_0x2b96cb){return _0x2b96cb;});}return null;};}function removeEntity(_0x444363,_0x47ea54){return function(_0x7f8c4){if(_0x7f8c4){return _0x7f8c4[_0xadb0('0x2a')]()[_0xadb0('0x2b')](function(){var _0x515828=_0x7f8c4['get']({'plain':!![]});var _0x5266de=_0xadb0('0x2c');return db[_0xadb0('0x2d')][_0xadb0('0x2a')]({'where':{'type':_0x5266de,'resourceId':_0x515828['id']}})['then'](function(){return _0x7f8c4;});})[_0xadb0('0x2b')](function(){_0x444363[_0xadb0('0x1d')](0xcc)[_0xadb0('0x1e')]();});}};}function handleEntityNotFound(_0x5a329d,_0x54649){return function(_0x341580){if(!_0x341580){_0x5a329d[_0xadb0('0x1c')](0x194);}return _0x341580;};}function handleError(_0x4e71f3,_0x418f45){_0x418f45=_0x418f45||0x1f4;return function(_0x55cf35){logger[_0xadb0('0x2e')](_0x55cf35[_0xadb0('0x2f')]);if(_0x55cf35['name']){delete _0x55cf35[_0xadb0('0x30')];}_0x4e71f3[_0xadb0('0x1d')](_0x418f45)[_0xadb0('0x31')](_0x55cf35);};}exports[_0xadb0('0x32')]=function(_0x5543e3,_0x2044b4){var _0x109f81={},_0x37dc22={},_0x45754b={'count':0x0,'rows':[]};var _0x13efc5=_[_0xadb0('0x33')](db[_0xadb0('0x34')]['rawAttributes'],function(_0x59a581){return{'name':_0x59a581[_0xadb0('0x35')],'type':_0x59a581[_0xadb0('0x36')][_0xadb0('0x37')]};});_0x37dc22[_0xadb0('0x38')]=_['map'](_0x13efc5,_0xadb0('0x30'));_0x37dc22['query']=_[_0xadb0('0x39')](_0x5543e3[_0xadb0('0x3a')]);_0x37dc22[_0xadb0('0x3b')]=_[_0xadb0('0x3c')](_0x37dc22[_0xadb0('0x38')],_0x37dc22[_0xadb0('0x3a')]);_0x109f81[_0xadb0('0x3d')]=_[_0xadb0('0x3c')](_0x37dc22[_0xadb0('0x38')],qs['fields'](_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x3e')]));_0x109f81[_0xadb0('0x3d')]=_0x109f81['attributes'][_0xadb0('0x3f')]?_0x109f81[_0xadb0('0x3d')]:_0x37dc22[_0xadb0('0x38')];if(!_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x40')](_0xadb0('0x41'))){_0x109f81['limit']=qs[_0xadb0('0x22')](_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x22')]);_0x109f81['offset']=qs[_0xadb0('0x20')](_0x5543e3['query'][_0xadb0('0x20')]);}_0x109f81['order']=qs[_0xadb0('0x42')](_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x42')]);_0x109f81['where']=qs[_0xadb0('0x3b')](_[_0xadb0('0x43')](_0x5543e3[_0xadb0('0x3a')],_0x37dc22[_0xadb0('0x3b')]),_0x13efc5);if(_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x44')]){_0x109f81[_0xadb0('0x45')]=_[_0xadb0('0x46')](_0x109f81[_0xadb0('0x45')],{'$or':[{'key':{'$like':'%'+_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x44')]+'%'}},{'value':{'$like':'%'+_0x5543e3[_0xadb0('0x3a')][_0xadb0('0x44')]+'%'}}]});}_0x109f81=_['merge']({},_0x109f81,_0x5543e3[_0xadb0('0x47')]);var _0x116b8d={'where':_0x109f81[_0xadb0('0x45')]};return db[_0xadb0('0x34')]['count'](_0x116b8d)[_0xadb0('0x2b')](function(_0x20f5ff){_0x45754b['count']=_0x20f5ff;if(_0x5543e3[_0xadb0('0x3a')]['includeAll']){_0x109f81[_0xadb0('0x48')]=[{'all':!![]}];}return db[_0xadb0('0x34')][_0xadb0('0x49')](_0x109f81);})[_0xadb0('0x2b')](function(_0x5d52bf){_0x45754b[_0xadb0('0x4a')]=_0x5d52bf;return _0x45754b;})[_0xadb0('0x2b')](respondWithFilteredResult(_0x2044b4,_0x109f81))[_0xadb0('0x4b')](handleError(_0x2044b4,null));};exports[_0xadb0('0x4c')]=function(_0x51843f,_0x53d611){var _0x570db8={'raw':!![],'where':{'id':_0x51843f[_0xadb0('0x4d')]['id']}},_0x1561c4={};_0x1561c4[_0xadb0('0x38')]=_[_0xadb0('0x39')](db[_0xadb0('0x34')][_0xadb0('0x4e')]);_0x1561c4[_0xadb0('0x3a')]=_['keys'](_0x51843f[_0xadb0('0x3a')]);_0x1561c4[_0xadb0('0x3b')]=_[_0xadb0('0x3c')](_0x1561c4[_0xadb0('0x38')],_0x1561c4[_0xadb0('0x3a')]);_0x570db8['attributes']=_[_0xadb0('0x3c')](_0x1561c4[_0xadb0('0x38')],qs[_0xadb0('0x3e')](_0x51843f[_0xadb0('0x3a')][_0xadb0('0x3e')]));_0x570db8[_0xadb0('0x3d')]=_0x570db8[_0xadb0('0x3d')][_0xadb0('0x3f')]?_0x570db8['attributes']:_0x1561c4[_0xadb0('0x38')];if(_0x51843f[_0xadb0('0x3a')][_0xadb0('0x4f')]){_0x570db8[_0xadb0('0x48')]=[{'all':!![]}];}_0x570db8=_[_0xadb0('0x46')]({},_0x570db8,_0x51843f[_0xadb0('0x47')]);return db[_0xadb0('0x34')][_0xadb0('0x50')](_0x570db8)[_0xadb0('0x2b')](handleEntityNotFound(_0x53d611,null))[_0xadb0('0x2b')](respondWithResult(_0x53d611,null))[_0xadb0('0x4b')](handleError(_0x53d611,null));};exports[_0xadb0('0x29')]=function(_0xa9c733,_0x2cb190){if(_0xa9c733['body']['id']){delete _0xa9c733[_0xadb0('0x51')]['id'];}return db[_0xadb0('0x34')][_0xadb0('0x50')]({'where':{'id':_0xa9c733['params']['id']}})[_0xadb0('0x2b')](handleEntityNotFound(_0x2cb190,null))[_0xadb0('0x2b')](saveUpdates(_0xa9c733[_0xadb0('0x51')],null))['then'](respondWithResult(_0x2cb190,null))[_0xadb0('0x4b')](handleError(_0x2cb190,null));};exports['destroy']=function(_0x33484b,_0x5db5cf){return db[_0xadb0('0x34')]['find']({'where':{'id':_0x33484b[_0xadb0('0x4d')]['id']}})[_0xadb0('0x2b')](handleEntityNotFound(_0x5db5cf,null))['then'](removeEntity(_0x5db5cf,null))['catch'](handleError(_0x5db5cf,null));};exports[_0xadb0('0x52')]=function(_0x4fb8c7,_0x179a60){var _0x54c548={'key':_0x4fb8c7[_0xadb0('0x51')][_0xadb0('0x37')]};if(_0x4fb8c7[_0xadb0('0x51')]['MailAccountId']){_0x54c548[_0xadb0('0x53')]=_0x4fb8c7[_0xadb0('0x51')][_0xadb0('0x53')];}else if(_0x4fb8c7[_0xadb0('0x51')][_0xadb0('0x54')]){_0x54c548[_0xadb0('0x54')]=_0x4fb8c7['body'][_0xadb0('0x54')];}else if(_0x4fb8c7[_0xadb0('0x51')][_0xadb0('0x55')]){_0x54c548['OpenchannelAccountId']=_0x4fb8c7['body'][_0xadb0('0x55')];}else if(_0x4fb8c7[_0xadb0('0x51')][_0xadb0('0x56')]){_0x54c548[_0xadb0('0x56')]=_0x4fb8c7['body'][_0xadb0('0x56')];}return db[_0xadb0('0x34')]['find']({'where':_0x54c548})[_0xadb0('0x2b')](function(_0xb3b9b9){if(_0xb3b9b9){throw new db[(_0xadb0('0x57'))][(_0xadb0('0x58'))](_0xadb0('0x59'));}return db[_0xadb0('0x34')][_0xadb0('0x52')](_0x4fb8c7['body']);})[_0xadb0('0x2b')](function(_0x163c88){var _0x2da7f0=_0x4fb8c7[_0xadb0('0x5a')][_0xadb0('0x5b')]({'plain':!![]});if(!_0x2da7f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2da7f0[_0xadb0('0x5c')]===_0xadb0('0x5a')){var _0x3044c3=_0x163c88[_0xadb0('0x5b')]({'plain':!![]});return db[_0xadb0('0x5d')]['find']({'where':{'name':_0xadb0('0x2c'),'userProfileId':_0x2da7f0[_0xadb0('0x5e')]},'raw':!![]})['then'](function(_0x1615d6){if(_0x1615d6&&_0x1615d6[_0xadb0('0x5f')]===0x0){return db[_0xadb0('0x2d')]['create']({'name':_0x3044c3[_0xadb0('0x30')],'resourceId':_0x3044c3['id'],'type':_0x1615d6['name'],'sectionId':_0x1615d6['id']},{})['then'](function(){return _0x163c88;});}else{return _0x163c88;}})['catch'](function(_0x5556d2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5556d2);throw _0x5556d2;});}return _0x163c88;})['then'](respondWithResult(_0x179a60,0xc9))[_0xadb0('0x4b')](handleError(_0x179a60,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 55f7776..f7268d7 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 _0x8ca9=['rimraf','exports','tools_canned_answers','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x2b9972,_0x3a8d75){_0x2b9972=_0x2b9972-0x0;var _0x299e8b=_0x8ca9[_0x2b9972];return _0x299e8b;};'use strict';var _=require(_0x98ca('0x0'));var util=require('util');var logger=require(_0x98ca('0x1'))(_0x98ca('0x2'));var moment=require('moment');var BPromise=require(_0x98ca('0x3'));var rp=require(_0x98ca('0x4'));var fs=require('fs');var path=require(_0x98ca('0x5'));var rimraf=require(_0x98ca('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x98ca('0x7')]=function(_0x51c890,_0x2e5f12){return _0x51c890['define']('CannedAnswer',attributes,{'tableName':_0x98ca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa3e1=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','CannedAnswer'];(function(_0x3b83f3,_0x8488b){var _0x146b69=function(_0x58a93d){while(--_0x58a93d){_0x3b83f3['push'](_0x3b83f3['shift']());}};_0x146b69(++_0x8488b);}(_0xa3e1,0x13b));var _0x1a3e=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0xa3e1[_0x27b423];return _0x5c11b8;};'use strict';var _=require('lodash');var util=require(_0x1a3e('0x0'));var logger=require(_0x1a3e('0x1'))(_0x1a3e('0x2'));var moment=require(_0x1a3e('0x3'));var BPromise=require(_0x1a3e('0x4'));var rp=require(_0x1a3e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a3e('0x6'));var config=require(_0x1a3e('0x7'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4cbdc5,_0x3f5ce8){return _0x4cbdc5[_0x1a3e('0x8')](_0x1a3e('0x9'),attributes,{'tableName':_0x1a3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1a3e('0xb'),'collate':_0x1a3e('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 3d6febb..b2aefa9 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(_0x2e7efa,_0x27499d){var _0x47c46f=function(_0x1812ee){while(--_0x1812ee){_0x2e7efa['push'](_0x2e7efa['shift']());}};_0x47c46f(++_0x27499d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x3dd346,_0x30eb12){var _0x58f64c=function(_0x52a7ce){while(--_0x52a7ce){_0x3dd346['push'](_0x3dd346['shift']());}};_0x58f64c(++_0x30eb12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 c28235d..dbd85f3 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 _0x1c9e=['create','put','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x1c9e,0x72));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe1c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe1c9('0x1'));var express=require(_0xe1c9('0x2'));var router=express[_0xe1c9('0x3')]();var fs_extra=require(_0xe1c9('0x4'));var auth=require(_0xe1c9('0x5'));var interaction=require(_0xe1c9('0x6'));var config=require(_0xe1c9('0x7'));var controller=require('./cannedAnswer.controller');router[_0xe1c9('0x8')]('/',auth[_0xe1c9('0x9')](),controller[_0xe1c9('0xa')]);router[_0xe1c9('0x8')]('/:id',auth[_0xe1c9('0x9')](),controller['show']);router[_0xe1c9('0xb')]('/',auth[_0xe1c9('0x9')](),controller[_0xe1c9('0xc')]);router[_0xe1c9('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe1c9('0xe')](_0xe1c9('0xf'),auth[_0xe1c9('0x9')](),controller[_0xe1c9('0x10')]);module[_0xe1c9('0x11')]=router;
\ No newline at end of file
+var _0xd6d6=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xd6d6,0x184));var _0x6d6d=function(_0x372594,_0x4953cf){_0x372594=_0x372594-0x0;var _0x539748=_0xd6d6[_0x372594];return _0x539748;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d6d('0x3'));var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth[_0x6d6d('0xb')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0xa')](_0x6d6d('0xd'),auth[_0x6d6d('0xb')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xf')]('/',auth[_0x6d6d('0xb')](),controller[_0x6d6d('0x10')]);router[_0x6d6d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x12')]);router['delete'](_0x6d6d('0xd'),auth[_0x6d6d('0xb')](),controller[_0x6d6d('0x13')]);module[_0x6d6d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index d72bd4b..ee11b28 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 _0x3c8c=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3832b8,_0x4491cf){var _0x4b383a=function(_0x27ac30){while(--_0x27ac30){_0x3832b8['push'](_0x3832b8['shift']());}};_0x4b383a(++_0x4491cf);}(_0x3c8c,0xb0));var _0xc3c8=function(_0x122a4a,_0x47d80f){_0x122a4a=_0x122a4a-0x0;var _0x38004a=_0x3c8c[_0x122a4a];return _0x38004a;};'use strict';var Sequelize=require(_0xc3c8('0x0'));module[_0xc3c8('0x1')]={'calldate':{'type':Sequelize[_0xc3c8('0x2')],'allowNull':![],'defaultValue':_0xc3c8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xc3c8('0x4')]},'dst':{'type':Sequelize[_0xc3c8('0x4')]},'dcontext':{'type':Sequelize[_0xc3c8('0x4')]},'channel':{'type':Sequelize[_0xc3c8('0x4')]},'dstchannel':{'type':Sequelize[_0xc3c8('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc3c8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc3c8('0x4')]},'amaflags':{'type':Sequelize[_0xc3c8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xc3c8('0x4')]},'uniqueid':{'type':Sequelize[_0xc3c8('0x4')]},'linkedid':{'type':Sequelize[_0xc3c8('0x4')]},'sequence':{'type':Sequelize[_0xc3c8('0x4')]},'peeraccount':{'type':Sequelize[_0xc3c8('0x4')]},'type':{'type':Sequelize[_0xc3c8('0x4')]},'tag':{'type':Sequelize[_0xc3c8('0x4')]}};
\ No newline at end of file
+var _0xa047=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xa047,0x1c5));var _0x7a04=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xa047[_0x1558ab];return _0x53b64a;};'use strict';var Sequelize=require(_0x7a04('0x0'));module[_0x7a04('0x1')]={'calldate':{'type':Sequelize[_0x7a04('0x2')],'allowNull':![],'defaultValue':_0x7a04('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x7a04('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x7a04('0x4')]},'channel':{'type':Sequelize[_0x7a04('0x4')]},'dstchannel':{'type':Sequelize[_0x7a04('0x4')]},'lastapp':{'type':Sequelize[_0x7a04('0x4')]},'lastdata':{'type':Sequelize[_0x7a04('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7a04('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7a04('0x4')]},'amaflags':{'type':Sequelize[_0x7a04('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7a04('0x4')]},'uniqueid':{'type':Sequelize[_0x7a04('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7a04('0x4')]},'peeraccount':{'type':Sequelize[_0x7a04('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7a04('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ec3f931..a1ca3db 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 _0xb647=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xab766d,_0x607780){var _0x1b57fd=function(_0x22cfeb){while(--_0x22cfeb){_0xab766d['push'](_0xab766d['shift']());}};_0x1b57fd(++_0x607780);}(_0xb647,0xdb));var _0x7b64=function(_0x52c309,_0x52db5e){_0x52c309=_0x52c309-0x0;var _0x1b67ec=_0xb647[_0x52c309];return _0x1b67ec;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require(_0x7b64('0x1'));var zipdir=require(_0x7b64('0x2'));var jsonpatch=require(_0x7b64('0x3'));var rp=require(_0x7b64('0x4'));var moment=require(_0x7b64('0x5'));var BPromise=require(_0x7b64('0x6'));var Mustache=require(_0x7b64('0x7'));var util=require('util');var path=require(_0x7b64('0x8'));var sox=require('sox');var csv=require(_0x7b64('0x9'));var ejs=require(_0x7b64('0xa'));var fs=require('fs');var fs_extra=require(_0x7b64('0xb'));var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0x9'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var licenseUtil=require(_0x7b64('0x17'));var db=require(_0x7b64('0x18'))['db'];function respondWithStatusCode(_0x25e135,_0x432626){_0x432626=_0x432626||0xcc;return function(_0x5ea1dd){if(_0x5ea1dd){return _0x25e135['sendStatus'](_0x432626);}return _0x25e135[_0x7b64('0x19')](_0x432626)['end']();};}function respondWithResult(_0x530938,_0x2f21d8){_0x2f21d8=_0x2f21d8||0xc8;return function(_0x29a596){if(_0x29a596){return _0x530938[_0x7b64('0x19')](_0x2f21d8)[_0x7b64('0x1a')](_0x29a596);}};}function respondWithFilteredResult(_0x33ebe7,_0x437ddc){return function(_0x306a4e){if(_0x306a4e){var _0x519316=typeof _0x437ddc[_0x7b64('0x1b')]===_0x7b64('0x1c')&&typeof _0x437ddc[_0x7b64('0x1d')]===_0x7b64('0x1c');var _0x157c03=_0x306a4e['count'];var _0x3935c3=_0x519316?0x0:_0x437ddc[_0x7b64('0x1b')];var _0x58517e=_0x519316?_0x306a4e[_0x7b64('0x1e')]:_0x437ddc[_0x7b64('0x1b')]+_0x437ddc['limit'];var _0x23845e;if(_0x58517e>=_0x157c03){_0x58517e=_0x157c03;_0x23845e=0xc8;}else{_0x23845e=0xce;}_0x33ebe7[_0x7b64('0x19')](_0x23845e);return _0x33ebe7[_0x7b64('0x1f')](_0x7b64('0x20'),_0x3935c3+'-'+_0x58517e+'/'+_0x157c03)['json'](_0x306a4e);}return null;};}function patchUpdates(_0x123a3b){return function(_0x5c4135){try{jsonpatch['apply'](_0x5c4135,_0x123a3b,!![]);}catch(_0x3f73cf){return BPromise['reject'](_0x3f73cf);}return _0x5c4135[_0x7b64('0x21')]();};}function saveUpdates(_0x587da6,_0x1bbd87){return function(_0x1ad95f){if(_0x1ad95f){return _0x1ad95f[_0x7b64('0x22')](_0x587da6)[_0x7b64('0x23')](function(_0x450b7e){return _0x450b7e;});}return null;};}function removeEntity(_0x3c0d97,_0x215ea9){return function(_0x3d4bef){if(_0x3d4bef){return _0x3d4bef[_0x7b64('0x24')]()[_0x7b64('0x23')](function(){_0x3c0d97[_0x7b64('0x19')](0xcc)[_0x7b64('0x25')]();});}};}function handleEntityNotFound(_0x24b68e,_0x42efa1){return function(_0x50d06c){if(!_0x50d06c){_0x24b68e[_0x7b64('0x26')](0x194);}return _0x50d06c;};}function handleError(_0x5d9586,_0x1580d0){_0x1580d0=_0x1580d0||0x1f4;return function(_0x21fbd3){logger['error'](_0x21fbd3['stack']);if(_0x21fbd3[_0x7b64('0x27')]){delete _0x21fbd3[_0x7b64('0x27')];}_0x5d9586[_0x7b64('0x19')](_0x1580d0)[_0x7b64('0x28')](_0x21fbd3);};}exports[_0x7b64('0x29')]=function(_0x3c9fad,_0x6740b2){var _0x2729f1={},_0x53e29b={},_0x1616c9={'count':0x0,'rows':[]};var _0x2c4619=_['map'](db[_0x7b64('0x2a')][_0x7b64('0x2b')],function(_0x369402){return{'name':_0x369402[_0x7b64('0x2c')],'type':_0x369402[_0x7b64('0x2d')][_0x7b64('0x2e')]};});_0x53e29b['model']=_['map'](_0x2c4619,_0x7b64('0x27'));_0x53e29b[_0x7b64('0x2f')]=_['keys'](_0x3c9fad['query']);_0x53e29b[_0x7b64('0x30')]=_['intersection'](_0x53e29b[_0x7b64('0x31')],_0x53e29b['query']);_0x2729f1['attributes']=_['intersection'](_0x53e29b[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x3c9fad[_0x7b64('0x2f')]['fields']));_0x2729f1[_0x7b64('0x33')]=_0x2729f1['attributes'][_0x7b64('0x34')]?_0x2729f1[_0x7b64('0x33')]:_0x53e29b[_0x7b64('0x31')];if(!_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x35')]('nolimit')){_0x2729f1[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1d')]);_0x2729f1['offset']=qs[_0x7b64('0x1b')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1b')]);}_0x2729f1[_0x7b64('0x36')]=qs[_0x7b64('0x37')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x37')]);_0x2729f1['where']=qs['filters'](_[_0x7b64('0x38')](_0x3c9fad[_0x7b64('0x2f')],_0x53e29b[_0x7b64('0x30')]),_0x2c4619);if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]){_0x2729f1[_0x7b64('0x3a')]=_[_0x7b64('0x3b')](_0x2729f1[_0x7b64('0x3a')],{'$or':_[_0x7b64('0x3c')](_0x2c4619,function(_0x5b1278){if(_0x5b1278[_0x7b64('0x2d')]!==_0x7b64('0x3d')){var _0x451f9b={};_0x451f9b[_0x5b1278[_0x7b64('0x27')]]={'$like':'%'+_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]+'%'};return _0x451f9b;}})});}_0x2729f1=_[_0x7b64('0x3b')]({},_0x2729f1,_0x3c9fad[_0x7b64('0x3e')]);var _0x3c4467={'where':_0x2729f1[_0x7b64('0x3a')]};return db[_0x7b64('0x2a')][_0x7b64('0x1e')](_0x3c4467)[_0x7b64('0x23')](function(_0x36cfce){_0x1616c9[_0x7b64('0x1e')]=_0x36cfce;if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x2729f1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2a')][_0x7b64('0x41')](_0x2729f1);})['then'](function(_0x442d65){_0x1616c9[_0x7b64('0x42')]=_0x442d65;return _0x1616c9;})[_0x7b64('0x23')](respondWithFilteredResult(_0x6740b2,_0x2729f1))['catch'](handleError(_0x6740b2,null));};exports[_0x7b64('0x43')]=function(_0x2e4d0f,_0x55c889){var _0x216c58={'raw':!![],'where':{'id':_0x2e4d0f['params']['id']}},_0xf0d4a1={};_0xf0d4a1[_0x7b64('0x31')]=_['keys'](db[_0x7b64('0x2a')][_0x7b64('0x2b')]);_0xf0d4a1[_0x7b64('0x2f')]=_['keys'](_0x2e4d0f[_0x7b64('0x2f')]);_0xf0d4a1[_0x7b64('0x30')]=_[_0x7b64('0x44')](_0xf0d4a1[_0x7b64('0x31')],_0xf0d4a1[_0x7b64('0x2f')]);_0x216c58[_0x7b64('0x33')]=_['intersection'](_0xf0d4a1[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x32')]));_0x216c58[_0x7b64('0x33')]=_0x216c58['attributes']['length']?_0x216c58['attributes']:_0xf0d4a1['model'];if(_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x216c58[_0x7b64('0x40')]=[{'all':!![]}];}_0x216c58=_[_0x7b64('0x3b')]({},_0x216c58,_0x2e4d0f[_0x7b64('0x3e')]);return db[_0x7b64('0x2a')][_0x7b64('0x45')](_0x216c58)[_0x7b64('0x23')](handleEntityNotFound(_0x55c889,null))[_0x7b64('0x23')](respondWithResult(_0x55c889,null))[_0x7b64('0x46')](handleError(_0x55c889,null));};exports[_0x7b64('0x47')]=function(_0x38983a,_0x4add4d){return db['Cdr'][_0x7b64('0x47')](_0x38983a[_0x7b64('0x48')],{})[_0x7b64('0x23')](respondWithResult(_0x4add4d,0xc9))[_0x7b64('0x46')](handleError(_0x4add4d,null));};exports[_0x7b64('0x22')]=function(_0x5a8639,_0x3e5321){if(_0x5a8639[_0x7b64('0x48')]['id']){delete _0x5a8639[_0x7b64('0x48')]['id'];}return db['Cdr'][_0x7b64('0x45')]({'where':{'id':_0x5a8639[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3e5321,null))[_0x7b64('0x23')](saveUpdates(_0x5a8639[_0x7b64('0x48')],null))['then'](respondWithResult(_0x3e5321,null))[_0x7b64('0x46')](handleError(_0x3e5321,null));};exports[_0x7b64('0x24')]=function(_0x52b04a,_0x3656b8){return db[_0x7b64('0x2a')]['find']({'where':{'id':_0x52b04a[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3656b8,null))[_0x7b64('0x23')](removeEntity(_0x3656b8,null))[_0x7b64('0x46')](handleError(_0x3656b8,null));};exports[_0x7b64('0x4a')]=function(_0x79cbc9,_0x253b33){return db[_0x7b64('0x2a')][_0x7b64('0x4a')]()[_0x7b64('0x23')](respondWithResult(_0x253b33,null))[_0x7b64('0x46')](handleError(_0x253b33,null));};
\ No newline at end of file
+var _0xf69d=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','send','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3a2097,_0x2c9c75){var _0x3c2d41=function(_0x3c6a1f){while(--_0x3c6a1f){_0x3a2097['push'](_0x3a2097['shift']());}};_0x3c2d41(++_0x2c9c75);}(_0xf69d,0xd3));var _0xdf69=function(_0x2616d7,_0x2fe262){_0x2616d7=_0x2616d7-0x0;var _0x111b31=_0xf69d[_0x2616d7];return _0x111b31;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require(_0xdf69('0xa'));var ejs=require(_0xdf69('0xb'));var fs=require('fs');var fs_extra=require(_0xdf69('0xc'));var _=require(_0xdf69('0xd'));var squel=require(_0xdf69('0xe'));var crypto=require(_0xdf69('0xf'));var jsforce=require(_0xdf69('0x10'));var deskjs=require(_0xdf69('0x11'));var toCsv=require(_0xdf69('0xa'));var querystring=require(_0xdf69('0x12'));var Papa=require(_0xdf69('0x13'));var Redis=require(_0xdf69('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdf69('0x15'));var as=require(_0xdf69('0x16'));var hardwareService=require(_0xdf69('0x17'));var logger=require(_0xdf69('0x18'))(_0xdf69('0x19'));var utils=require(_0xdf69('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df98a,_0x3dcda8){_0x3dcda8=_0x3dcda8||0xcc;return function(_0xbacdc6){if(_0xbacdc6){return _0x5df98a[_0xdf69('0x1b')](_0x3dcda8);}return _0x5df98a[_0xdf69('0x1c')](_0x3dcda8)[_0xdf69('0x1d')]();};}function respondWithResult(_0x38aee2,_0x584cbd){_0x584cbd=_0x584cbd||0xc8;return function(_0x41cc77){if(_0x41cc77){return _0x38aee2[_0xdf69('0x1c')](_0x584cbd)[_0xdf69('0x1e')](_0x41cc77);}};}function respondWithFilteredResult(_0xef2df5,_0x4f28fc){return function(_0xa4242f){if(_0xa4242f){var _0x56be66=typeof _0x4f28fc[_0xdf69('0x1f')]===_0xdf69('0x20')&&typeof _0x4f28fc['limit']===_0xdf69('0x20');var _0x449908=_0xa4242f[_0xdf69('0x21')];var _0x85d1d=_0x56be66?0x0:_0x4f28fc['offset'];var _0x5ae237=_0x56be66?_0xa4242f[_0xdf69('0x21')]:_0x4f28fc[_0xdf69('0x1f')]+_0x4f28fc['limit'];var _0x32cf65;if(_0x5ae237>=_0x449908){_0x5ae237=_0x449908;_0x32cf65=0xc8;}else{_0x32cf65=0xce;}_0xef2df5[_0xdf69('0x1c')](_0x32cf65);return _0xef2df5[_0xdf69('0x22')]('Content-Range',_0x85d1d+'-'+_0x5ae237+'/'+_0x449908)[_0xdf69('0x1e')](_0xa4242f);}return null;};}function patchUpdates(_0x452cfa){return function(_0x4d09d5){try{jsonpatch['apply'](_0x4d09d5,_0x452cfa,!![]);}catch(_0x32505a){return BPromise[_0xdf69('0x23')](_0x32505a);}return _0x4d09d5[_0xdf69('0x24')]();};}function saveUpdates(_0x5d91b8,_0x50ef18){return function(_0x5be7dd){if(_0x5be7dd){return _0x5be7dd[_0xdf69('0x25')](_0x5d91b8)['then'](function(_0x21f757){return _0x21f757;});}return null;};}function removeEntity(_0x311534,_0x1d37d8){return function(_0x54d2ca){if(_0x54d2ca){return _0x54d2ca['destroy']()[_0xdf69('0x26')](function(){_0x311534[_0xdf69('0x1c')](0xcc)[_0xdf69('0x1d')]();});}};}function handleEntityNotFound(_0x3fd933,_0x549191){return function(_0x3b727c){if(!_0x3b727c){_0x3fd933[_0xdf69('0x1b')](0x194);}return _0x3b727c;};}function handleError(_0x3e4f28,_0x5969cb){_0x5969cb=_0x5969cb||0x1f4;return function(_0x2da3df){logger['error'](_0x2da3df['stack']);if(_0x2da3df['name']){delete _0x2da3df['name'];}_0x3e4f28[_0xdf69('0x1c')](_0x5969cb)[_0xdf69('0x27')](_0x2da3df);};}exports['index']=function(_0x301bd2,_0xd81d0a){var _0x19cf2d={},_0x12aec3={},_0x1b7c16={'count':0x0,'rows':[]};var _0x1b57b3=_[_0xdf69('0x28')](db[_0xdf69('0x29')][_0xdf69('0x2a')],function(_0x3b97df){return{'name':_0x3b97df[_0xdf69('0x2b')],'type':_0x3b97df[_0xdf69('0x2c')][_0xdf69('0x2d')]};});_0x12aec3[_0xdf69('0x2e')]=_[_0xdf69('0x28')](_0x1b57b3,_0xdf69('0x2f'));_0x12aec3[_0xdf69('0x30')]=_['keys'](_0x301bd2[_0xdf69('0x30')]);_0x12aec3[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x12aec3[_0xdf69('0x2e')],_0x12aec3[_0xdf69('0x30')]);_0x19cf2d['attributes']=_[_0xdf69('0x32')](_0x12aec3['model'],qs[_0xdf69('0x33')](_0x301bd2[_0xdf69('0x30')]['fields']));_0x19cf2d[_0xdf69('0x34')]=_0x19cf2d['attributes'][_0xdf69('0x35')]?_0x19cf2d[_0xdf69('0x34')]:_0x12aec3[_0xdf69('0x2e')];if(!_0x301bd2[_0xdf69('0x30')][_0xdf69('0x36')]('nolimit')){_0x19cf2d[_0xdf69('0x37')]=qs['limit'](_0x301bd2[_0xdf69('0x30')][_0xdf69('0x37')]);_0x19cf2d[_0xdf69('0x1f')]=qs[_0xdf69('0x1f')](_0x301bd2['query'][_0xdf69('0x1f')]);}_0x19cf2d['order']=qs[_0xdf69('0x38')](_0x301bd2['query'][_0xdf69('0x38')]);_0x19cf2d['where']=qs[_0xdf69('0x31')](_[_0xdf69('0x39')](_0x301bd2[_0xdf69('0x30')],_0x12aec3[_0xdf69('0x31')]),_0x1b57b3);if(_0x301bd2[_0xdf69('0x30')]['filter']){_0x19cf2d[_0xdf69('0x3a')]=_[_0xdf69('0x3b')](_0x19cf2d['where'],{'$or':_['map'](_0x1b57b3,function(_0x4ee03c){if(_0x4ee03c['type']!==_0xdf69('0x3c')){var _0x5aff7d={};_0x5aff7d[_0x4ee03c[_0xdf69('0x2f')]]={'$like':'%'+_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3d')]+'%'};return _0x5aff7d;}})});}_0x19cf2d=_[_0xdf69('0x3b')]({},_0x19cf2d,_0x301bd2['options']);var _0x3de096={'where':_0x19cf2d[_0xdf69('0x3a')]};return db[_0xdf69('0x29')]['count'](_0x3de096)[_0xdf69('0x26')](function(_0xdd919d){_0x1b7c16[_0xdf69('0x21')]=_0xdd919d;if(_0x301bd2[_0xdf69('0x30')][_0xdf69('0x3e')]){_0x19cf2d[_0xdf69('0x3f')]=[{'all':!![]}];}return db[_0xdf69('0x29')]['findAll'](_0x19cf2d);})['then'](function(_0x1fc4aa){_0x1b7c16[_0xdf69('0x40')]=_0x1fc4aa;return _0x1b7c16;})[_0xdf69('0x26')](respondWithFilteredResult(_0xd81d0a,_0x19cf2d))[_0xdf69('0x41')](handleError(_0xd81d0a,null));};exports['show']=function(_0x4a972c,_0x5980b1){var _0x5454e1={'raw':!![],'where':{'id':_0x4a972c['params']['id']}},_0x2abc7f={};_0x2abc7f[_0xdf69('0x2e')]=_['keys'](db[_0xdf69('0x29')][_0xdf69('0x2a')]);_0x2abc7f[_0xdf69('0x30')]=_[_0xdf69('0x42')](_0x4a972c[_0xdf69('0x30')]);_0x2abc7f[_0xdf69('0x31')]=_[_0xdf69('0x32')](_0x2abc7f[_0xdf69('0x2e')],_0x2abc7f[_0xdf69('0x30')]);_0x5454e1['attributes']=_['intersection'](_0x2abc7f[_0xdf69('0x2e')],qs['fields'](_0x4a972c[_0xdf69('0x30')][_0xdf69('0x33')]));_0x5454e1[_0xdf69('0x34')]=_0x5454e1['attributes'][_0xdf69('0x35')]?_0x5454e1[_0xdf69('0x34')]:_0x2abc7f[_0xdf69('0x2e')];if(_0x4a972c[_0xdf69('0x30')]['includeAll']){_0x5454e1[_0xdf69('0x3f')]=[{'all':!![]}];}_0x5454e1=_[_0xdf69('0x3b')]({},_0x5454e1,_0x4a972c['options']);return db['Cdr'][_0xdf69('0x43')](_0x5454e1)[_0xdf69('0x26')](handleEntityNotFound(_0x5980b1,null))[_0xdf69('0x26')](respondWithResult(_0x5980b1,null))[_0xdf69('0x41')](handleError(_0x5980b1,null));};exports[_0xdf69('0x44')]=function(_0x1b46c6,_0x578eec){return db['Cdr'][_0xdf69('0x44')](_0x1b46c6[_0xdf69('0x45')],{})[_0xdf69('0x26')](respondWithResult(_0x578eec,0xc9))[_0xdf69('0x41')](handleError(_0x578eec,null));};exports['update']=function(_0x4bc70f,_0xb34f76){if(_0x4bc70f[_0xdf69('0x45')]['id']){delete _0x4bc70f[_0xdf69('0x45')]['id'];}return db[_0xdf69('0x29')][_0xdf69('0x43')]({'where':{'id':_0x4bc70f[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0xb34f76,null))[_0xdf69('0x26')](saveUpdates(_0x4bc70f[_0xdf69('0x45')],null))[_0xdf69('0x26')](respondWithResult(_0xb34f76,null))[_0xdf69('0x41')](handleError(_0xb34f76,null));};exports[_0xdf69('0x47')]=function(_0x9a24c9,_0x439b06){return db['Cdr'][_0xdf69('0x43')]({'where':{'id':_0x9a24c9[_0xdf69('0x46')]['id']}})[_0xdf69('0x26')](handleEntityNotFound(_0x439b06,null))['then'](removeEntity(_0x439b06,null))[_0xdf69('0x41')](handleError(_0x439b06,null));};exports[_0xdf69('0x48')]=function(_0x15ca48,_0x4abeb7){return db[_0xdf69('0x29')]['describe']()[_0xdf69('0x26')](respondWithResult(_0x4abeb7,null))[_0xdf69('0x41')](handleError(_0x4abeb7,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3cba8e9..3e5936b 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(_0x1d7bfc,_0x9dc01){var _0x34d68d=function(_0x3a7380){while(--_0x3a7380){_0x1d7bfc['push'](_0x1d7bfc['shift']());}};_0x34d68d(++_0x9dc01);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(_0x55dd9d,_0x39bb00){var _0x300f11=function(_0x86f10a){while(--_0x86f10a){_0x55dd9d['push'](_0x55dd9d['shift']());}};_0x300f11(++_0x39bb00);}(_0x7a54,0x106));var _0x47a5=function(_0x1a1ac0,_0x5b3b56){_0x1a1ac0=_0x1a1ac0-0x0;var _0x3dd4ce=_0x7a54[_0x1a1ac0];return _0x3dd4ce;};'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 11aba53..ff2a522 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 _0xe24a=['../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c2a87,_0x301e33){var _0x3a4efd=function(_0x2c5e19){while(--_0x2c5e19){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x3a4efd(++_0x301e33);}(_0xe24a,0x1dc));var _0xae24=function(_0x502a31,_0x1aeeca){_0x502a31=_0x502a31-0x0;var _0x1b003b=_0xe24a[_0x502a31];return _0x1b003b;};'use strict';var _=require(_0xae24('0x0'));var util=require(_0xae24('0x1'));var moment=require(_0xae24('0x2'));var BPromise=require(_0xae24('0x3'));var rs=require(_0xae24('0x4'));var fs=require('fs');var Redis=require(_0xae24('0x5'));var db=require(_0xae24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae24('0x7'))(_0xae24('0x8'));var config=require(_0xae24('0x9'));var jayson=require(_0xae24('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2da4b4,_0x5d5370,_0x4d4745){return new BPromise(function(_0xebdbb4,_0x64b120){return client['request'](_0x2da4b4,_0x4d4745)['then'](function(_0x2abe37){logger[_0xae24('0xb')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0xae24('0xc'));logger[_0xae24('0xd')](_0xae24('0xe'),_0x5d5370,_0xae24('0xc'),JSON[_0xae24('0xf')](_0x2abe37));if(_0x2abe37['error']){if(_0x2abe37[_0xae24('0x10')]['code']===0x1f4){logger[_0xae24('0x10')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);return _0x64b120(_0x2abe37[_0xae24('0x10')]['message']);}logger[_0xae24('0x10')](_0xae24('0x12'),_0x5d5370,_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);return _0xebdbb4(_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);}else{logger[_0xae24('0xb')]('Cdr,\x20%s,\x20%s',_0x5d5370,'request\x20sent');_0xebdbb4(_0x2abe37[_0xae24('0x13')][_0xae24('0x11')]);}})[_0xae24('0x14')](function(_0x26b773){logger[_0xae24('0x10')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0x26b773);_0x64b120(_0x26b773);});});}
\ No newline at end of file
+var _0x2ec4=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d6cf2,_0x456384){var _0x3aa3eb=function(_0x5b685f){while(--_0x5b685f){_0x3d6cf2['push'](_0x3d6cf2['shift']());}};_0x3aa3eb(++_0x456384);}(_0x2ec4,0x1d2));var _0x42ec=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2ec4[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x42ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x42ec('0x1'));var fs=require('fs');var Redis=require(_0x42ec('0x2'));var db=require(_0x42ec('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x42ec('0x4'))('rpc');var config=require(_0x42ec('0x5'));var jayson=require(_0x42ec('0x6'));var client=jayson['client'][_0x42ec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4fb9b3,_0x4f6fcd,_0x2ab2a2){return new BPromise(function(_0x53866a,_0x74c41c){return client[_0x42ec('0x8')](_0x4fb9b3,_0x2ab2a2)[_0x42ec('0x9')](function(_0x3074a8){logger[_0x42ec('0xa')](_0x42ec('0xb'),_0x4f6fcd,_0x42ec('0xc'));logger[_0x42ec('0xd')](_0x42ec('0xe'),_0x4f6fcd,_0x42ec('0xc'),JSON[_0x42ec('0xf')](_0x3074a8));if(_0x3074a8[_0x42ec('0x10')]){if(_0x3074a8[_0x42ec('0x10')][_0x42ec('0x11')]===0x1f4){logger[_0x42ec('0x10')]('Cdr,\x20%s,\x20%s',_0x4f6fcd,_0x3074a8['error'][_0x42ec('0x12')]);return _0x74c41c(_0x3074a8[_0x42ec('0x10')][_0x42ec('0x12')]);}logger['error'](_0x42ec('0xb'),_0x4f6fcd,_0x3074a8[_0x42ec('0x10')][_0x42ec('0x12')]);return _0x53866a(_0x3074a8[_0x42ec('0x10')]['message']);}else{logger[_0x42ec('0xa')](_0x42ec('0xb'),_0x4f6fcd,_0x42ec('0xc'));_0x53866a(_0x3074a8['result']['message']);}})[_0x42ec('0x13')](function(_0x47d660){logger[_0x42ec('0x10')](_0x42ec('0xb'),_0x4f6fcd,_0x47d660);_0x74c41c(_0x47d660);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0f99064..d5bbe5b 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x474030,_0x38397a){var _0x584ab0=function(_0xfd7646){while(--_0xfd7646){_0x474030['push'](_0x474030['shift']());}};_0x584ab0(++_0x38397a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e9903,_0x3ec512){_0x3e9903=_0x3e9903-0x0;var _0xcab758=_0xb10b[_0x3e9903];return _0xcab758;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a854680..bc50742 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 _0x42ab=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x50b342,_0x3fdd5a){var _0x3426d5=function(_0x597d34){while(--_0x597d34){_0x50b342['push'](_0x50b342['shift']());}};_0x3426d5(++_0x3fdd5a);}(_0x42ab,0x194));var _0xb42a=function(_0x262f44,_0x3847ba){_0x262f44=_0x262f44-0x0;var _0x33b27c=_0x42ab[_0x262f44];return _0x33b27c;};'use strict';var Sequelize=require(_0xb42a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb42a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb42a('0x2')],'allowNull':![],'defaultValue':_0xb42a('0x3')},'appdata':{'type':Sequelize[_0xb42a('0x4')]()},'description':{'type':Sequelize[_0xb42a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xf5b0=['noop','TEXT','sequelize','exports','STRING'];(function(_0x4d5dfc,_0xd5042b){var _0x2c29f0=function(_0x2ae258){while(--_0x2ae258){_0x4d5dfc['push'](_0x4d5dfc['shift']());}};_0x2c29f0(++_0xd5042b);}(_0xf5b0,0x1b5));var _0x0f5b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xf5b0[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x0f5b('0x0'));module[_0x0f5b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0f5b('0x2')],'allowNull':![],'defaultValue':_0x0f5b('0x3')},'appdata':{'type':Sequelize[_0x0f5b('0x4')]()},'description':{'type':Sequelize[_0x0f5b('0x2')]},'interval':{'type':Sequelize[_0x0f5b('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 6282a3d..818556c 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 _0x2746=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','find','params','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3da001,_0x256e26){var _0x2947e9=function(_0x4afdc0){while(--_0x4afdc0){_0x3da001['push'](_0x3da001['shift']());}};_0x2947e9(++_0x256e26);}(_0x2746,0x19c));var _0x6274=function(_0x85465a,_0x4dfeb2){_0x85465a=_0x85465a-0x0;var _0x57ffb9=_0x2746[_0x85465a];return _0x57ffb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6274('0x0'));var jsonpatch=require(_0x6274('0x1'));var rp=require(_0x6274('0x2'));var moment=require(_0x6274('0x3'));var BPromise=require(_0x6274('0x4'));var Mustache=require(_0x6274('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6274('0x6'));var csv=require(_0x6274('0x7'));var ejs=require(_0x6274('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6274('0x9'));var squel=require(_0x6274('0xa'));var crypto=require(_0x6274('0xb'));var jsforce=require(_0x6274('0xc'));var deskjs=require(_0x6274('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6274('0xe'));var Papa=require('papaparse');var Redis=require(_0x6274('0xf'));var authService=require(_0x6274('0x10'));var qs=require(_0x6274('0x11'));var as=require(_0x6274('0x12'));var hardwareService=require(_0x6274('0x13'));var logger=require(_0x6274('0x14'))(_0x6274('0x15'));var utils=require(_0x6274('0x16'));var config=require(_0x6274('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a0a1,_0xd3a0a2){_0xd3a0a2=_0xd3a0a2||0xcc;return function(_0x479fdc){if(_0x479fdc){return _0x59a0a1[_0x6274('0x18')](_0xd3a0a2);}return _0x59a0a1[_0x6274('0x19')](_0xd3a0a2)[_0x6274('0x1a')]();};}function respondWithResult(_0x4f4f9e,_0x58a4e3){_0x58a4e3=_0x58a4e3||0xc8;return function(_0x488b60){if(_0x488b60){return _0x4f4f9e[_0x6274('0x19')](_0x58a4e3)[_0x6274('0x1b')](_0x488b60);}};}function respondWithFilteredResult(_0x4b581a,_0x5e6ff8){return function(_0x425c8b){if(_0x425c8b){var _0x1d0dc4=typeof _0x5e6ff8[_0x6274('0x1c')]===_0x6274('0x1d')&&typeof _0x5e6ff8[_0x6274('0x1e')]==='undefined';var _0x3219d1=_0x425c8b[_0x6274('0x1f')];var _0x40cc32=_0x1d0dc4?0x0:_0x5e6ff8['offset'];var _0x5cdf5e=_0x1d0dc4?_0x425c8b[_0x6274('0x1f')]:_0x5e6ff8['offset']+_0x5e6ff8['limit'];var _0x402b97;if(_0x5cdf5e>=_0x3219d1){_0x5cdf5e=_0x3219d1;_0x402b97=0xc8;}else{_0x402b97=0xce;}_0x4b581a['status'](_0x402b97);return _0x4b581a[_0x6274('0x20')](_0x6274('0x21'),_0x40cc32+'-'+_0x5cdf5e+'/'+_0x3219d1)['json'](_0x425c8b);}return null;};}function patchUpdates(_0x55dab9){return function(_0x3e0248){try{jsonpatch[_0x6274('0x22')](_0x3e0248,_0x55dab9,!![]);}catch(_0xe2b388){return BPromise[_0x6274('0x23')](_0xe2b388);}return _0x3e0248[_0x6274('0x24')]();};}function saveUpdates(_0x221c7a,_0x3b8fb6){return function(_0x12df93){if(_0x12df93){return _0x12df93[_0x6274('0x25')](_0x221c7a)[_0x6274('0x26')](function(_0x1d1a09){return _0x1d1a09;});}return null;};}function removeEntity(_0xc49220,_0x125f14){return function(_0xa0c8bd){if(_0xa0c8bd){return _0xa0c8bd[_0x6274('0x27')]()[_0x6274('0x26')](function(){_0xc49220[_0x6274('0x19')](0xcc)[_0x6274('0x1a')]();});}};}function handleEntityNotFound(_0x5228a1,_0x425241){return function(_0x486d1f){if(!_0x486d1f){_0x5228a1[_0x6274('0x18')](0x194);}return _0x486d1f;};}function handleError(_0x543ac7,_0x234149){_0x234149=_0x234149||0x1f4;return function(_0x1513e8){logger['error'](_0x1513e8[_0x6274('0x28')]);if(_0x1513e8['name']){delete _0x1513e8['name'];}_0x543ac7[_0x6274('0x19')](_0x234149)[_0x6274('0x29')](_0x1513e8);};}exports[_0x6274('0x2a')]=function(_0x490541,_0x3feefd){var _0x49df2e={'raw':!![],'where':{'id':_0x490541['params']['id']}},_0x4818e2={};_0x4818e2[_0x6274('0x2b')]=_[_0x6274('0x2c')](db[_0x6274('0x2d')][_0x6274('0x2e')]);_0x4818e2[_0x6274('0x2f')]=_[_0x6274('0x2c')](_0x490541['query']);_0x4818e2[_0x6274('0x30')]=_[_0x6274('0x31')](_0x4818e2[_0x6274('0x2b')],_0x4818e2[_0x6274('0x2f')]);_0x49df2e[_0x6274('0x32')]=_[_0x6274('0x31')](_0x4818e2[_0x6274('0x2b')],qs['fields'](_0x490541['query'][_0x6274('0x33')]));_0x49df2e[_0x6274('0x32')]=_0x49df2e[_0x6274('0x32')][_0x6274('0x34')]?_0x49df2e[_0x6274('0x32')]:_0x4818e2[_0x6274('0x2b')];if(_0x490541[_0x6274('0x2f')][_0x6274('0x35')]){_0x49df2e[_0x6274('0x36')]=[{'all':!![]}];}_0x49df2e=_[_0x6274('0x37')]({},_0x49df2e,_0x490541[_0x6274('0x38')]);return db[_0x6274('0x2d')]['find'](_0x49df2e)[_0x6274('0x26')](handleEntityNotFound(_0x3feefd,null))[_0x6274('0x26')](respondWithResult(_0x3feefd,null))[_0x6274('0x39')](handleError(_0x3feefd,null));};exports[_0x6274('0x25')]=function(_0x167cba,_0x8b1bd4){if(_0x167cba['body']['id']){delete _0x167cba['body']['id'];}return db['ChatApplication'][_0x6274('0x3a')]({'where':{'id':_0x167cba[_0x6274('0x3b')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x8b1bd4,null))[_0x6274('0x26')](saveUpdates(_0x167cba[_0x6274('0x3c')],null))[_0x6274('0x26')](respondWithResult(_0x8b1bd4,null))[_0x6274('0x39')](handleError(_0x8b1bd4,null));};exports[_0x6274('0x27')]=function(_0x3a63ca,_0x115077){return db[_0x6274('0x2d')][_0x6274('0x3a')]({'where':{'id':_0x3a63ca[_0x6274('0x3b')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x115077,null))[_0x6274('0x26')](removeEntity(_0x115077,null))[_0x6274('0x39')](handleError(_0x115077,null));};
\ No newline at end of file
+var _0x9780=['end','offset','undefined','limit','count','set','json','reject','save','update','destroy','error','stack','name','send','show','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','find','then','body','params','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x9780,0x1d4));var _0x0978=function(_0x4ae506,_0x5a97ed){_0x4ae506=_0x4ae506-0x0;var _0x18e3a1=_0x9780[_0x4ae506];return _0x18e3a1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0978('0x0'));var jsonpatch=require(_0x0978('0x1'));var rp=require(_0x0978('0x2'));var moment=require(_0x0978('0x3'));var BPromise=require(_0x0978('0x4'));var Mustache=require(_0x0978('0x5'));var util=require(_0x0978('0x6'));var path=require(_0x0978('0x7'));var sox=require(_0x0978('0x8'));var csv=require(_0x0978('0x9'));var ejs=require(_0x0978('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0978('0xb'));var squel=require(_0x0978('0xc'));var crypto=require(_0x0978('0xd'));var jsforce=require(_0x0978('0xe'));var deskjs=require(_0x0978('0xf'));var toCsv=require(_0x0978('0x9'));var querystring=require(_0x0978('0x10'));var Papa=require(_0x0978('0x11'));var Redis=require(_0x0978('0x12'));var authService=require(_0x0978('0x13'));var qs=require(_0x0978('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0978('0x15'));var logger=require('../../config/logger')(_0x0978('0x16'));var utils=require(_0x0978('0x17'));var config=require(_0x0978('0x18'));var licenseUtil=require(_0x0978('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3db101,_0x4cb5f5){_0x4cb5f5=_0x4cb5f5||0xcc;return function(_0x3cc5e6){if(_0x3cc5e6){return _0x3db101[_0x0978('0x1a')](_0x4cb5f5);}return _0x3db101[_0x0978('0x1b')](_0x4cb5f5)[_0x0978('0x1c')]();};}function respondWithResult(_0x155a71,_0xe18785){_0xe18785=_0xe18785||0xc8;return function(_0x1fc724){if(_0x1fc724){return _0x155a71[_0x0978('0x1b')](_0xe18785)['json'](_0x1fc724);}};}function respondWithFilteredResult(_0x28d1b8,_0x2177e0){return function(_0x1fe6a9){if(_0x1fe6a9){var _0x20e9ab=typeof _0x2177e0[_0x0978('0x1d')]===_0x0978('0x1e')&&typeof _0x2177e0[_0x0978('0x1f')]===_0x0978('0x1e');var _0x2f2d4c=_0x1fe6a9['count'];var _0x18f40a=_0x20e9ab?0x0:_0x2177e0[_0x0978('0x1d')];var _0x23d426=_0x20e9ab?_0x1fe6a9[_0x0978('0x20')]:_0x2177e0[_0x0978('0x1d')]+_0x2177e0[_0x0978('0x1f')];var _0x1cdd40;if(_0x23d426>=_0x2f2d4c){_0x23d426=_0x2f2d4c;_0x1cdd40=0xc8;}else{_0x1cdd40=0xce;}_0x28d1b8[_0x0978('0x1b')](_0x1cdd40);return _0x28d1b8[_0x0978('0x21')]('Content-Range',_0x18f40a+'-'+_0x23d426+'/'+_0x2f2d4c)[_0x0978('0x22')](_0x1fe6a9);}return null;};}function patchUpdates(_0xad6a1d){return function(_0x346ffc){try{jsonpatch['apply'](_0x346ffc,_0xad6a1d,!![]);}catch(_0x1ac591){return BPromise[_0x0978('0x23')](_0x1ac591);}return _0x346ffc[_0x0978('0x24')]();};}function saveUpdates(_0x5b6558,_0x1c97a9){return function(_0x5b3c5c){if(_0x5b3c5c){return _0x5b3c5c[_0x0978('0x25')](_0x5b6558)['then'](function(_0x2f61db){return _0x2f61db;});}return null;};}function removeEntity(_0x4f4fa6,_0x1a968d){return function(_0x58e40d){if(_0x58e40d){return _0x58e40d[_0x0978('0x26')]()['then'](function(){_0x4f4fa6['status'](0xcc)[_0x0978('0x1c')]();});}};}function handleEntityNotFound(_0x45d953,_0x453e2c){return function(_0x2e3612){if(!_0x2e3612){_0x45d953[_0x0978('0x1a')](0x194);}return _0x2e3612;};}function handleError(_0x1fcb09,_0x3f5c6d){_0x3f5c6d=_0x3f5c6d||0x1f4;return function(_0x39fff2){logger[_0x0978('0x27')](_0x39fff2[_0x0978('0x28')]);if(_0x39fff2[_0x0978('0x29')]){delete _0x39fff2[_0x0978('0x29')];}_0x1fcb09[_0x0978('0x1b')](_0x3f5c6d)[_0x0978('0x2a')](_0x39fff2);};}exports[_0x0978('0x2b')]=function(_0x4215a3,_0x16a8e8){var _0xc68e34={'raw':!![],'where':{'id':_0x4215a3['params']['id']}},_0x111966={};_0x111966[_0x0978('0x2c')]=_['keys'](db[_0x0978('0x2d')][_0x0978('0x2e')]);_0x111966[_0x0978('0x2f')]=_[_0x0978('0x30')](_0x4215a3[_0x0978('0x2f')]);_0x111966[_0x0978('0x31')]=_[_0x0978('0x32')](_0x111966[_0x0978('0x2c')],_0x111966[_0x0978('0x2f')]);_0xc68e34[_0x0978('0x33')]=_[_0x0978('0x32')](_0x111966[_0x0978('0x2c')],qs[_0x0978('0x34')](_0x4215a3[_0x0978('0x2f')][_0x0978('0x34')]));_0xc68e34[_0x0978('0x33')]=_0xc68e34[_0x0978('0x33')][_0x0978('0x35')]?_0xc68e34['attributes']:_0x111966[_0x0978('0x2c')];if(_0x4215a3[_0x0978('0x2f')][_0x0978('0x36')]){_0xc68e34[_0x0978('0x37')]=[{'all':!![]}];}_0xc68e34=_[_0x0978('0x38')]({},_0xc68e34,_0x4215a3['options']);return db[_0x0978('0x2d')][_0x0978('0x39')](_0xc68e34)[_0x0978('0x3a')](handleEntityNotFound(_0x16a8e8,null))[_0x0978('0x3a')](respondWithResult(_0x16a8e8,null))['catch'](handleError(_0x16a8e8,null));};exports['update']=function(_0x5dcc5e,_0x2f937b){if(_0x5dcc5e[_0x0978('0x3b')]['id']){delete _0x5dcc5e['body']['id'];}return db[_0x0978('0x2d')][_0x0978('0x39')]({'where':{'id':_0x5dcc5e[_0x0978('0x3c')]['id']}})[_0x0978('0x3a')](handleEntityNotFound(_0x2f937b,null))['then'](saveUpdates(_0x5dcc5e[_0x0978('0x3b')],null))['then'](respondWithResult(_0x2f937b,null))[_0x0978('0x3d')](handleError(_0x2f937b,null));};exports[_0x0978('0x26')]=function(_0x185477,_0x2b7511){return db[_0x0978('0x2d')][_0x0978('0x39')]({'where':{'id':_0x185477[_0x0978('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2b7511,null))[_0x0978('0x3a')](removeEntity(_0x2b7511,null))[_0x0978('0x3d')](handleError(_0x2b7511,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7400fed..a555f4a 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 _0xfdd7=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdd7,0xa3));var _0x7fdd=function(_0x33aa5f,_0x28b469){_0x33aa5f=_0x33aa5f-0x0;var _0x4774a1=_0xfdd7[_0x33aa5f];return _0x4774a1;};'use strict';var _=require(_0x7fdd('0x0'));var util=require(_0x7fdd('0x1'));var logger=require(_0x7fdd('0x2'))('api');var moment=require(_0x7fdd('0x3'));var BPromise=require(_0x7fdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fdd('0x5'));var rimraf=require(_0x7fdd('0x6'));var config=require(_0x7fdd('0x7'));var attributes=require(_0x7fdd('0x8'));module[_0x7fdd('0x9')]=function(_0x54deda,_0x40dbe3){return _0x54deda[_0x7fdd('0xa')](_0x7fdd('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7fdd('0xc'),'collate':_0x7fdd('0xd')});};
\ No newline at end of file
+var _0x2b6c=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x32ea14,_0x5cf630){var _0x4c7d20=function(_0x332286){while(--_0x332286){_0x32ea14['push'](_0x32ea14['shift']());}};_0x4c7d20(++_0x5cf630);}(_0x2b6c,0xa1));var _0xc2b6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2b6c[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc2b6('0x0'));var moment=require('moment');var BPromise=require(_0xc2b6('0x1'));var rp=require(_0xc2b6('0x2'));var fs=require('fs');var path=require(_0xc2b6('0x3'));var rimraf=require(_0xc2b6('0x4'));var config=require(_0xc2b6('0x5'));var attributes=require('./chatApplication.attributes');module[_0xc2b6('0x6')]=function(_0x7e1215,_0x38a364){return _0x7e1215[_0xc2b6('0x7')](_0xc2b6('0x8'),attributes,{'tableName':_0xc2b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2b6('0xa'),'collate':_0xc2b6('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 586d00f..c0d8ce1 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 _0x6c36=['code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x19a8b5,_0x3d98c2){var _0xb4e415=function(_0x4c02b7){while(--_0x4c02b7){_0x19a8b5['push'](_0x19a8b5['shift']());}};_0xb4e415(++_0x3d98c2);}(_0x6c36,0x112));var _0x66c3=function(_0x2b7337,_0x324cc6){_0x2b7337=_0x2b7337-0x0;var _0x3d894d=_0x6c36[_0x2b7337];return _0x3d894d;};'use strict';var _=require(_0x66c3('0x0'));var util=require(_0x66c3('0x1'));var moment=require('moment');var BPromise=require(_0x66c3('0x2'));var rs=require(_0x66c3('0x3'));var fs=require('fs');var Redis=require(_0x66c3('0x4'));var db=require(_0x66c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x66c3('0x6'));var config=require(_0x66c3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x66c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41a106,_0x3e017a,_0x47552b){return new BPromise(function(_0x34cb24,_0x3c7ca8){return client['request'](_0x41a106,_0x47552b)[_0x66c3('0x9')](function(_0x5550b9){logger['info'](_0x66c3('0xa'),_0x3e017a,_0x66c3('0xb'));logger[_0x66c3('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3e017a,_0x66c3('0xb'),JSON['stringify'](_0x5550b9));if(_0x5550b9[_0x66c3('0xd')]){if(_0x5550b9['error'][_0x66c3('0xe')]===0x1f4){logger[_0x66c3('0xd')](_0x66c3('0xa'),_0x3e017a,_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);return _0x3c7ca8(_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);}logger['error'](_0x66c3('0xa'),_0x3e017a,_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);return _0x34cb24(_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);}else{logger[_0x66c3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x3e017a,_0x66c3('0xb'));_0x34cb24(_0x5550b9[_0x66c3('0x11')]['message']);}})['catch'](function(_0x5a6bba){logger['error'](_0x66c3('0xa'),_0x3e017a,_0x5a6bba);_0x3c7ca8(_0x5a6bba);});});}
\ No newline at end of file
+var _0x275f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x275f,0x154));var _0xf275=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x275f[_0x492221];return _0x398bf9;};'use strict';var _=require(_0xf275('0x0'));var util=require('util');var moment=require(_0xf275('0x1'));var BPromise=require(_0xf275('0x2'));var rs=require(_0xf275('0x3'));var fs=require('fs');var Redis=require(_0xf275('0x4'));var db=require(_0xf275('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf275('0x6'))(_0xf275('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf275('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6fb6,_0x14f81c,_0x153a32){return new BPromise(function(_0x5074a4,_0x3f9823){return client[_0xf275('0x9')](_0x4d6fb6,_0x153a32)[_0xf275('0xa')](function(_0x11c49a){logger[_0xf275('0xb')](_0xf275('0xc'),_0x14f81c,'request\x20sent');logger['debug'](_0xf275('0xd'),_0x14f81c,_0xf275('0xe'),JSON[_0xf275('0xf')](_0x11c49a));if(_0x11c49a[_0xf275('0x10')]){if(_0x11c49a[_0xf275('0x10')]['code']===0x1f4){logger[_0xf275('0x10')](_0xf275('0xc'),_0x14f81c,_0x11c49a[_0xf275('0x10')][_0xf275('0x11')]);return _0x3f9823(_0x11c49a['error']['message']);}logger[_0xf275('0x10')](_0xf275('0xc'),_0x14f81c,_0x11c49a[_0xf275('0x10')][_0xf275('0x11')]);return _0x5074a4(_0x11c49a[_0xf275('0x10')][_0xf275('0x11')]);}else{logger[_0xf275('0xb')]('ChatApplication,\x20%s,\x20%s',_0x14f81c,_0xf275('0xe'));_0x5074a4(_0x11c49a[_0xf275('0x12')][_0xf275('0x11')]);}})['catch'](function(_0x4216b8){logger[_0xf275('0x10')](_0xf275('0xc'),_0x14f81c,_0x4216b8);_0x3f9823(_0x4216b8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c4a455b..56bf5d6 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 _0x759d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4017fc,_0x4734de){var _0x49b7e4=function(_0x414b2f){while(--_0x414b2f){_0x4017fc['push'](_0x4017fc['shift']());}};_0x49b7e4(++_0x4734de);}(_0x759d,0x10a));var _0xd759=function(_0x226e5d,_0x3d7316){_0x226e5d=_0x226e5d-0x0;var _0x8d9bdc=_0x759d[_0x226e5d];return _0x8d9bdc;};'use strict';var multer=require(_0xd759('0x0'));var util=require('util');var path=require(_0xd759('0x1'));var timeout=require(_0xd759('0x2'));var express=require(_0xd759('0x3'));var router=express[_0xd759('0x4')]();var fs_extra=require(_0xd759('0x5'));var auth=require(_0xd759('0x6'));var interaction=require(_0xd759('0x7'));var config=require(_0xd759('0x8'));var controller=require(_0xd759('0x9'));router['get'](_0xd759('0xa'),auth[_0xd759('0xb')](),controller[_0xd759('0xc')]);router[_0xd759('0xd')](_0xd759('0xa'),auth[_0xd759('0xb')](),controller[_0xd759('0xe')]);router['delete'](_0xd759('0xa'),auth[_0xd759('0xb')](),controller['destroy']);module[_0xd759('0xf')]=router;
\ No newline at end of file
+var _0xe359=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe359,0xdc));var _0x9e35=function(_0x5115c0,_0x2d588e){_0x5115c0=_0x5115c0-0x0;var _0x4344d7=_0xe359[_0x5115c0];return _0x4344d7;};'use strict';var multer=require(_0x9e35('0x0'));var util=require(_0x9e35('0x1'));var path=require('path');var timeout=require(_0x9e35('0x2'));var express=require(_0x9e35('0x3'));var router=express[_0x9e35('0x4')]();var fs_extra=require(_0x9e35('0x5'));var auth=require(_0x9e35('0x6'));var interaction=require(_0x9e35('0x7'));var config=require(_0x9e35('0x8'));var controller=require(_0x9e35('0x9'));router[_0x9e35('0xa')](_0x9e35('0xb'),auth[_0x9e35('0xc')](),controller[_0x9e35('0xd')]);router[_0x9e35('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9e35('0xf')]);router['delete'](_0x9e35('0xb'),auth[_0x9e35('0xc')](),controller[_0x9e35('0x10')]);module[_0x9e35('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9136603..f19b033 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 _0xd668=['STRING','BOOLEAN','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd668,0x18e));var _0x8d66=function(_0x204ef6,_0x14dc9b){_0x204ef6=_0x204ef6-0x0;var _0x5e3a4b=_0xd668[_0x204ef6];return _0x5e3a4b;};'use strict';var Sequelize=require(_0x8d66('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d66('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8d66('0x1')]},'write':{'type':Sequelize[_0x8d66('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xffb1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xffb1,0x93));var _0x1ffb=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0xffb1[_0x2ce6d5];return _0x32d272;};'use strict';var Sequelize=require(_0x1ffb('0x0'));module[_0x1ffb('0x1')]={'name':{'type':Sequelize[_0x1ffb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ffb('0x2')]},'write':{'type':Sequelize[_0x1ffb('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 8ca3743..6b7d6d4 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 _0x28c7=['include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ChatGroup','includeAll'];(function(_0x27c0f8,_0xd1bd2f){var _0x426b4e=function(_0x1d3f4b){while(--_0x1d3f4b){_0x27c0f8['push'](_0x27c0f8['shift']());}};_0x426b4e(++_0xd1bd2f);}(_0x28c7,0x7d));var _0x728c=function(_0x476350,_0x481037){_0x476350=_0x476350-0x0;var _0x452d18=_0x28c7[_0x476350];return _0x452d18;};'use strict';var emlformat=require(_0x728c('0x0'));var rimraf=require(_0x728c('0x1'));var zipdir=require(_0x728c('0x2'));var jsonpatch=require(_0x728c('0x3'));var rp=require(_0x728c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x728c('0x5'));var util=require(_0x728c('0x6'));var path=require(_0x728c('0x7'));var sox=require(_0x728c('0x8'));var csv=require(_0x728c('0x9'));var ejs=require(_0x728c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x728c('0xb'));var crypto=require(_0x728c('0xc'));var jsforce=require(_0x728c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x728c('0x9'));var querystring=require('querystring');var Papa=require(_0x728c('0xe'));var Redis=require(_0x728c('0xf'));var authService=require(_0x728c('0x10'));var qs=require(_0x728c('0x11'));var as=require(_0x728c('0x12'));var hardwareService=require(_0x728c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x728c('0x14'));var config=require(_0x728c('0x15'));var licenseUtil=require(_0x728c('0x16'));var db=require(_0x728c('0x17'))['db'];config[_0x728c('0x18')]=_[_0x728c('0x19')](config[_0x728c('0x18')],{'host':_0x728c('0x1a'),'port':0x18eb});var socket=require(_0x728c('0x1b'))(new Redis(config['redis']));require(_0x728c('0x1c'))[_0x728c('0x1d')](socket);function respondWithStatusCode(_0x5ec169,_0x8afd0b){_0x8afd0b=_0x8afd0b||0xcc;return function(_0x4b5046){if(_0x4b5046){return _0x5ec169[_0x728c('0x1e')](_0x8afd0b);}return _0x5ec169[_0x728c('0x1f')](_0x8afd0b)[_0x728c('0x20')]();};}function respondWithResult(_0x11e97f,_0x8ab394){_0x8ab394=_0x8ab394||0xc8;return function(_0x2b621b){if(_0x2b621b){return _0x11e97f[_0x728c('0x1f')](_0x8ab394)['json'](_0x2b621b);}};}function respondWithFilteredResult(_0x594e64,_0x320b3d){return function(_0x2b18dc){if(_0x2b18dc){var _0x3cdf6b=typeof _0x320b3d[_0x728c('0x21')]===_0x728c('0x22')&&typeof _0x320b3d[_0x728c('0x23')]===_0x728c('0x22');var _0x38fb5c=_0x2b18dc[_0x728c('0x24')];var _0x1440f8=_0x3cdf6b?0x0:_0x320b3d[_0x728c('0x21')];var _0xc1a8e3=_0x3cdf6b?_0x2b18dc[_0x728c('0x24')]:_0x320b3d[_0x728c('0x21')]+_0x320b3d[_0x728c('0x23')];var _0x3178e6;if(_0xc1a8e3>=_0x38fb5c){_0xc1a8e3=_0x38fb5c;_0x3178e6=0xc8;}else{_0x3178e6=0xce;}_0x594e64['status'](_0x3178e6);return _0x594e64[_0x728c('0x25')]('Content-Range',_0x1440f8+'-'+_0xc1a8e3+'/'+_0x38fb5c)[_0x728c('0x26')](_0x2b18dc);}return null;};}function patchUpdates(_0x1a3b51){return function(_0x3a24c8){try{jsonpatch[_0x728c('0x27')](_0x3a24c8,_0x1a3b51,!![]);}catch(_0x48ec9b){return BPromise[_0x728c('0x28')](_0x48ec9b);}return _0x3a24c8[_0x728c('0x29')]();};}function saveUpdates(_0x504b2d,_0x35edd6){return function(_0x505c10){if(_0x505c10){return _0x505c10[_0x728c('0x2a')](_0x504b2d)[_0x728c('0x2b')](function(_0x42cf4f){return _0x42cf4f;});}return null;};}function removeEntity(_0x189ddc,_0x40bb3e){return function(_0x3a4645){if(_0x3a4645){return _0x3a4645[_0x728c('0x2c')]()[_0x728c('0x2b')](function(){_0x189ddc['status'](0xcc)[_0x728c('0x20')]();});}};}function handleEntityNotFound(_0x57a8d1,_0x38ea70){return function(_0x510e56){if(!_0x510e56){_0x57a8d1[_0x728c('0x1e')](0x194);}return _0x510e56;};}function handleError(_0x652ad1,_0x1347f4){_0x1347f4=_0x1347f4||0x1f4;return function(_0x4a8da7){logger[_0x728c('0x2d')](_0x4a8da7[_0x728c('0x2e')]);if(_0x4a8da7[_0x728c('0x2f')]){delete _0x4a8da7[_0x728c('0x2f')];}_0x652ad1['status'](_0x1347f4)[_0x728c('0x30')](_0x4a8da7);};}exports['index']=function(_0x21c7ef,_0x9dc0dd){var _0x49c6eb={},_0x11dc0d={},_0x2e9e9f={'count':0x0,'rows':[]};var _0x12c727=_['map'](db['ChatGroup']['rawAttributes'],function(_0xe340fc){return{'name':_0xe340fc[_0x728c('0x31')],'type':_0xe340fc[_0x728c('0x32')][_0x728c('0x33')]};});_0x11dc0d['model']=_[_0x728c('0x34')](_0x12c727,'name');_0x11dc0d['query']=_[_0x728c('0x35')](_0x21c7ef[_0x728c('0x36')]);_0x11dc0d[_0x728c('0x37')]=_[_0x728c('0x38')](_0x11dc0d[_0x728c('0x39')],_0x11dc0d[_0x728c('0x36')]);_0x49c6eb['attributes']=_[_0x728c('0x38')](_0x11dc0d[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x3a')]));_0x49c6eb[_0x728c('0x3b')]=_0x49c6eb['attributes'][_0x728c('0x3c')]?_0x49c6eb[_0x728c('0x3b')]:_0x11dc0d[_0x728c('0x39')];if(!_0x21c7ef[_0x728c('0x36')][_0x728c('0x3d')](_0x728c('0x3e'))){_0x49c6eb['limit']=qs[_0x728c('0x23')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x23')]);_0x49c6eb[_0x728c('0x21')]=qs[_0x728c('0x21')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x21')]);}_0x49c6eb[_0x728c('0x3f')]=qs[_0x728c('0x40')](_0x21c7ef[_0x728c('0x36')]['sort']);_0x49c6eb[_0x728c('0x41')]=qs['filters'](_['pick'](_0x21c7ef['query'],_0x11dc0d['filters']),_0x12c727);if(_0x21c7ef[_0x728c('0x36')][_0x728c('0x42')]){_0x49c6eb[_0x728c('0x41')]=_[_0x728c('0x43')](_0x49c6eb[_0x728c('0x41')],{'$or':_[_0x728c('0x34')](_0x12c727,function(_0x12e445){if(_0x12e445[_0x728c('0x32')]!=='VIRTUAL'){var _0x38c7d9={};_0x38c7d9[_0x12e445[_0x728c('0x2f')]]={'$like':'%'+_0x21c7ef[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x38c7d9;}})});}_0x49c6eb=_[_0x728c('0x43')]({},_0x49c6eb,_0x21c7ef[_0x728c('0x44')]);var _0x42c751={'where':_0x49c6eb[_0x728c('0x41')]};return db[_0x728c('0x45')][_0x728c('0x24')](_0x42c751)[_0x728c('0x2b')](function(_0x128b78){_0x2e9e9f[_0x728c('0x24')]=_0x128b78;if(_0x21c7ef[_0x728c('0x36')][_0x728c('0x46')]){_0x49c6eb[_0x728c('0x47')]=[{'all':!![]}];}return db[_0x728c('0x45')][_0x728c('0x48')](_0x49c6eb);})[_0x728c('0x2b')](function(_0x44259d){_0x2e9e9f[_0x728c('0x49')]=_0x44259d;return _0x2e9e9f;})[_0x728c('0x2b')](respondWithFilteredResult(_0x9dc0dd,_0x49c6eb))[_0x728c('0x4a')](handleError(_0x9dc0dd,null));};exports['show']=function(_0x1fd311,_0x6e83c0){var _0x1ba3c4={'raw':!![],'where':{'id':_0x1fd311[_0x728c('0x4b')]['id']}},_0x3a9a9a={};_0x3a9a9a['model']=_[_0x728c('0x35')](db[_0x728c('0x45')][_0x728c('0x4c')]);_0x3a9a9a[_0x728c('0x36')]=_[_0x728c('0x35')](_0x1fd311[_0x728c('0x36')]);_0x3a9a9a[_0x728c('0x37')]=_[_0x728c('0x38')](_0x3a9a9a[_0x728c('0x39')],_0x3a9a9a['query']);_0x1ba3c4[_0x728c('0x3b')]=_[_0x728c('0x38')](_0x3a9a9a[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x1fd311[_0x728c('0x36')]['fields']));_0x1ba3c4[_0x728c('0x3b')]=_0x1ba3c4[_0x728c('0x3b')]['length']?_0x1ba3c4['attributes']:_0x3a9a9a[_0x728c('0x39')];if(_0x1fd311[_0x728c('0x36')]['includeAll']){_0x1ba3c4[_0x728c('0x47')]=[{'all':!![]}];}_0x1ba3c4=_[_0x728c('0x43')]({},_0x1ba3c4,_0x1fd311[_0x728c('0x44')]);return db[_0x728c('0x45')][_0x728c('0x4d')](_0x1ba3c4)['then'](handleEntityNotFound(_0x6e83c0,null))['then'](respondWithResult(_0x6e83c0,null))[_0x728c('0x4a')](handleError(_0x6e83c0,null));};exports[_0x728c('0x4e')]=function(_0x6a39a5,_0x3dec30){return db[_0x728c('0x45')]['create'](_0x6a39a5[_0x728c('0x4f')],{})[_0x728c('0x2b')](respondWithResult(_0x3dec30,0xc9))[_0x728c('0x4a')](handleError(_0x3dec30,null));};exports[_0x728c('0x2a')]=function(_0x2c2709,_0x2431e0){if(_0x2c2709[_0x728c('0x4f')]['id']){delete _0x2c2709[_0x728c('0x4f')]['id'];}return db[_0x728c('0x45')][_0x728c('0x4d')]({'where':{'id':_0x2c2709[_0x728c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2431e0,null))[_0x728c('0x2b')](saveUpdates(_0x2c2709['body'],null))[_0x728c('0x2b')](respondWithResult(_0x2431e0,null))[_0x728c('0x4a')](handleError(_0x2431e0,null));};exports[_0x728c('0x2c')]=function(_0x9e7300,_0x509cf1){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x9e7300[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x509cf1,null))[_0x728c('0x2b')](removeEntity(_0x509cf1,null))[_0x728c('0x4a')](handleError(_0x509cf1,null));};exports['describe']=function(_0x277764,_0x2a1e04){return db[_0x728c('0x45')][_0x728c('0x50')]()[_0x728c('0x2b')](respondWithResult(_0x2a1e04,null))[_0x728c('0x4a')](handleError(_0x2a1e04,null));};exports[_0x728c('0x51')]=function(_0x48630d,_0x4621c9,_0x2fda2e){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x48630d['params']['id'],'ToId':_0x48630d[_0x728c('0x52')]['id'],'read':![]}})[_0x728c('0x2b')](function(_0x20bc46){return{'id':_[_0x728c('0x53')](_0x48630d['params']['id']),'count':_0x20bc46};})['then'](respondWithResult(_0x4621c9,null))['catch'](handleError(_0x4621c9,null));};exports[_0x728c('0x54')]=function(_0x591d64,_0x38e45a,_0x12e3a3){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x591d64[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x38e45a,null))[_0x728c('0x2b')](function(_0x8ef293){if(_0x8ef293){return _0x8ef293[_0x728c('0x54')](_0x591d64[_0x728c('0x4f')]['ids'],_['omit'](_0x591d64[_0x728c('0x4f')],[_0x728c('0x55'),'id'])||{});}})[_0x728c('0x2b')](respondWithResult(_0x38e45a,null))[_0x728c('0x4a')](handleError(_0x38e45a,null));};exports[_0x728c('0x56')]=function(_0x3caec6,_0x2acc95,_0x2dbd2b){var _0x197beb={};var _0x45ee62={};var _0x5e772b;var _0x5f29da;return db[_0x728c('0x45')][_0x728c('0x57')]({'where':{'id':_0x3caec6[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x2acc95,null))[_0x728c('0x2b')](function(_0x2fe8cd){if(_0x2fe8cd){_0x5e772b=_0x2fe8cd;_0x45ee62[_0x728c('0x39')]=_[_0x728c('0x35')](db[_0x728c('0x58')][_0x728c('0x4c')]);_0x45ee62['query']=_[_0x728c('0x35')](_0x3caec6[_0x728c('0x36')]);_0x45ee62[_0x728c('0x37')]=_[_0x728c('0x38')](_0x45ee62['model'],_0x45ee62[_0x728c('0x36')]);_0x197beb[_0x728c('0x3b')]=_[_0x728c('0x38')](_0x45ee62[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x3caec6[_0x728c('0x36')][_0x728c('0x3a')]));_0x197beb[_0x728c('0x3b')]=_0x197beb['attributes'][_0x728c('0x3c')]?_0x197beb[_0x728c('0x3b')]:_0x45ee62[_0x728c('0x39')];_0x197beb[_0x728c('0x3f')]=qs['sort'](_0x3caec6[_0x728c('0x36')][_0x728c('0x40')]);_0x197beb[_0x728c('0x41')]=qs[_0x728c('0x37')](_[_0x728c('0x59')](_0x3caec6['query'],_0x45ee62[_0x728c('0x37')]));if(_0x3caec6[_0x728c('0x36')][_0x728c('0x42')]){_0x197beb[_0x728c('0x41')]=_[_0x728c('0x43')](_0x197beb[_0x728c('0x41')],{'$or':_[_0x728c('0x34')](_0x197beb[_0x728c('0x3b')],function(_0x4d047e){var _0x4b899b={};_0x4b899b[_0x4d047e]={'$like':'%'+_0x3caec6[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x4b899b;})});}_0x197beb=_[_0x728c('0x43')]({},_0x197beb,_0x3caec6[_0x728c('0x44')]);return _0x5e772b[_0x728c('0x56')](_0x197beb);}})[_0x728c('0x2b')](function(_0x108adf){if(_0x108adf){_0x5f29da=_0x108adf['length'];if(!_0x3caec6[_0x728c('0x36')]['hasOwnProperty'](_0x728c('0x3e'))){_0x197beb[_0x728c('0x23')]=qs['limit'](_0x3caec6[_0x728c('0x36')][_0x728c('0x23')]);_0x197beb[_0x728c('0x21')]=qs['offset'](_0x3caec6[_0x728c('0x36')][_0x728c('0x21')]);}return _0x5e772b[_0x728c('0x56')](_0x197beb);}})[_0x728c('0x2b')](function(_0x5ce0ca){if(_0x5ce0ca){return _0x5ce0ca?{'count':_0x5f29da,'rows':_0x5ce0ca}:null;}})['then'](respondWithResult(_0x2acc95,null))[_0x728c('0x4a')](handleError(_0x2acc95,null));};exports[_0x728c('0x5a')]=function(_0x3f6cf,_0x4dbd70,_0x447601){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x3f6cf[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x4dbd70,null))[_0x728c('0x2b')](function(_0x14889b){if(_0x14889b){return _0x14889b['removeMembers'](_0x3f6cf[_0x728c('0x36')][_0x728c('0x55')]);}})[_0x728c('0x2b')](respondWithStatusCode(_0x4dbd70,null))[_0x728c('0x4a')](handleError(_0x4dbd70,null));};exports[_0x728c('0x5b')]=function(_0x4f6be0,_0x511cae,_0x275e67){if(_0x4f6be0[_0x728c('0x4f')]['id']){delete _0x4f6be0['body']['id'];}return db[_0x728c('0x45')][_0x728c('0x4d')]({'where':{'id':_0x4f6be0[_0x728c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x511cae,null))[_0x728c('0x2b')](function(_0x21dd0b){if(_0x21dd0b){_0x4f6be0[_0x728c('0x4f')]['ChatGroupId']=_0x21dd0b['id'];return db[_0x728c('0x5c')][_0x728c('0x4e')](_0x4f6be0[_0x728c('0x4f')]);}})[_0x728c('0x2b')](respondWithResult(_0x511cae,null))['catch'](handleError(_0x511cae,null));};exports['getMessages']=function(_0x59f627,_0x25a662,_0x16e3c1){var _0x4d1a48={};var _0x33dd0c={};var _0x4d2ac5;var _0x4484b3;return db['ChatGroup'][_0x728c('0x57')]({'where':{'id':_0x59f627[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x25a662,null))[_0x728c('0x2b')](function(_0x1a78bf){if(_0x1a78bf){_0x4d2ac5=_0x1a78bf;_0x33dd0c[_0x728c('0x39')]=_['keys'](db['ChatInternalMessage'][_0x728c('0x4c')]);_0x33dd0c[_0x728c('0x36')]=_[_0x728c('0x35')](_0x59f627[_0x728c('0x36')]);_0x33dd0c[_0x728c('0x37')]=_[_0x728c('0x38')](_0x33dd0c[_0x728c('0x39')],_0x33dd0c[_0x728c('0x36')]);_0x4d1a48[_0x728c('0x3b')]=_['intersection'](_0x33dd0c[_0x728c('0x39')],qs['fields'](_0x59f627[_0x728c('0x36')][_0x728c('0x3a')]));_0x4d1a48[_0x728c('0x3b')]=_0x4d1a48['attributes'][_0x728c('0x3c')]?_0x4d1a48[_0x728c('0x3b')]:_0x33dd0c[_0x728c('0x39')];_0x4d1a48[_0x728c('0x3f')]=qs['sort'](_0x59f627['query'][_0x728c('0x40')]);_0x4d1a48[_0x728c('0x41')]=qs['filters'](_['pick'](_0x59f627['query'],_0x33dd0c[_0x728c('0x37')]));if(_0x59f627[_0x728c('0x36')][_0x728c('0x42')]){_0x4d1a48[_0x728c('0x41')]=_[_0x728c('0x43')](_0x4d1a48['where'],{'$or':_[_0x728c('0x34')](_0x4d1a48[_0x728c('0x3b')],function(_0x418d2d){var _0x496fda={};_0x496fda[_0x418d2d]={'$like':'%'+_0x59f627[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x496fda;})});}if(_0x59f627[_0x728c('0x36')][_0x728c('0x5d')]){var _0x5e3af5=_0x59f627[_0x728c('0x36')][_0x728c('0x5d')][_0x728c('0x5e')](',');var _0x15aafa={};_0x15aafa[_0x5e3af5[0x0]]={'$gte':moment(_0x5e3af5[0x1])[_0x728c('0x5f')](_0x728c('0x60'))};_0x4d1a48[_0x728c('0x41')]=_[_0x728c('0x43')](_0x4d1a48[_0x728c('0x41')],_0x15aafa);}_0x4d1a48=_[_0x728c('0x43')]({},_0x4d1a48,_0x59f627[_0x728c('0x44')]);return _0x4d2ac5[_0x728c('0x61')](_0x4d1a48);}})[_0x728c('0x2b')](function(_0xc795b2){if(_0xc795b2){_0x4484b3=_0xc795b2[_0x728c('0x3c')];if(!_0x59f627[_0x728c('0x36')][_0x728c('0x3d')](_0x728c('0x3e'))){_0x4d1a48[_0x728c('0x23')]=qs[_0x728c('0x23')](_0x59f627[_0x728c('0x36')][_0x728c('0x23')]);_0x4d1a48[_0x728c('0x21')]=qs[_0x728c('0x21')](_0x59f627[_0x728c('0x36')][_0x728c('0x21')]);}return _0x4d2ac5['getMessages'](_0x4d1a48);}})['then'](function(_0x19a3d2){if(_0x19a3d2){return _0x19a3d2?{'count':_0x4484b3,'rows':_0x19a3d2}:null;}})[_0x728c('0x2b')](respondWithResult(_0x25a662,null))[_0x728c('0x4a')](handleError(_0x25a662,null));};
\ No newline at end of file
+var _0x79a9=['catch','show','params','includeAll','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','pick','$gte','format','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','rows'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x79a9,0x7a));var _0x979a=function(_0x448c06,_0x363654){_0x448c06=_0x448c06-0x0;var _0x29f030=_0x79a9[_0x448c06];return _0x29f030;};'use strict';var emlformat=require(_0x979a('0x0'));var rimraf=require(_0x979a('0x1'));var zipdir=require(_0x979a('0x2'));var jsonpatch=require(_0x979a('0x3'));var rp=require(_0x979a('0x4'));var moment=require(_0x979a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x979a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x979a('0x7'));var ejs=require(_0x979a('0x8'));var fs=require('fs');var fs_extra=require(_0x979a('0x9'));var _=require(_0x979a('0xa'));var squel=require(_0x979a('0xb'));var crypto=require('crypto');var jsforce=require(_0x979a('0xc'));var deskjs=require(_0x979a('0xd'));var toCsv=require(_0x979a('0x7'));var querystring=require(_0x979a('0xe'));var Papa=require(_0x979a('0xf'));var Redis=require(_0x979a('0x10'));var authService=require(_0x979a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x979a('0x12'));var hardwareService=require(_0x979a('0x13'));var logger=require('../../config/logger')(_0x979a('0x14'));var utils=require('../../config/utils');var config=require(_0x979a('0x15'));var licenseUtil=require(_0x979a('0x16'));var db=require(_0x979a('0x17'))['db'];config['redis']=_[_0x979a('0x18')](config[_0x979a('0x19')],{'host':_0x979a('0x1a'),'port':0x18eb});var socket=require(_0x979a('0x1b'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x979a('0x1c')](socket);function respondWithStatusCode(_0x1e670a,_0x4bcc1a){_0x4bcc1a=_0x4bcc1a||0xcc;return function(_0x4a8ed4){if(_0x4a8ed4){return _0x1e670a[_0x979a('0x1d')](_0x4bcc1a);}return _0x1e670a[_0x979a('0x1e')](_0x4bcc1a)['end']();};}function respondWithResult(_0x499242,_0x4dd63b){_0x4dd63b=_0x4dd63b||0xc8;return function(_0x2780dd){if(_0x2780dd){return _0x499242[_0x979a('0x1e')](_0x4dd63b)[_0x979a('0x1f')](_0x2780dd);}};}function respondWithFilteredResult(_0x5ca699,_0x10a3de){return function(_0x359895){if(_0x359895){var _0x48bba1=typeof _0x10a3de[_0x979a('0x20')]==='undefined'&&typeof _0x10a3de['limit']===_0x979a('0x21');var _0x3a84d5=_0x359895[_0x979a('0x22')];var _0x44a65d=_0x48bba1?0x0:_0x10a3de['offset'];var _0x52b93a=_0x48bba1?_0x359895[_0x979a('0x22')]:_0x10a3de['offset']+_0x10a3de[_0x979a('0x23')];var _0x43fd57;if(_0x52b93a>=_0x3a84d5){_0x52b93a=_0x3a84d5;_0x43fd57=0xc8;}else{_0x43fd57=0xce;}_0x5ca699[_0x979a('0x1e')](_0x43fd57);return _0x5ca699[_0x979a('0x24')](_0x979a('0x25'),_0x44a65d+'-'+_0x52b93a+'/'+_0x3a84d5)[_0x979a('0x1f')](_0x359895);}return null;};}function patchUpdates(_0x4bb4e5){return function(_0x1678a8){try{jsonpatch['apply'](_0x1678a8,_0x4bb4e5,!![]);}catch(_0xbf2dba){return BPromise['reject'](_0xbf2dba);}return _0x1678a8[_0x979a('0x26')]();};}function saveUpdates(_0x2249f8,_0x4134f3){return function(_0x10e972){if(_0x10e972){return _0x10e972[_0x979a('0x27')](_0x2249f8)[_0x979a('0x28')](function(_0x2c1583){return _0x2c1583;});}return null;};}function removeEntity(_0x11ed9a,_0x1dbe9c){return function(_0x5015fd){if(_0x5015fd){return _0x5015fd[_0x979a('0x29')]()[_0x979a('0x28')](function(){_0x11ed9a[_0x979a('0x1e')](0xcc)[_0x979a('0x2a')]();});}};}function handleEntityNotFound(_0x551a04,_0x6e77f){return function(_0x468c1c){if(!_0x468c1c){_0x551a04[_0x979a('0x1d')](0x194);}return _0x468c1c;};}function handleError(_0xea8e68,_0x3c0966){_0x3c0966=_0x3c0966||0x1f4;return function(_0x11fdd9){logger[_0x979a('0x2b')](_0x11fdd9[_0x979a('0x2c')]);if(_0x11fdd9[_0x979a('0x2d')]){delete _0x11fdd9[_0x979a('0x2d')];}_0xea8e68['status'](_0x3c0966)[_0x979a('0x2e')](_0x11fdd9);};}exports[_0x979a('0x2f')]=function(_0xcddd8c,_0xd17a7f){var _0x41be30={},_0x59a12e={},_0xa8241e={'count':0x0,'rows':[]};var _0x4cc42c=_[_0x979a('0x30')](db[_0x979a('0x31')][_0x979a('0x32')],function(_0x12b868){return{'name':_0x12b868[_0x979a('0x33')],'type':_0x12b868[_0x979a('0x34')][_0x979a('0x35')]};});_0x59a12e[_0x979a('0x36')]=_[_0x979a('0x30')](_0x4cc42c,_0x979a('0x2d'));_0x59a12e[_0x979a('0x37')]=_[_0x979a('0x38')](_0xcddd8c[_0x979a('0x37')]);_0x59a12e[_0x979a('0x39')]=_[_0x979a('0x3a')](_0x59a12e[_0x979a('0x36')],_0x59a12e[_0x979a('0x37')]);_0x41be30[_0x979a('0x3b')]=_[_0x979a('0x3a')](_0x59a12e[_0x979a('0x36')],qs[_0x979a('0x3c')](_0xcddd8c[_0x979a('0x37')]['fields']));_0x41be30[_0x979a('0x3b')]=_0x41be30[_0x979a('0x3b')][_0x979a('0x3d')]?_0x41be30[_0x979a('0x3b')]:_0x59a12e[_0x979a('0x36')];if(!_0xcddd8c['query'][_0x979a('0x3e')]('nolimit')){_0x41be30[_0x979a('0x23')]=qs[_0x979a('0x23')](_0xcddd8c[_0x979a('0x37')]['limit']);_0x41be30['offset']=qs[_0x979a('0x20')](_0xcddd8c[_0x979a('0x37')]['offset']);}_0x41be30[_0x979a('0x3f')]=qs['sort'](_0xcddd8c[_0x979a('0x37')][_0x979a('0x40')]);_0x41be30['where']=qs['filters'](_['pick'](_0xcddd8c[_0x979a('0x37')],_0x59a12e['filters']),_0x4cc42c);if(_0xcddd8c[_0x979a('0x37')][_0x979a('0x41')]){_0x41be30[_0x979a('0x42')]=_[_0x979a('0x43')](_0x41be30[_0x979a('0x42')],{'$or':_[_0x979a('0x30')](_0x4cc42c,function(_0x251d78){if(_0x251d78['type']!==_0x979a('0x44')){var _0x4c172d={};_0x4c172d[_0x251d78['name']]={'$like':'%'+_0xcddd8c['query']['filter']+'%'};return _0x4c172d;}})});}_0x41be30=_[_0x979a('0x43')]({},_0x41be30,_0xcddd8c[_0x979a('0x45')]);var _0x429d32={'where':_0x41be30[_0x979a('0x42')]};return db['ChatGroup'][_0x979a('0x22')](_0x429d32)[_0x979a('0x28')](function(_0x42dbfe){_0xa8241e[_0x979a('0x22')]=_0x42dbfe;if(_0xcddd8c['query']['includeAll']){_0x41be30[_0x979a('0x46')]=[{'all':!![]}];}return db[_0x979a('0x31')]['findAll'](_0x41be30);})[_0x979a('0x28')](function(_0x17e805){_0xa8241e[_0x979a('0x47')]=_0x17e805;return _0xa8241e;})['then'](respondWithFilteredResult(_0xd17a7f,_0x41be30))[_0x979a('0x48')](handleError(_0xd17a7f,null));};exports[_0x979a('0x49')]=function(_0x496991,_0x2640ea){var _0x5567a1={'raw':!![],'where':{'id':_0x496991[_0x979a('0x4a')]['id']}},_0x5730e7={};_0x5730e7[_0x979a('0x36')]=_[_0x979a('0x38')](db[_0x979a('0x31')][_0x979a('0x32')]);_0x5730e7[_0x979a('0x37')]=_['keys'](_0x496991[_0x979a('0x37')]);_0x5730e7[_0x979a('0x39')]=_[_0x979a('0x3a')](_0x5730e7[_0x979a('0x36')],_0x5730e7['query']);_0x5567a1[_0x979a('0x3b')]=_[_0x979a('0x3a')](_0x5730e7[_0x979a('0x36')],qs[_0x979a('0x3c')](_0x496991[_0x979a('0x37')][_0x979a('0x3c')]));_0x5567a1['attributes']=_0x5567a1[_0x979a('0x3b')][_0x979a('0x3d')]?_0x5567a1[_0x979a('0x3b')]:_0x5730e7[_0x979a('0x36')];if(_0x496991[_0x979a('0x37')][_0x979a('0x4b')]){_0x5567a1[_0x979a('0x46')]=[{'all':!![]}];}_0x5567a1=_[_0x979a('0x43')]({},_0x5567a1,_0x496991['options']);return db[_0x979a('0x31')][_0x979a('0x4c')](_0x5567a1)['then'](handleEntityNotFound(_0x2640ea,null))[_0x979a('0x28')](respondWithResult(_0x2640ea,null))[_0x979a('0x48')](handleError(_0x2640ea,null));};exports[_0x979a('0x4d')]=function(_0x4012f0,_0x23ea5b){return db[_0x979a('0x31')][_0x979a('0x4d')](_0x4012f0[_0x979a('0x4e')],{})[_0x979a('0x28')](respondWithResult(_0x23ea5b,0xc9))[_0x979a('0x48')](handleError(_0x23ea5b,null));};exports[_0x979a('0x27')]=function(_0x521802,_0x5d4519){if(_0x521802['body']['id']){delete _0x521802['body']['id'];}return db[_0x979a('0x31')][_0x979a('0x4c')]({'where':{'id':_0x521802['params']['id']}})[_0x979a('0x28')](handleEntityNotFound(_0x5d4519,null))[_0x979a('0x28')](saveUpdates(_0x521802[_0x979a('0x4e')],null))['then'](respondWithResult(_0x5d4519,null))[_0x979a('0x48')](handleError(_0x5d4519,null));};exports[_0x979a('0x29')]=function(_0x5c6e49,_0x30d3c2){return db[_0x979a('0x31')][_0x979a('0x4c')]({'where':{'id':_0x5c6e49[_0x979a('0x4a')]['id']}})[_0x979a('0x28')](handleEntityNotFound(_0x30d3c2,null))[_0x979a('0x28')](removeEntity(_0x30d3c2,null))[_0x979a('0x48')](handleError(_0x30d3c2,null));};exports[_0x979a('0x4f')]=function(_0x70e87e,_0x132a51){return db['ChatGroup'][_0x979a('0x4f')]()[_0x979a('0x28')](respondWithResult(_0x132a51,null))[_0x979a('0x48')](handleError(_0x132a51,null));};exports[_0x979a('0x50')]=function(_0x1b6953,_0x4de06f,_0x26c74c){return db['ChatInternalMessage'][_0x979a('0x22')]({'where':{'ChatGroupId':_0x1b6953[_0x979a('0x4a')]['id'],'ToId':_0x1b6953[_0x979a('0x51')]['id'],'read':![]}})[_0x979a('0x28')](function(_0x40fe69){return{'id':_[_0x979a('0x52')](_0x1b6953['params']['id']),'count':_0x40fe69};})[_0x979a('0x28')](respondWithResult(_0x4de06f,null))[_0x979a('0x48')](handleError(_0x4de06f,null));};exports[_0x979a('0x53')]=function(_0x1f19bc,_0x263e42,_0x5835b9){return db[_0x979a('0x31')][_0x979a('0x4c')]({'where':{'id':_0x1f19bc[_0x979a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x263e42,null))['then'](function(_0x2575d4){if(_0x2575d4){return _0x2575d4[_0x979a('0x53')](_0x1f19bc[_0x979a('0x4e')][_0x979a('0x54')],_['omit'](_0x1f19bc[_0x979a('0x4e')],[_0x979a('0x54'),'id'])||{});}})[_0x979a('0x28')](respondWithResult(_0x263e42,null))[_0x979a('0x48')](handleError(_0x263e42,null));};exports[_0x979a('0x55')]=function(_0x514c46,_0x212f30,_0x2b2808){var _0x4c05a6={};var _0x5c9cc2={};var _0x2b5da3;var _0x3d8562;return db[_0x979a('0x31')][_0x979a('0x56')]({'where':{'id':_0x514c46[_0x979a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x212f30,null))[_0x979a('0x28')](function(_0x3f1324){if(_0x3f1324){_0x2b5da3=_0x3f1324;_0x5c9cc2[_0x979a('0x36')]=_[_0x979a('0x38')](db[_0x979a('0x57')][_0x979a('0x32')]);_0x5c9cc2[_0x979a('0x37')]=_['keys'](_0x514c46[_0x979a('0x37')]);_0x5c9cc2['filters']=_[_0x979a('0x3a')](_0x5c9cc2[_0x979a('0x36')],_0x5c9cc2[_0x979a('0x37')]);_0x4c05a6[_0x979a('0x3b')]=_[_0x979a('0x3a')](_0x5c9cc2['model'],qs['fields'](_0x514c46[_0x979a('0x37')][_0x979a('0x3c')]));_0x4c05a6['attributes']=_0x4c05a6[_0x979a('0x3b')][_0x979a('0x3d')]?_0x4c05a6['attributes']:_0x5c9cc2[_0x979a('0x36')];_0x4c05a6[_0x979a('0x3f')]=qs['sort'](_0x514c46['query'][_0x979a('0x40')]);_0x4c05a6['where']=qs[_0x979a('0x39')](_['pick'](_0x514c46['query'],_0x5c9cc2[_0x979a('0x39')]));if(_0x514c46[_0x979a('0x37')][_0x979a('0x41')]){_0x4c05a6[_0x979a('0x42')]=_[_0x979a('0x43')](_0x4c05a6[_0x979a('0x42')],{'$or':_[_0x979a('0x30')](_0x4c05a6['attributes'],function(_0x2a902f){var _0xba68d4={};_0xba68d4[_0x2a902f]={'$like':'%'+_0x514c46[_0x979a('0x37')][_0x979a('0x41')]+'%'};return _0xba68d4;})});}_0x4c05a6=_[_0x979a('0x43')]({},_0x4c05a6,_0x514c46[_0x979a('0x45')]);return _0x2b5da3[_0x979a('0x55')](_0x4c05a6);}})[_0x979a('0x28')](function(_0x152f65){if(_0x152f65){_0x3d8562=_0x152f65['length'];if(!_0x514c46[_0x979a('0x37')][_0x979a('0x3e')](_0x979a('0x58'))){_0x4c05a6['limit']=qs[_0x979a('0x23')](_0x514c46[_0x979a('0x37')][_0x979a('0x23')]);_0x4c05a6['offset']=qs[_0x979a('0x20')](_0x514c46[_0x979a('0x37')]['offset']);}return _0x2b5da3['getMembers'](_0x4c05a6);}})[_0x979a('0x28')](function(_0x476eae){if(_0x476eae){return _0x476eae?{'count':_0x3d8562,'rows':_0x476eae}:null;}})[_0x979a('0x28')](respondWithResult(_0x212f30,null))[_0x979a('0x48')](handleError(_0x212f30,null));};exports[_0x979a('0x59')]=function(_0x53a417,_0x3aed71,_0x301926){return db[_0x979a('0x31')][_0x979a('0x4c')]({'where':{'id':_0x53a417[_0x979a('0x4a')]['id']}})[_0x979a('0x28')](handleEntityNotFound(_0x3aed71,null))[_0x979a('0x28')](function(_0x1baf98){if(_0x1baf98){return _0x1baf98[_0x979a('0x59')](_0x53a417[_0x979a('0x37')][_0x979a('0x54')]);}})[_0x979a('0x28')](respondWithStatusCode(_0x3aed71,null))[_0x979a('0x48')](handleError(_0x3aed71,null));};exports[_0x979a('0x5a')]=function(_0x58d74a,_0x467c2c,_0x31d412){if(_0x58d74a['body']['id']){delete _0x58d74a[_0x979a('0x4e')]['id'];}return db[_0x979a('0x31')][_0x979a('0x4c')]({'where':{'id':_0x58d74a['params']['id']}})[_0x979a('0x28')](handleEntityNotFound(_0x467c2c,null))['then'](function(_0x13b27d){if(_0x13b27d){_0x58d74a[_0x979a('0x4e')][_0x979a('0x5b')]=_0x13b27d['id'];return db['ChatInternalMessage']['create'](_0x58d74a[_0x979a('0x4e')]);}})['then'](respondWithResult(_0x467c2c,null))['catch'](handleError(_0x467c2c,null));};exports['getMessages']=function(_0xa596d7,_0x14d824,_0x20f47e){var _0x3c2b10={};var _0x21023b={};var _0x551094;var _0x3fc648;return db[_0x979a('0x31')]['findOne']({'where':{'id':_0xa596d7[_0x979a('0x4a')]['id']}})[_0x979a('0x28')](handleEntityNotFound(_0x14d824,null))[_0x979a('0x28')](function(_0x8cdd4){if(_0x8cdd4){_0x551094=_0x8cdd4;_0x21023b[_0x979a('0x36')]=_[_0x979a('0x38')](db[_0x979a('0x5c')][_0x979a('0x32')]);_0x21023b[_0x979a('0x37')]=_[_0x979a('0x38')](_0xa596d7['query']);_0x21023b[_0x979a('0x39')]=_[_0x979a('0x3a')](_0x21023b[_0x979a('0x36')],_0x21023b[_0x979a('0x37')]);_0x3c2b10['attributes']=_['intersection'](_0x21023b[_0x979a('0x36')],qs[_0x979a('0x3c')](_0xa596d7[_0x979a('0x37')][_0x979a('0x3c')]));_0x3c2b10[_0x979a('0x3b')]=_0x3c2b10[_0x979a('0x3b')]['length']?_0x3c2b10[_0x979a('0x3b')]:_0x21023b[_0x979a('0x36')];_0x3c2b10[_0x979a('0x3f')]=qs[_0x979a('0x40')](_0xa596d7[_0x979a('0x37')][_0x979a('0x40')]);_0x3c2b10[_0x979a('0x42')]=qs['filters'](_[_0x979a('0x5d')](_0xa596d7[_0x979a('0x37')],_0x21023b['filters']));if(_0xa596d7[_0x979a('0x37')]['filter']){_0x3c2b10['where']=_['merge'](_0x3c2b10[_0x979a('0x42')],{'$or':_[_0x979a('0x30')](_0x3c2b10[_0x979a('0x3b')],function(_0x496c46){var _0x5968d8={};_0x5968d8[_0x496c46]={'$like':'%'+_0xa596d7[_0x979a('0x37')]['filter']+'%'};return _0x5968d8;})});}if(_0xa596d7[_0x979a('0x37')][_0x979a('0x5e')]){var _0x4fe262=_0xa596d7['query'][_0x979a('0x5e')]['split'](',');var _0x1b7d61={};_0x1b7d61[_0x4fe262[0x0]]={'$gte':moment(_0x4fe262[0x1])[_0x979a('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3c2b10[_0x979a('0x42')]=_[_0x979a('0x43')](_0x3c2b10[_0x979a('0x42')],_0x1b7d61);}_0x3c2b10=_[_0x979a('0x43')]({},_0x3c2b10,_0xa596d7['options']);return _0x551094[_0x979a('0x60')](_0x3c2b10);}})[_0x979a('0x28')](function(_0xf60a4d){if(_0xf60a4d){_0x3fc648=_0xf60a4d[_0x979a('0x3d')];if(!_0xa596d7[_0x979a('0x37')][_0x979a('0x3e')]('nolimit')){_0x3c2b10['limit']=qs[_0x979a('0x23')](_0xa596d7[_0x979a('0x37')][_0x979a('0x23')]);_0x3c2b10[_0x979a('0x20')]=qs['offset'](_0xa596d7[_0x979a('0x37')][_0x979a('0x20')]);}return _0x551094[_0x979a('0x60')](_0x3c2b10);}})[_0x979a('0x28')](function(_0x3dc27e){if(_0x3dc27e){return _0x3dc27e?{'count':_0x3fc648,'rows':_0x3dc27e}:null;}})[_0x979a('0x28')](respondWithResult(_0x14d824,null))[_0x979a('0x48')](handleError(_0x14d824,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e855f55..92bb089 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 _0xfba2=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1c5896,_0x34e0b1){var _0x91aaff=function(_0x2f05bf){while(--_0x2f05bf){_0x1c5896['push'](_0x1c5896['shift']());}};_0x91aaff(++_0x34e0b1);}(_0xfba2,0xf9));var _0x2fba=function(_0x1d751f,_0xcac928){_0x1d751f=_0x1d751f-0x0;var _0x162d5f=_0xfba2[_0x1d751f];return _0x162d5f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2fba('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2fba('0x1')](0x0);var events={'afterCreate':_0x2fba('0x2'),'afterUpdate':_0x2fba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2db851){return function(_0x3eef22,_0x233e9c,_0x16c6ed){ChatGroupEvents[_0x2fba('0x4')](_0x2db851+':'+_0x3eef22['id'],_0x3eef22);ChatGroupEvents['emit'](_0x2db851,_0x3eef22);_0x16c6ed(null);};}for(var e in events){if(events[_0x2fba('0x5')](e)){var event=events[e];ChatGroup[_0x2fba('0x6')](e,emitEvent(event));}}module[_0x2fba('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x157f=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0x157f,0xd2));var _0xf157=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x157f[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xf157('0x0'));var ChatGroup=require(_0xf157('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf157('0x2')](0x0);var events={'afterCreate':_0xf157('0x3'),'afterUpdate':_0xf157('0x4'),'afterDestroy':_0xf157('0x5')};function emitEvent(_0x19d725){return function(_0x6920cf,_0x34a187,_0x248c09){ChatGroupEvents[_0xf157('0x6')](_0x19d725+':'+_0x6920cf['id'],_0x6920cf);ChatGroupEvents[_0xf157('0x6')](_0x19d725,_0x6920cf);_0x248c09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xf157('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1fae7cb..38c0bb4 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 _0xfa2b=['moment','bluebird','request-promise','path','rimraf','exports','ChatGroup','lodash','util','../../config/logger','api'];(function(_0x165ec6,_0x2d6664){var _0x3c475a=function(_0x4ebfdd){while(--_0x4ebfdd){_0x165ec6['push'](_0x165ec6['shift']());}};_0x3c475a(++_0x2d6664);}(_0xfa2b,0x1ca));var _0xbfa2=function(_0x3b0bb4,_0x32a3ac){_0x3b0bb4=_0x3b0bb4-0x0;var _0x57e927=_0xfa2b[_0x3b0bb4];return _0x57e927;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbfa2('0x9')]=function(_0x2fdd37,_0x39f154){return _0x2fdd37['define'](_0xbfa2('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d9b=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define'];(function(_0x6cf3b6,_0x4b7560){var _0xdbe948=function(_0x1504d6){while(--_0x1504d6){_0x6cf3b6['push'](_0x6cf3b6['shift']());}};_0xdbe948(++_0x4b7560);}(_0x2d9b,0x19a));var _0xb2d9=function(_0x3d77d9,_0x19e90a){_0x3d77d9=_0x3d77d9-0x0;var _0x2a12a0=_0x2d9b[_0x3d77d9];return _0x2a12a0;};'use strict';var _=require(_0xb2d9('0x0'));var util=require('util');var logger=require(_0xb2d9('0x1'))('api');var moment=require(_0xb2d9('0x2'));var BPromise=require(_0xb2d9('0x3'));var rp=require(_0xb2d9('0x4'));var fs=require('fs');var path=require(_0xb2d9('0x5'));var rimraf=require(_0xb2d9('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2d9('0x7'));module[_0xb2d9('0x8')]=function(_0x2b2822,_0x462635){return _0x2b2822[_0xb2d9('0x9')]('ChatGroup',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 3447f31..e906121 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 _0x3204=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc844cd,_0x1d55f8){var _0xb85fc7=function(_0xb0b367){while(--_0xb0b367){_0xc844cd['push'](_0xc844cd['shift']());}};_0xb85fc7(++_0x1d55f8);}(_0x3204,0x12e));var _0x4320=function(_0x43a8ff,_0x28ee24){_0x43a8ff=_0x43a8ff-0x0;var _0x44558b=_0x3204[_0x43a8ff];return _0x44558b;};'use strict';var _=require(_0x4320('0x0'));var util=require(_0x4320('0x1'));var moment=require(_0x4320('0x2'));var BPromise=require(_0x4320('0x3'));var rs=require(_0x4320('0x4'));var fs=require('fs');var Redis=require(_0x4320('0x5'));var db=require(_0x4320('0x6'))['db'];var utils=require(_0x4320('0x7'));var logger=require(_0x4320('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4320('0x9'));var client=jayson[_0x4320('0xa')][_0x4320('0xb')]({'port':0x232a});config[_0x4320('0xc')]=_[_0x4320('0xd')](config[_0x4320('0xc')],{'host':_0x4320('0xe'),'port':0x18eb});var socket=require(_0x4320('0xf'))(new Redis(config[_0x4320('0xc')]));require('./chatGroup.socket')[_0x4320('0x10')](socket);function respondWithRpcPromise(_0x2b8f99,_0x33a378,_0x245419){return new BPromise(function(_0x5142c8,_0x3cc8cd){return client[_0x4320('0x11')](_0x2b8f99,_0x245419)['then'](function(_0x505b60){logger['info'](_0x4320('0x12'),_0x33a378,_0x4320('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x33a378,_0x4320('0x13'),JSON[_0x4320('0x14')](_0x505b60));if(_0x505b60[_0x4320('0x15')]){if(_0x505b60[_0x4320('0x15')][_0x4320('0x16')]===0x1f4){logger[_0x4320('0x15')]('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x505b60['error'][_0x4320('0x17')]);return _0x3cc8cd(_0x505b60[_0x4320('0x15')][_0x4320('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x505b60['error'][_0x4320('0x17')]);return _0x5142c8(_0x505b60[_0x4320('0x15')][_0x4320('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x4320('0x13'));_0x5142c8(_0x505b60[_0x4320('0x18')][_0x4320('0x17')]);}})['catch'](function(_0x436e6d){logger['error'](_0x4320('0x12'),_0x33a378,_0x436e6d);_0x3cc8cd(_0x436e6d);});});}
\ No newline at end of file
+var _0xc688=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','defaults','socket.io-emitter','redis','register','then','info','request\x20sent'];(function(_0x42f1eb,_0x5364a2){var _0x51ac7f=function(_0x40b1c0){while(--_0x40b1c0){_0x42f1eb['push'](_0x42f1eb['shift']());}};_0x51ac7f(++_0x5364a2);}(_0xc688,0xc0));var _0x8c68=function(_0x4e9552,_0x2c65b5){_0x4e9552=_0x4e9552-0x0;var _0x27fd4a=_0xc688[_0x4e9552];return _0x27fd4a;};'use strict';var _=require(_0x8c68('0x0'));var util=require(_0x8c68('0x1'));var moment=require('moment');var BPromise=require(_0x8c68('0x2'));var rs=require(_0x8c68('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c68('0x4'))['db'];var utils=require(_0x8c68('0x5'));var logger=require('../../config/logger')(_0x8c68('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c68('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8c68('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c68('0x9'))(new Redis(config[_0x8c68('0xa')]));require('./chatGroup.socket')[_0x8c68('0xb')](socket);function respondWithRpcPromise(_0x531bf2,_0xc29a6e,_0x150f09){return new BPromise(function(_0xcb9bee,_0x96f2f1){return client['request'](_0x531bf2,_0x150f09)[_0x8c68('0xc')](function(_0x3c97ea){logger[_0x8c68('0xd')]('ChatGroup,\x20%s,\x20%s',_0xc29a6e,_0x8c68('0xe'));logger[_0x8c68('0xf')](_0x8c68('0x10'),_0xc29a6e,_0x8c68('0xe'),JSON[_0x8c68('0x11')](_0x3c97ea));if(_0x3c97ea[_0x8c68('0x12')]){if(_0x3c97ea[_0x8c68('0x12')][_0x8c68('0x13')]===0x1f4){logger[_0x8c68('0x12')]('ChatGroup,\x20%s,\x20%s',_0xc29a6e,_0x3c97ea[_0x8c68('0x12')]['message']);return _0x96f2f1(_0x3c97ea[_0x8c68('0x12')]['message']);}logger['error'](_0x8c68('0x14'),_0xc29a6e,_0x3c97ea['error'][_0x8c68('0x15')]);return _0xcb9bee(_0x3c97ea[_0x8c68('0x12')][_0x8c68('0x15')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xc29a6e,_0x8c68('0xe'));_0xcb9bee(_0x3c97ea['result'][_0x8c68('0x15')]);}})[_0x8c68('0x16')](function(_0x1b6e32){logger['error'](_0x8c68('0x14'),_0xc29a6e,_0x1b6e32);_0x96f2f1(_0x1b6e32);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index b9fdd2d..d8b6c14 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 _0x156d=['./chatGroup.events','save','remove','update','register','length','chatGroup:'];(function(_0xd3b64b,_0x189e4a){var _0x4d24ab=function(_0x9efedf){while(--_0x9efedf){_0xd3b64b['push'](_0xd3b64b['shift']());}};_0x4d24ab(++_0x189e4a);}(_0x156d,0x1c0));var _0xd156=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x156d[_0x4b369d];return _0x571a98;};'use strict';var ChatGroupEvents=require(_0xd156('0x0'));var events=[_0xd156('0x1'),_0xd156('0x2'),_0xd156('0x3')];function createListener(_0xec20ea,_0x256dd3){return function(_0x4b7a40){_0x256dd3['emit'](_0xec20ea,_0x4b7a40);};}function removeListener(_0xeed629,_0x3280a8){return function(){ChatGroupEvents['removeListener'](_0xeed629,_0x3280a8);};}exports[_0xd156('0x4')]=function(_0x5ce1d6){for(var _0x157a77=0x0,_0x258561=events[_0xd156('0x5')];_0x157a77<_0x258561;_0x157a77++){var _0x23ed99=events[_0x157a77];var _0x44cc2b=createListener(_0xd156('0x6')+_0x23ed99,_0x5ce1d6);ChatGroupEvents['on'](_0x23ed99,_0x44cc2b);}};
\ No newline at end of file
+var _0x4711=['./chatGroup.events','save','remove','emit','removeListener','register','chatGroup:'];(function(_0x56464a,_0x3551ba){var _0x25a4a9=function(_0x1bf19d){while(--_0x1bf19d){_0x56464a['push'](_0x56464a['shift']());}};_0x25a4a9(++_0x3551ba);}(_0x4711,0x70));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var ChatGroupEvents=require(_0x1471('0x0'));var events=[_0x1471('0x1'),_0x1471('0x2'),'update'];function createListener(_0x486e4f,_0x36da61){return function(_0x33d7ac){_0x36da61[_0x1471('0x3')](_0x486e4f,_0x33d7ac);};}function removeListener(_0x1dba49,_0x29e02e){return function(){ChatGroupEvents[_0x1471('0x4')](_0x1dba49,_0x29e02e);};}exports[_0x1471('0x5')]=function(_0x562387){for(var _0x15db41=0x0,_0x89dd0=events['length'];_0x15db41<_0x89dd0;_0x15db41++){var _0x1ec66b=events[_0x15db41];var _0x4bd634=createListener(_0x1471('0x6')+_0x1ec66b,_0x562387);ChatGroupEvents['on'](_0x1ec66b,_0x4bd634);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1072bb8..028442a 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 _0x47f7=['./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','post','create','addMembers','put','update','delete','removeMembers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2efd54,_0x241172){var _0x3f923e=function(_0x3cfd1d){while(--_0x3cfd1d){_0x2efd54['push'](_0x2efd54['shift']());}};_0x3f923e(++_0x241172);}(_0x47f7,0x17f));var _0x747f=function(_0x36ac6b,_0x5eba33){_0x36ac6b=_0x36ac6b-0x0;var _0x3068db=_0x47f7[_0x36ac6b];return _0x3068db;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x747f('0x0'));var timeout=require(_0x747f('0x1'));var express=require(_0x747f('0x2'));var router=express[_0x747f('0x3')]();var fs_extra=require(_0x747f('0x4'));var auth=require(_0x747f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x747f('0x6'));var controller=require(_0x747f('0x7'));router[_0x747f('0x8')]('/',auth[_0x747f('0x9')](),controller['index']);router[_0x747f('0x8')](_0x747f('0xa'),auth[_0x747f('0x9')](),controller[_0x747f('0xb')]);router[_0x747f('0x8')](_0x747f('0xc'),auth[_0x747f('0x9')](),controller[_0x747f('0xd')]);router[_0x747f('0x8')](_0x747f('0xe'),auth[_0x747f('0x9')](),controller[_0x747f('0xf')]);router[_0x747f('0x8')](_0x747f('0x10'),auth[_0x747f('0x9')](),controller['getMembers']);router[_0x747f('0x8')](_0x747f('0x11'),auth[_0x747f('0x9')](),controller['getMessages']);router[_0x747f('0x12')]('/',auth[_0x747f('0x9')](),controller[_0x747f('0x13')]);router[_0x747f('0x12')](_0x747f('0x10'),auth[_0x747f('0x9')](),controller[_0x747f('0x14')]);router[_0x747f('0x12')](_0x747f('0x11'),auth[_0x747f('0x9')](),controller['addMessage']);router[_0x747f('0x15')](_0x747f('0xc'),auth['isAuthenticated'](),controller[_0x747f('0x16')]);router[_0x747f('0x17')](_0x747f('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0x747f('0x9')](),controller[_0x747f('0x18')]);module[_0x747f('0x19')]=router;
\ No newline at end of file
+var _0xddd2=['create','post','addMembers','addMessage','put','update','/:id','destroy','delete','removeMembers','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages'];(function(_0x4c6df4,_0x503373){var _0x2409c3=function(_0x22a0cf){while(--_0x22a0cf){_0x4c6df4['push'](_0x4c6df4['shift']());}};_0x2409c3(++_0x503373);}(_0xddd2,0xfb));var _0x2ddd=function(_0x1f3e80,_0x19e38f){_0x1f3e80=_0x1f3e80-0x0;var _0x4455a2=_0xddd2[_0x1f3e80];return _0x4455a2;};'use strict';var multer=require(_0x2ddd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ddd('0x1'));var express=require(_0x2ddd('0x2'));var router=express['Router']();var fs_extra=require(_0x2ddd('0x3'));var auth=require(_0x2ddd('0x4'));var interaction=require(_0x2ddd('0x5'));var config=require(_0x2ddd('0x6'));var controller=require(_0x2ddd('0x7'));router[_0x2ddd('0x8')]('/',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0xa')]);router[_0x2ddd('0x8')](_0x2ddd('0xb'),auth[_0x2ddd('0x9')](),controller[_0x2ddd('0xc')]);router[_0x2ddd('0x8')]('/:id',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0xd')]);router[_0x2ddd('0x8')](_0x2ddd('0xe'),auth[_0x2ddd('0x9')](),controller[_0x2ddd('0xf')]);router[_0x2ddd('0x8')]('/:id/members',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x10')]);router[_0x2ddd('0x8')](_0x2ddd('0x11'),auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x12')]);router['post']('/',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x13')]);router[_0x2ddd('0x14')]('/:id/members',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x15')]);router[_0x2ddd('0x14')](_0x2ddd('0x11'),auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x16')]);router[_0x2ddd('0x17')]('/:id',auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x18')]);router['delete'](_0x2ddd('0x19'),auth[_0x2ddd('0x9')](),controller[_0x2ddd('0x1a')]);router[_0x2ddd('0x1b')]('/:id/members',auth['isAuthenticated'](),controller[_0x2ddd('0x1c')]);module[_0x2ddd('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 2001151..0d5c683 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 _0x0ed1=['out','BOOLEAN','INTEGER','exports','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x0ed1,0x99));var _0x10ed=function(_0x29854a,_0x4d43bb){_0x29854a=_0x29854a-0x0;var _0x357e4b=_0x0ed1[_0x29854a];return _0x357e4b;};'use strict';var Sequelize=require('sequelize');module[_0x10ed('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x10ed('0x1')](_0x10ed('0x2'),'thumb'),'defaultValue':_0x10ed('0x2')},'ratingMessage':{'type':Sequelize[_0x10ed('0x3')]},'pathTranscript':{'type':Sequelize[_0x10ed('0x3')]},'mailTranscript':{'type':Sequelize[_0x10ed('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10ed('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x10ed('0x4')]},'thirdDisposition':{'type':Sequelize[_0x10ed('0x4')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x10ed('0x4')]},'browserVersion':{'type':Sequelize[_0x10ed('0x4')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x10ed('0x4')]},'deviceModel':{'type':Sequelize[_0x10ed('0x4')]},'deviceVendor':{'type':Sequelize[_0x10ed('0x4')]},'deviceType':{'type':Sequelize[_0x10ed('0x4')]},'referer':{'type':Sequelize[_0x10ed('0x3')]},'customerIp':{'type':Sequelize[_0x10ed('0x4')]},'formData':{'type':Sequelize[_0x10ed('0x3')](_0x10ed('0x6'))},'read1stAt':{'type':Sequelize[_0x10ed('0x5')]},'lastMsgAt':{'type':Sequelize[_0x10ed('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x10ed('0x1')]('in',_0x10ed('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10ed('0x4')]},'customerPort':{'type':Sequelize[_0x10ed('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x10ed('0x8')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x10ed('0x9')]}};
\ No newline at end of file
+var _0x30bb=['BOOLEAN','INTEGER','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x30bb,0xfd));var _0xb30b=function(_0x513c7d,_0x2b5369){_0x513c7d=_0x513c7d-0x0;var _0x59722=_0x30bb[_0x513c7d];return _0x59722;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb30b('0x0')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xb30b('0x1')),'defaultValue':_0xb30b('0x2')},'ratingMessage':{'type':Sequelize[_0xb30b('0x3')]},'pathTranscript':{'type':Sequelize[_0xb30b('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb30b('0x4')]},'disposition':{'type':Sequelize[_0xb30b('0x5')]},'secondDisposition':{'type':Sequelize[_0xb30b('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb30b('0x5')]},'browserName':{'type':Sequelize[_0xb30b('0x5')]},'browserVersion':{'type':Sequelize[_0xb30b('0x5')]},'osName':{'type':Sequelize[_0xb30b('0x5')]},'osVersion':{'type':Sequelize[_0xb30b('0x5')]},'deviceModel':{'type':Sequelize[_0xb30b('0x5')]},'deviceVendor':{'type':Sequelize[_0xb30b('0x5')]},'deviceType':{'type':Sequelize[_0xb30b('0x5')]},'referer':{'type':Sequelize[_0xb30b('0x3')]},'customerIp':{'type':Sequelize[_0xb30b('0x5')]},'formData':{'type':Sequelize[_0xb30b('0x3')](_0xb30b('0x6'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xb30b('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb30b('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb30b('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xb30b('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xb30b('0x8')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 72f6346..82d11b5 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 _0xe6aa=['removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','ChatWebsite','Account','Owner','mkdirSync','Chat','createdAt','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','out','Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','bluebird','mustache','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','update','name','render','body','contact','agent','account','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','model','ChatInteraction','keys','attributes','intersection','fields','options','find','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','email','isNull','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','closed','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','ContactId','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','ids','getMessages','filters','length','hasOwnProperty','nolimit','sort','where','merge','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','order','pick','ChatInteractionId','secret','includeAgent','includeAll','addTags','spread','Tag','color','emit','chatInteractionTags:save'];(function(_0x58bbeb,_0x19caf1){var _0x5d9f3e=function(_0x27e100){while(--_0x27e100){_0x58bbeb['push'](_0x58bbeb['shift']());}};_0x5d9f3e(++_0x19caf1);}(_0xe6aa,0x1ca));var _0xae6a=function(_0x123dba,_0x58ff2d){_0x123dba=_0x123dba-0x0;var _0x41b42d=_0xe6aa[_0x123dba];return _0x41b42d;};'use strict';var rimraf=require(_0xae6a('0x0'));var zipdir=require('zip-dir');var rp=require(_0xae6a('0x1'));var moment=require('moment');var BPromise=require(_0xae6a('0x2'));var Mustache=require(_0xae6a('0x3'));var util=require('util');var path=require(_0xae6a('0x4'));var ejs=require(_0xae6a('0x5'));var fs=require('fs');var _=require(_0xae6a('0x6'));var Redis=require('ioredis');var interaction=require(_0xae6a('0x7'));var qs=require(_0xae6a('0x8'));var pdf=require(_0xae6a('0x9'));var logger=require(_0xae6a('0xa'))('api');var config=require(_0xae6a('0xb'));var db=require(_0xae6a('0xc'))['db'];config['redis']=_[_0xae6a('0xd')](config[_0xae6a('0xe')],{'host':_0xae6a('0xf'),'port':0x18eb});var socket=require(_0xae6a('0x10'))(new Redis(config[_0xae6a('0xe')]));require(_0xae6a('0x11'))[_0xae6a('0x12')](socket);var jayson=require(_0xae6a('0x13'));var client=jayson['client'][_0xae6a('0x14')]({'port':0x232b});var client9004=jayson[_0xae6a('0x15')][_0xae6a('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x4998fd,_0x26572c,_0x148261,_0xb30f94){return new BPromise(function(_0x50d0d5,_0x31527a){var _0x3990cf=_0xb30f94||client;return _0x3990cf[_0xae6a('0x16')](_0x4998fd,_0x148261)[_0xae6a('0x17')](function(_0x1c0015){logger[_0xae6a('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x26572c,_0xae6a('0x19'));logger[_0xae6a('0x1a')](_0xae6a('0x1b'),_0x26572c,_0xae6a('0x19'),JSON[_0xae6a('0x1c')](_0x1c0015));if(_0x1c0015[_0xae6a('0x1d')]){if(_0x1c0015[_0xae6a('0x1d')]['code']===0x1f4){logger['error'](_0xae6a('0x1e'),_0x26572c,_0x1c0015['error'][_0xae6a('0x1f')]);return _0x31527a(_0x1c0015[_0xae6a('0x1d')][_0xae6a('0x1f')]);}logger[_0xae6a('0x1d')](_0xae6a('0x1e'),_0x26572c,_0x1c0015['error']['message']);return _0x50d0d5(_0x1c0015[_0xae6a('0x1d')][_0xae6a('0x1f')]);}else{logger[_0xae6a('0x18')](_0xae6a('0x1e'),_0x26572c,_0xae6a('0x19'));_0x50d0d5(_0x1c0015[_0xae6a('0x20')][_0xae6a('0x1f')]);}})[_0xae6a('0x21')](function(_0x26e83f){logger[_0xae6a('0x1d')](_0xae6a('0x1e'),_0x26572c,_0x26e83f);_0x31527a(_0x26e83f);});});}function respondWithStatusCode(_0x5b71f1,_0x554db7){_0x554db7=_0x554db7||0xcc;return function(_0x4aab98){if(_0x4aab98){return _0x5b71f1[_0xae6a('0x22')](_0x554db7);}return _0x5b71f1[_0xae6a('0x23')](_0x554db7)[_0xae6a('0x24')]();};}function respondWithResult(_0x423a54,_0x28ceff){_0x28ceff=_0x28ceff||0xc8;return function(_0x32724b){if(_0x32724b){return _0x423a54['status'](_0x28ceff)[_0xae6a('0x25')](_0x32724b);}};}function respondWithFilteredResult(_0x5df151,_0x2bb3f4){return function(_0x30968b){if(_0x30968b){var _0x266eab=typeof _0x2bb3f4[_0xae6a('0x26')]==='undefined'&&typeof _0x2bb3f4['limit']===_0xae6a('0x27');var _0x4d2725=_0x30968b[_0xae6a('0x28')];var _0x29ae99=_0x266eab?0x0:_0x2bb3f4[_0xae6a('0x26')];var _0x14213e=_0x266eab?_0x30968b[_0xae6a('0x28')]:_0x2bb3f4['offset']+_0x2bb3f4[_0xae6a('0x29')];var _0x2d70ca;if(_0x14213e>=_0x4d2725){_0x14213e=_0x4d2725;_0x2d70ca=0xc8;}else{_0x2d70ca=0xce;}_0x5df151[_0xae6a('0x23')](_0x2d70ca);return _0x5df151['set']('Content-Range',_0x29ae99+'-'+_0x14213e+'/'+_0x4d2725)[_0xae6a('0x25')](_0x30968b);}return null;};}function saveUpdates(_0x36b8af){return function(_0x23980d){if(_0x23980d){return _0x23980d[_0xae6a('0x2a')](_0x36b8af)[_0xae6a('0x17')](function(_0x2cee1e){return _0x2cee1e;});}return null;};}function removeEntity(_0x1a1f2b){return function(_0x4ae06f){if(_0x4ae06f){return _0x4ae06f['destroy']()[_0xae6a('0x17')](function(){_0x1a1f2b[_0xae6a('0x23')](0xcc)[_0xae6a('0x24')]();});}};}function handleEntityNotFound(_0x1cc51f){return function(_0x3a74e1){if(!_0x3a74e1){_0x1cc51f[_0xae6a('0x22')](0x194);}return _0x3a74e1;};}function handleError(_0x3793e0,_0x208af8){_0x208af8=_0x208af8||0x1f4;return function(_0x3dfbfa){logger[_0xae6a('0x1d')](_0x3dfbfa['stack']);if(_0x3dfbfa[_0xae6a('0x2b')]){delete _0x3dfbfa[_0xae6a('0x2b')];}_0x3793e0[_0xae6a('0x23')](_0x208af8)['send'](_0x3dfbfa);};}function getMustacheRender(_0x56c778,_0xd75e0){return Mustache[_0xae6a('0x2c')](_0x56c778,_['merge'](_0xd75e0[_0xae6a('0x2d')],{'contact':_0xd75e0[_0xae6a('0x2e')],'message':_0xd75e0[_0xae6a('0x1f')],'agent':_0xd75e0[_0xae6a('0x2f')],'interaction':_0xd75e0['interaction'],'account':_0xd75e0[_0xae6a('0x30')]}))||'';}exports['index']=function(_0x592cc4,_0x264e3a){var _0x210645={};var _0x14582f=_['map'](db['ChatInteraction'][_0xae6a('0x31')],function(_0x29bff6){return{'name':_0x29bff6[_0xae6a('0x32')],'type':_0x29bff6[_0xae6a('0x33')][_0xae6a('0x34')]};});_0x210645=qs['getOptions'](_0x14582f,_0x592cc4);return interaction[_0xae6a('0x35')](_0xae6a('0x36'),_0x592cc4[_0xae6a('0x37')],_0x592cc4[_0xae6a('0x38')],_0x210645,_0x14582f)[_0xae6a('0x17')](respondWithFilteredResult(_0x264e3a,_0x210645))[_0xae6a('0x21')](handleError(_0x264e3a,null));};exports[_0xae6a('0x39')]=function(_0x418f48,_0x1c5d79){var _0x92015a={'raw':![],'where':{'id':_0x418f48['params']['id']}},_0x4059b9={};_0x4059b9[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x3b')]['rawAttributes']);_0x4059b9[_0xae6a('0x37')]=_[_0xae6a('0x3c')](_0x418f48['query']);_0x4059b9['filters']=_['intersection'](_0x4059b9[_0xae6a('0x3a')],_0x4059b9[_0xae6a('0x37')]);_0x92015a[_0xae6a('0x3d')]=_[_0xae6a('0x3e')](_0x4059b9[_0xae6a('0x3a')],qs[_0xae6a('0x3f')](_0x418f48[_0xae6a('0x37')][_0xae6a('0x3f')]));_0x92015a['attributes']=_0x92015a[_0xae6a('0x3d')]['length']?_0x92015a[_0xae6a('0x3d')]:_0x4059b9[_0xae6a('0x3a')];if(_0x418f48[_0xae6a('0x37')]['includeAll']){_0x92015a['include']=[{'all':!![]}];}_0x92015a=_['merge']({},_0x92015a,_0x418f48[_0xae6a('0x40')]);return db[_0xae6a('0x3b')][_0xae6a('0x41')](_0x92015a)['then'](handleEntityNotFound(_0x1c5d79,null))['then'](respondWithResult(_0x1c5d79,null))['catch'](handleError(_0x1c5d79,null));};exports[_0xae6a('0x42')]=function(_0x4c25ab,_0x3b0b9a){return db[_0xae6a('0x3b')][_0xae6a('0x42')](_0x4c25ab[_0xae6a('0x2d')],{})[_0xae6a('0x17')](respondWithResult(_0x3b0b9a,0xc9))['catch'](handleError(_0x3b0b9a,null));};exports[_0xae6a('0x2a')]=function(_0x10af07,_0x22941f){if(_0x10af07[_0xae6a('0x2d')]['id']){delete _0x10af07[_0xae6a('0x2d')]['id'];}return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x10af07[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x22941f,null))['then'](saveUpdates(_0x10af07[_0xae6a('0x2d')],null))[_0xae6a('0x17')](respondWithResult(_0x22941f,null))['catch'](handleError(_0x22941f,null));};exports[_0xae6a('0x44')]=function(_0xce0a7e,_0x383d28){return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0xce0a7e[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x383d28,null))[_0xae6a('0x17')](removeEntity(_0x383d28,null))[_0xae6a('0x21')](handleError(_0x383d28,null));};exports[_0xae6a('0x45')]=function(_0x2b2ab7,_0xdb6106){return db['ChatInteraction'][_0xae6a('0x45')]()[_0xae6a('0x17')](respondWithResult(_0xdb6106,null))['catch'](handleError(_0xdb6106,null));};exports[_0xae6a('0x46')]=function(_0x3bc6e7,_0x381ed0){var _0x471c10=_0x3bc6e7[_0xae6a('0x43')]['id'];var _0x1c1bb2;var _0xbfef90;var _0x290da0;return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0x471c10}})[_0xae6a('0x17')](function(_0x450b2e){_0x1c1bb2=_0x450b2e;return db['ChatWebsite'][_0xae6a('0x47')]({'where':{'id':_0x450b2e[_0xae6a('0x48')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xae6a('0x49'),_0xae6a('0x4a'),_0xae6a('0x4b')],'raw':!![]});})[_0xae6a('0x17')](function(_0x73bb7a){if(_0x73bb7a&&_0x73bb7a['vidaooApiKey']&&_0x73bb7a['vidaooEscalation']){_0xbfef90=_0x73bb7a;var _0x4aceb7={'interaction':{'id':_0x471c10},'agent':{'id':_0x3bc6e7['user']['id'],'name':_0x3bc6e7[_0xae6a('0x38')]['name'],'fullname':_0x3bc6e7[_0xae6a('0x38')][_0xae6a('0x4c')],'email':_0x3bc6e7['user']['email']},'contact':_0x3bc6e7[_0xae6a('0x2d')][_0xae6a('0x2e')],'account':_0x3bc6e7[_0xae6a('0x2d')][_0xae6a('0x30')]};var _0x43df6e={'rejectUnauthorized':![],'method':_0xae6a('0x4d'),'url':_0xae6a('0x4e'),'headers':{'X-APIKEY':_0x73bb7a[_0xae6a('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3bc6e7[_0xae6a('0x38')][_0xae6a('0x50')]],'buttons':null,'topic':_0xbfef90[_0xae6a('0x49')],'note':_[_0xae6a('0x51')](_0xbfef90[_0xae6a('0x4a')])?null:getMustacheRender(_0xbfef90[_0xae6a('0x4a')],_0x4aceb7),'metadata':null},'redirect':_0xae6a('0x52'),'json':!![]};try{if(!_['isNull'](_0xbfef90[_0xae6a('0x4b')])){var _0x3606fc=getMustacheRender(_0xbfef90[_0xae6a('0x4b')],_0x4aceb7);var _0x2034d5=JSON[_0xae6a('0x53')](_0x3606fc);_0x43df6e[_0xae6a('0x2d')][_0xae6a('0x54')]=_0x2034d5;}}catch(_0x50eb28){throw new db['Sequelize'][(_0xae6a('0x55'))](_0xae6a('0x56'));}return rp(_0x43df6e);}else{throw new db['Sequelize']['ValidationError'](_0xae6a('0x57'));}})[_0xae6a('0x17')](function(_0x2b878b){_0x290da0=_0x2b878b;if(_0x290da0['id']){var _0x52f504={'body':_0x290da0[_0xae6a('0x58')],'ChatWebsiteId':_0xbfef90['id'],'ChatInteractionId':_0x1c1bb2['id'],'direction':'out','UserId':_0x3bc6e7['user']['id']};return db[_0xae6a('0x59')][_0xae6a('0x42')](_0x52f504,{});}else{throw new db[(_0xae6a('0x5a'))]['ValidationError'](_0xae6a('0x5b'));}})[_0xae6a('0x17')](function(){return _0x1c1bb2[_0xae6a('0x5c')]({'vidaooSessionId':_0x290da0['id']});})['then'](respondWithResult(_0x381ed0,null))[_0xae6a('0x21')](handleError(_0x381ed0,null));};exports[_0xae6a('0x5d')]=function(_0x49345a,_0x4f8230){if(_0x49345a[_0xae6a('0x2d')]['id']){delete _0x49345a[_0xae6a('0x2d')]['id'];}return db[_0xae6a('0x3b')]['find']({'where':{'id':_0x49345a[_0xae6a('0x43')]['id']},'include':[{'model':db[_0xae6a('0x5e')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4f8230,null))[_0xae6a('0x17')](saveUpdates(_0x49345a['body'],null))['then'](respondWithResult(_0x4f8230,null))[_0xae6a('0x21')](handleError(_0x4f8230,null));};exports[_0xae6a('0x5f')]=function(_0x5e5803,_0x2734ce){if(_0x5e5803[_0xae6a('0x2d')]['id']){delete _0x5e5803[_0xae6a('0x2d')]['id'];}return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x5e5803['params']['id']}})[_0xae6a('0x17')](function(_0x379253){if(!_0x379253){logger[_0xae6a('0x1d')](_0xae6a('0x60'),_0xae6a('0x5f'),0x194,_0xae6a('0x61'));_0x2734ce[_0xae6a('0x22')](0x194);}else{if(_0x379253[_0xae6a('0x62')]){throw new db['Sequelize'][(_0xae6a('0x55'))]('Interaction\x20already\x20assigned');}}return _0x379253;})['then'](function(_0x2a3639){if(_0x2a3639){return _0x2a3639[_0xae6a('0x2a')]({'closed':_0x5e5803['body']['closed'],'disposition':_0x5e5803[_0xae6a('0x2d')][_0xae6a('0x63')]})[_0xae6a('0x17')](function(_0x316f71){return _0x316f71;});}})['then'](function(){return respondWithRpcPromise(_0xae6a('0x64'),_0xae6a('0x5f'),_0x5e5803[_0xae6a('0x2d')],client9004);})[_0xae6a('0x17')](respondWithResult(_0x2734ce,null))[_0xae6a('0x21')](handleError(_0x2734ce,null));};exports[_0xae6a('0x65')]=function(_0x35322d,_0x2f7403){_0x35322d['body'][_0xae6a('0x2b')]=_0x35322d[_0xae6a('0x66')]['originalname'];_0x35322d[_0xae6a('0x2d')][_0xae6a('0x67')]=_0x35322d[_0xae6a('0x66')][_0xae6a('0x68')];_0x35322d[_0xae6a('0x2d')][_0xae6a('0x33')]=_0x35322d[_0xae6a('0x66')][_0xae6a('0x69')];return db[_0xae6a('0x6a')][_0xae6a('0x42')](_0x35322d['body'])[_0xae6a('0x17')](respondWithResult(_0x2f7403,0xc9))['catch'](handleError(_0x2f7403,null));};exports['attachmentDownload']=function(_0x1165d5,_0x31c015){return db['ChatInteraction'][_0xae6a('0x47')]({'where':{'id':_0x1165d5[_0xae6a('0x43')]['id']},'raw':!![]})[_0xae6a('0x17')](handleEntityNotFound(_0x31c015,null))[_0xae6a('0x17')](function(_0x777720){if(_0x777720){if(_0x777720[_0xae6a('0x6b')]){return _0x31c015['status'](0x193)[_0xae6a('0x25')]({'status':0x193,'message':_0xae6a('0x6c')});}return db[_0xae6a('0x6a')]['findOne']({'where':{'id':_0x1165d5[_0xae6a('0x37')]['attachId']},'raw':!![]})[_0xae6a('0x17')](handleEntityNotFound(_0x31c015,null));}})[_0xae6a('0x17')](function(_0x5022fc){if(_0x5022fc){var _0x44cc44=_0x5022fc[_0xae6a('0x6d')]!==null;var _0x4f3f9d=path['join'](config[_0xae6a('0x6e')],_0xae6a('0x6f'));if(_0x44cc44){_0x4f3f9d=path[_0xae6a('0x70')](_0x4f3f9d,_0xae6a('0x71'));}var _0x3c38b6=path['join'](_0x4f3f9d,_0x5022fc[_0xae6a('0x67')]);return _0x31c015[_0xae6a('0x72')](_0x3c38b6);}})['catch'](handleError(_0x31c015,null));};exports[_0xae6a('0x73')]=function(_0x33ecc9,_0x23ffdd){var _0x42a833=null;var _0x2cf004=null;var _0x1f02b5=null;if(_0x33ecc9[_0xae6a('0x2d')]['id']){delete _0x33ecc9[_0xae6a('0x2d')]['id'];}if(_0x33ecc9['body']['mailTranscript']){_0x1f02b5=path[_0xae6a('0x70')](config['root'],_0xae6a('0x74'),util['format'](_0xae6a('0x75'),Date['now']()));_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x76')]=_0x1f02b5;}return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x33ecc9[_0xae6a('0x43')]['id']},'include':[{'model':db[_0xae6a('0x59')],'as':_0xae6a('0x77'),'include':[{'model':db[_0xae6a('0x78')],'as':'User'}]}]})[_0xae6a('0x17')](handleEntityNotFound(_0x23ffdd,null))[_0xae6a('0x17')](saveUpdates(_0x33ecc9['body'],null))[_0xae6a('0x17')](function(_0x262af3){if(_0x262af3){_0x42a833=_0x262af3;return db['ChatWebsite'][_0xae6a('0x41')]({'where':{'id':_0x42a833[_0xae6a('0x48')]}});}})[_0xae6a('0x17')](function(_0x5f425e){if(_0x5f425e){_0x2cf004=_0x5f425e;return db[_0xae6a('0x5e')][_0xae6a('0x41')]({'where':{'id':_0x42a833[_0xae6a('0x79')]}});}})[_0xae6a('0x17')](function(_0x214b6d){if(_0x214b6d){if(_0x1f02b5){var _0x4eb0cb=null;for(var _0x4af66a=0x1;_0x4af66a<_0x42a833[_0xae6a('0x77')]['length'];++_0x4af66a){_0x4eb0cb=_0x42a833['Messages'][_0x4af66a];var _0x2eacd8=_0x4eb0cb['UserId']?util[_0xae6a('0x7a')](_0xae6a('0x7b'),_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb[_0xae6a('0x62')]):'System';var _0x2db7b4=_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x7d')]||util['format'](_0xae6a('0x7b'),_0xae6a('0x7e'),_0x4eb0cb[_0xae6a('0x79')]);switch(_0x2cf004[_0xae6a('0x7f')]){case'website_alias':_0x2eacd8=_0x4eb0cb[_0xae6a('0x62')]?util['format']('%s%d',_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb[_0xae6a('0x62')]):_0xae6a('0x80');break;case'agent_alias':_0x2eacd8=_0x4eb0cb[_0xae6a('0x62')]?_0x4eb0cb[_0xae6a('0x78')][_0xae6a('0x81')]||_0x4eb0cb[_0xae6a('0x78')]['fullname']:_0xae6a('0x80');break;case _0xae6a('0x82'):_0x2eacd8=_0x4eb0cb['UserId']?_0x4eb0cb[_0xae6a('0x78')][_0xae6a('0x4c')]:_0xae6a('0x80');break;default:_0x2eacd8=_0x4eb0cb['UserId']?util[_0xae6a('0x7a')](_0xae6a('0x7b'),_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb['UserId']):'System';}var _0x3a34c6=util['format'](_0xae6a('0x83'),moment(_0x4eb0cb['createdAt'])[_0xae6a('0x7a')](_0xae6a('0x84')),_0x4eb0cb[_0xae6a('0x85')]==='in'?_0x2db7b4:_0x2eacd8,_0x4eb0cb[_0xae6a('0x2d')]);if(!_0x4eb0cb['secret']){fs[_0xae6a('0x86')](_0x1f02b5,_0x3a34c6);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xae6a('0x87')],'as':_0xae6a('0x88'),'raw':!![],'include':[{'model':db[_0xae6a('0x89')],'as':_0xae6a('0x89'),'raw':!![]}]}]});}}})[_0xae6a('0x17')](function(_0x48e3e4){if(!_0x48e3e4||!_0x48e3e4[_0xae6a('0x88')]||!_0x33ecc9[_0xae6a('0x2d')])return _0x42a833;var _0x4737d2=_0x48e3e4[_0xae6a('0x8a')]();return respondWithRpcPromise(_0xae6a('0x8b'),_0xae6a('0x8c'),{'account':_0x4737d2,'message':{'from':util[_0xae6a('0x7a')](_0xae6a('0x8d'),_0x48e3e4['name'],_0x48e3e4[_0xae6a('0x50')]||_0x48e3e4[_0xae6a('0x88')][_0xae6a('0x38')]),'to':_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x8e')],'subject':_0xae6a('0x8f'),'text':util[_0xae6a('0x7a')](_0xae6a('0x90'),_0x33ecc9[_0xae6a('0x2d')]['mailTranscript']),'attachments':[{'path':_0x1f02b5}]}})['then'](function(){return _0x42a833;})[_0xae6a('0x21')](function(_0x17c3ed){logger['error'](_0x17c3ed);});})['then'](respondWithStatusCode(_0x23ffdd,0xc8))[_0xae6a('0x21')](handleError(_0x23ffdd,null));};exports['addMessage']=function(_0x11f794,_0x126fe1){return db[_0xae6a('0x59')][_0xae6a('0x41')]({'where':{'id':_0x11f794[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x126fe1,null))[_0xae6a('0x17')](function(_0x337d64){if(_0x337d64){return _0x337d64['addMessage'](_0x11f794['body']['ids'],_[_0xae6a('0x91')](_0x11f794[_0xae6a('0x2d')],[_0xae6a('0x92'),'id'])||{});}})['then'](respondWithResult(_0x126fe1,null))[_0xae6a('0x21')](handleError(_0x126fe1,null));};exports[_0xae6a('0x93')]=function(_0xc15337,_0x4e2e2d){var _0x1df31a={'raw':![],'where':{}};var _0x4102f4={};var _0x502b73={'count':0x0,'rows':[]};return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0xc15337[_0xae6a('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e2e2d,null))[_0xae6a('0x17')](function(_0x2aa14e){if(_0x2aa14e){_0x4102f4[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x59')][_0xae6a('0x31')]);_0x4102f4['query']=_[_0xae6a('0x3c')](_0xc15337[_0xae6a('0x37')]);_0x4102f4[_0xae6a('0x94')]=_[_0xae6a('0x3e')](_0x4102f4[_0xae6a('0x3a')],_0x4102f4['query']);_0x1df31a['attributes']=_[_0xae6a('0x3e')](_0x4102f4[_0xae6a('0x3a')],qs[_0xae6a('0x3f')](_0xc15337['query']['fields']));_0x1df31a['attributes']=_0x1df31a[_0xae6a('0x3d')][_0xae6a('0x95')]?_0x1df31a[_0xae6a('0x3d')]:_0x4102f4[_0xae6a('0x3a')];if(!_0xc15337['query'][_0xae6a('0x96')](_0xae6a('0x97'))){_0x1df31a['limit']=qs[_0xae6a('0x29')](_0xc15337['query'][_0xae6a('0x29')]);_0x1df31a[_0xae6a('0x26')]=qs[_0xae6a('0x26')](_0xc15337['query'][_0xae6a('0x26')]);}_0x1df31a['order']=qs[_0xae6a('0x98')](_0xc15337[_0xae6a('0x37')][_0xae6a('0x98')]);_0x1df31a['where']=qs[_0xae6a('0x94')](_['pick'](_0xc15337[_0xae6a('0x37')],_0x4102f4[_0xae6a('0x94')]));_0x1df31a['where']['ChatInteractionId']=_0x2aa14e['id'];if(_0xc15337['query']['filter']){_0x1df31a[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x1df31a[_0xae6a('0x99')],{'$or':_[_0xae6a('0x9b')](_0x1df31a[_0xae6a('0x3d')],function(_0x27d60e){var _0x5f3baf={};_0x5f3baf[_0x27d60e]={'$like':'%'+_0xc15337['query'][_0xae6a('0x9c')]+'%'};return _0x5f3baf;})});}if(_0xc15337[_0xae6a('0x37')][_0xae6a('0x9d')]){var _0x3c1174=_0xc15337['query'][_0xae6a('0x9d')][_0xae6a('0x9e')](',');var _0x37c322={};_0x37c322[_0x3c1174[0x0]]={'$gte':moment(_0x3c1174[0x1])[_0xae6a('0x7a')](_0xae6a('0x9f'))};_0x1df31a[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x1df31a[_0xae6a('0x99')],_0x37c322);}_0x1df31a=_[_0xae6a('0x9a')]({},_0x1df31a,_0xc15337[_0xae6a('0x40')]);return db[_0xae6a('0x59')][_0xae6a('0x28')]({'where':_0x1df31a[_0xae6a('0x99')]})[_0xae6a('0x17')](function(_0x3ccf5d){_0x502b73['count']=_0x3ccf5d;if(_0xc15337[_0xae6a('0x37')]['includeAll']){_0x1df31a[_0xae6a('0xa0')]=[{'all':!![]}];}return db[_0xae6a('0x59')][_0xae6a('0x35')](_0x1df31a);})[_0xae6a('0x17')](function(_0x2a51f3){_0x502b73[_0xae6a('0xa1')]=_0x2a51f3;return _0x502b73;});}})['then'](respondWithFilteredResult(_0x4e2e2d,_0x1df31a))[_0xae6a('0x21')](handleError(_0x4e2e2d,null));};exports[_0xae6a('0xa2')]=function(_0x467efb,_0x46b413){var _0x2ee7b2={'where':{}},_0x1e618a={},_0x1a0101={'count':0x0,'rows':[]};return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0x467efb['params']['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x46b413,null))[_0xae6a('0x17')](function(_0x58b88e){if(_0x58b88e){_0x1e618a[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x59')][_0xae6a('0x31')]);_0x1e618a['query']=_['keys'](_0x467efb[_0xae6a('0x37')]);_0x1e618a[_0xae6a('0x94')]=_[_0xae6a('0x3e')](_0x1e618a[_0xae6a('0x3a')],_0x1e618a['query']);_0x2ee7b2['attributes']=_[_0xae6a('0x3e')](_0x1e618a[_0xae6a('0x3a')],qs['fields'](_0x467efb[_0xae6a('0x37')][_0xae6a('0x3f')]));_0x2ee7b2[_0xae6a('0x3d')]=_0x2ee7b2[_0xae6a('0x3d')][_0xae6a('0x95')]?_0x2ee7b2['attributes']:_0x1e618a[_0xae6a('0x3a')];if(!_0x467efb[_0xae6a('0x37')][_0xae6a('0x96')]('nolimit')){_0x2ee7b2[_0xae6a('0x29')]=qs[_0xae6a('0x29')](_0x467efb[_0xae6a('0x37')][_0xae6a('0x29')]);_0x2ee7b2[_0xae6a('0x26')]=qs['offset'](_0x467efb[_0xae6a('0x37')]['offset']);}_0x2ee7b2[_0xae6a('0xa3')]=qs['sort'](_0x467efb['query'][_0xae6a('0x98')]);_0x2ee7b2['where']=qs[_0xae6a('0x94')](_[_0xae6a('0xa4')](_0x467efb[_0xae6a('0x37')],_0x1e618a[_0xae6a('0x94')]));_0x2ee7b2[_0xae6a('0x99')][_0xae6a('0xa5')]=_0x58b88e['id'];if(_0x467efb['query'][_0xae6a('0x9c')]){_0x2ee7b2[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x2ee7b2[_0xae6a('0x99')],{'$or':_['map'](_0x2ee7b2['attributes'],function(_0x2f8472){var _0xf46d66={};_0xf46d66[_0x2f8472]={'$like':'%'+_0x467efb[_0xae6a('0x37')]['filter']+'%'};return _0xf46d66;})});}_0x2ee7b2[_0xae6a('0x99')][_0xae6a('0xa6')]=![];if(_0x467efb[_0xae6a('0x37')]['id']){_0x2ee7b2['where']['id']={'$gt':_0x467efb[_0xae6a('0x37')]['id']};}_0x2ee7b2=_[_0xae6a('0x9a')]({},_0x2ee7b2,_0x467efb[_0xae6a('0x40')]);return db['ChatMessage'][_0xae6a('0x28')]({'where':_0x2ee7b2[_0xae6a('0x99')]})[_0xae6a('0x17')](function(_0x42dd4e){_0x1a0101['count']=_0x42dd4e;_0x2ee7b2[_0xae6a('0xa0')]=[];if(_0x467efb[_0xae6a('0x37')][_0xae6a('0xa7')]){_0x2ee7b2[_0xae6a('0xa0')]['push']({'model':db[_0xae6a('0x78')],'as':_0xae6a('0x78'),'attributes':['id',_0xae6a('0x4c'),_0xae6a('0x81')]});}if(_0x467efb['query'][_0xae6a('0xa8')]){_0x2ee7b2[_0xae6a('0xa0')]=[{'all':!![]}];}return db[_0xae6a('0x59')][_0xae6a('0x35')](_0x2ee7b2);})[_0xae6a('0x17')](function(_0x30737d){_0x1a0101['rows']=_0x30737d;return _0x1a0101;});}})['then'](respondWithFilteredResult(_0x46b413,_0x2ee7b2))[_0xae6a('0x21')](handleError(_0x46b413,null));};exports[_0xae6a('0xa9')]=function(_0x2bfc9a,_0x2bafb3){return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x2bfc9a[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x2bafb3,null))[_0xae6a('0x17')](function(_0x85d6c5){if(_0x85d6c5){return _0x85d6c5['setTags'](_0x2bfc9a[_0xae6a('0x2d')][_0xae6a('0x92')],_['omit'](_0x2bfc9a[_0xae6a('0x2d')],['ids','id'])||{})[_0xae6a('0xaa')](function(){return db[_0xae6a('0xab')][_0xae6a('0x35')]({'attributes':['id',_0xae6a('0x2b'),_0xae6a('0xac')],'where':{'id':_0x2bfc9a[_0xae6a('0x2d')][_0xae6a('0x92')]}});})[_0xae6a('0x17')](function(_0x324adb){socket[_0xae6a('0xad')](_0xae6a('0xae'),{'id':Number(_0x2bfc9a['params']['id']),'tags':_0x324adb||[]});return{'id':Number(_0x2bfc9a['params']['id']),'tags':_0x324adb||[]};});}})[_0xae6a('0x17')](respondWithResult(_0x2bafb3,null))['catch'](handleError(_0x2bafb3,null));};exports[_0xae6a('0xaf')]=function(_0x354a3b,_0x246434){return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x354a3b[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x246434,null))[_0xae6a('0x17')](function(_0x250ddb){if(_0x250ddb){return _0x250ddb[_0xae6a('0xaf')](_0x354a3b[_0xae6a('0x37')][_0xae6a('0x92')]);}})['then'](respondWithStatusCode(_0x246434,null))['catch'](handleError(_0x246434,null));};exports['download']=function(_0x585885,_0x16e591){var _0xcede78=moment()[_0xae6a('0xb0')]()[_0xae6a('0xb1')]();var _0x4b6e9d=path['join'](config[_0xae6a('0x6e')],'server','files','tmp');var _0x52be63=path[_0xae6a('0x70')](config[_0xae6a('0x6e')],_0xae6a('0xb2'),_0xae6a('0xb3'),_0xae6a('0xb4'));var _0x317b65=path['join'](_0x4b6e9d,_0xcede78);var _0x12c801=util[_0xae6a('0x7a')](_0xae6a('0xb5'),_0x585885[_0xae6a('0x43')]['id'],_0xcede78);var _0x105860=path[_0xae6a('0x70')](_0x4b6e9d,_0x12c801);var _0x3bcf83=[];_0x3bcf83[_0xae6a('0xb6')]({'model':db[_0xae6a('0x78')],'as':'User','attributes':['id',_0xae6a('0x4c')],'raw':!![]});_0x3bcf83[_0xae6a('0xb6')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xae6a('0xb7'),_0xae6a('0xb8')],'raw':!![]});if(_0x585885[_0xae6a('0x37')][_0xae6a('0xb4')]){_0x3bcf83['push']({'model':db[_0xae6a('0x6a')],'as':'Attachment','raw':!![]});}var _0x5eba4b=[{'model':db[_0xae6a('0x59')],'as':_0xae6a('0x77'),'attributes':['id','body','createdAt',_0xae6a('0x85'),_0xae6a('0xa6'),_0xae6a('0xb9')],'include':_0x3bcf83}];_0x5eba4b['push']({'model':db[_0xae6a('0xba')],'as':_0xae6a('0xbb'),'attributes':['id',_0xae6a('0x2b')]});_0x5eba4b[_0xae6a('0xb6')]({'model':db['User'],'as':_0xae6a('0xbc'),'attributes':['id',_0xae6a('0x4c')]});return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x585885[_0xae6a('0x43')]['id']},'include':_0x5eba4b})[_0xae6a('0x17')](handleEntityNotFound(_0x16e591,null))[_0xae6a('0x17')](function(_0x5d0f25){if(_0x5d0f25){var _0x308352=_0x5d0f25['get']({'plain':!![]});fs[_0xae6a('0xbd')](_0x317b65);var _0x2a6113={'channel':_0xae6a('0xbe'),'account':_0x308352['Account']['name'],'agent':_0x308352[_0xae6a('0xbc')]?_0x308352[_0xae6a('0xbc')]['fullname']:'N.A.','createdAt':moment(_0x308352[_0xae6a('0xbf')])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')](),'closedAt':_0x308352[_0xae6a('0x6b')]?moment(_0x308352[_0xae6a('0xc0')])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')]():'','disposition':_0x308352['disposition'],'chatInfo':{'browser':_0x308352['browserName'],'os':_0x308352[_0xae6a('0xc1')],'referer':_0x308352[_0xae6a('0xc2')],'customerIp':_0x308352[_0xae6a('0xc3')],'customerPort':_0x308352[_0xae6a('0xc4')]?_0x308352[_0xae6a('0xc4')]:_0xae6a('0xc5')},'messages':_(_0x308352['Messages'])[_0xae6a('0xc6')]()['filter']({'secret':![]})['map'](function(_0x48d949){if(_0x48d949[_0xae6a('0x6a')]){var _0x28af58=path[_0xae6a('0x70')](_0x52be63,_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')]);if(fs[_0xae6a('0xc7')](_0x28af58)){fs['createReadStream'](_0x28af58)[_0xae6a('0xc8')](fs['createWriteStream'](path['join'](_0x317b65,_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')])));}}return{'date':moment(_0x48d949['createdAt'])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')](),'sender':_0x48d949[_0xae6a('0x85')]===_0xae6a('0xc9')?_0x48d949['User']?_0x48d949[_0xae6a('0x78')][_0xae6a('0x4c')]:_0xae6a('0x80'):_0x48d949[_0xae6a('0xca')][_0xae6a('0xb7')]+(_0x48d949[_0xae6a('0xca')][_0xae6a('0xb8')]?'\x20'+_0x48d949[_0xae6a('0xca')][_0xae6a('0xb8')]:''),'body':_0x48d949[_0xae6a('0x6a')]?_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')]:_0x48d949[_0xae6a('0x2d')],'direction':_0x48d949['direction']===_0xae6a('0xc9')?'A':'C','secret':_0x48d949[_0xae6a('0xa6')],'read':_0x48d949[_0xae6a('0xb9')],'attachment':_0x48d949['Attachment']};})[_0xae6a('0xcb')]()};return ejs[_0xae6a('0xcc')](path[_0xae6a('0x70')](config[_0xae6a('0x6e')],_0xae6a('0xb2'),_0xae6a('0xcd'),_0xae6a('0xce')),{'interaction':_0x2a6113})['then'](function(_0x324b90){var _0x575dfe=path[_0xae6a('0x70')](_0x317b65,_0xae6a('0xcf')+_0x308352['id']+'-'+_0xcede78+'.pdf');var _0x3024df={'path':_0x575dfe,'channel':_0xae6a('0xbe'),'interactionId':_0x308352['id']};return pdf[_0xae6a('0xd0')](_0x324b90,_0x3024df);})[_0xae6a('0x17')](function(){return new Promise(function(_0x4af8bd,_0x2721d3){zipdir(_0x317b65,{'saveTo':_0x105860},function(_0x4fea87,_0x2a9af6){if(_0x4fea87)return _0x2721d3(_0x4fea87);return _0x4af8bd(_0x2a9af6);});})['then'](function(){return new BPromise(function(_0x282223,_0x2ccf18){rimraf(_0x317b65,function(_0x41dfee){if(_0x41dfee)_0x2ccf18(_0x41dfee);return _0x282223();});});})[_0xae6a('0x17')](function(){return _0x16e591[_0xae6a('0x72')](_0x105860,_0x12c801,function(_0x2ff712){if(_0x2ff712){logger[_0xae6a('0x1d')](_0xae6a('0xd1'),_0x2ff712);}else{fs[_0xae6a('0xd2')](_0x105860);}});});});}else{return _0x16e591[_0xae6a('0x22')](0xc8);}})[_0xae6a('0x21')](handleError(_0x16e591,null));};
\ No newline at end of file
+var _0xa479=['then','stack','name','send','render','merge','body','contact','agent','account','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','user','show','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','follow','isNull','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','now','pathTranscript','Messages','User','ContactId','format','agentAlias','customer','%s%d','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','sort','where','pick','filter','map','$gte','split','rows','getMyMessages','ChatInteractionId','push','addTags','Tag','chatInteractionTags:save','removeTags','unix','toString','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','read','Account','get','mkdirSync','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','zip-dir','moment','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInteraction,\x20%s,\x20%s','catch','status','end','json','undefined','limit','count','offset','update'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xa479,0x160));var _0x9a47=function(_0x625ee2,_0x35458f){_0x625ee2=_0x625ee2-0x0;var _0x40aa97=_0xa479[_0x625ee2];return _0x40aa97;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x9a47('0x0'));var rp=require('request-promise');var moment=require(_0x9a47('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x9a47('0x2'));var util=require(_0x9a47('0x3'));var path=require(_0x9a47('0x4'));var ejs=require(_0x9a47('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x9a47('0x6'));var qs=require(_0x9a47('0x7'));var pdf=require(_0x9a47('0x8'));var logger=require(_0x9a47('0x9'))(_0x9a47('0xa'));var config=require(_0x9a47('0xb'));var db=require(_0x9a47('0xc'))['db'];config[_0x9a47('0xd')]=_['defaults'](config[_0x9a47('0xd')],{'host':_0x9a47('0xe'),'port':0x18eb});var socket=require(_0x9a47('0xf'))(new Redis(config['redis']));require(_0x9a47('0x10'))[_0x9a47('0x11')](socket);var jayson=require(_0x9a47('0x12'));var client=jayson['client'][_0x9a47('0x13')]({'port':0x232b});var client9004=jayson[_0x9a47('0x14')][_0x9a47('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x2d55b6,_0x2148f1,_0x54fd08,_0x106ceb){return new BPromise(function(_0x2fae37,_0x2b3978){var _0x5e09bc=_0x106ceb||client;return _0x5e09bc['request'](_0x2d55b6,_0x54fd08)['then'](function(_0x204322){logger[_0x9a47('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2148f1,_0x9a47('0x16'));logger[_0x9a47('0x17')](_0x9a47('0x18'),_0x2148f1,_0x9a47('0x16'),JSON[_0x9a47('0x19')](_0x204322));if(_0x204322['error']){if(_0x204322[_0x9a47('0x1a')]['code']===0x1f4){logger[_0x9a47('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2148f1,_0x204322[_0x9a47('0x1a')]['message']);return _0x2b3978(_0x204322[_0x9a47('0x1a')][_0x9a47('0x1b')]);}logger['error'](_0x9a47('0x1c'),_0x2148f1,_0x204322['error'][_0x9a47('0x1b')]);return _0x2fae37(_0x204322['error']['message']);}else{logger[_0x9a47('0x15')](_0x9a47('0x1c'),_0x2148f1,_0x9a47('0x16'));_0x2fae37(_0x204322['result'][_0x9a47('0x1b')]);}})[_0x9a47('0x1d')](function(_0x59300b){logger[_0x9a47('0x1a')](_0x9a47('0x1c'),_0x2148f1,_0x59300b);_0x2b3978(_0x59300b);});});}function respondWithStatusCode(_0x26e9ad,_0xb76964){_0xb76964=_0xb76964||0xcc;return function(_0x8cdcc1){if(_0x8cdcc1){return _0x26e9ad['sendStatus'](_0xb76964);}return _0x26e9ad[_0x9a47('0x1e')](_0xb76964)[_0x9a47('0x1f')]();};}function respondWithResult(_0x54a86e,_0x1db9d0){_0x1db9d0=_0x1db9d0||0xc8;return function(_0x4b0b29){if(_0x4b0b29){return _0x54a86e['status'](_0x1db9d0)[_0x9a47('0x20')](_0x4b0b29);}};}function respondWithFilteredResult(_0x14b102,_0x11a267){return function(_0x3dd778){if(_0x3dd778){var _0xa98450=typeof _0x11a267['offset']===_0x9a47('0x21')&&typeof _0x11a267[_0x9a47('0x22')]===_0x9a47('0x21');var _0x59a40a=_0x3dd778[_0x9a47('0x23')];var _0x45676a=_0xa98450?0x0:_0x11a267['offset'];var _0x47c3c5=_0xa98450?_0x3dd778['count']:_0x11a267[_0x9a47('0x24')]+_0x11a267[_0x9a47('0x22')];var _0x2ceb8f;if(_0x47c3c5>=_0x59a40a){_0x47c3c5=_0x59a40a;_0x2ceb8f=0xc8;}else{_0x2ceb8f=0xce;}_0x14b102[_0x9a47('0x1e')](_0x2ceb8f);return _0x14b102['set']('Content-Range',_0x45676a+'-'+_0x47c3c5+'/'+_0x59a40a)[_0x9a47('0x20')](_0x3dd778);}return null;};}function saveUpdates(_0x1b87bd){return function(_0x18fe3a){if(_0x18fe3a){return _0x18fe3a[_0x9a47('0x25')](_0x1b87bd)['then'](function(_0x551ff0){return _0x551ff0;});}return null;};}function removeEntity(_0xd84ffa){return function(_0x505145){if(_0x505145){return _0x505145['destroy']()[_0x9a47('0x26')](function(){_0xd84ffa[_0x9a47('0x1e')](0xcc)[_0x9a47('0x1f')]();});}};}function handleEntityNotFound(_0x1a4c4c){return function(_0x26c67f){if(!_0x26c67f){_0x1a4c4c['sendStatus'](0x194);}return _0x26c67f;};}function handleError(_0x594a50,_0x7d0ee6){_0x7d0ee6=_0x7d0ee6||0x1f4;return function(_0x1b558a){logger['error'](_0x1b558a[_0x9a47('0x27')]);if(_0x1b558a[_0x9a47('0x28')]){delete _0x1b558a[_0x9a47('0x28')];}_0x594a50['status'](_0x7d0ee6)[_0x9a47('0x29')](_0x1b558a);};}function getMustacheRender(_0x24d911,_0x549fc2){return Mustache[_0x9a47('0x2a')](_0x24d911,_[_0x9a47('0x2b')](_0x549fc2[_0x9a47('0x2c')],{'contact':_0x549fc2[_0x9a47('0x2d')],'message':_0x549fc2[_0x9a47('0x1b')],'agent':_0x549fc2[_0x9a47('0x2e')],'interaction':_0x549fc2['interaction'],'account':_0x549fc2[_0x9a47('0x2f')]}))||'';}exports[_0x9a47('0x30')]=function(_0x4b710b,_0x5068b5){var _0x2a5d40={};var _0x52484b=_['map'](db[_0x9a47('0x31')][_0x9a47('0x32')],function(_0x15d351){return{'name':_0x15d351[_0x9a47('0x33')],'type':_0x15d351[_0x9a47('0x34')]['key']};});_0x2a5d40=qs[_0x9a47('0x35')](_0x52484b,_0x4b710b);return interaction[_0x9a47('0x36')](_0x9a47('0x37'),_0x4b710b[_0x9a47('0x38')],_0x4b710b[_0x9a47('0x39')],_0x2a5d40,_0x52484b)[_0x9a47('0x26')](respondWithFilteredResult(_0x5068b5,_0x2a5d40))['catch'](handleError(_0x5068b5,null));};exports[_0x9a47('0x3a')]=function(_0x3c1f7f,_0x1d2ff3){var _0xc9cd65={'raw':![],'where':{'id':_0x3c1f7f['params']['id']}},_0x18f346={};_0x18f346[_0x9a47('0x3b')]=_[_0x9a47('0x3c')](db[_0x9a47('0x31')][_0x9a47('0x32')]);_0x18f346[_0x9a47('0x38')]=_[_0x9a47('0x3c')](_0x3c1f7f[_0x9a47('0x38')]);_0x18f346[_0x9a47('0x3d')]=_[_0x9a47('0x3e')](_0x18f346[_0x9a47('0x3b')],_0x18f346[_0x9a47('0x38')]);_0xc9cd65['attributes']=_['intersection'](_0x18f346[_0x9a47('0x3b')],qs[_0x9a47('0x3f')](_0x3c1f7f['query'][_0x9a47('0x3f')]));_0xc9cd65['attributes']=_0xc9cd65[_0x9a47('0x40')][_0x9a47('0x41')]?_0xc9cd65[_0x9a47('0x40')]:_0x18f346[_0x9a47('0x3b')];if(_0x3c1f7f[_0x9a47('0x38')][_0x9a47('0x42')]){_0xc9cd65[_0x9a47('0x43')]=[{'all':!![]}];}_0xc9cd65=_['merge']({},_0xc9cd65,_0x3c1f7f[_0x9a47('0x44')]);return db['ChatInteraction'][_0x9a47('0x45')](_0xc9cd65)[_0x9a47('0x26')](handleEntityNotFound(_0x1d2ff3,null))['then'](respondWithResult(_0x1d2ff3,null))[_0x9a47('0x1d')](handleError(_0x1d2ff3,null));};exports[_0x9a47('0x46')]=function(_0x215308,_0x54618b){return db[_0x9a47('0x31')][_0x9a47('0x46')](_0x215308[_0x9a47('0x2c')],{})[_0x9a47('0x26')](respondWithResult(_0x54618b,0xc9))[_0x9a47('0x1d')](handleError(_0x54618b,null));};exports[_0x9a47('0x25')]=function(_0xc5582,_0x443925){if(_0xc5582[_0x9a47('0x2c')]['id']){delete _0xc5582[_0x9a47('0x2c')]['id'];}return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0xc5582[_0x9a47('0x47')]['id']}})['then'](handleEntityNotFound(_0x443925,null))[_0x9a47('0x26')](saveUpdates(_0xc5582[_0x9a47('0x2c')],null))['then'](respondWithResult(_0x443925,null))['catch'](handleError(_0x443925,null));};exports[_0x9a47('0x48')]=function(_0x4588a0,_0x5281f5){return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0x4588a0[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0x5281f5,null))[_0x9a47('0x26')](removeEntity(_0x5281f5,null))[_0x9a47('0x1d')](handleError(_0x5281f5,null));};exports[_0x9a47('0x49')]=function(_0x3f89f0,_0xe0c98c){return db[_0x9a47('0x31')][_0x9a47('0x49')]()[_0x9a47('0x26')](respondWithResult(_0xe0c98c,null))[_0x9a47('0x1d')](handleError(_0xe0c98c,null));};exports[_0x9a47('0x4a')]=function(_0x74d970,_0x36ce23){var _0x154821=_0x74d970[_0x9a47('0x47')]['id'];var _0x1fd70e;var _0x4cd5cd;var _0x3ed0e9;return db[_0x9a47('0x31')][_0x9a47('0x4b')]({'where':{'id':_0x154821}})[_0x9a47('0x26')](function(_0x55e358){_0x1fd70e=_0x55e358;return db[_0x9a47('0x4c')][_0x9a47('0x4b')]({'where':{'id':_0x55e358[_0x9a47('0x4d')]},'attributes':['id',_0x9a47('0x4e'),_0x9a47('0x4f'),'vidaooTopic',_0x9a47('0x50'),_0x9a47('0x51')],'raw':!![]});})[_0x9a47('0x26')](function(_0x569c4e){if(_0x569c4e&&_0x569c4e[_0x9a47('0x4e')]&&_0x569c4e[_0x9a47('0x4f')]){_0x4cd5cd=_0x569c4e;var _0x25c198={'interaction':{'id':_0x154821},'agent':{'id':_0x74d970[_0x9a47('0x39')]['id'],'name':_0x74d970[_0x9a47('0x39')]['name'],'fullname':_0x74d970[_0x9a47('0x39')][_0x9a47('0x52')],'email':_0x74d970[_0x9a47('0x39')][_0x9a47('0x53')]},'contact':_0x74d970[_0x9a47('0x2c')][_0x9a47('0x2d')],'account':_0x74d970['body'][_0x9a47('0x2f')]};var _0xaa8c4e={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x569c4e['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x74d970[_0x9a47('0x39')]['email']],'buttons':null,'topic':_0x4cd5cd['vidaooTopic'],'note':_['isNull'](_0x4cd5cd[_0x9a47('0x50')])?null:getMustacheRender(_0x4cd5cd[_0x9a47('0x50')],_0x25c198),'metadata':null},'redirect':_0x9a47('0x54'),'json':!![]};try{if(!_[_0x9a47('0x55')](_0x4cd5cd[_0x9a47('0x51')])){var _0x24cd6b=getMustacheRender(_0x4cd5cd['vidaooMetadata'],_0x25c198);var _0x4d5b4b=JSON[_0x9a47('0x56')](_0x24cd6b);_0xaa8c4e['body'][_0x9a47('0x57')]=_0x4d5b4b;}}catch(_0x593f34){throw new db['Sequelize']['ValidationError'](_0x9a47('0x58'));}return rp(_0xaa8c4e);}else{throw new db[(_0x9a47('0x59'))][(_0x9a47('0x5a'))](_0x9a47('0x5b'));}})[_0x9a47('0x26')](function(_0x1f3ecc){_0x3ed0e9=_0x1f3ecc;if(_0x3ed0e9['id']){var _0x443032={'body':_0x3ed0e9['join_url'],'ChatWebsiteId':_0x4cd5cd['id'],'ChatInteractionId':_0x1fd70e['id'],'direction':_0x9a47('0x5c'),'UserId':_0x74d970[_0x9a47('0x39')]['id']};return db[_0x9a47('0x5d')][_0x9a47('0x46')](_0x443032,{});}else{throw new db['Sequelize'][(_0x9a47('0x5a'))](_0x9a47('0x5e'));}})[_0x9a47('0x26')](function(){return _0x1fd70e['updateAttributes']({'vidaooSessionId':_0x3ed0e9['id']});})[_0x9a47('0x26')](respondWithResult(_0x36ce23,null))[_0x9a47('0x1d')](handleError(_0x36ce23,null));};exports[_0x9a47('0x5f')]=function(_0x6553a3,_0x2b954f){if(_0x6553a3[_0x9a47('0x2c')]['id']){delete _0x6553a3['body']['id'];}return db[_0x9a47('0x31')]['find']({'where':{'id':_0x6553a3[_0x9a47('0x47')]['id']},'include':[{'model':db[_0x9a47('0x60')],'as':_0x9a47('0x61')}]})['then'](handleEntityNotFound(_0x2b954f,null))[_0x9a47('0x26')](saveUpdates(_0x6553a3[_0x9a47('0x2c')],null))[_0x9a47('0x26')](respondWithResult(_0x2b954f,null))['catch'](handleError(_0x2b954f,null));};exports['abandon']=function(_0x241390,_0x3ee2d9){if(_0x241390['body']['id']){delete _0x241390[_0x9a47('0x2c')]['id'];}return db[_0x9a47('0x31')]['find']({'where':{'id':_0x241390[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](function(_0x463795){if(!_0x463795){logger['error'](_0x9a47('0x62'),_0x9a47('0x63'),0x194,_0x9a47('0x64'));_0x3ee2d9[_0x9a47('0x65')](0x194);}else{if(_0x463795[_0x9a47('0x66')]){throw new db[(_0x9a47('0x59'))][(_0x9a47('0x5a'))](_0x9a47('0x67'));}}return _0x463795;})[_0x9a47('0x26')](function(_0x1bc6db){if(_0x1bc6db){return _0x1bc6db[_0x9a47('0x25')]({'closed':_0x241390[_0x9a47('0x2c')][_0x9a47('0x68')],'disposition':_0x241390[_0x9a47('0x2c')]['disposition']})['then'](function(_0x4d54ed){return _0x4d54ed;});}})[_0x9a47('0x26')](function(){return respondWithRpcPromise(_0x9a47('0x69'),_0x9a47('0x63'),_0x241390['body'],client9004);})['then'](respondWithResult(_0x3ee2d9,null))[_0x9a47('0x1d')](handleError(_0x3ee2d9,null));};exports['attachmentUpload']=function(_0x3a1645,_0x558aef){_0x3a1645[_0x9a47('0x2c')][_0x9a47('0x28')]=_0x3a1645[_0x9a47('0x6a')]['originalname'];_0x3a1645[_0x9a47('0x2c')][_0x9a47('0x6b')]=_0x3a1645[_0x9a47('0x6a')][_0x9a47('0x6c')];_0x3a1645[_0x9a47('0x2c')][_0x9a47('0x34')]=_0x3a1645[_0x9a47('0x6a')][_0x9a47('0x6d')];return db[_0x9a47('0x6e')][_0x9a47('0x46')](_0x3a1645[_0x9a47('0x2c')])[_0x9a47('0x26')](respondWithResult(_0x558aef,0xc9))[_0x9a47('0x1d')](handleError(_0x558aef,null));};exports[_0x9a47('0x6f')]=function(_0x260981,_0x553a63){return db['ChatInteraction']['findOne']({'where':{'id':_0x260981[_0x9a47('0x47')]['id']},'raw':!![]})[_0x9a47('0x26')](handleEntityNotFound(_0x553a63,null))[_0x9a47('0x26')](function(_0x660463){if(_0x660463){if(_0x660463['closed']){return _0x553a63[_0x9a47('0x1e')](0x193)[_0x9a47('0x20')]({'status':0x193,'message':'Unauthorized'});}return db[_0x9a47('0x6e')][_0x9a47('0x4b')]({'where':{'id':_0x260981['query']['attachId']},'raw':!![]})[_0x9a47('0x26')](handleEntityNotFound(_0x553a63,null));}})[_0x9a47('0x26')](function(_0x452043){if(_0x452043){var _0x3e1724=_0x452043[_0x9a47('0x70')]!==null;var _0xa328e3=path[_0x9a47('0x71')](config[_0x9a47('0x72')],_0x9a47('0x73'));if(_0x3e1724){_0xa328e3=path[_0x9a47('0x71')](_0xa328e3,'offline-chat/');}var _0x434699=path[_0x9a47('0x71')](_0xa328e3,_0x452043[_0x9a47('0x6b')]);return _0x553a63[_0x9a47('0x74')](_0x434699);}})[_0x9a47('0x1d')](handleError(_0x553a63,null));};exports[_0x9a47('0x75')]=function(_0x1ec51e,_0x4e152c){var _0x2bd4f3=null;var _0x266461=null;var _0x33cdc0=null;if(_0x1ec51e[_0x9a47('0x2c')]['id']){delete _0x1ec51e[_0x9a47('0x2c')]['id'];}if(_0x1ec51e[_0x9a47('0x2c')][_0x9a47('0x76')]){_0x33cdc0=path[_0x9a47('0x71')](config[_0x9a47('0x72')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0x9a47('0x77')]()));_0x1ec51e[_0x9a47('0x2c')][_0x9a47('0x78')]=_0x33cdc0;}return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0x1ec51e['params']['id']},'include':[{'model':db[_0x9a47('0x5d')],'as':_0x9a47('0x79'),'include':[{'model':db['User'],'as':_0x9a47('0x7a')}]}]})[_0x9a47('0x26')](handleEntityNotFound(_0x4e152c,null))['then'](saveUpdates(_0x1ec51e[_0x9a47('0x2c')],null))[_0x9a47('0x26')](function(_0x12097a){if(_0x12097a){_0x2bd4f3=_0x12097a;return db[_0x9a47('0x4c')][_0x9a47('0x45')]({'where':{'id':_0x2bd4f3[_0x9a47('0x4d')]}});}})[_0x9a47('0x26')](function(_0x5cef83){if(_0x5cef83){_0x266461=_0x5cef83;return db[_0x9a47('0x60')][_0x9a47('0x45')]({'where':{'id':_0x2bd4f3[_0x9a47('0x7b')]}});}})[_0x9a47('0x26')](function(_0x2392bd){if(_0x2392bd){if(_0x33cdc0){var _0x5b13d5=null;for(var _0x3d9ceb=0x1;_0x3d9ceb<_0x2bd4f3[_0x9a47('0x79')][_0x9a47('0x41')];++_0x3d9ceb){_0x5b13d5=_0x2bd4f3[_0x9a47('0x79')][_0x3d9ceb];var _0x48cc07=_0x5b13d5[_0x9a47('0x66')]?util[_0x9a47('0x7c')]('%s%d',_0x266461[_0x9a47('0x7d')],_0x5b13d5[_0x9a47('0x66')]):'System';var _0x4f2786=_0x1ec51e[_0x9a47('0x2c')][_0x9a47('0x7e')]||util[_0x9a47('0x7c')](_0x9a47('0x7f'),'Visitor',_0x5b13d5[_0x9a47('0x7b')]);switch(_0x266461['agentIdentifier']){case'website_alias':_0x48cc07=_0x5b13d5[_0x9a47('0x66')]?util[_0x9a47('0x7c')]('%s%d',_0x266461[_0x9a47('0x7d')],_0x5b13d5['UserId']):_0x9a47('0x80');break;case _0x9a47('0x81'):_0x48cc07=_0x5b13d5[_0x9a47('0x66')]?_0x5b13d5[_0x9a47('0x7a')][_0x9a47('0x82')]||_0x5b13d5['User'][_0x9a47('0x52')]:_0x9a47('0x80');break;case _0x9a47('0x83'):_0x48cc07=_0x5b13d5[_0x9a47('0x66')]?_0x5b13d5[_0x9a47('0x7a')][_0x9a47('0x52')]:_0x9a47('0x80');break;default:_0x48cc07=_0x5b13d5['UserId']?util[_0x9a47('0x7c')](_0x9a47('0x7f'),_0x266461[_0x9a47('0x7d')],_0x5b13d5[_0x9a47('0x66')]):'System';}var _0x580266=util[_0x9a47('0x7c')](_0x9a47('0x84'),moment(_0x5b13d5['createdAt'])[_0x9a47('0x7c')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5b13d5['direction']==='in'?_0x4f2786:_0x48cc07,_0x5b13d5[_0x9a47('0x2c')]);if(!_0x5b13d5[_0x9a47('0x85')]){fs['appendFileSync'](_0x33cdc0,_0x580266);}}return db[_0x9a47('0x86')][_0x9a47('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x9a47('0x87')],'as':_0x9a47('0x88'),'raw':!![],'include':[{'model':db[_0x9a47('0x89')],'as':_0x9a47('0x89'),'raw':!![]}]}]});}}})[_0x9a47('0x26')](function(_0x109044){if(!_0x109044||!_0x109044[_0x9a47('0x88')]||!_0x1ec51e[_0x9a47('0x2c')])return _0x2bd4f3;var _0xb241f3=_0x109044['getSmtpOptions']();return respondWithRpcPromise(_0x9a47('0x8a'),_0x9a47('0x8b'),{'account':_0xb241f3,'message':{'from':util[_0x9a47('0x7c')]('\x22%s\x22\x20<%s>',_0x109044['name'],_0x109044['email']||_0x109044['Smtp'][_0x9a47('0x39')]),'to':_0x1ec51e[_0x9a47('0x2c')][_0x9a47('0x76')],'subject':'Mail\x20Transcript','text':util[_0x9a47('0x7c')](_0x9a47('0x8c'),_0x1ec51e[_0x9a47('0x2c')][_0x9a47('0x76')]),'attachments':[{'path':_0x33cdc0}]}})[_0x9a47('0x26')](function(){return _0x2bd4f3;})['catch'](function(_0xa3f42c){logger[_0x9a47('0x1a')](_0xa3f42c);});})[_0x9a47('0x26')](respondWithStatusCode(_0x4e152c,0xc8))['catch'](handleError(_0x4e152c,null));};exports[_0x9a47('0x8d')]=function(_0x530682,_0x2fbe1c){return db[_0x9a47('0x5d')][_0x9a47('0x45')]({'where':{'id':_0x530682[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0x2fbe1c,null))[_0x9a47('0x26')](function(_0x11fbfc){if(_0x11fbfc){return _0x11fbfc[_0x9a47('0x8d')](_0x530682['body'][_0x9a47('0x8e')],_[_0x9a47('0x8f')](_0x530682[_0x9a47('0x2c')],[_0x9a47('0x8e'),'id'])||{});}})[_0x9a47('0x26')](respondWithResult(_0x2fbe1c,null))[_0x9a47('0x1d')](handleError(_0x2fbe1c,null));};exports['getMessages']=function(_0x4c54be,_0x4ae8df){var _0x5a4df4={'raw':![],'where':{}};var _0x3f5526={};var _0x5723b7={'count':0x0,'rows':[]};return db[_0x9a47('0x31')][_0x9a47('0x4b')]({'where':{'id':_0x4c54be[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0x4ae8df,null))[_0x9a47('0x26')](function(_0xddaf64){if(_0xddaf64){_0x3f5526[_0x9a47('0x3b')]=_[_0x9a47('0x3c')](db['ChatMessage'][_0x9a47('0x32')]);_0x3f5526[_0x9a47('0x38')]=_['keys'](_0x4c54be[_0x9a47('0x38')]);_0x3f5526[_0x9a47('0x3d')]=_['intersection'](_0x3f5526[_0x9a47('0x3b')],_0x3f5526[_0x9a47('0x38')]);_0x5a4df4[_0x9a47('0x40')]=_[_0x9a47('0x3e')](_0x3f5526[_0x9a47('0x3b')],qs[_0x9a47('0x3f')](_0x4c54be[_0x9a47('0x38')][_0x9a47('0x3f')]));_0x5a4df4[_0x9a47('0x40')]=_0x5a4df4['attributes'][_0x9a47('0x41')]?_0x5a4df4[_0x9a47('0x40')]:_0x3f5526[_0x9a47('0x3b')];if(!_0x4c54be[_0x9a47('0x38')][_0x9a47('0x90')](_0x9a47('0x91'))){_0x5a4df4['limit']=qs[_0x9a47('0x22')](_0x4c54be[_0x9a47('0x38')][_0x9a47('0x22')]);_0x5a4df4[_0x9a47('0x24')]=qs[_0x9a47('0x24')](_0x4c54be[_0x9a47('0x38')]['offset']);}_0x5a4df4['order']=qs[_0x9a47('0x92')](_0x4c54be[_0x9a47('0x38')][_0x9a47('0x92')]);_0x5a4df4[_0x9a47('0x93')]=qs[_0x9a47('0x3d')](_[_0x9a47('0x94')](_0x4c54be[_0x9a47('0x38')],_0x3f5526[_0x9a47('0x3d')]));_0x5a4df4[_0x9a47('0x93')]['ChatInteractionId']=_0xddaf64['id'];if(_0x4c54be[_0x9a47('0x38')][_0x9a47('0x95')]){_0x5a4df4[_0x9a47('0x93')]=_[_0x9a47('0x2b')](_0x5a4df4[_0x9a47('0x93')],{'$or':_[_0x9a47('0x96')](_0x5a4df4[_0x9a47('0x40')],function(_0x143486){var _0x86560e={};_0x86560e[_0x143486]={'$like':'%'+_0x4c54be[_0x9a47('0x38')][_0x9a47('0x95')]+'%'};return _0x86560e;})});}if(_0x4c54be['query']['$gte']){var _0x521753=_0x4c54be[_0x9a47('0x38')][_0x9a47('0x97')][_0x9a47('0x98')](',');var _0x2b1f7b={};_0x2b1f7b[_0x521753[0x0]]={'$gte':moment(_0x521753[0x1])[_0x9a47('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5a4df4[_0x9a47('0x93')]=_[_0x9a47('0x2b')](_0x5a4df4[_0x9a47('0x93')],_0x2b1f7b);}_0x5a4df4=_[_0x9a47('0x2b')]({},_0x5a4df4,_0x4c54be[_0x9a47('0x44')]);return db['ChatMessage'][_0x9a47('0x23')]({'where':_0x5a4df4[_0x9a47('0x93')]})[_0x9a47('0x26')](function(_0x298fee){_0x5723b7[_0x9a47('0x23')]=_0x298fee;if(_0x4c54be['query'][_0x9a47('0x42')]){_0x5a4df4['include']=[{'all':!![]}];}return db[_0x9a47('0x5d')]['findAll'](_0x5a4df4);})[_0x9a47('0x26')](function(_0x5e8a40){_0x5723b7[_0x9a47('0x99')]=_0x5e8a40;return _0x5723b7;});}})[_0x9a47('0x26')](respondWithFilteredResult(_0x4ae8df,_0x5a4df4))[_0x9a47('0x1d')](handleError(_0x4ae8df,null));};exports[_0x9a47('0x9a')]=function(_0x1d9976,_0xd31915){var _0x26709c={'where':{}},_0x508f2c={},_0x417c24={'count':0x0,'rows':[]};return db[_0x9a47('0x31')][_0x9a47('0x4b')]({'where':{'id':_0x1d9976[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0xd31915,null))[_0x9a47('0x26')](function(_0x56fac9){if(_0x56fac9){_0x508f2c['model']=_[_0x9a47('0x3c')](db[_0x9a47('0x5d')]['rawAttributes']);_0x508f2c[_0x9a47('0x38')]=_['keys'](_0x1d9976[_0x9a47('0x38')]);_0x508f2c[_0x9a47('0x3d')]=_[_0x9a47('0x3e')](_0x508f2c['model'],_0x508f2c[_0x9a47('0x38')]);_0x26709c[_0x9a47('0x40')]=_[_0x9a47('0x3e')](_0x508f2c['model'],qs[_0x9a47('0x3f')](_0x1d9976[_0x9a47('0x38')][_0x9a47('0x3f')]));_0x26709c['attributes']=_0x26709c[_0x9a47('0x40')][_0x9a47('0x41')]?_0x26709c['attributes']:_0x508f2c['model'];if(!_0x1d9976[_0x9a47('0x38')]['hasOwnProperty'](_0x9a47('0x91'))){_0x26709c['limit']=qs[_0x9a47('0x22')](_0x1d9976[_0x9a47('0x38')][_0x9a47('0x22')]);_0x26709c[_0x9a47('0x24')]=qs[_0x9a47('0x24')](_0x1d9976['query'][_0x9a47('0x24')]);}_0x26709c['order']=qs['sort'](_0x1d9976[_0x9a47('0x38')]['sort']);_0x26709c['where']=qs[_0x9a47('0x3d')](_['pick'](_0x1d9976['query'],_0x508f2c[_0x9a47('0x3d')]));_0x26709c[_0x9a47('0x93')][_0x9a47('0x9b')]=_0x56fac9['id'];if(_0x1d9976[_0x9a47('0x38')][_0x9a47('0x95')]){_0x26709c[_0x9a47('0x93')]=_[_0x9a47('0x2b')](_0x26709c[_0x9a47('0x93')],{'$or':_['map'](_0x26709c['attributes'],function(_0x2bb5e1){var _0x4a3a0b={};_0x4a3a0b[_0x2bb5e1]={'$like':'%'+_0x1d9976[_0x9a47('0x38')][_0x9a47('0x95')]+'%'};return _0x4a3a0b;})});}_0x26709c[_0x9a47('0x93')][_0x9a47('0x85')]=![];if(_0x1d9976[_0x9a47('0x38')]['id']){_0x26709c[_0x9a47('0x93')]['id']={'$gt':_0x1d9976[_0x9a47('0x38')]['id']};}_0x26709c=_[_0x9a47('0x2b')]({},_0x26709c,_0x1d9976[_0x9a47('0x44')]);return db['ChatMessage']['count']({'where':_0x26709c['where']})[_0x9a47('0x26')](function(_0x4a21b6){_0x417c24[_0x9a47('0x23')]=_0x4a21b6;_0x26709c['include']=[];if(_0x1d9976[_0x9a47('0x38')]['includeAgent']){_0x26709c['include'][_0x9a47('0x9c')]({'model':db[_0x9a47('0x7a')],'as':_0x9a47('0x7a'),'attributes':['id',_0x9a47('0x52'),_0x9a47('0x82')]});}if(_0x1d9976['query'][_0x9a47('0x42')]){_0x26709c[_0x9a47('0x43')]=[{'all':!![]}];}return db[_0x9a47('0x5d')]['findAll'](_0x26709c);})[_0x9a47('0x26')](function(_0x4ac92f){_0x417c24[_0x9a47('0x99')]=_0x4ac92f;return _0x417c24;});}})[_0x9a47('0x26')](respondWithFilteredResult(_0xd31915,_0x26709c))['catch'](handleError(_0xd31915,null));};exports[_0x9a47('0x9d')]=function(_0x5efa29,_0x319e8e){return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0x5efa29['params']['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0x319e8e,null))[_0x9a47('0x26')](function(_0x189c2b){if(_0x189c2b){return _0x189c2b['setTags'](_0x5efa29['body'][_0x9a47('0x8e')],_['omit'](_0x5efa29[_0x9a47('0x2c')],[_0x9a47('0x8e'),'id'])||{})['spread'](function(){return db[_0x9a47('0x9e')]['findAll']({'attributes':['id',_0x9a47('0x28'),'color'],'where':{'id':_0x5efa29['body'][_0x9a47('0x8e')]}});})[_0x9a47('0x26')](function(_0x66829f){socket['emit'](_0x9a47('0x9f'),{'id':Number(_0x5efa29[_0x9a47('0x47')]['id']),'tags':_0x66829f||[]});return{'id':Number(_0x5efa29['params']['id']),'tags':_0x66829f||[]};});}})['then'](respondWithResult(_0x319e8e,null))[_0x9a47('0x1d')](handleError(_0x319e8e,null));};exports[_0x9a47('0xa0')]=function(_0x3a48e0,_0x1d8d45){return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0x3a48e0[_0x9a47('0x47')]['id']}})[_0x9a47('0x26')](handleEntityNotFound(_0x1d8d45,null))['then'](function(_0x5a751b){if(_0x5a751b){return _0x5a751b[_0x9a47('0xa0')](_0x3a48e0[_0x9a47('0x38')][_0x9a47('0x8e')]);}})['then'](respondWithStatusCode(_0x1d8d45,null))['catch'](handleError(_0x1d8d45,null));};exports[_0x9a47('0x74')]=function(_0x1965fa,_0x5e57ec){var _0x4b745c=moment()[_0x9a47('0xa1')]()[_0x9a47('0xa2')]();var _0x27414a=path[_0x9a47('0x71')](config[_0x9a47('0x72')],'server',_0x9a47('0xa3'),'tmp');var _0x3b3e24=path[_0x9a47('0x71')](config['root'],'server',_0x9a47('0xa3'),_0x9a47('0xa4'));var _0x4069bc=path[_0x9a47('0x71')](_0x27414a,_0x4b745c);var _0x150704=util[_0x9a47('0x7c')](_0x9a47('0xa5'),_0x1965fa['params']['id'],_0x4b745c);var _0x9ce6f2=path[_0x9a47('0x71')](_0x27414a,_0x150704);var _0x47dac9=[];_0x47dac9['push']({'model':db[_0x9a47('0x7a')],'as':_0x9a47('0x7a'),'attributes':['id',_0x9a47('0x52')],'raw':!![]});_0x47dac9[_0x9a47('0x9c')]({'model':db[_0x9a47('0x60')],'as':_0x9a47('0x61'),'attributes':['id',_0x9a47('0xa6'),_0x9a47('0xa7')],'raw':!![]});if(_0x1965fa[_0x9a47('0x38')][_0x9a47('0xa4')]){_0x47dac9[_0x9a47('0x9c')]({'model':db['Attachment'],'as':_0x9a47('0x6e'),'raw':!![]});}var _0x49eb82=[{'model':db[_0x9a47('0x5d')],'as':'Messages','attributes':['id',_0x9a47('0x2c'),_0x9a47('0xa8'),_0x9a47('0xa9'),_0x9a47('0x85'),_0x9a47('0xaa')],'include':_0x47dac9}];_0x49eb82[_0x9a47('0x9c')]({'model':db[_0x9a47('0x4c')],'as':_0x9a47('0xab'),'attributes':['id',_0x9a47('0x28')]});_0x49eb82[_0x9a47('0x9c')]({'model':db['User'],'as':'Owner','attributes':['id',_0x9a47('0x52')]});return db[_0x9a47('0x31')][_0x9a47('0x45')]({'where':{'id':_0x1965fa[_0x9a47('0x47')]['id']},'include':_0x49eb82})[_0x9a47('0x26')](handleEntityNotFound(_0x5e57ec,null))[_0x9a47('0x26')](function(_0xc605b4){if(_0xc605b4){var _0x402c8e=_0xc605b4[_0x9a47('0xac')]({'plain':!![]});fs[_0x9a47('0xad')](_0x4069bc);var _0x25589f={'channel':'Chat','account':_0x402c8e[_0x9a47('0xab')][_0x9a47('0x28')],'agent':_0x402c8e['Owner']?_0x402c8e[_0x9a47('0xae')][_0x9a47('0x52')]:_0x9a47('0xaf'),'createdAt':moment(_0x402c8e['createdAt'])[_0x9a47('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9a47('0xa2')](),'closedAt':_0x402c8e[_0x9a47('0x68')]?moment(_0x402c8e[_0x9a47('0xb0')])[_0x9a47('0x7c')](_0x9a47('0xb1'))[_0x9a47('0xa2')]():'','disposition':_0x402c8e[_0x9a47('0xb2')],'chatInfo':{'browser':_0x402c8e[_0x9a47('0xb3')],'os':_0x402c8e[_0x9a47('0xb4')],'referer':_0x402c8e['referer'],'customerIp':_0x402c8e[_0x9a47('0xb5')],'customerPort':_0x402c8e['customerPort']?_0x402c8e[_0x9a47('0xb6')]:_0x9a47('0xaf')},'messages':_(_0x402c8e[_0x9a47('0x79')])[_0x9a47('0xb7')]()['filter']({'secret':![]})[_0x9a47('0x96')](function(_0x189a04){if(_0x189a04['Attachment']){var _0x2f4b76=path['join'](_0x3b3e24,_0x189a04[_0x9a47('0x6e')][_0x9a47('0x6b')]);if(fs[_0x9a47('0xb8')](_0x2f4b76)){fs['createReadStream'](_0x2f4b76)[_0x9a47('0xb9')](fs[_0x9a47('0xba')](path[_0x9a47('0x71')](_0x4069bc,_0x189a04[_0x9a47('0x6e')][_0x9a47('0x6b')])));}}return{'date':moment(_0x189a04['createdAt'])['format'](_0x9a47('0xb1'))[_0x9a47('0xa2')](),'sender':_0x189a04[_0x9a47('0xa9')]===_0x9a47('0x5c')?_0x189a04[_0x9a47('0x7a')]?_0x189a04[_0x9a47('0x7a')][_0x9a47('0x52')]:_0x9a47('0x80'):_0x189a04[_0x9a47('0x61')][_0x9a47('0xa6')]+(_0x189a04[_0x9a47('0x61')][_0x9a47('0xa7')]?'\x20'+_0x189a04[_0x9a47('0x61')][_0x9a47('0xa7')]:''),'body':_0x189a04['Attachment']?_0x189a04[_0x9a47('0x6e')]['basename']:_0x189a04[_0x9a47('0x2c')],'direction':_0x189a04[_0x9a47('0xa9')]===_0x9a47('0x5c')?'A':'C','secret':_0x189a04['secret'],'read':_0x189a04['read'],'attachment':_0x189a04['Attachment']};})['value']()};return ejs[_0x9a47('0xbb')](path[_0x9a47('0x71')](config[_0x9a47('0x72')],'server',_0x9a47('0xbc'),_0x9a47('0xbd')),{'interaction':_0x25589f})[_0x9a47('0x26')](function(_0x54d774){var _0x1d675e=path[_0x9a47('0x71')](_0x4069bc,_0x9a47('0xbe')+_0x402c8e['id']+'-'+_0x4b745c+_0x9a47('0xbf'));var _0x169be7={'path':_0x1d675e,'channel':_0x9a47('0xc0'),'interactionId':_0x402c8e['id']};return pdf[_0x9a47('0xc1')](_0x54d774,_0x169be7);})[_0x9a47('0x26')](function(){return new Promise(function(_0x5cf492,_0x1763f7){zipdir(_0x4069bc,{'saveTo':_0x9ce6f2},function(_0x535db0,_0x2b3885){if(_0x535db0)return _0x1763f7(_0x535db0);return _0x5cf492(_0x2b3885);});})[_0x9a47('0x26')](function(){return new BPromise(function(_0x24c9f4,_0x26302f){rimraf(_0x4069bc,function(_0x2158e6){if(_0x2158e6)_0x26302f(_0x2158e6);return _0x24c9f4();});});})[_0x9a47('0x26')](function(){return _0x5e57ec['download'](_0x9ce6f2,_0x150704,function(_0x3c9320){if(_0x3c9320){logger[_0x9a47('0x1a')](_0x9a47('0xc2'),_0x3c9320);}else{fs['unlinkSync'](_0x9ce6f2);}});});});}else{return _0x5e57ec[_0x9a47('0x65')](0xc8);}})[_0x9a47('0x1d')](handleError(_0x5e57ec,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index a5c3a6d..8d064b7 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 _0xca2b=['getUsers','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove'];(function(_0x575006,_0x26719a){var _0x183b83=function(_0x488b77){while(--_0x488b77){_0x575006['push'](_0x575006['shift']());}};_0x183b83(++_0x26719a);}(_0xca2b,0x8a));var _0xbca2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xca2b[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xbca2('0x0'));var ChatInteraction=require(_0xbca2('0x1'))['db'][_0xbca2('0x2')];var ChatMessage=require(_0xbca2('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbca2('0x3'),'afterUpdate':_0xbca2('0x4'),'afterDestroy':_0xbca2('0x5')};function emitEvent(_0x4fe21b){return function(_0xd54425,_0x43cacf,_0x567b50){_0xd54425[_0xbca2('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9011ef){_0xd54425['setDataValue']('Users',_0x9011ef[_0xbca2('0x7')](function(_0x543c0f){return{'id':_0x543c0f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xd54425['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x6643df){_0xd54425[_0xbca2('0x8')](_0xbca2('0x9'),_0x6643df[_0xbca2('0xa')]);ChatInteractionEvents[_0xbca2('0xb')](_0x4fe21b+':'+_0xd54425['id'],_0xd54425);ChatInteractionEvents[_0xbca2('0xb')](_0x4fe21b,_0xd54425);_0x567b50(null);})[_0xbca2('0xc')](_0x567b50(null));};}for(var e in events){if(events[_0xbca2('0xd')](e)){var event=events[e];ChatInteraction[_0xbca2('0xe')](e,emitEvent(event));}}module[_0xbca2('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x3725=['then','unreadMessages','emit','exports','events','../../mysqldb','ChatMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x3725,0x13f));var _0x5372=function(_0x4d973c,_0x36153f){_0x4d973c=_0x4d973c-0x0;var _0x33d408=_0x3725[_0x4d973c];return _0x33d408;};'use strict';var EventEmitter=require(_0x5372('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x5372('0x1'))['db'][_0x5372('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5372('0x3'),'afterUpdate':_0x5372('0x4'),'afterDestroy':_0x5372('0x5')};function emitEvent(_0x2beb86){return function(_0x43b022,_0x3356d8,_0x270b9a){_0x43b022[_0x5372('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4f84a9){_0x43b022[_0x5372('0x7')](_0x5372('0x8'),_0x4f84a9[_0x5372('0x9')](function(_0xc91dc3){return{'id':_0xc91dc3['id']};}));return ChatMessage[_0x5372('0xa')]({'where':{'ChatInteractionId':_0x43b022['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5372('0xb')](function(_0x2050da){_0x43b022[_0x5372('0x7')](_0x5372('0xc'),_0x2050da['length']);ChatInteractionEvents[_0x5372('0xd')](_0x2beb86+':'+_0x43b022['id'],_0x43b022);ChatInteractionEvents[_0x5372('0xd')](_0x2beb86,_0x43b022);_0x270b9a(null);})['catch'](_0x270b9a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5372('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 825e8e7..38363e3 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 _0x3f8c=['api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3f8c,0x1a6));var _0xc3f8=function(_0x5796a6,_0x20267a){_0x5796a6=_0x5796a6-0x0;var _0x1370da=_0x3f8c[_0x5796a6];return _0x1370da;};'use strict';var _=require(_0xc3f8('0x0'));var util=require(_0xc3f8('0x1'));var logger=require(_0xc3f8('0x2'))(_0xc3f8('0x3'));var moment=require(_0xc3f8('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3f8('0x5'));var fs=require('fs');var path=require(_0xc3f8('0x6'));var rimraf=require('rimraf');var config=require(_0xc3f8('0x7'));var attributes=require(_0xc3f8('0x8'));module[_0xc3f8('0x9')]=function(_0x53ca64,_0x555dcb){return _0x53ca64[_0xc3f8('0xa')](_0xc3f8('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x228893,_0x110afe,_0x3ce100){if(_0x228893['changed'](_0xc3f8('0xc'))){_0x228893[_0xc3f8('0xd')]=moment()[_0xc3f8('0xe')](_0xc3f8('0xf'));}_0x3ce100(null,_0x228893);}},'charset':_0xc3f8('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa557=['closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed'];(function(_0x5d75e5,_0x3b0e32){var _0x238cc3=function(_0x50ab73){while(--_0x50ab73){_0x5d75e5['push'](_0x5d75e5['shift']());}};_0x238cc3(++_0x3b0e32);}(_0xa557,0x16c));var _0x7a55=function(_0x25188d,_0x43a52d){_0x25188d=_0x25188d-0x0;var _0x4eca6f=_0xa557[_0x25188d];return _0x4eca6f;};'use strict';var _=require(_0x7a55('0x0'));var util=require('util');var logger=require(_0x7a55('0x1'))(_0x7a55('0x2'));var moment=require(_0x7a55('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a55('0x5'));var config=require(_0x7a55('0x6'));var attributes=require(_0x7a55('0x7'));module[_0x7a55('0x8')]=function(_0xb2aaf9,_0x7c56a7){return _0xb2aaf9['define']('ChatInteraction',attributes,{'tableName':_0x7a55('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4644db,_0x3ecafe,_0x5ba350){if(_0x4644db[_0x7a55('0xa')](_0x7a55('0xb'))){_0x4644db[_0x7a55('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5ba350(null,_0x4644db);}},'charset':_0x7a55('0xd'),'collate':_0x7a55('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index fc78229..db7840e 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 _0xfa89=['message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','stringify','AddTagsToChatInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s'];(function(_0x1833e7,_0x37bda7){var _0x37ee75=function(_0x5b8a59){while(--_0x5b8a59){_0x1833e7['push'](_0x1833e7['shift']());}};_0x37ee75(++_0x37bda7);}(_0xfa89,0xa7));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9fa8('0x0'));var moment=require(_0x9fa8('0x1'));var BPromise=require(_0x9fa8('0x2'));var rs=require(_0x9fa8('0x3'));var fs=require('fs');var Redis=require(_0x9fa8('0x4'));var db=require(_0x9fa8('0x5'))['db'];var utils=require(_0x9fa8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fa8('0x7'));var jayson=require(_0x9fa8('0x8'));var client=jayson['client'][_0x9fa8('0x9')]({'port':0x232a});config[_0x9fa8('0xa')]=_[_0x9fa8('0xb')](config[_0x9fa8('0xa')],{'host':_0x9fa8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fa8('0xa')]));require(_0x9fa8('0xd'))[_0x9fa8('0xe')](socket);function respondWithRpcPromise(_0x951e87,_0x2b68c1,_0x334fdd){return new BPromise(function(_0xee411b,_0x9cd50f){return client[_0x9fa8('0xf')](_0x951e87,_0x334fdd)[_0x9fa8('0x10')](function(_0x551ff9){logger[_0x9fa8('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x2b68c1,_0x9fa8('0x12'));logger[_0x9fa8('0x13')](_0x9fa8('0x14'),_0x2b68c1,_0x9fa8('0x12'),JSON['stringify'](_0x551ff9));if(_0x551ff9['error']){if(_0x551ff9['error']['code']===0x1f4){logger[_0x9fa8('0x15')](_0x9fa8('0x16'),_0x2b68c1,_0x551ff9[_0x9fa8('0x15')][_0x9fa8('0x17')]);return _0x9cd50f(_0x551ff9[_0x9fa8('0x15')][_0x9fa8('0x17')]);}logger[_0x9fa8('0x15')](_0x9fa8('0x16'),_0x2b68c1,_0x551ff9['error'][_0x9fa8('0x17')]);return _0xee411b(_0x551ff9['error']['message']);}else{logger[_0x9fa8('0x11')](_0x9fa8('0x16'),_0x2b68c1,'request\x20sent');_0xee411b(_0x551ff9[_0x9fa8('0x18')][_0x9fa8('0x17')]);}})[_0x9fa8('0x19')](function(_0x11ca25){logger['error'](_0x9fa8('0x16'),_0x2b68c1,_0x11ca25);_0x9cd50f(_0x11ca25);});});}exports[_0x9fa8('0x1a')]=function(_0x52f2cd){var _0x396147=this;return new Promise(function(_0x3a726a,_0x491767){return db[_0x9fa8('0x1b')]['update'](_0x52f2cd[_0x9fa8('0x1c')],{'raw':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')][_0x9fa8('0x1e')]||null:null,'attributes':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')][_0x9fa8('0x1f')]||null:null,'limit':_0x52f2cd['options']?_0x52f2cd[_0x9fa8('0x1d')]['limit']||null:null})[_0x9fa8('0x10')](function(_0x4e3c95){logger[_0x9fa8('0x11')]('UpdateChatInteraction',_0x52f2cd);logger[_0x9fa8('0x13')](_0x9fa8('0x1a'),_0x52f2cd,JSON[_0x9fa8('0x20')](_0x4e3c95));_0x3a726a(_0x4e3c95);})[_0x9fa8('0x19')](function(_0x470b6e){logger[_0x9fa8('0x15')](_0x9fa8('0x1a'),_0x470b6e[_0x9fa8('0x17')],_0x52f2cd);_0x491767(_0x396147[_0x9fa8('0x15')](0x1f4,_0x470b6e[_0x9fa8('0x17')]));});});};exports[_0x9fa8('0x21')]=function(_0x4f84d7){return new Promise(function(_0xa7e9e9,_0x78b12d){return db[_0x9fa8('0x1b')][_0x9fa8('0x22')]({'where':_0x4f84d7[_0x9fa8('0x1d')]?_0x4f84d7['options'][_0x9fa8('0x1e')]||null:null})[_0x9fa8('0x10')](function(_0x4d6711){if(_0x4d6711){return _0x4d6711['addTags'](_0x4f84d7[_0x9fa8('0x1c')]['ids'],_['omit'](_0x4f84d7[_0x9fa8('0x1c')],[_0x9fa8('0x23'),'id'])||{});}})[_0x9fa8('0x24')](function(_0x215867){logger['info'](_0x9fa8('0x25'),_0x4f84d7);logger['debug']('AddTags',_0x4f84d7,JSON[_0x9fa8('0x20')](_0x215867));_0xa7e9e9(_0x215867);})[_0x9fa8('0x19')](function(_0x5d825a){logger['error'](_0x9fa8('0x25'),_0x5d825a[_0x9fa8('0x17')],_0x4f84d7);_0x78b12d(_this['error'](0x1f4,_0x5d825a['message']));});});};
\ No newline at end of file
+var _0xf6e2=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0xbd9650,_0x51ba81){var _0x374b5d=function(_0x300d18){while(--_0x300d18){_0xbd9650['push'](_0xbd9650['shift']());}};_0x374b5d(++_0x51ba81);}(_0xf6e2,0x14f));var _0x2f6e=function(_0x4fe6f1,_0x386a7a){_0x4fe6f1=_0x4fe6f1-0x0;var _0x338075=_0xf6e2[_0x4fe6f1];return _0x338075;};'use strict';var _=require('lodash');var util=require(_0x2f6e('0x0'));var moment=require(_0x2f6e('0x1'));var BPromise=require(_0x2f6e('0x2'));var rs=require(_0x2f6e('0x3'));var fs=require('fs');var Redis=require(_0x2f6e('0x4'));var db=require(_0x2f6e('0x5'))['db'];var utils=require(_0x2f6e('0x6'));var logger=require(_0x2f6e('0x7'))(_0x2f6e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f6e('0x9'));var client=jayson[_0x2f6e('0xa')]['http']({'port':0x232a});config[_0x2f6e('0xb')]=_[_0x2f6e('0xc')](config[_0x2f6e('0xb')],{'host':_0x2f6e('0xd'),'port':0x18eb});var socket=require(_0x2f6e('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2f6e('0xf')](socket);function respondWithRpcPromise(_0x5ac768,_0x3e01ba,_0x37584f){return new BPromise(function(_0x14dd57,_0x432cf2){return client[_0x2f6e('0x10')](_0x5ac768,_0x37584f)[_0x2f6e('0x11')](function(_0x47943a){logger[_0x2f6e('0x12')](_0x2f6e('0x13'),_0x3e01ba,_0x2f6e('0x14'));logger[_0x2f6e('0x15')](_0x2f6e('0x16'),_0x3e01ba,_0x2f6e('0x14'),JSON[_0x2f6e('0x17')](_0x47943a));if(_0x47943a['error']){if(_0x47943a['error']['code']===0x1f4){logger[_0x2f6e('0x18')](_0x2f6e('0x13'),_0x3e01ba,_0x47943a[_0x2f6e('0x18')][_0x2f6e('0x19')]);return _0x432cf2(_0x47943a['error'][_0x2f6e('0x19')]);}logger[_0x2f6e('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3e01ba,_0x47943a[_0x2f6e('0x18')][_0x2f6e('0x19')]);return _0x14dd57(_0x47943a[_0x2f6e('0x18')][_0x2f6e('0x19')]);}else{logger[_0x2f6e('0x12')](_0x2f6e('0x13'),_0x3e01ba,'request\x20sent');_0x14dd57(_0x47943a[_0x2f6e('0x1a')]['message']);}})[_0x2f6e('0x1b')](function(_0x28c865){logger[_0x2f6e('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3e01ba,_0x28c865);_0x432cf2(_0x28c865);});});}exports['UpdateChatInteraction']=function(_0xe00f6f){var _0x5d5211=this;return new Promise(function(_0x20f107,_0x73ace9){return db[_0x2f6e('0x1c')][_0x2f6e('0x1d')](_0xe00f6f[_0x2f6e('0x1e')],{'raw':_0xe00f6f[_0x2f6e('0x1f')]?_0xe00f6f[_0x2f6e('0x1f')][_0x2f6e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe00f6f[_0x2f6e('0x1f')]?_0xe00f6f[_0x2f6e('0x1f')][_0x2f6e('0x21')]||null:null,'attributes':_0xe00f6f[_0x2f6e('0x1f')]?_0xe00f6f[_0x2f6e('0x1f')][_0x2f6e('0x22')]||null:null,'limit':_0xe00f6f['options']?_0xe00f6f['options'][_0x2f6e('0x23')]||null:null})['then'](function(_0x316219){logger[_0x2f6e('0x12')](_0x2f6e('0x24'),_0xe00f6f);logger['debug'](_0x2f6e('0x24'),_0xe00f6f,JSON['stringify'](_0x316219));_0x20f107(_0x316219);})[_0x2f6e('0x1b')](function(_0x4282d3){logger[_0x2f6e('0x18')](_0x2f6e('0x24'),_0x4282d3[_0x2f6e('0x19')],_0xe00f6f);_0x73ace9(_0x5d5211[_0x2f6e('0x18')](0x1f4,_0x4282d3[_0x2f6e('0x19')]));});});};exports[_0x2f6e('0x25')]=function(_0x23378b){return new Promise(function(_0x410c62,_0x37995d){return db[_0x2f6e('0x1c')][_0x2f6e('0x26')]({'where':_0x23378b[_0x2f6e('0x1f')]?_0x23378b[_0x2f6e('0x1f')]['where']||null:null})['then'](function(_0x1234b0){if(_0x1234b0){return _0x1234b0[_0x2f6e('0x27')](_0x23378b[_0x2f6e('0x1e')][_0x2f6e('0x28')],_[_0x2f6e('0x29')](_0x23378b[_0x2f6e('0x1e')],[_0x2f6e('0x28'),'id'])||{});}})[_0x2f6e('0x2a')](function(_0x31260c){logger[_0x2f6e('0x12')](_0x2f6e('0x2b'),_0x23378b);logger['debug'](_0x2f6e('0x2b'),_0x23378b,JSON[_0x2f6e('0x17')](_0x31260c));_0x410c62(_0x31260c);})[_0x2f6e('0x1b')](function(_0x286739){logger[_0x2f6e('0x18')](_0x2f6e('0x2b'),_0x286739[_0x2f6e('0x19')],_0x23378b);_0x37995d(_this[_0x2f6e('0x18')](0x1f4,_0x286739['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index c88067b..47bd34d 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 _0x7eea=['./chatInteraction.events','save','remove','update','emit','removeListener','chatInteraction:'];(function(_0x2849f5,_0x5d2c3f){var _0x2aa0e4=function(_0xb415a7){while(--_0xb415a7){_0x2849f5['push'](_0x2849f5['shift']());}};_0x2aa0e4(++_0x5d2c3f);}(_0x7eea,0x7e));var _0xa7ee=function(_0x395152,_0x1507a8){_0x395152=_0x395152-0x0;var _0x373b2f=_0x7eea[_0x395152];return _0x373b2f;};'use strict';var ChatInteractionEvents=require(_0xa7ee('0x0'));var events=[_0xa7ee('0x1'),_0xa7ee('0x2'),_0xa7ee('0x3')];function createListener(_0x2a6a72,_0xda5fc6){return function(_0xe2ecac){_0xda5fc6[_0xa7ee('0x4')](_0x2a6a72,_0xe2ecac);};}function removeListener(_0x2779aa,_0xf00933){return function(){ChatInteractionEvents[_0xa7ee('0x5')](_0x2779aa,_0xf00933);};}exports['register']=function(_0x2c726c){for(var _0x3f3417=0x0,_0x35d130=events['length'];_0x3f3417<_0x35d130;_0x3f3417++){var _0x55adc4=events[_0x3f3417];var _0x3c18e5=createListener(_0xa7ee('0x6')+_0x55adc4,_0x2c726c);ChatInteractionEvents['on'](_0x55adc4,_0x3c18e5);}};
\ No newline at end of file
+var _0xbb0d=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x2119ee,_0x2b6196){var _0x19202c=function(_0xa20981){while(--_0xa20981){_0x2119ee['push'](_0x2119ee['shift']());}};_0x19202c(++_0x2b6196);}(_0xbb0d,0x1ad));var _0xdbb0=function(_0x592c0c,_0x28b163){_0x592c0c=_0x592c0c-0x0;var _0x44ce56=_0xbb0d[_0x592c0c];return _0x44ce56;};'use strict';var ChatInteractionEvents=require(_0xdbb0('0x0'));var events=[_0xdbb0('0x1'),'remove',_0xdbb0('0x2')];function createListener(_0x1bf6dd,_0x3189f3){return function(_0x2b11de){_0x3189f3[_0xdbb0('0x3')](_0x1bf6dd,_0x2b11de);};}function removeListener(_0x4247da,_0xe5bc84){return function(){ChatInteractionEvents[_0xdbb0('0x4')](_0x4247da,_0xe5bc84);};}exports[_0xdbb0('0x5')]=function(_0x5eaccd){for(var _0x17fdce=0x0,_0x1cbd30=events[_0xdbb0('0x6')];_0x17fdce<_0x1cbd30;_0x17fdce++){var _0x1ee4a3=events[_0x17fdce];var _0x3b0d1e=createListener(_0xdbb0('0x7')+_0x1ee4a3,_0x5eaccd);ChatInteractionEvents['on'](_0x1ee4a3,_0x3b0d1e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 758d389..20ce9ce 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 _0x46b0=['%s-%s','now','replace','single','file','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/'];(function(_0x4a0a02,_0x4c8dc5){var _0x2beac7=function(_0x32b784){while(--_0x32b784){_0x4a0a02['push'](_0x4a0a02['shift']());}};_0x2beac7(++_0x4c8dc5);}(_0x46b0,0x1bf));var _0x046b=function(_0x4cf252,_0x6c073e){_0x4cf252=_0x4cf252-0x0;var _0x16b1e5=_0x46b0[_0x4cf252];return _0x16b1e5;};'use strict';var multer=require(_0x046b('0x0'));var util=require(_0x046b('0x1'));var path=require('path');var timeout=require(_0x046b('0x2'));var express=require(_0x046b('0x3'));var router=express[_0x046b('0x4')]();var fs_extra=require(_0x046b('0x5'));var auth=require(_0x046b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x046b('0x7'));var controller=require(_0x046b('0x8'));router[_0x046b('0x9')]('/',auth[_0x046b('0xa')](),controller[_0x046b('0xb')]);router['get'](_0x046b('0xc'),auth[_0x046b('0xa')](),controller[_0x046b('0xd')]);router[_0x046b('0x9')](_0x046b('0xe'),auth[_0x046b('0xf')](),controller[_0x046b('0x10')]);router[_0x046b('0x9')]('/:id/attachment_download',auth[_0x046b('0xf')](),controller['attachmentDownload']);router[_0x046b('0x9')](_0x046b('0x11'),auth['isAuthenticated'](),controller[_0x046b('0x12')]);router[_0x046b('0x9')](_0x046b('0x13'),auth[_0x046b('0xf')](),controller[_0x046b('0x14')]);router[_0x046b('0x9')](_0x046b('0x15'),auth['isAuthenticated'](),controller[_0x046b('0x16')]);router[_0x046b('0x17')]('/',auth[_0x046b('0xa')](),controller[_0x046b('0x18')]);router['post'](_0x046b('0x19'),auth[_0x046b('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x046b('0x1a')]({'destination':function(_0x1bb762,_0x2f34af,_0x92d44a){_0x92d44a(null,path[_0x046b('0x1b')](config[_0x046b('0x1c')],_0x046b('0x1d')));},'filename':function(_0xa87a95,_0x3dffe5,_0x7267a2){_0x7267a2(null,util['format'](_0x046b('0x1e'),Date[_0x046b('0x1f')](),_0x3dffe5['originalname'][_0x046b('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x046b('0x21')](_0x046b('0x22')),controller['attachmentUpload']);router['post'](_0x046b('0x11'),auth[_0x046b('0xf')](),controller[_0x046b('0x23')]);router[_0x046b('0x17')](_0x046b('0x24'),auth[_0x046b('0xa')](),interaction[_0x046b('0x25')]('chat','chatinteraction:addtags'),controller[_0x046b('0x26')]);router[_0x046b('0x27')](_0x046b('0xe'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x046b('0x28')),controller[_0x046b('0x29')]);router[_0x046b('0x27')](_0x046b('0x2a'),controller[_0x046b('0x2b')]);router['put'](_0x046b('0x2c'),auth[_0x046b('0xf')](),controller['abandon']);router[_0x046b('0x27')](_0x046b('0x2d'),controller[_0x046b('0x2e')]);router[_0x046b('0x2f')]('/:id',auth[_0x046b('0xa')](),interaction[_0x046b('0x25')](_0x046b('0x30'),_0x046b('0x31')),controller[_0x046b('0x32')]);router[_0x046b('0x2f')](_0x046b('0x24'),auth[_0x046b('0xa')](),controller[_0x046b('0x33')]);module[_0x046b('0x34')]=router;
\ No newline at end of file
+var _0xc90b=['isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','attachmentUpload','/:id/messages','addMessage','tracked','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','chat','/:id/tags','removeTags','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xc90b,0x13b));var _0xbc90=function(_0x2f6891,_0xe2ce5a){_0x2f6891=_0x2f6891-0x0;var _0x6bcf76=_0xc90b[_0x2f6891];return _0x6bcf76;};'use strict';var multer=require(_0xbc90('0x0'));var util=require(_0xbc90('0x1'));var path=require(_0xbc90('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc90('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbc90('0x4'));var interaction=require(_0xbc90('0x5'));var config=require(_0xbc90('0x6'));var controller=require('./chatInteraction.controller');router[_0xbc90('0x7')]('/',auth['isAuthenticated'](),controller[_0xbc90('0x8')]);router[_0xbc90('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xbc90('0x7')](_0xbc90('0x9'),auth[_0xbc90('0xa')](),controller[_0xbc90('0xb')]);router[_0xbc90('0x7')](_0xbc90('0xc'),auth[_0xbc90('0xa')](),controller[_0xbc90('0xd')]);router[_0xbc90('0x7')]('/:id/messages',auth[_0xbc90('0xe')](),controller[_0xbc90('0xf')]);router[_0xbc90('0x7')](_0xbc90('0x10'),auth[_0xbc90('0xa')](),controller[_0xbc90('0x11')]);router[_0xbc90('0x7')](_0xbc90('0x12'),auth[_0xbc90('0xe')](),controller[_0xbc90('0x13')]);router[_0xbc90('0x14')]('/',auth['isAuthenticated'](),controller[_0xbc90('0x15')]);router[_0xbc90('0x14')](_0xbc90('0x16'),auth[_0xbc90('0xe')](),controller[_0xbc90('0x17')]);var upload=multer({'storage':multer[_0xbc90('0x18')]({'destination':function(_0x7ecd20,_0x3ea90e,_0x56ffe7){_0x56ffe7(null,path['join'](config[_0xbc90('0x19')],'server/files/attachments/'));},'filename':function(_0xcc503e,_0xb18d56,_0x9e61be){_0x9e61be(null,util[_0xbc90('0x1a')](_0xbc90('0x1b'),Date[_0xbc90('0x1c')](),_0xb18d56[_0xbc90('0x1d')][_0xbc90('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbc90('0x14')]('/:id/attachment_upload',upload['single']('file'),controller[_0xbc90('0x1f')]);router[_0xbc90('0x14')](_0xbc90('0x20'),auth['isChatInteractionAuthorized'](),controller[_0xbc90('0x21')]);router['post']('/:id/tags',auth[_0xbc90('0xe')](),interaction[_0xbc90('0x22')]('chat',_0xbc90('0x23')),controller[_0xbc90('0x24')]);router[_0xbc90('0x25')](_0xbc90('0x9'),auth[_0xbc90('0xe')](),interaction[_0xbc90('0x22')]('chat','chatinteraction:update'),controller[_0xbc90('0x26')]);router[_0xbc90('0x25')](_0xbc90('0x27'),controller[_0xbc90('0x28')]);router[_0xbc90('0x25')]('/:id/abandon',auth[_0xbc90('0xa')](),controller[_0xbc90('0x29')]);router[_0xbc90('0x25')](_0xbc90('0x2a'),controller['close']);router[_0xbc90('0x2b')](_0xbc90('0x9'),auth[_0xbc90('0xe')](),interaction[_0xbc90('0x22')](_0xbc90('0x2c'),'chatinteraction:destroy'),controller['destroy']);router['delete'](_0xbc90('0x2d'),auth[_0xbc90('0xe')](),controller[_0xbc90('0x2e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 227d7a2..7d00bca 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 _0x8abb=['TEXT','medium','INTEGER','sequelize'];(function(_0x53433f,_0x3b7cf7){var _0x526c67=function(_0x274519){while(--_0x274519){_0x53433f['push'](_0x53433f['shift']());}};_0x526c67(++_0x3b7cf7);}(_0x8abb,0x9f));var _0xb8ab=function(_0x48ec35,_0x22bbf5){_0x48ec35=_0x48ec35-0x0;var _0x25f526=_0x8abb[_0x48ec35];return _0x25f526;};'use strict';var Sequelize=require(_0xb8ab('0x0'));module['exports']={'body':{'type':Sequelize[_0xb8ab('0x1')](_0xb8ab('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb8ab('0x3')]}};
\ No newline at end of file
+var _0xaa02=['sequelize'];(function(_0x2f4ca1,_0x8c1158){var _0x2a7056=function(_0x56a99a){while(--_0x56a99a){_0x2f4ca1['push'](_0x2f4ca1['shift']());}};_0x2a7056(++_0x8c1158);}(_0xaa02,0x1f2));var _0x2aa0=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xaa02[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x2aa0('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 4e737c2..f8de404 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 _0x571c=['include','ChatInternalMessage','catch','params','intersection','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Agents','userProfileId','UserProfileResource','length','push','messages','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x3bc15e,_0x872aff){var _0x49087c=function(_0x3dbf7a){while(--_0x3dbf7a){_0x3bc15e['push'](_0x3bc15e['shift']());}};_0x49087c(++_0x872aff);}(_0x571c,0x106));var _0xc571=function(_0x3088ac,_0x1647f2){_0x3088ac=_0x3088ac-0x0;var _0x19d89d=_0x571c[_0x3088ac];return _0x19d89d;};'use strict';var emlformat=require(_0xc571('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc571('0x1'));var jsonpatch=require(_0xc571('0x2'));var rp=require('request-promise');var moment=require(_0xc571('0x3'));var BPromise=require(_0xc571('0x4'));var Mustache=require(_0xc571('0x5'));var util=require(_0xc571('0x6'));var path=require(_0xc571('0x7'));var sox=require(_0xc571('0x8'));var csv=require('to-csv');var ejs=require(_0xc571('0x9'));var fs=require('fs');var fs_extra=require(_0xc571('0xa'));var _=require(_0xc571('0xb'));var squel=require(_0xc571('0xc'));var crypto=require('crypto');var jsforce=require(_0xc571('0xd'));var deskjs=require(_0xc571('0xe'));var toCsv=require(_0xc571('0xf'));var querystring=require(_0xc571('0x10'));var Papa=require(_0xc571('0x11'));var Redis=require(_0xc571('0x12'));var authService=require(_0xc571('0x13'));var qs=require(_0xc571('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc571('0x15'))(_0xc571('0x16'));var utils=require('../../config/utils');var config=require(_0xc571('0x17'));var licenseUtil=require(_0xc571('0x18'));var db=require(_0xc571('0x19'))['db'];config[_0xc571('0x1a')]=_[_0xc571('0x1b')](config['redis'],{'host':_0xc571('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc571('0x1a')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x3b219b,_0x11ec97){_0x11ec97=_0x11ec97||0xcc;return function(_0x1198b2){if(_0x1198b2){return _0x3b219b[_0xc571('0x1d')](_0x11ec97);}return _0x3b219b[_0xc571('0x1e')](_0x11ec97)[_0xc571('0x1f')]();};}function respondWithResult(_0x1e559d,_0x4a8c92){_0x4a8c92=_0x4a8c92||0xc8;return function(_0x264967){if(_0x264967){return _0x1e559d['status'](_0x4a8c92)['json'](_0x264967);}};}function respondWithFilteredResult(_0x233ceb,_0x200cdd){return function(_0xc9c95e){if(_0xc9c95e){var _0x405c28=typeof _0x200cdd[_0xc571('0x20')]===_0xc571('0x21')&&typeof _0x200cdd[_0xc571('0x22')]===_0xc571('0x21');var _0x43987f=_0xc9c95e[_0xc571('0x23')];var _0x4f42d2=_0x405c28?0x0:_0x200cdd[_0xc571('0x20')];var _0x1ca9de=_0x405c28?_0xc9c95e[_0xc571('0x23')]:_0x200cdd[_0xc571('0x20')]+_0x200cdd[_0xc571('0x22')];var _0x14c735;if(_0x1ca9de>=_0x43987f){_0x1ca9de=_0x43987f;_0x14c735=0xc8;}else{_0x14c735=0xce;}_0x233ceb['status'](_0x14c735);return _0x233ceb[_0xc571('0x24')](_0xc571('0x25'),_0x4f42d2+'-'+_0x1ca9de+'/'+_0x43987f)[_0xc571('0x26')](_0xc9c95e);}return null;};}function patchUpdates(_0x107448){return function(_0x1d864e){try{jsonpatch[_0xc571('0x27')](_0x1d864e,_0x107448,!![]);}catch(_0x5a0142){return BPromise[_0xc571('0x28')](_0x5a0142);}return _0x1d864e[_0xc571('0x29')]();};}function saveUpdates(_0x2bffde,_0x465f64){return function(_0x29591f){if(_0x29591f){return _0x29591f[_0xc571('0x2a')](_0x2bffde)[_0xc571('0x2b')](function(_0xb70b03){return _0xb70b03;});}return null;};}function removeEntity(_0x46eab2,_0x2ebb7f){return function(_0x109921){if(_0x109921){return _0x109921[_0xc571('0x2c')]()[_0xc571('0x2b')](function(){_0x46eab2[_0xc571('0x1e')](0xcc)[_0xc571('0x1f')]();});}};}function handleEntityNotFound(_0xf122f2,_0x1c4662){return function(_0x2afc79){if(!_0x2afc79){_0xf122f2[_0xc571('0x1d')](0x194);}return _0x2afc79;};}function handleError(_0xd5718b,_0x43a93e){_0x43a93e=_0x43a93e||0x1f4;return function(_0xbca8e3){logger[_0xc571('0x2d')](_0xbca8e3[_0xc571('0x2e')]);if(_0xbca8e3['name']){delete _0xbca8e3['name'];}_0xd5718b[_0xc571('0x1e')](_0x43a93e)[_0xc571('0x2f')](_0xbca8e3);};}exports['index']=function(_0x59bda7,_0x103d94){var _0x45b862={},_0x3f5b2f={},_0x4bcdf7={'count':0x0,'rows':[]};var _0x5ea250=_[_0xc571('0x30')](db['ChatInternalMessage'][_0xc571('0x31')],function(_0x194a27){return{'name':_0x194a27[_0xc571('0x32')],'type':_0x194a27[_0xc571('0x33')][_0xc571('0x34')]};});_0x3f5b2f[_0xc571('0x35')]=_[_0xc571('0x30')](_0x5ea250,_0xc571('0x36'));_0x3f5b2f[_0xc571('0x37')]=_[_0xc571('0x38')](_0x59bda7[_0xc571('0x37')]);_0x3f5b2f[_0xc571('0x39')]=_['intersection'](_0x3f5b2f['model'],_0x3f5b2f[_0xc571('0x37')]);_0x45b862[_0xc571('0x3a')]=_['intersection'](_0x3f5b2f[_0xc571('0x35')],qs[_0xc571('0x3b')](_0x59bda7[_0xc571('0x37')]['fields']));_0x45b862['attributes']=_0x45b862[_0xc571('0x3a')]['length']?_0x45b862[_0xc571('0x3a')]:_0x3f5b2f['model'];if(!_0x59bda7[_0xc571('0x37')][_0xc571('0x3c')](_0xc571('0x3d'))){_0x45b862[_0xc571('0x22')]=qs[_0xc571('0x22')](_0x59bda7[_0xc571('0x37')][_0xc571('0x22')]);_0x45b862['offset']=qs[_0xc571('0x20')](_0x59bda7[_0xc571('0x37')]['offset']);}_0x45b862[_0xc571('0x3e')]=qs[_0xc571('0x3f')](_0x59bda7['query'][_0xc571('0x3f')]);_0x45b862['where']=qs['filters'](_[_0xc571('0x40')](_0x59bda7[_0xc571('0x37')],_0x3f5b2f[_0xc571('0x39')]),_0x5ea250);if(_0x59bda7[_0xc571('0x37')][_0xc571('0x41')]){_0x45b862[_0xc571('0x42')]=_[_0xc571('0x43')](_0x45b862[_0xc571('0x42')],{'$or':_[_0xc571('0x30')](_0x5ea250,function(_0x42a3ea){if(_0x42a3ea[_0xc571('0x33')]!==_0xc571('0x44')){var _0x59a621={};_0x59a621[_0x42a3ea['name']]={'$like':'%'+_0x59bda7[_0xc571('0x37')][_0xc571('0x41')]+'%'};return _0x59a621;}})});}_0x45b862=_[_0xc571('0x43')]({},_0x45b862,_0x59bda7[_0xc571('0x45')]);var _0x123fa9={'where':_0x45b862[_0xc571('0x42')]};return db['ChatInternalMessage'][_0xc571('0x23')](_0x123fa9)[_0xc571('0x2b')](function(_0x2788ba){_0x4bcdf7['count']=_0x2788ba;if(_0x59bda7['query'][_0xc571('0x46')]){_0x45b862[_0xc571('0x47')]=[{'all':!![]}];}return db[_0xc571('0x48')]['findAll'](_0x45b862);})['then'](function(_0x11f5ea){_0x4bcdf7['rows']=_0x11f5ea;return _0x4bcdf7;})[_0xc571('0x2b')](respondWithFilteredResult(_0x103d94,_0x45b862))[_0xc571('0x49')](handleError(_0x103d94,null));};exports['show']=function(_0x4d7af9,_0x272485){var _0x2decd7={'raw':!![],'where':{'id':_0x4d7af9[_0xc571('0x4a')]['id']}},_0x4ae188={};_0x4ae188[_0xc571('0x35')]=_[_0xc571('0x38')](db['ChatInternalMessage'][_0xc571('0x31')]);_0x4ae188['query']=_[_0xc571('0x38')](_0x4d7af9['query']);_0x4ae188[_0xc571('0x39')]=_[_0xc571('0x4b')](_0x4ae188[_0xc571('0x35')],_0x4ae188[_0xc571('0x37')]);_0x2decd7[_0xc571('0x3a')]=_['intersection'](_0x4ae188[_0xc571('0x35')],qs[_0xc571('0x3b')](_0x4d7af9['query'][_0xc571('0x3b')]));_0x2decd7['attributes']=_0x2decd7[_0xc571('0x3a')]['length']?_0x2decd7[_0xc571('0x3a')]:_0x4ae188[_0xc571('0x35')];if(_0x4d7af9['query']['includeAll']){_0x2decd7[_0xc571('0x47')]=[{'all':!![]}];}_0x2decd7=_['merge']({},_0x2decd7,_0x4d7af9[_0xc571('0x45')]);return db[_0xc571('0x48')]['find'](_0x2decd7)[_0xc571('0x2b')](handleEntityNotFound(_0x272485,null))['then'](respondWithResult(_0x272485,null))[_0xc571('0x49')](handleError(_0x272485,null));};exports[_0xc571('0x4c')]=function(_0x6298f1,_0x10b33b){return db['ChatInternalMessage']['create'](_0x6298f1[_0xc571('0x4d')],{})[_0xc571('0x2b')](respondWithResult(_0x10b33b,0xc9))[_0xc571('0x49')](handleError(_0x10b33b,null));};exports[_0xc571('0x2a')]=function(_0xfeb373,_0xad4b35){if(_0xfeb373[_0xc571('0x4d')]['id']){delete _0xfeb373[_0xc571('0x4d')]['id'];}return db[_0xc571('0x48')]['find']({'where':{'id':_0xfeb373[_0xc571('0x4a')]['id']}})[_0xc571('0x2b')](handleEntityNotFound(_0xad4b35,null))['then'](saveUpdates(_0xfeb373[_0xc571('0x4d')],null))[_0xc571('0x2b')](respondWithResult(_0xad4b35,null))['catch'](handleError(_0xad4b35,null));};exports[_0xc571('0x2c')]=function(_0x10b861,_0x43c2fa){return db[_0xc571('0x48')]['find']({'where':{'id':_0x10b861[_0xc571('0x4a')]['id']}})[_0xc571('0x2b')](handleEntityNotFound(_0x43c2fa,null))[_0xc571('0x2b')](removeEntity(_0x43c2fa,null))['catch'](handleError(_0x43c2fa,null));};exports[_0xc571('0x4e')]=function(_0x43e72a,_0x244801){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x244801,null))[_0xc571('0x49')](handleError(_0x244801,null));};function wrapUser(_0x428661){return function(_0x12b6cf){var _0x2cf7b9=_0x428661[_0xc571('0x4f')]({'plain':!![]});_0x2cf7b9['messages']=[];if(_0x12b6cf){_0x2cf7b9[_0xc571('0x50')]=_0x12b6cf[_0xc571('0x51')];_0x2cf7b9[_0xc571('0x52')]=_0x12b6cf;}else{_0x2cf7b9['lastMessageAt']=moment(0x0)[_0xc571('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cf7b9[_0xc571('0x52')]={};}return _0x2cf7b9;};}exports[_0xc571('0x54')]=function(_0xff5a14,_0x2d18b3,_0x689bdb){var _0xeb1d91=[];return db[_0xc571('0x55')][_0xc571('0x56')]({'where':{'role':[_0xc571('0x57'),_0xc571('0x58'),_0xc571('0x59')]},'attributes':['id',_0xc571('0x5a'),'name',_0xc571('0x5b'),_0xc571('0x5c'),_0xc571('0x5d'),'online',_0xc571('0x5e'),_0xc571('0x5f'),_0xc571('0x60')],'order':qs[_0xc571('0x3f')]('-online'),'include':[{'model':db[_0xc571('0x61')],'as':_0xc571('0x62'),'attributes':['id',_0xc571('0x36'),_0xc571('0x33')],'through':{'attributes':[]}}]})[_0xc571('0x2b')](function(_0x5ac25e){if(_0x5ac25e){var _0x3ee3ae=_0xff5a14['user'][_0xc571('0x4f')]({'plain':!![]});if(!_0x3ee3ae)throw new Error(_0xc571('0x63'));if(_0x3ee3ae[_0xc571('0x5b')]==='user'){return db['UserProfileSection'][_0xc571('0x64')]({'where':{'name':_0xc571('0x65'),'userProfileId':_0x3ee3ae[_0xc571('0x66')]},'raw':!![]})[_0xc571('0x2b')](function(_0x559c61){if(_0x559c61){if(_0x559c61['autoAssociation']===0x0){return db[_0xc571('0x67')]['findAll']({'where':{'sectionId':_0x559c61['id']},'raw':!![]})['then'](function(_0x5097e1){var _0x4de96f=[];if(_['isEmpty'](_0x5097e1)){_0x4de96f=_[_0xc571('0x41')](_0x5ac25e,function(_0x487e08){if(_0x487e08[_0xc571('0x5b')]!=='agent'){return _0x487e08;}});return _0x4de96f;}else{for(var _0x64d9c8=0x0;_0x64d9c8<_0x5ac25e[_0xc571('0x68')];_0x64d9c8++){var _0x3fac51=_0x5ac25e[_0x64d9c8];if(_0x3fac51[_0xc571('0x5b')]===_0xc571('0x57')){var _0x218df0=_[_0xc571('0x64')](_0x5097e1,function(_0x4eb52b){return _0x4eb52b['resourceId']===_0x3fac51['id'];});if(_0x218df0)_0x4de96f[_0xc571('0x69')](_0x3fac51);}else{_0x4de96f[_0xc571('0x69')](_0x3fac51);}}return _0x4de96f;}});}else{return _0x5ac25e;}}else{var _0x1c0861=_[_0xc571('0x41')](_0x5ac25e,function(_0x231080){if(_0x231080['role']!==_0xc571('0x57')){return _0x231080;}});return _0x1c0861;}});}else{return _0x5ac25e;}}})[_0xc571('0x2b')](function(_0x5675bd){var _0x599e0a=[];if(_0x5675bd){_0xeb1d91=_0x5675bd;for(var _0x44ed5a=0x0;_0x44ed5a<_0x5675bd[_0xc571('0x68')];_0x44ed5a+=0x1){_0xeb1d91[_0x44ed5a][_0xc571('0x6a')]=[];_0x599e0a[_0xc571('0x69')](db[_0xc571('0x48')][_0xc571('0x64')]({'where':{'FromId':[_0xff5a14[_0xc571('0x59')]['id'],_0x5675bd[_0x44ed5a]['id']],'ToId':[_0xff5a14[_0xc571('0x59')]['id'],_0x5675bd[_0x44ed5a]['id']],'ChatGroupId':null},'attributes':['id',_0xc571('0x51'),'FromId',_0xc571('0x6b'),_0xc571('0x6c'),_0xc571('0x4d')],'order':qs[_0xc571('0x3f')](_0xc571('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc571('0x2b')](wrapUser(_0x5675bd[_0x44ed5a])));}return BPromise[_0xc571('0x6e')](_0x599e0a);}return[];})[_0xc571('0x2b')](function(_0x511dd8){return{'rows':_0x511dd8,'count':_0x511dd8[_0xc571('0x68')]};})[_0xc571('0x2b')](respondWithResult(_0x2d18b3,null))['catch'](handleError(_0x2d18b3,null));};
\ No newline at end of file
+var _0x88cc=['format','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','push','FromId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt'];(function(_0x3ae6f0,_0xf814e){var _0x5d4aa4=function(_0x2280fb){while(--_0x2280fb){_0x3ae6f0['push'](_0x3ae6f0['shift']());}};_0x5d4aa4(++_0xf814e);}(_0x88cc,0x16b));var _0xc88c=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0x88cc[_0x4c06ac];return _0x2333cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc88c('0x0'));var zipdir=require(_0xc88c('0x1'));var jsonpatch=require(_0xc88c('0x2'));var rp=require(_0xc88c('0x3'));var moment=require(_0xc88c('0x4'));var BPromise=require(_0xc88c('0x5'));var Mustache=require(_0xc88c('0x6'));var util=require(_0xc88c('0x7'));var path=require(_0xc88c('0x8'));var sox=require(_0xc88c('0x9'));var csv=require(_0xc88c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc88c('0xb'));var _=require('lodash');var squel=require(_0xc88c('0xc'));var crypto=require(_0xc88c('0xd'));var jsforce=require(_0xc88c('0xe'));var deskjs=require(_0xc88c('0xf'));var toCsv=require(_0xc88c('0xa'));var querystring=require(_0xc88c('0x10'));var Papa=require(_0xc88c('0x11'));var Redis=require(_0xc88c('0x12'));var authService=require(_0xc88c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc88c('0x14'));var hardwareService=require(_0xc88c('0x15'));var logger=require(_0xc88c('0x16'))(_0xc88c('0x17'));var utils=require(_0xc88c('0x18'));var config=require(_0xc88c('0x19'));var licenseUtil=require(_0xc88c('0x1a'));var db=require(_0xc88c('0x1b'))['db'];config['redis']=_['defaults'](config[_0xc88c('0x1c')],{'host':_0xc88c('0x1d'),'port':0x18eb});var socket=require(_0xc88c('0x1e'))(new Redis(config['redis']));require(_0xc88c('0x1f'))[_0xc88c('0x20')](socket);function respondWithStatusCode(_0x386023,_0x3f22ad){_0x3f22ad=_0x3f22ad||0xcc;return function(_0xc61ebe){if(_0xc61ebe){return _0x386023[_0xc88c('0x21')](_0x3f22ad);}return _0x386023['status'](_0x3f22ad)['end']();};}function respondWithResult(_0x3acf0f,_0x1e9b32){_0x1e9b32=_0x1e9b32||0xc8;return function(_0x4cf3fe){if(_0x4cf3fe){return _0x3acf0f[_0xc88c('0x22')](_0x1e9b32)[_0xc88c('0x23')](_0x4cf3fe);}};}function respondWithFilteredResult(_0x88f26f,_0x1d0af3){return function(_0x263801){if(_0x263801){var _0x270ef0=typeof _0x1d0af3[_0xc88c('0x24')]===_0xc88c('0x25')&&typeof _0x1d0af3[_0xc88c('0x26')]===_0xc88c('0x25');var _0x1e3711=_0x263801[_0xc88c('0x27')];var _0x4522e2=_0x270ef0?0x0:_0x1d0af3[_0xc88c('0x24')];var _0x1e39f7=_0x270ef0?_0x263801[_0xc88c('0x27')]:_0x1d0af3[_0xc88c('0x24')]+_0x1d0af3[_0xc88c('0x26')];var _0x3a877f;if(_0x1e39f7>=_0x1e3711){_0x1e39f7=_0x1e3711;_0x3a877f=0xc8;}else{_0x3a877f=0xce;}_0x88f26f[_0xc88c('0x22')](_0x3a877f);return _0x88f26f[_0xc88c('0x28')](_0xc88c('0x29'),_0x4522e2+'-'+_0x1e39f7+'/'+_0x1e3711)['json'](_0x263801);}return null;};}function patchUpdates(_0x1e3da5){return function(_0x37a09e){try{jsonpatch[_0xc88c('0x2a')](_0x37a09e,_0x1e3da5,!![]);}catch(_0x190ea9){return BPromise['reject'](_0x190ea9);}return _0x37a09e[_0xc88c('0x2b')]();};}function saveUpdates(_0x3f00e1,_0x4ff21d){return function(_0x151726){if(_0x151726){return _0x151726['update'](_0x3f00e1)[_0xc88c('0x2c')](function(_0x595146){return _0x595146;});}return null;};}function removeEntity(_0x36888a,_0x8a95c0){return function(_0x4f7da9){if(_0x4f7da9){return _0x4f7da9[_0xc88c('0x2d')]()[_0xc88c('0x2c')](function(){_0x36888a['status'](0xcc)[_0xc88c('0x2e')]();});}};}function handleEntityNotFound(_0x76440e,_0x3ea352){return function(_0x25cd48){if(!_0x25cd48){_0x76440e[_0xc88c('0x21')](0x194);}return _0x25cd48;};}function handleError(_0x9ccbe0,_0x13e407){_0x13e407=_0x13e407||0x1f4;return function(_0x5637ae){logger[_0xc88c('0x2f')](_0x5637ae['stack']);if(_0x5637ae['name']){delete _0x5637ae['name'];}_0x9ccbe0['status'](_0x13e407)[_0xc88c('0x30')](_0x5637ae);};}exports[_0xc88c('0x31')]=function(_0x4ade37,_0x1a121c){var _0x3e7560={},_0x1bde1c={},_0x4cf2ac={'count':0x0,'rows':[]};var _0x4ba997=_['map'](db[_0xc88c('0x32')][_0xc88c('0x33')],function(_0x475a2d){return{'name':_0x475a2d[_0xc88c('0x34')],'type':_0x475a2d['type'][_0xc88c('0x35')]};});_0x1bde1c[_0xc88c('0x36')]=_[_0xc88c('0x37')](_0x4ba997,'name');_0x1bde1c['query']=_[_0xc88c('0x38')](_0x4ade37[_0xc88c('0x39')]);_0x1bde1c[_0xc88c('0x3a')]=_[_0xc88c('0x3b')](_0x1bde1c['model'],_0x1bde1c['query']);_0x3e7560[_0xc88c('0x3c')]=_['intersection'](_0x1bde1c[_0xc88c('0x36')],qs[_0xc88c('0x3d')](_0x4ade37[_0xc88c('0x39')]['fields']));_0x3e7560['attributes']=_0x3e7560[_0xc88c('0x3c')][_0xc88c('0x3e')]?_0x3e7560[_0xc88c('0x3c')]:_0x1bde1c['model'];if(!_0x4ade37[_0xc88c('0x39')][_0xc88c('0x3f')]('nolimit')){_0x3e7560[_0xc88c('0x26')]=qs[_0xc88c('0x26')](_0x4ade37[_0xc88c('0x39')][_0xc88c('0x26')]);_0x3e7560[_0xc88c('0x24')]=qs['offset'](_0x4ade37[_0xc88c('0x39')][_0xc88c('0x24')]);}_0x3e7560[_0xc88c('0x40')]=qs[_0xc88c('0x41')](_0x4ade37[_0xc88c('0x39')][_0xc88c('0x41')]);_0x3e7560['where']=qs[_0xc88c('0x3a')](_[_0xc88c('0x42')](_0x4ade37[_0xc88c('0x39')],_0x1bde1c['filters']),_0x4ba997);if(_0x4ade37[_0xc88c('0x39')][_0xc88c('0x43')]){_0x3e7560[_0xc88c('0x44')]=_[_0xc88c('0x45')](_0x3e7560['where'],{'$or':_['map'](_0x4ba997,function(_0x57950e){if(_0x57950e['type']!==_0xc88c('0x46')){var _0x46b7c1={};_0x46b7c1[_0x57950e[_0xc88c('0x47')]]={'$like':'%'+_0x4ade37[_0xc88c('0x39')][_0xc88c('0x43')]+'%'};return _0x46b7c1;}})});}_0x3e7560=_['merge']({},_0x3e7560,_0x4ade37[_0xc88c('0x48')]);var _0x49d5a1={'where':_0x3e7560[_0xc88c('0x44')]};return db['ChatInternalMessage'][_0xc88c('0x27')](_0x49d5a1)[_0xc88c('0x2c')](function(_0x432001){_0x4cf2ac[_0xc88c('0x27')]=_0x432001;if(_0x4ade37[_0xc88c('0x39')][_0xc88c('0x49')]){_0x3e7560['include']=[{'all':!![]}];}return db[_0xc88c('0x32')][_0xc88c('0x4a')](_0x3e7560);})['then'](function(_0x4f5dfe){_0x4cf2ac[_0xc88c('0x4b')]=_0x4f5dfe;return _0x4cf2ac;})['then'](respondWithFilteredResult(_0x1a121c,_0x3e7560))[_0xc88c('0x4c')](handleError(_0x1a121c,null));};exports['show']=function(_0x2f255b,_0x429af5){var _0x4239fe={'raw':!![],'where':{'id':_0x2f255b[_0xc88c('0x4d')]['id']}},_0x4ddb53={};_0x4ddb53[_0xc88c('0x36')]=_[_0xc88c('0x38')](db['ChatInternalMessage'][_0xc88c('0x33')]);_0x4ddb53['query']=_[_0xc88c('0x38')](_0x2f255b[_0xc88c('0x39')]);_0x4ddb53['filters']=_[_0xc88c('0x3b')](_0x4ddb53[_0xc88c('0x36')],_0x4ddb53[_0xc88c('0x39')]);_0x4239fe['attributes']=_[_0xc88c('0x3b')](_0x4ddb53[_0xc88c('0x36')],qs[_0xc88c('0x3d')](_0x2f255b['query'][_0xc88c('0x3d')]));_0x4239fe[_0xc88c('0x3c')]=_0x4239fe['attributes'][_0xc88c('0x3e')]?_0x4239fe[_0xc88c('0x3c')]:_0x4ddb53['model'];if(_0x2f255b['query'][_0xc88c('0x49')]){_0x4239fe[_0xc88c('0x4e')]=[{'all':!![]}];}_0x4239fe=_[_0xc88c('0x45')]({},_0x4239fe,_0x2f255b[_0xc88c('0x48')]);return db[_0xc88c('0x32')][_0xc88c('0x4f')](_0x4239fe)[_0xc88c('0x2c')](handleEntityNotFound(_0x429af5,null))['then'](respondWithResult(_0x429af5,null))['catch'](handleError(_0x429af5,null));};exports[_0xc88c('0x50')]=function(_0x49fbdd,_0x27ccaa){return db[_0xc88c('0x32')][_0xc88c('0x50')](_0x49fbdd[_0xc88c('0x51')],{})[_0xc88c('0x2c')](respondWithResult(_0x27ccaa,0xc9))[_0xc88c('0x4c')](handleError(_0x27ccaa,null));};exports[_0xc88c('0x52')]=function(_0x31139a,_0x95ef6f){if(_0x31139a[_0xc88c('0x51')]['id']){delete _0x31139a[_0xc88c('0x51')]['id'];}return db['ChatInternalMessage'][_0xc88c('0x4f')]({'where':{'id':_0x31139a[_0xc88c('0x4d')]['id']}})[_0xc88c('0x2c')](handleEntityNotFound(_0x95ef6f,null))[_0xc88c('0x2c')](saveUpdates(_0x31139a[_0xc88c('0x51')],null))['then'](respondWithResult(_0x95ef6f,null))['catch'](handleError(_0x95ef6f,null));};exports[_0xc88c('0x2d')]=function(_0x512403,_0x109648){return db[_0xc88c('0x32')]['find']({'where':{'id':_0x512403[_0xc88c('0x4d')]['id']}})[_0xc88c('0x2c')](handleEntityNotFound(_0x109648,null))['then'](removeEntity(_0x109648,null))[_0xc88c('0x4c')](handleError(_0x109648,null));};exports['describe']=function(_0x2e1c3b,_0x308423){return db['ChatInternalMessage'][_0xc88c('0x53')]()['then'](respondWithResult(_0x308423,null))[_0xc88c('0x4c')](handleError(_0x308423,null));};function wrapUser(_0x54abcc){return function(_0x56c075){var _0x4130d6=_0x54abcc[_0xc88c('0x54')]({'plain':!![]});_0x4130d6[_0xc88c('0x55')]=[];if(_0x56c075){_0x4130d6['lastMessageAt']=_0x56c075[_0xc88c('0x56')];_0x4130d6[_0xc88c('0x57')]=_0x56c075;}else{_0x4130d6[_0xc88c('0x58')]=moment(0x0)[_0xc88c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x4130d6[_0xc88c('0x57')]={};}return _0x4130d6;};}exports['getUsers']=function(_0x4d404f,_0x59b871,_0x1e5c01){var _0x1ea0ff=[];return db[_0xc88c('0x5a')]['findAll']({'where':{'role':[_0xc88c('0x5b'),_0xc88c('0x5c'),_0xc88c('0x5d')]},'attributes':['id',_0xc88c('0x5e'),_0xc88c('0x47'),_0xc88c('0x5f'),_0xc88c('0x60'),_0xc88c('0x61'),'online',_0xc88c('0x62'),_0xc88c('0x63'),_0xc88c('0x64')],'order':qs[_0xc88c('0x41')](_0xc88c('0x65')),'include':[{'model':db[_0xc88c('0x66')],'as':_0xc88c('0x67'),'attributes':['id',_0xc88c('0x47'),_0xc88c('0x68')],'through':{'attributes':[]}}]})[_0xc88c('0x2c')](function(_0x5d61e9){if(_0x5d61e9){var _0x530bc5=_0x4d404f['user'][_0xc88c('0x54')]({'plain':!![]});if(!_0x530bc5)throw new Error(_0xc88c('0x69'));if(_0x530bc5[_0xc88c('0x5f')]==='user'){return db[_0xc88c('0x6a')][_0xc88c('0x4f')]({'where':{'name':'Agents','userProfileId':_0x530bc5[_0xc88c('0x6b')]},'raw':!![]})[_0xc88c('0x2c')](function(_0x392a03){if(_0x392a03){if(_0x392a03['autoAssociation']===0x0){return db[_0xc88c('0x6c')][_0xc88c('0x4a')]({'where':{'sectionId':_0x392a03['id']},'raw':!![]})[_0xc88c('0x2c')](function(_0x57bba0){var _0x381bf7=[];if(_['isEmpty'](_0x57bba0)){_0x381bf7=_[_0xc88c('0x43')](_0x5d61e9,function(_0x304880){if(_0x304880[_0xc88c('0x5f')]!==_0xc88c('0x5b')){return _0x304880;}});return _0x381bf7;}else{for(var _0xbb9dfa=0x0;_0xbb9dfa<_0x5d61e9['length'];_0xbb9dfa++){var _0x154d82=_0x5d61e9[_0xbb9dfa];if(_0x154d82[_0xc88c('0x5f')]==='agent'){var _0x3af848=_['find'](_0x57bba0,function(_0x4fbde8){return _0x4fbde8['resourceId']===_0x154d82['id'];});if(_0x3af848)_0x381bf7[_0xc88c('0x6d')](_0x154d82);}else{_0x381bf7[_0xc88c('0x6d')](_0x154d82);}}return _0x381bf7;}});}else{return _0x5d61e9;}}else{var _0x52edc8=_[_0xc88c('0x43')](_0x5d61e9,function(_0xf58e20){if(_0xf58e20[_0xc88c('0x5f')]!==_0xc88c('0x5b')){return _0xf58e20;}});return _0x52edc8;}});}else{return _0x5d61e9;}}})[_0xc88c('0x2c')](function(_0x31d74e){var _0x2e59c2=[];if(_0x31d74e){_0x1ea0ff=_0x31d74e;for(var _0x7e9996=0x0;_0x7e9996<_0x31d74e[_0xc88c('0x3e')];_0x7e9996+=0x1){_0x1ea0ff[_0x7e9996][_0xc88c('0x55')]=[];_0x2e59c2[_0xc88c('0x6d')](db['ChatInternalMessage'][_0xc88c('0x4f')]({'where':{'FromId':[_0x4d404f[_0xc88c('0x5d')]['id'],_0x31d74e[_0x7e9996]['id']],'ToId':[_0x4d404f[_0xc88c('0x5d')]['id'],_0x31d74e[_0x7e9996]['id']],'ChatGroupId':null},'attributes':['id',_0xc88c('0x56'),_0xc88c('0x6e'),'ToId','read',_0xc88c('0x51')],'order':qs[_0xc88c('0x41')](_0xc88c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc88c('0x2c')](wrapUser(_0x31d74e[_0x7e9996])));}return BPromise[_0xc88c('0x70')](_0x2e59c2);}return[];})[_0xc88c('0x2c')](function(_0x9f1282){return{'rows':_0x9f1282,'count':_0x9f1282['length']};})[_0xc88c('0x2c')](respondWithResult(_0x59b871,null))['catch'](handleError(_0x59b871,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0ba9996..3d360d4 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 _0xd98c=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x49aed9,_0x4a7b44){var _0x5c913e=function(_0x454bf7){while(--_0x454bf7){_0x49aed9['push'](_0x49aed9['shift']());}};_0x5c913e(++_0x4a7b44);}(_0xd98c,0xe3));var _0xcd98=function(_0x1f68e1,_0x206dc8){_0x1f68e1=_0x1f68e1-0x0;var _0x35d201=_0xd98c[_0x1f68e1];return _0x35d201;};'use strict';var EventEmitter=require(_0xcd98('0x0'));var ChatInternalMessage=require(_0xcd98('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcd98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd98('0x3'),'afterDestroy':_0xcd98('0x4')};function emitEvent(_0x2c4b4b){return function(_0x526bc9,_0x5c245c,_0x2c69b5){ChatInternalMessageEvents[_0xcd98('0x5')](_0x2c4b4b+':'+_0x526bc9['id'],_0x526bc9);ChatInternalMessageEvents['emit'](_0x2c4b4b,_0x526bc9);_0x2c69b5(null);};}for(var e in events){if(events[_0xcd98('0x6')](e)){var event=events[e];ChatInternalMessage[_0xcd98('0x7')](e,emitEvent(event));}}module[_0xcd98('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb16a=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0xcba290,_0xd59e33){var _0x5a813b=function(_0x340860){while(--_0x340860){_0xcba290['push'](_0xcba290['shift']());}};_0x5a813b(++_0xd59e33);}(_0xb16a,0x178));var _0xab16=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb16a[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xab16('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xab16('0x1')](0x0);var events={'afterCreate':_0xab16('0x2'),'afterUpdate':_0xab16('0x3'),'afterDestroy':_0xab16('0x4')};function emitEvent(_0x1ddca0){return function(_0x5dae4a,_0x1823cc,_0x4ee03e){ChatInternalMessageEvents[_0xab16('0x5')](_0x1ddca0+':'+_0x5dae4a['id'],_0x5dae4a);ChatInternalMessageEvents['emit'](_0x1ddca0,_0x5dae4a);_0x4ee03e(null);};}for(var e in events){if(events[_0xab16('0x6')](e)){var event=events[e];ChatInternalMessage[_0xab16('0x7')](e,emitEvent(event));}}module[_0xab16('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 3e8408e..3a748a9 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 _0x3ccf=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define'];(function(_0x68b457,_0x525e03){var _0x994162=function(_0x5224f7){while(--_0x5224f7){_0x68b457['push'](_0x68b457['shift']());}};_0x994162(++_0x525e03);}(_0x3ccf,0xd6));var _0xf3cc=function(_0x3fe929,_0x1f90e5){_0x3fe929=_0x3fe929-0x0;var _0x1f46a3=_0x3ccf[_0x3fe929];return _0x1f46a3;};'use strict';var _=require(_0xf3cc('0x0'));var util=require(_0xf3cc('0x1'));var logger=require(_0xf3cc('0x2'))(_0xf3cc('0x3'));var moment=require(_0xf3cc('0x4'));var BPromise=require(_0xf3cc('0x5'));var rp=require(_0xf3cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3cc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3cc('0x8'));module[_0xf3cc('0x9')]=function(_0x50f8e6,_0x5a6dda){return _0x50f8e6[_0xf3cc('0xa')](_0xf3cc('0xb'),attributes,{'tableName':_0xf3cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf3cc('0xd'),'collate':_0xf3cc('0xe')});};
\ No newline at end of file
+var _0x5928=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x41df75,_0x2b4605){var _0x3dfc97=function(_0x567477){while(--_0x567477){_0x41df75['push'](_0x41df75['shift']());}};_0x3dfc97(++_0x2b4605);}(_0x5928,0x14d));var _0x8592=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5928[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8592('0x0'));var util=require(_0x8592('0x1'));var logger=require(_0x8592('0x2'))(_0x8592('0x3'));var moment=require(_0x8592('0x4'));var BPromise=require(_0x8592('0x5'));var rp=require(_0x8592('0x6'));var fs=require('fs');var path=require(_0x8592('0x7'));var rimraf=require(_0x8592('0x8'));var config=require(_0x8592('0x9'));var attributes=require(_0x8592('0xa'));module[_0x8592('0xb')]=function(_0x56150b,_0x1a4118){return _0x56150b[_0x8592('0xc')](_0x8592('0xd'),attributes,{'tableName':_0x8592('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8592('0xf'),'collate':_0x8592('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1d8ee5e..9016114 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 _0x636d=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment'];(function(_0x38d3bd,_0x49f837){var _0x19022c=function(_0x30341f){while(--_0x30341f){_0x38d3bd['push'](_0x38d3bd['shift']());}};_0x19022c(++_0x49f837);}(_0x636d,0xf0));var _0xd636=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x636d[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xd636('0x0'));var util=require(_0xd636('0x1'));var moment=require(_0xd636('0x2'));var BPromise=require(_0xd636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd636('0x4'))['db'];var utils=require(_0xd636('0x5'));var logger=require(_0xd636('0x6'))(_0xd636('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd636('0x8')][_0xd636('0x9')]({'port':0x232a});config['redis']=_[_0xd636('0xa')](config['redis'],{'host':_0xd636('0xb'),'port':0x18eb});var socket=require(_0xd636('0xc'))(new Redis(config[_0xd636('0xd')]));require(_0xd636('0xe'))[_0xd636('0xf')](socket);function respondWithRpcPromise(_0x4b02db,_0x587d55,_0x526e0f){return new BPromise(function(_0x3863db,_0x36099d){return client[_0xd636('0x10')](_0x4b02db,_0x526e0f)[_0xd636('0x11')](function(_0x41784c){logger['info'](_0xd636('0x12'),_0x587d55,_0xd636('0x13'));logger['debug'](_0xd636('0x14'),_0x587d55,_0xd636('0x13'),JSON[_0xd636('0x15')](_0x41784c));if(_0x41784c['error']){if(_0x41784c['error'][_0xd636('0x16')]===0x1f4){logger[_0xd636('0x17')](_0xd636('0x12'),_0x587d55,_0x41784c[_0xd636('0x17')][_0xd636('0x18')]);return _0x36099d(_0x41784c['error']['message']);}logger[_0xd636('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x587d55,_0x41784c['error'][_0xd636('0x18')]);return _0x3863db(_0x41784c[_0xd636('0x17')][_0xd636('0x18')]);}else{logger[_0xd636('0x19')](_0xd636('0x12'),_0x587d55,_0xd636('0x13'));_0x3863db(_0x41784c[_0xd636('0x1a')]['message']);}})['catch'](function(_0x56a6a5){logger[_0xd636('0x17')](_0xd636('0x12'),_0x587d55,_0x56a6a5);_0x36099d(_0x56a6a5);});});}
\ No newline at end of file
+var _0x88b4=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xa9f2e0,_0x4821ed){var _0x4526cc=function(_0x233007){while(--_0x233007){_0xa9f2e0['push'](_0xa9f2e0['shift']());}};_0x4526cc(++_0x4821ed);}(_0x88b4,0xa8));var _0x488b=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x88b4[_0x266ddc];return _0x39c1d7;};'use strict';var _=require(_0x488b('0x0'));var util=require(_0x488b('0x1'));var moment=require(_0x488b('0x2'));var BPromise=require('bluebird');var rs=require(_0x488b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x488b('0x4'));var logger=require(_0x488b('0x5'))(_0x488b('0x6'));var config=require(_0x488b('0x7'));var jayson=require(_0x488b('0x8'));var client=jayson[_0x488b('0x9')][_0x488b('0xa')]({'port':0x232a});config[_0x488b('0xb')]=_[_0x488b('0xc')](config[_0x488b('0xb')],{'host':_0x488b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x488b('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ee69e,_0x40932a,_0x34e733){return new BPromise(function(_0x5b37aa,_0x3066c0){return client[_0x488b('0xf')](_0x4ee69e,_0x34e733)[_0x488b('0x10')](function(_0x453092){logger[_0x488b('0x11')](_0x488b('0x12'),_0x40932a,_0x488b('0x13'));logger[_0x488b('0x14')](_0x488b('0x15'),_0x40932a,_0x488b('0x13'),JSON[_0x488b('0x16')](_0x453092));if(_0x453092['error']){if(_0x453092[_0x488b('0x17')][_0x488b('0x18')]===0x1f4){logger[_0x488b('0x17')](_0x488b('0x12'),_0x40932a,_0x453092['error'][_0x488b('0x19')]);return _0x3066c0(_0x453092[_0x488b('0x17')]['message']);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x40932a,_0x453092[_0x488b('0x17')]['message']);return _0x5b37aa(_0x453092['error']['message']);}else{logger['info'](_0x488b('0x12'),_0x40932a,_0x488b('0x13'));_0x5b37aa(_0x453092[_0x488b('0x1a')][_0x488b('0x19')]);}})[_0x488b('0x1b')](function(_0x4f6edb){logger['error'](_0x488b('0x12'),_0x40932a,_0x4f6edb);_0x3066c0(_0x4f6edb);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2ce5abe..278dcbe 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 _0x674f=['emit','removeListener','register','length','./chatInternalMessage.events','save','remove','update'];(function(_0x75c2cc,_0x3ada99){var _0x340fe4=function(_0x3b2401){while(--_0x3b2401){_0x75c2cc['push'](_0x75c2cc['shift']());}};_0x340fe4(++_0x3ada99);}(_0x674f,0x1c4));var _0xf674=function(_0x34af24,_0x14918f){_0x34af24=_0x34af24-0x0;var _0x33fd87=_0x674f[_0x34af24];return _0x33fd87;};'use strict';var ChatInternalMessageEvents=require(_0xf674('0x0'));var events=[_0xf674('0x1'),_0xf674('0x2'),_0xf674('0x3')];function createListener(_0x44b6fa,_0x5b0df8){return function(_0x3daefd){_0x5b0df8[_0xf674('0x4')](_0x44b6fa,_0x3daefd);};}function removeListener(_0x3fe02a,_0x19f66f){return function(){ChatInternalMessageEvents[_0xf674('0x5')](_0x3fe02a,_0x19f66f);};}exports[_0xf674('0x6')]=function(_0xba55e4){for(var _0x271696=0x0,_0x525450=events[_0xf674('0x7')];_0x271696<_0x525450;_0x271696++){var _0x747ed6=events[_0x271696];var _0x4c2d54=createListener('chatInternalMessage:'+_0x747ed6,_0xba55e4);ChatInternalMessageEvents['on'](_0x747ed6,_0x4c2d54);}};
\ No newline at end of file
+var _0x1775=['update','emit','removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x1fac11,_0x419598){var _0x4d4b72=function(_0x24c1c0){while(--_0x24c1c0){_0x1fac11['push'](_0x1fac11['shift']());}};_0x4d4b72(++_0x419598);}(_0x1775,0xa5));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var ChatInternalMessageEvents=require(_0x5177('0x0'));var events=[_0x5177('0x1'),_0x5177('0x2'),_0x5177('0x3')];function createListener(_0x5151f4,_0x4c6b4a){return function(_0x1d8f64){_0x4c6b4a[_0x5177('0x4')](_0x5151f4,_0x1d8f64);};}function removeListener(_0x4ca381,_0x2ff3b3){return function(){ChatInternalMessageEvents[_0x5177('0x5')](_0x4ca381,_0x2ff3b3);};}exports['register']=function(_0x14099d){for(var _0x277312=0x0,_0x13c7ad=events['length'];_0x277312<_0x13c7ad;_0x277312++){var _0x3afc7d=events[_0x277312];var _0x30e354=createListener(_0x5177('0x6')+_0x3afc7d,_0x14099d);ChatInternalMessageEvents['on'](_0x3afc7d,_0x30e354);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 479ff91..59bcee1 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 _0x1402=['/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0x1402,0x1eb));var _0x2140=function(_0x1170e5,_0xc0e250){_0x1170e5=_0x1170e5-0x0;var _0x3ec902=_0x1402[_0x1170e5];return _0x3ec902;};'use strict';var multer=require(_0x2140('0x0'));var util=require(_0x2140('0x1'));var path=require('path');var timeout=require(_0x2140('0x2'));var express=require(_0x2140('0x3'));var router=express['Router']();var fs_extra=require(_0x2140('0x4'));var auth=require(_0x2140('0x5'));var interaction=require(_0x2140('0x6'));var config=require(_0x2140('0x7'));var controller=require(_0x2140('0x8'));router[_0x2140('0x9')]('/',auth[_0x2140('0xa')](),controller['index']);router['get'](_0x2140('0xb'),auth[_0x2140('0xa')](),controller[_0x2140('0xc')]);router[_0x2140('0x9')](_0x2140('0xd'),auth[_0x2140('0xa')](),controller[_0x2140('0xe')]);router[_0x2140('0x9')](_0x2140('0xf'),auth[_0x2140('0xa')](),controller[_0x2140('0x10')]);router['post']('/',auth[_0x2140('0xa')](),controller[_0x2140('0x11')]);router[_0x2140('0x12')]('/:id',controller[_0x2140('0x13')]);router[_0x2140('0x14')](_0x2140('0xf'),auth[_0x2140('0xa')](),controller[_0x2140('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xbf8e=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b3a32,_0x548cdd){var _0x3d0dd5=function(_0x53b5e5){while(--_0x53b5e5){_0x2b3a32['push'](_0x2b3a32['shift']());}};_0x3d0dd5(++_0x548cdd);}(_0xbf8e,0x100));var _0xebf8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbf8e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xebf8('0x0'));var util=require(_0xebf8('0x1'));var path=require(_0xebf8('0x2'));var timeout=require('connect-timeout');var express=require(_0xebf8('0x3'));var router=express[_0xebf8('0x4')]();var fs_extra=require(_0xebf8('0x5'));var auth=require(_0xebf8('0x6'));var interaction=require(_0xebf8('0x7'));var config=require(_0xebf8('0x8'));var controller=require(_0xebf8('0x9'));router[_0xebf8('0xa')]('/',auth[_0xebf8('0xb')](),controller[_0xebf8('0xc')]);router['get'](_0xebf8('0xd'),auth[_0xebf8('0xb')](),controller['describe']);router[_0xebf8('0xa')](_0xebf8('0xe'),auth[_0xebf8('0xb')](),controller[_0xebf8('0xf')]);router[_0xebf8('0xa')](_0xebf8('0x10'),auth['isAuthenticated'](),controller[_0xebf8('0x11')]);router['post']('/',auth[_0xebf8('0xb')](),controller[_0xebf8('0x12')]);router[_0xebf8('0x13')](_0xebf8('0x10'),controller[_0xebf8('0x14')]);router[_0xebf8('0x15')](_0xebf8('0x10'),auth[_0xebf8('0xb')](),controller[_0xebf8('0x16')]);module[_0xebf8('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 96d3e2e..4e7e820 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 _0x1219=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9121('0x0'));module[_0x9121('0x1')]={'body':{'type':Sequelize[_0x9121('0x2')](_0x9121('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9121('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9121('0x5')]('in','out'),'defaultValue':_0x9121('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9121('0x7')]},'providerName':{'type':Sequelize[_0x9121('0x8')]},'providerResponse':{'type':Sequelize[_0x9121('0x2')]}};
\ No newline at end of file
+var _0xb10b=['DATE','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2bfc60,_0xa254ab){_0x2bfc60=_0x2bfc60-0x0;var _0x44ea2c=_0xb10b[_0x2bfc60];return _0x44ea2c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbb10('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb10('0x4')]('in',_0xbb10('0x5')),'defaultValue':_0xbb10('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbb10('0x6')]},'providerName':{'type':Sequelize[_0xbb10('0x7')]},'providerResponse':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 2429d84..08f0757 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 _0x51b8=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','../../config/logger','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','name','options','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','accept','chat','UserId','user','agent','get','ChatInteraction','interaction','role','null','rejectMessage','ContactId','Sequelize','QueryTypes','contact','User','email','SIP/%s','channel','motionChannel','event','reject','EventManager','rejectmessage','parse','formData','util','ioredis','../../components/interaction/service','api'];(function(_0x1ea7d4,_0x2257bd){var _0x55e995=function(_0x34937a){while(--_0x34937a){_0x1ea7d4['push'](_0x1ea7d4['shift']());}};_0x55e995(++_0x2257bd);}(_0x51b8,0x190));var _0x851b=function(_0x43d4f7,_0x2aba64){_0x43d4f7=_0x43d4f7-0x0;var _0x2ad52e=_0x51b8[_0x43d4f7];return _0x2ad52e;};'use strict';var util=require(_0x851b('0x0'));var _=require('lodash');var Redis=require(_0x851b('0x1'));var interactionService=require(_0x851b('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x851b('0x3'));var config=require(_0x851b('0x4'));var db=require(_0x851b('0x5'))['db'];config[_0x851b('0x6')]=_[_0x851b('0x7')](config['redis'],{'host':_0x851b('0x8'),'port':0x18eb});var socket=require(_0x851b('0x9'))(new Redis(config[_0x851b('0x6')]));require(_0x851b('0xa'))[_0x851b('0xb')](socket);var jayson=require(_0x851b('0xc'));var client=jayson['client'][_0x851b('0xd')]({'port':0x232c});var client9002=jayson[_0x851b('0xe')]['http']({'port':0x232a});var interaction_log=require(_0x851b('0xf'))('chat-interactions');function respondWithRpcPromise(_0x1f7cb3,_0x12ff9a,_0x1076eb,_0x32a3fe){return new Promise(function(_0x294e73,_0x12c168){var _0x40ec72=_0x32a3fe||client;return _0x40ec72[_0x851b('0x10')](_0x1f7cb3,_0x1076eb)[_0x851b('0x11')](function(_0xf4b5d){logger[_0x851b('0x12')](_0x851b('0x13'),_0x12ff9a,_0x851b('0x14'));logger[_0x851b('0x15')](_0x851b('0x16'),_0x12ff9a,'request\x20sent',JSON['stringify'](_0xf4b5d));if(_0xf4b5d[_0x851b('0x17')]){if(_0xf4b5d[_0x851b('0x17')][_0x851b('0x18')]===0x1f4){logger['error'](_0x851b('0x13'),_0x12ff9a,_0xf4b5d[_0x851b('0x17')]['message']);return _0x12c168(_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);}logger[_0x851b('0x17')]('ChatMessage,\x20%s,\x20%s',_0x12ff9a,_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);return _0x294e73(_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);}else{logger['info'](_0x851b('0x13'),_0x12ff9a,'request\x20sent');_0x294e73(_0xf4b5d[_0x851b('0x1a')][_0x851b('0x19')]);}})['catch'](function(_0x179687){logger[_0x851b('0x17')]('ChatMessage,\x20%s,\x20%s',_0x12ff9a,_0x179687);_0x12c168(_0x179687);});});}function respondWithResult(_0x4e1361,_0x701f07){_0x701f07=_0x701f07||0xc8;return function(_0x19bd98){if(_0x19bd98){return _0x4e1361[_0x851b('0x1b')](_0x701f07)[_0x851b('0x1c')](_0x19bd98);}};}function respondWithFilteredResult(_0x32f804,_0x33f352){return function(_0x27d4df){if(_0x27d4df){var _0x2ce246=typeof _0x33f352[_0x851b('0x1d')]===_0x851b('0x1e')&&typeof _0x33f352[_0x851b('0x1f')]===_0x851b('0x1e');var _0x326753=_0x27d4df[_0x851b('0x20')];var _0x249a78=_0x2ce246?0x0:_0x33f352[_0x851b('0x1d')];var _0x3528f5=_0x2ce246?_0x27d4df[_0x851b('0x20')]:_0x33f352[_0x851b('0x1d')]+_0x33f352[_0x851b('0x1f')];var _0x4a9ad1;if(_0x3528f5>=_0x326753){_0x3528f5=_0x326753;_0x4a9ad1=0xc8;}else{_0x4a9ad1=0xce;}_0x32f804['status'](_0x4a9ad1);return _0x32f804[_0x851b('0x21')]('Content-Range',_0x249a78+'-'+_0x3528f5+'/'+_0x326753)[_0x851b('0x1c')](_0x27d4df);}return null;};}function saveUpdates(_0x417e01){return function(_0x38b2d9){if(_0x38b2d9){return _0x38b2d9[_0x851b('0x22')](_0x417e01)[_0x851b('0x11')](function(_0x2c3f4d){return _0x2c3f4d;});}return null;};}function removeEntity(_0x27851a){return function(_0xff943b){if(_0xff943b){return _0xff943b[_0x851b('0x23')]()['then'](function(){_0x27851a[_0x851b('0x1b')](0xcc)[_0x851b('0x24')]();});}};}function handleEntityNotFound(_0x53a6ee){return function(_0x24b79d){if(!_0x24b79d){_0x53a6ee[_0x851b('0x25')](0x194);}return _0x24b79d;};}function handleError(_0x3e9ad2,_0x175491){_0x175491=_0x175491||0x1f4;return function(_0x2d902b){logger['error'](_0x2d902b[_0x851b('0x26')]);if(_0x2d902b['name']){delete _0x2d902b['name'];}_0x3e9ad2[_0x851b('0x1b')](_0x175491)[_0x851b('0x27')](_0x2d902b);};}exports[_0x851b('0x28')]=function(_0x416c6c,_0x5563d4){var _0x2f297d={},_0x1c1fe6={},_0x404a11={'count':0x0,'rows':[]};var _0x1c7d4d=_[_0x851b('0x29')](db[_0x851b('0x2a')][_0x851b('0x2b')],function(_0x51d358){return{'name':_0x51d358[_0x851b('0x2c')],'type':_0x51d358[_0x851b('0x2d')][_0x851b('0x2e')]};});_0x1c1fe6[_0x851b('0x2f')]=_[_0x851b('0x29')](_0x1c7d4d,'name');_0x1c1fe6[_0x851b('0x30')]=_[_0x851b('0x31')](_0x416c6c['query']);_0x1c1fe6['filters']=_[_0x851b('0x32')](_0x1c1fe6['model'],_0x1c1fe6[_0x851b('0x30')]);_0x2f297d[_0x851b('0x33')]=_[_0x851b('0x32')](_0x1c1fe6['model'],qs[_0x851b('0x34')](_0x416c6c['query'][_0x851b('0x34')]));_0x2f297d[_0x851b('0x33')]=_0x2f297d[_0x851b('0x33')][_0x851b('0x35')]?_0x2f297d['attributes']:_0x1c1fe6['model'];if(!_0x416c6c['query'][_0x851b('0x36')]('nolimit')){_0x2f297d[_0x851b('0x1f')]=qs[_0x851b('0x1f')](_0x416c6c[_0x851b('0x30')][_0x851b('0x1f')]);_0x2f297d[_0x851b('0x1d')]=qs[_0x851b('0x1d')](_0x416c6c['query']['offset']);}_0x2f297d[_0x851b('0x37')]=qs[_0x851b('0x38')](_0x416c6c[_0x851b('0x30')][_0x851b('0x38')]);_0x2f297d[_0x851b('0x39')]=qs[_0x851b('0x3a')](_[_0x851b('0x3b')](_0x416c6c[_0x851b('0x30')],_0x1c1fe6[_0x851b('0x3a')]),_0x1c7d4d);if(_0x416c6c[_0x851b('0x30')][_0x851b('0x3c')]){_0x2f297d[_0x851b('0x39')]=_[_0x851b('0x3d')](_0x2f297d['where'],{'$or':_[_0x851b('0x29')](_0x1c7d4d,function(_0x345f97){if(_0x345f97['type']!=='VIRTUAL'){var _0x2b3237={};_0x2b3237[_0x345f97[_0x851b('0x3e')]]={'$like':'%'+_0x416c6c[_0x851b('0x30')][_0x851b('0x3c')]+'%'};return _0x2b3237;}})});}_0x2f297d=_[_0x851b('0x3d')]({},_0x2f297d,_0x416c6c[_0x851b('0x3f')]);var _0x577dcc={'where':_0x2f297d[_0x851b('0x39')]};return db[_0x851b('0x2a')][_0x851b('0x20')](_0x577dcc)[_0x851b('0x11')](function(_0x54b668){_0x404a11['count']=_0x54b668;if(_0x416c6c['query'][_0x851b('0x40')]){_0x2f297d['include']=[{'all':!![]}];}return db[_0x851b('0x2a')][_0x851b('0x41')](_0x2f297d);})[_0x851b('0x11')](function(_0x454939){_0x404a11[_0x851b('0x42')]=_0x454939;return _0x404a11;})[_0x851b('0x11')](respondWithFilteredResult(_0x5563d4,_0x2f297d))['catch'](handleError(_0x5563d4,null));};exports[_0x851b('0x43')]=function(_0x40ee53,_0x2a821d){var _0x1c7b45={'raw':!![],'where':{'id':_0x40ee53[_0x851b('0x44')]['id']}},_0x13fa3a={};_0x13fa3a['model']=_[_0x851b('0x31')](db[_0x851b('0x2a')][_0x851b('0x2b')]);_0x13fa3a[_0x851b('0x30')]=_[_0x851b('0x31')](_0x40ee53['query']);_0x13fa3a['filters']=_[_0x851b('0x32')](_0x13fa3a[_0x851b('0x2f')],_0x13fa3a[_0x851b('0x30')]);_0x1c7b45[_0x851b('0x33')]=_['intersection'](_0x13fa3a[_0x851b('0x2f')],qs['fields'](_0x40ee53[_0x851b('0x30')]['fields']));_0x1c7b45[_0x851b('0x33')]=_0x1c7b45[_0x851b('0x33')]['length']?_0x1c7b45[_0x851b('0x33')]:_0x13fa3a[_0x851b('0x2f')];if(_0x40ee53[_0x851b('0x30')][_0x851b('0x40')]){_0x1c7b45[_0x851b('0x45')]=[{'all':!![]}];}_0x1c7b45=_[_0x851b('0x3d')]({},_0x1c7b45,_0x40ee53[_0x851b('0x3f')]);return db[_0x851b('0x2a')]['find'](_0x1c7b45)[_0x851b('0x11')](handleEntityNotFound(_0x2a821d,null))[_0x851b('0x11')](respondWithResult(_0x2a821d,null))[_0x851b('0x46')](handleError(_0x2a821d,null));};exports[_0x851b('0x47')]=function(_0x42a48b,_0x379b1){return db[_0x851b('0x2a')][_0x851b('0x47')](_0x42a48b['body'],{})[_0x851b('0x11')](respondWithResult(_0x379b1,0xc9))[_0x851b('0x46')](handleError(_0x379b1,null));};exports[_0x851b('0x22')]=function(_0x189529,_0x3cc46c){if(_0x189529[_0x851b('0x48')]['id']){delete _0x189529[_0x851b('0x48')]['id'];}return db[_0x851b('0x2a')][_0x851b('0x49')]({'where':{'id':_0x189529[_0x851b('0x44')]['id']}})[_0x851b('0x11')](handleEntityNotFound(_0x3cc46c,null))[_0x851b('0x11')](saveUpdates(_0x189529[_0x851b('0x48')],null))[_0x851b('0x11')](respondWithResult(_0x3cc46c,null))['catch'](handleError(_0x3cc46c,null));};exports[_0x851b('0x23')]=function(_0x107c0a,_0x3cb7e5){return db['ChatMessage']['find']({'where':{'id':_0x107c0a[_0x851b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3cb7e5,null))[_0x851b('0x11')](removeEntity(_0x3cb7e5,null))[_0x851b('0x46')](handleError(_0x3cb7e5,null));};exports[_0x851b('0x4a')]=function(_0xe1413c,_0x5297f7){return db[_0x851b('0x2a')][_0x851b('0x4a')]()['then'](respondWithResult(_0x5297f7,null))['catch'](handleError(_0x5297f7,null));};exports[_0x851b('0x4b')]=function(_0x1d9de4,_0x33b1ae){var _0x4a7c36=_0x851b('0x4c');return interactionService['acceptMessage'](_0x1d9de4,_0x4a7c36)[_0x851b('0x11')](respondWithResult(_0x33b1ae,null))[_0x851b('0x46')](handleError(_0x33b1ae,null));};exports['reject']=function(_0x1fb3a2,_0x9702e1){var _0x1b6386={'agent':{},'channel':_0x851b('0x4c')};if(_0x1fb3a2['body']['id']){delete _0x1fb3a2['body']['id'];}_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')]=_0x1fb3a2['body'][_0x851b('0x4d')]||_0x1fb3a2[_0x851b('0x4e')]['id'];_0x1b6386[_0x851b('0x4f')]['id']=_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')];return db[_0x851b('0x2a')][_0x851b('0x49')]({'where':{'id':_0x1fb3a2[_0x851b('0x44')]['id'],'UserId':null}})[_0x851b('0x11')](handleEntityNotFound(_0x9702e1,null))['then'](function(_0x4ad686){if(_0x4ad686){_0x1b6386[_0x851b('0x19')]=_0x4ad686[_0x851b('0x50')]({'plain':!![]});return db[_0x851b('0x51')][_0x851b('0x49')]({'where':{'id':_0x4ad686['ChatInteractionId']}});}return null;})[_0x851b('0x11')](handleEntityNotFound(_0x9702e1,null))[_0x851b('0x11')](function(_0x3b62f2){if(_0x3b62f2){_0x1b6386[_0x851b('0x52')]=_0x3b62f2[_0x851b('0x50')]({'plain':!![]});interaction_log[_0x851b('0x12')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fb3a2[_0x851b('0x4e')]['id'],_0x1fb3a2[_0x851b('0x4e')]['name'],_0x1fb3a2[_0x851b('0x4e')][_0x851b('0x53')],_0x1b6386[_0x851b('0x52')]['id'],_0x1fb3a2[_0x851b('0x48')]?JSON['stringify'](_0x1fb3a2['body']):_0x851b('0x54'));return respondWithRpcPromise('RejectMessage',_0x851b('0x55'),_0x1b6386);}return null;})[_0x851b('0x11')](function(_0x5a9ff0){var _0x3852d2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a9ff0[_0x851b('0x19')][_0x851b('0x56')];return db['sequelize']['query'](_0x3852d2,{'type':db[_0x851b('0x57')][_0x851b('0x58')]['SELECT'],'raw':!![]})['then'](function(_0x51e0da){return _0x51e0da;});})[_0x851b('0x11')](function(_0x2f1e7a){if(_0x2f1e7a){_0x1b6386[_0x851b('0x19')][_0x851b('0x59')]=_0x2f1e7a[0x0];if(!_0x1fb3a2[_0x851b('0x48')]['UserId'])return;return db[_0x851b('0x5a')][_0x851b('0x49')]({'where':{'id':_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')],'role':'agent'},'attributes':['id',_0x851b('0x3e'),'fullname',_0x851b('0x5b'),'internal'],'raw':!![]});}return null;})[_0x851b('0x11')](function(_0x27ea2f){if(!_0x27ea2f)return null;_0x1b6386[_0x851b('0x19')][_0x851b('0x4f')]=_0x27ea2f;return _0x1b6386;})[_0x851b('0x11')](function(_0x2f084c){if(_0x2f084c){_0x2f084c['message']['interface']=util['format'](_0x851b('0x5c'),_0x1fb3a2[_0x851b('0x4e')][_0x851b('0x3e')]);_0x2f084c[_0x851b('0x19')]['channel']=_0x1b6386[_0x851b('0x5d')];_0x2f084c[_0x851b('0x19')][_0x851b('0x5e')]=_0x1b6386[_0x851b('0x5d')];_0x2f084c[_0x851b('0x19')][_0x851b('0x5f')]=_0x851b('0x60');respondWithRpcPromise(_0x851b('0x61'),'EventManager',{'event':_0x851b('0x62'),'message':_[_0x851b('0x3d')](_0x1b6386[_0x851b('0x19')],JSON[_0x851b('0x63')](_0x1b6386['interaction'][_0x851b('0x64')]))},client9002);return _0x1b6386;}return null;})[_0x851b('0x11')](respondWithResult(_0x9702e1,null))[_0x851b('0x46')](handleError(_0x9702e1,null));};
\ No newline at end of file
+var _0x2423=['stack','send','index','map','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','findAll','show','params','include','find','create','body','destroy','describe','accept','chat','reject','UserId','agent','get','ChatInteraction','ChatInteractionId','interaction','user','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','internal','format','channel','motionChannel','EventManager','rejectmessage','parse','util','../../components/parsers/qs','../../config/logger','api','redis','localhost','socket.io-emitter','register','jayson/promise','client','chat-interactions','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus'];(function(_0x1bac9a,_0x49f25b){var _0x39b6aa=function(_0x180ad4){while(--_0x180ad4){_0x1bac9a['push'](_0x1bac9a['shift']());}};_0x39b6aa(++_0x49f25b);}(_0x2423,0x107));var _0x3242=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2423[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3242('0x0'));var _=require('lodash');var Redis=require('ioredis');var interactionService=require('../../components/interaction/service');var qs=require(_0x3242('0x1'));var logger=require(_0x3242('0x2'))(_0x3242('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3242('0x4')],{'host':_0x3242('0x5'),'port':0x18eb});var socket=require(_0x3242('0x6'))(new Redis(config[_0x3242('0x4')]));require('./chatMessage.socket')[_0x3242('0x7')](socket);var jayson=require(_0x3242('0x8'));var client=jayson[_0x3242('0x9')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var interaction_log=require(_0x3242('0x2'))(_0x3242('0xa'));function respondWithRpcPromise(_0x260281,_0x3608cb,_0x3e8850,_0x1a0e5a){return new Promise(function(_0x4a9f53,_0x41b315){var _0x12d13f=_0x1a0e5a||client;return _0x12d13f[_0x3242('0xb')](_0x260281,_0x3e8850)[_0x3242('0xc')](function(_0x2c98d8){logger[_0x3242('0xd')](_0x3242('0xe'),_0x3608cb,_0x3242('0xf'));logger[_0x3242('0x10')](_0x3242('0x11'),_0x3608cb,_0x3242('0xf'),JSON[_0x3242('0x12')](_0x2c98d8));if(_0x2c98d8[_0x3242('0x13')]){if(_0x2c98d8[_0x3242('0x13')][_0x3242('0x14')]===0x1f4){logger[_0x3242('0x13')](_0x3242('0xe'),_0x3608cb,_0x2c98d8[_0x3242('0x13')]['message']);return _0x41b315(_0x2c98d8[_0x3242('0x13')][_0x3242('0x15')]);}logger[_0x3242('0x13')](_0x3242('0xe'),_0x3608cb,_0x2c98d8[_0x3242('0x13')][_0x3242('0x15')]);return _0x4a9f53(_0x2c98d8[_0x3242('0x13')][_0x3242('0x15')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3608cb,_0x3242('0xf'));_0x4a9f53(_0x2c98d8[_0x3242('0x16')][_0x3242('0x15')]);}})[_0x3242('0x17')](function(_0x464128){logger[_0x3242('0x13')](_0x3242('0xe'),_0x3608cb,_0x464128);_0x41b315(_0x464128);});});}function respondWithResult(_0x4d0e70,_0x47aa52){_0x47aa52=_0x47aa52||0xc8;return function(_0x59b8e3){if(_0x59b8e3){return _0x4d0e70['status'](_0x47aa52)[_0x3242('0x18')](_0x59b8e3);}};}function respondWithFilteredResult(_0x208bb7,_0x4945e3){return function(_0x22cc74){if(_0x22cc74){var _0x28335d=typeof _0x4945e3[_0x3242('0x19')]===_0x3242('0x1a')&&typeof _0x4945e3[_0x3242('0x1b')]===_0x3242('0x1a');var _0x333829=_0x22cc74[_0x3242('0x1c')];var _0xba175d=_0x28335d?0x0:_0x4945e3[_0x3242('0x19')];var _0x2809d2=_0x28335d?_0x22cc74[_0x3242('0x1c')]:_0x4945e3[_0x3242('0x19')]+_0x4945e3[_0x3242('0x1b')];var _0xdc9fae;if(_0x2809d2>=_0x333829){_0x2809d2=_0x333829;_0xdc9fae=0xc8;}else{_0xdc9fae=0xce;}_0x208bb7['status'](_0xdc9fae);return _0x208bb7[_0x3242('0x1d')](_0x3242('0x1e'),_0xba175d+'-'+_0x2809d2+'/'+_0x333829)['json'](_0x22cc74);}return null;};}function saveUpdates(_0x1cfb12){return function(_0x491561){if(_0x491561){return _0x491561[_0x3242('0x1f')](_0x1cfb12)[_0x3242('0xc')](function(_0x59b328){return _0x59b328;});}return null;};}function removeEntity(_0x151548){return function(_0x30d8c2){if(_0x30d8c2){return _0x30d8c2['destroy']()['then'](function(){_0x151548['status'](0xcc)[_0x3242('0x20')]();});}};}function handleEntityNotFound(_0x28ff70){return function(_0x3b8d4f){if(!_0x3b8d4f){_0x28ff70[_0x3242('0x21')](0x194);}return _0x3b8d4f;};}function handleError(_0x14771b,_0x4d0b5e){_0x4d0b5e=_0x4d0b5e||0x1f4;return function(_0x38960b){logger[_0x3242('0x13')](_0x38960b[_0x3242('0x22')]);if(_0x38960b['name']){delete _0x38960b['name'];}_0x14771b['status'](_0x4d0b5e)[_0x3242('0x23')](_0x38960b);};}exports[_0x3242('0x24')]=function(_0x5cb356,_0x34c8a0){var _0x18f01f={},_0x272f66={},_0x217fe9={'count':0x0,'rows':[]};var _0x5612f9=_[_0x3242('0x25')](db['ChatMessage'][_0x3242('0x26')],function(_0x3845a2){return{'name':_0x3845a2['fieldName'],'type':_0x3845a2['type'][_0x3242('0x27')]};});_0x272f66[_0x3242('0x28')]=_[_0x3242('0x25')](_0x5612f9,_0x3242('0x29'));_0x272f66['query']=_[_0x3242('0x2a')](_0x5cb356[_0x3242('0x2b')]);_0x272f66[_0x3242('0x2c')]=_[_0x3242('0x2d')](_0x272f66[_0x3242('0x28')],_0x272f66[_0x3242('0x2b')]);_0x18f01f[_0x3242('0x2e')]=_[_0x3242('0x2d')](_0x272f66[_0x3242('0x28')],qs['fields'](_0x5cb356[_0x3242('0x2b')][_0x3242('0x2f')]));_0x18f01f[_0x3242('0x2e')]=_0x18f01f['attributes'][_0x3242('0x30')]?_0x18f01f[_0x3242('0x2e')]:_0x272f66[_0x3242('0x28')];if(!_0x5cb356[_0x3242('0x2b')][_0x3242('0x31')](_0x3242('0x32'))){_0x18f01f['limit']=qs[_0x3242('0x1b')](_0x5cb356['query'][_0x3242('0x1b')]);_0x18f01f[_0x3242('0x19')]=qs[_0x3242('0x19')](_0x5cb356[_0x3242('0x2b')][_0x3242('0x19')]);}_0x18f01f[_0x3242('0x33')]=qs[_0x3242('0x34')](_0x5cb356[_0x3242('0x2b')][_0x3242('0x34')]);_0x18f01f[_0x3242('0x35')]=qs[_0x3242('0x2c')](_[_0x3242('0x36')](_0x5cb356[_0x3242('0x2b')],_0x272f66['filters']),_0x5612f9);if(_0x5cb356['query'][_0x3242('0x37')]){_0x18f01f[_0x3242('0x35')]=_[_0x3242('0x38')](_0x18f01f[_0x3242('0x35')],{'$or':_[_0x3242('0x25')](_0x5612f9,function(_0xb9713d){if(_0xb9713d['type']!==_0x3242('0x39')){var _0x23d368={};_0x23d368[_0xb9713d[_0x3242('0x29')]]={'$like':'%'+_0x5cb356['query'][_0x3242('0x37')]+'%'};return _0x23d368;}})});}_0x18f01f=_['merge']({},_0x18f01f,_0x5cb356[_0x3242('0x3a')]);var _0x1a212a={'where':_0x18f01f[_0x3242('0x35')]};return db[_0x3242('0x3b')][_0x3242('0x1c')](_0x1a212a)['then'](function(_0x5d6720){_0x217fe9[_0x3242('0x1c')]=_0x5d6720;if(_0x5cb356[_0x3242('0x2b')][_0x3242('0x3c')]){_0x18f01f['include']=[{'all':!![]}];}return db[_0x3242('0x3b')][_0x3242('0x3d')](_0x18f01f);})[_0x3242('0xc')](function(_0x16bb1f){_0x217fe9['rows']=_0x16bb1f;return _0x217fe9;})[_0x3242('0xc')](respondWithFilteredResult(_0x34c8a0,_0x18f01f))[_0x3242('0x17')](handleError(_0x34c8a0,null));};exports[_0x3242('0x3e')]=function(_0x546ef1,_0x1aa92c){var _0x1738f2={'raw':!![],'where':{'id':_0x546ef1[_0x3242('0x3f')]['id']}},_0x568862={};_0x568862[_0x3242('0x28')]=_['keys'](db[_0x3242('0x3b')]['rawAttributes']);_0x568862['query']=_[_0x3242('0x2a')](_0x546ef1[_0x3242('0x2b')]);_0x568862[_0x3242('0x2c')]=_['intersection'](_0x568862[_0x3242('0x28')],_0x568862[_0x3242('0x2b')]);_0x1738f2[_0x3242('0x2e')]=_[_0x3242('0x2d')](_0x568862[_0x3242('0x28')],qs[_0x3242('0x2f')](_0x546ef1[_0x3242('0x2b')][_0x3242('0x2f')]));_0x1738f2[_0x3242('0x2e')]=_0x1738f2[_0x3242('0x2e')][_0x3242('0x30')]?_0x1738f2['attributes']:_0x568862[_0x3242('0x28')];if(_0x546ef1[_0x3242('0x2b')][_0x3242('0x3c')]){_0x1738f2[_0x3242('0x40')]=[{'all':!![]}];}_0x1738f2=_[_0x3242('0x38')]({},_0x1738f2,_0x546ef1[_0x3242('0x3a')]);return db[_0x3242('0x3b')][_0x3242('0x41')](_0x1738f2)['then'](handleEntityNotFound(_0x1aa92c,null))['then'](respondWithResult(_0x1aa92c,null))[_0x3242('0x17')](handleError(_0x1aa92c,null));};exports['create']=function(_0xb41a6a,_0x5b4acb){return db[_0x3242('0x3b')][_0x3242('0x42')](_0xb41a6a['body'],{})['then'](respondWithResult(_0x5b4acb,0xc9))['catch'](handleError(_0x5b4acb,null));};exports[_0x3242('0x1f')]=function(_0x2128f2,_0x4fc2ff){if(_0x2128f2[_0x3242('0x43')]['id']){delete _0x2128f2[_0x3242('0x43')]['id'];}return db[_0x3242('0x3b')][_0x3242('0x41')]({'where':{'id':_0x2128f2[_0x3242('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4fc2ff,null))[_0x3242('0xc')](saveUpdates(_0x2128f2[_0x3242('0x43')],null))[_0x3242('0xc')](respondWithResult(_0x4fc2ff,null))[_0x3242('0x17')](handleError(_0x4fc2ff,null));};exports[_0x3242('0x44')]=function(_0x3d1bb9,_0x52aa57){return db[_0x3242('0x3b')][_0x3242('0x41')]({'where':{'id':_0x3d1bb9[_0x3242('0x3f')]['id']}})[_0x3242('0xc')](handleEntityNotFound(_0x52aa57,null))[_0x3242('0xc')](removeEntity(_0x52aa57,null))[_0x3242('0x17')](handleError(_0x52aa57,null));};exports[_0x3242('0x45')]=function(_0x1a7657,_0x1dd352){return db[_0x3242('0x3b')]['describe']()[_0x3242('0xc')](respondWithResult(_0x1dd352,null))[_0x3242('0x17')](handleError(_0x1dd352,null));};exports[_0x3242('0x46')]=function(_0x8cbcab,_0x47cc88){var _0x40f0e6=_0x3242('0x47');return interactionService['acceptMessage'](_0x8cbcab,_0x40f0e6)[_0x3242('0xc')](respondWithResult(_0x47cc88,null))['catch'](handleError(_0x47cc88,null));};exports[_0x3242('0x48')]=function(_0x15b9bc,_0x219a25){var _0x33c332={'agent':{},'channel':_0x3242('0x47')};if(_0x15b9bc[_0x3242('0x43')]['id']){delete _0x15b9bc[_0x3242('0x43')]['id'];}_0x15b9bc[_0x3242('0x43')][_0x3242('0x49')]=_0x15b9bc[_0x3242('0x43')][_0x3242('0x49')]||_0x15b9bc['user']['id'];_0x33c332[_0x3242('0x4a')]['id']=_0x15b9bc[_0x3242('0x43')][_0x3242('0x49')];return db[_0x3242('0x3b')][_0x3242('0x41')]({'where':{'id':_0x15b9bc['params']['id'],'UserId':null}})[_0x3242('0xc')](handleEntityNotFound(_0x219a25,null))[_0x3242('0xc')](function(_0x7544db){if(_0x7544db){_0x33c332['message']=_0x7544db[_0x3242('0x4b')]({'plain':!![]});return db[_0x3242('0x4c')][_0x3242('0x41')]({'where':{'id':_0x7544db[_0x3242('0x4d')]}});}return null;})[_0x3242('0xc')](handleEntityNotFound(_0x219a25,null))[_0x3242('0xc')](function(_0x417ef4){if(_0x417ef4){_0x33c332[_0x3242('0x4e')]=_0x417ef4[_0x3242('0x4b')]({'plain':!![]});interaction_log[_0x3242('0xd')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x15b9bc['user']['id'],_0x15b9bc[_0x3242('0x4f')][_0x3242('0x29')],_0x15b9bc[_0x3242('0x4f')][_0x3242('0x50')],_0x33c332[_0x3242('0x4e')]['id'],_0x15b9bc[_0x3242('0x43')]?JSON[_0x3242('0x12')](_0x15b9bc['body']):_0x3242('0x51'));return respondWithRpcPromise(_0x3242('0x52'),_0x3242('0x53'),_0x33c332);}return null;})[_0x3242('0xc')](function(_0x4d7109){var _0x271190=_0x3242('0x54')+_0x4d7109[_0x3242('0x15')][_0x3242('0x55')];return db[_0x3242('0x56')][_0x3242('0x2b')](_0x271190,{'type':db[_0x3242('0x57')]['QueryTypes'][_0x3242('0x58')],'raw':!![]})[_0x3242('0xc')](function(_0x2aff15){return _0x2aff15;});})[_0x3242('0xc')](function(_0x667837){if(_0x667837){_0x33c332[_0x3242('0x15')][_0x3242('0x59')]=_0x667837[0x0];if(!_0x15b9bc[_0x3242('0x43')]['UserId'])return;return db[_0x3242('0x5a')]['find']({'where':{'id':_0x15b9bc[_0x3242('0x43')][_0x3242('0x49')],'role':_0x3242('0x4a')},'attributes':['id',_0x3242('0x29'),_0x3242('0x5b'),'email',_0x3242('0x5c')],'raw':!![]});}return null;})['then'](function(_0x138398){if(!_0x138398)return null;_0x33c332[_0x3242('0x15')][_0x3242('0x4a')]=_0x138398;return _0x33c332;})[_0x3242('0xc')](function(_0x1b7921){if(_0x1b7921){_0x1b7921['message']['interface']=util[_0x3242('0x5d')]('SIP/%s',_0x15b9bc[_0x3242('0x4f')][_0x3242('0x29')]);_0x1b7921[_0x3242('0x15')]['channel']=_0x33c332[_0x3242('0x5e')];_0x1b7921[_0x3242('0x15')][_0x3242('0x5f')]=_0x33c332[_0x3242('0x5e')];_0x1b7921[_0x3242('0x15')]['event']='reject';respondWithRpcPromise(_0x3242('0x60'),'EventManager',{'event':_0x3242('0x61'),'message':_[_0x3242('0x38')](_0x33c332[_0x3242('0x15')],JSON[_0x3242('0x62')](_0x33c332['interaction']['formData']))},client9002);return _0x33c332;}return null;})[_0x3242('0xc')](respondWithResult(_0x219a25,null))[_0x3242('0x17')](handleError(_0x219a25,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 7fbf39d..2aec584 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 _0x13b9=['remove','hasOwnProperty','exports','ChatMessage'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x13b9,0x117));var _0x913b=function(_0x66b39c,_0xad7354){_0x66b39c=_0x66b39c-0x0;var _0x451fe4=_0x13b9[_0x66b39c];return _0x451fe4;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x913b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x913b('0x1')};function emitEvent(_0x160366){return function(_0x3a1ae1,_0x422c3e,_0xe52964){ChatMessageEvents['emit'](_0x160366+':'+_0x3a1ae1['id'],_0x3a1ae1);ChatMessageEvents['emit'](_0x160366,_0x3a1ae1);_0xe52964(null);};}for(var e in events){if(events[_0x913b('0x2')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x913b('0x3')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3ff4=['emit','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x5043c7,_0x40e9d5){var _0x3f2079=function(_0x360719){while(--_0x360719){_0x5043c7['push'](_0x5043c7['shift']());}};_0x3f2079(++_0x40e9d5);}(_0x3ff4,0xd3));var _0x43ff=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x3ff4[_0x1d24eb];return _0x1dc576;};'use strict';var EventEmitter=require(_0x43ff('0x0'));var ChatMessage=require(_0x43ff('0x1'))['db'][_0x43ff('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x43ff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x43ff('0x4'),'afterDestroy':_0x43ff('0x5')};function emitEvent(_0x32e4bc){return function(_0x375d61,_0x37811b,_0xd68234){ChatMessageEvents[_0x43ff('0x6')](_0x32e4bc+':'+_0x375d61['id'],_0x375d61);ChatMessageEvents[_0x43ff('0x6')](_0x32e4bc,_0x375d61);_0xd68234(null);};}for(var e in events){if(events['hasOwnProperty'](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 166e9ef..c04a5db 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 _0xe797=['moment','bluebird','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x15664f,_0x3c74c5){var _0x1747f1=function(_0x3ca956){while(--_0x3ca956){_0x15664f['push'](_0x15664f['shift']());}};_0x1747f1(++_0x3c74c5);}(_0xe797,0x1da));var _0x7e79=function(_0x409c62,_0x52c0f5){_0x409c62=_0x409c62-0x0;var _0x15c3b6=_0xe797[_0x409c62];return _0x15c3b6;};'use strict';var _=require('lodash');var util=require(_0x7e79('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7e79('0x1'));var BPromise=require(_0x7e79('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e79('0x3'));var config=require(_0x7e79('0x4'));var attributes=require(_0x7e79('0x5'));module['exports']=function(_0x3ee086,_0x531453){return _0x3ee086[_0x7e79('0x6')](_0x7e79('0x7'),attributes,{'tableName':_0x7e79('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e79('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cdaba,_0xc4d48,_0x4b202f){var _0x388dca=_0x3ee086[_0x7e79('0xa')];var _0x52a7d3=_0x1cdaba[_0x7e79('0xb')]({'plain':!![]});if(_0x52a7d3[_0x7e79('0xc')][_0x7e79('0xd')]()==='in'||_0x52a7d3[_0x7e79('0xc')][_0x7e79('0xd')]()==='out'&&!_0x52a7d3[_0x7e79('0xe')]&&!_[_0x7e79('0xf')](_0x52a7d3[_0x7e79('0x10')])){_0x388dca[_0x7e79('0x11')][_0x7e79('0x12')]({'where':{'id':_0x52a7d3[_0x7e79('0x13')]}})[_0x7e79('0x14')](function(_0x118236){if(_0x118236){_0x118236['update']({'lastMsgAt':_0x52a7d3[_0x7e79('0x15')],'lastMsgDirection':_0x52a7d3[_0x7e79('0xc')]['toLowerCase']()});}})[_0x7e79('0x16')](function(_0x3fc7e4){console['error'](_0x3fc7e4);});}_0x4b202f();}},'charset':_0x7e79('0x17'),'collate':_0x7e79('0x18')});};
\ No newline at end of file
+var _0xfb64=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','get','direction','toLowerCase','out','UserId','findOne'];(function(_0x152929,_0x1456d0){var _0x4c0dc7=function(_0x12628a){while(--_0x12628a){_0x152929['push'](_0x152929['shift']());}};_0x4c0dc7(++_0x1456d0);}(_0xfb64,0x157));var _0x4fb6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfb64[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4fb6('0x0'));var util=require(_0x4fb6('0x1'));var logger=require(_0x4fb6('0x2'))(_0x4fb6('0x3'));var moment=require(_0x4fb6('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fb6('0x5'));var fs=require('fs');var path=require(_0x4fb6('0x6'));var rimraf=require(_0x4fb6('0x7'));var config=require(_0x4fb6('0x8'));var attributes=require(_0x4fb6('0x9'));module[_0x4fb6('0xa')]=function(_0x3aa438,_0x214021){return _0x3aa438[_0x4fb6('0xb')](_0x4fb6('0xc'),attributes,{'tableName':_0x4fb6('0xd'),'paranoid':![],'indexes':[{'name':_0x4fb6('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfad1b1,_0x3e03d6,_0x557912){var _0x45e655=_0x3aa438['models'];var _0x1208c2=_0xfad1b1[_0x4fb6('0xf')]({'plain':!![]});if(_0x1208c2[_0x4fb6('0x10')][_0x4fb6('0x11')]()==='in'||_0x1208c2[_0x4fb6('0x10')][_0x4fb6('0x11')]()===_0x4fb6('0x12')&&!_0x1208c2['secret']&&!_['isNil'](_0x1208c2[_0x4fb6('0x13')])){_0x45e655['ChatInteraction'][_0x4fb6('0x14')]({'where':{'id':_0x1208c2['ChatInteractionId']}})[_0x4fb6('0x15')](function(_0x333e9c){if(_0x333e9c){_0x333e9c[_0x4fb6('0x16')]({'lastMsgAt':_0x1208c2[_0x4fb6('0x17')],'lastMsgDirection':_0x1208c2[_0x4fb6('0x10')][_0x4fb6('0x11')]()});}})[_0x4fb6('0x18')](function(_0x4d8104){console[_0x4fb6('0x19')](_0x4d8104);});}_0x557912();}},'charset':_0x4fb6('0x1a'),'collate':_0x4fb6('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 1742f73..3bffc2d 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 _0x7c24=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','raw','then','debug','CreateChatMessage','lodash','util','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7c24,0xf9));var _0x47c2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7c24[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x47c2('0x0'));var util=require(_0x47c2('0x1'));var moment=require(_0x47c2('0x2'));var BPromise=require(_0x47c2('0x3'));var rs=require(_0x47c2('0x4'));var fs=require('fs');var Redis=require(_0x47c2('0x5'));var db=require(_0x47c2('0x6'))['db'];var utils=require(_0x47c2('0x7'));var logger=require(_0x47c2('0x8'))(_0x47c2('0x9'));var config=require(_0x47c2('0xa'));var jayson=require(_0x47c2('0xb'));var client=jayson[_0x47c2('0xc')][_0x47c2('0xd')]({'port':0x232a});config['redis']=_[_0x47c2('0xe')](config['redis'],{'host':_0x47c2('0xf'),'port':0x18eb});var socket=require(_0x47c2('0x10'))(new Redis(config[_0x47c2('0x11')]));require(_0x47c2('0x12'))[_0x47c2('0x13')](socket);function respondWithRpcPromise(_0x40c88a,_0x398bc8,_0xd84fcc){return new BPromise(function(_0x1dd2d9,_0x5554f2){return client['request'](_0x40c88a,_0xd84fcc)['then'](function(_0x27749e){logger['info'](_0x47c2('0x14'),_0x398bc8,_0x47c2('0x15'));logger['debug'](_0x47c2('0x16'),_0x398bc8,_0x47c2('0x15'),JSON[_0x47c2('0x17')](_0x27749e));if(_0x27749e[_0x47c2('0x18')]){if(_0x27749e[_0x47c2('0x18')][_0x47c2('0x19')]===0x1f4){logger[_0x47c2('0x18')]('ChatMessage,\x20%s,\x20%s',_0x398bc8,_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);return _0x5554f2(_0x27749e['error'][_0x47c2('0x1a')]);}logger[_0x47c2('0x18')](_0x47c2('0x14'),_0x398bc8,_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);return _0x1dd2d9(_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);}else{logger[_0x47c2('0x1b')](_0x47c2('0x14'),_0x398bc8,_0x47c2('0x15'));_0x1dd2d9(_0x27749e[_0x47c2('0x1c')][_0x47c2('0x1a')]);}})[_0x47c2('0x1d')](function(_0x4799b5){logger[_0x47c2('0x18')](_0x47c2('0x14'),_0x398bc8,_0x4799b5);_0x5554f2(_0x4799b5);});});}exports['CreateChatMessage']=function(_0x4fb528){var _0x2c2bf2=this;return new Promise(function(_0x2a8fed,_0x2eaf3e){return db['ChatMessage'][_0x47c2('0x1e')](_0x4fb528['body'],{'raw':_0x4fb528['options']?_0x4fb528[_0x47c2('0x1f')][_0x47c2('0x20')]===undefined?!![]:![]:!![]})[_0x47c2('0x21')](function(_0x242890){logger[_0x47c2('0x1b')]('CreateChatMessage',_0x4fb528);logger[_0x47c2('0x22')](_0x47c2('0x23'),_0x4fb528,JSON[_0x47c2('0x17')](_0x242890));_0x2a8fed(_0x242890);})['catch'](function(_0x5870ff){logger[_0x47c2('0x18')](_0x47c2('0x23'),_0x5870ff[_0x47c2('0x1a')],_0x4fb528);_0x2eaf3e(_0x2c2bf2[_0x47c2('0x18')](0x1f4,_0x5870ff[_0x47c2('0x1a')]));});});};
\ No newline at end of file
+var _0x6016=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','create','body','options','raw','CreateChatMessage','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x6016,0x1ba));var _0x6601=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0x6016[_0x500785];return _0x1f8bcc;};'use strict';var _=require(_0x6601('0x0'));var util=require('util');var moment=require(_0x6601('0x1'));var BPromise=require('bluebird');var rs=require(_0x6601('0x2'));var fs=require('fs');var Redis=require(_0x6601('0x3'));var db=require(_0x6601('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6601('0x5'))('rpc');var config=require(_0x6601('0x6'));var jayson=require(_0x6601('0x7'));var client=jayson[_0x6601('0x8')][_0x6601('0x9')]({'port':0x232a});config[_0x6601('0xa')]=_['defaults'](config[_0x6601('0xa')],{'host':_0x6601('0xb'),'port':0x18eb});var socket=require(_0x6601('0xc'))(new Redis(config[_0x6601('0xa')]));require(_0x6601('0xd'))[_0x6601('0xe')](socket);function respondWithRpcPromise(_0x4bc49c,_0xfc9110,_0xe444ed){return new BPromise(function(_0x4c8182,_0x10777b){return client[_0x6601('0xf')](_0x4bc49c,_0xe444ed)[_0x6601('0x10')](function(_0x224aa5){logger[_0x6601('0x11')](_0x6601('0x12'),_0xfc9110,'request\x20sent');logger['debug'](_0x6601('0x13'),_0xfc9110,_0x6601('0x14'),JSON['stringify'](_0x224aa5));if(_0x224aa5['error']){if(_0x224aa5['error'][_0x6601('0x15')]===0x1f4){logger[_0x6601('0x16')]('ChatMessage,\x20%s,\x20%s',_0xfc9110,_0x224aa5['error'][_0x6601('0x17')]);return _0x10777b(_0x224aa5[_0x6601('0x16')][_0x6601('0x17')]);}logger[_0x6601('0x16')](_0x6601('0x12'),_0xfc9110,_0x224aa5[_0x6601('0x16')][_0x6601('0x17')]);return _0x4c8182(_0x224aa5[_0x6601('0x16')][_0x6601('0x17')]);}else{logger['info'](_0x6601('0x12'),_0xfc9110,_0x6601('0x14'));_0x4c8182(_0x224aa5[_0x6601('0x18')][_0x6601('0x17')]);}})[_0x6601('0x19')](function(_0x1e3230){logger[_0x6601('0x16')](_0x6601('0x12'),_0xfc9110,_0x1e3230);_0x10777b(_0x1e3230);});});}exports['CreateChatMessage']=function(_0x1733b1){var _0x28ac48=this;return new Promise(function(_0x9413ba,_0x3bbcff){return db['ChatMessage'][_0x6601('0x1a')](_0x1733b1[_0x6601('0x1b')],{'raw':_0x1733b1[_0x6601('0x1c')]?_0x1733b1[_0x6601('0x1c')][_0x6601('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1ea437){logger[_0x6601('0x11')](_0x6601('0x1e'),_0x1733b1);logger['debug']('CreateChatMessage',_0x1733b1,JSON[_0x6601('0x1f')](_0x1ea437));_0x9413ba(_0x1ea437);})[_0x6601('0x19')](function(_0x22e218){logger[_0x6601('0x16')](_0x6601('0x1e'),_0x22e218[_0x6601('0x17')],_0x1733b1);_0x3bbcff(_0x28ac48[_0x6601('0x16')](0x1f4,_0x22e218[_0x6601('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index cba1248..68114ca 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 _0x3eea=['removeListener','register','length','./chatMessage.events','remove','update','emit'];(function(_0x266945,_0x5c5e8c){var _0x4477d5=function(_0x18c0b2){while(--_0x18c0b2){_0x266945['push'](_0x266945['shift']());}};_0x4477d5(++_0x5c5e8c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5a15a2,_0x5873d3){_0x5a15a2=_0x5a15a2-0x0;var _0x2ab56c=_0x3eea[_0x5a15a2];return _0x2ab56c;};'use strict';var ChatMessageEvents=require(_0xa3ee('0x0'));var events=['save',_0xa3ee('0x1'),_0xa3ee('0x2')];function createListener(_0x16512c,_0x1c6a49){return function(_0x46acfa){_0x1c6a49[_0xa3ee('0x3')](_0x16512c,_0x46acfa);};}function removeListener(_0x104913,_0x35ed7d){return function(){ChatMessageEvents[_0xa3ee('0x4')](_0x104913,_0x35ed7d);};}exports[_0xa3ee('0x5')]=function(_0xb93cdb){for(var _0x5776bb=0x0,_0x538bf9=events[_0xa3ee('0x6')];_0x5776bb<_0x538bf9;_0x5776bb++){var _0x4e4588=events[_0x5776bb];var _0x37a3f0=createListener('chatMessage:'+_0x4e4588,_0xb93cdb);ChatMessageEvents['on'](_0x4e4588,_0x37a3f0);}};
\ No newline at end of file
+var _0xab86=['remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4b1fb4,_0x36f2e0){var _0x1617cc=function(_0x49a5ad){while(--_0x49a5ad){_0x4b1fb4['push'](_0x4b1fb4['shift']());}};_0x1617cc(++_0x36f2e0);}(_0xab86,0x13e));var _0x6ab8=function(_0x141a33,_0x44996b){_0x141a33=_0x141a33-0x0;var _0x51b489=_0xab86[_0x141a33];return _0x51b489;};'use strict';var ChatMessageEvents=require(_0x6ab8('0x0'));var events=[_0x6ab8('0x1'),_0x6ab8('0x2'),'update'];function createListener(_0x548007,_0xfa522f){return function(_0x4bcc45){_0xfa522f[_0x6ab8('0x3')](_0x548007,_0x4bcc45);};}function removeListener(_0x48cb6a,_0xf27ba7){return function(){ChatMessageEvents[_0x6ab8('0x4')](_0x48cb6a,_0xf27ba7);};}exports[_0x6ab8('0x5')]=function(_0x154d17){for(var _0x6f41f=0x0,_0x265771=events[_0x6ab8('0x6')];_0x6f41f<_0x265771;_0x6f41f++){var _0x2a452=events[_0x6f41f];var _0x363c5e=createListener(_0x6ab8('0x7')+_0x2a452,_0x154d17);ChatMessageEvents['on'](_0x2a452,_0x363c5e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f3d37ab..b797a2d 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 _0x4a86=['delete','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','update','/:id/accept','/:id/reject','reject'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4a86,0x1a5));var _0x64a8=function(_0x1da2b3,_0xc2e7cf){_0x1da2b3=_0x1da2b3-0x0;var _0x2c1ac6=_0x4a86[_0x1da2b3];return _0x2c1ac6;};'use strict';var multer=require('multer');var util=require(_0x64a8('0x0'));var path=require(_0x64a8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x64a8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x64a8('0x3'));var interaction=require(_0x64a8('0x4'));var config=require('../../config/environment');var controller=require(_0x64a8('0x5'));router[_0x64a8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x64a8('0x7'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x9')]);router[_0x64a8('0x6')](_0x64a8('0xa'),auth[_0x64a8('0x8')](),controller[_0x64a8('0xb')]);router[_0x64a8('0xc')]('/',auth[_0x64a8('0x8')](),interaction[_0x64a8('0xd')](_0x64a8('0xe'),_0x64a8('0xf')),controller['create']);router['put'](_0x64a8('0xa'),controller[_0x64a8('0x10')]);router['put'](_0x64a8('0x11'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x64a8('0x12'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x13')]);router[_0x64a8('0x14')](_0x64a8('0xa'),auth[_0x64a8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x04da=['post','chat','chatmessage:create','create','put','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x52a019,_0x234e71){var _0x527e82=function(_0x3ed76f){while(--_0x3ed76f){_0x52a019['push'](_0x52a019['shift']());}};_0x527e82(++_0x234e71);}(_0x04da,0xb9));var _0xa04d=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x04da[_0x585133];return _0x18254a;};'use strict';var multer=require(_0xa04d('0x0'));var util=require(_0xa04d('0x1'));var path=require(_0xa04d('0x2'));var timeout=require(_0xa04d('0x3'));var express=require('express');var router=express[_0xa04d('0x4')]();var fs_extra=require(_0xa04d('0x5'));var auth=require(_0xa04d('0x6'));var interaction=require(_0xa04d('0x7'));var config=require(_0xa04d('0x8'));var controller=require('./chatMessage.controller');router[_0xa04d('0x9')]('/',auth[_0xa04d('0xa')](),controller['index']);router[_0xa04d('0x9')](_0xa04d('0xb'),auth[_0xa04d('0xa')](),controller[_0xa04d('0xc')]);router[_0xa04d('0x9')](_0xa04d('0xd'),auth[_0xa04d('0xa')](),controller[_0xa04d('0xe')]);router[_0xa04d('0xf')]('/',auth[_0xa04d('0xa')](),interaction['tracked'](_0xa04d('0x10'),_0xa04d('0x11')),controller[_0xa04d('0x12')]);router[_0xa04d('0x13')](_0xa04d('0xd'),controller['update']);router[_0xa04d('0x13')]('/:id/accept',auth[_0xa04d('0xa')](),controller[_0xa04d('0x14')]);router[_0xa04d('0x13')](_0xa04d('0x15'),auth[_0xa04d('0xa')](),controller[_0xa04d('0x16')]);router['delete'](_0xa04d('0xd'),auth['isAuthenticated'](),controller[_0xa04d('0x17')]);module[_0xa04d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 334c383..0cbbbad 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0x464e93,_0x39e4b9){var _0x591865=function(_0x3c60e1){while(--_0x3c60e1){_0x464e93['push'](_0x464e93['shift']());}};_0x591865(++_0x39e4b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xb10b[_0x3fe042];return _0x7d4a1f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x5ec17c,_0x4100a3){var _0x50bd2e=function(_0x4f228c){while(--_0x4f228c){_0x5ec17c['push'](_0x5ec17c['shift']());}};_0x50bd2e(++_0x4100a3);}(_0x2032,0xd9));var _0x2203=function(_0x12eec3,_0x3d693a){_0x12eec3=_0x12eec3-0x0;var _0x46da51=_0x2032[_0x12eec3];return _0x46da51;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('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 e499903..1471131 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(_0x30a1d6,_0x57eedc){var _0x5afa8e=function(_0x445377){while(--_0x445377){_0x30a1d6['push'](_0x30a1d6['shift']());}};_0x5afa8e(++_0x57eedc);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _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(_0x23609e,_0x2d91f2){var _0x151315=function(_0x12c3f7){while(--_0x12c3f7){_0x23609e['push'](_0x23609e['shift']());}};_0x151315(++_0x2d91f2);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 0269ef9..b74c0d1 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4607=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x24dac7,_0x2ffbaa){var _0x32c81f=function(_0x5e6475){while(--_0x5e6475){_0x24dac7['push'](_0x24dac7['shift']());}};_0x32c81f(++_0x2ffbaa);}(_0x4607,0x121));var _0x7460=function(_0x1a7987,_0x2b7aa2){_0x1a7987=_0x1a7987-0x0;var _0x4c89c4=_0x4607[_0x1a7987];return _0x4c89c4;};'use strict';var EventEmitter=require(_0x7460('0x0'));var ChatOfflineMessage=require(_0x7460('0x1'))['db'][_0x7460('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7460('0x3')](0x0);var events={'afterCreate':_0x7460('0x4'),'afterUpdate':_0x7460('0x5'),'afterDestroy':_0x7460('0x6')};function emitEvent(_0x2de7f8){return function(_0x353411,_0x53ebd1,_0x117045){ChatOfflineMessageEvents[_0x7460('0x7')](_0x2de7f8+':'+_0x353411['id'],_0x353411);ChatOfflineMessageEvents[_0x7460('0x7')](_0x2de7f8,_0x353411);_0x117045(null);};}for(var e in events){if(events[_0x7460('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x7460('0x9')](e,emitEvent(event));}}module[_0x7460('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xf2d7=['update','remove','emit','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xf2d7,0xd3));var _0x7f2d=function(_0x351274,_0xa3dc98){_0x351274=_0x351274-0x0;var _0x2c388a=_0xf2d7[_0x351274];return _0x2c388a;};'use strict';var EventEmitter=require(_0x7f2d('0x0'));var ChatOfflineMessage=require(_0x7f2d('0x1'))['db'][_0x7f2d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7f2d('0x3')](0x0);var events={'afterCreate':_0x7f2d('0x4'),'afterUpdate':_0x7f2d('0x5'),'afterDestroy':_0x7f2d('0x6')};function emitEvent(_0x30966c){return function(_0x353a51,_0x31c645,_0xfffefc){ChatOfflineMessageEvents[_0x7f2d('0x7')](_0x30966c+':'+_0x353a51['id'],_0x353a51);ChatOfflineMessageEvents[_0x7f2d('0x7')](_0x30966c,_0x353a51);_0xfffefc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x7f2d('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2fb7fa1..b29cf1d 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 _0xc216=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x148bad,_0x1ac85a){var _0x52aec4=function(_0x4a9faf){while(--_0x4a9faf){_0x148bad['push'](_0x148bad['shift']());}};_0x52aec4(++_0x1ac85a);}(_0xc216,0x9b));var _0x6c21=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xc216[_0x26f1b2];return _0x1624a4;};'use strict';var attributes=require(_0x6c21('0x0'));module['exports']=function(_0x4000ff){return _0x4000ff[_0x6c21('0x1')](_0x6c21('0x2'),attributes,{'tableName':_0x6c21('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c21('0x4'),'collate':_0x6c21('0x5')});};
\ No newline at end of file
+var _0x5fc8=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0xaab8cd,_0x469c73){var _0x21a175=function(_0x55fe2b){while(--_0x55fe2b){_0xaab8cd['push'](_0xaab8cd['shift']());}};_0x21a175(++_0x469c73);}(_0x5fc8,0xdf));var _0x85fc=function(_0xa7c258,_0x8729ef){_0xa7c258=_0xa7c258-0x0;var _0x30474b=_0x5fc8[_0xa7c258];return _0x30474b;};'use strict';var attributes=require(_0x85fc('0x0'));module['exports']=function(_0x5e020e){return _0x5e020e[_0x85fc('0x1')](_0x85fc('0x2'),attributes,{'tableName':_0x85fc('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x85fc('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0c713d0..8519ef4 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 _0x8966=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8966,0x184));var _0x6896=function(_0x3edccf,_0xe16b3){_0x3edccf=_0x3edccf-0x0;var _0x2295b5=_0x8966[_0x3edccf];return _0x2295b5;};'use strict';var _=require('lodash');var util=require(_0x6896('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6896('0x1'));var fs=require('fs');var Redis=require(_0x6896('0x2'));var db=require(_0x6896('0x3'))['db'];var utils=require(_0x6896('0x4'));var logger=require('../../config/logger')(_0x6896('0x5'));var config=require('../../config/environment');var jayson=require(_0x6896('0x6'));var client=jayson['client'][_0x6896('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5655f0,_0x53dddc,_0x232300){return new BPromise(function(_0x595a00,_0xa35530){return client['request'](_0x5655f0,_0x232300)['then'](function(_0x54ac4a){logger[_0x6896('0x8')](_0x6896('0x9'),_0x53dddc,_0x6896('0xa'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x53dddc,_0x6896('0xa'),JSON['stringify'](_0x54ac4a));if(_0x54ac4a[_0x6896('0xb')]){if(_0x54ac4a[_0x6896('0xb')][_0x6896('0xc')]===0x1f4){logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);return _0xa35530(_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);}logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);return _0x595a00(_0x54ac4a[_0x6896('0xb')]['message']);}else{logger[_0x6896('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53dddc,_0x6896('0xa'));_0x595a00(_0x54ac4a[_0x6896('0xe')][_0x6896('0xd')]);}})['catch'](function(_0xe6da5e){logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0xe6da5e);_0xa35530(_0xe6da5e);});});}
\ No newline at end of file
+var _0x4634=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x4634,0xe3));var _0x4463=function(_0xdb6d73,_0x406132){_0xdb6d73=_0xdb6d73-0x0;var _0x3dd50d=_0x4634[_0xdb6d73];return _0x3dd50d;};'use strict';var _=require('lodash');var util=require(_0x4463('0x0'));var moment=require(_0x4463('0x1'));var BPromise=require(_0x4463('0x2'));var rs=require(_0x4463('0x3'));var fs=require('fs');var Redis=require(_0x4463('0x4'));var db=require(_0x4463('0x5'))['db'];var utils=require(_0x4463('0x6'));var logger=require('../../config/logger')(_0x4463('0x7'));var config=require(_0x4463('0x8'));var jayson=require(_0x4463('0x9'));var client=jayson['client'][_0x4463('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18f97a,_0xc6b5b4,_0x22a9ae){return new BPromise(function(_0x235705,_0x558177){return client['request'](_0x18f97a,_0x22a9ae)[_0x4463('0xb')](function(_0x4e1137){logger[_0x4463('0xc')](_0x4463('0xd'),_0xc6b5b4,_0x4463('0xe'));logger[_0x4463('0xf')](_0x4463('0x10'),_0xc6b5b4,_0x4463('0xe'),JSON[_0x4463('0x11')](_0x4e1137));if(_0x4e1137[_0x4463('0x12')]){if(_0x4e1137[_0x4463('0x12')][_0x4463('0x13')]===0x1f4){logger[_0x4463('0x12')](_0x4463('0xd'),_0xc6b5b4,_0x4e1137[_0x4463('0x12')][_0x4463('0x14')]);return _0x558177(_0x4e1137[_0x4463('0x12')][_0x4463('0x14')]);}logger[_0x4463('0x12')](_0x4463('0xd'),_0xc6b5b4,_0x4e1137[_0x4463('0x12')]['message']);return _0x235705(_0x4e1137[_0x4463('0x12')][_0x4463('0x14')]);}else{logger[_0x4463('0xc')](_0x4463('0xd'),_0xc6b5b4,'request\x20sent');_0x235705(_0x4e1137['result'][_0x4463('0x14')]);}})[_0x4463('0x15')](function(_0x1412c0){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xc6b5b4,_0x1412c0);_0x558177(_0x1412c0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index beda700..ec75b26 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 _0xde5b=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','update','delete','exports','multer','path','express','Router'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xde5b,0x13f));var _0xbde5=function(_0x27cbb6,_0x3e5142){_0x27cbb6=_0x27cbb6-0x0;var _0x219d8e=_0xde5b[_0x27cbb6];return _0x219d8e;};'use strict';var multer=require(_0xbde5('0x0'));var util=require('util');var path=require(_0xbde5('0x1'));var timeout=require('connect-timeout');var express=require(_0xbde5('0x2'));var router=express[_0xbde5('0x3')]();var fs_extra=require(_0xbde5('0x4'));var auth=require(_0xbde5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbde5('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xbde5('0x7')]('/',auth[_0xbde5('0x8')](),controller[_0xbde5('0x9')]);router['get']('/describe',auth[_0xbde5('0x8')](),controller[_0xbde5('0xa')]);router[_0xbde5('0x7')](_0xbde5('0xb'),auth[_0xbde5('0x8')](),controller[_0xbde5('0xc')]);router['post']('/',auth[_0xbde5('0x8')](),controller['create']);router[_0xbde5('0xd')]('/:id',auth[_0xbde5('0x8')](),controller[_0xbde5('0xe')]);router[_0xbde5('0xf')](_0xbde5('0xb'),auth[_0xbde5('0x8')](),controller['destroy']);module[_0xbde5('0x10')]=router;
\ No newline at end of file
+var _0x4069=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3f6ae9,_0x250970){var _0x1a3047=function(_0x516ac8){while(--_0x516ac8){_0x3f6ae9['push'](_0x3f6ae9['shift']());}};_0x1a3047(++_0x250970);}(_0x4069,0x134));var _0x9406=function(_0x30ea22,_0x175f80){_0x30ea22=_0x30ea22-0x0;var _0xd9670a=_0x4069[_0x30ea22];return _0xd9670a;};'use strict';var multer=require(_0x9406('0x0'));var util=require(_0x9406('0x1'));var path=require(_0x9406('0x2'));var timeout=require(_0x9406('0x3'));var express=require(_0x9406('0x4'));var router=express[_0x9406('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9406('0x6'));var interaction=require(_0x9406('0x7'));var config=require(_0x9406('0x8'));var controller=require(_0x9406('0x9'));router[_0x9406('0xa')]('/',auth[_0x9406('0xb')](),controller[_0x9406('0xc')]);router[_0x9406('0xa')](_0x9406('0xd'),auth[_0x9406('0xb')](),controller[_0x9406('0xe')]);router['get'](_0x9406('0xf'),auth[_0x9406('0xb')](),controller['show']);router[_0x9406('0x10')]('/',auth['isAuthenticated'](),controller[_0x9406('0x11')]);router['put'](_0x9406('0xf'),auth[_0x9406('0xb')](),controller['update']);router[_0x9406('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9406('0x13')]);module[_0x9406('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3acdd6c..10393f0 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 _0xc20c=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xc20c,0x19e));var _0xcc20=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xc20c[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0xcc20('0x0'));module[_0xcc20('0x1')]={'name':{'type':Sequelize[_0xcc20('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcc20('0x3')](_0xcc20('0x4'),_0xcc20('0x5')),'defaultValue':_0xcc20('0x4')},'selector':{'type':Sequelize[_0xcc20('0x2')]},'timeout':{'type':Sequelize[_0xcc20('0x6')]}};
\ No newline at end of file
+var _0x3f5f=['exports','STRING','mouseOver','INTEGER'];(function(_0x13517f,_0x4d1fbe){var _0x5b0b25=function(_0xe03da0){while(--_0xe03da0){_0x13517f['push'](_0x13517f['shift']());}};_0x5b0b25(++_0x4d1fbe);}(_0x3f5f,0x78));var _0xf3f5=function(_0x31bf4a,_0x51eb5f){_0x31bf4a=_0x31bf4a-0x0;var _0x2265ec=_0x3f5f[_0x31bf4a];return _0x2265ec;};'use strict';var Sequelize=require('sequelize');module[_0xf3f5('0x0')]={'name':{'type':Sequelize[_0xf3f5('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0xf3f5('0x2')},'selector':{'type':Sequelize[_0xf3f5('0x1')]},'timeout':{'type':Sequelize[_0xf3f5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 645e5bf..cfd52f9 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 _0x78b7=['rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','destroy','error','stack','name','send','params','keys','ChatProactiveAction'];(function(_0x3bd78d,_0x381dbf){var _0x1c5bad=function(_0x1dc0b7){while(--_0x1dc0b7){_0x3bd78d['push'](_0x3bd78d['shift']());}};_0x1c5bad(++_0x381dbf);}(_0x78b7,0x194));var _0x778b=function(_0x4c117d,_0xf11d85){_0x4c117d=_0x4c117d-0x0;var _0x1d1319=_0x78b7[_0x4c117d];return _0x1d1319;};'use strict';var emlformat=require(_0x778b('0x0'));var rimraf=require(_0x778b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x778b('0x2'));var rp=require(_0x778b('0x3'));var moment=require(_0x778b('0x4'));var BPromise=require(_0x778b('0x5'));var Mustache=require(_0x778b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x778b('0x7'));var csv=require(_0x778b('0x8'));var ejs=require(_0x778b('0x9'));var fs=require('fs');var fs_extra=require(_0x778b('0xa'));var _=require(_0x778b('0xb'));var squel=require(_0x778b('0xc'));var crypto=require('crypto');var jsforce=require(_0x778b('0xd'));var deskjs=require(_0x778b('0xe'));var toCsv=require(_0x778b('0x8'));var querystring=require(_0x778b('0xf'));var Papa=require(_0x778b('0x10'));var Redis=require('ioredis');var authService=require(_0x778b('0x11'));var qs=require(_0x778b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x778b('0x13'));var logger=require(_0x778b('0x14'))(_0x778b('0x15'));var utils=require(_0x778b('0x16'));var config=require(_0x778b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7ca7,_0x8ae3a9){_0x8ae3a9=_0x8ae3a9||0xcc;return function(_0x39584a){if(_0x39584a){return _0x2f7ca7[_0x778b('0x18')](_0x8ae3a9);}return _0x2f7ca7[_0x778b('0x19')](_0x8ae3a9)[_0x778b('0x1a')]();};}function respondWithResult(_0x47026b,_0x5c09c9){_0x5c09c9=_0x5c09c9||0xc8;return function(_0x1a7672){if(_0x1a7672){return _0x47026b[_0x778b('0x19')](_0x5c09c9)[_0x778b('0x1b')](_0x1a7672);}};}function respondWithFilteredResult(_0x389d63,_0x7aa12){return function(_0x52be17){if(_0x52be17){var _0x1bf480=typeof _0x7aa12['offset']===_0x778b('0x1c')&&typeof _0x7aa12[_0x778b('0x1d')]==='undefined';var _0x23069d=_0x52be17['count'];var _0x2d2732=_0x1bf480?0x0:_0x7aa12[_0x778b('0x1e')];var _0x5d9376=_0x1bf480?_0x52be17[_0x778b('0x1f')]:_0x7aa12[_0x778b('0x1e')]+_0x7aa12[_0x778b('0x1d')];var _0x5d4c05;if(_0x5d9376>=_0x23069d){_0x5d9376=_0x23069d;_0x5d4c05=0xc8;}else{_0x5d4c05=0xce;}_0x389d63[_0x778b('0x19')](_0x5d4c05);return _0x389d63[_0x778b('0x20')](_0x778b('0x21'),_0x2d2732+'-'+_0x5d9376+'/'+_0x23069d)[_0x778b('0x1b')](_0x52be17);}return null;};}function patchUpdates(_0x128388){return function(_0xa9c869){try{jsonpatch['apply'](_0xa9c869,_0x128388,!![]);}catch(_0x3f7282){return BPromise[_0x778b('0x22')](_0x3f7282);}return _0xa9c869['save']();};}function saveUpdates(_0x4083c2,_0x4a9564){return function(_0x3736f1){if(_0x3736f1){return _0x3736f1['update'](_0x4083c2)[_0x778b('0x23')](function(_0x4efc37){return _0x4efc37;});}return null;};}function removeEntity(_0x5bf9bb,_0xcef5c){return function(_0x578252){if(_0x578252){return _0x578252[_0x778b('0x24')]()[_0x778b('0x23')](function(){_0x5bf9bb[_0x778b('0x19')](0xcc)[_0x778b('0x1a')]();});}};}function handleEntityNotFound(_0x2095af,_0x4f1b03){return function(_0xa9083a){if(!_0xa9083a){_0x2095af[_0x778b('0x18')](0x194);}return _0xa9083a;};}function handleError(_0x1bc22f,_0x4ce74d){_0x4ce74d=_0x4ce74d||0x1f4;return function(_0x554c67){logger[_0x778b('0x25')](_0x554c67[_0x778b('0x26')]);if(_0x554c67[_0x778b('0x27')]){delete _0x554c67[_0x778b('0x27')];}_0x1bc22f[_0x778b('0x19')](_0x4ce74d)[_0x778b('0x28')](_0x554c67);};}exports['show']=function(_0x527051,_0x480714){var _0x17721e={'raw':!![],'where':{'id':_0x527051[_0x778b('0x29')]['id']}},_0xccca67={};_0xccca67['model']=_[_0x778b('0x2a')](db[_0x778b('0x2b')][_0x778b('0x2c')]);_0xccca67[_0x778b('0x2d')]=_[_0x778b('0x2a')](_0x527051['query']);_0xccca67[_0x778b('0x2e')]=_[_0x778b('0x2f')](_0xccca67['model'],_0xccca67['query']);_0x17721e[_0x778b('0x30')]=_[_0x778b('0x2f')](_0xccca67['model'],qs[_0x778b('0x31')](_0x527051[_0x778b('0x2d')][_0x778b('0x31')]));_0x17721e[_0x778b('0x30')]=_0x17721e[_0x778b('0x30')][_0x778b('0x32')]?_0x17721e['attributes']:_0xccca67['model'];if(_0x527051[_0x778b('0x2d')][_0x778b('0x33')]){_0x17721e['include']=[{'all':!![]}];}_0x17721e=_['merge']({},_0x17721e,_0x527051['options']);return db[_0x778b('0x2b')]['find'](_0x17721e)[_0x778b('0x23')](handleEntityNotFound(_0x480714,null))['then'](respondWithResult(_0x480714,null))[_0x778b('0x34')](handleError(_0x480714,null));};exports[_0x778b('0x35')]=function(_0x51b580,_0x179e51){return db['ChatProactiveAction'][_0x778b('0x35')](_0x51b580[_0x778b('0x36')],{})[_0x778b('0x23')](respondWithResult(_0x179e51,0xc9))[_0x778b('0x34')](handleError(_0x179e51,null));};exports['update']=function(_0x4d49e9,_0x2feb02){if(_0x4d49e9['body']['id']){delete _0x4d49e9[_0x778b('0x36')]['id'];}return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x4d49e9[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x2feb02,null))[_0x778b('0x23')](saveUpdates(_0x4d49e9['body'],null))['then'](respondWithResult(_0x2feb02,null))[_0x778b('0x34')](handleError(_0x2feb02,null));};exports[_0x778b('0x24')]=function(_0x57aaac,_0x1b3da5){return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x57aaac[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x1b3da5,null))[_0x778b('0x23')](removeEntity(_0x1b3da5,null))[_0x778b('0x34')](handleError(_0x1b3da5,null));};
\ No newline at end of file
+var _0x2d17=['../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2d17,0x17e));var _0x72d1=function(_0x43ccbb,_0x2223c9){_0x43ccbb=_0x43ccbb-0x0;var _0x18f1b6=_0x2d17[_0x43ccbb];return _0x18f1b6;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={'raw':!![],'where':{'id':_0x4c4c41[_0x72d1('0x27')]['id']}},_0x32588f={};_0x32588f['model']=_[_0x72d1('0x28')](db['ChatProactiveAction'][_0x72d1('0x29')]);_0x32588f[_0x72d1('0x2a')]=_['keys'](_0x4c4c41[_0x72d1('0x2a')]);_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2a')]);_0x20055f['attributes']=_[_0x72d1('0x2c')](_0x32588f[_0x72d1('0x2d')],qs[_0x72d1('0x2e')](_0x4c4c41['query'][_0x72d1('0x2e')]));_0x20055f[_0x72d1('0x2f')]=_0x20055f['attributes'][_0x72d1('0x30')]?_0x20055f[_0x72d1('0x2f')]:_0x32588f[_0x72d1('0x2d')];if(_0x4c4c41['query'][_0x72d1('0x31')]){_0x20055f['include']=[{'all':!![]}];}_0x20055f=_[_0x72d1('0x32')]({},_0x20055f,_0x4c4c41[_0x72d1('0x33')]);return db[_0x72d1('0x34')][_0x72d1('0x35')](_0x20055f)[_0x72d1('0x23')](handleEntityNotFound(_0x707cd0,null))[_0x72d1('0x23')](respondWithResult(_0x707cd0,null))[_0x72d1('0x36')](handleError(_0x707cd0,null));};exports[_0x72d1('0x37')]=function(_0x4006b9,_0x24be04){return db[_0x72d1('0x34')]['create'](_0x4006b9[_0x72d1('0x38')],{})[_0x72d1('0x23')](respondWithResult(_0x24be04,0xc9))[_0x72d1('0x36')](handleError(_0x24be04,null));};exports[_0x72d1('0x39')]=function(_0x49e074,_0x3eb3da){if(_0x49e074[_0x72d1('0x38')]['id']){delete _0x49e074[_0x72d1('0x38')]['id'];}return db['ChatProactiveAction'][_0x72d1('0x35')]({'where':{'id':_0x49e074[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x3eb3da,null))['then'](saveUpdates(_0x49e074[_0x72d1('0x38')],null))[_0x72d1('0x23')](respondWithResult(_0x3eb3da,null))[_0x72d1('0x36')](handleError(_0x3eb3da,null));};exports['destroy']=function(_0x43b419,_0x40cdbd){return db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'id':_0x43b419[_0x72d1('0x27')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x40cdbd,null))[_0x72d1('0x23')](removeEntity(_0x40cdbd,null))['catch'](handleError(_0x40cdbd,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 9510a9f..4c1b6c9 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 _0x64ac=['moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','../../config/logger'];(function(_0x47985e,_0x350685){var _0x23e631=function(_0x10838e){while(--_0x10838e){_0x47985e['push'](_0x47985e['shift']());}};_0x23e631(++_0x350685);}(_0x64ac,0x6c));var _0xc64a=function(_0x5c44c9,_0x3350d4){_0x5c44c9=_0x5c44c9-0x0;var _0x31a957=_0x64ac[_0x5c44c9];return _0x31a957;};'use strict';var _=require('lodash');var util=require(_0xc64a('0x0'));var logger=require(_0xc64a('0x1'))('api');var moment=require(_0xc64a('0x2'));var BPromise=require(_0xc64a('0x3'));var rp=require(_0xc64a('0x4'));var fs=require('fs');var path=require(_0xc64a('0x5'));var rimraf=require('rimraf');var config=require(_0xc64a('0x6'));var attributes=require(_0xc64a('0x7'));module[_0xc64a('0x8')]=function(_0x2215fa,_0x224e72){return _0x2215fa[_0xc64a('0x9')](_0xc64a('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6a4=['path','../../config/environment','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xd6a4,0x123));var _0x4d6a=function(_0xb70c12,_0x3e092b){_0xb70c12=_0xb70c12-0x0;var _0x5b86d9=_0xd6a4[_0xb70c12];return _0x5b86d9;};'use strict';var _=require(_0x4d6a('0x0'));var util=require(_0x4d6a('0x1'));var logger=require(_0x4d6a('0x2'))('api');var moment=require(_0x4d6a('0x3'));var BPromise=require(_0x4d6a('0x4'));var rp=require(_0x4d6a('0x5'));var fs=require('fs');var path=require(_0x4d6a('0x6'));var rimraf=require('rimraf');var config=require(_0x4d6a('0x7'));var attributes=require(_0x4d6a('0x8'));module['exports']=function(_0x494f72,_0xf21151){return _0x494f72[_0x4d6a('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x4d6a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 768e8c1..1d4be1f 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 _0x75d5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x15e8fe,_0x14d43e){var _0x28bd91=function(_0x5bfc87){while(--_0x5bfc87){_0x15e8fe['push'](_0x15e8fe['shift']());}};_0x28bd91(++_0x14d43e);}(_0x75d5,0x1c7));var _0x575d=function(_0x1ad47e,_0x5bc8eb){_0x1ad47e=_0x1ad47e-0x0;var _0x175aa2=_0x75d5[_0x1ad47e];return _0x175aa2;};'use strict';var _=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var moment=require(_0x575d('0x2'));var BPromise=require(_0x575d('0x3'));var rs=require(_0x575d('0x4'));var fs=require('fs');var Redis=require(_0x575d('0x5'));var db=require(_0x575d('0x6'))['db'];var utils=require(_0x575d('0x7'));var logger=require(_0x575d('0x8'))(_0x575d('0x9'));var config=require('../../config/environment');var jayson=require(_0x575d('0xa'));var client=jayson[_0x575d('0xb')][_0x575d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5366ea,_0x2ff9fe,_0x3bc7d5){return new BPromise(function(_0x4b3cb0,_0x478d97){return client[_0x575d('0xd')](_0x5366ea,_0x3bc7d5)[_0x575d('0xe')](function(_0x51c8ed){logger[_0x575d('0xf')](_0x575d('0x10'),_0x2ff9fe,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2ff9fe,_0x575d('0x11'),JSON[_0x575d('0x12')](_0x51c8ed));if(_0x51c8ed['error']){if(_0x51c8ed['error'][_0x575d('0x13')]===0x1f4){logger[_0x575d('0x14')](_0x575d('0x10'),_0x2ff9fe,_0x51c8ed[_0x575d('0x14')]['message']);return _0x478d97(_0x51c8ed[_0x575d('0x14')]['message']);}logger[_0x575d('0x14')](_0x575d('0x10'),_0x2ff9fe,_0x51c8ed['error'][_0x575d('0x15')]);return _0x4b3cb0(_0x51c8ed[_0x575d('0x14')][_0x575d('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2ff9fe,'request\x20sent');_0x4b3cb0(_0x51c8ed['result'][_0x575d('0x15')]);}})[_0x575d('0x16')](function(_0x4c7307){logger[_0x575d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x2ff9fe,_0x4c7307);_0x478d97(_0x4c7307);});});}
\ No newline at end of file
+var _0x4fad=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fad,0x10a));var _0xd4fa=function(_0x551c43,_0x347e8e){_0x551c43=_0x551c43-0x0;var _0x27d763=_0x4fad[_0x551c43];return _0x27d763;};'use strict';var _=require('lodash');var util=require(_0xd4fa('0x0'));var moment=require(_0xd4fa('0x1'));var BPromise=require(_0xd4fa('0x2'));var rs=require(_0xd4fa('0x3'));var fs=require('fs');var Redis=require(_0xd4fa('0x4'));var db=require(_0xd4fa('0x5'))['db'];var utils=require(_0xd4fa('0x6'));var logger=require(_0xd4fa('0x7'))(_0xd4fa('0x8'));var config=require(_0xd4fa('0x9'));var jayson=require(_0xd4fa('0xa'));var client=jayson[_0xd4fa('0xb')][_0xd4fa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c8a35,_0x311dd1,_0x30c2ac){return new BPromise(function(_0x51137a,_0x2b706d){return client[_0xd4fa('0xd')](_0x2c8a35,_0x30c2ac)['then'](function(_0x44e777){logger[_0xd4fa('0xe')](_0xd4fa('0xf'),_0x311dd1,_0xd4fa('0x10'));logger[_0xd4fa('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x311dd1,_0xd4fa('0x10'),JSON[_0xd4fa('0x12')](_0x44e777));if(_0x44e777[_0xd4fa('0x13')]){if(_0x44e777['error']['code']===0x1f4){logger['error'](_0xd4fa('0xf'),_0x311dd1,_0x44e777[_0xd4fa('0x13')][_0xd4fa('0x14')]);return _0x2b706d(_0x44e777[_0xd4fa('0x13')]['message']);}logger[_0xd4fa('0x13')](_0xd4fa('0xf'),_0x311dd1,_0x44e777[_0xd4fa('0x13')][_0xd4fa('0x14')]);return _0x51137a(_0x44e777[_0xd4fa('0x13')]['message']);}else{logger[_0xd4fa('0xe')](_0xd4fa('0xf'),_0x311dd1,_0xd4fa('0x10'));_0x51137a(_0x44e777[_0xd4fa('0x15')][_0xd4fa('0x14')]);}})['catch'](function(_0x137bd3){logger[_0xd4fa('0x13')](_0xd4fa('0xf'),_0x311dd1,_0x137bd3);_0x2b706d(_0x137bd3);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8d80512..591fb0c 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x2eb2[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x462725,_0x24546f){var _0x523672=function(_0xcd2c05){while(--_0xcd2c05){_0x462725['push'](_0x462725['shift']());}};_0x523672(++_0x24546f);}(_0x8958,0x93));var _0x8895=function(_0x343493,_0x2b85bc){_0x343493=_0x343493-0x0;var _0x11776a=_0x8958[_0x343493];return _0x11776a;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 54d2c8b..030fd89 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 _0x6579=['beepall','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6579,0x10f));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9657('0x0'));module['exports']={'name':{'type':Sequelize[_0x9657('0x1')],'unique':_0x9657('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9657('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9657('0x3')](_0x9657('0x4'),_0x9657('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x398a=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports','name'];(function(_0x3f9864,_0x24d8a1){var _0x4f03c2=function(_0x2c13aa){while(--_0x2c13aa){_0x3f9864['push'](_0x3f9864['shift']());}};_0x4f03c2(++_0x24d8a1);}(_0x398a,0x154));var _0xa398=function(_0xc690c2,_0x307dbe){_0xc690c2=_0xc690c2-0x0;var _0x131ba9=_0x398a[_0xc690c2];return _0x131ba9;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa398('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa398('0x3')]},'timeout':{'type':Sequelize[_0xa398('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 043c1be..a53f0c3 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 _0xceea=['count','set','then','destroy','UserProfileResource','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','autoAssociation','update','describe','getMembers','findOne','get','UserChatQueue','hasOwnProperty','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','nolimit','addTeams','Agents','online','flatMap','transaction','each','findOrCreate','forEach','emit','ids','select','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','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','limit','undefined'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xceea,0xe7));var _0xacee=function(_0x49b1ca,_0x32f161){_0x49b1ca=_0x49b1ca-0x0;var _0x5650bb=_0xceea[_0x49b1ca];return _0x5650bb;};'use strict';var BPromise=require(_0xacee('0x0'));var util=require('util');var _=require(_0xacee('0x1'));var squel=require(_0xacee('0x2'));var Redis=require('ioredis');var qs=require(_0xacee('0x3'));var logger=require(_0xacee('0x4'))(_0xacee('0x5'));var config=require('../../config/environment');var db=require(_0xacee('0x6'))['db'];config['redis']=_[_0xacee('0x7')](config[_0xacee('0x8')],{'host':_0xacee('0x9'),'port':0x18eb});var socket=require(_0xacee('0xa'))(new Redis(config[_0xacee('0x8')]));require(_0xacee('0xb'))[_0xacee('0xc')](socket);function respondWithStatusCode(_0x9575f3,_0x133999){_0x133999=_0x133999||0xcc;return function(_0x179935){if(_0x179935){return _0x9575f3['sendStatus'](_0x133999);}return _0x9575f3[_0xacee('0xd')](_0x133999)[_0xacee('0xe')]();};}function respondWithResult(_0x55ea18,_0x593b1f){_0x593b1f=_0x593b1f||0xc8;return function(_0x4ec6d9){if(_0x4ec6d9){return _0x55ea18[_0xacee('0xd')](_0x593b1f)[_0xacee('0xf')](_0x4ec6d9);}};}function respondWithFilteredResult(_0x46ce65,_0x2cb230){return function(_0x557c68){if(_0x557c68){var _0x4d0489=typeof _0x2cb230[_0xacee('0x10')]==='undefined'&&typeof _0x2cb230[_0xacee('0x11')]===_0xacee('0x12');var _0x181d9e=_0x557c68[_0xacee('0x13')];var _0x38073a=_0x4d0489?0x0:_0x2cb230['offset'];var _0x328784=_0x4d0489?_0x557c68['count']:_0x2cb230[_0xacee('0x10')]+_0x2cb230[_0xacee('0x11')];var _0x57f589;if(_0x328784>=_0x181d9e){_0x328784=_0x181d9e;_0x57f589=0xc8;}else{_0x57f589=0xce;}_0x46ce65['status'](_0x57f589);return _0x46ce65[_0xacee('0x14')]('Content-Range',_0x38073a+'-'+_0x328784+'/'+_0x181d9e)[_0xacee('0xf')](_0x557c68);}return null;};}function saveUpdates(_0x22bd6e){return function(_0x749fa4){if(_0x749fa4){return _0x749fa4['update'](_0x22bd6e)[_0xacee('0x15')](function(_0x1885ce){return _0x1885ce;});}return null;};}function removeEntity(_0x49fed2){return function(_0x2b4457){if(_0x2b4457){return _0x2b4457[_0xacee('0x16')]()['then'](function(){var _0x2d1101=_0x2b4457['get']({'plain':!![]});var _0x23d3ed='ChatQueues';return db[_0xacee('0x17')]['destroy']({'where':{'type':_0x23d3ed,'resourceId':_0x2d1101['id']}})[_0xacee('0x15')](function(){return _0x2b4457;});})[_0xacee('0x15')](function(){_0x49fed2[_0xacee('0xd')](0xcc)[_0xacee('0xe')]();});}};}function handleEntityNotFound(_0x315908){return function(_0x2d3742){if(!_0x2d3742){_0x315908['sendStatus'](0x194);}return _0x2d3742;};}function handleError(_0x4509c6,_0x5021ea){_0x5021ea=_0x5021ea||0x1f4;return function(_0x436f30){logger[_0xacee('0x18')](_0x436f30['stack']);if(_0x436f30[_0xacee('0x19')]){delete _0x436f30[_0xacee('0x19')];}_0x4509c6[_0xacee('0xd')](_0x5021ea)[_0xacee('0x1a')](_0x436f30);};}exports[_0xacee('0x1b')]=function(_0xfb9adb,_0x2c07a8){var _0x4e69a2={};var _0x57e87e={'count':0x0,'rows':[]};var _0x3036f2=_[_0xacee('0x1c')](db[_0xacee('0x1d')][_0xacee('0x1e')],function(_0x44514c){return{'name':_0x44514c[_0xacee('0x1f')],'type':_0x44514c[_0xacee('0x20')][_0xacee('0x21')]};});_0x4e69a2=qs[_0xacee('0x22')](_0x3036f2,_0xfb9adb);var _0x37e3a7={'where':_0x4e69a2[_0xacee('0x23')]};return db[_0xacee('0x1d')][_0xacee('0x13')](_0x37e3a7)['then'](function(_0x403315){_0x57e87e['count']=_0x403315;_0x4e69a2[_0xacee('0x24')]=qs[_0xacee('0x24')](_0xfb9adb[_0xacee('0x25')]);return db[_0xacee('0x1d')][_0xacee('0x26')](_0x4e69a2);})[_0xacee('0x15')](function(_0x26da1c){_0x57e87e[_0xacee('0x27')]=_0x26da1c;return _0x57e87e;})[_0xacee('0x15')](respondWithFilteredResult(_0x2c07a8,_0x4e69a2))[_0xacee('0x28')](handleError(_0x2c07a8,null));};exports[_0xacee('0x29')]=function(_0x308df7,_0x443634){var _0x21d9d6={'raw':!![],'where':{'id':_0x308df7[_0xacee('0x2a')]['id']}},_0x12fdd4={};_0x12fdd4[_0xacee('0x2b')]=_[_0xacee('0x2c')](db['ChatQueue'][_0xacee('0x1e')]);_0x12fdd4['query']=_[_0xacee('0x2c')](_0x308df7[_0xacee('0x25')]);_0x12fdd4[_0xacee('0x2d')]=_[_0xacee('0x2e')](_0x12fdd4['model'],_0x12fdd4[_0xacee('0x25')]);_0x21d9d6[_0xacee('0x2f')]=_[_0xacee('0x2e')](_0x12fdd4[_0xacee('0x2b')],qs[_0xacee('0x30')](_0x308df7[_0xacee('0x25')][_0xacee('0x30')]));_0x21d9d6[_0xacee('0x2f')]=_0x21d9d6['attributes'][_0xacee('0x31')]?_0x21d9d6[_0xacee('0x2f')]:_0x12fdd4[_0xacee('0x2b')];if(_0x308df7['query'][_0xacee('0x32')]){_0x21d9d6[_0xacee('0x24')]=[{'all':!![]}];}_0x21d9d6=_[_0xacee('0x33')]({},_0x21d9d6,_0x308df7[_0xacee('0x34')]);return db[_0xacee('0x1d')][_0xacee('0x35')](_0x21d9d6)[_0xacee('0x15')](handleEntityNotFound(_0x443634,null))[_0xacee('0x15')](respondWithResult(_0x443634,null))[_0xacee('0x28')](handleError(_0x443634,null));};exports[_0xacee('0x36')]=function(_0x4bd734,_0x56dba5){return db[_0xacee('0x1d')]['create'](_0x4bd734[_0xacee('0x37')],{})['then'](function(_0x30b0ca){var _0x435ea1=_0x4bd734['user']['get']({'plain':!![]});if(!_0x435ea1)throw new Error(_0xacee('0x38'));if(_0x435ea1['role']==='user'){var _0x444f1f=_0x30b0ca['get']({'plain':!![]});var _0x117b31=_0xacee('0x39');return db[_0xacee('0x3a')]['find']({'where':{'name':_0x117b31,'userProfileId':_0x435ea1['userProfileId']},'raw':!![]})['then'](function(_0x28f677){if(_0x28f677&&_0x28f677[_0xacee('0x3b')]===0x0){return db[_0xacee('0x17')][_0xacee('0x36')]({'name':_0x444f1f[_0xacee('0x19')],'resourceId':_0x444f1f['id'],'type':_0x28f677['name'],'sectionId':_0x28f677['id']},{})[_0xacee('0x15')](function(){return _0x30b0ca;});}else{return _0x30b0ca;}})[_0xacee('0x28')](function(_0x1f6d54){logger[_0xacee('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6d54);throw _0x1f6d54;});}return _0x30b0ca;})[_0xacee('0x15')](respondWithResult(_0x56dba5,0xc9))[_0xacee('0x28')](handleError(_0x56dba5,null));};exports[_0xacee('0x3c')]=function(_0x5306b3,_0x17602f){if(_0x5306b3[_0xacee('0x37')]['id']){delete _0x5306b3[_0xacee('0x37')]['id'];}return db[_0xacee('0x1d')]['find']({'where':{'id':_0x5306b3[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x17602f,null))[_0xacee('0x15')](saveUpdates(_0x5306b3[_0xacee('0x37')],null))['then'](respondWithResult(_0x17602f,null))['catch'](handleError(_0x17602f,null));};exports[_0xacee('0x16')]=function(_0x1e3a60,_0x46f2bb){return db[_0xacee('0x1d')]['find']({'where':{'id':_0x1e3a60[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x46f2bb,null))[_0xacee('0x15')](removeEntity(_0x46f2bb,null))[_0xacee('0x28')](handleError(_0x46f2bb,null));};exports[_0xacee('0x3d')]=function(_0x2e8520,_0x5e77ab){return db[_0xacee('0x1d')][_0xacee('0x3d')]()[_0xacee('0x15')](respondWithResult(_0x5e77ab,null))[_0xacee('0x28')](handleError(_0x5e77ab,null));};exports[_0xacee('0x3e')]=function(_0xf5785f,_0x326871){var _0x4e0e4a={'raw':!![],'where':{}},_0xd93c1a={},_0x3237de;return db['ChatQueue'][_0xacee('0x3f')]({'where':{'id':_0xf5785f[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x326871,null))[_0xacee('0x15')](function(_0xad2411){if(_0xad2411){_0x3237de=_0xad2411[_0xacee('0x40')]({'plain':!![]});_0xd93c1a[_0xacee('0x2b')]=_['keys'](db[_0xacee('0x41')][_0xacee('0x1e')]);_0xd93c1a[_0xacee('0x25')]=_[_0xacee('0x2c')](_0xf5785f[_0xacee('0x25')]);_0xd93c1a[_0xacee('0x2d')]=_[_0xacee('0x2e')](_0xd93c1a[_0xacee('0x2b')],_0xd93c1a[_0xacee('0x25')]);_0x4e0e4a['attributes']=_[_0xacee('0x2e')](_0xd93c1a[_0xacee('0x2b')],qs[_0xacee('0x30')](_0xf5785f[_0xacee('0x25')][_0xacee('0x30')]));_0x4e0e4a[_0xacee('0x2f')]=_0x4e0e4a['attributes']['length']?_0x4e0e4a['attributes']:_0xd93c1a['model'];if(!_0xf5785f[_0xacee('0x25')][_0xacee('0x42')]('nolimit')){_0x4e0e4a[_0xacee('0x11')]=qs[_0xacee('0x11')](_0xf5785f[_0xacee('0x25')]['limit']);_0x4e0e4a[_0xacee('0x10')]=qs[_0xacee('0x10')](_0xf5785f[_0xacee('0x25')]['offset']);}_0x4e0e4a['order']=qs[_0xacee('0x43')](_0xf5785f[_0xacee('0x25')]['sort']);_0x4e0e4a['where']=qs['filters'](_[_0xacee('0x44')](_0xf5785f[_0xacee('0x25')],_0xd93c1a['filters']));_0x4e0e4a[_0xacee('0x23')][_0xacee('0x45')]=_0xad2411['id'];if(_0xf5785f[_0xacee('0x25')][_0xacee('0x46')]){_0x4e0e4a[_0xacee('0x23')]=_['merge'](_0x4e0e4a[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x4e0e4a['attributes'],function(_0x518ae6){var _0x3b6e52={};_0x3b6e52[_0x518ae6]={'$like':'%'+_0xf5785f['query'][_0xacee('0x46')]+'%'};return _0x3b6e52;})});}_0x4e0e4a=_[_0xacee('0x33')]({},_0x4e0e4a,_0xf5785f['options']);return db[_0xacee('0x41')][_0xacee('0x26')](_0x4e0e4a);}})['then'](function(_0x34e863){if(_0x34e863){return db[_0xacee('0x47')][_0xacee('0x48')]({'where':{'id':_['map'](_0x34e863,_0xacee('0x49')),'role':_0xacee('0x4a')},'attributes':['id',_0xacee('0x19'),_0xacee('0x4b'),_0xacee('0x4c'),_0xacee('0x4d')]});}})[_0xacee('0x15')](function(_0xe2d289){if(_0xe2d289){return{'count':_0xe2d289[_0xacee('0x13')],'rows':_['map'](_0xe2d289[_0xacee('0x27')],function(_0x5851d5){return{'membername':_0x5851d5[_0xacee('0x19')],'UserId':_0x5851d5['id'],'queue_name':_0x3237de[_0xacee('0x19')],'ChatQueueId':_0x3237de['id'],'interface':util[_0xacee('0x4e')](_0xacee('0x4f'),_0xacee('0x50'),_0x5851d5[_0xacee('0x19')]),'penalty':0x0,'paused':_0x5851d5[_0xacee('0x4b')],'createdAt':_0x5851d5[_0xacee('0x4d')],'updatedAt':_0x5851d5[_0xacee('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x326871,_0x4e0e4a))['catch'](handleError(_0x326871,null));};exports[_0xacee('0x51')]=function(_0x38067a,_0x291278){var _0x3ab7dc={};var _0xa7363f={};var _0x59adb0;var _0x5f491d;return db[_0xacee('0x1d')]['findOne']({'where':{'id':_0x38067a[_0xacee('0x2a')]['id']}})['then'](handleEntityNotFound(_0x291278,null))[_0xacee('0x15')](function(_0x1d5c76){if(_0x1d5c76){_0x59adb0=_0x1d5c76;_0xa7363f['model']=_[_0xacee('0x2c')](db[_0xacee('0x52')][_0xacee('0x1e')]);_0xa7363f[_0xacee('0x25')]=_[_0xacee('0x2c')](_0x38067a[_0xacee('0x25')]);_0xa7363f['filters']=_[_0xacee('0x2e')](_0xa7363f[_0xacee('0x2b')],_0xa7363f['query']);_0x3ab7dc['attributes']=_[_0xacee('0x2e')](_0xa7363f[_0xacee('0x2b')],qs['fields'](_0x38067a[_0xacee('0x25')]['fields']));_0x3ab7dc[_0xacee('0x2f')]=_0x3ab7dc[_0xacee('0x2f')][_0xacee('0x31')]?_0x3ab7dc[_0xacee('0x2f')]:_0xa7363f[_0xacee('0x2b')];_0x3ab7dc[_0xacee('0x53')]=qs[_0xacee('0x43')](_0x38067a[_0xacee('0x25')][_0xacee('0x43')]);_0x3ab7dc[_0xacee('0x23')]=qs[_0xacee('0x2d')](_[_0xacee('0x44')](_0x38067a[_0xacee('0x25')],_0xa7363f[_0xacee('0x2d')]));if(_0x38067a[_0xacee('0x25')][_0xacee('0x46')]){_0x3ab7dc[_0xacee('0x23')]=_[_0xacee('0x33')](_0x3ab7dc[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x3ab7dc[_0xacee('0x2f')],function(_0x580ea1){var _0x161dca={};_0x161dca[_0x580ea1]={'$like':'%'+_0x38067a[_0xacee('0x25')][_0xacee('0x46')]+'%'};return _0x161dca;})});}_0x3ab7dc=_[_0xacee('0x33')]({},_0x3ab7dc,_0x38067a[_0xacee('0x34')]);return _0x59adb0[_0xacee('0x51')](_0x3ab7dc);}})[_0xacee('0x15')](function(_0x2e5c38){if(_0x2e5c38){_0x5f491d=_0x2e5c38['length'];if(!_0x38067a['query'][_0xacee('0x42')](_0xacee('0x54'))){_0x3ab7dc['limit']=qs['limit'](_0x38067a['query'][_0xacee('0x11')]);_0x3ab7dc[_0xacee('0x10')]=qs[_0xacee('0x10')](_0x38067a[_0xacee('0x25')][_0xacee('0x10')]);}return _0x59adb0['getTeams'](_0x3ab7dc);}})[_0xacee('0x15')](function(_0x1c9507){if(_0x1c9507){return _0x1c9507?{'count':_0x5f491d,'rows':_0x1c9507}:null;}})[_0xacee('0x15')](respondWithResult(_0x291278,null))['catch'](handleError(_0x291278,null));};exports[_0xacee('0x55')]=function(_0x1935b9,_0x512f9d){var _0x5df4dd=_0x1935b9[_0xacee('0x37')]['ids'];return db['Team'][_0xacee('0x26')]({'where':{'id':_0x5df4dd},'attributes':['id'],'include':[{'model':db['User'],'as':_0xacee('0x56'),'attributes':['id',_0xacee('0x19'),_0xacee('0x57'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1bef58){if(_0x1bef58){var _0x28cb9a=_[_0xacee('0x58')](_0x1bef58,function(_0x48393d){var _0x26aa49=_0x48393d[_0xacee('0x40')]({'plain':!![]});return _0x26aa49['Agents'];});return db[_0xacee('0x1d')]['find']({'where':{'id':_0x1935b9['params']['id']}})[_0xacee('0x15')](function(_0x40e632){return db['sequelize'][_0xacee('0x59')](function(_0x41a6b9){return _0x40e632['addTeams'](_0x5df4dd,{'transaction':_0x41a6b9})[_0xacee('0x15')](function(){return BPromise[_0xacee('0x5a')](_0x28cb9a,function(_0x1c97dc){return db[_0xacee('0x41')][_0xacee('0x5b')]({'where':{'UserId':_0x1c97dc['id'],'ChatQueueId':_0x1935b9[_0xacee('0x2a')]['id']},'transaction':_0x41a6b9});});})[_0xacee('0x15')](function(){_0x28cb9a[_0xacee('0x5c')](function(_0x238c52){socket[_0xacee('0x5d')]('userChatQueue:save',{'UserId':_0x238c52['id'],'ChatQueueId':_0x40e632['id']});});});});});}})[_0xacee('0x15')](respondWithStatusCode(_0x512f9d,null))[_0xacee('0x28')](handleError(_0x512f9d,null));};exports['removeTeams']=function(_0x339285,_0x1f15bd){return db[_0xacee('0x52')][_0xacee('0x26')]({'where':{'id':_0x339285['query'][_0xacee('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xacee('0x47')],'as':_0xacee('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f15bd,null))[_0xacee('0x15')](function(_0x4a8998){var _0x2b9973=_[_0xacee('0x1c')](_0x4a8998,'id');var _0x34dfa2=[];var _0x2f39b3=[];var _0x7189cc=squel[_0xacee('0x5f')]();_0x7189cc['field'](_0xacee('0x60'))[_0xacee('0x61')](_0xacee('0x62'),'tq')[_0xacee('0x63')](_0xacee('0x64'),'ut',_0xacee('0x65'))[_0xacee('0x23')](_0xacee('0x66'),_0x339285[_0xacee('0x2a')]['id']);for(var _0x1fafcc=0x0;_0x1fafcc<_0x4a8998['length'];_0x1fafcc+=0x1){let _0x1f880c=_0x4a8998[_0x1fafcc];for(var _0x12872a=0x0;_0x12872a<_0x1f880c['Agents'][_0xacee('0x31')];_0x12872a+=0x1){let _0x221682=_0x1f880c['Agents'][_0x12872a];var _0x1c5f85=_0x7189cc[_0xacee('0x67')]();_0x1c5f85['where'](_0xacee('0x68'),_0x221682['id']);_0x2f39b3[_0xacee('0x69')](db[_0xacee('0x6a')]['query'](_0x1c5f85[_0xacee('0x6b')](),{'type':db[_0xacee('0x6a')][_0xacee('0x6c')]['SELECT']})[_0xacee('0x15')](function(_0x2fe41d){if(_0x2fe41d[_0xacee('0x31')]===0x1){return _0x221682['id'];}else{var _0x969d70=_[_0xacee('0x6d')](_['map'](_0x2fe41d,_0xacee('0x6e')),function(_0x242598){return _[_0xacee('0x6f')](_0x2b9973,_0x242598);});if(_0x969d70){return _0x221682['id'];}}}));}}return BPromise[_0xacee('0x70')](_0x2f39b3)[_0xacee('0x15')](function(_0x2a9d6d){_0x34dfa2=_(_0x34dfa2)[_0xacee('0x71')](_0x2a9d6d)[_0xacee('0x72')]()[_0xacee('0x73')]();return db[_0xacee('0x1d')][_0xacee('0x35')]({'where':{'id':_0x339285['params']['id']}})[_0xacee('0x15')](function(_0x1c15eb){return db[_0xacee('0x6a')][_0xacee('0x59')](function(_0x5ab2ce){return _0x1c15eb[_0xacee('0x74')](_0x339285[_0xacee('0x25')][_0xacee('0x5e')],{'transaction':_0x5ab2ce})['then'](function(){if(!_['isEmpty'](_0x34dfa2)){return _0x1c15eb[_0xacee('0x75')](_0x34dfa2,{'transaction':_0x5ab2ce});}})['then'](function(){_0x34dfa2[_0xacee('0x5c')](function(_0x124a55){socket[_0xacee('0x5d')](_0xacee('0x76'),{'UserId':_0x124a55,'ChatQueueId':_0x1c15eb['id']});});});});});});})['then'](respondWithStatusCode(_0x1f15bd,null))[_0xacee('0x28')](handleError(_0x1f15bd,null));};exports[_0xacee('0x77')]=function(_0x289596,_0x42bd5a){return db[_0xacee('0x1d')][_0xacee('0x35')]({'where':{'id':_0x289596['params']['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x42bd5a,null))['then'](function(_0x30a68c){if(_0x30a68c){return _0x30a68c[_0xacee('0x77')](_0x289596['body']['ids'],_[_0xacee('0x78')](_0x289596[_0xacee('0x37')],[_0xacee('0x5e'),'id'])||{})[_0xacee('0x79')](function(_0x44913e){for(var _0x1e62b6=0x0;_0x1e62b6<_0x289596[_0xacee('0x37')][_0xacee('0x5e')]['length'];_0x1e62b6+=0x1){socket[_0xacee('0x5d')](_0xacee('0x7a'),{'UserId':Number(_0x289596[_0xacee('0x37')][_0xacee('0x5e')][_0x1e62b6]),'ChatQueueId':Number(_0x289596[_0xacee('0x2a')]['id'])});}return _0x44913e;});}})[_0xacee('0x15')](respondWithResult(_0x42bd5a,null))[_0xacee('0x28')](handleError(_0x42bd5a,null));};exports[_0xacee('0x75')]=function(_0x56aac0,_0xd90440){return db['ChatQueue']['find']({'where':{'id':_0x56aac0['params']['id']}})['then'](handleEntityNotFound(_0xd90440,null))[_0xacee('0x15')](function(_0x1c9194){if(_0x1c9194){return _0x1c9194['removeAgents'](_0x56aac0['query'][_0xacee('0x5e')])[_0xacee('0x15')](function(){if(_[_0xacee('0x7b')](_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')])){for(var _0x1b59b8=0x0;_0x1b59b8<_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')][_0xacee('0x31')];_0x1b59b8+=0x1){socket[_0xacee('0x5d')](_0xacee('0x76'),{'UserId':Number(_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')][_0x1b59b8]),'ChatQueueId':Number(_0x56aac0[_0xacee('0x2a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')]),'ChatQueueId':Number(_0x56aac0[_0xacee('0x2a')]['id'])});}});}})[_0xacee('0x15')](respondWithStatusCode(_0xd90440,null))['catch'](handleError(_0xd90440,null));};exports[_0xacee('0x7c')]=function(_0x36e4c7,_0x5bc0b6){var _0x2f2997={};var _0x5c25f9={};var _0x172538;var _0x3ff528;return db[_0xacee('0x1d')][_0xacee('0x3f')]({'where':{'id':_0x36e4c7[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x5bc0b6,null))[_0xacee('0x15')](function(_0x26b5c4){if(_0x26b5c4){_0x172538=_0x26b5c4;_0x5c25f9[_0xacee('0x2b')]=_[_0xacee('0x2c')](db[_0xacee('0x47')][_0xacee('0x1e')]);_0x5c25f9[_0xacee('0x25')]=_['keys'](_0x36e4c7[_0xacee('0x25')]);_0x5c25f9['filters']=_[_0xacee('0x2e')](_0x5c25f9[_0xacee('0x2b')],_0x5c25f9[_0xacee('0x25')]);_0x2f2997[_0xacee('0x2f')]=_[_0xacee('0x2e')](_0x5c25f9[_0xacee('0x2b')],qs['fields'](_0x36e4c7['query'][_0xacee('0x30')]));_0x2f2997['attributes']=_0x2f2997[_0xacee('0x2f')][_0xacee('0x31')]?_0x2f2997[_0xacee('0x2f')]:_0x5c25f9[_0xacee('0x2b')];_0x2f2997[_0xacee('0x53')]=qs[_0xacee('0x43')](_0x36e4c7[_0xacee('0x25')][_0xacee('0x43')]);_0x2f2997[_0xacee('0x23')]=qs[_0xacee('0x2d')](_[_0xacee('0x44')](_0x36e4c7['query'],_0x5c25f9[_0xacee('0x2d')]));if(_0x36e4c7['query']['filter']){_0x2f2997[_0xacee('0x23')]=_[_0xacee('0x33')](_0x2f2997[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x2f2997[_0xacee('0x2f')],function(_0x4619dd){var _0x3f545f={};_0x3f545f[_0x4619dd]={'$like':'%'+_0x36e4c7[_0xacee('0x25')]['filter']+'%'};return _0x3f545f;})});}_0x2f2997=_[_0xacee('0x33')]({},_0x2f2997,_0x36e4c7['options']);return _0x172538[_0xacee('0x7c')](_0x2f2997);}})[_0xacee('0x15')](function(_0x1bf0cc){if(_0x1bf0cc){_0x3ff528=_0x1bf0cc[_0xacee('0x31')];if(!_0x36e4c7[_0xacee('0x25')][_0xacee('0x42')](_0xacee('0x54'))){_0x2f2997[_0xacee('0x11')]=qs[_0xacee('0x11')](_0x36e4c7[_0xacee('0x25')][_0xacee('0x11')]);_0x2f2997['offset']=qs[_0xacee('0x10')](_0x36e4c7[_0xacee('0x25')]['offset']);}return _0x172538[_0xacee('0x7c')](_0x2f2997);}})[_0xacee('0x15')](function(_0x14b81e){if(_0x14b81e){return _0x14b81e?{'count':_0x3ff528,'rows':_0x14b81e}:null;}})['then'](respondWithResult(_0x5bc0b6,null))['catch'](handleError(_0x5bc0b6,null));};
\ No newline at end of file
+var _0x36db=['rawAttributes','type','where','include','catch','show','params','model','query','filters','intersection','attributes','fields','length','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','keys','nolimit','order','sort','pick','ChatQueueId','filter','findAll','User','agent','chatPause','rows','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','includes','all','compact','value','isEmpty','removeAgents','forEach','omit','spread','isArray','userChatQueue:remove','getAgents','hasOwnProperty','bluebird','util','squel','ioredis','api','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','UserProfileResource','name','send','index','map','ChatQueue'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x36db,0x19b));var _0xb36d=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x36db[_0x36a469];return _0x3347fc;};'use strict';var BPromise=require(_0xb36d('0x0'));var util=require(_0xb36d('0x1'));var _=require('lodash');var squel=require(_0xb36d('0x2'));var Redis=require(_0xb36d('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xb36d('0x4'));var config=require('../../config/environment');var db=require(_0xb36d('0x5'))['db'];config[_0xb36d('0x6')]=_[_0xb36d('0x7')](config[_0xb36d('0x6')],{'host':_0xb36d('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb36d('0x6')]));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x330050,_0x1a824e){_0x1a824e=_0x1a824e||0xcc;return function(_0x4a9182){if(_0x4a9182){return _0x330050[_0xb36d('0x9')](_0x1a824e);}return _0x330050['status'](_0x1a824e)[_0xb36d('0xa')]();};}function respondWithResult(_0x434cb6,_0x51ebf8){_0x51ebf8=_0x51ebf8||0xc8;return function(_0x30d78b){if(_0x30d78b){return _0x434cb6[_0xb36d('0xb')](_0x51ebf8)[_0xb36d('0xc')](_0x30d78b);}};}function respondWithFilteredResult(_0x54005a,_0x17ecad){return function(_0x2b490f){if(_0x2b490f){var _0x43f90b=typeof _0x17ecad[_0xb36d('0xd')]===_0xb36d('0xe')&&typeof _0x17ecad['limit']===_0xb36d('0xe');var _0x3ca4c2=_0x2b490f[_0xb36d('0xf')];var _0x15e393=_0x43f90b?0x0:_0x17ecad[_0xb36d('0xd')];var _0x29c2e9=_0x43f90b?_0x2b490f[_0xb36d('0xf')]:_0x17ecad[_0xb36d('0xd')]+_0x17ecad[_0xb36d('0x10')];var _0x1cd617;if(_0x29c2e9>=_0x3ca4c2){_0x29c2e9=_0x3ca4c2;_0x1cd617=0xc8;}else{_0x1cd617=0xce;}_0x54005a[_0xb36d('0xb')](_0x1cd617);return _0x54005a[_0xb36d('0x11')](_0xb36d('0x12'),_0x15e393+'-'+_0x29c2e9+'/'+_0x3ca4c2)[_0xb36d('0xc')](_0x2b490f);}return null;};}function saveUpdates(_0x4c80fa){return function(_0x15a35e){if(_0x15a35e){return _0x15a35e[_0xb36d('0x13')](_0x4c80fa)[_0xb36d('0x14')](function(_0x390703){return _0x390703;});}return null;};}function removeEntity(_0x27d310){return function(_0x1c1780){if(_0x1c1780){return _0x1c1780[_0xb36d('0x15')]()[_0xb36d('0x14')](function(){var _0x11be3b=_0x1c1780[_0xb36d('0x16')]({'plain':!![]});var _0x4d0c89='ChatQueues';return db[_0xb36d('0x17')]['destroy']({'where':{'type':_0x4d0c89,'resourceId':_0x11be3b['id']}})[_0xb36d('0x14')](function(){return _0x1c1780;});})['then'](function(){_0x27d310[_0xb36d('0xb')](0xcc)[_0xb36d('0xa')]();});}};}function handleEntityNotFound(_0x1a3dd1){return function(_0x22aa52){if(!_0x22aa52){_0x1a3dd1[_0xb36d('0x9')](0x194);}return _0x22aa52;};}function handleError(_0xb18f2a,_0x42d65b){_0x42d65b=_0x42d65b||0x1f4;return function(_0x2dac72){logger['error'](_0x2dac72['stack']);if(_0x2dac72['name']){delete _0x2dac72[_0xb36d('0x18')];}_0xb18f2a[_0xb36d('0xb')](_0x42d65b)[_0xb36d('0x19')](_0x2dac72);};}exports[_0xb36d('0x1a')]=function(_0x2f6646,_0x1fe8a8){var _0x954f5b={};var _0x318a9f={'count':0x0,'rows':[]};var _0x1516fa=_[_0xb36d('0x1b')](db[_0xb36d('0x1c')][_0xb36d('0x1d')],function(_0x5f0988){return{'name':_0x5f0988['fieldName'],'type':_0x5f0988[_0xb36d('0x1e')]['key']};});_0x954f5b=qs['getOptions'](_0x1516fa,_0x2f6646);var _0x21d6e2={'where':_0x954f5b[_0xb36d('0x1f')]};return db[_0xb36d('0x1c')][_0xb36d('0xf')](_0x21d6e2)[_0xb36d('0x14')](function(_0x41b1da){_0x318a9f[_0xb36d('0xf')]=_0x41b1da;_0x954f5b['include']=qs[_0xb36d('0x20')](_0x2f6646['query']);return db[_0xb36d('0x1c')]['findAll'](_0x954f5b);})[_0xb36d('0x14')](function(_0x4b41b3){_0x318a9f['rows']=_0x4b41b3;return _0x318a9f;})[_0xb36d('0x14')](respondWithFilteredResult(_0x1fe8a8,_0x954f5b))[_0xb36d('0x21')](handleError(_0x1fe8a8,null));};exports[_0xb36d('0x22')]=function(_0x889f83,_0x484c22){var _0x3c16b1={'raw':!![],'where':{'id':_0x889f83[_0xb36d('0x23')]['id']}},_0x4f634e={};_0x4f634e[_0xb36d('0x24')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x4f634e[_0xb36d('0x25')]=_['keys'](_0x889f83['query']);_0x4f634e[_0xb36d('0x26')]=_[_0xb36d('0x27')](_0x4f634e['model'],_0x4f634e[_0xb36d('0x25')]);_0x3c16b1[_0xb36d('0x28')]=_['intersection'](_0x4f634e[_0xb36d('0x24')],qs[_0xb36d('0x29')](_0x889f83[_0xb36d('0x25')][_0xb36d('0x29')]));_0x3c16b1['attributes']=_0x3c16b1[_0xb36d('0x28')][_0xb36d('0x2a')]?_0x3c16b1[_0xb36d('0x28')]:_0x4f634e[_0xb36d('0x24')];if(_0x889f83['query']['includeAll']){_0x3c16b1[_0xb36d('0x20')]=[{'all':!![]}];}_0x3c16b1=_[_0xb36d('0x2b')]({},_0x3c16b1,_0x889f83[_0xb36d('0x2c')]);return db['ChatQueue'][_0xb36d('0x2d')](_0x3c16b1)[_0xb36d('0x14')](handleEntityNotFound(_0x484c22,null))[_0xb36d('0x14')](respondWithResult(_0x484c22,null))[_0xb36d('0x21')](handleError(_0x484c22,null));};exports[_0xb36d('0x2e')]=function(_0x33ad6f,_0x1bc486){return db[_0xb36d('0x1c')][_0xb36d('0x2e')](_0x33ad6f[_0xb36d('0x2f')],{})[_0xb36d('0x14')](function(_0x55ab41){var _0x2c836e=_0x33ad6f['user']['get']({'plain':!![]});if(!_0x2c836e)throw new Error(_0xb36d('0x30'));if(_0x2c836e['role']===_0xb36d('0x31')){var _0x2edad5=_0x55ab41[_0xb36d('0x16')]({'plain':!![]});var _0x245347='ChatQueues';return db['UserProfileSection'][_0xb36d('0x2d')]({'where':{'name':_0x245347,'userProfileId':_0x2c836e[_0xb36d('0x32')]},'raw':!![]})[_0xb36d('0x14')](function(_0x3d0187){if(_0x3d0187&&_0x3d0187[_0xb36d('0x33')]===0x0){return db[_0xb36d('0x17')]['create']({'name':_0x2edad5[_0xb36d('0x18')],'resourceId':_0x2edad5['id'],'type':_0x3d0187[_0xb36d('0x18')],'sectionId':_0x3d0187['id']},{})[_0xb36d('0x14')](function(){return _0x55ab41;});}else{return _0x55ab41;}})[_0xb36d('0x21')](function(_0x2b591e){logger[_0xb36d('0x34')](_0xb36d('0x35'),_0x2b591e);throw _0x2b591e;});}return _0x55ab41;})[_0xb36d('0x14')](respondWithResult(_0x1bc486,0xc9))[_0xb36d('0x21')](handleError(_0x1bc486,null));};exports[_0xb36d('0x13')]=function(_0x1ea227,_0x3e93a5){if(_0x1ea227[_0xb36d('0x2f')]['id']){delete _0x1ea227[_0xb36d('0x2f')]['id'];}return db[_0xb36d('0x1c')][_0xb36d('0x2d')]({'where':{'id':_0x1ea227[_0xb36d('0x23')]['id']}})['then'](handleEntityNotFound(_0x3e93a5,null))[_0xb36d('0x14')](saveUpdates(_0x1ea227['body'],null))[_0xb36d('0x14')](respondWithResult(_0x3e93a5,null))[_0xb36d('0x21')](handleError(_0x3e93a5,null));};exports['destroy']=function(_0x40c215,_0x2e5986){return db[_0xb36d('0x1c')]['find']({'where':{'id':_0x40c215[_0xb36d('0x23')]['id']}})[_0xb36d('0x14')](handleEntityNotFound(_0x2e5986,null))[_0xb36d('0x14')](removeEntity(_0x2e5986,null))[_0xb36d('0x21')](handleError(_0x2e5986,null));};exports[_0xb36d('0x36')]=function(_0x489387,_0x1e0248){return db[_0xb36d('0x1c')]['describe']()[_0xb36d('0x14')](respondWithResult(_0x1e0248,null))[_0xb36d('0x21')](handleError(_0x1e0248,null));};exports['getMembers']=function(_0x237182,_0x33cee9){var _0x2e4222={'raw':!![],'where':{}},_0x69bcad={},_0x4333f9;return db['ChatQueue'][_0xb36d('0x37')]({'where':{'id':_0x237182[_0xb36d('0x23')]['id']}})['then'](handleEntityNotFound(_0x33cee9,null))[_0xb36d('0x14')](function(_0x19c4e9){if(_0x19c4e9){_0x4333f9=_0x19c4e9[_0xb36d('0x16')]({'plain':!![]});_0x69bcad['model']=_['keys'](db[_0xb36d('0x38')][_0xb36d('0x1d')]);_0x69bcad[_0xb36d('0x25')]=_[_0xb36d('0x39')](_0x237182['query']);_0x69bcad[_0xb36d('0x26')]=_[_0xb36d('0x27')](_0x69bcad[_0xb36d('0x24')],_0x69bcad[_0xb36d('0x25')]);_0x2e4222[_0xb36d('0x28')]=_['intersection'](_0x69bcad[_0xb36d('0x24')],qs[_0xb36d('0x29')](_0x237182[_0xb36d('0x25')][_0xb36d('0x29')]));_0x2e4222[_0xb36d('0x28')]=_0x2e4222[_0xb36d('0x28')][_0xb36d('0x2a')]?_0x2e4222['attributes']:_0x69bcad[_0xb36d('0x24')];if(!_0x237182[_0xb36d('0x25')]['hasOwnProperty'](_0xb36d('0x3a'))){_0x2e4222[_0xb36d('0x10')]=qs['limit'](_0x237182[_0xb36d('0x25')]['limit']);_0x2e4222[_0xb36d('0xd')]=qs['offset'](_0x237182[_0xb36d('0x25')][_0xb36d('0xd')]);}_0x2e4222[_0xb36d('0x3b')]=qs['sort'](_0x237182[_0xb36d('0x25')][_0xb36d('0x3c')]);_0x2e4222[_0xb36d('0x1f')]=qs[_0xb36d('0x26')](_[_0xb36d('0x3d')](_0x237182[_0xb36d('0x25')],_0x69bcad[_0xb36d('0x26')]));_0x2e4222[_0xb36d('0x1f')][_0xb36d('0x3e')]=_0x19c4e9['id'];if(_0x237182[_0xb36d('0x25')]['filter']){_0x2e4222[_0xb36d('0x1f')]=_[_0xb36d('0x2b')](_0x2e4222[_0xb36d('0x1f')],{'$or':_[_0xb36d('0x1b')](_0x2e4222[_0xb36d('0x28')],function(_0x20f2d9){var _0x1d3ab2={};_0x1d3ab2[_0x20f2d9]={'$like':'%'+_0x237182[_0xb36d('0x25')][_0xb36d('0x3f')]+'%'};return _0x1d3ab2;})});}_0x2e4222=_[_0xb36d('0x2b')]({},_0x2e4222,_0x237182[_0xb36d('0x2c')]);return db['UserChatQueue'][_0xb36d('0x40')](_0x2e4222);}})[_0xb36d('0x14')](function(_0x4f227f){if(_0x4f227f){return db[_0xb36d('0x41')]['findAndCountAll']({'where':{'id':_['map'](_0x4f227f,'UserId'),'role':_0xb36d('0x42')},'attributes':['id',_0xb36d('0x18'),_0xb36d('0x43'),'updatedAt','createdAt']});}})[_0xb36d('0x14')](function(_0x23494f){if(_0x23494f){return{'count':_0x23494f[_0xb36d('0xf')],'rows':_[_0xb36d('0x1b')](_0x23494f[_0xb36d('0x44')],function(_0x389974){return{'membername':_0x389974[_0xb36d('0x18')],'UserId':_0x389974['id'],'queue_name':_0x4333f9[_0xb36d('0x18')],'ChatQueueId':_0x4333f9['id'],'interface':util['format'](_0xb36d('0x45'),_0xb36d('0x46'),_0x389974[_0xb36d('0x18')]),'penalty':0x0,'paused':_0x389974[_0xb36d('0x43')],'createdAt':_0x389974[_0xb36d('0x47')],'updatedAt':_0x389974[_0xb36d('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb36d('0x14')](respondWithFilteredResult(_0x33cee9,_0x2e4222))[_0xb36d('0x21')](handleError(_0x33cee9,null));};exports[_0xb36d('0x49')]=function(_0x33dafc,_0x5dfca2){var _0x1d02c7={};var _0xdd640={};var _0x25599f;var _0x3329e2;return db['ChatQueue'][_0xb36d('0x37')]({'where':{'id':_0x33dafc[_0xb36d('0x23')]['id']}})[_0xb36d('0x14')](handleEntityNotFound(_0x5dfca2,null))[_0xb36d('0x14')](function(_0x5866a6){if(_0x5866a6){_0x25599f=_0x5866a6;_0xdd640[_0xb36d('0x24')]=_['keys'](db[_0xb36d('0x4a')]['rawAttributes']);_0xdd640[_0xb36d('0x25')]=_[_0xb36d('0x39')](_0x33dafc[_0xb36d('0x25')]);_0xdd640[_0xb36d('0x26')]=_[_0xb36d('0x27')](_0xdd640[_0xb36d('0x24')],_0xdd640[_0xb36d('0x25')]);_0x1d02c7[_0xb36d('0x28')]=_[_0xb36d('0x27')](_0xdd640[_0xb36d('0x24')],qs[_0xb36d('0x29')](_0x33dafc[_0xb36d('0x25')][_0xb36d('0x29')]));_0x1d02c7[_0xb36d('0x28')]=_0x1d02c7[_0xb36d('0x28')]['length']?_0x1d02c7[_0xb36d('0x28')]:_0xdd640[_0xb36d('0x24')];_0x1d02c7[_0xb36d('0x3b')]=qs['sort'](_0x33dafc[_0xb36d('0x25')][_0xb36d('0x3c')]);_0x1d02c7[_0xb36d('0x1f')]=qs[_0xb36d('0x26')](_[_0xb36d('0x3d')](_0x33dafc[_0xb36d('0x25')],_0xdd640['filters']));if(_0x33dafc['query'][_0xb36d('0x3f')]){_0x1d02c7[_0xb36d('0x1f')]=_['merge'](_0x1d02c7['where'],{'$or':_[_0xb36d('0x1b')](_0x1d02c7[_0xb36d('0x28')],function(_0x1250b4){var _0x5d758d={};_0x5d758d[_0x1250b4]={'$like':'%'+_0x33dafc['query']['filter']+'%'};return _0x5d758d;})});}_0x1d02c7=_[_0xb36d('0x2b')]({},_0x1d02c7,_0x33dafc[_0xb36d('0x2c')]);return _0x25599f['getTeams'](_0x1d02c7);}})[_0xb36d('0x14')](function(_0x20db27){if(_0x20db27){_0x3329e2=_0x20db27['length'];if(!_0x33dafc[_0xb36d('0x25')]['hasOwnProperty'](_0xb36d('0x3a'))){_0x1d02c7[_0xb36d('0x10')]=qs[_0xb36d('0x10')](_0x33dafc[_0xb36d('0x25')][_0xb36d('0x10')]);_0x1d02c7[_0xb36d('0xd')]=qs[_0xb36d('0xd')](_0x33dafc['query'][_0xb36d('0xd')]);}return _0x25599f[_0xb36d('0x49')](_0x1d02c7);}})['then'](function(_0x2c0dc0){if(_0x2c0dc0){return _0x2c0dc0?{'count':_0x3329e2,'rows':_0x2c0dc0}:null;}})['then'](respondWithResult(_0x5dfca2,null))[_0xb36d('0x21')](handleError(_0x5dfca2,null));};exports[_0xb36d('0x4b')]=function(_0xdedc54,_0x35d2f5){var _0x44b472=_0xdedc54[_0xb36d('0x2f')][_0xb36d('0x4c')];return db['Team'][_0xb36d('0x40')]({'where':{'id':_0x44b472},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb36d('0x4d'),'attributes':['id',_0xb36d('0x18'),_0xb36d('0x4e'),'voicePause',_0xb36d('0x4f')],'raw':!![]}]})['then'](function(_0x137811){if(_0x137811){var _0x385569=_[_0xb36d('0x50')](_0x137811,function(_0x5be958){var _0x5ae06b=_0x5be958[_0xb36d('0x16')]({'plain':!![]});return _0x5ae06b['Agents'];});return db[_0xb36d('0x1c')][_0xb36d('0x2d')]({'where':{'id':_0xdedc54['params']['id']}})[_0xb36d('0x14')](function(_0x1d08ec){return db['sequelize'][_0xb36d('0x51')](function(_0x3dd4da){return _0x1d08ec['addTeams'](_0x44b472,{'transaction':_0x3dd4da})[_0xb36d('0x14')](function(){return BPromise[_0xb36d('0x52')](_0x385569,function(_0x5bc4d2){return db['UserChatQueue'][_0xb36d('0x53')]({'where':{'UserId':_0x5bc4d2['id'],'ChatQueueId':_0xdedc54['params']['id']},'transaction':_0x3dd4da});});})['then'](function(){_0x385569['forEach'](function(_0xb2a149){socket[_0xb36d('0x54')]('userChatQueue:save',{'UserId':_0xb2a149['id'],'ChatQueueId':_0x1d08ec['id']});});});});});}})['then'](respondWithStatusCode(_0x35d2f5,null))[_0xb36d('0x21')](handleError(_0x35d2f5,null));};exports[_0xb36d('0x55')]=function(_0x2c1404,_0x49aa68){return db[_0xb36d('0x4a')][_0xb36d('0x40')]({'where':{'id':_0x2c1404[_0xb36d('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb36d('0x41')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb36d('0x14')](handleEntityNotFound(_0x49aa68,null))[_0xb36d('0x14')](function(_0xcf202e){var _0xd7b56=_[_0xb36d('0x1b')](_0xcf202e,'id');var _0x1ba7ac=[];var _0x5da68a=[];var _0x59c2ce=squel[_0xb36d('0x56')]();_0x59c2ce['field'](_0xb36d('0x57'))[_0xb36d('0x58')](_0xb36d('0x59'),'tq')['join'](_0xb36d('0x5a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb36d('0x1f')]('ChatQueueId\x20=\x20?',_0x2c1404[_0xb36d('0x23')]['id']);for(var _0x2e7ef4=0x0;_0x2e7ef4<_0xcf202e[_0xb36d('0x2a')];_0x2e7ef4+=0x1){let _0x28e847=_0xcf202e[_0x2e7ef4];for(var _0xe4a530=0x0;_0xe4a530<_0x28e847['Agents'][_0xb36d('0x2a')];_0xe4a530+=0x1){let _0x1899c6=_0x28e847[_0xb36d('0x4d')][_0xe4a530];var _0x5eb1a7=_0x59c2ce[_0xb36d('0x5b')]();_0x5eb1a7[_0xb36d('0x1f')](_0xb36d('0x5c'),_0x1899c6['id']);_0x5da68a[_0xb36d('0x5d')](db['sequelize'][_0xb36d('0x25')](_0x5eb1a7[_0xb36d('0x5e')](),{'type':db[_0xb36d('0x5f')][_0xb36d('0x60')]['SELECT']})[_0xb36d('0x14')](function(_0x262dd2){if(_0x262dd2[_0xb36d('0x2a')]===0x1){return _0x1899c6['id'];}else{var _0x5b85c6=_['every'](_['map'](_0x262dd2,'TeamId'),function(_0x4187d8){return _[_0xb36d('0x61')](_0xd7b56,_0x4187d8);});if(_0x5b85c6){return _0x1899c6['id'];}}}));}}return BPromise[_0xb36d('0x62')](_0x5da68a)[_0xb36d('0x14')](function(_0x34d6ec){_0x1ba7ac=_(_0x1ba7ac)['union'](_0x34d6ec)[_0xb36d('0x63')]()[_0xb36d('0x64')]();return db[_0xb36d('0x1c')][_0xb36d('0x2d')]({'where':{'id':_0x2c1404[_0xb36d('0x23')]['id']}})[_0xb36d('0x14')](function(_0x35fb69){return db[_0xb36d('0x5f')][_0xb36d('0x51')](function(_0x3b722d){return _0x35fb69[_0xb36d('0x55')](_0x2c1404[_0xb36d('0x25')]['ids'],{'transaction':_0x3b722d})[_0xb36d('0x14')](function(){if(!_[_0xb36d('0x65')](_0x1ba7ac)){return _0x35fb69[_0xb36d('0x66')](_0x1ba7ac,{'transaction':_0x3b722d});}})[_0xb36d('0x14')](function(){_0x1ba7ac[_0xb36d('0x67')](function(_0xe6ae79){socket[_0xb36d('0x54')]('userChatQueue:remove',{'UserId':_0xe6ae79,'ChatQueueId':_0x35fb69['id']});});});});});});})[_0xb36d('0x14')](respondWithStatusCode(_0x49aa68,null))['catch'](handleError(_0x49aa68,null));};exports['addAgents']=function(_0x2455ff,_0x14e58f){return db['ChatQueue'][_0xb36d('0x2d')]({'where':{'id':_0x2455ff[_0xb36d('0x23')]['id']}})[_0xb36d('0x14')](handleEntityNotFound(_0x14e58f,null))['then'](function(_0x567bf9){if(_0x567bf9){return _0x567bf9['addAgents'](_0x2455ff[_0xb36d('0x2f')][_0xb36d('0x4c')],_[_0xb36d('0x68')](_0x2455ff['body'],['ids','id'])||{})[_0xb36d('0x69')](function(_0x1b9e34){for(var _0x2d0f08=0x0;_0x2d0f08<_0x2455ff['body'][_0xb36d('0x4c')][_0xb36d('0x2a')];_0x2d0f08+=0x1){socket[_0xb36d('0x54')]('userChatQueue:save',{'UserId':Number(_0x2455ff['body'][_0xb36d('0x4c')][_0x2d0f08]),'ChatQueueId':Number(_0x2455ff[_0xb36d('0x23')]['id'])});}return _0x1b9e34;});}})['then'](respondWithResult(_0x14e58f,null))[_0xb36d('0x21')](handleError(_0x14e58f,null));};exports['removeAgents']=function(_0x4f44d1,_0x3f5b81){return db[_0xb36d('0x1c')]['find']({'where':{'id':_0x4f44d1[_0xb36d('0x23')]['id']}})['then'](handleEntityNotFound(_0x3f5b81,null))[_0xb36d('0x14')](function(_0x80fea4){if(_0x80fea4){return _0x80fea4[_0xb36d('0x66')](_0x4f44d1['query'][_0xb36d('0x4c')])[_0xb36d('0x14')](function(){if(_[_0xb36d('0x6a')](_0x4f44d1[_0xb36d('0x25')][_0xb36d('0x4c')])){for(var _0x41aedf=0x0;_0x41aedf<_0x4f44d1['query'][_0xb36d('0x4c')][_0xb36d('0x2a')];_0x41aedf+=0x1){socket['emit'](_0xb36d('0x6b'),{'UserId':Number(_0x4f44d1[_0xb36d('0x25')]['ids'][_0x41aedf]),'ChatQueueId':Number(_0x4f44d1['params']['id'])});}}else{socket[_0xb36d('0x54')](_0xb36d('0x6b'),{'UserId':Number(_0x4f44d1[_0xb36d('0x25')]['ids']),'ChatQueueId':Number(_0x4f44d1[_0xb36d('0x23')]['id'])});}});}})[_0xb36d('0x14')](respondWithStatusCode(_0x3f5b81,null))[_0xb36d('0x21')](handleError(_0x3f5b81,null));};exports[_0xb36d('0x6c')]=function(_0x413707,_0x2b02cf){var _0x8da210={};var _0x255198={};var _0x2b42e0;var _0x252922;return db[_0xb36d('0x1c')][_0xb36d('0x37')]({'where':{'id':_0x413707[_0xb36d('0x23')]['id']}})[_0xb36d('0x14')](handleEntityNotFound(_0x2b02cf,null))['then'](function(_0x5b7c4d){if(_0x5b7c4d){_0x2b42e0=_0x5b7c4d;_0x255198[_0xb36d('0x24')]=_[_0xb36d('0x39')](db[_0xb36d('0x41')]['rawAttributes']);_0x255198['query']=_[_0xb36d('0x39')](_0x413707[_0xb36d('0x25')]);_0x255198[_0xb36d('0x26')]=_[_0xb36d('0x27')](_0x255198['model'],_0x255198[_0xb36d('0x25')]);_0x8da210['attributes']=_['intersection'](_0x255198['model'],qs[_0xb36d('0x29')](_0x413707['query'][_0xb36d('0x29')]));_0x8da210['attributes']=_0x8da210[_0xb36d('0x28')][_0xb36d('0x2a')]?_0x8da210[_0xb36d('0x28')]:_0x255198['model'];_0x8da210[_0xb36d('0x3b')]=qs[_0xb36d('0x3c')](_0x413707[_0xb36d('0x25')]['sort']);_0x8da210['where']=qs[_0xb36d('0x26')](_[_0xb36d('0x3d')](_0x413707[_0xb36d('0x25')],_0x255198[_0xb36d('0x26')]));if(_0x413707['query'][_0xb36d('0x3f')]){_0x8da210['where']=_[_0xb36d('0x2b')](_0x8da210['where'],{'$or':_[_0xb36d('0x1b')](_0x8da210['attributes'],function(_0x1e452e){var _0x101fd7={};_0x101fd7[_0x1e452e]={'$like':'%'+_0x413707[_0xb36d('0x25')][_0xb36d('0x3f')]+'%'};return _0x101fd7;})});}_0x8da210=_['merge']({},_0x8da210,_0x413707[_0xb36d('0x2c')]);return _0x2b42e0[_0xb36d('0x6c')](_0x8da210);}})['then'](function(_0x392b63){if(_0x392b63){_0x252922=_0x392b63[_0xb36d('0x2a')];if(!_0x413707[_0xb36d('0x25')][_0xb36d('0x6d')](_0xb36d('0x3a'))){_0x8da210[_0xb36d('0x10')]=qs[_0xb36d('0x10')](_0x413707[_0xb36d('0x25')][_0xb36d('0x10')]);_0x8da210[_0xb36d('0xd')]=qs[_0xb36d('0xd')](_0x413707[_0xb36d('0x25')]['offset']);}return _0x2b42e0[_0xb36d('0x6c')](_0x8da210);}})['then'](function(_0x313a21){if(_0x313a21){return _0x313a21?{'count':_0x252922,'rows':_0x313a21}:null;}})[_0xb36d('0x14')](respondWithResult(_0x2b02cf,null))[_0xb36d('0x21')](handleError(_0x2b02cf,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index d9fad18..9b830bd 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 _0x79e3=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x79e3,0x77));var _0x379e=function(_0x1fa3d4,_0x39e1a5){_0x1fa3d4=_0x1fa3d4-0x0;var _0x1bf27c=_0x79e3[_0x1fa3d4];return _0x1bf27c;};'use strict';var EventEmitter=require(_0x379e('0x0'));var ChatQueue=require(_0x379e('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x379e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x379e('0x3'),'afterDestroy':_0x379e('0x4')};function emitEvent(_0x2e6d6b){return function(_0x234aa2,_0x2d61cd,_0x5bd2c6){ChatQueueEvents[_0x379e('0x5')](_0x2e6d6b+':'+_0x234aa2['id'],_0x234aa2);ChatQueueEvents[_0x379e('0x5')](_0x2e6d6b,_0x234aa2);_0x5bd2c6(null);};}for(var e in events){if(events[_0x379e('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xe2b4=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x556c52,_0x465925){var _0x3cfb76=function(_0x2f26f8){while(--_0x2f26f8){_0x556c52['push'](_0x556c52['shift']());}};_0x3cfb76(++_0x465925);}(_0xe2b4,0x18f));var _0x4e2b=function(_0x42cb1d,_0x22fc5b){_0x42cb1d=_0x42cb1d-0x0;var _0xf5ecc=_0xe2b4[_0x42cb1d];return _0xf5ecc;};'use strict';var EventEmitter=require(_0x4e2b('0x0'));var ChatQueue=require(_0x4e2b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4e2b('0x2')](0x0);var events={'afterCreate':_0x4e2b('0x3'),'afterUpdate':_0x4e2b('0x4'),'afterDestroy':_0x4e2b('0x5')};function emitEvent(_0x57efee){return function(_0x52371c,_0x7b72cf,_0x1c7077){ChatQueueEvents[_0x4e2b('0x6')](_0x57efee+':'+_0x52371c['id'],_0x52371c);ChatQueueEvents[_0x4e2b('0x6')](_0x57efee,_0x52371c);_0x1c7077(null);};}for(var e in events){if(events[_0x4e2b('0x7')](e)){var event=events[e];ChatQueue[_0x4e2b('0x8')](e,emitEvent(event));}}module[_0x4e2b('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index e1a89a3..ed44a8f 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 _0x5457=['request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','api','bluebird'];(function(_0x408110,_0x29c63a){var _0x272714=function(_0x2637ae){while(--_0x2637ae){_0x408110['push'](_0x408110['shift']());}};_0x272714(++_0x29c63a);}(_0x5457,0xb2));var _0x7545=function(_0x5c01d3,_0x1cc626){_0x5c01d3=_0x5c01d3-0x0;var _0x546b80=_0x5457[_0x5c01d3];return _0x546b80;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7545('0x0'));var moment=require('moment');var BPromise=require(_0x7545('0x1'));var rp=require(_0x7545('0x2'));var fs=require('fs');var path=require(_0x7545('0x3'));var rimraf=require(_0x7545('0x4'));var config=require(_0x7545('0x5'));var attributes=require('./chatQueue.attributes');module[_0x7545('0x6')]=function(_0x57f623,_0x5e3e8c){return _0x57f623[_0x7545('0x7')](_0x7545('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe20d=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x1e39ba,_0x5946cf){var _0x4dfe65=function(_0x1acadd){while(--_0x1acadd){_0x1e39ba['push'](_0x1e39ba['shift']());}};_0x4dfe65(++_0x5946cf);}(_0xe20d,0x11f));var _0xde20=function(_0x2b5584,_0x2c1bab){_0x2b5584=_0x2b5584-0x0;var _0x3f8885=_0xe20d[_0x2b5584];return _0x3f8885;};'use strict';var _=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xde20('0x2'));var BPromise=require(_0xde20('0x3'));var rp=require(_0xde20('0x4'));var fs=require('fs');var path=require(_0xde20('0x5'));var rimraf=require(_0xde20('0x6'));var config=require(_0xde20('0x7'));var attributes=require('./chatQueue.attributes');module[_0xde20('0x8')]=function(_0x2681f8,_0x1568e1){return _0x2681f8[_0xde20('0x9')](_0xde20('0xa'),attributes,{'tableName':_0xde20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index e29176f..8ae5e86 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 _0x3c8b=['socket.io-emitter','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x5a408b,_0x242bea){_0x5a408b=_0x5a408b-0x0;var _0x2d9caf=_0x3c8b[_0x5a408b];return _0x2d9caf;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var moment=require('moment');var BPromise=require(_0xb3c8('0x1'));var rs=require(_0xb3c8('0x2'));var fs=require('fs');var Redis=require(_0xb3c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x4'));var logger=require(_0xb3c8('0x5'))(_0xb3c8('0x6'));var config=require(_0xb3c8('0x7'));var jayson=require(_0xb3c8('0x8'));var client=jayson[_0xb3c8('0x9')][_0xb3c8('0xa')]({'port':0x232a});config[_0xb3c8('0xb')]=_['defaults'](config[_0xb3c8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3c8('0xc'))(new Redis(config[_0xb3c8('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4790d0,_0x3cea69,_0x363230){return new BPromise(function(_0xdf4041,_0x508b1f){return client[_0xb3c8('0xd')](_0x4790d0,_0x363230)[_0xb3c8('0xe')](function(_0x21eac8){logger[_0xb3c8('0xf')]('ChatQueue,\x20%s,\x20%s',_0x3cea69,_0xb3c8('0x10'));logger['debug'](_0xb3c8('0x11'),_0x3cea69,'request\x20sent',JSON[_0xb3c8('0x12')](_0x21eac8));if(_0x21eac8[_0xb3c8('0x13')]){if(_0x21eac8[_0xb3c8('0x13')]['code']===0x1f4){logger['error'](_0xb3c8('0x14'),_0x3cea69,_0x21eac8[_0xb3c8('0x13')][_0xb3c8('0x15')]);return _0x508b1f(_0x21eac8['error']['message']);}logger[_0xb3c8('0x13')](_0xb3c8('0x14'),_0x3cea69,_0x21eac8[_0xb3c8('0x13')]['message']);return _0xdf4041(_0x21eac8[_0xb3c8('0x13')][_0xb3c8('0x15')]);}else{logger[_0xb3c8('0xf')](_0xb3c8('0x14'),_0x3cea69,_0xb3c8('0x10'));_0xdf4041(_0x21eac8[_0xb3c8('0x16')][_0xb3c8('0x15')]);}})[_0xb3c8('0x17')](function(_0x168555){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3cea69,_0x168555);_0x508b1f(_0x168555);});});}exports[_0xb3c8('0x18')]=function(_0x5390cc){var _0x4d4bda=this;return new Promise(function(_0x433549,_0x4df53e){return db[_0xb3c8('0x19')]['findAll']({'raw':_0x5390cc['options']?_0x5390cc[_0xb3c8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1b')]||null:null,'attributes':_0x5390cc['options']?_0x5390cc[_0xb3c8('0x1a')]['attributes']||null:null,'limit':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1c')]||null:null,'include':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1d')],function(_0x557be7){return{'model':db[_0x557be7[_0xb3c8('0x1f')]],'as':_0x557be7['as'],'attributes':_0x557be7['attributes'],'include':_0x557be7[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x557be7[_0xb3c8('0x1d')],function(_0x1d0b73){return{'model':db[_0x1d0b73['model']],'as':_0x1d0b73['as'],'attributes':_0x1d0b73[_0xb3c8('0x20')],'include':_0x1d0b73[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x1d0b73[_0xb3c8('0x1d')],function(_0x275312){return{'model':db[_0x275312[_0xb3c8('0x1f')]],'as':_0x275312['as'],'attributes':_0x275312[_0xb3c8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35bd6d){logger[_0xb3c8('0xf')]('GetChatQueue',_0x5390cc);logger[_0xb3c8('0x21')](_0xb3c8('0x18'),_0x5390cc,JSON[_0xb3c8('0x12')](_0x35bd6d));_0x433549(_0x35bd6d);})[_0xb3c8('0x17')](function(_0x27e928){logger[_0xb3c8('0x13')](_0xb3c8('0x18'),_0x27e928['message'],_0x5390cc);_0x4df53e(_0x4d4bda[_0xb3c8('0x13')](0x1f4,_0x27e928[_0xb3c8('0x15')]));});});};exports[_0xb3c8('0x22')]=function(_0x320e3f){var _0x4511cf=this;return new Promise(function(_0x557745,_0x2369e5){return db[_0xb3c8('0x19')][_0xb3c8('0x23')]({'raw':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x24')]===undefined?!![]:![]:!![],'where':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1b')]||null:null,'attributes':_0x320e3f['options']?_0x320e3f[_0xb3c8('0x1a')]['attributes']||null:null,'include':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1d')],function(_0x550ab8){return{'model':db[_0x550ab8[_0xb3c8('0x1f')]],'as':_0x550ab8['as'],'attributes':_0x550ab8['attributes'],'include':_0x550ab8[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x550ab8[_0xb3c8('0x1d')],function(_0xc6554d){return{'model':db[_0xc6554d['model']],'as':_0xc6554d['as'],'attributes':_0xc6554d[_0xb3c8('0x20')],'include':_0xc6554d[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0xc6554d[_0xb3c8('0x1d')],function(_0x3ee715){return{'model':db[_0x3ee715[_0xb3c8('0x1f')]],'as':_0x3ee715['as'],'attributes':_0x3ee715['attributes']};}):[]};}):[]};}):[]:[]})[_0xb3c8('0xe')](function(_0x287521){logger[_0xb3c8('0xf')](_0xb3c8('0x22'),_0x320e3f);logger[_0xb3c8('0x21')]('ShowChatQueue',_0x320e3f,JSON['stringify'](_0x287521));_0x557745(_0x287521);})[_0xb3c8('0x17')](function(_0x1ecefb){logger[_0xb3c8('0x13')]('ShowChatQueue',_0x1ecefb[_0xb3c8('0x15')],_0x320e3f);_0x2369e5(_0x4511cf['error'](0x1f4,_0x1ecefb[_0xb3c8('0x15')]));});});};
\ No newline at end of file
+var _0xe1aa=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','ShowChatQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./chatQueue.socket','request'];(function(_0x4c4634,_0x43d778){var _0x1a44a9=function(_0x428abb){while(--_0x428abb){_0x4c4634['push'](_0x4c4634['shift']());}};_0x1a44a9(++_0x43d778);}(_0xe1aa,0xfc));var _0xae1a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe1aa[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xae1a('0x2'));var fs=require('fs');var Redis=require(_0xae1a('0x3'));var db=require(_0xae1a('0x4'))['db'];var utils=require(_0xae1a('0x5'));var logger=require(_0xae1a('0x6'))('rpc');var config=require(_0xae1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae1a('0x8')][_0xae1a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xae1a('0xa')],{'host':_0xae1a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae1a('0xa')]));require(_0xae1a('0xc'))['register'](socket);function respondWithRpcPromise(_0x22bb87,_0x31abc0,_0x39efce){return new BPromise(function(_0xcd51ac,_0x4a648b){return client[_0xae1a('0xd')](_0x22bb87,_0x39efce)[_0xae1a('0xe')](function(_0x54722b){logger[_0xae1a('0xf')](_0xae1a('0x10'),_0x31abc0,_0xae1a('0x11'));logger[_0xae1a('0x12')](_0xae1a('0x13'),_0x31abc0,_0xae1a('0x11'),JSON[_0xae1a('0x14')](_0x54722b));if(_0x54722b[_0xae1a('0x15')]){if(_0x54722b[_0xae1a('0x15')][_0xae1a('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x31abc0,_0x54722b['error']['message']);return _0x4a648b(_0x54722b[_0xae1a('0x15')][_0xae1a('0x17')]);}logger[_0xae1a('0x15')](_0xae1a('0x10'),_0x31abc0,_0x54722b[_0xae1a('0x15')]['message']);return _0xcd51ac(_0x54722b[_0xae1a('0x15')][_0xae1a('0x17')]);}else{logger['info'](_0xae1a('0x10'),_0x31abc0,_0xae1a('0x11'));_0xcd51ac(_0x54722b[_0xae1a('0x18')][_0xae1a('0x17')]);}})[_0xae1a('0x19')](function(_0x28ad91){logger[_0xae1a('0x15')](_0xae1a('0x10'),_0x31abc0,_0x28ad91);_0x4a648b(_0x28ad91);});});}exports[_0xae1a('0x1a')]=function(_0xd7bb55){var _0x49a8af=this;return new Promise(function(_0x2493d5,_0x112604){return db[_0xae1a('0x1b')][_0xae1a('0x1c')]({'raw':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55['options'][_0xae1a('0x1e')]===undefined?!![]:![]:!![],'where':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')]['where']||null:null,'attributes':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x1f')]||null:null,'limit':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x20')]||null:null,'include':_0xd7bb55['options']?_0xd7bb55[_0xae1a('0x1d')]['include']?_['map'](_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x21')],function(_0x3907c6){return{'model':db[_0x3907c6[_0xae1a('0x22')]],'as':_0x3907c6['as'],'attributes':_0x3907c6[_0xae1a('0x1f')],'include':_0x3907c6['include']?_[_0xae1a('0x23')](_0x3907c6[_0xae1a('0x21')],function(_0x29ed55){return{'model':db[_0x29ed55['model']],'as':_0x29ed55['as'],'attributes':_0x29ed55['attributes'],'include':_0x29ed55['include']?_[_0xae1a('0x23')](_0x29ed55[_0xae1a('0x21')],function(_0x536ddd){return{'model':db[_0x536ddd['model']],'as':_0x536ddd['as'],'attributes':_0x536ddd[_0xae1a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xae1a('0xe')](function(_0x127d6d){logger[_0xae1a('0xf')](_0xae1a('0x1a'),_0xd7bb55);logger[_0xae1a('0x12')](_0xae1a('0x1a'),_0xd7bb55,JSON['stringify'](_0x127d6d));_0x2493d5(_0x127d6d);})['catch'](function(_0x1d0626){logger[_0xae1a('0x15')](_0xae1a('0x1a'),_0x1d0626['message'],_0xd7bb55);_0x112604(_0x49a8af[_0xae1a('0x15')](0x1f4,_0x1d0626[_0xae1a('0x17')]));});});};exports[_0xae1a('0x24')]=function(_0x59ad9e){var _0x2dcf41=this;return new Promise(function(_0x10d50b,_0x5b75a0){return db[_0xae1a('0x1b')][_0xae1a('0x25')]({'raw':_0x59ad9e[_0xae1a('0x1d')]?_0x59ad9e[_0xae1a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x59ad9e['options']?_0x59ad9e['options']['where']||null:null,'attributes':_0x59ad9e[_0xae1a('0x1d')]?_0x59ad9e['options'][_0xae1a('0x1f')]||null:null,'include':_0x59ad9e['options']?_0x59ad9e['options'][_0xae1a('0x21')]?_[_0xae1a('0x23')](_0x59ad9e[_0xae1a('0x1d')]['include'],function(_0x412791){return{'model':db[_0x412791[_0xae1a('0x22')]],'as':_0x412791['as'],'attributes':_0x412791[_0xae1a('0x1f')],'include':_0x412791[_0xae1a('0x21')]?_['map'](_0x412791['include'],function(_0x564dc0){return{'model':db[_0x564dc0[_0xae1a('0x22')]],'as':_0x564dc0['as'],'attributes':_0x564dc0[_0xae1a('0x1f')],'include':_0x564dc0['include']?_[_0xae1a('0x23')](_0x564dc0[_0xae1a('0x21')],function(_0x283148){return{'model':db[_0x283148[_0xae1a('0x22')]],'as':_0x283148['as'],'attributes':_0x283148['attributes']};}):[]};}):[]};}):[]:[]})[_0xae1a('0xe')](function(_0x5068ca){logger[_0xae1a('0xf')](_0xae1a('0x24'),_0x59ad9e);logger[_0xae1a('0x12')](_0xae1a('0x24'),_0x59ad9e,JSON[_0xae1a('0x14')](_0x5068ca));_0x10d50b(_0x5068ca);})[_0xae1a('0x19')](function(_0x331dc8){logger['error'](_0xae1a('0x24'),_0x331dc8[_0xae1a('0x17')],_0x59ad9e);_0x5b75a0(_0x2dcf41[_0xae1a('0x15')](0x1f4,_0x331dc8[_0xae1a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8c2c9bd..d9b71d6 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 _0x9f62=['save','update','removeListener','register','length'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9f62,0x154));var _0x29f6=function(_0x2c49cf,_0x55329f){_0x2c49cf=_0x2c49cf-0x0;var _0x1928f4=_0x9f62[_0x2c49cf];return _0x1928f4;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x29f6('0x0'),'remove',_0x29f6('0x1')];function createListener(_0x254ab3,_0x548050){return function(_0x5618b7){_0x548050['emit'](_0x254ab3,_0x5618b7);};}function removeListener(_0x258ddd,_0x2f0420){return function(){ChatQueueEvents[_0x29f6('0x2')](_0x258ddd,_0x2f0420);};}exports[_0x29f6('0x3')]=function(_0x595034){for(var _0xf66137=0x0,_0x272876=events[_0x29f6('0x4')];_0xf66137<_0x272876;_0xf66137++){var _0x2ba602=events[_0xf66137];var _0x416c6c=createListener('chatQueue:'+_0x2ba602,_0x595034);ChatQueueEvents['on'](_0x2ba602,_0x416c6c);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x5a90af,_0x49cf78){var _0x309ac3=function(_0x223880){while(--_0x223880){_0x5a90af['push'](_0x5a90af['shift']());}};_0x309ac3(++_0x49cf78);}(_0xe107,0xb3));var _0x7e10=function(_0x150eff,_0x5b7ce3){_0x150eff=_0x150eff-0x0;var _0x4f7e93=_0xe107[_0x150eff];return _0x4f7e93;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e589084..f738476 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 _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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x3c4515,_0x52f867){_0x3c4515=_0x3c4515-0x0;var _0x3ef194=_0x3e74[_0x3c4515];return _0x3ef194;};'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
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x319a45,_0x4eee0d){var _0x3d6229=function(_0x10c715){while(--_0x10c715){_0x319a45['push'](_0x319a45['shift']());}};_0x3d6229(++_0x4eee0d);}(_0x814b,0x1a2));var _0xb814=function(_0xbf09ab,_0x251a19){_0xbf09ab=_0xbf09ab-0x0;var _0x2a9aef=_0x814b[_0xbf09ab];return _0x2a9aef;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e91c4a5..d56be93 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 _0x71f8=['moment','sequelize','exports','STRING','DATE'];(function(_0xe8e040,_0x278f92){var _0x6be7b8=function(_0x3dabd0){while(--_0x3dabd0){_0xe8e040['push'](_0xe8e040['shift']());}};_0x6be7b8(++_0x278f92);}(_0x71f8,0x1ae));var _0x871f=function(_0x4ea2f7,_0x11c547){_0x4ea2f7=_0x4ea2f7-0x0;var _0x532c3c=_0x71f8[_0x4ea2f7];return _0x532c3c;};'use strict';var moment=require(_0x871f('0x0'));var Sequelize=require(_0x871f('0x1'));module[_0x871f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x871f('0x3')]},'joinAt':{'type':Sequelize[_0x871f('0x4')]},'leaveAt':{'type':Sequelize[_0x871f('0x4')]},'acceptAt':{'type':Sequelize[_0x871f('0x4')]},'exitAt':{'type':Sequelize[_0x871f('0x4')]},'reason':{'type':Sequelize[_0x871f('0x3')]}};
\ No newline at end of file
+var _0x2f8f=['DATE','moment','sequelize','exports','STRING'];(function(_0x5685c3,_0x275a26){var _0x3ffb25=function(_0x57ea05){while(--_0x57ea05){_0x5685c3['push'](_0x5685c3['shift']());}};_0x3ffb25(++_0x275a26);}(_0x2f8f,0x13c));var _0xf2f8=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x2f8f[_0x26d6d9];return _0x1b4875;};'use strict';var moment=require(_0xf2f8('0x0'));var Sequelize=require(_0xf2f8('0x1'));module[_0xf2f8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf2f8('0x3')]},'joinAt':{'type':Sequelize[_0xf2f8('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf2f8('0x4')]},'exitAt':{'type':Sequelize[_0xf2f8('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ae037ca..d889444 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 _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x9120,0x1b3));var _0x0912=function(_0x23d2c0,_0x271f90){_0x23d2c0=_0x23d2c0-0x0;var _0x34b324=_0x9120[_0x23d2c0];return _0x34b324;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));};
\ No newline at end of file
+var _0xcddb=['nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','update','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','save','then','destroy','end','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x57cc40,_0x3bacf8){_0x57cc40=_0x57cc40-0x0;var _0x43c6fa=_0xcddb[_0x57cc40];return _0x43c6fa;};'use strict';var emlformat=require(_0xbcdd('0x0'));var rimraf=require(_0xbcdd('0x1'));var zipdir=require(_0xbcdd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbcdd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbcdd('0x4'));var util=require(_0xbcdd('0x5'));var path=require(_0xbcdd('0x6'));var sox=require(_0xbcdd('0x7'));var csv=require('to-csv');var ejs=require(_0xbcdd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcdd('0x9'));var squel=require(_0xbcdd('0xa'));var crypto=require('crypto');var jsforce=require(_0xbcdd('0xb'));var deskjs=require(_0xbcdd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbcdd('0xd'));var Redis=require(_0xbcdd('0xe'));var authService=require(_0xbcdd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbcdd('0x10'));var hardwareService=require(_0xbcdd('0x11'));var logger=require(_0xbcdd('0x12'))(_0xbcdd('0x13'));var utils=require('../../config/utils');var config=require(_0xbcdd('0x14'));var licenseUtil=require(_0xbcdd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33cb85,_0x948ca6){_0x948ca6=_0x948ca6||0xcc;return function(_0x5a84c4){if(_0x5a84c4){return _0x33cb85[_0xbcdd('0x16')](_0x948ca6);}return _0x33cb85[_0xbcdd('0x17')](_0x948ca6)['end']();};}function respondWithResult(_0x59da7a,_0x3be98b){_0x3be98b=_0x3be98b||0xc8;return function(_0x34e4cb){if(_0x34e4cb){return _0x59da7a[_0xbcdd('0x17')](_0x3be98b)[_0xbcdd('0x18')](_0x34e4cb);}};}function respondWithFilteredResult(_0x377448,_0x5b66cb){return function(_0x87eb1e){if(_0x87eb1e){var _0x408055=typeof _0x5b66cb['offset']===_0xbcdd('0x19')&&typeof _0x5b66cb['limit']===_0xbcdd('0x19');var _0x2e7eeb=_0x87eb1e[_0xbcdd('0x1a')];var _0x47ae02=_0x408055?0x0:_0x5b66cb[_0xbcdd('0x1b')];var _0x39d865=_0x408055?_0x87eb1e[_0xbcdd('0x1a')]:_0x5b66cb[_0xbcdd('0x1b')]+_0x5b66cb[_0xbcdd('0x1c')];var _0x5ad171;if(_0x39d865>=_0x2e7eeb){_0x39d865=_0x2e7eeb;_0x5ad171=0xc8;}else{_0x5ad171=0xce;}_0x377448[_0xbcdd('0x17')](_0x5ad171);return _0x377448[_0xbcdd('0x1d')](_0xbcdd('0x1e'),_0x47ae02+'-'+_0x39d865+'/'+_0x2e7eeb)[_0xbcdd('0x18')](_0x87eb1e);}return null;};}function patchUpdates(_0x45ae83){return function(_0x1b8c70){try{jsonpatch['apply'](_0x1b8c70,_0x45ae83,!![]);}catch(_0x224a84){return BPromise['reject'](_0x224a84);}return _0x1b8c70[_0xbcdd('0x1f')]();};}function saveUpdates(_0x1d9e2d,_0x26798d){return function(_0x23bbd5){if(_0x23bbd5){return _0x23bbd5['update'](_0x1d9e2d)[_0xbcdd('0x20')](function(_0x2cd0dd){return _0x2cd0dd;});}return null;};}function removeEntity(_0x1e4db6,_0x19e183){return function(_0x527e71){if(_0x527e71){return _0x527e71[_0xbcdd('0x21')]()[_0xbcdd('0x20')](function(){_0x1e4db6[_0xbcdd('0x17')](0xcc)[_0xbcdd('0x22')]();});}};}function handleEntityNotFound(_0x3cfd0f,_0x5441a9){return function(_0x1f334d){if(!_0x1f334d){_0x3cfd0f[_0xbcdd('0x16')](0x194);}return _0x1f334d;};}function handleError(_0x14a34b,_0x3f57a5){_0x3f57a5=_0x3f57a5||0x1f4;return function(_0x37f2a9){logger['error'](_0x37f2a9[_0xbcdd('0x23')]);if(_0x37f2a9[_0xbcdd('0x24')]){delete _0x37f2a9['name'];}_0x14a34b[_0xbcdd('0x17')](_0x3f57a5)[_0xbcdd('0x25')](_0x37f2a9);};}exports[_0xbcdd('0x26')]=function(_0x18b13b,_0x3f6487){var _0x553e98={},_0x163a3e={},_0x485696={'count':0x0,'rows':[]};var _0x5d6234=_[_0xbcdd('0x27')](db[_0xbcdd('0x28')]['rawAttributes'],function(_0x2dc944){return{'name':_0x2dc944[_0xbcdd('0x29')],'type':_0x2dc944[_0xbcdd('0x2a')][_0xbcdd('0x2b')]};});_0x163a3e[_0xbcdd('0x2c')]=_[_0xbcdd('0x27')](_0x5d6234,_0xbcdd('0x24'));_0x163a3e[_0xbcdd('0x2d')]=_[_0xbcdd('0x2e')](_0x18b13b['query']);_0x163a3e[_0xbcdd('0x2f')]=_[_0xbcdd('0x30')](_0x163a3e['model'],_0x163a3e['query']);_0x553e98[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x163a3e['model'],qs[_0xbcdd('0x32')](_0x18b13b['query'][_0xbcdd('0x32')]));_0x553e98['attributes']=_0x553e98[_0xbcdd('0x31')]['length']?_0x553e98[_0xbcdd('0x31')]:_0x163a3e[_0xbcdd('0x2c')];if(!_0x18b13b['query'][_0xbcdd('0x33')](_0xbcdd('0x34'))){_0x553e98[_0xbcdd('0x1c')]=qs[_0xbcdd('0x1c')](_0x18b13b[_0xbcdd('0x2d')]['limit']);_0x553e98[_0xbcdd('0x1b')]=qs['offset'](_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x1b')]);}_0x553e98['order']=qs['sort'](_0x18b13b[_0xbcdd('0x2d')]['sort']);_0x553e98[_0xbcdd('0x35')]=qs[_0xbcdd('0x2f')](_[_0xbcdd('0x36')](_0x18b13b['query'],_0x163a3e[_0xbcdd('0x2f')]),_0x5d6234);if(_0x18b13b[_0xbcdd('0x2d')][_0xbcdd('0x37')]){_0x553e98[_0xbcdd('0x35')]=_[_0xbcdd('0x38')](_0x553e98[_0xbcdd('0x35')],{'$or':_[_0xbcdd('0x27')](_0x5d6234,function(_0xd646d1){if(_0xd646d1[_0xbcdd('0x2a')]!==_0xbcdd('0x39')){var _0x40d4fd={};_0x40d4fd[_0xd646d1[_0xbcdd('0x24')]]={'$like':'%'+_0x18b13b['query'][_0xbcdd('0x37')]+'%'};return _0x40d4fd;}})});}_0x553e98=_[_0xbcdd('0x38')]({},_0x553e98,_0x18b13b[_0xbcdd('0x3a')]);var _0x2a9568={'where':_0x553e98[_0xbcdd('0x35')]};return db[_0xbcdd('0x28')]['count'](_0x2a9568)[_0xbcdd('0x20')](function(_0x57ab36){_0x485696[_0xbcdd('0x1a')]=_0x57ab36;if(_0x18b13b['query'][_0xbcdd('0x3b')]){_0x553e98[_0xbcdd('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbcdd('0x3d')](_0x553e98);})[_0xbcdd('0x20')](function(_0x41721d){_0x485696[_0xbcdd('0x3e')]=_0x41721d;return _0x485696;})['then'](respondWithFilteredResult(_0x3f6487,_0x553e98))['catch'](handleError(_0x3f6487,null));};exports[_0xbcdd('0x3f')]=function(_0xd41482,_0x41fc62){var _0x4b184b={'raw':!![],'where':{'id':_0xd41482[_0xbcdd('0x40')]['id']}},_0x3e65ce={};_0x3e65ce['model']=_[_0xbcdd('0x2e')](db[_0xbcdd('0x28')][_0xbcdd('0x41')]);_0x3e65ce['query']=_[_0xbcdd('0x2e')](_0xd41482[_0xbcdd('0x2d')]);_0x3e65ce[_0xbcdd('0x2f')]=_['intersection'](_0x3e65ce[_0xbcdd('0x2c')],_0x3e65ce[_0xbcdd('0x2d')]);_0x4b184b[_0xbcdd('0x31')]=_[_0xbcdd('0x30')](_0x3e65ce[_0xbcdd('0x2c')],qs[_0xbcdd('0x32')](_0xd41482[_0xbcdd('0x2d')][_0xbcdd('0x32')]));_0x4b184b[_0xbcdd('0x31')]=_0x4b184b[_0xbcdd('0x31')][_0xbcdd('0x42')]?_0x4b184b[_0xbcdd('0x31')]:_0x3e65ce['model'];if(_0xd41482[_0xbcdd('0x2d')]['includeAll']){_0x4b184b[_0xbcdd('0x3c')]=[{'all':!![]}];}_0x4b184b=_[_0xbcdd('0x38')]({},_0x4b184b,_0xd41482['options']);return db[_0xbcdd('0x28')][_0xbcdd('0x43')](_0x4b184b)[_0xbcdd('0x20')](handleEntityNotFound(_0x41fc62,null))[_0xbcdd('0x20')](respondWithResult(_0x41fc62,null))[_0xbcdd('0x44')](handleError(_0x41fc62,null));};exports['create']=function(_0xb1f54d,_0x6f4939){return db['ChatQueueReport']['create'](_0xb1f54d[_0xbcdd('0x45')],{})[_0xbcdd('0x20')](respondWithResult(_0x6f4939,0xc9))[_0xbcdd('0x44')](handleError(_0x6f4939,null));};exports[_0xbcdd('0x46')]=function(_0x26535a,_0x6708f5){if(_0x26535a[_0xbcdd('0x45')]['id']){delete _0x26535a['body']['id'];}return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x26535a['params']['id']}})[_0xbcdd('0x20')](handleEntityNotFound(_0x6708f5,null))['then'](saveUpdates(_0x26535a[_0xbcdd('0x45')],null))[_0xbcdd('0x20')](respondWithResult(_0x6708f5,null))[_0xbcdd('0x44')](handleError(_0x6708f5,null));};exports[_0xbcdd('0x21')]=function(_0x282450,_0x304966){return db[_0xbcdd('0x28')][_0xbcdd('0x43')]({'where':{'id':_0x282450['params']['id']}})['then'](handleEntityNotFound(_0x304966,null))[_0xbcdd('0x20')](removeEntity(_0x304966,null))[_0xbcdd('0x44')](handleError(_0x304966,null));};exports['describe']=function(_0x2242bd,_0x312832){return db[_0xbcdd('0x28')][_0xbcdd('0x47')]()[_0xbcdd('0x20')](respondWithResult(_0x312832,null))['catch'](handleError(_0x312832,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 10657e3..918808c 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x229742,_0x5c682d){var _0x536bbf=function(_0x142918){while(--_0x142918){_0x229742['push'](_0x229742['shift']());}};_0x536bbf(++_0x5c682d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2e53e1,_0x12aed1){var _0x3a23de=function(_0xd84699){while(--_0xd84699){_0x2e53e1['push'](_0x2e53e1['shift']());}};_0x3a23de(++_0x12aed1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 9a7233b..4fd0af2 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 _0x3fc4=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x518ee7,_0x18f4a4){var _0x59b1d7=function(_0x238778){while(--_0x238778){_0x518ee7['push'](_0x518ee7['shift']());}};_0x59b1d7(++_0x18f4a4);}(_0x3fc4,0x179));var _0x43fc=function(_0x22ec7e,_0x24fde9){_0x22ec7e=_0x22ec7e-0x0;var _0x2bd9d2=_0x3fc4[_0x22ec7e];return _0x2bd9d2;};'use strict';var _=require('lodash');var util=require(_0x43fc('0x0'));var moment=require(_0x43fc('0x1'));var BPromise=require(_0x43fc('0x2'));var rs=require(_0x43fc('0x3'));var fs=require('fs');var Redis=require(_0x43fc('0x4'));var db=require(_0x43fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fc('0x6'))('rpc');var config=require(_0x43fc('0x7'));var jayson=require(_0x43fc('0x8'));var client=jayson[_0x43fc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a8d6c,_0x509e56,_0x2b17a5){return new BPromise(function(_0x38e8ba,_0x56116a){return client['request'](_0x2a8d6c,_0x2b17a5)[_0x43fc('0xa')](function(_0x2cc50c){logger['info'](_0x43fc('0xb'),_0x509e56,_0x43fc('0xc'));logger[_0x43fc('0xd')](_0x43fc('0xe'),_0x509e56,_0x43fc('0xc'),JSON[_0x43fc('0xf')](_0x2cc50c));if(_0x2cc50c[_0x43fc('0x10')]){if(_0x2cc50c[_0x43fc('0x10')]['code']===0x1f4){logger['error'](_0x43fc('0xb'),_0x509e56,_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);return _0x56116a(_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);}logger[_0x43fc('0x10')](_0x43fc('0xb'),_0x509e56,_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);return _0x38e8ba(_0x2cc50c[_0x43fc('0x10')]['message']);}else{logger[_0x43fc('0x12')](_0x43fc('0xb'),_0x509e56,_0x43fc('0xc'));_0x38e8ba(_0x2cc50c[_0x43fc('0x13')][_0x43fc('0x11')]);}})[_0x43fc('0x14')](function(_0x54f01b){logger[_0x43fc('0x10')](_0x43fc('0xb'),_0x509e56,_0x54f01b);_0x56116a(_0x54f01b);});});}exports[_0x43fc('0x15')]=function(_0x10fbcf){var _0x4763ea=this;return new Promise(function(_0x2a68e6,_0x45ac0a){return db[_0x43fc('0x16')]['create'](_0x10fbcf[_0x43fc('0x17')],{'raw':_0x10fbcf[_0x43fc('0x18')]?_0x10fbcf[_0x43fc('0x18')][_0x43fc('0x19')]===undefined?!![]:![]:!![]})[_0x43fc('0xa')](function(_0x5c133a){logger[_0x43fc('0x12')](_0x43fc('0x15'),_0x10fbcf);logger['debug'](_0x43fc('0x15'),_0x10fbcf,JSON[_0x43fc('0xf')](_0x5c133a));_0x2a68e6(_0x5c133a);})[_0x43fc('0x14')](function(_0x2bda3b){logger['error'](_0x43fc('0x15'),_0x2bda3b[_0x43fc('0x11')],_0x10fbcf);_0x45ac0a(_0x4763ea[_0x43fc('0x10')](0x1f4,_0x2bda3b[_0x43fc('0x11')]));});});};exports[_0x43fc('0x1a')]=function(_0x3cbc4e){var _0x113069=this;return new Promise(function(_0x5c7cc2,_0x25f9a9){return db[_0x43fc('0x16')][_0x43fc('0x1b')](_0x3cbc4e['body'],{'raw':_0x3cbc4e['options']?_0x3cbc4e['options'][_0x43fc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cbc4e[_0x43fc('0x18')]?_0x3cbc4e[_0x43fc('0x18')]['where']||null:null,'attributes':_0x3cbc4e[_0x43fc('0x18')]?_0x3cbc4e[_0x43fc('0x18')][_0x43fc('0x1c')]||null:null,'limit':_0x3cbc4e['options']?_0x3cbc4e[_0x43fc('0x18')][_0x43fc('0x1d')]||null:null})['then'](function(_0x1836e1){logger[_0x43fc('0x12')]('UpdateChatQueueReport',_0x3cbc4e);logger[_0x43fc('0xd')]('UpdateChatQueueReport',_0x3cbc4e,JSON[_0x43fc('0xf')](_0x1836e1));_0x5c7cc2(_0x1836e1);})[_0x43fc('0x14')](function(_0x3ff3d2){logger[_0x43fc('0x10')](_0x43fc('0x1a'),_0x3ff3d2['message'],_0x3cbc4e);_0x25f9a9(_0x113069[_0x43fc('0x10')](0x1f4,_0x3ff3d2[_0x43fc('0x11')]));});});};
\ No newline at end of file
+var _0x25c9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x490e0a,_0x1eca50){var _0x212ff2=function(_0x281eb2){while(--_0x281eb2){_0x490e0a['push'](_0x490e0a['shift']());}};_0x212ff2(++_0x1eca50);}(_0x25c9,0x1d9));var _0x925c=function(_0x307592,_0x4249d3){_0x307592=_0x307592-0x0;var _0x189387=_0x25c9[_0x307592];return _0x189387;};'use strict';var _=require(_0x925c('0x0'));var util=require(_0x925c('0x1'));var moment=require(_0x925c('0x2'));var BPromise=require(_0x925c('0x3'));var rs=require(_0x925c('0x4'));var fs=require('fs');var Redis=require(_0x925c('0x5'));var db=require(_0x925c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x925c('0x7'))('rpc');var config=require(_0x925c('0x8'));var jayson=require(_0x925c('0x9'));var client=jayson['client'][_0x925c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4af9af,_0x9d7ac3,_0x8d7d33){return new BPromise(function(_0x8da534,_0x1034b8){return client[_0x925c('0xb')](_0x4af9af,_0x8d7d33)['then'](function(_0x2f76ca){logger[_0x925c('0xc')](_0x925c('0xd'),_0x9d7ac3,'request\x20sent');logger[_0x925c('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x9d7ac3,_0x925c('0xf'),JSON[_0x925c('0x10')](_0x2f76ca));if(_0x2f76ca[_0x925c('0x11')]){if(_0x2f76ca[_0x925c('0x11')][_0x925c('0x12')]===0x1f4){logger['error'](_0x925c('0xd'),_0x9d7ac3,_0x2f76ca[_0x925c('0x11')][_0x925c('0x13')]);return _0x1034b8(_0x2f76ca['error'][_0x925c('0x13')]);}logger[_0x925c('0x11')](_0x925c('0xd'),_0x9d7ac3,_0x2f76ca[_0x925c('0x11')]['message']);return _0x8da534(_0x2f76ca['error'][_0x925c('0x13')]);}else{logger[_0x925c('0xc')](_0x925c('0xd'),_0x9d7ac3,_0x925c('0xf'));_0x8da534(_0x2f76ca[_0x925c('0x14')][_0x925c('0x13')]);}})[_0x925c('0x15')](function(_0x531853){logger['error'](_0x925c('0xd'),_0x9d7ac3,_0x531853);_0x1034b8(_0x531853);});});}exports[_0x925c('0x16')]=function(_0x5f50e9){var _0x1de978=this;return new Promise(function(_0xeacc0d,_0x298bb9){return db['ChatQueueReport'][_0x925c('0x17')](_0x5f50e9[_0x925c('0x18')],{'raw':_0x5f50e9[_0x925c('0x19')]?_0x5f50e9[_0x925c('0x19')][_0x925c('0x1a')]===undefined?!![]:![]:!![]})[_0x925c('0x1b')](function(_0x53fb3d){logger['info'](_0x925c('0x16'),_0x5f50e9);logger[_0x925c('0xe')](_0x925c('0x16'),_0x5f50e9,JSON['stringify'](_0x53fb3d));_0xeacc0d(_0x53fb3d);})[_0x925c('0x15')](function(_0x51468e){logger[_0x925c('0x11')](_0x925c('0x16'),_0x51468e[_0x925c('0x13')],_0x5f50e9);_0x298bb9(_0x1de978[_0x925c('0x11')](0x1f4,_0x51468e['message']));});});};exports[_0x925c('0x1c')]=function(_0x1adfff){var _0x32c21f=this;return new Promise(function(_0x3f4faa,_0x4a5520){return db[_0x925c('0x1d')][_0x925c('0x1e')](_0x1adfff[_0x925c('0x18')],{'raw':_0x1adfff[_0x925c('0x19')]?_0x1adfff[_0x925c('0x19')][_0x925c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1adfff[_0x925c('0x19')]?_0x1adfff[_0x925c('0x19')][_0x925c('0x1f')]||null:null,'attributes':_0x1adfff[_0x925c('0x19')]?_0x1adfff['options'][_0x925c('0x20')]||null:null,'limit':_0x1adfff[_0x925c('0x19')]?_0x1adfff[_0x925c('0x19')][_0x925c('0x21')]||null:null})['then'](function(_0xd29b3f){logger[_0x925c('0xc')](_0x925c('0x1c'),_0x1adfff);logger[_0x925c('0xe')]('UpdateChatQueueReport',_0x1adfff,JSON[_0x925c('0x10')](_0xd29b3f));_0x3f4faa(_0xd29b3f);})['catch'](function(_0x47b2fd){logger[_0x925c('0x11')](_0x925c('0x1c'),_0x47b2fd[_0x925c('0x13')],_0x1adfff);_0x4a5520(_0x32c21f[_0x925c('0x11')](0x1f4,_0x47b2fd[_0x925c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e86ca0a..8d92d1f 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 _0x11de=['connect-timeout','express','Router','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path'];(function(_0xc3a71f,_0x54fe71){var _0x46a474=function(_0x47e601){while(--_0x47e601){_0xc3a71f['push'](_0xc3a71f['shift']());}};_0x46a474(++_0x54fe71);}(_0x11de,0x8a));var _0xe11d=function(_0x468431,_0x4a46d0){_0x468431=_0x468431-0x0;var _0x2a9dd4=_0x11de[_0x468431];return _0x2a9dd4;};'use strict';var multer=require(_0xe11d('0x0'));var util=require('util');var path=require(_0xe11d('0x1'));var timeout=require(_0xe11d('0x2'));var express=require(_0xe11d('0x3'));var router=express[_0xe11d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe11d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe11d('0x6'));router[_0xe11d('0x7')]('/',auth[_0xe11d('0x8')](),controller[_0xe11d('0x9')]);router[_0xe11d('0x7')](_0xe11d('0xa'),auth[_0xe11d('0x8')](),controller[_0xe11d('0xb')]);router['get'](_0xe11d('0xc'),auth[_0xe11d('0x8')](),controller[_0xe11d('0xd')]);router['post']('/',auth[_0xe11d('0x8')](),controller[_0xe11d('0xe')]);router[_0xe11d('0xf')]('/:id',auth[_0xe11d('0x8')](),controller[_0xe11d('0x10')]);router[_0xe11d('0x11')](_0xe11d('0xc'),auth[_0xe11d('0x8')](),controller[_0xe11d('0x12')]);module[_0xe11d('0x13')]=router;
\ No newline at end of file
+var _0x58f8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x58f8,0x72));var _0x858f=function(_0x181d91,_0x5442f2){_0x181d91=_0x181d91-0x0;var _0x94ee39=_0x58f8[_0x181d91];return _0x94ee39;};'use strict';var multer=require(_0x858f('0x0'));var util=require(_0x858f('0x1'));var path=require(_0x858f('0x2'));var timeout=require(_0x858f('0x3'));var express=require(_0x858f('0x4'));var router=express[_0x858f('0x5')]();var fs_extra=require(_0x858f('0x6'));var auth=require(_0x858f('0x7'));var interaction=require(_0x858f('0x8'));var config=require(_0x858f('0x9'));var controller=require(_0x858f('0xa'));router[_0x858f('0xb')]('/',auth[_0x858f('0xc')](),controller[_0x858f('0xd')]);router[_0x858f('0xb')](_0x858f('0xe'),auth['isAuthenticated'](),controller[_0x858f('0xf')]);router[_0x858f('0xb')]('/:id',auth[_0x858f('0xc')](),controller[_0x858f('0x10')]);router[_0x858f('0x11')]('/',auth[_0x858f('0xc')](),controller['create']);router[_0x858f('0x12')](_0x858f('0x13'),auth[_0x858f('0xc')](),controller[_0x858f('0x14')]);router[_0x858f('0x15')]('/:id',auth[_0x858f('0xc')](),controller[_0x858f('0x16')]);module[_0x858f('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b536586..3f7d1d2 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x25be3b,_0x55e82b){var _0x3dbf80=function(_0x4928a2){while(--_0x4928a2){_0x25be3b['push'](_0x25be3b['shift']());}};_0x3dbf80(++_0x55e82b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x56e43b,_0x2f347f){var _0x5ee377=function(_0x1c5ca9){while(--_0x1c5ca9){_0x56e43b['push'](_0x56e43b['shift']());}};_0x5ee377(++_0x2f347f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xcb91[_0x16539a];return _0x200796;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4dad233..ebcb129 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 _0x025b=['rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll'];(function(_0x1840c7,_0xb8b170){var _0x225acb=function(_0x425118){while(--_0x425118){_0x1840c7['push'](_0x1840c7['shift']());}};_0x225acb(++_0xb8b170);}(_0x025b,0x1c5));var _0xb025=function(_0x320e21,_0x1f9905){_0x320e21=_0x320e21-0x0;var _0x3d174a=_0x025b[_0x320e21];return _0x3d174a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb025('0x0'));var zipdir=require(_0xb025('0x1'));var jsonpatch=require(_0xb025('0x2'));var rp=require(_0xb025('0x3'));var moment=require(_0xb025('0x4'));var BPromise=require(_0xb025('0x5'));var Mustache=require(_0xb025('0x6'));var util=require(_0xb025('0x7'));var path=require(_0xb025('0x8'));var sox=require('sox');var csv=require(_0xb025('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb025('0xa'));var _=require(_0xb025('0xb'));var squel=require('squel');var crypto=require(_0xb025('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb025('0xd'));var toCsv=require(_0xb025('0x9'));var querystring=require(_0xb025('0xe'));var Papa=require('papaparse');var Redis=require(_0xb025('0xf'));var authService=require(_0xb025('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb025('0x11'));var hardwareService=require(_0xb025('0x12'));var logger=require(_0xb025('0x13'))(_0xb025('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb025('0x15'))['db'];function respondWithStatusCode(_0x69ccf5,_0x3ef3be){_0x3ef3be=_0x3ef3be||0xcc;return function(_0x23a764){if(_0x23a764){return _0x69ccf5[_0xb025('0x16')](_0x3ef3be);}return _0x69ccf5[_0xb025('0x17')](_0x3ef3be)[_0xb025('0x18')]();};}function respondWithResult(_0x74d0d,_0x36f978){_0x36f978=_0x36f978||0xc8;return function(_0x475f1f){if(_0x475f1f){return _0x74d0d[_0xb025('0x17')](_0x36f978)['json'](_0x475f1f);}};}function respondWithFilteredResult(_0x593f44,_0x8c1b51){return function(_0x90cf0b){if(_0x90cf0b){var _0x22a3eb=typeof _0x8c1b51[_0xb025('0x19')]===_0xb025('0x1a')&&typeof _0x8c1b51[_0xb025('0x1b')]===_0xb025('0x1a');var _0xa826e0=_0x90cf0b[_0xb025('0x1c')];var _0x3251a8=_0x22a3eb?0x0:_0x8c1b51[_0xb025('0x19')];var _0x1a4b94=_0x22a3eb?_0x90cf0b[_0xb025('0x1c')]:_0x8c1b51[_0xb025('0x19')]+_0x8c1b51[_0xb025('0x1b')];var _0x4dbc87;if(_0x1a4b94>=_0xa826e0){_0x1a4b94=_0xa826e0;_0x4dbc87=0xc8;}else{_0x4dbc87=0xce;}_0x593f44[_0xb025('0x17')](_0x4dbc87);return _0x593f44['set'](_0xb025('0x1d'),_0x3251a8+'-'+_0x1a4b94+'/'+_0xa826e0)['json'](_0x90cf0b);}return null;};}function patchUpdates(_0x407fa0){return function(_0x2f124d){try{jsonpatch[_0xb025('0x1e')](_0x2f124d,_0x407fa0,!![]);}catch(_0x5bfd89){return BPromise[_0xb025('0x1f')](_0x5bfd89);}return _0x2f124d[_0xb025('0x20')]();};}function saveUpdates(_0x1f3b18,_0x4743d){return function(_0x567358){if(_0x567358){return _0x567358[_0xb025('0x21')](_0x1f3b18)['then'](function(_0x335e49){return _0x335e49;});}return null;};}function removeEntity(_0x569e35,_0x14b21e){return function(_0x3076cd){if(_0x3076cd){return _0x3076cd['destroy']()[_0xb025('0x22')](function(){_0x569e35['status'](0xcc)[_0xb025('0x18')]();});}};}function handleEntityNotFound(_0x136233,_0x5b1547){return function(_0x20913f){if(!_0x20913f){_0x136233[_0xb025('0x16')](0x194);}return _0x20913f;};}function handleError(_0x59195d,_0x255ca7){_0x255ca7=_0x255ca7||0x1f4;return function(_0x423b5a){logger[_0xb025('0x23')](_0x423b5a[_0xb025('0x24')]);if(_0x423b5a[_0xb025('0x25')]){delete _0x423b5a[_0xb025('0x25')];}_0x59195d[_0xb025('0x17')](_0x255ca7)[_0xb025('0x26')](_0x423b5a);};}exports[_0xb025('0x27')]=function(_0x2201cb,_0x40e280){var _0x555aa3={},_0x4e2930={},_0x2593e1={'count':0x0,'rows':[]};var _0x8dc14a=_[_0xb025('0x28')](db[_0xb025('0x29')][_0xb025('0x2a')],function(_0x58677c){return{'name':_0x58677c[_0xb025('0x2b')],'type':_0x58677c['type'][_0xb025('0x2c')]};});_0x4e2930[_0xb025('0x2d')]=_[_0xb025('0x28')](_0x8dc14a,_0xb025('0x25'));_0x4e2930[_0xb025('0x2e')]=_[_0xb025('0x2f')](_0x2201cb[_0xb025('0x2e')]);_0x4e2930[_0xb025('0x30')]=_[_0xb025('0x31')](_0x4e2930['model'],_0x4e2930[_0xb025('0x2e')]);_0x555aa3[_0xb025('0x32')]=_[_0xb025('0x31')](_0x4e2930[_0xb025('0x2d')],qs[_0xb025('0x33')](_0x2201cb['query'][_0xb025('0x33')]));_0x555aa3['attributes']=_0x555aa3[_0xb025('0x32')][_0xb025('0x34')]?_0x555aa3['attributes']:_0x4e2930['model'];if(!_0x2201cb[_0xb025('0x2e')][_0xb025('0x35')](_0xb025('0x36'))){_0x555aa3[_0xb025('0x1b')]=qs['limit'](_0x2201cb[_0xb025('0x2e')]['limit']);_0x555aa3[_0xb025('0x19')]=qs[_0xb025('0x19')](_0x2201cb[_0xb025('0x2e')][_0xb025('0x19')]);}_0x555aa3['order']=qs[_0xb025('0x37')](_0x2201cb['query']['sort']);_0x555aa3[_0xb025('0x38')]=qs[_0xb025('0x30')](_[_0xb025('0x39')](_0x2201cb[_0xb025('0x2e')],_0x4e2930[_0xb025('0x30')]),_0x8dc14a);if(_0x2201cb[_0xb025('0x2e')][_0xb025('0x3a')]){_0x555aa3[_0xb025('0x38')]=_[_0xb025('0x3b')](_0x555aa3['where'],{'$or':_['map'](_0x8dc14a,function(_0x951edb){if(_0x951edb[_0xb025('0x3c')]!=='VIRTUAL'){var _0x32fc22={};_0x32fc22[_0x951edb[_0xb025('0x25')]]={'$like':'%'+_0x2201cb[_0xb025('0x2e')][_0xb025('0x3a')]+'%'};return _0x32fc22;}})});}_0x555aa3=_[_0xb025('0x3b')]({},_0x555aa3,_0x2201cb[_0xb025('0x3d')]);var _0xec3e46={'where':_0x555aa3['where']};return db[_0xb025('0x29')][_0xb025('0x1c')](_0xec3e46)['then'](function(_0x4a5d9a){_0x2593e1[_0xb025('0x1c')]=_0x4a5d9a;if(_0x2201cb[_0xb025('0x2e')][_0xb025('0x3e')]){_0x555aa3[_0xb025('0x3f')]=[{'all':!![]}];}return db[_0xb025('0x29')][_0xb025('0x40')](_0x555aa3);})['then'](function(_0x27f695){_0x2593e1[_0xb025('0x41')]=_0x27f695;return _0x2593e1;})['then'](respondWithFilteredResult(_0x40e280,_0x555aa3))[_0xb025('0x42')](handleError(_0x40e280,null));};exports[_0xb025('0x43')]=function(_0x2ae6e3,_0x2d02a0){var _0x3280db={'raw':!![],'where':{'id':_0x2ae6e3[_0xb025('0x44')]['id']}},_0x549884={};_0x549884[_0xb025('0x2d')]=_[_0xb025('0x2f')](db[_0xb025('0x29')][_0xb025('0x2a')]);_0x549884[_0xb025('0x2e')]=_['keys'](_0x2ae6e3[_0xb025('0x2e')]);_0x549884[_0xb025('0x30')]=_[_0xb025('0x31')](_0x549884['model'],_0x549884[_0xb025('0x2e')]);_0x3280db['attributes']=_['intersection'](_0x549884[_0xb025('0x2d')],qs['fields'](_0x2ae6e3[_0xb025('0x2e')][_0xb025('0x33')]));_0x3280db['attributes']=_0x3280db[_0xb025('0x32')][_0xb025('0x34')]?_0x3280db[_0xb025('0x32')]:_0x549884[_0xb025('0x2d')];if(_0x2ae6e3[_0xb025('0x2e')][_0xb025('0x3e')]){_0x3280db[_0xb025('0x3f')]=[{'all':!![]}];}_0x3280db=_[_0xb025('0x3b')]({},_0x3280db,_0x2ae6e3['options']);return db[_0xb025('0x29')][_0xb025('0x45')](_0x3280db)[_0xb025('0x22')](handleEntityNotFound(_0x2d02a0,null))[_0xb025('0x22')](respondWithResult(_0x2d02a0,null))[_0xb025('0x42')](handleError(_0x2d02a0,null));};exports[_0xb025('0x46')]=function(_0xddad1e,_0x2a17a3){return db[_0xb025('0x29')]['create'](_0xddad1e[_0xb025('0x47')],{})[_0xb025('0x22')](respondWithResult(_0x2a17a3,0xc9))['catch'](handleError(_0x2a17a3,null));};exports[_0xb025('0x21')]=function(_0x5c3846,_0x4fa1d4){if(_0x5c3846[_0xb025('0x47')]['id']){delete _0x5c3846['body']['id'];}return db[_0xb025('0x29')][_0xb025('0x45')]({'where':{'id':_0x5c3846[_0xb025('0x44')]['id']}})[_0xb025('0x22')](handleEntityNotFound(_0x4fa1d4,null))['then'](saveUpdates(_0x5c3846[_0xb025('0x47')],null))[_0xb025('0x22')](respondWithResult(_0x4fa1d4,null))[_0xb025('0x42')](handleError(_0x4fa1d4,null));};exports[_0xb025('0x48')]=function(_0x596e57,_0xd846aa){return db['ChatTransferReport'][_0xb025('0x45')]({'where':{'id':_0x596e57[_0xb025('0x44')]['id']}})[_0xb025('0x22')](handleEntityNotFound(_0xd846aa,null))[_0xb025('0x22')](removeEntity(_0xd846aa,null))[_0xb025('0x42')](handleError(_0xd846aa,null));};exports[_0xb025('0x49')]=function(_0x3267b8,_0x37c7a7){return db[_0xb025('0x29')][_0xb025('0x49')]()[_0xb025('0x22')](respondWithResult(_0x37c7a7,null))[_0xb025('0x42')](handleError(_0x37c7a7,null));};
\ No newline at end of file
+var _0x60e0=['VIRTUAL','filter','options','ChatTransferReport','then','includeAll','include','catch','show','params','create','body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','status','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','pick','where','merge'];(function(_0x5d0521,_0x4eab58){var _0x4a78b8=function(_0x392828){while(--_0x392828){_0x5d0521['push'](_0x5d0521['shift']());}};_0x4a78b8(++_0x4eab58);}(_0x60e0,0x176));var _0x060e=function(_0x5bba54,_0x2771b5){_0x5bba54=_0x5bba54-0x0;var _0x59e1ce=_0x60e0[_0x5bba54];return _0x59e1ce;};'use strict';var emlformat=require(_0x060e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x060e('0x1'));var rp=require('request-promise');var moment=require(_0x060e('0x2'));var BPromise=require(_0x060e('0x3'));var Mustache=require(_0x060e('0x4'));var util=require(_0x060e('0x5'));var path=require(_0x060e('0x6'));var sox=require('sox');var csv=require(_0x060e('0x7'));var ejs=require(_0x060e('0x8'));var fs=require('fs');var fs_extra=require(_0x060e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x060e('0xa'));var jsforce=require(_0x060e('0xb'));var deskjs=require(_0x060e('0xc'));var toCsv=require(_0x060e('0x7'));var querystring=require(_0x060e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x060e('0xe'));var as=require(_0x060e('0xf'));var hardwareService=require(_0x060e('0x10'));var logger=require('../../config/logger')(_0x060e('0x11'));var utils=require(_0x060e('0x12'));var config=require(_0x060e('0x13'));var licenseUtil=require(_0x060e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7046f6,_0x5ddef9){_0x5ddef9=_0x5ddef9||0xcc;return function(_0x3a6f7f){if(_0x3a6f7f){return _0x7046f6[_0x060e('0x15')](_0x5ddef9);}return _0x7046f6['status'](_0x5ddef9)[_0x060e('0x16')]();};}function respondWithResult(_0x163130,_0x37455c){_0x37455c=_0x37455c||0xc8;return function(_0x495977){if(_0x495977){return _0x163130['status'](_0x37455c)[_0x060e('0x17')](_0x495977);}};}function respondWithFilteredResult(_0xe909cc,_0x2c95f7){return function(_0x366b87){if(_0x366b87){var _0x5f4611=typeof _0x2c95f7[_0x060e('0x18')]==='undefined'&&typeof _0x2c95f7['limit']===_0x060e('0x19');var _0x2d3ecf=_0x366b87['count'];var _0x5eb8e1=_0x5f4611?0x0:_0x2c95f7[_0x060e('0x18')];var _0x56a406=_0x5f4611?_0x366b87['count']:_0x2c95f7['offset']+_0x2c95f7['limit'];var _0x30afb0;if(_0x56a406>=_0x2d3ecf){_0x56a406=_0x2d3ecf;_0x30afb0=0xc8;}else{_0x30afb0=0xce;}_0xe909cc[_0x060e('0x1a')](_0x30afb0);return _0xe909cc['set'](_0x060e('0x1b'),_0x5eb8e1+'-'+_0x56a406+'/'+_0x2d3ecf)[_0x060e('0x17')](_0x366b87);}return null;};}function patchUpdates(_0x48f050){return function(_0x318156){try{jsonpatch[_0x060e('0x1c')](_0x318156,_0x48f050,!![]);}catch(_0x1c8250){return BPromise[_0x060e('0x1d')](_0x1c8250);}return _0x318156[_0x060e('0x1e')]();};}function saveUpdates(_0x4e74b9,_0x47d257){return function(_0x5a4d39){if(_0x5a4d39){return _0x5a4d39[_0x060e('0x1f')](_0x4e74b9)['then'](function(_0x55f245){return _0x55f245;});}return null;};}function removeEntity(_0x56783c,_0x3518a9){return function(_0x34f1f0){if(_0x34f1f0){return _0x34f1f0[_0x060e('0x20')]()['then'](function(){_0x56783c['status'](0xcc)[_0x060e('0x16')]();});}};}function handleEntityNotFound(_0x42e391,_0x323bf1){return function(_0x3319b1){if(!_0x3319b1){_0x42e391[_0x060e('0x15')](0x194);}return _0x3319b1;};}function handleError(_0x5ab4cd,_0x3649cb){_0x3649cb=_0x3649cb||0x1f4;return function(_0x23a90b){logger[_0x060e('0x21')](_0x23a90b[_0x060e('0x22')]);if(_0x23a90b['name']){delete _0x23a90b[_0x060e('0x23')];}_0x5ab4cd[_0x060e('0x1a')](_0x3649cb)[_0x060e('0x24')](_0x23a90b);};}exports[_0x060e('0x25')]=function(_0x2721e9,_0x5d857b){var _0x3aa8c5={},_0x4d8550={},_0x44d856={'count':0x0,'rows':[]};var _0x2d4bbc=_[_0x060e('0x26')](db['ChatTransferReport'][_0x060e('0x27')],function(_0x573432){return{'name':_0x573432[_0x060e('0x28')],'type':_0x573432[_0x060e('0x29')][_0x060e('0x2a')]};});_0x4d8550['model']=_['map'](_0x2d4bbc,_0x060e('0x23'));_0x4d8550[_0x060e('0x2b')]=_[_0x060e('0x2c')](_0x2721e9[_0x060e('0x2b')]);_0x4d8550[_0x060e('0x2d')]=_['intersection'](_0x4d8550['model'],_0x4d8550['query']);_0x3aa8c5['attributes']=_[_0x060e('0x2e')](_0x4d8550[_0x060e('0x2f')],qs['fields'](_0x2721e9[_0x060e('0x2b')][_0x060e('0x30')]));_0x3aa8c5[_0x060e('0x31')]=_0x3aa8c5['attributes'][_0x060e('0x32')]?_0x3aa8c5[_0x060e('0x31')]:_0x4d8550[_0x060e('0x2f')];if(!_0x2721e9['query']['hasOwnProperty'](_0x060e('0x33'))){_0x3aa8c5[_0x060e('0x34')]=qs[_0x060e('0x34')](_0x2721e9[_0x060e('0x2b')][_0x060e('0x34')]);_0x3aa8c5[_0x060e('0x18')]=qs[_0x060e('0x18')](_0x2721e9[_0x060e('0x2b')][_0x060e('0x18')]);}_0x3aa8c5[_0x060e('0x35')]=qs[_0x060e('0x36')](_0x2721e9['query'][_0x060e('0x36')]);_0x3aa8c5['where']=qs[_0x060e('0x2d')](_[_0x060e('0x37')](_0x2721e9[_0x060e('0x2b')],_0x4d8550[_0x060e('0x2d')]),_0x2d4bbc);if(_0x2721e9[_0x060e('0x2b')]['filter']){_0x3aa8c5[_0x060e('0x38')]=_[_0x060e('0x39')](_0x3aa8c5[_0x060e('0x38')],{'$or':_[_0x060e('0x26')](_0x2d4bbc,function(_0x36ef10){if(_0x36ef10['type']!==_0x060e('0x3a')){var _0x5de8c8={};_0x5de8c8[_0x36ef10[_0x060e('0x23')]]={'$like':'%'+_0x2721e9[_0x060e('0x2b')][_0x060e('0x3b')]+'%'};return _0x5de8c8;}})});}_0x3aa8c5=_[_0x060e('0x39')]({},_0x3aa8c5,_0x2721e9[_0x060e('0x3c')]);var _0x4c800f={'where':_0x3aa8c5[_0x060e('0x38')]};return db[_0x060e('0x3d')]['count'](_0x4c800f)[_0x060e('0x3e')](function(_0x235208){_0x44d856['count']=_0x235208;if(_0x2721e9['query'][_0x060e('0x3f')]){_0x3aa8c5[_0x060e('0x40')]=[{'all':!![]}];}return db[_0x060e('0x3d')]['findAll'](_0x3aa8c5);})[_0x060e('0x3e')](function(_0xea30a2){_0x44d856['rows']=_0xea30a2;return _0x44d856;})['then'](respondWithFilteredResult(_0x5d857b,_0x3aa8c5))[_0x060e('0x41')](handleError(_0x5d857b,null));};exports[_0x060e('0x42')]=function(_0xc907b3,_0x12bf15){var _0x5a1da9={'raw':!![],'where':{'id':_0xc907b3[_0x060e('0x43')]['id']}},_0x5a2779={};_0x5a2779[_0x060e('0x2f')]=_[_0x060e('0x2c')](db[_0x060e('0x3d')][_0x060e('0x27')]);_0x5a2779[_0x060e('0x2b')]=_['keys'](_0xc907b3[_0x060e('0x2b')]);_0x5a2779[_0x060e('0x2d')]=_[_0x060e('0x2e')](_0x5a2779['model'],_0x5a2779['query']);_0x5a1da9[_0x060e('0x31')]=_['intersection'](_0x5a2779['model'],qs[_0x060e('0x30')](_0xc907b3[_0x060e('0x2b')][_0x060e('0x30')]));_0x5a1da9[_0x060e('0x31')]=_0x5a1da9[_0x060e('0x31')][_0x060e('0x32')]?_0x5a1da9[_0x060e('0x31')]:_0x5a2779[_0x060e('0x2f')];if(_0xc907b3[_0x060e('0x2b')]['includeAll']){_0x5a1da9[_0x060e('0x40')]=[{'all':!![]}];}_0x5a1da9=_[_0x060e('0x39')]({},_0x5a1da9,_0xc907b3[_0x060e('0x3c')]);return db[_0x060e('0x3d')]['find'](_0x5a1da9)[_0x060e('0x3e')](handleEntityNotFound(_0x12bf15,null))['then'](respondWithResult(_0x12bf15,null))[_0x060e('0x41')](handleError(_0x12bf15,null));};exports[_0x060e('0x44')]=function(_0xe87cc7,_0x613991){return db[_0x060e('0x3d')][_0x060e('0x44')](_0xe87cc7[_0x060e('0x45')],{})[_0x060e('0x3e')](respondWithResult(_0x613991,0xc9))['catch'](handleError(_0x613991,null));};exports[_0x060e('0x1f')]=function(_0x40b40c,_0x33a7e1){if(_0x40b40c[_0x060e('0x45')]['id']){delete _0x40b40c[_0x060e('0x45')]['id'];}return db[_0x060e('0x3d')][_0x060e('0x46')]({'where':{'id':_0x40b40c[_0x060e('0x43')]['id']}})[_0x060e('0x3e')](handleEntityNotFound(_0x33a7e1,null))['then'](saveUpdates(_0x40b40c[_0x060e('0x45')],null))[_0x060e('0x3e')](respondWithResult(_0x33a7e1,null))['catch'](handleError(_0x33a7e1,null));};exports[_0x060e('0x20')]=function(_0xc051de,_0x1c3928){return db[_0x060e('0x3d')]['find']({'where':{'id':_0xc051de[_0x060e('0x43')]['id']}})[_0x060e('0x3e')](handleEntityNotFound(_0x1c3928,null))[_0x060e('0x3e')](removeEntity(_0x1c3928,null))['catch'](handleError(_0x1c3928,null));};exports[_0x060e('0x47')]=function(_0x113e96,_0x406e81){return db[_0x060e('0x3d')]['describe']()[_0x060e('0x3e')](respondWithResult(_0x406e81,null))[_0x060e('0x41')](handleError(_0x406e81,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 7d8223c..157ed6b 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 _0x2180=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer'];(function(_0x109294,_0x62001){var _0x80a6fa=function(_0x2b3726){while(--_0x2b3726){_0x109294['push'](_0x109294['shift']());}};_0x80a6fa(++_0x62001);}(_0x2180,0xa9));var _0x0218=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x2180[_0x954b3a];return _0x3a313e;};'use strict';var _=require(_0x0218('0x0'));var util=require(_0x0218('0x1'));var logger=require(_0x0218('0x2'))(_0x0218('0x3'));var moment=require(_0x0218('0x4'));var BPromise=require(_0x0218('0x5'));var rp=require(_0x0218('0x6'));var fs=require('fs');var path=require(_0x0218('0x7'));var rimraf=require('rimraf');var config=require(_0x0218('0x8'));var attributes=require(_0x0218('0x9'));module[_0x0218('0xa')]=function(_0x1a51e9,_0x5604f2){return _0x1a51e9[_0x0218('0xb')]('ChatTransferReport',attributes,{'tableName':_0x0218('0xc'),'paranoid':![],'indexes':[{'name':_0x0218('0xd'),'fields':[_0x0218('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa456=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xa456,0x15c));var _0x6a45=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa456[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require('../../config/logger')(_0x6a45('0x2'));var moment=require('moment');var BPromise=require(_0x6a45('0x3'));var rp=require(_0x6a45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a45('0x5'));var config=require(_0x6a45('0x6'));var attributes=require(_0x6a45('0x7'));module[_0x6a45('0x8')]=function(_0x2a7862,_0x2cdd9b){return _0x2a7862[_0x6a45('0x9')]('ChatTransferReport',attributes,{'tableName':_0x6a45('0xa'),'paranoid':![],'indexes':[{'name':_0x6a45('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cef520b..8e6e556 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 _0x1bc3=['code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x452ab2,_0x6da72b){var _0x5e9940=function(_0x45c3d4){while(--_0x45c3d4){_0x452ab2['push'](_0x452ab2['shift']());}};_0x5e9940(++_0x6da72b);}(_0x1bc3,0x144));var _0x31bc=function(_0x521f4e,_0x1114c2){_0x521f4e=_0x521f4e-0x0;var _0x407fda=_0x1bc3[_0x521f4e];return _0x407fda;};'use strict';var _=require(_0x31bc('0x0'));var util=require('util');var moment=require(_0x31bc('0x1'));var BPromise=require(_0x31bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31bc('0x3'));var db=require(_0x31bc('0x4'))['db'];var utils=require(_0x31bc('0x5'));var logger=require(_0x31bc('0x6'))(_0x31bc('0x7'));var config=require(_0x31bc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d0112,_0x5b54a3,_0x16db44){return new BPromise(function(_0x1a6040,_0x1c4dde){return client['request'](_0x5d0112,_0x16db44)[_0x31bc('0xa')](function(_0x282049){logger['info'](_0x31bc('0xb'),_0x5b54a3,'request\x20sent');logger[_0x31bc('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'),JSON[_0x31bc('0xe')](_0x282049));if(_0x282049[_0x31bc('0xf')]){if(_0x282049[_0x31bc('0xf')][_0x31bc('0x10')]===0x1f4){logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);return _0x1c4dde(_0x282049['error'][_0x31bc('0x11')]);}logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049['error'][_0x31bc('0x11')]);return _0x1a6040(_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);}else{logger[_0x31bc('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'));_0x1a6040(_0x282049[_0x31bc('0x13')]['message']);}})['catch'](function(_0x2d4d1d){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x2d4d1d);_0x1c4dde(_0x2d4d1d);});});}
\ No newline at end of file
+var _0xba15=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x12964c,_0x12843c){var _0x5e6329=function(_0x5be832){while(--_0x5be832){_0x12964c['push'](_0x12964c['shift']());}};_0x5e6329(++_0x12843c);}(_0xba15,0x143));var _0x5ba1=function(_0xba75d3,_0x39035b){_0xba75d3=_0xba75d3-0x0;var _0x4202ce=_0xba15[_0xba75d3];return _0x4202ce;};'use strict';var _=require(_0x5ba1('0x0'));var util=require(_0x5ba1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ba1('0x2'));var fs=require('fs');var Redis=require(_0x5ba1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ba1('0x4'));var logger=require(_0x5ba1('0x5'))(_0x5ba1('0x6'));var config=require(_0x5ba1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ba1('0x8')][_0x5ba1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e186f,_0x2a2760,_0x41b2c7){return new BPromise(function(_0x25fd56,_0x454bb4){return client['request'](_0x4e186f,_0x41b2c7)[_0x5ba1('0xa')](function(_0x416214){logger[_0x5ba1('0xb')](_0x5ba1('0xc'),_0x2a2760,_0x5ba1('0xd'));logger['debug'](_0x5ba1('0xe'),_0x2a2760,_0x5ba1('0xd'),JSON[_0x5ba1('0xf')](_0x416214));if(_0x416214[_0x5ba1('0x10')]){if(_0x416214['error'][_0x5ba1('0x11')]===0x1f4){logger[_0x5ba1('0x10')](_0x5ba1('0xc'),_0x2a2760,_0x416214[_0x5ba1('0x10')]['message']);return _0x454bb4(_0x416214['error'][_0x5ba1('0x12')]);}logger[_0x5ba1('0x10')](_0x5ba1('0xc'),_0x2a2760,_0x416214[_0x5ba1('0x10')][_0x5ba1('0x12')]);return _0x25fd56(_0x416214[_0x5ba1('0x10')]['message']);}else{logger[_0x5ba1('0xb')](_0x5ba1('0xc'),_0x2a2760,'request\x20sent');_0x25fd56(_0x416214[_0x5ba1('0x13')][_0x5ba1('0x12')]);}})[_0x5ba1('0x14')](function(_0x218fe){logger[_0x5ba1('0x10')](_0x5ba1('0xc'),_0x2a2760,_0x218fe);_0x454bb4(_0x218fe);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index c08bf26..ea0e504 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 _0x9748=['express','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','describe','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x9748,0x1d1));var _0x8974=function(_0x5d2c0e,_0x864cca){_0x5d2c0e=_0x5d2c0e-0x0;var _0x3ac730=_0x9748[_0x5d2c0e];return _0x3ac730;};'use strict';var multer=require(_0x8974('0x0'));var util=require('util');var path=require(_0x8974('0x1'));var timeout=require(_0x8974('0x2'));var express=require(_0x8974('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8974('0x4'));var interaction=require(_0x8974('0x5'));var config=require('../../config/environment');var controller=require(_0x8974('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8974('0x7')](_0x8974('0x8'),auth['isAuthenticated'](),controller[_0x8974('0x9')]);router[_0x8974('0x7')](_0x8974('0xa'),auth['isAuthenticated'](),controller[_0x8974('0xb')]);router['post']('/',auth[_0x8974('0xc')](),controller['create']);router[_0x8974('0xd')](_0x8974('0xa'),auth[_0x8974('0xc')](),controller[_0x8974('0xe')]);router[_0x8974('0xf')](_0x8974('0xa'),auth[_0x8974('0xc')](),controller[_0x8974('0x10')]);module[_0x8974('0x11')]=router;
\ No newline at end of file
+var _0x5a34=['./chatTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2e4c9b,_0x1ddbe9){var _0x392189=function(_0x1caed6){while(--_0x1caed6){_0x2e4c9b['push'](_0x2e4c9b['shift']());}};_0x392189(++_0x1ddbe9);}(_0x5a34,0x9f));var _0x45a3=function(_0x503733,_0x3428a2){_0x503733=_0x503733-0x0;var _0x29baa4=_0x5a34[_0x503733];return _0x29baa4;};'use strict';var multer=require(_0x45a3('0x0'));var util=require(_0x45a3('0x1'));var path=require(_0x45a3('0x2'));var timeout=require(_0x45a3('0x3'));var express=require(_0x45a3('0x4'));var router=express[_0x45a3('0x5')]();var fs_extra=require(_0x45a3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x45a3('0x7'));var config=require(_0x45a3('0x8'));var controller=require(_0x45a3('0x9'));router[_0x45a3('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x45a3('0xa')](_0x45a3('0xb'),auth[_0x45a3('0xc')](),controller[_0x45a3('0xd')]);router[_0x45a3('0xa')]('/:id',auth[_0x45a3('0xc')](),controller[_0x45a3('0xe')]);router[_0x45a3('0xf')]('/',auth[_0x45a3('0xc')](),controller[_0x45a3('0x10')]);router[_0x45a3('0x11')]('/:id',auth[_0x45a3('0xc')](),controller[_0x45a3('0x12')]);router[_0x45a3('0x13')]('/:id',auth[_0x45a3('0xc')](),controller['destroy']);module[_0x45a3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 4b518dd..8b3684a 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 _0x447f=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.'];(function(_0x754f0,_0x4b0d70){var _0x486710=function(_0x24105c){while(--_0x24105c){_0x754f0['push'](_0x754f0['shift']());}};_0x486710(++_0x4b0d70);}(_0x447f,0x156));var _0xf447=function(_0x546c3b,_0x248e63){_0x546c3b=_0x546c3b-0x0;var _0x7b2f47=_0x447f[_0x546c3b];return _0x7b2f47;};'use strict';var Sequelize=require(_0xf447('0x0'));var rs=require(_0xf447('0x1'));module[_0xf447('0x2')]={'name':{'type':Sequelize[_0xf447('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'unique':_0xf447('0x4')},'description':{'type':Sequelize[_0xf447('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x5')},'key':{'type':Sequelize[_0xf447('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x6')},'customerAlias':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf447('0x3')]},'animation':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf447('0xb')](_0xf447('0xc'),_0xf447('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xf')},'header_offline':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x10')},'download_transcript':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf447('0x11')]},'closingQuestion':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x15')},'placeholderMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xf')},'skipMessageButton':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x17')},'conditionAgreement':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x18')},'ratingType':{'type':Sequelize[_0xf447('0xb')](_0xf447('0x19'),_0xf447('0x1a')),'defaultValue':_0xf447('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf447('0x1b')]({'items':[{'type':_0xf447('0x1c'),'variable':null,'config':{'placeholder':'name','type':_0xf447('0x1d'),'required':!![]},'props':{'title':_0xf447('0x1e'),'helpText':''}},{'type':_0xf447('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf447('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf447('0x1f')](_0xf447('0x20'))?JSON[_0xf447('0x21')](this[_0xf447('0x1f')](_0xf447('0x20'))):{};},'set':function(_0x3edcde){return this['setDataValue'](_0xf447('0x20'),JSON[_0xf447('0x1b')](_0x3edcde));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf447('0x1c'),'props':{'title':_0xf447('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf447('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xf447('0x22'),'helpText':_0xf447('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf447('0x24'))?JSON[_0xf447('0x21')](this[_0xf447('0x1f')](_0xf447('0x24'))):{};},'set':function(_0x58af63){return this['setDataValue'](_0xf447('0x24'),JSON[_0xf447('0x1b')](_0x58af63));}},'token':{'type':Sequelize[_0xf447('0x3')],'defaultValue':function(){return rs[_0xf447('0x25')]();}},'autoclose':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf447('0x3')]},'forwardOffline':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf447('0x3')]},'waitingTitle':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x26')},'waitingMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x28')},'offlineMessageBody':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf447('0x11')],'defaultValue':function(){return _0xf447('0x2b');}},'notificationSound':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf447('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf447('0x9')],'comment':_0xf447('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![],'comment':_0xf447('0x32'),'set':function(_0xa0a312){if(!_0xa0a312)this['setDataValue'](_0xf447('0x33'),null);this[_0xf447('0x34')](_0xf447('0x35'),_0xa0a312);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf447('0x3')]},'vidaooTopic':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf447('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf447('0x11')]}};
\ No newline at end of file
+var _0x9670=['squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded'];(function(_0xc051b2,_0x3d6d9d){var _0x599dc2=function(_0x235ded){while(--_0x235ded){_0xc051b2['push'](_0xc051b2['shift']());}};_0x599dc2(++_0x3d6d9d);}(_0x9670,0x16f));var _0x0967=function(_0x25d255,_0x44231b){_0x25d255=_0x25d255-0x0;var _0x2d6b09=_0x9670[_0x25d255];return _0x2d6b09;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0967('0x0'));module[_0x0967('0x1')]={'name':{'type':Sequelize[_0x0967('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'unique':_0x0967('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x4')},'key':{'type':Sequelize[_0x0967('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x5')},'customerAlias':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0967('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0967('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0967('0x9')](_0x0967('0xa'),_0x0967('0xb')),'defaultValue':_0x0967('0xa')},'header_online':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0xc')},'offline_chat_button':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x0967('0xe')},'download_transcript':{'type':Sequelize[_0x0967('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0967('0x11')]},'closingQuestion':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0967('0x15')},'placeholderMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x16')},'closingMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x17')},'closingMessageButton':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0xd')},'skipMessageButton':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x18')},'conditionAgreement':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0967('0x19')},'ratingType':{'type':Sequelize['ENUM'](_0x0967('0x1a'),'thumb'),'defaultValue':_0x0967('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x0967('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0967('0x11')],'defaultValue':function(){return JSON[_0x0967('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0967('0x1c'),'type':_0x0967('0x1d'),'required':!![]},'props':{'title':_0x0967('0x1c'),'helpText':''}},{'type':_0x0967('0x1e'),'props':{'title':_0x0967('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0967('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0967('0x1f')](_0x0967('0x20'))?JSON[_0x0967('0x21')](this['getDataValue'](_0x0967('0x20'))):{};},'set':function(_0x41191e){return this[_0x0967('0x22')](_0x0967('0x20'),JSON[_0x0967('0x1b')](_0x41191e));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0967('0x1b')]({'items':[{'type':'input','props':{'title':_0x0967('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0967('0x4')},'variable':null},{'type':_0x0967('0x23'),'config':{'placeholder':_0x0967('0x24')},'props':{'title':_0x0967('0x24'),'helpText':_0x0967('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x0967('0x1f')](_0x0967('0x26'))?JSON[_0x0967('0x21')](this[_0x0967('0x1f')]('offlineForm')):{};},'set':function(_0x11645f){return this[_0x0967('0x22')](_0x0967('0x26'),JSON[_0x0967('0x1b')](_0x11645f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0967('0x2')]},'waitingTitle':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x27')},'waitingMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0967('0x18')},'sendUnmanaged':{'type':Sequelize[_0x0967('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0967('0x11')],'defaultValue':function(){return _0x0967('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0967('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0967('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x0967('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x2c')},'messagesAlignment':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x2d')},'defaultTitle':{'type':Sequelize[_0x0967('0x2')]},'customerAvatar':{'type':Sequelize[_0x0967('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0967('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0967('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0967('0x2')],'defaultValue':_0x0967('0x2f')},'systemAvatar':{'type':Sequelize[_0x0967('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0967('0x8')],'comment':_0x0967('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0967('0x31'),'set':function(_0xb65e38){if(!_0xb65e38)this[_0x0967('0x22')](_0x0967('0x32'),null);this['setDataValue'](_0x0967('0x33'),_0xb65e38);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0967('0x2')]},'vidaooTopic':{'type':Sequelize[_0x0967('0x2')],'allowNull':![],'defaultValue':_0x0967('0x34')},'vidaooNote':{'type':Sequelize[_0x0967('0x2')],'defaultValue':function(){return _0x0967('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x0967('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0967('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0967('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 20ab415..09d36ab 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 _0xa8a8=['device','model','vendor','%s\x20%s\x20%s','type','stringify','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','find','create','body','address','forEach','trim','testWildcardValidity','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','describe','addDisposition','ChatWebsiteId','Disposition','order','sort','include','removeDispositions','ids','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','download','root','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','DESC','Applications','Intervals','format','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','List','Contacts','contact','headers','threadId','ChatInteraction','customerIp','closed','externalUrl','interaction','lastName','messageId','created','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','./helpers/wildcard-expressions','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','update','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown'];(function(_0x4baebc,_0x41de8c){var _0x31b89c=function(_0x368217){while(--_0x368217){_0x4baebc['push'](_0x4baebc['shift']());}};_0x31b89c(++_0x41de8c);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4888a4,_0x46a30){_0x4888a4=_0x4888a4-0x0;var _0x1f2445=_0xa8a8[_0x4888a4];return _0x1f2445;};'use strict';var Mustache=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var ejs=require(_0x8a8a('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a8a('0x4'));var querystring=require(_0x8a8a('0x5'));var htmlToText=require(_0x8a8a('0x6'));var Redis=require(_0x8a8a('0x7'));var jayson=require(_0x8a8a('0x8'));var qs=require(_0x8a8a('0x9'));var logger=require(_0x8a8a('0xa'))(_0x8a8a('0xb'));var config=require(_0x8a8a('0xc'));var APIBadRequestError=require(_0x8a8a('0xd'))[_0x8a8a('0xe')];var APINotFoundError=require(_0x8a8a('0xd'))[_0x8a8a('0xf')];var APIOutOfIntervalError=require(_0x8a8a('0xd'))[_0x8a8a('0x10')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0x8a8a('0xd'))['APIConflictError'];var wildcardUtils=require(_0x8a8a('0x11'));var URL=require(_0x8a8a('0x12'))['URL'];var db=require(_0x8a8a('0x13'))['db'];config[_0x8a8a('0x14')]=_[_0x8a8a('0x15')](config['redis'],{'host':_0x8a8a('0x16'),'port':0x18eb});var socket=require(_0x8a8a('0x17'))(new Redis(config[_0x8a8a('0x14')]));require(_0x8a8a('0x18'))['register'](socket);var client=jayson[_0x8a8a('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x232a});var client9003=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x232b});var client9001=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x16d38d,_0x51ce75,_0x1ed3be,_0x568b83){return new Promise(function(_0x1f36b6,_0x3046ae){var _0x46a4f4=_0x568b83||client;return _0x46a4f4[_0x8a8a('0x1b')](_0x16d38d,_0x1ed3be)[_0x8a8a('0x1c')](function(_0x5dd616){logger[_0x8a8a('0x1d')](_0x8a8a('0x1e'),_0x51ce75,_0x8a8a('0x1f'));logger[_0x8a8a('0x20')](_0x8a8a('0x21'),_0x51ce75,_0x8a8a('0x1f'),JSON['stringify'](_0x5dd616));if(_0x5dd616['error']){if(_0x5dd616['error']['code']===0x1f4){logger['error'](_0x8a8a('0x1e'),_0x51ce75,_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);return _0x3046ae(_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);}logger[_0x8a8a('0x22')](_0x8a8a('0x1e'),_0x51ce75,_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);return _0x1f36b6(_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);}else{logger[_0x8a8a('0x1d')](_0x8a8a('0x1e'),_0x51ce75,_0x8a8a('0x1f'));_0x1f36b6(_0x5dd616[_0x8a8a('0x24')]['message']);}})[_0x8a8a('0x25')](function(_0x16c55b){logger[_0x8a8a('0x22')](_0x8a8a('0x1e'),_0x51ce75,_0x16c55b);_0x3046ae(_0x16c55b);});});}function respondWithStatusCode(_0x36e6d4,_0x251315){_0x251315=_0x251315||0xcc;return function(_0x3aa46d){if(_0x3aa46d){return _0x36e6d4['sendStatus'](_0x251315);}return _0x36e6d4[_0x8a8a('0x26')](_0x251315)[_0x8a8a('0x27')]();};}function respondWithResult(_0x2e217a,_0x54ff7e){_0x54ff7e=_0x54ff7e||0xc8;return function(_0x58f42b){if(_0x58f42b){return _0x2e217a[_0x8a8a('0x26')](_0x54ff7e)[_0x8a8a('0x28')](_0x58f42b);}};}function respondWithFilteredResult(_0x5c70bd,_0x4d8760){return function(_0x4b3bc5){if(_0x4b3bc5){var _0x78fd48=typeof _0x4d8760['offset']===_0x8a8a('0x29')&&typeof _0x4d8760[_0x8a8a('0x2a')]==='undefined';var _0x36c7f8=_0x4b3bc5[_0x8a8a('0x2b')];var _0x250852=_0x78fd48?0x0:_0x4d8760[_0x8a8a('0x2c')];var _0x41802e=_0x78fd48?_0x4b3bc5[_0x8a8a('0x2b')]:_0x4d8760[_0x8a8a('0x2c')]+_0x4d8760[_0x8a8a('0x2a')];var _0x5768a6;if(_0x41802e>=_0x36c7f8){_0x41802e=_0x36c7f8;_0x5768a6=0xc8;}else{_0x5768a6=0xce;}_0x5c70bd['status'](_0x5768a6);return _0x5c70bd['set'](_0x8a8a('0x2d'),_0x250852+'-'+_0x41802e+'/'+_0x36c7f8)[_0x8a8a('0x28')](_0x4b3bc5);}return null;};}function saveUpdates(_0x5f301e){return function(_0x2b5dc9){if(_0x2b5dc9){return _0x2b5dc9[_0x8a8a('0x2e')](_0x5f301e)['then'](function(_0x3abab2){return _0x3abab2;});}return null;};}function removeEntity(_0x431b3a){return function(_0x63b9be){if(_0x63b9be){return _0x63b9be['destroy']()['then'](function(){var _0x8457a0=_0x63b9be['get']({'plain':!![]});var _0x2a3198=_0x8a8a('0x2f');return db[_0x8a8a('0x30')][_0x8a8a('0x31')]({'where':{'type':_0x2a3198,'resourceId':_0x8457a0['id']}})[_0x8a8a('0x1c')](function(){return _0x63b9be;});})[_0x8a8a('0x1c')](function(){_0x431b3a[_0x8a8a('0x26')](0xcc)[_0x8a8a('0x27')]();});}};}function handleEntityNotFound(_0x320398){return function(_0xf7d4d7){if(!_0xf7d4d7){_0x320398[_0x8a8a('0x32')](0x194);}return _0xf7d4d7;};}function handleError(_0x45ddb4,_0x17a36c){_0x17a36c=_0x17a36c||0x1f4;return function(_0x37e644){logger[_0x8a8a('0x22')](_0x37e644[_0x8a8a('0x33')]);if(_0x37e644[_0x8a8a('0x34')]){delete _0x37e644[_0x8a8a('0x34')];}_0x45ddb4['status'](_0x17a36c)['send'](_0x37e644);};}function createInteractionObject(_0x53da01,_0x34db33,_0x9e0128,_0x376de3){var _0x117a5c=require(_0x8a8a('0x35'));var _0x508e67=new _0x117a5c();var _0x4ee92e=_0x508e67[_0x8a8a('0x36')](_0x9e0128['user-agent'])[_0x8a8a('0x37')]();var _0x5c210e=_0x34db33['customerIp'];if(_0x9e0128[_0x8a8a('0x38')]){_0x5c210e=_0x9e0128[_0x8a8a('0x38')];}else if(_0x9e0128[_0x8a8a('0x39')]){_0x5c210e=_[_0x8a8a('0x3a')](_0x9e0128[_0x8a8a('0x39')][_0x8a8a('0x3b')](','));}return{'ContactId':_0x376de3['id'],'ChatWebsiteId':_0x53da01,'from':(_0x376de3[_0x8a8a('0x3c')]||'')+'\x20'+(_0x376de3['lastName']||''),'customerIp':_0x5c210e,'customerPort':_0x9e0128[_0x8a8a('0x3d')]?_0x9e0128[_0x8a8a('0x3d')]:null,'referer':_0x34db33[_0x8a8a('0x3e')],'browserName':_0x4ee92e['browser'][_0x8a8a('0x34')]&&_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x40')]?util['format'](_0x8a8a('0x41'),_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x34')],_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x40')]):_0x8a8a('0x42'),'browserVersion':_0x4ee92e['browser']['version']||_0x8a8a('0x42'),'osName':util['format'](_0x8a8a('0x41'),_0x4ee92e['os'][_0x8a8a('0x34')],_0x4ee92e['os']['version']),'osVersion':_0x4ee92e['os']['version'],'deviceModel':_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x44')]&&_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x45')]?util['format'](_0x8a8a('0x46'),_0x4ee92e['device'][_0x8a8a('0x44')],_0x4ee92e[_0x8a8a('0x43')]['vendor'],_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x47')]):null,'deviceVendor':_0x4ee92e[_0x8a8a('0x43')]['vendor'],'deviceType':_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x47')],'formData':JSON[_0x8a8a('0x48')](_0x34db33)};}exports['index']=function(_0x5466d4,_0x44aed3){var _0x1eb8bf={'include':[{'model':db[_0x8a8a('0x49')],'as':_0x8a8a('0x4a')}]},_0x1b842a={},_0x5c6c98={'count':0x0,'rows':[]};var _0x86588c=_[_0x8a8a('0x4b')](db[_0x8a8a('0x4c')][_0x8a8a('0x4d')],function(_0x13c233){return{'name':_0x13c233[_0x8a8a('0x4e')],'type':_0x13c233[_0x8a8a('0x47')][_0x8a8a('0x4f')]};});_0x1b842a[_0x8a8a('0x44')]=_['map'](_0x86588c,_0x8a8a('0x34'));_0x1b842a[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x5466d4[_0x8a8a('0x50')]);_0x1b842a[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x1b842a['model'],_0x1b842a[_0x8a8a('0x50')]);_0x1eb8bf[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x1b842a[_0x8a8a('0x44')],qs['fields'](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x1eb8bf[_0x8a8a('0x54')]=_0x1eb8bf['attributes']['length']?_0x1eb8bf[_0x8a8a('0x54')]:_0x1b842a[_0x8a8a('0x44')];if(!_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x1eb8bf[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x1eb8bf['offset']=qs['offset'](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x1eb8bf['order']=qs['sort'](_0x5466d4[_0x8a8a('0x50')]['sort']);_0x1eb8bf[_0x8a8a('0x58')]=qs['filters'](_[_0x8a8a('0x59')](_0x5466d4[_0x8a8a('0x50')],_0x1b842a[_0x8a8a('0x52')]),_0x86588c);if(_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x1eb8bf[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x1eb8bf[_0x8a8a('0x58')],{'$or':_[_0x8a8a('0x4b')](_0x86588c,function(_0x2c771e){if(_0x2c771e['type']!==_0x8a8a('0x5c')){var _0x133bae={};_0x133bae[_0x2c771e[_0x8a8a('0x34')]]={'$like':'%'+_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0x133bae;}})});}_0x1eb8bf=_['merge']({},_0x1eb8bf,_0x5466d4[_0x8a8a('0x5d')]);var _0x140673={'where':_0x1eb8bf['where']};return db['ChatWebsite'][_0x8a8a('0x2b')](_0x140673)[_0x8a8a('0x1c')](function(_0x322b4c){_0x5c6c98[_0x8a8a('0x2b')]=_0x322b4c;if(_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x1eb8bf['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1eb8bf);})[_0x8a8a('0x1c')](function(_0x54d848){_0x5c6c98[_0x8a8a('0x5f')]=_0x54d848;return _0x5c6c98;})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x44aed3,_0x1eb8bf))['catch'](handleError(_0x44aed3,null));};exports[_0x8a8a('0x60')]=function(_0x38ba9f,_0x183f88){var _0x119fb5={'raw':![],'where':{'id':_0x38ba9f[_0x8a8a('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x8a8a('0x4a')}]},_0x4cf6ae={};_0x4cf6ae[_0x8a8a('0x44')]=_['keys'](db[_0x8a8a('0x4c')][_0x8a8a('0x4d')]);_0x4cf6ae[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x38ba9f['query']);_0x4cf6ae[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x4cf6ae[_0x8a8a('0x44')],_0x4cf6ae['query']);_0x119fb5['attributes']=_[_0x8a8a('0x53')](_0x4cf6ae['model'],qs['fields'](_0x38ba9f['query'][_0x8a8a('0x55')]));_0x119fb5[_0x8a8a('0x54')]=_0x119fb5['attributes'][_0x8a8a('0x62')]?_0x119fb5['attributes']:_0x4cf6ae['model'];if(_0x38ba9f[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x119fb5['include']=[{'all':!![]}];}_0x119fb5=_[_0x8a8a('0x5b')]({},_0x119fb5,_0x38ba9f[_0x8a8a('0x5d')]);return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x119fb5)[_0x8a8a('0x1c')](handleEntityNotFound(_0x183f88,null))[_0x8a8a('0x1c')](respondWithResult(_0x183f88,null))['catch'](handleError(_0x183f88,null));};exports[_0x8a8a('0x64')]=function(_0x402b5f,_0x587ea8){var _0x2ce579=null;_0x402b5f[_0x8a8a('0x65')][_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x67')](_0x450afc=>{if(_0x450afc[_0x8a8a('0x68')]()!==''&&!wildcardUtils[_0x8a8a('0x69')](_0x450afc[_0x8a8a('0x68')]())){_0x2ce579=new APIBadRequestError('\x22'+_0x450afc[_0x8a8a('0x68')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2ce579){return handleError(_0x587ea8,null)(_0x2ce579);}return db[_0x8a8a('0x4c')][_0x8a8a('0x64')](_0x402b5f['body'],{})[_0x8a8a('0x1c')](function(_0x1f90af){var _0x2640e3=_0x402b5f[_0x8a8a('0x6a')][_0x8a8a('0x6b')]({'plain':!![]});if(!_0x2640e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2640e3[_0x8a8a('0x6c')]===_0x8a8a('0x6a')){var _0x3edc54=_0x1f90af[_0x8a8a('0x6b')]({'plain':!![]});var _0x3fc483=_0x8a8a('0x2f');return db[_0x8a8a('0x6d')]['find']({'where':{'name':_0x3fc483,'userProfileId':_0x2640e3[_0x8a8a('0x6e')]},'raw':!![]})[_0x8a8a('0x1c')](function(_0x35ed30){if(_0x35ed30&&_0x35ed30['autoAssociation']===0x0){return db[_0x8a8a('0x30')]['create']({'name':_0x3edc54[_0x8a8a('0x34')],'resourceId':_0x3edc54['id'],'type':_0x35ed30[_0x8a8a('0x34')],'sectionId':_0x35ed30['id']},{})['then'](function(){return _0x1f90af;});}else{return _0x1f90af;}})[_0x8a8a('0x25')](function(_0x42891b){logger[_0x8a8a('0x22')](_0x8a8a('0x6f'),_0x42891b);throw _0x42891b;});}return _0x1f90af;})[_0x8a8a('0x1c')](respondWithResult(_0x587ea8,0xc9))[_0x8a8a('0x25')](handleError(_0x587ea8,null));};exports[_0x8a8a('0x2e')]=function(_0x25b684,_0x31c0dc){var _0x218e5b=null;_0x25b684[_0x8a8a('0x65')][_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x67')](_0x8a0a49=>{if(_0x8a0a49[_0x8a8a('0x68')]()!==''&&!wildcardUtils[_0x8a8a('0x69')](_0x8a0a49[_0x8a8a('0x68')]())){_0x218e5b=new APIBadRequestError('\x22'+_0x8a0a49['trim']()+_0x8a8a('0x70'));}});if(_0x218e5b){return handleError(_0x31c0dc,null)(_0x218e5b);}if(_0x25b684['body']['id']){delete _0x25b684[_0x8a8a('0x65')]['id'];}return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x25b684['params']['id']},'include':[{'model':db['Pause'],'as':_0x8a8a('0x4a')}]})[_0x8a8a('0x1c')](handleEntityNotFound(_0x31c0dc,null))[_0x8a8a('0x1c')](saveUpdates(_0x25b684['body'],null))['then'](respondWithResult(_0x31c0dc,null))[_0x8a8a('0x25')](handleError(_0x31c0dc,null));};exports[_0x8a8a('0x31')]=function(_0x46a556,_0x155cc4){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x46a556[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x155cc4,null))['then'](removeEntity(_0x155cc4,null))[_0x8a8a('0x25')](handleError(_0x155cc4,null));};exports[_0x8a8a('0x71')]=function(_0x4a906c,_0x3158f2){return db[_0x8a8a('0x4c')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](respondWithResult(_0x3158f2,null))[_0x8a8a('0x25')](handleError(_0x3158f2,null));};exports[_0x8a8a('0x72')]=function(_0x4a886f,_0x2924a4){if(_0x4a886f[_0x8a8a('0x65')]['id']){delete _0x4a886f[_0x8a8a('0x65')]['id'];}return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x4a886f['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2924a4,null))[_0x8a8a('0x1c')](function(_0x34d140){if(_0x34d140){_0x4a886f[_0x8a8a('0x65')][_0x8a8a('0x73')]=_0x34d140['id'];return db[_0x8a8a('0x74')][_0x8a8a('0x64')](_0x4a886f[_0x8a8a('0x65')]);}})[_0x8a8a('0x1c')](respondWithResult(_0x2924a4,null))[_0x8a8a('0x25')](handleError(_0x2924a4,null));};exports['getDispositions']=function(_0x306a50,_0x20b40e){var _0x3bb8d7={'raw':![],'where':{}};var _0x3391b5={};var _0xb74976={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x306a50[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x20b40e,null))[_0x8a8a('0x1c')](function(_0x50b105){if(_0x50b105){_0x3391b5[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db[_0x8a8a('0x74')][_0x8a8a('0x4d')]);_0x3391b5['query']=_[_0x8a8a('0x51')](_0x306a50[_0x8a8a('0x50')]);_0x3391b5[_0x8a8a('0x52')]=_['intersection'](_0x3391b5['model'],_0x3391b5['query']);_0x3bb8d7[_0x8a8a('0x54')]=_['intersection'](_0x3391b5[_0x8a8a('0x44')],qs['fields'](_0x306a50['query'][_0x8a8a('0x55')]));_0x3bb8d7['attributes']=_0x3bb8d7['attributes']['length']?_0x3bb8d7[_0x8a8a('0x54')]:_0x3391b5['model'];if(!_0x306a50['query'][_0x8a8a('0x56')]('nolimit')){_0x3bb8d7[_0x8a8a('0x2a')]=qs['limit'](_0x306a50[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x3bb8d7[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x306a50['query'][_0x8a8a('0x2c')]);}_0x3bb8d7[_0x8a8a('0x75')]=qs['sort'](_0x306a50[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x3bb8d7[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_['pick'](_0x306a50['query'],_0x3391b5[_0x8a8a('0x52')]));_0x3bb8d7[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x50b105['id'];if(_0x306a50['query'][_0x8a8a('0x5a')]){_0x3bb8d7[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x3bb8d7['where'],{'$or':_[_0x8a8a('0x4b')](_0x3bb8d7[_0x8a8a('0x54')],function(_0x1e60a6){var _0x3a7e46={};_0x3a7e46[_0x1e60a6]={'$like':'%'+_0x306a50[_0x8a8a('0x50')]['filter']+'%'};return _0x3a7e46;})});}_0x3bb8d7=_[_0x8a8a('0x5b')]({},_0x3bb8d7,_0x306a50[_0x8a8a('0x5d')]);return db[_0x8a8a('0x74')][_0x8a8a('0x2b')]({'where':_0x3bb8d7[_0x8a8a('0x58')]})[_0x8a8a('0x1c')](function(_0x276126){_0xb74976['count']=_0x276126;if(_0x306a50['query'][_0x8a8a('0x5e')]){_0x3bb8d7[_0x8a8a('0x77')]=[{'all':!![]}];}return db[_0x8a8a('0x74')]['findAll'](_0x3bb8d7);})[_0x8a8a('0x1c')](function(_0xd53cec){_0xb74976[_0x8a8a('0x5f')]=_0xd53cec;return _0xb74976;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x20b40e,_0x3bb8d7))[_0x8a8a('0x25')](handleError(_0x20b40e,null));};exports[_0x8a8a('0x78')]=function(_0x3a0e27,_0x26d57f){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3a0e27['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x26d57f,null))[_0x8a8a('0x1c')](function(_0x311c6c){if(_0x311c6c){return _0x311c6c['removeDispositions'](_0x3a0e27[_0x8a8a('0x50')][_0x8a8a('0x79')]);}})[_0x8a8a('0x1c')](respondWithStatusCode(_0x26d57f,null))['catch'](handleError(_0x26d57f,null));};exports['addAnswer']=function(_0x1f409b,_0x450b1a){if(_0x1f409b[_0x8a8a('0x65')]['id']){delete _0x1f409b[_0x8a8a('0x65')]['id'];}return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x1f409b[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x450b1a,null))[_0x8a8a('0x1c')](function(_0x5df060){if(_0x5df060){_0x1f409b['body'][_0x8a8a('0x73')]=_0x5df060['id'];return db[_0x8a8a('0x7a')][_0x8a8a('0x64')](_0x1f409b['body']);}})[_0x8a8a('0x1c')](respondWithResult(_0x450b1a,null))[_0x8a8a('0x25')](handleError(_0x450b1a,null));};exports[_0x8a8a('0x7b')]=function(_0x198083,_0x31f2e6){var _0x5ac7b7={'raw':![],'where':{}};var _0x5ac592={};var _0x5d727e={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x198083[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x31f2e6,null))[_0x8a8a('0x1c')](function(_0x34502e){if(_0x34502e){_0x5ac592['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0x7a')]['rawAttributes']);_0x5ac592['query']=_[_0x8a8a('0x51')](_0x198083[_0x8a8a('0x50')]);_0x5ac592['filters']=_[_0x8a8a('0x53')](_0x5ac592['model'],_0x5ac592['query']);_0x5ac7b7[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x5ac592[_0x8a8a('0x44')],qs['fields'](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x5ac7b7[_0x8a8a('0x54')]=_0x5ac7b7[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x5ac7b7[_0x8a8a('0x54')]:_0x5ac592['model'];if(!_0x198083['query']['hasOwnProperty'](_0x8a8a('0x57'))){_0x5ac7b7[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x5ac7b7[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x5ac7b7['order']=qs[_0x8a8a('0x76')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x5ac7b7[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x198083['query'],_0x5ac592['filters']));_0x5ac7b7['where'][_0x8a8a('0x73')]=_0x34502e['id'];if(_0x198083['query'][_0x8a8a('0x5a')]){_0x5ac7b7['where']=_[_0x8a8a('0x5b')](_0x5ac7b7['where'],{'$or':_[_0x8a8a('0x4b')](_0x5ac7b7[_0x8a8a('0x54')],function(_0x5e8094){var _0x12110e={};_0x12110e[_0x5e8094]={'$like':'%'+_0x198083['query']['filter']+'%'};return _0x12110e;})});}_0x5ac7b7=_[_0x8a8a('0x5b')]({},_0x5ac7b7,_0x198083['options']);return db[_0x8a8a('0x7a')]['count']({'where':_0x5ac7b7[_0x8a8a('0x58')]})['then'](function(_0x34aa82){_0x5d727e[_0x8a8a('0x2b')]=_0x34aa82;if(_0x198083[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x5ac7b7['include']=[{'all':!![]}];}return db[_0x8a8a('0x7a')][_0x8a8a('0x7d')](_0x5ac7b7);})[_0x8a8a('0x1c')](function(_0x33ac80){_0x5d727e['rows']=_0x33ac80;return _0x5d727e;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x31f2e6,_0x5ac7b7))[_0x8a8a('0x25')](handleError(_0x31f2e6,null));};exports[_0x8a8a('0x7e')]=function(_0x4e4983,_0xd5f3cf){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x4e4983[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0xd5f3cf,null))['then'](function(_0x5b5087){if(_0x5b5087){return _0x5b5087[_0x8a8a('0x7e')](_0x4e4983[_0x8a8a('0x50')][_0x8a8a('0x79')]);}})['then'](respondWithStatusCode(_0xd5f3cf,null))[_0x8a8a('0x25')](handleError(_0xd5f3cf,null));};exports[_0x8a8a('0x7f')]=function(_0x559f13,_0x568cb2){_0x559f13[_0x8a8a('0x65')][_0x8a8a('0x80')]=_0x559f13[_0x8a8a('0x81')]['filename'];return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x559f13['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x568cb2,null))[_0x8a8a('0x1c')](saveUpdates(_0x559f13['body'],null))[_0x8a8a('0x1c')](respondWithResult(_0x568cb2,null))['catch'](handleError(_0x568cb2,null));};exports[_0x8a8a('0x82')]=function(_0x16a4a8,_0x575f64){_0x16a4a8[_0x8a8a('0x65')][_0x8a8a('0x83')]=_0x16a4a8['file'][_0x8a8a('0x84')];return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x16a4a8[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x575f64,null))[_0x8a8a('0x1c')](saveUpdates(_0x16a4a8[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x575f64,null))['catch'](handleError(_0x575f64,null));};exports[_0x8a8a('0x85')]=function(_0x4d1fc0,_0x269d17){_0x4d1fc0[_0x8a8a('0x65')][_0x8a8a('0x86')]=_0x4d1fc0[_0x8a8a('0x81')][_0x8a8a('0x84')];return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x4d1fc0[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x269d17,null))[_0x8a8a('0x1c')](saveUpdates(_0x4d1fc0[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x269d17,null))['catch'](handleError(_0x269d17,null));};exports['addSystemAvatar']=function(_0x35d9e2,_0x1cb3aa){_0x35d9e2[_0x8a8a('0x65')][_0x8a8a('0x87')]=_0x35d9e2[_0x8a8a('0x81')][_0x8a8a('0x84')];return db[_0x8a8a('0x4c')]['find']({'where':{'id':_0x35d9e2['params']['id']}})['then'](handleEntityNotFound(_0x1cb3aa,null))[_0x8a8a('0x1c')](saveUpdates(_0x35d9e2[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x1cb3aa,null))['catch'](handleError(_0x1cb3aa,null));};exports[_0x8a8a('0x88')]=function(_0xe6030b,_0x39d705){var _0x19c264=path[_0x8a8a('0x89')](config['root'],_0x8a8a('0x8a'));var _0xde7f73={'where':{'id':_0xe6030b[_0x8a8a('0x61')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x913a2f=![];return require(_0x8a8a('0x8b'))[_0x8a8a('0x8c')]()['then'](function(_0x4a2af9){if(_0x4a2af9){_0x913a2f=_0x4a2af9[_0x8a8a('0x8d')];}})[_0x8a8a('0x1c')](function(){return db[_0x8a8a('0x4c')]['find'](_0xde7f73);})[_0x8a8a('0x1c')](handleEntityNotFound(_0x39d705,null))[_0x8a8a('0x1c')](function(_0x5b555e){if(_0x5b555e){if(!_[_0x8a8a('0x8e')](_0x5b555e[_0x8a8a('0x80')])){if(fs['existsSync'](path[_0x8a8a('0x89')](config['root'],'server/files/images/logos/',_0x5b555e[_0x8a8a('0x80')]))&&_0x913a2f){_0x19c264=path[_0x8a8a('0x89')](config['root'],'server/files/images/logos/',_0x5b555e['sitepic']);}}return _0x39d705[_0x8a8a('0x8f')](_0x19c264);}})['catch'](handleError(_0x39d705,null));};exports['getAvatar']=function(_0xc0fb22,_0x69e16){var _0x58ac24=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x91'));var _0x43ab4d={'where':{'id':_0xc0fb22[_0x8a8a('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x8a8a('0x4c')]['find'](_0x43ab4d)[_0x8a8a('0x1c')](handleEntityNotFound(_0x69e16,null))[_0x8a8a('0x1c')](function(_0x9bd75e){if(_0x9bd75e){if(!_[_0x8a8a('0x8e')](_0x9bd75e['agentAvatar'])){if(fs['existsSync'](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x9bd75e[_0x8a8a('0x83')]))){_0x58ac24=path[_0x8a8a('0x89')](config['root'],_0x8a8a('0x92'),_0x9bd75e[_0x8a8a('0x83')]);}}return _0x69e16[_0x8a8a('0x8f')](_0x58ac24);}})['catch'](handleError(_0x69e16,null));};exports['getCustomerAvatar']=function(_0x83f17d,_0x4d9d70){var _0x46aff7=path['join'](config[_0x8a8a('0x90')],'server/files/images/avatars/customer_avatar.png');var _0x4caec3={'where':{'id':_0x83f17d['params']['id']},'attributes':['id','customerAvatar',_0x8a8a('0x93')],'raw':!![]};return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x4caec3)['then'](handleEntityNotFound(_0x4d9d70,null))[_0x8a8a('0x1c')](function(_0x16b941){if(_0x16b941){if(!_[_0x8a8a('0x8e')](_0x16b941[_0x8a8a('0x86')])){if(fs[_0x8a8a('0x94')](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x16b941['customerAvatar']))&&_0x16b941[_0x8a8a('0x93')]){_0x46aff7=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x16b941[_0x8a8a('0x86')]);}}return _0x4d9d70[_0x8a8a('0x8f')](_0x46aff7);}})[_0x8a8a('0x25')](handleError(_0x4d9d70,null));};exports[_0x8a8a('0x95')]=function(_0x5130d3,_0x5023d7){var _0x45647=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x96'));var _0x3a30c6={'where':{'id':_0x5130d3[_0x8a8a('0x61')]['id']},'attributes':['id',_0x8a8a('0x87')],'raw':!![]};return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x3a30c6)[_0x8a8a('0x1c')](handleEntityNotFound(_0x5023d7,null))[_0x8a8a('0x1c')](function(_0x5376b6){if(_0x5376b6){if(!_[_0x8a8a('0x8e')](_0x5376b6[_0x8a8a('0x87')])){if(fs[_0x8a8a('0x94')](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x92'),_0x5376b6[_0x8a8a('0x87')]))){_0x45647=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x92'),_0x5376b6[_0x8a8a('0x87')]);}}return _0x5023d7['download'](_0x45647);}})[_0x8a8a('0x25')](handleError(_0x5023d7,null));};function checkWebsiteInterval(_0x211dfc){var _0x2d7ed6=_0x211dfc[_0x8a8a('0x97')];if(!_0x2d7ed6){return Promise['resolve'](_0x211dfc);}var _0x44561a=_0x211dfc[_0x8a8a('0x98')]||undefined;return _0x2d7ed6[_0x8a8a('0x99')](_0x44561a)[_0x8a8a('0x1c')](function(_0x474e27){if(!_0x474e27){throw new APIOutOfIntervalError();}return _0x211dfc;});}exports[_0x8a8a('0x9a')]=function(_0x59ed64,_0x33667d){var _0x3c2e96={'body':_0x59ed64[_0x8a8a('0x65')],'channel':_0x8a8a('0x9b')};var _0x35bb17=[];var _0x17e607=[];var _0x184310={};var _0xfa3640=![];if(_0x59ed64['body']['id']){delete _0x59ed64[_0x8a8a('0x65')]['id'];}if(_[_0x8a8a('0x8e')](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')])){throw new APIBadRequestError(_0x8a8a('0x9d'));}if(_[_0x8a8a('0x8e')](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9e')])){throw new APIBadRequestError(_0x8a8a('0x9f'));}if(_['isEmpty'](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x65')])){throw new APIBadRequestError(_0x8a8a('0xa0'));}var _0x1f54d4=_0x59ed64[_0x8a8a('0x65')]['customerIp']&&_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x3e')];return db[_0x8a8a('0xa1')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](function(_0x55e474){if(!_0x55e474){throw new Error('No\x20available\x20attributes');}_0x35bb17=Object['keys'](_0x55e474)[_0x8a8a('0x5a')](function(_0x3074a2){return![_0x8a8a('0xa2'),_0x8a8a('0xa3')][_0x8a8a('0xa4')](_0x3074a2);});_0x17e607=Object[_0x8a8a('0x51')](_0x55e474)['filter'](function(_0x1c7c8a){return![_0x8a8a('0xa2'),_0x8a8a('0xa3'),'CompanyId',_0x8a8a('0xa5')][_0x8a8a('0xa4')](_0x1c7c8a);});if(!_[_0x8a8a('0xa4')](_0x17e607,_0x59ed64['body'][_0x8a8a('0x9e')])){throw new APIBadRequestError(_0x8a8a('0xa6')+_0x17e607['join'](',\x20'));}_0x184310[_0x59ed64['body'][_0x8a8a('0x9e')]]=_0x59ed64['body']['from'];})['then'](function(){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x59ed64[_0x8a8a('0x61')]['id']},'include':[{'model':db[_0x8a8a('0xa7')],'as':'List','include':[{'model':db[_0x8a8a('0xa1')],'as':'Contacts','where':_0x184310,'limit':0x1,'order':[[_0x8a8a('0xa3'),_0x8a8a('0xa8')]]}]},{'model':db['ChatApplication'],'as':_0x8a8a('0xa9')},{'model':db[_0x8a8a('0x97')],'as':'Interval','include':[{'model':db[_0x8a8a('0x97')],'as':_0x8a8a('0xaa'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x8a8a('0x1c')](function(_0x1dc93c){if(!_0x1dc93c){throw new APINotFoundError(util[_0x8a8a('0xab')](_0x8a8a('0xac'),_0x59ed64[_0x8a8a('0x61')]['id']));}if(_0x1f54d4){return checkWebsiteInterval(_0x1dc93c);}return _0x1dc93c;})['then'](function(_0x5ab5e1){_0x3c2e96[_0x8a8a('0xad')]=_0x5ab5e1;_0x3c2e96[_0x8a8a('0xae')]=_['orderBy'](_0x5ab5e1[_0x8a8a('0xa9')],[_0x8a8a('0xaf')],[_0x8a8a('0xb0')]);if(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xa9')]){delete _0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xa9')];}_0x3c2e96[_0x8a8a('0xb1')]=_0x5ab5e1[_0x8a8a('0xb2')]||{'id':_0x5ab5e1[_0x8a8a('0xa5')]};if(_0x3c2e96[_0x8a8a('0xb1')]&&_0x3c2e96[_0x8a8a('0xb1')][_0x8a8a('0xb3')]['length']){return _0x3c2e96[_0x8a8a('0xb1')][_0x8a8a('0xb3')][0x0];}var _0x3d4dee=_['defaults'](_0x59ed64[_0x8a8a('0x65')],{'firstName':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')],'ListId':_0x5ab5e1[_0x8a8a('0xa5')]});_0x3d4dee[_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9e')]]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')];return db[_0x8a8a('0xa1')][_0x8a8a('0x64')](_0x3d4dee,{'fields':_0x35bb17,'raw':!![]});})[_0x8a8a('0x1c')](function(_0x5c9358){_0x3c2e96[_0x8a8a('0xb4')]=_0x5c9358;var _0x35d518=createInteractionObject(_0x59ed64[_0x8a8a('0x61')]['id'],_0x59ed64[_0x8a8a('0x65')],_0x59ed64[_0x8a8a('0xb5')],_0x5c9358);var _0x3f0724={'ChatWebsiteId':_0x59ed64[_0x8a8a('0x61')]['id']};if(_0x59ed64['body'][_0x8a8a('0xb6')]){_0x3f0724[_0x8a8a('0xb6')]=_0x59ed64['body'][_0x8a8a('0xb6')];_0x3f0724['closed']=![];return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':_0x3f0724})['then'](function(_0x2d8647){var _0x32ba47=_0x59ed64['body'][_0x8a8a('0xb8')]&&_0x59ed64[_0x8a8a('0x65')]['referer'];if(_0x2d8647){_0xfa3640=!![];return _0x2d8647;}else if(!_0x32ba47&&_0x2d8647&&_0x2d8647[_0x8a8a('0xb9')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x35d518[_0x8a8a('0xb6')]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb6')];_0x35d518['externalUrl']=_0x59ed64['body'][_0x8a8a('0xba')];return db['ChatInteraction'][_0x8a8a('0x64')](_0x35d518);});}_0x3f0724['ContactId']=_0x5c9358['id'];if(_0x59ed64['body'][_0x8a8a('0xbb')]&&_0x59ed64['body']['interaction']['id']){_0x3f0724['id']=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbb')]['id'];return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':_0x3f0724})[_0x8a8a('0x1c')](function(_0x4cb1da){var _0x3d757a=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb8')]&&_0x59ed64['body'][_0x8a8a('0x3e')];if(!_0x3d757a&&_0x4cb1da&&_0x4cb1da['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x4cb1da){_0xfa3640=!![];return _0x4cb1da;}else{return db['ChatInteraction'][_0x8a8a('0x64')](_0x35d518);}});}return db['ChatInteraction']['create'](_0x35d518);})['then'](function(_0x203b2d){if(!_0xfa3640){return _0x203b2d;}var _0x159c37={'from':(_0x3c2e96[_0x8a8a('0xb4')][_0x8a8a('0x3c')]||'')+'\x20'+(_0x3c2e96['contact'][_0x8a8a('0xbc')]||'')};if(_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb6')]&&_0x59ed64['body'][_0x8a8a('0xbd')]&&_0x59ed64['body']['threadId']!=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbd')]){_0x159c37[_0x8a8a('0xb6')]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbd')];}return _0x203b2d['update'](_0x159c37);})[_0x8a8a('0x1c')](function(_0x33e008){_0x3c2e96[_0x8a8a('0xbb')]=_0x33e008[_0x8a8a('0x6b')]({'plain':!![]});_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xbe')]=!_0xfa3640;if(_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xbe')]){if(_0x3c2e96[_0x8a8a('0xad')]['autoclose']){_0x3c2e96[_0x8a8a('0xae')]['push']({'id':0x0,'priority':_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0x62')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8a8a('0xbf')});}}return db[_0x8a8a('0xc0')][_0x8a8a('0x64')]({'body':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x65')],'ChatWebsiteId':_0x59ed64[_0x8a8a('0x61')]['id'],'ChatInteractionId':_0x33e008['id'],'direction':'in','ContactId':_0x3c2e96[_0x8a8a('0xb4')]['id'],'AttachmentId':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xc1')]});})[_0x8a8a('0x1c')](function(_0x3e4b43){_0x3c2e96[_0x8a8a('0x23')]=_0x3e4b43;if(!_0x3c2e96[_0x8a8a('0xbb')]['UserId']){return;}return db[_0x8a8a('0xc2')][_0x8a8a('0x63')]({'attributes':['id',_0x8a8a('0x34')],'where':{'id':_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc3')]}});})[_0x8a8a('0x1c')](function(_0x5a7fcd){if(_0x5a7fcd){_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0xc4')]({'id':0x0,'priority':0x0,'app':_0x8a8a('0xc5'),'appdata':_0x5a7fcd[_0x8a8a('0x34')]+','+(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xc6')]||0xa),'interval':_0x8a8a('0xbf')});_0x3c2e96[_0x8a8a('0xc7')]=!![];}if(!_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc8')]){return;}return db[_0x8a8a('0xc9')][_0x8a8a('0x63')]({'attributes':['id',_0x8a8a('0x34')],'where':{'id':_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc8')]}});})[_0x8a8a('0x1c')](function(_0x433051){if(_0x433051){_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0xc4')]({'id':0x0,'priority':0x1,'app':_0x8a8a('0xca'),'appdata':_0x433051[_0x8a8a('0x34')]+','+(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xcb')]||0x12c),'interval':_0x8a8a('0xbf')});}return respondWithRpcPromise('Start','startRouting',_0x3c2e96);})[_0x8a8a('0x1c')](function(_0x55d97e){respondWithRpcPromise(_0x8a8a('0xcc'),_0x8a8a('0xcc'),{'event':_0x8a8a('0x9a'),'message':_0x55d97e},client9002);return _0x55d97e;})[_0x8a8a('0x1c')](respondWithResult(_0x33667d,null))['catch'](APIHandleError(_0x33667d));};exports[_0x8a8a('0xcd')]=function(_0x1cad71,_0x2ae822){var _0xb988c3,_0x36e8c6,_0x204dde;var _0x155a64=[];var _0x21504d={};var _0x123c98=_0x1cad71[_0x8a8a('0xce')]||[];var _0x2c82d4=[];var _0x4bf38e;return db[_0x8a8a('0xa1')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](function(_0xb2fc5b){if(!_0xb2fc5b){throw new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd1'));}_0x155a64=_[_0x8a8a('0xd2')](_[_0x8a8a('0x51')](_0xb2fc5b),[_0x8a8a('0xa2'),_0x8a8a('0xa3'),'CompanyId',_0x8a8a('0xa5')]);if(_0x1cad71[_0x8a8a('0x65')]['id']){delete _0x1cad71[_0x8a8a('0x65')]['id'];}if(_[_0x8a8a('0x8e')](_0x1cad71[_0x8a8a('0x65')]['from'])){throw _0x2ae822['status'](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd4')));}if(_[_0x8a8a('0x8e')](_0x1cad71['body'][_0x8a8a('0x65')])||_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x65')]===''){throw _0x2ae822[_0x8a8a('0x26')](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8a8a('0x8e')](_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')])){throw _0x2ae822[_0x8a8a('0x26')](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd6')+_0x155a64));}if(!_[_0x8a8a('0xa4')](_0x155a64,_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')])){throw _0x2ae822['status'](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd7')+_0x155a64));}_0x21504d[_0x1cad71[_0x8a8a('0x65')]['mapKeyOffline']]=_0x1cad71['body'][_0x8a8a('0x9c')];})[_0x8a8a('0x1c')](function(){return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x1cad71[_0x8a8a('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x8a8a('0xb2')},{'model':db[_0x8a8a('0xd8')],'as':_0x8a8a('0xd8')}]});})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2ae822,null))['then'](function(_0x2f68b3){if(_0x2f68b3&&_0x2f68b3[_0x8a8a('0xb2')]){_0x36e8c6=_0x2f68b3;var _0x2e583f=_[_0x8a8a('0x15')](_0x1cad71['body'],{'firstName':_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x9c')],'phone':_0x1cad71['body'][_0x8a8a('0x9c')],'ListId':_0x2f68b3[_0x8a8a('0xa5')]});_0x2e583f[_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')]]=_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x9c')];return db[_0x8a8a('0xa1')][_0x8a8a('0xd9')]({'where':_0x21504d,'defaults':_0x2e583f});}})[_0x8a8a('0xda')](function(_0x30ee47){if(_0x30ee47){_0x204dde=_0x30ee47;var _0xd1803f=fs[_0x8a8a('0xdb')](path['join'](config[_0x8a8a('0x90')],'server/files/templates/chatOfflineMessage.ejs'),_0x8a8a('0xdc'));var _0x4b334b=ejs[_0x8a8a('0xdd')](_0xd1803f,{'body':_[_0x8a8a('0xde')](_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x65')]),'bodyTitle':_0x36e8c6['offlineMessageBody']});return db[_0x8a8a('0xdf')]['create']({'body':_0x4b334b,'plainBody':htmlToText[_0x8a8a('0xe0')](_0x4b334b),'ContactId':_0x30ee47['id'],'ChatWebsiteId':_0x36e8c6['id']});}})[_0x8a8a('0x1c')](function(_0x3c292a){_0x4bf38e=_0x3c292a;if(_0x123c98[_0x8a8a('0x62')]){var _0x327020=_0x123c98[_0x8a8a('0x4b')](function(_0x1edb12){return{'name':_0x1edb12[_0x8a8a('0xe1')],'basename':_0x1edb12['filename'],'type':_0x1edb12['mimetype'],'ChatOfflineMessageId':_0x3c292a['id']};});_0x2c82d4=_0x327020[_0x8a8a('0x4b')](_0x268a78=>{var _0xb02292={'filename':_0x268a78[_0x8a8a('0x34')],'path':path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0xe2'),_0x8a8a('0xce'),_0x8a8a('0xe3'),_0x8a8a('0xe4'),_0x268a78['basename'])};return _0xb02292;});if(!_0x36e8c6['openNewInteraction']){return db[_0x8a8a('0xe5')][_0x8a8a('0xe6')](function(_0x4bffba){return db[_0x8a8a('0xe7')][_0x8a8a('0xe8')](_0x327020,{'transaction':_0x4bffba});});}}})[_0x8a8a('0x1c')](function(){if(_0x4bf38e){_0xb988c3=_0x4bf38e;return db['MailAccount'][_0x8a8a('0x7c')]({'where':{'service':!![]},'include':[{'model':db[_0x8a8a('0xe9')],'as':_0x8a8a('0xea'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x8a8a('0x1c')](function(_0x25d338){if(_0x25d338&&_0x25d338[_0x8a8a('0xea')]&&_0x36e8c6[_0x8a8a('0xeb')]&&_0x36e8c6[_0x8a8a('0xec')]){var _0x327f00=_0x25d338[_0x8a8a('0xed')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x327f00,'message':{'from':util[_0x8a8a('0xab')](_0x8a8a('0xee'),_0x25d338['name'],_0x25d338[_0x8a8a('0xef')]||_0x25d338['Smtp']['user']),'to':_0x36e8c6['forwardOfflineAddress'],'subject':_0x36e8c6[_0x8a8a('0xf0')],'html':_0xb988c3[_0x8a8a('0x65')],'attachments':_0x2c82d4}},client9003)[_0x8a8a('0x1c')](function(){return _0xb988c3;})[_0x8a8a('0x25')](function(_0xcfd82f){logger[_0x8a8a('0x22')](_0xcfd82f);});}})['then'](function(){if(_0x36e8c6&&_0x36e8c6['openNewInteraction']&&_0x36e8c6['MailAccountId']){var _0x192040=[];if(_0x123c98[_0x8a8a('0x62')]){_0x192040=_0x123c98[_0x8a8a('0x4b')](function(_0x5843c8){return{'name':_0x5843c8['originalname'],'basename':_0x5843c8['filename'],'type':_0x5843c8[_0x8a8a('0xf1')],'ChatOfflineMessageId':_0x4bf38e['id']};});}var _0x5168b5;if(!_[_0x8a8a('0x8e')](_0x36e8c6[_0x8a8a('0xf2')])){var _0x51c6f8=_[_0x8a8a('0x4b')](_0x1cad71['body'],function(_0x51744a){return _0x51744a;});var _0x19c612=_[_0x8a8a('0xf3')](_0x51c6f8)[0x0];var _0x220434=_['mapValues'](_0x19c612,function(_0x29e6d0){return _0x29e6d0;});_0x5168b5=_0x220434[0x1][_0x36e8c6[_0x8a8a('0xf2')]];}var _0x517c95={'from':_0x204dde[_0x8a8a('0xef')],'firstName':_0x204dde[_0x8a8a('0x3c')],'lastName':_0x204dde[_0x8a8a('0xbc')],'mapKey':_0x8a8a('0xef'),'message':{'from':_0x204dde[_0x8a8a('0xef')],'to':_0x36e8c6[_0x8a8a('0xd8')]['email'],'cc':'','subject':_[_0x8a8a('0x8e')](_0x5168b5)?_0x36e8c6[_0x8a8a('0xf0')]:_0x5168b5,'messageId':'','sentAt':new Date(),'attach':_0x192040[_0x8a8a('0x62')],'attachments':_0x192040,'originChannel':_0x8a8a('0xf4'),'ChatWebsiteId':_0x36e8c6['id'],'ChatOfflineMessageId':_0xb988c3['id'],'originTo':_0x36e8c6[_0x8a8a('0xd8')]['email']},'body':_0xb988c3[_0x8a8a('0x65')]};var _0x55737e={'account':{'id':_0x36e8c6[_0x8a8a('0xf5')]},'body':_0x517c95,'log':_0x8a8a('0xf6')};return respondWithRpcPromise(_0x8a8a('0xf6'),_0x8a8a('0xf7'),_0x55737e,client9001)[_0x8a8a('0x1c')](function(){return _0xb988c3;})[_0x8a8a('0x25')](function(_0x540e6e){logger['error'](_0x540e6e);});}return;})[_0x8a8a('0x1c')](function(){if(_0xb988c3){return _0xb988c3;}})[_0x8a8a('0x1c')](respondWithResult(_0x2ae822,null))[_0x8a8a('0x25')](function(){for(var _0x20f945 of _0x123c98){var _0x1baed2=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0xe2'),_0x8a8a('0xce'),_0x8a8a('0xe3'),_0x8a8a('0xe4'),_0x20f945[_0x8a8a('0x84')]);fs_extra['remove'](_0x1baed2)[_0x8a8a('0x25')](function(_0x4f31a2){logger[_0x8a8a('0x22')](_0x8a8a('0xf8'),_0x1baed2,_0x4f31a2);});}});};exports[_0x8a8a('0xf9')]=function(_0x203707,_0x3cdc0a){return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':{'id':_0x203707['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3cdc0a,null))['then'](function(_0x1e3017){if(_0x1e3017){return _0x1e3017['addInteraction'](_0x203707[_0x8a8a('0x65')][_0x8a8a('0x79')],_[_0x8a8a('0xfa')](_0x203707[_0x8a8a('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x3cdc0a,null))[_0x8a8a('0x25')](handleError(_0x3cdc0a,null));};exports[_0x8a8a('0xfb')]=function(_0x4dd128,_0x15b30c){var _0x59022b={'raw':![],'where':{}};var _0x577662={};var _0x24f65a={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x4dd128['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x15b30c,null))[_0x8a8a('0x1c')](function(_0x2e34e6){if(_0x2e34e6){_0x577662['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0xb7')]['rawAttributes']);_0x577662['query']=_[_0x8a8a('0x51')](_0x4dd128[_0x8a8a('0x50')]);_0x577662[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x577662[_0x8a8a('0x44')],_0x577662['query']);_0x59022b[_0x8a8a('0x54')]=_['intersection'](_0x577662['model'],qs[_0x8a8a('0x55')](_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x59022b[_0x8a8a('0x54')]=_0x59022b[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x59022b['attributes']:_0x577662[_0x8a8a('0x44')];if(!_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x59022b[_0x8a8a('0x2a')]=qs['limit'](_0x4dd128[_0x8a8a('0x50')]['limit']);_0x59022b[_0x8a8a('0x2c')]=qs['offset'](_0x4dd128['query'][_0x8a8a('0x2c')]);}_0x59022b[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x4dd128['query'][_0x8a8a('0x76')]);_0x59022b['where']=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x4dd128[_0x8a8a('0x50')],_0x577662[_0x8a8a('0x52')]));_0x59022b[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x2e34e6['id'];if(_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x59022b[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x59022b[_0x8a8a('0x58')],{'$or':_['map'](_0x59022b['attributes'],function(_0x2d23ae){var _0x1d3559={};_0x1d3559[_0x2d23ae]={'$like':'%'+_0x4dd128[_0x8a8a('0x50')]['filter']+'%'};return _0x1d3559;})});}_0x59022b=_['merge']({},_0x59022b,_0x4dd128[_0x8a8a('0x5d')]);return db[_0x8a8a('0xb7')]['count']({'where':_0x59022b['where']})[_0x8a8a('0x1c')](function(_0xb08e40){_0x24f65a['count']=_0xb08e40;if(_0x4dd128['query'][_0x8a8a('0x5e')]){_0x59022b['include']=[{'model':db[_0x8a8a('0xa1')],'as':'Contact','required':![]},{'model':db[_0x8a8a('0xc2')],'as':'Owner','attributes':['name','fullname',_0x8a8a('0xfc')],'required':![]},{'model':db['Tag'],'as':_0x8a8a('0xfd'),'attributes':['id',_0x8a8a('0x34'),_0x8a8a('0xfe')],'where':_0x4dd128['query']['tag']?{'id':_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0xff')]}:undefined,'required':_0x4dd128[_0x8a8a('0x50')]['tag']?!![]:![]}];}return db[_0x8a8a('0xb7')][_0x8a8a('0x7d')](_0x59022b);})[_0x8a8a('0x1c')](function(_0x5e4abc){_0x24f65a['rows']=_0x5e4abc;return _0x24f65a;});}})['then'](respondWithFilteredResult(_0x15b30c,_0x59022b))['catch'](handleError(_0x15b30c,null));};exports[_0x8a8a('0x100')]=function(_0x3488b4,_0x3fd5b2){var _0x6120b4=0x0;var _0x255a29=0x0;var _0x3723d9=![];var _0x82197;var _0x5e11da;return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3488b4[_0x8a8a('0x61')]['id']},'include':[{'model':db['Interval'],'as':_0x8a8a('0x97'),'include':[{'model':db[_0x8a8a('0x97')],'as':_0x8a8a('0xaa'),'attributes':['id','interval']}]}]})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3fd5b2,null))[_0x8a8a('0x1c')](function(_0x10e059){if(_0x10e059){_0x82197=_0x10e059;return _0x10e059[_0x8a8a('0x101')]({'raw':!![]});}})[_0x8a8a('0x1c')](function(_0x142a8c){if(_0x82197){if(_0x142a8c){_0x5e11da=_0x142a8c;}}return require('../../config/license/util')[_0x8a8a('0x8c')]();})[_0x8a8a('0x1c')](function(_0x3a0fd0){if(_0x3a0fd0){_0x255a29=_0x3a0fd0[_0x8a8a('0x102')];_0x3723d9=_0x3a0fd0[_0x8a8a('0x8d')];}})[_0x8a8a('0x1c')](function(){return db[_0x8a8a('0xb7')][_0x8a8a('0x2b')]({'where':{'closed':![]}});})[_0x8a8a('0x1c')](function(_0x234485){_0x6120b4=_0x234485;if(_0x255a29&&_0x234485>_0x255a29){return db[_0x8a8a('0x103')][_0x8a8a('0x7c')]({'where':{'id':0x1}})[_0x8a8a('0x1c')](function(_0x874574){if(_0x874574){_0x874574[_0x8a8a('0x104')](_0x8a8a('0x105'));}});}})[_0x8a8a('0x1c')](function(){var _0x1f882e=_0x82197[_0x8a8a('0x97')];var _0x270117=_0x82197[_0x8a8a('0x98')]||undefined;return _0x1f882e?_0x1f882e[_0x8a8a('0x99')](_0x270117):!![];})[_0x8a8a('0x1c')](function(_0x25d8ea){var _0x5ce17f=fs['readFileSync'](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x106')),_0x8a8a('0xdc'));var _0x4da155=_0x8a8a('0x107');var _0x3265d7=![];var _0x546652,_0x332c4c;if(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x3e')]){_0x546652=new URL(_0x3488b4[_0x8a8a('0xb5')]['referer'])[_0x8a8a('0x108')];}else if(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x108')]){_0x546652=new URL(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x108')])[_0x8a8a('0x108')];}else{_0x546652=_0x8a8a('0x109');}_0x332c4c=typeof _0x82197[_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x63')](function(_0x268030){return wildcardUtils['testWebsiteWithWildcard'](_0x268030,_0x546652);})!==_0x8a8a('0x29');var _0x3c07fa={'chatVersion':_0x4da155,'chatWebsiteAddressOrigin':_0x332c4c?_0x546652:_0x82197[_0x8a8a('0x66')],'remote':_0x82197['remote'],'query':querystring[_0x8a8a('0x48')](_[_0x8a8a('0x5b')](_0x82197[_0x8a8a('0x6b')]({'plain':!![]}),{'customerIp':_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x39')]||_0x3488b4['headers'][_0x8a8a('0x10a')]||_0x3488b4['connection'][_0x8a8a('0x10b')]||_0x3488b4['ip'],'referer':_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x3e')],'openedInteractions':_0x6120b4,'maxInteractions':_0x255a29,'virtual':_0x3723d9[_0x8a8a('0x102')],'online':_0x25d8ea,'custom':_0x3723d9,'address':_0x332c4c?_0x546652:null}))[_0x8a8a('0x10c')](/'/g,'\x5c\x27')};_0x3fd5b2[_0x8a8a('0xd3')](ejs[_0x8a8a('0xdd')](Mustache[_0x8a8a('0xdd')](_0x5ce17f,_0x3c07fa),{'proactiveActions':_0x5e11da,'alignment':_0x82197[_0x8a8a('0x10d')],'verticalAlignment':_0x82197[_0x8a8a('0x10e')],'div_color':_0x82197[_0x8a8a('0xfe')],'labelText':_0x82197[_0x8a8a('0x10f')],'text_color':_0x82197[_0x8a8a('0x110')],'text_button_color':_0x82197['textButtonColor'],'button_color':_0x82197[_0x8a8a('0x111')],'background_color':_0x82197[_0x8a8a('0x112')],'hideWhenOffline':_0x82197[_0x8a8a('0x113')],'intervalId':_0x82197['IntervalId'],'isDevelopment':_0x3265d7,'chatVersion':_0x4da155}));})[_0x8a8a('0x25')](handleError(_0x3fd5b2,null));};exports[_0x8a8a('0x114')]=function(_0x3c3829,_0x38f151){var _0x500151=_0x3c3829['params']['id'];var _0x13e934=_0x3c3829[_0x8a8a('0x65')];var _0x578863=0xc8;var _0x321588=null;return db[_0x8a8a('0xe5')][_0x8a8a('0xe6')]({'isolationLevel':db[_0x8a8a('0xe5')]['Transaction'][_0x8a8a('0x115')][_0x8a8a('0x116')]},function(_0x377fb){return db['ChatWebsite'][_0x8a8a('0x7c')]({'where':{'id':_0x500151},'transaction':_0x377fb})['then'](function(_0x3415f2){if(_0x3415f2){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x500151},'transaction':_0x377fb})[_0x8a8a('0x1c')](function(){var _0x487ac2=_[_0x8a8a('0x4b')](_0x13e934,function(_0x300627){_0x300627[_0x8a8a('0x73')]=_0x500151;return _0x300627;});return db[_0x8a8a('0x117')][_0x8a8a('0xe8')](_0x487ac2,{'transaction':_0x377fb});});}else{_0x578863=0x194;_0x321588=[];}});})['then'](function(){if(_0x578863!==0x194){return db[_0x8a8a('0x117')][_0x8a8a('0x118')]({'where':{'ChatWebsiteId':_0x500151},'order':_0x8a8a('0xaf')})[_0x8a8a('0x1c')](function(_0x2b3f58){_0x321588=_0x2b3f58;});}})[_0x8a8a('0x25')](function(_0x5bcf5e){_0x578863=0x1f4;logger[_0x8a8a('0x22')](_0x5bcf5e[_0x8a8a('0x33')]);if(_0x5bcf5e[_0x8a8a('0x34')]){delete _0x5bcf5e[_0x8a8a('0x34')];}_0x321588=_0x5bcf5e;})[_0x8a8a('0x119')](function(){if(_0x321588===null){_0x38f151[_0x8a8a('0x32')](_0x578863);}else{if(_0x578863===0x1f4){_0x38f151[_0x8a8a('0x26')](_0x578863)[_0x8a8a('0xd3')](_0x321588);}else{_0x38f151[_0x8a8a('0x26')](_0x578863)[_0x8a8a('0x28')](_0x321588);}}});};exports[_0x8a8a('0x11a')]=function(_0x515e99,_0x49f317){var _0x4e4a02={};var _0x2cb19e={};var _0x2e97f5;var _0x1c0953;return db['ChatWebsite']['findOne']({'where':{'id':_0x515e99[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x49f317,null))['then'](function(_0x4f6f49){if(_0x4f6f49){_0x2e97f5=_0x4f6f49;_0x2cb19e[_0x8a8a('0x44')]=_['keys'](db[_0x8a8a('0x117')][_0x8a8a('0x4d')]);_0x2cb19e[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x515e99['query']);_0x2cb19e[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x2cb19e['model'],_0x2cb19e['query']);_0x4e4a02[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x2cb19e[_0x8a8a('0x44')],qs['fields'](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x4e4a02[_0x8a8a('0x54')]=_0x4e4a02[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x4e4a02[_0x8a8a('0x54')]:_0x2cb19e[_0x8a8a('0x44')];_0x4e4a02[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x4e4a02['where']=qs[_0x8a8a('0x52')](_['pick'](_0x515e99[_0x8a8a('0x50')],_0x2cb19e['filters']));if(_0x515e99['query'][_0x8a8a('0x5a')]){_0x4e4a02['where']=_['merge'](_0x4e4a02['where'],{'$or':_['map'](_0x4e4a02[_0x8a8a('0x54')],function(_0x3a1604){var _0x3e87d3={};_0x3e87d3[_0x3a1604]={'$like':'%'+_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0x3e87d3;})});}_0x4e4a02=_[_0x8a8a('0x5b')]({},_0x4e4a02,_0x515e99[_0x8a8a('0x5d')]);return _0x2e97f5[_0x8a8a('0x11a')](_0x4e4a02);}})[_0x8a8a('0x1c')](function(_0x9f342e){if(_0x9f342e){_0x1c0953=_0x9f342e[_0x8a8a('0x62')];if(!_0x515e99['query'][_0x8a8a('0x56')]('nolimit')){_0x4e4a02[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x4e4a02[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}return _0x2e97f5[_0x8a8a('0x11a')](_0x4e4a02);}})[_0x8a8a('0x1c')](function(_0x13fb20){if(_0x13fb20){return _0x13fb20?{'count':_0x1c0953,'rows':_0x13fb20}:null;}})['then'](respondWithResult(_0x49f317,null))['catch'](handleError(_0x49f317,null));};exports['addProactiveActions']=function(_0xda869f,_0x55931b){return db[_0x8a8a('0x11b')][_0x8a8a('0x63')]({'where':{'id':_0xda869f[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x55931b,null))[_0x8a8a('0x1c')](function(_0x591976){if(_0x591976){return _0x591976[_0x8a8a('0x11c')](_0xda869f['body'][_0x8a8a('0x79')],_['omit'](_0xda869f[_0x8a8a('0x65')],[_0x8a8a('0x79'),'id'])||{});}})[_0x8a8a('0x1c')](respondWithResult(_0x55931b,null))[_0x8a8a('0x25')](handleError(_0x55931b,null));};exports[_0x8a8a('0x101')]=function(_0x43bfeb,_0x2406f1){var _0x511fac={};var _0x3bef44={};var _0x5b4ca0;var _0x4cff06;return db['ChatWebsite']['findOne']({'where':{'id':_0x43bfeb['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2406f1,null))[_0x8a8a('0x1c')](function(_0x374b3f){if(_0x374b3f){_0x5b4ca0=_0x374b3f;_0x3bef44[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db[_0x8a8a('0x11d')][_0x8a8a('0x4d')]);_0x3bef44['query']=_['keys'](_0x43bfeb['query']);_0x3bef44[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x3bef44[_0x8a8a('0x44')],_0x3bef44[_0x8a8a('0x50')]);_0x511fac[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x3bef44['model'],qs[_0x8a8a('0x55')](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x511fac['attributes']=_0x511fac[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x511fac[_0x8a8a('0x54')]:_0x3bef44['model'];_0x511fac[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x511fac[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x43bfeb[_0x8a8a('0x50')],_0x3bef44['filters']));if(_0x43bfeb['query'][_0x8a8a('0x5a')]){_0x511fac['where']=_['merge'](_0x511fac['where'],{'$or':_['map'](_0x511fac['attributes'],function(_0x5d28bb){var _0x55b0c2={};_0x55b0c2[_0x5d28bb]={'$like':'%'+_0x43bfeb[_0x8a8a('0x50')]['filter']+'%'};return _0x55b0c2;})});}_0x511fac=_[_0x8a8a('0x5b')]({},_0x511fac,_0x43bfeb[_0x8a8a('0x5d')]);return _0x5b4ca0[_0x8a8a('0x101')](_0x511fac);}})['then'](function(_0x433bd5){if(_0x433bd5){_0x4cff06=_0x433bd5[_0x8a8a('0x62')];if(!_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x56')]('nolimit')){_0x511fac['limit']=qs[_0x8a8a('0x2a')](_0x43bfeb[_0x8a8a('0x50')]['limit']);_0x511fac[_0x8a8a('0x2c')]=qs['offset'](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}return _0x5b4ca0['getProactiveActions'](_0x511fac);}})[_0x8a8a('0x1c')](function(_0x51c902){if(_0x51c902){return _0x51c902?{'count':_0x4cff06,'rows':_0x51c902}:null;}})[_0x8a8a('0x1c')](respondWithResult(_0x2406f1,null))[_0x8a8a('0x25')](handleError(_0x2406f1,null));};exports[_0x8a8a('0x11e')]=function(_0x269483,_0x3f9d81){var _0x565d4f=_0x269483[_0x8a8a('0x50')][_0x8a8a('0x11f')]===_0x8a8a('0x120')?_0x8a8a('0x121'):_0x8a8a('0x122');return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'attributes':['id',_0x565d4f],'where':{'id':_0x269483[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3f9d81,null))['then'](function(_0x2810fc){if(_0x2810fc){var _0x3e8ddf=_0x2810fc[_0x565d4f];var _0x2eddb9=_0x3e8ddf&&_0x3e8ddf[_0x8a8a('0x123')]?_0x3e8ddf[_0x8a8a('0x123')]:[];_0x3f9d81[_0x8a8a('0xd3')]({'fromKey':_['isNil'](_0x3e8ddf[_0x8a8a('0x124')])?undefined:_0x3e8ddf[_0x8a8a('0x124')],'count':_0x2eddb9['length'],'rows':_0x2eddb9});}})[_0x8a8a('0x25')](handleError(_0x3f9d81,null));};exports[_0x8a8a('0x125')]=function(_0x2f5102,_0x51dc09){var _0x48676a={'raw':![],'where':{}};var _0x586205={};var _0x462121={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x2f5102['params']['id']}})['then'](handleEntityNotFound(_0x51dc09,null))[_0x8a8a('0x1c')](function(_0x1b021a){if(_0x1b021a){_0x586205['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0xdf')][_0x8a8a('0x4d')]);_0x586205[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x2f5102['query']);_0x586205['filters']=_['intersection'](_0x586205[_0x8a8a('0x44')],_0x586205['query']);_0x48676a[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x586205[_0x8a8a('0x44')],qs[_0x8a8a('0x55')](_0x2f5102[_0x8a8a('0x50')]['fields']));_0x48676a[_0x8a8a('0x54')]=_0x48676a[_0x8a8a('0x54')]['length']?_0x48676a[_0x8a8a('0x54')]:_0x586205[_0x8a8a('0x44')];if(!_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x48676a[_0x8a8a('0x2a')]=qs['limit'](_0x2f5102['query'][_0x8a8a('0x2a')]);_0x48676a[_0x8a8a('0x2c')]=qs['offset'](_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x48676a[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x48676a[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_['pick'](_0x2f5102['query'],_0x586205['filters']));_0x48676a[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x1b021a['id'];if(_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x48676a[_0x8a8a('0x58')]=_['merge'](_0x48676a[_0x8a8a('0x58')],{'$or':_[_0x8a8a('0x4b')](_0x48676a['attributes'],function(_0x43af89){var _0xc8998e={};_0xc8998e[_0x43af89]={'$like':'%'+_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0xc8998e;})});}_0x48676a=_[_0x8a8a('0x5b')]({},_0x48676a,_0x2f5102['options']);return db[_0x8a8a('0xdf')][_0x8a8a('0x2b')]({'where':_0x48676a[_0x8a8a('0x58')]})[_0x8a8a('0x1c')](function(_0x48901b){_0x462121[_0x8a8a('0x2b')]=_0x48901b;if(_0x2f5102['query'][_0x8a8a('0x5e')]){_0x48676a[_0x8a8a('0x77')]=[{'all':!![]}];}else{_0x48676a[_0x8a8a('0x77')]=[{'model':db[_0x8a8a('0xa1')],'as':_0x8a8a('0x126'),'required':![]},{'model':db['Attachment'],'as':_0x8a8a('0x127'),'required':![]}];}return db['ChatOfflineMessage'][_0x8a8a('0x7d')](_0x48676a);})['then'](function(_0x4b44b9){_0x462121[_0x8a8a('0x5f')]=_0x4b44b9;return _0x462121;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x51dc09,_0x48676a))[_0x8a8a('0x25')](handleError(_0x51dc09,null));};exports[_0x8a8a('0x128')]=function(_0x2d99d3,_0x1dff03){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x2d99d3[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x1dff03,null))[_0x8a8a('0x1c')](function(_0x4125a3){if(_0x4125a3){return _0x4125a3[_0x8a8a('0x128')](_0x2d99d3[_0x8a8a('0x65')][_0x8a8a('0x79')],_[_0x8a8a('0xfa')](_0x2d99d3[_0x8a8a('0x65')],[_0x8a8a('0x79'),'id'])||{})[_0x8a8a('0xda')](function(_0x4447dc){for(var _0x2d3f1c=0x0;_0x2d3f1c<_0x2d99d3[_0x8a8a('0x65')]['ids']['length'];_0x2d3f1c+=0x1){socket[_0x8a8a('0x129')](_0x8a8a('0x12a'),{'UserId':Number(_0x2d99d3[_0x8a8a('0x65')][_0x8a8a('0x79')][_0x2d3f1c]),'ChatWebsiteId':Number(_0x2d99d3['params']['id'])});}return _0x4447dc;});}})[_0x8a8a('0x1c')](respondWithResult(_0x1dff03,null))['catch'](handleError(_0x1dff03,null));};exports[_0x8a8a('0x12b')]=function(_0x3991e8,_0x1d221f){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3991e8[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x1d221f,null))[_0x8a8a('0x1c')](function(_0x11ae8d){if(_0x11ae8d){return _0x11ae8d[_0x8a8a('0x12b')](_0x3991e8[_0x8a8a('0x50')]['ids'])[_0x8a8a('0x1c')](function(){if(_[_0x8a8a('0x12c')](_0x3991e8['query'][_0x8a8a('0x79')])){for(var _0x4676bb=0x0;_0x4676bb<_0x3991e8['query'][_0x8a8a('0x79')][_0x8a8a('0x62')];_0x4676bb+=0x1){socket['emit'](_0x8a8a('0x12d'),{'UserId':Number(_0x3991e8[_0x8a8a('0x50')][_0x8a8a('0x79')][_0x4676bb]),'ChatWebsiteId':Number(_0x3991e8['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3991e8['query'][_0x8a8a('0x79')]),'ChatWebsiteId':Number(_0x3991e8[_0x8a8a('0x61')]['id'])});}});}})[_0x8a8a('0x1c')](respondWithStatusCode(_0x1d221f,null))[_0x8a8a('0x25')](handleError(_0x1d221f,null));};exports['getAgents']=function(_0x3fb3c0,_0x3b0476){var _0x37a540={};var _0x2cee68={};var _0x206127;var _0x21cd36;return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x3fb3c0[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3b0476,null))[_0x8a8a('0x1c')](function(_0xac535c){if(_0xac535c){_0x206127=_0xac535c;_0x2cee68[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db['User'][_0x8a8a('0x4d')]);_0x2cee68[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x3fb3c0[_0x8a8a('0x50')]);_0x2cee68[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x2cee68[_0x8a8a('0x44')],_0x2cee68[_0x8a8a('0x50')]);_0x37a540['attributes']=_[_0x8a8a('0x53')](_0x2cee68[_0x8a8a('0x44')],qs['fields'](_0x3fb3c0['query']['fields']));_0x37a540['attributes']=_0x37a540[_0x8a8a('0x54')]['length']?_0x37a540[_0x8a8a('0x54')]:_0x2cee68[_0x8a8a('0x44')];_0x37a540[_0x8a8a('0x75')]=qs['sort'](_0x3fb3c0[_0x8a8a('0x50')]['sort']);_0x37a540['where']=qs[_0x8a8a('0x52')](_['pick'](_0x3fb3c0[_0x8a8a('0x50')],_0x2cee68[_0x8a8a('0x52')]));if(_0x3fb3c0[_0x8a8a('0x50')]['filter']){_0x37a540['where']=_[_0x8a8a('0x5b')](_0x37a540[_0x8a8a('0x58')],{'$or':_['map'](_0x37a540[_0x8a8a('0x54')],function(_0x5c0bd5){var _0x33ca5d={};_0x33ca5d[_0x5c0bd5]={'$like':'%'+_0x3fb3c0[_0x8a8a('0x50')]['filter']+'%'};return _0x33ca5d;})});}_0x37a540=_['merge']({},_0x37a540,_0x3fb3c0[_0x8a8a('0x5d')]);return _0x206127[_0x8a8a('0x12e')](_0x37a540);}})[_0x8a8a('0x1c')](function(_0x2ee77d){if(_0x2ee77d){_0x21cd36=_0x2ee77d[_0x8a8a('0x62')];if(!_0x3fb3c0[_0x8a8a('0x50')][_0x8a8a('0x56')]('nolimit')){_0x37a540[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x3fb3c0['query']['limit']);_0x37a540[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x3fb3c0['query'][_0x8a8a('0x2c')]);}return _0x206127[_0x8a8a('0x12e')](_0x37a540);}})['then'](function(_0x1bd6a8){if(_0x1bd6a8){return _0x1bd6a8?{'count':_0x21cd36,'rows':_0x1bd6a8}:null;}})['then'](respondWithResult(_0x3b0476,null))[_0x8a8a('0x25')](handleError(_0x3b0476,null));};
\ No newline at end of file
+var _0x81bd=['autoclose','close','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','ValidationError','no\x20available\x20attributes','difference','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','Smtp','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','UserProfileResource','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','params','Pause','options','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findAll','rows','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','createdAt','includes','updatedAt','ListId','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','contact','threadId','closed','externalUrl','ContactId','interaction','ChatInteraction','Writing\x20on\x20closed\x20interaction','messageId','created'];(function(_0x305195,_0x1c9e74){var _0x113e42=function(_0x2abc0f){while(--_0x2abc0f){_0x305195['push'](_0x305195['shift']());}};_0x113e42(++_0x1c9e74);}(_0x81bd,0x7c));var _0xd81b=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x81bd[_0x5f42f1];return _0x5534ee;};'use strict';var Mustache=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var ejs=require(_0xd81b('0x3'));var fs=require('fs');var fs_extra=require(_0xd81b('0x4'));var _=require(_0xd81b('0x5'));var querystring=require(_0xd81b('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xd81b('0x7'));var jayson=require(_0xd81b('0x8'));var qs=require(_0xd81b('0x9'));var logger=require('../../config/logger')(_0xd81b('0xa'));var config=require(_0xd81b('0xb'));var APIBadRequestError=require(_0xd81b('0xc'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xd81b('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0xd81b('0xe')];var APIHandleError=require(_0xd81b('0xc'))[_0xd81b('0xf')];var APIConflictError=require(_0xd81b('0xc'))[_0xd81b('0x10')];var wildcardUtils=require(_0xd81b('0x11'));var URL=require(_0xd81b('0x12'))[_0xd81b('0x13')];var db=require(_0xd81b('0x14'))['db'];config[_0xd81b('0x15')]=_[_0xd81b('0x16')](config[_0xd81b('0x15')],{'host':_0xd81b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0x15')]));require('./chatWebsite.socket')[_0xd81b('0x18')](socket);var client=jayson[_0xd81b('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xd81b('0x19')]['http']({'port':0x232a});var client9003=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x232b});var client9001=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x128162,_0x552215,_0x1c620d,_0x27b7a0){return new Promise(function(_0x5c2863,_0x2abef4){var _0x26df61=_0x27b7a0||client;return _0x26df61[_0xd81b('0x1b')](_0x128162,_0x1c620d)[_0xd81b('0x1c')](function(_0x5f7db6){logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));logger[_0xd81b('0x20')](_0xd81b('0x21'),_0x552215,_0xd81b('0x1f'),JSON[_0xd81b('0x22')](_0x5f7db6));if(_0x5f7db6[_0xd81b('0x23')]){if(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x24')]===0x1f4){logger[_0xd81b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x552215,_0x5f7db6['error'][_0xd81b('0x25')]);return _0x2abef4(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}logger['error'](_0xd81b('0x1e'),_0x552215,_0x5f7db6[_0xd81b('0x23')]['message']);return _0x5c2863(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}else{logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));_0x5c2863(_0x5f7db6[_0xd81b('0x26')][_0xd81b('0x25')]);}})[_0xd81b('0x27')](function(_0x341aec){logger[_0xd81b('0x23')](_0xd81b('0x1e'),_0x552215,_0x341aec);_0x2abef4(_0x341aec);});});}function respondWithStatusCode(_0x1bf351,_0x596389){_0x596389=_0x596389||0xcc;return function(_0x28768f){if(_0x28768f){return _0x1bf351[_0xd81b('0x28')](_0x596389);}return _0x1bf351[_0xd81b('0x29')](_0x596389)[_0xd81b('0x2a')]();};}function respondWithResult(_0x3266c2,_0x2d0d02){_0x2d0d02=_0x2d0d02||0xc8;return function(_0x3e28dd){if(_0x3e28dd){return _0x3266c2[_0xd81b('0x29')](_0x2d0d02)[_0xd81b('0x2b')](_0x3e28dd);}};}function respondWithFilteredResult(_0x483a3d,_0x469cc4){return function(_0x4e2eff){if(_0x4e2eff){var _0x5c8aee=typeof _0x469cc4[_0xd81b('0x2c')]===_0xd81b('0x2d')&&typeof _0x469cc4['limit']==='undefined';var _0x4093c8=_0x4e2eff[_0xd81b('0x2e')];var _0x1b1434=_0x5c8aee?0x0:_0x469cc4[_0xd81b('0x2c')];var _0x1a1572=_0x5c8aee?_0x4e2eff[_0xd81b('0x2e')]:_0x469cc4['offset']+_0x469cc4[_0xd81b('0x2f')];var _0x26f629;if(_0x1a1572>=_0x4093c8){_0x1a1572=_0x4093c8;_0x26f629=0xc8;}else{_0x26f629=0xce;}_0x483a3d['status'](_0x26f629);return _0x483a3d['set'](_0xd81b('0x30'),_0x1b1434+'-'+_0x1a1572+'/'+_0x4093c8)[_0xd81b('0x2b')](_0x4e2eff);}return null;};}function saveUpdates(_0x50472a){return function(_0x50ce25){if(_0x50ce25){return _0x50ce25['update'](_0x50472a)[_0xd81b('0x1c')](function(_0x3ead68){return _0x3ead68;});}return null;};}function removeEntity(_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x31')]()[_0xd81b('0x1c')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='ChatWebsites';return db[_0xd81b('0x32')][_0xd81b('0x31')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1c')](function(){return _0x1c4cf7;});})[_0xd81b('0x1c')](function(){_0x1d2f46[_0xd81b('0x29')](0xcc)[_0xd81b('0x2a')]();});}};}function handleEntityNotFound(_0x1c20d3){return function(_0x2d23b9){if(!_0x2d23b9){_0x1c20d3[_0xd81b('0x28')](0x194);}return _0x2d23b9;};}function handleError(_0xe88a33,_0x1be4e2){_0x1be4e2=_0x1be4e2||0x1f4;return function(_0x3c8371){logger[_0xd81b('0x23')](_0x3c8371['stack']);if(_0x3c8371['name']){delete _0x3c8371[_0xd81b('0x33')];}_0xe88a33[_0xd81b('0x29')](_0x1be4e2)[_0xd81b('0x34')](_0x3c8371);};}function createInteractionObject(_0x59c066,_0x362ebc,_0x37ba34,_0x5a236a){var _0x46f058=require(_0xd81b('0x35'));var _0x512e39=new _0x46f058();var _0xed5272=_0x512e39['setUA'](_0x37ba34[_0xd81b('0x36')])[_0xd81b('0x37')]();var _0x203365=_0x362ebc[_0xd81b('0x38')];if(_0x37ba34['cf-connecting-ip']){_0x203365=_0x37ba34[_0xd81b('0x39')];}else if(_0x37ba34[_0xd81b('0x3a')]){_0x203365=_[_0xd81b('0x3b')](_0x37ba34[_0xd81b('0x3a')][_0xd81b('0x3c')](','));}return{'ContactId':_0x5a236a['id'],'ChatWebsiteId':_0x59c066,'from':(_0x5a236a[_0xd81b('0x3d')]||'')+'\x20'+(_0x5a236a[_0xd81b('0x3e')]||''),'customerIp':_0x203365,'customerPort':_0x37ba34['x-real-port']?_0x37ba34[_0xd81b('0x3f')]:null,'referer':_0x362ebc[_0xd81b('0x40')],'browserName':_0xed5272[_0xd81b('0x41')]['name']&&_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]?util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272[_0xd81b('0x41')]['name'],_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]):_0xd81b('0x45'),'browserVersion':_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]||_0xd81b('0x45'),'osName':util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272['os'][_0xd81b('0x33')],_0xed5272['os'][_0xd81b('0x42')]),'osVersion':_0xed5272['os'][_0xd81b('0x42')],'deviceModel':_0xed5272['device'][_0xd81b('0x46')]&&_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')]?util[_0xd81b('0x43')](_0xd81b('0x49'),_0xed5272[_0xd81b('0x47')][_0xd81b('0x46')],_0xed5272[_0xd81b('0x47')]['vendor'],_0xed5272['device'][_0xd81b('0x4a')]):null,'deviceVendor':_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')],'deviceType':_0xed5272[_0xd81b('0x47')][_0xd81b('0x4a')],'formData':JSON[_0xd81b('0x22')](_0x362ebc)};}exports[_0xd81b('0x4b')]=function(_0x2e44f3,_0x2fa588){var _0xcfbbc2={'include':[{'model':db['Pause'],'as':_0xd81b('0x4c')}]},_0x41e2e6={},_0x38e436={'count':0x0,'rows':[]};var _0x2b61fc=_[_0xd81b('0x4d')](db[_0xd81b('0x4e')][_0xd81b('0x4f')],function(_0x410ef3){return{'name':_0x410ef3[_0xd81b('0x50')],'type':_0x410ef3[_0xd81b('0x4a')][_0xd81b('0x51')]};});_0x41e2e6['model']=_[_0xd81b('0x4d')](_0x2b61fc,_0xd81b('0x33'));_0x41e2e6[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x2e44f3['query']);_0x41e2e6[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],_0x41e2e6[_0xd81b('0x52')]);_0xcfbbc2[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x2e44f3[_0xd81b('0x52')]['fields']));_0xcfbbc2['attributes']=_0xcfbbc2[_0xd81b('0x56')][_0xd81b('0x58')]?_0xcfbbc2[_0xd81b('0x56')]:_0x41e2e6[_0xd81b('0x46')];if(!_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0xcfbbc2[_0xd81b('0x2f')]=qs['limit'](_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x2f')]);_0xcfbbc2[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x2e44f3[_0xd81b('0x52')]['offset']);}_0xcfbbc2[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x2e44f3['query'][_0xd81b('0x5c')]);_0xcfbbc2[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x2e44f3[_0xd81b('0x52')],_0x41e2e6[_0xd81b('0x54')]),_0x2b61fc);if(_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]){_0xcfbbc2[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0xcfbbc2[_0xd81b('0x5d')],{'$or':_['map'](_0x2b61fc,function(_0x285e82){if(_0x285e82['type']!==_0xd81b('0x61')){var _0x7b438c={};_0x7b438c[_0x285e82[_0xd81b('0x33')]]={'$like':'%'+_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x7b438c;}})});}_0xcfbbc2=_[_0xd81b('0x60')]({},_0xcfbbc2,_0x2e44f3['options']);var _0x2d978d={'where':_0xcfbbc2[_0xd81b('0x5d')]};return db['ChatWebsite']['count'](_0x2d978d)[_0xd81b('0x1c')](function(_0x59e018){_0x38e436[_0xd81b('0x2e')]=_0x59e018;if(_0x2e44f3['query'][_0xd81b('0x62')]){_0xcfbbc2[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x4e')]['findAll'](_0xcfbbc2);})[_0xd81b('0x1c')](function(_0x10ed99){_0x38e436['rows']=_0x10ed99;return _0x38e436;})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2fa588,_0xcfbbc2))[_0xd81b('0x27')](handleError(_0x2fa588,null));};exports['show']=function(_0x1ba5d6,_0x5e1cd7){var _0x3c9264={'raw':![],'where':{'id':_0x1ba5d6[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':_0xd81b('0x4c')}]},_0x31553e={};_0x31553e[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x4e')][_0xd81b('0x4f')]);_0x31553e[_0xd81b('0x52')]=_['keys'](_0x1ba5d6[_0xd81b('0x52')]);_0x31553e[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x31553e[_0xd81b('0x46')],_0x31553e[_0xd81b('0x52')]);_0x3c9264[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x31553e['model'],qs['fields'](_0x1ba5d6['query'][_0xd81b('0x57')]));_0x3c9264[_0xd81b('0x56')]=_0x3c9264[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3c9264[_0xd81b('0x56')]:_0x31553e[_0xd81b('0x46')];if(_0x1ba5d6[_0xd81b('0x52')]['includeAll']){_0x3c9264[_0xd81b('0x63')]=[{'all':!![]}];}_0x3c9264=_[_0xd81b('0x60')]({},_0x3c9264,_0x1ba5d6[_0xd81b('0x66')]);return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x3c9264)[_0xd81b('0x1c')](handleEntityNotFound(_0x5e1cd7,null))[_0xd81b('0x1c')](respondWithResult(_0x5e1cd7,null))['catch'](handleError(_0x5e1cd7,null));};exports[_0xd81b('0x68')]=function(_0x15f003,_0x12b2a7){var _0x8cf25d=null;_0x15f003[_0xd81b('0x69')][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x8fa8cd=>{if(_0x8fa8cd[_0xd81b('0x6c')]()!==''&&!wildcardUtils[_0xd81b('0x6d')](_0x8fa8cd[_0xd81b('0x6c')]())){_0x8cf25d=new APIBadRequestError('\x22'+_0x8fa8cd['trim']()+_0xd81b('0x6e'));}});if(_0x8cf25d){return handleError(_0x12b2a7,null)(_0x8cf25d);}return db['ChatWebsite'][_0xd81b('0x68')](_0x15f003[_0xd81b('0x69')],{})[_0xd81b('0x1c')](function(_0xc3c117){var _0xb94a69=_0x15f003[_0xd81b('0x6f')][_0xd81b('0x70')]({'plain':!![]});if(!_0xb94a69)throw new Error(_0xd81b('0x71'));if(_0xb94a69[_0xd81b('0x72')]===_0xd81b('0x6f')){var _0x5bcfd7=_0xc3c117[_0xd81b('0x70')]({'plain':!![]});var _0x344c32=_0xd81b('0x73');return db[_0xd81b('0x74')][_0xd81b('0x67')]({'where':{'name':_0x344c32,'userProfileId':_0xb94a69['userProfileId']},'raw':!![]})['then'](function(_0x3274d2){if(_0x3274d2&&_0x3274d2[_0xd81b('0x75')]===0x0){return db[_0xd81b('0x32')][_0xd81b('0x68')]({'name':_0x5bcfd7[_0xd81b('0x33')],'resourceId':_0x5bcfd7['id'],'type':_0x3274d2[_0xd81b('0x33')],'sectionId':_0x3274d2['id']},{})[_0xd81b('0x1c')](function(){return _0xc3c117;});}else{return _0xc3c117;}})['catch'](function(_0x2190df){logger[_0xd81b('0x23')](_0xd81b('0x76'),_0x2190df);throw _0x2190df;});}return _0xc3c117;})[_0xd81b('0x1c')](respondWithResult(_0x12b2a7,0xc9))[_0xd81b('0x27')](handleError(_0x12b2a7,null));};exports[_0xd81b('0x77')]=function(_0x1e0da3,_0x185f28){var _0x2315db=null;_0x1e0da3['body'][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x9c30e7=>{if(_0x9c30e7[_0xd81b('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x9c30e7[_0xd81b('0x6c')]())){_0x2315db=new APIBadRequestError('\x22'+_0x9c30e7[_0xd81b('0x6c')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2315db){return handleError(_0x185f28,null)(_0x2315db);}if(_0x1e0da3[_0xd81b('0x69')]['id']){delete _0x1e0da3[_0xd81b('0x69')]['id'];}return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x1e0da3[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':'mandatoryDispositionPause'}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x185f28,null))[_0xd81b('0x1c')](saveUpdates(_0x1e0da3[_0xd81b('0x69')],null))['then'](respondWithResult(_0x185f28,null))['catch'](handleError(_0x185f28,null));};exports[_0xd81b('0x31')]=function(_0x950cc3,_0x36c694){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x950cc3[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x36c694,null))[_0xd81b('0x1c')](removeEntity(_0x36c694,null))['catch'](handleError(_0x36c694,null));};exports['describe']=function(_0x42ae01,_0x256696){return db[_0xd81b('0x4e')][_0xd81b('0x78')]()['then'](respondWithResult(_0x256696,null))[_0xd81b('0x27')](handleError(_0x256696,null));};exports[_0xd81b('0x79')]=function(_0x4b8294,_0x46e36b){if(_0x4b8294['body']['id']){delete _0x4b8294[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x4b8294[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x46e36b,null))[_0xd81b('0x1c')](function(_0x2490f1){if(_0x2490f1){_0x4b8294[_0xd81b('0x69')]['ChatWebsiteId']=_0x2490f1['id'];return db[_0xd81b('0x7a')][_0xd81b('0x68')](_0x4b8294[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x46e36b,null))[_0xd81b('0x27')](handleError(_0x46e36b,null));};exports[_0xd81b('0x7b')]=function(_0x579052,_0x5c8ea0){var _0x31509d={'raw':![],'where':{}};var _0x3023d9={};var _0x97bd3e={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x579052[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x5c8ea0,null))[_0xd81b('0x1c')](function(_0x195f1c){if(_0x195f1c){_0x3023d9[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0x7a')][_0xd81b('0x4f')]);_0x3023d9[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x579052[_0xd81b('0x52')]);_0x3023d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x3023d9['model'],_0x3023d9[_0xd81b('0x52')]);_0x31509d[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x3023d9[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x579052[_0xd81b('0x52')]['fields']));_0x31509d[_0xd81b('0x56')]=_0x31509d['attributes'][_0xd81b('0x58')]?_0x31509d[_0xd81b('0x56')]:_0x3023d9[_0xd81b('0x46')];if(!_0x579052['query'][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31509d[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x579052[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x31509d['offset']=qs[_0xd81b('0x2c')](_0x579052['query']['offset']);}_0x31509d[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x579052[_0xd81b('0x52')]['sort']);_0x31509d[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x579052[_0xd81b('0x52')],_0x3023d9[_0xd81b('0x54')]));_0x31509d[_0xd81b('0x5d')]['ChatWebsiteId']=_0x195f1c['id'];if(_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31509d[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31509d[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x31509d[_0xd81b('0x56')],function(_0x270d82){var _0x380951={};_0x380951[_0x270d82]={'$like':'%'+_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x380951;})});}_0x31509d=_[_0xd81b('0x60')]({},_0x31509d,_0x579052[_0xd81b('0x66')]);return db[_0xd81b('0x7a')][_0xd81b('0x2e')]({'where':_0x31509d['where']})[_0xd81b('0x1c')](function(_0x47f90e){_0x97bd3e[_0xd81b('0x2e')]=_0x47f90e;if(_0x579052[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31509d[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x7a')][_0xd81b('0x7c')](_0x31509d);})['then'](function(_0x3a41e6){_0x97bd3e[_0xd81b('0x7d')]=_0x3a41e6;return _0x97bd3e;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x5c8ea0,_0x31509d))[_0xd81b('0x27')](handleError(_0x5c8ea0,null));};exports[_0xd81b('0x7e')]=function(_0x6e4c25,_0x2481e9){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x6e4c25[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2481e9,null))[_0xd81b('0x1c')](function(_0x5a02f7){if(_0x5a02f7){return _0x5a02f7[_0xd81b('0x7e')](_0x6e4c25[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x2481e9,null))[_0xd81b('0x27')](handleError(_0x2481e9,null));};exports['addAnswer']=function(_0x421c2b,_0x1e61d8){if(_0x421c2b[_0xd81b('0x69')]['id']){delete _0x421c2b[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x421c2b['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x1e61d8,null))['then'](function(_0x4461f3){if(_0x4461f3){_0x421c2b[_0xd81b('0x69')][_0xd81b('0x80')]=_0x4461f3['id'];return db[_0xd81b('0x81')]['create'](_0x421c2b[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x1e61d8,null))['catch'](handleError(_0x1e61d8,null));};exports[_0xd81b('0x82')]=function(_0x142d78,_0x2c1a0e){var _0x1c6291={'raw':![],'where':{}};var _0x2f9a9f={};var _0x4c8925={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x83')]({'where':{'id':_0x142d78['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2c1a0e,null))['then'](function(_0x509001){if(_0x509001){_0x2f9a9f[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['CannedAnswer']['rawAttributes']);_0x2f9a9f[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x142d78['query']);_0x2f9a9f[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],_0x2f9a9f[_0xd81b('0x52')]);_0x1c6291['attributes']=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x142d78['query']['fields']));_0x1c6291[_0xd81b('0x56')]=_0x1c6291[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c6291[_0xd81b('0x56')]:_0x2f9a9f[_0xd81b('0x46')];if(!_0x142d78['query']['hasOwnProperty'](_0xd81b('0x5a'))){_0x1c6291[_0xd81b('0x2f')]=qs['limit'](_0x142d78['query'][_0xd81b('0x2f')]);_0x1c6291[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x1c6291[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c6291[_0xd81b('0x5d')]=qs['filters'](_['pick'](_0x142d78[_0xd81b('0x52')],_0x2f9a9f[_0xd81b('0x54')]));_0x1c6291[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x509001['id'];if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c6291[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x1c6291[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x1c6291[_0xd81b('0x56')],function(_0x32e484){var _0x30fb62={};_0x30fb62[_0x32e484]={'$like':'%'+_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x30fb62;})});}_0x1c6291=_['merge']({},_0x1c6291,_0x142d78[_0xd81b('0x66')]);return db[_0xd81b('0x81')][_0xd81b('0x2e')]({'where':_0x1c6291['where']})[_0xd81b('0x1c')](function(_0x3bd28c){_0x4c8925[_0xd81b('0x2e')]=_0x3bd28c;if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x62')]){_0x1c6291['include']=[{'all':!![]}];}return db[_0xd81b('0x81')][_0xd81b('0x7c')](_0x1c6291);})[_0xd81b('0x1c')](function(_0x30fe56){_0x4c8925[_0xd81b('0x7d')]=_0x30fe56;return _0x4c8925;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2c1a0e,_0x1c6291))[_0xd81b('0x27')](handleError(_0x2c1a0e,null));};exports[_0xd81b('0x84')]=function(_0x1c3ea4,_0x282e83){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x1c3ea4['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x282e83,null))[_0xd81b('0x1c')](function(_0x15d52d){if(_0x15d52d){return _0x15d52d['removeAnswers'](_0x1c3ea4[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x282e83,null))[_0xd81b('0x27')](handleError(_0x282e83,null));};exports['addLogo']=function(_0x1e5f94,_0x4e037b){_0x1e5f94['body'][_0xd81b('0x85')]=_0x1e5f94[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x1e5f94['params']['id']}})['then'](handleEntityNotFound(_0x4e037b,null))[_0xd81b('0x1c')](saveUpdates(_0x1e5f94[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x4e037b,null))[_0xd81b('0x27')](handleError(_0x4e037b,null));};exports[_0xd81b('0x88')]=function(_0x36611b,_0x368fc6){_0x36611b[_0xd81b('0x69')][_0xd81b('0x89')]=_0x36611b[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x36611b[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x368fc6,null))[_0xd81b('0x1c')](saveUpdates(_0x36611b[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x368fc6,null))[_0xd81b('0x27')](handleError(_0x368fc6,null));};exports[_0xd81b('0x8a')]=function(_0x4c6848,_0x1162c0){_0x4c6848[_0xd81b('0x69')][_0xd81b('0x8b')]=_0x4c6848[_0xd81b('0x86')][_0xd81b('0x87')];return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x4c6848[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x1162c0,null))[_0xd81b('0x1c')](saveUpdates(_0x4c6848[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x1162c0,null))[_0xd81b('0x27')](handleError(_0x1162c0,null));};exports[_0xd81b('0x8c')]=function(_0x11b49d,_0x22e808){_0x11b49d[_0xd81b('0x69')][_0xd81b('0x8d')]=_0x11b49d[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x11b49d[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x22e808,null))[_0xd81b('0x1c')](saveUpdates(_0x11b49d['body'],null))[_0xd81b('0x1c')](respondWithResult(_0x22e808,null))[_0xd81b('0x27')](handleError(_0x22e808,null));};exports[_0xd81b('0x8e')]=function(_0x478b92,_0xf13081){var _0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/default_logo.svg');var _0x2a6dcb={'where':{'id':_0x478b92[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x85')],'raw':!![]};var _0xf2e1b5=![];return require(_0xd81b('0x91'))[_0xd81b('0x92')]()[_0xd81b('0x1c')](function(_0x55384e){if(_0x55384e){_0xf2e1b5=_0x55384e['custom'];}})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x2a6dcb);})['then'](handleEntityNotFound(_0xf13081,null))[_0xd81b('0x1c')](function(_0x5189b8){if(_0x5189b8){if(!_[_0xd81b('0x93')](_0x5189b8[_0xd81b('0x85')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x95'),_0x5189b8[_0xd81b('0x85')]))&&_0xf2e1b5){_0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/',_0x5189b8[_0xd81b('0x85')]);}}return _0xf13081[_0xd81b('0x96')](_0x3069d1);}})[_0xd81b('0x27')](handleError(_0xf13081,null));};exports['getAvatar']=function(_0x4b2b45,_0x4d44d7){var _0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x97'));var _0x175d02={'where':{'id':_0x4b2b45[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd81b('0x67')](_0x175d02)[_0xd81b('0x1c')](handleEntityNotFound(_0x4d44d7,null))[_0xd81b('0x1c')](function(_0x361d5a){if(_0x361d5a){if(!_['isNil'](_0x361d5a[_0xd81b('0x89')])){if(fs['existsSync'](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x361d5a['agentAvatar']))){_0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x361d5a[_0xd81b('0x89')]);}}return _0x4d44d7['download'](_0x3c5ea6);}})[_0xd81b('0x27')](handleError(_0x4d44d7,null));};exports[_0xd81b('0x99')]=function(_0x10449f,_0x539668){var _0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9a'));var _0x1e2612={'where':{'id':_0x10449f[_0xd81b('0x64')]['id']},'attributes':['id','customerAvatar',_0xd81b('0x9b')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x1e2612)['then'](handleEntityNotFound(_0x539668,null))[_0xd81b('0x1c')](function(_0xc9bdfe){if(_0xc9bdfe){if(!_[_0xd81b('0x93')](_0xc9bdfe[_0xd81b('0x8b')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe['customerAvatar']))&&_0xc9bdfe['showCustomerAvatar']){_0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe[_0xd81b('0x8b')]);}}return _0x539668['download'](_0x277379);}})['catch'](handleError(_0x539668,null));};exports[_0xd81b('0x9c')]=function(_0x397d26,_0x335713){var _0x1b18ef=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9d'));var _0x13e25f={'where':{'id':_0x397d26[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x8d')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x13e25f)[_0xd81b('0x1c')](handleEntityNotFound(_0x335713,null))[_0xd81b('0x1c')](function(_0x4283bd){if(_0x4283bd){if(!_['isNil'](_0x4283bd[_0xd81b('0x8d')])){if(fs[_0xd81b('0x94')](path['join'](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x4283bd[_0xd81b('0x8d')]))){_0x1b18ef=path['join'](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x4283bd[_0xd81b('0x8d')]);}}return _0x335713[_0xd81b('0x96')](_0x1b18ef);}})[_0xd81b('0x27')](handleError(_0x335713,null));};function checkWebsiteInterval(_0x2164d4){var _0x7e3d22=_0x2164d4[_0xd81b('0x9e')];if(!_0x7e3d22){return Promise[_0xd81b('0x9f')](_0x2164d4);}var _0x1b0156=_0x2164d4[_0xd81b('0xa0')]||undefined;return _0x7e3d22[_0xd81b('0xa1')](_0x1b0156)['then'](function(_0x8cda4b){if(!_0x8cda4b){throw new APIOutOfIntervalError();}return _0x2164d4;});}exports[_0xd81b('0xa2')]=function(_0x22dd20,_0x2ea321){var _0x305014={'body':_0x22dd20[_0xd81b('0x69')],'channel':_0xd81b('0xa3')};var _0x10382d=[];var _0x282942=[];var _0x24a88b={};var _0x48e6ba=![];if(_0x22dd20[_0xd81b('0x69')]['id']){delete _0x22dd20[_0xd81b('0x69')]['id'];}if(_['isNil'](_0x22dd20[_0xd81b('0x69')]['from'])){throw new APIBadRequestError(_0xd81b('0xa4'));}if(_[_0xd81b('0x93')](_0x22dd20['body'][_0xd81b('0xa5')])){throw new APIBadRequestError(_0xd81b('0xa6'));}if(_[_0xd81b('0xa7')](_0x22dd20[_0xd81b('0x69')]['body'])){throw new APIBadRequestError(_0xd81b('0xa8'));}var _0x3a248d=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];return db['CmContact'][_0xd81b('0x78')]()[_0xd81b('0x1c')](function(_0x14a219){if(!_0x14a219){throw new Error('No\x20available\x20attributes');}_0x10382d=Object['keys'](_0x14a219)[_0xd81b('0x5f')](function(_0x322771){return![_0xd81b('0xa9'),'updatedAt'][_0xd81b('0xaa')](_0x322771);});_0x282942=Object[_0xd81b('0x53')](_0x14a219)[_0xd81b('0x5f')](function(_0x4719f3){return![_0xd81b('0xa9'),_0xd81b('0xab'),'CompanyId',_0xd81b('0xac')][_0xd81b('0xaa')](_0x4719f3);});if(!_['includes'](_0x282942,_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x282942[_0xd81b('0x8f')](',\x20'));}_0x24a88b[_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')]]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xad')];})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x22dd20[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':'List','include':[{'model':db[_0xd81b('0xaf')],'as':_0xd81b('0xb0'),'where':_0x24a88b,'limit':0x1,'order':[['updatedAt',_0xd81b('0xb1')]]}]},{'model':db[_0xd81b('0xb2')],'as':_0xd81b('0xb3')},{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db['Interval'],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')],'raw':!![]}]}]});})[_0xd81b('0x1c')](function(_0x9658e){if(!_0x9658e){throw new APINotFoundError(util[_0xd81b('0x43')](_0xd81b('0xb6'),_0x22dd20[_0xd81b('0x64')]['id']));}if(_0x3a248d){return checkWebsiteInterval(_0x9658e);}return _0x9658e;})[_0xd81b('0x1c')](function(_0x44d405){_0x305014[_0xd81b('0xb7')]=_0x44d405;_0x305014[_0xd81b('0xb8')]=_['orderBy'](_0x44d405['Applications'],[_0xd81b('0xb9')],[_0xd81b('0xba')]);if(_0x305014[_0xd81b('0xb7')]['Applications']){delete _0x305014[_0xd81b('0xb7')][_0xd81b('0xb3')];}_0x305014[_0xd81b('0xbb')]=_0x44d405['List']||{'id':_0x44d405[_0xd81b('0xac')]};if(_0x305014[_0xd81b('0xbb')]&&_0x305014['list'][_0xd81b('0xb0')][_0xd81b('0x58')]){return _0x305014[_0xd81b('0xbb')][_0xd81b('0xb0')][0x0];}var _0x8026d7=_[_0xd81b('0x16')](_0x22dd20[_0xd81b('0x69')],{'firstName':_0x22dd20['body'][_0xd81b('0xad')],'ListId':_0x44d405[_0xd81b('0xac')]});_0x8026d7[_0x22dd20['body'][_0xd81b('0xa5')]]=_0x22dd20['body'][_0xd81b('0xad')];return db[_0xd81b('0xaf')][_0xd81b('0x68')](_0x8026d7,{'fields':_0x10382d,'raw':!![]});})[_0xd81b('0x1c')](function(_0x3a6e15){_0x305014[_0xd81b('0xbc')]=_0x3a6e15;var _0x87b315=createInteractionObject(_0x22dd20['params']['id'],_0x22dd20[_0xd81b('0x69')],_0x22dd20['headers'],_0x3a6e15);var _0x48073b={'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id']};if(_0x22dd20['body'][_0xd81b('0xbd')]){_0x48073b[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x48073b['closed']=![];return db['ChatInteraction'][_0xd81b('0x67')]({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x50529b){var _0x2ec729=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20['body'][_0xd81b('0x40')];if(_0x50529b){_0x48e6ba=!![];return _0x50529b;}else if(!_0x2ec729&&_0x50529b&&_0x50529b[_0xd81b('0xbe')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x87b315[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x87b315[_0xd81b('0xbf')]=_0x22dd20[_0xd81b('0x69')]['externalUrl'];return db['ChatInteraction'][_0xd81b('0x68')](_0x87b315);});}_0x48073b[_0xd81b('0xc0')]=_0x3a6e15['id'];if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xc1')]&&_0x22dd20['body'][_0xd81b('0xc1')]['id']){_0x48073b['id']=_0x22dd20['body'][_0xd81b('0xc1')]['id'];return db[_0xd81b('0xc2')]['find']({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x264d72){var _0x1d5dac=_0x22dd20['body'][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];if(!_0x1d5dac&&_0x264d72&&_0x264d72['closed']){throw new APIConflictError(_0xd81b('0xc3'));}else if(_0x264d72){_0x48e6ba=!![];return _0x264d72;}else{return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);}});}return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);})['then'](function(_0x5c3dce){if(!_0x48e6ba){return _0x5c3dce;}var _0x105735={'from':(_0x305014[_0xd81b('0xbc')][_0xd81b('0x3d')]||'')+'\x20'+(_0x305014[_0xd81b('0xbc')]['lastName']||'')};if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]&&_0x22dd20[_0xd81b('0x69')]['messageId']&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]!=_0x22dd20[_0xd81b('0x69')]['messageId']){_0x105735['threadId']=_0x22dd20['body'][_0xd81b('0xc4')];}return _0x5c3dce['update'](_0x105735);})[_0xd81b('0x1c')](function(_0x3d7a57){_0x305014[_0xd81b('0xc1')]=_0x3d7a57['get']({'plain':!![]});_0x305014['interaction'][_0xd81b('0xc5')]=!_0x48e6ba;if(_0x305014['interaction'][_0xd81b('0xc5')]){if(_0x305014[_0xd81b('0xb7')][_0xd81b('0xc6')]){_0x305014[_0xd81b('0xb8')]['push']({'id':0x0,'priority':_0x305014[_0xd81b('0xb8')][_0xd81b('0x58')]+0x1,'app':_0xd81b('0xc7'),'appdata':'unmanaged','interval':_0xd81b('0xc8')});}}return db['ChatMessage'][_0xd81b('0x68')]({'body':_0x22dd20[_0xd81b('0x69')]['body'],'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id'],'ChatInteractionId':_0x3d7a57['id'],'direction':'in','ContactId':_0x305014[_0xd81b('0xbc')]['id'],'AttachmentId':_0x22dd20[_0xd81b('0x69')]['AttachmentId']});})['then'](function(_0x1c10da){_0x305014[_0xd81b('0x25')]=_0x1c10da;if(!_0x305014[_0xd81b('0xc1')][_0xd81b('0xc9')]){return;}return db[_0xd81b('0xca')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014['interaction']['UserId']}});})[_0xd81b('0x1c')](function(_0x10f27c){if(_0x10f27c){_0x305014[_0xd81b('0xb8')][_0xd81b('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10f27c[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xcc')]||0xa),'interval':_0xd81b('0xc8')});_0x305014[_0xd81b('0xcd')]=!![];}if(!_0x305014['interaction']['queueId']){return;}return db[_0xd81b('0xce')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014[_0xd81b('0xc1')][_0xd81b('0xcf')]}});})['then'](function(_0x49e5dd){if(_0x49e5dd){_0x305014[_0xd81b('0xb8')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd81b('0xd0'),'appdata':_0x49e5dd[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xd1')]||0x12c),'interval':_0xd81b('0xc8')});}return respondWithRpcPromise(_0xd81b('0xd2'),_0xd81b('0xd3'),_0x305014);})[_0xd81b('0x1c')](function(_0x538cc2){respondWithRpcPromise(_0xd81b('0xd4'),_0xd81b('0xd4'),{'event':_0xd81b('0xa2'),'message':_0x538cc2},client9002);return _0x538cc2;})[_0xd81b('0x1c')](respondWithResult(_0x2ea321,null))[_0xd81b('0x27')](APIHandleError(_0x2ea321));};exports[_0xd81b('0xd5')]=function(_0x2f4b2b,_0x59779e){var _0x1e184c,_0x5d6b18,_0x19eef8;var _0x520762=[];var _0x36650d={};var _0x1c5923=_0x2f4b2b['files']||[];var _0x16865b=[];var _0x522616;return db[_0xd81b('0xaf')][_0xd81b('0x78')]()['then'](function(_0x98f92e){if(!_0x98f92e){throw new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xd7'));}_0x520762=_[_0xd81b('0xd8')](_[_0xd81b('0x53')](_0x98f92e),[_0xd81b('0xa9'),_0xd81b('0xab'),_0xd81b('0xd9'),_0xd81b('0xac')]);if(_0x2f4b2b[_0xd81b('0x69')]['id']){delete _0x2f4b2b[_0xd81b('0x69')]['id'];}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')]['from'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdb')));}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')])||_0x2f4b2b[_0xd81b('0x69')]['body']===''){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))]['ValidationError'](_0xd81b('0xdc')));}if(_['isNil'](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xdd')])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xde')+_0x520762));}if(!_['includes'](_0x520762,_0x2f4b2b['body']['mapKeyOffline'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdf')+_0x520762));}_0x36650d[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b['body'][_0xd81b('0xad')];})['then'](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x2f4b2b[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':_0xd81b('0xe0')},{'model':db[_0xd81b('0xe1')],'as':_0xd81b('0xe1')}]});})[_0xd81b('0x1c')](handleEntityNotFound(_0x59779e,null))[_0xd81b('0x1c')](function(_0x28cbe7){if(_0x28cbe7&&_0x28cbe7[_0xd81b('0xe0')]){_0x5d6b18=_0x28cbe7;var _0x30abaf=_[_0xd81b('0x16')](_0x2f4b2b[_0xd81b('0x69')],{'firstName':_0x2f4b2b['body'][_0xd81b('0xad')],'phone':_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xad')],'ListId':_0x28cbe7[_0xd81b('0xac')]});_0x30abaf[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b[_0xd81b('0x69')]['from'];return db['CmContact'][_0xd81b('0xe2')]({'where':_0x36650d,'defaults':_0x30abaf});}})['spread'](function(_0x126aaa){if(_0x126aaa){_0x19eef8=_0x126aaa;var _0x3e8623=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0xe4')),_0xd81b('0xe5'));var _0x576d9d=ejs[_0xd81b('0xe6')](_0x3e8623,{'body':_[_0xd81b('0xe7')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')]),'bodyTitle':_0x5d6b18[_0xd81b('0xe8')]});return db[_0xd81b('0xe9')]['create']({'body':_0x576d9d,'plainBody':htmlToText[_0xd81b('0xea')](_0x576d9d),'ContactId':_0x126aaa['id'],'ChatWebsiteId':_0x5d6b18['id']});}})[_0xd81b('0x1c')](function(_0x3b6ed5){_0x522616=_0x3b6ed5;if(_0x1c5923[_0xd81b('0x58')]){var _0x11b997=_0x1c5923[_0xd81b('0x4d')](function(_0x3ec25d){return{'name':_0x3ec25d[_0xd81b('0xeb')],'basename':_0x3ec25d[_0xd81b('0x87')],'type':_0x3ec25d['mimetype'],'ChatOfflineMessageId':_0x3b6ed5['id']};});_0x16865b=_0x11b997[_0xd81b('0x4d')](_0x10a82f=>{var _0x255f26={'filename':_0x10a82f[_0xd81b('0x33')],'path':path['join'](config[_0xd81b('0x90')],_0xd81b('0xec'),_0xd81b('0xed'),'attachments',_0xd81b('0xee'),_0x10a82f[_0xd81b('0xef')])};return _0x255f26;});if(!_0x5d6b18[_0xd81b('0xf0')]){return db[_0xd81b('0xf1')][_0xd81b('0xf2')](function(_0x4f1d2b){return db[_0xd81b('0xf3')][_0xd81b('0xf4')](_0x11b997,{'transaction':_0x4f1d2b});});}}})[_0xd81b('0x1c')](function(){if(_0x522616){_0x1e184c=_0x522616;return db['MailAccount'][_0xd81b('0x83')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd81b('0xf5')],'as':_0xd81b('0xf5'),'raw':!![]}]}]});}})['then'](function(_0x2e4523){if(_0x2e4523&&_0x2e4523['Smtp']&&_0x5d6b18[_0xd81b('0xf6')]&&_0x5d6b18[_0xd81b('0xf7')]){var _0x3a10ac=_0x2e4523[_0xd81b('0xf8')]();return respondWithRpcPromise('SendMail',_0xd81b('0xf9'),{'account':_0x3a10ac,'message':{'from':util[_0xd81b('0x43')](_0xd81b('0xfa'),_0x2e4523[_0xd81b('0x33')],_0x2e4523[_0xd81b('0xfb')]||_0x2e4523[_0xd81b('0xfc')]['user']),'to':_0x5d6b18[_0xd81b('0xf7')],'subject':_0x5d6b18['offlineMessageSubject'],'html':_0x1e184c['body'],'attachments':_0x16865b}},client9003)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0xb2d684){logger['error'](_0xb2d684);});}})[_0xd81b('0x1c')](function(){if(_0x5d6b18&&_0x5d6b18[_0xd81b('0xf0')]&&_0x5d6b18['MailAccountId']){var _0x50fbfd=[];if(_0x1c5923[_0xd81b('0x58')]){_0x50fbfd=_0x1c5923[_0xd81b('0x4d')](function(_0x44e2a8){return{'name':_0x44e2a8[_0xd81b('0xeb')],'basename':_0x44e2a8[_0xd81b('0x87')],'type':_0x44e2a8[_0xd81b('0xfd')],'ChatOfflineMessageId':_0x522616['id']};});}var _0x462925;if(!_[_0xd81b('0x93')](_0x5d6b18[_0xd81b('0xfe')])){var _0x41d12a=_[_0xd81b('0x4d')](_0x2f4b2b[_0xd81b('0x69')],function(_0x2f3170){return _0x2f3170;});var _0xfc4221=_['toPairsIn'](_0x41d12a)[0x0];var _0x25939f=_[_0xd81b('0xff')](_0xfc4221,function(_0x5a7cb8){return _0x5a7cb8;});_0x462925=_0x25939f[0x1][_0x5d6b18[_0xd81b('0xfe')]];}var _0x250cd7={'from':_0x19eef8[_0xd81b('0xfb')],'firstName':_0x19eef8[_0xd81b('0x3d')],'lastName':_0x19eef8['lastName'],'mapKey':_0xd81b('0xfb'),'message':{'from':_0x19eef8[_0xd81b('0xfb')],'to':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')],'cc':'','subject':_[_0xd81b('0x93')](_0x462925)?_0x5d6b18[_0xd81b('0x100')]:_0x462925,'messageId':'','sentAt':new Date(),'attach':_0x50fbfd['length'],'attachments':_0x50fbfd,'originChannel':_0xd81b('0x101'),'ChatWebsiteId':_0x5d6b18['id'],'ChatOfflineMessageId':_0x1e184c['id'],'originTo':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')]},'body':_0x1e184c[_0xd81b('0x69')]};var _0x35320d={'account':{'id':_0x5d6b18[_0xd81b('0x102')]},'body':_0x250cd7,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xd81b('0x103'),_0x35320d,client9001)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0x3c329e){logger['error'](_0x3c329e);});}return;})[_0xd81b('0x1c')](function(){if(_0x1e184c){return _0x1e184c;}})[_0xd81b('0x1c')](respondWithResult(_0x59779e,null))[_0xd81b('0x27')](function(){for(var _0x468794 of _0x1c5923){var _0x1c3473=path['join'](config[_0xd81b('0x90')],'server',_0xd81b('0xed'),_0xd81b('0x104'),'offline-chat',_0x468794['filename']);fs_extra[_0xd81b('0x105')](_0x1c3473)['catch'](function(_0x5f1c6b){logger[_0xd81b('0x23')](_0xd81b('0x106'),_0x1c3473,_0x5f1c6b);});}});};exports[_0xd81b('0x107')]=function(_0x56195b,_0x584698){return db[_0xd81b('0xc2')][_0xd81b('0x67')]({'where':{'id':_0x56195b[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x584698,null))[_0xd81b('0x1c')](function(_0xae9cb8){if(_0xae9cb8){return _0xae9cb8['addInteraction'](_0x56195b['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x56195b[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x584698,null))[_0xd81b('0x27')](handleError(_0x584698,null));};exports['getInteractions']=function(_0x22e159,_0x3d3ee1){var _0x31e7f7={'raw':![],'where':{}};var _0x4850d8={};var _0x51c975={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x22e159[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x3d3ee1,null))[_0xd81b('0x1c')](function(_0x525220){if(_0x525220){_0x4850d8[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['ChatInteraction'][_0xd81b('0x4f')]);_0x4850d8[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x22e159['query']);_0x4850d8[_0xd81b('0x54')]=_['intersection'](_0x4850d8[_0xd81b('0x46')],_0x4850d8['query']);_0x31e7f7[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x4850d8[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x57')]));_0x31e7f7['attributes']=_0x31e7f7['attributes'][_0xd81b('0x58')]?_0x31e7f7[_0xd81b('0x56')]:_0x4850d8[_0xd81b('0x46')];if(!_0x22e159[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31e7f7[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x22e159['query'][_0xd81b('0x2f')]);_0x31e7f7[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x22e159[_0xd81b('0x52')]['offset']);}_0x31e7f7[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x31e7f7['where']=qs[_0xd81b('0x54')](_['pick'](_0x22e159['query'],_0x4850d8[_0xd81b('0x54')]));_0x31e7f7[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x525220['id'];if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31e7f7[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31e7f7['where'],{'$or':_[_0xd81b('0x4d')](_0x31e7f7[_0xd81b('0x56')],function(_0x16ef58){var _0x3b4240={};_0x3b4240[_0x16ef58]={'$like':'%'+_0x22e159['query'][_0xd81b('0x5f')]+'%'};return _0x3b4240;})});}_0x31e7f7=_[_0xd81b('0x60')]({},_0x31e7f7,_0x22e159['options']);return db[_0xd81b('0xc2')]['count']({'where':_0x31e7f7[_0xd81b('0x5d')]})['then'](function(_0x54062e){_0x51c975[_0xd81b('0x2e')]=_0x54062e;if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31e7f7[_0xd81b('0x63')]=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db['User'],'as':_0xd81b('0x10a'),'attributes':[_0xd81b('0x33'),_0xd81b('0x10b'),_0xd81b('0x10c')],'required':![]},{'model':db[_0xd81b('0x10d')],'as':_0xd81b('0x10e'),'attributes':['id',_0xd81b('0x33'),_0xd81b('0x10f')],'where':_0x22e159[_0xd81b('0x52')]['tag']?{'id':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]}:undefined,'required':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]?!![]:![]}];}return db[_0xd81b('0xc2')][_0xd81b('0x7c')](_0x31e7f7);})[_0xd81b('0x1c')](function(_0x23139c){_0x51c975[_0xd81b('0x7d')]=_0x23139c;return _0x51c975;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x3d3ee1,_0x31e7f7))['catch'](handleError(_0x3d3ee1,null));};exports[_0xd81b('0x111')]=function(_0x432b04,_0x2ff8f6){var _0x30a57a=0x0;var _0x25f776=0x0;var _0x1313da=![];var _0x115026;var _0x202316;return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x432b04[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')]}]}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x2ff8f6,null))['then'](function(_0x16ccac){if(_0x16ccac){_0x115026=_0x16ccac;return _0x16ccac['getProactiveActions']({'raw':!![]});}})[_0xd81b('0x1c')](function(_0x1c3879){if(_0x115026){if(_0x1c3879){_0x202316=_0x1c3879;}}return require(_0xd81b('0x91'))[_0xd81b('0x92')]();})[_0xd81b('0x1c')](function(_0x4e6c6d){if(_0x4e6c6d){_0x25f776=_0x4e6c6d[_0xd81b('0x112')];_0x1313da=_0x4e6c6d[_0xd81b('0x113')];}})[_0xd81b('0x1c')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xd81b('0x1c')](function(_0x366808){_0x30a57a=_0x366808;if(_0x25f776&&_0x366808>_0x25f776){return db['License'][_0xd81b('0x83')]({'where':{'id':0x1}})[_0xd81b('0x1c')](function(_0x2ac7d3){if(_0x2ac7d3){_0x2ac7d3[_0xd81b('0x114')](_0xd81b('0x115'));}});}})[_0xd81b('0x1c')](function(){var _0x203fbe=_0x115026[_0xd81b('0x9e')];var _0xf1f6f2=_0x115026[_0xd81b('0xa0')]||undefined;return _0x203fbe?_0x203fbe[_0xd81b('0xa1')](_0xf1f6f2):!![];})[_0xd81b('0x1c')](function(_0xe0b626){var _0x5a187a=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0x116')),_0xd81b('0xe5'));var _0x4cb573=_0xd81b('0x117');var _0x53d707=![];var _0x480fab,_0x1685e6;if(_0x432b04[_0xd81b('0x118')]['referer']){_0x480fab=new URL(_0x432b04['headers'][_0xd81b('0x40')])[_0xd81b('0x119')];}else if(_0x432b04[_0xd81b('0x118')][_0xd81b('0x119')]){_0x480fab=new URL(_0x432b04[_0xd81b('0x118')]['origin'])[_0xd81b('0x119')];}else{_0x480fab=_0xd81b('0x11a');}_0x1685e6=typeof _0x115026[_0xd81b('0x6a')][_0xd81b('0x3c')](',')['find'](function(_0x549d83){return wildcardUtils[_0xd81b('0x11b')](_0x549d83,_0x480fab);})!==_0xd81b('0x2d');var _0x39eb20={'chatVersion':_0x4cb573,'chatWebsiteAddressOrigin':_0x1685e6?_0x480fab:_0x115026[_0xd81b('0x6a')],'remote':_0x115026[_0xd81b('0x11c')],'query':querystring[_0xd81b('0x22')](_['merge'](_0x115026[_0xd81b('0x70')]({'plain':!![]}),{'customerIp':_0x432b04[_0xd81b('0x118')]['x-forwarded-for']||_0x432b04[_0xd81b('0x118')][_0xd81b('0x11d')]||_0x432b04[_0xd81b('0x11e')][_0xd81b('0x11f')]||_0x432b04['ip'],'referer':_0x432b04['headers'][_0xd81b('0x40')],'openedInteractions':_0x30a57a,'maxInteractions':_0x25f776,'virtual':_0x1313da[_0xd81b('0x112')],'online':_0xe0b626,'custom':_0x1313da,'address':_0x1685e6?_0x480fab:null}))[_0xd81b('0x120')](/'/g,'\x5c\x27')};_0x2ff8f6[_0xd81b('0x34')](ejs[_0xd81b('0xe6')](Mustache[_0xd81b('0xe6')](_0x5a187a,_0x39eb20),{'proactiveActions':_0x202316,'alignment':_0x115026[_0xd81b('0x121')],'verticalAlignment':_0x115026[_0xd81b('0x122')],'div_color':_0x115026[_0xd81b('0x10f')],'labelText':_0x115026[_0xd81b('0x123')],'text_color':_0x115026[_0xd81b('0x124')],'text_button_color':_0x115026['textButtonColor'],'button_color':_0x115026[_0xd81b('0x125')],'background_color':_0x115026[_0xd81b('0x126')],'hideWhenOffline':_0x115026[_0xd81b('0x127')],'intervalId':_0x115026[_0xd81b('0x128')],'isDevelopment':_0x53d707,'chatVersion':_0x4cb573}));})[_0xd81b('0x27')](handleError(_0x2ff8f6,null));};exports[_0xd81b('0x129')]=function(_0x2eefbd,_0x2883fe){var _0x34cf85=_0x2eefbd[_0xd81b('0x64')]['id'];var _0x4eae4a=_0x2eefbd[_0xd81b('0x69')];var _0x388752=0xc8;var _0x580b1f=null;return db[_0xd81b('0xf1')][_0xd81b('0xf2')]({'isolationLevel':db[_0xd81b('0xf1')][_0xd81b('0x12a')]['ISOLATION_LEVELS'][_0xd81b('0x12b')]},function(_0x33d580){return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(_0x386b39){if(_0x386b39){return db[_0xd81b('0xb2')][_0xd81b('0x31')]({'where':{'ChatWebsiteId':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(){var _0x3c839c=_[_0xd81b('0x4d')](_0x4eae4a,function(_0x9bbfea){_0x9bbfea[_0xd81b('0x80')]=_0x34cf85;return _0x9bbfea;});return db[_0xd81b('0xb2')][_0xd81b('0xf4')](_0x3c839c,{'transaction':_0x33d580});});}else{_0x388752=0x194;_0x580b1f=[];}});})['then'](function(){if(_0x388752!==0x194){return db[_0xd81b('0xb2')][_0xd81b('0x12c')]({'where':{'ChatWebsiteId':_0x34cf85},'order':_0xd81b('0xb9')})['then'](function(_0x5ae954){_0x580b1f=_0x5ae954;});}})[_0xd81b('0x27')](function(_0x5ab098){_0x388752=0x1f4;logger[_0xd81b('0x23')](_0x5ab098['stack']);if(_0x5ab098[_0xd81b('0x33')]){delete _0x5ab098[_0xd81b('0x33')];}_0x580b1f=_0x5ab098;})[_0xd81b('0x12d')](function(){if(_0x580b1f===null){_0x2883fe[_0xd81b('0x28')](_0x388752);}else{if(_0x388752===0x1f4){_0x2883fe['status'](_0x388752)['send'](_0x580b1f);}else{_0x2883fe[_0xd81b('0x29')](_0x388752)[_0xd81b('0x2b')](_0x580b1f);}}});};exports[_0xd81b('0x12e')]=function(_0x1e841d,_0x6121cf){var _0x15ce6c={};var _0x29e6d9={};var _0x57ef3b;var _0xf7cefc;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e841d[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x6121cf,null))['then'](function(_0x28e08c){if(_0x28e08c){_0x57ef3b=_0x28e08c;_0x29e6d9[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xb2')][_0xd81b('0x4f')]);_0x29e6d9[_0xd81b('0x52')]=_['keys'](_0x1e841d['query']);_0x29e6d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x29e6d9['model'],_0x29e6d9['query']);_0x15ce6c[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x29e6d9['model'],qs[_0xd81b('0x57')](_0x1e841d[_0xd81b('0x52')]['fields']));_0x15ce6c[_0xd81b('0x56')]=_0x15ce6c[_0xd81b('0x56')][_0xd81b('0x58')]?_0x15ce6c['attributes']:_0x29e6d9[_0xd81b('0x46')];_0x15ce6c[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x15ce6c['where']=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x1e841d[_0xd81b('0x52')],_0x29e6d9[_0xd81b('0x54')]));if(_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x15ce6c[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x15ce6c[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x15ce6c['attributes'],function(_0x407136){var _0x3b5455={};_0x3b5455[_0x407136]={'$like':'%'+_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x3b5455;})});}_0x15ce6c=_[_0xd81b('0x60')]({},_0x15ce6c,_0x1e841d[_0xd81b('0x66')]);return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})['then'](function(_0x5b1898){if(_0x5b1898){_0xf7cefc=_0x5b1898[_0xd81b('0x58')];if(!_0x1e841d[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x15ce6c[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x15ce6c[_0xd81b('0x2c')]=qs['offset'](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})[_0xd81b('0x1c')](function(_0x89764a){if(_0x89764a){return _0x89764a?{'count':_0xf7cefc,'rows':_0x89764a}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x6121cf,null))[_0xd81b('0x27')](handleError(_0x6121cf,null));};exports['addProactiveActions']=function(_0x5a8445,_0x47a903){return db['chatProactiveAction']['find']({'where':{'id':_0x5a8445[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x47a903,null))[_0xd81b('0x1c')](function(_0x4d4feb){if(_0x4d4feb){return _0x4d4feb[_0xd81b('0x12f')](_0x5a8445['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x5a8445[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x47a903,null))[_0xd81b('0x27')](handleError(_0x47a903,null));};exports[_0xd81b('0x130')]=function(_0xd09d12,_0x251bf4){var _0x3682e4={};var _0x49f9d1={};var _0x5c97b9;var _0x1e4634;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xd09d12[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x251bf4,null))[_0xd81b('0x1c')](function(_0x4e3323){if(_0x4e3323){_0x5c97b9=_0x4e3323;_0x49f9d1[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x131')][_0xd81b('0x4f')]);_0x49f9d1['query']=_['keys'](_0xd09d12[_0xd81b('0x52')]);_0x49f9d1[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x49f9d1[_0xd81b('0x46')],_0x49f9d1[_0xd81b('0x52')]);_0x3682e4[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x49f9d1['model'],qs[_0xd81b('0x57')](_0xd09d12['query']['fields']));_0x3682e4['attributes']=_0x3682e4[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3682e4[_0xd81b('0x56')]:_0x49f9d1[_0xd81b('0x46')];_0x3682e4[_0xd81b('0x5b')]=qs['sort'](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x3682e4[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_['pick'](_0xd09d12['query'],_0x49f9d1[_0xd81b('0x54')]));if(_0xd09d12[_0xd81b('0x52')]['filter']){_0x3682e4[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x3682e4[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x3682e4[_0xd81b('0x56')],function(_0x111dd0){var _0x37301b={};_0x37301b[_0x111dd0]={'$like':'%'+_0xd09d12['query']['filter']+'%'};return _0x37301b;})});}_0x3682e4=_[_0xd81b('0x60')]({},_0x3682e4,_0xd09d12['options']);return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x222acd){if(_0x222acd){_0x1e4634=_0x222acd[_0xd81b('0x58')];if(!_0xd09d12[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x3682e4[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xd09d12[_0xd81b('0x52')]['limit']);_0x3682e4[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x3c96d4){if(_0x3c96d4){return _0x3c96d4?{'count':_0x1e4634,'rows':_0x3c96d4}:null;}})['then'](respondWithResult(_0x251bf4,null))[_0xd81b('0x27')](handleError(_0x251bf4,null));};exports[_0xd81b('0x132')]=function(_0x4387a7,_0x24fc43){var _0x498cc0=_0x4387a7[_0xd81b('0x52')][_0xd81b('0x133')]===_0xd81b('0x134')?_0xd81b('0x135'):_0xd81b('0x136');return db[_0xd81b('0x4e')]['find']({'attributes':['id',_0x498cc0],'where':{'id':_0x4387a7[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x24fc43,null))[_0xd81b('0x1c')](function(_0x597c54){if(_0x597c54){var _0x4e792e=_0x597c54[_0x498cc0];var _0x58e782=_0x4e792e&&_0x4e792e[_0xd81b('0x137')]?_0x4e792e['items']:[];_0x24fc43[_0xd81b('0x34')]({'fromKey':_[_0xd81b('0x93')](_0x4e792e['fromKey'])?undefined:_0x4e792e[_0xd81b('0x138')],'count':_0x58e782[_0xd81b('0x58')],'rows':_0x58e782});}})[_0xd81b('0x27')](handleError(_0x24fc43,null));};exports['getOfflineMessages']=function(_0x5f10b0,_0x19ff30){var _0x398e61={'raw':![],'where':{}};var _0xcb2433={};var _0x32573b={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x5f10b0['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x19ff30,null))[_0xd81b('0x1c')](function(_0x1eea94){if(_0x1eea94){_0xcb2433[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xe9')]['rawAttributes']);_0xcb2433['query']=_[_0xd81b('0x53')](_0x5f10b0[_0xd81b('0x52')]);_0xcb2433[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0xcb2433['model'],_0xcb2433[_0xd81b('0x52')]);_0x398e61['attributes']=_[_0xd81b('0x55')](_0xcb2433['model'],qs[_0xd81b('0x57')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x57')]));_0x398e61['attributes']=_0x398e61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x398e61[_0xd81b('0x56')]:_0xcb2433[_0xd81b('0x46')];if(!_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x398e61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x5f10b0['query'][_0xd81b('0x2f')]);_0x398e61[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x398e61[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x398e61[_0xd81b('0x5d')]=qs['filters'](_[_0xd81b('0x5e')](_0x5f10b0[_0xd81b('0x52')],_0xcb2433[_0xd81b('0x54')]));_0x398e61[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x1eea94['id'];if(_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x398e61[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x398e61['where'],{'$or':_['map'](_0x398e61[_0xd81b('0x56')],function(_0x56f4c8){var _0xa5dd60={};_0xa5dd60[_0x56f4c8]={'$like':'%'+_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0xa5dd60;})});}_0x398e61=_[_0xd81b('0x60')]({},_0x398e61,_0x5f10b0[_0xd81b('0x66')]);return db[_0xd81b('0xe9')][_0xd81b('0x2e')]({'where':_0x398e61[_0xd81b('0x5d')]})['then'](function(_0x443a17){_0x32573b[_0xd81b('0x2e')]=_0x443a17;if(_0x5f10b0['query'][_0xd81b('0x62')]){_0x398e61[_0xd81b('0x63')]=[{'all':!![]}];}else{_0x398e61['include']=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db[_0xd81b('0xf3')],'as':_0xd81b('0x139'),'required':![]}];}return db[_0xd81b('0xe9')][_0xd81b('0x7c')](_0x398e61);})[_0xd81b('0x1c')](function(_0x57da47){_0x32573b[_0xd81b('0x7d')]=_0x57da47;return _0x32573b;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x19ff30,_0x398e61))['catch'](handleError(_0x19ff30,null));};exports[_0xd81b('0x13a')]=function(_0x207681,_0x212f03){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x207681[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x212f03,null))[_0xd81b('0x1c')](function(_0x3ea155){if(_0x3ea155){return _0x3ea155[_0xd81b('0x13a')](_0x207681['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x207681[_0xd81b('0x69')],[_0xd81b('0x7f'),'id'])||{})[_0xd81b('0x13b')](function(_0x3b393b){for(var _0xd6d130=0x0;_0xd6d130<_0x207681['body'][_0xd81b('0x7f')][_0xd81b('0x58')];_0xd6d130+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x13d'),{'UserId':Number(_0x207681['body'][_0xd81b('0x7f')][_0xd6d130]),'ChatWebsiteId':Number(_0x207681[_0xd81b('0x64')]['id'])});}return _0x3b393b;});}})['then'](respondWithResult(_0x212f03,null))['catch'](handleError(_0x212f03,null));};exports[_0xd81b('0x13e')]=function(_0x44a9e1,_0x26d2c2){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x44a9e1['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x26d2c2,null))[_0xd81b('0x1c')](function(_0x4c684a){if(_0x4c684a){return _0x4c684a[_0xd81b('0x13e')](_0x44a9e1['query'][_0xd81b('0x7f')])['then'](function(){if(_[_0xd81b('0x13f')](_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')])){for(var _0x56d986=0x0;_0x56d986<_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0xd81b('0x58')];_0x56d986+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0x56d986]),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}}else{socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1['query']['ids']),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}});}})[_0xd81b('0x1c')](respondWithStatusCode(_0x26d2c2,null))[_0xd81b('0x27')](handleError(_0x26d2c2,null));};exports[_0xd81b('0x141')]=function(_0xb7102c,_0x2b1519){var _0x1c5a61={};var _0x4c1201={};var _0x1f76aa;var _0x36fa37;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xb7102c[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2b1519,null))[_0xd81b('0x1c')](function(_0x4fc360){if(_0x4fc360){_0x1f76aa=_0x4fc360;_0x4c1201[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0xca')]['rawAttributes']);_0x4c1201[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0xb7102c[_0xd81b('0x52')]);_0x4c1201['filters']=_[_0xd81b('0x55')](_0x4c1201[_0xd81b('0x46')],_0x4c1201[_0xd81b('0x52')]);_0x1c5a61['attributes']=_[_0xd81b('0x55')](_0x4c1201['model'],qs[_0xd81b('0x57')](_0xb7102c['query'][_0xd81b('0x57')]));_0x1c5a61[_0xd81b('0x56')]=_0x1c5a61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c5a61[_0xd81b('0x56')]:_0x4c1201[_0xd81b('0x46')];_0x1c5a61['order']=qs[_0xd81b('0x5c')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c5a61[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0xb7102c[_0xd81b('0x52')],_0x4c1201[_0xd81b('0x54')]));if(_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c5a61['where']=_[_0xd81b('0x60')](_0x1c5a61['where'],{'$or':_[_0xd81b('0x4d')](_0x1c5a61['attributes'],function(_0x45bf7e){var _0x29464b={};_0x29464b[_0x45bf7e]={'$like':'%'+_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x29464b;})});}_0x1c5a61=_[_0xd81b('0x60')]({},_0x1c5a61,_0xb7102c[_0xd81b('0x66')]);return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})['then'](function(_0xec700e){if(_0xec700e){_0x36fa37=_0xec700e[_0xd81b('0x58')];if(!_0xb7102c[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x1c5a61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x1c5a61['offset']=qs['offset'](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})[_0xd81b('0x1c')](function(_0x450634){if(_0x450634){return _0x450634?{'count':_0x36fa37,'rows':_0x450634}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x2b1519,null))[_0xd81b('0x27')](handleError(_0x2b1519,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index b3305c7..002e184 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 _0xc43c=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3b545c,_0x491912){var _0xc9eb90=function(_0x35aeec){while(--_0x35aeec){_0x3b545c['push'](_0x3b545c['shift']());}};_0xc9eb90(++_0x491912);}(_0xc43c,0x152));var _0xcc43=function(_0x44d357,_0x5d25fa){_0x44d357=_0x44d357-0x0;var _0x564514=_0xc43c[_0x44d357];return _0x564514;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var ChatWebsite=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcc43('0x3')](0x0);var events={'afterCreate':_0xcc43('0x4'),'afterUpdate':_0xcc43('0x5'),'afterDestroy':'remove'};function emitEvent(_0x162a11){return function(_0x258c7e,_0x5c21a3,_0x1b589f){ChatWebsiteEvents[_0xcc43('0x6')](_0x162a11+':'+_0x258c7e['id'],_0x258c7e);ChatWebsiteEvents[_0xcc43('0x6')](_0x162a11,_0x258c7e);_0x1b589f(null);};}for(var e in events){if(events[_0xcc43('0x7')](e)){var event=events[e];ChatWebsite[_0xcc43('0x8')](e,emitEvent(event));}}module[_0xcc43('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xd846=['../../mysqldb','ChatWebsite','update','emit','hook','exports','events'];(function(_0x5e58b2,_0x52b950){var _0x2e7bd3=function(_0x38d8cf){while(--_0x38d8cf){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x2e7bd3(++_0x52b950);}(_0xd846,0x195));var _0x6d84=function(_0x548d50,_0xec2bcd){_0x548d50=_0x548d50-0x0;var _0x2c3049=_0xd846[_0x548d50];return _0x2c3049;};'use strict';var EventEmitter=require(_0x6d84('0x0'));var ChatWebsite=require(_0x6d84('0x1'))['db'][_0x6d84('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d84('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47e90f){return function(_0x15fb0c,_0xa19796,_0x5c2176){ChatWebsiteEvents[_0x6d84('0x4')](_0x47e90f+':'+_0x15fb0c['id'],_0x15fb0c);ChatWebsiteEvents['emit'](_0x47e90f,_0x15fb0c);_0x5c2176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x6d84('0x5')](e,emitEvent(event));}}module[_0x6d84('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 3961379..2ec2b6e 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 _0x85fb=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x112db5,_0x38a06d){var _0x1d7d06=function(_0x44571e){while(--_0x44571e){_0x112db5['push'](_0x112db5['shift']());}};_0x1d7d06(++_0x38a06d);}(_0x85fb,0x6a));var _0xb85f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x85fb[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb85f('0x0'));var util=require(_0xb85f('0x1'));var logger=require(_0xb85f('0x2'))(_0xb85f('0x3'));var moment=require(_0xb85f('0x4'));var BPromise=require('bluebird');var rp=require(_0xb85f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb85f('0x6'));var config=require(_0xb85f('0x7'));var attributes=require(_0xb85f('0x8'));module['exports']=function(_0x447109,_0x2f2e6f){return _0x447109[_0xb85f('0x9')](_0xb85f('0xa'),attributes,{'tableName':_0xb85f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ada=['moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x0ada,0x176));var _0xa0ad=function(_0x2741c2,_0x4a688f){_0x2741c2=_0x2741c2-0x0;var _0x162ace=_0x0ada[_0x2741c2];return _0x162ace;};'use strict';var _=require(_0xa0ad('0x0'));var util=require(_0xa0ad('0x1'));var logger=require(_0xa0ad('0x2'))(_0xa0ad('0x3'));var moment=require(_0xa0ad('0x4'));var BPromise=require('bluebird');var rp=require(_0xa0ad('0x5'));var fs=require('fs');var path=require(_0xa0ad('0x6'));var rimraf=require(_0xa0ad('0x7'));var config=require(_0xa0ad('0x8'));var attributes=require(_0xa0ad('0x9'));module[_0xa0ad('0xa')]=function(_0x37717b,_0x3b5653){return _0x37717b[_0xa0ad('0xb')](_0xa0ad('0xc'),attributes,{'tableName':_0xa0ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index c40f1d1..2bf840f 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 _0x9791=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','localhost','redis','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9791,0x1ac));var _0x1979=function(_0x3c687b,_0x83ea4){_0x3c687b=_0x3c687b-0x0;var _0x20dfa5=_0x9791[_0x3c687b];return _0x20dfa5;};'use strict';var _=require(_0x1979('0x0'));var util=require(_0x1979('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1979('0x2'));var fs=require('fs');var Redis=require(_0x1979('0x3'));var db=require(_0x1979('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1979('0x5'))(_0x1979('0x6'));var config=require('../../config/environment');var jayson=require(_0x1979('0x7'));var client=jayson[_0x1979('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1979('0x9')](config['redis'],{'host':_0x1979('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1979('0xb')]));require(_0x1979('0xc'))[_0x1979('0xd')](socket);function respondWithRpcPromise(_0x5885f8,_0x37d8c9,_0x16789d){return new BPromise(function(_0xc944c2,_0x495a39){return client[_0x1979('0xe')](_0x5885f8,_0x16789d)[_0x1979('0xf')](function(_0x4af758){logger[_0x1979('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x37d8c9,_0x1979('0x11'));logger[_0x1979('0x12')](_0x1979('0x13'),_0x37d8c9,_0x1979('0x11'),JSON[_0x1979('0x14')](_0x4af758));if(_0x4af758[_0x1979('0x15')]){if(_0x4af758[_0x1979('0x15')][_0x1979('0x16')]===0x1f4){logger['error'](_0x1979('0x17'),_0x37d8c9,_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);return _0x495a39(_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);}logger[_0x1979('0x15')](_0x1979('0x17'),_0x37d8c9,_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);return _0xc944c2(_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);}else{logger[_0x1979('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x37d8c9,'request\x20sent');_0xc944c2(_0x4af758[_0x1979('0x19')]['message']);}})[_0x1979('0x1a')](function(_0x20eac8){logger[_0x1979('0x15')](_0x1979('0x17'),_0x37d8c9,_0x20eac8);_0x495a39(_0x20eac8);});});}
\ No newline at end of file
+var _0xc211=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','request\x20sent','debug','error','ChatWebsite,\x20%s,\x20%s','message','info','result'];(function(_0x319ed9,_0x255199){var _0x19b360=function(_0x105317){while(--_0x105317){_0x319ed9['push'](_0x319ed9['shift']());}};_0x19b360(++_0x255199);}(_0xc211,0x16d));var _0x1c21=function(_0x189564,_0x419229){_0x189564=_0x189564-0x0;var _0x531d23=_0xc211[_0x189564];return _0x531d23;};'use strict';var _=require(_0x1c21('0x0'));var util=require('util');var moment=require(_0x1c21('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c21('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c21('0x3'))['db'];var utils=require(_0x1c21('0x4'));var logger=require('../../config/logger')(_0x1c21('0x5'));var config=require(_0x1c21('0x6'));var jayson=require(_0x1c21('0x7'));var client=jayson[_0x1c21('0x8')][_0x1c21('0x9')]({'port':0x232a});config['redis']=_[_0x1c21('0xa')](config[_0x1c21('0xb')],{'host':_0x1c21('0xc'),'port':0x18eb});var socket=require(_0x1c21('0xd'))(new Redis(config['redis']));require(_0x1c21('0xe'))[_0x1c21('0xf')](socket);function respondWithRpcPromise(_0x801aec,_0x198113,_0x1544f2){return new BPromise(function(_0x453f76,_0x3624ad){return client[_0x1c21('0x10')](_0x801aec,_0x1544f2)[_0x1c21('0x11')](function(_0x5a7b6a){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x198113,_0x1c21('0x12'));logger[_0x1c21('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x198113,'request\x20sent',JSON['stringify'](_0x5a7b6a));if(_0x5a7b6a['error']){if(_0x5a7b6a[_0x1c21('0x14')]['code']===0x1f4){logger[_0x1c21('0x14')](_0x1c21('0x15'),_0x198113,_0x5a7b6a[_0x1c21('0x14')][_0x1c21('0x16')]);return _0x3624ad(_0x5a7b6a[_0x1c21('0x14')][_0x1c21('0x16')]);}logger[_0x1c21('0x14')](_0x1c21('0x15'),_0x198113,_0x5a7b6a[_0x1c21('0x14')][_0x1c21('0x16')]);return _0x453f76(_0x5a7b6a[_0x1c21('0x14')][_0x1c21('0x16')]);}else{logger[_0x1c21('0x17')](_0x1c21('0x15'),_0x198113,'request\x20sent');_0x453f76(_0x5a7b6a[_0x1c21('0x18')]['message']);}})[_0x1c21('0x19')](function(_0x467e82){logger[_0x1c21('0x14')](_0x1c21('0x15'),_0x198113,_0x467e82);_0x3624ad(_0x467e82);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 5021535..444033c 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 _0x3ea2=['length','./chatWebsite.events','update','emit','removeListener','register'];(function(_0x5c5953,_0x44bf4a){var _0x13a1a4=function(_0x593948){while(--_0x593948){_0x5c5953['push'](_0x5c5953['shift']());}};_0x13a1a4(++_0x44bf4a);}(_0x3ea2,0x121));var _0x23ea=function(_0x2035ef,_0x3f7d39){_0x2035ef=_0x2035ef-0x0;var _0x86c909=_0x3ea2[_0x2035ef];return _0x86c909;};'use strict';var ChatWebsiteEvents=require(_0x23ea('0x0'));var events=['save','remove',_0x23ea('0x1')];function createListener(_0x4f5c40,_0x4a7a67){return function(_0x53082c){_0x4a7a67[_0x23ea('0x2')](_0x4f5c40,_0x53082c);};}function removeListener(_0x2dee7d,_0x378570){return function(){ChatWebsiteEvents[_0x23ea('0x3')](_0x2dee7d,_0x378570);};}exports[_0x23ea('0x4')]=function(_0x24d6f4){for(var _0x298590=0x0,_0xab2159=events[_0x23ea('0x5')];_0x298590<_0xab2159;_0x298590++){var _0x5babfb=events[_0x298590];var _0x4a2a80=createListener('chatWebsite:'+_0x5babfb,_0x24d6f4);ChatWebsiteEvents['on'](_0x5babfb,_0x4a2a80);}};
\ No newline at end of file
+var _0xd585=['remove','update','emit','removeListener','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x2661a4,_0x4b56f1){var _0x176b8e=function(_0x55e3c5){while(--_0x55e3c5){_0x2661a4['push'](_0x2661a4['shift']());}};_0x176b8e(++_0x4b56f1);}(_0xd585,0x13e));var _0x5d58=function(_0x4d5330,_0x48e3ef){_0x4d5330=_0x4d5330-0x0;var _0x121916=_0xd585[_0x4d5330];return _0x121916;};'use strict';var ChatWebsiteEvents=require(_0x5d58('0x0'));var events=[_0x5d58('0x1'),_0x5d58('0x2'),_0x5d58('0x3')];function createListener(_0x5b0737,_0x172236){return function(_0x37e370){_0x172236[_0x5d58('0x4')](_0x5b0737,_0x37e370);};}function removeListener(_0x15a661,_0x54b5bc){return function(){ChatWebsiteEvents[_0x5d58('0x5')](_0x15a661,_0x54b5bc);};}exports[_0x5d58('0x6')]=function(_0x56f80d){for(var _0x14ad78=0x0,_0x23a3a3=events['length'];_0x14ad78<_0x23a3a3;_0x14ad78++){var _0x1c1d49=events[_0x14ad78];var _0x4b30d9=createListener(_0x5d58('0x7')+_0x1c1d49,_0x56f80d);ChatWebsiteEvents['on'](_0x1c1d49,_0x4b30d9);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 51b6742..2f2f7cf 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0650=['localhost','test','replace','([\x5cw]+)','exports','../../../utils/misc','url','URL'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x0650,0xed));var _0x0065=function(_0x4f3e5a,_0x1ee150){_0x4f3e5a=_0x4f3e5a-0x0;var _0x452880=_0x0650[_0x4f3e5a];return _0x452880;};var escapeRegExp=require(_0x0065('0x0'))['escapeRegExp'];var URL=require(_0x0065('0x1'))[_0x0065('0x2')];function testWildcardValidity(_0x5e6e6c){var _0x16f9eb=!![];try{new URL(_0x5e6e6c['replace']('*',_0x0065('0x3')));}catch(_0x8260ba){_0x16f9eb=![];}return _0x16f9eb&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0065('0x4')](_0x5e6e6c);}function testWebsiteWithWildcard(_0x4b15b1,_0xdf9084){var _0x507ed3;var _0x5cf16e=escapeRegExp(_0x4b15b1['trim']()[_0x0065('0x5')](/\/$/,''))[_0x0065('0x5')]('\x5c*',_0x0065('0x6'));try{new URL(_0x4b15b1[_0x0065('0x5')]('\x5c*',_0x0065('0x3')));_0x507ed3=new RegExp(_0x5cf16e)[_0x0065('0x4')](_0xdf9084);}catch(_0x8974f){_0x507ed3=![];}return _0x507ed3;}module[_0x0065('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x57b7=['localhost','exports','../../../utils/misc','escapeRegExp','url','URL','replace','test','trim','([\x5cw]+)'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x57b7,0x160));var _0x757b=function(_0x2d223a,_0x3c63cb){_0x2d223a=_0x2d223a-0x0;var _0x28c01a=_0x57b7[_0x2d223a];return _0x28c01a;};var escapeRegExp=require(_0x757b('0x0'))[_0x757b('0x1')];var URL=require(_0x757b('0x2'))[_0x757b('0x3')];function testWildcardValidity(_0x30c202){var _0x451dc6=!![];try{new URL(_0x30c202[_0x757b('0x4')]('*','localhost'));}catch(_0x22daa8){_0x451dc6=![];}return _0x451dc6&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x757b('0x5')](_0x30c202);}function testWebsiteWithWildcard(_0x25fe8a,_0x29dab0){var _0x5a1447;var _0x1b4949=escapeRegExp(_0x25fe8a[_0x757b('0x6')]()[_0x757b('0x4')](/\/$/,''))[_0x757b('0x4')]('\x5c*',_0x757b('0x7'));try{new URL(_0x25fe8a[_0x757b('0x4')]('\x5c*',_0x757b('0x8')));_0x5a1447=new RegExp(_0x1b4949)[_0x757b('0x5')](_0x29dab0);}catch(_0x53a1ce){_0x5a1447=![];}return _0x5a1447;}module[_0x757b('0x9')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 690c999..7540f27 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 _0x19db=['/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','file','diskStorage','join','server/files/images/avatars/','single','/:id/customer_avatar','/:id/notify','attachments','ensureDir','extname','replace','/:id/offline','addInteraction','addProactiveActions'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x19db,0x196));var _0xb19d=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x19db[_0x2fb87c];return _0x43038b;};'use strict';var multer=require(_0xb19d('0x0'));var util=require(_0xb19d('0x1'));var path=require(_0xb19d('0x2'));var timeout=require(_0xb19d('0x3'));var express=require(_0xb19d('0x4'));var router=express['Router']();var fs_extra=require(_0xb19d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb19d('0x6'));var controller=require(_0xb19d('0x7'));router[_0xb19d('0x8')]('/',auth[_0xb19d('0x9')](),controller[_0xb19d('0xa')]);router[_0xb19d('0x8')]('/describe',auth[_0xb19d('0x9')](),controller[_0xb19d('0xb')]);router[_0xb19d('0x8')](_0xb19d('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb19d('0xd'),auth[_0xb19d('0x9')](),controller[_0xb19d('0xe')]);router[_0xb19d('0x8')](_0xb19d('0xf'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x10')]);router[_0xb19d('0x8')](_0xb19d('0x11'),controller[_0xb19d('0x12')]);router[_0xb19d('0x8')](_0xb19d('0x13'),controller['getAvatar']);router[_0xb19d('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xb19d('0x8')](_0xb19d('0x14'),controller[_0xb19d('0x15')]);router[_0xb19d('0x8')](_0xb19d('0x16'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x17')]);router[_0xb19d('0x8')]('/:id/snippet',controller['getSnippet']);router['get'](_0xb19d('0x18'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x19')]);router[_0xb19d('0x8')](_0xb19d('0x1a'),auth['isAuthenticated'](),controller[_0xb19d('0x1b')]);router[_0xb19d('0x8')]('/:id/fields',controller[_0xb19d('0x1c')]);router[_0xb19d('0x8')](_0xb19d('0x1d'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x1e')]);router[_0xb19d('0x8')]('/:id/users',auth[_0xb19d('0x9')](),controller[_0xb19d('0x1f')]);router['post']('/',auth[_0xb19d('0x9')](),controller[_0xb19d('0x20')]);router[_0xb19d('0x21')]('/:id/dispositions',auth[_0xb19d('0x9')](),controller[_0xb19d('0x22')]);router[_0xb19d('0x21')]('/:id/canned_answers',auth[_0xb19d('0x9')](),controller[_0xb19d('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37415e,_0x5a7765,_0x3aa77d){_0x3aa77d(null,path['join'](config[_0xb19d('0x24')],_0xb19d('0x25')));},'filename':function(_0x48e33f,_0x254671,_0x4a25e4){_0x4a25e4(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date[_0xb19d('0x28')](),_0x254671[_0xb19d('0x29')]));}})});router['post'](_0xb19d('0x11'),upload['single'](_0xb19d('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xb19d('0x2b')]({'destination':function(_0x39b118,_0x2a79f6,_0x59010a){_0x59010a(null,path[_0xb19d('0x2c')](config['root'],_0xb19d('0x2d')));},'filename':function(_0x312e9a,_0x4a1ad4,_0x82bfa7){_0x82bfa7(null,util[_0xb19d('0x26')]('%s-%s',Date[_0xb19d('0x28')](),_0x4a1ad4[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')]('/:id/avatar',upload[_0xb19d('0x2e')](_0xb19d('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28d32a,_0x298238,_0x21fe16){_0x21fe16(null,path[_0xb19d('0x2c')](config[_0xb19d('0x24')],_0xb19d('0x2d')));},'filename':function(_0x51c400,_0x4b3ee6,_0x204ba9){_0x204ba9(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date['now'](),_0x4b3ee6[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')](_0xb19d('0x2f'),upload[_0xb19d('0x2e')](_0xb19d('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb19d('0x2b')]({'destination':function(_0x458279,_0xb611b7,_0x357c5c){_0x357c5c(null,path['join'](config[_0xb19d('0x24')],_0xb19d('0x2d')));},'filename':function(_0x1eb73e,_0x36e221,_0x4dbbde){_0x4dbbde(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date[_0xb19d('0x28')](),_0x36e221[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')](_0xb19d('0x14'),upload[_0xb19d('0x2e')]('file'),controller['addSystemAvatar']);router['post'](_0xb19d('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x13f727,_0x38eb02,_0xb95950){const _0x1fe7c2=path[_0xb19d('0x2c')](config[_0xb19d('0x24')],'server/files',_0xb19d('0x31'),'offline-chat');fs_extra[_0xb19d('0x32')](_0x1fe7c2,function(){_0xb95950(null,_0x1fe7c2);});},'filename':function(_0x3b26ba,_0x25d374,_0x54de63){const _0xb647e1=_0x25d374['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15ca2c=path[_0xb19d('0x33')](_0xb647e1);const _0x153bc4=Date['now']()+'-'+_0xb647e1[_0xb19d('0x34')](_0x15ca2c,'')+_0x15ca2c;_0x54de63(null,_0x153bc4);}})});router['post'](_0xb19d('0x35'),offlineUploadMulter['any'](),controller['offline']);router[_0xb19d('0x21')](_0xb19d('0x16'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x36')]);router['post']('/:id/applications',auth[_0xb19d('0x9')](),controller['addApplications']);router[_0xb19d('0x21')](_0xb19d('0x1a'),auth['isAuthenticated'](),controller[_0xb19d('0x37')]);router[_0xb19d('0x21')](_0xb19d('0x38'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x39')]);router[_0xb19d('0x3a')]('/:id',auth[_0xb19d('0x9')](),controller[_0xb19d('0x3b')]);router[_0xb19d('0x3c')](_0xb19d('0xc'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3d')]);router['delete'](_0xb19d('0xd'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3e')]);router[_0xb19d('0x3c')](_0xb19d('0xf'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3f')]);router[_0xb19d('0x3c')](_0xb19d('0x38'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x40')]);module[_0xb19d('0x41')]=router;
\ No newline at end of file
+var _0xbff3=['getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','diskStorage','now','originalname','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet'];(function(_0x5dcc7c,_0x5e3b9d){var _0x4dfa73=function(_0x17ebfb){while(--_0x17ebfb){_0x5dcc7c['push'](_0x5dcc7c['shift']());}};_0x4dfa73(++_0x5e3b9d);}(_0xbff3,0x194));var _0x3bff=function(_0x43fbc9,_0x59e518){_0x43fbc9=_0x43fbc9-0x0;var _0x3ae36b=_0xbff3[_0x43fbc9];return _0x3ae36b;};'use strict';var multer=require('multer');var util=require(_0x3bff('0x0'));var path=require(_0x3bff('0x1'));var timeout=require(_0x3bff('0x2'));var express=require('express');var router=express[_0x3bff('0x3')]();var fs_extra=require(_0x3bff('0x4'));var auth=require(_0x3bff('0x5'));var interaction=require(_0x3bff('0x6'));var config=require(_0x3bff('0x7'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x3bff('0x8')](),controller[_0x3bff('0x9')]);router[_0x3bff('0xa')](_0x3bff('0xb'),auth[_0x3bff('0x8')](),controller[_0x3bff('0xc')]);router[_0x3bff('0xa')](_0x3bff('0xd'),auth[_0x3bff('0x8')](),controller[_0x3bff('0xe')]);router[_0x3bff('0xa')]('/:id/dispositions',auth[_0x3bff('0x8')](),controller[_0x3bff('0xf')]);router[_0x3bff('0xa')](_0x3bff('0x10'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x11')]);router['get'](_0x3bff('0x12'),controller[_0x3bff('0x13')]);router[_0x3bff('0xa')](_0x3bff('0x14'),controller[_0x3bff('0x15')]);router[_0x3bff('0xa')](_0x3bff('0x16'),controller[_0x3bff('0x17')]);router[_0x3bff('0xa')](_0x3bff('0x18'),controller[_0x3bff('0x19')]);router['get'](_0x3bff('0x1a'),auth[_0x3bff('0x8')](),controller['getInteractions']);router['get'](_0x3bff('0x1b'),controller[_0x3bff('0x1c')]);router[_0x3bff('0xa')](_0x3bff('0x1d'),auth['isAuthenticated'](),controller[_0x3bff('0x1e')]);router['get'](_0x3bff('0x1f'),auth[_0x3bff('0x8')](),controller['getProactiveActions']);router[_0x3bff('0xa')]('/:id/fields',controller[_0x3bff('0x20')]);router[_0x3bff('0xa')](_0x3bff('0x21'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x3bff('0xa')](_0x3bff('0x22'),auth[_0x3bff('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3bff('0x23')](_0x3bff('0x24'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x25')]);router[_0x3bff('0x23')](_0x3bff('0x10'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e6f6e,_0xa097ba,_0x3035c6){_0x3035c6(null,path[_0x3bff('0x27')](config[_0x3bff('0x28')],_0x3bff('0x29')));},'filename':function(_0x4c31e8,_0x4c2a4c,_0x221ad6){_0x221ad6(null,util[_0x3bff('0x2a')](_0x3bff('0x2b'),Date['now'](),_0x4c2a4c['originalname']));}})});router['post']('/:id/logo',upload[_0x3bff('0x2c')](_0x3bff('0x2d')),controller[_0x3bff('0x2e')]);var upload=multer({'storage':multer[_0x3bff('0x2f')]({'destination':function(_0x3d0878,_0x27287a,_0x2bbaa8){_0x2bbaa8(null,path[_0x3bff('0x27')](config[_0x3bff('0x28')],'server/files/images/avatars/'));},'filename':function(_0x5f2dd8,_0x571389,_0x56ddb9){_0x56ddb9(null,util[_0x3bff('0x2a')](_0x3bff('0x2b'),Date[_0x3bff('0x30')](),_0x571389[_0x3bff('0x31')]));}})});router['post'](_0x3bff('0x14'),upload[_0x3bff('0x2c')](_0x3bff('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x3bff('0x2f')]({'destination':function(_0x4f9b4c,_0x2b669c,_0x5b98a2){_0x5b98a2(null,path[_0x3bff('0x27')](config[_0x3bff('0x28')],'server/files/images/avatars/'));},'filename':function(_0x484ba1,_0x36bb5f,_0x9a1b79){_0x9a1b79(null,util['format']('%s-%s',Date['now'](),_0x36bb5f['originalname']));}})});router[_0x3bff('0x23')](_0x3bff('0x16'),upload['single'](_0x3bff('0x2d')),controller[_0x3bff('0x32')]);var upload=multer({'storage':multer[_0x3bff('0x2f')]({'destination':function(_0xa3db26,_0x2edf63,_0x217da1){_0x217da1(null,path[_0x3bff('0x27')](config[_0x3bff('0x28')],_0x3bff('0x33')));},'filename':function(_0x3d6eea,_0xf8d6e,_0x49c459){_0x49c459(null,util[_0x3bff('0x2a')]('%s-%s',Date[_0x3bff('0x30')](),_0xf8d6e[_0x3bff('0x31')]));}})});router[_0x3bff('0x23')](_0x3bff('0x18'),upload[_0x3bff('0x2c')](_0x3bff('0x2d')),controller[_0x3bff('0x34')]);router[_0x3bff('0x23')](_0x3bff('0x35'),controller[_0x3bff('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x3bff('0x2f')]({'destination':function(_0x528474,_0x55cb29,_0x53ae71){const _0xb6a7f4=path[_0x3bff('0x27')](config['root'],'server/files',_0x3bff('0x37'),_0x3bff('0x38'));fs_extra['ensureDir'](_0xb6a7f4,function(){_0x53ae71(null,_0xb6a7f4);});},'filename':function(_0x224904,_0x36a90a,_0x3e928a){const _0x42f28a=_0x36a90a[_0x3bff('0x31')][_0x3bff('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a7244=path[_0x3bff('0x3a')](_0x42f28a);const _0x3425f2=Date[_0x3bff('0x30')]()+'-'+_0x42f28a[_0x3bff('0x39')](_0x2a7244,'')+_0x2a7244;_0x3e928a(null,_0x3425f2);}})});router['post'](_0x3bff('0x3b'),offlineUploadMulter[_0x3bff('0x3c')](),controller[_0x3bff('0x3d')]);router['post'](_0x3bff('0x1a'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x3e')]);router[_0x3bff('0x23')](_0x3bff('0x1d'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x3f')]);router[_0x3bff('0x23')]('/:id/proactive_actions',auth[_0x3bff('0x8')](),controller[_0x3bff('0x40')]);router[_0x3bff('0x23')]('/:id/users',auth[_0x3bff('0x8')](),controller[_0x3bff('0x41')]);router[_0x3bff('0x42')](_0x3bff('0xd'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x43')]);router[_0x3bff('0x44')](_0x3bff('0xd'),auth[_0x3bff('0x8')](),controller['destroy']);router[_0x3bff('0x44')](_0x3bff('0x24'),auth[_0x3bff('0x8')](),controller['removeDispositions']);router[_0x3bff('0x44')](_0x3bff('0x10'),auth[_0x3bff('0x8')](),controller[_0x3bff('0x45')]);router[_0x3bff('0x44')]('/:id/users',auth[_0x3bff('0x8')](),controller[_0x3bff('0x46')]);module[_0x3bff('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 7429f13..7997faa 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x203d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','Router','env','app','get'];(function(_0x23e314,_0x2ba525){var _0x3c1bf4=function(_0x7ec1b4){while(--_0x7ec1b4){_0x23e314['push'](_0x23e314['shift']());}};_0x3c1bf4(++_0x2ba525);}(_0x203d,0x66));var _0xd203=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x203d[_0xdea41a];return _0x15d0d8;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd203('0x0'));var auth=require(_0xd203('0x1'));var config=require('../config/environment');var router=express[_0xd203('0x2')]();var isProduction=config[_0xd203('0x3')]==='production'||![];function clientSideLogs(_0x1b0785,_0x3766ac,_0x264de3){var _0x532383=_0x1b0785[_0xd203('0x4')][_0xd203('0x5')]('client-side-logger');if(!_0x532383){throw new Error(_0xd203('0x6'));}return beaverLogger[_0xd203('0x7')]({'uri':_0xd203('0x8'),'logger':_0x532383,'enableCors':!isProduction})(_0x1b0785,_0x3766ac,_0x264de3);}router[_0xd203('0x9')](auth[_0xd203('0xa')](),clientSideLogs);module[_0xd203('0xb')]=router;
\ No newline at end of file
+var _0x8b17=['use','exports','../components/auth/service','../config/environment','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x1af84c,_0x4d766e){var _0x3a4351=function(_0x11bd8f){while(--_0x11bd8f){_0x1af84c['push'](_0x1af84c['shift']());}};_0x3a4351(++_0x4d766e);}(_0x8b17,0x9e));var _0x78b1=function(_0x91c9d6,_0x4bfa45){_0x91c9d6=_0x91c9d6-0x0;var _0x13de68=_0x8b17[_0x91c9d6];return _0x13de68;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x78b1('0x0'));var config=require(_0x78b1('0x1'));var router=express['Router']();var isProduction=config[_0x78b1('0x2')]===_0x78b1('0x3')||![];function clientSideLogs(_0x2c0133,_0x3b1527,_0x3ad0e2){var _0x281373=_0x2c0133[_0x78b1('0x4')][_0x78b1('0x5')](_0x78b1('0x6'));if(!_0x281373){throw new Error(_0x78b1('0x7'));}return beaverLogger[_0x78b1('0x8')]({'uri':_0x78b1('0x9'),'logger':_0x281373,'enableCors':!isProduction})(_0x2c0133,_0x3b1527,_0x3ad0e2);}router[_0x78b1('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0x78b1('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 1eaf327..9cc0376 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 _0x7554=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x34d8a1,_0x4e9d8f){var _0x11b1ce=function(_0x4ac29e){while(--_0x4ac29e){_0x34d8a1['push'](_0x34d8a1['shift']());}};_0x11b1ce(++_0x4e9d8f);}(_0x7554,0x1a5));var _0x4755=function(_0x1cd762,_0x223478){_0x1cd762=_0x1cd762-0x0;var _0x45128a=_0x7554[_0x1cd762];return _0x45128a;};'use strict';var Sequelize=require(_0x4755('0x0'));module[_0x4755('0x1')]={'name':{'type':Sequelize[_0x4755('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4755('0x3')]('AmazonAWS','Google',_0x4755('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4755('0x3')](_0x4755('0x5'),_0x4755('0x6'))},'data1':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x7')},'data2':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x8')},'data3':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x4755('0xa')},'data5':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xc')},'data6':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xd')},'data7':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xe')}};
\ No newline at end of file
+var _0x4a34=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a34,0x1cd));var _0x44a3=function(_0x4426fe,_0x40d3b7){_0x4426fe=_0x4426fe-0x0;var _0x2f79df=_0x4a34[_0x4426fe];return _0x2f79df;};'use strict';var Sequelize=require('sequelize');module[_0x44a3('0x0')]={'name':{'type':Sequelize[_0x44a3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x44a3('0x2')]('AmazonAWS',_0x44a3('0x3'),_0x44a3('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x44a3('0x2')](_0x44a3('0x5'),_0x44a3('0x6'))},'data1':{'type':Sequelize[_0x44a3('0x1')],'comment':_0x44a3('0x7')},'data2':{'type':Sequelize[_0x44a3('0x1')],'comment':_0x44a3('0x8')},'data3':{'type':Sequelize[_0x44a3('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x44a3('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x44a3('0xa')],'comment':_0x44a3('0xb')},'data7':{'type':Sequelize[_0x44a3('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 660f1c9..5188fff 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 _0x9c59=['../../components/encryptor','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','update','then','end','error','stack','name','send','padEnd','index','CloudProvider','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','lodash','../../components/parsers/qs'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9c59,0x115));var _0x99c5=function(_0xe3e56a,_0xd3462d){_0xe3e56a=_0xe3e56a-0x0;var _0x5617f2=_0x9c59[_0xe3e56a];return _0x5617f2;};'use strict';var _=require(_0x99c5('0x0'));var Redis=require('ioredis');var qs=require(_0x99c5('0x1'));var encryptor=require(_0x99c5('0x2'));var config=require('../../config/environment');var logger=require(_0x99c5('0x3'))(_0x99c5('0x4'));var db=require(_0x99c5('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x99c5('0x6')]=_['defaults'](config[_0x99c5('0x6')],{'host':_0x99c5('0x7'),'port':0x18eb});var socket=require(_0x99c5('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x99c5('0x6')]);function respondWithStatusCode(_0x14358e,_0xd44207){_0xd44207=_0xd44207||0xcc;return function(_0x42c247){if(_0x42c247){return _0x14358e[_0x99c5('0x9')](_0xd44207);}return _0x14358e[_0x99c5('0xa')](_0xd44207)['end']();};}function respondWithResult(_0x28b684,_0x562839){_0x562839=_0x562839||0xc8;return function(_0x240210){if(_0x240210){return _0x28b684['status'](_0x562839)[_0x99c5('0xb')](_0x240210);}};}function respondWithFilteredResult(_0x54ae0a,_0x5f1861){return function(_0xa2ddb){if(_0xa2ddb){var _0x17eae1=typeof _0x5f1861[_0x99c5('0xc')]===_0x99c5('0xd')&&typeof _0x5f1861[_0x99c5('0xe')]==='undefined';var _0x48bad0=_0xa2ddb[_0x99c5('0xf')];var _0x52510b=_0x17eae1?0x0:_0x5f1861[_0x99c5('0xc')];var _0x41b68c=_0x17eae1?_0xa2ddb[_0x99c5('0xf')]:_0x5f1861['offset']+_0x5f1861[_0x99c5('0xe')];var _0x308d0a;if(_0x41b68c>=_0x48bad0){_0x41b68c=_0x48bad0;_0x308d0a=0xc8;}else{_0x308d0a=0xce;}_0x54ae0a[_0x99c5('0xa')](_0x308d0a);return _0x54ae0a[_0x99c5('0x10')]('Content-Range',_0x52510b+'-'+_0x41b68c+'/'+_0x48bad0)['json'](_0xa2ddb);}return null;};}function saveUpdates(_0x39bac1){return function(_0x51726f){if(_0x51726f){return _0x51726f[_0x99c5('0x11')](_0x39bac1)[_0x99c5('0x12')](function(_0x5e4f4f){return _0x5e4f4f;});}return null;};}function removeEntity(_0x4ea965){return function(_0x891141){if(_0x891141){return _0x891141['destroy']()[_0x99c5('0x12')](function(){_0x4ea965[_0x99c5('0xa')](0xcc)[_0x99c5('0x13')]();});}};}function handleEntityNotFound(_0x178bee){return function(_0x49ad00){if(!_0x49ad00){_0x178bee['sendStatus'](0x194);}return _0x49ad00;};}function handleError(_0x42098a,_0x39326b){_0x39326b=_0x39326b||0x1f4;return function(_0x24156a){logger[_0x99c5('0x14')](_0x24156a[_0x99c5('0x15')]);if(_0x24156a[_0x99c5('0x16')]){delete _0x24156a[_0x99c5('0x16')];}_0x42098a[_0x99c5('0xa')](_0x39326b)[_0x99c5('0x17')](_0x24156a);};}function maskClientSecret(_0x4794f9){return _[_0x99c5('0x18')](_0x4794f9['slice'](0x0,0x3),0x14,'*');}exports[_0x99c5('0x19')]=function(_0x206032,_0x1396e2){var _0x597b4a={},_0x4346c4={},_0x1ee82d={'count':0x0,'rows':[]};var _0x15d7a0=_['map'](db[_0x99c5('0x1a')]['rawAttributes'],function(_0x235483){return{'name':_0x235483[_0x99c5('0x1b')],'type':_0x235483[_0x99c5('0x1c')]['key']};});_0x4346c4[_0x99c5('0x1d')]=_[_0x99c5('0x1e')](_0x15d7a0,_0x99c5('0x16'));_0x4346c4['query']=_[_0x99c5('0x1f')](_0x206032[_0x99c5('0x20')]);_0x4346c4[_0x99c5('0x21')]=_[_0x99c5('0x22')](_0x4346c4[_0x99c5('0x1d')],_0x4346c4[_0x99c5('0x20')]);_0x597b4a[_0x99c5('0x23')]=_[_0x99c5('0x22')](_0x4346c4[_0x99c5('0x1d')],qs['fields'](_0x206032[_0x99c5('0x20')][_0x99c5('0x24')]));_0x597b4a[_0x99c5('0x23')]=_0x597b4a[_0x99c5('0x23')][_0x99c5('0x25')]?_0x597b4a[_0x99c5('0x23')]:_0x4346c4['model'];if(!_0x206032[_0x99c5('0x20')][_0x99c5('0x26')](_0x99c5('0x27'))){_0x597b4a['limit']=qs[_0x99c5('0xe')](_0x206032['query']['limit']);_0x597b4a['offset']=qs['offset'](_0x206032[_0x99c5('0x20')][_0x99c5('0xc')]);}_0x597b4a[_0x99c5('0x28')]=qs[_0x99c5('0x29')](_0x206032[_0x99c5('0x20')][_0x99c5('0x29')]);_0x597b4a[_0x99c5('0x2a')]=qs['filters'](_[_0x99c5('0x2b')](_0x206032[_0x99c5('0x20')],_0x4346c4['filters']),_0x15d7a0);if(_0x206032[_0x99c5('0x20')][_0x99c5('0x2c')]){_0x597b4a[_0x99c5('0x2a')]=_[_0x99c5('0x2d')](_0x597b4a['where'],{'$or':_[_0x99c5('0x1e')](_0x15d7a0,function(_0x3d1251){if(_0x3d1251['type']!==_0x99c5('0x2e')){var _0x490089={};_0x490089[_0x3d1251[_0x99c5('0x16')]]={'$like':'%'+_0x206032[_0x99c5('0x20')][_0x99c5('0x2c')]+'%'};return _0x490089;}})});}_0x597b4a=_[_0x99c5('0x2d')]({},_0x597b4a,_0x206032[_0x99c5('0x2f')]);var _0x3405a7={'where':_0x597b4a[_0x99c5('0x2a')]};return db[_0x99c5('0x1a')][_0x99c5('0xf')](_0x3405a7)['then'](function(_0x5e11fb){_0x1ee82d['count']=_0x5e11fb;if(_0x206032['query'][_0x99c5('0x30')]){_0x597b4a[_0x99c5('0x31')]=[{'all':!![]}];}return db[_0x99c5('0x1a')][_0x99c5('0x32')](_0x597b4a);})[_0x99c5('0x12')](function(_0x2fb05f){_0x1ee82d['rows']=_[_0x99c5('0x1e')](_0x2fb05f,function(_0x13f50e){if(_0x13f50e[_0x99c5('0x33')]===_0x99c5('0x34')){var _0x2be319=encryptor['decryptString'](_0x13f50e[_0x99c5('0x35')]);_0x13f50e['data3']=maskClientSecret(_0x2be319);}return _0x13f50e;});return _0x1ee82d;})[_0x99c5('0x12')](respondWithFilteredResult(_0x1396e2,_0x597b4a))[_0x99c5('0x36')](handleError(_0x1396e2,null));};exports[_0x99c5('0x37')]=function(_0x371e21,_0x16c02b){var _0x348f9a={'raw':!![],'where':{'id':_0x371e21[_0x99c5('0x38')]['id']}},_0x549ac7={};_0x549ac7['model']=_[_0x99c5('0x1f')](db['CloudProvider'][_0x99c5('0x39')]);_0x549ac7[_0x99c5('0x20')]=_[_0x99c5('0x1f')](_0x371e21[_0x99c5('0x20')]);_0x549ac7[_0x99c5('0x21')]=_[_0x99c5('0x22')](_0x549ac7[_0x99c5('0x1d')],_0x549ac7[_0x99c5('0x20')]);_0x348f9a[_0x99c5('0x23')]=_['intersection'](_0x549ac7[_0x99c5('0x1d')],qs[_0x99c5('0x24')](_0x371e21[_0x99c5('0x20')][_0x99c5('0x24')]));_0x348f9a['attributes']=_0x348f9a['attributes'][_0x99c5('0x25')]?_0x348f9a[_0x99c5('0x23')]:_0x549ac7[_0x99c5('0x1d')];if(_0x371e21[_0x99c5('0x20')][_0x99c5('0x30')]){_0x348f9a['include']=[{'all':!![]}];}_0x348f9a=_['merge']({},_0x348f9a,_0x371e21[_0x99c5('0x2f')]);return db[_0x99c5('0x1a')][_0x99c5('0x3a')](_0x348f9a)[_0x99c5('0x12')](handleEntityNotFound(_0x16c02b,null))['then'](function(_0x13b83c){if(_0x13b83c[_0x99c5('0x33')]===_0x99c5('0x34')){var _0xd9978a=encryptor[_0x99c5('0x3b')](_0x13b83c[_0x99c5('0x35')]);_0x13b83c[_0x99c5('0x35')]=maskClientSecret(_0xd9978a);}return _0x13b83c;})[_0x99c5('0x12')](respondWithResult(_0x16c02b,null))[_0x99c5('0x36')](handleError(_0x16c02b,null));};exports[_0x99c5('0x3c')]=function(_0x28d21a,_0x18edaf){if(!_0x28d21a[_0x99c5('0x3d')]['name'])throw new Error(_0x99c5('0x3e'));if(!_0x28d21a['body'][_0x99c5('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5761de=db['CloudProvider'][_0x99c5('0x39')][_0x99c5('0x33')][_0x99c5('0x3f')];if(!_0x5761de[_0x99c5('0x40')](_0x28d21a[_0x99c5('0x3d')]['service']))throw new Error(_0x99c5('0x41')+_0x5761de[_0x99c5('0x42')](',\x20'));if(_0x28d21a[_0x99c5('0x3d')]['service']===_0x99c5('0x34')&&_0x28d21a[_0x99c5('0x3d')][_0x99c5('0x35')]){_0x28d21a['body']['data3']=encryptor[_0x99c5('0x43')](_0x28d21a['body'][_0x99c5('0x35')]);}return db[_0x99c5('0x1a')][_0x99c5('0x3c')](_0x28d21a[_0x99c5('0x3d')],{})[_0x99c5('0x12')](respondWithResult(_0x18edaf,0xc9))[_0x99c5('0x36')](handleError(_0x18edaf,null));};exports[_0x99c5('0x11')]=function(_0x2d2e3b,_0x5367e5){if(_0x2d2e3b[_0x99c5('0x3d')]['id']){delete _0x2d2e3b[_0x99c5('0x3d')]['id'];}return db[_0x99c5('0x1a')]['find']({'where':{'id':_0x2d2e3b[_0x99c5('0x38')]['id']}})[_0x99c5('0x12')](handleEntityNotFound(_0x5367e5,null))['then'](function(_0x35aece){if(_0x35aece[_0x99c5('0x33')]==='MicrosoftAzure'&&_0x2d2e3b['body']['data3']){_0x2d2e3b[_0x99c5('0x3d')][_0x99c5('0x35')]=encryptor['encryptString'](_0x2d2e3b[_0x99c5('0x3d')][_0x99c5('0x35')]);}return _0x35aece;})[_0x99c5('0x12')](saveUpdates(_0x2d2e3b[_0x99c5('0x3d')],null))[_0x99c5('0x12')](respondWithResult(_0x5367e5,null))['catch'](handleError(_0x5367e5,null));};exports['destroy']=function(_0x3877ba,_0xb657d4){return db[_0x99c5('0x1a')][_0x99c5('0x3a')]({'where':{'id':_0x3877ba[_0x99c5('0x38')]['id']}})[_0x99c5('0x12')](handleEntityNotFound(_0xb657d4,null))[_0x99c5('0x12')](removeEntity(_0xb657d4,null))[_0x99c5('0x36')](handleError(_0xb657d4,null));};exports[_0x99c5('0x44')]=function(_0x2d3621,_0xc73eff){return db[_0x99c5('0x1a')][_0x99c5('0x45')]({'where':{'id':_0x2d3621[_0x99c5('0x38')]['id']},'raw':!![]})[_0x99c5('0x12')](function(_0x3310c0){if(!_0x3310c0)return _0xc73eff['sendStatus'](0x194);return{'url':oauth[_0x99c5('0x46')](_0x3310c0,_0x2d3621[_0x99c5('0x47')]['id'])};})[_0x99c5('0x12')](respondWithResult(_0xc73eff,null))[_0x99c5('0x36')](handleError(_0xc73eff,null));};exports[_0x99c5('0x48')]=function(_0x2e4c0e,_0xe4c8f9){var _0x5dd88a=_0x2e4c0e[_0x99c5('0x3d')];var _0x9069b3;var _0x3f5e14;if(_0x5dd88a[_0x99c5('0x14')])throw _0x5dd88a;redis[_0x99c5('0x49')](_0x5dd88a[_0x99c5('0x4a')])['then'](function(_0x190561){if(!_0x190561)throw new Error(_0x99c5('0x4b'));_0x9069b3=JSON[_0x99c5('0x4c')](_0x190561);var _0x281e14=Buffer['from'](_0x5dd88a[_0x99c5('0x4a')],'base64')[_0x99c5('0x4d')]('ascii');_0x3f5e14=JSON[_0x99c5('0x4c')](_0x281e14);if(!oauth[_0x99c5('0x4e')](_0x5dd88a[_0x99c5('0x4f')],_0x9069b3['oauth2Claims']))throw new Error(_0x99c5('0x50'));redis[_0x99c5('0x51')](_0x5dd88a[_0x99c5('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x5dd88a[_0x99c5('0x52')],_0x9069b3);})[_0x99c5('0x12')](function(_0x5d2df4){_0x9069b3[_0x99c5('0x53')]=_0x5d2df4[_0x99c5('0x54')];_0x9069b3[_0x99c5('0x55')]=_0x5d2df4[_0x99c5('0x56')];return db[_0x99c5('0x1a')][_0x99c5('0x11')]({'data5':_0x9069b3[_0x99c5('0x53')],'data6':_0x9069b3[_0x99c5('0x55')]},{'where':{'id':_0x9069b3['id']}});})['then'](function(){oauth[_0x99c5('0x57')](_0x9069b3);socket[_0x99c5('0x58')](_0x99c5('0x59'),{'id':_0x3f5e14['id']});return;})[_0x99c5('0x12')](respondWithStatusCode(_0xe4c8f9,null))[_0x99c5('0x36')](function(_0xfaa083){if(_0x3f5e14){socket[_0x99c5('0x58')](_0x99c5('0x5a'),{'id':_0x3f5e14['id']});}if(!_0x9069b3){logger[_0x99c5('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0xfaa083);return _0xe4c8f9[_0x99c5('0xa')](0x1f4)[_0x99c5('0x17')](_0xfaa083[_0x99c5('0x5b')]);}logger[_0x99c5('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x9069b3['id'],JSON[_0x99c5('0x5c')](_0xfaa083));});};
\ No newline at end of file
+var _0x1c0d=['Content-Range','json','update','then','end','sendStatus','error','stack','name','send','padEnd','slice','CloudProvider','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','VIRTUAL','filter','includeAll','include','findAll','MicrosoftAzure','decryptString','data3','catch','params','rawAttributes','intersection','length','merge','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','state','parse','from','base64','toString','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','status','offset','undefined','count','limit','set'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c0d,0x1cf));var _0xd1c0=function(_0x1e125a,_0x4f87fe){_0x1e125a=_0x1e125a-0x0;var _0x584e68=_0x1c0d[_0x1e125a];return _0x584e68;};'use strict';var _=require(_0xd1c0('0x0'));var Redis=require(_0xd1c0('0x1'));var qs=require(_0xd1c0('0x2'));var encryptor=require(_0xd1c0('0x3'));var config=require('../../config/environment');var logger=require(_0xd1c0('0x4'))(_0xd1c0('0x5'));var db=require(_0xd1c0('0x6'))['db'];var oauth=require(_0xd1c0('0x7'));config['redis']=_[_0xd1c0('0x8')](config[_0xd1c0('0x9')],{'host':_0xd1c0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd1c0('0x9')]));var redis=new Redis(config[_0xd1c0('0x9')]);function respondWithStatusCode(_0x1a96f8,_0x260814){_0x260814=_0x260814||0xcc;return function(_0x297b79){if(_0x297b79){return _0x1a96f8['sendStatus'](_0x260814);}return _0x1a96f8[_0xd1c0('0xb')](_0x260814)['end']();};}function respondWithResult(_0x2fb513,_0x38781d){_0x38781d=_0x38781d||0xc8;return function(_0x4c90fe){if(_0x4c90fe){return _0x2fb513[_0xd1c0('0xb')](_0x38781d)['json'](_0x4c90fe);}};}function respondWithFilteredResult(_0x536ef4,_0x5cee8f){return function(_0x24d170){if(_0x24d170){var _0x533f65=typeof _0x5cee8f[_0xd1c0('0xc')]===_0xd1c0('0xd')&&typeof _0x5cee8f['limit']===_0xd1c0('0xd');var _0x5df0c6=_0x24d170[_0xd1c0('0xe')];var _0x2b3d0a=_0x533f65?0x0:_0x5cee8f[_0xd1c0('0xc')];var _0x41f7bf=_0x533f65?_0x24d170[_0xd1c0('0xe')]:_0x5cee8f['offset']+_0x5cee8f[_0xd1c0('0xf')];var _0x3ee6f8;if(_0x41f7bf>=_0x5df0c6){_0x41f7bf=_0x5df0c6;_0x3ee6f8=0xc8;}else{_0x3ee6f8=0xce;}_0x536ef4[_0xd1c0('0xb')](_0x3ee6f8);return _0x536ef4[_0xd1c0('0x10')](_0xd1c0('0x11'),_0x2b3d0a+'-'+_0x41f7bf+'/'+_0x5df0c6)[_0xd1c0('0x12')](_0x24d170);}return null;};}function saveUpdates(_0x138eb9){return function(_0xf754c6){if(_0xf754c6){return _0xf754c6[_0xd1c0('0x13')](_0x138eb9)[_0xd1c0('0x14')](function(_0x134216){return _0x134216;});}return null;};}function removeEntity(_0x148f1b){return function(_0x20d068){if(_0x20d068){return _0x20d068['destroy']()['then'](function(){_0x148f1b['status'](0xcc)[_0xd1c0('0x15')]();});}};}function handleEntityNotFound(_0x10cd44){return function(_0x559edb){if(!_0x559edb){_0x10cd44[_0xd1c0('0x16')](0x194);}return _0x559edb;};}function handleError(_0x321b9a,_0x544f3b){_0x544f3b=_0x544f3b||0x1f4;return function(_0x3e404d){logger[_0xd1c0('0x17')](_0x3e404d[_0xd1c0('0x18')]);if(_0x3e404d['name']){delete _0x3e404d[_0xd1c0('0x19')];}_0x321b9a[_0xd1c0('0xb')](_0x544f3b)[_0xd1c0('0x1a')](_0x3e404d);};}function maskClientSecret(_0x3fcbd2){return _[_0xd1c0('0x1b')](_0x3fcbd2[_0xd1c0('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4ab7d2,_0x43d457){var _0x35742d={},_0x47a8c6={},_0x55b4cc={'count':0x0,'rows':[]};var _0x54d00a=_['map'](db[_0xd1c0('0x1d')]['rawAttributes'],function(_0x546a1e){return{'name':_0x546a1e[_0xd1c0('0x1e')],'type':_0x546a1e[_0xd1c0('0x1f')][_0xd1c0('0x20')]};});_0x47a8c6[_0xd1c0('0x21')]=_[_0xd1c0('0x22')](_0x54d00a,_0xd1c0('0x19'));_0x47a8c6[_0xd1c0('0x23')]=_[_0xd1c0('0x24')](_0x4ab7d2['query']);_0x47a8c6[_0xd1c0('0x25')]=_['intersection'](_0x47a8c6[_0xd1c0('0x21')],_0x47a8c6[_0xd1c0('0x23')]);_0x35742d[_0xd1c0('0x26')]=_['intersection'](_0x47a8c6['model'],qs['fields'](_0x4ab7d2[_0xd1c0('0x23')][_0xd1c0('0x27')]));_0x35742d[_0xd1c0('0x26')]=_0x35742d[_0xd1c0('0x26')]['length']?_0x35742d[_0xd1c0('0x26')]:_0x47a8c6[_0xd1c0('0x21')];if(!_0x4ab7d2['query'][_0xd1c0('0x28')](_0xd1c0('0x29'))){_0x35742d[_0xd1c0('0xf')]=qs[_0xd1c0('0xf')](_0x4ab7d2[_0xd1c0('0x23')][_0xd1c0('0xf')]);_0x35742d['offset']=qs[_0xd1c0('0xc')](_0x4ab7d2[_0xd1c0('0x23')][_0xd1c0('0xc')]);}_0x35742d[_0xd1c0('0x2a')]=qs['sort'](_0x4ab7d2[_0xd1c0('0x23')]['sort']);_0x35742d[_0xd1c0('0x2b')]=qs[_0xd1c0('0x25')](_['pick'](_0x4ab7d2[_0xd1c0('0x23')],_0x47a8c6[_0xd1c0('0x25')]),_0x54d00a);if(_0x4ab7d2[_0xd1c0('0x23')]['filter']){_0x35742d[_0xd1c0('0x2b')]=_['merge'](_0x35742d['where'],{'$or':_[_0xd1c0('0x22')](_0x54d00a,function(_0x9f57f7){if(_0x9f57f7[_0xd1c0('0x1f')]!==_0xd1c0('0x2c')){var _0x3a7653={};_0x3a7653[_0x9f57f7[_0xd1c0('0x19')]]={'$like':'%'+_0x4ab7d2[_0xd1c0('0x23')][_0xd1c0('0x2d')]+'%'};return _0x3a7653;}})});}_0x35742d=_['merge']({},_0x35742d,_0x4ab7d2['options']);var _0x37fb9e={'where':_0x35742d[_0xd1c0('0x2b')]};return db[_0xd1c0('0x1d')][_0xd1c0('0xe')](_0x37fb9e)[_0xd1c0('0x14')](function(_0x2e2be4){_0x55b4cc[_0xd1c0('0xe')]=_0x2e2be4;if(_0x4ab7d2['query'][_0xd1c0('0x2e')]){_0x35742d[_0xd1c0('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xd1c0('0x30')](_0x35742d);})[_0xd1c0('0x14')](function(_0x5f5bb3){_0x55b4cc['rows']=_[_0xd1c0('0x22')](_0x5f5bb3,function(_0x7c2a19){if(_0x7c2a19['service']===_0xd1c0('0x31')){var _0x13fb68=encryptor[_0xd1c0('0x32')](_0x7c2a19[_0xd1c0('0x33')]);_0x7c2a19[_0xd1c0('0x33')]=maskClientSecret(_0x13fb68);}return _0x7c2a19;});return _0x55b4cc;})[_0xd1c0('0x14')](respondWithFilteredResult(_0x43d457,_0x35742d))[_0xd1c0('0x34')](handleError(_0x43d457,null));};exports['show']=function(_0x32d5c7,_0xbbd326){var _0x1e34b7={'raw':!![],'where':{'id':_0x32d5c7[_0xd1c0('0x35')]['id']}},_0x25725e={};_0x25725e['model']=_[_0xd1c0('0x24')](db[_0xd1c0('0x1d')][_0xd1c0('0x36')]);_0x25725e[_0xd1c0('0x23')]=_['keys'](_0x32d5c7[_0xd1c0('0x23')]);_0x25725e['filters']=_[_0xd1c0('0x37')](_0x25725e[_0xd1c0('0x21')],_0x25725e[_0xd1c0('0x23')]);_0x1e34b7[_0xd1c0('0x26')]=_['intersection'](_0x25725e['model'],qs[_0xd1c0('0x27')](_0x32d5c7[_0xd1c0('0x23')]['fields']));_0x1e34b7['attributes']=_0x1e34b7['attributes'][_0xd1c0('0x38')]?_0x1e34b7[_0xd1c0('0x26')]:_0x25725e[_0xd1c0('0x21')];if(_0x32d5c7[_0xd1c0('0x23')][_0xd1c0('0x2e')]){_0x1e34b7[_0xd1c0('0x2f')]=[{'all':!![]}];}_0x1e34b7=_[_0xd1c0('0x39')]({},_0x1e34b7,_0x32d5c7[_0xd1c0('0x3a')]);return db[_0xd1c0('0x1d')][_0xd1c0('0x3b')](_0x1e34b7)[_0xd1c0('0x14')](handleEntityNotFound(_0xbbd326,null))[_0xd1c0('0x14')](function(_0x3d2bd3){if(_0x3d2bd3[_0xd1c0('0x3c')]===_0xd1c0('0x31')){var _0x449284=encryptor[_0xd1c0('0x32')](_0x3d2bd3[_0xd1c0('0x33')]);_0x3d2bd3[_0xd1c0('0x33')]=maskClientSecret(_0x449284);}return _0x3d2bd3;})[_0xd1c0('0x14')](respondWithResult(_0xbbd326,null))['catch'](handleError(_0xbbd326,null));};exports[_0xd1c0('0x3d')]=function(_0x12625f,_0x5ea16d){if(!_0x12625f[_0xd1c0('0x3e')][_0xd1c0('0x19')])throw new Error(_0xd1c0('0x3f'));if(!_0x12625f[_0xd1c0('0x3e')][_0xd1c0('0x3c')])throw new Error(_0xd1c0('0x40'));var _0x3d7e7d=db[_0xd1c0('0x1d')][_0xd1c0('0x36')][_0xd1c0('0x3c')][_0xd1c0('0x41')];if(!_0x3d7e7d[_0xd1c0('0x42')](_0x12625f[_0xd1c0('0x3e')][_0xd1c0('0x3c')]))throw new Error(_0xd1c0('0x43')+_0x3d7e7d[_0xd1c0('0x44')](',\x20'));if(_0x12625f['body'][_0xd1c0('0x3c')]===_0xd1c0('0x31')&&_0x12625f[_0xd1c0('0x3e')][_0xd1c0('0x33')]){_0x12625f['body']['data3']=encryptor[_0xd1c0('0x45')](_0x12625f[_0xd1c0('0x3e')][_0xd1c0('0x33')]);}return db[_0xd1c0('0x1d')][_0xd1c0('0x3d')](_0x12625f['body'],{})['then'](respondWithResult(_0x5ea16d,0xc9))[_0xd1c0('0x34')](handleError(_0x5ea16d,null));};exports[_0xd1c0('0x13')]=function(_0x48590a,_0xce774f){if(_0x48590a['body']['id']){delete _0x48590a[_0xd1c0('0x3e')]['id'];}return db[_0xd1c0('0x1d')][_0xd1c0('0x3b')]({'where':{'id':_0x48590a[_0xd1c0('0x35')]['id']}})[_0xd1c0('0x14')](handleEntityNotFound(_0xce774f,null))['then'](function(_0x16b524){if(_0x16b524[_0xd1c0('0x3c')]===_0xd1c0('0x31')&&_0x48590a['body']['data3']){_0x48590a[_0xd1c0('0x3e')][_0xd1c0('0x33')]=encryptor[_0xd1c0('0x45')](_0x48590a[_0xd1c0('0x3e')]['data3']);}return _0x16b524;})['then'](saveUpdates(_0x48590a[_0xd1c0('0x3e')],null))['then'](respondWithResult(_0xce774f,null))[_0xd1c0('0x34')](handleError(_0xce774f,null));};exports[_0xd1c0('0x46')]=function(_0x215cc1,_0x3ab1f4){return db[_0xd1c0('0x1d')][_0xd1c0('0x3b')]({'where':{'id':_0x215cc1[_0xd1c0('0x35')]['id']}})['then'](handleEntityNotFound(_0x3ab1f4,null))[_0xd1c0('0x14')](removeEntity(_0x3ab1f4,null))[_0xd1c0('0x34')](handleError(_0x3ab1f4,null));};exports[_0xd1c0('0x47')]=function(_0x39753d,_0x3d86a0){return db[_0xd1c0('0x1d')][_0xd1c0('0x48')]({'where':{'id':_0x39753d[_0xd1c0('0x35')]['id']},'raw':!![]})[_0xd1c0('0x14')](function(_0x3fcb91){if(!_0x3fcb91)return _0x3d86a0['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3fcb91,_0x39753d[_0xd1c0('0x49')]['id'])};})[_0xd1c0('0x14')](respondWithResult(_0x3d86a0,null))[_0xd1c0('0x34')](handleError(_0x3d86a0,null));};exports[_0xd1c0('0x4a')]=function(_0x1138ce,_0x347f40){var _0x4079db=_0x1138ce[_0xd1c0('0x3e')];var _0xf3f99a;var _0x2cb120;if(_0x4079db[_0xd1c0('0x17')])throw _0x4079db;redis['get'](_0x4079db[_0xd1c0('0x4b')])['then'](function(_0x53828f){if(!_0x53828f)throw new Error('Invalid\x20state\x20parameter');_0xf3f99a=JSON[_0xd1c0('0x4c')](_0x53828f);var _0xe97fd5=Buffer[_0xd1c0('0x4d')](_0x4079db[_0xd1c0('0x4b')],_0xd1c0('0x4e'))[_0xd1c0('0x4f')]('ascii');_0x2cb120=JSON[_0xd1c0('0x4c')](_0xe97fd5);if(!oauth['isValidIdToken'](_0x4079db[_0xd1c0('0x50')],_0xf3f99a[_0xd1c0('0x51')]))throw new Error(_0xd1c0('0x52'));redis[_0xd1c0('0x53')](_0x4079db[_0xd1c0('0x4b')]);return oauth[_0xd1c0('0x54')](_0x4079db['code'],_0xf3f99a);})[_0xd1c0('0x14')](function(_0x2dd9cf){_0xf3f99a['data5']=_0x2dd9cf[_0xd1c0('0x55')];_0xf3f99a[_0xd1c0('0x56')]=_0x2dd9cf[_0xd1c0('0x57')];return db[_0xd1c0('0x1d')][_0xd1c0('0x13')]({'data5':_0xf3f99a[_0xd1c0('0x58')],'data6':_0xf3f99a[_0xd1c0('0x56')]},{'where':{'id':_0xf3f99a['id']}});})['then'](function(){oauth[_0xd1c0('0x59')](_0xf3f99a);socket[_0xd1c0('0x5a')](_0xd1c0('0x5b'),{'id':_0x2cb120['id']});return;})[_0xd1c0('0x14')](respondWithStatusCode(_0x347f40,null))[_0xd1c0('0x34')](function(_0x365365){if(_0x2cb120){socket[_0xd1c0('0x5a')](_0xd1c0('0x5c'),{'id':_0x2cb120['id']});}if(!_0xf3f99a){logger[_0xd1c0('0x17')](_0xd1c0('0x5d'),_0x365365);return _0x347f40[_0xd1c0('0xb')](0x1f4)[_0xd1c0('0x1a')](_0x365365[_0xd1c0('0x5e')]);}logger[_0xd1c0('0x17')](_0xd1c0('0x5f'),_0xf3f99a['id'],JSON['stringify'](_0x365365));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0f29706..edb7434 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 _0x0ac2=['../../config/logger','api','moment','request-promise','path','../../config/environment','CloudProvider'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0x0ac2,0x15e));var _0x20ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ac2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x20ac('0x0'))(_0x20ac('0x1'));var moment=require(_0x20ac('0x2'));var BPromise=require('bluebird');var rp=require(_0x20ac('0x3'));var fs=require('fs');var path=require(_0x20ac('0x4'));var rimraf=require('rimraf');var config=require(_0x20ac('0x5'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x75ed64,_0x294ca6){return _0x75ed64['define'](_0x20ac('0x6'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f27=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x555e05,_0x21c425){var _0x1d4250=function(_0x37f705){while(--_0x37f705){_0x555e05['push'](_0x555e05['shift']());}};_0x1d4250(++_0x21c425);}(_0x7f27,0x142));var _0x77f2=function(_0x1cb272,_0x325587){_0x1cb272=_0x1cb272-0x0;var _0x5a6857=_0x7f27[_0x1cb272];return _0x5a6857;};'use strict';var _=require(_0x77f2('0x0'));var util=require('util');var logger=require(_0x77f2('0x1'))(_0x77f2('0x2'));var moment=require(_0x77f2('0x3'));var BPromise=require(_0x77f2('0x4'));var rp=require(_0x77f2('0x5'));var fs=require('fs');var path=require(_0x77f2('0x6'));var rimraf=require(_0x77f2('0x7'));var config=require(_0x77f2('0x8'));var attributes=require(_0x77f2('0x9'));module[_0x77f2('0xa')]=function(_0xd3661d,_0x149515){return _0xd3661d[_0x77f2('0xb')](_0x77f2('0xc'),attributes,{'tableName':_0x77f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7d778c6..e944e70 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa26d=['findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','/.default','join','Outlook365','Dynamics365','data7','replace','{TENANT_ID}','data2','code','from','base64','randomBytes','toString','hex','client_id','data1','redirect_uri','form_post','state','nonce','prompt','map','key','value','oauth2Claims','oauth2/','set','stringify','payload','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider'];(function(_0x9cdbe2,_0x5d2fa2){var _0x4e0f87=function(_0x224cc4){while(--_0x224cc4){_0x9cdbe2['push'](_0x9cdbe2['shift']());}};_0x4e0f87(++_0x5d2fa2);}(_0xa26d,0x108));var _0xda26=function(_0x5ef2b7,_0xfec6f9){_0x5ef2b7=_0x5ef2b7-0x0;var _0x1c5ef4=_0xa26d[_0x5ef2b7];return _0x1c5ef4;};'use strict';var _=require('lodash');var crypto=require(_0xda26('0x0'));var jwt=require(_0xda26('0x1'));var moment=require(_0xda26('0x2'));var Redis=require(_0xda26('0x3'));var rp=require(_0xda26('0x4'));var util=require(_0xda26('0x5'));var encryptor=require(_0xda26('0x6'));var config=require(_0xda26('0x7'));var logger=require(_0xda26('0x8'))(_0xda26('0x9'));var schedule=require(_0xda26('0xa'));var db=require(_0xda26('0xb'))['db'];config[_0xda26('0xc')]=_['defaults'](config[_0xda26('0xc')],{'host':_0xda26('0xd'),'port':0x18eb});var redis=new Redis(config[_0xda26('0xc')]);var MICROSOFT_AUTH_URL=_0xda26('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xda26('0xf'),_0xda26('0x10'),_0xda26('0x11'),'offline_access',_0xda26('0x12'),_0xda26('0x13'),_0xda26('0x14')],'Dynamics365':[_0xda26('0xf'),_0xda26('0x15')]};var MICROSOFT_AUTH_ENDPOINT=_0xda26('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0xda26('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xf832b2){var _0x3fb91f=_['map'](AZURE_AUTH_SCOPES[_0xf832b2[_0xda26('0x18')]]);if(_0xf832b2[_0xda26('0x18')]==='Dynamics365')_0x3fb91f[_0xda26('0x19')](_0xf832b2['data7']+_0xda26('0x1a'));return _0x3fb91f[_0xda26('0x1b')]('\x20');}function getAccessTokenScope(_0xe60e1){if(_0xe60e1['type']===_0xda26('0x1c'))return _0xda26('0x12');if(_0xe60e1[_0xda26('0x18')]===_0xda26('0x1d'))return _0xe60e1[_0xda26('0x1e')]+_0xda26('0x1a');}function generateMicrosoftAuthorizationUrl(_0x3d6434,_0x94274d){var _0x439410=MICROSOFT_AUTH_URL[_0xda26('0x1f')](_0xda26('0x20'),_0x3d6434[_0xda26('0x21')]);var _0x2ca64c=[_0xda26('0x22'),'id_token'];var _0xc6f7d8=Buffer[_0xda26('0x23')](JSON['stringify']({'id':_0x94274d}))['toString'](_0xda26('0x24'));var _0x282383=crypto[_0xda26('0x25')](0x10)[_0xda26('0x26')](_0xda26('0x27'));var _0x41bb92=getAuthorizationScopes(_0x3d6434);var _0x1f4a00=[{'key':_0xda26('0x28'),'value':_0x3d6434[_0xda26('0x29')]},{'key':'response_type','value':encodeURIComponent(_0x2ca64c[_0xda26('0x1b')]('\x20'))},{'key':_0xda26('0x2a'),'value':_0x3d6434['data4']},{'key':'response_mode','value':_0xda26('0x2b')},{'key':'scope','value':encodeURIComponent(_0x41bb92)},{'key':_0xda26('0x2c'),'value':_0xc6f7d8},{'key':_0xda26('0x2d'),'value':_0x282383},{'key':_0xda26('0x2e'),'value':'login'}];var _0x88e17d=_0x439410+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xda26('0x2f')](_0x1f4a00,function(_0x2e2add){return _0x2e2add[_0xda26('0x30')]+'='+_0x2e2add[_0xda26('0x31')];})[_0xda26('0x1b')]('&');_0x3d6434[_0xda26('0x32')]={'issuer':_0x439410[_0xda26('0x1f')](_0xda26('0x33'),''),'audience':_0x3d6434[_0xda26('0x29')],'state':_0xc6f7d8,'nonce':_0x282383};redis[_0xda26('0x34')](_0xc6f7d8,JSON[_0xda26('0x35')](_0x3d6434));return _0x88e17d;}function isValidIdToken(_0x4c6972,_0x46ef95){try{var _0x422a7b=jwt['decode'](_0x4c6972,{'complete':!![]});var _0x2949d3=_0x422a7b[_0xda26('0x36')];if(_0x2949d3['iss']!==_0x46ef95['issuer'])return![];if(_0x2949d3[_0xda26('0x37')]!==_0x46ef95[_0xda26('0x38')])return![];if(_0x2949d3[_0xda26('0x2d')]!==_0x46ef95[_0xda26('0x2d')])return![];if(moment()[_0xda26('0x39')](moment[_0xda26('0x3a')](_0x2949d3[_0xda26('0x3b')])))return![];return!![];}catch(_0x404abe){throw _0x404abe;}}function refreshOauth2MicrosoftAccessToken(_0x4b1d89){return Promise[_0xda26('0x3c')]()[_0xda26('0x3d')](function(){if(_0x4b1d89[_0xda26('0x3e')])return _0x4b1d89;return db[_0xda26('0x3f')][_0xda26('0x40')]({'where':{'id':_0x4b1d89['id']},'raw':!![]});})[_0xda26('0x3d')](function(_0x4969b0){var _0x23cc98={'grant_type':_0xda26('0x41'),'refresh_token':_0x4969b0[_0xda26('0x42')],'scope':getAccessTokenScope(_0x4969b0),'redirect_uri':_0x4969b0[_0xda26('0x43')],'client_id':_0x4969b0[_0xda26('0x29')],'client_secret':encryptor[_0xda26('0x44')](_0x4969b0[_0xda26('0x3e')])};var _0x51ed92={'method':_0xda26('0x45'),'uri':MICROSOFT_AUTH_URL[_0xda26('0x1f')]('{TENANT_ID}',_0x4969b0[_0xda26('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x23cc98,'json':!![]};return rp(_0x51ed92);})['then'](function(_0x2f7eca){_0x4b1d89[_0xda26('0x46')]=_0x2f7eca[_0xda26('0x47')];_0x4b1d89[_0xda26('0x42')]=_0x2f7eca['refresh_token'];return db['CloudProvider'][_0xda26('0x48')]({'data5':_0x4b1d89[_0xda26('0x46')],'data6':_0x4b1d89[_0xda26('0x42')]},{'where':{'id':_0x4b1d89['id']}});})['then'](function(){return _0x4b1d89;})[_0xda26('0x49')](function(_0x15d0fb){logger['error'](_0xda26('0x4a'),_0x4b1d89['id'],_0x15d0fb);});}function getOauth2MicrosoftAccessToken(_0x50bb53,_0x2cc2c1){var _0x28273a={'grant_type':'authorization_code','code':_0x50bb53,'scope':getAccessTokenScope(_0x2cc2c1),'redirect_uri':_0x2cc2c1[_0xda26('0x43')],'client_id':_0x2cc2c1[_0xda26('0x29')],'client_secret':encryptor[_0xda26('0x44')](_0x2cc2c1['data3'])};var _0x557048={'method':_0xda26('0x45'),'uri':MICROSOFT_AUTH_URL[_0xda26('0x1f')]('{TENANT_ID}',_0x2cc2c1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28273a,'json':!![]};return rp(_0x557048);}function startRefreshInterval(_0x5726de){var _0x2f49dd=schedule[_0xda26('0x4b')];if(_0x2f49dd[_0x5726de['id']])clearInterval(_0x2f49dd[_0x5726de['id']]);_0x2f49dd[_0x5726de['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xda26('0x4c')](this,{'id':_0x5726de['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xda26('0x4b')]=_0x2f49dd;}function startAllRefreshIntervals(){return db[_0xda26('0x3f')][_0xda26('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x45090f){var _0x52094f=_0x45090f[_0xda26('0x2f')](function(_0x24e86a){return refreshOauth2MicrosoftAccessToken(_0x24e86a)[_0xda26('0x3d')](function(_0x2797d5){startRefreshInterval(_0x2797d5);});});return Promise[_0xda26('0x4e')](_0x52094f);})[_0xda26('0x49')](function(_0x23d2a9){var _0x1b21b9=_0x23d2a9?util['inspect'](_0x23d2a9,{'showHidden':![],'depth':null}):'';logger[_0xda26('0x4f')](_0xda26('0x50'),_0x1b21b9);});}module[_0xda26('0x51')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8f3d=['stringify','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','value','join','oauth2Claims','decode','payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data1','bind','intervals','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','id_token'];(function(_0x5676d3,_0x582062){var _0x573736=function(_0x3760bc){while(--_0x3760bc){_0x5676d3['push'](_0x5676d3['shift']());}};_0x573736(++_0x582062);}(_0x8f3d,0xbf));var _0xd8f3=function(_0x59617b,_0x3f3fbd){_0x59617b=_0x59617b-0x0;var _0xa9b90b=_0x8f3d[_0x59617b];return _0xa9b90b;};'use strict';var _=require('lodash');var crypto=require(_0xd8f3('0x0'));var jwt=require(_0xd8f3('0x1'));var moment=require(_0xd8f3('0x2'));var Redis=require(_0xd8f3('0x3'));var rp=require(_0xd8f3('0x4'));var util=require(_0xd8f3('0x5'));var encryptor=require(_0xd8f3('0x6'));var config=require(_0xd8f3('0x7'));var logger=require('../../config/logger')(_0xd8f3('0x8'));var schedule=require(_0xd8f3('0x9'));var db=require(_0xd8f3('0xa'))['db'];config[_0xd8f3('0xb')]=_[_0xd8f3('0xc')](config[_0xd8f3('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xd8f3('0xd'),_0xd8f3('0xe'),_0xd8f3('0xf'),'offline_access',_0xd8f3('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xd8f3('0x11')],'Dynamics365':[_0xd8f3('0xd'),_0xd8f3('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xd8f3('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xd8f3('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x9a72fe){var _0x25e255=_[_0xd8f3('0x15')](AZURE_AUTH_SCOPES[_0x9a72fe['type']]);if(_0x9a72fe[_0xd8f3('0x16')]==='Dynamics365')_0x25e255['push'](_0x9a72fe[_0xd8f3('0x17')]+_0xd8f3('0x18'));return _0x25e255['join']('\x20');}function getAccessTokenScope(_0x186f33){if(_0x186f33[_0xd8f3('0x16')]===_0xd8f3('0x19'))return _0xd8f3('0x10');if(_0x186f33[_0xd8f3('0x16')]==='Dynamics365')return _0x186f33['data7']+_0xd8f3('0x18');}function generateMicrosoftAuthorizationUrl(_0x37f057,_0x41c4ec){var _0x11e56e=MICROSOFT_AUTH_URL[_0xd8f3('0x1a')](_0xd8f3('0x1b'),_0x37f057[_0xd8f3('0x1c')]);var _0xeac49f=[_0xd8f3('0x1d'),_0xd8f3('0x1e')];var _0x2c0a21=Buffer['from'](JSON[_0xd8f3('0x1f')]({'id':_0x41c4ec}))['toString'](_0xd8f3('0x20'));var _0xaa55e9=crypto[_0xd8f3('0x21')](0x10)['toString'](_0xd8f3('0x22'));var _0x3c94e6=getAuthorizationScopes(_0x37f057);var _0x396977=[{'key':_0xd8f3('0x23'),'value':_0x37f057['data1']},{'key':_0xd8f3('0x24'),'value':encodeURIComponent(_0xeac49f['join']('\x20'))},{'key':_0xd8f3('0x25'),'value':_0x37f057[_0xd8f3('0x26')]},{'key':'response_mode','value':_0xd8f3('0x27')},{'key':_0xd8f3('0x28'),'value':encodeURIComponent(_0x3c94e6)},{'key':_0xd8f3('0x29'),'value':_0x2c0a21},{'key':_0xd8f3('0x2a'),'value':_0xaa55e9},{'key':_0xd8f3('0x2b'),'value':'login'}];var _0x56e648=_0x11e56e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd8f3('0x15')](_0x396977,function(_0x5c6e34){return _0x5c6e34['key']+'='+_0x5c6e34[_0xd8f3('0x2c')];})[_0xd8f3('0x2d')]('&');_0x37f057[_0xd8f3('0x2e')]={'issuer':_0x11e56e['replace']('oauth2/',''),'audience':_0x37f057['data1'],'state':_0x2c0a21,'nonce':_0xaa55e9};redis['set'](_0x2c0a21,JSON[_0xd8f3('0x1f')](_0x37f057));return _0x56e648;}function isValidIdToken(_0x213334,_0x2495d6){try{var _0x2ff04d=jwt[_0xd8f3('0x2f')](_0x213334,{'complete':!![]});var _0x21d598=_0x2ff04d[_0xd8f3('0x30')];if(_0x21d598[_0xd8f3('0x31')]!==_0x2495d6[_0xd8f3('0x32')])return![];if(_0x21d598[_0xd8f3('0x33')]!==_0x2495d6[_0xd8f3('0x34')])return![];if(_0x21d598['nonce']!==_0x2495d6['nonce'])return![];if(moment()[_0xd8f3('0x35')](moment['unix'](_0x21d598[_0xd8f3('0x36')])))return![];return!![];}catch(_0x2a39d0){throw _0x2a39d0;}}function refreshOauth2MicrosoftAccessToken(_0x4258da){return Promise[_0xd8f3('0x37')]()[_0xd8f3('0x38')](function(){if(_0x4258da[_0xd8f3('0x39')])return _0x4258da;return db[_0xd8f3('0x3a')]['findOne']({'where':{'id':_0x4258da['id']},'raw':!![]});})[_0xd8f3('0x38')](function(_0x4b76d8){var _0x341ad3={'grant_type':_0xd8f3('0x3b'),'refresh_token':_0x4b76d8[_0xd8f3('0x3c')],'scope':getAccessTokenScope(_0x4b76d8),'redirect_uri':_0x4b76d8[_0xd8f3('0x26')],'client_id':_0x4b76d8['data1'],'client_secret':encryptor[_0xd8f3('0x3d')](_0x4b76d8['data3'])};var _0x41e4bb={'method':_0xd8f3('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xd8f3('0x1a')](_0xd8f3('0x1b'),_0x4b76d8[_0xd8f3('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x341ad3,'json':!![]};return rp(_0x41e4bb);})[_0xd8f3('0x38')](function(_0x16c070){_0x4258da[_0xd8f3('0x3f')]=_0x16c070['access_token'];_0x4258da['data6']=_0x16c070[_0xd8f3('0x3b')];return db['CloudProvider'][_0xd8f3('0x40')]({'data5':_0x4258da[_0xd8f3('0x3f')],'data6':_0x4258da[_0xd8f3('0x3c')]},{'where':{'id':_0x4258da['id']}});})[_0xd8f3('0x38')](function(){return _0x4258da;})[_0xd8f3('0x41')](function(_0x44d2d9){logger[_0xd8f3('0x42')](_0xd8f3('0x43'),_0x4258da['id'],_0x44d2d9);});}function getOauth2MicrosoftAccessToken(_0x240a7f,_0x12b8d8){var _0x276d23={'grant_type':'authorization_code','code':_0x240a7f,'scope':getAccessTokenScope(_0x12b8d8),'redirect_uri':_0x12b8d8[_0xd8f3('0x26')],'client_id':_0x12b8d8[_0xd8f3('0x44')],'client_secret':encryptor[_0xd8f3('0x3d')](_0x12b8d8[_0xd8f3('0x39')])};var _0x4ac142={'method':_0xd8f3('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xd8f3('0x1a')]('{TENANT_ID}',_0x12b8d8[_0xd8f3('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x276d23,'json':!![]};return rp(_0x4ac142);}function startRefreshInterval(_0x45aa9d){var _0x4fbb6f=schedule['intervals'];if(_0x4fbb6f[_0x45aa9d['id']])clearInterval(_0x4fbb6f[_0x45aa9d['id']]);_0x4fbb6f[_0x45aa9d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd8f3('0x45')](this,{'id':_0x45aa9d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd8f3('0x46')]=_0x4fbb6f;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4678c7){var _0x1eeed4=_0x4678c7[_0xd8f3('0x15')](function(_0x15fa8c){return refreshOauth2MicrosoftAccessToken(_0x15fa8c)[_0xd8f3('0x38')](function(_0x10e7df){startRefreshInterval(_0x10e7df);});});return Promise[_0xd8f3('0x47')](_0x1eeed4);})['catch'](function(_0x48e457){var _0x5a06d9=_0x48e457?util['inspect'](_0x48e457,{'showHidden':![],'depth':null}):'';logger[_0xd8f3('0x42')](_0xd8f3('0x48'),_0x5a06d9);});}module[_0xd8f3('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index a7fdb94..c666284 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 _0xba5a=['error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x4c0de6,_0x4f95d0){var _0x47795b=function(_0x27a7fb){while(--_0x27a7fb){_0x4c0de6['push'](_0x4c0de6['shift']());}};_0x47795b(++_0x4f95d0);}(_0xba5a,0x1d0));var _0xaba5=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xba5a[_0x4a9beb];return _0x2d4c58;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var moment=require(_0xaba5('0x1'));var BPromise=require(_0xaba5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaba5('0x3'))['db'];var utils=require(_0xaba5('0x4'));var logger=require(_0xaba5('0x5'))(_0xaba5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaba5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e6b46,_0x2ef868,_0x1dba58){return new BPromise(function(_0x3772a2,_0x45f5ea){return client[_0xaba5('0x8')](_0x5e6b46,_0x1dba58)['then'](function(_0x3be776){logger[_0xaba5('0x9')](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));logger[_0xaba5('0xc')](_0xaba5('0xd'),_0x2ef868,_0xaba5('0xb'),JSON[_0xaba5('0xe')](_0x3be776));if(_0x3be776['error']){if(_0x3be776['error'][_0xaba5('0xf')]===0x1f4){logger['error'](_0xaba5('0xa'),_0x2ef868,_0x3be776['error']['message']);return _0x45f5ea(_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);}logger[_0xaba5('0x10')](_0xaba5('0xa'),_0x2ef868,_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);return _0x3772a2(_0x3be776[_0xaba5('0x10')]['message']);}else{logger['info'](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));_0x3772a2(_0x3be776[_0xaba5('0x12')][_0xaba5('0x11')]);}})[_0xaba5('0x13')](function(_0x53ec3c){logger[_0xaba5('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2ef868,_0x53ec3c);_0x45f5ea(_0x53ec3c);});});}
\ No newline at end of file
+var _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb2af,0xd2));var _0xfb2a=function(_0x53b70f,_0x2f4571){_0x53b70f=_0x53b70f-0x0;var _0x169483=_0xb2af[_0x53b70f];return _0x169483;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f07556e..1523ff3 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x3c9ca5,_0x25cbbf){var _0x515ebe=function(_0x2e3b18){while(--_0x2e3b18){_0x3c9ca5['push'](_0x3c9ca5['shift']());}};_0x515ebe(++_0x25cbbf);}(_0xadb5,0xad));var _0x5adb=function(_0x493c72,_0x2018d6){_0x493c72=_0x493c72-0x0;var _0x1924aa=_0xadb5[_0x493c72];return _0x1924aa;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa44713,_0x785a44){_0xa44713=_0xa44713-0x0;var _0x214686=_0x5f2f[_0xa44713];return _0x214686;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 7240263..fd87609 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 _0xba4d=['STRING','name','sequelize'];(function(_0x1012a0,_0x52bc09){var _0xf439d1=function(_0x33c572){while(--_0x33c572){_0x1012a0['push'](_0x1012a0['shift']());}};_0xf439d1(++_0x52bc09);}(_0xba4d,0x15b));var _0xdba4=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xba4d[_0x555b2f];return _0x81c0a6;};'use strict';var Sequelize=require(_0xdba4('0x0'));module['exports']={'name':{'type':Sequelize[_0xdba4('0x1')],'unique':_0xdba4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xdba4('0x1')]},'website':{'type':Sequelize[_0xdba4('0x1')]},'phone':{'type':Sequelize[_0xdba4('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xdba4('0x1')]},'postalCode':{'type':Sequelize[_0xdba4('0x1')]},'city':{'type':Sequelize[_0xdba4('0x1')]},'country':{'type':Sequelize[_0xdba4('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xdba4('0x1')]},'sCity':{'type':Sequelize[_0xdba4('0x1')]},'sCountry':{'type':Sequelize[_0xdba4('0x1')]},'description':{'type':Sequelize[_0xdba4('0x1')]}};
\ No newline at end of file
+var _0x08dc=['STRING','name','sequelize'];(function(_0x5566bc,_0x2dcdb4){var _0x4cca9a=function(_0x113225){while(--_0x113225){_0x5566bc['push'](_0x5566bc['shift']());}};_0x4cca9a(++_0x2dcdb4);}(_0x08dc,0x1e8));var _0xc08d=function(_0x1632a9,_0x36f4a3){_0x1632a9=_0x1632a9-0x0;var _0x33ddf1=_0x08dc[_0x1632a9];return _0x33ddf1;};'use strict';var Sequelize=require(_0xc08d('0x0'));module['exports']={'name':{'type':Sequelize[_0xc08d('0x1')],'unique':_0xc08d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc08d('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc08d('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc08d('0x1')]},'type':{'type':Sequelize[_0xc08d('0x1')]},'street':{'type':Sequelize[_0xc08d('0x1')]},'postalCode':{'type':Sequelize[_0xc08d('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc08d('0x1')]},'email':{'type':Sequelize[_0xc08d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xc08d('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc08d('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1925dd6..d090bb6 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 _0x1ccb=['stack','name','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','merge','where','map','filter','options','count','rows','catch','params','rawAttributes','length','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','omit','ids','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','Companies','UserProfileResource','error'];(function(_0x4548ca,_0x4b9074){var _0x45f913=function(_0x16dd4d){while(--_0x16dd4d){_0x4548ca['push'](_0x4548ca['shift']());}};_0x45f913(++_0x4b9074);}(_0x1ccb,0x178));var _0xb1cc=function(_0xf8408d,_0x2c374c){_0xf8408d=_0xf8408d-0x0;var _0x4d0fa2=_0x1ccb[_0xf8408d];return _0x4d0fa2;};'use strict';var emlformat=require(_0xb1cc('0x0'));var rimraf=require(_0xb1cc('0x1'));var zipdir=require(_0xb1cc('0x2'));var jsonpatch=require(_0xb1cc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1cc('0x4'));var util=require(_0xb1cc('0x5'));var path=require('path');var sox=require(_0xb1cc('0x6'));var csv=require(_0xb1cc('0x7'));var ejs=require(_0xb1cc('0x8'));var fs=require('fs');var fs_extra=require(_0xb1cc('0x9'));var _=require(_0xb1cc('0xa'));var squel=require(_0xb1cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb1cc('0xc'));var deskjs=require(_0xb1cc('0xd'));var toCsv=require(_0xb1cc('0x7'));var querystring=require(_0xb1cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb1cc('0xf'));var as=require(_0xb1cc('0x10'));var hardwareService=require(_0xb1cc('0x11'));var logger=require(_0xb1cc('0x12'))(_0xb1cc('0x13'));var utils=require(_0xb1cc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb1cc('0x15'));var db=require(_0xb1cc('0x16'))['db'];function respondWithStatusCode(_0x4e3dde,_0x304b65){_0x304b65=_0x304b65||0xcc;return function(_0x946516){if(_0x946516){return _0x4e3dde[_0xb1cc('0x17')](_0x304b65);}return _0x4e3dde[_0xb1cc('0x18')](_0x304b65)[_0xb1cc('0x19')]();};}function respondWithResult(_0x16eaf9,_0x206e98){_0x206e98=_0x206e98||0xc8;return function(_0x3b4aa9){if(_0x3b4aa9){return _0x16eaf9[_0xb1cc('0x18')](_0x206e98)['json'](_0x3b4aa9);}};}function respondWithFilteredResult(_0x4aab54,_0x15e5d8){return function(_0x25e89e){if(_0x25e89e){var _0x30bac9=typeof _0x15e5d8['offset']===_0xb1cc('0x1a')&&typeof _0x15e5d8[_0xb1cc('0x1b')]==='undefined';var _0x11011d=_0x25e89e['count'];var _0x5e39a4=_0x30bac9?0x0:_0x15e5d8[_0xb1cc('0x1c')];var _0xfd21fc=_0x30bac9?_0x25e89e['count']:_0x15e5d8[_0xb1cc('0x1c')]+_0x15e5d8[_0xb1cc('0x1b')];var _0x1a3f12;if(_0xfd21fc>=_0x11011d){_0xfd21fc=_0x11011d;_0x1a3f12=0xc8;}else{_0x1a3f12=0xce;}_0x4aab54[_0xb1cc('0x18')](_0x1a3f12);return _0x4aab54[_0xb1cc('0x1d')](_0xb1cc('0x1e'),_0x5e39a4+'-'+_0xfd21fc+'/'+_0x11011d)[_0xb1cc('0x1f')](_0x25e89e);}return null;};}function patchUpdates(_0x215f0b){return function(_0x3aa055){try{jsonpatch[_0xb1cc('0x20')](_0x3aa055,_0x215f0b,!![]);}catch(_0x421bdd){return BPromise[_0xb1cc('0x21')](_0x421bdd);}return _0x3aa055['save']();};}function saveUpdates(_0x30a2b7,_0x50d1f2){return function(_0x472bda){if(_0x472bda){return _0x472bda['update'](_0x30a2b7)[_0xb1cc('0x22')](function(_0x2f43e0){return _0x2f43e0;});}return null;};}function removeEntity(_0x4a3e38,_0x57e970){return function(_0x1c25f1){if(_0x1c25f1){return _0x1c25f1[_0xb1cc('0x23')]()[_0xb1cc('0x22')](function(){var _0xae0760=_0x1c25f1['get']({'plain':!![]});var _0x3ea486=_0xb1cc('0x24');return db[_0xb1cc('0x25')][_0xb1cc('0x23')]({'where':{'type':_0x3ea486,'resourceId':_0xae0760['id']}})[_0xb1cc('0x22')](function(){return _0x1c25f1;});})[_0xb1cc('0x22')](function(){_0x4a3e38[_0xb1cc('0x18')](0xcc)[_0xb1cc('0x19')]();});}};}function handleEntityNotFound(_0x4c78a4,_0x396fc2){return function(_0x248411){if(!_0x248411){_0x4c78a4[_0xb1cc('0x17')](0x194);}return _0x248411;};}function handleError(_0x54caf2,_0x1d54ed){_0x1d54ed=_0x1d54ed||0x1f4;return function(_0x811083){logger[_0xb1cc('0x26')](_0x811083[_0xb1cc('0x27')]);if(_0x811083['name']){delete _0x811083[_0xb1cc('0x28')];}_0x54caf2[_0xb1cc('0x18')](_0x1d54ed)['send'](_0x811083);};}exports[_0xb1cc('0x29')]=function(_0x3feb1c,_0x5c9b06){var _0x176655={},_0x3f095f={},_0x1c4bb7={'count':0x0,'rows':[]};return db[_0xb1cc('0x2a')][_0xb1cc('0x2b')]()[_0xb1cc('0x22')](function(_0x5079d8){_0x3f095f[_0xb1cc('0x2c')]=_[_0xb1cc('0x2d')](_0x5079d8);_0x3f095f[_0xb1cc('0x2e')]=_[_0xb1cc('0x2d')](_0x3feb1c['query']);_0x3f095f[_0xb1cc('0x2f')]=_['intersection'](_0x3f095f[_0xb1cc('0x2c')],_0x3f095f[_0xb1cc('0x2e')]);_0x176655[_0xb1cc('0x30')]=_[_0xb1cc('0x31')](_0x3f095f[_0xb1cc('0x2c')],qs[_0xb1cc('0x32')](_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x32')]));_0x176655[_0xb1cc('0x30')]=_0x176655['attributes']['length']?_0x176655[_0xb1cc('0x30')]:_0x3f095f[_0xb1cc('0x2c')];if(!_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x33')](_0xb1cc('0x34'))){_0x176655[_0xb1cc('0x1b')]=qs['limit'](_0x3feb1c['query'][_0xb1cc('0x1b')]);_0x176655[_0xb1cc('0x1c')]=qs[_0xb1cc('0x1c')](_0x3feb1c[_0xb1cc('0x2e')]['offset']);}_0x176655[_0xb1cc('0x35')]=qs[_0xb1cc('0x36')](_0x3feb1c['query'][_0xb1cc('0x36')]);_0x176655['where']=qs[_0xb1cc('0x2f')](_['pick'](_0x3feb1c[_0xb1cc('0x2e')],_0x3f095f[_0xb1cc('0x2f')]),_0x5079d8);if(_0x3feb1c[_0xb1cc('0x2e')]['filter']){_0x176655['where']=_[_0xb1cc('0x37')](_0x176655[_0xb1cc('0x38')],{'$or':_[_0xb1cc('0x39')](_0x176655[_0xb1cc('0x30')],function(_0x420a6b){var _0x377def={};_0x377def[_0x420a6b]={'$like':'%'+_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x3a')]+'%'};return _0x377def;})});}_0x176655=_['merge']({},_0x176655,_0x3feb1c[_0xb1cc('0x3b')]);var _0x4f8157={'where':_0x176655['where']};return db[_0xb1cc('0x2a')]['count'](_0x4f8157)['then'](function(_0x157f14){_0x1c4bb7[_0xb1cc('0x3c')]=_0x157f14;if(_0x3feb1c[_0xb1cc('0x2e')]['includeAll']){_0x176655['include']=[{'all':!![]}];}return db[_0xb1cc('0x2a')]['findAll'](_0x176655);})[_0xb1cc('0x22')](function(_0x1807eb){_0x1c4bb7[_0xb1cc('0x3d')]=_0x1807eb;return _0x1c4bb7;})['then'](respondWithFilteredResult(_0x5c9b06,_0x176655))[_0xb1cc('0x3e')](handleError(_0x5c9b06,null));})[_0xb1cc('0x3e')](handleError(_0x5c9b06,null));};exports['show']=function(_0x14f938,_0x254f3c){var _0x1b87f6={'raw':![],'where':{'id':_0x14f938[_0xb1cc('0x3f')]['id']}},_0x29783e={};_0x29783e[_0xb1cc('0x2c')]=_['keys'](db[_0xb1cc('0x2a')][_0xb1cc('0x40')]);_0x29783e[_0xb1cc('0x2e')]=_['keys'](_0x14f938[_0xb1cc('0x2e')]);_0x29783e[_0xb1cc('0x2f')]=_[_0xb1cc('0x31')](_0x29783e[_0xb1cc('0x2c')],_0x29783e['query']);_0x1b87f6[_0xb1cc('0x30')]=_['intersection'](_0x29783e['model'],qs[_0xb1cc('0x32')](_0x14f938['query'][_0xb1cc('0x32')]));_0x1b87f6[_0xb1cc('0x30')]=_0x1b87f6[_0xb1cc('0x30')][_0xb1cc('0x41')]?_0x1b87f6['attributes']:_0x29783e[_0xb1cc('0x2c')];if(_0x14f938[_0xb1cc('0x2e')][_0xb1cc('0x42')]){_0x1b87f6[_0xb1cc('0x43')]=[{'all':!![]}];}_0x1b87f6=_[_0xb1cc('0x37')]({},_0x1b87f6,_0x14f938[_0xb1cc('0x3b')]);return db[_0xb1cc('0x2a')][_0xb1cc('0x44')](_0x1b87f6)[_0xb1cc('0x22')](handleEntityNotFound(_0x254f3c,null))['then'](respondWithResult(_0x254f3c,null))[_0xb1cc('0x3e')](handleError(_0x254f3c,null));};exports[_0xb1cc('0x45')]=function(_0x2ace43,_0x5d8a66){return db['CmCompany'][_0xb1cc('0x45')](_0x2ace43[_0xb1cc('0x46')],{})[_0xb1cc('0x22')](function(_0x2faa1e){var _0x2d4c84=_0x2ace43[_0xb1cc('0x47')][_0xb1cc('0x48')]({'plain':!![]});if(!_0x2d4c84)throw new Error(_0xb1cc('0x49'));if(_0x2d4c84['role']===_0xb1cc('0x47')){var _0x223243=_0x2faa1e[_0xb1cc('0x48')]({'plain':!![]});var _0x4b65b8='Companies';return db['UserProfileSection']['find']({'where':{'name':_0x4b65b8,'userProfileId':_0x2d4c84[_0xb1cc('0x4a')]},'raw':!![]})[_0xb1cc('0x22')](function(_0x52482c){if(_0x52482c&&_0x52482c[_0xb1cc('0x4b')]===0x0){return db[_0xb1cc('0x25')][_0xb1cc('0x45')]({'name':_0x223243[_0xb1cc('0x28')],'resourceId':_0x223243['id'],'type':_0x52482c[_0xb1cc('0x28')],'sectionId':_0x52482c['id']},{})[_0xb1cc('0x22')](function(){return _0x2faa1e;});}else{return _0x2faa1e;}})[_0xb1cc('0x3e')](function(_0x367564){logger[_0xb1cc('0x26')](_0xb1cc('0x4c'),_0x367564);throw _0x367564;});}return _0x2faa1e;})[_0xb1cc('0x22')](respondWithResult(_0x5d8a66,0xc9))[_0xb1cc('0x3e')](handleError(_0x5d8a66,null));};exports[_0xb1cc('0x4d')]=function(_0x278f3e,_0x1631a3){if(_0x278f3e[_0xb1cc('0x46')]['id']){delete _0x278f3e[_0xb1cc('0x46')]['id'];}return db[_0xb1cc('0x2a')][_0xb1cc('0x44')]({'where':{'id':_0x278f3e['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x1631a3,null))[_0xb1cc('0x22')](saveUpdates(_0x278f3e[_0xb1cc('0x46')],null))[_0xb1cc('0x22')](respondWithResult(_0x1631a3,null))[_0xb1cc('0x3e')](handleError(_0x1631a3,null));};exports['destroy']=function(_0x1bce8d,_0x1e90a3){return db[_0xb1cc('0x2a')][_0xb1cc('0x44')]({'where':{'id':_0x1bce8d['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x1e90a3,null))[_0xb1cc('0x22')](removeEntity(_0x1e90a3,null))[_0xb1cc('0x3e')](handleError(_0x1e90a3,null));};exports[_0xb1cc('0x2b')]=function(_0x3f10e0,_0x23b31a){return db[_0xb1cc('0x2a')][_0xb1cc('0x2b')]()[_0xb1cc('0x22')](respondWithResult(_0x23b31a,null))[_0xb1cc('0x3e')](handleError(_0x23b31a,null));};exports[_0xb1cc('0x4e')]=function(_0x16f994,_0x5d59b,_0x5ba40){return db[_0xb1cc('0x4f')]['find']({'where':{'id':_0x16f994['params']['id']}})['then'](handleEntityNotFound(_0x5d59b,null))[_0xb1cc('0x22')](function(_0x379eb1){if(_0x379eb1){return _0x379eb1[_0xb1cc('0x4e')](_0x16f994[_0xb1cc('0x46')]['ids'],_[_0xb1cc('0x50')](_0x16f994[_0xb1cc('0x46')],[_0xb1cc('0x51'),'id'])||{});}})['then'](respondWithResult(_0x5d59b,null))[_0xb1cc('0x3e')](handleError(_0x5d59b,null));};exports[_0xb1cc('0x52')]=function(_0x13ea9d,_0x5a648f,_0x4f7d4b){var _0x2b986a={};var _0x377104={};var _0x5c5271;var _0x3305c1;return db[_0xb1cc('0x2a')]['findOne']({'where':{'id':_0x13ea9d['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x5a648f,null))[_0xb1cc('0x22')](function(_0x325ca2){if(_0x325ca2){_0x5c5271=_0x325ca2;_0x377104['model']=_[_0xb1cc('0x2d')](db[_0xb1cc('0x4f')][_0xb1cc('0x40')]);_0x377104[_0xb1cc('0x2e')]=_[_0xb1cc('0x2d')](_0x13ea9d[_0xb1cc('0x2e')]);_0x377104['filters']=_[_0xb1cc('0x31')](_0x377104[_0xb1cc('0x2c')],_0x377104['query']);_0x2b986a[_0xb1cc('0x30')]=_[_0xb1cc('0x31')](_0x377104[_0xb1cc('0x2c')],qs[_0xb1cc('0x32')](_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x32')]));_0x2b986a[_0xb1cc('0x30')]=_0x2b986a['attributes'][_0xb1cc('0x41')]?_0x2b986a[_0xb1cc('0x30')]:_0x377104[_0xb1cc('0x2c')];_0x2b986a[_0xb1cc('0x35')]=qs[_0xb1cc('0x36')](_0x13ea9d['query'][_0xb1cc('0x36')]);_0x2b986a['where']=qs[_0xb1cc('0x2f')](_['pick'](_0x13ea9d[_0xb1cc('0x2e')],_0x377104[_0xb1cc('0x2f')]));if(_0x13ea9d['query'][_0xb1cc('0x3a')]){_0x2b986a['where']=_[_0xb1cc('0x37')](_0x2b986a['where'],{'$or':_[_0xb1cc('0x39')](_0x2b986a[_0xb1cc('0x30')],function(_0x34f797){var _0xab4d88={};_0xab4d88[_0x34f797]={'$like':'%'+_0x13ea9d['query'][_0xb1cc('0x3a')]+'%'};return _0xab4d88;})});}_0x2b986a=_[_0xb1cc('0x37')]({},_0x2b986a,_0x13ea9d['options']);return _0x5c5271[_0xb1cc('0x52')](_0x2b986a);}})['then'](function(_0x5bd85d){if(_0x5bd85d){_0x3305c1=_0x5bd85d[_0xb1cc('0x41')];if(!_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x33')](_0xb1cc('0x34'))){_0x2b986a[_0xb1cc('0x1b')]=qs[_0xb1cc('0x1b')](_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x1b')]);_0x2b986a[_0xb1cc('0x1c')]=qs['offset'](_0x13ea9d['query'][_0xb1cc('0x1c')]);}return _0x5c5271['getContacts'](_0x2b986a);}})['then'](function(_0x42cef8){if(_0x42cef8){return _0x42cef8?{'count':_0x3305c1,'rows':_0x42cef8}:null;}})[_0xb1cc('0x22')](respondWithResult(_0x5a648f,null))[_0xb1cc('0x3e')](handleError(_0x5a648f,null));};
\ No newline at end of file
+var _0x3779=['index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','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','end','status','json','offset','undefined','limit','count','Content-Range','apply','then','UserProfileResource','destroy','sendStatus','stack','name','send'];(function(_0x5eef07,_0x2edb41){var _0x458e15=function(_0xabd3d3){while(--_0xabd3d3){_0x5eef07['push'](_0x5eef07['shift']());}};_0x458e15(++_0x2edb41);}(_0x3779,0x127));var _0x9377=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x3779[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9377('0x0'));var zipdir=require(_0x9377('0x1'));var jsonpatch=require(_0x9377('0x2'));var rp=require(_0x9377('0x3'));var moment=require('moment');var BPromise=require(_0x9377('0x4'));var Mustache=require(_0x9377('0x5'));var util=require('util');var path=require(_0x9377('0x6'));var sox=require('sox');var csv=require(_0x9377('0x7'));var ejs=require(_0x9377('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9377('0x9'));var squel=require(_0x9377('0xa'));var crypto=require(_0x9377('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9377('0xc'));var toCsv=require(_0x9377('0x7'));var querystring=require('querystring');var Papa=require(_0x9377('0xd'));var Redis=require(_0x9377('0xe'));var authService=require(_0x9377('0xf'));var qs=require(_0x9377('0x10'));var as=require(_0x9377('0x11'));var hardwareService=require(_0x9377('0x12'));var logger=require(_0x9377('0x13'))(_0x9377('0x14'));var utils=require(_0x9377('0x15'));var config=require(_0x9377('0x16'));var licenseUtil=require(_0x9377('0x17'));var db=require(_0x9377('0x18'))['db'];function respondWithStatusCode(_0x2cde9f,_0x83d310){_0x83d310=_0x83d310||0xcc;return function(_0x2df25a){if(_0x2df25a){return _0x2cde9f['sendStatus'](_0x83d310);}return _0x2cde9f['status'](_0x83d310)[_0x9377('0x19')]();};}function respondWithResult(_0x1759bb,_0x48f6fa){_0x48f6fa=_0x48f6fa||0xc8;return function(_0x161953){if(_0x161953){return _0x1759bb[_0x9377('0x1a')](_0x48f6fa)[_0x9377('0x1b')](_0x161953);}};}function respondWithFilteredResult(_0x407452,_0xcf80b5){return function(_0x4ee962){if(_0x4ee962){var _0x5b83ba=typeof _0xcf80b5[_0x9377('0x1c')]===_0x9377('0x1d')&&typeof _0xcf80b5[_0x9377('0x1e')]==='undefined';var _0x680e9f=_0x4ee962['count'];var _0x5e89a4=_0x5b83ba?0x0:_0xcf80b5[_0x9377('0x1c')];var _0x2901fb=_0x5b83ba?_0x4ee962[_0x9377('0x1f')]:_0xcf80b5['offset']+_0xcf80b5[_0x9377('0x1e')];var _0x2ea54a;if(_0x2901fb>=_0x680e9f){_0x2901fb=_0x680e9f;_0x2ea54a=0xc8;}else{_0x2ea54a=0xce;}_0x407452[_0x9377('0x1a')](_0x2ea54a);return _0x407452['set'](_0x9377('0x20'),_0x5e89a4+'-'+_0x2901fb+'/'+_0x680e9f)[_0x9377('0x1b')](_0x4ee962);}return null;};}function patchUpdates(_0x4c8b7a){return function(_0x317a77){try{jsonpatch[_0x9377('0x21')](_0x317a77,_0x4c8b7a,!![]);}catch(_0x5c22d9){return BPromise['reject'](_0x5c22d9);}return _0x317a77['save']();};}function saveUpdates(_0x1a5963,_0x3dfd7a){return function(_0x4389d5){if(_0x4389d5){return _0x4389d5['update'](_0x1a5963)[_0x9377('0x22')](function(_0x19ce3f){return _0x19ce3f;});}return null;};}function removeEntity(_0x421a1f,_0x3e7507){return function(_0x26aa60){if(_0x26aa60){return _0x26aa60['destroy']()[_0x9377('0x22')](function(){var _0xac2c1d=_0x26aa60['get']({'plain':!![]});var _0x29ef4e='Companies';return db[_0x9377('0x23')][_0x9377('0x24')]({'where':{'type':_0x29ef4e,'resourceId':_0xac2c1d['id']}})[_0x9377('0x22')](function(){return _0x26aa60;});})['then'](function(){_0x421a1f[_0x9377('0x1a')](0xcc)[_0x9377('0x19')]();});}};}function handleEntityNotFound(_0x56b4e6,_0x369af6){return function(_0x5f5a64){if(!_0x5f5a64){_0x56b4e6[_0x9377('0x25')](0x194);}return _0x5f5a64;};}function handleError(_0x5d01eb,_0x5331ee){_0x5331ee=_0x5331ee||0x1f4;return function(_0x205f88){logger['error'](_0x205f88[_0x9377('0x26')]);if(_0x205f88[_0x9377('0x27')]){delete _0x205f88['name'];}_0x5d01eb[_0x9377('0x1a')](_0x5331ee)[_0x9377('0x28')](_0x205f88);};}exports[_0x9377('0x29')]=function(_0x47005c,_0x13703d){var _0x1b8fcd={},_0x411616={},_0x44f1cc={'count':0x0,'rows':[]};return db[_0x9377('0x2a')][_0x9377('0x2b')]()[_0x9377('0x22')](function(_0x19a6b8){_0x411616[_0x9377('0x2c')]=_[_0x9377('0x2d')](_0x19a6b8);_0x411616[_0x9377('0x2e')]=_[_0x9377('0x2d')](_0x47005c['query']);_0x411616[_0x9377('0x2f')]=_[_0x9377('0x30')](_0x411616[_0x9377('0x2c')],_0x411616[_0x9377('0x2e')]);_0x1b8fcd[_0x9377('0x31')]=_[_0x9377('0x30')](_0x411616[_0x9377('0x2c')],qs[_0x9377('0x32')](_0x47005c[_0x9377('0x2e')][_0x9377('0x32')]));_0x1b8fcd[_0x9377('0x31')]=_0x1b8fcd[_0x9377('0x31')][_0x9377('0x33')]?_0x1b8fcd[_0x9377('0x31')]:_0x411616[_0x9377('0x2c')];if(!_0x47005c[_0x9377('0x2e')][_0x9377('0x34')](_0x9377('0x35'))){_0x1b8fcd[_0x9377('0x1e')]=qs['limit'](_0x47005c[_0x9377('0x2e')][_0x9377('0x1e')]);_0x1b8fcd[_0x9377('0x1c')]=qs['offset'](_0x47005c[_0x9377('0x2e')][_0x9377('0x1c')]);}_0x1b8fcd[_0x9377('0x36')]=qs[_0x9377('0x37')](_0x47005c[_0x9377('0x2e')][_0x9377('0x37')]);_0x1b8fcd[_0x9377('0x38')]=qs[_0x9377('0x2f')](_[_0x9377('0x39')](_0x47005c[_0x9377('0x2e')],_0x411616[_0x9377('0x2f')]),_0x19a6b8);if(_0x47005c['query'][_0x9377('0x3a')]){_0x1b8fcd[_0x9377('0x38')]=_['merge'](_0x1b8fcd[_0x9377('0x38')],{'$or':_[_0x9377('0x3b')](_0x1b8fcd[_0x9377('0x31')],function(_0x432654){var _0x321fae={};_0x321fae[_0x432654]={'$like':'%'+_0x47005c['query']['filter']+'%'};return _0x321fae;})});}_0x1b8fcd=_[_0x9377('0x3c')]({},_0x1b8fcd,_0x47005c[_0x9377('0x3d')]);var _0x1c0c3e={'where':_0x1b8fcd[_0x9377('0x38')]};return db['CmCompany'][_0x9377('0x1f')](_0x1c0c3e)['then'](function(_0x452c5d){_0x44f1cc[_0x9377('0x1f')]=_0x452c5d;if(_0x47005c[_0x9377('0x2e')][_0x9377('0x3e')]){_0x1b8fcd['include']=[{'all':!![]}];}return db['CmCompany'][_0x9377('0x3f')](_0x1b8fcd);})['then'](function(_0x677111){_0x44f1cc[_0x9377('0x40')]=_0x677111;return _0x44f1cc;})[_0x9377('0x22')](respondWithFilteredResult(_0x13703d,_0x1b8fcd))[_0x9377('0x41')](handleError(_0x13703d,null));})[_0x9377('0x41')](handleError(_0x13703d,null));};exports['show']=function(_0x46a742,_0x562a8e){var _0x576f8c={'raw':![],'where':{'id':_0x46a742[_0x9377('0x42')]['id']}},_0x470415={};_0x470415[_0x9377('0x2c')]=_[_0x9377('0x2d')](db[_0x9377('0x2a')][_0x9377('0x43')]);_0x470415['query']=_[_0x9377('0x2d')](_0x46a742['query']);_0x470415[_0x9377('0x2f')]=_[_0x9377('0x30')](_0x470415[_0x9377('0x2c')],_0x470415[_0x9377('0x2e')]);_0x576f8c[_0x9377('0x31')]=_[_0x9377('0x30')](_0x470415[_0x9377('0x2c')],qs['fields'](_0x46a742[_0x9377('0x2e')]['fields']));_0x576f8c[_0x9377('0x31')]=_0x576f8c[_0x9377('0x31')][_0x9377('0x33')]?_0x576f8c[_0x9377('0x31')]:_0x470415[_0x9377('0x2c')];if(_0x46a742['query']['includeAll']){_0x576f8c[_0x9377('0x44')]=[{'all':!![]}];}_0x576f8c=_['merge']({},_0x576f8c,_0x46a742[_0x9377('0x3d')]);return db[_0x9377('0x2a')][_0x9377('0x45')](_0x576f8c)[_0x9377('0x22')](handleEntityNotFound(_0x562a8e,null))[_0x9377('0x22')](respondWithResult(_0x562a8e,null))[_0x9377('0x41')](handleError(_0x562a8e,null));};exports[_0x9377('0x46')]=function(_0x40419e,_0x426ff3){return db[_0x9377('0x2a')]['create'](_0x40419e[_0x9377('0x47')],{})[_0x9377('0x22')](function(_0x484bb4){var _0x5c30a6=_0x40419e[_0x9377('0x48')][_0x9377('0x49')]({'plain':!![]});if(!_0x5c30a6)throw new Error(_0x9377('0x4a'));if(_0x5c30a6['role']==='user'){var _0x2b89b4=_0x484bb4['get']({'plain':!![]});var _0x7b5f1e=_0x9377('0x4b');return db[_0x9377('0x4c')][_0x9377('0x45')]({'where':{'name':_0x7b5f1e,'userProfileId':_0x5c30a6[_0x9377('0x4d')]},'raw':!![]})[_0x9377('0x22')](function(_0x24960e){if(_0x24960e&&_0x24960e[_0x9377('0x4e')]===0x0){return db['UserProfileResource'][_0x9377('0x46')]({'name':_0x2b89b4['name'],'resourceId':_0x2b89b4['id'],'type':_0x24960e[_0x9377('0x27')],'sectionId':_0x24960e['id']},{})[_0x9377('0x22')](function(){return _0x484bb4;});}else{return _0x484bb4;}})['catch'](function(_0x19a148){logger['error'](_0x9377('0x4f'),_0x19a148);throw _0x19a148;});}return _0x484bb4;})[_0x9377('0x22')](respondWithResult(_0x426ff3,0xc9))[_0x9377('0x41')](handleError(_0x426ff3,null));};exports[_0x9377('0x50')]=function(_0x4261e9,_0x5ac130){if(_0x4261e9['body']['id']){delete _0x4261e9['body']['id'];}return db[_0x9377('0x2a')][_0x9377('0x45')]({'where':{'id':_0x4261e9[_0x9377('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ac130,null))[_0x9377('0x22')](saveUpdates(_0x4261e9[_0x9377('0x47')],null))[_0x9377('0x22')](respondWithResult(_0x5ac130,null))['catch'](handleError(_0x5ac130,null));};exports['destroy']=function(_0x181997,_0x14b678){return db['CmCompany'][_0x9377('0x45')]({'where':{'id':_0x181997[_0x9377('0x42')]['id']}})['then'](handleEntityNotFound(_0x14b678,null))[_0x9377('0x22')](removeEntity(_0x14b678,null))[_0x9377('0x41')](handleError(_0x14b678,null));};exports[_0x9377('0x2b')]=function(_0x5618b6,_0x5ae406){return db[_0x9377('0x2a')]['describe']()['then'](respondWithResult(_0x5ae406,null))['catch'](handleError(_0x5ae406,null));};exports[_0x9377('0x51')]=function(_0x27f20a,_0xdf353f,_0x2a84c2){return db[_0x9377('0x52')][_0x9377('0x45')]({'where':{'id':_0x27f20a['params']['id']}})[_0x9377('0x22')](handleEntityNotFound(_0xdf353f,null))[_0x9377('0x22')](function(_0x440921){if(_0x440921){return _0x440921['addContacts'](_0x27f20a[_0x9377('0x47')]['ids'],_['omit'](_0x27f20a[_0x9377('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0xdf353f,null))[_0x9377('0x41')](handleError(_0xdf353f,null));};exports[_0x9377('0x53')]=function(_0x4cd77d,_0x12871c,_0x55c8b2){var _0x24c27d={};var _0x3c05a9={};var _0x178447;var _0x37278e;return db[_0x9377('0x2a')]['findOne']({'where':{'id':_0x4cd77d[_0x9377('0x42')]['id']}})[_0x9377('0x22')](handleEntityNotFound(_0x12871c,null))[_0x9377('0x22')](function(_0x30e89f){if(_0x30e89f){_0x178447=_0x30e89f;_0x3c05a9[_0x9377('0x2c')]=_[_0x9377('0x2d')](db['CmContact']['rawAttributes']);_0x3c05a9[_0x9377('0x2e')]=_['keys'](_0x4cd77d[_0x9377('0x2e')]);_0x3c05a9['filters']=_[_0x9377('0x30')](_0x3c05a9[_0x9377('0x2c')],_0x3c05a9['query']);_0x24c27d[_0x9377('0x31')]=_[_0x9377('0x30')](_0x3c05a9[_0x9377('0x2c')],qs[_0x9377('0x32')](_0x4cd77d[_0x9377('0x2e')]['fields']));_0x24c27d[_0x9377('0x31')]=_0x24c27d[_0x9377('0x31')]['length']?_0x24c27d[_0x9377('0x31')]:_0x3c05a9[_0x9377('0x2c')];_0x24c27d['order']=qs['sort'](_0x4cd77d[_0x9377('0x2e')][_0x9377('0x37')]);_0x24c27d[_0x9377('0x38')]=qs['filters'](_['pick'](_0x4cd77d[_0x9377('0x2e')],_0x3c05a9['filters']));if(_0x4cd77d[_0x9377('0x2e')]['filter']){_0x24c27d[_0x9377('0x38')]=_[_0x9377('0x3c')](_0x24c27d['where'],{'$or':_['map'](_0x24c27d[_0x9377('0x31')],function(_0x349ea8){var _0x119c10={};_0x119c10[_0x349ea8]={'$like':'%'+_0x4cd77d[_0x9377('0x2e')][_0x9377('0x3a')]+'%'};return _0x119c10;})});}_0x24c27d=_[_0x9377('0x3c')]({},_0x24c27d,_0x4cd77d['options']);return _0x178447[_0x9377('0x53')](_0x24c27d);}})[_0x9377('0x22')](function(_0x317974){if(_0x317974){_0x37278e=_0x317974[_0x9377('0x33')];if(!_0x4cd77d[_0x9377('0x2e')][_0x9377('0x34')](_0x9377('0x35'))){_0x24c27d[_0x9377('0x1e')]=qs[_0x9377('0x1e')](_0x4cd77d[_0x9377('0x2e')][_0x9377('0x1e')]);_0x24c27d[_0x9377('0x1c')]=qs[_0x9377('0x1c')](_0x4cd77d['query'][_0x9377('0x1c')]);}return _0x178447[_0x9377('0x53')](_0x24c27d);}})[_0x9377('0x22')](function(_0x35a569){if(_0x35a569){return _0x35a569?{'count':_0x37278e,'rows':_0x35a569}:null;}})[_0x9377('0x22')](respondWithResult(_0x12871c,null))[_0x9377('0x41')](handleError(_0x12871c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 85d968c..54f6498 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 _0x1ae0=['CmCompany','cm_companies','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x1ae0,0x147));var _0x01ae=function(_0x49c5af,_0x29c031){_0x49c5af=_0x49c5af-0x0;var _0x2111e6=_0x1ae0[_0x49c5af];return _0x2111e6;};'use strict';var _=require(_0x01ae('0x0'));var util=require(_0x01ae('0x1'));var logger=require('../../config/logger')(_0x01ae('0x2'));var moment=require('moment');var BPromise=require(_0x01ae('0x3'));var rp=require(_0x01ae('0x4'));var fs=require('fs');var path=require(_0x01ae('0x5'));var rimraf=require(_0x01ae('0x6'));var config=require(_0x01ae('0x7'));var attributes=require(_0x01ae('0x8'));module[_0x01ae('0x9')]=function(_0x221cbe,_0xfce1ea){return _0x221cbe[_0x01ae('0xa')](_0x01ae('0xb'),attributes,{'tableName':_0x01ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3ce=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash'];(function(_0x5f0495,_0xe7a0d2){var _0x120167=function(_0x22e563){while(--_0x22e563){_0x5f0495['push'](_0x5f0495['shift']());}};_0x120167(++_0xe7a0d2);}(_0xf3ce,0x8e));var _0xef3c=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xf3ce[_0x307086];return _0x699043;};'use strict';var _=require(_0xef3c('0x0'));var util=require('util');var logger=require(_0xef3c('0x1'))(_0xef3c('0x2'));var moment=require(_0xef3c('0x3'));var BPromise=require(_0xef3c('0x4'));var rp=require(_0xef3c('0x5'));var fs=require('fs');var path=require(_0xef3c('0x6'));var rimraf=require(_0xef3c('0x7'));var config=require(_0xef3c('0x8'));var attributes=require(_0xef3c('0x9'));module[_0xef3c('0xa')]=function(_0x453c6c,_0x10967e){return _0x453c6c[_0xef3c('0xb')]('CmCompany',attributes,{'tableName':_0xef3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 1608be1..49c268b 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 _0xce3e=['request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xce3e,0x129));var _0xece3=function(_0x3e29e5,_0x1cd087){_0x3e29e5=_0x3e29e5-0x0;var _0x37f88a=_0xce3e[_0x3e29e5];return _0x37f88a;};'use strict';var _=require('lodash');var util=require(_0xece3('0x0'));var moment=require(_0xece3('0x1'));var BPromise=require(_0xece3('0x2'));var rs=require(_0xece3('0x3'));var fs=require('fs');var Redis=require(_0xece3('0x4'));var db=require(_0xece3('0x5'))['db'];var utils=require(_0xece3('0x6'));var logger=require(_0xece3('0x7'))(_0xece3('0x8'));var config=require(_0xece3('0x9'));var jayson=require(_0xece3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cb3a,_0x4668bc,_0x185d2c){return new BPromise(function(_0x51bcf7,_0x2d2111){return client[_0xece3('0xb')](_0x20cb3a,_0x185d2c)[_0xece3('0xc')](function(_0x792283){logger[_0xece3('0xd')](_0xece3('0xe'),_0x4668bc,'request\x20sent');logger['debug'](_0xece3('0xf'),_0x4668bc,'request\x20sent',JSON[_0xece3('0x10')](_0x792283));if(_0x792283['error']){if(_0x792283[_0xece3('0x11')][_0xece3('0x12')]===0x1f4){logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x792283['error'][_0xece3('0x13')]);return _0x2d2111(_0x792283[_0xece3('0x11')][_0xece3('0x13')]);}logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x792283[_0xece3('0x11')][_0xece3('0x13')]);return _0x51bcf7(_0x792283[_0xece3('0x11')][_0xece3('0x13')]);}else{logger[_0xece3('0xd')](_0xece3('0xe'),_0x4668bc,_0xece3('0x14'));_0x51bcf7(_0x792283['result'][_0xece3('0x13')]);}})[_0xece3('0x15')](function(_0x238aa0){logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x238aa0);_0x2d2111(_0x238aa0);});});}
\ No newline at end of file
+var _0xaba1=['http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x431f87,_0x4b0d8a){var _0x154786=function(_0x4c73d3){while(--_0x4c73d3){_0x431f87['push'](_0x431f87['shift']());}};_0x154786(++_0x4b0d8a);}(_0xaba1,0x175));var _0x1aba=function(_0x360f70,_0x1a0325){_0x360f70=_0x360f70-0x0;var _0x3a628b=_0xaba1[_0x360f70];return _0x3a628b;};'use strict';var _=require(_0x1aba('0x0'));var util=require('util');var moment=require(_0x1aba('0x1'));var BPromise=require(_0x1aba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aba('0x3'))['db'];var utils=require(_0x1aba('0x4'));var logger=require('../../config/logger')(_0x1aba('0x5'));var config=require('../../config/environment');var jayson=require(_0x1aba('0x6'));var client=jayson['client'][_0x1aba('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52b628,_0x1935e1,_0x278047){return new BPromise(function(_0x3d664e,_0x3493de){return client[_0x1aba('0x8')](_0x52b628,_0x278047)[_0x1aba('0x9')](function(_0xbcb153){logger['info'](_0x1aba('0xa'),_0x1935e1,_0x1aba('0xb'));logger[_0x1aba('0xc')](_0x1aba('0xd'),_0x1935e1,_0x1aba('0xb'),JSON['stringify'](_0xbcb153));if(_0xbcb153[_0x1aba('0xe')]){if(_0xbcb153[_0x1aba('0xe')][_0x1aba('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x1935e1,_0xbcb153[_0x1aba('0xe')]['message']);return _0x3493de(_0xbcb153[_0x1aba('0xe')][_0x1aba('0x10')]);}logger[_0x1aba('0xe')](_0x1aba('0xa'),_0x1935e1,_0xbcb153['error'][_0x1aba('0x10')]);return _0x3d664e(_0xbcb153[_0x1aba('0xe')][_0x1aba('0x10')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x1935e1,_0x1aba('0xb'));_0x3d664e(_0xbcb153[_0x1aba('0x11')][_0x1aba('0x10')]);}})[_0x1aba('0x12')](function(_0x16d7db){logger['error'](_0x1aba('0xa'),_0x1935e1,_0x16d7db);_0x3493de(_0x16d7db);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 664a813..1000848 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 _0xbf13=['addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','create'];(function(_0x2d652f,_0x58c104){var _0x670d67=function(_0x455be5){while(--_0x455be5){_0x2d652f['push'](_0x2d652f['shift']());}};_0x670d67(++_0x58c104);}(_0xbf13,0xe2));var _0x3bf1=function(_0x144a67,_0x52c58b){_0x144a67=_0x144a67-0x0;var _0x67d893=_0xbf13[_0x144a67];return _0x67d893;};'use strict';var multer=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var path=require(_0x3bf1('0x2'));var timeout=require(_0x3bf1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3bf1('0x4'));var auth=require(_0x3bf1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3bf1('0x6'));var controller=require(_0x3bf1('0x7'));router[_0x3bf1('0x8')]('/',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xa')]);router['get']('/describe',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xb')]);router['get'](_0x3bf1('0xc'),auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xd')]);router[_0x3bf1('0x8')](_0x3bf1('0xe'),auth[_0x3bf1('0x9')](),controller['getContacts']);router['post']('/',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xf')]);router['post'](_0x3bf1('0xe'),auth['isAuthenticated'](),controller[_0x3bf1('0x10')]);router[_0x3bf1('0x11')](_0x3bf1('0xc'),auth[_0x3bf1('0x9')](),controller[_0x3bf1('0x12')]);router[_0x3bf1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3bf1('0x14')]);module[_0x3bf1('0x15')]=router;
\ No newline at end of file
+var _0xc962=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','create','addContacts','put','update','delete','multer'];(function(_0x232ba4,_0x1eb213){var _0x3849b2=function(_0x29cf3a){while(--_0x29cf3a){_0x232ba4['push'](_0x232ba4['shift']());}};_0x3849b2(++_0x1eb213);}(_0xc962,0x6d));var _0x2c96=function(_0x1f44c8,_0x3dfb66){_0x1f44c8=_0x1f44c8-0x0;var _0x2ee697=_0xc962[_0x1f44c8];return _0x2ee697;};'use strict';var multer=require(_0x2c96('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c96('0x1'));var router=express[_0x2c96('0x2')]();var fs_extra=require(_0x2c96('0x3'));var auth=require(_0x2c96('0x4'));var interaction=require(_0x2c96('0x5'));var config=require(_0x2c96('0x6'));var controller=require(_0x2c96('0x7'));router[_0x2c96('0x8')]('/',auth['isAuthenticated'](),controller[_0x2c96('0x9')]);router[_0x2c96('0x8')](_0x2c96('0xa'),auth[_0x2c96('0xb')](),controller[_0x2c96('0xc')]);router[_0x2c96('0x8')](_0x2c96('0xd'),auth[_0x2c96('0xb')](),controller[_0x2c96('0xe')]);router['get']('/:id/contacts',auth[_0x2c96('0xb')](),controller[_0x2c96('0xf')]);router[_0x2c96('0x10')]('/',auth[_0x2c96('0xb')](),controller[_0x2c96('0x11')]);router[_0x2c96('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2c96('0x12')]);router[_0x2c96('0x13')](_0x2c96('0xd'),auth[_0x2c96('0xb')](),controller[_0x2c96('0x14')]);router[_0x2c96('0x15')](_0x2c96('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6cedac0..1fe3220 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 _0x6bf1=['INTEGER','DATE','NOW','exports','STRING','TEXT'];(function(_0x2a0c6c,_0x42f63d){var _0x2300a4=function(_0x47a1b7){while(--_0x47a1b7){_0x2a0c6c['push'](_0x2a0c6c['shift']());}};_0x2300a4(++_0x42f63d);}(_0x6bf1,0x9f));var _0x16bf=function(_0x2bc081,_0x15f9de){_0x2bc081=_0x2bc081-0x0;var _0x8b3bdf=_0x6bf1[_0x2bc081];return _0x8b3bdf;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x16bf('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x16bf('0x1')]},'street':{'type':Sequelize[_0x16bf('0x1')]},'postalCode':{'type':Sequelize[_0x16bf('0x1')]},'city':{'type':Sequelize[_0x16bf('0x1')]},'country':{'type':Sequelize[_0x16bf('0x1')]},'dateOfBirth':{'type':Sequelize[_0x16bf('0x1')]},'description':{'type':Sequelize[_0x16bf('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x16bf('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x16bf('0x1')]},'url':{'type':Sequelize[_0x16bf('0x1')]},'facebook':{'type':Sequelize[_0x16bf('0x1')]},'fb_data':{'type':Sequelize[_0x16bf('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x16bf('0x1')]},'teams':{'type':Sequelize[_0x16bf('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x16bf('0x1')]},'wechat':{'type':Sequelize[_0x16bf('0x1')]},'telegram':{'type':Sequelize[_0x16bf('0x1')]},'UserId':{'type':Sequelize[_0x16bf('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x16bf('0x1')]},'priority':{'type':Sequelize[_0x16bf('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x16bf('0x4')],'defaultValue':Sequelize[_0x16bf('0x5')]},'dialTimezone':{'type':Sequelize[_0x16bf('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa2a0=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize'];(function(_0x147483,_0x4806c4){var _0x483fe5=function(_0x5da942){while(--_0x5da942){_0x147483['push'](_0x147483['shift']());}};_0x483fe5(++_0x4806c4);}(_0xa2a0,0xd6));var _0x0a2a=function(_0x49b2da,_0x4514de){_0x49b2da=_0x49b2da-0x0;var _0x3471d4=_0xa2a0[_0x49b2da];return _0x3471d4;};'use strict';var _=require(_0x0a2a('0x0'));var Sequelize=require(_0x0a2a('0x1'));module[_0x0a2a('0x2')]={'firstName':{'type':Sequelize[_0x0a2a('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0a2a('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0a2a('0x3')]},'country':{'type':Sequelize[_0x0a2a('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0a2a('0x3')]},'description':{'type':Sequelize[_0x0a2a('0x4')]},'phone':{'type':Sequelize[_0x0a2a('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x0a2a('0x3')]},'facebook':{'type':Sequelize[_0x0a2a('0x3')]},'fb_data':{'type':Sequelize[_0x0a2a('0x3')]},'twitter':{'type':Sequelize[_0x0a2a('0x3')]},'skype':{'type':Sequelize[_0x0a2a('0x3')]},'teams':{'type':Sequelize[_0x0a2a('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0a2a('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x0a2a('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x0a2a('0x3')]},'priority':{'type':Sequelize[_0x0a2a('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0a2a('0x6')],'defaultValue':Sequelize[_0x0a2a('0x7')]},'dialTimezone':{'type':Sequelize[_0x0a2a('0x3')]},'utcOffset':{'type':Sequelize[_0x0a2a('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 0f68e16..68eda05 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 _0x5dbe=['findAll','query','user','CmContact','find','catch','keys','length','startsWith','cf_','columnName','displayName','alias','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','body','from','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','where','$or','ListId','findOrCreate','push','contact','all','show','params','Tag','Tags','color','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','CmCustomField','pickBy','isEmpty','table','setFields','id\x20=\x20?','toParam','text','findOne','model','filters','intersection','fields','attributes','order','sort','pick','merge','filter','options','getTags','hasOwnProperty','setTags','ContactItemType','items','item_types','ItemTypeId','description','phone','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','rawAttributes','nolimit','includeAll','include','rows','getHopperHistories','ContactId','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','createReadStream','meta','import','agent','binding','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','User','fork','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','disposition','secondDisposition','UserId','key','Owner','browserName','customerIp','deviceModel','osName','ratingType','ratingValue','subject','substatus','threadId','Interaction','flatten','sortBy','value','slice','moment','bluebird','path','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','json','offset','undefined','count','limit','status','set','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','index','describe'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x5dbe,0xe1));var _0xe5db=function(_0x337651,_0x2af690){_0x337651=_0x337651-0x0;var _0x20893c=_0x5dbe[_0x337651];return _0x20893c;};'use strict';var moment=require(_0xe5db('0x0'));var BPromise=require(_0xe5db('0x1'));var util=require('util');var path=require(_0xe5db('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe5db('0x3'));var Papa=require(_0xe5db('0x4'));var Redis=require(_0xe5db('0x5'));var contacts=require(_0xe5db('0x6'));var qs=require(_0xe5db('0x7'));var logger=require(_0xe5db('0x8'))('api');var config=require(_0xe5db('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xe5db('0xa')],{'host':_0xe5db('0xb'),'port':0x18eb});var socket=require(_0xe5db('0xc'))(new Redis(config[_0xe5db('0xa')]));require('./cmContact.socket')[_0xe5db('0xd')](socket);function respondWithResult(_0xe4d3cc,_0x3ef830){_0x3ef830=_0x3ef830||0xc8;return function(_0x43a032){if(_0x43a032){return _0xe4d3cc['status'](_0x3ef830)[_0xe5db('0xe')](_0x43a032);}};}function respondWithFilteredResult(_0x1c962a,_0x638866){return function(_0x1b68b6){if(_0x1b68b6){var _0x6fa943=typeof _0x638866[_0xe5db('0xf')]==='undefined'&&typeof _0x638866['limit']===_0xe5db('0x10');var _0x49dea2=_0x1b68b6[_0xe5db('0x11')];var _0x2fe0d5=_0x6fa943?0x0:_0x638866[_0xe5db('0xf')];var _0x1dec25=_0x6fa943?_0x1b68b6['count']:_0x638866['offset']+_0x638866[_0xe5db('0x12')];var _0x3a605b;if(_0x1dec25>=_0x49dea2){_0x1dec25=_0x49dea2;_0x3a605b=0xc8;}else{_0x3a605b=0xce;}_0x1c962a[_0xe5db('0x13')](_0x3a605b);return _0x1c962a[_0xe5db('0x14')](_0xe5db('0x15'),_0x2fe0d5+'-'+_0x1dec25+'/'+_0x49dea2)['json'](_0x1b68b6);}return null;};}function saveUpdates(_0x46d2d5){return function(_0x14adff){if(_0x14adff){return _0x14adff[_0xe5db('0x16')](_0x46d2d5)['then'](function(_0x29b029){return _0x29b029;});}return null;};}function removeEntity(_0x3777a4){return function(_0x1b5e06){if(_0x1b5e06){return _0x1b5e06[_0xe5db('0x17')]()[_0xe5db('0x18')](function(){_0x3777a4['status'](0xcc)[_0xe5db('0x19')]();});}};}function handleEntityNotFound(_0x4b455a){return function(_0x113d25){if(!_0x113d25){_0x4b455a[_0xe5db('0x1a')](0x194);}return _0x113d25;};}function handleError(_0x4d4907,_0xd0cf0a){_0xd0cf0a=_0xd0cf0a||0x1f4;return function(_0x58a33d){logger[_0xe5db('0x1b')](_0x58a33d[_0xe5db('0x1c')]);if(_0x58a33d[_0xe5db('0x1d')]){delete _0x58a33d[_0xe5db('0x1d')];}_0x4d4907[_0xe5db('0x13')](_0xd0cf0a)[_0xe5db('0x1e')](_0x58a33d);};}exports[_0xe5db('0x1f')]=function(_0x2c16f8,_0x46252c){var _0x245860={};return contacts[_0xe5db('0x20')]()[_0xe5db('0x18')](function(_0x55a486){_0x245860=qs['getOptions'](_0x55a486,_0x2c16f8);return contacts[_0xe5db('0x21')](_0x2c16f8[_0xe5db('0x22')],_0x2c16f8[_0xe5db('0x23')],_0x245860,_0x55a486);})[_0xe5db('0x18')](respondWithFilteredResult(_0x46252c,_0x245860))['catch'](handleError(_0x46252c,null));};exports[_0xe5db('0x17')]=function(_0x3d0422,_0x51804f){return db[_0xe5db('0x24')][_0xe5db('0x25')]({'where':{'id':_0x3d0422['params']['id']}})[_0xe5db('0x18')](handleEntityNotFound(_0x51804f,null))['then'](removeEntity(_0x51804f,null))[_0xe5db('0x26')](handleError(_0x51804f,null));};exports['describe']=function(_0x348980,_0x510b48){return db['CmContact'][_0xe5db('0x20')]()[_0xe5db('0x18')](function(_0x25013c){delete _0x25013c['tags'];for(var _0x4efbe0=0x0;_0x4efbe0
','Attachments','generateXOAuth2Token','user=','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','@xcally.com','head','name','substring','indexOf','split','length','html','test','includes','attachments','filename','_SRC','replace','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x131d39['slice'](0x0,-0x1)['join']('\x20'):_0x9a5845[_0x7b9f('0xe')];}return'Anonymous';}function getLastName(_0x311b1d){var _0x250d47=_[_0x7b9f('0xd')](_0x311b1d[_0x7b9f('0x9')]);if(_0x250d47&&_0x250d47[_0x7b9f('0xe')]){var _0x4428a4=_0x250d47[_0x7b9f('0xe')][_0x7b9f('0x11')](/\s+/);return _0x4428a4[_0x7b9f('0x12')]>0x1?_0x4428a4['pop']():'';}return'';}function getMails(_0x1a3004,_0x2ba1b6){var _0x4d7fef='';for(var _0x50cece=0x0;_0x50cece<_0x2ba1b6['value']['length'];_0x50cece+=0x1){if(_0x2ba1b6[_0x7b9f('0x9')][_0x50cece][_0x7b9f('0xa')]!==_0x1a3004){if(!_['isEmpty'](_0x4d7fef)){_0x4d7fef+=',';}_0x4d7fef+=_0x2ba1b6[_0x7b9f('0x9')][_0x50cece]['name']||_0x2ba1b6[_0x7b9f('0x9')][_0x50cece][_0x7b9f('0xa')]||'';_0x4d7fef+='\x20<';_0x4d7fef+=_0x2ba1b6[_0x7b9f('0x9')][_0x50cece][_0x7b9f('0xa')]?_0x2ba1b6[_0x7b9f('0x9')][_0x50cece][_0x7b9f('0xa')]:_0x7b9f('0xb')+random['generate'](0x6)+'@xcally.com';_0x4d7fef+='>';}}return _0x4d7fef;}function parseEmail(_0x5b19b4,_0x26a90b,_0x5e8ecc){if(_0x26a90b[_0x7b9f('0x13')]){var _0x2cf67d=/