From b0619fe020494243fb90c610afbfe941bcb46752 Mon Sep 17 00:00:00 2001
From: support
Date: Fri, 15 Jul 2022 07:11:20 +0000
Subject: [PATCH] Built motion from commit 79c7c506.|2.6.12
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
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/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/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/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1203 files changed, 1203 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index d08024c..179e544 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T06:45:48.176Z",
+ "time": "2022-07-15T07:03:09.832Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 7665dea..9f0eaf5 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-15T06:45:48.176Z",
+ "time": "2022-07-15T07:03:09.832Z",
"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 1957b29..6c6a32b 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 _0x7ab6=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x15b612,_0x3570c8){var _0x5bea74=function(_0x29c3db){while(--_0x29c3db){_0x15b612['push'](_0x15b612['shift']());}};_0x5bea74(++_0x3570c8);}(_0x7ab6,0x1bf));var _0x67ab=function(_0x19ad32,_0xcda39d){_0x19ad32=_0x19ad32-0x0;var _0x2d96c8=_0x7ab6[_0x19ad32];return _0x2d96c8;};'use strict';var Sequelize=require(_0x67ab('0x0'));module[_0x67ab('0x1')]={'name':{'type':Sequelize[_0x67ab('0x2')],'get':function(_0x46bb94){return this[_0x67ab('0x3')](_0x67ab('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x67ab('0x5'),_0x67ab('0x6'),_0x67ab('0x7'),'jscripty',_0x67ab('0x8'),'browser',_0x67ab('0x9'),'script']],'msg':_0x67ab('0xa')}},'comment':_0x67ab('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x67ab('0xb')},'data2':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x67ab('0xc')](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[_0x67ab('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x67ab('0xd')},'data7':{'type':Sequelize[_0x67ab('0xe')],'comments':_0x67ab('0xf')}};
\ No newline at end of file
+var _0x5e85=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','motionbar','jscripty','browser'];(function(_0x1c8de9,_0x5b826b){var _0x284b59=function(_0xb0c110){while(--_0xb0c110){_0x1c8de9['push'](_0x1c8de9['shift']());}};_0x284b59(++_0x5b826b);}(_0x5e85,0x161));var _0x55e8=function(_0x878aa5,_0x163df7){_0x878aa5=_0x878aa5-0x0;var _0x35534b=_0x5e85[_0x878aa5];return _0x35534b;};'use strict';var Sequelize=require(_0x55e8('0x0'));module[_0x55e8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b3374){return this[_0x55e8('0x2')]('action');}},'action':{'type':Sequelize[_0x55e8('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x55e8('0x4'),_0x55e8('0x5'),'urlForward',_0x55e8('0x6'),_0x55e8('0x7'),_0x55e8('0x8')]],'msg':_0x55e8('0x9')}},'comment':_0x55e8('0x9')},'data1':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xa')},'data2':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xb')},'data3':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comment':_0x55e8('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x55e8('0xd')},'data5':{'type':Sequelize[_0x55e8('0x3')](0x1000),'comments':_0x55e8('0xe')},'data6':{'type':Sequelize[_0x55e8('0x3')],'comments':_0x55e8('0xf')},'data7':{'type':Sequelize[_0x55e8('0x10')],'comments':_0x55e8('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index d1bb29b..bfed0dc 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 _0x169f=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','body','Action','params','catch','find','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs'];(function(_0x18983d,_0x3472b3){var _0x340651=function(_0x3d8cb7){while(--_0x3d8cb7){_0x18983d['push'](_0x18983d['shift']());}};_0x340651(++_0x3472b3);}(_0x169f,0x13b));var _0xf169=function(_0x59c23e,_0x555150){_0x59c23e=_0x59c23e-0x0;var _0x1db2b4=_0x169f[_0x59c23e];return _0x1db2b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf169('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf169('0x1'));var rp=require('request-promise');var moment=require(_0xf169('0x2'));var BPromise=require(_0xf169('0x3'));var Mustache=require(_0xf169('0x4'));var util=require('util');var path=require(_0xf169('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf169('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf169('0x7'));var squel=require(_0xf169('0x8'));var crypto=require(_0xf169('0x9'));var jsforce=require(_0xf169('0xa'));var deskjs=require(_0xf169('0xb'));var toCsv=require(_0xf169('0xc'));var querystring=require(_0xf169('0xd'));var Papa=require(_0xf169('0xe'));var Redis=require(_0xf169('0xf'));var authService=require(_0xf169('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf169('0x11'));var hardwareService=require(_0xf169('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf169('0x13'));var config=require(_0xf169('0x14'));var licenseUtil=require(_0xf169('0x15'));var db=require(_0xf169('0x16'))['db'];function respondWithStatusCode(_0x5752d4,_0x1bf8b4){_0x1bf8b4=_0x1bf8b4||0xcc;return function(_0x50245a){if(_0x50245a){return _0x5752d4[_0xf169('0x17')](_0x1bf8b4);}return _0x5752d4['status'](_0x1bf8b4)[_0xf169('0x18')]();};}function respondWithResult(_0x4f1879,_0x35ca7a){_0x35ca7a=_0x35ca7a||0xc8;return function(_0x970789){if(_0x970789){return _0x4f1879['status'](_0x35ca7a)[_0xf169('0x19')](_0x970789);}};}function respondWithFilteredResult(_0x3c221c,_0x2d4eb5){return function(_0x4d3807){if(_0x4d3807){var _0x573224=typeof _0x2d4eb5[_0xf169('0x1a')]==='undefined'&&typeof _0x2d4eb5['limit']===_0xf169('0x1b');var _0x31237e=_0x4d3807[_0xf169('0x1c')];var _0x47ef98=_0x573224?0x0:_0x2d4eb5[_0xf169('0x1a')];var _0x5d6a6d=_0x573224?_0x4d3807['count']:_0x2d4eb5[_0xf169('0x1a')]+_0x2d4eb5[_0xf169('0x1d')];var _0xde4dfe;if(_0x5d6a6d>=_0x31237e){_0x5d6a6d=_0x31237e;_0xde4dfe=0xc8;}else{_0xde4dfe=0xce;}_0x3c221c['status'](_0xde4dfe);return _0x3c221c[_0xf169('0x1e')](_0xf169('0x1f'),_0x47ef98+'-'+_0x5d6a6d+'/'+_0x31237e)[_0xf169('0x19')](_0x4d3807);}return null;};}function patchUpdates(_0x5f2cf9){return function(_0x37fa8e){try{jsonpatch['apply'](_0x37fa8e,_0x5f2cf9,!![]);}catch(_0xab7a8d){return BPromise[_0xf169('0x20')](_0xab7a8d);}return _0x37fa8e[_0xf169('0x21')]();};}function saveUpdates(_0x526fa9,_0x23442c){return function(_0x56f724){if(_0x56f724){return _0x56f724[_0xf169('0x22')](_0x526fa9)[_0xf169('0x23')](function(_0x41eb0f){return _0x41eb0f;});}return null;};}function removeEntity(_0x6d6ed5,_0x580923){return function(_0x5498ed){if(_0x5498ed){return _0x5498ed[_0xf169('0x24')]()[_0xf169('0x23')](function(){_0x6d6ed5[_0xf169('0x25')](0xcc)[_0xf169('0x18')]();});}};}function handleEntityNotFound(_0x299d49,_0x14de7d){return function(_0x52ba5c){if(!_0x52ba5c){_0x299d49['sendStatus'](0x194);}return _0x52ba5c;};}function handleError(_0x40dfab,_0x463b5b){_0x463b5b=_0x463b5b||0x1f4;return function(_0x2c129f){logger[_0xf169('0x26')](_0x2c129f[_0xf169('0x27')]);if(_0x2c129f['name']){delete _0x2c129f[_0xf169('0x28')];}_0x40dfab[_0xf169('0x25')](_0x463b5b)['send'](_0x2c129f);};}exports[_0xf169('0x22')]=function(_0x2dbe30,_0x288a74){if(_0x2dbe30[_0xf169('0x29')]['id']){delete _0x2dbe30['body']['id'];}return db[_0xf169('0x2a')]['find']({'where':{'id':_0x2dbe30[_0xf169('0x2b')]['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x288a74,null))[_0xf169('0x23')](saveUpdates(_0x2dbe30[_0xf169('0x29')],null))[_0xf169('0x23')](respondWithResult(_0x288a74,null))[_0xf169('0x2c')](handleError(_0x288a74,null));};exports['destroy']=function(_0x1bf8e4,_0x13cdd0){return db[_0xf169('0x2a')][_0xf169('0x2d')]({'where':{'id':_0x1bf8e4['params']['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x13cdd0,null))[_0xf169('0x23')](removeEntity(_0x13cdd0,null))[_0xf169('0x2c')](handleError(_0x13cdd0,null));};
\ No newline at end of file
+var _0x5cf8=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','body','find','params','Action','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x80b32f,_0x890ca){var _0x599198=function(_0x4aa7db){while(--_0x4aa7db){_0x80b32f['push'](_0x80b32f['shift']());}};_0x599198(++_0x890ca);}(_0x5cf8,0xe0));var _0x85cf=function(_0x55e45c,_0x3fd637){_0x55e45c=_0x55e45c-0x0;var _0x5d304e=_0x5cf8[_0x55e45c];return _0x5d304e;};'use strict';var emlformat=require(_0x85cf('0x0'));var rimraf=require(_0x85cf('0x1'));var zipdir=require(_0x85cf('0x2'));var jsonpatch=require(_0x85cf('0x3'));var rp=require(_0x85cf('0x4'));var moment=require('moment');var BPromise=require(_0x85cf('0x5'));var Mustache=require(_0x85cf('0x6'));var util=require(_0x85cf('0x7'));var path=require('path');var sox=require(_0x85cf('0x8'));var csv=require('to-csv');var ejs=require(_0x85cf('0x9'));var fs=require('fs');var fs_extra=require(_0x85cf('0xa'));var _=require(_0x85cf('0xb'));var squel=require(_0x85cf('0xc'));var crypto=require(_0x85cf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x85cf('0xe'));var toCsv=require(_0x85cf('0xf'));var querystring=require(_0x85cf('0x10'));var Papa=require(_0x85cf('0x11'));var Redis=require(_0x85cf('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x85cf('0x13'));var hardwareService=require(_0x85cf('0x14'));var logger=require(_0x85cf('0x15'))(_0x85cf('0x16'));var utils=require(_0x85cf('0x17'));var config=require(_0x85cf('0x18'));var licenseUtil=require(_0x85cf('0x19'));var db=require(_0x85cf('0x1a'))['db'];function respondWithStatusCode(_0x2c87ad,_0x3249f8){_0x3249f8=_0x3249f8||0xcc;return function(_0x4c005b){if(_0x4c005b){return _0x2c87ad[_0x85cf('0x1b')](_0x3249f8);}return _0x2c87ad[_0x85cf('0x1c')](_0x3249f8)[_0x85cf('0x1d')]();};}function respondWithResult(_0x16595e,_0x2200e4){_0x2200e4=_0x2200e4||0xc8;return function(_0x2a3606){if(_0x2a3606){return _0x16595e[_0x85cf('0x1c')](_0x2200e4)[_0x85cf('0x1e')](_0x2a3606);}};}function respondWithFilteredResult(_0x4eb40f,_0x34b31d){return function(_0x284aac){if(_0x284aac){var _0x5b4702=typeof _0x34b31d[_0x85cf('0x1f')]==='undefined'&&typeof _0x34b31d['limit']==='undefined';var _0x305869=_0x284aac[_0x85cf('0x20')];var _0x4128c6=_0x5b4702?0x0:_0x34b31d[_0x85cf('0x1f')];var _0x425294=_0x5b4702?_0x284aac['count']:_0x34b31d[_0x85cf('0x1f')]+_0x34b31d[_0x85cf('0x21')];var _0x1abac3;if(_0x425294>=_0x305869){_0x425294=_0x305869;_0x1abac3=0xc8;}else{_0x1abac3=0xce;}_0x4eb40f['status'](_0x1abac3);return _0x4eb40f[_0x85cf('0x22')](_0x85cf('0x23'),_0x4128c6+'-'+_0x425294+'/'+_0x305869)['json'](_0x284aac);}return null;};}function patchUpdates(_0x52d19d){return function(_0x2aa61c){try{jsonpatch[_0x85cf('0x24')](_0x2aa61c,_0x52d19d,!![]);}catch(_0x95943e){return BPromise[_0x85cf('0x25')](_0x95943e);}return _0x2aa61c['save']();};}function saveUpdates(_0x3708d9,_0xe27031){return function(_0x1101a5){if(_0x1101a5){return _0x1101a5[_0x85cf('0x26')](_0x3708d9)[_0x85cf('0x27')](function(_0x1a9135){return _0x1a9135;});}return null;};}function removeEntity(_0x49943e,_0x343254){return function(_0x1369a1){if(_0x1369a1){return _0x1369a1[_0x85cf('0x28')]()['then'](function(){_0x49943e['status'](0xcc)[_0x85cf('0x1d')]();});}};}function handleEntityNotFound(_0x5f30ef,_0x16f14f){return function(_0x338b19){if(!_0x338b19){_0x5f30ef['sendStatus'](0x194);}return _0x338b19;};}function handleError(_0x584e8c,_0x2c389b){_0x2c389b=_0x2c389b||0x1f4;return function(_0x58fbbd){logger['error'](_0x58fbbd[_0x85cf('0x29')]);if(_0x58fbbd[_0x85cf('0x2a')]){delete _0x58fbbd[_0x85cf('0x2a')];}_0x584e8c['status'](_0x2c389b)['send'](_0x58fbbd);};}exports[_0x85cf('0x26')]=function(_0x2b3965,_0x52c79f){if(_0x2b3965[_0x85cf('0x2b')]['id']){delete _0x2b3965[_0x85cf('0x2b')]['id'];}return db['Action'][_0x85cf('0x2c')]({'where':{'id':_0x2b3965[_0x85cf('0x2d')]['id']}})[_0x85cf('0x27')](handleEntityNotFound(_0x52c79f,null))[_0x85cf('0x27')](saveUpdates(_0x2b3965[_0x85cf('0x2b')],null))[_0x85cf('0x27')](respondWithResult(_0x52c79f,null))['catch'](handleError(_0x52c79f,null));};exports[_0x85cf('0x28')]=function(_0x369aaa,_0x50e783){return db[_0x85cf('0x2e')]['find']({'where':{'id':_0x369aaa['params']['id']}})['then'](handleEntityNotFound(_0x50e783,null))[_0x85cf('0x27')](removeEntity(_0x50e783,null))[_0x85cf('0x2f')](handleError(_0x50e783,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 96a8f6d..ec6ba48 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 _0x0a78=['api','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x3d220e,_0x3a67a5){var _0x421b95=function(_0x4c6a9a){while(--_0x4c6a9a){_0x3d220e['push'](_0x3d220e['shift']());}};_0x421b95(++_0x3a67a5);}(_0x0a78,0x1ab));var _0x80a7=function(_0x33a877,_0x413a2d){_0x33a877=_0x33a877-0x0;var _0x459879=_0x0a78[_0x33a877];return _0x459879;};'use strict';var _=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var logger=require('../../config/logger')(_0x80a7('0x2'));var moment=require('moment');var BPromise=require(_0x80a7('0x3'));var rp=require(_0x80a7('0x4'));var fs=require('fs');var path=require(_0x80a7('0x5'));var rimraf=require('rimraf');var config=require(_0x80a7('0x6'));var attributes=require('./action.attributes');module[_0x80a7('0x7')]=function(_0x38425e,_0x546c40){return _0x38425e[_0x80a7('0x8')](_0x80a7('0x9'),attributes,{'tableName':_0x80a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff01=['rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xff01,0x130));var _0x1ff0=function(_0xfe28c5,_0x452499){_0xfe28c5=_0xfe28c5-0x0;var _0xad25d1=_0xff01[_0xfe28c5];return _0xad25d1;};'use strict';var _=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var logger=require(_0x1ff0('0x2'))(_0x1ff0('0x3'));var moment=require(_0x1ff0('0x4'));var BPromise=require(_0x1ff0('0x5'));var rp=require(_0x1ff0('0x6'));var fs=require('fs');var path=require(_0x1ff0('0x7'));var rimraf=require(_0x1ff0('0x8'));var config=require('../../config/environment');var attributes=require(_0x1ff0('0x9'));module['exports']=function(_0x34c0f2,_0x43d97b){return _0x34c0f2[_0x1ff0('0xa')](_0x1ff0('0xb'),attributes,{'tableName':_0x1ff0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 0627500..1e5d425 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x53ec,0x192));var _0xc53e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x53ec[_0x2bf6be];return _0x532ef4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x822d4e,_0x3acaac){var _0x5b7fd9=function(_0x4055e6){while(--_0x4055e6){_0x822d4e['push'](_0x822d4e['shift']());}};_0x5b7fd9(++_0x3acaac);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3d836f9..97def7a 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 _0xcfdf=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcfdf,0x195));var _0xfcfd=function(_0x25147b,_0x534c37){_0x25147b=_0x25147b-0x0;var _0x12bc18=_0xcfdf[_0x25147b];return _0x12bc18;};'use strict';var multer=require('multer');var util=require(_0xfcfd('0x0'));var path=require(_0xfcfd('0x1'));var timeout=require(_0xfcfd('0x2'));var express=require(_0xfcfd('0x3'));var router=express[_0xfcfd('0x4')]();var fs_extra=require(_0xfcfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfcfd('0x6'));var config=require(_0xfcfd('0x7'));var controller=require(_0xfcfd('0x8'));router[_0xfcfd('0x9')]('/:id',auth[_0xfcfd('0xa')](),controller[_0xfcfd('0xb')]);router[_0xfcfd('0xc')](_0xfcfd('0xd'),auth[_0xfcfd('0xa')](),controller['destroy']);module[_0xfcfd('0xe')]=router;
\ No newline at end of file
+var _0x347e=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated','update','delete','exports','multer','util','path'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x347e,0x135));var _0xe347=function(_0x24e893,_0x130483){_0x24e893=_0x24e893-0x0;var _0x437e82=_0x347e[_0x24e893];return _0x437e82;};'use strict';var multer=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var path=require(_0xe347('0x2'));var timeout=require(_0xe347('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe347('0x4'));var auth=require(_0xe347('0x5'));var interaction=require(_0xe347('0x6'));var config=require('../../config/environment');var controller=require(_0xe347('0x7'));router['put'](_0xe347('0x8'),auth[_0xe347('0x9')](),controller[_0xe347('0xa')]);router[_0xe347('0xb')]('/:id',auth[_0xe347('0x9')](),controller['destroy']);module[_0xe347('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 28b25e6..296788e 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 _0xbd51=['sequelize','STRING'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5f9a43,_0x33b992){_0x5f9a43=_0x5f9a43-0x0;var _0x1bbb9e=_0xbd51[_0x5f9a43];return _0x1bbb9e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x1a043b,_0x4d540a){var _0x105ff5=function(_0x49532e){while(--_0x49532e){_0x1a043b['push'](_0x1a043b['shift']());}};_0x105ff5(++_0x4d540a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 6fead9b..6bb2151 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 _0x95c3=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','select','output','web','fullPath','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','groupBy','Limited\x20Query:','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x29ce11,_0x3887ab){var _0x255fa8=function(_0x4b5475){while(--_0x4b5475){_0x29ce11['push'](_0x29ce11['shift']());}};_0x255fa8(++_0x3887ab);}(_0x95c3,0x6d));var _0x395c=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x95c3[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x395c('0x0'));var jsonpatch=require(_0x395c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x395c('0x2'));var Mustache=require(_0x395c('0x3'));var util=require(_0x395c('0x4'));var path=require(_0x395c('0x5'));var sox=require(_0x395c('0x6'));var csv=require('to-csv');var ejs=require(_0x395c('0x7'));var fs=require('fs');var fs_extra=require(_0x395c('0x8'));var _=require(_0x395c('0x9'));var squel=require(_0x395c('0xa'));var crypto=require(_0x395c('0xb'));var jsforce=require(_0x395c('0xc'));var deskjs=require(_0x395c('0xd'));var toCsv=require(_0x395c('0xe'));var querystring=require(_0x395c('0xf'));var Papa=require(_0x395c('0x10'));var Redis=require(_0x395c('0x11'));var authService=require(_0x395c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x395c('0x13'));var hardwareService=require(_0x395c('0x14'));var logger=require(_0x395c('0x15'))(_0x395c('0x16'));var utils=require('../../config/utils');var config=require(_0x395c('0x17'));var licenseUtil=require(_0x395c('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x395c('0x19'))[_0x395c('0x1a')];function respondWithStatusCode(_0x2d5125,_0x3cba31){_0x3cba31=_0x3cba31||0xcc;return function(_0x4ffd1f){if(_0x4ffd1f){return _0x2d5125[_0x395c('0x1b')](_0x3cba31);}return _0x2d5125['status'](_0x3cba31)['end']();};}function respondWithResult(_0x493e3b,_0x3173d9){_0x3173d9=_0x3173d9||0xc8;return function(_0x134bf5){if(_0x134bf5){return _0x493e3b[_0x395c('0x1c')](_0x3173d9)[_0x395c('0x1d')](_0x134bf5);}};}function respondWithFilteredResult(_0x2a60d6,_0x5e498e){return function(_0x24b7ba){if(_0x24b7ba){var _0x265c93=typeof _0x5e498e[_0x395c('0x1e')]===_0x395c('0x1f')&&typeof _0x5e498e[_0x395c('0x20')]===_0x395c('0x1f');var _0x55516b=_0x24b7ba['count'];var _0x202efc=_0x265c93?0x0:_0x5e498e[_0x395c('0x1e')];var _0xefe87b=_0x265c93?_0x24b7ba[_0x395c('0x21')]:_0x5e498e[_0x395c('0x1e')]+_0x5e498e['limit'];var _0x5b117e;if(_0xefe87b>=_0x55516b){_0xefe87b=_0x55516b;_0x5b117e=0xc8;}else{_0x5b117e=0xce;}_0x2a60d6[_0x395c('0x1c')](_0x5b117e);return _0x2a60d6[_0x395c('0x22')](_0x395c('0x23'),_0x202efc+'-'+_0xefe87b+'/'+_0x55516b)[_0x395c('0x1d')](_0x24b7ba);}return null;};}function patchUpdates(_0x164628){return function(_0x1c2e7a){try{jsonpatch[_0x395c('0x24')](_0x1c2e7a,_0x164628,!![]);}catch(_0x2c3882){return BPromise[_0x395c('0x25')](_0x2c3882);}return _0x1c2e7a[_0x395c('0x26')]();};}function saveUpdates(_0x160e3b,_0x30eeec){return function(_0x41d2ae){if(_0x41d2ae){return _0x41d2ae[_0x395c('0x27')](_0x160e3b)[_0x395c('0x28')](function(_0x520ee6){return _0x520ee6;});}return null;};}function removeEntity(_0x404384,_0x221350){return function(_0x56faad){if(_0x56faad){return _0x56faad[_0x395c('0x29')]()[_0x395c('0x28')](function(){var _0x6e557f=_0x56faad['get']({'plain':!![]});var _0x977443=_0x395c('0x2a');return db[_0x395c('0x2b')][_0x395c('0x29')]({'where':{'type':_0x977443,'resourceId':_0x6e557f['id']}})[_0x395c('0x28')](function(){return _0x56faad;});})['then'](function(){_0x404384[_0x395c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4b54,_0x328a2c){return function(_0xc609e5){if(!_0xc609e5){_0x2d4b54[_0x395c('0x1b')](0x194);}return _0xc609e5;};}function handleError(_0x1c33f4,_0x26343c){_0x26343c=_0x26343c||0x1f4;return function(_0x393c50){logger[_0x395c('0x2c')](_0x393c50[_0x395c('0x2d')]);if(_0x393c50['name']){delete _0x393c50[_0x395c('0x2e')];}_0x1c33f4[_0x395c('0x1c')](_0x26343c)['send'](_0x393c50);};}exports[_0x395c('0x2f')]=function(_0x2625b7,_0xdb4d05){var _0x453680={},_0x3f6a1d={},_0x3130ad={'count':0x0,'rows':[]};var _0x5159ab=_[_0x395c('0x30')](db['AnalyticCustomReport'][_0x395c('0x31')],function(_0x4189b4){return{'name':_0x4189b4[_0x395c('0x32')],'type':_0x4189b4['type']['key']};});_0x3f6a1d[_0x395c('0x33')]=_[_0x395c('0x30')](_0x5159ab,'name');_0x3f6a1d[_0x395c('0x34')]=_[_0x395c('0x35')](_0x2625b7[_0x395c('0x34')]);_0x3f6a1d[_0x395c('0x36')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],_0x3f6a1d[_0x395c('0x34')]);_0x453680[_0x395c('0x38')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],qs[_0x395c('0x39')](_0x2625b7[_0x395c('0x34')][_0x395c('0x39')]));_0x453680[_0x395c('0x38')]=_0x453680['attributes']['length']?_0x453680[_0x395c('0x38')]:_0x3f6a1d[_0x395c('0x33')];if(!_0x2625b7[_0x395c('0x34')][_0x395c('0x3a')](_0x395c('0x3b'))){_0x453680[_0x395c('0x20')]=qs[_0x395c('0x20')](_0x2625b7['query'][_0x395c('0x20')]);_0x453680[_0x395c('0x1e')]=qs[_0x395c('0x1e')](_0x2625b7['query'][_0x395c('0x1e')]);}_0x453680[_0x395c('0x3c')]=qs[_0x395c('0x3d')](_0x2625b7['query']['sort']);_0x453680[_0x395c('0x3e')]=qs['filters'](_[_0x395c('0x3f')](_0x2625b7[_0x395c('0x34')],_0x3f6a1d[_0x395c('0x36')]),_0x5159ab);if(_0x2625b7['query']['filter']){_0x453680[_0x395c('0x3e')]=_[_0x395c('0x40')](_0x453680['where'],{'$or':_['map'](_0x5159ab,function(_0x1028d5){if(_0x1028d5[_0x395c('0x41')]!==_0x395c('0x42')){var _0x181e33={};_0x181e33[_0x1028d5[_0x395c('0x2e')]]={'$like':'%'+_0x2625b7[_0x395c('0x34')]['filter']+'%'};return _0x181e33;}})});}_0x453680=_['merge']({},_0x453680,_0x2625b7[_0x395c('0x43')]);var _0x22d7aa={'where':_0x453680[_0x395c('0x3e')]};return db['AnalyticCustomReport'][_0x395c('0x21')](_0x22d7aa)['then'](function(_0x3421f8){_0x3130ad[_0x395c('0x21')]=_0x3421f8;if(_0x2625b7['query'][_0x395c('0x44')]){_0x453680[_0x395c('0x45')]=[{'all':!![]}];}return db[_0x395c('0x46')][_0x395c('0x47')](_0x453680);})[_0x395c('0x28')](function(_0x8474af){_0x3130ad[_0x395c('0x48')]=_0x8474af;return _0x3130ad;})[_0x395c('0x28')](respondWithFilteredResult(_0xdb4d05,_0x453680))[_0x395c('0x49')](handleError(_0xdb4d05,null));};exports[_0x395c('0x4a')]=function(_0x3c59a2,_0x5dfba4){var _0x4b47d9={'raw':![],'where':{'id':_0x3c59a2['params']['id']}},_0x596819={};_0x596819[_0x395c('0x33')]=_[_0x395c('0x35')](db[_0x395c('0x46')][_0x395c('0x31')]);_0x596819[_0x395c('0x34')]=_['keys'](_0x3c59a2['query']);_0x596819[_0x395c('0x36')]=_['intersection'](_0x596819[_0x395c('0x33')],_0x596819[_0x395c('0x34')]);_0x4b47d9[_0x395c('0x38')]=_[_0x395c('0x37')](_0x596819[_0x395c('0x33')],qs[_0x395c('0x39')](_0x3c59a2[_0x395c('0x34')][_0x395c('0x39')]));_0x4b47d9[_0x395c('0x38')]=_0x4b47d9['attributes'][_0x395c('0x4b')]?_0x4b47d9[_0x395c('0x38')]:_0x596819[_0x395c('0x33')];if(_0x3c59a2[_0x395c('0x34')][_0x395c('0x44')]){_0x4b47d9[_0x395c('0x45')]=[{'all':!![]}];}_0x4b47d9=_['merge']({},_0x4b47d9,_0x3c59a2[_0x395c('0x43')]);return db['AnalyticCustomReport'][_0x395c('0x4c')](_0x4b47d9)['then'](handleEntityNotFound(_0x5dfba4,null))['then'](respondWithResult(_0x5dfba4,null))[_0x395c('0x49')](handleError(_0x5dfba4,null));};exports[_0x395c('0x4d')]=function(_0x432cb4,_0x2a4979){return db[_0x395c('0x46')][_0x395c('0x4d')](_0x432cb4[_0x395c('0x4e')],{})[_0x395c('0x28')](function(_0x1c6520){var _0x4a053f=_0x432cb4['user']['get']({'plain':!![]});if(!_0x4a053f)throw new Error(_0x395c('0x4f'));if(_0x4a053f[_0x395c('0x50')]===_0x395c('0x51')){var _0x52f975=_0x1c6520[_0x395c('0x52')]({'plain':!![]});var _0x3710ed=_0x395c('0x53');return db['UserProfileSection'][_0x395c('0x4c')]({'where':{'name':_0x3710ed,'userProfileId':_0x4a053f['userProfileId']},'raw':!![]})[_0x395c('0x28')](function(_0x47735e){if(_0x47735e&&_0x47735e[_0x395c('0x54')]===0x0){return db[_0x395c('0x2b')]['create']({'name':_0x52f975[_0x395c('0x2e')],'resourceId':_0x52f975['id'],'type':_0x395c('0x2a'),'sectionId':_0x47735e['id']},{})['then'](function(){return _0x1c6520;});}else{return _0x1c6520;}})['catch'](function(_0x535cc1){logger['error'](_0x395c('0x55'),_0x535cc1);throw _0x535cc1;});}return _0x1c6520;})[_0x395c('0x28')](respondWithResult(_0x2a4979,0xc9))['catch'](handleError(_0x2a4979,null));};exports['update']=function(_0x5a8889,_0x31f41b){if(_0x5a8889['body']['id']){delete _0x5a8889[_0x395c('0x4e')]['id'];}return db[_0x395c('0x46')][_0x395c('0x4c')]({'where':{'id':_0x5a8889['params']['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x31f41b,null))[_0x395c('0x28')](saveUpdates(_0x5a8889[_0x395c('0x4e')],null))['then'](respondWithResult(_0x31f41b,null))['catch'](handleError(_0x31f41b,null));};exports[_0x395c('0x29')]=function(_0x4e7928,_0x5dde80){return db['AnalyticCustomReport'][_0x395c('0x4c')]({'where':{'id':_0x4e7928[_0x395c('0x56')]['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x5dde80,null))[_0x395c('0x28')](removeEntity(_0x5dde80,null))[_0x395c('0x49')](handleError(_0x5dde80,null));};exports[_0x395c('0x57')]=function(_0x4a319e,_0x351f54){var _0x455648=0xa;var _0x59d63f=[_0x395c('0x58'),_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0x240f99={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x395c('0x5c'),'MAX':_0x395c('0x5d'),'MIN':_0x395c('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1cee20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x32c356=function(_0x156ace){return!_[_0x395c('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x395c('0x66')],_0x156ace);};var _0x208d6d=function(_0xbb1a7){if(!_0xbb1a7||!_0xbb1a7['rules'][_0x395c('0x4b')]){return'';}for(var _0x272e13='(',_0x136fca=0x0;_0x136fca<_0xbb1a7[_0x395c('0x67')]['length'];_0x136fca+=0x1){_0x136fca>0x0&&(_0x272e13+='\x20'+_0xbb1a7[_0x395c('0x68')]+'\x20');_0x272e13+=_0xbb1a7[_0x395c('0x67')][_0x136fca]['group']?_0x208d6d(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x69')]):_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6a')]+'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')]+(_0x32c356(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')])?'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6c')]:'');}return _0x272e13+')';};var _0x3bda2a={'where':{'id':_0x4a319e[_0x395c('0x56')]['id']}},_0x227331,_0x3daee5,_0x353b19,_0x3cdb8f,_0x34f5b3;_0x3bda2a=_['merge']({},_0x3bda2a,_0x4a319e[_0x395c('0x43')]);return db[_0x395c('0x46')]['find'](_0x3bda2a)[_0x395c('0x28')](function(_0x2c02ef){if(_0x2c02ef){_0x227331=_0x2c02ef;return _0x2c02ef[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x566612){if(_0x566612){if(!_0x566612['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3daee5=_0x566612;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xd72304){if(_0xd72304){_0x353b19=_[_0x395c('0x71')](_0xd72304,'id');var _0xa8d112;var _0x21a9a=squel['select']();_0x21a9a[_0x395c('0x72')](_0x227331['table']);for(var _0xd2bef9=0x0;_0xd2bef9<_0x3daee5[_0x395c('0x4b')];_0xd2bef9+=0x1){_0xa8d112=_0x3daee5[_0xd2bef9]['MetricId']?_0x353b19[_0x3daee5[_0xd2bef9][_0x395c('0x73')]][_0x395c('0x74')]:_0x3daee5[_0xd2bef9][_0x395c('0x6a')];_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x75')]?_[_0x395c('0x76')](_0x240f99[_0x3daee5[_0xd2bef9][_0x395c('0x75')]],'%s',_0xa8d112):_0xa8d112;_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x77')]?_[_0x395c('0x76')](_0x1cee20[_0x3daee5[_0xd2bef9][_0x395c('0x77')]],'%s',_0xa8d112):_0xa8d112;if(_0x3daee5[_0xd2bef9]['groupBy']){_0x21a9a[_0x395c('0x69')](_0xa8d112);}_0x3daee5[_0xd2bef9]['orderBy']&&_0x21a9a[_0x395c('0x3c')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x78')]===_0x395c('0x79')?![]:!![]);_0x21a9a[_0x395c('0x6a')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x7a')]||_0xa8d112);}if(_0x227331[_0x395c('0x7b')]){_0x227331[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x7b')]);for(var _0xe4c769=0x0;_0xe4c769<_0x227331['joins'][_0x395c('0x4b')];_0xe4c769+=0x1){if(_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x59d63f,_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')])&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7d')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]){_0x21a9a[_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]](_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x227331[_0x395c('0x81')],_0x227331['joins'][_0xe4c769][_0x395c('0x7d')],_0x227331['joins'][_0xe4c769]['foreignTable'],_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]));}}}if(_0x227331[_0x395c('0x82')]){_0x227331[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x82')]);_0x21a9a[_0x395c('0x3e')](_0x208d6d(_0x227331[_0x395c('0x82')][_0x395c('0x69')]));}_0x34f5b3=_0x21a9a[_0x395c('0x83')]();_0x21a9a[_0x395c('0x20')](_0x455648);_0x21a9a[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')]('Limited\x20Query:',_0x21a9a[_0x395c('0x85')]());return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x21a9a[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](respondWithResult(_0x351f54,null))[_0x395c('0x49')](handleError(_0x351f54,null));};function runReport(_0x52faf5,_0x429758,_0x30c58d){var _0x3430f0=_0x429758[_0x395c('0x2e')];var _0x355de9=0xa;var _0x2132af=[_0x395c('0x58'),_0x395c('0x59'),'right_join',_0x395c('0x5b')];var _0x5c3d60={'SUM':'SUM(%s)','COUNT':_0x395c('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x395c('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':_0x395c('0x8b')};var _0x261770={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x504672=function(_0x1c8ecb){return!_['includes'](['IS\x20NULL',_0x395c('0x8c'),'IS\x20EMPTY',_0x395c('0x66')],_0x1c8ecb);};var _0x117d2c=function(_0x2e9031){if(!_0x2e9031||!_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x5ed96f='(',_0xf2e9dd=0x0;_0xf2e9dd<_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')];_0xf2e9dd+=0x1){_0xf2e9dd>0x0&&(_0x5ed96f+='\x20'+_0x2e9031['operator']+'\x20');_0x5ed96f+=_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x69')]?_0x117d2c(_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x69')]):_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6a')]+'\x20'+_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x6b')]+(_0x504672(_0x2e9031[_0x395c('0x67')][_0xf2e9dd]['condition'])?'\x20'+_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6c')]:'');}return _0x5ed96f+')';};var _0x706699={'where':{'id':_0x52faf5['id']}},_0x465df4,_0x2de332,_0x391be6,_0x3fa8cf,_0x20c968;_0x706699=_[_0x395c('0x40')]({},_0x706699,_0x30c58d);return db[_0x395c('0x46')][_0x395c('0x4c')](_0x706699)[_0x395c('0x28')](function(_0x10d1f8){if(_0x10d1f8){_0x465df4=_0x10d1f8;return _0x10d1f8[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x126f6c){if(_0x126f6c){if(!_0x126f6c['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2de332=_0x126f6c;return db[_0x395c('0x70')]['findAll']({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xe8d66c){if(_0xe8d66c){_0x391be6=_[_0x395c('0x71')](_0xe8d66c,'id');var _0x516bad;var _0x52ecbf=squel[_0x395c('0x8e')]();_0x52ecbf[_0x395c('0x72')](_0x465df4['table']);for(var _0x46a431=0x0;_0x46a431<_0x2de332['length'];_0x46a431+=0x1){_0x516bad=_0x2de332[_0x46a431][_0x395c('0x73')]?_0x391be6[_0x2de332[_0x46a431][_0x395c('0x73')]]['metric']:_0x2de332[_0x46a431][_0x395c('0x6a')];_0x516bad=_0x2de332[_0x46a431]['function']?_[_0x395c('0x76')](_0x5c3d60[_0x2de332[_0x46a431]['function']],'%s',_0x516bad):_0x516bad;_0x516bad=_0x2de332[_0x46a431][_0x395c('0x77')]?_[_0x395c('0x76')](_0x261770[_0x2de332[_0x46a431][_0x395c('0x77')]],'%s',_0x516bad):_0x516bad;if(_0x2de332[_0x46a431]['groupBy']){_0x52ecbf['group'](_0x516bad);}_0x2de332[_0x46a431][_0x395c('0x78')]&&_0x52ecbf[_0x395c('0x3c')](_0x516bad,_0x2de332[_0x46a431]['orderBy']===_0x395c('0x79')?![]:!![]);_0x52ecbf[_0x395c('0x6a')](_0x516bad,_0x2de332[_0x46a431]['alias']||_0x516bad);}if(_0x465df4['joins']){_0x465df4[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x7b')]);for(var _0x38dc7b=0x0;_0x38dc7b<_0x465df4[_0x395c('0x7b')][_0x395c('0x4b')];_0x38dc7b+=0x1){if(_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x2132af,_0x465df4['joins'][_0x38dc7b][_0x395c('0x41')])&&_0x465df4[_0x395c('0x7b')][_0x38dc7b]['parentKey']&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')]&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7f')]){_0x52ecbf[_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]](_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignTable'],null,util[_0x395c('0x77')]('%s.%s\x20=\x20%s.%s',_0x465df4['table'],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7d')],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')],_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignKey']));}}}if(_0x465df4[_0x395c('0x82')]){_0x465df4[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x82')]);_0x52ecbf['where'](_0x117d2c(_0x465df4['conditions']['group']));}_0x20c968=_0x52ecbf['clone']();_0x52ecbf[_0x395c('0x20')](_0x355de9);_0x52ecbf[_0x395c('0x1e')](0x0);return;}})['then'](function(){if(_0x429758[_0x395c('0x8f')]===_0x395c('0x90')){return null;}var _0x67fcf4=_[_0x395c('0x40')](_0x429758,{'name':_0x429758[_0x395c('0x91')]||_0x429758[_0x395c('0x2e')]||_0x465df4['name'],'basename':_0x3430f0,'savename':util[_0x395c('0x77')]('%s-%s.%s',_0x429758['name']||_0x465df4[_0x395c('0x2e')],require(_0x395c('0x92'))['generate'](0x4),_0x429758['output']||_0x395c('0x93')),'reportId':_0x465df4['id'],'reportType':_0x395c('0x94')});return db['AnalyticExtractedReport'][_0x395c('0x4d')](_0x67fcf4,{'raw':!![]});})[_0x395c('0x28')](function(_0x28098f){if(_0x465df4['table']===_0x395c('0x95')){_0x20c968[_0x395c('0x3e')](_0x465df4[_0x395c('0x81')]+_0x395c('0x96'),_0x429758[_0x395c('0x97')],_0x429758[_0x395c('0x98')]);}else{_0x20c968['where'](_0x465df4[_0x395c('0x81')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x429758[_0x395c('0x97')],_0x429758['endDate']);}if(_0x28098f){logger[_0x395c('0x99')](_0x395c('0x9a'),_0x20c968[_0x395c('0x85')]());require(_0x395c('0x9b'))[_0x395c('0x9c')](path['join'](__dirname,_0x395c('0x9d'),_0x28098f['output']),[_0x28098f['id'],_0x20c968['toString'](),path[_0x395c('0x58')](__dirname,'../../files/reports',_0x28098f[_0x395c('0x9e')]),_0x3430f0]);return _0x28098f;}else{var _0x260ea1=squel[_0x395c('0x8e')]();_0x260ea1[_0x395c('0x72')]('('+_0x20c968[_0x395c('0x85')]()+')',_0x395c('0x9f'));_0x260ea1['field'](_0x395c('0xa0'),_0x395c('0x21'));_0x20c968['limit'](_0x429758[_0x395c('0x20')]||_0x355de9);_0x20c968['offset'](_0x429758['offset']||0x0);return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x260ea1[_0x395c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x395c('0x88')]})[_0x395c('0x28')](function(_0x541db6){if(!_0x541db6[_0x395c('0x4b')]){_0x3fa8cf=0x0;}else{_0x3fa8cf=_0x541db6[0x0][_0x395c('0x21')]||0x0;}return dbH['sequelize'][_0x395c('0x34')](_0x20c968[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')]['SELECT']});})['then'](function(_0x5f4be7){return{'rows':_0x5f4be7||[],'count':_0x3fa8cf};});}});}exports[_0x395c('0xa1')]=function(_0x4a7bf5,_0x27d594){return runReport(_0x4a7bf5[_0x395c('0x56')],_0x4a7bf5[_0x395c('0x34')],_0x4a7bf5[_0x395c('0x43')])[_0x395c('0x28')](respondWithResult(_0x27d594,null))[_0x395c('0x49')](handleError(_0x27d594,null));};exports['runReport']=runReport;exports['query']=function(_0x4bc3ab,_0x39ef20){var _0x20b9d1=0xa;var _0x23635d=['join',_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0xb51bff={'SUM':_0x395c('0xa2'),'COUNT':_0x395c('0x89'),'COUNT DISTINCT':_0x395c('0x5c'),'MAX':'MAX(%s)','MIN':_0x395c('0x5e'),'AVG':_0x395c('0x8a'),'GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x441b08={'SEC_TO_TIME':_0x395c('0xa3'),'DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x19fe31=function(_0x1e199c){return!_[_0x395c('0x65')]([_0x395c('0xa4'),_0x395c('0x8c'),_0x395c('0xa5'),'IS\x20NOT\x20EMPTY'],_0x1e199c);};var _0x4bd290=function(_0x1e9560){if(!_0x1e9560||!_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x57c75e='(',_0x18bae9=0x0;_0x18bae9<_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')];_0x18bae9+=0x1){_0x18bae9>0x0&&(_0x57c75e+='\x20'+_0x1e9560['operator']+'\x20');_0x57c75e+=_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]?_0x4bd290(_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]):_0x1e9560[_0x395c('0x67')][_0x18bae9]['field']+'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6b')]+(_0x19fe31(_0x1e9560['rules'][_0x18bae9][_0x395c('0x6b')])?'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6c')]:'');}return _0x57c75e+')';};var _0x58b238={'where':{'id':_0x4bc3ab[_0x395c('0x56')]['id']}},_0x2c235b,_0x2264d9,_0x203dbd,_0x5043f9,_0x320baf;_0x58b238=_[_0x395c('0x40')]({},_0x58b238,_0x4bc3ab[_0x395c('0x43')]);return db['AnalyticCustomReport']['find'](_0x58b238)['then'](function(_0x3e90e3){if(_0x3e90e3){_0x2c235b=_0x3e90e3;return _0x3e90e3['getFields']();}return null;})[_0x395c('0x28')](function(_0xefad23){if(_0xefad23){if(!_0xefad23['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2264d9=_0xefad23;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0x468ffa){if(_0x468ffa){_0x203dbd=_[_0x395c('0x71')](_0x468ffa,'id');var _0x53f6e7;var _0x2b4696=squel[_0x395c('0x8e')]();_0x2b4696[_0x395c('0x72')](_0x2c235b[_0x395c('0x81')]);for(var _0x2ac5d5=0x0;_0x2ac5d5<_0x2264d9[_0x395c('0x4b')];_0x2ac5d5+=0x1){_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x73')]?_0x203dbd[_0x2264d9[_0x2ac5d5][_0x395c('0x73')]][_0x395c('0x74')]:_0x2264d9[_0x2ac5d5][_0x395c('0x6a')];_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x75')]?_[_0x395c('0x76')](_0xb51bff[_0x2264d9[_0x2ac5d5][_0x395c('0x75')]],'%s',_0x53f6e7):_0x53f6e7;_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x77')]?_[_0x395c('0x76')](_0x441b08[_0x2264d9[_0x2ac5d5][_0x395c('0x77')]],'%s',_0x53f6e7):_0x53f6e7;if(_0x2264d9[_0x2ac5d5][_0x395c('0xa6')]){_0x2b4696[_0x395c('0x69')](_0x53f6e7);}_0x2264d9[_0x2ac5d5][_0x395c('0x78')]&&_0x2b4696['order'](_0x53f6e7,_0x2264d9[_0x2ac5d5]['orderBy']===_0x395c('0x79')?![]:!![]);_0x2b4696[_0x395c('0x6a')](_0x53f6e7,_0x2264d9[_0x2ac5d5][_0x395c('0x7a')]||_0x53f6e7);}if(_0x2c235b[_0x395c('0x7b')]){_0x2c235b['joins']=JSON[_0x395c('0x7c')](_0x2c235b['joins']);for(var _0x84ea7f=0x0;_0x84ea7f<_0x2c235b['joins'][_0x395c('0x4b')];_0x84ea7f+=0x1){if(_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')]&&_['includes'](_0x23635d,_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')])&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey']&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignTable']&&_0x2c235b['joins'][_0x84ea7f]['foreignKey']){_0x2b4696[_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['type']](_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x2c235b['table'],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey'],_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignKey']));}}}if(_0x2c235b[_0x395c('0x82')]){_0x2c235b[_0x395c('0x82')]=JSON['parse'](_0x2c235b[_0x395c('0x82')]);_0x2b4696['where'](_0x4bd290(_0x2c235b[_0x395c('0x82')][_0x395c('0x69')]));}_0x320baf=_0x2b4696[_0x395c('0x83')]();_0x2b4696['limit'](_0x20b9d1);_0x2b4696[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')](_0x395c('0xa7'),_0x2b4696[_0x395c('0x85')]());return dbH['sequelize']['query'](_0x2b4696['toString'](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](function(){return{'sql':_0x320baf[_0x395c('0x85')]()};})[_0x395c('0x28')](respondWithResult(_0x39ef20,null))[_0x395c('0x49')](handleError(_0x39ef20,null));};
\ No newline at end of file
+var _0x1e91=['send','index','map','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','QueryTypes','COUNT(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','Sequelize','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','sequelize','SELECT','run','runReport','value','select','metric','debug','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','UserProfileResource','error','name'];(function(_0x3ba1b1,_0x35446d){var _0x473018=function(_0x11ca92){while(--_0x11ca92){_0x3ba1b1['push'](_0x3ba1b1['shift']());}};_0x473018(++_0x35446d);}(_0x1e91,0x1d0));var _0x11e9=function(_0x27f424,_0xa6af37){_0x27f424=_0x27f424-0x0;var _0x5ae589=_0x1e91[_0x27f424];return _0x5ae589;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11e9('0x0'));var zipdir=require(_0x11e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11e9('0x2'));var moment=require(_0x11e9('0x3'));var BPromise=require(_0x11e9('0x4'));var Mustache=require(_0x11e9('0x5'));var util=require('util');var path=require(_0x11e9('0x6'));var sox=require(_0x11e9('0x7'));var csv=require(_0x11e9('0x8'));var ejs=require(_0x11e9('0x9'));var fs=require('fs');var fs_extra=require(_0x11e9('0xa'));var _=require('lodash');var squel=require(_0x11e9('0xb'));var crypto=require(_0x11e9('0xc'));var jsforce=require(_0x11e9('0xd'));var deskjs=require(_0x11e9('0xe'));var toCsv=require(_0x11e9('0x8'));var querystring=require('querystring');var Papa=require(_0x11e9('0xf'));var Redis=require(_0x11e9('0x10'));var authService=require(_0x11e9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11e9('0x12'));var logger=require(_0x11e9('0x13'))(_0x11e9('0x14'));var utils=require(_0x11e9('0x15'));var config=require(_0x11e9('0x16'));var licenseUtil=require(_0x11e9('0x17'));var db=require(_0x11e9('0x18'))['db'];var dbH=require(_0x11e9('0x18'))[_0x11e9('0x19')];function respondWithStatusCode(_0x3f51c6,_0x2e9c78){_0x2e9c78=_0x2e9c78||0xcc;return function(_0x290e9b){if(_0x290e9b){return _0x3f51c6['sendStatus'](_0x2e9c78);}return _0x3f51c6['status'](_0x2e9c78)[_0x11e9('0x1a')]();};}function respondWithResult(_0x2abd33,_0x5b3e0a){_0x5b3e0a=_0x5b3e0a||0xc8;return function(_0x30629e){if(_0x30629e){return _0x2abd33[_0x11e9('0x1b')](_0x5b3e0a)[_0x11e9('0x1c')](_0x30629e);}};}function respondWithFilteredResult(_0x4b2364,_0x19031d){return function(_0xecf89a){if(_0xecf89a){var _0x1d831d=typeof _0x19031d[_0x11e9('0x1d')]===_0x11e9('0x1e')&&typeof _0x19031d['limit']===_0x11e9('0x1e');var _0x468e66=_0xecf89a[_0x11e9('0x1f')];var _0x232622=_0x1d831d?0x0:_0x19031d[_0x11e9('0x1d')];var _0x49679b=_0x1d831d?_0xecf89a[_0x11e9('0x1f')]:_0x19031d[_0x11e9('0x1d')]+_0x19031d[_0x11e9('0x20')];var _0x384608;if(_0x49679b>=_0x468e66){_0x49679b=_0x468e66;_0x384608=0xc8;}else{_0x384608=0xce;}_0x4b2364[_0x11e9('0x1b')](_0x384608);return _0x4b2364[_0x11e9('0x21')]('Content-Range',_0x232622+'-'+_0x49679b+'/'+_0x468e66)[_0x11e9('0x1c')](_0xecf89a);}return null;};}function patchUpdates(_0x48fb76){return function(_0x4cb8cf){try{jsonpatch[_0x11e9('0x22')](_0x4cb8cf,_0x48fb76,!![]);}catch(_0x57eebe){return BPromise[_0x11e9('0x23')](_0x57eebe);}return _0x4cb8cf[_0x11e9('0x24')]();};}function saveUpdates(_0x5a0744,_0x598c76){return function(_0x38831c){if(_0x38831c){return _0x38831c[_0x11e9('0x25')](_0x5a0744)[_0x11e9('0x26')](function(_0x27eb23){return _0x27eb23;});}return null;};}function removeEntity(_0x1521c4,_0xccaa9b){return function(_0x1c73c8){if(_0x1c73c8){return _0x1c73c8['destroy']()[_0x11e9('0x26')](function(){var _0x278a2f=_0x1c73c8[_0x11e9('0x27')]({'plain':!![]});var _0x43f763='CustomReports';return db[_0x11e9('0x28')]['destroy']({'where':{'type':_0x43f763,'resourceId':_0x278a2f['id']}})[_0x11e9('0x26')](function(){return _0x1c73c8;});})[_0x11e9('0x26')](function(){_0x1521c4['status'](0xcc)[_0x11e9('0x1a')]();});}};}function handleEntityNotFound(_0x46af11,_0x40279d){return function(_0x44ebd5){if(!_0x44ebd5){_0x46af11['sendStatus'](0x194);}return _0x44ebd5;};}function handleError(_0x42096e,_0x4ca2bd){_0x4ca2bd=_0x4ca2bd||0x1f4;return function(_0x3a0c78){logger[_0x11e9('0x29')](_0x3a0c78['stack']);if(_0x3a0c78['name']){delete _0x3a0c78[_0x11e9('0x2a')];}_0x42096e[_0x11e9('0x1b')](_0x4ca2bd)[_0x11e9('0x2b')](_0x3a0c78);};}exports[_0x11e9('0x2c')]=function(_0x1a1bde,_0x582079){var _0x1b8281={},_0x1f668f={},_0x1f309f={'count':0x0,'rows':[]};var _0x502bf2=_[_0x11e9('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x33b7e0){return{'name':_0x33b7e0['fieldName'],'type':_0x33b7e0[_0x11e9('0x2e')][_0x11e9('0x2f')]};});_0x1f668f[_0x11e9('0x30')]=_[_0x11e9('0x2d')](_0x502bf2,_0x11e9('0x2a'));_0x1f668f['query']=_[_0x11e9('0x31')](_0x1a1bde['query']);_0x1f668f['filters']=_[_0x11e9('0x32')](_0x1f668f[_0x11e9('0x30')],_0x1f668f[_0x11e9('0x33')]);_0x1b8281[_0x11e9('0x34')]=_['intersection'](_0x1f668f['model'],qs[_0x11e9('0x35')](_0x1a1bde['query'][_0x11e9('0x35')]));_0x1b8281[_0x11e9('0x34')]=_0x1b8281[_0x11e9('0x34')][_0x11e9('0x36')]?_0x1b8281['attributes']:_0x1f668f[_0x11e9('0x30')];if(!_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x37')](_0x11e9('0x38'))){_0x1b8281[_0x11e9('0x20')]=qs[_0x11e9('0x20')](_0x1a1bde['query'][_0x11e9('0x20')]);_0x1b8281[_0x11e9('0x1d')]=qs[_0x11e9('0x1d')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x1d')]);}_0x1b8281[_0x11e9('0x39')]=qs[_0x11e9('0x3a')](_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3a')]);_0x1b8281[_0x11e9('0x3b')]=qs[_0x11e9('0x3c')](_[_0x11e9('0x3d')](_0x1a1bde[_0x11e9('0x33')],_0x1f668f['filters']),_0x502bf2);if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]){_0x1b8281[_0x11e9('0x3b')]=_['merge'](_0x1b8281[_0x11e9('0x3b')],{'$or':_[_0x11e9('0x2d')](_0x502bf2,function(_0x43a37f){if(_0x43a37f[_0x11e9('0x2e')]!=='VIRTUAL'){var _0x1cd6e7={};_0x1cd6e7[_0x43a37f['name']]={'$like':'%'+_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x3e')]+'%'};return _0x1cd6e7;}})});}_0x1b8281=_[_0x11e9('0x3f')]({},_0x1b8281,_0x1a1bde[_0x11e9('0x40')]);var _0x252abb={'where':_0x1b8281[_0x11e9('0x3b')]};return db[_0x11e9('0x41')][_0x11e9('0x1f')](_0x252abb)[_0x11e9('0x26')](function(_0x3022e6){_0x1f309f[_0x11e9('0x1f')]=_0x3022e6;if(_0x1a1bde[_0x11e9('0x33')][_0x11e9('0x42')]){_0x1b8281['include']=[{'all':!![]}];}return db[_0x11e9('0x41')][_0x11e9('0x43')](_0x1b8281);})[_0x11e9('0x26')](function(_0x52b6c3){_0x1f309f[_0x11e9('0x44')]=_0x52b6c3;return _0x1f309f;})[_0x11e9('0x26')](respondWithFilteredResult(_0x582079,_0x1b8281))[_0x11e9('0x45')](handleError(_0x582079,null));};exports[_0x11e9('0x46')]=function(_0x2b88ec,_0x3fe633){var _0x962f9b={'raw':![],'where':{'id':_0x2b88ec[_0x11e9('0x47')]['id']}},_0x354edc={};_0x354edc['model']=_[_0x11e9('0x31')](db['AnalyticCustomReport'][_0x11e9('0x48')]);_0x354edc['query']=_['keys'](_0x2b88ec[_0x11e9('0x33')]);_0x354edc[_0x11e9('0x3c')]=_[_0x11e9('0x32')](_0x354edc[_0x11e9('0x30')],_0x354edc[_0x11e9('0x33')]);_0x962f9b['attributes']=_['intersection'](_0x354edc[_0x11e9('0x30')],qs[_0x11e9('0x35')](_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x35')]));_0x962f9b[_0x11e9('0x34')]=_0x962f9b[_0x11e9('0x34')][_0x11e9('0x36')]?_0x962f9b['attributes']:_0x354edc[_0x11e9('0x30')];if(_0x2b88ec[_0x11e9('0x33')][_0x11e9('0x42')]){_0x962f9b[_0x11e9('0x49')]=[{'all':!![]}];}_0x962f9b=_[_0x11e9('0x3f')]({},_0x962f9b,_0x2b88ec[_0x11e9('0x40')]);return db['AnalyticCustomReport'][_0x11e9('0x4a')](_0x962f9b)[_0x11e9('0x26')](handleEntityNotFound(_0x3fe633,null))[_0x11e9('0x26')](respondWithResult(_0x3fe633,null))[_0x11e9('0x45')](handleError(_0x3fe633,null));};exports['create']=function(_0x41099,_0x472cde){return db[_0x11e9('0x41')][_0x11e9('0x4b')](_0x41099[_0x11e9('0x4c')],{})[_0x11e9('0x26')](function(_0x3186e4){var _0x7e4ea7=_0x41099[_0x11e9('0x4d')][_0x11e9('0x27')]({'plain':!![]});if(!_0x7e4ea7)throw new Error(_0x11e9('0x4e'));if(_0x7e4ea7[_0x11e9('0x4f')]==='user'){var _0x12323c=_0x3186e4[_0x11e9('0x27')]({'plain':!![]});var _0x282bd7=_0x11e9('0x50');return db[_0x11e9('0x51')][_0x11e9('0x4a')]({'where':{'name':_0x282bd7,'userProfileId':_0x7e4ea7['userProfileId']},'raw':!![]})[_0x11e9('0x26')](function(_0x4c6f74){if(_0x4c6f74&&_0x4c6f74[_0x11e9('0x52')]===0x0){return db['UserProfileResource'][_0x11e9('0x4b')]({'name':_0x12323c[_0x11e9('0x2a')],'resourceId':_0x12323c['id'],'type':_0x11e9('0x53'),'sectionId':_0x4c6f74['id']},{})[_0x11e9('0x26')](function(){return _0x3186e4;});}else{return _0x3186e4;}})[_0x11e9('0x45')](function(_0x15cef8){logger['error'](_0x11e9('0x54'),_0x15cef8);throw _0x15cef8;});}return _0x3186e4;})[_0x11e9('0x26')](respondWithResult(_0x472cde,0xc9))[_0x11e9('0x45')](handleError(_0x472cde,null));};exports[_0x11e9('0x25')]=function(_0x5dc41e,_0x588d8e){if(_0x5dc41e[_0x11e9('0x4c')]['id']){delete _0x5dc41e[_0x11e9('0x4c')]['id'];}return db[_0x11e9('0x41')][_0x11e9('0x4a')]({'where':{'id':_0x5dc41e[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x588d8e,null))[_0x11e9('0x26')](saveUpdates(_0x5dc41e[_0x11e9('0x4c')],null))[_0x11e9('0x26')](respondWithResult(_0x588d8e,null))['catch'](handleError(_0x588d8e,null));};exports[_0x11e9('0x55')]=function(_0x4ca36a,_0x1a30be){return db['AnalyticCustomReport'][_0x11e9('0x4a')]({'where':{'id':_0x4ca36a[_0x11e9('0x47')]['id']}})[_0x11e9('0x26')](handleEntityNotFound(_0x1a30be,null))[_0x11e9('0x26')](removeEntity(_0x1a30be,null))[_0x11e9('0x45')](handleError(_0x1a30be,null));};exports[_0x11e9('0x56')]=function(_0x2f231e,_0x31949e){var _0x56c81f=0xa;var _0x201756=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x549b79={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x3b4f91={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fa69e=function(_0x239f29){return!_[_0x11e9('0x64')]([_0x11e9('0x65'),_0x11e9('0x66'),'IS\x20EMPTY',_0x11e9('0x67')],_0x239f29);};var _0x99fd7=function(_0x165cfd){if(!_0x165cfd||!_0x165cfd['rules'][_0x11e9('0x36')]){return'';}for(var _0x3340e0='(',_0x1e29b0=0x0;_0x1e29b0<_0x165cfd[_0x11e9('0x68')][_0x11e9('0x36')];_0x1e29b0+=0x1){_0x1e29b0>0x0&&(_0x3340e0+='\x20'+_0x165cfd[_0x11e9('0x69')]+'\x20');_0x3340e0+=_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]?_0x99fd7(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6a')]):_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['field']+'\x20'+_0x165cfd['rules'][_0x1e29b0]['condition']+(_0x4fa69e(_0x165cfd[_0x11e9('0x68')][_0x1e29b0][_0x11e9('0x6b')])?'\x20'+_0x165cfd[_0x11e9('0x68')][_0x1e29b0]['value']:'');}return _0x3340e0+')';};var _0x361c8c={'where':{'id':_0x2f231e['params']['id']}},_0x124532,_0xffad16,_0x3801f0,_0x3572e1,_0x7341eb;_0x361c8c=_[_0x11e9('0x3f')]({},_0x361c8c,_0x2f231e[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x361c8c)['then'](function(_0x26984a){if(_0x26984a){_0x124532=_0x26984a;return _0x26984a[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x44caf0){if(_0x44caf0){if(!_0x44caf0[_0x11e9('0x36')]){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0xffad16=_0x44caf0;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x344095){if(_0x344095){_0x3801f0=_[_0x11e9('0x70')](_0x344095,'id');var _0x39acd1;var _0x3d48a1=squel['select']();_0x3d48a1[_0x11e9('0x71')](_0x124532[_0x11e9('0x72')]);for(var _0x2de040=0x0;_0x2de040<_0xffad16[_0x11e9('0x36')];_0x2de040+=0x1){_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x73')]?_0x3801f0[_0xffad16[_0x2de040][_0x11e9('0x73')]]['metric']:_0xffad16[_0x2de040][_0x11e9('0x74')];_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x549b79[_0xffad16[_0x2de040][_0x11e9('0x75')]],'%s',_0x39acd1):_0x39acd1;_0x39acd1=_0xffad16[_0x2de040][_0x11e9('0x77')]?_['replace'](_0x3b4f91[_0xffad16[_0x2de040][_0x11e9('0x77')]],'%s',_0x39acd1):_0x39acd1;if(_0xffad16[_0x2de040][_0x11e9('0x78')]){_0x3d48a1['group'](_0x39acd1);}_0xffad16[_0x2de040]['orderBy']&&_0x3d48a1[_0x11e9('0x39')](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x79')]===_0x11e9('0x7a')?![]:!![]);_0x3d48a1['field'](_0x39acd1,_0xffad16[_0x2de040][_0x11e9('0x7b')]||_0x39acd1);}if(_0x124532[_0x11e9('0x7c')]){_0x124532[_0x11e9('0x7c')]=JSON[_0x11e9('0x7d')](_0x124532['joins']);for(var _0x7ef269=0x0;_0x7ef269<_0x124532[_0x11e9('0x7c')][_0x11e9('0x36')];_0x7ef269+=0x1){if(_0x124532['joins'][_0x7ef269][_0x11e9('0x2e')]&&_['includes'](_0x201756,_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x2e')])&&_0x124532['joins'][_0x7ef269][_0x11e9('0x7e')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')]&&_0x124532[_0x11e9('0x7c')][_0x7ef269]['foreignKey']){_0x3d48a1[_0x124532['joins'][_0x7ef269]['type']](_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],null,util['format'](_0x11e9('0x80'),_0x124532[_0x11e9('0x72')],_0x124532[_0x11e9('0x7c')][_0x7ef269]['parentKey'],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x7f')],_0x124532[_0x11e9('0x7c')][_0x7ef269][_0x11e9('0x81')]));}}}if(_0x124532['conditions']){_0x124532[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x124532['conditions']);_0x3d48a1[_0x11e9('0x3b')](_0x99fd7(_0x124532[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x7341eb=_0x3d48a1[_0x11e9('0x83')]();_0x3d48a1[_0x11e9('0x20')](_0x56c81f);_0x3d48a1[_0x11e9('0x1d')](0x0);logger['debug'](_0x11e9('0x84'),_0x3d48a1[_0x11e9('0x85')]());return dbH['sequelize']['query'](_0x3d48a1[_0x11e9('0x85')](),{'type':dbH['sequelize'][_0x11e9('0x86')]['SELECT']});}})[_0x11e9('0x26')](respondWithResult(_0x31949e,null))[_0x11e9('0x45')](handleError(_0x31949e,null));};function runReport(_0x56d38b,_0x40b67d,_0x5d29ed){var _0x13b7eb=_0x40b67d['name'];var _0x2297a4=0xa;var _0x270905=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0x2ed1fd={'SUM':'SUM(%s)','COUNT':_0x11e9('0x87'),'COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':_0x11e9('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':_0x11e9('0x61')};var _0x49d3a2={'SEC_TO_TIME':_0x11e9('0x89'),'DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x145727=function(_0x43376e){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x43376e);};var _0x49d742=function(_0xeb16a9){if(!_0xeb16a9||!_0xeb16a9[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x540d1f='(',_0x42c6b3=0x0;_0x42c6b3<_0xeb16a9['rules'][_0x11e9('0x36')];_0x42c6b3+=0x1){_0x42c6b3>0x0&&(_0x540d1f+='\x20'+_0xeb16a9['operator']+'\x20');_0x540d1f+=_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]?_0x49d742(_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6a')]):_0xeb16a9[_0x11e9('0x68')][_0x42c6b3]['field']+'\x20'+_0xeb16a9[_0x11e9('0x68')][_0x42c6b3][_0x11e9('0x6b')]+(_0x145727(_0xeb16a9['rules'][_0x42c6b3][_0x11e9('0x6b')])?'\x20'+_0xeb16a9['rules'][_0x42c6b3]['value']:'');}return _0x540d1f+')';};var _0x203c03={'where':{'id':_0x56d38b['id']}},_0x4bf3c4,_0x5a38e2,_0x34d8e7,_0xbc6a54,_0x209e8e;_0x203c03=_['merge']({},_0x203c03,_0x5d29ed);return db[_0x11e9('0x41')]['find'](_0x203c03)['then'](function(_0x4b1a87){if(_0x4b1a87){_0x4bf3c4=_0x4b1a87;return _0x4b1a87[_0x11e9('0x6c')]();}return null;})[_0x11e9('0x26')](function(_0x556ca9){if(_0x556ca9){if(!_0x556ca9[_0x11e9('0x36')]){throw new db[(_0x11e9('0x8d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5a38e2=_0x556ca9;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x56b34f){if(_0x56b34f){_0x34d8e7=_['keyBy'](_0x56b34f,'id');var _0x124cee;var _0x36217d=squel['select']();_0x36217d[_0x11e9('0x71')](_0x4bf3c4[_0x11e9('0x72')]);for(var _0x4de937=0x0;_0x4de937<_0x5a38e2[_0x11e9('0x36')];_0x4de937+=0x1){_0x124cee=_0x5a38e2[_0x4de937]['MetricId']?_0x34d8e7[_0x5a38e2[_0x4de937]['MetricId']]['metric']:_0x5a38e2[_0x4de937]['field'];_0x124cee=_0x5a38e2[_0x4de937][_0x11e9('0x75')]?_[_0x11e9('0x76')](_0x2ed1fd[_0x5a38e2[_0x4de937]['function']],'%s',_0x124cee):_0x124cee;_0x124cee=_0x5a38e2[_0x4de937]['format']?_[_0x11e9('0x76')](_0x49d3a2[_0x5a38e2[_0x4de937]['format']],'%s',_0x124cee):_0x124cee;if(_0x5a38e2[_0x4de937][_0x11e9('0x78')]){_0x36217d[_0x11e9('0x6a')](_0x124cee);}_0x5a38e2[_0x4de937][_0x11e9('0x79')]&&_0x36217d[_0x11e9('0x39')](_0x124cee,_0x5a38e2[_0x4de937]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x36217d[_0x11e9('0x74')](_0x124cee,_0x5a38e2[_0x4de937][_0x11e9('0x7b')]||_0x124cee);}if(_0x4bf3c4[_0x11e9('0x7c')]){_0x4bf3c4['joins']=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x7c')]);for(var _0x357077=0x0;_0x357077<_0x4bf3c4['joins'][_0x11e9('0x36')];_0x357077+=0x1){if(_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]&&_['includes'](_0x270905,_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')])&&_0x4bf3c4['joins'][_0x357077]['parentKey']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable']&&_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]){_0x36217d[_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x2e')]](_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x4bf3c4[_0x11e9('0x72')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x7e')],_0x4bf3c4[_0x11e9('0x7c')][_0x357077]['foreignTable'],_0x4bf3c4[_0x11e9('0x7c')][_0x357077][_0x11e9('0x81')]));}}}if(_0x4bf3c4[_0x11e9('0x82')]){_0x4bf3c4[_0x11e9('0x82')]=JSON[_0x11e9('0x7d')](_0x4bf3c4[_0x11e9('0x82')]);_0x36217d[_0x11e9('0x3b')](_0x49d742(_0x4bf3c4[_0x11e9('0x82')][_0x11e9('0x6a')]));}_0x209e8e=_0x36217d[_0x11e9('0x83')]();_0x36217d[_0x11e9('0x20')](_0x2297a4);_0x36217d[_0x11e9('0x1d')](0x0);return;}})[_0x11e9('0x26')](function(){if(_0x40b67d[_0x11e9('0x8e')]===_0x11e9('0x8f')){return null;}var _0x456074=_[_0x11e9('0x3f')](_0x40b67d,{'name':_0x40b67d[_0x11e9('0x90')]||_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],'basename':_0x13b7eb,'savename':util[_0x11e9('0x77')]('%s-%s.%s',_0x40b67d[_0x11e9('0x2a')]||_0x4bf3c4[_0x11e9('0x2a')],require(_0x11e9('0x91'))[_0x11e9('0x92')](0x4),_0x40b67d[_0x11e9('0x8e')]||_0x11e9('0x93')),'reportId':_0x4bf3c4['id'],'reportType':_0x11e9('0x94')});return db[_0x11e9('0x95')]['create'](_0x456074,{'raw':!![]});})['then'](function(_0x134f75){if(_0x4bf3c4['table']==='cdr'){_0x209e8e['where'](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x96'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}else{_0x209e8e[_0x11e9('0x3b')](_0x4bf3c4[_0x11e9('0x72')]+_0x11e9('0x99'),_0x40b67d[_0x11e9('0x97')],_0x40b67d[_0x11e9('0x98')]);}if(_0x134f75){logger[_0x11e9('0x9a')](_0x11e9('0x9b'),_0x209e8e[_0x11e9('0x85')]());require(_0x11e9('0x9c'))[_0x11e9('0x9d')](path['join'](__dirname,_0x11e9('0x9e'),_0x134f75['output']),[_0x134f75['id'],_0x209e8e[_0x11e9('0x85')](),path[_0x11e9('0x57')](__dirname,'../../files/reports',_0x134f75[_0x11e9('0x9f')]),_0x13b7eb]);return _0x134f75;}else{var _0xc2f347=squel['select']();_0xc2f347[_0x11e9('0x71')]('('+_0x209e8e[_0x11e9('0x85')]()+')','countTable');_0xc2f347[_0x11e9('0x74')](_0x11e9('0xa0'),_0x11e9('0x1f'));_0x209e8e[_0x11e9('0x20')](_0x40b67d['limit']||_0x2297a4);_0x209e8e[_0x11e9('0x1d')](_0x40b67d[_0x11e9('0x1d')]||0x0);return dbH[_0x11e9('0xa1')]['query'](_0xc2f347['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')]['SELECT']})[_0x11e9('0x26')](function(_0x21592d){if(!_0x21592d[_0x11e9('0x36')]){_0xbc6a54=0x0;}else{_0xbc6a54=_0x21592d[0x0][_0x11e9('0x1f')]||0x0;}return dbH[_0x11e9('0xa1')]['query'](_0x209e8e[_0x11e9('0x85')](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});})['then'](function(_0x5ebccf){return{'rows':_0x5ebccf||[],'count':_0xbc6a54};});}});}exports[_0x11e9('0xa3')]=function(_0x299dc7,_0x51e2d5){return runReport(_0x299dc7[_0x11e9('0x47')],_0x299dc7['query'],_0x299dc7[_0x11e9('0x40')])['then'](respondWithResult(_0x51e2d5,null))['catch'](handleError(_0x51e2d5,null));};exports[_0x11e9('0xa4')]=runReport;exports[_0x11e9('0x33')]=function(_0x221300,_0x5dd0a5){var _0x2e3ed0=0xa;var _0x1333e4=[_0x11e9('0x57'),_0x11e9('0x58'),_0x11e9('0x59'),_0x11e9('0x5a')];var _0xd2aa06={'SUM':_0x11e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x11e9('0x5c'),'MAX':_0x11e9('0x5d'),'MIN':_0x11e9('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x11e9('0x5f'),'GROUP_CONCAT ASC':_0x11e9('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe8b688={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x11e9('0x8a'),'HOUR':_0x11e9('0x62'),'ROUND':_0x11e9('0x63'),'UNIX_TIMESTAMP':_0x11e9('0x8b')};var _0x440c64=function(_0x432da6){return!_['includes']([_0x11e9('0x65'),_0x11e9('0x66'),_0x11e9('0x8c'),_0x11e9('0x67')],_0x432da6);};var _0x7aee04=function(_0x13b7f6){if(!_0x13b7f6||!_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')]){return'';}for(var _0x202bbd='(',_0x7a25b1=0x0;_0x7a25b1<_0x13b7f6[_0x11e9('0x68')][_0x11e9('0x36')];_0x7a25b1+=0x1){_0x7a25b1>0x0&&(_0x202bbd+='\x20'+_0x13b7f6[_0x11e9('0x69')]+'\x20');_0x202bbd+=_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]?_0x7aee04(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6a')]):_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x74')]+'\x20'+_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')]+(_0x440c64(_0x13b7f6[_0x11e9('0x68')][_0x7a25b1][_0x11e9('0x6b')])?'\x20'+_0x13b7f6['rules'][_0x7a25b1][_0x11e9('0xa5')]:'');}return _0x202bbd+')';};var _0x19cb52={'where':{'id':_0x221300[_0x11e9('0x47')]['id']}},_0x1c2031,_0x377fdf,_0x5b2a4c,_0x5bf5f7,_0x404128;_0x19cb52=_[_0x11e9('0x3f')]({},_0x19cb52,_0x221300[_0x11e9('0x40')]);return db[_0x11e9('0x41')][_0x11e9('0x4a')](_0x19cb52)['then'](function(_0x1dd63c){if(_0x1dd63c){_0x1c2031=_0x1dd63c;return _0x1dd63c['getFields']();}return null;})[_0x11e9('0x26')](function(_0x43e7b4){if(_0x43e7b4){if(!_0x43e7b4['length']){throw new db['Sequelize'][(_0x11e9('0x6d'))](_0x11e9('0x6e'),0x193);}_0x377fdf=_0x43e7b4;return db[_0x11e9('0x6f')][_0x11e9('0x43')]({'raw':!![]});}return null;})[_0x11e9('0x26')](function(_0x20fbd8){if(_0x20fbd8){_0x5b2a4c=_[_0x11e9('0x70')](_0x20fbd8,'id');var _0x557f0d;var _0x430002=squel[_0x11e9('0xa6')]();_0x430002[_0x11e9('0x71')](_0x1c2031[_0x11e9('0x72')]);for(var _0x460cd9=0x0;_0x460cd9<_0x377fdf['length'];_0x460cd9+=0x1){_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x73')]?_0x5b2a4c[_0x377fdf[_0x460cd9][_0x11e9('0x73')]][_0x11e9('0xa7')]:_0x377fdf[_0x460cd9]['field'];_0x557f0d=_0x377fdf[_0x460cd9]['function']?_[_0x11e9('0x76')](_0xd2aa06[_0x377fdf[_0x460cd9][_0x11e9('0x75')]],'%s',_0x557f0d):_0x557f0d;_0x557f0d=_0x377fdf[_0x460cd9][_0x11e9('0x77')]?_[_0x11e9('0x76')](_0xe8b688[_0x377fdf[_0x460cd9]['format']],'%s',_0x557f0d):_0x557f0d;if(_0x377fdf[_0x460cd9][_0x11e9('0x78')]){_0x430002[_0x11e9('0x6a')](_0x557f0d);}_0x377fdf[_0x460cd9][_0x11e9('0x79')]&&_0x430002['order'](_0x557f0d,_0x377fdf[_0x460cd9]['orderBy']===_0x11e9('0x7a')?![]:!![]);_0x430002[_0x11e9('0x74')](_0x557f0d,_0x377fdf[_0x460cd9]['alias']||_0x557f0d);}if(_0x1c2031[_0x11e9('0x7c')]){_0x1c2031[_0x11e9('0x7c')]=JSON['parse'](_0x1c2031[_0x11e9('0x7c')]);for(var _0x4108a9=0x0;_0x4108a9<_0x1c2031[_0x11e9('0x7c')][_0x11e9('0x36')];_0x4108a9+=0x1){if(_0x1c2031['joins'][_0x4108a9]['type']&&_[_0x11e9('0x64')](_0x1333e4,_0x1c2031['joins'][_0x4108a9]['type'])&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')]&&_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')]&&_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x81')]){_0x430002[_0x1c2031['joins'][_0x4108a9]['type']](_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7f')],null,util[_0x11e9('0x77')]('%s.%s\x20=\x20%s.%s',_0x1c2031['table'],_0x1c2031[_0x11e9('0x7c')][_0x4108a9][_0x11e9('0x7e')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x7f')],_0x1c2031['joins'][_0x4108a9][_0x11e9('0x81')]));}}}if(_0x1c2031[_0x11e9('0x82')]){_0x1c2031['conditions']=JSON[_0x11e9('0x7d')](_0x1c2031['conditions']);_0x430002['where'](_0x7aee04(_0x1c2031['conditions'][_0x11e9('0x6a')]));}_0x404128=_0x430002['clone']();_0x430002[_0x11e9('0x20')](_0x2e3ed0);_0x430002[_0x11e9('0x1d')](0x0);logger[_0x11e9('0xa8')]('Limited\x20Query:',_0x430002[_0x11e9('0x85')]());return dbH[_0x11e9('0xa1')][_0x11e9('0x33')](_0x430002['toString'](),{'type':dbH[_0x11e9('0xa1')][_0x11e9('0x86')][_0x11e9('0xa2')]});}})[_0x11e9('0x26')](function(){return{'sql':_0x404128['toString']()};})['then'](respondWithResult(_0x5dd0a5,null))['catch'](handleError(_0x5dd0a5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 1e46f20..03bcfc6 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 _0x98e8=['api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x584d2a,_0x80af2e){var _0x2929cc=function(_0xbca9e3){while(--_0xbca9e3){_0x584d2a['push'](_0x584d2a['shift']());}};_0x2929cc(++_0x80af2e);}(_0x98e8,0x10e));var _0x898e=function(_0x52c3e2,_0x332d61){_0x52c3e2=_0x52c3e2-0x0;var _0x325392=_0x98e8[_0x52c3e2];return _0x325392;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var logger=require(_0x898e('0x2'))(_0x898e('0x3'));var moment=require('moment');var BPromise=require(_0x898e('0x4'));var rp=require(_0x898e('0x5'));var fs=require('fs');var path=require(_0x898e('0x6'));var rimraf=require('rimraf');var config=require(_0x898e('0x7'));var attributes=require(_0x898e('0x8'));module[_0x898e('0x9')]=function(_0xa016de,_0x37bb10){return _0xa016de[_0x898e('0xa')](_0x898e('0xb'),attributes,{'tableName':_0x898e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe657=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x8473ab,_0x11263e){var _0x3a89c0=function(_0x95ab9f){while(--_0x95ab9f){_0x8473ab['push'](_0x8473ab['shift']());}};_0x3a89c0(++_0x11263e);}(_0xe657,0x1c1));var _0x7e65=function(_0xdfe8c4,_0x3f695c){_0xdfe8c4=_0xdfe8c4-0x0;var _0x5ee124=_0xe657[_0xdfe8c4];return _0x5ee124;};'use strict';var _=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var logger=require(_0x7e65('0x2'))('api');var moment=require(_0x7e65('0x3'));var BPromise=require(_0x7e65('0x4'));var rp=require(_0x7e65('0x5'));var fs=require('fs');var path=require(_0x7e65('0x6'));var rimraf=require(_0x7e65('0x7'));var config=require(_0x7e65('0x8'));var attributes=require(_0x7e65('0x9'));module['exports']=function(_0x4e416a,_0x51ba1d){return _0x4e416a[_0x7e65('0xa')](_0x7e65('0xb'),attributes,{'tableName':_0x7e65('0xc'),'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 4ed2332..c7f31ea 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 _0xebb5=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0xebb5,0xb5));var _0x5ebb=function(_0x22d9ee,_0x2f495b){_0x22d9ee=_0x22d9ee-0x0;var _0x3f66f1=_0xebb5[_0x22d9ee];return _0x3f66f1;};'use strict';var _=require(_0x5ebb('0x0'));var util=require(_0x5ebb('0x1'));var moment=require(_0x5ebb('0x2'));var BPromise=require(_0x5ebb('0x3'));var rs=require(_0x5ebb('0x4'));var fs=require('fs');var Redis=require(_0x5ebb('0x5'));var db=require(_0x5ebb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ebb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebb('0x8'));var client=jayson[_0x5ebb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b31a8,_0x2a417f,_0x1954a7){return new BPromise(function(_0x259c3d,_0x767513){return client[_0x5ebb('0xa')](_0x3b31a8,_0x1954a7)[_0x5ebb('0xb')](function(_0x34136c){logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));logger[_0x5ebb('0xe')](_0x5ebb('0xf'),_0x2a417f,_0x5ebb('0xd'),JSON[_0x5ebb('0x10')](_0x34136c));if(_0x34136c[_0x5ebb('0x11')]){if(_0x34136c['error']['code']===0x1f4){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')]['message']);return _0x767513(_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);}logger['error'](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);return _0x259c3d(_0x34136c['error'][_0x5ebb('0x12')]);}else{logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));_0x259c3d(_0x34136c[_0x5ebb('0x13')][_0x5ebb('0x12')]);}})['catch'](function(_0xbac4ed){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0xbac4ed);_0x767513(_0xbac4ed);});});}
\ No newline at end of file
+var _0xd3be=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2514ff,_0x381293){var _0x21579d=function(_0x411c12){while(--_0x411c12){_0x2514ff['push'](_0x2514ff['shift']());}};_0x21579d(++_0x381293);}(_0xd3be,0xdf));var _0xed3b=function(_0x5d35b7,_0x3337e2){_0x5d35b7=_0x5d35b7-0x0;var _0x158b8b=_0xd3be[_0x5d35b7];return _0x158b8b;};'use strict';var _=require(_0xed3b('0x0'));var util=require(_0xed3b('0x1'));var moment=require(_0xed3b('0x2'));var BPromise=require('bluebird');var rs=require(_0xed3b('0x3'));var fs=require('fs');var Redis=require(_0xed3b('0x4'));var db=require(_0xed3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed3b('0x6'))(_0xed3b('0x7'));var config=require(_0xed3b('0x8'));var jayson=require(_0xed3b('0x9'));var client=jayson['client'][_0xed3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47dbac,_0x4d281e,_0x44bfb7){return new BPromise(function(_0x16bea0,_0x4f5223){return client[_0xed3b('0xb')](_0x47dbac,_0x44bfb7)[_0xed3b('0xc')](function(_0x3ff99d){logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));logger['debug'](_0xed3b('0x10'),_0x4d281e,'request\x20sent',JSON['stringify'](_0x3ff99d));if(_0x3ff99d[_0xed3b('0x11')]){if(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x12')]===0x1f4){logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x4f5223(_0x3ff99d['error'][_0xed3b('0x13')]);}logger[_0xed3b('0x11')](_0xed3b('0xe'),_0x4d281e,_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);return _0x16bea0(_0x3ff99d[_0xed3b('0x11')][_0xed3b('0x13')]);}else{logger[_0xed3b('0xd')](_0xed3b('0xe'),_0x4d281e,_0xed3b('0xf'));_0x16bea0(_0x3ff99d[_0xed3b('0x14')]['message']);}})[_0xed3b('0x15')](function(_0x3ff86b){logger[_0xed3b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d281e,_0x3ff86b);_0x4f5223(_0x3ff86b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index f7be351..cb4cf2c 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 _0x7490=['/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x5d0969,_0x15e07f){var _0x2f67aa=function(_0x59e132){while(--_0x59e132){_0x5d0969['push'](_0x5d0969['shift']());}};_0x2f67aa(++_0x15e07f);}(_0x7490,0xf4));var _0x0749=function(_0x2d9951,_0x121f23){_0x2d9951=_0x2d9951-0x0;var _0x310df9=_0x7490[_0x2d9951];return _0x310df9;};'use strict';var multer=require(_0x0749('0x0'));var util=require('util');var path=require(_0x0749('0x1'));var timeout=require(_0x0749('0x2'));var express=require(_0x0749('0x3'));var router=express[_0x0749('0x4')]();var fs_extra=require(_0x0749('0x5'));var auth=require(_0x0749('0x6'));var interaction=require(_0x0749('0x7'));var config=require(_0x0749('0x8'));var controller=require(_0x0749('0x9'));router[_0x0749('0xa')]('/',auth[_0x0749('0xb')](),controller[_0x0749('0xc')]);router['get'](_0x0749('0xd'),auth[_0x0749('0xb')](),controller['show']);router[_0x0749('0xa')](_0x0749('0xe'),auth[_0x0749('0xb')](),controller[_0x0749('0xf')]);router[_0x0749('0xa')](_0x0749('0x10'),auth[_0x0749('0xb')](),controller[_0x0749('0x11')]);router[_0x0749('0xa')](_0x0749('0x12'),auth['isAuthenticated'](),controller[_0x0749('0x13')]);router['post']('/',auth[_0x0749('0xb')](),controller[_0x0749('0x14')]);router[_0x0749('0x15')]('/:id',auth[_0x0749('0xb')](),controller[_0x0749('0x16')]);router[_0x0749('0x17')](_0x0749('0xd'),auth[_0x0749('0xb')](),controller[_0x0749('0x18')]);module[_0x0749('0x19')]=router;
\ No newline at end of file
+var _0xd78c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0xd78c,0x10d));var _0xcd78=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd78c[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xcd78('0x0'));var util=require(_0xcd78('0x1'));var path=require(_0xcd78('0x2'));var timeout=require(_0xcd78('0x3'));var express=require(_0xcd78('0x4'));var router=express[_0xcd78('0x5')]();var fs_extra=require(_0xcd78('0x6'));var auth=require(_0xcd78('0x7'));var interaction=require(_0xcd78('0x8'));var config=require(_0xcd78('0x9'));var controller=require(_0xcd78('0xa'));router[_0xcd78('0xb')]('/',auth[_0xcd78('0xc')](),controller['index']);router[_0xcd78('0xb')](_0xcd78('0xd'),auth['isAuthenticated'](),controller[_0xcd78('0xe')]);router['get'](_0xcd78('0xf'),auth['isAuthenticated'](),controller[_0xcd78('0x10')]);router[_0xcd78('0xb')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xcd78('0xb')]('/:id/query',auth[_0xcd78('0xc')](),controller[_0xcd78('0x11')]);router[_0xcd78('0x12')]('/',auth[_0xcd78('0xc')](),controller[_0xcd78('0x13')]);router[_0xcd78('0x14')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['update']);router[_0xcd78('0x15')](_0xcd78('0xd'),auth[_0xcd78('0xc')](),controller['destroy']);module[_0xcd78('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 24a0e75..6afd776 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x26eeaf,_0x18f26d){var _0x20a33c=function(_0xe8790e){while(--_0xe8790e){_0x26eeaf['push'](_0x26eeaf['shift']());}};_0x20a33c(++_0x18f26d);}(_0x53ec,0x192));var _0xc53e=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x53ec[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x55ad58,_0x44c12f){var _0x471b98=function(_0x52a1cd){while(--_0x52a1cd){_0x55ad58['push'](_0x55ad58['shift']());}};_0x471b98(++_0x44c12f);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x299565,_0x13b4df){_0x299565=_0x299565-0x0;var _0x413367=_0x3eea[_0x299565];return _0x413367;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5c5d1f2..ca4c3af 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1868f4,_0x150266){var _0x273bf8=function(_0x596165){while(--_0x596165){_0x1868f4['push'](_0x1868f4['shift']());}};_0x273bf8(++_0x150266);}(_0xda19,0xd5));var _0x9da1=function(_0x2b6fb8,_0x13466c){_0x2b6fb8=_0x2b6fb8-0x0;var _0x3b161a=_0xda19[_0x2b6fb8];return _0x3b161a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
+var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x191559,_0xb1a10f){var _0x1f6626=function(_0x61578b){while(--_0x61578b){_0x191559['push'](_0x191559['shift']());}};_0x1f6626(++_0xb1a10f);}(_0x814b,0x1a2));var _0xb814=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x814b[_0x5a2299];return _0xedff0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c9ec0de..0f4255e 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 _0x7010=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','api','moment','request-promise','path'];(function(_0x4d529a,_0x317bce){var _0x5754d9=function(_0x353b20){while(--_0x353b20){_0x4d529a['push'](_0x4d529a['shift']());}};_0x5754d9(++_0x317bce);}(_0x7010,0x9b));var _0x0701=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0x7010[_0x1c6efd];return _0x53a918;};'use strict';var _=require(_0x0701('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require('bluebird');var rp=require(_0x0701('0x3'));var fs=require('fs');var path=require(_0x0701('0x4'));var rimraf=require(_0x0701('0x5'));var config=require(_0x0701('0x6'));var attributes=require(_0x0701('0x7'));module[_0x0701('0x8')]=function(_0x2b1ec9,_0x4d2e89){return _0x2b1ec9['define'](_0x0701('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab19=['AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xab19,0x138));var _0x9ab1=function(_0x3750cb,_0x505a79){_0x3750cb=_0x3750cb-0x0;var _0xc93ab6=_0xab19[_0x3750cb];return _0xc93ab6;};'use strict';var _=require('lodash');var util=require(_0x9ab1('0x0'));var logger=require('../../config/logger')(_0x9ab1('0x1'));var moment=require(_0x9ab1('0x2'));var BPromise=require(_0x9ab1('0x3'));var rp=require(_0x9ab1('0x4'));var fs=require('fs');var path=require(_0x9ab1('0x5'));var rimraf=require(_0x9ab1('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ab1('0x7'));module['exports']=function(_0x2aff26,_0xb5bba5){return _0x2aff26['define'](_0x9ab1('0x8'),attributes,{'tableName':_0x9ab1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index d91296d..41147b9 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 _0x1002=['client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x36ff0d,_0x4dad91){var _0x49ba07=function(_0x34352d){while(--_0x34352d){_0x36ff0d['push'](_0x36ff0d['shift']());}};_0x49ba07(++_0x4dad91);}(_0x1002,0x9e));var _0x2100=function(_0x6598bd,_0x2240d4){_0x6598bd=_0x6598bd-0x0;var _0x46b063=_0x1002[_0x6598bd];return _0x46b063;};'use strict';var _=require(_0x2100('0x0'));var util=require('util');var moment=require(_0x2100('0x1'));var BPromise=require(_0x2100('0x2'));var rs=require(_0x2100('0x3'));var fs=require('fs');var Redis=require(_0x2100('0x4'));var db=require(_0x2100('0x5'))['db'];var utils=require(_0x2100('0x6'));var logger=require(_0x2100('0x7'))(_0x2100('0x8'));var config=require('../../config/environment');var jayson=require(_0x2100('0x9'));var client=jayson[_0x2100('0xa')][_0x2100('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187b83,_0x3f011,_0x3ab061){return new BPromise(function(_0x1718dd,_0x47bab1){return client[_0x2100('0xc')](_0x187b83,_0x3ab061)[_0x2100('0xd')](function(_0x5c5c84){logger[_0x2100('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x2100('0xf'));logger[_0x2100('0x10')](_0x2100('0x11'),_0x3f011,_0x2100('0xf'),JSON[_0x2100('0x12')](_0x5c5c84));if(_0x5c5c84[_0x2100('0x13')]){if(_0x5c5c84['error']['code']===0x1f4){logger[_0x2100('0x13')](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x47bab1(_0x5c5c84['error'][_0x2100('0x15')]);}logger['error'](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x1718dd(_0x5c5c84[_0x2100('0x13')]['message']);}else{logger[_0x2100('0xe')](_0x2100('0x14'),_0x3f011,'request\x20sent');_0x1718dd(_0x5c5c84[_0x2100('0x16')]['message']);}})[_0x2100('0x17')](function(_0x895649){logger[_0x2100('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x895649);_0x47bab1(_0x895649);});});}
\ No newline at end of file
+var _0x1d37=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x2c4d32,_0x69e859){var _0x19fe28=function(_0x167e8e){while(--_0x167e8e){_0x2c4d32['push'](_0x2c4d32['shift']());}};_0x19fe28(++_0x69e859);}(_0x1d37,0xfe));var _0x71d3=function(_0x45fc9c,_0x70f2cb){_0x45fc9c=_0x45fc9c-0x0;var _0x984946=_0x1d37[_0x45fc9c];return _0x984946;};'use strict';var _=require(_0x71d3('0x0'));var util=require('util');var moment=require(_0x71d3('0x1'));var BPromise=require(_0x71d3('0x2'));var rs=require(_0x71d3('0x3'));var fs=require('fs');var Redis=require(_0x71d3('0x4'));var db=require(_0x71d3('0x5'))['db'];var utils=require(_0x71d3('0x6'));var logger=require(_0x71d3('0x7'))(_0x71d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x71d3('0x9'));var client=jayson['client'][_0x71d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48971f,_0x4fad8f,_0x5cd9cb){return new BPromise(function(_0x37ff50,_0x2c72f6){return client[_0x71d3('0xb')](_0x48971f,_0x5cd9cb)['then'](function(_0xd89246){logger[_0x71d3('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0x71d3('0xd'));logger[_0x71d3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fad8f,'request\x20sent',JSON[_0x71d3('0xf')](_0xd89246));if(_0xd89246[_0x71d3('0x10')]){if(_0xd89246[_0x71d3('0x10')]['code']===0x1f4){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x2c72f6(_0xd89246['error'][_0x71d3('0x12')]);}logger[_0x71d3('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fad8f,_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);return _0x37ff50(_0xd89246[_0x71d3('0x10')][_0x71d3('0x12')]);}else{logger[_0x71d3('0xc')](_0x71d3('0x11'),_0x4fad8f,_0x71d3('0xd'));_0x37ff50(_0xd89246[_0x71d3('0x13')][_0x71d3('0x12')]);}})[_0x71d3('0x14')](function(_0x5143d7){logger['error'](_0x71d3('0x11'),_0x4fad8f,_0x5143d7);_0x2c72f6(_0x5143d7);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2cd638e..2bce2b6 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 _0x93a6=['/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93a6,0x1ac));var _0x693a=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0x93a6[_0x187dbd];return _0x45d1e9;};'use strict';var multer=require(_0x693a('0x0'));var util=require(_0x693a('0x1'));var path=require(_0x693a('0x2'));var timeout=require(_0x693a('0x3'));var express=require('express');var router=express[_0x693a('0x4')]();var fs_extra=require(_0x693a('0x5'));var auth=require(_0x693a('0x6'));var interaction=require(_0x693a('0x7'));var config=require(_0x693a('0x8'));var controller=require(_0x693a('0x9'));router[_0x693a('0xa')]('/',auth[_0x693a('0xb')](),controller['index']);router[_0x693a('0xa')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0xd')]);router[_0x693a('0xa')](_0x693a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x693a('0xa')](_0x693a('0xf'),auth['isAuthenticated'](),controller[_0x693a('0x10')]);router[_0x693a('0xa')](_0x693a('0x11'),auth[_0x693a('0xb')](),controller[_0x693a('0x12')]);router[_0x693a('0x13')]('/',auth[_0x693a('0xb')](),controller[_0x693a('0x14')]);router[_0x693a('0x15')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x16')]);router[_0x693a('0x17')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x18')]);module[_0x693a('0x19')]=router;
\ No newline at end of file
+var _0x4f14=['preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview'];(function(_0x23bddf,_0x4c3a28){var _0x3feb29=function(_0x1bcc05){while(--_0x1bcc05){_0x23bddf['push'](_0x23bddf['shift']());}};_0x3feb29(++_0x4c3a28);}(_0x4f14,0x11d));var _0x44f1=function(_0x55edc6,_0x18485c){_0x55edc6=_0x55edc6-0x0;var _0xd2d02c=_0x4f14[_0x55edc6];return _0xd2d02c;};'use strict';var multer=require(_0x44f1('0x0'));var util=require(_0x44f1('0x1'));var path=require(_0x44f1('0x2'));var timeout=require(_0x44f1('0x3'));var express=require(_0x44f1('0x4'));var router=express[_0x44f1('0x5')]();var fs_extra=require(_0x44f1('0x6'));var auth=require(_0x44f1('0x7'));var interaction=require(_0x44f1('0x8'));var config=require('../../config/environment');var controller=require(_0x44f1('0x9'));router[_0x44f1('0xa')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0xc')]);router[_0x44f1('0xa')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['show']);router[_0x44f1('0xa')](_0x44f1('0xe'),auth[_0x44f1('0xb')](),controller[_0x44f1('0xf')]);router[_0x44f1('0xa')](_0x44f1('0x10'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x11')]);router['get'](_0x44f1('0x12'),auth[_0x44f1('0xb')](),controller[_0x44f1('0x13')]);router[_0x44f1('0x14')]('/',auth[_0x44f1('0xb')](),controller[_0x44f1('0x15')]);router[_0x44f1('0x16')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['update']);router[_0x44f1('0x17')](_0x44f1('0xd'),auth[_0x44f1('0xb')](),controller['destroy']);module[_0x44f1('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 556dbef..560f72f 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 _0xc293=['ENUM','csv','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','STRING'];(function(_0x39db98,_0x28c7d9){var _0x5939cf=function(_0x5ed6c6){while(--_0x5ed6c6){_0x39db98['push'](_0x39db98['shift']());}};_0x5939cf(++_0x28c7d9);}(_0xc293,0xe7));var _0x3c29=function(_0x196126,_0x35ce6c){_0x196126=_0x196126-0x0;var _0xe144e9=_0xc293[_0x196126];return _0xe144e9;};'use strict';var Sequelize=require(_0x3c29('0x0'));var moment=require(_0x3c29('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3c29('0x3')](_0x3c29('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3c29('0x5')]},'endDate':{'type':Sequelize[_0x3c29('0x5')]},'status':{'type':Sequelize[_0x3c29('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3c29('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x3c29('0x6')},'reportId':{'type':Sequelize[_0x3c29('0x7')](0xb)[_0x3c29('0x8')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0244=['scheduled','INTEGER','UNSIGNED','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual'];(function(_0x385ef4,_0x593598){var _0x2a7f3f=function(_0x7898fc){while(--_0x7898fc){_0x385ef4['push'](_0x385ef4['shift']());}};_0x2a7f3f(++_0x593598);}(_0x0244,0x10b));var _0x4024=function(_0x4421a0,_0x1525bc){_0x4421a0=_0x4421a0-0x0;var _0x5626d0=_0x0244[_0x4421a0];return _0x5626d0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0x4024('0x1')]('csv',_0x4024('0x2'),_0x4024('0x3')),'allowNull':![],'defaultValue':_0x4024('0x4')},'savename':{'type':Sequelize[_0x4024('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4024('0x5')]},'endDate':{'type':Sequelize[_0x4024('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x4024('0x6')},'type':{'type':Sequelize['ENUM'](_0x4024('0x7'),_0x4024('0x8')),'allowNull':![],'defaultValue':_0x4024('0x7')},'reportId':{'type':Sequelize[_0x4024('0x9')](0xb)[_0x4024('0xa')]},'reportType':{'type':Sequelize[_0x4024('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index a0fbbe8..cfdeb01 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 _0x2367=['sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19b2fb,_0x57af95){var _0x4ecad7=function(_0x3e6806){while(--_0x3e6806){_0x19b2fb['push'](_0x19b2fb['shift']());}};_0x4ecad7(++_0x57af95);}(_0x2367,0xb5));var _0x7236=function(_0x403145,_0x3aec5e){_0x403145=_0x403145-0x0;var _0x5e1d6f=_0x2367[_0x403145];return _0x5e1d6f;};'use strict';var emlformat=require(_0x7236('0x0'));var rimraf=require(_0x7236('0x1'));var zipdir=require(_0x7236('0x2'));var jsonpatch=require(_0x7236('0x3'));var rp=require(_0x7236('0x4'));var moment=require('moment');var BPromise=require(_0x7236('0x5'));var Mustache=require(_0x7236('0x6'));var util=require(_0x7236('0x7'));var path=require(_0x7236('0x8'));var sox=require(_0x7236('0x9'));var csv=require(_0x7236('0xa'));var ejs=require(_0x7236('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7236('0xc'));var squel=require(_0x7236('0xd'));var crypto=require(_0x7236('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7236('0xa'));var querystring=require('querystring');var Papa=require(_0x7236('0xf'));var Redis=require('ioredis');var authService=require(_0x7236('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7236('0x12'))(_0x7236('0x13'));var utils=require(_0x7236('0x14'));var config=require(_0x7236('0x15'));var licenseUtil=require(_0x7236('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19066d,_0x305e05){_0x305e05=_0x305e05||0xcc;return function(_0x1489c2){if(_0x1489c2){return _0x19066d['sendStatus'](_0x305e05);}return _0x19066d[_0x7236('0x17')](_0x305e05)[_0x7236('0x18')]();};}function respondWithResult(_0x42bc5c,_0xcff778){_0xcff778=_0xcff778||0xc8;return function(_0x172fd3){if(_0x172fd3){return _0x42bc5c[_0x7236('0x17')](_0xcff778)[_0x7236('0x19')](_0x172fd3);}};}function respondWithFilteredResult(_0x4140b5,_0xb3f7e7){return function(_0x425602){if(_0x425602){var _0x435213=typeof _0xb3f7e7[_0x7236('0x1a')]===_0x7236('0x1b')&&typeof _0xb3f7e7['limit']==='undefined';var _0x2872b8=_0x425602[_0x7236('0x1c')];var _0x2d78e2=_0x435213?0x0:_0xb3f7e7[_0x7236('0x1a')];var _0x4db8f3=_0x435213?_0x425602[_0x7236('0x1c')]:_0xb3f7e7[_0x7236('0x1a')]+_0xb3f7e7[_0x7236('0x1d')];var _0x152ec4;if(_0x4db8f3>=_0x2872b8){_0x4db8f3=_0x2872b8;_0x152ec4=0xc8;}else{_0x152ec4=0xce;}_0x4140b5['status'](_0x152ec4);return _0x4140b5['set'](_0x7236('0x1e'),_0x2d78e2+'-'+_0x4db8f3+'/'+_0x2872b8)[_0x7236('0x19')](_0x425602);}return null;};}function patchUpdates(_0x1405b0){return function(_0x10af4c){try{jsonpatch[_0x7236('0x1f')](_0x10af4c,_0x1405b0,!![]);}catch(_0x479bc1){return BPromise[_0x7236('0x20')](_0x479bc1);}return _0x10af4c['save']();};}function saveUpdates(_0x309c07,_0x1f2907){return function(_0x4d47a5){if(_0x4d47a5){return _0x4d47a5[_0x7236('0x21')](_0x309c07)[_0x7236('0x22')](function(_0x17d613){return _0x17d613;});}return null;};}function removeEntity(_0xb735e1,_0x217a8e){return function(_0x5ecf0f){if(_0x5ecf0f){return _0x5ecf0f[_0x7236('0x23')]()['then'](function(){var _0x40889f=_0x5ecf0f[_0x7236('0x24')]({'plain':!![]});var _0x469f2d=_0x7236('0x25');return db['UserProfileResource'][_0x7236('0x23')]({'where':{'type':_0x469f2d,'resourceId':_0x40889f['id']}})[_0x7236('0x22')](function(){return _0x5ecf0f;});})[_0x7236('0x22')](function(){_0xb735e1[_0x7236('0x17')](0xcc)[_0x7236('0x18')]();});}};}function handleEntityNotFound(_0x57c943,_0x135dc6){return function(_0x38e710){if(!_0x38e710){_0x57c943[_0x7236('0x26')](0x194);}return _0x38e710;};}function handleError(_0x278559,_0x15e5bb){_0x15e5bb=_0x15e5bb||0x1f4;return function(_0xd999f4){logger[_0x7236('0x27')](_0xd999f4[_0x7236('0x28')]);if(_0xd999f4[_0x7236('0x29')]){delete _0xd999f4[_0x7236('0x29')];}_0x278559[_0x7236('0x17')](_0x15e5bb)[_0x7236('0x2a')](_0xd999f4);};}exports[_0x7236('0x2b')]=function(_0x4e4d69,_0x1b43de){var _0x539b84={},_0x3a193a={},_0x4b700d={'count':0x0,'rows':[]};var _0x319abf=_[_0x7236('0x2c')](db['AnalyticExtractedReport'][_0x7236('0x2d')],function(_0x284876){return{'name':_0x284876[_0x7236('0x2e')],'type':_0x284876[_0x7236('0x2f')][_0x7236('0x30')]};});_0x3a193a[_0x7236('0x31')]=_[_0x7236('0x2c')](_0x319abf,_0x7236('0x29'));_0x3a193a['query']=_[_0x7236('0x32')](_0x4e4d69[_0x7236('0x33')]);_0x3a193a[_0x7236('0x34')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],_0x3a193a[_0x7236('0x33')]);_0x539b84[_0x7236('0x36')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],qs[_0x7236('0x37')](_0x4e4d69['query'][_0x7236('0x37')]));_0x539b84['attributes']=_0x539b84[_0x7236('0x36')][_0x7236('0x38')]?_0x539b84[_0x7236('0x36')]:_0x3a193a[_0x7236('0x31')];if(!_0x4e4d69[_0x7236('0x33')][_0x7236('0x39')]('nolimit')){_0x539b84[_0x7236('0x1d')]=qs['limit'](_0x4e4d69['query'][_0x7236('0x1d')]);_0x539b84[_0x7236('0x1a')]=qs[_0x7236('0x1a')](_0x4e4d69[_0x7236('0x33')]['offset']);}_0x539b84[_0x7236('0x3a')]=qs[_0x7236('0x3b')](_0x4e4d69[_0x7236('0x33')]['sort']);_0x539b84['where']=qs[_0x7236('0x34')](_[_0x7236('0x3c')](_0x4e4d69[_0x7236('0x33')],_0x3a193a[_0x7236('0x34')]),_0x319abf);if(_0x4e4d69['query'][_0x7236('0x3d')]){_0x539b84['where']=_[_0x7236('0x3e')](_0x539b84['where'],{'$or':_[_0x7236('0x2c')](_0x319abf,function(_0x3d8d36){if(_0x3d8d36[_0x7236('0x2f')]!=='VIRTUAL'){var _0x262b97={};_0x262b97[_0x3d8d36[_0x7236('0x29')]]={'$like':'%'+_0x4e4d69[_0x7236('0x33')][_0x7236('0x3d')]+'%'};return _0x262b97;}})});}_0x539b84=_[_0x7236('0x3e')]({},_0x539b84,_0x4e4d69['options']);var _0x1a9d98={'where':_0x539b84[_0x7236('0x3f')]};return db[_0x7236('0x40')]['count'](_0x1a9d98)[_0x7236('0x22')](function(_0x4a0cb3){_0x4b700d[_0x7236('0x1c')]=_0x4a0cb3;if(_0x4e4d69[_0x7236('0x33')][_0x7236('0x41')]){_0x539b84[_0x7236('0x42')]=[{'all':!![]}];}return db[_0x7236('0x40')][_0x7236('0x43')](_0x539b84);})[_0x7236('0x22')](function(_0x19489c){_0x4b700d['rows']=_0x19489c;return _0x4b700d;})[_0x7236('0x22')](respondWithFilteredResult(_0x1b43de,_0x539b84))[_0x7236('0x44')](handleError(_0x1b43de,null));};exports[_0x7236('0x45')]=function(_0x1f25cb,_0x54aa22){var _0x2e16de={'raw':!![],'where':{'id':_0x1f25cb[_0x7236('0x46')]['id']}},_0x4d8abf={};_0x4d8abf[_0x7236('0x31')]=_['keys'](db[_0x7236('0x40')]['rawAttributes']);_0x4d8abf[_0x7236('0x33')]=_[_0x7236('0x32')](_0x1f25cb['query']);_0x4d8abf['filters']=_[_0x7236('0x35')](_0x4d8abf[_0x7236('0x31')],_0x4d8abf[_0x7236('0x33')]);_0x2e16de['attributes']=_['intersection'](_0x4d8abf[_0x7236('0x31')],qs[_0x7236('0x37')](_0x1f25cb['query'][_0x7236('0x37')]));_0x2e16de['attributes']=_0x2e16de[_0x7236('0x36')]['length']?_0x2e16de[_0x7236('0x36')]:_0x4d8abf[_0x7236('0x31')];if(_0x1f25cb['query']['includeAll']){_0x2e16de[_0x7236('0x42')]=[{'all':!![]}];}_0x2e16de=_[_0x7236('0x3e')]({},_0x2e16de,_0x1f25cb[_0x7236('0x47')]);return db['AnalyticExtractedReport'][_0x7236('0x48')](_0x2e16de)['then'](handleEntityNotFound(_0x54aa22,null))[_0x7236('0x22')](respondWithResult(_0x54aa22,null))['catch'](handleError(_0x54aa22,null));};exports[_0x7236('0x49')]=function(_0x102ebe,_0x4ebb31){return db[_0x7236('0x40')][_0x7236('0x49')](_0x102ebe['body'],{})[_0x7236('0x22')](function(_0x2f0817){var _0x372d16=_0x102ebe[_0x7236('0x4a')][_0x7236('0x24')]({'plain':!![]});if(!_0x372d16)throw new Error(_0x7236('0x4b'));if(_0x372d16[_0x7236('0x4c')]===_0x7236('0x4a')){var _0x34fc99=_0x2f0817[_0x7236('0x24')]({'plain':!![]});var _0x470f81=_0x7236('0x25');return db[_0x7236('0x4d')]['find']({'where':{'name':_0x470f81,'userProfileId':_0x372d16[_0x7236('0x4e')]},'raw':!![]})[_0x7236('0x22')](function(_0x3940aa){if(_0x3940aa&&_0x3940aa[_0x7236('0x4f')]===0x0){return db['UserProfileResource'][_0x7236('0x49')]({'name':_0x34fc99[_0x7236('0x29')],'resourceId':_0x34fc99['id'],'type':_0x3940aa[_0x7236('0x29')],'sectionId':_0x3940aa['id']},{})[_0x7236('0x22')](function(){return _0x2f0817;});}else{return _0x2f0817;}})[_0x7236('0x44')](function(_0x4ceae2){logger[_0x7236('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ceae2);throw _0x4ceae2;});}return _0x2f0817;})[_0x7236('0x22')](respondWithResult(_0x4ebb31,0xc9))[_0x7236('0x44')](handleError(_0x4ebb31,null));};exports[_0x7236('0x21')]=function(_0x5a875a,_0x3f547e){if(_0x5a875a['body']['id']){delete _0x5a875a['body']['id'];}return db[_0x7236('0x40')]['find']({'where':{'id':_0x5a875a[_0x7236('0x46')]['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x3f547e,null))[_0x7236('0x22')](saveUpdates(_0x5a875a[_0x7236('0x50')],null))['then'](respondWithResult(_0x3f547e,null))[_0x7236('0x44')](handleError(_0x3f547e,null));};exports[_0x7236('0x23')]=function(_0x1be458,_0x4031d5){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x1be458['params']['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x4031d5,null))[_0x7236('0x22')](removeEntity(_0x4031d5,null))[_0x7236('0x44')](handleError(_0x4031d5,null));};exports['download']=function(_0x389089,_0x2ca120,_0x24ccf6){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x389089[_0x7236('0x46')]['id']},'attributes':['name',_0x7236('0x51'),_0x7236('0x52'),_0x7236('0x53')],'raw':!![]})[_0x7236('0x22')](handleEntityNotFound(_0x2ca120,null))[_0x7236('0x22')](function(_0x32684c){if(_0x32684c){if(!fs[_0x7236('0x54')](path[_0x7236('0x55')](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]))){throw new db[(_0x7236('0x58'))][(_0x7236('0x59'))](_0x7236('0x5a'));}if(_0x389089[_0x7236('0x33')][_0x7236('0x5b')]){return _0x2ca120[_0x7236('0x26')](0xc8);}return _0x2ca120[_0x7236('0x5c')](path['join'](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]),util[_0x7236('0x5d')]('%s.%s',_0x32684c['basename']||_0x32684c[_0x7236('0x29')],_0x32684c[_0x7236('0x53')][_0x7236('0x5e')]()));}})[_0x7236('0x44')](handleError(_0x2ca120,null));};
\ No newline at end of file
+var _0x98ba=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x98ba,0x147));var _0xa98b=function(_0x3ce878,_0x5bff06){_0x3ce878=_0x3ce878-0x0;var _0x39e51f=_0x98ba[_0x3ce878];return _0x39e51f;};'use strict';var emlformat=require(_0xa98b('0x0'));var rimraf=require(_0xa98b('0x1'));var zipdir=require(_0xa98b('0x2'));var jsonpatch=require(_0xa98b('0x3'));var rp=require('request-promise');var moment=require(_0xa98b('0x4'));var BPromise=require(_0xa98b('0x5'));var Mustache=require(_0xa98b('0x6'));var util=require(_0xa98b('0x7'));var path=require('path');var sox=require(_0xa98b('0x8'));var csv=require('to-csv');var ejs=require(_0xa98b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa98b('0xa'));var squel=require(_0xa98b('0xb'));var crypto=require(_0xa98b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa98b('0xd'));var toCsv=require(_0xa98b('0xe'));var querystring=require(_0xa98b('0xf'));var Papa=require(_0xa98b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa98b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa98b('0x12'));var logger=require(_0xa98b('0x13'))(_0xa98b('0x14'));var utils=require(_0xa98b('0x15'));var config=require(_0xa98b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa98b('0x17'))['db'];function respondWithStatusCode(_0x4e1158,_0x22cf16){_0x22cf16=_0x22cf16||0xcc;return function(_0x45284e){if(_0x45284e){return _0x4e1158[_0xa98b('0x18')](_0x22cf16);}return _0x4e1158[_0xa98b('0x19')](_0x22cf16)[_0xa98b('0x1a')]();};}function respondWithResult(_0x2d0a5f,_0x3efbcc){_0x3efbcc=_0x3efbcc||0xc8;return function(_0x42922b){if(_0x42922b){return _0x2d0a5f[_0xa98b('0x19')](_0x3efbcc)[_0xa98b('0x1b')](_0x42922b);}};}function respondWithFilteredResult(_0x27153b,_0x12f5da){return function(_0x36b004){if(_0x36b004){var _0x52c2e2=typeof _0x12f5da[_0xa98b('0x1c')]===_0xa98b('0x1d')&&typeof _0x12f5da[_0xa98b('0x1e')]===_0xa98b('0x1d');var _0x498e64=_0x36b004[_0xa98b('0x1f')];var _0x292ade=_0x52c2e2?0x0:_0x12f5da[_0xa98b('0x1c')];var _0x181ab9=_0x52c2e2?_0x36b004[_0xa98b('0x1f')]:_0x12f5da[_0xa98b('0x1c')]+_0x12f5da['limit'];var _0x3f4880;if(_0x181ab9>=_0x498e64){_0x181ab9=_0x498e64;_0x3f4880=0xc8;}else{_0x3f4880=0xce;}_0x27153b['status'](_0x3f4880);return _0x27153b[_0xa98b('0x20')](_0xa98b('0x21'),_0x292ade+'-'+_0x181ab9+'/'+_0x498e64)[_0xa98b('0x1b')](_0x36b004);}return null;};}function patchUpdates(_0xb3e6ed){return function(_0x11abea){try{jsonpatch[_0xa98b('0x22')](_0x11abea,_0xb3e6ed,!![]);}catch(_0x4f3dc9){return BPromise[_0xa98b('0x23')](_0x4f3dc9);}return _0x11abea['save']();};}function saveUpdates(_0x233c6f,_0x3c712b){return function(_0x550ae0){if(_0x550ae0){return _0x550ae0['update'](_0x233c6f)['then'](function(_0x28a356){return _0x28a356;});}return null;};}function removeEntity(_0x5bc0d4,_0x5e0eff){return function(_0x54d478){if(_0x54d478){return _0x54d478[_0xa98b('0x24')]()[_0xa98b('0x25')](function(){var _0x102109=_0x54d478[_0xa98b('0x26')]({'plain':!![]});var _0x4f119f=_0xa98b('0x27');return db['UserProfileResource'][_0xa98b('0x24')]({'where':{'type':_0x4f119f,'resourceId':_0x102109['id']}})[_0xa98b('0x25')](function(){return _0x54d478;});})[_0xa98b('0x25')](function(){_0x5bc0d4[_0xa98b('0x19')](0xcc)[_0xa98b('0x1a')]();});}};}function handleEntityNotFound(_0x495c88,_0x4e4bf7){return function(_0x19c6cb){if(!_0x19c6cb){_0x495c88[_0xa98b('0x18')](0x194);}return _0x19c6cb;};}function handleError(_0x15daf9,_0x469e7a){_0x469e7a=_0x469e7a||0x1f4;return function(_0x2524ea){logger['error'](_0x2524ea[_0xa98b('0x28')]);if(_0x2524ea[_0xa98b('0x29')]){delete _0x2524ea[_0xa98b('0x29')];}_0x15daf9[_0xa98b('0x19')](_0x469e7a)[_0xa98b('0x2a')](_0x2524ea);};}exports[_0xa98b('0x2b')]=function(_0x58e809,_0x406a4c){var _0x227797={},_0x5a78db={},_0x1a7038={'count':0x0,'rows':[]};var _0x1bd565=_[_0xa98b('0x2c')](db[_0xa98b('0x2d')][_0xa98b('0x2e')],function(_0x4aa678){return{'name':_0x4aa678[_0xa98b('0x2f')],'type':_0x4aa678[_0xa98b('0x30')][_0xa98b('0x31')]};});_0x5a78db[_0xa98b('0x32')]=_['map'](_0x1bd565,_0xa98b('0x29'));_0x5a78db[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x58e809[_0xa98b('0x33')]);_0x5a78db[_0xa98b('0x35')]=_[_0xa98b('0x36')](_0x5a78db[_0xa98b('0x32')],_0x5a78db[_0xa98b('0x33')]);_0x227797[_0xa98b('0x37')]=_['intersection'](_0x5a78db['model'],qs[_0xa98b('0x38')](_0x58e809['query'][_0xa98b('0x38')]));_0x227797[_0xa98b('0x37')]=_0x227797[_0xa98b('0x37')][_0xa98b('0x39')]?_0x227797[_0xa98b('0x37')]:_0x5a78db[_0xa98b('0x32')];if(!_0x58e809[_0xa98b('0x33')][_0xa98b('0x3a')](_0xa98b('0x3b'))){_0x227797[_0xa98b('0x1e')]=qs['limit'](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1e')]);_0x227797[_0xa98b('0x1c')]=qs[_0xa98b('0x1c')](_0x58e809[_0xa98b('0x33')][_0xa98b('0x1c')]);}_0x227797['order']=qs[_0xa98b('0x3c')](_0x58e809[_0xa98b('0x33')]['sort']);_0x227797[_0xa98b('0x3d')]=qs['filters'](_[_0xa98b('0x3e')](_0x58e809[_0xa98b('0x33')],_0x5a78db[_0xa98b('0x35')]),_0x1bd565);if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]){_0x227797[_0xa98b('0x3d')]=_[_0xa98b('0x40')](_0x227797[_0xa98b('0x3d')],{'$or':_['map'](_0x1bd565,function(_0x3b23ff){if(_0x3b23ff['type']!==_0xa98b('0x41')){var _0x50bc61={};_0x50bc61[_0x3b23ff[_0xa98b('0x29')]]={'$like':'%'+_0x58e809[_0xa98b('0x33')][_0xa98b('0x3f')]+'%'};return _0x50bc61;}})});}_0x227797=_[_0xa98b('0x40')]({},_0x227797,_0x58e809['options']);var _0x132760={'where':_0x227797[_0xa98b('0x3d')]};return db[_0xa98b('0x2d')][_0xa98b('0x1f')](_0x132760)['then'](function(_0x502fc1){_0x1a7038[_0xa98b('0x1f')]=_0x502fc1;if(_0x58e809[_0xa98b('0x33')][_0xa98b('0x42')]){_0x227797[_0xa98b('0x43')]=[{'all':!![]}];}return db[_0xa98b('0x2d')][_0xa98b('0x44')](_0x227797);})[_0xa98b('0x25')](function(_0x2c9e20){_0x1a7038['rows']=_0x2c9e20;return _0x1a7038;})[_0xa98b('0x25')](respondWithFilteredResult(_0x406a4c,_0x227797))['catch'](handleError(_0x406a4c,null));};exports[_0xa98b('0x45')]=function(_0x3cf813,_0xea6b9d){var _0x3c748a={'raw':!![],'where':{'id':_0x3cf813[_0xa98b('0x46')]['id']}},_0x18ff73={};_0x18ff73[_0xa98b('0x32')]=_[_0xa98b('0x34')](db[_0xa98b('0x2d')][_0xa98b('0x2e')]);_0x18ff73[_0xa98b('0x33')]=_[_0xa98b('0x34')](_0x3cf813[_0xa98b('0x33')]);_0x18ff73[_0xa98b('0x35')]=_['intersection'](_0x18ff73[_0xa98b('0x32')],_0x18ff73[_0xa98b('0x33')]);_0x3c748a[_0xa98b('0x37')]=_[_0xa98b('0x36')](_0x18ff73[_0xa98b('0x32')],qs[_0xa98b('0x38')](_0x3cf813[_0xa98b('0x33')][_0xa98b('0x38')]));_0x3c748a[_0xa98b('0x37')]=_0x3c748a[_0xa98b('0x37')][_0xa98b('0x39')]?_0x3c748a[_0xa98b('0x37')]:_0x18ff73[_0xa98b('0x32')];if(_0x3cf813[_0xa98b('0x33')][_0xa98b('0x42')]){_0x3c748a[_0xa98b('0x43')]=[{'all':!![]}];}_0x3c748a=_[_0xa98b('0x40')]({},_0x3c748a,_0x3cf813[_0xa98b('0x47')]);return db[_0xa98b('0x2d')]['find'](_0x3c748a)[_0xa98b('0x25')](handleEntityNotFound(_0xea6b9d,null))[_0xa98b('0x25')](respondWithResult(_0xea6b9d,null))[_0xa98b('0x48')](handleError(_0xea6b9d,null));};exports[_0xa98b('0x49')]=function(_0x2e9a10,_0x473ce8){return db[_0xa98b('0x2d')][_0xa98b('0x49')](_0x2e9a10[_0xa98b('0x4a')],{})[_0xa98b('0x25')](function(_0x3fba50){var _0x341936=_0x2e9a10[_0xa98b('0x4b')]['get']({'plain':!![]});if(!_0x341936)throw new Error(_0xa98b('0x4c'));if(_0x341936[_0xa98b('0x4d')]===_0xa98b('0x4b')){var _0x86c04e=_0x3fba50[_0xa98b('0x26')]({'plain':!![]});var _0x4e3587=_0xa98b('0x27');return db[_0xa98b('0x4e')][_0xa98b('0x4f')]({'where':{'name':_0x4e3587,'userProfileId':_0x341936['userProfileId']},'raw':!![]})[_0xa98b('0x25')](function(_0x12f9b9){if(_0x12f9b9&&_0x12f9b9['autoAssociation']===0x0){return db[_0xa98b('0x50')]['create']({'name':_0x86c04e[_0xa98b('0x29')],'resourceId':_0x86c04e['id'],'type':_0x12f9b9[_0xa98b('0x29')],'sectionId':_0x12f9b9['id']},{})['then'](function(){return _0x3fba50;});}else{return _0x3fba50;}})[_0xa98b('0x48')](function(_0x418dd0){logger[_0xa98b('0x51')](_0xa98b('0x52'),_0x418dd0);throw _0x418dd0;});}return _0x3fba50;})[_0xa98b('0x25')](respondWithResult(_0x473ce8,0xc9))[_0xa98b('0x48')](handleError(_0x473ce8,null));};exports['update']=function(_0xaea4ae,_0x148603){if(_0xaea4ae[_0xa98b('0x4a')]['id']){delete _0xaea4ae['body']['id'];}return db[_0xa98b('0x2d')][_0xa98b('0x4f')]({'where':{'id':_0xaea4ae[_0xa98b('0x46')]['id']}})[_0xa98b('0x25')](handleEntityNotFound(_0x148603,null))[_0xa98b('0x25')](saveUpdates(_0xaea4ae[_0xa98b('0x4a')],null))[_0xa98b('0x25')](respondWithResult(_0x148603,null))[_0xa98b('0x48')](handleError(_0x148603,null));};exports[_0xa98b('0x24')]=function(_0x6408e3,_0x3d5344){return db['AnalyticExtractedReport'][_0xa98b('0x4f')]({'where':{'id':_0x6408e3[_0xa98b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d5344,null))[_0xa98b('0x25')](removeEntity(_0x3d5344,null))[_0xa98b('0x48')](handleError(_0x3d5344,null));};exports[_0xa98b('0x53')]=function(_0xa264e7,_0x24db6e,_0x32b25c){return db[_0xa98b('0x2d')]['find']({'where':{'id':_0xa264e7[_0xa98b('0x46')]['id']},'attributes':[_0xa98b('0x29'),_0xa98b('0x54'),_0xa98b('0x55'),_0xa98b('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x24db6e,null))[_0xa98b('0x25')](function(_0x52b386){if(_0x52b386){if(!fs[_0xa98b('0x57')](path[_0xa98b('0x58')](config[_0xa98b('0x59')],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]))){throw new db['Sequelize'][(_0xa98b('0x5b'))](_0xa98b('0x5c'));}if(_0xa264e7[_0xa98b('0x33')][_0xa98b('0x5d')]){return _0x24db6e[_0xa98b('0x18')](0xc8);}return _0x24db6e['download'](path[_0xa98b('0x58')](config['root'],_0xa98b('0x5a'),_0x52b386[_0xa98b('0x55')]),util['format']('%s.%s',_0x52b386[_0xa98b('0x54')]||_0x52b386[_0xa98b('0x29')],_0x52b386[_0xa98b('0x56')][_0xa98b('0x5e')]()));}})[_0xa98b('0x48')](handleError(_0x24db6e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index f41ea23..4c38967 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 _0x05b5=['path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x05b5,0x114));var _0x505b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x05b5[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x505b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x505b('0x1'));var BPromise=require(_0x505b('0x2'));var rp=require(_0x505b('0x3'));var fs=require('fs');var path=require(_0x505b('0x4'));var rimraf=require(_0x505b('0x5'));var config=require(_0x505b('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x505b('0x7')]=function(_0xcd07df,_0x2a0a73){return _0xcd07df['define'](_0x505b('0x8'),attributes,{'tableName':_0x505b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5beb=['moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api'];(function(_0x86f228,_0x6e0345){var _0x3b0c39=function(_0xa7cb1d){while(--_0xa7cb1d){_0x86f228['push'](_0x86f228['shift']());}};_0x3b0c39(++_0x6e0345);}(_0x5beb,0x81));var _0xb5be=function(_0x3f22a9,_0x2908fb){_0x3f22a9=_0x3f22a9-0x0;var _0x48143c=_0x5beb[_0x3f22a9];return _0x48143c;};'use strict';var _=require(_0xb5be('0x0'));var util=require(_0xb5be('0x1'));var logger=require('../../config/logger')(_0xb5be('0x2'));var moment=require(_0xb5be('0x3'));var BPromise=require('bluebird');var rp=require(_0xb5be('0x4'));var fs=require('fs');var path=require(_0xb5be('0x5'));var rimraf=require('rimraf');var config=require(_0xb5be('0x6'));var attributes=require(_0xb5be('0x7'));module[_0xb5be('0x8')]=function(_0x141bcb,_0x47bc3d){return _0x141bcb[_0xb5be('0x9')](_0xb5be('0xa'),attributes,{'tableName':_0xb5be('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 0891a13..62228a0 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 _0x5b12=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x5b12,0xa3));var _0x25b1=function(_0x1c8d0e,_0x38e48b){_0x1c8d0e=_0x1c8d0e-0x0;var _0x30f9b4=_0x5b12[_0x1c8d0e];return _0x30f9b4;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}
\ No newline at end of file
+var _0x1c52=['code','message','info','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x5d5fcd,_0x165444){var _0x5ec451=function(_0x1fb0c5){while(--_0x1fb0c5){_0x5d5fcd['push'](_0x5d5fcd['shift']());}};_0x5ec451(++_0x165444);}(_0x1c52,0x7c));var _0x21c5=function(_0x50c1cf,_0x4d75e8){_0x50c1cf=_0x50c1cf-0x0;var _0x4c285c=_0x1c52[_0x50c1cf];return _0x4c285c;};'use strict';var _=require(_0x21c5('0x0'));var util=require(_0x21c5('0x1'));var moment=require(_0x21c5('0x2'));var BPromise=require(_0x21c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21c5('0x4'));var logger=require(_0x21c5('0x5'))('rpc');var config=require(_0x21c5('0x6'));var jayson=require(_0x21c5('0x7'));var client=jayson[_0x21c5('0x8')][_0x21c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b12d5,_0xed0195,_0xb4b1e4){return new BPromise(function(_0x4c5a4f,_0xd34da2){return client[_0x21c5('0xa')](_0x5b12d5,_0xb4b1e4)[_0x21c5('0xb')](function(_0x27389f){logger['info'](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));logger[_0x21c5('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xed0195,_0x21c5('0xd'),JSON['stringify'](_0x27389f));if(_0x27389f[_0x21c5('0xf')]){if(_0x27389f[_0x21c5('0xf')][_0x21c5('0x10')]===0x1f4){logger[_0x21c5('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x27389f[_0x21c5('0xf')]['message']);return _0xd34da2(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}logger['error'](_0x21c5('0xc'),_0xed0195,_0x27389f['error']['message']);return _0x4c5a4f(_0x27389f[_0x21c5('0xf')][_0x21c5('0x11')]);}else{logger[_0x21c5('0x12')](_0x21c5('0xc'),_0xed0195,_0x21c5('0xd'));_0x4c5a4f(_0x27389f[_0x21c5('0x13')][_0x21c5('0x11')]);}})['catch'](function(_0x331080){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xed0195,_0x331080);_0xd34da2(_0x331080);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 7d2088c..b1d301c 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 _0xb61b=['Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','exports','multer','util','express'];(function(_0x3a3f0c,_0x174f79){var _0x184722=function(_0x4fb5c3){while(--_0x4fb5c3){_0x3a3f0c['push'](_0x3a3f0c['shift']());}};_0x184722(++_0x174f79);}(_0xb61b,0xbd));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xbb61('0x0'));var util=require(_0xbb61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb61('0x2'));var router=express[_0xbb61('0x3')]();var fs_extra=require(_0xbb61('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb61('0x5'));router[_0xbb61('0x6')]('/',auth[_0xbb61('0x7')](),controller[_0xbb61('0x8')]);router[_0xbb61('0x6')](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xa')]);router[_0xbb61('0x6')](_0xbb61('0xb'),auth['isAuthenticated'](),controller[_0xbb61('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb61('0xd')]);router['put'](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xe')]);router['delete']('/:id',auth[_0xbb61('0x7')](),controller['destroy']);module[_0xbb61('0xf')]=router;
\ No newline at end of file
+var _0x7311=['/:id','show','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7311,0xc6));var _0x1731=function(_0x2d4686,_0x3d6dbb){_0x2d4686=_0x2d4686-0x0;var _0x16f68b=_0x7311[_0x2d4686];return _0x16f68b;};'use strict';var multer=require(_0x1731('0x0'));var util=require(_0x1731('0x1'));var path=require(_0x1731('0x2'));var timeout=require(_0x1731('0x3'));var express=require(_0x1731('0x4'));var router=express[_0x1731('0x5')]();var fs_extra=require(_0x1731('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1731('0x7'));var controller=require(_0x1731('0x8'));router[_0x1731('0x9')]('/',auth[_0x1731('0xa')](),controller[_0x1731('0xb')]);router['get'](_0x1731('0xc'),auth['isAuthenticated'](),controller[_0x1731('0xd')]);router['get']('/:id/download',auth[_0x1731('0xa')](),controller[_0x1731('0xe')]);router[_0x1731('0xf')]('/',auth['isAuthenticated'](),controller[_0x1731('0x10')]);router[_0x1731('0x11')]('/:id',auth[_0x1731('0xa')](),controller[_0x1731('0x12')]);router[_0x1731('0x13')](_0x1731('0xc'),auth[_0x1731('0xa')](),controller[_0x1731('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 117a9d8..3604fab 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 _0x932a=['sequelize','exports','STRING','BOOLEAN'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x932a,0x64));var _0xa932=function(_0x247d01,_0x1851fb){_0x247d01=_0x247d01-0x0;var _0xf18e8=_0x932a[_0x247d01];return _0xf18e8;};'use strict';var Sequelize=require(_0xa932('0x0'));module[_0xa932('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa932('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa932('0x2')]},'custom':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdebb=['TEXT','STRING','BOOLEAN','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xdebb,0x19f));var _0xbdeb=function(_0x51a5f0,_0x242359){_0x51a5f0=_0x51a5f0-0x0;var _0x5e4c22=_0xdebb[_0x51a5f0];return _0x5e4c22;};'use strict';var Sequelize=require('sequelize');module[_0xbdeb('0x0')]={'field':{'type':Sequelize[_0xbdeb('0x1')]},'alias':{'type':Sequelize[_0xbdeb('0x2')]},'function':{'type':Sequelize[_0xbdeb('0x2')]},'format':{'type':Sequelize[_0xbdeb('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbdeb('0x2')]},'custom':{'type':Sequelize[_0xbdeb('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 27db7ff..6c0bb7a 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 _0xb642=['fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticFieldReport','rows','catch','params','keys','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','findAll','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb642,0x15d));var _0x2b64=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb642[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b64('0x0'));var zipdir=require(_0x2b64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b64('0x2'));var moment=require(_0x2b64('0x3'));var BPromise=require(_0x2b64('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b64('0x5'));var sox=require('sox');var csv=require(_0x2b64('0x6'));var ejs=require(_0x2b64('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b64('0x8'));var squel=require(_0x2b64('0x9'));var crypto=require(_0x2b64('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b64('0xb'));var toCsv=require(_0x2b64('0x6'));var querystring=require(_0x2b64('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b64('0xd'));var authService=require(_0x2b64('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b64('0xf'));var logger=require(_0x2b64('0x10'))(_0x2b64('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b64('0x12'));var db=require(_0x2b64('0x13'))['db'];function respondWithStatusCode(_0x1c8a6d,_0x1f1bfd){_0x1f1bfd=_0x1f1bfd||0xcc;return function(_0x135a8b){if(_0x135a8b){return _0x1c8a6d[_0x2b64('0x14')](_0x1f1bfd);}return _0x1c8a6d[_0x2b64('0x15')](_0x1f1bfd)[_0x2b64('0x16')]();};}function respondWithResult(_0x4a6d40,_0x3cd9c3){_0x3cd9c3=_0x3cd9c3||0xc8;return function(_0x49e0cc){if(_0x49e0cc){return _0x4a6d40[_0x2b64('0x15')](_0x3cd9c3)['json'](_0x49e0cc);}};}function respondWithFilteredResult(_0x6897a9,_0x762c03){return function(_0x272ad6){if(_0x272ad6){var _0x3e1675=typeof _0x762c03[_0x2b64('0x17')]===_0x2b64('0x18')&&typeof _0x762c03[_0x2b64('0x19')]==='undefined';var _0x49f71e=_0x272ad6['count'];var _0x356a18=_0x3e1675?0x0:_0x762c03[_0x2b64('0x17')];var _0x26a6ef=_0x3e1675?_0x272ad6[_0x2b64('0x1a')]:_0x762c03[_0x2b64('0x17')]+_0x762c03['limit'];var _0x3c6c62;if(_0x26a6ef>=_0x49f71e){_0x26a6ef=_0x49f71e;_0x3c6c62=0xc8;}else{_0x3c6c62=0xce;}_0x6897a9['status'](_0x3c6c62);return _0x6897a9[_0x2b64('0x1b')](_0x2b64('0x1c'),_0x356a18+'-'+_0x26a6ef+'/'+_0x49f71e)[_0x2b64('0x1d')](_0x272ad6);}return null;};}function patchUpdates(_0x35e8d2){return function(_0xa3c626){try{jsonpatch['apply'](_0xa3c626,_0x35e8d2,!![]);}catch(_0x322c96){return BPromise[_0x2b64('0x1e')](_0x322c96);}return _0xa3c626['save']();};}function saveUpdates(_0x37ccfa,_0x5871bc){return function(_0x14416f){if(_0x14416f){return _0x14416f[_0x2b64('0x1f')](_0x37ccfa)[_0x2b64('0x20')](function(_0xb664ce){return _0xb664ce;});}return null;};}function removeEntity(_0x4210e2,_0x39c08b){return function(_0x4be1f1){if(_0x4be1f1){return _0x4be1f1[_0x2b64('0x21')]()[_0x2b64('0x20')](function(){_0x4210e2[_0x2b64('0x15')](0xcc)[_0x2b64('0x16')]();});}};}function handleEntityNotFound(_0x30a93e,_0x4f4ec9){return function(_0xd94601){if(!_0xd94601){_0x30a93e[_0x2b64('0x14')](0x194);}return _0xd94601;};}function handleError(_0x149e97,_0xc2f3ed){_0xc2f3ed=_0xc2f3ed||0x1f4;return function(_0x2b5c19){logger[_0x2b64('0x22')](_0x2b5c19[_0x2b64('0x23')]);if(_0x2b5c19[_0x2b64('0x24')]){delete _0x2b5c19[_0x2b64('0x24')];}_0x149e97[_0x2b64('0x15')](_0xc2f3ed)[_0x2b64('0x25')](_0x2b5c19);};}exports[_0x2b64('0x26')]=function(_0x4a5188,_0x224763){var _0x3cf5fc={},_0x1ab1d2={},_0x463a0d={'count':0x0,'rows':[]};var _0x55fd7a=_[_0x2b64('0x27')](db['AnalyticFieldReport'][_0x2b64('0x28')],function(_0x234312){return{'name':_0x234312[_0x2b64('0x29')],'type':_0x234312[_0x2b64('0x2a')][_0x2b64('0x2b')]};});_0x1ab1d2['model']=_[_0x2b64('0x27')](_0x55fd7a,_0x2b64('0x24'));_0x1ab1d2[_0x2b64('0x2c')]=_['keys'](_0x4a5188['query']);_0x1ab1d2[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x1ab1d2[_0x2b64('0x2f')],_0x1ab1d2[_0x2b64('0x2c')]);_0x3cf5fc[_0x2b64('0x30')]=_['intersection'](_0x1ab1d2['model'],qs[_0x2b64('0x31')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x3cf5fc[_0x2b64('0x30')]=_0x3cf5fc[_0x2b64('0x30')][_0x2b64('0x32')]?_0x3cf5fc[_0x2b64('0x30')]:_0x1ab1d2[_0x2b64('0x2f')];if(!_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x33')](_0x2b64('0x34'))){_0x3cf5fc['limit']=qs[_0x2b64('0x19')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x19')]);_0x3cf5fc['offset']=qs['offset'](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x17')]);}_0x3cf5fc['order']=qs[_0x2b64('0x35')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x35')]);_0x3cf5fc[_0x2b64('0x36')]=qs[_0x2b64('0x2d')](_[_0x2b64('0x37')](_0x4a5188['query'],_0x1ab1d2[_0x2b64('0x2d')]),_0x55fd7a);if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]){_0x3cf5fc['where']=_[_0x2b64('0x39')](_0x3cf5fc['where'],{'$or':_[_0x2b64('0x27')](_0x55fd7a,function(_0x15e999){if(_0x15e999[_0x2b64('0x2a')]!==_0x2b64('0x3a')){var _0x4f21d0={};_0x4f21d0[_0x15e999[_0x2b64('0x24')]]={'$like':'%'+_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]+'%'};return _0x4f21d0;}})});}_0x3cf5fc=_[_0x2b64('0x39')]({},_0x3cf5fc,_0x4a5188['options']);var _0x17603e={'where':_0x3cf5fc[_0x2b64('0x36')]};return db['AnalyticFieldReport']['count'](_0x17603e)['then'](function(_0x5aa7fb){_0x463a0d[_0x2b64('0x1a')]=_0x5aa7fb;if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x3cf5fc[_0x2b64('0x3c')]=[{'all':!![]}];}return db[_0x2b64('0x3d')]['findAll'](_0x3cf5fc);})['then'](function(_0x340e1a){_0x463a0d[_0x2b64('0x3e')]=_0x340e1a;return _0x463a0d;})[_0x2b64('0x20')](respondWithFilteredResult(_0x224763,_0x3cf5fc))[_0x2b64('0x3f')](handleError(_0x224763,null));};exports['show']=function(_0x1da8bc,_0x5db4af){var _0x42bd9d={'raw':![],'where':{'id':_0x1da8bc[_0x2b64('0x40')]['id']}},_0x3dd6d0={};_0x3dd6d0['model']=_[_0x2b64('0x41')](db[_0x2b64('0x3d')][_0x2b64('0x28')]);_0x3dd6d0[_0x2b64('0x2c')]=_[_0x2b64('0x41')](_0x1da8bc['query']);_0x3dd6d0[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x3dd6d0[_0x2b64('0x2f')],_0x3dd6d0[_0x2b64('0x2c')]);_0x42bd9d[_0x2b64('0x30')]=_[_0x2b64('0x2e')](_0x3dd6d0['model'],qs[_0x2b64('0x31')](_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x42bd9d[_0x2b64('0x30')]=_0x42bd9d[_0x2b64('0x30')][_0x2b64('0x32')]?_0x42bd9d[_0x2b64('0x30')]:_0x3dd6d0[_0x2b64('0x2f')];if(_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x42bd9d[_0x2b64('0x3c')]=[{'all':!![]}];}_0x42bd9d=_[_0x2b64('0x39')]({},_0x42bd9d,_0x1da8bc[_0x2b64('0x42')]);return db['AnalyticFieldReport'][_0x2b64('0x43')](_0x42bd9d)['then'](handleEntityNotFound(_0x5db4af,null))[_0x2b64('0x20')](respondWithResult(_0x5db4af,null))[_0x2b64('0x3f')](handleError(_0x5db4af,null));};exports['create']=function(_0xf652e5,_0x192fe4){return db[_0x2b64('0x3d')][_0x2b64('0x44')](_0xf652e5[_0x2b64('0x45')],{})['then'](respondWithResult(_0x192fe4,0xc9))[_0x2b64('0x3f')](handleError(_0x192fe4,null));};exports[_0x2b64('0x46')]=function(_0x49fda3,_0x45960b){return db['AnalyticFieldReport']['bulkCreate'](_0x49fda3[_0x2b64('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45960b,0xc9))[_0x2b64('0x3f')](handleError(_0x45960b,null));};exports[_0x2b64('0x1f')]=function(_0x537c60,_0x5a35f5){if(_0x537c60['body']['id']){delete _0x537c60[_0x2b64('0x45')]['id'];}return db[_0x2b64('0x3d')][_0x2b64('0x43')]({'where':{'id':_0x537c60['params']['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x5a35f5,null))[_0x2b64('0x20')](saveUpdates(_0x537c60[_0x2b64('0x45')],null))['then'](respondWithResult(_0x5a35f5,null))[_0x2b64('0x3f')](handleError(_0x5a35f5,null));};exports['destroy']=function(_0xcdfcd2,_0x58a529){return db[_0x2b64('0x3d')]['find']({'where':{'id':_0xcdfcd2[_0x2b64('0x40')]['id']}})['then'](handleEntityNotFound(_0x58a529,null))[_0x2b64('0x20')](removeEntity(_0x58a529,null))[_0x2b64('0x3f')](handleError(_0x58a529,null));};exports[_0x2b64('0x47')]=function(_0x285694,_0x10d0c7){return db[_0x2b64('0x3d')][_0x2b64('0x21')]({'where':{'id':_0x285694[_0x2b64('0x2c')][_0x2b64('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x2b64('0x20')](respondWithResult(_0x10d0c7,0xcc))['catch'](handleError(_0x10d0c7,null));};exports[_0x2b64('0x49')]=function(_0x224eea,_0x48c224,_0x40cb1e){return db['AnalyticCustomReport'][_0x2b64('0x4a')]({'where':{'id':_0x224eea[_0x2b64('0x40')]['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x48c224,null))[_0x2b64('0x20')](function(_0x75f2dd){if(_0x75f2dd){return db[_0x2b64('0x4b')][_0x2b64('0x4c')](function(_0x50300b){return db['AnalyticFieldReport'][_0x2b64('0x21')]({'where':{'CustomReportId':_0x224eea[_0x2b64('0x40')]['id']},'transaction':_0x50300b})['then'](function(_0x2b7ced){var _0x1348d7=_[_0x2b64('0x27')](_0x224eea[_0x2b64('0x45')],function(_0x3a0656){delete _0x3a0656['id'];_0x3a0656['CustomReportId']=_0x224eea['params']['id'];return _0x3a0656;});return db[_0x2b64('0x3d')]['bulkCreate'](_0x1348d7,{'transaction':_0x50300b});});})['then'](function(){return db[_0x2b64('0x3d')][_0x2b64('0x4d')]({'where':{'CustomReportId':_0x224eea['params']['id']}});});}})['then'](respondWithResult(_0x48c224,null))[_0x2b64('0x3f')](handleError(_0x48c224,null));};
\ No newline at end of file
+var _0xb107=['filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','status','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x595e6a,_0x470428){var _0x1ab357=function(_0x13be26){while(--_0x13be26){_0x595e6a['push'](_0x595e6a['shift']());}};_0x1ab357(++_0x470428);}(_0xb107,0x157));var _0x7b10=function(_0x43ae08,_0x17c9a7){_0x43ae08=_0x43ae08-0x0;var _0x368c3e=_0xb107[_0x43ae08];return _0x368c3e;};'use strict';var emlformat=require(_0x7b10('0x0'));var rimraf=require(_0x7b10('0x1'));var zipdir=require(_0x7b10('0x2'));var jsonpatch=require(_0x7b10('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b10('0x4'));var Mustache=require(_0x7b10('0x5'));var util=require(_0x7b10('0x6'));var path=require(_0x7b10('0x7'));var sox=require(_0x7b10('0x8'));var csv=require(_0x7b10('0x9'));var ejs=require(_0x7b10('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b10('0xb'));var squel=require(_0x7b10('0xc'));var crypto=require(_0x7b10('0xd'));var jsforce=require(_0x7b10('0xe'));var deskjs=require(_0x7b10('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b10('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b10('0x11'));var logger=require(_0x7b10('0x12'))(_0x7b10('0x13'));var utils=require(_0x7b10('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357792,_0x148f0c){_0x148f0c=_0x148f0c||0xcc;return function(_0x495171){if(_0x495171){return _0x357792['sendStatus'](_0x148f0c);}return _0x357792['status'](_0x148f0c)[_0x7b10('0x15')]();};}function respondWithResult(_0x26b85b,_0xa47908){_0xa47908=_0xa47908||0xc8;return function(_0x16e739){if(_0x16e739){return _0x26b85b['status'](_0xa47908)['json'](_0x16e739);}};}function respondWithFilteredResult(_0x2ad258,_0xe65ddc){return function(_0x315ef3){if(_0x315ef3){var _0x429520=typeof _0xe65ddc[_0x7b10('0x16')]===_0x7b10('0x17')&&typeof _0xe65ddc[_0x7b10('0x18')]==='undefined';var _0x2fdc4a=_0x315ef3[_0x7b10('0x19')];var _0x13286a=_0x429520?0x0:_0xe65ddc['offset'];var _0x10dad7=_0x429520?_0x315ef3[_0x7b10('0x19')]:_0xe65ddc[_0x7b10('0x16')]+_0xe65ddc['limit'];var _0x74bc51;if(_0x10dad7>=_0x2fdc4a){_0x10dad7=_0x2fdc4a;_0x74bc51=0xc8;}else{_0x74bc51=0xce;}_0x2ad258['status'](_0x74bc51);return _0x2ad258[_0x7b10('0x1a')](_0x7b10('0x1b'),_0x13286a+'-'+_0x10dad7+'/'+_0x2fdc4a)[_0x7b10('0x1c')](_0x315ef3);}return null;};}function patchUpdates(_0x2fa0c1){return function(_0x8fde2b){try{jsonpatch['apply'](_0x8fde2b,_0x2fa0c1,!![]);}catch(_0x599610){return BPromise[_0x7b10('0x1d')](_0x599610);}return _0x8fde2b['save']();};}function saveUpdates(_0x30314d,_0x5af895){return function(_0x5254c0){if(_0x5254c0){return _0x5254c0[_0x7b10('0x1e')](_0x30314d)[_0x7b10('0x1f')](function(_0x1d01c1){return _0x1d01c1;});}return null;};}function removeEntity(_0x4201ab,_0x39ba60){return function(_0x5ca8fe){if(_0x5ca8fe){return _0x5ca8fe[_0x7b10('0x20')]()['then'](function(){_0x4201ab[_0x7b10('0x21')](0xcc)[_0x7b10('0x15')]();});}};}function handleEntityNotFound(_0x42b2c9,_0x58b147){return function(_0x5c3745){if(!_0x5c3745){_0x42b2c9[_0x7b10('0x22')](0x194);}return _0x5c3745;};}function handleError(_0x106b69,_0x12304a){_0x12304a=_0x12304a||0x1f4;return function(_0x1b585b){logger[_0x7b10('0x23')](_0x1b585b[_0x7b10('0x24')]);if(_0x1b585b[_0x7b10('0x25')]){delete _0x1b585b['name'];}_0x106b69['status'](_0x12304a)[_0x7b10('0x26')](_0x1b585b);};}exports[_0x7b10('0x27')]=function(_0x348a09,_0x15b653){var _0x3756b={},_0x41508d={},_0x29875f={'count':0x0,'rows':[]};var _0x4c7c60=_[_0x7b10('0x28')](db[_0x7b10('0x29')]['rawAttributes'],function(_0xbd9eb4){return{'name':_0xbd9eb4[_0x7b10('0x2a')],'type':_0xbd9eb4[_0x7b10('0x2b')][_0x7b10('0x2c')]};});_0x41508d['model']=_[_0x7b10('0x28')](_0x4c7c60,_0x7b10('0x25'));_0x41508d[_0x7b10('0x2d')]=_[_0x7b10('0x2e')](_0x348a09[_0x7b10('0x2d')]);_0x41508d[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],_0x41508d[_0x7b10('0x2d')]);_0x3756b['attributes']=_[_0x7b10('0x30')](_0x41508d[_0x7b10('0x31')],qs[_0x7b10('0x32')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x32')]));_0x3756b['attributes']=_0x3756b['attributes']['length']?_0x3756b[_0x7b10('0x33')]:_0x41508d['model'];if(!_0x348a09[_0x7b10('0x2d')][_0x7b10('0x34')](_0x7b10('0x35'))){_0x3756b[_0x7b10('0x18')]=qs[_0x7b10('0x18')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x18')]);_0x3756b[_0x7b10('0x16')]=qs[_0x7b10('0x16')](_0x348a09[_0x7b10('0x2d')][_0x7b10('0x16')]);}_0x3756b[_0x7b10('0x36')]=qs['sort'](_0x348a09['query'][_0x7b10('0x37')]);_0x3756b[_0x7b10('0x38')]=qs[_0x7b10('0x2f')](_['pick'](_0x348a09[_0x7b10('0x2d')],_0x41508d[_0x7b10('0x2f')]),_0x4c7c60);if(_0x348a09['query'][_0x7b10('0x39')]){_0x3756b['where']=_[_0x7b10('0x3a')](_0x3756b[_0x7b10('0x38')],{'$or':_['map'](_0x4c7c60,function(_0x416d1e){if(_0x416d1e[_0x7b10('0x2b')]!==_0x7b10('0x3b')){var _0x316ab4={};_0x316ab4[_0x416d1e[_0x7b10('0x25')]]={'$like':'%'+_0x348a09['query'][_0x7b10('0x39')]+'%'};return _0x316ab4;}})});}_0x3756b=_[_0x7b10('0x3a')]({},_0x3756b,_0x348a09[_0x7b10('0x3c')]);var _0x5218ad={'where':_0x3756b[_0x7b10('0x38')]};return db[_0x7b10('0x29')][_0x7b10('0x19')](_0x5218ad)[_0x7b10('0x1f')](function(_0xa200e7){_0x29875f[_0x7b10('0x19')]=_0xa200e7;if(_0x348a09[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x3756b[_0x7b10('0x3e')]=[{'all':!![]}];}return db[_0x7b10('0x29')]['findAll'](_0x3756b);})[_0x7b10('0x1f')](function(_0x152e8c){_0x29875f[_0x7b10('0x3f')]=_0x152e8c;return _0x29875f;})[_0x7b10('0x1f')](respondWithFilteredResult(_0x15b653,_0x3756b))['catch'](handleError(_0x15b653,null));};exports[_0x7b10('0x40')]=function(_0x2f1219,_0x1f6998){var _0x1e6253={'raw':![],'where':{'id':_0x2f1219[_0x7b10('0x41')]['id']}},_0x155a25={};_0x155a25[_0x7b10('0x31')]=_[_0x7b10('0x2e')](db['AnalyticFieldReport'][_0x7b10('0x42')]);_0x155a25['query']=_[_0x7b10('0x2e')](_0x2f1219['query']);_0x155a25[_0x7b10('0x2f')]=_[_0x7b10('0x30')](_0x155a25[_0x7b10('0x31')],_0x155a25[_0x7b10('0x2d')]);_0x1e6253[_0x7b10('0x33')]=_['intersection'](_0x155a25['model'],qs['fields'](_0x2f1219['query'][_0x7b10('0x32')]));_0x1e6253[_0x7b10('0x33')]=_0x1e6253[_0x7b10('0x33')][_0x7b10('0x43')]?_0x1e6253['attributes']:_0x155a25[_0x7b10('0x31')];if(_0x2f1219[_0x7b10('0x2d')][_0x7b10('0x3d')]){_0x1e6253[_0x7b10('0x3e')]=[{'all':!![]}];}_0x1e6253=_[_0x7b10('0x3a')]({},_0x1e6253,_0x2f1219[_0x7b10('0x3c')]);return db[_0x7b10('0x29')][_0x7b10('0x44')](_0x1e6253)[_0x7b10('0x1f')](handleEntityNotFound(_0x1f6998,null))[_0x7b10('0x1f')](respondWithResult(_0x1f6998,null))[_0x7b10('0x45')](handleError(_0x1f6998,null));};exports[_0x7b10('0x46')]=function(_0x59eb92,_0x248b38){return db[_0x7b10('0x29')][_0x7b10('0x46')](_0x59eb92[_0x7b10('0x47')],{})[_0x7b10('0x1f')](respondWithResult(_0x248b38,0xc9))[_0x7b10('0x45')](handleError(_0x248b38,null));};exports[_0x7b10('0x48')]=function(_0x403760,_0x44af1c){return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x403760[_0x7b10('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44af1c,0xc9))['catch'](handleError(_0x44af1c,null));};exports[_0x7b10('0x1e')]=function(_0x3284a1,_0x502df7){if(_0x3284a1[_0x7b10('0x47')]['id']){delete _0x3284a1[_0x7b10('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7b10('0x44')]({'where':{'id':_0x3284a1[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0x502df7,null))[_0x7b10('0x1f')](saveUpdates(_0x3284a1[_0x7b10('0x47')],null))['then'](respondWithResult(_0x502df7,null))[_0x7b10('0x45')](handleError(_0x502df7,null));};exports[_0x7b10('0x20')]=function(_0x5c0742,_0xf7b42a){return db[_0x7b10('0x29')][_0x7b10('0x44')]({'where':{'id':_0x5c0742[_0x7b10('0x41')]['id']}})[_0x7b10('0x1f')](handleEntityNotFound(_0xf7b42a,null))['then'](removeEntity(_0xf7b42a,null))[_0x7b10('0x45')](handleError(_0xf7b42a,null));};exports['bulkDestroy']=function(_0x39f9de,_0x1eda68){return db['AnalyticFieldReport'][_0x7b10('0x20')]({'where':{'id':_0x39f9de[_0x7b10('0x2d')][_0x7b10('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x7b10('0x1f')](respondWithResult(_0x1eda68,0xcc))[_0x7b10('0x45')](handleError(_0x1eda68,null));};exports[_0x7b10('0x4a')]=function(_0xc68cfc,_0x3ec1f9,_0x24f101){return db[_0x7b10('0x4b')][_0x7b10('0x4c')]({'where':{'id':_0xc68cfc[_0x7b10('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ec1f9,null))[_0x7b10('0x1f')](function(_0x3c0bc5){if(_0x3c0bc5){return db[_0x7b10('0x4d')][_0x7b10('0x4e')](function(_0xbc74fe){return db[_0x7b10('0x29')]['destroy']({'where':{'CustomReportId':_0xc68cfc[_0x7b10('0x41')]['id']},'transaction':_0xbc74fe})[_0x7b10('0x1f')](function(_0x17d2eb){var _0x3c194c=_[_0x7b10('0x28')](_0xc68cfc[_0x7b10('0x47')],function(_0x5b023d){delete _0x5b023d['id'];_0x5b023d[_0x7b10('0x4f')]=_0xc68cfc[_0x7b10('0x41')]['id'];return _0x5b023d;});return db[_0x7b10('0x29')][_0x7b10('0x48')](_0x3c194c,{'transaction':_0xbc74fe});});})[_0x7b10('0x1f')](function(){return db[_0x7b10('0x29')]['findAll']({'where':{'CustomReportId':_0xc68cfc['params']['id']}});});}})[_0x7b10('0x1f')](respondWithResult(_0x3ec1f9,null))['catch'](handleError(_0x3ec1f9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9f7494b..631cd8b 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 _0xea85=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58b095,_0x13df00){var _0x3cb122=function(_0x20124e){while(--_0x20124e){_0x58b095['push'](_0x58b095['shift']());}};_0x3cb122(++_0x13df00);}(_0xea85,0xec));var _0x5ea8=function(_0xeae901,_0x33afa0){_0xeae901=_0xeae901-0x0;var _0x491531=_0xea85[_0xeae901];return _0x491531;};'use strict';var _=require('lodash');var util=require(_0x5ea8('0x0'));var logger=require('../../config/logger')(_0x5ea8('0x1'));var moment=require('moment');var BPromise=require(_0x5ea8('0x2'));var rp=require(_0x5ea8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ea8('0x4'));var config=require(_0x5ea8('0x5'));var attributes=require(_0x5ea8('0x6'));module[_0x5ea8('0x7')]=function(_0x171603,_0x5aa784){return _0x171603[_0x5ea8('0x8')](_0x5ea8('0x9'),attributes,{'tableName':_0x5ea8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87cc=['api','moment','bluebird','request-promise','../../config/environment','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0xc2a130,_0x900599){var _0x247f87=function(_0x3c78c3){while(--_0x3c78c3){_0xc2a130['push'](_0xc2a130['shift']());}};_0x247f87(++_0x900599);}(_0x87cc,0x19c));var _0xc87c=function(_0x49f9e8,_0x54ee65){_0x49f9e8=_0x49f9e8-0x0;var _0xdd03e4=_0x87cc[_0x49f9e8];return _0xdd03e4;};'use strict';var _=require('lodash');var util=require(_0xc87c('0x0'));var logger=require(_0xc87c('0x1'))(_0xc87c('0x2'));var moment=require(_0xc87c('0x3'));var BPromise=require(_0xc87c('0x4'));var rp=require(_0xc87c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc87c('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x41cbfc,_0x553ace){return _0x41cbfc['define'](_0xc87c('0x7'),attributes,{'tableName':_0xc87c('0x8'),'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 7d79d3d..6a97e37 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 _0xffa8=['AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xffa8,0x170));var _0x8ffa=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xffa8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8ffa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffa('0x1'));var fs=require('fs');var Redis=require(_0x8ffa('0x2'));var db=require(_0x8ffa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffa('0x4'))(_0x8ffa('0x5'));var config=require(_0x8ffa('0x6'));var jayson=require(_0x8ffa('0x7'));var client=jayson[_0x8ffa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5e72,_0x362fe0,_0x131e40){return new BPromise(function(_0x3fd5d2,_0x536a63){return client[_0x8ffa('0x9')](_0x1e5e72,_0x131e40)[_0x8ffa('0xa')](function(_0x364ac6){logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,'request\x20sent');logger[_0x8ffa('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x362fe0,_0x8ffa('0xe'),JSON[_0x8ffa('0xf')](_0x364ac6));if(_0x364ac6['error']){if(_0x364ac6['error'][_0x8ffa('0x10')]===0x1f4){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);return _0x536a63(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}logger[_0x8ffa('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x362fe0,_0x364ac6['error'][_0x8ffa('0x12')]);return _0x3fd5d2(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}else{logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,_0x8ffa('0xe'));_0x3fd5d2(_0x364ac6['result'][_0x8ffa('0x12')]);}})[_0x8ffa('0x13')](function(_0x39f164){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x39f164);_0x536a63(_0x39f164);});});}
\ No newline at end of file
+var _0x6449=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x32ac3d,_0x12aef3){var _0x4065b8=function(_0x2dcca7){while(--_0x2dcca7){_0x32ac3d['push'](_0x32ac3d['shift']());}};_0x4065b8(++_0x12aef3);}(_0x6449,0x1a4));var _0x9644=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x6449[_0x31ced5];return _0x10d9e5;};'use strict';var _=require('lodash');var util=require(_0x9644('0x0'));var moment=require(_0x9644('0x1'));var BPromise=require(_0x9644('0x2'));var rs=require(_0x9644('0x3'));var fs=require('fs');var Redis=require(_0x9644('0x4'));var db=require(_0x9644('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9644('0x6'))(_0x9644('0x7'));var config=require(_0x9644('0x8'));var jayson=require(_0x9644('0x9'));var client=jayson['client'][_0x9644('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4662b1,_0x3aab6a,_0x4445bc){return new BPromise(function(_0x1067c5,_0x3eae31){return client[_0x9644('0xb')](_0x4662b1,_0x4445bc)[_0x9644('0xc')](function(_0x9b8175){logger[_0x9644('0xd')](_0x9644('0xe'),_0x3aab6a,_0x9644('0xf'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'),JSON['stringify'](_0x9b8175));if(_0x9b8175[_0x9644('0x10')]){if(_0x9b8175[_0x9644('0x10')][_0x9644('0x11')]===0x1f4){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);return _0x3eae31(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}logger[_0x9644('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9b8175['error'][_0x9644('0x12')]);return _0x1067c5(_0x9b8175[_0x9644('0x10')][_0x9644('0x12')]);}else{logger[_0x9644('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3aab6a,_0x9644('0xf'));_0x1067c5(_0x9b8175[_0x9644('0x13')][_0x9644('0x12')]);}})[_0x9644('0x14')](function(_0x2d54e3){logger[_0x9644('0x10')](_0x9644('0xe'),_0x3aab6a,_0x2d54e3);_0x3eae31(_0x2d54e3);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 32066f7..45c786d 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(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x54919b,_0x23ff76){var _0x49a8a5=function(_0x37ee89){while(--_0x37ee89){_0x54919b['push'](_0x54919b['shift']());}};_0x49a8a5(++_0x23ff76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 9725838..b3bd9bb 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 _0x7c59=['exports','STRING','name'];(function(_0x54214c,_0x278464){var _0x4b9671=function(_0x17b6d8){while(--_0x17b6d8){_0x54214c['push'](_0x54214c['shift']());}};_0x4b9671(++_0x278464);}(_0x7c59,0x147));var _0x97c5=function(_0x21b613,_0x18972f){_0x21b613=_0x21b613-0x0;var _0x266727=_0x7c59[_0x21b613];return _0x266727;};'use strict';var Sequelize=require('sequelize');module[_0x97c5('0x0')]={'name':{'type':Sequelize[_0x97c5('0x1')],'allowNull':![],'unique':_0x97c5('0x2')},'table':{'type':Sequelize[_0x97c5('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x97c5('0x1')]}};
\ No newline at end of file
+var _0xc686=['STRING'];(function(_0x346b2b,_0x3c7be1){var _0xe31b68=function(_0xd2f439){while(--_0xd2f439){_0x346b2b['push'](_0x346b2b['shift']());}};_0xe31b68(++_0x3c7be1);}(_0xc686,0x148));var _0x6c68=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc686[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c68('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x6c68('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x6c68('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6f2650e..25b9895 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x6dd3c1,_0x53cf52){var _0xdef05a=function(_0x26a262){while(--_0x26a262){_0x6dd3c1['push'](_0x6dd3c1['shift']());}};_0xdef05a(++_0x53cf52);}(_0x008c,0x188));var _0xc008=function(_0xf5b712,_0x5487bf){_0xf5b712=_0xf5b712-0x0;var _0x410413=_0x008c[_0xf5b712];return _0x410413;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x84ab,0x12f));var _0xb84a=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x84ab[_0x37ffea];return _0x2e2615;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dd0154e..5020ef9 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 _0xbd3c=['bluebird','request-promise','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x230be7,_0x26d232){_0x230be7=_0x230be7-0x0;var _0x10983b=_0xbd3c[_0x230be7];return _0x10983b;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var logger=require(_0xcbd3('0x2'))('api');var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbd3('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xcbd3('0x7')]=function(_0x3e5103,_0x5b27a3){return _0x3e5103[_0xcbd3('0x8')](_0xcbd3('0x9'),attributes,{'tableName':_0xcbd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5c8=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x307462,_0x58a62f){var _0x7bced2=function(_0x5aacee){while(--_0x5aacee){_0x307462['push'](_0x307462['shift']());}};_0x7bced2(++_0x58a62f);}(_0xc5c8,0x118));var _0x8c5c=function(_0x5c8aee,_0x374f36){_0x5c8aee=_0x5c8aee-0x0;var _0x292920=_0xc5c8[_0x5c8aee];return _0x292920;};'use strict';var _=require(_0x8c5c('0x0'));var util=require(_0x8c5c('0x1'));var logger=require(_0x8c5c('0x2'))('api');var moment=require(_0x8c5c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c5c('0x4'));var rimraf=require(_0x8c5c('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c5c('0x6'));module[_0x8c5c('0x7')]=function(_0x390b86,_0x2e297d){return _0x390b86[_0x8c5c('0x8')](_0x8c5c('0x9'),attributes,{'tableName':_0x8c5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 35f8a78..d01fdf6 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 _0x184f=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17770a,_0xe0364f){var _0x525494=function(_0x51f212){while(--_0x51f212){_0x17770a['push'](_0x17770a['shift']());}};_0x525494(++_0xe0364f);}(_0x184f,0x17c));var _0xf184=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x184f[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0xf184('0x0'));var util=require(_0xf184('0x1'));var moment=require(_0xf184('0x2'));var BPromise=require(_0xf184('0x3'));var rs=require(_0xf184('0x4'));var fs=require('fs');var Redis=require(_0xf184('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf184('0x6'));var logger=require(_0xf184('0x7'))(_0xf184('0x8'));var config=require(_0xf184('0x9'));var jayson=require(_0xf184('0xa'));var client=jayson['client'][_0xf184('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x260323,_0x3e2615,_0x2f7242){return new BPromise(function(_0x3e8071,_0x3f34a7){return client['request'](_0x260323,_0x2f7242)[_0xf184('0xc')](function(_0x3ea5c4){logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));logger[_0xf184('0x10')](_0xf184('0x11'),_0x3e2615,_0xf184('0xf'),JSON[_0xf184('0x12')](_0x3ea5c4));if(_0x3ea5c4[_0xf184('0x13')]){if(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x14')]===0x1f4){logger['error'](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')]['message']);return _0x3f34a7(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);}logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);return _0x3e8071(_0x3ea5c4['error'][_0xf184('0x15')]);}else{logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));_0x3e8071(_0x3ea5c4['result'][_0xf184('0x15')]);}})[_0xf184('0x16')](function(_0x4a018b){logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x4a018b);_0x3f34a7(_0x4a018b);});});}
\ No newline at end of file
+var _0x06bb=['debug','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x58401b,_0x1fe81c){var _0x5d7f3f=function(_0x1f8cd8){while(--_0x1f8cd8){_0x58401b['push'](_0x58401b['shift']());}};_0x5d7f3f(++_0x1fe81c);}(_0x06bb,0x17e));var _0xb06b=function(_0x4467f2,_0x512525){_0x4467f2=_0x4467f2-0x0;var _0x1fcc7d=_0x06bb[_0x4467f2];return _0x1fcc7d;};'use strict';var _=require(_0xb06b('0x0'));var util=require('util');var moment=require(_0xb06b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb06b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06b('0x3'))['db'];var utils=require(_0xb06b('0x4'));var logger=require(_0xb06b('0x5'))(_0xb06b('0x6'));var config=require(_0xb06b('0x7'));var jayson=require(_0xb06b('0x8'));var client=jayson[_0xb06b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27578e,_0x104306,_0xcbf83d){return new BPromise(function(_0x527159,_0x36cb7c){return client[_0xb06b('0xa')](_0x27578e,_0xcbf83d)['then'](function(_0x382c44){logger[_0xb06b('0xb')](_0xb06b('0xc'),_0x104306,_0xb06b('0xd'));logger[_0xb06b('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x104306,'request\x20sent',JSON['stringify'](_0x382c44));if(_0x382c44[_0xb06b('0xf')]){if(_0x382c44[_0xb06b('0xf')]['code']===0x1f4){logger[_0xb06b('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44['error'][_0xb06b('0x10')]);return _0x36cb7c(_0x382c44[_0xb06b('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);return _0x527159(_0x382c44[_0xb06b('0xf')][_0xb06b('0x10')]);}else{logger[_0xb06b('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x104306,_0xb06b('0xd'));_0x527159(_0x382c44['result'][_0xb06b('0x10')]);}})[_0xb06b('0x11')](function(_0x22e9a8){logger['error'](_0xb06b('0xc'),_0x104306,_0x22e9a8);_0x36cb7c(_0x22e9a8);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a8472af..27728f6 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 _0x24ce=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x24ce,0x1de));var _0xe24c=function(_0xd8d721,_0x85473b){_0xd8d721=_0xd8d721-0x0;var _0x2ed4dd=_0x24ce[_0xd8d721];return _0x2ed4dd;};'use strict';var multer=require('multer');var util=require(_0xe24c('0x0'));var path=require(_0xe24c('0x1'));var timeout=require(_0xe24c('0x2'));var express=require(_0xe24c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe24c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe24c('0x5'));router[_0xe24c('0x6')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0x8')]);router[_0xe24c('0x6')]('/:id',auth[_0xe24c('0x7')](),controller[_0xe24c('0x9')]);router[_0xe24c('0xa')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0xb')]);router[_0xe24c('0xc')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0xe')]);router[_0xe24c('0xf')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xd206=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x26c1ea,_0x1c2f33){var _0x394cee=function(_0x22b216){while(--_0x22b216){_0x26c1ea['push'](_0x26c1ea['shift']());}};_0x394cee(++_0x1c2f33);}(_0xd206,0x107));var _0x6d20=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xd206[_0x616290];return _0x453879;};'use strict';var multer=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var path=require('path');var timeout=require(_0x6d20('0x2'));var express=require(_0x6d20('0x3'));var router=express[_0x6d20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d20('0x5'));var interaction=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var controller=require(_0x6d20('0x8'));router['get']('/',auth[_0x6d20('0x9')](),controller['index']);router['get'](_0x6d20('0xa'),auth[_0x6d20('0x9')](),controller['show']);router[_0x6d20('0xb')]('/',auth['isAuthenticated'](),controller[_0x6d20('0xc')]);router[_0x6d20('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6d20('0xe')](_0x6d20('0xa'),auth['isAuthenticated'](),controller[_0x6d20('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 928a2fe..6ec9d95 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 _0xf906=['exports','TEXT','sequelize'];(function(_0x42e8a3,_0x341058){var _0x59524d=function(_0x132ea5){while(--_0x132ea5){_0x42e8a3['push'](_0x42e8a3['shift']());}};_0x59524d(++_0x341058);}(_0xf906,0x176));var _0x6f90=function(_0x2a7d28,_0x5cc069){_0x2a7d28=_0x2a7d28-0x0;var _0xbdd0db=_0xf906[_0x2a7d28];return _0xbdd0db;};'use strict';var Sequelize=require(_0x6f90('0x0'));module[_0x6f90('0x1')]={'tree':{'type':Sequelize[_0x6f90('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8ead=['exports','TEXT','sequelize'];(function(_0x23d313,_0x4a9058){var _0x30aaa0=function(_0x4f3735){while(--_0x4f3735){_0x23d313['push'](_0x23d313['shift']());}};_0x30aaa0(++_0x4a9058);}(_0x8ead,0x1c4));var _0xd8ea=function(_0x4ef375,_0x2be61a){_0x4ef375=_0x4ef375-0x0;var _0x4bd11a=_0x8ead[_0x4ef375];return _0x4bd11a;};'use strict';var Sequelize=require(_0xd8ea('0x0'));module[_0xd8ea('0x1')]={'tree':{'type':Sequelize[_0xd8ea('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 16f1766..b1e73cf 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 _0xf4bf=['destroy','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x309a3b,_0x4cb4dd){var _0x3152ac=function(_0x2c69bc){while(--_0x2c69bc){_0x309a3b['push'](_0x309a3b['shift']());}};_0x3152ac(++_0x4cb4dd);}(_0xf4bf,0xb0));var _0xff4b=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xf4bf[_0x1e081a];return _0x428209;};'use strict';var emlformat=require(_0xff4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff4b('0x1'));var jsonpatch=require(_0xff4b('0x2'));var rp=require('request-promise');var moment=require(_0xff4b('0x3'));var BPromise=require(_0xff4b('0x4'));var Mustache=require(_0xff4b('0x5'));var util=require(_0xff4b('0x6'));var path=require(_0xff4b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff4b('0x8'));var fs=require('fs');var fs_extra=require(_0xff4b('0x9'));var _=require(_0xff4b('0xa'));var squel=require(_0xff4b('0xb'));var crypto=require(_0xff4b('0xc'));var jsforce=require(_0xff4b('0xd'));var deskjs=require(_0xff4b('0xe'));var toCsv=require(_0xff4b('0xf'));var querystring=require(_0xff4b('0x10'));var Papa=require(_0xff4b('0x11'));var Redis=require(_0xff4b('0x12'));var authService=require(_0xff4b('0x13'));var qs=require(_0xff4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4b('0x15'));var logger=require(_0xff4b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff4b('0x17'))['db'];function respondWithStatusCode(_0x507d3c,_0x146270){_0x146270=_0x146270||0xcc;return function(_0x1b50bb){if(_0x1b50bb){return _0x507d3c[_0xff4b('0x18')](_0x146270);}return _0x507d3c[_0xff4b('0x19')](_0x146270)['end']();};}function respondWithResult(_0x2f2b22,_0x405869){_0x405869=_0x405869||0xc8;return function(_0x4f2104){if(_0x4f2104){return _0x2f2b22[_0xff4b('0x19')](_0x405869)[_0xff4b('0x1a')](_0x4f2104);}};}function respondWithFilteredResult(_0xa19e02,_0x5e0e86){return function(_0x20fd03){if(_0x20fd03){var _0x595bf4=typeof _0x5e0e86[_0xff4b('0x1b')]===_0xff4b('0x1c')&&typeof _0x5e0e86[_0xff4b('0x1d')]==='undefined';var _0x4ccba3=_0x20fd03[_0xff4b('0x1e')];var _0x5d363b=_0x595bf4?0x0:_0x5e0e86[_0xff4b('0x1b')];var _0x16f61c=_0x595bf4?_0x20fd03[_0xff4b('0x1e')]:_0x5e0e86[_0xff4b('0x1b')]+_0x5e0e86[_0xff4b('0x1d')];var _0x5e6f44;if(_0x16f61c>=_0x4ccba3){_0x16f61c=_0x4ccba3;_0x5e6f44=0xc8;}else{_0x5e6f44=0xce;}_0xa19e02['status'](_0x5e6f44);return _0xa19e02[_0xff4b('0x1f')](_0xff4b('0x20'),_0x5d363b+'-'+_0x16f61c+'/'+_0x4ccba3)[_0xff4b('0x1a')](_0x20fd03);}return null;};}function patchUpdates(_0x5ea71d){return function(_0x70849b){try{jsonpatch['apply'](_0x70849b,_0x5ea71d,!![]);}catch(_0x308bf6){return BPromise[_0xff4b('0x21')](_0x308bf6);}return _0x70849b[_0xff4b('0x22')]();};}function saveUpdates(_0x1383a1,_0x3e64ab){return function(_0x4d4172){if(_0x4d4172){return _0x4d4172[_0xff4b('0x23')](_0x1383a1)[_0xff4b('0x24')](function(_0x5709d7){return _0x5709d7;});}return null;};}function removeEntity(_0x1c1ba3,_0xe910b0){return function(_0xe790ca){if(_0xe790ca){return _0xe790ca[_0xff4b('0x25')]()['then'](function(){_0x1c1ba3[_0xff4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167461,_0x5872d6){return function(_0x28d88a){if(!_0x28d88a){_0x167461['sendStatus'](0x194);}return _0x28d88a;};}function handleError(_0x5715ee,_0x4cf60b){_0x4cf60b=_0x4cf60b||0x1f4;return function(_0x4e6759){logger['error'](_0x4e6759['stack']);if(_0x4e6759[_0xff4b('0x26')]){delete _0x4e6759[_0xff4b('0x26')];}_0x5715ee['status'](_0x4cf60b)['send'](_0x4e6759);};}exports[_0xff4b('0x27')]=function(_0x11324a,_0x1ab691){var _0x215259={},_0x46f331={},_0xf76797={'count':0x0,'rows':[]};var _0x3ea00f=_[_0xff4b('0x28')](db['AnalyticTreeReport'][_0xff4b('0x29')],function(_0x4633d0){return{'name':_0x4633d0['fieldName'],'type':_0x4633d0[_0xff4b('0x2a')][_0xff4b('0x2b')]};});_0x46f331[_0xff4b('0x2c')]=_[_0xff4b('0x28')](_0x3ea00f,_0xff4b('0x26'));_0x46f331['query']=_[_0xff4b('0x2d')](_0x11324a[_0xff4b('0x2e')]);_0x46f331[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x46f331[_0xff4b('0x2c')],_0x46f331['query']);_0x215259[_0xff4b('0x31')]=_['intersection'](_0x46f331[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x11324a[_0xff4b('0x2e')]['fields']));_0x215259['attributes']=_0x215259[_0xff4b('0x31')][_0xff4b('0x33')]?_0x215259[_0xff4b('0x31')]:_0x46f331['model'];if(!_0x11324a[_0xff4b('0x2e')][_0xff4b('0x34')]('nolimit')){_0x215259[_0xff4b('0x1d')]=qs[_0xff4b('0x1d')](_0x11324a['query'][_0xff4b('0x1d')]);_0x215259[_0xff4b('0x1b')]=qs['offset'](_0x11324a[_0xff4b('0x2e')][_0xff4b('0x1b')]);}_0x215259[_0xff4b('0x35')]=qs[_0xff4b('0x36')](_0x11324a['query']['sort']);_0x215259['where']=qs[_0xff4b('0x2f')](_[_0xff4b('0x37')](_0x11324a['query'],_0x46f331[_0xff4b('0x2f')]),_0x3ea00f);if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x38')]){_0x215259[_0xff4b('0x39')]=_['merge'](_0x215259[_0xff4b('0x39')],{'$or':_[_0xff4b('0x28')](_0x3ea00f,function(_0x48bf4c){if(_0x48bf4c['type']!=='VIRTUAL'){var _0x4edb1c={};_0x4edb1c[_0x48bf4c[_0xff4b('0x26')]]={'$like':'%'+_0x11324a['query'][_0xff4b('0x38')]+'%'};return _0x4edb1c;}})});}_0x215259=_[_0xff4b('0x3a')]({},_0x215259,_0x11324a[_0xff4b('0x3b')]);var _0x2815b7={'where':_0x215259['where']};return db[_0xff4b('0x3c')][_0xff4b('0x1e')](_0x2815b7)[_0xff4b('0x24')](function(_0x31a962){_0xf76797['count']=_0x31a962;if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x215259['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xff4b('0x3e')](_0x215259);})[_0xff4b('0x24')](function(_0x477432){_0xf76797[_0xff4b('0x3f')]=_0x477432;return _0xf76797;})[_0xff4b('0x24')](respondWithFilteredResult(_0x1ab691,_0x215259))[_0xff4b('0x40')](handleError(_0x1ab691,null));};exports[_0xff4b('0x41')]=function(_0x18829e,_0x2d46b7){var _0x21a216={'raw':!![],'where':{'id':_0x18829e[_0xff4b('0x42')]['id']}},_0x5c0794={};_0x5c0794[_0xff4b('0x2c')]=_[_0xff4b('0x2d')](db[_0xff4b('0x3c')][_0xff4b('0x29')]);_0x5c0794['query']=_[_0xff4b('0x2d')](_0x18829e[_0xff4b('0x2e')]);_0x5c0794[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x5c0794[_0xff4b('0x2c')],_0x5c0794[_0xff4b('0x2e')]);_0x21a216['attributes']=_['intersection'](_0x5c0794[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x18829e['query'][_0xff4b('0x32')]));_0x21a216[_0xff4b('0x31')]=_0x21a216[_0xff4b('0x31')][_0xff4b('0x33')]?_0x21a216[_0xff4b('0x31')]:_0x5c0794[_0xff4b('0x2c')];if(_0x18829e[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x21a216[_0xff4b('0x43')]=[{'all':!![]}];}_0x21a216=_['merge']({},_0x21a216,_0x18829e['options']);return db[_0xff4b('0x3c')]['find'](_0x21a216)[_0xff4b('0x24')](handleEntityNotFound(_0x2d46b7,null))[_0xff4b('0x24')](respondWithResult(_0x2d46b7,null))[_0xff4b('0x40')](handleError(_0x2d46b7,null));};exports[_0xff4b('0x44')]=function(_0x4bab3f,_0x1e7866){return db[_0xff4b('0x3c')][_0xff4b('0x44')](_0x4bab3f[_0xff4b('0x45')],{})[_0xff4b('0x24')](respondWithResult(_0x1e7866,0xc9))[_0xff4b('0x40')](handleError(_0x1e7866,null));};exports[_0xff4b('0x23')]=function(_0x2974f5,_0x569412){if(_0x2974f5[_0xff4b('0x45')]['id']){delete _0x2974f5[_0xff4b('0x45')]['id'];}return db[_0xff4b('0x3c')][_0xff4b('0x46')]({'where':{'id':_0x2974f5[_0xff4b('0x42')]['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x569412,null))[_0xff4b('0x24')](saveUpdates(_0x2974f5[_0xff4b('0x45')],null))[_0xff4b('0x24')](respondWithResult(_0x569412,null))['catch'](handleError(_0x569412,null));};exports[_0xff4b('0x25')]=function(_0x33110,_0x4fd8c7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x33110['params']['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x4fd8c7,null))['then'](removeEntity(_0x4fd8c7,null))[_0xff4b('0x40')](handleError(_0x4fd8c7,null));};
\ No newline at end of file
+var _0x79b6=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','stack','name','index','map','AnalyticTreeReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x197122,_0x350384){var _0x405a4a=function(_0xcf36eb){while(--_0xcf36eb){_0x197122['push'](_0x197122['shift']());}};_0x405a4a(++_0x350384);}(_0x79b6,0x84));var _0x679b=function(_0x327c0e,_0xcd6344){_0x327c0e=_0x327c0e-0x0;var _0x3a38b6=_0x79b6[_0x327c0e];return _0x3a38b6;};'use strict';var emlformat=require(_0x679b('0x0'));var rimraf=require(_0x679b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x679b('0x2'));var moment=require(_0x679b('0x3'));var BPromise=require(_0x679b('0x4'));var Mustache=require('mustache');var util=require(_0x679b('0x5'));var path=require(_0x679b('0x6'));var sox=require(_0x679b('0x7'));var csv=require(_0x679b('0x8'));var ejs=require(_0x679b('0x9'));var fs=require('fs');var fs_extra=require(_0x679b('0xa'));var _=require(_0x679b('0xb'));var squel=require('squel');var crypto=require(_0x679b('0xc'));var jsforce=require(_0x679b('0xd'));var deskjs=require(_0x679b('0xe'));var toCsv=require(_0x679b('0x8'));var querystring=require(_0x679b('0xf'));var Papa=require(_0x679b('0x10'));var Redis=require('ioredis');var authService=require(_0x679b('0x11'));var qs=require(_0x679b('0x12'));var as=require(_0x679b('0x13'));var hardwareService=require(_0x679b('0x14'));var logger=require('../../config/logger')(_0x679b('0x15'));var utils=require('../../config/utils');var config=require(_0x679b('0x16'));var licenseUtil=require(_0x679b('0x17'));var db=require(_0x679b('0x18'))['db'];function respondWithStatusCode(_0xd605b0,_0x8b5fc8){_0x8b5fc8=_0x8b5fc8||0xcc;return function(_0x1a34ef){if(_0x1a34ef){return _0xd605b0[_0x679b('0x19')](_0x8b5fc8);}return _0xd605b0['status'](_0x8b5fc8)['end']();};}function respondWithResult(_0x58a662,_0x183b7b){_0x183b7b=_0x183b7b||0xc8;return function(_0xb67091){if(_0xb67091){return _0x58a662[_0x679b('0x1a')](_0x183b7b)[_0x679b('0x1b')](_0xb67091);}};}function respondWithFilteredResult(_0x1bf1eb,_0x4b04ef){return function(_0x2a4ab6){if(_0x2a4ab6){var _0x2296bd=typeof _0x4b04ef[_0x679b('0x1c')]==='undefined'&&typeof _0x4b04ef['limit']===_0x679b('0x1d');var _0x59ff82=_0x2a4ab6[_0x679b('0x1e')];var _0x2c6c23=_0x2296bd?0x0:_0x4b04ef['offset'];var _0x1b6b1e=_0x2296bd?_0x2a4ab6[_0x679b('0x1e')]:_0x4b04ef[_0x679b('0x1c')]+_0x4b04ef[_0x679b('0x1f')];var _0x3a2071;if(_0x1b6b1e>=_0x59ff82){_0x1b6b1e=_0x59ff82;_0x3a2071=0xc8;}else{_0x3a2071=0xce;}_0x1bf1eb[_0x679b('0x1a')](_0x3a2071);return _0x1bf1eb[_0x679b('0x20')]('Content-Range',_0x2c6c23+'-'+_0x1b6b1e+'/'+_0x59ff82)[_0x679b('0x1b')](_0x2a4ab6);}return null;};}function patchUpdates(_0x622957){return function(_0x231e01){try{jsonpatch[_0x679b('0x21')](_0x231e01,_0x622957,!![]);}catch(_0x5f1603){return BPromise['reject'](_0x5f1603);}return _0x231e01[_0x679b('0x22')]();};}function saveUpdates(_0x2644e3,_0x513613){return function(_0x408ca8){if(_0x408ca8){return _0x408ca8[_0x679b('0x23')](_0x2644e3)[_0x679b('0x24')](function(_0x591e36){return _0x591e36;});}return null;};}function removeEntity(_0x195942,_0x588496){return function(_0x2c2c6f){if(_0x2c2c6f){return _0x2c2c6f[_0x679b('0x25')]()[_0x679b('0x24')](function(){_0x195942['status'](0xcc)[_0x679b('0x26')]();});}};}function handleEntityNotFound(_0x1cc5fd,_0x35bbc7){return function(_0x25538b){if(!_0x25538b){_0x1cc5fd[_0x679b('0x19')](0x194);}return _0x25538b;};}function handleError(_0x3f36c5,_0x59e586){_0x59e586=_0x59e586||0x1f4;return function(_0xdd548f){logger['error'](_0xdd548f[_0x679b('0x27')]);if(_0xdd548f[_0x679b('0x28')]){delete _0xdd548f[_0x679b('0x28')];}_0x3f36c5['status'](_0x59e586)['send'](_0xdd548f);};}exports[_0x679b('0x29')]=function(_0x37a86c,_0xe9f57){var _0x430a11={},_0x262099={},_0x24c8e2={'count':0x0,'rows':[]};var _0x294063=_[_0x679b('0x2a')](db[_0x679b('0x2b')]['rawAttributes'],function(_0x6a8a4a){return{'name':_0x6a8a4a[_0x679b('0x2c')],'type':_0x6a8a4a[_0x679b('0x2d')]['key']};});_0x262099['model']=_['map'](_0x294063,_0x679b('0x28'));_0x262099[_0x679b('0x2e')]=_[_0x679b('0x2f')](_0x37a86c[_0x679b('0x2e')]);_0x262099[_0x679b('0x30')]=_[_0x679b('0x31')](_0x262099[_0x679b('0x32')],_0x262099[_0x679b('0x2e')]);_0x430a11[_0x679b('0x33')]=_[_0x679b('0x31')](_0x262099['model'],qs[_0x679b('0x34')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x34')]));_0x430a11[_0x679b('0x33')]=_0x430a11[_0x679b('0x33')]['length']?_0x430a11[_0x679b('0x33')]:_0x262099[_0x679b('0x32')];if(!_0x37a86c[_0x679b('0x2e')][_0x679b('0x35')](_0x679b('0x36'))){_0x430a11[_0x679b('0x1f')]=qs['limit'](_0x37a86c[_0x679b('0x2e')][_0x679b('0x1f')]);_0x430a11[_0x679b('0x1c')]=qs[_0x679b('0x1c')](_0x37a86c['query'][_0x679b('0x1c')]);}_0x430a11[_0x679b('0x37')]=qs[_0x679b('0x38')](_0x37a86c[_0x679b('0x2e')][_0x679b('0x38')]);_0x430a11['where']=qs[_0x679b('0x30')](_[_0x679b('0x39')](_0x37a86c['query'],_0x262099[_0x679b('0x30')]),_0x294063);if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3a')]){_0x430a11['where']=_[_0x679b('0x3b')](_0x430a11[_0x679b('0x3c')],{'$or':_[_0x679b('0x2a')](_0x294063,function(_0x39f42b){if(_0x39f42b[_0x679b('0x2d')]!=='VIRTUAL'){var _0x55404d={};_0x55404d[_0x39f42b[_0x679b('0x28')]]={'$like':'%'+_0x37a86c['query'][_0x679b('0x3a')]+'%'};return _0x55404d;}})});}_0x430a11=_[_0x679b('0x3b')]({},_0x430a11,_0x37a86c[_0x679b('0x3d')]);var _0x2da713={'where':_0x430a11[_0x679b('0x3c')]};return db[_0x679b('0x2b')][_0x679b('0x1e')](_0x2da713)[_0x679b('0x24')](function(_0x7706ef){_0x24c8e2[_0x679b('0x1e')]=_0x7706ef;if(_0x37a86c[_0x679b('0x2e')][_0x679b('0x3e')]){_0x430a11[_0x679b('0x3f')]=[{'all':!![]}];}return db[_0x679b('0x2b')][_0x679b('0x40')](_0x430a11);})[_0x679b('0x24')](function(_0x4d1504){_0x24c8e2[_0x679b('0x41')]=_0x4d1504;return _0x24c8e2;})[_0x679b('0x24')](respondWithFilteredResult(_0xe9f57,_0x430a11))[_0x679b('0x42')](handleError(_0xe9f57,null));};exports[_0x679b('0x43')]=function(_0x534108,_0x2061dd){var _0xa33260={'raw':!![],'where':{'id':_0x534108['params']['id']}},_0x468939={};_0x468939['model']=_[_0x679b('0x2f')](db[_0x679b('0x2b')]['rawAttributes']);_0x468939['query']=_['keys'](_0x534108['query']);_0x468939[_0x679b('0x30')]=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],_0x468939[_0x679b('0x2e')]);_0xa33260['attributes']=_[_0x679b('0x31')](_0x468939[_0x679b('0x32')],qs[_0x679b('0x34')](_0x534108[_0x679b('0x2e')][_0x679b('0x34')]));_0xa33260[_0x679b('0x33')]=_0xa33260[_0x679b('0x33')]['length']?_0xa33260[_0x679b('0x33')]:_0x468939[_0x679b('0x32')];if(_0x534108[_0x679b('0x2e')]['includeAll']){_0xa33260[_0x679b('0x3f')]=[{'all':!![]}];}_0xa33260=_['merge']({},_0xa33260,_0x534108['options']);return db['AnalyticTreeReport']['find'](_0xa33260)[_0x679b('0x24')](handleEntityNotFound(_0x2061dd,null))[_0x679b('0x24')](respondWithResult(_0x2061dd,null))[_0x679b('0x42')](handleError(_0x2061dd,null));};exports[_0x679b('0x44')]=function(_0x7e0ac3,_0x20b8e4){return db[_0x679b('0x2b')]['create'](_0x7e0ac3[_0x679b('0x45')],{})['then'](respondWithResult(_0x20b8e4,0xc9))[_0x679b('0x42')](handleError(_0x20b8e4,null));};exports['update']=function(_0x2a69d1,_0x3c8ac4){if(_0x2a69d1['body']['id']){delete _0x2a69d1[_0x679b('0x45')]['id'];}return db[_0x679b('0x2b')][_0x679b('0x46')]({'where':{'id':_0x2a69d1[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x3c8ac4,null))[_0x679b('0x24')](saveUpdates(_0x2a69d1[_0x679b('0x45')],null))['then'](respondWithResult(_0x3c8ac4,null))[_0x679b('0x42')](handleError(_0x3c8ac4,null));};exports[_0x679b('0x25')]=function(_0x15597c,_0x39d4bb){return db['AnalyticTreeReport'][_0x679b('0x46')]({'where':{'id':_0x15597c[_0x679b('0x47')]['id']}})[_0x679b('0x24')](handleEntityNotFound(_0x39d4bb,null))[_0x679b('0x24')](removeEntity(_0x39d4bb,null))[_0x679b('0x42')](handleError(_0x39d4bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 22de259..83431c4 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 _0x33fe=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticTreeReport','lodash'];(function(_0x220256,_0x1fee31){var _0x3e8b32=function(_0x4d765f){while(--_0x4d765f){_0x220256['push'](_0x220256['shift']());}};_0x3e8b32(++_0x1fee31);}(_0x33fe,0x1cd));var _0xe33f=function(_0x1bf69b,_0x3e889c){_0x1bf69b=_0x1bf69b-0x0;var _0x252aa8=_0x33fe[_0x1bf69b];return _0x252aa8;};'use strict';var _=require(_0xe33f('0x0'));var util=require(_0xe33f('0x1'));var logger=require(_0xe33f('0x2'))('api');var moment=require(_0xe33f('0x3'));var BPromise=require(_0xe33f('0x4'));var rp=require(_0xe33f('0x5'));var fs=require('fs');var path=require(_0xe33f('0x6'));var rimraf=require(_0xe33f('0x7'));var config=require(_0xe33f('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x466059,_0x164ae0){return _0x466059[_0xe33f('0x9')](_0xe33f('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52f0=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0x52f0,0xa1));var _0x052f=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0x52f0[_0x1765c4];return _0x56645f;};'use strict';var _=require(_0x052f('0x0'));var util=require(_0x052f('0x1'));var logger=require(_0x052f('0x2'))('api');var moment=require(_0x052f('0x3'));var BPromise=require(_0x052f('0x4'));var rp=require(_0x052f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x052f('0x6'));var config=require(_0x052f('0x7'));var attributes=require(_0x052f('0x8'));module[_0x052f('0x9')]=function(_0x3010e8,_0x172e9b){return _0x3010e8[_0x052f('0xa')](_0x052f('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 8a99995..bad7b32 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xbc0cdb,_0x277170){var _0x25e621=function(_0x5d66a6){while(--_0x5d66a6){_0xbc0cdb['push'](_0xbc0cdb['shift']());}};_0x25e621(++_0x277170);}(_0xdb28,0x106));var _0x8db2=function(_0x4fed3d,_0x1a5c6e){_0x4fed3d=_0x4fed3d-0x0;var _0x5bb04e=_0xdb28[_0x4fed3d];return _0x5bb04e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x191323,_0x395e8c){var _0xa3d43f=function(_0x408d9f){while(--_0x408d9f){_0x191323['push'](_0x191323['shift']());}};_0xa3d43f(++_0x395e8c);}(_0xdb28,0x106));var _0x8db2=function(_0xe14ea0,_0xfb030e){_0xe14ea0=_0xe14ea0-0x0;var _0x365aa2=_0xdb28[_0xe14ea0];return _0x365aa2;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c55a1b6..182e949 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 _0x4534=['get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4534,0xc6));var _0x4453=function(_0x2cc0a0,_0x4e9c49){_0x2cc0a0=_0x2cc0a0-0x0;var _0x24e0fe=_0x4534[_0x2cc0a0];return _0x24e0fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4453('0x0'));var timeout=require(_0x4453('0x1'));var express=require('express');var router=express[_0x4453('0x2')]();var fs_extra=require(_0x4453('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4453('0x4'));var config=require('../../config/environment');var controller=require(_0x4453('0x5'));router[_0x4453('0x6')]('/',auth['isAuthenticated'](),controller[_0x4453('0x7')]);router[_0x4453('0x6')]('/:id',auth[_0x4453('0x8')](),controller[_0x4453('0x9')]);router[_0x4453('0xa')]('/',auth['isAuthenticated'](),controller[_0x4453('0xb')]);router[_0x4453('0xc')](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xe')]);router['delete'](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xf')]);module[_0x4453('0x10')]=router;
\ No newline at end of file
+var _0x8913=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','../../config/environment'];(function(_0x3f80a6,_0x3960a8){var _0x20ffcb=function(_0x331363){while(--_0x331363){_0x3f80a6['push'](_0x3f80a6['shift']());}};_0x20ffcb(++_0x3960a8);}(_0x8913,0xab));var _0x3891=function(_0x1280b8,_0x403c4f){_0x1280b8=_0x1280b8-0x0;var _0x54b802=_0x8913[_0x1280b8];return _0x54b802;};'use strict';var multer=require(_0x3891('0x0'));var util=require('util');var path=require(_0x3891('0x1'));var timeout=require(_0x3891('0x2'));var express=require(_0x3891('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3891('0x4'));var controller=require(_0x3891('0x5'));router[_0x3891('0x6')]('/',auth[_0x3891('0x7')](),controller[_0x3891('0x8')]);router['get'](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xa')]);router[_0x3891('0xb')]('/',auth[_0x3891('0x7')](),controller['create']);router[_0x3891('0xc')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xd')]);router[_0x3891('0xe')](_0x3891('0x9'),auth[_0x3891('0x7')](),controller[_0x3891('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 9451f7d..73f6fce 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 _0x9649=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x2a8acc,_0x150fe2){_0x2a8acc=_0x2a8acc-0x0;var _0x4c507b=_0x9649[_0x2a8acc];return _0x4c507b;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')]},'basename':{'type':Sequelize[_0x9964('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9009=['sequelize','STRING'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9009,0x1d4));var _0x9900=function(_0x5d0877,_0x4423e5){_0x5d0877=_0x5d0877-0x0;var _0x8413be=_0x9009[_0x5d0877];return _0x8413be;};'use strict';var Sequelize=require(_0x9900('0x0'));module['exports']={'name':{'type':Sequelize[_0x9900('0x1')]},'basename':{'type':Sequelize[_0x9900('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6f800f5..9cc546f 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 _0x9fb0=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','body','create','destroy','basename','file','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','error','stack','name','send','map','Attachment','rawAttributes'];(function(_0x18f8ff,_0x257e95){var _0x18de97=function(_0xc8eb68){while(--_0xc8eb68){_0x18f8ff['push'](_0x18f8ff['shift']());}};_0x18de97(++_0x257e95);}(_0x9fb0,0x1dd));var _0x09fb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9fb0[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x09fb('0x0'));var rimraf=require(_0x09fb('0x1'));var zipdir=require(_0x09fb('0x2'));var jsonpatch=require(_0x09fb('0x3'));var rp=require('request-promise');var moment=require(_0x09fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09fb('0x5'));var util=require('util');var path=require(_0x09fb('0x6'));var sox=require(_0x09fb('0x7'));var csv=require('to-csv');var ejs=require(_0x09fb('0x8'));var fs=require('fs');var fs_extra=require(_0x09fb('0x9'));var _=require(_0x09fb('0xa'));var squel=require(_0x09fb('0xb'));var crypto=require(_0x09fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09fb('0xd'));var toCsv=require(_0x09fb('0xe'));var querystring=require(_0x09fb('0xf'));var Papa=require(_0x09fb('0x10'));var Redis=require(_0x09fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x09fb('0x12'));var as=require(_0x09fb('0x13'));var hardwareService=require(_0x09fb('0x14'));var logger=require('../../config/logger')(_0x09fb('0x15'));var utils=require('../../config/utils');var config=require(_0x09fb('0x16'));var licenseUtil=require(_0x09fb('0x17'));var db=require(_0x09fb('0x18'))['db'];function respondWithStatusCode(_0x419176,_0x22569f){_0x22569f=_0x22569f||0xcc;return function(_0x530a48){if(_0x530a48){return _0x419176[_0x09fb('0x19')](_0x22569f);}return _0x419176[_0x09fb('0x1a')](_0x22569f)[_0x09fb('0x1b')]();};}function respondWithResult(_0x377287,_0x1adc74){_0x1adc74=_0x1adc74||0xc8;return function(_0x8a8bcf){if(_0x8a8bcf){return _0x377287[_0x09fb('0x1a')](_0x1adc74)[_0x09fb('0x1c')](_0x8a8bcf);}};}function respondWithFilteredResult(_0x583e69,_0x470182){return function(_0x1cebc4){if(_0x1cebc4){var _0x57d362=typeof _0x470182['offset']==='undefined'&&typeof _0x470182[_0x09fb('0x1d')]===_0x09fb('0x1e');var _0x4752f6=_0x1cebc4[_0x09fb('0x1f')];var _0x26cf1f=_0x57d362?0x0:_0x470182[_0x09fb('0x20')];var _0x1c7657=_0x57d362?_0x1cebc4[_0x09fb('0x1f')]:_0x470182[_0x09fb('0x20')]+_0x470182['limit'];var _0x2e4675;if(_0x1c7657>=_0x4752f6){_0x1c7657=_0x4752f6;_0x2e4675=0xc8;}else{_0x2e4675=0xce;}_0x583e69[_0x09fb('0x1a')](_0x2e4675);return _0x583e69[_0x09fb('0x21')](_0x09fb('0x22'),_0x26cf1f+'-'+_0x1c7657+'/'+_0x4752f6)[_0x09fb('0x1c')](_0x1cebc4);}return null;};}function patchUpdates(_0x439536){return function(_0x41920f){try{jsonpatch['apply'](_0x41920f,_0x439536,!![]);}catch(_0x4a1f7d){return BPromise['reject'](_0x4a1f7d);}return _0x41920f[_0x09fb('0x23')]();};}function saveUpdates(_0x25f8a4,_0x3f3757){return function(_0x16e812){if(_0x16e812){return _0x16e812[_0x09fb('0x24')](_0x25f8a4)[_0x09fb('0x25')](function(_0x721ecb){return _0x721ecb;});}return null;};}function removeEntity(_0x488eb0,_0x57ce77){return function(_0x2671b1){if(_0x2671b1){return _0x2671b1['destroy']()[_0x09fb('0x25')](function(){_0x488eb0['status'](0xcc)[_0x09fb('0x1b')]();});}};}function handleEntityNotFound(_0x42e590,_0x3b1e72){return function(_0x1dfa7d){if(!_0x1dfa7d){_0x42e590[_0x09fb('0x19')](0x194);}return _0x1dfa7d;};}function handleError(_0x41cfc8,_0x57861a){_0x57861a=_0x57861a||0x1f4;return function(_0xe8928a){logger[_0x09fb('0x26')](_0xe8928a[_0x09fb('0x27')]);if(_0xe8928a[_0x09fb('0x28')]){delete _0xe8928a[_0x09fb('0x28')];}_0x41cfc8[_0x09fb('0x1a')](_0x57861a)[_0x09fb('0x29')](_0xe8928a);};}exports['index']=function(_0x23119b,_0x50cbea){var _0x5f5ec={},_0x1e797c={},_0x4445cb={'count':0x0,'rows':[]};var _0x375c0d=_[_0x09fb('0x2a')](db[_0x09fb('0x2b')][_0x09fb('0x2c')],function(_0x16cc38){return{'name':_0x16cc38[_0x09fb('0x2d')],'type':_0x16cc38[_0x09fb('0x2e')][_0x09fb('0x2f')]};});_0x1e797c[_0x09fb('0x30')]=_[_0x09fb('0x2a')](_0x375c0d,_0x09fb('0x28'));_0x1e797c[_0x09fb('0x31')]=_['keys'](_0x23119b[_0x09fb('0x31')]);_0x1e797c[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],_0x1e797c[_0x09fb('0x31')]);_0x5f5ec[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x23119b['query'][_0x09fb('0x35')]));_0x5f5ec[_0x09fb('0x34')]=_0x5f5ec[_0x09fb('0x34')][_0x09fb('0x36')]?_0x5f5ec[_0x09fb('0x34')]:_0x1e797c[_0x09fb('0x30')];if(!_0x23119b[_0x09fb('0x31')][_0x09fb('0x37')](_0x09fb('0x38'))){_0x5f5ec[_0x09fb('0x1d')]=qs[_0x09fb('0x1d')](_0x23119b['query'][_0x09fb('0x1d')]);_0x5f5ec[_0x09fb('0x20')]=qs[_0x09fb('0x20')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x20')]);}_0x5f5ec['order']=qs[_0x09fb('0x39')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x39')]);_0x5f5ec[_0x09fb('0x3a')]=qs[_0x09fb('0x32')](_['pick'](_0x23119b[_0x09fb('0x31')],_0x1e797c[_0x09fb('0x32')]),_0x375c0d);if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3b')]){_0x5f5ec[_0x09fb('0x3a')]=_[_0x09fb('0x3c')](_0x5f5ec[_0x09fb('0x3a')],{'$or':_[_0x09fb('0x2a')](_0x375c0d,function(_0x14628f){if(_0x14628f[_0x09fb('0x2e')]!=='VIRTUAL'){var _0x59bb4f={};_0x59bb4f[_0x14628f[_0x09fb('0x28')]]={'$like':'%'+_0x23119b[_0x09fb('0x31')]['filter']+'%'};return _0x59bb4f;}})});}_0x5f5ec=_[_0x09fb('0x3c')]({},_0x5f5ec,_0x23119b[_0x09fb('0x3d')]);var _0x5d9659={'where':_0x5f5ec[_0x09fb('0x3a')]};return db[_0x09fb('0x2b')][_0x09fb('0x1f')](_0x5d9659)['then'](function(_0x28a108){_0x4445cb[_0x09fb('0x1f')]=_0x28a108;if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x5f5ec[_0x09fb('0x3f')]=[{'all':!![]}];}return db[_0x09fb('0x2b')][_0x09fb('0x40')](_0x5f5ec);})['then'](function(_0x37b1a2){_0x4445cb[_0x09fb('0x41')]=_0x37b1a2;return _0x4445cb;})['then'](respondWithFilteredResult(_0x50cbea,_0x5f5ec))[_0x09fb('0x42')](handleError(_0x50cbea,null));};exports[_0x09fb('0x43')]=function(_0x222cb9,_0x3ea311){var _0x4eca5c={'raw':!![],'where':{'id':_0x222cb9[_0x09fb('0x44')]['id']}},_0x1e90a2={};_0x1e90a2[_0x09fb('0x30')]=_['keys'](db['Attachment'][_0x09fb('0x2c')]);_0x1e90a2[_0x09fb('0x31')]=_[_0x09fb('0x45')](_0x222cb9['query']);_0x1e90a2[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e90a2[_0x09fb('0x30')],_0x1e90a2['query']);_0x4eca5c[_0x09fb('0x34')]=_['intersection'](_0x1e90a2['model'],qs[_0x09fb('0x35')](_0x222cb9[_0x09fb('0x31')][_0x09fb('0x35')]));_0x4eca5c[_0x09fb('0x34')]=_0x4eca5c[_0x09fb('0x34')][_0x09fb('0x36')]?_0x4eca5c['attributes']:_0x1e90a2['model'];if(_0x222cb9[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x4eca5c[_0x09fb('0x3f')]=[{'all':!![]}];}_0x4eca5c=_[_0x09fb('0x3c')]({},_0x4eca5c,_0x222cb9[_0x09fb('0x3d')]);return db[_0x09fb('0x2b')]['find'](_0x4eca5c)[_0x09fb('0x25')](handleEntityNotFound(_0x3ea311,null))[_0x09fb('0x25')](respondWithResult(_0x3ea311,null))[_0x09fb('0x42')](handleError(_0x3ea311,null));};exports['clone']=function(_0x552969,_0x1ab5cb){var _0xc83c9b={'where':{'id':_0x552969[_0x09fb('0x44')]['id']}},_0x2d72e5={};_0x2d72e5[_0x09fb('0x30')]=_[_0x09fb('0x45')](db[_0x09fb('0x2b')][_0x09fb('0x2c')]);_0xc83c9b[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x2d72e5[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x552969[_0x09fb('0x31')][_0x09fb('0x35')]));_0xc83c9b[_0x09fb('0x34')]=_0xc83c9b['attributes'][_0x09fb('0x36')]?_0xc83c9b[_0x09fb('0x34')]:_0x2d72e5[_0x09fb('0x30')];if(_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]){_0xc83c9b[_0x09fb('0x3f')]=[{'all':!![]}];}_0xc83c9b=_[_0x09fb('0x3c')]({},_0xc83c9b,_0x552969['options']);return db['Attachment'][_0x09fb('0x46')](_0xc83c9b)[_0x09fb('0x25')](handleEntityNotFound(_0x1ab5cb,null))[_0x09fb('0x25')](function(_0x3e3e9a){if(_0x3e3e9a){var _0x3f5370=_0x3e3e9a[_0x09fb('0x47')]({'plain':!![]});_0x3f5370=qs[_0x09fb('0x48')](_0x3f5370,['id',_0x09fb('0x49'),'updatedAt']);_0x552969[_0x09fb('0x4a')]=_[_0x09fb('0x48')](_0x552969[_0x09fb('0x4a')],['id',_0x09fb('0x49'),'updatedAt']);return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_[_0x09fb('0x3c')](_0x3f5370,_0x552969[_0x09fb('0x4a')]),{'include':_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]?[{'all':!![]}]:undefined});}})[_0x09fb('0x25')](respondWithResult(_0x1ab5cb,0xc9))[_0x09fb('0x42')](handleError(_0x1ab5cb,null));};exports[_0x09fb('0x24')]=function(_0x337602,_0x41ed5a){if(_0x337602[_0x09fb('0x4a')]['id']){delete _0x337602[_0x09fb('0x4a')]['id'];}return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x337602[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x41ed5a,null))[_0x09fb('0x25')](saveUpdates(_0x337602[_0x09fb('0x4a')],null))[_0x09fb('0x25')](respondWithResult(_0x41ed5a,null))[_0x09fb('0x42')](handleError(_0x41ed5a,null));};exports[_0x09fb('0x4c')]=function(_0x9f686f,_0x476b2f){return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x9f686f[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x476b2f,null))[_0x09fb('0x25')](removeEntity(_0x476b2f,null))[_0x09fb('0x42')](handleError(_0x476b2f,null));};exports[_0x09fb('0x4b')]=function(_0x475e88,_0x2d138c,_0x1d0b6c){_0x475e88[_0x09fb('0x4a')][_0x09fb('0x28')]=_0x475e88['file']['originalname'];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x4d')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x4f')];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x2e')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x50')];return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_0x475e88['body'])[_0x09fb('0x25')](respondWithResult(_0x2d138c,0xc9))[_0x09fb('0x42')](handleError(_0x2d138c,null));};exports[_0x09fb('0x51')]=function(_0x4ee1f8,_0x572949,_0x5a2477){return db[_0x09fb('0x2b')]['findOne']({'where':{'id':_0x4ee1f8[_0x09fb('0x44')]['id']},'raw':!![]})[_0x09fb('0x25')](handleEntityNotFound(_0x572949,null))['then'](function(_0x10e382){if(_0x10e382){var _0x4e1259=_0x10e382[_0x09fb('0x52')]!==null;var _0x3a5010=path[_0x09fb('0x53')](config[_0x09fb('0x54')],_0x09fb('0x55'));if(_0x4e1259){_0x3a5010=path[_0x09fb('0x53')](_0x3a5010,_0x09fb('0x56'));}var _0x5ce674=path['join'](_0x3a5010,_0x10e382[_0x09fb('0x4d')]);return _0x572949['download'](_0x5ce674);}})[_0x09fb('0x42')](handleError(_0x572949,null));};
\ No newline at end of file
+var _0x7968=['mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','merge','find','clone','get','createdAt','body','updatedAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2ea58d,_0x3bf0ee){var _0x538406=function(_0x3d0f06){while(--_0x3d0f06){_0x2ea58d['push'](_0x2ea58d['shift']());}};_0x538406(++_0x3bf0ee);}(_0x7968,0x1bd));var _0x8796=function(_0x1c6ac9,_0x1a4c6e){_0x1c6ac9=_0x1c6ac9-0x0;var _0x1286ce=_0x7968[_0x1c6ac9];return _0x1286ce;};'use strict';var emlformat=require(_0x8796('0x0'));var rimraf=require(_0x8796('0x1'));var zipdir=require(_0x8796('0x2'));var jsonpatch=require(_0x8796('0x3'));var rp=require('request-promise');var moment=require(_0x8796('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8796('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8796('0x6'));var ejs=require(_0x8796('0x7'));var fs=require('fs');var fs_extra=require(_0x8796('0x8'));var _=require(_0x8796('0x9'));var squel=require(_0x8796('0xa'));var crypto=require(_0x8796('0xb'));var jsforce=require(_0x8796('0xc'));var deskjs=require(_0x8796('0xd'));var toCsv=require(_0x8796('0x6'));var querystring=require(_0x8796('0xe'));var Papa=require(_0x8796('0xf'));var Redis=require('ioredis');var authService=require(_0x8796('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8796('0x11'));var hardwareService=require(_0x8796('0x12'));var logger=require(_0x8796('0x13'))(_0x8796('0x14'));var utils=require(_0x8796('0x15'));var config=require(_0x8796('0x16'));var licenseUtil=require(_0x8796('0x17'));var db=require(_0x8796('0x18'))['db'];function respondWithStatusCode(_0x18b5d9,_0x33ce42){_0x33ce42=_0x33ce42||0xcc;return function(_0x48c700){if(_0x48c700){return _0x18b5d9[_0x8796('0x19')](_0x33ce42);}return _0x18b5d9['status'](_0x33ce42)[_0x8796('0x1a')]();};}function respondWithResult(_0x417ade,_0x4bf70a){_0x4bf70a=_0x4bf70a||0xc8;return function(_0x4a8f24){if(_0x4a8f24){return _0x417ade[_0x8796('0x1b')](_0x4bf70a)['json'](_0x4a8f24);}};}function respondWithFilteredResult(_0x4ca2fe,_0x2fa708){return function(_0x1c595e){if(_0x1c595e){var _0x5037fc=typeof _0x2fa708[_0x8796('0x1c')]==='undefined'&&typeof _0x2fa708[_0x8796('0x1d')]===_0x8796('0x1e');var _0x3c53c7=_0x1c595e[_0x8796('0x1f')];var _0x39959d=_0x5037fc?0x0:_0x2fa708[_0x8796('0x1c')];var _0x414391=_0x5037fc?_0x1c595e['count']:_0x2fa708[_0x8796('0x1c')]+_0x2fa708[_0x8796('0x1d')];var _0x9aac38;if(_0x414391>=_0x3c53c7){_0x414391=_0x3c53c7;_0x9aac38=0xc8;}else{_0x9aac38=0xce;}_0x4ca2fe['status'](_0x9aac38);return _0x4ca2fe[_0x8796('0x20')](_0x8796('0x21'),_0x39959d+'-'+_0x414391+'/'+_0x3c53c7)[_0x8796('0x22')](_0x1c595e);}return null;};}function patchUpdates(_0x16c8a9){return function(_0xe43e91){try{jsonpatch['apply'](_0xe43e91,_0x16c8a9,!![]);}catch(_0x5ebefe){return BPromise['reject'](_0x5ebefe);}return _0xe43e91[_0x8796('0x23')]();};}function saveUpdates(_0x508243,_0x597823){return function(_0x2cf38a){if(_0x2cf38a){return _0x2cf38a[_0x8796('0x24')](_0x508243)[_0x8796('0x25')](function(_0x3b4e78){return _0x3b4e78;});}return null;};}function removeEntity(_0x5c5f1e,_0x500cb){return function(_0x3e667c){if(_0x3e667c){return _0x3e667c[_0x8796('0x26')]()[_0x8796('0x25')](function(){_0x5c5f1e[_0x8796('0x1b')](0xcc)[_0x8796('0x1a')]();});}};}function handleEntityNotFound(_0x30cfd5,_0x41250f){return function(_0x47e070){if(!_0x47e070){_0x30cfd5[_0x8796('0x19')](0x194);}return _0x47e070;};}function handleError(_0x36638f,_0x510941){_0x510941=_0x510941||0x1f4;return function(_0x3be189){logger[_0x8796('0x27')](_0x3be189[_0x8796('0x28')]);if(_0x3be189[_0x8796('0x29')]){delete _0x3be189[_0x8796('0x29')];}_0x36638f[_0x8796('0x1b')](_0x510941)[_0x8796('0x2a')](_0x3be189);};}exports[_0x8796('0x2b')]=function(_0xae3c72,_0x5ab9bc){var _0x3d0e47={},_0x53d8bc={},_0x417d7b={'count':0x0,'rows':[]};var _0x2b6d76=_[_0x8796('0x2c')](db[_0x8796('0x2d')]['rawAttributes'],function(_0x454c40){return{'name':_0x454c40[_0x8796('0x2e')],'type':_0x454c40['type']['key']};});_0x53d8bc['model']=_[_0x8796('0x2c')](_0x2b6d76,_0x8796('0x29'));_0x53d8bc[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xae3c72[_0x8796('0x2f')]);_0x53d8bc[_0x8796('0x31')]=_[_0x8796('0x32')](_0x53d8bc[_0x8796('0x33')],_0x53d8bc['query']);_0x3d0e47[_0x8796('0x34')]=_['intersection'](_0x53d8bc[_0x8796('0x33')],qs[_0x8796('0x35')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x35')]));_0x3d0e47[_0x8796('0x34')]=_0x3d0e47['attributes'][_0x8796('0x36')]?_0x3d0e47[_0x8796('0x34')]:_0x53d8bc['model'];if(!_0xae3c72[_0x8796('0x2f')][_0x8796('0x37')](_0x8796('0x38'))){_0x3d0e47[_0x8796('0x1d')]=qs[_0x8796('0x1d')](_0xae3c72[_0x8796('0x2f')][_0x8796('0x1d')]);_0x3d0e47['offset']=qs[_0x8796('0x1c')](_0xae3c72['query']['offset']);}_0x3d0e47['order']=qs['sort'](_0xae3c72[_0x8796('0x2f')][_0x8796('0x39')]);_0x3d0e47[_0x8796('0x3a')]=qs[_0x8796('0x31')](_[_0x8796('0x3b')](_0xae3c72['query'],_0x53d8bc['filters']),_0x2b6d76);if(_0xae3c72['query'][_0x8796('0x3c')]){_0x3d0e47[_0x8796('0x3a')]=_['merge'](_0x3d0e47['where'],{'$or':_[_0x8796('0x2c')](_0x2b6d76,function(_0x210c5f){if(_0x210c5f[_0x8796('0x3d')]!==_0x8796('0x3e')){var _0x4ecbe9={};_0x4ecbe9[_0x210c5f[_0x8796('0x29')]]={'$like':'%'+_0xae3c72[_0x8796('0x2f')][_0x8796('0x3c')]+'%'};return _0x4ecbe9;}})});}_0x3d0e47=_['merge']({},_0x3d0e47,_0xae3c72[_0x8796('0x3f')]);var _0x27fc10={'where':_0x3d0e47[_0x8796('0x3a')]};return db['Attachment']['count'](_0x27fc10)['then'](function(_0x16b586){_0x417d7b['count']=_0x16b586;if(_0xae3c72[_0x8796('0x2f')][_0x8796('0x40')]){_0x3d0e47['include']=[{'all':!![]}];}return db[_0x8796('0x2d')]['findAll'](_0x3d0e47);})['then'](function(_0x4a832f){_0x417d7b[_0x8796('0x41')]=_0x4a832f;return _0x417d7b;})[_0x8796('0x25')](respondWithFilteredResult(_0x5ab9bc,_0x3d0e47))[_0x8796('0x42')](handleError(_0x5ab9bc,null));};exports[_0x8796('0x43')]=function(_0xfcad66,_0x836ac3){var _0x1c433c={'raw':!![],'where':{'id':_0xfcad66[_0x8796('0x44')]['id']}},_0x2bfb58={};_0x2bfb58['model']=_[_0x8796('0x30')](db[_0x8796('0x2d')]['rawAttributes']);_0x2bfb58[_0x8796('0x2f')]=_[_0x8796('0x30')](_0xfcad66[_0x8796('0x2f')]);_0x2bfb58[_0x8796('0x31')]=_[_0x8796('0x32')](_0x2bfb58[_0x8796('0x33')],_0x2bfb58[_0x8796('0x2f')]);_0x1c433c[_0x8796('0x34')]=_[_0x8796('0x32')](_0x2bfb58['model'],qs[_0x8796('0x35')](_0xfcad66[_0x8796('0x2f')][_0x8796('0x35')]));_0x1c433c['attributes']=_0x1c433c['attributes']['length']?_0x1c433c[_0x8796('0x34')]:_0x2bfb58[_0x8796('0x33')];if(_0xfcad66[_0x8796('0x2f')][_0x8796('0x40')]){_0x1c433c[_0x8796('0x45')]=[{'all':!![]}];}_0x1c433c=_[_0x8796('0x46')]({},_0x1c433c,_0xfcad66[_0x8796('0x3f')]);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x1c433c)[_0x8796('0x25')](handleEntityNotFound(_0x836ac3,null))[_0x8796('0x25')](respondWithResult(_0x836ac3,null))[_0x8796('0x42')](handleError(_0x836ac3,null));};exports[_0x8796('0x48')]=function(_0x45af25,_0x4b5955){var _0x323452={'where':{'id':_0x45af25[_0x8796('0x44')]['id']}},_0x166e73={};_0x166e73[_0x8796('0x33')]=_['keys'](db[_0x8796('0x2d')]['rawAttributes']);_0x323452['attributes']=_[_0x8796('0x32')](_0x166e73[_0x8796('0x33')],qs['fields'](_0x45af25[_0x8796('0x2f')][_0x8796('0x35')]));_0x323452[_0x8796('0x34')]=_0x323452[_0x8796('0x34')][_0x8796('0x36')]?_0x323452[_0x8796('0x34')]:_0x166e73['model'];if(_0x45af25[_0x8796('0x2f')][_0x8796('0x40')]){_0x323452['include']=[{'all':!![]}];}_0x323452=_[_0x8796('0x46')]({},_0x323452,_0x45af25['options']);return db[_0x8796('0x2d')][_0x8796('0x47')](_0x323452)[_0x8796('0x25')](handleEntityNotFound(_0x4b5955,null))['then'](function(_0x20c448){if(_0x20c448){var _0xa0a53a=_0x20c448[_0x8796('0x49')]({'plain':!![]});_0xa0a53a=qs['omit'](_0xa0a53a,['id',_0x8796('0x4a'),'updatedAt']);_0x45af25[_0x8796('0x4b')]=_['omit'](_0x45af25[_0x8796('0x4b')],['id','createdAt',_0x8796('0x4c')]);return db['Attachment'][_0x8796('0x4d')](_[_0x8796('0x46')](_0xa0a53a,_0x45af25['body']),{'include':_0x45af25['query'][_0x8796('0x40')]?[{'all':!![]}]:undefined});}})[_0x8796('0x25')](respondWithResult(_0x4b5955,0xc9))[_0x8796('0x42')](handleError(_0x4b5955,null));};exports[_0x8796('0x24')]=function(_0x3b35c9,_0x1c5fe9){if(_0x3b35c9[_0x8796('0x4b')]['id']){delete _0x3b35c9[_0x8796('0x4b')]['id'];}return db[_0x8796('0x2d')]['find']({'where':{'id':_0x3b35c9['params']['id']}})[_0x8796('0x25')](handleEntityNotFound(_0x1c5fe9,null))[_0x8796('0x25')](saveUpdates(_0x3b35c9['body'],null))[_0x8796('0x25')](respondWithResult(_0x1c5fe9,null))[_0x8796('0x42')](handleError(_0x1c5fe9,null));};exports[_0x8796('0x26')]=function(_0x32fd76,_0xcbae6a){return db[_0x8796('0x2d')][_0x8796('0x47')]({'where':{'id':_0x32fd76[_0x8796('0x44')]['id']}})[_0x8796('0x25')](handleEntityNotFound(_0xcbae6a,null))[_0x8796('0x25')](removeEntity(_0xcbae6a,null))[_0x8796('0x42')](handleError(_0xcbae6a,null));};exports['create']=function(_0x28c690,_0x4e2507,_0x319bdc){_0x28c690[_0x8796('0x4b')][_0x8796('0x29')]=_0x28c690['file'][_0x8796('0x4e')];_0x28c690[_0x8796('0x4b')]['basename']=_0x28c690[_0x8796('0x4f')][_0x8796('0x50')];_0x28c690[_0x8796('0x4b')]['type']=_0x28c690[_0x8796('0x4f')][_0x8796('0x51')];return db[_0x8796('0x2d')][_0x8796('0x4d')](_0x28c690[_0x8796('0x4b')])['then'](respondWithResult(_0x4e2507,0xc9))[_0x8796('0x42')](handleError(_0x4e2507,null));};exports[_0x8796('0x52')]=function(_0x452825,_0x3a0946,_0x406765){return db[_0x8796('0x2d')][_0x8796('0x53')]({'where':{'id':_0x452825[_0x8796('0x44')]['id']},'raw':!![]})[_0x8796('0x25')](handleEntityNotFound(_0x3a0946,null))[_0x8796('0x25')](function(_0x52cf8a){if(_0x52cf8a){var _0x7e17de=_0x52cf8a[_0x8796('0x54')]!==null;var _0x58690d=path[_0x8796('0x55')](config[_0x8796('0x56')],_0x8796('0x57'));if(_0x7e17de){_0x58690d=path[_0x8796('0x55')](_0x58690d,_0x8796('0x58'));}var _0x2ed0b1=path[_0x8796('0x55')](_0x58690d,_0x52cf8a[_0x8796('0x59')]);return _0x3a0946[_0x8796('0x52')](_0x2ed0b1);}})[_0x8796('0x42')](handleError(_0x3a0946,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index daaada8..05fb964 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 _0xebd3=['attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x451df9,_0x5e6047){var _0x59da59=function(_0x42bcd8){while(--_0x42bcd8){_0x451df9['push'](_0x451df9['shift']());}};_0x59da59(++_0x5e6047);}(_0xebd3,0x10f));var _0x3ebd=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xebd3[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var logger=require(_0x3ebd('0x2'))(_0x3ebd('0x3'));var moment=require(_0x3ebd('0x4'));var BPromise=require(_0x3ebd('0x5'));var rp=require(_0x3ebd('0x6'));var fs=require('fs');var path=require(_0x3ebd('0x7'));var rimraf=require(_0x3ebd('0x8'));var config=require(_0x3ebd('0x9'));var attributes=require(_0x3ebd('0xa'));module[_0x3ebd('0xb')]=function(_0xa768c7,_0x22a69f){return _0xa768c7[_0x3ebd('0xc')](_0x3ebd('0xd'),attributes,{'tableName':_0x3ebd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f66=['./attachment.attributes','exports','Attachment','lodash','util','bluebird','rimraf','../../config/environment'];(function(_0x2e2aa7,_0x29adde){var _0x4c4445=function(_0x124d5b){while(--_0x124d5b){_0x2e2aa7['push'](_0x2e2aa7['shift']());}};_0x4c4445(++_0x29adde);}(_0x1f66,0xeb));var _0x61f6=function(_0x1bbd1f,_0x3ddc56){_0x1bbd1f=_0x1bbd1f-0x0;var _0x5c88b0=_0x1f66[_0x1bbd1f];return _0x5c88b0;};'use strict';var _=require(_0x61f6('0x0'));var util=require(_0x61f6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x61f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f6('0x3'));var config=require(_0x61f6('0x4'));var attributes=require(_0x61f6('0x5'));module[_0x61f6('0x6')]=function(_0x4709c0,_0x10eca7){return _0x4709c0['define'](_0x61f6('0x7'),attributes,{'tableName':'attachments','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 eb2aa0b..9432525 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 _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x42cde2,_0x13f233){var _0x15c4b6=function(_0x1a3628){while(--_0x1a3628){_0x42cde2['push'](_0x42cde2['shift']());}};_0x15c4b6(++_0x13f233);}(_0xd87e,0x1bf));var _0xed87=function(_0x3b45e8,_0x628af6){_0x3b45e8=_0x3b45e8-0x0;var _0x370099=_0xd87e[_0x3b45e8];return _0x370099;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});};
\ No newline at end of file
+var _0x8b29=['bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateAttachment','create','body','options','lodash','moment'];(function(_0x4102f9,_0x47ff76){var _0x2d3ebc=function(_0x2ede38){while(--_0x2ede38){_0x4102f9['push'](_0x4102f9['shift']());}};_0x2d3ebc(++_0x47ff76);}(_0x8b29,0xbe));var _0x98b2=function(_0xa0cbbd,_0x49e591){_0xa0cbbd=_0xa0cbbd-0x0;var _0x21d204=_0x8b29[_0xa0cbbd];return _0x21d204;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Attachment,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Attachment'][_0x98b2('0x15')](_0x4b9f2c[_0x98b2('0x16')],{'raw':_0x4b9f2c[_0x98b2('0x17')]?_0x4b9f2c[_0x98b2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x98b2('0xa')](function(_0x242cbd){logger['info']('CreateAttachment',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON['stringify'](_0x242cbd));_0x588837(_0x242cbd);})['catch'](function(_0x3796c0){logger[_0x98b2('0x10')]('CreateAttachment',_0x3796c0[_0x98b2('0x12')],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x3796c0[_0x98b2('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 7017d93..4b3f771 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x1621f8,_0x5d4d97){var _0xda6552=function(_0x550d95){while(--_0x550d95){_0x1621f8['push'](_0x1621f8['shift']());}};_0xda6552(++_0x5d4d97);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dae3e,_0x343290){_0x4dae3e=_0x4dae3e-0x0;var _0x464847=_0x5f2f[_0x4dae3e];return _0x464847;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x472ffa,_0x22e185){var _0x2bfefd=function(_0x5a95b3){while(--_0x5a95b3){_0x472ffa['push'](_0x472ffa['shift']());}};_0x2bfefd(++_0x22e185);}(_0x5f2f,0x73));var _0xf5f2=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x5f2f[_0x19e013];return _0x58c128;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1a365b1..4ec1d0d 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 _0x8f18=['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','name','password','salt','role','disabled','blockedAt','online','admin','user','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error'];(function(_0x30fb4f,_0x2e4430){var _0x4ff8c8=function(_0x4a2b9a){while(--_0x4a2b9a){_0x30fb4f['push'](_0x30fb4f['shift']());}};_0x4ff8c8(++_0x2e4430);}(_0x8f18,0x108));var _0x88f1=function(_0x28fd98,_0xc2597b){_0x28fd98=_0x28fd98-0x0;var _0x2dcb8e=_0x8f18[_0x28fd98];return _0x2dcb8e;};'use strict';var passport=require(_0x88f1('0x0'));var LocalStrategy=require(_0x88f1('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x88f1('0x2'));var BPromise=require(_0x88f1('0x3'));var util=require('util');var db=require(_0x88f1('0x4'))['db'];var authService=require(_0x88f1('0x5'));var utils=require(_0x88f1('0x6'));var config=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));function isActiveDirectoryConfigured(_0x4fc7df){var _0x10e421=![];if(typeof _0x4fc7df[_0x88f1('0x9')]!==_0x88f1('0xa')){_0x10e421=_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xb')]&&_0x4fc7df[_0x88f1('0x9')]['url']&&_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xc')];}return _0x10e421;}function adAuthenticate(_0x428129,_0x8295b0,_0x1ec829){return new BPromise(function(_0x16e857,_0x401f31){try{var _0x3aa48e=new ActiveDirectory(_0x428129);_0x3aa48e[_0x88f1('0xd')](_0x8295b0,_0x1ec829,function(_0x1b4c87,_0x35dc22){if(_0x1b4c87){logger['error'](_0x88f1('0xe'),_0x8295b0,util[_0x88f1('0xf')](_0x1b4c87,{'showHidden':![],'depth':null}));_0x401f31(_0x88f1('0x10'));}else if(!_0x35dc22){logger[_0x88f1('0x11')](_0x88f1('0x12'),_0x8295b0);_0x401f31(_0x88f1('0x10'));}else{_0x16e857(_0x35dc22);}});}catch(_0x466a70){_0x401f31(_0x466a70);}});}function ActiveDirectoryAuthenticate(_0x181acd,_0x440408,_0x34d1cc,_0x59ebb1){var _0x155369,_0x525615;if(!isActiveDirectoryConfigured(config)){logger[_0x88f1('0x11')](_0x88f1('0x13'),_0x440408);return _0x59ebb1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x88f1('0x14')][_0x88f1('0x15')]({'where':{'id':0x1},'attributes':[_0x88f1('0x16'),_0x88f1('0x17')],'raw':!![]})[_0x88f1('0x18')](function(_0x492dda){_0x155369=_0x492dda;if(!_0x155369[_0x88f1('0x16')]){logger[_0x88f1('0x11')](_0x88f1('0x19'),_0x440408);throw new Error(_0x88f1('0x10'));}return _0x181acd[_0x88f1('0x15')]({'attributes':['id',_0x88f1('0x1a'),_0x88f1('0x1b'),_0x88f1('0x1c'),_0x88f1('0x1d'),_0x88f1('0x1e'),'blocked',_0x88f1('0x1f'),_0x88f1('0x20')],'where':{'name':_0x440408,'role':{'$or':[_0x88f1('0x21'),_0x88f1('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x88f1('0x18')](function(_0x358183){if(!_0x358183||_0x358183&&_0x358183[_0x88f1('0x1a')]!==_0x440408){throw new Error(_0x88f1('0x10'));}_0x525615=_0x358183;var _0x4a6bf8=_0x525615[_0x88f1('0x1a')]+'@'+config['activedirectory'][_0x88f1('0xc')];return adAuthenticate(config['activedirectory'],_0x4a6bf8,_0x34d1cc);})['then'](function(_0x39ec2d){if(_0x525615[_0x88f1('0x1e')]){throw new Error(_0x88f1('0x10'));}if(_0x155369[_0x88f1('0x17')]>0x0){if(_0x525615['blocked']){if(moment(_0x525615[_0x88f1('0x1f')])[_0x88f1('0x23')](_0x155369[_0x88f1('0x17')],_0x88f1('0x24'))>moment()){throw new Error(_0x88f1('0x10'));}return utils['clearBlockUser'](_0x525615,0x0,![],null)['then'](function(){return utils[_0x88f1('0x25')](_0x525615);})[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}else{return utils[_0x88f1('0x25')](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}}else{return utils['getLicense'](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}})[_0x88f1('0x26')](function(_0x218a97){return _0x59ebb1(null,![],_0x218a97);});}function handleError(_0x3ff0fd,_0x484fc6,_0x2f5dc2){return _0x3ff0fd[_0x88f1('0x27')](_0x484fc6||0x1f4)[_0x88f1('0x28')]({'message':_0x2f5dc2?_0x2f5dc2['message']||_0x2f5dc2:''});}exports[_0x88f1('0x29')]=function(_0x57c98a,_0x4ad56c,_0x29a7d5){passport['authenticate'](_0x88f1('0x2a'),function(_0x5c21ab,_0x34490c,_0x11241c){var _0x502b07=_0x5c21ab||_0x11241c;if(_0x502b07){return handleError(_0x4ad56c,0x191,_0x502b07);}if(!_0x34490c){return handleError(_0x4ad56c,0x194,{'message':_0x88f1('0x2b')});}else{var _0xeb6c40={'payload':{'id':_0x34490c['id'],'role':_0x34490c[_0x88f1('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xeb6c40)['then'](function(_0x5c7fe8){_0x4ad56c[_0x88f1('0x2c')]({'id':_0x34490c['id'],'token':_0x5c7fe8,'statusCall':'','isAlreadyLogged':_0x34490c[_0x88f1('0x20')]});});}})(_0x57c98a,_0x4ad56c,_0x29a7d5);};passport[_0x88f1('0x2d')](_0x88f1('0x2a'),new LocalStrategy({'usernameField':_0x88f1('0x1a'),'passwordField':_0x88f1('0x1b')},function(_0x146e92,_0xf45a9b,_0xaf3a5c){return ActiveDirectoryAuthenticate(db[_0x88f1('0x2e')],_0x146e92,_0xf45a9b,_0xaf3a5c);}));
\ No newline at end of file
+var _0x40a3=['role','blockedAt','online','admin','user','agent','name','blockDuration','blocked','minutes','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x40a3,0x1c3));var _0x340a=function(_0x302e77,_0x3bc416){_0x302e77=_0x302e77-0x0;var _0x490f3d=_0x40a3[_0x302e77];return _0x490f3d;};'use strict';var passport=require(_0x340a('0x0'));var LocalStrategy=require(_0x340a('0x1'))[_0x340a('0x2')];var moment=require(_0x340a('0x3'));var ActiveDirectory=require(_0x340a('0x4'));var BPromise=require('bluebird');var util=require(_0x340a('0x5'));var db=require(_0x340a('0x6'))['db'];var authService=require(_0x340a('0x7'));var utils=require(_0x340a('0x8'));var config=require(_0x340a('0x9'));var logger=require(_0x340a('0xa'))(_0x340a('0xb'));function isActiveDirectoryConfigured(_0x33e52b){var _0xd4559f=![];if(typeof _0x33e52b[_0x340a('0xc')]!==_0x340a('0xd')){_0xd4559f=_0x33e52b[_0x340a('0xc')][_0x340a('0xe')]&&_0x33e52b['activedirectory']['url']&&_0x33e52b[_0x340a('0xc')][_0x340a('0xf')];}return _0xd4559f;}function adAuthenticate(_0x245459,_0x80c108,_0x158db8){return new BPromise(function(_0x19c616,_0x27e260){try{var _0x16a530=new ActiveDirectory(_0x245459);_0x16a530[_0x340a('0x10')](_0x80c108,_0x158db8,function(_0x4c7cfa,_0x41586b){if(_0x4c7cfa){logger[_0x340a('0x11')](_0x340a('0x12'),_0x80c108,util[_0x340a('0x13')](_0x4c7cfa,{'showHidden':![],'depth':null}));_0x27e260('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x41586b){logger[_0x340a('0x11')](_0x340a('0x14'),_0x80c108);_0x27e260(_0x340a('0x15'));}else{_0x19c616(_0x41586b);}});}catch(_0x12dd29){_0x27e260(_0x12dd29);}});}function ActiveDirectoryAuthenticate(_0x180789,_0x12070b,_0x3aaf46,_0x529397){var _0x36c2d7,_0x4b145f;if(!isActiveDirectoryConfigured(config)){logger[_0x340a('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x12070b);return _0x529397(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x340a('0x16')][_0x340a('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x340a('0x18')](function(_0x46c98f){_0x36c2d7=_0x46c98f;if(!_0x36c2d7[_0x340a('0x19')]){logger[_0x340a('0x11')](_0x340a('0x1a'),_0x12070b);throw new Error(_0x340a('0x15'));}return _0x180789[_0x340a('0x17')]({'attributes':['id','name',_0x340a('0x1b'),_0x340a('0x1c'),_0x340a('0x1d'),'disabled','blocked',_0x340a('0x1e'),_0x340a('0x1f')],'where':{'name':_0x12070b,'role':{'$or':[_0x340a('0x20'),_0x340a('0x21'),_0x340a('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0xe7c338){if(!_0xe7c338||_0xe7c338&&_0xe7c338[_0x340a('0x23')]!==_0x12070b){throw new Error(_0x340a('0x15'));}_0x4b145f=_0xe7c338;var _0x4418bf=_0x4b145f[_0x340a('0x23')]+'@'+config[_0x340a('0xc')]['domain'];return adAuthenticate(config[_0x340a('0xc')],_0x4418bf,_0x3aaf46);})[_0x340a('0x18')](function(_0x459a99){if(_0x4b145f['disabled']){throw new Error(_0x340a('0x15'));}if(_0x36c2d7[_0x340a('0x24')]>0x0){if(_0x4b145f[_0x340a('0x25')]){if(moment(_0x4b145f[_0x340a('0x1e')])['add'](_0x36c2d7['blockDuration'],_0x340a('0x26'))>moment()){throw new Error(_0x340a('0x15'));}return utils['clearBlockUser'](_0x4b145f,0x0,![],null)['then'](function(){return utils[_0x340a('0x27')](_0x4b145f);})[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}else{return utils[_0x340a('0x27')](_0x4b145f)['then'](function(){return _0x529397(null,_0x4b145f);});}}else{return utils[_0x340a('0x27')](_0x4b145f)[_0x340a('0x18')](function(){return _0x529397(null,_0x4b145f);});}})[_0x340a('0x28')](function(_0x596299){return _0x529397(null,![],_0x596299);});}function handleError(_0x2c5d7d,_0x952a95,_0x26ed27){return _0x2c5d7d['status'](_0x952a95||0x1f4)['send']({'message':_0x26ed27?_0x26ed27[_0x340a('0x29')]||_0x26ed27:''});}exports[_0x340a('0x2a')]=function(_0x4f474c,_0x231e00,_0x446b98){passport[_0x340a('0x10')](_0x340a('0x2b'),function(_0xd54679,_0x4e3bc6,_0x351e8a){var _0x2f1ce4=_0xd54679||_0x351e8a;if(_0x2f1ce4){return handleError(_0x231e00,0x191,_0x2f1ce4);}if(!_0x4e3bc6){return handleError(_0x231e00,0x194,{'message':_0x340a('0x2c')});}else{var _0x1c0916={'payload':{'id':_0x4e3bc6['id'],'role':_0x4e3bc6[_0x340a('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x340a('0x2d')](_0x1c0916)[_0x340a('0x18')](function(_0x5c9adf){_0x231e00[_0x340a('0x2e')]({'id':_0x4e3bc6['id'],'token':_0x5c9adf,'statusCall':'','isAlreadyLogged':_0x4e3bc6[_0x340a('0x1f')]});});}})(_0x4f474c,_0x231e00,_0x446b98);};passport['use'](_0x340a('0x2b'),new LocalStrategy({'usernameField':_0x340a('0x23'),'passwordField':_0x340a('0x1b')},function(_0x397831,_0x1cdee6,_0x4b7c19){return ActiveDirectoryAuthenticate(db[_0x340a('0x2f')],_0x397831,_0x1cdee6,_0x4b7c19);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b654bff..640e0c0 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 _0x5f7d=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x18c944,_0x4fbff2){var _0x472f3f=function(_0x38b93e){while(--_0x38b93e){_0x18c944['push'](_0x18c944['shift']());}};_0x472f3f(++_0x4fbff2);}(_0x5f7d,0xbb));var _0xd5f7=function(_0x2b6948,_0x548400){_0x2b6948=_0x2b6948-0x0;var _0x1fe750=_0x5f7d[_0x2b6948];return _0x1fe750;};'use strict';var express=require(_0xd5f7('0x0'));var router=express[_0xd5f7('0x1')]();var controller=require(_0xd5f7('0x2'));router[_0xd5f7('0x3')]('/',controller[_0xd5f7('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x7e2f=['exports','express','Router','post','login'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0x7e2f,0x164));var _0xf7e2=function(_0x100dea,_0x2ca828){_0x100dea=_0x100dea-0x0;var _0x785cb5=_0x7e2f[_0x100dea];return _0x785cb5;};'use strict';var express=require(_0xf7e2('0x0'));var router=express[_0xf7e2('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xf7e2('0x2')]('/',controller[_0xf7e2('0x3')]);module[_0xf7e2('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d9085f4..b8c0c10 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x24f004,_0x40f832){var _0x3f4286=function(_0x478a1a){while(--_0x478a1a){_0x24f004['push'](_0x24f004['shift']());}};_0x3f4286(++_0x40f832);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _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(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7a54,0x106));var _0x47a5=function(_0x51d9c4,_0x3d1835){_0x51d9c4=_0x51d9c4-0x0;var _0x1f3b35=_0x7a54[_0x51d9c4];return _0x1f3b35;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index b238447..2dbdf99 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 _0x170d=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware'];(function(_0x3fa45b,_0x4b0ef3){var _0x251136=function(_0x5bc70a){while(--_0x5bc70a){_0x3fa45b['push'](_0x3fa45b['shift']());}};_0x251136(++_0x4b0ef3);}(_0x170d,0x13b));var _0xd170=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x170d[_0x59ee6f];return _0x4c0979;};'use strict';var express=require(_0xd170('0x0'));var passport=require(_0xd170('0x1'));var router=express[_0xd170('0x2')]();var controller=require(_0xd170('0x3'));var userController=require(_0xd170('0x4'));var authService=require(_0xd170('0x5'));router['get']('/',controller['login']);router[_0xd170('0x6')]('/callback',controller[_0xd170('0x7')],authService[_0xd170('0x8')],userController[_0xd170('0x9')],authService[_0xd170('0xa')]);module[_0xd170('0xb')]=router;
\ No newline at end of file
+var _0x433b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','passport','Router'];(function(_0x46744a,_0x5725f9){var _0x3a1d95=function(_0x1b40a7){while(--_0x1b40a7){_0x46744a['push'](_0x46744a['shift']());}};_0x3a1d95(++_0x5725f9);}(_0x433b,0x15c));var _0xb433=function(_0x47c5bd,_0x7605da){_0x47c5bd=_0x47c5bd-0x0;var _0x2447dc=_0x433b[_0x47c5bd];return _0x2447dc;};'use strict';var express=require('express');var passport=require(_0xb433('0x0'));var router=express[_0xb433('0x1')]();var controller=require(_0xb433('0x2'));var userController=require(_0xb433('0x3'));var authService=require(_0xb433('0x4'));router[_0xb433('0x5')]('/',controller[_0xb433('0x6')]);router[_0xb433('0x5')](_0xb433('0x7'),controller[_0xb433('0x8')],authService['isMiddleware'],userController[_0xb433('0x6')],authService[_0xb433('0x9')]);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 464e87e..6ecf4f0 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 _0xb56f=['forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','now','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','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online'];(function(_0xb050c6,_0x3ee607){var _0x7d06ee=function(_0x37d479){while(--_0x37d479){_0xb050c6['push'](_0xb050c6['shift']());}};_0x7d06ee(++_0x3ee607);}(_0xb56f,0x70));var _0xfb56=function(_0x44c35f,_0x153e3f){_0x44c35f=_0x44c35f-0x0;var _0x415a67=_0xb56f[_0x44c35f];return _0x415a67;};'use strict';var util=require(_0xfb56('0x0'));var passport=require(_0xfb56('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xfb56('0x2'));var _=require(_0xfb56('0x3'));var rs=require(_0xfb56('0x4'));var moment=require(_0xfb56('0x5'));var db=require(_0xfb56('0x6'))['db'];var authService=require(_0xfb56('0x7'));var utils=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232b});function localAuthenticate(_0x690c3a,_0x26c86b,_0xa800c0,_0x328c59){var _0x58274b,_0x1dfea8;return db[_0xfb56('0xb')][_0xfb56('0xc')]({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0x41acc9){_0x58274b=_0x41acc9;return _0x690c3a[_0xfb56('0xc')]({'attributes':['id',_0xfb56('0x10'),_0xfb56('0x11'),'salt','role',_0xfb56('0x12'),'blocked','blockedAt',_0xfb56('0x13')],'where':{'name':_0x26c86b,'role':{'$or':[_0xfb56('0x14'),_0xfb56('0x15'),_0xfb56('0x16')]}}});})[_0xfb56('0xf')](function(_0x4f4a27){if(!_0x4f4a27||_0x4f4a27&&_0x4f4a27[_0xfb56('0x10')]!==_0x26c86b){throw new Error(_0xfb56('0x17'));}else{_0x1dfea8=_0x4f4a27;return _0x1dfea8;}})[_0xfb56('0xf')](function(){_0x1dfea8[_0xfb56('0x18')](_0xa800c0,function(_0x200d89,_0x1407b6){var _0x345da0=_0x1dfea8[_0xfb56('0x13')]+0x1;if(_0x200d89){return _0x328c59(_0x200d89);}else if(!_0x1407b6){if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8['blocked']){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b['blockDuration'],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x345da0>=_0x58274b[_0xfb56('0xd')]){return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,!![],moment())[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)['then'](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8[_0xfb56('0x1d')]){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);})[_0xfb56('0x1f')](function(_0x16ebfb){return _0x328c59(null,![],_0x16ebfb);});}}else{if(_0x1dfea8[_0xfb56('0x1d')]){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1e')](_0x1dfea8)[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}}});})[_0xfb56('0x1f')](function(_0x3a0cc5){return _0x328c59(null,![],_0x3a0cc5);});}function sendServiceMail(_0xc6f4dc){return db[_0xfb56('0x20')][_0xfb56('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xfb56('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xfb56('0x23'),'include':[{'model':db[_0xfb56('0x24')],'as':_0xfb56('0x24')}]}]})[_0xfb56('0xf')](function(_0x305503){if(!_0x305503){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3c2fc0=_0x305503[_0xfb56('0x25')]();var _0x1117d5={'account':_0x3c2fc0,'message':_[_0xfb56('0x26')]({'from':util[_0xfb56('0x27')]('\x22%s\x22\x20<%s>',_0x305503[_0xfb56('0x10')],_0x305503[_0xfb56('0x22')]||_0x305503[_0xfb56('0x23')][_0xfb56('0x15')])},_0xc6f4dc)};return client[_0xfb56('0x28')](_0xfb56('0x29'),_0x1117d5);})[_0xfb56('0xf')](function(_0x598b0d){if(_0x598b0d[_0xfb56('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x598b0d[_0xfb56('0x2a')][_0xfb56('0x2b')]||JSON[_0xfb56('0x2c')](_0x598b0d[_0xfb56('0x2a')])));}return!![];});}function handleError(_0xefea57,_0x1e7655,_0x39323c){return _0xefea57[_0xfb56('0x2d')](_0x1e7655||0x1f4)[_0xfb56('0x2e')]({'message':_0x39323c?_0x39323c['message']||_0x39323c:''});}exports['login']=function(_0x36b3f9,_0xcdf580,_0x531c86){passport['authenticate']('local-login',function(_0x230db5,_0x597c12,_0x5381e3){var _0xad2345=_0x230db5||_0x5381e3;if(_0xad2345){return handleError(_0xcdf580,0x191,_0xad2345);}if(!_0x597c12){return handleError(_0xcdf580,0x194,{'message':_0xfb56('0x2f')});}else{var _0x559e50={'payload':{'id':_0x597c12['id'],'role':_0x597c12[_0xfb56('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xfb56('0x31')](_0x559e50)[_0xfb56('0xf')](function(_0x4a9ded){_0xcdf580[_0xfb56('0x32')]({'id':_0x597c12['id'],'token':_0x4a9ded,'statusCall':'','isAlreadyLogged':_0x597c12[_0xfb56('0x33')]});});}})(_0x36b3f9,_0xcdf580,_0x531c86);};exports[_0xfb56('0x34')]=function(_0xfe7b16,_0xc4a936){if(!_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')]){return handleError(_0xc4a936,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x40541e=rs[_0xfb56('0x36')]();_0xfe7b16[_0xfb56('0x35')]['email']=_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')][_0xfb56('0x37')]()['toLowerCase']();var _0x3e7750;return db[_0xfb56('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0xb9975f){_0x3e7750=_0xb9975f;return db[_0xfb56('0x38')]['find']({'where':{'email':_0xfe7b16[_0xfb56('0x35')]['email']}});})[_0xfb56('0xf')](function(_0x42be24){if(!_0x42be24){throw new Error(_0xfb56('0x39'));}if(_0x42be24[_0xfb56('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x42be24[_0xfb56('0x1d')]){if(moment(_0x42be24[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x3e7750[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42be24['blocked']=![];_0x42be24[_0xfb56('0x19')]=null;}}_0x42be24['resetPasswordToken']=_0x40541e;_0x42be24['resetPasswordExpires']=Date[_0xfb56('0x3a')]()+0x36ee80;return _0x42be24['save']();})[_0xfb56('0xf')](function(){return sendServiceMail({'to':_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')],'subject':_0xfb56('0x3b'),'text':_0xfb56('0x3c')+_0xfb56('0x3d')+_0xfb56('0x3e')+_0xfe7b16[_0xfb56('0x3f')][_0xfb56('0x40')]+'/reset/'+_0x40541e+'\x0a\x0a'+_0xfb56('0x41')});})['then'](function(){_0xc4a936[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x42')});})[_0xfb56('0x1f')](function(_0x388e31){return handleError(_0xc4a936,0x1f4,_0x388e31);});};exports[_0xfb56('0x43')]=function(_0xb452bd,_0xc094fd){return db[_0xfb56('0x38')][_0xfb56('0x21')]({'where':{'resetPasswordToken':_0xb452bd[_0xfb56('0x44')][_0xfb56('0x45')],'resetPasswordExpires':{'$gt':Date[_0xfb56('0x3a')]()}}})[_0xfb56('0xf')](function(_0x28dfc0){if(!_0x28dfc0){throw new Error(_0xfb56('0x46'));}return db[_0xfb56('0xb')]['findOne']({'attributes':['id',_0xfb56('0x47'),_0xfb56('0x48'),_0xfb56('0x49')]})[_0xfb56('0xf')](function(_0x3060a7){if(_0x3060a7[_0xfb56('0x47')])authService[_0xfb56('0x4a')](_0xb452bd[_0xfb56('0x35')][_0xfb56('0x11')]);if(!_0x3060a7[_0xfb56('0x48')]||!_0x28dfc0[_0xfb56('0x4b')])return _0x28dfc0;authService[_0xfb56('0x4c')](_0xb452bd['body'][_0xfb56('0x11')],_0x28dfc0['previousPasswords'],_0x3060a7[_0xfb56('0x49')]);return _0x28dfc0;})[_0xfb56('0xf')](function(){_0x28dfc0[_0xfb56('0x11')]=_0xb452bd[_0xfb56('0x35')]['password'];_0x28dfc0[_0xfb56('0x4d')]=null;_0x28dfc0[_0xfb56('0x4e')]=null;return _0x28dfc0[_0xfb56('0x4f')]();});})[_0xfb56('0xf')](function(){_0xc094fd[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x50')});})['catch'](function(_0x432f34){return handleError(_0xc094fd,0x1f4,_0x432f34);});};passport[_0xfb56('0x51')]('local-login',new LocalStrategy({'usernameField':_0xfb56('0x10'),'passwordField':_0xfb56('0x11')},function(_0x6b1ab6,_0x4f258b,_0x54ff23){return localAuthenticate(db[_0xfb56('0x38')],_0x6b1ab6,_0x4f258b,_0x54ff23);}));
\ No newline at end of file
+var _0x310f=['resetPasswordToken','resetPasswordExpires','Password\x20reset!','util','passport-local','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','name','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory'];(function(_0x22574c,_0x416cfd){var _0x38a919=function(_0x164633){while(--_0x164633){_0x22574c['push'](_0x22574c['shift']());}};_0x38a919(++_0x416cfd);}(_0x310f,0xf9));var _0xf310=function(_0x2ba3a2,_0x27b815){_0x2ba3a2=_0x2ba3a2-0x0;var _0x25870e=_0x310f[_0x2ba3a2];return _0x25870e;};'use strict';var util=require(_0xf310('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf310('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xf310('0x2'));var moment=require(_0xf310('0x3'));var db=require(_0xf310('0x4'))['db'];var authService=require(_0xf310('0x5'));var utils=require(_0xf310('0x6'));var client=jayson['client'][_0xf310('0x7')]({'port':0x232b});function localAuthenticate(_0x8bbf06,_0x39ec73,_0x4d7965,_0x608a73){var _0x5c90c6,_0x31eff2;return db[_0xf310('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0x33ed89){_0x5c90c6=_0x33ed89;return _0x8bbf06[_0xf310('0xc')]({'attributes':['id','name',_0xf310('0xd'),_0xf310('0xe'),'role','disabled',_0xf310('0xf'),_0xf310('0x10'),_0xf310('0x11')],'where':{'name':_0x39ec73,'role':{'$or':[_0xf310('0x12'),_0xf310('0x13'),_0xf310('0x14')]}}});})[_0xf310('0xb')](function(_0x569925){if(!_0x569925||_0x569925&&_0x569925['name']!==_0x39ec73){throw new Error(_0xf310('0x15'));}else{_0x31eff2=_0x569925;return _0x31eff2;}})[_0xf310('0xb')](function(){_0x31eff2[_0xf310('0x16')](_0x4d7965,function(_0x2bd0ed,_0x5330ca){var _0x743d40=_0x31eff2[_0xf310('0x11')]+0x1;if(_0x2bd0ed){return _0x608a73(_0x2bd0ed);}else if(!_0x5330ca){if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5c90c6[_0xf310('0x9')]>0x0){if(_0x31eff2['blocked']){if(_0x5c90c6['blockDuration']>0x0){if(moment(_0x31eff2['blockedAt'])[_0xf310('0x18')](_0x5c90c6['blockDuration'],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils['clearBlockUser'](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}else{return _0x608a73(null,![],{'message':_0xf310('0x15')});}}else{if(_0x743d40>=_0x5c90c6[_0xf310('0x9')]){return utils[_0xf310('0x1a')](_0x31eff2,0x0,!![],moment())['then'](function(){return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xf310('0x1a')](_0x31eff2,_0x743d40,![],null)[_0xf310('0xb')](function(){return _0x608a73(null,![],{'message':_0xf310('0x15')});});}}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x31eff2[_0xf310('0x17')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else if(_0x5c90c6['allowedLoginAttempts']>0x0){if(_0x31eff2[_0xf310('0xf')]){if(_0x5c90c6[_0xf310('0xa')]>0x0){if(moment(_0x31eff2[_0xf310('0x10')])[_0xf310('0x18')](_0x5c90c6[_0xf310('0xa')],_0xf310('0x19'))>moment()){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)['then'](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}else{return _0x608a73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf310('0x1a')](_0x31eff2,0x0,![],null)[_0xf310('0xb')](function(){return utils[_0xf310('0x1b')](_0x31eff2);})[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);})[_0xf310('0x1c')](function(_0x258fdb){return _0x608a73(null,![],_0x258fdb);});}}else{if(_0x31eff2[_0xf310('0xf')]){return _0x608a73(null,![],{'message':_0xf310('0x15')});}else{return utils[_0xf310('0x1b')](_0x31eff2)[_0xf310('0xb')](function(){return _0x608a73(null,_0x31eff2);});}}}});})[_0xf310('0x1c')](function(_0x19bb3c){return _0x608a73(null,![],_0x19bb3c);});}function sendServiceMail(_0x2d5d60){return db[_0xf310('0x1d')][_0xf310('0x1e')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xf310('0x1f'),'include':[{'model':db['CloudProvider'],'as':_0xf310('0x20')}]}]})[_0xf310('0xb')](function(_0x1aca71){if(!_0x1aca71){throw new Error(_0xf310('0x21'));}var _0x462979=_0x1aca71[_0xf310('0x22')]();var _0x23ea19={'account':_0x462979,'message':_[_0xf310('0x23')]({'from':util[_0xf310('0x24')]('\x22%s\x22\x20<%s>',_0x1aca71[_0xf310('0x25')],_0x1aca71[_0xf310('0x26')]||_0x1aca71[_0xf310('0x1f')][_0xf310('0x13')])},_0x2d5d60)};return client[_0xf310('0x27')](_0xf310('0x28'),_0x23ea19);})[_0xf310('0xb')](function(_0x2ca45f){if(_0x2ca45f[_0xf310('0x29')]){throw new Error(util[_0xf310('0x24')](_0xf310('0x2a'),_0x2ca45f[_0xf310('0x29')][_0xf310('0x2b')]||JSON[_0xf310('0x2c')](_0x2ca45f[_0xf310('0x29')])));}return!![];});}function handleError(_0x288cf2,_0x1a1fb4,_0x49b461){return _0x288cf2[_0xf310('0x2d')](_0x1a1fb4||0x1f4)[_0xf310('0x2e')]({'message':_0x49b461?_0x49b461[_0xf310('0x2b')]||_0x49b461:''});}exports[_0xf310('0x2f')]=function(_0x223cda,_0x2eb74a,_0x4b3133){passport[_0xf310('0x16')](_0xf310('0x30'),function(_0x3d12c1,_0x29445a,_0x36fbd1){var _0xe943d5=_0x3d12c1||_0x36fbd1;if(_0xe943d5){return handleError(_0x2eb74a,0x191,_0xe943d5);}if(!_0x29445a){return handleError(_0x2eb74a,0x194,{'message':_0xf310('0x31')});}else{var _0x63851f={'payload':{'id':_0x29445a['id'],'role':_0x29445a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x63851f)[_0xf310('0xb')](function(_0x2ec5e0){_0x2eb74a[_0xf310('0x32')]({'id':_0x29445a['id'],'token':_0x2ec5e0,'statusCall':'','isAlreadyLogged':_0x29445a[_0xf310('0x33')]});});}})(_0x223cda,_0x2eb74a,_0x4b3133);};exports['forgot']=function(_0x3e1cf7,_0x3e3950){if(!_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]){return handleError(_0x3e3950,0x1f4,{'message':_0xf310('0x35')});}var _0x402999=rs[_0xf310('0x36')]();_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]=_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')][_0xf310('0x37')]()[_0xf310('0x38')]();var _0x152c06;return db[_0xf310('0x8')][_0xf310('0xc')]({'where':{'id':0x1},'attributes':[_0xf310('0x9'),_0xf310('0xa')],'raw':!![]})[_0xf310('0xb')](function(_0xc6094a){_0x152c06=_0xc6094a;return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'email':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')]}});})[_0xf310('0xb')](function(_0x3307a4){if(!_0x3307a4){throw new Error(_0xf310('0x3a'));}if(_0x3307a4[_0xf310('0x17')]){throw new Error(_0xf310('0x3b'));}if(_0x3307a4['blocked']){if(moment(_0x3307a4[_0xf310('0x10')])[_0xf310('0x18')](_0x152c06[_0xf310('0xa')],_0xf310('0x19'))>moment()){throw new Error(_0xf310('0x3c'));}else{_0x3307a4[_0xf310('0xf')]=![];_0x3307a4[_0xf310('0x10')]=null;}}_0x3307a4['resetPasswordToken']=_0x402999;_0x3307a4['resetPasswordExpires']=Date[_0xf310('0x3d')]()+0x36ee80;return _0x3307a4[_0xf310('0x3e')]();})[_0xf310('0xb')](function(){return sendServiceMail({'to':_0x3e1cf7[_0xf310('0x34')][_0xf310('0x26')],'subject':_0xf310('0x3f'),'text':_0xf310('0x40')+_0xf310('0x41')+_0xf310('0x42')+_0x3e1cf7[_0xf310('0x43')][_0xf310('0x44')]+'/reset/'+_0x402999+'\x0a\x0a'+_0xf310('0x45')});})['then'](function(){_0x3e3950[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x46')});})[_0xf310('0x1c')](function(_0x31aead){return handleError(_0x3e3950,0x1f4,_0x31aead);});};exports['reset']=function(_0x24ac9a,_0x5ad28f){return db[_0xf310('0x39')][_0xf310('0x1e')]({'where':{'resetPasswordToken':_0x24ac9a[_0xf310('0x47')][_0xf310('0x48')],'resetPasswordExpires':{'$gt':Date[_0xf310('0x3d')]()}}})[_0xf310('0xb')](function(_0xb10fc7){if(!_0xb10fc7){throw new Error(_0xf310('0x49'));}return db[_0xf310('0x8')]['findOne']({'attributes':['id','securePassword',_0xf310('0x4a'),_0xf310('0x4b')]})[_0xf310('0xb')](function(_0x170f3e){if(_0x170f3e[_0xf310('0x4c')])authService[_0xf310('0x4d')](_0x24ac9a['body'][_0xf310('0xd')]);if(!_0x170f3e[_0xf310('0x4a')]||!_0xb10fc7['previousPasswords'])return _0xb10fc7;authService[_0xf310('0x4e')](_0x24ac9a[_0xf310('0x34')][_0xf310('0xd')],_0xb10fc7['previousPasswords'],_0x170f3e[_0xf310('0x4b')]);return _0xb10fc7;})['then'](function(){_0xb10fc7[_0xf310('0xd')]=_0x24ac9a['body'][_0xf310('0xd')];_0xb10fc7[_0xf310('0x4f')]=null;_0xb10fc7[_0xf310('0x50')]=null;return _0xb10fc7[_0xf310('0x3e')]();});})[_0xf310('0xb')](function(){_0x5ad28f[_0xf310('0x2d')](0xc8)[_0xf310('0x2e')]({'message':_0xf310('0x51')});})[_0xf310('0x1c')](function(_0x4ddc4c){return handleError(_0x5ad28f,0x1f4,_0x4ddc4c);});};passport['use'](_0xf310('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0xf310('0xd')},function(_0x324b6b,_0x4ae829,_0x154be5){return localAuthenticate(db[_0xf310('0x39')],_0x324b6b,_0x4ae829,_0x154be5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 514064e..8d0126c 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 _0x1cb4=['post','login','/forgot','forgot','/reset/:token','express','Router'];(function(_0x347ae8,_0x55e717){var _0x109fb6=function(_0x4657fc){while(--_0x4657fc){_0x347ae8['push'](_0x347ae8['shift']());}};_0x109fb6(++_0x55e717);}(_0x1cb4,0x18d));var _0x41cb=function(_0x774780,_0x3012aa){_0x774780=_0x774780-0x0;var _0x596b9a=_0x1cb4[_0x774780];return _0x596b9a;};'use strict';var express=require(_0x41cb('0x0'));var router=express[_0x41cb('0x1')]();var controller=require('./authLocal.controller');router[_0x41cb('0x2')]('/',controller[_0x41cb('0x3')]);router[_0x41cb('0x2')](_0x41cb('0x4'),controller[_0x41cb('0x5')]);router['post'](_0x41cb('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0xf8f5=['exports','Router','./authLocal.controller','login','post','reset'];(function(_0x59591b,_0x354045){var _0x576642=function(_0x12d1ce){while(--_0x12d1ce){_0x59591b['push'](_0x59591b['shift']());}};_0x576642(++_0x354045);}(_0xf8f5,0x13f));var _0x5f8f=function(_0x1e80f9,_0xa68ab1){_0x1e80f9=_0x1e80f9-0x0;var _0x46f8f5=_0xf8f5[_0x1e80f9];return _0x46f8f5;};'use strict';var express=require('express');var router=express[_0x5f8f('0x0')]();var controller=require(_0x5f8f('0x1'));router['post']('/',controller[_0x5f8f('0x2')]);router[_0x5f8f('0x3')]('/forgot',controller['forgot']);router[_0x5f8f('0x3')]('/reset/:token',controller[_0x5f8f('0x4')]);module[_0x5f8f('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index c261b45..ccba078 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 _0x8fe8=['sequelize','exports','STRING','INTEGER'];(function(_0x21b49a,_0x4a930c){var _0x2e0492=function(_0x4fb37e){while(--_0x4fb37e){_0x21b49a['push'](_0x21b49a['shift']());}};_0x2e0492(++_0x4a930c);}(_0x8fe8,0x100));var _0x88fe=function(_0x67d9d7,_0x49b147){_0x67d9d7=_0x67d9d7-0x0;var _0x2a7c7f=_0x8fe8[_0x67d9d7];return _0x2a7c7f;};'use strict';var Sequelize=require(_0x88fe('0x0'));module[_0x88fe('0x1')]={'name':{'type':Sequelize[_0x88fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x88fe('0x2')]},'description':{'type':Sequelize[_0x88fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x88fe('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3511=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x3511,0x1c2));var _0x1351=function(_0x5ecac1,_0x2d7338){_0x5ecac1=_0x5ecac1-0x0;var _0x1fe487=_0x3511[_0x5ecac1];return _0x1fe487;};'use strict';var Sequelize=require(_0x1351('0x0'));module[_0x1351('0x1')]={'name':{'type':Sequelize[_0x1351('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1351('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1351('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 44b1326..2239a5a 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 _0x7943=['Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','Condition','addConditions','ids','omit','getConditions','findOne','merge','addActions','Action','find','getActions','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7943,0x7e));var _0x3794=function(_0x831dc4,_0x1877c9){_0x831dc4=_0x831dc4-0x0;var _0x4087eb=_0x7943[_0x831dc4];return _0x4087eb;};'use strict';var emlformat=require(_0x3794('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3794('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3794('0x3'));var util=require('util');var path=require(_0x3794('0x4'));var sox=require(_0x3794('0x5'));var csv=require(_0x3794('0x6'));var ejs=require(_0x3794('0x7'));var fs=require('fs');var fs_extra=require(_0x3794('0x8'));var _=require(_0x3794('0x9'));var squel=require(_0x3794('0xa'));var crypto=require(_0x3794('0xb'));var jsforce=require(_0x3794('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3794('0x6'));var querystring=require(_0x3794('0xd'));var Papa=require(_0x3794('0xe'));var Redis=require(_0x3794('0xf'));var authService=require(_0x3794('0x10'));var qs=require(_0x3794('0x11'));var as=require(_0x3794('0x12'));var hardwareService=require(_0x3794('0x13'));var logger=require('../../config/logger')(_0x3794('0x14'));var utils=require(_0x3794('0x15'));var config=require(_0x3794('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3794('0x17'))['db'];function respondWithStatusCode(_0x22b5e5,_0x5e0a2d){_0x5e0a2d=_0x5e0a2d||0xcc;return function(_0x15dbbd){if(_0x15dbbd){return _0x22b5e5['sendStatus'](_0x5e0a2d);}return _0x22b5e5[_0x3794('0x18')](_0x5e0a2d)[_0x3794('0x19')]();};}function respondWithResult(_0x115f2c,_0xa08c4d){_0xa08c4d=_0xa08c4d||0xc8;return function(_0x1e1b64){if(_0x1e1b64){return _0x115f2c[_0x3794('0x18')](_0xa08c4d)['json'](_0x1e1b64);}};}function respondWithFilteredResult(_0x3e6f44,_0x27dcdf){return function(_0xa81d2a){if(_0xa81d2a){var _0x15a95d=typeof _0x27dcdf[_0x3794('0x1a')]==='undefined'&&typeof _0x27dcdf[_0x3794('0x1b')]===_0x3794('0x1c');var _0x315758=_0xa81d2a[_0x3794('0x1d')];var _0x1ecb34=_0x15a95d?0x0:_0x27dcdf[_0x3794('0x1a')];var _0x577fbe=_0x15a95d?_0xa81d2a[_0x3794('0x1d')]:_0x27dcdf[_0x3794('0x1a')]+_0x27dcdf[_0x3794('0x1b')];var _0x5499c2;if(_0x577fbe>=_0x315758){_0x577fbe=_0x315758;_0x5499c2=0xc8;}else{_0x5499c2=0xce;}_0x3e6f44[_0x3794('0x18')](_0x5499c2);return _0x3e6f44['set'](_0x3794('0x1e'),_0x1ecb34+'-'+_0x577fbe+'/'+_0x315758)[_0x3794('0x1f')](_0xa81d2a);}return null;};}function patchUpdates(_0x4453c1){return function(_0x130f4f){try{jsonpatch['apply'](_0x130f4f,_0x4453c1,!![]);}catch(_0x234a03){return BPromise['reject'](_0x234a03);}return _0x130f4f[_0x3794('0x20')]();};}function saveUpdates(_0x2e6b67,_0x16b26e){return function(_0x58a970){if(_0x58a970){return _0x58a970[_0x3794('0x21')](_0x2e6b67)[_0x3794('0x22')](function(_0x3f60c9){return _0x3f60c9;});}return null;};}function removeEntity(_0x49dc47,_0x2497eb){return function(_0x42f162){if(_0x42f162){return _0x42f162[_0x3794('0x23')]()['then'](function(){_0x49dc47[_0x3794('0x18')](0xcc)[_0x3794('0x19')]();});}};}function handleEntityNotFound(_0x5ee5f0,_0x2bdc0a){return function(_0x56b3dc){if(!_0x56b3dc){_0x5ee5f0[_0x3794('0x24')](0x194);}return _0x56b3dc;};}function handleError(_0x5eddd5,_0xdbe130){_0xdbe130=_0xdbe130||0x1f4;return function(_0x285eb9){logger[_0x3794('0x25')](_0x285eb9[_0x3794('0x26')]);if(_0x285eb9[_0x3794('0x27')]){delete _0x285eb9[_0x3794('0x27')];}_0x5eddd5[_0x3794('0x18')](_0xdbe130)[_0x3794('0x28')](_0x285eb9);};}exports[_0x3794('0x29')]=function(_0x44fe69,_0x2045f5){var _0x3a3c8a={},_0x5a3e70={},_0x434dc3={'count':0x0,'rows':[]};var _0x1025a0=_['map'](db[_0x3794('0x2a')][_0x3794('0x2b')],function(_0x180f9f){return{'name':_0x180f9f[_0x3794('0x2c')],'type':_0x180f9f[_0x3794('0x2d')][_0x3794('0x2e')]};});_0x5a3e70['model']=_[_0x3794('0x2f')](_0x1025a0,_0x3794('0x27'));_0x5a3e70[_0x3794('0x30')]=_[_0x3794('0x31')](_0x44fe69[_0x3794('0x30')]);_0x5a3e70[_0x3794('0x32')]=_[_0x3794('0x33')](_0x5a3e70['model'],_0x5a3e70[_0x3794('0x30')]);_0x3a3c8a['attributes']=_[_0x3794('0x33')](_0x5a3e70[_0x3794('0x34')],qs[_0x3794('0x35')](_0x44fe69[_0x3794('0x30')]['fields']));_0x3a3c8a[_0x3794('0x36')]=_0x3a3c8a[_0x3794('0x36')][_0x3794('0x37')]?_0x3a3c8a['attributes']:_0x5a3e70[_0x3794('0x34')];if(!_0x44fe69[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x3a3c8a[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x1b')]);_0x3a3c8a[_0x3794('0x1a')]=qs['offset'](_0x44fe69[_0x3794('0x30')][_0x3794('0x1a')]);}_0x3a3c8a[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x3b')]);_0x3a3c8a[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x44fe69[_0x3794('0x30')],_0x5a3e70['filters']),_0x1025a0);if(_0x44fe69[_0x3794('0x30')][_0x3794('0x3e')]){_0x3a3c8a['where']=_['merge'](_0x3a3c8a[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1025a0,function(_0x5209c1){if(_0x5209c1[_0x3794('0x2d')]!=='VIRTUAL'){var _0x44414f={};_0x44414f[_0x5209c1[_0x3794('0x27')]]={'$like':'%'+_0x44fe69['query'][_0x3794('0x3e')]+'%'};return _0x44414f;}})});}_0x3a3c8a=_['merge']({},_0x3a3c8a,_0x44fe69[_0x3794('0x3f')]);var _0x301e21={'where':_0x3a3c8a[_0x3794('0x3c')]};return db[_0x3794('0x2a')][_0x3794('0x1d')](_0x301e21)[_0x3794('0x22')](function(_0x4f3808){_0x434dc3[_0x3794('0x1d')]=_0x4f3808;if(_0x44fe69[_0x3794('0x30')]['includeAll']){_0x3a3c8a[_0x3794('0x40')]=[{'all':!![]}];}return db[_0x3794('0x2a')][_0x3794('0x41')](_0x3a3c8a);})[_0x3794('0x22')](function(_0x188785){_0x434dc3[_0x3794('0x42')]=_0x188785;return _0x434dc3;})[_0x3794('0x22')](respondWithFilteredResult(_0x2045f5,_0x3a3c8a))['catch'](handleError(_0x2045f5,null));};exports[_0x3794('0x43')]=function(_0x3b2237,_0x357d97){var _0x36f023={'raw':![],'where':{'id':_0x3b2237[_0x3794('0x44')]['id']}},_0x30cdda={};_0x30cdda[_0x3794('0x34')]=_[_0x3794('0x31')](db['Automation'][_0x3794('0x2b')]);_0x30cdda[_0x3794('0x30')]=_['keys'](_0x3b2237[_0x3794('0x30')]);_0x30cdda['filters']=_[_0x3794('0x33')](_0x30cdda[_0x3794('0x34')],_0x30cdda['query']);_0x36f023['attributes']=_['intersection'](_0x30cdda[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3b2237[_0x3794('0x30')]['fields']));_0x36f023[_0x3794('0x36')]=_0x36f023[_0x3794('0x36')]['length']?_0x36f023[_0x3794('0x36')]:_0x30cdda[_0x3794('0x34')];if(_0x3b2237['query'][_0x3794('0x45')]){_0x36f023[_0x3794('0x40')]=[{'all':!![]}];}_0x36f023=_['merge']({},_0x36f023,_0x3b2237[_0x3794('0x3f')]);return db[_0x3794('0x2a')]['find'](_0x36f023)[_0x3794('0x22')](handleEntityNotFound(_0x357d97,null))[_0x3794('0x22')](respondWithResult(_0x357d97,null))[_0x3794('0x46')](handleError(_0x357d97,null));};exports[_0x3794('0x47')]=function(_0x454149,_0x479fb1){return db['Automation'][_0x3794('0x47')](_0x454149[_0x3794('0x48')],{})[_0x3794('0x22')](respondWithResult(_0x479fb1,0xc9))[_0x3794('0x46')](handleError(_0x479fb1,null));};exports[_0x3794('0x21')]=function(_0x4f1dd5,_0x2a3a70){if(_0x4f1dd5['body']['id']){delete _0x4f1dd5[_0x3794('0x48')]['id'];}return db[_0x3794('0x2a')]['find']({'where':{'id':_0x4f1dd5[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x2a3a70,null))[_0x3794('0x22')](saveUpdates(_0x4f1dd5['body'],null))['then'](respondWithResult(_0x2a3a70,null))[_0x3794('0x46')](handleError(_0x2a3a70,null));};exports[_0x3794('0x23')]=function(_0x453b42,_0x22f277){return db['Automation']['find']({'where':{'id':_0x453b42[_0x3794('0x44')]['id']}})['then'](handleEntityNotFound(_0x22f277,null))[_0x3794('0x22')](removeEntity(_0x22f277,null))[_0x3794('0x46')](handleError(_0x22f277,null));};exports['addConditions']=function(_0x57d1dd,_0x10a779,_0x1fcf7e){return db[_0x3794('0x49')]['find']({'where':{'id':_0x57d1dd['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x10a779,null))[_0x3794('0x22')](function(_0x1f2d79){if(_0x1f2d79){return _0x1f2d79[_0x3794('0x4a')](_0x57d1dd[_0x3794('0x48')][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x57d1dd[_0x3794('0x48')],[_0x3794('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x10a779,null))['catch'](handleError(_0x10a779,null));};exports[_0x3794('0x4d')]=function(_0x541ceb,_0x4f0b1b,_0x499208){var _0x1567b8={};var _0x30ea87={};var _0x1aed29;var _0x3ac82d;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x541ceb['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x4f0b1b,null))[_0x3794('0x22')](function(_0x6ca493){if(_0x6ca493){_0x1aed29=_0x6ca493;_0x30ea87[_0x3794('0x34')]=_[_0x3794('0x31')](db['Condition'][_0x3794('0x2b')]);_0x30ea87['query']=_[_0x3794('0x31')](_0x541ceb[_0x3794('0x30')]);_0x30ea87['filters']=_['intersection'](_0x30ea87[_0x3794('0x34')],_0x30ea87[_0x3794('0x30')]);_0x1567b8[_0x3794('0x36')]=_[_0x3794('0x33')](_0x30ea87[_0x3794('0x34')],qs[_0x3794('0x35')](_0x541ceb['query'][_0x3794('0x35')]));_0x1567b8['attributes']=_0x1567b8[_0x3794('0x36')][_0x3794('0x37')]?_0x1567b8[_0x3794('0x36')]:_0x30ea87[_0x3794('0x34')];_0x1567b8[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x3b')]);_0x1567b8[_0x3794('0x3c')]=qs[_0x3794('0x32')](_['pick'](_0x541ceb['query'],_0x30ea87[_0x3794('0x32')]));if(_0x541ceb[_0x3794('0x30')][_0x3794('0x3e')]){_0x1567b8['where']=_[_0x3794('0x4f')](_0x1567b8[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1567b8[_0x3794('0x36')],function(_0x5d9fac){var _0x1a129e={};_0x1a129e[_0x5d9fac]={'$like':'%'+_0x541ceb['query'][_0x3794('0x3e')]+'%'};return _0x1a129e;})});}_0x1567b8=_[_0x3794('0x4f')]({},_0x1567b8,_0x541ceb[_0x3794('0x3f')]);return _0x1aed29[_0x3794('0x4d')](_0x1567b8);}})[_0x3794('0x22')](function(_0x43a89e){if(_0x43a89e){_0x3ac82d=_0x43a89e['length'];if(!_0x541ceb[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x1567b8[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1b')]);_0x1567b8['offset']=qs[_0x3794('0x1a')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x1aed29['getConditions'](_0x1567b8);}})[_0x3794('0x22')](function(_0xb0bb53){if(_0xb0bb53){return _0xb0bb53?{'count':_0x3ac82d,'rows':_0xb0bb53}:null;}})['then'](respondWithResult(_0x4f0b1b,null))[_0x3794('0x46')](handleError(_0x4f0b1b,null));};exports[_0x3794('0x50')]=function(_0x6b7f9c,_0x3c6579,_0x54f51e){return db[_0x3794('0x51')][_0x3794('0x52')]({'where':{'id':_0x6b7f9c[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3c6579,null))[_0x3794('0x22')](function(_0x2a9144){if(_0x2a9144){return _0x2a9144[_0x3794('0x50')](_0x6b7f9c['body'][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x6b7f9c[_0x3794('0x48')],['ids','id'])||{});}})[_0x3794('0x22')](respondWithResult(_0x3c6579,null))[_0x3794('0x46')](handleError(_0x3c6579,null));};exports[_0x3794('0x53')]=function(_0x3a1fac,_0x3f0393,_0x272886){var _0x544618={};var _0xa68b2={};var _0x2ee4de;var _0x48a57a;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x3a1fac[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3f0393,null))[_0x3794('0x22')](function(_0x123dde){if(_0x123dde){_0x2ee4de=_0x123dde;_0xa68b2[_0x3794('0x34')]=_[_0x3794('0x31')](db[_0x3794('0x51')][_0x3794('0x2b')]);_0xa68b2[_0x3794('0x30')]=_[_0x3794('0x31')](_0x3a1fac[_0x3794('0x30')]);_0xa68b2[_0x3794('0x32')]=_['intersection'](_0xa68b2['model'],_0xa68b2['query']);_0x544618[_0x3794('0x36')]=_['intersection'](_0xa68b2[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3a1fac['query'][_0x3794('0x35')]));_0x544618[_0x3794('0x36')]=_0x544618[_0x3794('0x36')][_0x3794('0x37')]?_0x544618[_0x3794('0x36')]:_0xa68b2[_0x3794('0x34')];_0x544618[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x3b')]);_0x544618[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x3a1fac[_0x3794('0x30')],_0xa68b2[_0x3794('0x32')]));if(_0x3a1fac[_0x3794('0x30')]['filter']){_0x544618[_0x3794('0x3c')]=_[_0x3794('0x4f')](_0x544618[_0x3794('0x3c')],{'$or':_['map'](_0x544618[_0x3794('0x36')],function(_0x4c5042){var _0x3d902d={};_0x3d902d[_0x4c5042]={'$like':'%'+_0x3a1fac[_0x3794('0x30')][_0x3794('0x3e')]+'%'};return _0x3d902d;})});}_0x544618=_[_0x3794('0x4f')]({},_0x544618,_0x3a1fac[_0x3794('0x3f')]);return _0x2ee4de[_0x3794('0x53')](_0x544618);}})[_0x3794('0x22')](function(_0x5b1a54){if(_0x5b1a54){_0x48a57a=_0x5b1a54[_0x3794('0x37')];if(!_0x3a1fac[_0x3794('0x30')]['hasOwnProperty']('nolimit')){_0x544618[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1b')]);_0x544618[_0x3794('0x1a')]=qs['offset'](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x2ee4de['getActions'](_0x544618);}})[_0x3794('0x22')](function(_0x5035cf){if(_0x5035cf){return _0x5035cf?{'count':_0x48a57a,'rows':_0x5035cf}:null;}})['then'](respondWithResult(_0x3f0393,null))[_0x3794('0x46')](handleError(_0x3f0393,null));};
\ No newline at end of file
+var _0x08ff=['name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','findAll','catch','length','find','create','body','params','destroy','Condition','addConditions','ids','omit','getConditions','filter','addActions','getActions','findOne','Action','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','reject','save','update','then','error','stack','send','index','map','Automation','rawAttributes','fieldName','key','model'];(function(_0x5177c4,_0x1a76ab){var _0x6be752=function(_0x2269a3){while(--_0x2269a3){_0x5177c4['push'](_0x5177c4['shift']());}};_0x6be752(++_0x1a76ab);}(_0x08ff,0xbc));var _0xf08f=function(_0x23f5f6,_0x3950b2){_0x23f5f6=_0x23f5f6-0x0;var _0x686cbd=_0x08ff[_0x23f5f6];return _0x686cbd;};'use strict';var emlformat=require(_0xf08f('0x0'));var rimraf=require(_0xf08f('0x1'));var zipdir=require(_0xf08f('0x2'));var jsonpatch=require(_0xf08f('0x3'));var rp=require(_0xf08f('0x4'));var moment=require('moment');var BPromise=require(_0xf08f('0x5'));var Mustache=require(_0xf08f('0x6'));var util=require(_0xf08f('0x7'));var path=require(_0xf08f('0x8'));var sox=require(_0xf08f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf08f('0xa'));var _=require(_0xf08f('0xb'));var squel=require(_0xf08f('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf08f('0xe'));var querystring=require(_0xf08f('0xf'));var Papa=require(_0xf08f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf08f('0x11'));var as=require(_0xf08f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf08f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf08f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08f('0x15'))['db'];function respondWithStatusCode(_0x17c011,_0x382e72){_0x382e72=_0x382e72||0xcc;return function(_0x6827d6){if(_0x6827d6){return _0x17c011[_0xf08f('0x16')](_0x382e72);}return _0x17c011[_0xf08f('0x17')](_0x382e72)[_0xf08f('0x18')]();};}function respondWithResult(_0x526131,_0x3c1151){_0x3c1151=_0x3c1151||0xc8;return function(_0x3768f0){if(_0x3768f0){return _0x526131[_0xf08f('0x17')](_0x3c1151)[_0xf08f('0x19')](_0x3768f0);}};}function respondWithFilteredResult(_0x949955,_0x3d37bc){return function(_0x4995f2){if(_0x4995f2){var _0xca2cb0=typeof _0x3d37bc[_0xf08f('0x1a')]==='undefined'&&typeof _0x3d37bc[_0xf08f('0x1b')]==='undefined';var _0x403ec2=_0x4995f2['count'];var _0x20acb4=_0xca2cb0?0x0:_0x3d37bc[_0xf08f('0x1a')];var _0x4480ff=_0xca2cb0?_0x4995f2[_0xf08f('0x1c')]:_0x3d37bc[_0xf08f('0x1a')]+_0x3d37bc[_0xf08f('0x1b')];var _0x17044a;if(_0x4480ff>=_0x403ec2){_0x4480ff=_0x403ec2;_0x17044a=0xc8;}else{_0x17044a=0xce;}_0x949955['status'](_0x17044a);return _0x949955['set']('Content-Range',_0x20acb4+'-'+_0x4480ff+'/'+_0x403ec2)[_0xf08f('0x19')](_0x4995f2);}return null;};}function patchUpdates(_0x400748){return function(_0x1e9046){try{jsonpatch['apply'](_0x1e9046,_0x400748,!![]);}catch(_0x180ff2){return BPromise[_0xf08f('0x1d')](_0x180ff2);}return _0x1e9046[_0xf08f('0x1e')]();};}function saveUpdates(_0x1d87cc,_0x39bd6e){return function(_0xd2c69c){if(_0xd2c69c){return _0xd2c69c[_0xf08f('0x1f')](_0x1d87cc)[_0xf08f('0x20')](function(_0x1fcbb7){return _0x1fcbb7;});}return null;};}function removeEntity(_0x5d36cc,_0x42d1f9){return function(_0x2d2b6a){if(_0x2d2b6a){return _0x2d2b6a['destroy']()[_0xf08f('0x20')](function(){_0x5d36cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d6db2,_0x24bc3e){return function(_0x3b9c9d){if(!_0x3b9c9d){_0x1d6db2[_0xf08f('0x16')](0x194);}return _0x3b9c9d;};}function handleError(_0x1e00a0,_0x5ba820){_0x5ba820=_0x5ba820||0x1f4;return function(_0x4eaef4){logger[_0xf08f('0x21')](_0x4eaef4[_0xf08f('0x22')]);if(_0x4eaef4['name']){delete _0x4eaef4['name'];}_0x1e00a0['status'](_0x5ba820)[_0xf08f('0x23')](_0x4eaef4);};}exports[_0xf08f('0x24')]=function(_0xff880f,_0x151aa5){var _0x516f26={},_0xba1c49={},_0x2313d5={'count':0x0,'rows':[]};var _0x2fb007=_[_0xf08f('0x25')](db[_0xf08f('0x26')][_0xf08f('0x27')],function(_0x5678fe){return{'name':_0x5678fe[_0xf08f('0x28')],'type':_0x5678fe['type'][_0xf08f('0x29')]};});_0xba1c49[_0xf08f('0x2a')]=_[_0xf08f('0x25')](_0x2fb007,_0xf08f('0x2b'));_0xba1c49[_0xf08f('0x2c')]=_[_0xf08f('0x2d')](_0xff880f['query']);_0xba1c49[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0xba1c49[_0xf08f('0x2a')],_0xba1c49[_0xf08f('0x2c')]);_0x516f26[_0xf08f('0x30')]=_['intersection'](_0xba1c49[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x31')]));_0x516f26[_0xf08f('0x30')]=_0x516f26[_0xf08f('0x30')]['length']?_0x516f26[_0xf08f('0x30')]:_0xba1c49['model'];if(!_0xff880f['query'][_0xf08f('0x32')](_0xf08f('0x33'))){_0x516f26['limit']=qs[_0xf08f('0x1b')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x516f26[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0xff880f[_0xf08f('0x2c')]['offset']);}_0x516f26[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0xff880f[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x516f26[_0xf08f('0x36')]=qs['filters'](_['pick'](_0xff880f[_0xf08f('0x2c')],_0xba1c49['filters']),_0x2fb007);if(_0xff880f[_0xf08f('0x2c')]['filter']){_0x516f26[_0xf08f('0x36')]=_['merge'](_0x516f26['where'],{'$or':_[_0xf08f('0x25')](_0x2fb007,function(_0x40a929){if(_0x40a929['type']!=='VIRTUAL'){var _0x3f6ae0={};_0x3f6ae0[_0x40a929[_0xf08f('0x2b')]]={'$like':'%'+_0xff880f[_0xf08f('0x2c')]['filter']+'%'};return _0x3f6ae0;}})});}_0x516f26=_[_0xf08f('0x37')]({},_0x516f26,_0xff880f[_0xf08f('0x38')]);var _0x26863b={'where':_0x516f26[_0xf08f('0x36')]};return db[_0xf08f('0x26')]['count'](_0x26863b)[_0xf08f('0x20')](function(_0x562704){_0x2313d5[_0xf08f('0x1c')]=_0x562704;if(_0xff880f[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x516f26['include']=[{'all':!![]}];}return db[_0xf08f('0x26')][_0xf08f('0x3a')](_0x516f26);})[_0xf08f('0x20')](function(_0x566ad6){_0x2313d5['rows']=_0x566ad6;return _0x2313d5;})['then'](respondWithFilteredResult(_0x151aa5,_0x516f26))[_0xf08f('0x3b')](handleError(_0x151aa5,null));};exports['show']=function(_0x379140,_0x17bce3){var _0x38f5c1={'raw':![],'where':{'id':_0x379140['params']['id']}},_0xc12883={};_0xc12883[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x26')][_0xf08f('0x27')]);_0xc12883['query']=_[_0xf08f('0x2d')](_0x379140[_0xf08f('0x2c')]);_0xc12883['filters']=_[_0xf08f('0x2f')](_0xc12883[_0xf08f('0x2a')],_0xc12883['query']);_0x38f5c1[_0xf08f('0x30')]=_['intersection'](_0xc12883[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x379140[_0xf08f('0x2c')]['fields']));_0x38f5c1[_0xf08f('0x30')]=_0x38f5c1[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x38f5c1[_0xf08f('0x30')]:_0xc12883[_0xf08f('0x2a')];if(_0x379140[_0xf08f('0x2c')][_0xf08f('0x39')]){_0x38f5c1['include']=[{'all':!![]}];}_0x38f5c1=_[_0xf08f('0x37')]({},_0x38f5c1,_0x379140[_0xf08f('0x38')]);return db[_0xf08f('0x26')][_0xf08f('0x3d')](_0x38f5c1)[_0xf08f('0x20')](handleEntityNotFound(_0x17bce3,null))[_0xf08f('0x20')](respondWithResult(_0x17bce3,null))[_0xf08f('0x3b')](handleError(_0x17bce3,null));};exports[_0xf08f('0x3e')]=function(_0x224944,_0x380b9b){return db[_0xf08f('0x26')][_0xf08f('0x3e')](_0x224944[_0xf08f('0x3f')],{})[_0xf08f('0x20')](respondWithResult(_0x380b9b,0xc9))[_0xf08f('0x3b')](handleError(_0x380b9b,null));};exports[_0xf08f('0x1f')]=function(_0xb8e17d,_0x2b9052){if(_0xb8e17d[_0xf08f('0x3f')]['id']){delete _0xb8e17d[_0xf08f('0x3f')]['id'];}return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0xb8e17d[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x2b9052,null))[_0xf08f('0x20')](saveUpdates(_0xb8e17d[_0xf08f('0x3f')],null))[_0xf08f('0x20')](respondWithResult(_0x2b9052,null))[_0xf08f('0x3b')](handleError(_0x2b9052,null));};exports[_0xf08f('0x41')]=function(_0x20c80f,_0xb1f6c2){return db['Automation'][_0xf08f('0x3d')]({'where':{'id':_0x20c80f[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0xb1f6c2,null))[_0xf08f('0x20')](removeEntity(_0xb1f6c2,null))['catch'](handleError(_0xb1f6c2,null));};exports['addConditions']=function(_0x2cbe89,_0x192dd7,_0x52119b){return db[_0xf08f('0x42')][_0xf08f('0x3d')]({'where':{'id':_0x2cbe89[_0xf08f('0x40')]['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x192dd7,null))['then'](function(_0x7a47fe){if(_0x7a47fe){return _0x7a47fe[_0xf08f('0x43')](_0x2cbe89['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0x2cbe89[_0xf08f('0x3f')],[_0xf08f('0x44'),'id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x192dd7,null))['catch'](handleError(_0x192dd7,null));};exports[_0xf08f('0x46')]=function(_0x1c35c8,_0x28aeae,_0x3542a9){var _0x382317={};var _0x26ec05={};var _0x342df1;var _0x40914a;return db[_0xf08f('0x26')]['findOne']({'where':{'id':_0x1c35c8[_0xf08f('0x40')]['id']}})['then'](handleEntityNotFound(_0x28aeae,null))[_0xf08f('0x20')](function(_0x4121f8){if(_0x4121f8){_0x342df1=_0x4121f8;_0x26ec05[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x42')][_0xf08f('0x27')]);_0x26ec05['query']=_[_0xf08f('0x2d')](_0x1c35c8[_0xf08f('0x2c')]);_0x26ec05[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x26ec05['model'],_0x26ec05[_0xf08f('0x2c')]);_0x382317[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x26ec05[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x1c35c8['query'][_0xf08f('0x31')]));_0x382317[_0xf08f('0x30')]=_0x382317[_0xf08f('0x30')][_0xf08f('0x3c')]?_0x382317['attributes']:_0x26ec05[_0xf08f('0x2a')];_0x382317[_0xf08f('0x34')]=qs[_0xf08f('0x35')](_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x35')]);_0x382317[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_['pick'](_0x1c35c8[_0xf08f('0x2c')],_0x26ec05[_0xf08f('0x2e')]));if(_0x1c35c8['query'][_0xf08f('0x47')]){_0x382317['where']=_['merge'](_0x382317['where'],{'$or':_[_0xf08f('0x25')](_0x382317[_0xf08f('0x30')],function(_0x470ceb){var _0x13151c={};_0x13151c[_0x470ceb]={'$like':'%'+_0x1c35c8[_0xf08f('0x2c')][_0xf08f('0x47')]+'%'};return _0x13151c;})});}_0x382317=_[_0xf08f('0x37')]({},_0x382317,_0x1c35c8[_0xf08f('0x38')]);return _0x342df1[_0xf08f('0x46')](_0x382317);}})[_0xf08f('0x20')](function(_0x1aa1fb){if(_0x1aa1fb){_0x40914a=_0x1aa1fb['length'];if(!_0x1c35c8[_0xf08f('0x2c')]['hasOwnProperty'](_0xf08f('0x33'))){_0x382317['limit']=qs[_0xf08f('0x1b')](_0x1c35c8['query'][_0xf08f('0x1b')]);_0x382317[_0xf08f('0x1a')]=qs[_0xf08f('0x1a')](_0x1c35c8['query'][_0xf08f('0x1a')]);}return _0x342df1[_0xf08f('0x46')](_0x382317);}})['then'](function(_0x356fd1){if(_0x356fd1){return _0x356fd1?{'count':_0x40914a,'rows':_0x356fd1}:null;}})[_0xf08f('0x20')](respondWithResult(_0x28aeae,null))[_0xf08f('0x3b')](handleError(_0x28aeae,null));};exports['addActions']=function(_0xe69279,_0x437051,_0xf02ee0){return db['Action'][_0xf08f('0x3d')]({'where':{'id':_0xe69279['params']['id']}})[_0xf08f('0x20')](handleEntityNotFound(_0x437051,null))['then'](function(_0x7d2a63){if(_0x7d2a63){return _0x7d2a63[_0xf08f('0x48')](_0xe69279['body'][_0xf08f('0x44')],_[_0xf08f('0x45')](_0xe69279[_0xf08f('0x3f')],['ids','id'])||{});}})[_0xf08f('0x20')](respondWithResult(_0x437051,null))[_0xf08f('0x3b')](handleError(_0x437051,null));};exports[_0xf08f('0x49')]=function(_0x34ac4b,_0x31fafb,_0x44133a){var _0x3b84ac={};var _0x53bbe9={};var _0x3ba856;var _0x15a0e0;return db[_0xf08f('0x26')][_0xf08f('0x4a')]({'where':{'id':_0x34ac4b['params']['id']}})['then'](handleEntityNotFound(_0x31fafb,null))[_0xf08f('0x20')](function(_0x622562){if(_0x622562){_0x3ba856=_0x622562;_0x53bbe9[_0xf08f('0x2a')]=_[_0xf08f('0x2d')](db[_0xf08f('0x4b')]['rawAttributes']);_0x53bbe9['query']=_['keys'](_0x34ac4b[_0xf08f('0x2c')]);_0x53bbe9[_0xf08f('0x2e')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],_0x53bbe9[_0xf08f('0x2c')]);_0x3b84ac[_0xf08f('0x30')]=_[_0xf08f('0x2f')](_0x53bbe9[_0xf08f('0x2a')],qs[_0xf08f('0x31')](_0x34ac4b[_0xf08f('0x2c')]['fields']));_0x3b84ac[_0xf08f('0x30')]=_0x3b84ac['attributes'][_0xf08f('0x3c')]?_0x3b84ac['attributes']:_0x53bbe9[_0xf08f('0x2a')];_0x3b84ac[_0xf08f('0x34')]=qs['sort'](_0x34ac4b[_0xf08f('0x2c')]['sort']);_0x3b84ac[_0xf08f('0x36')]=qs[_0xf08f('0x2e')](_[_0xf08f('0x4c')](_0x34ac4b[_0xf08f('0x2c')],_0x53bbe9[_0xf08f('0x2e')]));if(_0x34ac4b['query'][_0xf08f('0x47')]){_0x3b84ac[_0xf08f('0x36')]=_[_0xf08f('0x37')](_0x3b84ac[_0xf08f('0x36')],{'$or':_[_0xf08f('0x25')](_0x3b84ac['attributes'],function(_0xa12d2d){var _0x1c2b46={};_0x1c2b46[_0xa12d2d]={'$like':'%'+_0x34ac4b['query'][_0xf08f('0x47')]+'%'};return _0x1c2b46;})});}_0x3b84ac=_[_0xf08f('0x37')]({},_0x3b84ac,_0x34ac4b[_0xf08f('0x38')]);return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x317a3f){if(_0x317a3f){_0x15a0e0=_0x317a3f['length'];if(!_0x34ac4b['query'][_0xf08f('0x32')]('nolimit')){_0x3b84ac['limit']=qs[_0xf08f('0x1b')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1b')]);_0x3b84ac['offset']=qs[_0xf08f('0x1a')](_0x34ac4b[_0xf08f('0x2c')][_0xf08f('0x1a')]);}return _0x3ba856[_0xf08f('0x49')](_0x3b84ac);}})[_0xf08f('0x20')](function(_0x25403a){if(_0x25403a){return _0x25403a?{'count':_0x15a0e0,'rows':_0x25403a}:null;}})[_0xf08f('0x20')](respondWithResult(_0x31fafb,null))[_0xf08f('0x3b')](handleError(_0x31fafb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6f41c2b..dc5ebe2 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 _0x938a=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','bluebird'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x938a,0x14d));var _0xa938=function(_0x14a880,_0x53a466){_0x14a880=_0x14a880-0x0;var _0x259843=_0x938a[_0x14a880];return _0x259843;};'use strict';var _=require(_0xa938('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa938('0x1'));var moment=require('moment');var BPromise=require(_0xa938('0x2'));var rp=require(_0xa938('0x3'));var fs=require('fs');var path=require(_0xa938('0x4'));var rimraf=require(_0xa938('0x5'));var config=require(_0xa938('0x6'));var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x133c56,_0x47c77f){return _0x133c56[_0xa938('0x9')](_0xa938('0xa'),attributes,{'tableName':_0xa938('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a11=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations'];(function(_0x260072,_0x163b97){var _0x28380a=function(_0x2aba52){while(--_0x2aba52){_0x260072['push'](_0x260072['shift']());}};_0x28380a(++_0x163b97);}(_0x8a11,0x84));var _0x18a1=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x8a11[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require(_0x18a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x18a1('0x1'));var moment=require(_0x18a1('0x2'));var BPromise=require(_0x18a1('0x3'));var rp=require(_0x18a1('0x4'));var fs=require('fs');var path=require(_0x18a1('0x5'));var rimraf=require(_0x18a1('0x6'));var config=require(_0x18a1('0x7'));var attributes=require(_0x18a1('0x8'));module[_0x18a1('0x9')]=function(_0x58089f,_0x2e0370){return _0x58089f['define']('Automation',attributes,{'tableName':_0x18a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 4704225..5359c5d 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 _0xb8cb=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x3d18cf,_0x285c01){_0x3d18cf=_0x3d18cf-0x0;var _0x47943a=_0xb8cb[_0x3d18cf];return _0x47943a;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});}
\ No newline at end of file
+var _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x349e,0xcb));var _0xe349=function(_0x41da72,_0x224fd6){_0x41da72=_0x41da72-0x0;var _0x36aade=_0x349e[_0x41da72];return _0x36aade;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('Automation,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index ff87047..dcd6f8a 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 _0x5859=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51b8eb,_0x45e664){var _0x219949=function(_0x21d965){while(--_0x21d965){_0x51b8eb['push'](_0x51b8eb['shift']());}};_0x219949(++_0x45e664);}(_0x5859,0xc4));var _0x9585=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5859[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var fs_extra=require(_0x9585('0x6'));var auth=require(_0x9585('0x7'));var interaction=require(_0x9585('0x8'));var config=require(_0x9585('0x9'));var controller=require(_0x9585('0xa'));router[_0x9585('0xb')]('/',auth[_0x9585('0xc')](),controller['index']);router[_0x9585('0xb')](_0x9585('0xd'),auth[_0x9585('0xc')](),controller['show']);router[_0x9585('0xb')](_0x9585('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0x9585('0xb')](_0x9585('0xf'),auth[_0x9585('0xc')](),controller[_0x9585('0x10')]);router['post']('/',auth[_0x9585('0xc')](),controller['create']);router[_0x9585('0x11')](_0x9585('0xe'),auth[_0x9585('0xc')](),controller[_0x9585('0x12')]);router[_0x9585('0x11')](_0x9585('0xf'),auth['isAuthenticated'](),controller[_0x9585('0x13')]);router[_0x9585('0x14')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x15')]);router[_0x9585('0x16')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x17')]);module[_0x9585('0x18')]=router;
\ No newline at end of file
+var _0x7bb8=['isAuthenticated','index','show','get','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','/:id','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller'];(function(_0x2c05d6,_0xf8af3d){var _0xb11f76=function(_0x2b4052){while(--_0x2b4052){_0x2c05d6['push'](_0x2c05d6['shift']());}};_0xb11f76(++_0xf8af3d);}(_0x7bb8,0xe8));var _0x87bb=function(_0x350610,_0x3f4eef){_0x350610=_0x350610-0x0;var _0x3b33c6=_0x7bb8[_0x350610];return _0x3b33c6;};'use strict';var multer=require('multer');var util=require(_0x87bb('0x0'));var path=require(_0x87bb('0x1'));var timeout=require(_0x87bb('0x2'));var express=require(_0x87bb('0x3'));var router=express['Router']();var fs_extra=require(_0x87bb('0x4'));var auth=require(_0x87bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x87bb('0x6'));var controller=require(_0x87bb('0x7'));router['get']('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x9')]);router['get']('/:id',auth[_0x87bb('0x8')](),controller[_0x87bb('0xa')]);router[_0x87bb('0xb')]('/:id/conditions',auth[_0x87bb('0x8')](),controller[_0x87bb('0xc')]);router[_0x87bb('0xb')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0xe')]);router[_0x87bb('0xf')]('/',auth[_0x87bb('0x8')](),controller[_0x87bb('0x10')]);router[_0x87bb('0xf')](_0x87bb('0x11'),auth[_0x87bb('0x8')](),controller['addConditions']);router[_0x87bb('0xf')](_0x87bb('0xd'),auth[_0x87bb('0x8')](),controller[_0x87bb('0x12')]);router[_0x87bb('0x13')](_0x87bb('0x14'),auth['isAuthenticated'](),controller[_0x87bb('0x15')]);router[_0x87bb('0x16')](_0x87bb('0x14'),auth[_0x87bb('0x8')](),controller['destroy']);module[_0x87bb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 2b62823..dfcb05d 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 _0x39bb=['#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\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)'];(function(_0x3754fb,_0x12ff0e){var _0x292964=function(_0x26c8f1){while(--_0x26c8f1){_0x3754fb['push'](_0x3754fb['shift']());}};_0x292964(++_0x12ff0e);}(_0x39bb,0xe7));var _0xb39b=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x39bb[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require('sequelize');module[_0xb39b('0x0')]={'name':{'type':Sequelize[_0xb39b('0x1')],'unique':_0xb39b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x4')),'allowNull':![],'defaultValue':_0xb39b('0x4')},'description':{'type':Sequelize[_0xb39b('0x1')]},'active':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb39b('0x6')](0x4)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb39b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'comment':_0xb39b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb39b('0x10')},'dialTimezone':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':_0xb39b('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x12'),_0xb39b('0x13'),_0xb39b('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':_0xb39b('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb39b('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb39b('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb39b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb39b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x19'),_0xb39b('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1b')},'dialCutDigit':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xa9bf=['UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER'];(function(_0x5c028c,_0x4fbf6d){var _0x9a4301=function(_0x27831a){while(--_0x27831a){_0x5c028c['push'](_0x5c028c['shift']());}};_0x9a4301(++_0x4fbf6d);}(_0xa9bf,0x136));var _0xfa9b=function(_0x51b8e7,_0x5c70fb){_0x51b8e7=_0x51b8e7-0x0;var _0x81fd25=_0xa9bf[_0x51b8e7];return _0x81fd25;};'use strict';var Sequelize=require(_0xfa9b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfa9b('0x1')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':_0xfa9b('0x3')},'limitCalls':{'type':Sequelize[_0xfa9b('0x4')](0x4)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfa9b('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfa9b('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xfa9b('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfa9b('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xfa9b('0xc')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xfa9b('0xd'),_0xfa9b('0xe'),_0xfa9b('0xf')),'defaultValue':_0xfa9b('0xd')},'dialAMDActive':{'type':Sequelize[_0xfa9b('0x2')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfa9b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfa9b('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfa9b('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfa9b('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfa9b('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfa9b('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfa9b('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfa9b('0x4')](0x9)[_0xfa9b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfa9b('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfa9b('0x17')](_0xfa9b('0x18'),'ASC'),'defaultValue':_0xfa9b('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x19')},'dialCutDigit':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfa9b('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)[_0xfa9b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfa9b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfa9b('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfa9b('0x4')](0x5)[_0xfa9b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfa9b('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index f217099..bebed2f 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 _0xe860=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','getHoppers','findOne','pick','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x3306a2,_0x274117){var _0x54f452=function(_0x266cb5){while(--_0x266cb5){_0x3306a2['push'](_0x3306a2['shift']());}};_0x54f452(++_0x274117);}(_0xe860,0x188));var _0x0e86=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0xe860[_0x206510];return _0x87aba;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){var _0x7ad308=_0x185354[_0x0e86('0x25')]({'plain':!![]});var _0x1ae6fe=_0x0e86('0x26');return db[_0x0e86('0x27')][_0x0e86('0x24')]({'where':{'type':_0x1ae6fe,'resourceId':_0x7ad308['id']}})['then'](function(){return _0x185354;});})[_0x0e86('0x23')](function(){_0x432253['status'](0xcc)[_0x0e86('0x28')]();});}};}function handleEntityNotFound(_0x13a187,_0x5b483f){return function(_0x49aea3){if(!_0x49aea3){_0x13a187[_0x0e86('0x16')](0x194);}return _0x49aea3;};}function handleError(_0x580416,_0x405643){_0x405643=_0x405643||0x1f4;return function(_0x1a7f77){logger['error'](_0x1a7f77['stack']);if(_0x1a7f77[_0x0e86('0x29')]){delete _0x1a7f77[_0x0e86('0x29')];}_0x580416[_0x0e86('0x17')](_0x405643)[_0x0e86('0x2a')](_0x1a7f77);};}exports[_0x0e86('0x2b')]=function(_0x53139c,_0x2194fd){var _0x432696={},_0x2351ca={},_0x33ea18={'count':0x0,'rows':[]};var _0x5a81dd=_[_0x0e86('0x2c')](db['Campaign'][_0x0e86('0x2d')],function(_0x244808){return{'name':_0x244808[_0x0e86('0x2e')],'type':_0x244808['type'][_0x0e86('0x2f')]};});_0x2351ca[_0x0e86('0x30')]=_[_0x0e86('0x2c')](_0x5a81dd,_0x0e86('0x29'));_0x2351ca[_0x0e86('0x31')]=_['keys'](_0x53139c[_0x0e86('0x31')]);_0x2351ca[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x2351ca[_0x0e86('0x30')],_0x2351ca['query']);_0x432696[_0x0e86('0x34')]=_['intersection'](_0x2351ca[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x53139c[_0x0e86('0x31')][_0x0e86('0x35')]));_0x432696[_0x0e86('0x34')]=_0x432696[_0x0e86('0x34')][_0x0e86('0x36')]?_0x432696[_0x0e86('0x34')]:_0x2351ca['model'];if(!_0x53139c[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x432696['limit']=qs['limit'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x432696[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x53139c[_0x0e86('0x31')]['offset']);}_0x432696[_0x0e86('0x39')]=qs['sort'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x432696['where']=qs[_0x0e86('0x32')](_['pick'](_0x53139c[_0x0e86('0x31')],_0x2351ca[_0x0e86('0x32')]),_0x5a81dd);if(_0x53139c[_0x0e86('0x31')]['filter']){_0x432696[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x432696[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x5a81dd,function(_0xdd6fdb){if(_0xdd6fdb[_0x0e86('0x3d')]!==_0x0e86('0x3e')){var _0x1d8d42={};_0x1d8d42[_0xdd6fdb[_0x0e86('0x29')]]={'$like':'%'+_0x53139c[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1d8d42;}})});}_0x432696=_['merge']({},_0x432696,_0x53139c[_0x0e86('0x40')]);var _0x382d94={'where':_0x432696[_0x0e86('0x3b')]};return db[_0x0e86('0x41')][_0x0e86('0x1c')](_0x382d94)[_0x0e86('0x23')](function(_0x5fa25f){_0x33ea18['count']=_0x5fa25f;if(_0x53139c[_0x0e86('0x31')][_0x0e86('0x42')]){_0x432696[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x41')]['findAll'](_0x432696);})[_0x0e86('0x23')](function(_0x4b4a2c){_0x33ea18[_0x0e86('0x44')]=_0x4b4a2c;return _0x33ea18;})[_0x0e86('0x23')](respondWithFilteredResult(_0x2194fd,_0x432696))[_0x0e86('0x45')](handleError(_0x2194fd,null));};exports[_0x0e86('0x46')]=function(_0x1bc5cc,_0x46de02){var _0x3e9ec3={'raw':![],'where':{'id':_0x1bc5cc['params']['id']}},_0x261899={};_0x261899[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x261899[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x1bc5cc[_0x0e86('0x31')]);_0x261899[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],_0x261899[_0x0e86('0x31')]);_0x3e9ec3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x35')]));_0x3e9ec3[_0x0e86('0x34')]=_0x3e9ec3[_0x0e86('0x34')][_0x0e86('0x36')]?_0x3e9ec3[_0x0e86('0x34')]:_0x261899[_0x0e86('0x30')];if(_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x42')]){_0x3e9ec3[_0x0e86('0x43')]=[{'all':!![]}];}_0x3e9ec3=_[_0x0e86('0x3c')]({},_0x3e9ec3,_0x1bc5cc[_0x0e86('0x40')]);return db['Campaign'][_0x0e86('0x48')](_0x3e9ec3)['then'](handleEntityNotFound(_0x46de02,null))['then'](respondWithResult(_0x46de02,null))[_0x0e86('0x45')](handleError(_0x46de02,null));};exports[_0x0e86('0x49')]=function(_0x33de57,_0x334cc2){return db['Campaign']['create'](_0x33de57[_0x0e86('0x4a')],{})[_0x0e86('0x23')](function(_0x581add){var _0x3fcf2a=_0x33de57['user'][_0x0e86('0x25')]({'plain':!![]});if(!_0x3fcf2a)throw new Error(_0x0e86('0x4b'));if(_0x3fcf2a[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x53e1b5=_0x581add['get']({'plain':!![]});var _0x119cf1='IvrCampaigns';return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x119cf1,'userProfileId':_0x3fcf2a[_0x0e86('0x4f')]},'raw':!![]})['then'](function(_0x3d792a){if(_0x3d792a&&_0x3d792a[_0x0e86('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x53e1b5[_0x0e86('0x29')],'resourceId':_0x53e1b5['id'],'type':_0x3d792a[_0x0e86('0x29')],'sectionId':_0x3d792a['id']},{})[_0x0e86('0x23')](function(){return _0x581add;});}else{return _0x581add;}})[_0x0e86('0x45')](function(_0x1a33b3){logger['error'](_0x0e86('0x51'),_0x1a33b3);throw _0x1a33b3;});}return _0x581add;})[_0x0e86('0x23')](respondWithResult(_0x334cc2,0xc9))[_0x0e86('0x45')](handleError(_0x334cc2,null));};exports[_0x0e86('0x52')]=function(_0xb80509,_0x42fb33){var _0x9049a3={'where':{'id':_0xb80509[_0x0e86('0x53')]['id']}},_0x5a813b={};_0x5a813b['model']=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x9049a3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x5a813b[_0x0e86('0x30')],qs['fields'](_0xb80509[_0x0e86('0x31')]['fields']));_0x9049a3[_0x0e86('0x34')]=_0x9049a3['attributes']['length']?_0x9049a3['attributes']:_0x5a813b[_0x0e86('0x30')];if(_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]){_0x9049a3[_0x0e86('0x43')]=[{'all':!![]}];}_0x9049a3=_[_0x0e86('0x3c')]({},_0x9049a3,_0xb80509[_0x0e86('0x40')]);return db['Campaign']['find'](_0x9049a3)['then'](handleEntityNotFound(_0x42fb33,null))[_0x0e86('0x23')](function(_0x1e220c){if(_0x1e220c){var _0x373ffc=_0x1e220c[_0x0e86('0x25')]({'plain':!![]});_0x373ffc=qs[_0x0e86('0x54')](_0x373ffc,['id',_0x0e86('0x55'),_0x0e86('0x56')]);_0xb80509[_0x0e86('0x4a')]=_[_0x0e86('0x54')](_0xb80509['body'],['id',_0x0e86('0x55'),_0x0e86('0x56')]);return db[_0x0e86('0x41')]['create'](_[_0x0e86('0x3c')](_0x373ffc,_0xb80509['body']),{'include':_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]?[{'all':!![]}]:undefined})[_0x0e86('0x23')](function(_0x3b3ba2){var _0x370ca6=_0xb80509[_0x0e86('0x4d')][_0x0e86('0x25')]({'plain':!![]});if(!_0x370ca6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ca6[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x3424fa=_0x3b3ba2[_0x0e86('0x25')]({'plain':!![]});var _0x86558c=_0x0e86('0x26');return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x86558c,'userProfileId':_0x370ca6[_0x0e86('0x4f')]},'raw':!![]})[_0x0e86('0x23')](function(_0x3d6b76){if(_0x3d6b76&&_0x3d6b76[_0x0e86('0x50')]===0x0){return db['UserProfileResource'][_0x0e86('0x49')]({'name':_0x3424fa['name'],'resourceId':_0x3424fa['id'],'type':_0x3d6b76[_0x0e86('0x29')],'sectionId':_0x3d6b76['id']},{})[_0x0e86('0x23')](function(){return _0x3b3ba2;});}else{return _0x3b3ba2;}})[_0x0e86('0x45')](function(_0x57ee43){logger[_0x0e86('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57ee43);throw _0x57ee43;});}return _0x3b3ba2;});}})[_0x0e86('0x23')](respondWithResult(_0x42fb33,0xc9))[_0x0e86('0x45')](handleError(_0x42fb33,null));};exports[_0x0e86('0x22')]=function(_0x379a7a,_0x259cc3){if(_0x379a7a[_0x0e86('0x4a')]['id']){delete _0x379a7a[_0x0e86('0x4a')]['id'];}return db['Campaign'][_0x0e86('0x48')]({'where':{'id':_0x379a7a[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x259cc3,null))['then'](saveUpdates(_0x379a7a[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x259cc3,null))[_0x0e86('0x45')](handleError(_0x259cc3,null));};exports[_0x0e86('0x24')]=function(_0x5e3626,_0x269bab){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x5e3626[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x269bab,null))['then'](removeEntity(_0x269bab,null))[_0x0e86('0x45')](handleError(_0x269bab,null));};exports[_0x0e86('0x58')]=function(_0x14a450,_0x2e437e,_0x4b9264){var _0x492c74={'raw':!![],'where':{}};var _0x204ed0={};var _0x2ac63f={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x14a450[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x2e437e,null))[_0x0e86('0x23')](function(_0x2d8d2e){if(_0x2d8d2e){_0x204ed0[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopper'][_0x0e86('0x2d')]);_0x204ed0[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x14a450[_0x0e86('0x31')]);_0x204ed0[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],_0x204ed0['query']);_0x492c74[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],qs['fields'](_0x14a450[_0x0e86('0x31')]['fields']));_0x492c74[_0x0e86('0x34')]=_0x492c74[_0x0e86('0x34')][_0x0e86('0x36')]?_0x492c74[_0x0e86('0x34')]:_0x204ed0['model'];if(!_0x14a450['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x492c74[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x14a450['query'][_0x0e86('0x1b')]);_0x492c74[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x14a450['query'][_0x0e86('0x19')]);}_0x492c74[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x14a450[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x492c74[_0x0e86('0x3b')]=qs['filters'](_[_0x0e86('0x5a')](_0x14a450['query'],_0x204ed0[_0x0e86('0x32')]));_0x492c74[_0x0e86('0x3b')]['CampaignId']=_0x2d8d2e['id'];if(_0x14a450[_0x0e86('0x31')]['filter']){_0x492c74[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x492c74['where'],{'$or':_[_0x0e86('0x2c')](_0x492c74['attributes'],function(_0x5ede91){var _0x4028a6={};_0x4028a6[_0x5ede91]={'$like':'%'+_0x14a450[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x4028a6;})});}_0x492c74=_['merge']({},_0x492c74,_0x14a450['options']);return db[_0x0e86('0x5b')][_0x0e86('0x1c')]({'where':_0x492c74['where']})[_0x0e86('0x23')](function(_0x474b6b){_0x2ac63f['count']=_0x474b6b;if(_0x14a450[_0x0e86('0x31')]['includeAll']){_0x492c74[_0x0e86('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x492c74);})[_0x0e86('0x23')](function(_0xec1890){_0x2ac63f[_0x0e86('0x44')]=_0xec1890;return _0x2ac63f;});}})['then'](respondWithFilteredResult(_0x2e437e,_0x492c74))['catch'](handleError(_0x2e437e,null));};exports[_0x0e86('0x5c')]=function(_0x2b8ecc,_0x1de61f,_0x2a51ee){var _0x595dab={'raw':!![],'where':{}};var _0x575a0c={};var _0x5211d6={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x2b8ecc['params']['id']}})['then'](handleEntityNotFound(_0x1de61f,null))[_0x0e86('0x23')](function(_0x3d52e5){if(_0x3d52e5){_0x575a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperHistory'][_0x0e86('0x2d')]);_0x575a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x2b8ecc[_0x0e86('0x31')]);_0x575a0c['filters']=_[_0x0e86('0x33')](_0x575a0c['model'],_0x575a0c['query']);_0x595dab[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x575a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x2b8ecc[_0x0e86('0x31')]['fields']));_0x595dab[_0x0e86('0x34')]=_0x595dab[_0x0e86('0x34')][_0x0e86('0x36')]?_0x595dab[_0x0e86('0x34')]:_0x575a0c[_0x0e86('0x30')];if(!_0x2b8ecc['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x595dab[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x595dab[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x595dab[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x595dab['where']=qs['filters'](_[_0x0e86('0x5a')](_0x2b8ecc[_0x0e86('0x31')],_0x575a0c[_0x0e86('0x32')]));_0x595dab[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x3d52e5['id'];if(_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x595dab[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x595dab[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x595dab['attributes'],function(_0x4ad45d){var _0x5ad0b3={};_0x5ad0b3[_0x4ad45d]={'$like':'%'+_0x2b8ecc[_0x0e86('0x31')]['filter']+'%'};return _0x5ad0b3;})});}_0x595dab=_[_0x0e86('0x3c')]({},_0x595dab,_0x2b8ecc['options']);return db[_0x0e86('0x5e')][_0x0e86('0x1c')]({'where':_0x595dab[_0x0e86('0x3b')]})['then'](function(_0x3254fb){_0x5211d6['count']=_0x3254fb;if(_0x2b8ecc['query']['includeAll']){_0x595dab['include']=[{'all':!![]}];}return db[_0x0e86('0x5e')][_0x0e86('0x5f')](_0x595dab);})[_0x0e86('0x23')](function(_0x14a189){_0x5211d6[_0x0e86('0x44')]=_0x14a189;return _0x5211d6;});}})['then'](respondWithFilteredResult(_0x1de61f,_0x595dab))['catch'](handleError(_0x1de61f,null));};exports[_0x0e86('0x60')]=function(_0x4bda62,_0x16ac42,_0x4d97f8){var _0x50818b={'raw':!![],'where':{}};var _0x573c6e={};var _0x172100={'count':0x0,'rows':[]};return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x4bda62[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ac42,null))[_0x0e86('0x23')](function(_0x644f28){if(_0x644f28){_0x573c6e['model']=_[_0x0e86('0x47')](db['CmHopperFinal'][_0x0e86('0x2d')]);_0x573c6e[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x4bda62[_0x0e86('0x31')]);_0x573c6e[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x573c6e[_0x0e86('0x30')],_0x573c6e['query']);_0x50818b[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x573c6e['model'],qs[_0x0e86('0x35')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x35')]));_0x50818b[_0x0e86('0x34')]=_0x50818b[_0x0e86('0x34')][_0x0e86('0x36')]?_0x50818b['attributes']:_0x573c6e[_0x0e86('0x30')];if(!_0x4bda62['query']['hasOwnProperty'](_0x0e86('0x38'))){_0x50818b[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x50818b['offset']=qs['offset'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x50818b[_0x0e86('0x39')]=qs['sort'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x50818b[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_['pick'](_0x4bda62[_0x0e86('0x31')],_0x573c6e[_0x0e86('0x32')]));_0x50818b[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x644f28['id'];if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x50818b['where']=_[_0x0e86('0x3c')](_0x50818b['where'],{'$or':_[_0x0e86('0x2c')](_0x50818b[_0x0e86('0x34')],function(_0x1c99f4){var _0x1be099={};_0x1be099[_0x1c99f4]={'$like':'%'+_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1be099;})});}_0x50818b=_[_0x0e86('0x3c')]({},_0x50818b,_0x4bda62[_0x0e86('0x40')]);return db[_0x0e86('0x61')]['count']({'where':_0x50818b['where']})[_0x0e86('0x23')](function(_0x1a3ef2){_0x172100[_0x0e86('0x1c')]=_0x1a3ef2;if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x42')]){_0x50818b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x50818b);})[_0x0e86('0x23')](function(_0x2532f6){_0x172100[_0x0e86('0x44')]=_0x2532f6;return _0x172100;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x16ac42,_0x50818b))['catch'](handleError(_0x16ac42,null));};exports['getHopperBlacks']=function(_0x3e64a8,_0x2cd55f,_0x152961){var _0x2ae260={'raw':!![],'where':{}};var _0x108a0c={};var _0x506230={'count':0x0,'rows':[]};return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x3e64a8['params']['id']}})['then'](handleEntityNotFound(_0x2cd55f,null))[_0x0e86('0x23')](function(_0x68fb2a){if(_0x68fb2a){_0x108a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperBlack'][_0x0e86('0x2d')]);_0x108a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x3e64a8['query']);_0x108a0c['filters']=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],_0x108a0c[_0x0e86('0x31')]);_0x2ae260[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x35')]));_0x2ae260[_0x0e86('0x34')]=_0x2ae260[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2ae260[_0x0e86('0x34')]:_0x108a0c[_0x0e86('0x30')];if(!_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x2ae260[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2ae260[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x3e64a8['query'][_0x0e86('0x19')]);}_0x2ae260['order']=qs[_0x0e86('0x3a')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2ae260['where']=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x3e64a8[_0x0e86('0x31')],_0x108a0c['filters']));_0x2ae260['where'][_0x0e86('0x5d')]=_0x68fb2a['id'];if(_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x2ae260[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2ae260['where'],{'$or':_[_0x0e86('0x2c')](_0x2ae260[_0x0e86('0x34')],function(_0x1662ad){var _0x6318ad={};_0x6318ad[_0x1662ad]={'$like':'%'+_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x6318ad;})});}_0x2ae260=_[_0x0e86('0x3c')]({},_0x2ae260,_0x3e64a8['options']);return db[_0x0e86('0x62')][_0x0e86('0x1c')]({'where':_0x2ae260['where']})[_0x0e86('0x23')](function(_0x2cd3d4){_0x506230[_0x0e86('0x1c')]=_0x2cd3d4;if(_0x3e64a8[_0x0e86('0x31')]['includeAll']){_0x2ae260[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x62')][_0x0e86('0x5f')](_0x2ae260);})[_0x0e86('0x23')](function(_0x806099){_0x506230[_0x0e86('0x44')]=_0x806099;return _0x506230;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x2cd55f,_0x2ae260))[_0x0e86('0x45')](handleError(_0x2cd55f,null));};exports[_0x0e86('0x63')]=function(_0x5dc45d,_0x5a52f6,_0x40741c){var _0x49064c={};var _0x3270e5={};var _0x1f3d5b;var _0x2a74e4;return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x5dc45d[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x5a52f6,null))[_0x0e86('0x23')](function(_0x2c7653){if(_0x2c7653){_0x1f3d5b=_0x2c7653;_0x3270e5[_0x0e86('0x30')]=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0x3270e5[_0x0e86('0x31')]=_['keys'](_0x5dc45d['query']);_0x3270e5[_0x0e86('0x32')]=_['intersection'](_0x3270e5['model'],_0x3270e5[_0x0e86('0x31')]);_0x49064c[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x3270e5[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x35')]));_0x49064c[_0x0e86('0x34')]=_0x49064c[_0x0e86('0x34')]['length']?_0x49064c[_0x0e86('0x34')]:_0x3270e5[_0x0e86('0x30')];_0x49064c['order']=qs[_0x0e86('0x3a')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x49064c[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x5dc45d[_0x0e86('0x31')],_0x3270e5[_0x0e86('0x32')]));if(_0x5dc45d['query'][_0x0e86('0x3f')]){_0x49064c['where']=_[_0x0e86('0x3c')](_0x49064c[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x49064c[_0x0e86('0x34')],function(_0x419088){var _0x2adef6={};_0x2adef6[_0x419088]={'$like':'%'+_0x5dc45d['query'][_0x0e86('0x3f')]+'%'};return _0x2adef6;})});}_0x49064c=_['merge']({},_0x49064c,_0x5dc45d['options']);return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x5754f2){if(_0x5754f2){_0x2a74e4=_0x5754f2['length'];if(!_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x49064c[_0x0e86('0x1b')]=qs['limit'](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x49064c['offset']=qs[_0x0e86('0x19')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x19')]);}return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x4fc66f){if(_0x4fc66f){return _0x4fc66f?{'count':_0x2a74e4,'rows':_0x4fc66f}:null;}})[_0x0e86('0x23')](respondWithResult(_0x5a52f6,null))[_0x0e86('0x45')](handleError(_0x5a52f6,null));};exports[_0x0e86('0x65')]=function(_0x18fc81,_0xd776db,_0x361a09){var _0x634087,_0x29051c;var _0xd3638f=[];var _0x19fe5d=moment()['format'](_0x0e86('0x66'));return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x18fc81['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xd776db,null))['then'](function(_0x89b797){if(_0x89b797){_0x29051c=_0x89b797;return _0x89b797[_0x0e86('0x65')](_0x18fc81['body'][_0x0e86('0x67')],_['omit'](_0x18fc81[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x2b21c5){var _0x4ca95c;var _0x4d46d7;_0x634087=_0x2b21c5||[];var _0x1379a3=[];if(_0x2b21c5){for(var _0x4866cc=0x0;_0x4866cc<_0x2b21c5[_0x0e86('0x36')];_0x4866cc+=0x1){var _0xdc8a00=_0x2b21c5[_0x4866cc][_0x0e86('0x25')]({'plain':!![]});_0x29051c[_0x0e86('0x69')]=_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]?_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]:_0x29051c[_0x0e86('0x69')];switch(_0x29051c[_0x0e86('0x69')]){case _0x0e86('0x6a'):_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt',_0x0e86('0x70'),_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),'phone')['field'](_0x0e86('0x73'),_0x0e86('0x74'))['field']('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')]('cm_contacts')[_0x0e86('0x3b')](_0x0e86('0x78'))[_0x0e86('0x3b')]('ListId\x20=\x20?',_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79'))[_0x0e86('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7b'))[_0x0e86('0x77')](_0x0e86('0x7c'))['where'](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]()))[_0x0e86('0x3b')](_0x0e86('0x7e'),squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))[_0x0e86('0x77')](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]())))[_0x0e86('0x76')]();break;case _0x0e86('0x80'):_0x4ca95c=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),_0x0e86('0x74'),_0x0e86('0x70'),_0x0e86('0x71'),_0x0e86('0x5d'),_0x0e86('0x55'),_0x0e86('0x56')],squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))['field'](_0x18fc81[_0x0e86('0x53')]['id']['toString'](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','createdAt')[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','updatedAt')[_0x0e86('0x77')](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')]['toString']())[_0x0e86('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))['from'](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id']['toString']())))[_0x0e86('0x76')]();break;default:_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt','ContactId',_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00['CmListId']['toString'](),_0x0e86('0x71'))['field'](_0x18fc81['params']['id']['toString'](),_0x0e86('0x5d'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x81'))[_0x0e86('0x3b')]('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())['where'](_0x0e86('0x79')))[_0x0e86('0x76')]();}_0x4d46d7=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x83'))[_0x0e86('0x6e')]([_0x0e86('0x84'),_0x0e86('0x74'),'phone',_0x0e86('0x85'),'createdAt',_0x0e86('0x56')],squel[_0x0e86('0x7a')]()['field']('h.id','id')[_0x0e86('0x72')]('NOW()',_0x0e86('0x74'))[_0x0e86('0x72')](_0x0e86('0x86'),_0x0e86('0x6f'))[_0x0e86('0x72')]('ci.OrderBY',_0x0e86('0x85'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x87'),'ci')['join']('cm_hopper','h',_0x0e86('0x88'))[_0x0e86('0x3b')](_0x0e86('0x89'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8a'),_0x18fc81['params']['id'][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8b'),_0x19fe5d))[_0x0e86('0x76')]();_0x1379a3[_0x0e86('0x8c')](db[_0x0e86('0x8d')]['query'](_0x4ca95c));_0xd3638f[_0x0e86('0x8c')](db['sequelize']['query'](_0x4d46d7));}return BPromise[_0x0e86('0x8e')](_0x1379a3);}})['then'](function(){return BPromise[_0x0e86('0x8e')](_0xd3638f);})[_0x0e86('0x23')](function(){return _0x634087;})['then'](respondWithResult(_0xd776db,null))[_0x0e86('0x45')](handleError(_0xd776db,null));};exports[_0x0e86('0x8f')]=function(_0x33134e,_0x36011d,_0x2fc9f2){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33134e[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x36011d,null))['then'](function(_0x1d03d7){if(_0x1d03d7){return _0x1d03d7[_0x0e86('0x8f')](_0x33134e[_0x0e86('0x31')][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x5e07a3){if(_0x5e07a3){return db['CmHopper'][_0x0e86('0x24')]({'where':{'ListId':_0x33134e['query'][_0x0e86('0x67')],'CampaignId':_0x33134e[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](function(){return _0x5e07a3;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x36011d,null))[_0x0e86('0x45')](handleError(_0x36011d,null));};exports[_0x0e86('0x90')]=function(_0x580138,_0xb36335,_0x8aa5d){var _0x2d52af={};var _0xe18336={};var _0x43123f;var _0x52442d;return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x580138[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xb36335,null))[_0x0e86('0x23')](function(_0x536ed9){if(_0x536ed9){_0x43123f=_0x536ed9;_0xe18336['model']=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0xe18336[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x580138[_0x0e86('0x31')]);_0xe18336[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0xe18336[_0x0e86('0x30')],_0xe18336[_0x0e86('0x31')]);_0x2d52af['attributes']=_[_0x0e86('0x33')](_0xe18336['model'],qs[_0x0e86('0x35')](_0x580138['query'][_0x0e86('0x35')]));_0x2d52af['attributes']=_0x2d52af[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2d52af[_0x0e86('0x34')]:_0xe18336[_0x0e86('0x30')];_0x2d52af[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x580138[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2d52af[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x580138['query'],_0xe18336[_0x0e86('0x32')]));if(_0x580138[_0x0e86('0x31')]['filter']){_0x2d52af[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2d52af[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x2d52af[_0x0e86('0x34')],function(_0x1df37c){var _0x1f1486={};_0x1f1486[_0x1df37c]={'$like':'%'+_0x580138['query'][_0x0e86('0x3f')]+'%'};return _0x1f1486;})});}_0x2d52af=_[_0x0e86('0x3c')]({},_0x2d52af,_0x580138[_0x0e86('0x40')]);return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x427d8c){if(_0x427d8c){_0x52442d=_0x427d8c[_0x0e86('0x36')];if(!_0x580138[_0x0e86('0x31')][_0x0e86('0x37')]('nolimit')){_0x2d52af['limit']=qs[_0x0e86('0x1b')](_0x580138[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2d52af['offset']=qs[_0x0e86('0x19')](_0x580138[_0x0e86('0x31')]['offset']);}return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x5544cd){if(_0x5544cd){return _0x5544cd?{'count':_0x52442d,'rows':_0x5544cd}:null;}})['then'](respondWithResult(_0xb36335,null))[_0x0e86('0x45')](handleError(_0xb36335,null));};exports['addBlackLists']=function(_0x342522,_0x369a02,_0x1564e3){var _0x4e3bc0,_0x5ddc03;var _0x470a96=[];var _0x1dfe5f=moment()[_0x0e86('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e86('0x41')]['find']({'where':{'id':_0x342522[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x369a02,null))[_0x0e86('0x23')](function(_0x3b8ad0){if(_0x3b8ad0){_0x5ddc03=_0x3b8ad0;return _0x3b8ad0['addBlackLists'](_0x342522['body'][_0x0e86('0x67')],_['omit'](_0x342522[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x5a557a){var _0x4d9f1e;var _0x175419;_0x4e3bc0=_0x5a557a||[];var _0x1e9950=[];if(_0x5a557a){for(var _0x4e3bcb=0x0;_0x4e3bcb<_0x5a557a['length'];_0x4e3bcb+=0x1){var _0x496260=_0x5a557a[_0x4e3bcb][_0x0e86('0x25')]({'plain':!![]});_0x4d9f1e=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x92'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'ContactId',_0x0e86('0x71'),_0x0e86('0x5d'),'createdAt',_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0x496260['CmListId']['toString'](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x342522['params']['id']['toString'](),_0x0e86('0x5d'))['field']('NOW()',_0x0e86('0x55'))[_0x0e86('0x72')]('NOW()',_0x0e86('0x56'))['from'](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0x496260[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79')))['toString']();_0x1e9950['push'](db['sequelize'][_0x0e86('0x31')](_0x4d9f1e));}return BPromise['all'](_0x1e9950);}})[_0x0e86('0x23')](function(){return _0x4e3bc0;})[_0x0e86('0x23')](respondWithResult(_0x369a02,null))[_0x0e86('0x45')](handleError(_0x369a02,null));};exports['removeBlackLists']=function(_0x33c463,_0x56cd27,_0x51dc39){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33c463['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56cd27,null))[_0x0e86('0x23')](function(_0x2d4e0c){if(_0x2d4e0c){return _0x2d4e0c[_0x0e86('0x93')](_0x33c463['query'][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x468f4e){if(_0x468f4e){return db['CmHopperBlack'][_0x0e86('0x24')]({'where':{'ListId':_0x33c463['query'][_0x0e86('0x67')],'CampaignId':_0x33c463['params']['id']}})['then'](function(){return _0x468f4e;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x56cd27,null))['catch'](handleError(_0x56cd27,null));};
\ No newline at end of file
+var _0xbca8=['hasOwnProperty','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','apply','reject','then','destroy','get','IvrCampaigns','end','error','name','send','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','clone','params','options','createdAt','updatedAt','body','omit','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0xbca8,0xcc));var _0x8bca=function(_0x40d342,_0x110e54){_0x40d342=_0x40d342-0x0;var _0x153c50=_0xbca8[_0x40d342];return _0x153c50;};'use strict';var emlformat=require(_0x8bca('0x0'));var rimraf=require(_0x8bca('0x1'));var zipdir=require(_0x8bca('0x2'));var jsonpatch=require(_0x8bca('0x3'));var rp=require(_0x8bca('0x4'));var moment=require('moment');var BPromise=require(_0x8bca('0x5'));var Mustache=require(_0x8bca('0x6'));var util=require(_0x8bca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8bca('0x8'));var ejs=require(_0x8bca('0x9'));var fs=require('fs');var fs_extra=require(_0x8bca('0xa'));var _=require(_0x8bca('0xb'));var squel=require('squel');var crypto=require(_0x8bca('0xc'));var jsforce=require(_0x8bca('0xd'));var deskjs=require(_0x8bca('0xe'));var toCsv=require(_0x8bca('0x8'));var querystring=require(_0x8bca('0xf'));var Papa=require(_0x8bca('0x10'));var Redis=require(_0x8bca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8bca('0x12'));var hardwareService=require(_0x8bca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8bca('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8bca('0x15'));var db=require(_0x8bca('0x16'))['db'];function respondWithStatusCode(_0x5eec01,_0x62c6d1){_0x62c6d1=_0x62c6d1||0xcc;return function(_0x1fe1b5){if(_0x1fe1b5){return _0x5eec01[_0x8bca('0x17')](_0x62c6d1);}return _0x5eec01[_0x8bca('0x18')](_0x62c6d1)['end']();};}function respondWithResult(_0x4bbf5c,_0x250d09){_0x250d09=_0x250d09||0xc8;return function(_0x59b65b){if(_0x59b65b){return _0x4bbf5c[_0x8bca('0x18')](_0x250d09)[_0x8bca('0x19')](_0x59b65b);}};}function respondWithFilteredResult(_0x145cfd,_0x2e3633){return function(_0x1c3590){if(_0x1c3590){var _0x1c78d5=typeof _0x2e3633['offset']==='undefined'&&typeof _0x2e3633[_0x8bca('0x1a')]==='undefined';var _0x2bd7b1=_0x1c3590[_0x8bca('0x1b')];var _0x4e24c8=_0x1c78d5?0x0:_0x2e3633['offset'];var _0x5622ba=_0x1c78d5?_0x1c3590[_0x8bca('0x1b')]:_0x2e3633[_0x8bca('0x1c')]+_0x2e3633['limit'];var _0x1a834c;if(_0x5622ba>=_0x2bd7b1){_0x5622ba=_0x2bd7b1;_0x1a834c=0xc8;}else{_0x1a834c=0xce;}_0x145cfd['status'](_0x1a834c);return _0x145cfd['set']('Content-Range',_0x4e24c8+'-'+_0x5622ba+'/'+_0x2bd7b1)[_0x8bca('0x19')](_0x1c3590);}return null;};}function patchUpdates(_0x17046f){return function(_0xdafaa1){try{jsonpatch[_0x8bca('0x1d')](_0xdafaa1,_0x17046f,!![]);}catch(_0x2d64cd){return BPromise[_0x8bca('0x1e')](_0x2d64cd);}return _0xdafaa1['save']();};}function saveUpdates(_0x315a59,_0x20dc10){return function(_0xf3296b){if(_0xf3296b){return _0xf3296b['update'](_0x315a59)[_0x8bca('0x1f')](function(_0x5ac207){return _0x5ac207;});}return null;};}function removeEntity(_0x1f014d,_0x4e4bff){return function(_0x2e3522){if(_0x2e3522){return _0x2e3522[_0x8bca('0x20')]()[_0x8bca('0x1f')](function(){var _0x8620e2=_0x2e3522[_0x8bca('0x21')]({'plain':!![]});var _0x3a7498=_0x8bca('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a7498,'resourceId':_0x8620e2['id']}})[_0x8bca('0x1f')](function(){return _0x2e3522;});})[_0x8bca('0x1f')](function(){_0x1f014d['status'](0xcc)[_0x8bca('0x23')]();});}};}function handleEntityNotFound(_0x706106,_0x103b53){return function(_0x344eae){if(!_0x344eae){_0x706106[_0x8bca('0x17')](0x194);}return _0x344eae;};}function handleError(_0x54ccae,_0x4767b5){_0x4767b5=_0x4767b5||0x1f4;return function(_0x58bfda){logger[_0x8bca('0x24')](_0x58bfda['stack']);if(_0x58bfda[_0x8bca('0x25')]){delete _0x58bfda[_0x8bca('0x25')];}_0x54ccae[_0x8bca('0x18')](_0x4767b5)[_0x8bca('0x26')](_0x58bfda);};}exports['index']=function(_0x252819,_0x429c3a){var _0x288f99={},_0x543897={},_0x539f7e={'count':0x0,'rows':[]};var _0x4dc8ef=_[_0x8bca('0x27')](db[_0x8bca('0x28')][_0x8bca('0x29')],function(_0x5b13a1){return{'name':_0x5b13a1[_0x8bca('0x2a')],'type':_0x5b13a1[_0x8bca('0x2b')]['key']};});_0x543897[_0x8bca('0x2c')]=_[_0x8bca('0x27')](_0x4dc8ef,_0x8bca('0x25'));_0x543897[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x252819['query']);_0x543897[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x543897[_0x8bca('0x2c')],_0x543897[_0x8bca('0x2d')]);_0x288f99[_0x8bca('0x31')]=_['intersection'](_0x543897[_0x8bca('0x2c')],qs['fields'](_0x252819['query'][_0x8bca('0x32')]));_0x288f99[_0x8bca('0x31')]=_0x288f99['attributes']['length']?_0x288f99[_0x8bca('0x31')]:_0x543897[_0x8bca('0x2c')];if(!_0x252819[_0x8bca('0x2d')]['hasOwnProperty'](_0x8bca('0x33'))){_0x288f99['limit']=qs[_0x8bca('0x1a')](_0x252819[_0x8bca('0x2d')]['limit']);_0x288f99[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x252819[_0x8bca('0x2d')]['offset']);}_0x288f99[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x252819['query']['sort']);_0x288f99[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x252819['query'],_0x543897[_0x8bca('0x2f')]),_0x4dc8ef);if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x288f99[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x288f99[_0x8bca('0x36')],{'$or':_['map'](_0x4dc8ef,function(_0x150b0d){if(_0x150b0d[_0x8bca('0x2b')]!==_0x8bca('0x39')){var _0x8873d1={};_0x8873d1[_0x150b0d[_0x8bca('0x25')]]={'$like':'%'+_0x252819[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x8873d1;}})});}_0x288f99=_[_0x8bca('0x38')]({},_0x288f99,_0x252819['options']);var _0x4c01f7={'where':_0x288f99[_0x8bca('0x36')]};return db[_0x8bca('0x28')]['count'](_0x4c01f7)[_0x8bca('0x1f')](function(_0x2bc3ff){_0x539f7e[_0x8bca('0x1b')]=_0x2bc3ff;if(_0x252819[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x288f99[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x28')][_0x8bca('0x3c')](_0x288f99);})[_0x8bca('0x1f')](function(_0x4b2839){_0x539f7e[_0x8bca('0x3d')]=_0x4b2839;return _0x539f7e;})['then'](respondWithFilteredResult(_0x429c3a,_0x288f99))[_0x8bca('0x3e')](handleError(_0x429c3a,null));};exports[_0x8bca('0x3f')]=function(_0x23bd03,_0x11a4be){var _0x291a77={'raw':![],'where':{'id':_0x23bd03['params']['id']}},_0x165404={};_0x165404[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['Campaign'][_0x8bca('0x29')]);_0x165404['query']=_['keys'](_0x23bd03['query']);_0x165404['filters']=_[_0x8bca('0x30')](_0x165404[_0x8bca('0x2c')],_0x165404[_0x8bca('0x2d')]);_0x291a77[_0x8bca('0x31')]=_['intersection'](_0x165404[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x291a77['attributes']=_0x291a77[_0x8bca('0x31')][_0x8bca('0x40')]?_0x291a77[_0x8bca('0x31')]:_0x165404[_0x8bca('0x2c')];if(_0x23bd03[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x291a77[_0x8bca('0x3b')]=[{'all':!![]}];}_0x291a77=_[_0x8bca('0x38')]({},_0x291a77,_0x23bd03['options']);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0x291a77)['then'](handleEntityNotFound(_0x11a4be,null))['then'](respondWithResult(_0x11a4be,null))[_0x8bca('0x3e')](handleError(_0x11a4be,null));};exports[_0x8bca('0x42')]=function(_0x41379f,_0x58a6c0){return db[_0x8bca('0x28')][_0x8bca('0x42')](_0x41379f['body'],{})[_0x8bca('0x1f')](function(_0x123e37){var _0x32e030=_0x41379f[_0x8bca('0x43')]['get']({'plain':!![]});if(!_0x32e030)throw new Error(_0x8bca('0x44'));if(_0x32e030[_0x8bca('0x45')]==='user'){var _0x3174b0=_0x123e37[_0x8bca('0x21')]({'plain':!![]});var _0x16dfb9='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x16dfb9,'userProfileId':_0x32e030[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x3547bd){if(_0x3547bd&&_0x3547bd[_0x8bca('0x47')]===0x0){return db['UserProfileResource'][_0x8bca('0x42')]({'name':_0x3174b0[_0x8bca('0x25')],'resourceId':_0x3174b0['id'],'type':_0x3547bd['name'],'sectionId':_0x3547bd['id']},{})[_0x8bca('0x1f')](function(){return _0x123e37;});}else{return _0x123e37;}})[_0x8bca('0x3e')](function(_0x5b4ffd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b4ffd);throw _0x5b4ffd;});}return _0x123e37;})[_0x8bca('0x1f')](respondWithResult(_0x58a6c0,0xc9))[_0x8bca('0x3e')](handleError(_0x58a6c0,null));};exports[_0x8bca('0x48')]=function(_0x134d07,_0x5c14dd){var _0xc2ec12={'where':{'id':_0x134d07[_0x8bca('0x49')]['id']}},_0x6e7dd7={};_0x6e7dd7[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x28')][_0x8bca('0x29')]);_0xc2ec12[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x6e7dd7[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x134d07[_0x8bca('0x2d')][_0x8bca('0x32')]));_0xc2ec12[_0x8bca('0x31')]=_0xc2ec12[_0x8bca('0x31')]['length']?_0xc2ec12[_0x8bca('0x31')]:_0x6e7dd7[_0x8bca('0x2c')];if(_0x134d07['query'][_0x8bca('0x3a')]){_0xc2ec12[_0x8bca('0x3b')]=[{'all':!![]}];}_0xc2ec12=_[_0x8bca('0x38')]({},_0xc2ec12,_0x134d07[_0x8bca('0x4a')]);return db[_0x8bca('0x28')][_0x8bca('0x41')](_0xc2ec12)[_0x8bca('0x1f')](handleEntityNotFound(_0x5c14dd,null))[_0x8bca('0x1f')](function(_0x2ce8fb){if(_0x2ce8fb){var _0x411772=_0x2ce8fb[_0x8bca('0x21')]({'plain':!![]});_0x411772=qs['omit'](_0x411772,['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);_0x134d07[_0x8bca('0x4d')]=_[_0x8bca('0x4e')](_0x134d07['body'],['id',_0x8bca('0x4b'),_0x8bca('0x4c')]);return db[_0x8bca('0x28')][_0x8bca('0x42')](_['merge'](_0x411772,_0x134d07[_0x8bca('0x4d')]),{'include':_0x134d07[_0x8bca('0x2d')][_0x8bca('0x3a')]?[{'all':!![]}]:undefined})[_0x8bca('0x1f')](function(_0x1d3975){var _0x13d038=_0x134d07[_0x8bca('0x43')][_0x8bca('0x21')]({'plain':!![]});if(!_0x13d038)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d038['role']===_0x8bca('0x43')){var _0x1d9b41=_0x1d3975[_0x8bca('0x21')]({'plain':!![]});var _0x30f6b3=_0x8bca('0x22');return db[_0x8bca('0x4f')]['find']({'where':{'name':_0x30f6b3,'userProfileId':_0x13d038[_0x8bca('0x46')]},'raw':!![]})['then'](function(_0x1672fe){if(_0x1672fe&&_0x1672fe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1d9b41[_0x8bca('0x25')],'resourceId':_0x1d9b41['id'],'type':_0x1672fe[_0x8bca('0x25')],'sectionId':_0x1672fe['id']},{})[_0x8bca('0x1f')](function(){return _0x1d3975;});}else{return _0x1d3975;}})[_0x8bca('0x3e')](function(_0x153116){logger['error'](_0x8bca('0x50'),_0x153116);throw _0x153116;});}return _0x1d3975;});}})[_0x8bca('0x1f')](respondWithResult(_0x5c14dd,0xc9))[_0x8bca('0x3e')](handleError(_0x5c14dd,null));};exports[_0x8bca('0x51')]=function(_0x17cb8e,_0x1133fe){if(_0x17cb8e['body']['id']){delete _0x17cb8e['body']['id'];}return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x17cb8e['params']['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x1133fe,null))[_0x8bca('0x1f')](saveUpdates(_0x17cb8e[_0x8bca('0x4d')],null))[_0x8bca('0x1f')](respondWithResult(_0x1133fe,null))[_0x8bca('0x3e')](handleError(_0x1133fe,null));};exports[_0x8bca('0x20')]=function(_0x2621ac,_0x3e8058){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2621ac['params']['id']}})['then'](handleEntityNotFound(_0x3e8058,null))[_0x8bca('0x1f')](removeEntity(_0x3e8058,null))[_0x8bca('0x3e')](handleError(_0x3e8058,null));};exports[_0x8bca('0x52')]=function(_0x12ab81,_0x33d117,_0x26f374){var _0x18c6cb={'raw':!![],'where':{}};var _0x4dd3d5={};var _0x35e6eb={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x12ab81[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x33d117,null))[_0x8bca('0x1f')](function(_0x243988){if(_0x243988){_0x4dd3d5['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x53')][_0x8bca('0x29')]);_0x4dd3d5[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x12ab81[_0x8bca('0x2d')]);_0x4dd3d5[_0x8bca('0x2f')]=_['intersection'](_0x4dd3d5['model'],_0x4dd3d5[_0x8bca('0x2d')]);_0x18c6cb[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x4dd3d5[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x18c6cb['attributes']=_0x18c6cb[_0x8bca('0x31')][_0x8bca('0x40')]?_0x18c6cb[_0x8bca('0x31')]:_0x4dd3d5[_0x8bca('0x2c')];if(!_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x18c6cb[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x12ab81[_0x8bca('0x2d')]['limit']);_0x18c6cb[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x12ab81['query'][_0x8bca('0x1c')]);}_0x18c6cb[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x18c6cb['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x12ab81[_0x8bca('0x2d')],_0x4dd3d5[_0x8bca('0x2f')]));_0x18c6cb[_0x8bca('0x36')][_0x8bca('0x56')]=_0x243988['id'];if(_0x12ab81['query'][_0x8bca('0x37')]){_0x18c6cb[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x18c6cb[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x18c6cb['attributes'],function(_0x35958f){var _0x42b85b={};_0x42b85b[_0x35958f]={'$like':'%'+_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x42b85b;})});}_0x18c6cb=_[_0x8bca('0x38')]({},_0x18c6cb,_0x12ab81[_0x8bca('0x4a')]);return db['CmHopper'][_0x8bca('0x1b')]({'where':_0x18c6cb[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x4d9477){_0x35e6eb['count']=_0x4d9477;if(_0x12ab81[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x18c6cb[_0x8bca('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x8bca('0x3c')](_0x18c6cb);})['then'](function(_0x12fc38){_0x35e6eb['rows']=_0x12fc38;return _0x35e6eb;});}})['then'](respondWithFilteredResult(_0x33d117,_0x18c6cb))[_0x8bca('0x3e')](handleError(_0x33d117,null));};exports[_0x8bca('0x57')]=function(_0x18d999,_0x57ae60,_0x1fa442){var _0x46d56a={'raw':!![],'where':{}};var _0x5e5b2c={};var _0x3281c7={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x18d999['params']['id']}})['then'](handleEntityNotFound(_0x57ae60,null))[_0x8bca('0x1f')](function(_0x2a308b){if(_0x2a308b){_0x5e5b2c['model']=_[_0x8bca('0x2e')](db[_0x8bca('0x59')][_0x8bca('0x29')]);_0x5e5b2c[_0x8bca('0x2d')]=_[_0x8bca('0x2e')](_0x18d999[_0x8bca('0x2d')]);_0x5e5b2c['filters']=_['intersection'](_0x5e5b2c[_0x8bca('0x2c')],_0x5e5b2c['query']);_0x46d56a['attributes']=_['intersection'](_0x5e5b2c['model'],qs[_0x8bca('0x32')](_0x18d999['query'][_0x8bca('0x32')]));_0x46d56a[_0x8bca('0x31')]=_0x46d56a[_0x8bca('0x31')][_0x8bca('0x40')]?_0x46d56a[_0x8bca('0x31')]:_0x5e5b2c[_0x8bca('0x2c')];if(!_0x18d999[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x46d56a['limit']=qs[_0x8bca('0x1a')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x46d56a[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x46d56a['order']=qs[_0x8bca('0x35')](_0x18d999[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x46d56a[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x18d999['query'],_0x5e5b2c[_0x8bca('0x2f')]));_0x46d56a[_0x8bca('0x36')]['CampaignId']=_0x2a308b['id'];if(_0x18d999[_0x8bca('0x2d')]['filter']){_0x46d56a[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x46d56a[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x46d56a[_0x8bca('0x31')],function(_0x153ff1){var _0x1455fd={};_0x1455fd[_0x153ff1]={'$like':'%'+_0x18d999[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x1455fd;})});}_0x46d56a=_['merge']({},_0x46d56a,_0x18d999[_0x8bca('0x4a')]);return db[_0x8bca('0x59')][_0x8bca('0x1b')]({'where':_0x46d56a[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x566946){_0x3281c7['count']=_0x566946;if(_0x18d999[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x46d56a['include']=[{'all':!![]}];}return db[_0x8bca('0x59')][_0x8bca('0x3c')](_0x46d56a);})[_0x8bca('0x1f')](function(_0x3dde74){_0x3281c7[_0x8bca('0x3d')]=_0x3dde74;return _0x3281c7;});}})['then'](respondWithFilteredResult(_0x57ae60,_0x46d56a))[_0x8bca('0x3e')](handleError(_0x57ae60,null));};exports[_0x8bca('0x5a')]=function(_0x319387,_0xef2a8b,_0x2c1557){var _0x473672={'raw':!![],'where':{}};var _0x222efa={};var _0x90fafe={'count':0x0,'rows':[]};return db[_0x8bca('0x28')]['findOne']({'where':{'id':_0x319387[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0xef2a8b,null))['then'](function(_0x2143e2){if(_0x2143e2){_0x222efa[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db['CmHopperFinal'][_0x8bca('0x29')]);_0x222efa[_0x8bca('0x2d')]=_['keys'](_0x319387[_0x8bca('0x2d')]);_0x222efa[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],_0x222efa[_0x8bca('0x2d')]);_0x473672['attributes']=_[_0x8bca('0x30')](_0x222efa[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x473672['attributes']=_0x473672[_0x8bca('0x31')][_0x8bca('0x40')]?_0x473672[_0x8bca('0x31')]:_0x222efa['model'];if(!_0x319387['query']['hasOwnProperty'](_0x8bca('0x33'))){_0x473672[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x319387[_0x8bca('0x2d')]['limit']);_0x473672['offset']=qs[_0x8bca('0x1c')](_0x319387[_0x8bca('0x2d')][_0x8bca('0x1c')]);}_0x473672[_0x8bca('0x34')]=qs['sort'](_0x319387['query'][_0x8bca('0x35')]);_0x473672['where']=qs[_0x8bca('0x2f')](_[_0x8bca('0x55')](_0x319387[_0x8bca('0x2d')],_0x222efa[_0x8bca('0x2f')]));_0x473672[_0x8bca('0x36')]['CampaignId']=_0x2143e2['id'];if(_0x319387['query'][_0x8bca('0x37')]){_0x473672[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x473672[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x473672['attributes'],function(_0x49e6f0){var _0x2d6d91={};_0x2d6d91[_0x49e6f0]={'$like':'%'+_0x319387[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x2d6d91;})});}_0x473672=_[_0x8bca('0x38')]({},_0x473672,_0x319387[_0x8bca('0x4a')]);return db[_0x8bca('0x5b')][_0x8bca('0x1b')]({'where':_0x473672[_0x8bca('0x36')]})[_0x8bca('0x1f')](function(_0x30470c){_0x90fafe[_0x8bca('0x1b')]=_0x30470c;if(_0x319387[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x473672['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x8bca('0x3c')](_0x473672);})[_0x8bca('0x1f')](function(_0x5dbd2e){_0x90fafe[_0x8bca('0x3d')]=_0x5dbd2e;return _0x90fafe;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0xef2a8b,_0x473672))[_0x8bca('0x3e')](handleError(_0xef2a8b,null));};exports[_0x8bca('0x5c')]=function(_0x280d1d,_0x215c78,_0x45bd58){var _0x1a5a65={'raw':!![],'where':{}};var _0x194f58={};var _0x12d957={'count':0x0,'rows':[]};return db['Campaign'][_0x8bca('0x58')]({'where':{'id':_0x280d1d[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x215c78,null))[_0x8bca('0x1f')](function(_0xd09bd0){if(_0xd09bd0){_0x194f58[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5d')][_0x8bca('0x29')]);_0x194f58[_0x8bca('0x2d')]=_['keys'](_0x280d1d[_0x8bca('0x2d')]);_0x194f58[_0x8bca('0x2f')]=_[_0x8bca('0x30')](_0x194f58['model'],_0x194f58[_0x8bca('0x2d')]);_0x1a5a65[_0x8bca('0x31')]=_[_0x8bca('0x30')](_0x194f58[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x32')]));_0x1a5a65[_0x8bca('0x31')]=_0x1a5a65[_0x8bca('0x31')][_0x8bca('0x40')]?_0x1a5a65[_0x8bca('0x31')]:_0x194f58[_0x8bca('0x2c')];if(!_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x1a5a65[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x1a')]);_0x1a5a65[_0x8bca('0x1c')]=qs['offset'](_0x280d1d['query']['offset']);}_0x1a5a65[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x1a5a65[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x280d1d[_0x8bca('0x2d')],_0x194f58['filters']));_0x1a5a65[_0x8bca('0x36')]['CampaignId']=_0xd09bd0['id'];if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x1a5a65['where']=_['merge'](_0x1a5a65[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x1a5a65[_0x8bca('0x31')],function(_0x4fb3e2){var _0x5cfce1={};_0x5cfce1[_0x4fb3e2]={'$like':'%'+_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x37')]+'%'};return _0x5cfce1;})});}_0x1a5a65=_[_0x8bca('0x38')]({},_0x1a5a65,_0x280d1d[_0x8bca('0x4a')]);return db[_0x8bca('0x5d')][_0x8bca('0x1b')]({'where':_0x1a5a65['where']})['then'](function(_0x2b1e57){_0x12d957[_0x8bca('0x1b')]=_0x2b1e57;if(_0x280d1d[_0x8bca('0x2d')][_0x8bca('0x3a')]){_0x1a5a65[_0x8bca('0x3b')]=[{'all':!![]}];}return db[_0x8bca('0x5d')][_0x8bca('0x3c')](_0x1a5a65);})[_0x8bca('0x1f')](function(_0x204d9c){_0x12d957[_0x8bca('0x3d')]=_0x204d9c;return _0x12d957;});}})[_0x8bca('0x1f')](respondWithFilteredResult(_0x215c78,_0x1a5a65))[_0x8bca('0x3e')](handleError(_0x215c78,null));};exports[_0x8bca('0x5e')]=function(_0x2d3041,_0x3421ae,_0x16b698){var _0x31070e={};var _0x22c9f1={};var _0x364e03;var _0x1fb3d2;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x2d3041[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x3421ae,null))[_0x8bca('0x1f')](function(_0x4cefb0){if(_0x4cefb0){_0x364e03=_0x4cefb0;_0x22c9f1[_0x8bca('0x2c')]=_[_0x8bca('0x2e')](db[_0x8bca('0x5f')]['rawAttributes']);_0x22c9f1[_0x8bca('0x2d')]=_['keys'](_0x2d3041[_0x8bca('0x2d')]);_0x22c9f1[_0x8bca('0x2f')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],_0x22c9f1['query']);_0x31070e[_0x8bca('0x31')]=_['intersection'](_0x22c9f1[_0x8bca('0x2c')],qs[_0x8bca('0x32')](_0x2d3041[_0x8bca('0x2d')]['fields']));_0x31070e[_0x8bca('0x31')]=_0x31070e['attributes'][_0x8bca('0x40')]?_0x31070e[_0x8bca('0x31')]:_0x22c9f1['model'];_0x31070e[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x2d3041[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x31070e[_0x8bca('0x36')]=qs[_0x8bca('0x2f')](_['pick'](_0x2d3041['query'],_0x22c9f1[_0x8bca('0x2f')]));if(_0x2d3041['query'][_0x8bca('0x37')]){_0x31070e[_0x8bca('0x36')]=_[_0x8bca('0x38')](_0x31070e[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x31070e[_0x8bca('0x31')],function(_0x55b799){var _0x5e02d2={};_0x5e02d2[_0x55b799]={'$like':'%'+_0x2d3041['query']['filter']+'%'};return _0x5e02d2;})});}_0x31070e=_[_0x8bca('0x38')]({},_0x31070e,_0x2d3041[_0x8bca('0x4a')]);return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0x6cedc3){if(_0x6cedc3){_0x1fb3d2=_0x6cedc3['length'];if(!_0x2d3041['query'][_0x8bca('0x54')](_0x8bca('0x33'))){_0x31070e[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x2d3041['query'][_0x8bca('0x1a')]);_0x31070e[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x2d3041['query'][_0x8bca('0x1c')]);}return _0x364e03[_0x8bca('0x5e')](_0x31070e);}})[_0x8bca('0x1f')](function(_0xe6d2c6){if(_0xe6d2c6){return _0xe6d2c6?{'count':_0x1fb3d2,'rows':_0xe6d2c6}:null;}})['then'](respondWithResult(_0x3421ae,null))[_0x8bca('0x3e')](handleError(_0x3421ae,null));};exports[_0x8bca('0x60')]=function(_0x14a9c1,_0x146796,_0x3e7d0c){var _0x29eac1,_0x49c29a;var _0x2ec68f=[];var _0x3c17a4=moment()[_0x8bca('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x14a9c1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x146796,null))[_0x8bca('0x1f')](function(_0x5b601d){if(_0x5b601d){_0x49c29a=_0x5b601d;return _0x5b601d['addLists'](_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x14a9c1[_0x8bca('0x4d')],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0x446d0b){var _0x4a8102;var _0x19da71;_0x29eac1=_0x446d0b||[];var _0xaae941=[];if(_0x446d0b){for(var _0x37e651=0x0;_0x37e651<_0x446d0b[_0x8bca('0x40')];_0x37e651+=0x1){var _0x265c90=_0x446d0b[_0x37e651][_0x8bca('0x21')]({'plain':!![]});_0x49c29a[_0x8bca('0x64')]=_0x14a9c1[_0x8bca('0x4d')][_0x8bca('0x64')]?_0x14a9c1['body']['dialCheckDuplicateType']:_0x49c29a['dialCheckDuplicateType'];switch(_0x49c29a[_0x8bca('0x64')]){case _0x8bca('0x65'):_0x4a8102=squel['insert']()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')]([_0x8bca('0x69'),_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field'](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()',_0x8bca('0x6a'))[_0x8bca('0x6e')]('id','ContactId')[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))['field'](_0x14a9c1['params']['id']['toString'](),_0x8bca('0x56'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))['where']('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x74'))[_0x8bca('0x36')](_0x8bca('0x75'),squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x76'))[_0x8bca('0x71')](_0x8bca('0x77'))[_0x8bca('0x36')](_0x8bca('0x78'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']()))[_0x8bca('0x36')](_0x8bca('0x75'),squel['select']()['field'](_0x8bca('0x79'))[_0x8bca('0x71')]('cm_hopper')['where'](_0x8bca('0x78'),_0x14a9c1['params']['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;case _0x8bca('0x7a'):_0x4a8102=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x67'))[_0x8bca('0x68')](['phone',_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),'createdAt',_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x69'),_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x7c'),_0x8bca('0x6a'))[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))['field']('\x27'+_0x3c17a4+'\x27','createdAt')[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contacts')[_0x8bca('0x36')]('deletedAt\x20IS\x20NULL')[_0x8bca('0x36')](_0x8bca('0x7d'),_0x265c90[_0x8bca('0x6f')]['toString']())['where'](_0x8bca('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x79'))[_0x8bca('0x71')](_0x8bca('0x67'))[_0x8bca('0x36')]('CampaignId\x20=\x20?',_0x14a9c1[_0x8bca('0x49')]['id'][_0x8bca('0x70')]())))[_0x8bca('0x70')]();break;default:_0x4a8102=squel['insert']()['into']('cm_hopper')[_0x8bca('0x68')]([_0x8bca('0x69'),'scheduledAt',_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),'updatedAt'],squel['select']()[_0x8bca('0x6e')]('phone',_0x8bca('0x69'))[_0x8bca('0x6e')]('NOW()','scheduledAt')[_0x8bca('0x6e')]('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x265c90['CmListId'][_0x8bca('0x70')](),'ListId')[_0x8bca('0x6e')](_0x14a9c1['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))['field']('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')]('ListId\x20=\x20?',_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))['toString']();}_0x19da71=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')](_0x8bca('0x7e'))[_0x8bca('0x68')]([_0x8bca('0x7f'),_0x8bca('0x6a'),'phone','OrderBy',_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()[_0x8bca('0x6e')](_0x8bca('0x80'),'id')[_0x8bca('0x6e')](_0x8bca('0x7c'),'scheduledAt')['field']('ci.item',_0x8bca('0x69'))[_0x8bca('0x6e')](_0x8bca('0x81'),_0x8bca('0x82'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4b'))[_0x8bca('0x6e')]('\x27'+_0x3c17a4+'\x27',_0x8bca('0x4c'))[_0x8bca('0x71')]('cm_contact_has_items','ci')[_0x8bca('0x83')](_0x8bca('0x67'),'h',_0x8bca('0x84'))[_0x8bca('0x36')](_0x8bca('0x85'),_0x265c90[_0x8bca('0x6f')][_0x8bca('0x70')]())[_0x8bca('0x36')](_0x8bca('0x86'),_0x14a9c1[_0x8bca('0x49')]['id']['toString']())[_0x8bca('0x36')](_0x8bca('0x87'),_0x3c17a4))[_0x8bca('0x70')]();_0xaae941[_0x8bca('0x88')](db[_0x8bca('0x89')][_0x8bca('0x2d')](_0x4a8102));_0x2ec68f[_0x8bca('0x88')](db['sequelize'][_0x8bca('0x2d')](_0x19da71));}return BPromise[_0x8bca('0x8a')](_0xaae941);}})[_0x8bca('0x1f')](function(){return BPromise[_0x8bca('0x8a')](_0x2ec68f);})[_0x8bca('0x1f')](function(){return _0x29eac1;})[_0x8bca('0x1f')](respondWithResult(_0x146796,null))[_0x8bca('0x3e')](handleError(_0x146796,null));};exports['removeLists']=function(_0x22c7c7,_0x17b179,_0x8e017c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x22c7c7[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x17b179,null))['then'](function(_0x314497){if(_0x314497){return _0x314497[_0x8bca('0x8b')](_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x4525ce){if(_0x4525ce){return db[_0x8bca('0x53')][_0x8bca('0x20')]({'where':{'ListId':_0x22c7c7[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x22c7c7[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](function(){return _0x4525ce;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x17b179,null))['catch'](handleError(_0x17b179,null));};exports[_0x8bca('0x8c')]=function(_0x510ba5,_0x27a4be,_0x44aea0){var _0x47cec2={};var _0x4e8b75={};var _0x4fa822;var _0x227f3f;return db[_0x8bca('0x28')][_0x8bca('0x58')]({'where':{'id':_0x510ba5[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x27a4be,null))[_0x8bca('0x1f')](function(_0x192bd5){if(_0x192bd5){_0x4fa822=_0x192bd5;_0x4e8b75['model']=_[_0x8bca('0x2e')](db['CmList'][_0x8bca('0x29')]);_0x4e8b75[_0x8bca('0x2d')]=_['keys'](_0x510ba5[_0x8bca('0x2d')]);_0x4e8b75[_0x8bca('0x2f')]=_['intersection'](_0x4e8b75[_0x8bca('0x2c')],_0x4e8b75[_0x8bca('0x2d')]);_0x47cec2['attributes']=_[_0x8bca('0x30')](_0x4e8b75['model'],qs[_0x8bca('0x32')](_0x510ba5[_0x8bca('0x2d')]['fields']));_0x47cec2['attributes']=_0x47cec2[_0x8bca('0x31')]['length']?_0x47cec2[_0x8bca('0x31')]:_0x4e8b75[_0x8bca('0x2c')];_0x47cec2[_0x8bca('0x34')]=qs[_0x8bca('0x35')](_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x35')]);_0x47cec2['where']=qs['filters'](_[_0x8bca('0x55')](_0x510ba5['query'],_0x4e8b75[_0x8bca('0x2f')]));if(_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x37')]){_0x47cec2[_0x8bca('0x36')]=_['merge'](_0x47cec2[_0x8bca('0x36')],{'$or':_[_0x8bca('0x27')](_0x47cec2['attributes'],function(_0x10d2f5){var _0x23f618={};_0x23f618[_0x10d2f5]={'$like':'%'+_0x510ba5[_0x8bca('0x2d')]['filter']+'%'};return _0x23f618;})});}_0x47cec2=_[_0x8bca('0x38')]({},_0x47cec2,_0x510ba5[_0x8bca('0x4a')]);return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})[_0x8bca('0x1f')](function(_0x23c6a2){if(_0x23c6a2){_0x227f3f=_0x23c6a2[_0x8bca('0x40')];if(!_0x510ba5[_0x8bca('0x2d')][_0x8bca('0x54')]('nolimit')){_0x47cec2[_0x8bca('0x1a')]=qs[_0x8bca('0x1a')](_0x510ba5['query'][_0x8bca('0x1a')]);_0x47cec2[_0x8bca('0x1c')]=qs[_0x8bca('0x1c')](_0x510ba5['query'][_0x8bca('0x1c')]);}return _0x4fa822[_0x8bca('0x8c')](_0x47cec2);}})['then'](function(_0x3e243d){if(_0x3e243d){return _0x3e243d?{'count':_0x227f3f,'rows':_0x3e243d}:null;}})[_0x8bca('0x1f')](respondWithResult(_0x27a4be,null))[_0x8bca('0x3e')](handleError(_0x27a4be,null));};exports[_0x8bca('0x8d')]=function(_0x1d2df1,_0x44dc99,_0x385119){var _0x1671d6,_0x21534b;var _0x28400f=[];var _0x2cc157=moment()[_0x8bca('0x61')](_0x8bca('0x8e'));return db['Campaign']['find']({'where':{'id':_0x1d2df1[_0x8bca('0x49')]['id']}})[_0x8bca('0x1f')](handleEntityNotFound(_0x44dc99,null))[_0x8bca('0x1f')](function(_0x52bef4){if(_0x52bef4){_0x21534b=_0x52bef4;return _0x52bef4[_0x8bca('0x8d')](_0x1d2df1[_0x8bca('0x4d')][_0x8bca('0x62')],_[_0x8bca('0x4e')](_0x1d2df1['body'],[_0x8bca('0x62'),'id'])||{});}return null;})[_0x8bca('0x63')](function(_0xf7b106){var _0x34fb34;var _0x13841a;_0x1671d6=_0xf7b106||[];var _0x5b9fd9=[];if(_0xf7b106){for(var _0x355512=0x0;_0x355512<_0xf7b106['length'];_0x355512+=0x1){var _0x30d51c=_0xf7b106[_0x355512][_0x8bca('0x21')]({'plain':!![]});_0x34fb34=squel[_0x8bca('0x7b')]()[_0x8bca('0x66')]('cm_hopper_black')[_0x8bca('0x68')](['phone','ContactId',_0x8bca('0x6c'),_0x8bca('0x56'),_0x8bca('0x4b'),_0x8bca('0x4c')],squel[_0x8bca('0x6d')]()['field']('phone',_0x8bca('0x69'))['field']('id',_0x8bca('0x6b'))[_0x8bca('0x6e')](_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')](),_0x8bca('0x6c'))[_0x8bca('0x6e')](_0x1d2df1[_0x8bca('0x49')]['id'][_0x8bca('0x70')](),_0x8bca('0x56'))[_0x8bca('0x6e')](_0x8bca('0x7c'),'createdAt')[_0x8bca('0x6e')]('NOW()',_0x8bca('0x4c'))[_0x8bca('0x71')](_0x8bca('0x72'))[_0x8bca('0x36')](_0x8bca('0x73'))[_0x8bca('0x36')](_0x8bca('0x7d'),_0x30d51c[_0x8bca('0x6f')][_0x8bca('0x70')]())['where'](_0x8bca('0x74')))[_0x8bca('0x70')]();_0x5b9fd9['push'](db[_0x8bca('0x89')]['query'](_0x34fb34));}return BPromise[_0x8bca('0x8a')](_0x5b9fd9);}})[_0x8bca('0x1f')](function(){return _0x1671d6;})['then'](respondWithResult(_0x44dc99,null))['catch'](handleError(_0x44dc99,null));};exports[_0x8bca('0x8f')]=function(_0x2dbd22,_0x570de3,_0x21d79c){return db[_0x8bca('0x28')][_0x8bca('0x41')]({'where':{'id':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](handleEntityNotFound(_0x570de3,null))[_0x8bca('0x1f')](function(_0x21ec10){if(_0x21ec10){return _0x21ec10[_0x8bca('0x8f')](_0x2dbd22['query'][_0x8bca('0x62')]);}})[_0x8bca('0x1f')](function(_0x10b7ec){if(_0x10b7ec){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2dbd22[_0x8bca('0x2d')][_0x8bca('0x62')],'CampaignId':_0x2dbd22[_0x8bca('0x49')]['id']}})['then'](function(){return _0x10b7ec;});}})[_0x8bca('0x1f')](respondWithStatusCode(_0x570de3,null))['catch'](handleError(_0x570de3,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 864e1ba..7af845c 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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 6908ffa..3aebb79 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 _0x757f=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','raw','where','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x757f,0xee));var _0xf757=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x757f[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rs=require(_0xf757('0x3'));var fs=require('fs');var Redis=require(_0xf757('0x4'));var db=require(_0xf757('0x5'))['db'];var utils=require(_0xf757('0x6'));var logger=require(_0xf757('0x7'))(_0xf757('0x8'));var config=require(_0xf757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf757('0xa')][_0xf757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1e06,_0x2c0fcf,_0x44b312){return new BPromise(function(_0x565224,_0x5bf802){return client[_0xf757('0xc')](_0x4e1e06,_0x44b312)[_0xf757('0xd')](function(_0x1360ac){logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));logger[_0xf757('0x10')](_0xf757('0x11'),_0x2c0fcf,_0xf757('0xf'),JSON[_0xf757('0x12')](_0x1360ac));if(_0x1360ac[_0xf757('0x13')]){if(_0x1360ac[_0xf757('0x13')][_0xf757('0x14')]===0x1f4){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x5bf802(_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);}logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x565224(_0x1360ac['error'][_0xf757('0x16')]);}else{logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));_0x565224(_0x1360ac[_0xf757('0x17')][_0xf757('0x16')]);}})['catch'](function(_0x1c5934){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1c5934);_0x5bf802(_0x1c5934);});});}exports[_0xf757('0x18')]=function(_0x54af52){var _0x2ef7fe=this;return new Promise(function(_0x4124a0,_0x23277e){return db[_0xf757('0x19')][_0xf757('0x1a')]({'raw':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1b')]===undefined?!![]:![]:!![],'where':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1c')]||null:null,'attributes':_0x54af52[_0xf757('0x1d')]?_0x54af52['options'][_0xf757('0x1e')]||null:null,'limit':_0x54af52[_0xf757('0x1d')]?_0x54af52[_0xf757('0x1d')][_0xf757('0x1f')]||null:null,'include':_0x54af52['options']?_0x54af52['options'][_0xf757('0x20')]?_[_0xf757('0x21')](_0x54af52[_0xf757('0x1d')][_0xf757('0x20')],function(_0x3d38dd){return{'model':db[_0x3d38dd[_0xf757('0x22')]],'as':_0x3d38dd['as'],'attributes':_0x3d38dd[_0xf757('0x1e')],'include':_0x3d38dd[_0xf757('0x20')]?_[_0xf757('0x21')](_0x3d38dd[_0xf757('0x20')],function(_0x4d9012){return{'model':db[_0x4d9012['model']],'as':_0x4d9012['as'],'attributes':_0x4d9012[_0xf757('0x1e')],'include':_0x4d9012[_0xf757('0x20')]?_[_0xf757('0x21')](_0x4d9012[_0xf757('0x20')],function(_0x207bae){return{'model':db[_0x207bae[_0xf757('0x22')]],'as':_0x207bae['as'],'attributes':_0x207bae[_0xf757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf757('0xd')](function(_0x58ac7a){logger['info'](_0xf757('0x18'),_0x54af52);logger['debug'](_0xf757('0x18'),_0x54af52,JSON['stringify'](_0x58ac7a));_0x4124a0(_0x58ac7a);})[_0xf757('0x23')](function(_0x1345d6){logger['error'](_0xf757('0x18'),_0x1345d6[_0xf757('0x16')],_0x54af52);_0x23277e(_0x2ef7fe[_0xf757('0x13')](0x1f4,_0x1345d6[_0xf757('0x16')]));});});};
\ No newline at end of file
+var _0xce25=['code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x3ab4bb,_0x4568e8){var _0x46aa87=function(_0xcc43bf){while(--_0xcc43bf){_0x3ab4bb['push'](_0x3ab4bb['shift']());}};_0x46aa87(++_0x4568e8);}(_0xce25,0x196));var _0x5ce2=function(_0x238020,_0x3fa739){_0x238020=_0x238020-0x0;var _0x550533=_0xce25[_0x238020];return _0x550533;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ce2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce2('0x1'))['db'];var utils=require(_0x5ce2('0x2'));var logger=require('../../config/logger')(_0x5ce2('0x3'));var config=require(_0x5ce2('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5ce2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x417149,_0x1ab2e7,_0xcb80ee){return new BPromise(function(_0x4a57a6,_0x2ccf81){return client[_0x5ce2('0x6')](_0x417149,_0xcb80ee)[_0x5ce2('0x7')](function(_0x49ede4){logger[_0x5ce2('0x8')](_0x5ce2('0x9'),_0x1ab2e7,_0x5ce2('0xa'));logger[_0x5ce2('0xb')](_0x5ce2('0xc'),_0x1ab2e7,_0x5ce2('0xa'),JSON['stringify'](_0x49ede4));if(_0x49ede4[_0x5ce2('0xd')]){if(_0x49ede4['error'][_0x5ce2('0xe')]===0x1f4){logger[_0x5ce2('0xd')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4['error']['message']);return _0x2ccf81(_0x49ede4['error'][_0x5ce2('0xf')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x49ede4[_0x5ce2('0xd')]['message']);return _0x4a57a6(_0x49ede4[_0x5ce2('0xd')][_0x5ce2('0xf')]);}else{logger[_0x5ce2('0x8')]('Campaign,\x20%s,\x20%s',_0x1ab2e7,_0x5ce2('0xa'));_0x4a57a6(_0x49ede4[_0x5ce2('0x10')][_0x5ce2('0xf')]);}})['catch'](function(_0x4b89d3){logger[_0x5ce2('0xd')](_0x5ce2('0x9'),_0x1ab2e7,_0x4b89d3);_0x2ccf81(_0x4b89d3);});});}exports[_0x5ce2('0x11')]=function(_0x5369e7){var _0x19915d=this;return new Promise(function(_0x30cb39,_0x3dd57a){return db[_0x5ce2('0x12')][_0x5ce2('0x13')]({'raw':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x15')]===undefined?!![]:![]:!![],'where':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x16')]||null:null,'attributes':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x17')]||null:null,'limit':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x18')]||null:null,'include':_0x5369e7[_0x5ce2('0x14')]?_0x5369e7[_0x5ce2('0x14')]['include']?_['map'](_0x5369e7[_0x5ce2('0x14')][_0x5ce2('0x19')],function(_0x3440b5){return{'model':db[_0x3440b5['model']],'as':_0x3440b5['as'],'attributes':_0x3440b5['attributes'],'include':_0x3440b5[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3440b5['include'],function(_0x3008af){return{'model':db[_0x3008af[_0x5ce2('0x1b')]],'as':_0x3008af['as'],'attributes':_0x3008af[_0x5ce2('0x17')],'include':_0x3008af[_0x5ce2('0x19')]?_[_0x5ce2('0x1a')](_0x3008af[_0x5ce2('0x19')],function(_0x3a4bb9){return{'model':db[_0x3a4bb9[_0x5ce2('0x1b')]],'as':_0x3a4bb9['as'],'attributes':_0x3a4bb9[_0x5ce2('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5ce2('0x7')](function(_0x2f4ccd){logger[_0x5ce2('0x8')](_0x5ce2('0x11'),_0x5369e7);logger[_0x5ce2('0xb')](_0x5ce2('0x11'),_0x5369e7,JSON[_0x5ce2('0x1c')](_0x2f4ccd));_0x30cb39(_0x2f4ccd);})[_0x5ce2('0x1d')](function(_0x2898ae){logger[_0x5ce2('0xd')](_0x5ce2('0x11'),_0x2898ae[_0x5ce2('0xf')],_0x5369e7);_0x3dd57a(_0x19915d[_0x5ce2('0xd')](0x1f4,_0x2898ae[_0x5ce2('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 736a7eb..3d000d7 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 _0x6208=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x47370b,_0x1c12e8){var _0x43e3e2=function(_0x52fffe){while(--_0x52fffe){_0x47370b['push'](_0x47370b['shift']());}};_0x43e3e2(++_0x1c12e8);}(_0x6208,0x15c));var _0x8620=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x6208[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var path=require('path');var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require(_0x8620('0x4'));var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8620('0x6'));router['get']('/',auth[_0x8620('0x7')](),controller['index']);router[_0x8620('0x8')](_0x8620('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8620('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x8620('0x8')](_0x8620('0xa'),auth[_0x8620('0x7')](),controller[_0x8620('0xb')]);router[_0x8620('0x8')](_0x8620('0xc'),auth[_0x8620('0x7')](),controller[_0x8620('0xd')]);router[_0x8620('0x8')](_0x8620('0xe'),auth[_0x8620('0x7')](),controller['getHopperBlacks']);router[_0x8620('0x8')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller['getLists']);router[_0x8620('0x8')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller[_0x8620('0x11')]);router[_0x8620('0x12')]('/',auth[_0x8620('0x7')](),controller[_0x8620('0x13')]);router[_0x8620('0x12')](_0x8620('0x14'),auth[_0x8620('0x7')](),controller[_0x8620('0x15')]);router[_0x8620('0x12')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x16')]);router[_0x8620('0x12')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller['addBlackLists']);router[_0x8620('0x17')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller['update']);router[_0x8620('0x18')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller[_0x8620('0x19')]);router['delete'](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x1a')]);router[_0x8620('0x18')]('/:id/blacklists',auth[_0x8620('0x7')](),controller[_0x8620('0x1b')]);module[_0x8620('0x1c')]=router;
\ No newline at end of file
+var _0x5119=['/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists','put','/:id','update','destroy','removeLists','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x19e785,_0x115ef1){var _0x5b4a67=function(_0x156346){while(--_0x156346){_0x19e785['push'](_0x19e785['shift']());}};_0x5b4a67(++_0x115ef1);}(_0x5119,0xc0));var _0x9511=function(_0x3b6d96,_0x5d3241){_0x3b6d96=_0x3b6d96-0x0;var _0x1e6b1c=_0x5119[_0x3b6d96];return _0x1e6b1c;};'use strict';var multer=require(_0x9511('0x0'));var util=require('util');var path=require(_0x9511('0x1'));var timeout=require(_0x9511('0x2'));var express=require(_0x9511('0x3'));var router=express[_0x9511('0x4')]();var fs_extra=require(_0x9511('0x5'));var auth=require(_0x9511('0x6'));var interaction=require(_0x9511('0x7'));var config=require(_0x9511('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9511('0x9')]);router['get']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0xb')]);router[_0x9511('0xc')](_0x9511('0xd'),auth[_0x9511('0xa')](),controller[_0x9511('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x9511('0xf')]);router[_0x9511('0xc')](_0x9511('0x10'),auth['isAuthenticated'](),controller[_0x9511('0x11')]);router[_0x9511('0xc')](_0x9511('0x12'),auth[_0x9511('0xa')](),controller[_0x9511('0x13')]);router[_0x9511('0xc')](_0x9511('0x14'),auth[_0x9511('0xa')](),controller['getLists']);router[_0x9511('0xc')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['getBlackLists']);router[_0x9511('0x16')]('/',auth['isAuthenticated'](),controller[_0x9511('0x17')]);router['post'](_0x9511('0x18'),auth[_0x9511('0xa')](),controller[_0x9511('0x19')]);router['post'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1a')]);router[_0x9511('0x16')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller['addBlackLists']);router[_0x9511('0x1b')](_0x9511('0x1c'),auth['isAuthenticated'](),controller[_0x9511('0x1d')]);router['delete']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0x1e')]);router['delete'](_0x9511('0x14'),auth[_0x9511('0xa')](),controller[_0x9511('0x1f')]);router[_0x9511('0x20')](_0x9511('0x15'),auth[_0x9511('0xa')](),controller[_0x9511('0x21')]);module[_0x9511('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e61b06c..a079c6f 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 _0xbc74=['exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0xbc74,0x162));var _0x4bc7=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbc74[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x4bc7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4bc7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4bc7('0x2')]},'name':{'type':Sequelize[_0x4bc7('0x3')],'get':function(){return this[_0x4bc7('0x4')](_0x4bc7('0x5'));}}};
\ No newline at end of file
+var _0x1497=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x4a258b,_0xb0006c){var _0x5ea6dc=function(_0x43bae0){while(--_0x43bae0){_0x4a258b['push'](_0x4a258b['shift']());}};_0x5ea6dc(++_0xb0006c);}(_0x1497,0x1ec));var _0x7149=function(_0x435d38,_0x2a187a){_0x435d38=_0x435d38-0x0;var _0x49e4f7=_0x1497[_0x435d38];return _0x49e4f7;};'use strict';var Sequelize=require(_0x7149('0x0'));module[_0x7149('0x1')]={'key':{'type':Sequelize[_0x7149('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7149('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x7149('0x2')]},'name':{'type':Sequelize[_0x7149('0x4')],'get':function(){return this[_0x7149('0x5')](_0x7149('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b42015a..0bdddc0 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 _0x22f3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','eml-format','rimraf'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x22f3,0xae));var _0x322f=function(_0x438c82,_0xd70276){_0x438c82=_0x438c82-0x0;var _0x17073a=_0x22f3[_0x438c82];return _0x17073a;};'use strict';var emlformat=require(_0x322f('0x0'));var rimraf=require(_0x322f('0x1'));var zipdir=require(_0x322f('0x2'));var jsonpatch=require(_0x322f('0x3'));var rp=require(_0x322f('0x4'));var moment=require(_0x322f('0x5'));var BPromise=require(_0x322f('0x6'));var Mustache=require(_0x322f('0x7'));var util=require('util');var path=require(_0x322f('0x8'));var sox=require(_0x322f('0x9'));var csv=require(_0x322f('0xa'));var ejs=require(_0x322f('0xb'));var fs=require('fs');var fs_extra=require(_0x322f('0xc'));var _=require('lodash');var squel=require(_0x322f('0xd'));var crypto=require(_0x322f('0xe'));var jsforce=require(_0x322f('0xf'));var deskjs=require(_0x322f('0x10'));var toCsv=require(_0x322f('0xa'));var querystring=require(_0x322f('0x11'));var Papa=require(_0x322f('0x12'));var Redis=require(_0x322f('0x13'));var authService=require(_0x322f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x322f('0x15'));var hardwareService=require(_0x322f('0x16'));var logger=require(_0x322f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x322f('0x18'));var licenseUtil=require(_0x322f('0x19'));var db=require(_0x322f('0x1a'))['db'];function respondWithStatusCode(_0x152be9,_0x39ad87){_0x39ad87=_0x39ad87||0xcc;return function(_0x58bfdf){if(_0x58bfdf){return _0x152be9[_0x322f('0x1b')](_0x39ad87);}return _0x152be9['status'](_0x39ad87)['end']();};}function respondWithResult(_0x497629,_0x2f7320){_0x2f7320=_0x2f7320||0xc8;return function(_0x15685f){if(_0x15685f){return _0x497629[_0x322f('0x1c')](_0x2f7320)[_0x322f('0x1d')](_0x15685f);}};}function respondWithFilteredResult(_0x2683c5,_0x4cda22){return function(_0x1fc16a){if(_0x1fc16a){var _0x452ae6=typeof _0x4cda22['offset']===_0x322f('0x1e')&&typeof _0x4cda22[_0x322f('0x1f')]===_0x322f('0x1e');var _0x1e3852=_0x1fc16a[_0x322f('0x20')];var _0x542583=_0x452ae6?0x0:_0x4cda22['offset'];var _0x171586=_0x452ae6?_0x1fc16a[_0x322f('0x20')]:_0x4cda22[_0x322f('0x21')]+_0x4cda22[_0x322f('0x1f')];var _0x3bcc9c;if(_0x171586>=_0x1e3852){_0x171586=_0x1e3852;_0x3bcc9c=0xc8;}else{_0x3bcc9c=0xce;}_0x2683c5[_0x322f('0x1c')](_0x3bcc9c);return _0x2683c5[_0x322f('0x22')](_0x322f('0x23'),_0x542583+'-'+_0x171586+'/'+_0x1e3852)[_0x322f('0x1d')](_0x1fc16a);}return null;};}function patchUpdates(_0xc9ff8){return function(_0x160c4c){try{jsonpatch[_0x322f('0x24')](_0x160c4c,_0xc9ff8,!![]);}catch(_0x298554){return BPromise[_0x322f('0x25')](_0x298554);}return _0x160c4c[_0x322f('0x26')]();};}function saveUpdates(_0x1c105d,_0x183894){return function(_0x25d529){if(_0x25d529){return _0x25d529[_0x322f('0x27')](_0x1c105d)[_0x322f('0x28')](function(_0x471712){return _0x471712;});}return null;};}function removeEntity(_0xa4cd26,_0x1967d7){return function(_0x3985fd){if(_0x3985fd){return _0x3985fd[_0x322f('0x29')]()[_0x322f('0x28')](function(){var _0x48c0e1=_0x3985fd[_0x322f('0x2a')]({'plain':!![]});var _0x5c7d99=_0x322f('0x2b');return db[_0x322f('0x2c')][_0x322f('0x29')]({'where':{'type':_0x5c7d99,'resourceId':_0x48c0e1['id']}})[_0x322f('0x28')](function(){return _0x3985fd;});})[_0x322f('0x28')](function(){_0xa4cd26[_0x322f('0x1c')](0xcc)[_0x322f('0x2d')]();});}};}function handleEntityNotFound(_0x873312,_0x64f44f){return function(_0x2e9ed3){if(!_0x2e9ed3){_0x873312[_0x322f('0x1b')](0x194);}return _0x2e9ed3;};}function handleError(_0x4ab290,_0x1f777c){_0x1f777c=_0x1f777c||0x1f4;return function(_0x4c5090){logger[_0x322f('0x2e')](_0x4c5090['stack']);if(_0x4c5090[_0x322f('0x2f')]){delete _0x4c5090[_0x322f('0x2f')];}_0x4ab290[_0x322f('0x1c')](_0x1f777c)['send'](_0x4c5090);};}exports['index']=function(_0x292ba0,_0x37b307){var _0x5d4207={},_0x200679={},_0x340fe3={'count':0x0,'rows':[]};var _0x407a4a=_['map'](db[_0x322f('0x30')][_0x322f('0x31')],function(_0xd65f1a){return{'name':_0xd65f1a[_0x322f('0x32')],'type':_0xd65f1a['type'][_0x322f('0x33')]};});_0x200679[_0x322f('0x34')]=_[_0x322f('0x35')](_0x407a4a,_0x322f('0x2f'));_0x200679[_0x322f('0x36')]=_[_0x322f('0x37')](_0x292ba0[_0x322f('0x36')]);_0x200679[_0x322f('0x38')]=_['intersection'](_0x200679[_0x322f('0x34')],_0x200679[_0x322f('0x36')]);_0x5d4207[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x200679[_0x322f('0x34')],qs[_0x322f('0x3b')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3b')]));_0x5d4207['attributes']=_0x5d4207[_0x322f('0x39')]['length']?_0x5d4207[_0x322f('0x39')]:_0x200679['model'];if(!_0x292ba0[_0x322f('0x36')]['hasOwnProperty']('nolimit')){_0x5d4207['limit']=qs['limit'](_0x292ba0[_0x322f('0x36')][_0x322f('0x1f')]);_0x5d4207[_0x322f('0x21')]=qs[_0x322f('0x21')](_0x292ba0[_0x322f('0x36')][_0x322f('0x21')]);}_0x5d4207[_0x322f('0x3c')]=qs[_0x322f('0x3d')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3d')]);_0x5d4207[_0x322f('0x3e')]=qs['filters'](_[_0x322f('0x3f')](_0x292ba0[_0x322f('0x36')],_0x200679['filters']),_0x407a4a);if(_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]){_0x5d4207[_0x322f('0x3e')]=_['merge'](_0x5d4207[_0x322f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x292ba0[_0x322f('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]+'%'}}]});}_0x5d4207=_[_0x322f('0x41')]({},_0x5d4207,_0x292ba0[_0x322f('0x42')]);var _0x57a041={'where':_0x5d4207[_0x322f('0x3e')]};return db[_0x322f('0x30')][_0x322f('0x20')](_0x57a041)['then'](function(_0x9ee9b8){_0x340fe3[_0x322f('0x20')]=_0x9ee9b8;if(_0x292ba0[_0x322f('0x36')][_0x322f('0x43')]){_0x5d4207[_0x322f('0x44')]=[{'all':!![]}];}return db[_0x322f('0x30')][_0x322f('0x45')](_0x5d4207);})[_0x322f('0x28')](function(_0x4228bf){_0x340fe3['rows']=_0x4228bf;return _0x340fe3;})[_0x322f('0x28')](respondWithFilteredResult(_0x37b307,_0x5d4207))[_0x322f('0x46')](handleError(_0x37b307,null));};exports[_0x322f('0x47')]=function(_0x2b3556,_0x126d2d){var _0x503f04={'raw':!![],'where':{'id':_0x2b3556[_0x322f('0x48')]['id']}},_0x358bab={};_0x358bab[_0x322f('0x34')]=_[_0x322f('0x37')](db['CannedAnswer'][_0x322f('0x31')]);_0x358bab[_0x322f('0x36')]=_[_0x322f('0x37')](_0x2b3556[_0x322f('0x36')]);_0x358bab['filters']=_[_0x322f('0x3a')](_0x358bab[_0x322f('0x34')],_0x358bab['query']);_0x503f04[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x358bab['model'],qs[_0x322f('0x3b')](_0x2b3556[_0x322f('0x36')]['fields']));_0x503f04[_0x322f('0x39')]=_0x503f04['attributes'][_0x322f('0x49')]?_0x503f04[_0x322f('0x39')]:_0x358bab['model'];if(_0x2b3556[_0x322f('0x36')][_0x322f('0x43')]){_0x503f04[_0x322f('0x44')]=[{'all':!![]}];}_0x503f04=_[_0x322f('0x41')]({},_0x503f04,_0x2b3556[_0x322f('0x42')]);return db[_0x322f('0x30')][_0x322f('0x4a')](_0x503f04)['then'](handleEntityNotFound(_0x126d2d,null))[_0x322f('0x28')](respondWithResult(_0x126d2d,null))['catch'](handleError(_0x126d2d,null));};exports[_0x322f('0x27')]=function(_0x1e4bdc,_0x220b99){if(_0x1e4bdc['body']['id']){delete _0x1e4bdc['body']['id'];}return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x1e4bdc[_0x322f('0x48')]['id']}})[_0x322f('0x28')](handleEntityNotFound(_0x220b99,null))[_0x322f('0x28')](saveUpdates(_0x1e4bdc[_0x322f('0x4b')],null))['then'](respondWithResult(_0x220b99,null))[_0x322f('0x46')](handleError(_0x220b99,null));};exports[_0x322f('0x29')]=function(_0x29b876,_0x10ae12){return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x29b876['params']['id']}})['then'](handleEntityNotFound(_0x10ae12,null))[_0x322f('0x28')](removeEntity(_0x10ae12,null))['catch'](handleError(_0x10ae12,null));};exports['create']=function(_0x5bc13e,_0x198fa3){var _0x11b77b={'key':_0x5bc13e[_0x322f('0x4b')][_0x322f('0x33')]};if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4c')]){_0x11b77b[_0x322f('0x4c')]=_0x5bc13e[_0x322f('0x4b')]['MailAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')]){_0x11b77b[_0x322f('0x4d')]=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4e')]){_0x11b77b[_0x322f('0x4e')]=_0x5bc13e['body']['OpenchannelAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')]){_0x11b77b['ChatWebsiteId']=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')];}return db['CannedAnswer'][_0x322f('0x4a')]({'where':_0x11b77b})['then'](function(_0x3b9e5c){if(_0x3b9e5c){throw new db[(_0x322f('0x50'))][(_0x322f('0x51'))](_0x322f('0x52'));}return db[_0x322f('0x30')][_0x322f('0x53')](_0x5bc13e['body']);})[_0x322f('0x28')](function(_0x34c816){var _0x4798e0=_0x5bc13e[_0x322f('0x54')]['get']({'plain':!![]});if(!_0x4798e0)throw new Error(_0x322f('0x55'));if(_0x4798e0[_0x322f('0x56')]===_0x322f('0x54')){var _0x28695a=_0x34c816['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x4798e0['userProfileId']},'raw':!![]})[_0x322f('0x28')](function(_0x20dd74){if(_0x20dd74&&_0x20dd74[_0x322f('0x57')]===0x0){return db[_0x322f('0x2c')][_0x322f('0x53')]({'name':_0x28695a['name'],'resourceId':_0x28695a['id'],'type':_0x20dd74[_0x322f('0x2f')],'sectionId':_0x20dd74['id']},{})['then'](function(){return _0x34c816;});}else{return _0x34c816;}})['catch'](function(_0x5e2269){logger[_0x322f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2269);throw _0x5e2269;});}return _0x34c816;})[_0x322f('0x28')](respondWithResult(_0x198fa3,0xc9))['catch'](handleError(_0x198fa3,null));};
\ No newline at end of file
+var _0xf530=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','CannedAnswers','end','sendStatus','error','stack','name','send','map','CannedAnswer','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','rows','catch','show','params','rawAttributes','include','find','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','get','UserProfileSection','userProfileId'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xf530,0xf6));var _0x0f53=function(_0x4e5d34,_0x42fc23){_0x4e5d34=_0x4e5d34-0x0;var _0xdf9586=_0xf530[_0x4e5d34];return _0xdf9586;};'use strict';var emlformat=require(_0x0f53('0x0'));var rimraf=require(_0x0f53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f53('0x2'));var rp=require(_0x0f53('0x3'));var moment=require(_0x0f53('0x4'));var BPromise=require(_0x0f53('0x5'));var Mustache=require(_0x0f53('0x6'));var util=require(_0x0f53('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0f53('0x8'));var crypto=require(_0x0f53('0x9'));var jsforce=require(_0x0f53('0xa'));var deskjs=require(_0x0f53('0xb'));var toCsv=require(_0x0f53('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f53('0xd'));var authService=require(_0x0f53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0f53('0xf'));var hardwareService=require(_0x0f53('0x10'));var logger=require(_0x0f53('0x11'))(_0x0f53('0x12'));var utils=require('../../config/utils');var config=require(_0x0f53('0x13'));var licenseUtil=require(_0x0f53('0x14'));var db=require(_0x0f53('0x15'))['db'];function respondWithStatusCode(_0x590db3,_0x3fa5a9){_0x3fa5a9=_0x3fa5a9||0xcc;return function(_0x5eca1c){if(_0x5eca1c){return _0x590db3['sendStatus'](_0x3fa5a9);}return _0x590db3[_0x0f53('0x16')](_0x3fa5a9)['end']();};}function respondWithResult(_0x2fdd43,_0x5aa4a1){_0x5aa4a1=_0x5aa4a1||0xc8;return function(_0x273b7c){if(_0x273b7c){return _0x2fdd43[_0x0f53('0x16')](_0x5aa4a1)['json'](_0x273b7c);}};}function respondWithFilteredResult(_0x1975b1,_0x101c9e){return function(_0x2415b4){if(_0x2415b4){var _0x444529=typeof _0x101c9e[_0x0f53('0x17')]===_0x0f53('0x18')&&typeof _0x101c9e['limit']===_0x0f53('0x18');var _0x1bd151=_0x2415b4[_0x0f53('0x19')];var _0x3af042=_0x444529?0x0:_0x101c9e['offset'];var _0x405e2c=_0x444529?_0x2415b4[_0x0f53('0x19')]:_0x101c9e[_0x0f53('0x17')]+_0x101c9e[_0x0f53('0x1a')];var _0x3fcbc2;if(_0x405e2c>=_0x1bd151){_0x405e2c=_0x1bd151;_0x3fcbc2=0xc8;}else{_0x3fcbc2=0xce;}_0x1975b1['status'](_0x3fcbc2);return _0x1975b1[_0x0f53('0x1b')](_0x0f53('0x1c'),_0x3af042+'-'+_0x405e2c+'/'+_0x1bd151)['json'](_0x2415b4);}return null;};}function patchUpdates(_0x1d3ead){return function(_0x5e1b19){try{jsonpatch[_0x0f53('0x1d')](_0x5e1b19,_0x1d3ead,!![]);}catch(_0x1b4e6f){return BPromise[_0x0f53('0x1e')](_0x1b4e6f);}return _0x5e1b19['save']();};}function saveUpdates(_0x759735,_0x49dc3e){return function(_0x186071){if(_0x186071){return _0x186071['update'](_0x759735)[_0x0f53('0x1f')](function(_0x50a6dc){return _0x50a6dc;});}return null;};}function removeEntity(_0x5c70b7,_0x82879e){return function(_0x192dee){if(_0x192dee){return _0x192dee[_0x0f53('0x20')]()[_0x0f53('0x1f')](function(){var _0x4dc0d6=_0x192dee['get']({'plain':!![]});var _0x196782=_0x0f53('0x21');return db['UserProfileResource'][_0x0f53('0x20')]({'where':{'type':_0x196782,'resourceId':_0x4dc0d6['id']}})[_0x0f53('0x1f')](function(){return _0x192dee;});})['then'](function(){_0x5c70b7['status'](0xcc)[_0x0f53('0x22')]();});}};}function handleEntityNotFound(_0x3a480c,_0x41b7ad){return function(_0x302f03){if(!_0x302f03){_0x3a480c[_0x0f53('0x23')](0x194);}return _0x302f03;};}function handleError(_0x1ecf62,_0x66e399){_0x66e399=_0x66e399||0x1f4;return function(_0x299dd8){logger[_0x0f53('0x24')](_0x299dd8[_0x0f53('0x25')]);if(_0x299dd8[_0x0f53('0x26')]){delete _0x299dd8[_0x0f53('0x26')];}_0x1ecf62[_0x0f53('0x16')](_0x66e399)[_0x0f53('0x27')](_0x299dd8);};}exports['index']=function(_0x38cbe6,_0x53d371){var _0x3d3c35={},_0x693e27={},_0x51748b={'count':0x0,'rows':[]};var _0x2b1ea9=_[_0x0f53('0x28')](db[_0x0f53('0x29')]['rawAttributes'],function(_0x24cb74){return{'name':_0x24cb74['fieldName'],'type':_0x24cb74['type'][_0x0f53('0x2a')]};});_0x693e27['model']=_[_0x0f53('0x28')](_0x2b1ea9,_0x0f53('0x26'));_0x693e27[_0x0f53('0x2b')]=_[_0x0f53('0x2c')](_0x38cbe6[_0x0f53('0x2b')]);_0x693e27[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x693e27[_0x0f53('0x2f')],_0x693e27[_0x0f53('0x2b')]);_0x3d3c35[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x693e27['model'],qs[_0x0f53('0x31')](_0x38cbe6['query'][_0x0f53('0x31')]));_0x3d3c35[_0x0f53('0x30')]=_0x3d3c35['attributes'][_0x0f53('0x32')]?_0x3d3c35[_0x0f53('0x30')]:_0x693e27[_0x0f53('0x2f')];if(!_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x33')](_0x0f53('0x34'))){_0x3d3c35[_0x0f53('0x1a')]=qs[_0x0f53('0x1a')](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x1a')]);_0x3d3c35[_0x0f53('0x17')]=qs['offset'](_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x17')]);}_0x3d3c35[_0x0f53('0x35')]=qs[_0x0f53('0x36')](_0x38cbe6[_0x0f53('0x2b')]['sort']);_0x3d3c35[_0x0f53('0x37')]=qs[_0x0f53('0x2d')](_['pick'](_0x38cbe6['query'],_0x693e27[_0x0f53('0x2d')]),_0x2b1ea9);if(_0x38cbe6['query']['filter']){_0x3d3c35[_0x0f53('0x37')]=_[_0x0f53('0x38')](_0x3d3c35[_0x0f53('0x37')],{'$or':[{'key':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}},{'value':{'$like':'%'+_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x39')]+'%'}}]});}_0x3d3c35=_['merge']({},_0x3d3c35,_0x38cbe6[_0x0f53('0x3a')]);var _0x9b503e={'where':_0x3d3c35[_0x0f53('0x37')]};return db[_0x0f53('0x29')]['count'](_0x9b503e)[_0x0f53('0x1f')](function(_0x38d8fd){_0x51748b[_0x0f53('0x19')]=_0x38d8fd;if(_0x38cbe6[_0x0f53('0x2b')][_0x0f53('0x3b')]){_0x3d3c35['include']=[{'all':!![]}];}return db[_0x0f53('0x29')]['findAll'](_0x3d3c35);})[_0x0f53('0x1f')](function(_0x216b2f){_0x51748b[_0x0f53('0x3c')]=_0x216b2f;return _0x51748b;})['then'](respondWithFilteredResult(_0x53d371,_0x3d3c35))[_0x0f53('0x3d')](handleError(_0x53d371,null));};exports[_0x0f53('0x3e')]=function(_0x2e081a,_0x729fe6){var _0x35bf00={'raw':!![],'where':{'id':_0x2e081a[_0x0f53('0x3f')]['id']}},_0x38733c={};_0x38733c[_0x0f53('0x2f')]=_[_0x0f53('0x2c')](db[_0x0f53('0x29')][_0x0f53('0x40')]);_0x38733c['query']=_['keys'](_0x2e081a[_0x0f53('0x2b')]);_0x38733c[_0x0f53('0x2d')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],_0x38733c['query']);_0x35bf00[_0x0f53('0x30')]=_[_0x0f53('0x2e')](_0x38733c[_0x0f53('0x2f')],qs[_0x0f53('0x31')](_0x2e081a[_0x0f53('0x2b')]['fields']));_0x35bf00['attributes']=_0x35bf00[_0x0f53('0x30')][_0x0f53('0x32')]?_0x35bf00[_0x0f53('0x30')]:_0x38733c[_0x0f53('0x2f')];if(_0x2e081a[_0x0f53('0x2b')]['includeAll']){_0x35bf00[_0x0f53('0x41')]=[{'all':!![]}];}_0x35bf00=_[_0x0f53('0x38')]({},_0x35bf00,_0x2e081a['options']);return db[_0x0f53('0x29')][_0x0f53('0x42')](_0x35bf00)[_0x0f53('0x1f')](handleEntityNotFound(_0x729fe6,null))[_0x0f53('0x1f')](respondWithResult(_0x729fe6,null))[_0x0f53('0x3d')](handleError(_0x729fe6,null));};exports[_0x0f53('0x43')]=function(_0x1d990e,_0x596c77){if(_0x1d990e[_0x0f53('0x44')]['id']){delete _0x1d990e['body']['id'];}return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1d990e[_0x0f53('0x3f')]['id']}})['then'](handleEntityNotFound(_0x596c77,null))['then'](saveUpdates(_0x1d990e[_0x0f53('0x44')],null))['then'](respondWithResult(_0x596c77,null))[_0x0f53('0x3d')](handleError(_0x596c77,null));};exports[_0x0f53('0x20')]=function(_0x1db7be,_0x5619df){return db[_0x0f53('0x29')][_0x0f53('0x42')]({'where':{'id':_0x1db7be[_0x0f53('0x3f')]['id']}})[_0x0f53('0x1f')](handleEntityNotFound(_0x5619df,null))[_0x0f53('0x1f')](removeEntity(_0x5619df,null))['catch'](handleError(_0x5619df,null));};exports['create']=function(_0x580def,_0x5291fb){var _0x5f3357={'key':_0x580def['body']['key']};if(_0x580def[_0x0f53('0x44')][_0x0f53('0x45')]){_0x5f3357['MailAccountId']=_0x580def[_0x0f53('0x44')][_0x0f53('0x45')];}else if(_0x580def[_0x0f53('0x44')][_0x0f53('0x46')]){_0x5f3357['SmsAccountId']=_0x580def['body'][_0x0f53('0x46')];}else if(_0x580def['body'][_0x0f53('0x47')]){_0x5f3357['OpenchannelAccountId']=_0x580def['body'][_0x0f53('0x47')];}else if(_0x580def['body'][_0x0f53('0x48')]){_0x5f3357[_0x0f53('0x48')]=_0x580def[_0x0f53('0x44')][_0x0f53('0x48')];}return db['CannedAnswer']['find']({'where':_0x5f3357})[_0x0f53('0x1f')](function(_0x4282d8){if(_0x4282d8){throw new db['Sequelize']['ValidationError'](_0x0f53('0x49'));}return db['CannedAnswer']['create'](_0x580def[_0x0f53('0x44')]);})[_0x0f53('0x1f')](function(_0x40c458){var _0x26406b=_0x580def[_0x0f53('0x4a')]['get']({'plain':!![]});if(!_0x26406b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26406b['role']===_0x0f53('0x4a')){var _0x37a297=_0x40c458[_0x0f53('0x4b')]({'plain':!![]});return db[_0x0f53('0x4c')][_0x0f53('0x42')]({'where':{'name':'CannedAnswers','userProfileId':_0x26406b[_0x0f53('0x4d')]},'raw':!![]})[_0x0f53('0x1f')](function(_0x39c837){if(_0x39c837&&_0x39c837[_0x0f53('0x4e')]===0x0){return db['UserProfileResource'][_0x0f53('0x4f')]({'name':_0x37a297[_0x0f53('0x26')],'resourceId':_0x37a297['id'],'type':_0x39c837[_0x0f53('0x26')],'sectionId':_0x39c837['id']},{})[_0x0f53('0x1f')](function(){return _0x40c458;});}else{return _0x40c458;}})[_0x0f53('0x3d')](function(_0x1bccfd){logger[_0x0f53('0x24')](_0x0f53('0x50'),_0x1bccfd);throw _0x1bccfd;});}return _0x40c458;})[_0x0f53('0x1f')](respondWithResult(_0x5291fb,0xc9))['catch'](handleError(_0x5291fb,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index a5020c0..b3f2af4 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 _0xd0a9=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd0a9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x9d0a('0x0'));var logger=require(_0x9d0a('0x1'))(_0x9d0a('0x2'));var moment=require(_0x9d0a('0x3'));var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0a('0x6'));var attributes=require(_0x9d0a('0x7'));module[_0x9d0a('0x8')]=function(_0x13e08f,_0x5c9aa3){return _0x13e08f['define'](_0x9d0a('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d0a('0xa'),'collate':_0x9d0a('0xb')});};
\ No newline at end of file
+var _0xb545=['util','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x49f7fb,_0xc53472){var _0x7a885e=function(_0x452160){while(--_0x452160){_0x49f7fb['push'](_0x49f7fb['shift']());}};_0x7a885e(++_0xc53472);}(_0xb545,0x74));var _0x5b54=function(_0x49eb9d,_0x3e8ff7){_0x49eb9d=_0x49eb9d-0x0;var _0x43124d=_0xb545[_0x49eb9d];return _0x43124d;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var logger=require('../../config/logger')(_0x5b54('0x2'));var moment=require(_0x5b54('0x3'));var BPromise=require(_0x5b54('0x4'));var rp=require(_0x5b54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b54('0x6'));var attributes=require(_0x5b54('0x7'));module['exports']=function(_0x52b69a,_0x358863){return _0x52b69a[_0x5b54('0x8')](_0x5b54('0x9'),attributes,{'tableName':_0x5b54('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b54('0xb'),'collate':_0x5b54('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 286fc0b..7610ac5 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(_0xae0e9b,_0x209495){var _0x5dec3a=function(_0x5df799){while(--_0x5df799){_0xae0e9b['push'](_0xae0e9b['shift']());}};_0x5dec3a(++_0x209495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x23e063,_0x3412f7){var _0xe60535=function(_0x1a8434){while(--_0x1a8434){_0x23e063['push'](_0x23e063['shift']());}};_0xe60535(++_0x3412f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 32ab53c..39adbde 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 _0x3e28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x4104f0,_0x489f33){var _0xe518fd=function(_0x6c75dd){while(--_0x6c75dd){_0x4104f0['push'](_0x4104f0['shift']());}};_0xe518fd(++_0x489f33);}(_0x3e28,0x142));var _0x83e2=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x3e28[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x83e2('0x0'));var util=require(_0x83e2('0x1'));var path=require(_0x83e2('0x2'));var timeout=require(_0x83e2('0x3'));var express=require('express');var router=express[_0x83e2('0x4')]();var fs_extra=require(_0x83e2('0x5'));var auth=require(_0x83e2('0x6'));var interaction=require(_0x83e2('0x7'));var config=require(_0x83e2('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xa')]);router['get'](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0xc')]);router[_0x83e2('0xd')]('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xe')]);router[_0x83e2('0xf')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x10')]);router[_0x83e2('0x11')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x12')]);module[_0x83e2('0x13')]=router;
\ No newline at end of file
+var _0x5eab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x45376e,_0x1ed151){var _0x4f5baf=function(_0x5cb66d){while(--_0x5cb66d){_0x45376e['push'](_0x45376e['shift']());}};_0x4f5baf(++_0x1ed151);}(_0x5eab,0xe4));var _0xb5ea=function(_0x215b11,_0xf38206){_0x215b11=_0x215b11-0x0;var _0x32b490=_0x5eab[_0x215b11];return _0x32b490;};'use strict';var multer=require(_0xb5ea('0x0'));var util=require(_0xb5ea('0x1'));var path=require(_0xb5ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5ea('0x3'));var router=express[_0xb5ea('0x4')]();var fs_extra=require(_0xb5ea('0x5'));var auth=require(_0xb5ea('0x6'));var interaction=require(_0xb5ea('0x7'));var config=require(_0xb5ea('0x8'));var controller=require(_0xb5ea('0x9'));router[_0xb5ea('0xa')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0xc')]);router['get'](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0xe')]);router[_0xb5ea('0xf')]('/',auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x10')]);router[_0xb5ea('0x11')](_0xb5ea('0xd'),auth['isAuthenticated'](),controller[_0xb5ea('0x12')]);router['delete'](_0xb5ea('0xd'),auth[_0xb5ea('0xb')](),controller[_0xb5ea('0x13')]);module[_0xb5ea('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 5862f37..6d9cc9b 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 _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2639fe,_0x508cb9){var _0x5148bd=function(_0x430192){while(--_0x430192){_0x2639fe['push'](_0x2639fe['shift']());}};_0x5148bd(++_0x508cb9);}(_0xaf09,0x10d));var _0x9af0=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xaf09[_0x4b26b5];return _0x4dec71;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}};
\ No newline at end of file
+var _0x90db=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x1bc598,_0x3eda62){var _0x14aa71=function(_0x526a01){while(--_0x526a01){_0x1bc598['push'](_0x1bc598['shift']());}};_0x14aa71(++_0x3eda62);}(_0x90db,0x1c0));var _0xb90d=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x90db[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require('sequelize');module[_0xb90d('0x0')]={'calldate':{'type':Sequelize[_0xb90d('0x1')],'allowNull':![],'defaultValue':_0xb90d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xb90d('0x3')]},'lastapp':{'type':Sequelize[_0xb90d('0x3')]},'lastdata':{'type':Sequelize[_0xb90d('0x3')]},'duration':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb90d('0x3')]},'amaflags':{'type':Sequelize[_0xb90d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb90d('0x3')]},'userfield':{'type':Sequelize[_0xb90d('0x3')]},'uniqueid':{'type':Sequelize[_0xb90d('0x3')]},'linkedid':{'type':Sequelize[_0xb90d('0x3')]},'sequence':{'type':Sequelize[_0xb90d('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb90d('0x3')]},'tag':{'type':Sequelize[_0xb90d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 35681ce..879cad4 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 _0x79a8=['reject','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x79a8,0x1d0));var _0x879a=function(_0x2ebd68,_0x10e9cc){_0x2ebd68=_0x2ebd68-0x0;var _0x2e68d5=_0x79a8[_0x2ebd68];return _0x2e68d5;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];function respondWithStatusCode(_0x320115,_0x54a9b6){_0x54a9b6=_0x54a9b6||0xcc;return function(_0x4738b4){if(_0x4738b4){return _0x320115[_0x879a('0x17')](_0x54a9b6);}return _0x320115[_0x879a('0x18')](_0x54a9b6)[_0x879a('0x19')]();};}function respondWithResult(_0x1a20c5,_0x1c2853){_0x1c2853=_0x1c2853||0xc8;return function(_0x461f1e){if(_0x461f1e){return _0x1a20c5[_0x879a('0x18')](_0x1c2853)[_0x879a('0x1a')](_0x461f1e);}};}function respondWithFilteredResult(_0x16b649,_0x5b4dbe){return function(_0x4a1e0e){if(_0x4a1e0e){var _0x3b8680=typeof _0x5b4dbe[_0x879a('0x1b')]==='undefined'&&typeof _0x5b4dbe[_0x879a('0x1c')]===_0x879a('0x1d');var _0x149105=_0x4a1e0e[_0x879a('0x1e')];var _0x32d9f5=_0x3b8680?0x0:_0x5b4dbe[_0x879a('0x1b')];var _0x4160bd=_0x3b8680?_0x4a1e0e[_0x879a('0x1e')]:_0x5b4dbe[_0x879a('0x1b')]+_0x5b4dbe[_0x879a('0x1c')];var _0x14241a;if(_0x4160bd>=_0x149105){_0x4160bd=_0x149105;_0x14241a=0xc8;}else{_0x14241a=0xce;}_0x16b649[_0x879a('0x18')](_0x14241a);return _0x16b649[_0x879a('0x1f')](_0x879a('0x20'),_0x32d9f5+'-'+_0x4160bd+'/'+_0x149105)['json'](_0x4a1e0e);}return null;};}function patchUpdates(_0x830b36){return function(_0x326e6a){try{jsonpatch['apply'](_0x326e6a,_0x830b36,!![]);}catch(_0x25a57d){return BPromise[_0x879a('0x21')](_0x25a57d);}return _0x326e6a['save']();};}function saveUpdates(_0x56e394,_0x4ed0d6){return function(_0x28c401){if(_0x28c401){return _0x28c401[_0x879a('0x22')](_0x56e394)[_0x879a('0x23')](function(_0x38d42c){return _0x38d42c;});}return null;};}function removeEntity(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(_0x3674f9){return _0x3674f9[_0x879a('0x24')]()[_0x879a('0x23')](function(){_0x4c3808[_0x879a('0x18')](0xcc)[_0x879a('0x19')]();});}};}function handleEntityNotFound(_0x1dd818,_0x7d67ed){return function(_0x14213c){if(!_0x14213c){_0x1dd818[_0x879a('0x17')](0x194);}return _0x14213c;};}function handleError(_0x2ee375,_0x272bf9){_0x272bf9=_0x272bf9||0x1f4;return function(_0x3510cc){logger[_0x879a('0x25')](_0x3510cc['stack']);if(_0x3510cc[_0x879a('0x26')]){delete _0x3510cc[_0x879a('0x26')];}_0x2ee375[_0x879a('0x18')](_0x272bf9)[_0x879a('0x27')](_0x3510cc);};}exports[_0x879a('0x28')]=function(_0x3030e0,_0x3ef6c1){var _0x2d9ed3={},_0x3ca5cd={},_0x1b6c15={'count':0x0,'rows':[]};var _0x2605e9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x99559){return{'name':_0x99559[_0x879a('0x2c')],'type':_0x99559[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x3ca5cd['model']=_[_0x879a('0x29')](_0x2605e9,'name');_0x3ca5cd[_0x879a('0x2f')]=_[_0x879a('0x30')](_0x3030e0[_0x879a('0x2f')]);_0x3ca5cd['filters']=_[_0x879a('0x31')](_0x3ca5cd['model'],_0x3ca5cd['query']);_0x2d9ed3['attributes']=_['intersection'](_0x3ca5cd[_0x879a('0x32')],qs[_0x879a('0x33')](_0x3030e0['query'][_0x879a('0x33')]));_0x2d9ed3[_0x879a('0x34')]=_0x2d9ed3[_0x879a('0x34')]['length']?_0x2d9ed3[_0x879a('0x34')]:_0x3ca5cd[_0x879a('0x32')];if(!_0x3030e0[_0x879a('0x2f')][_0x879a('0x35')]('nolimit')){_0x2d9ed3[_0x879a('0x1c')]=qs[_0x879a('0x1c')](_0x3030e0[_0x879a('0x2f')][_0x879a('0x1c')]);_0x2d9ed3['offset']=qs[_0x879a('0x1b')](_0x3030e0['query'][_0x879a('0x1b')]);}_0x2d9ed3['order']=qs[_0x879a('0x36')](_0x3030e0[_0x879a('0x2f')]['sort']);_0x2d9ed3[_0x879a('0x37')]=qs[_0x879a('0x38')](_[_0x879a('0x39')](_0x3030e0[_0x879a('0x2f')],_0x3ca5cd['filters']),_0x2605e9);if(_0x3030e0[_0x879a('0x2f')][_0x879a('0x3a')]){_0x2d9ed3[_0x879a('0x37')]=_['merge'](_0x2d9ed3['where'],{'$or':_['map'](_0x2605e9,function(_0x5de17f){if(_0x5de17f['type']!==_0x879a('0x3b')){var _0x142bdc={};_0x142bdc[_0x5de17f[_0x879a('0x26')]]={'$like':'%'+_0x3030e0['query']['filter']+'%'};return _0x142bdc;}})});}_0x2d9ed3=_['merge']({},_0x2d9ed3,_0x3030e0[_0x879a('0x3c')]);var _0x5597f9={'where':_0x2d9ed3[_0x879a('0x37')]};return db[_0x879a('0x2a')][_0x879a('0x1e')](_0x5597f9)['then'](function(_0x4f9681){_0x1b6c15[_0x879a('0x1e')]=_0x4f9681;if(_0x3030e0['query'][_0x879a('0x3d')]){_0x2d9ed3[_0x879a('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x879a('0x3f')](_0x2d9ed3);})[_0x879a('0x23')](function(_0x2cc43c){_0x1b6c15['rows']=_0x2cc43c;return _0x1b6c15;})[_0x879a('0x23')](respondWithFilteredResult(_0x3ef6c1,_0x2d9ed3))[_0x879a('0x40')](handleError(_0x3ef6c1,null));};exports['show']=function(_0x7d99a0,_0x2456a4){var _0x4dedfe={'raw':!![],'where':{'id':_0x7d99a0[_0x879a('0x41')]['id']}},_0x14f8e7={};_0x14f8e7[_0x879a('0x32')]=_[_0x879a('0x30')](db['Cdr'][_0x879a('0x2b')]);_0x14f8e7['query']=_[_0x879a('0x30')](_0x7d99a0['query']);_0x14f8e7[_0x879a('0x38')]=_['intersection'](_0x14f8e7[_0x879a('0x32')],_0x14f8e7[_0x879a('0x2f')]);_0x4dedfe[_0x879a('0x34')]=_[_0x879a('0x31')](_0x14f8e7[_0x879a('0x32')],qs[_0x879a('0x33')](_0x7d99a0['query'][_0x879a('0x33')]));_0x4dedfe[_0x879a('0x34')]=_0x4dedfe[_0x879a('0x34')]['length']?_0x4dedfe[_0x879a('0x34')]:_0x14f8e7[_0x879a('0x32')];if(_0x7d99a0[_0x879a('0x2f')]['includeAll']){_0x4dedfe[_0x879a('0x3e')]=[{'all':!![]}];}_0x4dedfe=_[_0x879a('0x42')]({},_0x4dedfe,_0x7d99a0[_0x879a('0x3c')]);return db[_0x879a('0x2a')]['find'](_0x4dedfe)['then'](handleEntityNotFound(_0x2456a4,null))[_0x879a('0x23')](respondWithResult(_0x2456a4,null))[_0x879a('0x40')](handleError(_0x2456a4,null));};exports['create']=function(_0x2ff7cd,_0x4420ac){return db['Cdr'][_0x879a('0x43')](_0x2ff7cd[_0x879a('0x44')],{})[_0x879a('0x23')](respondWithResult(_0x4420ac,0xc9))[_0x879a('0x40')](handleError(_0x4420ac,null));};exports['update']=function(_0x3ffbe6,_0x32933f){if(_0x3ffbe6[_0x879a('0x44')]['id']){delete _0x3ffbe6['body']['id'];}return db['Cdr'][_0x879a('0x45')]({'where':{'id':_0x3ffbe6[_0x879a('0x41')]['id']}})['then'](handleEntityNotFound(_0x32933f,null))[_0x879a('0x23')](saveUpdates(_0x3ffbe6[_0x879a('0x44')],null))[_0x879a('0x23')](respondWithResult(_0x32933f,null))['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x24')]=function(_0x677418,_0xc1c234){return db[_0x879a('0x2a')]['find']({'where':{'id':_0x677418[_0x879a('0x41')]['id']}})[_0x879a('0x23')](handleEntityNotFound(_0xc1c234,null))['then'](removeEntity(_0xc1c234,null))[_0x879a('0x40')](handleError(_0xc1c234,null));};exports[_0x879a('0x46')]=function(_0x59ff36,_0x51644c){return db[_0x879a('0x2a')]['describe']()['then'](respondWithResult(_0x51644c,null))[_0x879a('0x40')](handleError(_0x51644c,null));};
\ No newline at end of file
+var _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x4551fb,_0x2b8b8e){var _0x562381=function(_0x3b3bff){while(--_0x3b3bff){_0x4551fb['push'](_0x4551fb['shift']());}};_0x562381(++_0x2b8b8e);}(_0x1224,0x10d));var _0x4122=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0x1224[_0x2c85c0];return _0xf4d4c9;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 9c2d328..11d8fa1 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(_0x801484,_0x184262){var _0x2ecd18=function(_0x4ee805){while(--_0x4ee805){_0x801484['push'](_0x801484['shift']());}};_0x2ecd18(++_0x184262);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x696973,_0x3b62b4){var _0x527f71=function(_0x4e0db0){while(--_0x4e0db0){_0x696973['push'](_0x696973['shift']());}};_0x527f71(++_0x3b62b4);}(_0x7a54,0x106));var _0x47a5=function(_0x8713ca,_0x1ce76d){_0x8713ca=_0x8713ca-0x0;var _0x2dc080=_0x7a54[_0x8713ca];return _0x2dc080;};'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 ca2345c..a7c8824 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 _0x459f=['error','code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x459f,0x1e8));var _0xf459=function(_0x5f0746,_0x88ab3d){_0x5f0746=_0x5f0746-0x0;var _0x573949=_0x459f[_0x5f0746];return _0x573949;};'use strict';var _=require(_0xf459('0x0'));var util=require(_0xf459('0x1'));var moment=require(_0xf459('0x2'));var BPromise=require(_0xf459('0x3'));var rs=require(_0xf459('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf459('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf459('0x6'));var jayson=require(_0xf459('0x7'));var client=jayson[_0xf459('0x8')][_0xf459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363157,_0x3cd829,_0x3a989e){return new BPromise(function(_0x5ba229,_0x28a153){return client[_0xf459('0xa')](_0x363157,_0x3a989e)[_0xf459('0xb')](function(_0x599c50){logger[_0xf459('0xc')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0xf459('0xd'));logger[_0xf459('0xe')](_0xf459('0xf'),_0x3cd829,'request\x20sent',JSON['stringify'](_0x599c50));if(_0x599c50[_0xf459('0x10')]){if(_0x599c50[_0xf459('0x10')][_0xf459('0x11')]===0x1f4){logger[_0xf459('0x10')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x28a153(_0x599c50[_0xf459('0x10')][_0xf459('0x12')]);}logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x5ba229(_0x599c50['error'][_0xf459('0x12')]);}else{logger['info'](_0xf459('0x13'),_0x3cd829,_0xf459('0xd'));_0x5ba229(_0x599c50[_0xf459('0x14')][_0xf459('0x12')]);}})['catch'](function(_0x2288ec){logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x2288ec);_0x28a153(_0x2288ec);});});}
\ No newline at end of file
+var _0xf34b=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf34b,0xe5));var _0xbf34=function(_0x46e4fd,_0x2a3819){_0x46e4fd=_0x46e4fd-0x0;var _0x2032e1=_0xf34b[_0x46e4fd];return _0x2032e1;};'use strict';var _=require('lodash');var util=require(_0xbf34('0x0'));var moment=require(_0xbf34('0x1'));var BPromise=require(_0xbf34('0x2'));var rs=require(_0xbf34('0x3'));var fs=require('fs');var Redis=require(_0xbf34('0x4'));var db=require(_0xbf34('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf34('0x7'));var client=jayson[_0xbf34('0x8')][_0xbf34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x495e47,_0x136354,_0x1f50c3){return new BPromise(function(_0x3e1ce2,_0x35897e){return client['request'](_0x495e47,_0x1f50c3)[_0xbf34('0xa')](function(_0x212bc5){logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');logger[_0xbf34('0xd')](_0xbf34('0xe'),_0x136354,_0xbf34('0xf'),JSON[_0xbf34('0x10')](_0x212bc5));if(_0x212bc5[_0xbf34('0x11')]){if(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x12')]===0x1f4){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x35897e(_0x212bc5[_0xbf34('0x11')]['message']);}logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);return _0x3e1ce2(_0x212bc5[_0xbf34('0x11')][_0xbf34('0x13')]);}else{logger[_0xbf34('0xb')](_0xbf34('0xc'),_0x136354,'request\x20sent');_0x3e1ce2(_0x212bc5[_0xbf34('0x14')][_0xbf34('0x13')]);}})[_0xbf34('0x15')](function(_0x198e9c){logger[_0xbf34('0x11')](_0xbf34('0xc'),_0x136354,_0x198e9c);_0x35897e(_0x198e9c);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8fefaea..c527281 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19f727,_0x28224e){var _0x412836=function(_0x40634f){while(--_0x40634f){_0x19f727['push'](_0x19f727['shift']());}};_0x412836(++_0x28224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x46891a,_0x3e3051){var _0x4c578d=function(_0x3cf400){while(--_0x3cf400){_0x46891a['push'](_0x46891a['shift']());}};_0x4c578d(++_0x3e3051);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 68ff948..24f61d0 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 _0x278a=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x278a,0x90));var _0xa278=function(_0x37c900,_0x363707){_0x37c900=_0x37c900-0x0;var _0x85741f=_0x278a[_0x37c900];return _0x85741f;};'use strict';var Sequelize=require('sequelize');module[_0xa278('0x0')]={'priority':{'type':Sequelize[_0xa278('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa278('0x2')],'allowNull':![],'defaultValue':_0xa278('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa278('0x4')}};
\ No newline at end of file
+var _0x4089=['INTEGER','STRING','noop','*,*,*,*'];(function(_0x43fd11,_0x5f4a49){var _0x402181=function(_0x4e2ab2){while(--_0x4e2ab2){_0x43fd11['push'](_0x43fd11['shift']());}};_0x402181(++_0x5f4a49);}(_0x4089,0x84));var _0x9408=function(_0x30fb66,_0x35da54){_0x30fb66=_0x30fb66-0x0;var _0x2880d9=_0x4089[_0x30fb66];return _0x2880d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9408('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9408('0x1')],'allowNull':![],'defaultValue':_0x9408('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9408('0x1')]},'interval':{'type':Sequelize[_0x9408('0x1')],'defaultValue':_0x9408('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 9c6e455..c358aef 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 _0x3ae9=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','show','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x16eadc,_0x3fc953){var _0x5b05c8=function(_0xd8b9cf){while(--_0xd8b9cf){_0x16eadc['push'](_0x16eadc['shift']());}};_0x5b05c8(++_0x3fc953);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3ae9[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];function respondWithStatusCode(_0x1a23a3,_0x4a9f52){_0x4a9f52=_0x4a9f52||0xcc;return function(_0x571e5f){if(_0x571e5f){return _0x1a23a3[_0x93ae('0x16')](_0x4a9f52);}return _0x1a23a3['status'](_0x4a9f52)[_0x93ae('0x17')]();};}function respondWithResult(_0xbaf0e,_0x5b4ea1){_0x5b4ea1=_0x5b4ea1||0xc8;return function(_0x392a55){if(_0x392a55){return _0xbaf0e[_0x93ae('0x18')](_0x5b4ea1)[_0x93ae('0x19')](_0x392a55);}};}function respondWithFilteredResult(_0x1f8aa2,_0x121937){return function(_0x2d1df5){if(_0x2d1df5){var _0x5ed82a=typeof _0x121937[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x121937[_0x93ae('0x1c')]==='undefined';var _0x1a1718=_0x2d1df5['count'];var _0x54cfd0=_0x5ed82a?0x0:_0x121937[_0x93ae('0x1a')];var _0x51c77d=_0x5ed82a?_0x2d1df5[_0x93ae('0x1d')]:_0x121937[_0x93ae('0x1a')]+_0x121937['limit'];var _0x2dd19a;if(_0x51c77d>=_0x1a1718){_0x51c77d=_0x1a1718;_0x2dd19a=0xc8;}else{_0x2dd19a=0xce;}_0x1f8aa2[_0x93ae('0x18')](_0x2dd19a);return _0x1f8aa2[_0x93ae('0x1e')](_0x93ae('0x1f'),_0x54cfd0+'-'+_0x51c77d+'/'+_0x1a1718)['json'](_0x2d1df5);}return null;};}function patchUpdates(_0x128913){return function(_0x2f4187){try{jsonpatch['apply'](_0x2f4187,_0x128913,!![]);}catch(_0x3e0407){return BPromise[_0x93ae('0x20')](_0x3e0407);}return _0x2f4187[_0x93ae('0x21')]();};}function saveUpdates(_0x29922f,_0x26d5ac){return function(_0x468fdf){if(_0x468fdf){return _0x468fdf[_0x93ae('0x22')](_0x29922f)['then'](function(_0x5e7c32){return _0x5e7c32;});}return null;};}function removeEntity(_0xd33af5,_0x283e50){return function(_0x4f9f43){if(_0x4f9f43){return _0x4f9f43['destroy']()[_0x93ae('0x23')](function(){_0xd33af5[_0x93ae('0x18')](0xcc)[_0x93ae('0x17')]();});}};}function handleEntityNotFound(_0x10f6a3,_0x1abea7){return function(_0xe17086){if(!_0xe17086){_0x10f6a3[_0x93ae('0x16')](0x194);}return _0xe17086;};}function handleError(_0x32ddca,_0x542656){_0x542656=_0x542656||0x1f4;return function(_0x564c15){logger['error'](_0x564c15[_0x93ae('0x24')]);if(_0x564c15[_0x93ae('0x25')]){delete _0x564c15[_0x93ae('0x25')];}_0x32ddca[_0x93ae('0x18')](_0x542656)[_0x93ae('0x26')](_0x564c15);};}exports[_0x93ae('0x27')]=function(_0x520d6d,_0x54a37b){var _0x223f42={'raw':!![],'where':{'id':_0x520d6d[_0x93ae('0x28')]['id']}},_0x115ac5={};_0x115ac5[_0x93ae('0x29')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x115ac5[_0x93ae('0x2a')]=_['keys'](_0x520d6d[_0x93ae('0x2a')]);_0x115ac5[_0x93ae('0x2b')]=_['intersection'](_0x115ac5[_0x93ae('0x29')],_0x115ac5[_0x93ae('0x2a')]);_0x223f42[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x115ac5[_0x93ae('0x29')],qs[_0x93ae('0x2e')](_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x2e')]));_0x223f42['attributes']=_0x223f42[_0x93ae('0x2c')][_0x93ae('0x2f')]?_0x223f42[_0x93ae('0x2c')]:_0x115ac5[_0x93ae('0x29')];if(_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x30')]){_0x223f42[_0x93ae('0x31')]=[{'all':!![]}];}_0x223f42=_[_0x93ae('0x32')]({},_0x223f42,_0x520d6d['options']);return db[_0x93ae('0x33')]['find'](_0x223f42)[_0x93ae('0x23')](handleEntityNotFound(_0x54a37b,null))[_0x93ae('0x23')](respondWithResult(_0x54a37b,null))[_0x93ae('0x34')](handleError(_0x54a37b,null));};exports[_0x93ae('0x22')]=function(_0x1778f7,_0x46ade5){if(_0x1778f7['body']['id']){delete _0x1778f7[_0x93ae('0x35')]['id'];}return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x1778f7['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x46ade5,null))[_0x93ae('0x23')](saveUpdates(_0x1778f7[_0x93ae('0x35')],null))['then'](respondWithResult(_0x46ade5,null))['catch'](handleError(_0x46ade5,null));};exports[_0x93ae('0x37')]=function(_0x266126,_0x31e9b0){return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x266126[_0x93ae('0x28')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x31e9b0,null))[_0x93ae('0x23')](removeEntity(_0x31e9b0,null))[_0x93ae('0x34')](handleError(_0x31e9b0,null));};
\ No newline at end of file
+var _0xd52d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','ChatApplication','catch','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x541c5d,_0x2ef384){var _0x3568b5=function(_0x589bd1){while(--_0x589bd1){_0x541c5d['push'](_0x541c5d['shift']());}};_0x3568b5(++_0x2ef384);}(_0xd52d,0x1c7));var _0xdd52=function(_0x2a5497,_0x19bceb){_0x2a5497=_0x2a5497-0x0;var _0x5a335a=_0xd52d[_0x2a5497];return _0x5a335a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x592f15,_0x1156cc){return function(_0x353fde){if(!_0x353fde){_0x592f15[_0xdd52('0x26')](0x194);}return _0x353fde;};}function handleError(_0x2f2dfa,_0x4ee66d){_0x4ee66d=_0x4ee66d||0x1f4;return function(_0x41c7e5){logger[_0xdd52('0x27')](_0x41c7e5[_0xdd52('0x28')]);if(_0x41c7e5['name']){delete _0x41c7e5['name'];}_0x2f2dfa[_0xdd52('0x1a')](_0x4ee66d)['send'](_0x41c7e5);};}exports[_0xdd52('0x29')]=function(_0x3f96bd,_0xeb81a0){var _0x539418={'raw':!![],'where':{'id':_0x3f96bd[_0xdd52('0x2a')]['id']}},_0x499e14={};_0x499e14[_0xdd52('0x2b')]=_[_0xdd52('0x2c')](db['ChatApplication']['rawAttributes']);_0x499e14[_0xdd52('0x2d')]=_['keys'](_0x3f96bd[_0xdd52('0x2d')]);_0x499e14[_0xdd52('0x2e')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],_0x499e14[_0xdd52('0x2d')]);_0x539418[_0xdd52('0x30')]=_[_0xdd52('0x2f')](_0x499e14[_0xdd52('0x2b')],qs[_0xdd52('0x31')](_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x31')]));_0x539418[_0xdd52('0x30')]=_0x539418[_0xdd52('0x30')][_0xdd52('0x32')]?_0x539418[_0xdd52('0x30')]:_0x499e14[_0xdd52('0x2b')];if(_0x3f96bd[_0xdd52('0x2d')][_0xdd52('0x33')]){_0x539418[_0xdd52('0x34')]=[{'all':!![]}];}_0x539418=_[_0xdd52('0x35')]({},_0x539418,_0x3f96bd[_0xdd52('0x36')]);return db['ChatApplication'][_0xdd52('0x37')](_0x539418)[_0xdd52('0x24')](handleEntityNotFound(_0xeb81a0,null))['then'](respondWithResult(_0xeb81a0,null))['catch'](handleError(_0xeb81a0,null));};exports['update']=function(_0x17f735,_0x10d053){if(_0x17f735[_0xdd52('0x38')]['id']){delete _0x17f735[_0xdd52('0x38')]['id'];}return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x17f735[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x10d053,null))[_0xdd52('0x24')](saveUpdates(_0x17f735[_0xdd52('0x38')],null))['then'](respondWithResult(_0x10d053,null))[_0xdd52('0x3a')](handleError(_0x10d053,null));};exports[_0xdd52('0x25')]=function(_0x19ab35,_0x3497c3){return db[_0xdd52('0x39')][_0xdd52('0x37')]({'where':{'id':_0x19ab35[_0xdd52('0x2a')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x3497c3,null))[_0xdd52('0x24')](removeEntity(_0x3497c3,null))[_0xdd52('0x3a')](handleError(_0x3497c3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d5a7d1a..3c1ba58 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 _0x8743=['bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8743,0xa3));var _0x3874=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8743[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var logger=require(_0x3874('0x2'))(_0x3874('0x3'));var moment=require(_0x3874('0x4'));var BPromise=require(_0x3874('0x5'));var rp=require(_0x3874('0x6'));var fs=require('fs');var path=require(_0x3874('0x7'));var rimraf=require(_0x3874('0x8'));var config=require('../../config/environment');var attributes=require(_0x3874('0x9'));module[_0x3874('0xa')]=function(_0x1de2f9,_0x4fd2de){return _0x1de2f9[_0x3874('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3874('0xc'),'collate':_0x3874('0xd')});};
\ No newline at end of file
+var _0xd2d6=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x2b30cc,_0x54f567){_0x2b30cc=_0x2b30cc-0x0;var _0x39122c=_0xd2d6[_0x2b30cc];return _0x39122c;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))('api');var moment=require(_0x6d2d('0x3'));var BPromise=require(_0x6d2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2d('0x5'));var rimraf=require(_0x6d2d('0x6'));var config=require(_0x6d2d('0x7'));var attributes=require(_0x6d2d('0x8'));module[_0x6d2d('0x9')]=function(_0x43dfa0,_0x3575eb){return _0x43dfa0[_0x6d2d('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d2d('0xb'),'collate':_0x6d2d('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5640d0b..97d4ef2 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 _0xa0b1=['stringify','error','message','info','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1f7f32,_0x1e0a55){var _0x47ab3a=function(_0x3d6afc){while(--_0x3d6afc){_0x1f7f32['push'](_0x1f7f32['shift']());}};_0x47ab3a(++_0x1e0a55);}(_0xa0b1,0xa5));var _0x1a0b=function(_0x49923f,_0x671404){_0x49923f=_0x49923f-0x0;var _0x560684=_0xa0b1[_0x49923f];return _0x560684;};'use strict';var _=require(_0x1a0b('0x0'));var util=require('util');var moment=require(_0x1a0b('0x1'));var BPromise=require(_0x1a0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0b('0x3'));var logger=require(_0x1a0b('0x4'))(_0x1a0b('0x5'));var config=require(_0x1a0b('0x6'));var jayson=require(_0x1a0b('0x7'));var client=jayson[_0x1a0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311a81,_0x52fe19,_0x34d49e){return new BPromise(function(_0x444f46,_0x40e322){return client[_0x1a0b('0x9')](_0x311a81,_0x34d49e)[_0x1a0b('0xa')](function(_0x33e882){logger['info'](_0x1a0b('0xb'),_0x52fe19,_0x1a0b('0xc'));logger[_0x1a0b('0xd')](_0x1a0b('0xe'),_0x52fe19,'request\x20sent',JSON[_0x1a0b('0xf')](_0x33e882));if(_0x33e882[_0x1a0b('0x10')]){if(_0x33e882[_0x1a0b('0x10')]['code']===0x1f4){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x33e882[_0x1a0b('0x10')]['message']);return _0x40e322(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}logger[_0x1a0b('0x10')](_0x1a0b('0xb'),_0x52fe19,_0x33e882['error'][_0x1a0b('0x11')]);return _0x444f46(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}else{logger[_0x1a0b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x52fe19,_0x1a0b('0xc'));_0x444f46(_0x33e882['result'][_0x1a0b('0x11')]);}})[_0x1a0b('0x13')](function(_0x24d28a){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x24d28a);_0x40e322(_0x24d28a);});});}
\ No newline at end of file
+var _0x1ec9=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x1ec9,0x142));var _0x91ec=function(_0x7dfaa,_0x1c8ae2){_0x7dfaa=_0x7dfaa-0x0;var _0x561f7d=_0x1ec9[_0x7dfaa];return _0x561f7d;};'use strict';var _=require(_0x91ec('0x0'));var util=require(_0x91ec('0x1'));var moment=require('moment');var BPromise=require(_0x91ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91ec('0x3'))['db'];var utils=require(_0x91ec('0x4'));var logger=require(_0x91ec('0x5'))(_0x91ec('0x6'));var config=require(_0x91ec('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539328,_0x4266ed,_0xdfe11d){return new BPromise(function(_0x5ccb50,_0x198664){return client[_0x91ec('0x9')](_0x539328,_0xdfe11d)[_0x91ec('0xa')](function(_0x42f1a2){logger['info'](_0x91ec('0xb'),_0x4266ed,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4266ed,'request\x20sent',JSON[_0x91ec('0xc')](_0x42f1a2));if(_0x42f1a2[_0x91ec('0xd')]){if(_0x42f1a2['error'][_0x91ec('0xe')]===0x1f4){logger[_0x91ec('0xd')](_0x91ec('0xb'),_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x198664(_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);}logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x42f1a2[_0x91ec('0xd')][_0x91ec('0xf')]);return _0x5ccb50(_0x42f1a2[_0x91ec('0xd')]['message']);}else{logger[_0x91ec('0x10')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,'request\x20sent');_0x5ccb50(_0x42f1a2[_0x91ec('0x11')][_0x91ec('0xf')]);}})[_0x91ec('0x12')](function(_0x4075ed){logger[_0x91ec('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4266ed,_0x4075ed);_0x198664(_0x4075ed);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 48d9f5e..ef4ed64 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 _0x7b1e=['fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579d67,_0x56a6aa){var _0x826234=function(_0x270f06){while(--_0x270f06){_0x579d67['push'](_0x579d67['shift']());}};_0x826234(++_0x56a6aa);}(_0x7b1e,0xe8));var _0xe7b1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x7b1e[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xe7b1('0x0'));var util=require(_0xe7b1('0x1'));var path=require(_0xe7b1('0x2'));var timeout=require(_0xe7b1('0x3'));var express=require(_0xe7b1('0x4'));var router=express[_0xe7b1('0x5')]();var fs_extra=require(_0xe7b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7b1('0x7'));var config=require(_0xe7b1('0x8'));var controller=require(_0xe7b1('0x9'));router[_0xe7b1('0xa')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe7b1('0xc')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xd')]);router[_0xe7b1('0xe')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xf')]);module[_0xe7b1('0x10')]=router;
\ No newline at end of file
+var _0xaa79=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x8c20da,_0x49cfd6){var _0x50d918=function(_0xeaf97d){while(--_0xeaf97d){_0x8c20da['push'](_0x8c20da['shift']());}};_0x50d918(++_0x49cfd6);}(_0xaa79,0xd6));var _0x9aa7=function(_0x396052,_0x46a315){_0x396052=_0x396052-0x0;var _0x2221c4=_0xaa79[_0x396052];return _0x2221c4;};'use strict';var multer=require(_0x9aa7('0x0'));var util=require(_0x9aa7('0x1'));var path=require(_0x9aa7('0x2'));var timeout=require(_0x9aa7('0x3'));var express=require(_0x9aa7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9aa7('0x5'));var interaction=require(_0x9aa7('0x6'));var config=require(_0x9aa7('0x7'));var controller=require(_0x9aa7('0x8'));router[_0x9aa7('0x9')](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xc')]);router['put'](_0x9aa7('0xa'),auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xd')]);router[_0x9aa7('0xe')]('/:id',auth[_0x9aa7('0xb')](),controller[_0x9aa7('0xf')]);module[_0x9aa7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index dc31b56..41dcc55 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 _0x3adf=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa91eed,_0x4b7c93){var _0x1c77fc=function(_0x67d2f){while(--_0x67d2f){_0xa91eed['push'](_0xa91eed['shift']());}};_0x1c77fc(++_0x4b7c93);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x1193d0,_0x299caa){_0x1193d0=_0x1193d0-0x0;var _0x16d3a3=_0x3adf[_0x1193d0];return _0x16d3a3;};'use strict';var Sequelize=require(_0xf3ad('0x0'));module[_0xf3ad('0x1')]={'name':{'type':Sequelize[_0xf3ad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf3ad('0x2')]},'write':{'type':Sequelize[_0xf3ad('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc177=['STRING','BOOLEAN','sequelize','exports'];(function(_0x51c021,_0x1706ca){var _0xab7c52=function(_0x32f913){while(--_0x32f913){_0x51c021['push'](_0x51c021['shift']());}};_0xab7c52(++_0x1706ca);}(_0xc177,0x1b2));var _0x7c17=function(_0x319f8c,_0x4db9c4){_0x319f8c=_0x319f8c-0x0;var _0x9be6dc=_0xc177[_0x319f8c];return _0x9be6dc;};'use strict';var Sequelize=require(_0x7c17('0x0'));module[_0x7c17('0x1')]={'name':{'type':Sequelize[_0x7c17('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7c17('0x2')]},'write':{'type':Sequelize[_0x7c17('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 df4b2c8..268f618 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 _0x5b75=['show','params','fields','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','ChatGroup','include','findAll','rows','catch'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x5b75,0x137));var _0x55b7=function(_0x5211bc,_0x410051){_0x5211bc=_0x5211bc-0x0;var _0x2e5a9f=_0x5b75[_0x5211bc];return _0x2e5a9f;};'use strict';var emlformat=require(_0x55b7('0x0'));var rimraf=require(_0x55b7('0x1'));var zipdir=require(_0x55b7('0x2'));var jsonpatch=require(_0x55b7('0x3'));var rp=require('request-promise');var moment=require(_0x55b7('0x4'));var BPromise=require(_0x55b7('0x5'));var Mustache=require(_0x55b7('0x6'));var util=require('util');var path=require(_0x55b7('0x7'));var sox=require(_0x55b7('0x8'));var csv=require(_0x55b7('0x9'));var ejs=require(_0x55b7('0xa'));var fs=require('fs');var fs_extra=require(_0x55b7('0xb'));var _=require(_0x55b7('0xc'));var squel=require(_0x55b7('0xd'));var crypto=require(_0x55b7('0xe'));var jsforce=require(_0x55b7('0xf'));var deskjs=require(_0x55b7('0x10'));var toCsv=require(_0x55b7('0x9'));var querystring=require('querystring');var Papa=require(_0x55b7('0x11'));var Redis=require(_0x55b7('0x12'));var authService=require(_0x55b7('0x13'));var qs=require(_0x55b7('0x14'));var as=require(_0x55b7('0x15'));var hardwareService=require(_0x55b7('0x16'));var logger=require(_0x55b7('0x17'))(_0x55b7('0x18'));var utils=require(_0x55b7('0x19'));var config=require(_0x55b7('0x1a'));var licenseUtil=require(_0x55b7('0x1b'));var db=require(_0x55b7('0x1c'))['db'];config[_0x55b7('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x55b7('0x1e'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3feb9b,_0xa5ab){_0xa5ab=_0xa5ab||0xcc;return function(_0xd47649){if(_0xd47649){return _0x3feb9b[_0x55b7('0x1f')](_0xa5ab);}return _0x3feb9b[_0x55b7('0x20')](_0xa5ab)['end']();};}function respondWithResult(_0x44ca4c,_0x29dad5){_0x29dad5=_0x29dad5||0xc8;return function(_0x5801b1){if(_0x5801b1){return _0x44ca4c[_0x55b7('0x20')](_0x29dad5)[_0x55b7('0x21')](_0x5801b1);}};}function respondWithFilteredResult(_0x5a85d9,_0xdc2a74){return function(_0x9b18ba){if(_0x9b18ba){var _0x2efc38=typeof _0xdc2a74[_0x55b7('0x22')]===_0x55b7('0x23')&&typeof _0xdc2a74[_0x55b7('0x24')]==='undefined';var _0x4d62af=_0x9b18ba[_0x55b7('0x25')];var _0x2ce3dc=_0x2efc38?0x0:_0xdc2a74[_0x55b7('0x22')];var _0x1e3645=_0x2efc38?_0x9b18ba['count']:_0xdc2a74['offset']+_0xdc2a74[_0x55b7('0x24')];var _0x6e295c;if(_0x1e3645>=_0x4d62af){_0x1e3645=_0x4d62af;_0x6e295c=0xc8;}else{_0x6e295c=0xce;}_0x5a85d9[_0x55b7('0x20')](_0x6e295c);return _0x5a85d9[_0x55b7('0x26')](_0x55b7('0x27'),_0x2ce3dc+'-'+_0x1e3645+'/'+_0x4d62af)['json'](_0x9b18ba);}return null;};}function patchUpdates(_0x28dbfb){return function(_0xf497fc){try{jsonpatch[_0x55b7('0x28')](_0xf497fc,_0x28dbfb,!![]);}catch(_0x2332a2){return BPromise[_0x55b7('0x29')](_0x2332a2);}return _0xf497fc['save']();};}function saveUpdates(_0x5b0343,_0x472d3f){return function(_0x5e6c86){if(_0x5e6c86){return _0x5e6c86[_0x55b7('0x2a')](_0x5b0343)[_0x55b7('0x2b')](function(_0x5f0781){return _0x5f0781;});}return null;};}function removeEntity(_0x12a218,_0x1008cf){return function(_0x1b19be){if(_0x1b19be){return _0x1b19be[_0x55b7('0x2c')]()[_0x55b7('0x2b')](function(){_0x12a218[_0x55b7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e434,_0x34aee7){return function(_0x22a246){if(!_0x22a246){_0x46e434[_0x55b7('0x1f')](0x194);}return _0x22a246;};}function handleError(_0x3af05e,_0x4b541c){_0x4b541c=_0x4b541c||0x1f4;return function(_0x16f9bb){logger['error'](_0x16f9bb[_0x55b7('0x2d')]);if(_0x16f9bb[_0x55b7('0x2e')]){delete _0x16f9bb['name'];}_0x3af05e['status'](_0x4b541c)['send'](_0x16f9bb);};}exports[_0x55b7('0x2f')]=function(_0x5f326f,_0x31d6dc){var _0x3b1935={},_0x2878a9={},_0x199fcd={'count':0x0,'rows':[]};var _0x35e1fb=_['map'](db['ChatGroup'][_0x55b7('0x30')],function(_0x3645ac){return{'name':_0x3645ac[_0x55b7('0x31')],'type':_0x3645ac[_0x55b7('0x32')][_0x55b7('0x33')]};});_0x2878a9[_0x55b7('0x34')]=_['map'](_0x35e1fb,_0x55b7('0x2e'));_0x2878a9[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x5f326f[_0x55b7('0x35')]);_0x2878a9[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],_0x2878a9['query']);_0x3b1935[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],qs['fields'](_0x5f326f['query']['fields']));_0x3b1935[_0x55b7('0x39')]=_0x3b1935[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x3b1935[_0x55b7('0x39')]:_0x2878a9[_0x55b7('0x34')];if(!_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3b')]('nolimit')){_0x3b1935[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0x5f326f['query']['limit']);_0x3b1935['offset']=qs['offset'](_0x5f326f['query'][_0x55b7('0x22')]);}_0x3b1935[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x3b1935['where']=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0x5f326f[_0x55b7('0x35')],_0x2878a9[_0x55b7('0x37')]),_0x35e1fb);if(_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x3b1935[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x3b1935[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x35e1fb,function(_0x613a81){if(_0x613a81['type']!=='VIRTUAL'){var _0x12976b={};_0x12976b[_0x613a81['name']]={'$like':'%'+_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x12976b;}})});}_0x3b1935=_[_0x55b7('0x41')]({},_0x3b1935,_0x5f326f[_0x55b7('0x43')]);var _0x25c857={'where':_0x3b1935[_0x55b7('0x40')]};return db[_0x55b7('0x44')][_0x55b7('0x25')](_0x25c857)[_0x55b7('0x2b')](function(_0x34bf78){_0x199fcd[_0x55b7('0x25')]=_0x34bf78;if(_0x5f326f[_0x55b7('0x35')]['includeAll']){_0x3b1935[_0x55b7('0x45')]=[{'all':!![]}];}return db[_0x55b7('0x44')][_0x55b7('0x46')](_0x3b1935);})[_0x55b7('0x2b')](function(_0x2c4d49){_0x199fcd[_0x55b7('0x47')]=_0x2c4d49;return _0x199fcd;})[_0x55b7('0x2b')](respondWithFilteredResult(_0x31d6dc,_0x3b1935))[_0x55b7('0x48')](handleError(_0x31d6dc,null));};exports[_0x55b7('0x49')]=function(_0x477897,_0x477982){var _0x16f80f={'raw':!![],'where':{'id':_0x477897[_0x55b7('0x4a')]['id']}},_0x52146f={};_0x52146f[_0x55b7('0x34')]=_[_0x55b7('0x36')](db[_0x55b7('0x44')][_0x55b7('0x30')]);_0x52146f[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x477897[_0x55b7('0x35')]);_0x52146f['filters']=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],_0x52146f['query']);_0x16f80f[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0x477897[_0x55b7('0x35')]['fields']));_0x16f80f[_0x55b7('0x39')]=_0x16f80f[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x16f80f[_0x55b7('0x39')]:_0x52146f[_0x55b7('0x34')];if(_0x477897[_0x55b7('0x35')][_0x55b7('0x4c')]){_0x16f80f['include']=[{'all':!![]}];}_0x16f80f=_[_0x55b7('0x41')]({},_0x16f80f,_0x477897['options']);return db[_0x55b7('0x44')][_0x55b7('0x4d')](_0x16f80f)[_0x55b7('0x2b')](handleEntityNotFound(_0x477982,null))[_0x55b7('0x2b')](respondWithResult(_0x477982,null))[_0x55b7('0x48')](handleError(_0x477982,null));};exports[_0x55b7('0x4e')]=function(_0x9055df,_0x42bfad){return db[_0x55b7('0x44')]['create'](_0x9055df[_0x55b7('0x4f')],{})[_0x55b7('0x2b')](respondWithResult(_0x42bfad,0xc9))['catch'](handleError(_0x42bfad,null));};exports[_0x55b7('0x2a')]=function(_0x5b7d1e,_0x49f01c){if(_0x5b7d1e[_0x55b7('0x4f')]['id']){delete _0x5b7d1e[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5b7d1e[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x49f01c,null))[_0x55b7('0x2b')](saveUpdates(_0x5b7d1e[_0x55b7('0x4f')],null))['then'](respondWithResult(_0x49f01c,null))['catch'](handleError(_0x49f01c,null));};exports[_0x55b7('0x2c')]=function(_0x3923ad,_0x483713){return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x3923ad[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x483713,null))[_0x55b7('0x2b')](removeEntity(_0x483713,null))[_0x55b7('0x48')](handleError(_0x483713,null));};exports['describe']=function(_0x143d56,_0x156b7f){return db[_0x55b7('0x44')][_0x55b7('0x50')]()['then'](respondWithResult(_0x156b7f,null))[_0x55b7('0x48')](handleError(_0x156b7f,null));};exports[_0x55b7('0x51')]=function(_0x285a01,_0x44ede3,_0x5ea535){return db[_0x55b7('0x52')][_0x55b7('0x25')]({'where':{'ChatGroupId':_0x285a01['params']['id'],'ToId':_0x285a01[_0x55b7('0x53')]['id'],'read':![]}})[_0x55b7('0x2b')](function(_0x4017ff){return{'id':_[_0x55b7('0x54')](_0x285a01[_0x55b7('0x4a')]['id']),'count':_0x4017ff};})['then'](respondWithResult(_0x44ede3,null))[_0x55b7('0x48')](handleError(_0x44ede3,null));};exports[_0x55b7('0x55')]=function(_0x59290b,_0x996d84,_0x1cf788){return db['ChatGroup']['find']({'where':{'id':_0x59290b[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x996d84,null))[_0x55b7('0x2b')](function(_0x245df7){if(_0x245df7){return _0x245df7[_0x55b7('0x55')](_0x59290b[_0x55b7('0x4f')][_0x55b7('0x56')],_[_0x55b7('0x57')](_0x59290b['body'],[_0x55b7('0x56'),'id'])||{});}})[_0x55b7('0x2b')](respondWithResult(_0x996d84,null))[_0x55b7('0x48')](handleError(_0x996d84,null));};exports[_0x55b7('0x58')]=function(_0x1a3ead,_0x4d864e,_0x467f7e){var _0x4ff6f8={};var _0x51c814={};var _0x572af2;var _0x4b3b46;return db[_0x55b7('0x44')]['findOne']({'where':{'id':_0x1a3ead['params']['id']}})['then'](handleEntityNotFound(_0x4d864e,null))[_0x55b7('0x2b')](function(_0x4689e2){if(_0x4689e2){_0x572af2=_0x4689e2;_0x51c814['model']=_[_0x55b7('0x36')](db[_0x55b7('0x59')]['rawAttributes']);_0x51c814['query']=_[_0x55b7('0x36')](_0x1a3ead['query']);_0x51c814[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x51c814[_0x55b7('0x34')],_0x51c814['query']);_0x4ff6f8[_0x55b7('0x39')]=_['intersection'](_0x51c814['model'],qs[_0x55b7('0x4b')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x4b')]));_0x4ff6f8[_0x55b7('0x39')]=_0x4ff6f8[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x4ff6f8[_0x55b7('0x39')]:_0x51c814[_0x55b7('0x34')];_0x4ff6f8[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x4ff6f8['where']=qs['filters'](_[_0x55b7('0x3e')](_0x1a3ead[_0x55b7('0x35')],_0x51c814[_0x55b7('0x37')]));if(_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x4ff6f8['where']=_[_0x55b7('0x41')](_0x4ff6f8[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x4ff6f8[_0x55b7('0x39')],function(_0x183530){var _0x3def34={};_0x3def34[_0x183530]={'$like':'%'+_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x3def34;})});}_0x4ff6f8=_['merge']({},_0x4ff6f8,_0x1a3ead[_0x55b7('0x43')]);return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})['then'](function(_0x1e9faa){if(_0x1e9faa){_0x4b3b46=_0x1e9faa[_0x55b7('0x3a')];if(!_0x1a3ead['query'][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x4ff6f8[_0x55b7('0x24')]=qs['limit'](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x24')]);_0x4ff6f8[_0x55b7('0x22')]=qs['offset'](_0x1a3ead['query'][_0x55b7('0x22')]);}return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})[_0x55b7('0x2b')](function(_0x590669){if(_0x590669){return _0x590669?{'count':_0x4b3b46,'rows':_0x590669}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x4d864e,null))[_0x55b7('0x48')](handleError(_0x4d864e,null));};exports['removeMembers']=function(_0x150393,_0x2a5c5d,_0x50a3ea){return db[_0x55b7('0x44')]['find']({'where':{'id':_0x150393['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x2a5c5d,null))[_0x55b7('0x2b')](function(_0x5aee6c){if(_0x5aee6c){return _0x5aee6c['removeMembers'](_0x150393[_0x55b7('0x35')][_0x55b7('0x56')]);}})[_0x55b7('0x2b')](respondWithStatusCode(_0x2a5c5d,null))[_0x55b7('0x48')](handleError(_0x2a5c5d,null));};exports['addMessage']=function(_0x5520b6,_0x17c6fa,_0x55ffdd){if(_0x5520b6[_0x55b7('0x4f')]['id']){delete _0x5520b6[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5520b6[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x17c6fa,null))[_0x55b7('0x2b')](function(_0x3d079f){if(_0x3d079f){_0x5520b6[_0x55b7('0x4f')]['ChatGroupId']=_0x3d079f['id'];return db[_0x55b7('0x52')][_0x55b7('0x4e')](_0x5520b6['body']);}})['then'](respondWithResult(_0x17c6fa,null))[_0x55b7('0x48')](handleError(_0x17c6fa,null));};exports['getMessages']=function(_0xcde715,_0x5267b4,_0x15d434){var _0x48cdb9={};var _0x1544cc={};var _0x49ad61;var _0x1adbd9;return db['ChatGroup'][_0x55b7('0x5b')]({'where':{'id':_0xcde715['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x5267b4,null))[_0x55b7('0x2b')](function(_0x1cdaf3){if(_0x1cdaf3){_0x49ad61=_0x1cdaf3;_0x1544cc[_0x55b7('0x34')]=_[_0x55b7('0x36')](db['ChatInternalMessage'][_0x55b7('0x30')]);_0x1544cc[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0xcde715['query']);_0x1544cc[_0x55b7('0x37')]=_['intersection'](_0x1544cc[_0x55b7('0x34')],_0x1544cc['query']);_0x48cdb9['attributes']=_[_0x55b7('0x38')](_0x1544cc[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0xcde715['query'][_0x55b7('0x4b')]));_0x48cdb9[_0x55b7('0x39')]=_0x48cdb9[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x48cdb9[_0x55b7('0x39')]:_0x1544cc[_0x55b7('0x34')];_0x48cdb9[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0xcde715[_0x55b7('0x35')]['sort']);_0x48cdb9[_0x55b7('0x40')]=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0xcde715[_0x55b7('0x35')],_0x1544cc[_0x55b7('0x37')]));if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],{'$or':_['map'](_0x48cdb9[_0x55b7('0x39')],function(_0x469c0b){var _0x4b7b97={};_0x4b7b97[_0x469c0b]={'$like':'%'+_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x4b7b97;})});}if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x5c')]){var _0x56e082=_0xcde715[_0x55b7('0x35')]['$gte'][_0x55b7('0x5d')](',');var _0x37f399={};_0x37f399[_0x56e082[0x0]]={'$gte':moment(_0x56e082[0x1])['format'](_0x55b7('0x5e'))};_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],_0x37f399);}_0x48cdb9=_['merge']({},_0x48cdb9,_0xcde715['options']);return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0xc73b75){if(_0xc73b75){_0x1adbd9=_0xc73b75[_0x55b7('0x3a')];if(!_0xcde715[_0x55b7('0x35')][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x48cdb9[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0xcde715['query'][_0x55b7('0x24')]);_0x48cdb9[_0x55b7('0x22')]=qs[_0x55b7('0x22')](_0xcde715['query'][_0x55b7('0x22')]);}return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0x21f179){if(_0x21f179){return _0x21f179?{'count':_0x1adbd9,'rows':_0x21f179}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x5267b4,null))[_0x55b7('0x48')](handleError(_0x5267b4,null));};
\ No newline at end of file
+var _0xfcb2=['offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','where','merge','VIRTUAL','includeAll','ChatGroup','rows','catch','show','params','include','options','find','create','body','getUnread','ChatInternalMessage','addMembers','ids','omit','pick','filter','length','hasOwnProperty','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','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','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status'];(function(_0x14d17d,_0x56493b){var _0x388bb6=function(_0x3dd963){while(--_0x3dd963){_0x14d17d['push'](_0x14d17d['shift']());}};_0x388bb6(++_0x56493b);}(_0xfcb2,0xa2));var _0x2fcb=function(_0x523297,_0x15f343){_0x523297=_0x523297-0x0;var _0x530017=_0xfcb2[_0x523297];return _0x530017;};'use strict';var emlformat=require(_0x2fcb('0x0'));var rimraf=require(_0x2fcb('0x1'));var zipdir=require(_0x2fcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fcb('0x3'));var moment=require('moment');var BPromise=require(_0x2fcb('0x4'));var Mustache=require(_0x2fcb('0x5'));var util=require(_0x2fcb('0x6'));var path=require(_0x2fcb('0x7'));var sox=require(_0x2fcb('0x8'));var csv=require('to-csv');var ejs=require(_0x2fcb('0x9'));var fs=require('fs');var fs_extra=require(_0x2fcb('0xa'));var _=require(_0x2fcb('0xb'));var squel=require('squel');var crypto=require(_0x2fcb('0xc'));var jsforce=require(_0x2fcb('0xd'));var deskjs=require(_0x2fcb('0xe'));var toCsv=require(_0x2fcb('0xf'));var querystring=require('querystring');var Papa=require(_0x2fcb('0x10'));var Redis=require(_0x2fcb('0x11'));var authService=require(_0x2fcb('0x12'));var qs=require(_0x2fcb('0x13'));var as=require(_0x2fcb('0x14'));var hardwareService=require(_0x2fcb('0x15'));var logger=require(_0x2fcb('0x16'))(_0x2fcb('0x17'));var utils=require(_0x2fcb('0x18'));var config=require(_0x2fcb('0x19'));var licenseUtil=require(_0x2fcb('0x1a'));var db=require(_0x2fcb('0x1b'))['db'];config['redis']=_[_0x2fcb('0x1c')](config[_0x2fcb('0x1d')],{'host':_0x2fcb('0x1e'),'port':0x18eb});var socket=require(_0x2fcb('0x1f'))(new Redis(config[_0x2fcb('0x1d')]));require(_0x2fcb('0x20'))['register'](socket);function respondWithStatusCode(_0x1bc884,_0xba21d7){_0xba21d7=_0xba21d7||0xcc;return function(_0x3d69ce){if(_0x3d69ce){return _0x1bc884[_0x2fcb('0x21')](_0xba21d7);}return _0x1bc884['status'](_0xba21d7)[_0x2fcb('0x22')]();};}function respondWithResult(_0x8e5a34,_0x2f1a49){_0x2f1a49=_0x2f1a49||0xc8;return function(_0x2c0d19){if(_0x2c0d19){return _0x8e5a34[_0x2fcb('0x23')](_0x2f1a49)['json'](_0x2c0d19);}};}function respondWithFilteredResult(_0x4453fb,_0x28dd2d){return function(_0x5311b1){if(_0x5311b1){var _0x10ffbc=typeof _0x28dd2d[_0x2fcb('0x24')]===_0x2fcb('0x25')&&typeof _0x28dd2d[_0x2fcb('0x26')]===_0x2fcb('0x25');var _0x1f68aa=_0x5311b1[_0x2fcb('0x27')];var _0x5bf009=_0x10ffbc?0x0:_0x28dd2d[_0x2fcb('0x24')];var _0x518d68=_0x10ffbc?_0x5311b1[_0x2fcb('0x27')]:_0x28dd2d[_0x2fcb('0x24')]+_0x28dd2d[_0x2fcb('0x26')];var _0x1c674d;if(_0x518d68>=_0x1f68aa){_0x518d68=_0x1f68aa;_0x1c674d=0xc8;}else{_0x1c674d=0xce;}_0x4453fb[_0x2fcb('0x23')](_0x1c674d);return _0x4453fb['set'](_0x2fcb('0x28'),_0x5bf009+'-'+_0x518d68+'/'+_0x1f68aa)[_0x2fcb('0x29')](_0x5311b1);}return null;};}function patchUpdates(_0x155464){return function(_0x35159b){try{jsonpatch['apply'](_0x35159b,_0x155464,!![]);}catch(_0x59c5c8){return BPromise['reject'](_0x59c5c8);}return _0x35159b[_0x2fcb('0x2a')]();};}function saveUpdates(_0x41bb07,_0x4e1f71){return function(_0x53b6ed){if(_0x53b6ed){return _0x53b6ed[_0x2fcb('0x2b')](_0x41bb07)['then'](function(_0x5b4498){return _0x5b4498;});}return null;};}function removeEntity(_0x243786,_0x51e378){return function(_0x131383){if(_0x131383){return _0x131383[_0x2fcb('0x2c')]()[_0x2fcb('0x2d')](function(){_0x243786[_0x2fcb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a847,_0x326298){return function(_0x311904){if(!_0x311904){_0x51a847[_0x2fcb('0x21')](0x194);}return _0x311904;};}function handleError(_0xc4d7fe,_0x34d225){_0x34d225=_0x34d225||0x1f4;return function(_0x4b5464){logger[_0x2fcb('0x2e')](_0x4b5464[_0x2fcb('0x2f')]);if(_0x4b5464[_0x2fcb('0x30')]){delete _0x4b5464[_0x2fcb('0x30')];}_0xc4d7fe[_0x2fcb('0x23')](_0x34d225)[_0x2fcb('0x31')](_0x4b5464);};}exports[_0x2fcb('0x32')]=function(_0x72424b,_0x4858b9){var _0x469d66={},_0x1b186f={},_0x5d836c={'count':0x0,'rows':[]};var _0x5542c8=_[_0x2fcb('0x33')](db['ChatGroup'][_0x2fcb('0x34')],function(_0x2d3c1e){return{'name':_0x2d3c1e[_0x2fcb('0x35')],'type':_0x2d3c1e[_0x2fcb('0x36')][_0x2fcb('0x37')]};});_0x1b186f[_0x2fcb('0x38')]=_[_0x2fcb('0x33')](_0x5542c8,_0x2fcb('0x30'));_0x1b186f[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x72424b[_0x2fcb('0x39')]);_0x1b186f['filters']=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],_0x1b186f[_0x2fcb('0x39')]);_0x469d66[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x1b186f[_0x2fcb('0x38')],qs['fields'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x469d66['attributes']=_0x469d66[_0x2fcb('0x3c')]['length']?_0x469d66['attributes']:_0x1b186f['model'];if(!_0x72424b[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x469d66[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x469d66['offset']=qs[_0x2fcb('0x24')](_0x72424b[_0x2fcb('0x39')]['offset']);}_0x469d66[_0x2fcb('0x3f')]=qs['sort'](_0x72424b[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x469d66['where']=qs['filters'](_['pick'](_0x72424b[_0x2fcb('0x39')],_0x1b186f[_0x2fcb('0x41')]),_0x5542c8);if(_0x72424b['query']['filter']){_0x469d66[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x469d66[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x5542c8,function(_0x279db2){if(_0x279db2[_0x2fcb('0x36')]!==_0x2fcb('0x44')){var _0x4fd0ab={};_0x4fd0ab[_0x279db2[_0x2fcb('0x30')]]={'$like':'%'+_0x72424b['query']['filter']+'%'};return _0x4fd0ab;}})});}_0x469d66=_[_0x2fcb('0x43')]({},_0x469d66,_0x72424b['options']);var _0x3241df={'where':_0x469d66[_0x2fcb('0x42')]};return db['ChatGroup'][_0x2fcb('0x27')](_0x3241df)[_0x2fcb('0x2d')](function(_0x3a242d){_0x5d836c['count']=_0x3a242d;if(_0x72424b['query'][_0x2fcb('0x45')]){_0x469d66['include']=[{'all':!![]}];}return db[_0x2fcb('0x46')]['findAll'](_0x469d66);})[_0x2fcb('0x2d')](function(_0x1db681){_0x5d836c[_0x2fcb('0x47')]=_0x1db681;return _0x5d836c;})['then'](respondWithFilteredResult(_0x4858b9,_0x469d66))[_0x2fcb('0x48')](handleError(_0x4858b9,null));};exports[_0x2fcb('0x49')]=function(_0x283367,_0x20fb0a){var _0x1a11a7={'raw':!![],'where':{'id':_0x283367[_0x2fcb('0x4a')]['id']}},_0x3c543d={};_0x3c543d['model']=_[_0x2fcb('0x3a')](db[_0x2fcb('0x46')][_0x2fcb('0x34')]);_0x3c543d[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x283367['query']);_0x3c543d[_0x2fcb('0x41')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],_0x3c543d['query']);_0x1a11a7[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x3c543d[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0x283367[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x1a11a7['attributes']=_0x1a11a7[_0x2fcb('0x3c')]['length']?_0x1a11a7['attributes']:_0x3c543d['model'];if(_0x283367['query']['includeAll']){_0x1a11a7[_0x2fcb('0x4b')]=[{'all':!![]}];}_0x1a11a7=_[_0x2fcb('0x43')]({},_0x1a11a7,_0x283367[_0x2fcb('0x4c')]);return db[_0x2fcb('0x46')][_0x2fcb('0x4d')](_0x1a11a7)[_0x2fcb('0x2d')](handleEntityNotFound(_0x20fb0a,null))['then'](respondWithResult(_0x20fb0a,null))[_0x2fcb('0x48')](handleError(_0x20fb0a,null));};exports[_0x2fcb('0x4e')]=function(_0x4feba0,_0x348b04){return db[_0x2fcb('0x46')][_0x2fcb('0x4e')](_0x4feba0[_0x2fcb('0x4f')],{})[_0x2fcb('0x2d')](respondWithResult(_0x348b04,0xc9))[_0x2fcb('0x48')](handleError(_0x348b04,null));};exports[_0x2fcb('0x2b')]=function(_0x9850d0,_0x283d7f){if(_0x9850d0[_0x2fcb('0x4f')]['id']){delete _0x9850d0[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x9850d0[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x283d7f,null))[_0x2fcb('0x2d')](saveUpdates(_0x9850d0['body'],null))[_0x2fcb('0x2d')](respondWithResult(_0x283d7f,null))[_0x2fcb('0x48')](handleError(_0x283d7f,null));};exports[_0x2fcb('0x2c')]=function(_0x510b54,_0x1c577d){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x510b54[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1c577d,null))[_0x2fcb('0x2d')](removeEntity(_0x1c577d,null))['catch'](handleError(_0x1c577d,null));};exports['describe']=function(_0x13c461,_0x1c3f0f){return db[_0x2fcb('0x46')]['describe']()[_0x2fcb('0x2d')](respondWithResult(_0x1c3f0f,null))[_0x2fcb('0x48')](handleError(_0x1c3f0f,null));};exports[_0x2fcb('0x50')]=function(_0x1dd70,_0x551a53,_0x1cd9fa){return db[_0x2fcb('0x51')][_0x2fcb('0x27')]({'where':{'ChatGroupId':_0x1dd70[_0x2fcb('0x4a')]['id'],'ToId':_0x1dd70['user']['id'],'read':![]}})['then'](function(_0x20cf4e){return{'id':_['toInteger'](_0x1dd70[_0x2fcb('0x4a')]['id']),'count':_0x20cf4e};})[_0x2fcb('0x2d')](respondWithResult(_0x551a53,null))[_0x2fcb('0x48')](handleError(_0x551a53,null));};exports[_0x2fcb('0x52')]=function(_0x18b5a6,_0x383137,_0x59abf1){return db[_0x2fcb('0x46')]['find']({'where':{'id':_0x18b5a6[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x383137,null))[_0x2fcb('0x2d')](function(_0x39646b){if(_0x39646b){return _0x39646b[_0x2fcb('0x52')](_0x18b5a6['body'][_0x2fcb('0x53')],_[_0x2fcb('0x54')](_0x18b5a6[_0x2fcb('0x4f')],['ids','id'])||{});}})[_0x2fcb('0x2d')](respondWithResult(_0x383137,null))['catch'](handleError(_0x383137,null));};exports['getMembers']=function(_0xabd242,_0x3c7ec0,_0x3563c2){var _0x3bdafd={};var _0x26f81b={};var _0xb9fa9f;var _0x21a55f;return db[_0x2fcb('0x46')]['findOne']({'where':{'id':_0xabd242[_0x2fcb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c7ec0,null))[_0x2fcb('0x2d')](function(_0x161c0f){if(_0x161c0f){_0xb9fa9f=_0x161c0f;_0x26f81b[_0x2fcb('0x38')]=_[_0x2fcb('0x3a')](db['User']['rawAttributes']);_0x26f81b[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0xabd242[_0x2fcb('0x39')]);_0x26f81b['filters']=_[_0x2fcb('0x3b')](_0x26f81b[_0x2fcb('0x38')],_0x26f81b['query']);_0x3bdafd[_0x2fcb('0x3c')]=_['intersection'](_0x26f81b[_0x2fcb('0x38')],qs[_0x2fcb('0x3d')](_0xabd242[_0x2fcb('0x39')]['fields']));_0x3bdafd['attributes']=_0x3bdafd[_0x2fcb('0x3c')]['length']?_0x3bdafd['attributes']:_0x26f81b[_0x2fcb('0x38')];_0x3bdafd[_0x2fcb('0x3f')]=qs[_0x2fcb('0x40')](_0xabd242['query']['sort']);_0x3bdafd['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0xabd242[_0x2fcb('0x39')],_0x26f81b[_0x2fcb('0x41')]));if(_0xabd242['query'][_0x2fcb('0x56')]){_0x3bdafd[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x3bdafd[_0x2fcb('0x42')],{'$or':_['map'](_0x3bdafd[_0x2fcb('0x3c')],function(_0x594044){var _0x4f8ebb={};_0x4f8ebb[_0x594044]={'$like':'%'+_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x56')]+'%'};return _0x4f8ebb;})});}_0x3bdafd=_[_0x2fcb('0x43')]({},_0x3bdafd,_0xabd242[_0x2fcb('0x4c')]);return _0xb9fa9f['getMembers'](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0xedff81){if(_0xedff81){_0x21a55f=_0xedff81[_0x2fcb('0x57')];if(!_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x58')](_0x2fcb('0x3e'))){_0x3bdafd[_0x2fcb('0x26')]=qs[_0x2fcb('0x26')](_0xabd242[_0x2fcb('0x39')][_0x2fcb('0x26')]);_0x3bdafd[_0x2fcb('0x24')]=qs['offset'](_0xabd242['query'][_0x2fcb('0x24')]);}return _0xb9fa9f[_0x2fcb('0x59')](_0x3bdafd);}})[_0x2fcb('0x2d')](function(_0x48ee49){if(_0x48ee49){return _0x48ee49?{'count':_0x21a55f,'rows':_0x48ee49}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x3c7ec0,null))[_0x2fcb('0x48')](handleError(_0x3c7ec0,null));};exports[_0x2fcb('0x5a')]=function(_0x71e11,_0x249f4f,_0x4ce9dd){return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x71e11['params']['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x249f4f,null))[_0x2fcb('0x2d')](function(_0x45bc34){if(_0x45bc34){return _0x45bc34[_0x2fcb('0x5a')](_0x71e11[_0x2fcb('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x249f4f,null))[_0x2fcb('0x48')](handleError(_0x249f4f,null));};exports[_0x2fcb('0x5b')]=function(_0x44e6d5,_0x5edbfb,_0x1fa3a8){if(_0x44e6d5[_0x2fcb('0x4f')]['id']){delete _0x44e6d5[_0x2fcb('0x4f')]['id'];}return db[_0x2fcb('0x46')][_0x2fcb('0x4d')]({'where':{'id':_0x44e6d5[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x5edbfb,null))[_0x2fcb('0x2d')](function(_0x316cc6){if(_0x316cc6){_0x44e6d5[_0x2fcb('0x4f')][_0x2fcb('0x5c')]=_0x316cc6['id'];return db[_0x2fcb('0x51')][_0x2fcb('0x4e')](_0x44e6d5[_0x2fcb('0x4f')]);}})[_0x2fcb('0x2d')](respondWithResult(_0x5edbfb,null))[_0x2fcb('0x48')](handleError(_0x5edbfb,null));};exports['getMessages']=function(_0x1d974f,_0x1bd307,_0x545e68){var _0x22125d={};var _0x43f3f4={};var _0x33b687;var _0x52f5c0;return db['ChatGroup'][_0x2fcb('0x5d')]({'where':{'id':_0x1d974f[_0x2fcb('0x4a')]['id']}})[_0x2fcb('0x2d')](handleEntityNotFound(_0x1bd307,null))[_0x2fcb('0x2d')](function(_0x2861bd){if(_0x2861bd){_0x33b687=_0x2861bd;_0x43f3f4[_0x2fcb('0x38')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x43f3f4[_0x2fcb('0x39')]=_[_0x2fcb('0x3a')](_0x1d974f[_0x2fcb('0x39')]);_0x43f3f4['filters']=_[_0x2fcb('0x3b')](_0x43f3f4[_0x2fcb('0x38')],_0x43f3f4['query']);_0x22125d[_0x2fcb('0x3c')]=_[_0x2fcb('0x3b')](_0x43f3f4['model'],qs[_0x2fcb('0x3d')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x3d')]));_0x22125d[_0x2fcb('0x3c')]=_0x22125d['attributes'][_0x2fcb('0x57')]?_0x22125d['attributes']:_0x43f3f4[_0x2fcb('0x38')];_0x22125d['order']=qs[_0x2fcb('0x40')](_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x40')]);_0x22125d['where']=qs[_0x2fcb('0x41')](_[_0x2fcb('0x55')](_0x1d974f['query'],_0x43f3f4[_0x2fcb('0x41')]));if(_0x1d974f[_0x2fcb('0x39')]['filter']){_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],{'$or':_[_0x2fcb('0x33')](_0x22125d['attributes'],function(_0x36ed8a){var _0x44fe1c={};_0x44fe1c[_0x36ed8a]={'$like':'%'+_0x1d974f['query'][_0x2fcb('0x56')]+'%'};return _0x44fe1c;})});}if(_0x1d974f['query']['$gte']){var _0x3e48ea=_0x1d974f[_0x2fcb('0x39')][_0x2fcb('0x5e')][_0x2fcb('0x5f')](',');var _0x47054c={};_0x47054c[_0x3e48ea[0x0]]={'$gte':moment(_0x3e48ea[0x1])[_0x2fcb('0x60')](_0x2fcb('0x61'))};_0x22125d[_0x2fcb('0x42')]=_[_0x2fcb('0x43')](_0x22125d[_0x2fcb('0x42')],_0x47054c);}_0x22125d=_[_0x2fcb('0x43')]({},_0x22125d,_0x1d974f[_0x2fcb('0x4c')]);return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x419a37){if(_0x419a37){_0x52f5c0=_0x419a37[_0x2fcb('0x57')];if(!_0x1d974f[_0x2fcb('0x39')]['hasOwnProperty'](_0x2fcb('0x3e'))){_0x22125d['limit']=qs['limit'](_0x1d974f['query'][_0x2fcb('0x26')]);_0x22125d[_0x2fcb('0x24')]=qs[_0x2fcb('0x24')](_0x1d974f[_0x2fcb('0x39')]['offset']);}return _0x33b687[_0x2fcb('0x62')](_0x22125d);}})[_0x2fcb('0x2d')](function(_0x383e77){if(_0x383e77){return _0x383e77?{'count':_0x52f5c0,'rows':_0x383e77}:null;}})[_0x2fcb('0x2d')](respondWithResult(_0x1bd307,null))[_0x2fcb('0x48')](handleError(_0x1bd307,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index add507f..7d34ca8 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 _0x9b7c=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b7c,0x176));var _0xc9b7=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x9b7c[_0x1ea053];return _0x444b08;};'use strict';var EventEmitter=require(_0xc9b7('0x0'));var ChatGroup=require(_0xc9b7('0x1'))['db'][_0xc9b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9b7('0x4'),'afterDestroy':_0xc9b7('0x5')};function emitEvent(_0x29399d){return function(_0xee2a38,_0x251da6,_0x4a6516){ChatGroupEvents[_0xc9b7('0x6')](_0x29399d+':'+_0xee2a38['id'],_0xee2a38);ChatGroupEvents[_0xc9b7('0x6')](_0x29399d,_0xee2a38);_0x4a6516(null);};}for(var e in events){if(events[_0xc9b7('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x626d=['ChatGroup','setMaxListeners','save','remove','emit','exports','events'];(function(_0xc85e7f,_0x10574a){var _0x90e7c6=function(_0x4b2c85){while(--_0x4b2c85){_0xc85e7f['push'](_0xc85e7f['shift']());}};_0x90e7c6(++_0x10574a);}(_0x626d,0xa0));var _0xd626=function(_0x989980,_0x1e5018){_0x989980=_0x989980-0x0;var _0x939945=_0x626d[_0x989980];return _0x939945;};'use strict';var EventEmitter=require(_0xd626('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xd626('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd626('0x2')](0x0);var events={'afterCreate':_0xd626('0x3'),'afterUpdate':'update','afterDestroy':_0xd626('0x4')};function emitEvent(_0x33e3fc){return function(_0x31b2a5,_0x1ea984,_0xada387){ChatGroupEvents['emit'](_0x33e3fc+':'+_0x31b2a5['id'],_0x31b2a5);ChatGroupEvents[_0xd626('0x5')](_0x33e3fc,_0x31b2a5);_0xada387(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd626('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c5f6986..eee08cc 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 _0x8786=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0xdfc19,_0x48a555){var _0x1c3a65=function(_0x5dfc48){while(--_0x5dfc48){_0xdfc19['push'](_0xdfc19['shift']());}};_0x1c3a65(++_0x48a555);}(_0x8786,0x6c));var _0x6878=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8786[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var logger=require(_0x6878('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6878('0x3'));var rp=require(_0x6878('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6878('0x5'));var attributes=require(_0x6878('0x6'));module[_0x6878('0x7')]=function(_0x5851a6,_0x2c5f10){return _0x5851a6['define']('ChatGroup',attributes,{'tableName':_0x6878('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d7f=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x4d2612,_0x1f2501){var _0x1f21c4=function(_0x51ecab){while(--_0x51ecab){_0x4d2612['push'](_0x4d2612['shift']());}};_0x1f21c4(++_0x1f2501);}(_0x4d7f,0x161));var _0xf4d7=function(_0x580ea0,_0x3f57ef){_0x580ea0=_0x580ea0-0x0;var _0x54755e=_0x4d7f[_0x580ea0];return _0x54755e;};'use strict';var _=require(_0xf4d7('0x0'));var util=require(_0xf4d7('0x1'));var logger=require(_0xf4d7('0x2'))(_0xf4d7('0x3'));var moment=require(_0xf4d7('0x4'));var BPromise=require(_0xf4d7('0x5'));var rp=require(_0xf4d7('0x6'));var fs=require('fs');var path=require(_0xf4d7('0x7'));var rimraf=require(_0xf4d7('0x8'));var config=require(_0xf4d7('0x9'));var attributes=require(_0xf4d7('0xa'));module['exports']=function(_0x169cc6,_0x5793e4){return _0x169cc6[_0xf4d7('0xb')](_0xf4d7('0xc'),attributes,{'tableName':_0xf4d7('0xd'),'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 c10d2fa..63bbc99 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 _0x61a5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x308119,_0x2335dd){var _0x30a8d7=function(_0x2d52ce){while(--_0x2d52ce){_0x308119['push'](_0x308119['shift']());}};_0x30a8d7(++_0x2335dd);}(_0x61a5,0xf0));var _0x561a=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0x61a5[_0x131205];return _0x305300;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require(_0x561a('0x3'));var fs=require('fs');var Redis=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x561a('0x6'))(_0x561a('0x7'));var config=require('../../config/environment');var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});config[_0x561a('0xb')]=_[_0x561a('0xc')](config[_0x561a('0xb')],{'host':_0x561a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x561a('0xb')]));require('./chatGroup.socket')[_0x561a('0xe')](socket);function respondWithRpcPromise(_0x5288b4,_0x5b3510,_0x34e464){return new BPromise(function(_0x4071ba,_0x522f52){return client[_0x561a('0xf')](_0x5288b4,_0x34e464)['then'](function(_0x205e99){logger[_0x561a('0x10')](_0x561a('0x11'),_0x5b3510,_0x561a('0x12'));logger[_0x561a('0x13')](_0x561a('0x14'),_0x5b3510,_0x561a('0x12'),JSON[_0x561a('0x15')](_0x205e99));if(_0x205e99[_0x561a('0x16')]){if(_0x205e99[_0x561a('0x16')][_0x561a('0x17')]===0x1f4){logger[_0x561a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x522f52(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}logger[_0x561a('0x16')](_0x561a('0x11'),_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x4071ba(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}else{logger[_0x561a('0x10')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x561a('0x12'));_0x4071ba(_0x205e99[_0x561a('0x19')]['message']);}})[_0x561a('0x1a')](function(_0x785831){logger['error'](_0x561a('0x11'),_0x5b3510,_0x785831);_0x522f52(_0x785831);});});}
\ No newline at end of file
+var _0x8ece=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1ffa28,_0x104537){var _0x235fbb=function(_0x1dcc42){while(--_0x1dcc42){_0x1ffa28['push'](_0x1ffa28['shift']());}};_0x235fbb(++_0x104537);}(_0x8ece,0x195));var _0xe8ec=function(_0x3b8576,_0x241739){_0x3b8576=_0x3b8576-0x0;var _0x410744=_0x8ece[_0x3b8576];return _0x410744;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});config[_0xe8ec('0xb')]=_[_0xe8ec('0xc')](config[_0xe8ec('0xb')],{'host':_0xe8ec('0xd'),'port':0x18eb});var socket=require(_0xe8ec('0xe'))(new Redis(config['redis']));require(_0xe8ec('0xf'))['register'](socket);function respondWithRpcPromise(_0x1345e0,_0x5b1569,_0x1b0a84){return new BPromise(function(_0x278f86,_0x4ff773){return client[_0xe8ec('0x10')](_0x1345e0,_0x1b0a84)[_0xe8ec('0x11')](function(_0x959f4){logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));logger[_0xe8ec('0x15')](_0xe8ec('0x16'),_0x5b1569,_0xe8ec('0x14'),JSON[_0xe8ec('0x17')](_0x959f4));if(_0x959f4['error']){if(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x19')]===0x1f4){logger[_0xe8ec('0x18')](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x4ff773(_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);}logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x959f4[_0xe8ec('0x18')][_0xe8ec('0x1a')]);return _0x278f86(_0x959f4['error'][_0xe8ec('0x1a')]);}else{logger[_0xe8ec('0x12')](_0xe8ec('0x13'),_0x5b1569,_0xe8ec('0x14'));_0x278f86(_0x959f4[_0xe8ec('0x1b')][_0xe8ec('0x1a')]);}})[_0xe8ec('0x1c')](function(_0x2e54f0){logger['error'](_0xe8ec('0x13'),_0x5b1569,_0x2e54f0);_0x4ff773(_0x2e54f0);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 4667f66..c3bd289 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 _0x0eba=['removeListener','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x0eba,0x1d1));var _0xa0eb=function(_0x5715a2,_0x17e9c0){_0x5715a2=_0x5715a2-0x0;var _0x2ebf35=_0x0eba[_0x5715a2];return _0x2ebf35;};'use strict';var ChatGroupEvents=require(_0xa0eb('0x0'));var events=[_0xa0eb('0x1'),'remove','update'];function createListener(_0x38a06c,_0x475489){return function(_0x2c2d08){_0x475489[_0xa0eb('0x2')](_0x38a06c,_0x2c2d08);};}function removeListener(_0x984986,_0x397bd6){return function(){ChatGroupEvents[_0xa0eb('0x3')](_0x984986,_0x397bd6);};}exports['register']=function(_0x255b93){for(var _0x15ed4e=0x0,_0x545d73=events[_0xa0eb('0x4')];_0x15ed4e<_0x545d73;_0x15ed4e++){var _0x3f4cfd=events[_0x15ed4e];var _0x569016=createListener(_0xa0eb('0x5')+_0x3f4cfd,_0x255b93);ChatGroupEvents['on'](_0x3f4cfd,_0x569016);}};
\ No newline at end of file
+var _0x363a=['./chatGroup.events','remove','emit','register','chatGroup:'];(function(_0x51d92a,_0x49d811){var _0x1236b0=function(_0x46c098){while(--_0x46c098){_0x51d92a['push'](_0x51d92a['shift']());}};_0x1236b0(++_0x49d811);}(_0x363a,0x1d6));var _0xa363=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0x363a[_0x1475a6];return _0x3c0d07;};'use strict';var ChatGroupEvents=require(_0xa363('0x0'));var events=['save',_0xa363('0x1'),'update'];function createListener(_0x3e3904,_0x3ed619){return function(_0x38b957){_0x3ed619[_0xa363('0x2')](_0x3e3904,_0x38b957);};}function removeListener(_0x19adfb,_0x117c5a){return function(){ChatGroupEvents['removeListener'](_0x19adfb,_0x117c5a);};}exports[_0xa363('0x3')]=function(_0x16526d){for(var _0x43de0a=0x0,_0x135b6f=events['length'];_0x43de0a<_0x135b6f;_0x43de0a++){var _0x28b096=events[_0x43de0a];var _0x5447ed=createListener(_0xa363('0x4')+_0x28b096,_0x16526d);ChatGroupEvents['on'](_0x28b096,_0x5447ed);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1a4af5c..fe0edf5 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 _0x1be7=['../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x353f81,_0x2e9105){var _0x261d52=function(_0x358e45){while(--_0x358e45){_0x353f81['push'](_0x353f81['shift']());}};_0x261d52(++_0x2e9105);}(_0x1be7,0x1d8));var _0x71be=function(_0x26f081,_0x4277f3){_0x26f081=_0x26f081-0x0;var _0x4bf032=_0x1be7[_0x26f081];return _0x4bf032;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71be('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71be('0x1'));var auth=require(_0x71be('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x71be('0x3'));var controller=require(_0x71be('0x4'));router[_0x71be('0x5')]('/',auth['isAuthenticated'](),controller[_0x71be('0x6')]);router[_0x71be('0x5')](_0x71be('0x7'),auth[_0x71be('0x8')](),controller[_0x71be('0x9')]);router[_0x71be('0x5')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0xb')]);router[_0x71be('0x5')]('/:id/unread',auth[_0x71be('0x8')](),controller[_0x71be('0xc')]);router['get']('/:id/members',auth[_0x71be('0x8')](),controller['getMembers']);router[_0x71be('0x5')](_0x71be('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x71be('0xe')]('/',auth['isAuthenticated'](),controller[_0x71be('0xf')]);router[_0x71be('0xe')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x11')]);router[_0x71be('0xe')](_0x71be('0xd'),auth[_0x71be('0x8')](),controller[_0x71be('0x12')]);router[_0x71be('0x13')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x14')]);router[_0x71be('0x15')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x16')]);router[_0x71be('0x15')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x17')]);module[_0x71be('0x18')]=router;
\ No newline at end of file
+var _0x4219=['post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','create'];(function(_0x484a3e,_0x4c0eda){var _0x29a66a=function(_0x5310c3){while(--_0x5310c3){_0x484a3e['push'](_0x484a3e['shift']());}};_0x29a66a(++_0x4c0eda);}(_0x4219,0x17d));var _0x9421=function(_0xd89388,_0x33c473){_0xd89388=_0xd89388-0x0;var _0x4157a3=_0x4219[_0xd89388];return _0x4157a3;};'use strict';var multer=require('multer');var util=require(_0x9421('0x0'));var path=require(_0x9421('0x1'));var timeout=require(_0x9421('0x2'));var express=require(_0x9421('0x3'));var router=express[_0x9421('0x4')]();var fs_extra=require(_0x9421('0x5'));var auth=require(_0x9421('0x6'));var interaction=require(_0x9421('0x7'));var config=require(_0x9421('0x8'));var controller=require(_0x9421('0x9'));router['get']('/',auth[_0x9421('0xa')](),controller[_0x9421('0xb')]);router[_0x9421('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x9421('0xd')]);router['get'](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0xf')]);router[_0x9421('0xc')](_0x9421('0x10'),auth[_0x9421('0xa')](),controller[_0x9421('0x11')]);router[_0x9421('0xc')]('/:id/members',auth[_0x9421('0xa')](),controller[_0x9421('0x12')]);router[_0x9421('0xc')](_0x9421('0x13'),auth[_0x9421('0xa')](),controller[_0x9421('0x14')]);router['post']('/',auth[_0x9421('0xa')](),controller[_0x9421('0x15')]);router[_0x9421('0x16')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x18')]);router[_0x9421('0x16')]('/:id/messages',auth[_0x9421('0xa')](),controller[_0x9421('0x19')]);router[_0x9421('0x1a')](_0x9421('0xe'),auth[_0x9421('0xa')](),controller[_0x9421('0x1b')]);router[_0x9421('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9421('0x1d')]);router[_0x9421('0x1c')](_0x9421('0x17'),auth[_0x9421('0xa')](),controller[_0x9421('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fbef10e..b5b3e44 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 _0x3c0d=['DATE','long','out','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x578e15,_0x8e0df0){var _0x4c547d=function(_0x3c6888){while(--_0x3c6888){_0x578e15['push'](_0x578e15['shift']());}};_0x4c547d(++_0x8e0df0);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x4e823f,_0x1eb3f9){_0x4e823f=_0x4e823f-0x0;var _0x294b36=_0x3c0d[_0x4e823f];return _0x294b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd3c0('0x0')]},'ratingType':{'type':Sequelize[_0xd3c0('0x1')](_0xd3c0('0x2'),_0xd3c0('0x3')),'defaultValue':_0xd3c0('0x2')},'ratingMessage':{'type':Sequelize[_0xd3c0('0x4')]},'pathTranscript':{'type':Sequelize[_0xd3c0('0x4')]},'mailTranscript':{'type':Sequelize[_0xd3c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd3c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd3c0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd3c0('0x5')]},'browserName':{'type':Sequelize[_0xd3c0('0x5')]},'browserVersion':{'type':Sequelize[_0xd3c0('0x5')]},'osName':{'type':Sequelize[_0xd3c0('0x5')]},'osVersion':{'type':Sequelize[_0xd3c0('0x5')]},'deviceModel':{'type':Sequelize[_0xd3c0('0x5')]},'deviceVendor':{'type':Sequelize[_0xd3c0('0x5')]},'deviceType':{'type':Sequelize[_0xd3c0('0x5')]},'referer':{'type':Sequelize[_0xd3c0('0x4')]},'customerIp':{'type':Sequelize[_0xd3c0('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xd3c0('0x7'))},'read1stAt':{'type':Sequelize[_0xd3c0('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd3c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd3c0('0x5')]},'customerPort':{'type':Sequelize[_0xd3c0('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd3c0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb248=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x2d5818,_0xc9aa8b){var _0x1d1e9d=function(_0xdea9e8){while(--_0xdea9e8){_0x2d5818['push'](_0x2d5818['shift']());}};_0x1d1e9d(++_0xc9aa8b);}(_0xb248,0xc6));var _0x8b24=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xb248[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b24('0x2')]},'ratingType':{'type':Sequelize[_0x8b24('0x3')](_0x8b24('0x4'),'thumb'),'defaultValue':_0x8b24('0x4')},'ratingMessage':{'type':Sequelize[_0x8b24('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8b24('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b24('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b24('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8b24('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8b24('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8b24('0x6')]},'osVersion':{'type':Sequelize[_0x8b24('0x6')]},'deviceModel':{'type':Sequelize[_0x8b24('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8b24('0x6')]},'referer':{'type':Sequelize[_0x8b24('0x5')]},'customerIp':{'type':Sequelize[_0x8b24('0x6')]},'formData':{'type':Sequelize[_0x8b24('0x5')](_0x8b24('0x8'))},'read1stAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8b24('0x3')]('in',_0x8b24('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b24('0x6')]},'customerPort':{'type':Sequelize[_0x8b24('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8b24('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index cdb8371..c856604 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 _0xdfd5=['order','ChatInteractionId','includeAgent','push','rows','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','mkdirSync','Chat','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createWriteStream','firstName','value','server','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','map','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','includeAll','include','options','create','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooMetadata','vidaooApiKey','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ContactId','Messages','length','agentAlias','System','customer','Visitor','website_alias','%s%d','agent_alias','alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfd5,0x1c3));var _0x5dfd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xdfd5[_0xc0a3d3];return _0x3386e8;};'use strict';var rimraf=require(_0x5dfd('0x0'));var zipdir=require(_0x5dfd('0x1'));var rp=require(_0x5dfd('0x2'));var moment=require(_0x5dfd('0x3'));var BPromise=require(_0x5dfd('0x4'));var Mustache=require(_0x5dfd('0x5'));var util=require(_0x5dfd('0x6'));var path=require(_0x5dfd('0x7'));var ejs=require(_0x5dfd('0x8'));var fs=require('fs');var _=require(_0x5dfd('0x9'));var Redis=require(_0x5dfd('0xa'));var interaction=require(_0x5dfd('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5dfd('0xc'));var logger=require(_0x5dfd('0xd'))('api');var config=require(_0x5dfd('0xe'));var db=require('../../mysqldb')['db'];config[_0x5dfd('0xf')]=_[_0x5dfd('0x10')](config[_0x5dfd('0xf')],{'host':_0x5dfd('0x11'),'port':0x18eb});var socket=require(_0x5dfd('0x12'))(new Redis(config[_0x5dfd('0xf')]));require('./chatInteraction.socket')[_0x5dfd('0x13')](socket);var jayson=require(_0x5dfd('0x14'));var client=jayson[_0x5dfd('0x15')][_0x5dfd('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x5dfd('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x567186,_0x5e63cd,_0xa31e,_0x22c24c){return new BPromise(function(_0xbc4f07,_0x5f5342){var _0x4dfecd=_0x22c24c||client;return _0x4dfecd[_0x5dfd('0x17')](_0x567186,_0xa31e)[_0x5dfd('0x18')](function(_0x1b265e){logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));logger[_0x5dfd('0x1c')](_0x5dfd('0x1d'),_0x5e63cd,_0x5dfd('0x1b'),JSON[_0x5dfd('0x1e')](_0x1b265e));if(_0x1b265e[_0x5dfd('0x1f')]){if(_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x20')]===0x1f4){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0x5f5342(_0x1b265e['error']['message']);}logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0xbc4f07(_0x1b265e['error']['message']);}else{logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));_0xbc4f07(_0x1b265e['result'][_0x5dfd('0x21')]);}})[_0x5dfd('0x22')](function(_0xa72fe0){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0xa72fe0);_0x5f5342(_0xa72fe0);});});}function respondWithStatusCode(_0x25f52d,_0x11de10){_0x11de10=_0x11de10||0xcc;return function(_0x1fe62a){if(_0x1fe62a){return _0x25f52d[_0x5dfd('0x23')](_0x11de10);}return _0x25f52d[_0x5dfd('0x24')](_0x11de10)[_0x5dfd('0x25')]();};}function respondWithResult(_0x3b2bc5,_0x1ee99f){_0x1ee99f=_0x1ee99f||0xc8;return function(_0x149c22){if(_0x149c22){return _0x3b2bc5[_0x5dfd('0x24')](_0x1ee99f)[_0x5dfd('0x26')](_0x149c22);}};}function respondWithFilteredResult(_0x5165f4,_0x5ee86b){return function(_0x1a2f90){if(_0x1a2f90){var _0x96e0aa=typeof _0x5ee86b[_0x5dfd('0x27')]===_0x5dfd('0x28')&&typeof _0x5ee86b[_0x5dfd('0x29')]===_0x5dfd('0x28');var _0x24f158=_0x1a2f90[_0x5dfd('0x2a')];var _0x350ee2=_0x96e0aa?0x0:_0x5ee86b[_0x5dfd('0x27')];var _0x3230ab=_0x96e0aa?_0x1a2f90[_0x5dfd('0x2a')]:_0x5ee86b[_0x5dfd('0x27')]+_0x5ee86b[_0x5dfd('0x29')];var _0x41a7c5;if(_0x3230ab>=_0x24f158){_0x3230ab=_0x24f158;_0x41a7c5=0xc8;}else{_0x41a7c5=0xce;}_0x5165f4[_0x5dfd('0x24')](_0x41a7c5);return _0x5165f4[_0x5dfd('0x2b')](_0x5dfd('0x2c'),_0x350ee2+'-'+_0x3230ab+'/'+_0x24f158)['json'](_0x1a2f90);}return null;};}function saveUpdates(_0x13bc15){return function(_0x3c3b30){if(_0x3c3b30){return _0x3c3b30['update'](_0x13bc15)['then'](function(_0x15b12f){return _0x15b12f;});}return null;};}function removeEntity(_0x57d752){return function(_0x286a37){if(_0x286a37){return _0x286a37[_0x5dfd('0x2d')]()[_0x5dfd('0x18')](function(){_0x57d752[_0x5dfd('0x24')](0xcc)[_0x5dfd('0x25')]();});}};}function handleEntityNotFound(_0x296624){return function(_0x40dff6){if(!_0x40dff6){_0x296624['sendStatus'](0x194);}return _0x40dff6;};}function handleError(_0x26416b,_0x11b367){_0x11b367=_0x11b367||0x1f4;return function(_0x5cd921){logger['error'](_0x5cd921[_0x5dfd('0x2e')]);if(_0x5cd921[_0x5dfd('0x2f')]){delete _0x5cd921[_0x5dfd('0x2f')];}_0x26416b[_0x5dfd('0x24')](_0x11b367)['send'](_0x5cd921);};}function getMustacheRender(_0x434eb1,_0x5b8a61){return Mustache[_0x5dfd('0x30')](_0x434eb1,_[_0x5dfd('0x31')](_0x5b8a61[_0x5dfd('0x32')],{'contact':_0x5b8a61[_0x5dfd('0x33')],'message':_0x5b8a61[_0x5dfd('0x21')],'agent':_0x5b8a61[_0x5dfd('0x34')],'interaction':_0x5b8a61[_0x5dfd('0x35')],'account':_0x5b8a61['account']}))||'';}exports['index']=function(_0x263f18,_0x13d7d3){var _0x5dc4be={};var _0x218b46=_[_0x5dfd('0x36')](db['ChatInteraction'][_0x5dfd('0x37')],function(_0x4ebc78){return{'name':_0x4ebc78[_0x5dfd('0x38')],'type':_0x4ebc78[_0x5dfd('0x39')][_0x5dfd('0x3a')]};});_0x5dc4be=qs['getOptions'](_0x218b46,_0x263f18);return interaction[_0x5dfd('0x3b')](_0x5dfd('0x3c'),_0x263f18[_0x5dfd('0x3d')],_0x263f18[_0x5dfd('0x3e')],_0x5dc4be,_0x218b46)[_0x5dfd('0x18')](respondWithFilteredResult(_0x13d7d3,_0x5dc4be))['catch'](handleError(_0x13d7d3,null));};exports[_0x5dfd('0x3f')]=function(_0x18ac03,_0x4680a4){var _0x5f153={'raw':![],'where':{'id':_0x18ac03[_0x5dfd('0x40')]['id']}},_0x5928d3={};_0x5928d3[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x43')]['rawAttributes']);_0x5928d3[_0x5dfd('0x3d')]=_['keys'](_0x18ac03[_0x5dfd('0x3d')]);_0x5928d3[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],_0x5928d3[_0x5dfd('0x3d')]);_0x5f153['attributes']=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x5f153[_0x5dfd('0x47')]=_0x5f153[_0x5dfd('0x47')]['length']?_0x5f153[_0x5dfd('0x47')]:_0x5928d3[_0x5dfd('0x41')];if(_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x5f153[_0x5dfd('0x49')]=[{'all':!![]}];}_0x5f153=_[_0x5dfd('0x31')]({},_0x5f153,_0x18ac03[_0x5dfd('0x4a')]);return db[_0x5dfd('0x43')]['find'](_0x5f153)[_0x5dfd('0x18')](handleEntityNotFound(_0x4680a4,null))[_0x5dfd('0x18')](respondWithResult(_0x4680a4,null))[_0x5dfd('0x22')](handleError(_0x4680a4,null));};exports[_0x5dfd('0x4b')]=function(_0x2d3aa5,_0x136f15){return db[_0x5dfd('0x43')][_0x5dfd('0x4b')](_0x2d3aa5[_0x5dfd('0x32')],{})[_0x5dfd('0x18')](respondWithResult(_0x136f15,0xc9))[_0x5dfd('0x22')](handleError(_0x136f15,null));};exports[_0x5dfd('0x4c')]=function(_0x3ce5fd,_0x24361d){if(_0x3ce5fd['body']['id']){delete _0x3ce5fd[_0x5dfd('0x32')]['id'];}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x3ce5fd['params']['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x24361d,null))[_0x5dfd('0x18')](saveUpdates(_0x3ce5fd[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x24361d,null))[_0x5dfd('0x22')](handleError(_0x24361d,null));};exports[_0x5dfd('0x2d')]=function(_0x4f57ae,_0x422706){return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x4f57ae[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x422706,null))[_0x5dfd('0x18')](removeEntity(_0x422706,null))[_0x5dfd('0x22')](handleError(_0x422706,null));};exports[_0x5dfd('0x4e')]=function(_0x2e19bb,_0x166ced){return db['ChatInteraction'][_0x5dfd('0x4e')]()[_0x5dfd('0x18')](respondWithResult(_0x166ced,null))[_0x5dfd('0x22')](handleError(_0x166ced,null));};exports['createVidaooSession']=function(_0x71ba3e,_0x32532d){var _0x3865e5=_0x71ba3e[_0x5dfd('0x40')]['id'];var _0x333035;var _0xd98c0f;var _0x40e9d7;return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x3865e5}})['then'](function(_0x28c84a){_0x333035=_0x28c84a;return db[_0x5dfd('0x50')]['findOne']({'where':{'id':_0x28c84a[_0x5dfd('0x51')]},'attributes':['id','vidaooApiKey',_0x5dfd('0x52'),'vidaooTopic','vidaooNote',_0x5dfd('0x53')],'raw':!![]});})[_0x5dfd('0x18')](function(_0x4f3af6){if(_0x4f3af6&&_0x4f3af6[_0x5dfd('0x54')]&&_0x4f3af6[_0x5dfd('0x52')]){_0xd98c0f=_0x4f3af6;var _0x2f38c5={'interaction':{'id':_0x3865e5},'agent':{'id':_0x71ba3e[_0x5dfd('0x3e')]['id'],'name':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x2f')],'fullname':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x55')],'email':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]},'contact':_0x71ba3e['body'][_0x5dfd('0x33')],'account':_0x71ba3e[_0x5dfd('0x32')][_0x5dfd('0x57')]};var _0x2d8585={'rejectUnauthorized':![],'method':_0x5dfd('0x58'),'url':_0x5dfd('0x59'),'headers':{'X-APIKEY':_0x4f3af6[_0x5dfd('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]],'buttons':null,'topic':_0xd98c0f[_0x5dfd('0x5a')],'note':_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x5c')])?null:getMustacheRender(_0xd98c0f[_0x5dfd('0x5c')],_0x2f38c5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x53')])){var _0xe2649d=getMustacheRender(_0xd98c0f[_0x5dfd('0x53')],_0x2f38c5);var _0x5726df=JSON['parse'](_0xe2649d);_0x2d8585[_0x5dfd('0x32')][_0x5dfd('0x5d')]=_0x5726df;}}catch(_0x642260){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2d8585);}else{throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x60'));}})['then'](function(_0x11334e){_0x40e9d7=_0x11334e;if(_0x40e9d7['id']){var _0x4b8f19={'body':_0x40e9d7['join_url'],'ChatWebsiteId':_0xd98c0f['id'],'ChatInteractionId':_0x333035['id'],'direction':_0x5dfd('0x61'),'UserId':_0x71ba3e['user']['id']};return db[_0x5dfd('0x62')]['create'](_0x4b8f19,{});}else{throw new db['Sequelize'][(_0x5dfd('0x5f'))](_0x5dfd('0x63'));}})[_0x5dfd('0x18')](function(){return _0x333035[_0x5dfd('0x64')]({'vidaooSessionId':_0x40e9d7['id']});})[_0x5dfd('0x18')](respondWithResult(_0x32532d,null))['catch'](handleError(_0x32532d,null));};exports['customUpdate']=function(_0x177168,_0x476020){if(_0x177168[_0x5dfd('0x32')]['id']){delete _0x177168['body']['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x177168[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x65')],'as':_0x5dfd('0x66')}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x476020,null))['then'](saveUpdates(_0x177168[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x476020,null))['catch'](handleError(_0x476020,null));};exports['abandon']=function(_0x4766c5,_0x34357c){if(_0x4766c5[_0x5dfd('0x32')]['id']){delete _0x4766c5[_0x5dfd('0x32')]['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4766c5['params']['id']}})[_0x5dfd('0x18')](function(_0x355b5e){if(!_0x355b5e){logger[_0x5dfd('0x1f')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5dfd('0x67'),0x194,_0x5dfd('0x68'));_0x34357c[_0x5dfd('0x23')](0x194);}else{if(_0x355b5e[_0x5dfd('0x69')]){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x6a'));}}return _0x355b5e;})[_0x5dfd('0x18')](function(_0x5c5583){if(_0x5c5583){return _0x5c5583[_0x5dfd('0x4c')]({'closed':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6b')],'disposition':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6c')]})[_0x5dfd('0x18')](function(_0x3de061){return _0x3de061;});}})[_0x5dfd('0x18')](function(){return respondWithRpcPromise(_0x5dfd('0x6d'),_0x5dfd('0x67'),_0x4766c5[_0x5dfd('0x32')],client9004);})['then'](respondWithResult(_0x34357c,null))['catch'](handleError(_0x34357c,null));};exports[_0x5dfd('0x6e')]=function(_0x3dd887,_0x2ae1fe){_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x2f')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x70')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x71')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x72')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x39')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x73')];return db[_0x5dfd('0x74')]['create'](_0x3dd887['body'])[_0x5dfd('0x18')](respondWithResult(_0x2ae1fe,0xc9))[_0x5dfd('0x22')](handleError(_0x2ae1fe,null));};exports['attachmentDownload']=function(_0x1d8f5f,_0x5b75e4){return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f[_0x5dfd('0x40')]['id']},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null))[_0x5dfd('0x18')](function(_0x158a97){if(_0x158a97){if(_0x158a97[_0x5dfd('0x6b')]){return _0x5b75e4[_0x5dfd('0x24')](0x193)[_0x5dfd('0x26')]({'status':0x193,'message':_0x5dfd('0x75')});}return db['Attachment'][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f['query'][_0x5dfd('0x76')]},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null));}})['then'](function(_0xc20fa7){if(_0xc20fa7){var _0x2df00c=_0xc20fa7['ChatOfflineMessageId']!==null;var _0x522d2e=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x79'));if(_0x2df00c){_0x522d2e=path[_0x5dfd('0x77')](_0x522d2e,'offline-chat/');}var _0x35d594=path['join'](_0x522d2e,_0xc20fa7[_0x5dfd('0x71')]);return _0x5b75e4['download'](_0x35d594);}})['catch'](handleError(_0x5b75e4,null));};exports['close']=function(_0x36c9fa,_0x2bb094){var _0x4118de=null;var _0x1f57a0=null;var _0x4be4c1=null;if(_0x36c9fa[_0x5dfd('0x32')]['id']){delete _0x36c9fa['body']['id'];}if(_0x36c9fa['body'][_0x5dfd('0x7a')]){_0x4be4c1=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x7b'),util[_0x5dfd('0x7c')](_0x5dfd('0x7d'),Date[_0x5dfd('0x7e')]()));_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7f')]=_0x4be4c1;}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x36c9fa[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x62')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x2bb094,null))[_0x5dfd('0x18')](saveUpdates(_0x36c9fa['body'],null))[_0x5dfd('0x18')](function(_0x20d94f){if(_0x20d94f){_0x4118de=_0x20d94f;return db[_0x5dfd('0x50')][_0x5dfd('0x4d')]({'where':{'id':_0x4118de['ChatWebsiteId']}});}})[_0x5dfd('0x18')](function(_0x1abfac){if(_0x1abfac){_0x1f57a0=_0x1abfac;return db[_0x5dfd('0x65')]['find']({'where':{'id':_0x4118de[_0x5dfd('0x80')]}});}})[_0x5dfd('0x18')](function(_0x2bd84b){if(_0x2bd84b){if(_0x4be4c1){var _0x14eec1=null;for(var _0x45a598=0x1;_0x45a598<_0x4118de[_0x5dfd('0x81')][_0x5dfd('0x82')];++_0x45a598){_0x14eec1=_0x4118de['Messages'][_0x45a598];var _0xabe737=_0x14eec1[_0x5dfd('0x69')]?util[_0x5dfd('0x7c')]('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');var _0x57c664=_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x85')]||util[_0x5dfd('0x7c')]('%s%d',_0x5dfd('0x86'),_0x14eec1[_0x5dfd('0x80')]);switch(_0x1f57a0['agentIdentifier']){case _0x5dfd('0x87'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format'](_0x5dfd('0x88'),_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');break;case _0x5dfd('0x89'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1['User'][_0x5dfd('0x8a')]||_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;case _0x5dfd('0x8c'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;default:_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format']('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');}var _0x27e002=util[_0x5dfd('0x7c')](_0x5dfd('0x8d'),moment(_0x14eec1[_0x5dfd('0x8e')])[_0x5dfd('0x7c')](_0x5dfd('0x8f')),_0x14eec1[_0x5dfd('0x90')]==='in'?_0x57c664:_0xabe737,_0x14eec1[_0x5dfd('0x32')]);if(!_0x14eec1[_0x5dfd('0x91')]){fs[_0x5dfd('0x92')](_0x4be4c1,_0x27e002);}}return db['MailAccount'][_0x5dfd('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5dfd('0x93')],'as':_0x5dfd('0x94'),'raw':!![],'include':[{'model':db[_0x5dfd('0x95')],'as':_0x5dfd('0x95'),'raw':!![]}]}]});}}})[_0x5dfd('0x18')](function(_0xea5e0){if(!_0xea5e0||!_0xea5e0[_0x5dfd('0x94')]||!_0x36c9fa[_0x5dfd('0x32')])return _0x4118de;var _0xb8a62b=_0xea5e0['getSmtpOptions']();return respondWithRpcPromise(_0x5dfd('0x96'),'sendMail',{'account':_0xb8a62b,'message':{'from':util[_0x5dfd('0x7c')](_0x5dfd('0x97'),_0xea5e0[_0x5dfd('0x2f')],_0xea5e0[_0x5dfd('0x56')]||_0xea5e0[_0x5dfd('0x94')][_0x5dfd('0x3e')]),'to':_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7a')],'subject':_0x5dfd('0x98'),'text':util[_0x5dfd('0x7c')](_0x5dfd('0x99'),_0x36c9fa['body'][_0x5dfd('0x7a')]),'attachments':[{'path':_0x4be4c1}]}})[_0x5dfd('0x18')](function(){return _0x4118de;})[_0x5dfd('0x22')](function(_0x421991){logger[_0x5dfd('0x1f')](_0x421991);});})[_0x5dfd('0x18')](respondWithStatusCode(_0x2bb094,0xc8))[_0x5dfd('0x22')](handleError(_0x2bb094,null));};exports[_0x5dfd('0x9a')]=function(_0x1d8b85,_0x2e4360){return db[_0x5dfd('0x62')][_0x5dfd('0x4d')]({'where':{'id':_0x1d8b85[_0x5dfd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e4360,null))[_0x5dfd('0x18')](function(_0x2fc5f6){if(_0x2fc5f6){return _0x2fc5f6[_0x5dfd('0x9a')](_0x1d8b85[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x1d8b85[_0x5dfd('0x32')],[_0x5dfd('0x9b'),'id'])||{});}})[_0x5dfd('0x18')](respondWithResult(_0x2e4360,null))[_0x5dfd('0x22')](handleError(_0x2e4360,null));};exports['getMessages']=function(_0x16d6e8,_0x29b226){var _0x253810={'raw':![],'where':{}};var _0x9bc8a2={};var _0x4fe0a7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dfd('0x4f')]({'where':{'id':_0x16d6e8[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x29b226,null))[_0x5dfd('0x18')](function(_0x340282){if(_0x340282){_0x9bc8a2[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x9bc8a2['query']=_[_0x5dfd('0x42')](_0x16d6e8[_0x5dfd('0x3d')]);_0x9bc8a2['filters']=_[_0x5dfd('0x45')](_0x9bc8a2[_0x5dfd('0x41')],_0x9bc8a2[_0x5dfd('0x3d')]);_0x253810['attributes']=_['intersection'](_0x9bc8a2[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x16d6e8[_0x5dfd('0x3d')]['fields']));_0x253810['attributes']=_0x253810['attributes'][_0x5dfd('0x82')]?_0x253810['attributes']:_0x9bc8a2[_0x5dfd('0x41')];if(!_0x16d6e8['query'][_0x5dfd('0x9d')](_0x5dfd('0x9e'))){_0x253810[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x253810[_0x5dfd('0x27')]=qs[_0x5dfd('0x27')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x253810['order']=qs[_0x5dfd('0x9f')](_0x16d6e8[_0x5dfd('0x3d')]['sort']);_0x253810[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x16d6e8[_0x5dfd('0x3d')],_0x9bc8a2[_0x5dfd('0x44')]));_0x253810[_0x5dfd('0xa0')]['ChatInteractionId']=_0x340282['id'];if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x253810['where']=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],{'$or':_[_0x5dfd('0x36')](_0x253810[_0x5dfd('0x47')],function(_0x45e502){var _0xddded4={};_0xddded4[_0x45e502]={'$like':'%'+_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]+'%'};return _0xddded4;})});}if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')]){var _0x5be9a2=_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')][_0x5dfd('0xa4')](',');var _0x4777f8={};_0x4777f8[_0x5be9a2[0x0]]={'$gte':moment(_0x5be9a2[0x1])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))};_0x253810[_0x5dfd('0xa0')]=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],_0x4777f8);}_0x253810=_[_0x5dfd('0x31')]({},_0x253810,_0x16d6e8[_0x5dfd('0x4a')]);return db['ChatMessage']['count']({'where':_0x253810['where']})[_0x5dfd('0x18')](function(_0x55051b){_0x4fe0a7[_0x5dfd('0x2a')]=_0x55051b;if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x253810['include']=[{'all':!![]}];}return db[_0x5dfd('0x62')][_0x5dfd('0x3b')](_0x253810);})[_0x5dfd('0x18')](function(_0x4c2e7b){_0x4fe0a7['rows']=_0x4c2e7b;return _0x4fe0a7;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x29b226,_0x253810))['catch'](handleError(_0x29b226,null));};exports[_0x5dfd('0xa6')]=function(_0x460008,_0x28bd3b){var _0x204d36={'where':{}},_0x551579={},_0x13b2a1={'count':0x0,'rows':[]};return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x460008[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x28bd3b,null))[_0x5dfd('0x18')](function(_0x21c7f1){if(_0x21c7f1){_0x551579[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x551579[_0x5dfd('0x3d')]=_[_0x5dfd('0x42')](_0x460008[_0x5dfd('0x3d')]);_0x551579[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],_0x551579[_0x5dfd('0x3d')]);_0x204d36[_0x5dfd('0x47')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],qs['fields'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x204d36[_0x5dfd('0x47')]=_0x204d36[_0x5dfd('0x47')][_0x5dfd('0x82')]?_0x204d36[_0x5dfd('0x47')]:_0x551579['model'];if(!_0x460008[_0x5dfd('0x3d')]['hasOwnProperty']('nolimit')){_0x204d36[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x204d36[_0x5dfd('0x27')]=qs['offset'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x204d36[_0x5dfd('0xa7')]=qs[_0x5dfd('0x9f')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x9f')]);_0x204d36[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x460008[_0x5dfd('0x3d')],_0x551579[_0x5dfd('0x44')]));_0x204d36['where'][_0x5dfd('0xa8')]=_0x21c7f1['id'];if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x204d36['where']=_[_0x5dfd('0x31')](_0x204d36[_0x5dfd('0xa0')],{'$or':_['map'](_0x204d36[_0x5dfd('0x47')],function(_0x14b098){var _0xe07a6f={};_0xe07a6f[_0x14b098]={'$like':'%'+_0x460008[_0x5dfd('0x3d')]['filter']+'%'};return _0xe07a6f;})});}_0x204d36['where'][_0x5dfd('0x91')]=![];if(_0x460008[_0x5dfd('0x3d')]['id']){_0x204d36[_0x5dfd('0xa0')]['id']={'$gt':_0x460008[_0x5dfd('0x3d')]['id']};}_0x204d36=_['merge']({},_0x204d36,_0x460008[_0x5dfd('0x4a')]);return db[_0x5dfd('0x62')][_0x5dfd('0x2a')]({'where':_0x204d36[_0x5dfd('0xa0')]})[_0x5dfd('0x18')](function(_0x1b6518){_0x13b2a1['count']=_0x1b6518;_0x204d36[_0x5dfd('0x49')]=[];if(_0x460008['query'][_0x5dfd('0xa9')]){_0x204d36['include'][_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id',_0x5dfd('0x55'),_0x5dfd('0x8a')]});}if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x204d36[_0x5dfd('0x49')]=[{'all':!![]}];}return db[_0x5dfd('0x62')]['findAll'](_0x204d36);})[_0x5dfd('0x18')](function(_0x507f08){_0x13b2a1[_0x5dfd('0xab')]=_0x507f08;return _0x13b2a1;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x28bd3b,_0x204d36))['catch'](handleError(_0x28bd3b,null));};exports['addTags']=function(_0x4a180b,_0x4ceb2e){return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4a180b[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x4ceb2e,null))[_0x5dfd('0x18')](function(_0x3f23fd){if(_0x3f23fd){return _0x3f23fd[_0x5dfd('0xac')](_0x4a180b[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x4a180b['body'],[_0x5dfd('0x9b'),'id'])||{})[_0x5dfd('0xad')](function(){return db[_0x5dfd('0xae')]['findAll']({'attributes':['id',_0x5dfd('0x2f'),_0x5dfd('0xaf')],'where':{'id':_0x4a180b['body'][_0x5dfd('0x9b')]}});})[_0x5dfd('0x18')](function(_0x5c600c){socket[_0x5dfd('0xb0')](_0x5dfd('0xb1'),{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]});return{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]};});}})[_0x5dfd('0x18')](respondWithResult(_0x4ceb2e,null))[_0x5dfd('0x22')](handleError(_0x4ceb2e,null));};exports[_0x5dfd('0xb2')]=function(_0xc7a87d,_0x2398e4){return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0xc7a87d[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x2398e4,null))['then'](function(_0x11a262){if(_0x11a262){return _0x11a262['removeTags'](_0xc7a87d[_0x5dfd('0x3d')][_0x5dfd('0x9b')]);}})[_0x5dfd('0x18')](respondWithStatusCode(_0x2398e4,null))['catch'](handleError(_0x2398e4,null));};exports[_0x5dfd('0xb3')]=function(_0x26ea70,_0x5984c5){var _0x4481f5=moment()['unix']()[_0x5dfd('0xb4')]();var _0x179265=path[_0x5dfd('0x77')](config['root'],'server',_0x5dfd('0xb5'),_0x5dfd('0xb6'));var _0x493023=path['join'](config['root'],'server','files','attachments');var _0x32ea28=path[_0x5dfd('0x77')](_0x179265,_0x4481f5);var _0x303f79=util[_0x5dfd('0x7c')](_0x5dfd('0xb7'),_0x26ea70[_0x5dfd('0x40')]['id'],_0x4481f5);var _0xaec36b=path['join'](_0x179265,_0x303f79);var _0x447e42=[];_0x447e42[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id','fullname'],'raw':!![]});_0x447e42['push']({'model':db['CmContact'],'as':_0x5dfd('0x66'),'attributes':['id','firstName',_0x5dfd('0xb8')],'raw':!![]});if(_0x26ea70[_0x5dfd('0x3d')][_0x5dfd('0xb9')]){_0x447e42['push']({'model':db['Attachment'],'as':_0x5dfd('0x74'),'raw':!![]});}var _0xf8fa16=[{'model':db[_0x5dfd('0x62')],'as':'Messages','attributes':['id',_0x5dfd('0x32'),_0x5dfd('0x8e'),'direction',_0x5dfd('0x91'),_0x5dfd('0xba')],'include':_0x447e42}];_0xf8fa16[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x50')],'as':_0x5dfd('0xbb'),'attributes':['id',_0x5dfd('0x2f')]});_0xf8fa16['push']({'model':db[_0x5dfd('0x8b')],'as':'Owner','attributes':['id',_0x5dfd('0x55')]});return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x26ea70[_0x5dfd('0x40')]['id']},'include':_0xf8fa16})[_0x5dfd('0x18')](handleEntityNotFound(_0x5984c5,null))['then'](function(_0x2f3704){if(_0x2f3704){var _0x2af6d0=_0x2f3704['get']({'plain':!![]});fs[_0x5dfd('0xbc')](_0x32ea28);var _0x31b0d7={'channel':_0x5dfd('0xbd'),'account':_0x2af6d0[_0x5dfd('0xbb')]['name'],'agent':_0x2af6d0['Owner']?_0x2af6d0['Owner']['fullname']:'N.A.','createdAt':moment(_0x2af6d0['createdAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')](),'closedAt':_0x2af6d0[_0x5dfd('0x6b')]?moment(_0x2af6d0['closedAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')]():'','disposition':_0x2af6d0['disposition'],'chatInfo':{'browser':_0x2af6d0[_0x5dfd('0xbe')],'os':_0x2af6d0[_0x5dfd('0xbf')],'referer':_0x2af6d0[_0x5dfd('0xc0')],'customerIp':_0x2af6d0['customerIp'],'customerPort':_0x2af6d0[_0x5dfd('0xc1')]?_0x2af6d0[_0x5dfd('0xc1')]:_0x5dfd('0xc2')},'messages':_(_0x2af6d0[_0x5dfd('0x81')])[_0x5dfd('0xc3')]()[_0x5dfd('0xa2')]({'secret':![]})['map'](function(_0xacb12a){if(_0xacb12a['Attachment']){var _0x7df070=path[_0x5dfd('0x77')](_0x493023,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]);if(fs[_0x5dfd('0xc4')](_0x7df070)){fs['createReadStream'](_0x7df070)['pipe'](fs[_0x5dfd('0xc5')](path[_0x5dfd('0x77')](_0x32ea28,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')])));}}return{'date':moment(_0xacb12a[_0x5dfd('0x8e')])[_0x5dfd('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xacb12a[_0x5dfd('0x90')]===_0x5dfd('0x61')?_0xacb12a[_0x5dfd('0x8b')]?_0xacb12a[_0x5dfd('0x8b')]['fullname']:'System':_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xc6')]+(_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xb8')]?'\x20'+_0xacb12a[_0x5dfd('0x66')]['lastName']:''),'body':_0xacb12a['Attachment']?_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]:_0xacb12a[_0x5dfd('0x32')],'direction':_0xacb12a['direction']===_0x5dfd('0x61')?'A':'C','secret':_0xacb12a[_0x5dfd('0x91')],'read':_0xacb12a[_0x5dfd('0xba')],'attachment':_0xacb12a[_0x5dfd('0x74')]};})[_0x5dfd('0xc7')]()};return ejs['renderFile'](path[_0x5dfd('0x77')](config['root'],_0x5dfd('0xc8'),_0x5dfd('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x31b0d7})[_0x5dfd('0x18')](function(_0x134519){var _0x44e4b0=path[_0x5dfd('0x77')](_0x32ea28,_0x5dfd('0xca')+_0x2af6d0['id']+'-'+_0x4481f5+_0x5dfd('0xcb'));var _0x539313={'path':_0x44e4b0,'channel':_0x5dfd('0xbd'),'interactionId':_0x2af6d0['id']};return pdf[_0x5dfd('0xcc')](_0x134519,_0x539313);})[_0x5dfd('0x18')](function(){return new Promise(function(_0x2a8266,_0x5a7422){zipdir(_0x32ea28,{'saveTo':_0xaec36b},function(_0x507fa2,_0x4ce325){if(_0x507fa2)return _0x5a7422(_0x507fa2);return _0x2a8266(_0x4ce325);});})[_0x5dfd('0x18')](function(){return new BPromise(function(_0xda5f61,_0xb60d91){rimraf(_0x32ea28,function(_0x2960bc){if(_0x2960bc)_0xb60d91(_0x2960bc);return _0xda5f61();});});})[_0x5dfd('0x18')](function(){return _0x5984c5[_0x5dfd('0xb3')](_0xaec36b,_0x303f79,function(_0x381941){if(_0x381941){logger[_0x5dfd('0x1f')]('err',_0x381941);}else{fs[_0x5dfd('0xcd')](_0xaec36b);}});});});}else{return _0x5984c5[_0x5dfd('0x23')](0xc8);}})['catch'](handleError(_0x5984c5,null));};
\ No newline at end of file
+var _0xa641=['unlinkSync','zip-dir','request-promise','util','path','ejs','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','destroy','name','send','render','merge','body','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','attributes','fields','include','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','mailTranscript','format','transcript-%s.txt','now','User','ChatWebsite','ContactId','Messages','length','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','getMyMessages','push','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','direction','read','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa641,0x199));var _0x1a64=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa641[_0x4e676e];return _0x336a3c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x1a64('0x0'));var rp=require(_0x1a64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a64('0x2'));var path=require(_0x1a64('0x3'));var ejs=require(_0x1a64('0x4'));var fs=require('fs');var _=require(_0x1a64('0x5'));var Redis=require(_0x1a64('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x1a64('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x1a64('0x8'));var config=require(_0x1a64('0x9'));var db=require(_0x1a64('0xa'))['db'];config['redis']=_[_0x1a64('0xb')](config[_0x1a64('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a64('0xd'))(new Redis(config[_0x1a64('0xc')]));require(_0x1a64('0xe'))['register'](socket);var jayson=require(_0x1a64('0xf'));var client=jayson[_0x1a64('0x10')][_0x1a64('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x1a64('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x15a5d3,_0x37b612,_0x5ba2e9,_0x195186){return new BPromise(function(_0x5b385e,_0x231d68){var _0x51a48c=_0x195186||client;return _0x51a48c[_0x1a64('0x12')](_0x15a5d3,_0x5ba2e9)[_0x1a64('0x13')](function(_0x950204){logger[_0x1a64('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x37b612,'request\x20sent');logger[_0x1a64('0x15')](_0x1a64('0x16'),_0x37b612,_0x1a64('0x17'),JSON['stringify'](_0x950204));if(_0x950204['error']){if(_0x950204[_0x1a64('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x231d68(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);return _0x5b385e(_0x950204[_0x1a64('0x18')][_0x1a64('0x19')]);}else{logger[_0x1a64('0x14')](_0x1a64('0x1a'),_0x37b612,_0x1a64('0x17'));_0x5b385e(_0x950204[_0x1a64('0x1b')][_0x1a64('0x19')]);}})[_0x1a64('0x1c')](function(_0x5ea058){logger[_0x1a64('0x18')](_0x1a64('0x1a'),_0x37b612,_0x5ea058);_0x231d68(_0x5ea058);});});}function respondWithStatusCode(_0x1f6fb5,_0x516c69){_0x516c69=_0x516c69||0xcc;return function(_0xc71066){if(_0xc71066){return _0x1f6fb5[_0x1a64('0x1d')](_0x516c69);}return _0x1f6fb5['status'](_0x516c69)[_0x1a64('0x1e')]();};}function respondWithResult(_0x3c74ec,_0x5630ce){_0x5630ce=_0x5630ce||0xc8;return function(_0x286743){if(_0x286743){return _0x3c74ec[_0x1a64('0x1f')](_0x5630ce)['json'](_0x286743);}};}function respondWithFilteredResult(_0xf3ad73,_0x4e3f92){return function(_0x523d6e){if(_0x523d6e){var _0x57168c=typeof _0x4e3f92['offset']==='undefined'&&typeof _0x4e3f92[_0x1a64('0x20')]===_0x1a64('0x21');var _0x21084f=_0x523d6e[_0x1a64('0x22')];var _0x17fbc0=_0x57168c?0x0:_0x4e3f92['offset'];var _0x5916bc=_0x57168c?_0x523d6e[_0x1a64('0x22')]:_0x4e3f92[_0x1a64('0x23')]+_0x4e3f92[_0x1a64('0x20')];var _0x2e3da4;if(_0x5916bc>=_0x21084f){_0x5916bc=_0x21084f;_0x2e3da4=0xc8;}else{_0x2e3da4=0xce;}_0xf3ad73[_0x1a64('0x1f')](_0x2e3da4);return _0xf3ad73[_0x1a64('0x24')](_0x1a64('0x25'),_0x17fbc0+'-'+_0x5916bc+'/'+_0x21084f)['json'](_0x523d6e);}return null;};}function saveUpdates(_0x3c2b26){return function(_0x1004ad){if(_0x1004ad){return _0x1004ad['update'](_0x3c2b26)['then'](function(_0x212d33){return _0x212d33;});}return null;};}function removeEntity(_0x264138){return function(_0xfe058d){if(_0xfe058d){return _0xfe058d[_0x1a64('0x26')]()['then'](function(){_0x264138[_0x1a64('0x1f')](0xcc)[_0x1a64('0x1e')]();});}};}function handleEntityNotFound(_0x3c12f6){return function(_0x4563a1){if(!_0x4563a1){_0x3c12f6[_0x1a64('0x1d')](0x194);}return _0x4563a1;};}function handleError(_0x3a42fc,_0x53ff3e){_0x53ff3e=_0x53ff3e||0x1f4;return function(_0x2fd0c8){logger[_0x1a64('0x18')](_0x2fd0c8['stack']);if(_0x2fd0c8[_0x1a64('0x27')]){delete _0x2fd0c8[_0x1a64('0x27')];}_0x3a42fc[_0x1a64('0x1f')](_0x53ff3e)[_0x1a64('0x28')](_0x2fd0c8);};}function getMustacheRender(_0x235c58,_0x4a6b9f){return Mustache[_0x1a64('0x29')](_0x235c58,_[_0x1a64('0x2a')](_0x4a6b9f[_0x1a64('0x2b')],{'contact':_0x4a6b9f['contact'],'message':_0x4a6b9f[_0x1a64('0x19')],'agent':_0x4a6b9f['agent'],'interaction':_0x4a6b9f[_0x1a64('0x2c')],'account':_0x4a6b9f[_0x1a64('0x2d')]}))||'';}exports[_0x1a64('0x2e')]=function(_0x18d31a,_0x59aaf2){var _0x4a9ca5={};var _0x82ab76=_[_0x1a64('0x2f')](db[_0x1a64('0x30')][_0x1a64('0x31')],function(_0x5c953c){return{'name':_0x5c953c[_0x1a64('0x32')],'type':_0x5c953c[_0x1a64('0x33')][_0x1a64('0x34')]};});_0x4a9ca5=qs[_0x1a64('0x35')](_0x82ab76,_0x18d31a);return interaction[_0x1a64('0x36')](_0x1a64('0x37'),_0x18d31a[_0x1a64('0x38')],_0x18d31a[_0x1a64('0x39')],_0x4a9ca5,_0x82ab76)[_0x1a64('0x13')](respondWithFilteredResult(_0x59aaf2,_0x4a9ca5))['catch'](handleError(_0x59aaf2,null));};exports['show']=function(_0x3d3b4c,_0x2b1a1e){var _0x437a36={'raw':![],'where':{'id':_0x3d3b4c[_0x1a64('0x3a')]['id']}},_0x183501={};_0x183501[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x30')][_0x1a64('0x31')]);_0x183501[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3d3b4c[_0x1a64('0x38')]);_0x183501[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x183501[_0x1a64('0x3b')],_0x183501[_0x1a64('0x38')]);_0x437a36[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x183501['model'],qs[_0x1a64('0x40')](_0x3d3b4c[_0x1a64('0x38')]['fields']));_0x437a36[_0x1a64('0x3f')]=_0x437a36[_0x1a64('0x3f')]['length']?_0x437a36[_0x1a64('0x3f')]:_0x183501[_0x1a64('0x3b')];if(_0x3d3b4c[_0x1a64('0x38')]['includeAll']){_0x437a36[_0x1a64('0x41')]=[{'all':!![]}];}_0x437a36=_[_0x1a64('0x2a')]({},_0x437a36,_0x3d3b4c['options']);return db['ChatInteraction'][_0x1a64('0x42')](_0x437a36)[_0x1a64('0x13')](handleEntityNotFound(_0x2b1a1e,null))[_0x1a64('0x13')](respondWithResult(_0x2b1a1e,null))[_0x1a64('0x1c')](handleError(_0x2b1a1e,null));};exports['create']=function(_0x54777b,_0x48a095){return db['ChatInteraction'][_0x1a64('0x43')](_0x54777b['body'],{})['then'](respondWithResult(_0x48a095,0xc9))[_0x1a64('0x1c')](handleError(_0x48a095,null));};exports['update']=function(_0x558e63,_0x176d5c){if(_0x558e63[_0x1a64('0x2b')]['id']){delete _0x558e63[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x558e63[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x176d5c,null))['then'](saveUpdates(_0x558e63[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x176d5c,null))[_0x1a64('0x1c')](handleError(_0x176d5c,null));};exports['destroy']=function(_0x4441b5,_0x3a24ea){return db[_0x1a64('0x30')]['find']({'where':{'id':_0x4441b5['params']['id']}})['then'](handleEntityNotFound(_0x3a24ea,null))[_0x1a64('0x13')](removeEntity(_0x3a24ea,null))[_0x1a64('0x1c')](handleError(_0x3a24ea,null));};exports[_0x1a64('0x44')]=function(_0x54ffee,_0x303447){return db[_0x1a64('0x30')][_0x1a64('0x44')]()[_0x1a64('0x13')](respondWithResult(_0x303447,null))[_0x1a64('0x1c')](handleError(_0x303447,null));};exports[_0x1a64('0x45')]=function(_0x29c915,_0x3c62ef){var _0x2279bd=_0x29c915['params']['id'];var _0x3e0a5c;var _0x19b7a9;var _0x530d47;return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x2279bd}})[_0x1a64('0x13')](function(_0x2a7931){_0x3e0a5c=_0x2a7931;return db['ChatWebsite']['findOne']({'where':{'id':_0x2a7931[_0x1a64('0x47')]},'attributes':['id',_0x1a64('0x48'),_0x1a64('0x49'),_0x1a64('0x4a'),_0x1a64('0x4b'),_0x1a64('0x4c')],'raw':!![]});})[_0x1a64('0x13')](function(_0x4b94a0){if(_0x4b94a0&&_0x4b94a0['vidaooApiKey']&&_0x4b94a0['vidaooEscalation']){_0x19b7a9=_0x4b94a0;var _0x17fa55={'interaction':{'id':_0x2279bd},'agent':{'id':_0x29c915[_0x1a64('0x39')]['id'],'name':_0x29c915['user'][_0x1a64('0x27')],'fullname':_0x29c915[_0x1a64('0x39')][_0x1a64('0x4d')],'email':_0x29c915['user'][_0x1a64('0x4e')]},'contact':_0x29c915[_0x1a64('0x2b')][_0x1a64('0x4f')],'account':_0x29c915['body'][_0x1a64('0x2d')]};var _0x54f570={'rejectUnauthorized':![],'method':_0x1a64('0x50'),'url':_0x1a64('0x51'),'headers':{'X-APIKEY':_0x4b94a0[_0x1a64('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29c915[_0x1a64('0x39')][_0x1a64('0x4e')]],'buttons':null,'topic':_0x19b7a9[_0x1a64('0x4a')],'note':_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4b')])?null:getMustacheRender(_0x19b7a9['vidaooNote'],_0x17fa55),'metadata':null},'redirect':_0x1a64('0x53'),'json':!![]};try{if(!_[_0x1a64('0x52')](_0x19b7a9[_0x1a64('0x4c')])){var _0x1aa14e=getMustacheRender(_0x19b7a9[_0x1a64('0x4c')],_0x17fa55);var _0x565e78=JSON[_0x1a64('0x54')](_0x1aa14e);_0x54f570[_0x1a64('0x2b')][_0x1a64('0x55')]=_0x565e78;}}catch(_0x319363){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x54f570);}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x1a64('0x13')](function(_0x581434){_0x530d47=_0x581434;if(_0x530d47['id']){var _0x665aae={'body':_0x530d47[_0x1a64('0x58')],'ChatWebsiteId':_0x19b7a9['id'],'ChatInteractionId':_0x3e0a5c['id'],'direction':'out','UserId':_0x29c915[_0x1a64('0x39')]['id']};return db[_0x1a64('0x59')][_0x1a64('0x43')](_0x665aae,{});}else{throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1a64('0x13')](function(){return _0x3e0a5c[_0x1a64('0x5a')]({'vidaooSessionId':_0x530d47['id']});})[_0x1a64('0x13')](respondWithResult(_0x3c62ef,null))[_0x1a64('0x1c')](handleError(_0x3c62ef,null));};exports[_0x1a64('0x5b')]=function(_0x5dd1f4,_0x24b291){if(_0x5dd1f4[_0x1a64('0x2b')]['id']){delete _0x5dd1f4[_0x1a64('0x2b')]['id'];}return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x5dd1f4[_0x1a64('0x3a')]['id']},'include':[{'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d')}]})['then'](handleEntityNotFound(_0x24b291,null))[_0x1a64('0x13')](saveUpdates(_0x5dd1f4[_0x1a64('0x2b')],null))[_0x1a64('0x13')](respondWithResult(_0x24b291,null))[_0x1a64('0x1c')](handleError(_0x24b291,null));};exports[_0x1a64('0x5e')]=function(_0x3ecf23,_0x108da6){if(_0x3ecf23[_0x1a64('0x2b')]['id']){delete _0x3ecf23['body']['id'];}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x3ecf23[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](function(_0x1be29f){if(!_0x1be29f){logger[_0x1a64('0x18')](_0x1a64('0x5f'),_0x1a64('0x5e'),0x194,_0x1a64('0x60'));_0x108da6[_0x1a64('0x1d')](0x194);}else{if(_0x1be29f[_0x1a64('0x61')]){throw new db[(_0x1a64('0x56'))][(_0x1a64('0x57'))](_0x1a64('0x62'));}}return _0x1be29f;})['then'](function(_0x5e0627){if(_0x5e0627){return _0x5e0627['update']({'closed':_0x3ecf23[_0x1a64('0x2b')][_0x1a64('0x63')],'disposition':_0x3ecf23['body']['disposition']})['then'](function(_0x191c21){return _0x191c21;});}})[_0x1a64('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x1a64('0x5e'),_0x3ecf23['body'],client9004);})[_0x1a64('0x13')](respondWithResult(_0x108da6,null))[_0x1a64('0x1c')](handleError(_0x108da6,null));};exports[_0x1a64('0x64')]=function(_0x46c07b,_0x2c63bf){_0x46c07b[_0x1a64('0x2b')][_0x1a64('0x27')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x66')];_0x46c07b['body'][_0x1a64('0x67')]=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x68')];_0x46c07b[_0x1a64('0x2b')]['type']=_0x46c07b[_0x1a64('0x65')][_0x1a64('0x69')];return db[_0x1a64('0x6a')][_0x1a64('0x43')](_0x46c07b['body'])[_0x1a64('0x13')](respondWithResult(_0x2c63bf,0xc9))[_0x1a64('0x1c')](handleError(_0x2c63bf,null));};exports[_0x1a64('0x6b')]=function(_0x4e1d73,_0x2f3338){return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['params']['id']},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null))['then'](function(_0xba9f42){if(_0xba9f42){if(_0xba9f42[_0x1a64('0x63')]){return _0x2f3338[_0x1a64('0x1f')](0x193)[_0x1a64('0x6c')]({'status':0x193,'message':_0x1a64('0x6d')});}return db['Attachment'][_0x1a64('0x46')]({'where':{'id':_0x4e1d73['query'][_0x1a64('0x6e')]},'raw':!![]})[_0x1a64('0x13')](handleEntityNotFound(_0x2f3338,null));}})['then'](function(_0x1a7539){if(_0x1a7539){var _0x4d895b=_0x1a7539['ChatOfflineMessageId']!==null;var _0x6c8f4d=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0x71'));if(_0x4d895b){_0x6c8f4d=path['join'](_0x6c8f4d,_0x1a64('0x72'));}var _0x4edd79=path['join'](_0x6c8f4d,_0x1a7539[_0x1a64('0x67')]);return _0x2f3338['download'](_0x4edd79);}})['catch'](handleError(_0x2f3338,null));};exports['close']=function(_0x14ce35,_0x466e70){var _0x499857=null;var _0x2ed772=null;var _0x359d57=null;if(_0x14ce35['body']['id']){delete _0x14ce35[_0x1a64('0x2b')]['id'];}if(_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')]){_0x359d57=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server/files/chat/upload/',util[_0x1a64('0x74')](_0x1a64('0x75'),Date[_0x1a64('0x76')]()));_0x14ce35[_0x1a64('0x2b')]['pathTranscript']=_0x359d57;}return db['ChatInteraction'][_0x1a64('0x42')]({'where':{'id':_0x14ce35['params']['id']},'include':[{'model':db[_0x1a64('0x59')],'as':'Messages','include':[{'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77')}]}]})[_0x1a64('0x13')](handleEntityNotFound(_0x466e70,null))[_0x1a64('0x13')](saveUpdates(_0x14ce35[_0x1a64('0x2b')],null))[_0x1a64('0x13')](function(_0xda163e){if(_0xda163e){_0x499857=_0xda163e;return db[_0x1a64('0x78')]['find']({'where':{'id':_0x499857[_0x1a64('0x47')]}});}})[_0x1a64('0x13')](function(_0xa24c0a){if(_0xa24c0a){_0x2ed772=_0xa24c0a;return db[_0x1a64('0x5c')]['find']({'where':{'id':_0x499857[_0x1a64('0x79')]}});}})[_0x1a64('0x13')](function(_0x2176c7){if(_0x2176c7){if(_0x359d57){var _0x3cfb92=null;for(var _0x3308e1=0x1;_0x3308e1<_0x499857[_0x1a64('0x7a')][_0x1a64('0x7b')];++_0x3308e1){_0x3cfb92=_0x499857['Messages'][_0x3308e1];var _0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):'System';var _0x557867=_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x7e')]||util['format'](_0x1a64('0x7c'),_0x1a64('0x7f'),_0x3cfb92[_0x1a64('0x79')]);switch(_0x2ed772[_0x1a64('0x80')]){case _0x1a64('0x81'):_0x2fea2e=_0x3cfb92['UserId']?util['format'](_0x1a64('0x7c'),_0x2ed772['agentAlias'],_0x3cfb92['UserId']):_0x1a64('0x82');break;case'agent_alias':_0x2fea2e=_0x3cfb92['UserId']?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x83')]||_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;case'agent_fullname':_0x2fea2e=_0x3cfb92[_0x1a64('0x61')]?_0x3cfb92[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82');break;default:_0x2fea2e=_0x3cfb92['UserId']?util[_0x1a64('0x74')](_0x1a64('0x7c'),_0x2ed772[_0x1a64('0x7d')],_0x3cfb92[_0x1a64('0x61')]):_0x1a64('0x82');}var _0xd884a1=util[_0x1a64('0x74')](_0x1a64('0x84'),moment(_0x3cfb92[_0x1a64('0x85')])[_0x1a64('0x74')](_0x1a64('0x86')),_0x3cfb92['direction']==='in'?_0x557867:_0x2fea2e,_0x3cfb92['body']);if(!_0x3cfb92[_0x1a64('0x87')]){fs[_0x1a64('0x88')](_0x359d57,_0xd884a1);}}return db[_0x1a64('0x89')][_0x1a64('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1a64('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x1a64('0x13')](function(_0x4aa540){if(!_0x4aa540||!_0x4aa540[_0x1a64('0x8a')]||!_0x14ce35[_0x1a64('0x2b')])return _0x499857;var _0xad1595=_0x4aa540[_0x1a64('0x8b')]();return respondWithRpcPromise('SendMail',_0x1a64('0x8c'),{'account':_0xad1595,'message':{'from':util[_0x1a64('0x74')](_0x1a64('0x8d'),_0x4aa540[_0x1a64('0x27')],_0x4aa540[_0x1a64('0x4e')]||_0x4aa540[_0x1a64('0x8a')][_0x1a64('0x39')]),'to':_0x14ce35[_0x1a64('0x2b')][_0x1a64('0x73')],'subject':_0x1a64('0x8e'),'text':util[_0x1a64('0x74')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x14ce35['body'][_0x1a64('0x73')]),'attachments':[{'path':_0x359d57}]}})[_0x1a64('0x13')](function(){return _0x499857;})[_0x1a64('0x1c')](function(_0x37a943){logger['error'](_0x37a943);});})['then'](respondWithStatusCode(_0x466e70,0xc8))[_0x1a64('0x1c')](handleError(_0x466e70,null));};exports[_0x1a64('0x8f')]=function(_0x171499,_0x8e9541){return db['ChatMessage'][_0x1a64('0x42')]({'where':{'id':_0x171499[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x8e9541,null))[_0x1a64('0x13')](function(_0x286b91){if(_0x286b91){return _0x286b91[_0x1a64('0x8f')](_0x171499['body'][_0x1a64('0x90')],_[_0x1a64('0x91')](_0x171499['body'],[_0x1a64('0x90'),'id'])||{});}})[_0x1a64('0x13')](respondWithResult(_0x8e9541,null))[_0x1a64('0x1c')](handleError(_0x8e9541,null));};exports[_0x1a64('0x92')]=function(_0x3ba777,_0x467fb1){var _0xd8bead={'raw':![],'where':{}};var _0x1e5f01={};var _0x590db6={'count':0x0,'rows':[]};return db[_0x1a64('0x30')]['findOne']({'where':{'id':_0x3ba777[_0x1a64('0x3a')]['id']}})['then'](handleEntityNotFound(_0x467fb1,null))[_0x1a64('0x13')](function(_0x47a817){if(_0x47a817){_0x1e5f01['model']=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x1e5f01[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x3ba777[_0x1a64('0x38')]);_0x1e5f01[_0x1a64('0x3d')]=_['intersection'](_0x1e5f01['model'],_0x1e5f01[_0x1a64('0x38')]);_0xd8bead[_0x1a64('0x3f')]=_[_0x1a64('0x3e')](_0x1e5f01[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x3ba777[_0x1a64('0x38')]['fields']));_0xd8bead['attributes']=_0xd8bead[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0xd8bead['attributes']:_0x1e5f01['model'];if(!_0x3ba777[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0xd8bead[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x3ba777['query'][_0x1a64('0x20')]);_0xd8bead['offset']=qs[_0x1a64('0x23')](_0x3ba777['query'][_0x1a64('0x23')]);}_0xd8bead[_0x1a64('0x95')]=qs[_0x1a64('0x96')](_0x3ba777['query'][_0x1a64('0x96')]);_0xd8bead['where']=qs['filters'](_[_0x1a64('0x97')](_0x3ba777[_0x1a64('0x38')],_0x1e5f01[_0x1a64('0x3d')]));_0xd8bead['where'][_0x1a64('0x98')]=_0x47a817['id'];if(_0x3ba777[_0x1a64('0x38')]['filter']){_0xd8bead[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0xd8bead[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0xd8bead[_0x1a64('0x3f')],function(_0x513e72){var _0x577af4={};_0x577af4[_0x513e72]={'$like':'%'+_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x577af4;})});}if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9b')]){var _0x294799=_0x3ba777[_0x1a64('0x38')]['$gte'][_0x1a64('0x9c')](',');var _0x404058={};_0x404058[_0x294799[0x0]]={'$gte':moment(_0x294799[0x1])[_0x1a64('0x74')](_0x1a64('0x9d'))};_0xd8bead[_0x1a64('0x99')]=_['merge'](_0xd8bead[_0x1a64('0x99')],_0x404058);}_0xd8bead=_['merge']({},_0xd8bead,_0x3ba777[_0x1a64('0x9e')]);return db['ChatMessage']['count']({'where':_0xd8bead[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x4724b7){_0x590db6['count']=_0x4724b7;if(_0x3ba777[_0x1a64('0x38')][_0x1a64('0x9f')]){_0xd8bead[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')][_0x1a64('0x36')](_0xd8bead);})[_0x1a64('0x13')](function(_0x31f7f1){_0x590db6[_0x1a64('0xa0')]=_0x31f7f1;return _0x590db6;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x467fb1,_0xd8bead))[_0x1a64('0x1c')](handleError(_0x467fb1,null));};exports[_0x1a64('0xa1')]=function(_0x17f008,_0x5cf9fe){var _0x4266d4={'where':{}},_0x8cdf89={},_0x4c44ba={'count':0x0,'rows':[]};return db[_0x1a64('0x30')][_0x1a64('0x46')]({'where':{'id':_0x17f008['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x5cf9fe,null))['then'](function(_0x2a7d11){if(_0x2a7d11){_0x8cdf89[_0x1a64('0x3b')]=_[_0x1a64('0x3c')](db[_0x1a64('0x59')][_0x1a64('0x31')]);_0x8cdf89[_0x1a64('0x38')]=_[_0x1a64('0x3c')](_0x17f008['query']);_0x8cdf89[_0x1a64('0x3d')]=_[_0x1a64('0x3e')](_0x8cdf89['model'],_0x8cdf89[_0x1a64('0x38')]);_0x4266d4['attributes']=_[_0x1a64('0x3e')](_0x8cdf89[_0x1a64('0x3b')],qs[_0x1a64('0x40')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x40')]));_0x4266d4[_0x1a64('0x3f')]=_0x4266d4[_0x1a64('0x3f')][_0x1a64('0x7b')]?_0x4266d4['attributes']:_0x8cdf89[_0x1a64('0x3b')];if(!_0x17f008[_0x1a64('0x38')][_0x1a64('0x93')](_0x1a64('0x94'))){_0x4266d4[_0x1a64('0x20')]=qs[_0x1a64('0x20')](_0x17f008[_0x1a64('0x38')][_0x1a64('0x20')]);_0x4266d4[_0x1a64('0x23')]=qs[_0x1a64('0x23')](_0x17f008[_0x1a64('0x38')]['offset']);}_0x4266d4[_0x1a64('0x95')]=qs['sort'](_0x17f008['query']['sort']);_0x4266d4[_0x1a64('0x99')]=qs[_0x1a64('0x3d')](_[_0x1a64('0x97')](_0x17f008[_0x1a64('0x38')],_0x8cdf89['filters']));_0x4266d4[_0x1a64('0x99')][_0x1a64('0x98')]=_0x2a7d11['id'];if(_0x17f008[_0x1a64('0x38')]['filter']){_0x4266d4[_0x1a64('0x99')]=_[_0x1a64('0x2a')](_0x4266d4[_0x1a64('0x99')],{'$or':_[_0x1a64('0x2f')](_0x4266d4[_0x1a64('0x3f')],function(_0x33a008){var _0x3040ca={};_0x3040ca[_0x33a008]={'$like':'%'+_0x17f008[_0x1a64('0x38')][_0x1a64('0x9a')]+'%'};return _0x3040ca;})});}_0x4266d4['where'][_0x1a64('0x87')]=![];if(_0x17f008[_0x1a64('0x38')]['id']){_0x4266d4[_0x1a64('0x99')]['id']={'$gt':_0x17f008[_0x1a64('0x38')]['id']};}_0x4266d4=_[_0x1a64('0x2a')]({},_0x4266d4,_0x17f008[_0x1a64('0x9e')]);return db[_0x1a64('0x59')][_0x1a64('0x22')]({'where':_0x4266d4[_0x1a64('0x99')]})[_0x1a64('0x13')](function(_0x283bc5){_0x4c44ba[_0x1a64('0x22')]=_0x283bc5;_0x4266d4[_0x1a64('0x41')]=[];if(_0x17f008[_0x1a64('0x38')]['includeAgent']){_0x4266d4[_0x1a64('0x41')][_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0x77'),'attributes':['id',_0x1a64('0x4d'),_0x1a64('0x83')]});}if(_0x17f008['query'][_0x1a64('0x9f')]){_0x4266d4[_0x1a64('0x41')]=[{'all':!![]}];}return db[_0x1a64('0x59')]['findAll'](_0x4266d4);})['then'](function(_0x3be321){_0x4c44ba[_0x1a64('0xa0')]=_0x3be321;return _0x4c44ba;});}})[_0x1a64('0x13')](respondWithFilteredResult(_0x5cf9fe,_0x4266d4))['catch'](handleError(_0x5cf9fe,null));};exports[_0x1a64('0xa3')]=function(_0x4bf208,_0x54ecd5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x4bf208[_0x1a64('0x3a')]['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x54ecd5,null))['then'](function(_0x17c76d){if(_0x17c76d){return _0x17c76d[_0x1a64('0xa4')](_0x4bf208['body'][_0x1a64('0x90')],_['omit'](_0x4bf208[_0x1a64('0x2b')],[_0x1a64('0x90'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x1a64('0x27'),_0x1a64('0xa5')],'where':{'id':_0x4bf208['body']['ids']}});})[_0x1a64('0x13')](function(_0x3d6e4f){socket[_0x1a64('0xa6')](_0x1a64('0xa7'),{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]});return{'id':Number(_0x4bf208[_0x1a64('0x3a')]['id']),'tags':_0x3d6e4f||[]};});}})['then'](respondWithResult(_0x54ecd5,null))[_0x1a64('0x1c')](handleError(_0x54ecd5,null));};exports[_0x1a64('0xa8')]=function(_0xe59e81,_0x4873b5){return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0xe59e81['params']['id']}})[_0x1a64('0x13')](handleEntityNotFound(_0x4873b5,null))[_0x1a64('0x13')](function(_0x54f1c6){if(_0x54f1c6){return _0x54f1c6['removeTags'](_0xe59e81[_0x1a64('0x38')][_0x1a64('0x90')]);}})[_0x1a64('0x13')](respondWithStatusCode(_0x4873b5,null))[_0x1a64('0x1c')](handleError(_0x4873b5,null));};exports[_0x1a64('0xa9')]=function(_0x3f30fa,_0x38aa49){var _0x5aa2b0=moment()['unix']()[_0x1a64('0xaa')]();var _0x4927cf=path[_0x1a64('0x6f')](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xad'));var _0x5b88fe=path['join'](config[_0x1a64('0x70')],_0x1a64('0xab'),_0x1a64('0xac'),_0x1a64('0xae'));var _0x2fa326=path[_0x1a64('0x6f')](_0x4927cf,_0x5aa2b0);var _0x54de0d=util['format'](_0x1a64('0xaf'),_0x3f30fa[_0x1a64('0x3a')]['id'],_0x5aa2b0);var _0x366745=path[_0x1a64('0x6f')](_0x4927cf,_0x54de0d);var _0x5c1706=[];_0x5c1706['push']({'model':db[_0x1a64('0x77')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5c1706[_0x1a64('0xa2')]({'model':db[_0x1a64('0x5c')],'as':_0x1a64('0x5d'),'attributes':['id',_0x1a64('0xb0'),'lastName'],'raw':!![]});if(_0x3f30fa['query']['attachments']){_0x5c1706[_0x1a64('0xa2')]({'model':db['Attachment'],'as':_0x1a64('0x6a'),'raw':!![]});}var _0x368a01=[{'model':db['ChatMessage'],'as':_0x1a64('0x7a'),'attributes':['id',_0x1a64('0x2b'),_0x1a64('0x85'),_0x1a64('0xb1'),_0x1a64('0x87'),_0x1a64('0xb2')],'include':_0x5c1706}];_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x78')],'as':_0x1a64('0xb3'),'attributes':['id',_0x1a64('0x27')]});_0x368a01[_0x1a64('0xa2')]({'model':db[_0x1a64('0x77')],'as':_0x1a64('0xb4'),'attributes':['id','fullname']});return db[_0x1a64('0x30')][_0x1a64('0x42')]({'where':{'id':_0x3f30fa['params']['id']},'include':_0x368a01})[_0x1a64('0x13')](handleEntityNotFound(_0x38aa49,null))[_0x1a64('0x13')](function(_0x5d4f34){if(_0x5d4f34){var _0x20a865=_0x5d4f34[_0x1a64('0xb5')]({'plain':!![]});fs[_0x1a64('0xb6')](_0x2fa326);var _0xea5e27={'channel':'Chat','account':_0x20a865[_0x1a64('0xb3')][_0x1a64('0x27')],'agent':_0x20a865[_0x1a64('0xb4')]?_0x20a865['Owner'][_0x1a64('0x4d')]:_0x1a64('0xb7'),'createdAt':moment(_0x20a865[_0x1a64('0x85')])[_0x1a64('0x74')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x20a865[_0x1a64('0x63')]?moment(_0x20a865[_0x1a64('0xb8')])[_0x1a64('0x74')](_0x1a64('0x9d'))[_0x1a64('0xaa')]():'','disposition':_0x20a865[_0x1a64('0xb9')],'chatInfo':{'browser':_0x20a865[_0x1a64('0xba')],'os':_0x20a865[_0x1a64('0xbb')],'referer':_0x20a865[_0x1a64('0xbc')],'customerIp':_0x20a865[_0x1a64('0xbd')],'customerPort':_0x20a865[_0x1a64('0xbe')]?_0x20a865[_0x1a64('0xbe')]:_0x1a64('0xb7')},'messages':_(_0x20a865[_0x1a64('0x7a')])['tail']()[_0x1a64('0x9a')]({'secret':![]})[_0x1a64('0x2f')](function(_0x1048d4){if(_0x1048d4[_0x1a64('0x6a')]){var _0x449543=path[_0x1a64('0x6f')](_0x5b88fe,_0x1048d4['Attachment'][_0x1a64('0x67')]);if(fs[_0x1a64('0xbf')](_0x449543)){fs['createReadStream'](_0x449543)[_0x1a64('0xc0')](fs[_0x1a64('0xc1')](path[_0x1a64('0x6f')](_0x2fa326,_0x1048d4['Attachment'][_0x1a64('0x67')])));}}return{'date':moment(_0x1048d4[_0x1a64('0x85')])['format'](_0x1a64('0x9d'))[_0x1a64('0xaa')](),'sender':_0x1048d4['direction']===_0x1a64('0xc2')?_0x1048d4[_0x1a64('0x77')]?_0x1048d4[_0x1a64('0x77')][_0x1a64('0x4d')]:_0x1a64('0x82'):_0x1048d4[_0x1a64('0x5d')]['firstName']+(_0x1048d4['Contact'][_0x1a64('0xc3')]?'\x20'+_0x1048d4[_0x1a64('0x5d')][_0x1a64('0xc3')]:''),'body':_0x1048d4[_0x1a64('0x6a')]?_0x1048d4['Attachment'][_0x1a64('0x67')]:_0x1048d4[_0x1a64('0x2b')],'direction':_0x1048d4['direction']===_0x1a64('0xc2')?'A':'C','secret':_0x1048d4['secret'],'read':_0x1048d4['read'],'attachment':_0x1048d4[_0x1a64('0x6a')]};})[_0x1a64('0xc4')]()};return ejs[_0x1a64('0xc5')](path[_0x1a64('0x6f')](config[_0x1a64('0x70')],'server',_0x1a64('0xc6'),_0x1a64('0xc7')),{'interaction':_0xea5e27})['then'](function(_0x1c6318){var _0x52f59e=path[_0x1a64('0x6f')](_0x2fa326,'transcript-'+_0x20a865['id']+'-'+_0x5aa2b0+_0x1a64('0xc8'));var _0x52a754={'path':_0x52f59e,'channel':_0x1a64('0xc9'),'interactionId':_0x20a865['id']};return pdf[_0x1a64('0xca')](_0x1c6318,_0x52a754);})['then'](function(){return new Promise(function(_0x19ee42,_0x456154){zipdir(_0x2fa326,{'saveTo':_0x366745},function(_0x481f6c,_0x5b5923){if(_0x481f6c)return _0x456154(_0x481f6c);return _0x19ee42(_0x5b5923);});})[_0x1a64('0x13')](function(){return new BPromise(function(_0x4f3340,_0x122bc8){rimraf(_0x2fa326,function(_0x803957){if(_0x803957)_0x122bc8(_0x803957);return _0x4f3340();});});})[_0x1a64('0x13')](function(){return _0x38aa49[_0x1a64('0xa9')](_0x366745,_0x54de0d,function(_0x2b6aff){if(_0x2b6aff){logger[_0x1a64('0x18')]('err',_0x2b6aff);}else{fs[_0x1a64('0xcb')](_0x366745);}});});});}else{return _0x38aa49[_0x1a64('0x1d')](0xc8);}})[_0x1a64('0x1c')](handleError(_0x38aa49,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index c730afb..39a0bdd 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 _0xec1a=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','Users','map'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xec1a,0xdb));var _0xaec1=function(_0x59e9d8,_0x5e9850){_0x59e9d8=_0x59e9d8-0x0;var _0x33ebc9=_0xec1a[_0x59e9d8];return _0x33ebc9;};'use strict';var EventEmitter=require(_0xaec1('0x0'));var ChatInteraction=require(_0xaec1('0x1'))['db'][_0xaec1('0x2')];var ChatMessage=require(_0xaec1('0x1'))['db'][_0xaec1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec1('0x4')](0x0);var events={'afterCreate':_0xaec1('0x5'),'afterUpdate':_0xaec1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1e785d){return function(_0x4d2b66,_0x3a3648,_0x2948fd){_0x4d2b66['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ea22b){_0x4d2b66['setDataValue'](_0xaec1('0x7'),_0x1ea22b[_0xaec1('0x8')](function(_0x282834){return{'id':_0x282834['id']};}));return ChatMessage[_0xaec1('0x9')]({'where':{'ChatInteractionId':_0x4d2b66['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec1('0xa')](function(_0x3af653){_0x4d2b66[_0xaec1('0xb')](_0xaec1('0xc'),_0x3af653[_0xaec1('0xd')]);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d+':'+_0x4d2b66['id'],_0x4d2b66);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d,_0x4d2b66);_0x2948fd(null);})[_0xaec1('0xf')](_0x2948fd(null));};}for(var e in events){if(events[_0xaec1('0x10')](e)){var event=events[e];ChatInteraction[_0xaec1('0x11')](e,emitEvent(event));}}module[_0xaec1('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x155b=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x155b,0x16a));var _0xb155=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x155b[_0x3817a9];return _0x443f30;};'use strict';var EventEmitter=require(_0xb155('0x0'));var ChatInteraction=require(_0xb155('0x1'))['db'][_0xb155('0x2')];var ChatMessage=require(_0xb155('0x1'))['db'][_0xb155('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb155('0x4')](0x0);var events={'afterCreate':_0xb155('0x5'),'afterUpdate':_0xb155('0x6'),'afterDestroy':_0xb155('0x7')};function emitEvent(_0x1a9f1f){return function(_0x495da9,_0x46b008,_0x8bc4c){_0x495da9[_0xb155('0x8')]({'attributes':['id'],'raw':!![]})[_0xb155('0x9')](function(_0x112068){_0x495da9['setDataValue'](_0xb155('0xa'),_0x112068[_0xb155('0xb')](function(_0x3e17ad){return{'id':_0x3e17ad['id']};}));return ChatMessage[_0xb155('0xc')]({'where':{'ChatInteractionId':_0x495da9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb155('0x9')](function(_0xe9fe15){_0x495da9[_0xb155('0xd')](_0xb155('0xe'),_0xe9fe15[_0xb155('0xf')]);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f+':'+_0x495da9['id'],_0x495da9);ChatInteractionEvents[_0xb155('0x10')](_0x1a9f1f,_0x495da9);_0x8bc4c(null);})[_0xb155('0x11')](_0x8bc4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb155('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 548e867..aa006ac 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 _0xa11b=['request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xa11b,0xbf));var _0xba11=function(_0x391ff0,_0x46db5d){_0x391ff0=_0x391ff0-0x0;var _0x33fd7b=_0xa11b[_0x391ff0];return _0x33fd7b;};'use strict';var _=require('lodash');var util=require(_0xba11('0x0'));var logger=require(_0xba11('0x1'))(_0xba11('0x2'));var moment=require(_0xba11('0x3'));var BPromise=require('bluebird');var rp=require(_0xba11('0x4'));var fs=require('fs');var path=require(_0xba11('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba11('0x6'));module[_0xba11('0x7')]=function(_0x2619e7,_0x616bcb){return _0x2619e7[_0xba11('0x8')](_0xba11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db92e,_0x106568,_0x14db16){if(_0x2db92e[_0xba11('0xa')](_0xba11('0xb'))){_0x2db92e['closedAt']=moment()[_0xba11('0xc')](_0xba11('0xd'));}_0x14db16(null,_0x2db92e);}},'charset':'utf8mb4','collate':_0xba11('0xe')});};
\ No newline at end of file
+var _0x1396=['changed','closed','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0xda8f6f,_0x11c149){var _0x1b3e68=function(_0x168b8d){while(--_0x168b8d){_0xda8f6f['push'](_0xda8f6f['shift']());}};_0x1b3e68(++_0x11c149);}(_0x1396,0x122));var _0x6139=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1396[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6139('0x0'))(_0x6139('0x1'));var moment=require('moment');var BPromise=require(_0x6139('0x2'));var rp=require(_0x6139('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6139('0x4'));var config=require(_0x6139('0x5'));var attributes=require(_0x6139('0x6'));module[_0x6139('0x7')]=function(_0x152d10,_0x591dc2){return _0x152d10[_0x6139('0x8')](_0x6139('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x564e83,_0x1041b5,_0x1a2d2e){if(_0x564e83[_0x6139('0xa')](_0x6139('0xb'))){_0x564e83['closedAt']=moment()[_0x6139('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1a2d2e(null,_0x564e83);}},'charset':_0x6139('0xd'),'collate':_0x6139('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index fc052f3..337601d 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 _0x0814=['where','attributes','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x17a23d,_0x4b6c0c){var _0x531cec=function(_0x2c10f4){while(--_0x2c10f4){_0x17a23d['push'](_0x17a23d['shift']());}};_0x531cec(++_0x4b6c0c);}(_0x0814,0x15d));var _0x4081=function(_0x41289e,_0x13bef1){_0x41289e=_0x41289e-0x0;var _0x89a172=_0x0814[_0x41289e];return _0x89a172;};'use strict';var _=require(_0x4081('0x0'));var util=require('util');var moment=require(_0x4081('0x1'));var BPromise=require('bluebird');var rs=require(_0x4081('0x2'));var fs=require('fs');var Redis=require(_0x4081('0x3'));var db=require(_0x4081('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4081('0x5'));var config=require(_0x4081('0x6'));var jayson=require(_0x4081('0x7'));var client=jayson[_0x4081('0x8')][_0x4081('0x9')]({'port':0x232a});config[_0x4081('0xa')]=_['defaults'](config[_0x4081('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4081('0xb'))(new Redis(config[_0x4081('0xa')]));require(_0x4081('0xc'))[_0x4081('0xd')](socket);function respondWithRpcPromise(_0x8584e8,_0x286a05,_0x1340c2){return new BPromise(function(_0x27023d,_0x2ea04a){return client['request'](_0x8584e8,_0x1340c2)[_0x4081('0xe')](function(_0x121ff6){logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');logger[_0x4081('0x11')](_0x4081('0x12'),_0x286a05,_0x4081('0x13'),JSON[_0x4081('0x14')](_0x121ff6));if(_0x121ff6['error']){if(_0x121ff6['error']['code']===0x1f4){logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6['error'][_0x4081('0x16')]);return _0x2ea04a(_0x121ff6[_0x4081('0x15')]['message']);}logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6[_0x4081('0x15')][_0x4081('0x16')]);return _0x27023d(_0x121ff6[_0x4081('0x15')]['message']);}else{logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');_0x27023d(_0x121ff6[_0x4081('0x17')]['message']);}})[_0x4081('0x18')](function(_0x17541f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x286a05,_0x17541f);_0x2ea04a(_0x17541f);});});}exports[_0x4081('0x19')]=function(_0x34cfcc){var _0x2f64e7=this;return new Promise(function(_0x3f145e,_0x5f18c4){return db[_0x4081('0x1a')][_0x4081('0x1b')](_0x34cfcc[_0x4081('0x1c')],{'raw':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc['options'][_0x4081('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x1f')]||null:null,'attributes':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x20')]||null:null,'limit':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')]['limit']||null:null})[_0x4081('0xe')](function(_0x45e92d){logger[_0x4081('0xf')](_0x4081('0x19'),_0x34cfcc);logger[_0x4081('0x11')](_0x4081('0x19'),_0x34cfcc,JSON[_0x4081('0x14')](_0x45e92d));_0x3f145e(_0x45e92d);})[_0x4081('0x18')](function(_0x44d6de){logger['error'](_0x4081('0x19'),_0x44d6de[_0x4081('0x16')],_0x34cfcc);_0x5f18c4(_0x2f64e7[_0x4081('0x15')](0x1f4,_0x44d6de['message']));});});};exports[_0x4081('0x21')]=function(_0x194105){return new Promise(function(_0x15ee6c,_0xa90a85){return db[_0x4081('0x1a')][_0x4081('0x22')]({'where':_0x194105[_0x4081('0x1d')]?_0x194105[_0x4081('0x1d')]['where']||null:null})['then'](function(_0x3b8ca4){if(_0x3b8ca4){return _0x3b8ca4[_0x4081('0x23')](_0x194105[_0x4081('0x1c')][_0x4081('0x24')],_['omit'](_0x194105['body'],[_0x4081('0x24'),'id'])||{});}})['spread'](function(_0xec2384){logger[_0x4081('0xf')](_0x4081('0x25'),_0x194105);logger['debug']('AddTags',_0x194105,JSON[_0x4081('0x14')](_0xec2384));_0x15ee6c(_0xec2384);})[_0x4081('0x18')](function(_0x38e89c){logger[_0x4081('0x15')](_0x4081('0x25'),_0x38e89c[_0x4081('0x16')],_0x194105);_0xa90a85(_this[_0x4081('0x15')](0x1f4,_0x38e89c[_0x4081('0x16')]));});});};
\ No newline at end of file
+var _0x067d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','then','catch','AddTagsToChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis'];(function(_0x868d30,_0x121202){var _0xe498ab=function(_0x55f7b6){while(--_0x55f7b6){_0x868d30['push'](_0x868d30['shift']());}};_0xe498ab(++_0x121202);}(_0x067d,0xcd));var _0xd067=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0x067d[_0x1b2667];return _0x179ae8;};'use strict';var _=require(_0xd067('0x0'));var util=require(_0xd067('0x1'));var moment=require(_0xd067('0x2'));var BPromise=require('bluebird');var rs=require(_0xd067('0x3'));var fs=require('fs');var Redis=require(_0xd067('0x4'));var db=require(_0xd067('0x5'))['db'];var utils=require(_0xd067('0x6'));var logger=require(_0xd067('0x7'))(_0xd067('0x8'));var config=require(_0xd067('0x9'));var jayson=require(_0xd067('0xa'));var client=jayson[_0xd067('0xb')][_0xd067('0xc')]({'port':0x232a});config[_0xd067('0xd')]=_['defaults'](config[_0xd067('0xd')],{'host':_0xd067('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd067('0xd')]));require(_0xd067('0xf'))[_0xd067('0x10')](socket);function respondWithRpcPromise(_0xdcbfce,_0x214593,_0x566763){return new BPromise(function(_0x5cfe3d,_0x561c78){return client[_0xd067('0x11')](_0xdcbfce,_0x566763)['then'](function(_0x5b4bc6){logger[_0xd067('0x12')](_0xd067('0x13'),_0x214593,'request\x20sent');logger[_0xd067('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x214593,'request\x20sent',JSON[_0xd067('0x15')](_0x5b4bc6));if(_0x5b4bc6[_0xd067('0x16')]){if(_0x5b4bc6['error'][_0xd067('0x17')]===0x1f4){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);return _0x561c78(_0x5b4bc6['error'][_0xd067('0x18')]);}logger[_0xd067('0x16')](_0xd067('0x13'),_0x214593,_0x5b4bc6[_0xd067('0x16')]['message']);return _0x5cfe3d(_0x5b4bc6[_0xd067('0x16')][_0xd067('0x18')]);}else{logger['info'](_0xd067('0x13'),_0x214593,_0xd067('0x19'));_0x5cfe3d(_0x5b4bc6[_0xd067('0x1a')]['message']);}})['catch'](function(_0x33fe23){logger[_0xd067('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x214593,_0x33fe23);_0x561c78(_0x33fe23);});});}exports[_0xd067('0x1b')]=function(_0x96fa05){var _0x524132=this;return new Promise(function(_0x256d9e,_0xfd0b13){return db[_0xd067('0x1c')]['update'](_0x96fa05['body'],{'raw':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x1f')]||null:null,'attributes':_0x96fa05[_0xd067('0x1d')]?_0x96fa05['options'][_0xd067('0x20')]||null:null,'limit':_0x96fa05['options']?_0x96fa05[_0xd067('0x1d')][_0xd067('0x21')]||null:null})[_0xd067('0x22')](function(_0x29bc3b){logger[_0xd067('0x12')]('UpdateChatInteraction',_0x96fa05);logger[_0xd067('0x14')](_0xd067('0x1b'),_0x96fa05,JSON[_0xd067('0x15')](_0x29bc3b));_0x256d9e(_0x29bc3b);})[_0xd067('0x23')](function(_0x34de72){logger[_0xd067('0x16')](_0xd067('0x1b'),_0x34de72[_0xd067('0x18')],_0x96fa05);_0xfd0b13(_0x524132[_0xd067('0x16')](0x1f4,_0x34de72[_0xd067('0x18')]));});});};exports[_0xd067('0x24')]=function(_0x30474f){return new Promise(function(_0x50e112,_0x486ee8){return db[_0xd067('0x1c')]['find']({'where':_0x30474f[_0xd067('0x1d')]?_0x30474f[_0xd067('0x1d')]['where']||null:null})[_0xd067('0x22')](function(_0x2200c7){if(_0x2200c7){return _0x2200c7[_0xd067('0x25')](_0x30474f[_0xd067('0x26')][_0xd067('0x27')],_['omit'](_0x30474f['body'],[_0xd067('0x27'),'id'])||{});}})[_0xd067('0x28')](function(_0x2172ff){logger[_0xd067('0x12')](_0xd067('0x29'),_0x30474f);logger['debug']('AddTags',_0x30474f,JSON['stringify'](_0x2172ff));_0x50e112(_0x2172ff);})[_0xd067('0x23')](function(_0x2e8d0a){logger[_0xd067('0x16')](_0xd067('0x29'),_0x2e8d0a['message'],_0x30474f);_0x486ee8(_this[_0xd067('0x16')](0x1f4,_0x2e8d0a[_0xd067('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 9468218..20f2575 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 _0xab4b=['length','chatInteraction:','save','emit','removeListener'];(function(_0x39c931,_0xce322a){var _0x4d1dbb=function(_0x31db4e){while(--_0x31db4e){_0x39c931['push'](_0x39c931['shift']());}};_0x4d1dbb(++_0xce322a);}(_0xab4b,0x156));var _0xbab4=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xab4b[_0x257841];return _0x1b87ed;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xbab4('0x0'),'remove','update'];function createListener(_0x28fe4e,_0x479e3b){return function(_0x4eac02){_0x479e3b[_0xbab4('0x1')](_0x28fe4e,_0x4eac02);};}function removeListener(_0x174b76,_0x25f747){return function(){ChatInteractionEvents[_0xbab4('0x2')](_0x174b76,_0x25f747);};}exports['register']=function(_0x365090){for(var _0x6f1a52=0x0,_0x4f1afa=events[_0xbab4('0x3')];_0x6f1a52<_0x4f1afa;_0x6f1a52++){var _0x9851c8=events[_0x6f1a52];var _0x55cdd2=createListener(_0xbab4('0x4')+_0x9851c8,_0x365090);ChatInteractionEvents['on'](_0x9851c8,_0x55cdd2);}};
\ No newline at end of file
+var _0x15d6=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x366d42,_0x338fb4){var _0x1a47f7=function(_0x404f01){while(--_0x404f01){_0x366d42['push'](_0x366d42['shift']());}};_0x1a47f7(++_0x338fb4);}(_0x15d6,0xb3));var _0x615d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15d6[_0xa464c9];return _0x3d73c4;};'use strict';var ChatInteractionEvents=require(_0x615d('0x0'));var events=[_0x615d('0x1'),_0x615d('0x2'),_0x615d('0x3')];function createListener(_0x46ca8b,_0x423267){return function(_0x688729){_0x423267[_0x615d('0x4')](_0x46ca8b,_0x688729);};}function removeListener(_0x2c6415,_0x5d4beb){return function(){ChatInteractionEvents[_0x615d('0x5')](_0x2c6415,_0x5d4beb);};}exports[_0x615d('0x6')]=function(_0x5296d4){for(var _0x58fdaa=0x0,_0x162493=events[_0x615d('0x7')];_0x58fdaa<_0x162493;_0x58fdaa++){var _0x42ee0f=events[_0x58fdaa];var _0x1cb449=createListener(_0x615d('0x8')+_0x42ee0f,_0x5296d4);ChatInteractionEvents['on'](_0x42ee0f,_0x1cb449);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c5a390e..2b96b2b 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 _0x7aae=['create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7aae,0x1b6));var _0xe7aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe7aa('0x0'));var path=require(_0xe7aa('0x1'));var timeout=require(_0xe7aa('0x2'));var express=require('express');var router=express[_0xe7aa('0x3')]();var fs_extra=require(_0xe7aa('0x4'));var auth=require(_0xe7aa('0x5'));var interaction=require(_0xe7aa('0x6'));var config=require(_0xe7aa('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xe7aa('0x8')](),controller['index']);router['get']('/describe',auth[_0xe7aa('0x8')](),controller[_0xe7aa('0x9')]);router[_0xe7aa('0xa')](_0xe7aa('0xb'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xd')]);router['get'](_0xe7aa('0xe'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xf')]);router[_0xe7aa('0xa')](_0xe7aa('0x10'),auth['isAuthenticated'](),controller[_0xe7aa('0x11')]);router['get'](_0xe7aa('0x12'),auth[_0xe7aa('0xc')](),controller['getMyMessages']);router[_0xe7aa('0xa')](_0xe7aa('0x13'),auth['isAuthenticated'](),controller['download']);router[_0xe7aa('0x14')]('/',auth['isAuthenticated'](),controller[_0xe7aa('0x15')]);router[_0xe7aa('0x14')](_0xe7aa('0x16'),auth['isAuthenticated'](),controller[_0xe7aa('0x17')]);var upload=multer({'storage':multer[_0xe7aa('0x18')]({'destination':function(_0x570e00,_0x2da2e4,_0x581d9e){_0x581d9e(null,path[_0xe7aa('0x19')](config[_0xe7aa('0x1a')],_0xe7aa('0x1b')));},'filename':function(_0x48a31b,_0x1a1579,_0x195e17){_0x195e17(null,util[_0xe7aa('0x1c')](_0xe7aa('0x1d'),Date[_0xe7aa('0x1e')](),_0x1a1579[_0xe7aa('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7aa('0x14')]('/:id/attachment_upload',upload[_0xe7aa('0x20')](_0xe7aa('0x21')),controller[_0xe7aa('0x22')]);router['post'](_0xe7aa('0x10'),auth[_0xe7aa('0xc')](),controller['addMessage']);router[_0xe7aa('0x14')](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),interaction[_0xe7aa('0x24')](_0xe7aa('0x25'),_0xe7aa('0x26')),controller[_0xe7aa('0x27')]);router[_0xe7aa('0x28')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x29')),controller['update']);router[_0xe7aa('0x28')](_0xe7aa('0x2a'),controller[_0xe7aa('0x2b')]);router[_0xe7aa('0x28')](_0xe7aa('0x2c'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0x2d')]);router[_0xe7aa('0x28')]('/:id/close',controller[_0xe7aa('0x2e')]);router[_0xe7aa('0x2f')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x30')),controller[_0xe7aa('0x31')]);router['delete'](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),controller['removeTags']);module[_0xe7aa('0x32')]=router;
\ No newline at end of file
+var _0x9b6d=['describe','/:id','show','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x483461,_0x3a7690){var _0x1c851f=function(_0x3683ca){while(--_0x3683ca){_0x483461['push'](_0x483461['shift']());}};_0x1c851f(++_0x3a7690);}(_0x9b6d,0x1d5));var _0xd9b6=function(_0x15b6bc,_0x47b90f){_0x15b6bc=_0x15b6bc-0x0;var _0x50fb17=_0x9b6d[_0x15b6bc];return _0x50fb17;};'use strict';var multer=require('multer');var util=require(_0xd9b6('0x0'));var path=require('path');var timeout=require(_0xd9b6('0x1'));var express=require(_0xd9b6('0x2'));var router=express[_0xd9b6('0x3')]();var fs_extra=require(_0xd9b6('0x4'));var auth=require(_0xd9b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd9b6('0x6'));var controller=require('./chatInteraction.controller');router[_0xd9b6('0x7')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x9')]);router[_0xd9b6('0x7')](_0xd9b6('0xa'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0xb')]);router[_0xd9b6('0x7')](_0xd9b6('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0xd')]);router[_0xd9b6('0x7')]('/:id/attachment_download',auth[_0xd9b6('0xe')](),controller['attachmentDownload']);router[_0xd9b6('0x7')](_0xd9b6('0xf'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x10')]);router[_0xd9b6('0x7')](_0xd9b6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x12')]);router['get'](_0xd9b6('0x13'),auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x14')]);router[_0xd9b6('0x15')]('/',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x16')]);router[_0xd9b6('0x15')](_0xd9b6('0x17'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd9b6('0x18')]({'destination':function(_0xa05025,_0x590f10,_0x3030a9){_0x3030a9(null,path['join'](config[_0xd9b6('0x19')],'server/files/attachments/'));},'filename':function(_0x83eaad,_0xc863be,_0xcf1ef5){_0xcf1ef5(null,util['format'](_0xd9b6('0x1a'),Date[_0xd9b6('0x1b')](),_0xc863be['originalname'][_0xd9b6('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd9b6('0x15')](_0xd9b6('0x1d'),upload[_0xd9b6('0x1e')](_0xd9b6('0x1f')),controller[_0xd9b6('0x20')]);router['post'](_0xd9b6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xd9b6('0x21')]);router[_0xd9b6('0x15')]('/:id/tags',auth[_0xd9b6('0x8')](),interaction['tracked'](_0xd9b6('0x22'),'chatinteraction:addtags'),controller[_0xd9b6('0x23')]);router[_0xd9b6('0x24')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd9b6('0x22'),_0xd9b6('0x25')),controller[_0xd9b6('0x26')]);router[_0xd9b6('0x24')]('/:id/custom_update',controller[_0xd9b6('0x27')]);router[_0xd9b6('0x24')](_0xd9b6('0x28'),auth[_0xd9b6('0xe')](),controller['abandon']);router[_0xd9b6('0x24')](_0xd9b6('0x29'),controller[_0xd9b6('0x2a')]);router[_0xd9b6('0x2b')](_0xd9b6('0xc'),auth[_0xd9b6('0x8')](),interaction['tracked']('chat',_0xd9b6('0x2c')),controller[_0xd9b6('0x2d')]);router[_0xd9b6('0x2b')]('/:id/tags',auth[_0xd9b6('0x8')](),controller[_0xd9b6('0x2e')]);module[_0xd9b6('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cc7cfec..d0c99fa 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 _0x4058=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x4283e9,_0x55c057){var _0x4e4c67=function(_0x3c700c){while(--_0x3c700c){_0x4283e9['push'](_0x4283e9['shift']());}};_0x4e4c67(++_0x55c057);}(_0x4058,0x1be));var _0x8405=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0x4058[_0x25c72c];return _0x57e28b;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'body':{'type':Sequelize[_0x8405('0x2')](_0x8405('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8405('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8405('0x5')]}};
\ No newline at end of file
+var _0xf492=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xf492,0x102));var _0x2f49=function(_0x1f1578,_0x33d122){_0x1f1578=_0x1f1578-0x0;var _0x2603f6=_0xf492[_0x1f1578];return _0x2603f6;};'use strict';var Sequelize=require(_0x2f49('0x0'));module['exports']={'body':{'type':Sequelize[_0x2f49('0x1')](_0x2f49('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2f49('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2f49('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c4db13c..3d358e8 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 _0x88b6=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','ChatInternalMessage','includeAll','find','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','length','resourceId','push','createdAt','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x25ab29,_0x364fec){var _0x146cdf=function(_0x5a809d){while(--_0x5a809d){_0x25ab29['push'](_0x25ab29['shift']());}};_0x146cdf(++_0x364fec);}(_0x88b6,0x112));var _0x688b=function(_0x393bf6,_0x45b827){_0x393bf6=_0x393bf6-0x0;var _0x437338=_0x88b6[_0x393bf6];return _0x437338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x688b('0x0'));var zipdir=require(_0x688b('0x1'));var jsonpatch=require(_0x688b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x688b('0x3'));var util=require(_0x688b('0x4'));var path=require(_0x688b('0x5'));var sox=require(_0x688b('0x6'));var csv=require(_0x688b('0x7'));var ejs=require(_0x688b('0x8'));var fs=require('fs');var fs_extra=require(_0x688b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x688b('0xa'));var jsforce=require(_0x688b('0xb'));var deskjs=require(_0x688b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x688b('0xd'));var Papa=require(_0x688b('0xe'));var Redis=require('ioredis');var authService=require(_0x688b('0xf'));var qs=require(_0x688b('0x10'));var as=require(_0x688b('0x11'));var hardwareService=require(_0x688b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x688b('0x13'));var licenseUtil=require(_0x688b('0x14'));var db=require(_0x688b('0x15'))['db'];config[_0x688b('0x16')]=_[_0x688b('0x17')](config[_0x688b('0x16')],{'host':_0x688b('0x18'),'port':0x18eb});var socket=require(_0x688b('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x688b('0x1a')](socket);function respondWithStatusCode(_0x5bbc69,_0x2209c9){_0x2209c9=_0x2209c9||0xcc;return function(_0x212a13){if(_0x212a13){return _0x5bbc69[_0x688b('0x1b')](_0x2209c9);}return _0x5bbc69[_0x688b('0x1c')](_0x2209c9)[_0x688b('0x1d')]();};}function respondWithResult(_0x261823,_0x6b16c0){_0x6b16c0=_0x6b16c0||0xc8;return function(_0x1230af){if(_0x1230af){return _0x261823['status'](_0x6b16c0)[_0x688b('0x1e')](_0x1230af);}};}function respondWithFilteredResult(_0x602f7c,_0x2ca610){return function(_0x9157a){if(_0x9157a){var _0x44ca75=typeof _0x2ca610[_0x688b('0x1f')]===_0x688b('0x20')&&typeof _0x2ca610[_0x688b('0x21')]===_0x688b('0x20');var _0x26d69b=_0x9157a[_0x688b('0x22')];var _0x41fe4c=_0x44ca75?0x0:_0x2ca610[_0x688b('0x1f')];var _0x2bad4d=_0x44ca75?_0x9157a[_0x688b('0x22')]:_0x2ca610['offset']+_0x2ca610['limit'];var _0x54558e;if(_0x2bad4d>=_0x26d69b){_0x2bad4d=_0x26d69b;_0x54558e=0xc8;}else{_0x54558e=0xce;}_0x602f7c[_0x688b('0x1c')](_0x54558e);return _0x602f7c[_0x688b('0x23')](_0x688b('0x24'),_0x41fe4c+'-'+_0x2bad4d+'/'+_0x26d69b)[_0x688b('0x1e')](_0x9157a);}return null;};}function patchUpdates(_0x4ef372){return function(_0xe9f43d){try{jsonpatch[_0x688b('0x25')](_0xe9f43d,_0x4ef372,!![]);}catch(_0x270b0e){return BPromise['reject'](_0x270b0e);}return _0xe9f43d['save']();};}function saveUpdates(_0x434106,_0xa934ed){return function(_0x1827ab){if(_0x1827ab){return _0x1827ab[_0x688b('0x26')](_0x434106)[_0x688b('0x27')](function(_0x1310d6){return _0x1310d6;});}return null;};}function removeEntity(_0xa39004,_0x4b7464){return function(_0x3009b8){if(_0x3009b8){return _0x3009b8[_0x688b('0x28')]()[_0x688b('0x27')](function(){_0xa39004[_0x688b('0x1c')](0xcc)[_0x688b('0x1d')]();});}};}function handleEntityNotFound(_0x318c99,_0x4e90b8){return function(_0x327f57){if(!_0x327f57){_0x318c99[_0x688b('0x1b')](0x194);}return _0x327f57;};}function handleError(_0x594ab5,_0x306e19){_0x306e19=_0x306e19||0x1f4;return function(_0x506fe7){logger['error'](_0x506fe7[_0x688b('0x29')]);if(_0x506fe7[_0x688b('0x2a')]){delete _0x506fe7['name'];}_0x594ab5[_0x688b('0x1c')](_0x306e19)['send'](_0x506fe7);};}exports[_0x688b('0x2b')]=function(_0x1cd0a6,_0x5c4211){var _0x4d35c7={},_0x2687ab={},_0x4e3b44={'count':0x0,'rows':[]};var _0x3c1228=_[_0x688b('0x2c')](db['ChatInternalMessage'][_0x688b('0x2d')],function(_0x15e82a){return{'name':_0x15e82a['fieldName'],'type':_0x15e82a[_0x688b('0x2e')]['key']};});_0x2687ab[_0x688b('0x2f')]=_['map'](_0x3c1228,_0x688b('0x2a'));_0x2687ab[_0x688b('0x30')]=_['keys'](_0x1cd0a6[_0x688b('0x30')]);_0x2687ab[_0x688b('0x31')]=_[_0x688b('0x32')](_0x2687ab[_0x688b('0x2f')],_0x2687ab[_0x688b('0x30')]);_0x4d35c7[_0x688b('0x33')]=_[_0x688b('0x32')](_0x2687ab['model'],qs[_0x688b('0x34')](_0x1cd0a6[_0x688b('0x30')]['fields']));_0x4d35c7[_0x688b('0x33')]=_0x4d35c7['attributes']['length']?_0x4d35c7[_0x688b('0x33')]:_0x2687ab[_0x688b('0x2f')];if(!_0x1cd0a6[_0x688b('0x30')][_0x688b('0x35')]('nolimit')){_0x4d35c7[_0x688b('0x21')]=qs[_0x688b('0x21')](_0x1cd0a6[_0x688b('0x30')][_0x688b('0x21')]);_0x4d35c7[_0x688b('0x1f')]=qs[_0x688b('0x1f')](_0x1cd0a6[_0x688b('0x30')]['offset']);}_0x4d35c7['order']=qs['sort'](_0x1cd0a6['query'][_0x688b('0x36')]);_0x4d35c7[_0x688b('0x37')]=qs['filters'](_[_0x688b('0x38')](_0x1cd0a6[_0x688b('0x30')],_0x2687ab[_0x688b('0x31')]),_0x3c1228);if(_0x1cd0a6['query'][_0x688b('0x39')]){_0x4d35c7[_0x688b('0x37')]=_[_0x688b('0x3a')](_0x4d35c7['where'],{'$or':_[_0x688b('0x2c')](_0x3c1228,function(_0x47e653){if(_0x47e653[_0x688b('0x2e')]!==_0x688b('0x3b')){var _0x2c1ee4={};_0x2c1ee4[_0x47e653[_0x688b('0x2a')]]={'$like':'%'+_0x1cd0a6['query'][_0x688b('0x39')]+'%'};return _0x2c1ee4;}})});}_0x4d35c7=_['merge']({},_0x4d35c7,_0x1cd0a6[_0x688b('0x3c')]);var _0x28aa1e={'where':_0x4d35c7[_0x688b('0x37')]};return db['ChatInternalMessage']['count'](_0x28aa1e)[_0x688b('0x27')](function(_0x1fd051){_0x4e3b44[_0x688b('0x22')]=_0x1fd051;if(_0x1cd0a6['query']['includeAll']){_0x4d35c7[_0x688b('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x688b('0x3e')](_0x4d35c7);})[_0x688b('0x27')](function(_0x105635){_0x4e3b44[_0x688b('0x3f')]=_0x105635;return _0x4e3b44;})[_0x688b('0x27')](respondWithFilteredResult(_0x5c4211,_0x4d35c7))[_0x688b('0x40')](handleError(_0x5c4211,null));};exports[_0x688b('0x41')]=function(_0x23cc30,_0x54ff7e){var _0x4bd99f={'raw':!![],'where':{'id':_0x23cc30[_0x688b('0x42')]['id']}},_0x3350be={};_0x3350be[_0x688b('0x2f')]=_[_0x688b('0x43')](db[_0x688b('0x44')]['rawAttributes']);_0x3350be[_0x688b('0x30')]=_['keys'](_0x23cc30[_0x688b('0x30')]);_0x3350be[_0x688b('0x31')]=_['intersection'](_0x3350be[_0x688b('0x2f')],_0x3350be[_0x688b('0x30')]);_0x4bd99f[_0x688b('0x33')]=_[_0x688b('0x32')](_0x3350be[_0x688b('0x2f')],qs[_0x688b('0x34')](_0x23cc30[_0x688b('0x30')][_0x688b('0x34')]));_0x4bd99f[_0x688b('0x33')]=_0x4bd99f[_0x688b('0x33')]['length']?_0x4bd99f[_0x688b('0x33')]:_0x3350be[_0x688b('0x2f')];if(_0x23cc30['query'][_0x688b('0x45')]){_0x4bd99f[_0x688b('0x3d')]=[{'all':!![]}];}_0x4bd99f=_[_0x688b('0x3a')]({},_0x4bd99f,_0x23cc30[_0x688b('0x3c')]);return db[_0x688b('0x44')][_0x688b('0x46')](_0x4bd99f)[_0x688b('0x27')](handleEntityNotFound(_0x54ff7e,null))[_0x688b('0x27')](respondWithResult(_0x54ff7e,null))[_0x688b('0x40')](handleError(_0x54ff7e,null));};exports[_0x688b('0x47')]=function(_0x14f953,_0x217a55){return db['ChatInternalMessage']['create'](_0x14f953[_0x688b('0x48')],{})[_0x688b('0x27')](respondWithResult(_0x217a55,0xc9))[_0x688b('0x40')](handleError(_0x217a55,null));};exports['update']=function(_0x3c717a,_0x1d9c55){if(_0x3c717a[_0x688b('0x48')]['id']){delete _0x3c717a['body']['id'];}return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x3c717a[_0x688b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9c55,null))['then'](saveUpdates(_0x3c717a[_0x688b('0x48')],null))[_0x688b('0x27')](respondWithResult(_0x1d9c55,null))['catch'](handleError(_0x1d9c55,null));};exports[_0x688b('0x28')]=function(_0x4b6b68,_0x3d9c3e){return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x4b6b68[_0x688b('0x42')]['id']}})[_0x688b('0x27')](handleEntityNotFound(_0x3d9c3e,null))[_0x688b('0x27')](removeEntity(_0x3d9c3e,null))[_0x688b('0x40')](handleError(_0x3d9c3e,null));};exports[_0x688b('0x49')]=function(_0x1a6902,_0x213200){return db[_0x688b('0x44')][_0x688b('0x49')]()[_0x688b('0x27')](respondWithResult(_0x213200,null))['catch'](handleError(_0x213200,null));};function wrapUser(_0x25b482){return function(_0x1d7371){var _0xcde578=_0x25b482['get']({'plain':!![]});_0xcde578[_0x688b('0x4a')]=[];if(_0x1d7371){_0xcde578[_0x688b('0x4b')]=_0x1d7371['createdAt'];_0xcde578[_0x688b('0x4c')]=_0x1d7371;}else{_0xcde578[_0x688b('0x4b')]=moment(0x0)[_0x688b('0x4d')](_0x688b('0x4e'));_0xcde578[_0x688b('0x4c')]={};}return _0xcde578;};}exports[_0x688b('0x4f')]=function(_0x5bfa33,_0x5f20e5,_0x32414a){var _0x16e7b1=[];return db[_0x688b('0x50')][_0x688b('0x3e')]({'where':{'role':[_0x688b('0x51'),'admin','user']},'attributes':['id',_0x688b('0x52'),'name',_0x688b('0x53'),_0x688b('0x54'),_0x688b('0x55'),_0x688b('0x56'),_0x688b('0x57'),'allowmessenger',_0x688b('0x58')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x688b('0x59'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x688b('0x27')](function(_0x3f79da){if(_0x3f79da){var _0x47a589=_0x5bfa33[_0x688b('0x5a')]['get']({'plain':!![]});if(!_0x47a589)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a589[_0x688b('0x53')]===_0x688b('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0x688b('0x5b'),'userProfileId':_0x47a589[_0x688b('0x5c')]},'raw':!![]})[_0x688b('0x27')](function(_0xe4b232){if(_0xe4b232){if(_0xe4b232[_0x688b('0x5d')]===0x0){return db[_0x688b('0x5e')]['findAll']({'where':{'sectionId':_0xe4b232['id']},'raw':!![]})[_0x688b('0x27')](function(_0x39bded){var _0x203d5a=[];if(_['isEmpty'](_0x39bded)){_0x203d5a=_[_0x688b('0x39')](_0x3f79da,function(_0x3d6058){if(_0x3d6058['role']!==_0x688b('0x51')){return _0x3d6058;}});return _0x203d5a;}else{for(var _0x3446d1=0x0;_0x3446d1<_0x3f79da[_0x688b('0x5f')];_0x3446d1++){var _0x3a0b80=_0x3f79da[_0x3446d1];if(_0x3a0b80[_0x688b('0x53')]==='agent'){var _0x4e4841=_[_0x688b('0x46')](_0x39bded,function(_0x553816){return _0x553816[_0x688b('0x60')]===_0x3a0b80['id'];});if(_0x4e4841)_0x203d5a[_0x688b('0x61')](_0x3a0b80);}else{_0x203d5a['push'](_0x3a0b80);}}return _0x203d5a;}});}else{return _0x3f79da;}}else{var _0x4e4ca2=_[_0x688b('0x39')](_0x3f79da,function(_0x247fd2){if(_0x247fd2['role']!=='agent'){return _0x247fd2;}});return _0x4e4ca2;}});}else{return _0x3f79da;}}})[_0x688b('0x27')](function(_0x4ba986){var _0x2ae8a2=[];if(_0x4ba986){_0x16e7b1=_0x4ba986;for(var _0x47be44=0x0;_0x47be44<_0x4ba986['length'];_0x47be44+=0x1){_0x16e7b1[_0x47be44][_0x688b('0x4a')]=[];_0x2ae8a2['push'](db[_0x688b('0x44')][_0x688b('0x46')]({'where':{'FromId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ToId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ChatGroupId':null},'attributes':['id',_0x688b('0x62'),'FromId',_0x688b('0x63'),_0x688b('0x64'),_0x688b('0x48')],'order':qs[_0x688b('0x36')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x688b('0x27')](wrapUser(_0x4ba986[_0x47be44])));}return BPromise[_0x688b('0x65')](_0x2ae8a2);}return[];})[_0x688b('0x27')](function(_0x4be39f){return{'rows':_0x4be39f,'count':_0x4be39f['length']};})[_0x688b('0x27')](respondWithResult(_0x5f20e5,null))['catch'](handleError(_0x5f20e5,null));};
\ No newline at end of file
+var _0xc027=['sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','show','params','intersection','include','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','findAll','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','autoAssociation','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path'];(function(_0x1d61ca,_0x19164c){var _0x2fdf1f=function(_0x1526e3){while(--_0x1526e3){_0x1d61ca['push'](_0x1d61ca['shift']());}};_0x2fdf1f(++_0x19164c);}(_0xc027,0xcf));var _0x7c02=function(_0x2871c2,_0xe4c551){_0x2871c2=_0x2871c2-0x0;var _0x279bac=_0xc027[_0x2871c2];return _0x279bac;};'use strict';var emlformat=require(_0x7c02('0x0'));var rimraf=require(_0x7c02('0x1'));var zipdir=require(_0x7c02('0x2'));var jsonpatch=require(_0x7c02('0x3'));var rp=require(_0x7c02('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7c02('0x5'));var util=require('util');var path=require(_0x7c02('0x6'));var sox=require(_0x7c02('0x7'));var csv=require('to-csv');var ejs=require(_0x7c02('0x8'));var fs=require('fs');var fs_extra=require(_0x7c02('0x9'));var _=require(_0x7c02('0xa'));var squel=require(_0x7c02('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c02('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c02('0xd'));var querystring=require(_0x7c02('0xe'));var Papa=require('papaparse');var Redis=require(_0x7c02('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c02('0x10'));var as=require(_0x7c02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c02('0x12'));var utils=require(_0x7c02('0x13'));var config=require(_0x7c02('0x14'));var licenseUtil=require(_0x7c02('0x15'));var db=require(_0x7c02('0x16'))['db'];config[_0x7c02('0x17')]=_[_0x7c02('0x18')](config[_0x7c02('0x17')],{'host':_0x7c02('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c02('0x17')]));require(_0x7c02('0x1a'))[_0x7c02('0x1b')](socket);function respondWithStatusCode(_0x36f34b,_0x5728a0){_0x5728a0=_0x5728a0||0xcc;return function(_0x341976){if(_0x341976){return _0x36f34b[_0x7c02('0x1c')](_0x5728a0);}return _0x36f34b[_0x7c02('0x1d')](_0x5728a0)[_0x7c02('0x1e')]();};}function respondWithResult(_0x38f8ab,_0x2b23ea){_0x2b23ea=_0x2b23ea||0xc8;return function(_0x39a1f9){if(_0x39a1f9){return _0x38f8ab[_0x7c02('0x1d')](_0x2b23ea)[_0x7c02('0x1f')](_0x39a1f9);}};}function respondWithFilteredResult(_0x102706,_0x222ba0){return function(_0x2f9f1d){if(_0x2f9f1d){var _0x4ae159=typeof _0x222ba0[_0x7c02('0x20')]===_0x7c02('0x21')&&typeof _0x222ba0[_0x7c02('0x22')]==='undefined';var _0x1eeb3a=_0x2f9f1d[_0x7c02('0x23')];var _0x3a3950=_0x4ae159?0x0:_0x222ba0[_0x7c02('0x20')];var _0x70055d=_0x4ae159?_0x2f9f1d[_0x7c02('0x23')]:_0x222ba0[_0x7c02('0x20')]+_0x222ba0[_0x7c02('0x22')];var _0x3a474e;if(_0x70055d>=_0x1eeb3a){_0x70055d=_0x1eeb3a;_0x3a474e=0xc8;}else{_0x3a474e=0xce;}_0x102706[_0x7c02('0x1d')](_0x3a474e);return _0x102706[_0x7c02('0x24')](_0x7c02('0x25'),_0x3a3950+'-'+_0x70055d+'/'+_0x1eeb3a)[_0x7c02('0x1f')](_0x2f9f1d);}return null;};}function patchUpdates(_0x3ce541){return function(_0x761643){try{jsonpatch[_0x7c02('0x26')](_0x761643,_0x3ce541,!![]);}catch(_0x5edd8c){return BPromise[_0x7c02('0x27')](_0x5edd8c);}return _0x761643[_0x7c02('0x28')]();};}function saveUpdates(_0x5522af,_0x17c2cb){return function(_0x1ed8f4){if(_0x1ed8f4){return _0x1ed8f4[_0x7c02('0x29')](_0x5522af)[_0x7c02('0x2a')](function(_0x5183f7){return _0x5183f7;});}return null;};}function removeEntity(_0x54bf4c,_0x366ba1){return function(_0x352380){if(_0x352380){return _0x352380['destroy']()[_0x7c02('0x2a')](function(){_0x54bf4c['status'](0xcc)[_0x7c02('0x1e')]();});}};}function handleEntityNotFound(_0x2e615d,_0x2c6701){return function(_0x2395ea){if(!_0x2395ea){_0x2e615d['sendStatus'](0x194);}return _0x2395ea;};}function handleError(_0x45e0e8,_0x5e13d8){_0x5e13d8=_0x5e13d8||0x1f4;return function(_0x584c2e){logger[_0x7c02('0x2b')](_0x584c2e[_0x7c02('0x2c')]);if(_0x584c2e[_0x7c02('0x2d')]){delete _0x584c2e[_0x7c02('0x2d')];}_0x45e0e8[_0x7c02('0x1d')](_0x5e13d8)[_0x7c02('0x2e')](_0x584c2e);};}exports[_0x7c02('0x2f')]=function(_0x498bdc,_0x949df5){var _0x5e3b42={},_0xce8aff={},_0x579339={'count':0x0,'rows':[]};var _0x11baa5=_[_0x7c02('0x30')](db[_0x7c02('0x31')][_0x7c02('0x32')],function(_0x56e48d){return{'name':_0x56e48d['fieldName'],'type':_0x56e48d[_0x7c02('0x33')][_0x7c02('0x34')]};});_0xce8aff['model']=_[_0x7c02('0x30')](_0x11baa5,'name');_0xce8aff[_0x7c02('0x35')]=_[_0x7c02('0x36')](_0x498bdc[_0x7c02('0x35')]);_0xce8aff[_0x7c02('0x37')]=_['intersection'](_0xce8aff[_0x7c02('0x38')],_0xce8aff['query']);_0x5e3b42['attributes']=_['intersection'](_0xce8aff[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x39')]));_0x5e3b42[_0x7c02('0x3a')]=_0x5e3b42['attributes'][_0x7c02('0x3b')]?_0x5e3b42[_0x7c02('0x3a')]:_0xce8aff['model'];if(!_0x498bdc[_0x7c02('0x35')][_0x7c02('0x3c')](_0x7c02('0x3d'))){_0x5e3b42[_0x7c02('0x22')]=qs[_0x7c02('0x22')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x22')]);_0x5e3b42[_0x7c02('0x20')]=qs[_0x7c02('0x20')](_0x498bdc[_0x7c02('0x35')][_0x7c02('0x20')]);}_0x5e3b42['order']=qs[_0x7c02('0x3e')](_0x498bdc['query'][_0x7c02('0x3e')]);_0x5e3b42[_0x7c02('0x3f')]=qs[_0x7c02('0x37')](_[_0x7c02('0x40')](_0x498bdc[_0x7c02('0x35')],_0xce8aff[_0x7c02('0x37')]),_0x11baa5);if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]){_0x5e3b42[_0x7c02('0x3f')]=_[_0x7c02('0x42')](_0x5e3b42[_0x7c02('0x3f')],{'$or':_[_0x7c02('0x30')](_0x11baa5,function(_0x3fa6f6){if(_0x3fa6f6['type']!=='VIRTUAL'){var _0x196325={};_0x196325[_0x3fa6f6['name']]={'$like':'%'+_0x498bdc[_0x7c02('0x35')][_0x7c02('0x41')]+'%'};return _0x196325;}})});}_0x5e3b42=_[_0x7c02('0x42')]({},_0x5e3b42,_0x498bdc[_0x7c02('0x43')]);var _0x34217d={'where':_0x5e3b42[_0x7c02('0x3f')]};return db[_0x7c02('0x31')]['count'](_0x34217d)[_0x7c02('0x2a')](function(_0x237114){_0x579339[_0x7c02('0x23')]=_0x237114;if(_0x498bdc[_0x7c02('0x35')][_0x7c02('0x44')]){_0x5e3b42['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x5e3b42);})[_0x7c02('0x2a')](function(_0x537438){_0x579339['rows']=_0x537438;return _0x579339;})[_0x7c02('0x2a')](respondWithFilteredResult(_0x949df5,_0x5e3b42))['catch'](handleError(_0x949df5,null));};exports[_0x7c02('0x45')]=function(_0x3d699d,_0x1d4c9f){var _0x460cd2={'raw':!![],'where':{'id':_0x3d699d[_0x7c02('0x46')]['id']}},_0x491407={};_0x491407[_0x7c02('0x38')]=_[_0x7c02('0x36')](db['ChatInternalMessage'][_0x7c02('0x32')]);_0x491407[_0x7c02('0x35')]=_['keys'](_0x3d699d[_0x7c02('0x35')]);_0x491407[_0x7c02('0x37')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],_0x491407[_0x7c02('0x35')]);_0x460cd2[_0x7c02('0x3a')]=_[_0x7c02('0x47')](_0x491407[_0x7c02('0x38')],qs[_0x7c02('0x39')](_0x3d699d[_0x7c02('0x35')][_0x7c02('0x39')]));_0x460cd2[_0x7c02('0x3a')]=_0x460cd2[_0x7c02('0x3a')][_0x7c02('0x3b')]?_0x460cd2['attributes']:_0x491407['model'];if(_0x3d699d[_0x7c02('0x35')][_0x7c02('0x44')]){_0x460cd2[_0x7c02('0x48')]=[{'all':!![]}];}_0x460cd2=_[_0x7c02('0x42')]({},_0x460cd2,_0x3d699d['options']);return db[_0x7c02('0x31')][_0x7c02('0x49')](_0x460cd2)[_0x7c02('0x2a')](handleEntityNotFound(_0x1d4c9f,null))[_0x7c02('0x2a')](respondWithResult(_0x1d4c9f,null))[_0x7c02('0x4a')](handleError(_0x1d4c9f,null));};exports[_0x7c02('0x4b')]=function(_0x513ef2,_0x108f59){return db[_0x7c02('0x31')][_0x7c02('0x4b')](_0x513ef2[_0x7c02('0x4c')],{})[_0x7c02('0x2a')](respondWithResult(_0x108f59,0xc9))[_0x7c02('0x4a')](handleError(_0x108f59,null));};exports[_0x7c02('0x29')]=function(_0xa62f5,_0x16b8c6){if(_0xa62f5[_0x7c02('0x4c')]['id']){delete _0xa62f5['body']['id'];}return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0xa62f5['params']['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x16b8c6,null))[_0x7c02('0x2a')](saveUpdates(_0xa62f5[_0x7c02('0x4c')],null))[_0x7c02('0x2a')](respondWithResult(_0x16b8c6,null))[_0x7c02('0x4a')](handleError(_0x16b8c6,null));};exports[_0x7c02('0x4d')]=function(_0x4dbe91,_0x5b7b68){return db[_0x7c02('0x31')][_0x7c02('0x49')]({'where':{'id':_0x4dbe91[_0x7c02('0x46')]['id']}})[_0x7c02('0x2a')](handleEntityNotFound(_0x5b7b68,null))[_0x7c02('0x2a')](removeEntity(_0x5b7b68,null))[_0x7c02('0x4a')](handleError(_0x5b7b68,null));};exports[_0x7c02('0x4e')]=function(_0x486b50,_0xddea67){return db[_0x7c02('0x31')][_0x7c02('0x4e')]()[_0x7c02('0x2a')](respondWithResult(_0xddea67,null))[_0x7c02('0x4a')](handleError(_0xddea67,null));};function wrapUser(_0x1a31b0){return function(_0x3449c3){var _0x5b3bf2=_0x1a31b0[_0x7c02('0x4f')]({'plain':!![]});_0x5b3bf2[_0x7c02('0x50')]=[];if(_0x3449c3){_0x5b3bf2[_0x7c02('0x51')]=_0x3449c3[_0x7c02('0x52')];_0x5b3bf2['lastMessage']=_0x3449c3;}else{_0x5b3bf2[_0x7c02('0x51')]=moment(0x0)[_0x7c02('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b3bf2[_0x7c02('0x54')]={};}return _0x5b3bf2;};}exports[_0x7c02('0x55')]=function(_0xe8b756,_0x4d763d,_0x4682d4){var _0x29bde6=[];return db[_0x7c02('0x56')][_0x7c02('0x57')]({'where':{'role':['agent','admin',_0x7c02('0x58')]},'attributes':['id',_0x7c02('0x59'),_0x7c02('0x2d'),_0x7c02('0x5a'),'userpic',_0x7c02('0x5b'),_0x7c02('0x5c'),_0x7c02('0x5d'),_0x7c02('0x5e'),_0x7c02('0x5f')],'order':qs[_0x7c02('0x3e')](_0x7c02('0x60')),'include':[{'model':db[_0x7c02('0x61')],'as':_0x7c02('0x62'),'attributes':['id',_0x7c02('0x2d'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x3b1bb7){if(_0x3b1bb7){var _0x5be4d4=_0xe8b756[_0x7c02('0x58')]['get']({'plain':!![]});if(!_0x5be4d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5be4d4[_0x7c02('0x5a')]===_0x7c02('0x58')){return db['UserProfileSection'][_0x7c02('0x49')]({'where':{'name':'Agents','userProfileId':_0x5be4d4['userProfileId']},'raw':!![]})[_0x7c02('0x2a')](function(_0x3b3ff0){if(_0x3b3ff0){if(_0x3b3ff0[_0x7c02('0x63')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3b3ff0['id']},'raw':!![]})['then'](function(_0x135ee1){var _0xae15cc=[];if(_[_0x7c02('0x64')](_0x135ee1)){_0xae15cc=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x27237e){if(_0x27237e['role']!=='agent'){return _0x27237e;}});return _0xae15cc;}else{for(var _0x3e48d8=0x0;_0x3e48d8<_0x3b1bb7['length'];_0x3e48d8++){var _0x2a7dcb=_0x3b1bb7[_0x3e48d8];if(_0x2a7dcb[_0x7c02('0x5a')]===_0x7c02('0x65')){var _0xe5f2c4=_['find'](_0x135ee1,function(_0xaf7391){return _0xaf7391[_0x7c02('0x66')]===_0x2a7dcb['id'];});if(_0xe5f2c4)_0xae15cc['push'](_0x2a7dcb);}else{_0xae15cc[_0x7c02('0x67')](_0x2a7dcb);}}return _0xae15cc;}});}else{return _0x3b1bb7;}}else{var _0x3ef451=_[_0x7c02('0x41')](_0x3b1bb7,function(_0x47c902){if(_0x47c902[_0x7c02('0x5a')]!==_0x7c02('0x65')){return _0x47c902;}});return _0x3ef451;}});}else{return _0x3b1bb7;}}})[_0x7c02('0x2a')](function(_0x54d075){var _0x36f622=[];if(_0x54d075){_0x29bde6=_0x54d075;for(var _0x2a6e5b=0x0;_0x2a6e5b<_0x54d075[_0x7c02('0x3b')];_0x2a6e5b+=0x1){_0x29bde6[_0x2a6e5b][_0x7c02('0x50')]=[];_0x36f622[_0x7c02('0x67')](db['ChatInternalMessage'][_0x7c02('0x49')]({'where':{'FromId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ToId':[_0xe8b756[_0x7c02('0x58')]['id'],_0x54d075[_0x2a6e5b]['id']],'ChatGroupId':null},'attributes':['id',_0x7c02('0x52'),'FromId',_0x7c02('0x68'),_0x7c02('0x69'),'body'],'order':qs[_0x7c02('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7c02('0x2a')](wrapUser(_0x54d075[_0x2a6e5b])));}return BPromise[_0x7c02('0x6a')](_0x36f622);}return[];})[_0x7c02('0x2a')](function(_0x20121c){return{'rows':_0x20121c,'count':_0x20121c[_0x7c02('0x3b')]};})[_0x7c02('0x2a')](respondWithResult(_0x4d763d,null))[_0x7c02('0x4a')](handleError(_0x4d763d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 28676cf..72aa08f 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 _0x6d6d=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x6d6d,0xd2));var _0xd6d6=function(_0x3cf0c9,_0x4e4ec8){_0x3cf0c9=_0x3cf0c9-0x0;var _0xe29f0e=_0x6d6d[_0x3cf0c9];return _0xe29f0e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd6d6('0x0'))['db'][_0xd6d6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd6d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd6d6('0x3'),'afterDestroy':_0xd6d6('0x4')};function emitEvent(_0x69ff42){return function(_0xccafee,_0xfb579c,_0x15102b){ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42+':'+_0xccafee['id'],_0xccafee);ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42,_0xccafee);_0x15102b(null);};}for(var e in events){if(events[_0xd6d6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xbde6=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x36055a,_0x55613a){var _0x1eb71f=function(_0x489fc4){while(--_0x489fc4){_0x36055a['push'](_0x36055a['shift']());}};_0x1eb71f(++_0x55613a);}(_0xbde6,0xae));var _0x6bde=function(_0x14c606,_0x4d97f1){_0x14c606=_0x14c606-0x0;var _0x34fe6e=_0xbde6[_0x14c606];return _0x34fe6e;};'use strict';var EventEmitter=require(_0x6bde('0x0'));var ChatInternalMessage=require(_0x6bde('0x1'))['db'][_0x6bde('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6bde('0x3')](0x0);var events={'afterCreate':_0x6bde('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x185367){return function(_0x1e95b2,_0x24b635,_0x291732){ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367+':'+_0x1e95b2['id'],_0x1e95b2);ChatInternalMessageEvents[_0x6bde('0x5')](_0x185367,_0x1e95b2);_0x291732(null);};}for(var e in events){if(events[_0x6bde('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6bde('0x7')](e,emitEvent(event));}}module[_0x6bde('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 dbf6908..0adcf13 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 _0xc8ed=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xc8ed,0x1bd));var _0xdc8e=function(_0x251ae3,_0x340452){_0x251ae3=_0x251ae3-0x0;var _0x4b6995=_0xc8ed[_0x251ae3];return _0x4b6995;};'use strict';var _=require('lodash');var util=require(_0xdc8e('0x0'));var logger=require(_0xdc8e('0x1'))('api');var moment=require(_0xdc8e('0x2'));var BPromise=require(_0xdc8e('0x3'));var rp=require(_0xdc8e('0x4'));var fs=require('fs');var path=require(_0xdc8e('0x5'));var rimraf=require('rimraf');var config=require(_0xdc8e('0x6'));var attributes=require(_0xdc8e('0x7'));module[_0xdc8e('0x8')]=function(_0x4ce6a8,_0x5494b3){return _0x4ce6a8[_0xdc8e('0x9')](_0xdc8e('0xa'),attributes,{'tableName':_0xdc8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc8e('0xc'),'collate':_0xdc8e('0xd')});};
\ No newline at end of file
+var _0x1135=['moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xaf0e4c,_0x4760ab){var _0x28b3f9=function(_0xc36c19){while(--_0xc36c19){_0xaf0e4c['push'](_0xaf0e4c['shift']());}};_0x28b3f9(++_0x4760ab);}(_0x1135,0x1b7));var _0x5113=function(_0x16ba90,_0x108eb7){_0x16ba90=_0x16ba90-0x0;var _0x2bc281=_0x1135[_0x16ba90];return _0x2bc281;};'use strict';var _=require(_0x5113('0x0'));var util=require(_0x5113('0x1'));var logger=require(_0x5113('0x2'))('api');var moment=require(_0x5113('0x3'));var BPromise=require('bluebird');var rp=require(_0x5113('0x4'));var fs=require('fs');var path=require(_0x5113('0x5'));var rimraf=require(_0x5113('0x6'));var config=require(_0x5113('0x7'));var attributes=require(_0x5113('0x8'));module[_0x5113('0x9')]=function(_0x1fcd0d,_0xb8fccd){return _0x1fcd0d[_0x5113('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5113('0xb'),'collate':_0x5113('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6408a4d..4b27c2f 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 _0x2982=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2db83f,_0x5754fb){var _0x1fbe86=function(_0x16272f){while(--_0x16272f){_0x2db83f['push'](_0x2db83f['shift']());}};_0x1fbe86(++_0x5754fb);}(_0x2982,0x8d));var _0x2298=function(_0x28801e,_0x3c0c42){_0x28801e=_0x28801e-0x0;var _0x56e311=_0x2982[_0x28801e];return _0x56e311;};'use strict';var _=require(_0x2298('0x0'));var util=require('util');var moment=require(_0x2298('0x1'));var BPromise=require(_0x2298('0x2'));var rs=require(_0x2298('0x3'));var fs=require('fs');var Redis=require(_0x2298('0x4'));var db=require(_0x2298('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2298('0x6'))(_0x2298('0x7'));var config=require('../../config/environment');var jayson=require(_0x2298('0x8'));var client=jayson[_0x2298('0x9')][_0x2298('0xa')]({'port':0x232a});config['redis']=_[_0x2298('0xb')](config[_0x2298('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2298('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b34b2,_0xf6e6d9,_0x123b9e){return new BPromise(function(_0x493b7b,_0x11a3f9){return client[_0x2298('0xe')](_0x1b34b2,_0x123b9e)[_0x2298('0xf')](function(_0x1636ab){logger[_0x2298('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x2298('0x11'));logger[_0x2298('0x12')](_0x2298('0x13'),_0xf6e6d9,_0x2298('0x11'),JSON[_0x2298('0x14')](_0x1636ab));if(_0x1636ab[_0x2298('0x15')]){if(_0x1636ab['error'][_0x2298('0x16')]===0x1f4){logger['error'](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x11a3f9(_0x1636ab['error'][_0x2298('0x18')]);}logger[_0x2298('0x15')](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x493b7b(_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);}else{logger[_0x2298('0x10')](_0x2298('0x17'),_0xf6e6d9,_0x2298('0x11'));_0x493b7b(_0x1636ab[_0x2298('0x19')][_0x2298('0x18')]);}})[_0x2298('0x1a')](function(_0x453862){logger[_0x2298('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x453862);_0x11a3f9(_0x453862);});});}
\ No newline at end of file
+var _0xdadf=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','info','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x20bcef,_0x55607f){var _0x372a1d=function(_0x2c9b3e){while(--_0x2c9b3e){_0x20bcef['push'](_0x20bcef['shift']());}};_0x372a1d(++_0x55607f);}(_0xdadf,0xc8));var _0xfdad=function(_0x47bf5b,_0x4531da){_0x47bf5b=_0x47bf5b-0x0;var _0x34edac=_0xdadf[_0x47bf5b];return _0x34edac;};'use strict';var _=require(_0xfdad('0x0'));var util=require('util');var moment=require(_0xfdad('0x1'));var BPromise=require(_0xfdad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfdad('0x3'));var db=require(_0xfdad('0x4'))['db'];var utils=require(_0xfdad('0x5'));var logger=require(_0xfdad('0x6'))(_0xfdad('0x7'));var config=require(_0xfdad('0x8'));var jayson=require(_0xfdad('0x9'));var client=jayson['client'][_0xfdad('0xa')]({'port':0x232a});config[_0xfdad('0xb')]=_[_0xfdad('0xc')](config[_0xfdad('0xb')],{'host':_0xfdad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdad('0xb')]));require(_0xfdad('0xe'))['register'](socket);function respondWithRpcPromise(_0xc5be48,_0x5889cd,_0x546cb9){return new BPromise(function(_0x48ee1e,_0x413a62){return client[_0xfdad('0xf')](_0xc5be48,_0x546cb9)[_0xfdad('0x10')](function(_0x29049c){logger[_0xfdad('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5889cd,_0xfdad('0x12'),JSON['stringify'](_0x29049c));if(_0x29049c[_0xfdad('0x13')]){if(_0x29049c['error'][_0xfdad('0x14')]===0x1f4){logger[_0xfdad('0x13')](_0xfdad('0x15'),_0x5889cd,_0x29049c['error'][_0xfdad('0x16')]);return _0x413a62(_0x29049c['error'][_0xfdad('0x16')]);}logger['error'](_0xfdad('0x15'),_0x5889cd,_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);return _0x48ee1e(_0x29049c[_0xfdad('0x13')][_0xfdad('0x16')]);}else{logger['info'](_0xfdad('0x15'),_0x5889cd,_0xfdad('0x12'));_0x48ee1e(_0x29049c[_0xfdad('0x17')][_0xfdad('0x16')]);}})[_0xfdad('0x18')](function(_0x47cd2d){logger['error'](_0xfdad('0x15'),_0x5889cd,_0x47cd2d);_0x413a62(_0x47cd2d);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5283d63..4031087 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 _0xbde6=['removeListener','register','length','./chatInternalMessage.events','save','update','emit'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xbde6,0xc7));var _0x6bde=function(_0x480c85,_0x291d15){_0x480c85=_0x480c85-0x0;var _0x51531c=_0xbde6[_0x480c85];return _0x51531c;};'use strict';var ChatInternalMessageEvents=require(_0x6bde('0x0'));var events=[_0x6bde('0x1'),'remove',_0x6bde('0x2')];function createListener(_0x65e0d7,_0x4c9e67){return function(_0x552583){_0x4c9e67[_0x6bde('0x3')](_0x65e0d7,_0x552583);};}function removeListener(_0x5dc36d,_0x1b6604){return function(){ChatInternalMessageEvents[_0x6bde('0x4')](_0x5dc36d,_0x1b6604);};}exports[_0x6bde('0x5')]=function(_0x22d440){for(var _0x252625=0x0,_0x244daa=events[_0x6bde('0x6')];_0x252625<_0x244daa;_0x252625++){var _0x6b2c8f=events[_0x252625];var _0x24d6a5=createListener('chatInternalMessage:'+_0x6b2c8f,_0x22d440);ChatInternalMessageEvents['on'](_0x6b2c8f,_0x24d6a5);}};
\ No newline at end of file
+var _0x7f2e=['removeListener','chatInternalMessage:','./chatInternalMessage.events','remove','emit'];(function(_0x34fe2c,_0x3c12cc){var _0x4fef94=function(_0x761711){while(--_0x761711){_0x34fe2c['push'](_0x34fe2c['shift']());}};_0x4fef94(++_0x3c12cc);}(_0x7f2e,0x19c));var _0xe7f2=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x7f2e[_0x225f50];return _0x19d003;};'use strict';var ChatInternalMessageEvents=require(_0xe7f2('0x0'));var events=['save',_0xe7f2('0x1'),'update'];function createListener(_0x210ba0,_0x4fc5b3){return function(_0x4ad911){_0x4fc5b3[_0xe7f2('0x2')](_0x210ba0,_0x4ad911);};}function removeListener(_0x3c08cb,_0x1c5630){return function(){ChatInternalMessageEvents[_0xe7f2('0x3')](_0x3c08cb,_0x1c5630);};}exports['register']=function(_0x2de62f){for(var _0x14958f=0x0,_0xea3769=events['length'];_0x14958f<_0xea3769;_0x14958f++){var _0x15beaf=events[_0x14958f];var _0x329198=createListener(_0xe7f2('0x4')+_0x15beaf,_0x2de62f);ChatInternalMessageEvents['on'](_0x15beaf,_0x329198);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index af64287..6d27c2a 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 _0x024c=['getUsers','/:id','show','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/users'];(function(_0x30cb3a,_0x4adc6f){var _0x32e69f=function(_0x14845e){while(--_0x14845e){_0x30cb3a['push'](_0x30cb3a['shift']());}};_0x32e69f(++_0x4adc6f);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc024('0x0'));var util=require(_0xc024('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc024('0x2'));var router=express[_0xc024('0x3')]();var fs_extra=require(_0xc024('0x4'));var auth=require(_0xc024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc024('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc024('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc024('0x7')](_0xc024('0x8'),auth[_0xc024('0x9')](),controller[_0xc024('0xa')]);router['get'](_0xc024('0xb'),auth[_0xc024('0x9')](),controller[_0xc024('0xc')]);router[_0xc024('0x7')](_0xc024('0xd'),auth['isAuthenticated'](),controller[_0xc024('0xe')]);router[_0xc024('0xf')]('/',auth[_0xc024('0x9')](),controller[_0xc024('0x10')]);router[_0xc024('0x11')]('/:id',controller['update']);router[_0xc024('0x12')](_0xc024('0xd'),auth[_0xc024('0x9')](),controller['destroy']);module[_0xc024('0x13')]=router;
\ No newline at end of file
+var _0x2d3d=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','getUsers','/:id','show','post','create','put','update'];(function(_0x44adaf,_0xa3c961){var _0x1dad05=function(_0x5540e6){while(--_0x5540e6){_0x44adaf['push'](_0x44adaf['shift']());}};_0x1dad05(++_0xa3c961);}(_0x2d3d,0x1a3));var _0xd2d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d3d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd2d3('0x0'));var util=require(_0xd2d3('0x1'));var path=require(_0xd2d3('0x2'));var timeout=require(_0xd2d3('0x3'));var express=require(_0xd2d3('0x4'));var router=express[_0xd2d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2d3('0x6'));var interaction=require(_0xd2d3('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd2d3('0x8')]('/',auth[_0xd2d3('0x9')](),controller['index']);router[_0xd2d3('0x8')]('/describe',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xa')]);router[_0xd2d3('0x8')]('/users',auth[_0xd2d3('0x9')](),controller[_0xd2d3('0xb')]);router[_0xd2d3('0x8')](_0xd2d3('0xc'),auth['isAuthenticated'](),controller[_0xd2d3('0xd')]);router[_0xd2d3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd2d3('0xf')]);router[_0xd2d3('0x10')](_0xd2d3('0xc'),controller[_0xd2d3('0x11')]);router[_0xd2d3('0x12')](_0xd2d3('0xc'),auth[_0xd2d3('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 40e874d..fdfd7f8 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 _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x21929f,_0xb96182){var _0x1a6077=function(_0x209786){while(--_0x209786){_0x21929f['push'](_0x21929f['shift']());}};_0x1a6077(++_0xb96182);}(_0x578c,0x158));var _0xc578=function(_0x3e68f3,_0x1ec053){_0x3e68f3=_0x3e68f3-0x0;var _0x27ee2e=_0x578c[_0x3e68f3];return _0x27ee2e;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}};
\ No newline at end of file
+var _0xc224=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3afeda,_0x4b249f){var _0xb4c759=function(_0x4db382){while(--_0x4db382){_0x3afeda['push'](_0x3afeda['shift']());}};_0xb4c759(++_0x4b249f);}(_0xc224,0x1af));var _0x4c22=function(_0x5614ed,_0x180602){_0x5614ed=_0x5614ed-0x0;var _0xd0b252=_0xc224[_0x5614ed];return _0xd0b252;};'use strict';var Sequelize=require(_0x4c22('0x0'));module[_0x4c22('0x1')]={'body':{'type':Sequelize[_0x4c22('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c22('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c22('0x4')]('in',_0x4c22('0x5')),'defaultValue':_0x4c22('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c22('0x6')]},'providerName':{'type':Sequelize[_0x4c22('0x7')]},'providerResponse':{'type':Sequelize[_0x4c22('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4faa73f..55c5125 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 _0xd6e0=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','chat-interactions','accept','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','event','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x6c70aa,_0x14bea7){var _0x31dbf0=function(_0x1488a0){while(--_0x1488a0){_0x6c70aa['push'](_0x6c70aa['shift']());}};_0x31dbf0(++_0x14bea7);}(_0xd6e0,0x6d));var _0x0d6e=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xd6e0[_0x1505e5];return _0x5b1dcd;};'use strict';var emlformat=require(_0x0d6e('0x0'));var rimraf=require(_0x0d6e('0x1'));var zipdir=require(_0x0d6e('0x2'));var jsonpatch=require(_0x0d6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d6e('0x4'));var Mustache=require(_0x0d6e('0x5'));var util=require(_0x0d6e('0x6'));var path=require(_0x0d6e('0x7'));var sox=require(_0x0d6e('0x8'));var csv=require('to-csv');var ejs=require(_0x0d6e('0x9'));var fs=require('fs');var fs_extra=require(_0x0d6e('0xa'));var _=require(_0x0d6e('0xb'));var squel=require(_0x0d6e('0xc'));var crypto=require(_0x0d6e('0xd'));var jsforce=require(_0x0d6e('0xe'));var deskjs=require(_0x0d6e('0xf'));var toCsv=require(_0x0d6e('0x10'));var querystring=require(_0x0d6e('0x11'));var Papa=require('papaparse');var Redis=require(_0x0d6e('0x12'));var authService=require(_0x0d6e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d6e('0x14'));var hardwareService=require(_0x0d6e('0x15'));var logger=require(_0x0d6e('0x16'))(_0x0d6e('0x17'));var utils=require(_0x0d6e('0x18'));var config=require(_0x0d6e('0x19'));var licenseUtil=require(_0x0d6e('0x1a'));var db=require(_0x0d6e('0x1b'))['db'];config['redis']=_[_0x0d6e('0x1c')](config['redis'],{'host':_0x0d6e('0x1d'),'port':0x18eb});var socket=require(_0x0d6e('0x1e'))(new Redis(config[_0x0d6e('0x1f')]));require(_0x0d6e('0x20'))[_0x0d6e('0x21')](socket);var jayson=require(_0x0d6e('0x22'));var client=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232c});var client9002=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3f4a63,_0x117e93,_0x3352ac,_0x448e0b){return new BPromise(function(_0x2cff53,_0xdd2c5f){var _0x3d601a=_0x448e0b||client;return _0x3d601a['request'](_0x3f4a63,_0x3352ac)['then'](function(_0x3477c8){logger['info'](_0x0d6e('0x25'),_0x117e93,'request\x20sent');logger[_0x0d6e('0x26')](_0x0d6e('0x27'),_0x117e93,'request\x20sent',JSON[_0x0d6e('0x28')](_0x3477c8));if(_0x3477c8[_0x0d6e('0x29')]){if(_0x3477c8[_0x0d6e('0x29')]['code']===0x1f4){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);return _0xdd2c5f(_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);}logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8['error'][_0x0d6e('0x2a')]);return _0x2cff53(_0x3477c8['error'][_0x0d6e('0x2a')]);}else{logger[_0x0d6e('0x2b')](_0x0d6e('0x25'),_0x117e93,_0x0d6e('0x2c'));_0x2cff53(_0x3477c8['result'][_0x0d6e('0x2a')]);}})['catch'](function(_0x9cf683){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x9cf683);_0xdd2c5f(_0x9cf683);});});}function respondWithStatusCode(_0x166ec9,_0x2a7490){_0x2a7490=_0x2a7490||0xcc;return function(_0x3ae998){if(_0x3ae998){return _0x166ec9[_0x0d6e('0x2d')](_0x2a7490);}return _0x166ec9[_0x0d6e('0x2e')](_0x2a7490)[_0x0d6e('0x2f')]();};}function respondWithResult(_0x30d853,_0xe8fa){_0xe8fa=_0xe8fa||0xc8;return function(_0x5a357e){if(_0x5a357e){return _0x30d853['status'](_0xe8fa)[_0x0d6e('0x30')](_0x5a357e);}};}function respondWithFilteredResult(_0x29a0f8,_0x43cb7a){return function(_0x3bbdc4){if(_0x3bbdc4){var _0x1c38ab=typeof _0x43cb7a[_0x0d6e('0x31')]===_0x0d6e('0x32')&&typeof _0x43cb7a[_0x0d6e('0x33')]===_0x0d6e('0x32');var _0x133355=_0x3bbdc4[_0x0d6e('0x34')];var _0x5413c6=_0x1c38ab?0x0:_0x43cb7a[_0x0d6e('0x31')];var _0x384c81=_0x1c38ab?_0x3bbdc4[_0x0d6e('0x34')]:_0x43cb7a[_0x0d6e('0x31')]+_0x43cb7a[_0x0d6e('0x33')];var _0x1ce21e;if(_0x384c81>=_0x133355){_0x384c81=_0x133355;_0x1ce21e=0xc8;}else{_0x1ce21e=0xce;}_0x29a0f8[_0x0d6e('0x2e')](_0x1ce21e);return _0x29a0f8[_0x0d6e('0x35')]('Content-Range',_0x5413c6+'-'+_0x384c81+'/'+_0x133355)[_0x0d6e('0x30')](_0x3bbdc4);}return null;};}function patchUpdates(_0x255e8f){return function(_0xc4092){try{jsonpatch[_0x0d6e('0x36')](_0xc4092,_0x255e8f,!![]);}catch(_0x578061){return BPromise[_0x0d6e('0x37')](_0x578061);}return _0xc4092[_0x0d6e('0x38')]();};}function saveUpdates(_0x21576d,_0x244e22){return function(_0x42f7){if(_0x42f7){return _0x42f7['update'](_0x21576d)[_0x0d6e('0x39')](function(_0x4e0375){return _0x4e0375;});}return null;};}function removeEntity(_0x1444a9,_0x50de86){return function(_0x1b9139){if(_0x1b9139){return _0x1b9139[_0x0d6e('0x3a')]()['then'](function(){_0x1444a9[_0x0d6e('0x2e')](0xcc)[_0x0d6e('0x2f')]();});}};}function handleEntityNotFound(_0x46ba49,_0x18009e){return function(_0x5c88be){if(!_0x5c88be){_0x46ba49[_0x0d6e('0x2d')](0x194);}return _0x5c88be;};}function handleError(_0x2224c6,_0x51643f){_0x51643f=_0x51643f||0x1f4;return function(_0xbfa059){logger[_0x0d6e('0x29')](_0xbfa059[_0x0d6e('0x3b')]);if(_0xbfa059[_0x0d6e('0x3c')]){delete _0xbfa059[_0x0d6e('0x3c')];}_0x2224c6['status'](_0x51643f)[_0x0d6e('0x3d')](_0xbfa059);};}exports['index']=function(_0x6a0e02,_0x5299b9){var _0x3144e0={},_0x411942={},_0x3aee44={'count':0x0,'rows':[]};var _0xedb01e=_['map'](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')],function(_0x4bede1){return{'name':_0x4bede1[_0x0d6e('0x40')],'type':_0x4bede1[_0x0d6e('0x41')][_0x0d6e('0x42')]};});_0x411942[_0x0d6e('0x43')]=_[_0x0d6e('0x44')](_0xedb01e,_0x0d6e('0x3c'));_0x411942['query']=_[_0x0d6e('0x45')](_0x6a0e02[_0x0d6e('0x46')]);_0x411942[_0x0d6e('0x47')]=_['intersection'](_0x411942[_0x0d6e('0x43')],_0x411942[_0x0d6e('0x46')]);_0x3144e0[_0x0d6e('0x48')]=_[_0x0d6e('0x49')](_0x411942[_0x0d6e('0x43')],qs[_0x0d6e('0x4a')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x3144e0[_0x0d6e('0x48')]=_0x3144e0[_0x0d6e('0x48')][_0x0d6e('0x4b')]?_0x3144e0[_0x0d6e('0x48')]:_0x411942['model'];if(!_0x6a0e02['query'][_0x0d6e('0x4c')](_0x0d6e('0x4d'))){_0x3144e0[_0x0d6e('0x33')]=qs[_0x0d6e('0x33')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x33')]);_0x3144e0[_0x0d6e('0x31')]=qs[_0x0d6e('0x31')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x31')]);}_0x3144e0[_0x0d6e('0x4e')]=qs[_0x0d6e('0x4f')](_0x6a0e02[_0x0d6e('0x46')]['sort']);_0x3144e0[_0x0d6e('0x50')]=qs['filters'](_['pick'](_0x6a0e02[_0x0d6e('0x46')],_0x411942[_0x0d6e('0x47')]),_0xedb01e);if(_0x6a0e02['query']['filter']){_0x3144e0['where']=_[_0x0d6e('0x51')](_0x3144e0[_0x0d6e('0x50')],{'$or':_[_0x0d6e('0x44')](_0xedb01e,function(_0x412f54){if(_0x412f54['type']!=='VIRTUAL'){var _0x5b114d={};_0x5b114d[_0x412f54[_0x0d6e('0x3c')]]={'$like':'%'+_0x6a0e02['query'][_0x0d6e('0x52')]+'%'};return _0x5b114d;}})});}_0x3144e0=_[_0x0d6e('0x51')]({},_0x3144e0,_0x6a0e02[_0x0d6e('0x53')]);var _0x4e5068={'where':_0x3144e0['where']};return db[_0x0d6e('0x3e')]['count'](_0x4e5068)['then'](function(_0x468e7f){_0x3aee44[_0x0d6e('0x34')]=_0x468e7f;if(_0x6a0e02['query'][_0x0d6e('0x54')]){_0x3144e0[_0x0d6e('0x55')]=[{'all':!![]}];}return db[_0x0d6e('0x3e')][_0x0d6e('0x56')](_0x3144e0);})[_0x0d6e('0x39')](function(_0x4ca73e){_0x3aee44['rows']=_0x4ca73e;return _0x3aee44;})[_0x0d6e('0x39')](respondWithFilteredResult(_0x5299b9,_0x3144e0))[_0x0d6e('0x57')](handleError(_0x5299b9,null));};exports[_0x0d6e('0x58')]=function(_0x23c04a,_0x3a46fd){var _0x396b58={'raw':!![],'where':{'id':_0x23c04a[_0x0d6e('0x59')]['id']}},_0x2a9341={};_0x2a9341['model']=_[_0x0d6e('0x45')](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')]);_0x2a9341[_0x0d6e('0x46')]=_[_0x0d6e('0x45')](_0x23c04a[_0x0d6e('0x46')]);_0x2a9341[_0x0d6e('0x47')]=_[_0x0d6e('0x49')](_0x2a9341[_0x0d6e('0x43')],_0x2a9341[_0x0d6e('0x46')]);_0x396b58['attributes']=_['intersection'](_0x2a9341['model'],qs[_0x0d6e('0x4a')](_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x396b58[_0x0d6e('0x48')]=_0x396b58['attributes'][_0x0d6e('0x4b')]?_0x396b58[_0x0d6e('0x48')]:_0x2a9341[_0x0d6e('0x43')];if(_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x54')]){_0x396b58[_0x0d6e('0x55')]=[{'all':!![]}];}_0x396b58=_[_0x0d6e('0x51')]({},_0x396b58,_0x23c04a['options']);return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')](_0x396b58)[_0x0d6e('0x39')](handleEntityNotFound(_0x3a46fd,null))[_0x0d6e('0x39')](respondWithResult(_0x3a46fd,null))[_0x0d6e('0x57')](handleError(_0x3a46fd,null));};exports[_0x0d6e('0x5b')]=function(_0x956447,_0x241cea){return db[_0x0d6e('0x3e')]['create'](_0x956447[_0x0d6e('0x5c')],{})[_0x0d6e('0x39')](respondWithResult(_0x241cea,0xc9))[_0x0d6e('0x57')](handleError(_0x241cea,null));};exports[_0x0d6e('0x5d')]=function(_0x35d0f3,_0x5b0b8c){if(_0x35d0f3[_0x0d6e('0x5c')]['id']){delete _0x35d0f3[_0x0d6e('0x5c')]['id'];}return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x35d0f3['params']['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5b0b8c,null))[_0x0d6e('0x39')](saveUpdates(_0x35d0f3[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](respondWithResult(_0x5b0b8c,null))[_0x0d6e('0x57')](handleError(_0x5b0b8c,null));};exports[_0x0d6e('0x3a')]=function(_0x6f2fe9,_0x20819e){return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x6f2fe9[_0x0d6e('0x59')]['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x20819e,null))[_0x0d6e('0x39')](removeEntity(_0x20819e,null))[_0x0d6e('0x57')](handleError(_0x20819e,null));};exports[_0x0d6e('0x5e')]=function(_0x314ca2,_0x50e9d5){return db[_0x0d6e('0x3e')][_0x0d6e('0x5e')]()[_0x0d6e('0x39')](respondWithResult(_0x50e9d5,null))[_0x0d6e('0x57')](handleError(_0x50e9d5,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x60')]=function(_0x560857,_0x5704c9,_0xfc96d1){var _0x55099b={'agent':{},'channel':'chat'};if(_0x560857[_0x0d6e('0x5c')]['id']){delete _0x560857['body']['id'];}_0x560857['body']['read']=!![];_0x560857[_0x0d6e('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x560857['body'][_0x0d6e('0x61')]=_0x560857['body']['UserId']||_0x560857[_0x0d6e('0x62')]['id'];_0x55099b['agent']['id']=_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')];return db['ChatMessage'][_0x0d6e('0x5a')]({'where':{'id':_0x560857['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5704c9,null))[_0x0d6e('0x39')](saveUpdates(_0x560857[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](function(_0x29988e){if(_0x29988e){_0x55099b[_0x0d6e('0x2a')]=_0x29988e[_0x0d6e('0x63')]({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x29988e[_0x0d6e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5704c9,null))['then'](function(_0x363a9c){if(_0x363a9c){return _0x363a9c[_0x0d6e('0x5d')]({'UserId':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'read1stAt':_['isNil'](_0x363a9c[_0x0d6e('0x66')])?moment()['format'](_0x0d6e('0x67')):undefined});}return null;})['then'](function(_0x48c392){if(_0x48c392){_0x55099b['interaction']=_0x48c392['get']({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x68'),_0x560857['user']['id'],_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')],_0x560857['user'][_0x0d6e('0x69')],_0x55099b[_0x0d6e('0x6a')]['id'],_0x560857[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x560857[_0x0d6e('0x5c')]):'null');return respondWithRpcPromise(_0x0d6e('0x6b'),_0x0d6e('0x6c'),_0x55099b);}return null;})[_0x0d6e('0x39')](function(_0x43fc24){var _0x2c0d3b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x43fc24[_0x0d6e('0x2a')]['ContactId'];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x2c0d3b,{'type':db[_0x0d6e('0x6e')]['QueryTypes'][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0xe7ed40){return _0xe7ed40;});})[_0x0d6e('0x39')](function(_0x15e816){if(_0x15e816){_0x55099b['message'][_0x0d6e('0x70')]=_0x15e816[0x0];if(!_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db[_0x0d6e('0x71')][_0x0d6e('0x5a')]({'where':{'id':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':_0x0d6e('0x72')},'attributes':['id',_0x0d6e('0x3c'),_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x33b5ba){if(!_0x33b5ba)return null;_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x33b5ba;return _0x55099b;})['then'](function(_0x2827ea){if(_0x2827ea){if(_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x75')]){_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x76')]=util['format'](_0x0d6e('0x77'),_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x55099b[_0x0d6e('0x78')];_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x55099b[_0x0d6e('0x78')];_0x55099b['message']['event']=_0x0d6e('0x60');return respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x7b'),'message':_[_0x0d6e('0x51')](_0x55099b[_0x0d6e('0x2a')],JSON['parse'](_0x55099b[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002)[_0x0d6e('0x39')](function(){return _0x55099b;});}return _0x55099b;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x5704c9,null))[_0x0d6e('0x57')](handleError(_0x5704c9,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x37')]=function(_0x537f6b,_0x49f82f,_0x34851f){var _0x583830={'agent':{},'channel':'chat'};if(_0x537f6b[_0x0d6e('0x5c')]['id']){delete _0x537f6b['body']['id'];}_0x537f6b['body'][_0x0d6e('0x61')]=_0x537f6b[_0x0d6e('0x5c')]['UserId']||_0x537f6b[_0x0d6e('0x62')]['id'];_0x583830[_0x0d6e('0x72')]['id']=_0x537f6b['body'][_0x0d6e('0x61')];return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))['then'](function(_0x5dc060){if(_0x5dc060){_0x583830['message']=_0x5dc060['get']({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x5dc060[_0x0d6e('0x65')]}});}return null;})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))[_0x0d6e('0x39')](function(_0x3abfef){if(_0x3abfef){_0x583830[_0x0d6e('0x6a')]=_0x3abfef[_0x0d6e('0x63')]({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x7d'),_0x537f6b[_0x0d6e('0x62')]['id'],_0x537f6b['user']['name'],_0x537f6b['user'][_0x0d6e('0x69')],_0x583830[_0x0d6e('0x6a')]['id'],_0x537f6b[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x537f6b['body']):'null');return respondWithRpcPromise(_0x0d6e('0x7e'),_0x0d6e('0x7f'),_0x583830);}return null;})[_0x0d6e('0x39')](function(_0x151510){var _0x5b6c54=_0x0d6e('0x80')+_0x151510[_0x0d6e('0x2a')][_0x0d6e('0x81')];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x5b6c54,{'type':db[_0x0d6e('0x6e')][_0x0d6e('0x82')][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0x4c8f14){return _0x4c8f14;});})[_0x0d6e('0x39')](function(_0x4d0fa9){if(_0x4d0fa9){_0x583830[_0x0d6e('0x2a')]['contact']=_0x4d0fa9[0x0];if(!_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db['User'][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':'agent'},'attributes':['id','name',_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x2114db){if(!_0x2114db)return null;_0x583830[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x2114db;return _0x583830;})['then'](function(_0x2dafb0){if(_0x2dafb0){_0x2dafb0['message'][_0x0d6e('0x76')]=util['format']('SIP/%s',_0x537f6b[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x83')]=_0x0d6e('0x37');respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x84'),'message':_['merge'](_0x583830[_0x0d6e('0x2a')],JSON[_0x0d6e('0x85')](_0x583830[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002);return _0x583830;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x49f82f,null))['catch'](handleError(_0x49f82f,null));};
\ No newline at end of file
+var _0xeddd=['user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','reject','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','update','body','params','describe','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x292fbe,_0x1148ec){var _0x53ddce=function(_0x1890e5){while(--_0x1890e5){_0x292fbe['push'](_0x292fbe['shift']());}};_0x53ddce(++_0x1148ec);}(_0xeddd,0xa8));var _0xdedd=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xeddd[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require(_0xdedd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdedd('0x3'));var moment=require('moment');var BPromise=require(_0xdedd('0x4'));var Mustache=require(_0xdedd('0x5'));var util=require(_0xdedd('0x6'));var path=require(_0xdedd('0x7'));var sox=require(_0xdedd('0x8'));var csv=require(_0xdedd('0x9'));var ejs=require(_0xdedd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdedd('0xb'));var squel=require('squel');var crypto=require(_0xdedd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdedd('0xd'));var toCsv=require(_0xdedd('0x9'));var querystring=require(_0xdedd('0xe'));var Papa=require(_0xdedd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdedd('0x10'));var logger=require(_0xdedd('0x11'))(_0xdedd('0x12'));var utils=require(_0xdedd('0x13'));var config=require(_0xdedd('0x14'));var licenseUtil=require(_0xdedd('0x15'));var db=require(_0xdedd('0x16'))['db'];config[_0xdedd('0x17')]=_[_0xdedd('0x18')](config[_0xdedd('0x17')],{'host':_0xdedd('0x19'),'port':0x18eb});var socket=require(_0xdedd('0x1a'))(new Redis(config[_0xdedd('0x17')]));require(_0xdedd('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdedd('0x1c')][_0xdedd('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xdedd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x491595,_0x443358,_0x3d6f09,_0x228aa1){return new BPromise(function(_0x20bb0f,_0x447a06){var _0x263938=_0x228aa1||client;return _0x263938[_0xdedd('0x1e')](_0x491595,_0x3d6f09)[_0xdedd('0x1f')](function(_0x220d39){logger[_0xdedd('0x20')]('ChatMessage,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'));logger[_0xdedd('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x443358,_0xdedd('0x21'),JSON[_0xdedd('0x23')](_0x220d39));if(_0x220d39[_0xdedd('0x24')]){if(_0x220d39[_0xdedd('0x24')][_0xdedd('0x25')]===0x1f4){logger[_0xdedd('0x24')](_0xdedd('0x26'),_0x443358,_0x220d39['error']['message']);return _0x447a06(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}logger['error'](_0xdedd('0x26'),_0x443358,_0x220d39[_0xdedd('0x24')]['message']);return _0x20bb0f(_0x220d39[_0xdedd('0x24')][_0xdedd('0x27')]);}else{logger['info'](_0xdedd('0x26'),_0x443358,_0xdedd('0x21'));_0x20bb0f(_0x220d39[_0xdedd('0x28')][_0xdedd('0x27')]);}})[_0xdedd('0x29')](function(_0x1ef903){logger['error'](_0xdedd('0x26'),_0x443358,_0x1ef903);_0x447a06(_0x1ef903);});});}function respondWithStatusCode(_0x42c8f7,_0x4abc9e){_0x4abc9e=_0x4abc9e||0xcc;return function(_0x316a9b){if(_0x316a9b){return _0x42c8f7[_0xdedd('0x2a')](_0x4abc9e);}return _0x42c8f7[_0xdedd('0x2b')](_0x4abc9e)[_0xdedd('0x2c')]();};}function respondWithResult(_0x8a1418,_0x73d9de){_0x73d9de=_0x73d9de||0xc8;return function(_0x5f0a15){if(_0x5f0a15){return _0x8a1418[_0xdedd('0x2b')](_0x73d9de)[_0xdedd('0x2d')](_0x5f0a15);}};}function respondWithFilteredResult(_0xa7d00b,_0x1051c6){return function(_0x2f0a29){if(_0x2f0a29){var _0x5bb57f=typeof _0x1051c6['offset']===_0xdedd('0x2e')&&typeof _0x1051c6['limit']===_0xdedd('0x2e');var _0x18a75d=_0x2f0a29[_0xdedd('0x2f')];var _0x5370c8=_0x5bb57f?0x0:_0x1051c6[_0xdedd('0x30')];var _0x351624=_0x5bb57f?_0x2f0a29[_0xdedd('0x2f')]:_0x1051c6['offset']+_0x1051c6[_0xdedd('0x31')];var _0x456329;if(_0x351624>=_0x18a75d){_0x351624=_0x18a75d;_0x456329=0xc8;}else{_0x456329=0xce;}_0xa7d00b[_0xdedd('0x2b')](_0x456329);return _0xa7d00b[_0xdedd('0x32')](_0xdedd('0x33'),_0x5370c8+'-'+_0x351624+'/'+_0x18a75d)[_0xdedd('0x2d')](_0x2f0a29);}return null;};}function patchUpdates(_0x3fa081){return function(_0x38d046){try{jsonpatch[_0xdedd('0x34')](_0x38d046,_0x3fa081,!![]);}catch(_0xbba0f2){return BPromise['reject'](_0xbba0f2);}return _0x38d046[_0xdedd('0x35')]();};}function saveUpdates(_0x4aa293,_0x12857c){return function(_0x28b169){if(_0x28b169){return _0x28b169['update'](_0x4aa293)[_0xdedd('0x1f')](function(_0x475abf){return _0x475abf;});}return null;};}function removeEntity(_0x17b537,_0x521f19){return function(_0x593c63){if(_0x593c63){return _0x593c63[_0xdedd('0x36')]()['then'](function(){_0x17b537[_0xdedd('0x2b')](0xcc)[_0xdedd('0x2c')]();});}};}function handleEntityNotFound(_0x53cc94,_0x590a3a){return function(_0x198416){if(!_0x198416){_0x53cc94[_0xdedd('0x2a')](0x194);}return _0x198416;};}function handleError(_0x4715d3,_0x310ff1){_0x310ff1=_0x310ff1||0x1f4;return function(_0x4b88be){logger[_0xdedd('0x24')](_0x4b88be[_0xdedd('0x37')]);if(_0x4b88be['name']){delete _0x4b88be[_0xdedd('0x38')];}_0x4715d3['status'](_0x310ff1)[_0xdedd('0x39')](_0x4b88be);};}exports[_0xdedd('0x3a')]=function(_0x283886,_0x31837f){var _0x454d74={},_0xeb4285={},_0x2692fe={'count':0x0,'rows':[]};var _0x5a6779=_[_0xdedd('0x3b')](db[_0xdedd('0x3c')]['rawAttributes'],function(_0xadc8e1){return{'name':_0xadc8e1[_0xdedd('0x3d')],'type':_0xadc8e1[_0xdedd('0x3e')][_0xdedd('0x3f')]};});_0xeb4285[_0xdedd('0x40')]=_[_0xdedd('0x3b')](_0x5a6779,_0xdedd('0x38'));_0xeb4285[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x283886[_0xdedd('0x41')]);_0xeb4285[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],_0xeb4285[_0xdedd('0x41')]);_0x454d74[_0xdedd('0x45')]=_[_0xdedd('0x44')](_0xeb4285[_0xdedd('0x40')],qs[_0xdedd('0x46')](_0x283886['query'][_0xdedd('0x46')]));_0x454d74[_0xdedd('0x45')]=_0x454d74[_0xdedd('0x45')][_0xdedd('0x47')]?_0x454d74[_0xdedd('0x45')]:_0xeb4285[_0xdedd('0x40')];if(!_0x283886[_0xdedd('0x41')]['hasOwnProperty'](_0xdedd('0x48'))){_0x454d74[_0xdedd('0x31')]=qs['limit'](_0x283886[_0xdedd('0x41')][_0xdedd('0x31')]);_0x454d74[_0xdedd('0x30')]=qs[_0xdedd('0x30')](_0x283886[_0xdedd('0x41')][_0xdedd('0x30')]);}_0x454d74[_0xdedd('0x49')]=qs[_0xdedd('0x4a')](_0x283886[_0xdedd('0x41')][_0xdedd('0x4a')]);_0x454d74[_0xdedd('0x4b')]=qs[_0xdedd('0x43')](_[_0xdedd('0x4c')](_0x283886[_0xdedd('0x41')],_0xeb4285[_0xdedd('0x43')]),_0x5a6779);if(_0x283886[_0xdedd('0x41')]['filter']){_0x454d74['where']=_[_0xdedd('0x4d')](_0x454d74['where'],{'$or':_['map'](_0x5a6779,function(_0x864f11){if(_0x864f11[_0xdedd('0x3e')]!==_0xdedd('0x4e')){var _0x3bfedc={};_0x3bfedc[_0x864f11[_0xdedd('0x38')]]={'$like':'%'+_0x283886[_0xdedd('0x41')][_0xdedd('0x4f')]+'%'};return _0x3bfedc;}})});}_0x454d74=_[_0xdedd('0x4d')]({},_0x454d74,_0x283886[_0xdedd('0x50')]);var _0x2e805d={'where':_0x454d74['where']};return db['ChatMessage'][_0xdedd('0x2f')](_0x2e805d)[_0xdedd('0x1f')](function(_0x374e06){_0x2692fe[_0xdedd('0x2f')]=_0x374e06;if(_0x283886['query'][_0xdedd('0x51')]){_0x454d74[_0xdedd('0x52')]=[{'all':!![]}];}return db[_0xdedd('0x3c')][_0xdedd('0x53')](_0x454d74);})[_0xdedd('0x1f')](function(_0xe39b0){_0x2692fe[_0xdedd('0x54')]=_0xe39b0;return _0x2692fe;})[_0xdedd('0x1f')](respondWithFilteredResult(_0x31837f,_0x454d74))[_0xdedd('0x29')](handleError(_0x31837f,null));};exports[_0xdedd('0x55')]=function(_0x227602,_0x7697a7){var _0x4932bd={'raw':!![],'where':{'id':_0x227602['params']['id']}},_0x4bfc9c={};_0x4bfc9c[_0xdedd('0x40')]=_[_0xdedd('0x42')](db[_0xdedd('0x3c')]['rawAttributes']);_0x4bfc9c[_0xdedd('0x41')]=_[_0xdedd('0x42')](_0x227602[_0xdedd('0x41')]);_0x4bfc9c[_0xdedd('0x43')]=_[_0xdedd('0x44')](_0x4bfc9c[_0xdedd('0x40')],_0x4bfc9c[_0xdedd('0x41')]);_0x4932bd['attributes']=_[_0xdedd('0x44')](_0x4bfc9c['model'],qs['fields'](_0x227602[_0xdedd('0x41')][_0xdedd('0x46')]));_0x4932bd['attributes']=_0x4932bd[_0xdedd('0x45')]['length']?_0x4932bd[_0xdedd('0x45')]:_0x4bfc9c[_0xdedd('0x40')];if(_0x227602['query'][_0xdedd('0x51')]){_0x4932bd[_0xdedd('0x52')]=[{'all':!![]}];}_0x4932bd=_['merge']({},_0x4932bd,_0x227602['options']);return db[_0xdedd('0x3c')][_0xdedd('0x56')](_0x4932bd)[_0xdedd('0x1f')](handleEntityNotFound(_0x7697a7,null))[_0xdedd('0x1f')](respondWithResult(_0x7697a7,null))[_0xdedd('0x29')](handleError(_0x7697a7,null));};exports[_0xdedd('0x57')]=function(_0x2e7040,_0x5d3cd1){return db[_0xdedd('0x3c')][_0xdedd('0x57')](_0x2e7040['body'],{})['then'](respondWithResult(_0x5d3cd1,0xc9))['catch'](handleError(_0x5d3cd1,null));};exports[_0xdedd('0x58')]=function(_0x33b665,_0x2ad4b3){if(_0x33b665['body']['id']){delete _0x33b665[_0xdedd('0x59')]['id'];}return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x33b665['params']['id']}})[_0xdedd('0x1f')](handleEntityNotFound(_0x2ad4b3,null))[_0xdedd('0x1f')](saveUpdates(_0x33b665[_0xdedd('0x59')],null))[_0xdedd('0x1f')](respondWithResult(_0x2ad4b3,null))[_0xdedd('0x29')](handleError(_0x2ad4b3,null));};exports[_0xdedd('0x36')]=function(_0x8d74ba,_0x51920b){return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x8d74ba[_0xdedd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51920b,null))[_0xdedd('0x1f')](removeEntity(_0x51920b,null))[_0xdedd('0x29')](handleError(_0x51920b,null));};exports[_0xdedd('0x5b')]=function(_0x587ee1,_0x48cf67){return db['ChatMessage'][_0xdedd('0x5b')]()['then'](respondWithResult(_0x48cf67,null))[_0xdedd('0x29')](handleError(_0x48cf67,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports[_0xdedd('0x5d')]=function(_0x3f4518,_0x5daa53,_0x240c43){var _0x48fcce={'agent':{},'channel':'chat'};if(_0x3f4518['body']['id']){delete _0x3f4518[_0xdedd('0x59')]['id'];}_0x3f4518['body'][_0xdedd('0x5e')]=!![];_0x3f4518['body'][_0xdedd('0x5f')]=moment()['format'](_0xdedd('0x60'));_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')]=_0x3f4518[_0xdedd('0x59')]['UserId']||_0x3f4518[_0xdedd('0x62')]['id'];_0x48fcce[_0xdedd('0x63')]['id']=_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x3f4518['params']['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](saveUpdates(_0x3f4518[_0xdedd('0x59')],null))[_0xdedd('0x1f')](function(_0x1c360d){if(_0x1c360d){_0x48fcce['message']=_0x1c360d[_0xdedd('0x64')]({'plain':!![]});return db[_0xdedd('0x65')][_0xdedd('0x56')]({'where':{'id':_0x1c360d[_0xdedd('0x66')]}});}return null;})[_0xdedd('0x1f')](handleEntityNotFound(_0x5daa53,null))[_0xdedd('0x1f')](function(_0x52ba38){if(_0x52ba38){return _0x52ba38[_0xdedd('0x58')]({'UserId':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'read1stAt':_[_0xdedd('0x67')](_0x52ba38['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdedd('0x1f')](function(_0x45c484){if(_0x45c484){_0x48fcce[_0xdedd('0x68')]=_0x45c484[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x69'),_0x3f4518[_0xdedd('0x62')]['id'],_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')],_0x3f4518['user'][_0xdedd('0x6a')],_0x48fcce[_0xdedd('0x68')]['id'],_0x3f4518[_0xdedd('0x59')]?JSON[_0xdedd('0x23')](_0x3f4518[_0xdedd('0x59')]):'null');return respondWithRpcPromise(_0xdedd('0x6b'),_0xdedd('0x6c'),_0x48fcce);}return null;})[_0xdedd('0x1f')](function(_0x3ad6de){var _0x188041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ad6de[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')][_0xdedd('0x41')](_0x188041,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})['then'](function(_0x2b69a5){return _0x2b69a5;});})[_0xdedd('0x1f')](function(_0x309bef){if(_0x309bef){_0x48fcce[_0xdedd('0x27')][_0xdedd('0x71')]=_0x309bef[0x0];if(!_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')])return;return db[_0xdedd('0x72')]['find']({'where':{'id':_0x3f4518[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x2002f7){if(!_0x2002f7)return null;_0x48fcce[_0xdedd('0x27')]['agent']=_0x2002f7;return _0x48fcce;})[_0xdedd('0x1f')](function(_0x1d0dcd){if(_0x1d0dcd){if(_0x3f4518[_0xdedd('0x59')]['manual']){_0x48fcce['message'][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x3f4518[_0xdedd('0x62')][_0xdedd('0x38')]);_0x48fcce['message']['channel']=_0x48fcce['channel'];_0x48fcce[_0xdedd('0x27')]['motionChannel']=_0x48fcce[_0xdedd('0x78')];_0x48fcce[_0xdedd('0x27')][_0xdedd('0x79')]=_0xdedd('0x5d');return respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x7b'),'message':_['merge'](_0x48fcce[_0xdedd('0x27')],JSON[_0xdedd('0x7c')](_0x48fcce[_0xdedd('0x68')]['formData']))},client9002)['then'](function(){return _0x48fcce;});}return _0x48fcce;}return null;})[_0xdedd('0x1f')](respondWithResult(_0x5daa53,null))[_0xdedd('0x29')](handleError(_0x5daa53,null));};var interaction_log=require(_0xdedd('0x11'))(_0xdedd('0x5c'));exports['reject']=function(_0x1ad572,_0x21915f,_0x58445){var _0x472d73={'agent':{},'channel':'chat'};if(_0x1ad572[_0xdedd('0x59')]['id']){delete _0x1ad572[_0xdedd('0x59')]['id'];}_0x1ad572['body'][_0xdedd('0x61')]=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')]||_0x1ad572[_0xdedd('0x62')]['id'];_0x472d73['agent']['id']=_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')];return db[_0xdedd('0x3c')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x5a')]['id'],'UserId':null}})[_0xdedd('0x1f')](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x32d865){if(_0x32d865){_0x472d73[_0xdedd('0x27')]=_0x32d865['get']({'plain':!![]});return db[_0xdedd('0x65')]['find']({'where':{'id':_0x32d865[_0xdedd('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x21915f,null))[_0xdedd('0x1f')](function(_0x1ff0a1){if(_0x1ff0a1){_0x472d73['interaction']=_0x1ff0a1[_0xdedd('0x64')]({'plain':!![]});interaction_log[_0xdedd('0x20')](_0xdedd('0x7d'),_0x1ad572[_0xdedd('0x62')]['id'],_0x1ad572['user'][_0xdedd('0x38')],_0x1ad572[_0xdedd('0x62')][_0xdedd('0x6a')],_0x472d73[_0xdedd('0x68')]['id'],_0x1ad572['body']?JSON[_0xdedd('0x23')](_0x1ad572['body']):_0xdedd('0x7e'));return respondWithRpcPromise(_0xdedd('0x7f'),_0xdedd('0x80'),_0x472d73);}return null;})[_0xdedd('0x1f')](function(_0x564f39){var _0x33e75f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x564f39[_0xdedd('0x27')]['ContactId'];return db[_0xdedd('0x6d')]['query'](_0x33e75f,{'type':db[_0xdedd('0x6e')][_0xdedd('0x6f')][_0xdedd('0x70')],'raw':!![]})[_0xdedd('0x1f')](function(_0x4ed250){return _0x4ed250;});})[_0xdedd('0x1f')](function(_0x25f6d0){if(_0x25f6d0){_0x472d73[_0xdedd('0x27')]['contact']=_0x25f6d0[0x0];if(!_0x1ad572['body'][_0xdedd('0x61')])return;return db[_0xdedd('0x72')][_0xdedd('0x56')]({'where':{'id':_0x1ad572[_0xdedd('0x59')][_0xdedd('0x61')],'role':_0xdedd('0x63')},'attributes':['id',_0xdedd('0x38'),_0xdedd('0x73'),_0xdedd('0x74'),'internal'],'raw':!![]});}return null;})[_0xdedd('0x1f')](function(_0x4a2267){if(!_0x4a2267)return null;_0x472d73[_0xdedd('0x27')][_0xdedd('0x63')]=_0x4a2267;return _0x472d73;})[_0xdedd('0x1f')](function(_0x5a34e3){if(_0x5a34e3){_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x75')]=util[_0xdedd('0x76')](_0xdedd('0x77'),_0x1ad572[_0xdedd('0x62')][_0xdedd('0x38')]);_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x78')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3[_0xdedd('0x27')][_0xdedd('0x81')]=_0x472d73[_0xdedd('0x78')];_0x5a34e3['message']['event']=_0xdedd('0x82');respondWithRpcPromise(_0xdedd('0x7a'),_0xdedd('0x7a'),{'event':_0xdedd('0x83'),'message':_[_0xdedd('0x4d')](_0x472d73[_0xdedd('0x27')],JSON['parse'](_0x472d73['interaction'][_0xdedd('0x84')]))},client9002);return _0x472d73;}return null;})['then'](respondWithResult(_0x21915f,null))[_0xdedd('0x29')](handleError(_0x21915f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index f32bea1..5c838b0 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 _0x6108=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x6108,0x126));var _0x8610=function(_0xb276c0,_0x116692){_0xb276c0=_0xb276c0-0x0;var _0x3b5a6f=_0x6108[_0xb276c0];return _0x3b5a6f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8610('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8610('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8610('0x2'),'afterDestroy':_0x8610('0x3')};function emitEvent(_0x454a13){return function(_0x57a33f,_0x59dc79,_0x3f3357){ChatMessageEvents[_0x8610('0x4')](_0x454a13+':'+_0x57a33f['id'],_0x57a33f);ChatMessageEvents[_0x8610('0x4')](_0x454a13,_0x57a33f);_0x3f3357(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatMessage[_0x8610('0x6')](e,emitEvent(event));}}module[_0x8610('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x83aa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x57a2be,_0x2900b6){var _0x7f99d3=function(_0x1732b4){while(--_0x1732b4){_0x57a2be['push'](_0x57a2be['shift']());}};_0x7f99d3(++_0x2900b6);}(_0x83aa,0xb3));var _0xa83a=function(_0x5ade89,_0x2a90b0){_0x5ade89=_0x5ade89-0x0;var _0x272f1f=_0x83aa[_0x5ade89];return _0x272f1f;};'use strict';var EventEmitter=require(_0xa83a('0x0'));var ChatMessage=require(_0xa83a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa83a('0x2')](0x0);var events={'afterCreate':_0xa83a('0x3'),'afterUpdate':_0xa83a('0x4'),'afterDestroy':_0xa83a('0x5')};function emitEvent(_0x2a6180){return function(_0x2e0ddd,_0x2c72fe,_0xce83d9){ChatMessageEvents['emit'](_0x2a6180+':'+_0x2e0ddd['id'],_0x2e0ddd);ChatMessageEvents[_0xa83a('0x6')](_0x2a6180,_0x2e0ddd);_0xce83d9(null);};}for(var e in events){if(events[_0xa83a('0x7')](e)){var event=events[e];ChatMessage[_0xa83a('0x8')](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 efa6672..593a053 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 _0xf05b=['fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf05b,0xbd));var _0xbf05=function(_0x458ad3,_0x1cc9fe){_0x458ad3=_0x458ad3-0x0;var _0x4f9c4d=_0xf05b[_0x458ad3];return _0x4f9c4d;};'use strict';var _=require(_0xbf05('0x0'));var util=require(_0xbf05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf05('0x2'));var BPromise=require(_0xbf05('0x3'));var rp=require(_0xbf05('0x4'));var fs=require('fs');var path=require(_0xbf05('0x5'));var rimraf=require(_0xbf05('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x3f9c35,_0x3a6f09){return _0x3f9c35[_0xbf05('0x9')]('ChatMessage',attributes,{'tableName':_0xbf05('0xa'),'paranoid':![],'indexes':[{'name':_0xbf05('0xb'),'fields':['body'],'type':_0xbf05('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403655,_0x3da244,_0x5b143c){var _0x1b108c=_0x3f9c35[_0xbf05('0xd')];var _0x381f8c=_0x403655['get']({'plain':!![]});if(_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()==='in'||_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()===_0xbf05('0x10')&&!_0x381f8c[_0xbf05('0x11')]&&!_['isNil'](_0x381f8c['UserId'])){_0x1b108c['ChatInteraction']['findOne']({'where':{'id':_0x381f8c[_0xbf05('0x12')]}})[_0xbf05('0x13')](function(_0x194a9c){if(_0x194a9c){_0x194a9c[_0xbf05('0x14')]({'lastMsgAt':_0x381f8c[_0xbf05('0x15')],'lastMsgDirection':_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()});}})[_0xbf05('0x16')](function(_0x15ed51){console['error'](_0x15ed51);});}_0x5b143c();}},'charset':_0xbf05('0x17'),'collate':_0xbf05('0x18')});};
\ No newline at end of file
+var _0xe131=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe131,0x1b5));var _0x1e13=function(_0x496763,_0x43c2e1){_0x496763=_0x496763-0x0;var _0x19b652=_0xe131[_0x496763];return _0x19b652;};'use strict';var _=require(_0x1e13('0x0'));var util=require(_0x1e13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e13('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e13('0x3'));var fs=require('fs');var path=require(_0x1e13('0x4'));var rimraf=require(_0x1e13('0x5'));var config=require(_0x1e13('0x6'));var attributes=require(_0x1e13('0x7'));module[_0x1e13('0x8')]=function(_0x440239,_0x3ec2e6){return _0x440239[_0x1e13('0x9')](_0x1e13('0xa'),attributes,{'tableName':_0x1e13('0xb'),'paranoid':![],'indexes':[{'name':_0x1e13('0xc'),'fields':[_0x1e13('0xd')],'type':_0x1e13('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1569f3,_0x528329,_0x1012f4){var _0x39e8f1=_0x440239['models'];var _0x523f28=_0x1569f3[_0x1e13('0xf')]({'plain':!![]});if(_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()==='in'||_0x523f28['direction'][_0x1e13('0x11')]()==='out'&&!_0x523f28[_0x1e13('0x12')]&&!_[_0x1e13('0x13')](_0x523f28['UserId'])){_0x39e8f1[_0x1e13('0x14')][_0x1e13('0x15')]({'where':{'id':_0x523f28['ChatInteractionId']}})[_0x1e13('0x16')](function(_0x2cc3d0){if(_0x2cc3d0){_0x2cc3d0[_0x1e13('0x17')]({'lastMsgAt':_0x523f28['createdAt'],'lastMsgDirection':_0x523f28[_0x1e13('0x10')][_0x1e13('0x11')]()});}})[_0x1e13('0x18')](function(_0x164aa8){console[_0x1e13('0x19')](_0x164aa8);});}_0x1012f4();}},'charset':_0x1e13('0x1a'),'collate':_0x1e13('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 869d1db..68b44e4 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 _0x9f02=['register','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9f02,0x68));var _0x29f0=function(_0x4f7efa,_0x299b08){_0x4f7efa=_0x4f7efa-0x0;var _0x33d69d=_0x9f02[_0x4f7efa];return _0x33d69d;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['ChatMessage'][_0x29f0('0x18')](_0xf7da2e[_0x29f0('0x19')],{'raw':_0xf7da2e[_0x29f0('0x1a')]?_0xf7da2e['options'][_0x29f0('0x1b')]===undefined?!![]:![]:!![]})[_0x29f0('0x1c')](function(_0x23e691){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger['debug'](_0x29f0('0x17'),_0xf7da2e,JSON[_0x29f0('0x10')](_0x23e691));_0x5a4579(_0x23e691);})[_0x29f0('0x16')](function(_0x3d9a49){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x3d9a49[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x3d9a49[_0x29f0('0x14')]));});});};
\ No newline at end of file
+var _0xe0b0=['localhost','socket.io-emitter','redis','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','then','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x5a4bf4,_0x574d36){var _0x4187e8=function(_0x4532b4){while(--_0x4532b4){_0x5a4bf4['push'](_0x5a4bf4['shift']());}};_0x4187e8(++_0x574d36);}(_0xe0b0,0x70));var _0x0e0b=function(_0x5bc683,_0x23fab6){_0x5bc683=_0x5bc683-0x0;var _0x10b119=_0xe0b0[_0x5bc683];return _0x10b119;};'use strict';var _=require(_0x0e0b('0x0'));var util=require(_0x0e0b('0x1'));var moment=require(_0x0e0b('0x2'));var BPromise=require(_0x0e0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e0b('0x4'));var db=require(_0x0e0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e0b('0x6'));var config=require(_0x0e0b('0x7'));var jayson=require(_0x0e0b('0x8'));var client=jayson[_0x0e0b('0x9')][_0x0e0b('0xa')]({'port':0x232a});config['redis']=_[_0x0e0b('0xb')](config['redis'],{'host':_0x0e0b('0xc'),'port':0x18eb});var socket=require(_0x0e0b('0xd'))(new Redis(config[_0x0e0b('0xe')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2fcc75,_0x3d7e51,_0x41f7fa){return new BPromise(function(_0x330756,_0x4d2157){return client['request'](_0x2fcc75,_0x41f7fa)['then'](function(_0x18019a){logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));logger['debug'](_0x0e0b('0x12'),_0x3d7e51,_0x0e0b('0x11'),JSON[_0x0e0b('0x13')](_0x18019a));if(_0x18019a[_0x0e0b('0x14')]){if(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x15')]===0x1f4){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x18019a['error'][_0x0e0b('0x16')]);return _0x4d2157(_0x18019a[_0x0e0b('0x14')][_0x0e0b('0x16')]);}logger[_0x0e0b('0x14')](_0x0e0b('0x10'),_0x3d7e51,_0x18019a['error']['message']);return _0x330756(_0x18019a[_0x0e0b('0x14')]['message']);}else{logger[_0x0e0b('0xf')](_0x0e0b('0x10'),_0x3d7e51,_0x0e0b('0x11'));_0x330756(_0x18019a[_0x0e0b('0x17')][_0x0e0b('0x16')]);}})[_0x0e0b('0x18')](function(_0x3f665b){logger[_0x0e0b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3d7e51,_0x3f665b);_0x4d2157(_0x3f665b);});});}exports['CreateChatMessage']=function(_0x28747a){var _0x435951=this;return new Promise(function(_0x2a3d0b,_0x3d7341){return db['ChatMessage'][_0x0e0b('0x19')](_0x28747a[_0x0e0b('0x1a')],{'raw':_0x28747a[_0x0e0b('0x1b')]?_0x28747a[_0x0e0b('0x1b')][_0x0e0b('0x1c')]===undefined?!![]:![]:!![]})[_0x0e0b('0x1d')](function(_0x9adbce){logger[_0x0e0b('0xf')](_0x0e0b('0x1e'),_0x28747a);logger['debug'](_0x0e0b('0x1e'),_0x28747a,JSON['stringify'](_0x9adbce));_0x2a3d0b(_0x9adbce);})[_0x0e0b('0x18')](function(_0x2171a6){logger[_0x0e0b('0x14')](_0x0e0b('0x1e'),_0x2171a6['message'],_0x28747a);_0x3d7341(_0x435951[_0x0e0b('0x14')](0x1f4,_0x2171a6[_0x0e0b('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8f58316..10f51e1 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 _0x5183=['./chatMessage.events','save','remove','emit','register','chatMessage:'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5183,0x13e));var _0x3518=function(_0x237b0d,_0x2a940c){_0x237b0d=_0x237b0d-0x0;var _0x1b0713=_0x5183[_0x237b0d];return _0x1b0713;};'use strict';var ChatMessageEvents=require(_0x3518('0x0'));var events=[_0x3518('0x1'),_0x3518('0x2'),'update'];function createListener(_0x5b6958,_0x2323f3){return function(_0x3cc276){_0x2323f3[_0x3518('0x3')](_0x5b6958,_0x3cc276);};}function removeListener(_0x421ab5,_0x5a38df){return function(){ChatMessageEvents['removeListener'](_0x421ab5,_0x5a38df);};}exports[_0x3518('0x4')]=function(_0x1031a9){for(var _0x2c019c=0x0,_0x482b2d=events['length'];_0x2c019c<_0x482b2d;_0x2c019c++){var _0x488c52=events[_0x2c019c];var _0x147b59=createListener(_0x3518('0x5')+_0x488c52,_0x1031a9);ChatMessageEvents['on'](_0x488c52,_0x147b59);}};
\ No newline at end of file
+var _0x2e88=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x4de2c5,_0x21aeb7){var _0x4ef52b=function(_0x5e52f4){while(--_0x5e52f4){_0x4de2c5['push'](_0x4de2c5['shift']());}};_0x4ef52b(++_0x21aeb7);}(_0x2e88,0x95));var _0x82e8=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x2e88[_0x5948dd];return _0xb1f8be;};'use strict';var ChatMessageEvents=require(_0x82e8('0x0'));var events=[_0x82e8('0x1'),_0x82e8('0x2'),_0x82e8('0x3')];function createListener(_0x9dd860,_0x46c27f){return function(_0x552153){_0x46c27f[_0x82e8('0x4')](_0x9dd860,_0x552153);};}function removeListener(_0x1d7415,_0x576435){return function(){ChatMessageEvents[_0x82e8('0x5')](_0x1d7415,_0x576435);};}exports[_0x82e8('0x6')]=function(_0x4e909a){for(var _0x3162d1=0x0,_0x1e2496=events[_0x82e8('0x7')];_0x3162d1<_0x1e2496;_0x3162d1++){var _0x27df44=events[_0x3162d1];var _0x393c2c=createListener(_0x82e8('0x8')+_0x27df44,_0x4e909a);ChatMessageEvents['on'](_0x27df44,_0x393c2c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4ec6272..0324787 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 _0x79b3=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x3aa4a8,_0x53044f){var _0x3968d7=function(_0x38faaf){while(--_0x38faaf){_0x3aa4a8['push'](_0x3aa4a8['shift']());}};_0x3968d7(++_0x53044f);}(_0x79b3,0xb7));var _0x379b=function(_0x1b7623,_0x5460c4){_0x1b7623=_0x1b7623-0x0;var _0xe2d267=_0x79b3[_0x1b7623];return _0xe2d267;};'use strict';var multer=require(_0x379b('0x0'));var util=require(_0x379b('0x1'));var path=require(_0x379b('0x2'));var timeout=require(_0x379b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x379b('0x4'));var auth=require(_0x379b('0x5'));var interaction=require(_0x379b('0x6'));var config=require('../../config/environment');var controller=require(_0x379b('0x7'));router[_0x379b('0x8')]('/',auth[_0x379b('0x9')](),controller['index']);router[_0x379b('0x8')]('/describe',auth[_0x379b('0x9')](),controller[_0x379b('0xa')]);router[_0x379b('0x8')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller[_0x379b('0xc')]);router[_0x379b('0xd')]('/',auth[_0x379b('0x9')](),interaction[_0x379b('0xe')](_0x379b('0xf'),_0x379b('0x10')),controller[_0x379b('0x11')]);router['put']('/:id',controller[_0x379b('0x12')]);router['put'](_0x379b('0x13'),auth[_0x379b('0x9')](),controller[_0x379b('0x14')]);router[_0x379b('0x15')](_0x379b('0x16'),auth[_0x379b('0x9')](),controller[_0x379b('0x17')]);router[_0x379b('0x18')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller['destroy']);module[_0x379b('0x19')]=router;
\ No newline at end of file
+var _0x88ae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','put','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x27ba9c,_0x27a4b3){var _0xca605c=function(_0xb172bd){while(--_0xb172bd){_0x27ba9c['push'](_0x27ba9c['shift']());}};_0xca605c(++_0x27a4b3);}(_0x88ae,0xe5));var _0xe88a=function(_0x287cac,_0xb41eef){_0x287cac=_0x287cac-0x0;var _0x3dcd41=_0x88ae[_0x287cac];return _0x3dcd41;};'use strict';var multer=require('multer');var util=require(_0xe88a('0x0'));var path=require(_0xe88a('0x1'));var timeout=require(_0xe88a('0x2'));var express=require(_0xe88a('0x3'));var router=express['Router']();var fs_extra=require(_0xe88a('0x4'));var auth=require(_0xe88a('0x5'));var interaction=require(_0xe88a('0x6'));var config=require(_0xe88a('0x7'));var controller=require(_0xe88a('0x8'));router['get']('/',auth[_0xe88a('0x9')](),controller[_0xe88a('0xa')]);router[_0xe88a('0xb')](_0xe88a('0xc'),auth[_0xe88a('0x9')](),controller[_0xe88a('0xd')]);router['get'](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0xf')]);router[_0xe88a('0x10')]('/',auth[_0xe88a('0x9')](),interaction['tracked'](_0xe88a('0x11'),_0xe88a('0x12')),controller['create']);router[_0xe88a('0x13')](_0xe88a('0xe'),controller['update']);router[_0xe88a('0x13')]('/:id/accept',auth[_0xe88a('0x9')](),controller[_0xe88a('0x14')]);router['put'](_0xe88a('0x15'),auth[_0xe88a('0x9')](),controller[_0xe88a('0x16')]);router[_0xe88a('0x17')](_0xe88a('0xe'),auth['isAuthenticated'](),controller[_0xe88a('0x18')]);module[_0xe88a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8951594..7310dee 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(_0x3f3e83,_0x425bc0){var _0x560422=function(_0x4f78ea){while(--_0x4f78ea){_0x3f3e83['push'](_0x3f3e83['shift']());}};_0x560422(++_0x425bc0);}(_0xb10b,0x12a));var _0xbb10=function(_0x4336a6,_0xc235ca){_0x4336a6=_0x4336a6-0x0;var _0x4012f3=_0xb10b[_0x4336a6];return _0x4012f3;};'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 _0x5f66=['medium','TEXT','exports'];(function(_0x2b8fa9,_0x296276){var _0x2583db=function(_0x2270e4){while(--_0x2270e4){_0x2b8fa9['push'](_0x2b8fa9['shift']());}};_0x2583db(++_0x296276);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c0ee6f8..deb6ef8 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0xc80b7f,_0x2a8c83){_0xc80b7f=_0xc80b7f-0x0;var _0x1ab2cb=_0x7a54[_0xc80b7f];return _0x1ab2cb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x7a54,0x106));var _0x47a5=function(_0x2cc64e,_0x9ba4ba){_0x2cc64e=_0x2cc64e-0x0;var _0x3e0080=_0x7a54[_0x2cc64e];return _0x3e0080;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index df290a2..7d5de13 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 _0x293a=['ChatOfflineMessage','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20711e,_0x5b61c9){var _0x173e7f=function(_0x4eabdc){while(--_0x4eabdc){_0x20711e['push'](_0x20711e['shift']());}};_0x173e7f(++_0x5b61c9);}(_0x293a,0xa6));var _0xa293=function(_0x51af8c,_0x7ae22f){_0x51af8c=_0x51af8c-0x0;var _0x170551=_0x293a[_0x51af8c];return _0x170551;};'use strict';var EventEmitter=require(_0xa293('0x0'));var ChatOfflineMessage=require(_0xa293('0x1'))['db'][_0xa293('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa293('0x3'),'afterDestroy':_0xa293('0x4')};function emitEvent(_0x1a971f){return function(_0x1bb168,_0x406ec1,_0x2626cf){ChatOfflineMessageEvents[_0xa293('0x5')](_0x1a971f+':'+_0x1bb168['id'],_0x1bb168);ChatOfflineMessageEvents['emit'](_0x1a971f,_0x1bb168);_0x2626cf(null);};}for(var e in events){if(events[_0xa293('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xa293('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe29d=['events','../../mysqldb','ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x283152,_0x468a35){var _0x6cb80d=function(_0x17598a){while(--_0x17598a){_0x283152['push'](_0x283152['shift']());}};_0x6cb80d(++_0x468a35);}(_0xe29d,0x1a7));var _0xde29=function(_0x256fb0,_0x3cb5ab){_0x256fb0=_0x256fb0-0x0;var _0x80bcdd=_0xe29d[_0x256fb0];return _0x80bcdd;};'use strict';var EventEmitter=require(_0xde29('0x0'));var ChatOfflineMessage=require(_0xde29('0x1'))['db'][_0xde29('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde29('0x3'),'afterUpdate':'update','afterDestroy':_0xde29('0x4')};function emitEvent(_0x12cc24){return function(_0x40c756,_0x478b2a,_0xef43d5){ChatOfflineMessageEvents['emit'](_0x12cc24+':'+_0x40c756['id'],_0x40c756);ChatOfflineMessageEvents[_0xde29('0x5')](_0x12cc24,_0x40c756);_0xef43d5(null);};}for(var e in events){if(events[_0xde29('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xde29('0x7')](e,emitEvent(event));}}module[_0xde29('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 18ab773..2eac1a9 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 _0x3e82=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x6e8056,_0x786ea0){var _0x5c7a56=function(_0xa43aa5){while(--_0xa43aa5){_0x6e8056['push'](_0x6e8056['shift']());}};_0x5c7a56(++_0x786ea0);}(_0x3e82,0x147));var _0x23e8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e82[_0x40a045];return _0x1a687c;};'use strict';var attributes=require(_0x23e8('0x0'));module['exports']=function(_0x48a682){return _0x48a682[_0x23e8('0x1')](_0x23e8('0x2'),attributes,{'tableName':_0x23e8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x23e8('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xadd6=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x26cee6,_0x4794c6){var _0x54c1a1=function(_0x3ec1d9){while(--_0x3ec1d9){_0x26cee6['push'](_0x26cee6['shift']());}};_0x54c1a1(++_0x4794c6);}(_0xadd6,0xcf));var _0x6add=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xadd6[_0x1a0ef3];return _0x2b86da;};'use strict';var attributes=require(_0x6add('0x0'));module['exports']=function(_0x1c7655){return _0x1c7655['define'](_0x6add('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6add('0x2'),'collate':_0x6add('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 2426662..fa1595e 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 _0xc507=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5aedb2,_0x41d9d5){var _0x4010a1=function(_0x233e99){while(--_0x233e99){_0x5aedb2['push'](_0x5aedb2['shift']());}};_0x4010a1(++_0x41d9d5);}(_0xc507,0x73));var _0x7c50=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0xc507[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var moment=require(_0x7c50('0x2'));var BPromise=require(_0x7c50('0x3'));var rs=require(_0x7c50('0x4'));var fs=require('fs');var Redis=require(_0x7c50('0x5'));var db=require(_0x7c50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c50('0x7'))(_0x7c50('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c50('0x9'));var client=jayson[_0x7c50('0xa')][_0x7c50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eda30,_0x1ace0d,_0x815f20){return new BPromise(function(_0x5efd32,_0x909310){return client[_0x7c50('0xc')](_0x2eda30,_0x815f20)[_0x7c50('0xd')](function(_0x1df00b){logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));logger[_0x7c50('0x11')](_0x7c50('0x12'),_0x1ace0d,'request\x20sent',JSON[_0x7c50('0x13')](_0x1df00b));if(_0x1df00b[_0x7c50('0x14')]){if(_0x1df00b[_0x7c50('0x14')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);return _0x909310(_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);}logger[_0x7c50('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b['error'][_0x7c50('0x15')]);return _0x5efd32(_0x1df00b['error']['message']);}else{logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));_0x5efd32(_0x1df00b[_0x7c50('0x16')][_0x7c50('0x15')]);}})[_0x7c50('0x17')](function(_0x2515d7){logger[_0x7c50('0x14')](_0x7c50('0xf'),_0x1ace0d,_0x2515d7);_0x909310(_0x2515d7);});});}
\ No newline at end of file
+var _0x6f0d=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x11cba0,_0x310f52){var _0xe00153=function(_0x589b86){while(--_0x589b86){_0x11cba0['push'](_0x11cba0['shift']());}};_0xe00153(++_0x310f52);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x560625,_0x7407e3){_0x560625=_0x560625-0x0;var _0x57db60=_0x6f0d[_0x560625];return _0x57db60;};'use strict';var _=require(_0xd6f0('0x0'));var util=require('util');var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8b2,_0x2ba1b2,_0x289bc6){return new BPromise(function(_0x272022,_0x16f3c4){return client[_0xd6f0('0xa')](_0x1cf8b2,_0x289bc6)[_0xd6f0('0xb')](function(_0x4b8c2b){logger[_0xd6f0('0xc')](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));logger[_0xd6f0('0xf')](_0xd6f0('0x10'),_0x2ba1b2,'request\x20sent',JSON['stringify'](_0x4b8c2b));if(_0x4b8c2b[_0xd6f0('0x11')]){if(_0x4b8c2b['error'][_0xd6f0('0x12')]===0x1f4){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x16f3c4(_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);}logger[_0xd6f0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2ba1b2,_0x4b8c2b[_0xd6f0('0x11')][_0xd6f0('0x13')]);return _0x272022(_0x4b8c2b['error'][_0xd6f0('0x13')]);}else{logger['info'](_0xd6f0('0xd'),_0x2ba1b2,_0xd6f0('0xe'));_0x272022(_0x4b8c2b['result'][_0xd6f0('0x13')]);}})[_0xd6f0('0x14')](function(_0x4b17c2){logger[_0xd6f0('0x11')](_0xd6f0('0xd'),_0x2ba1b2,_0x4b17c2);_0x16f3c4(_0x4b17c2);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 679917c..95a8370 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 _0x854f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','exports'];(function(_0x3fd26c,_0x29e6d1){var _0x8b7bbe=function(_0x3217be){while(--_0x3217be){_0x3fd26c['push'](_0x3fd26c['shift']());}};_0x8b7bbe(++_0x29e6d1);}(_0x854f,0x108));var _0xf854=function(_0x52dfcf,_0x26e802){_0x52dfcf=_0x52dfcf-0x0;var _0x4d89cf=_0x854f[_0x52dfcf];return _0x4d89cf;};'use strict';var multer=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var path=require(_0xf854('0x2'));var timeout=require(_0xf854('0x3'));var express=require(_0xf854('0x4'));var router=express[_0xf854('0x5')]();var fs_extra=require(_0xf854('0x6'));var auth=require(_0xf854('0x7'));var interaction=require(_0xf854('0x8'));var config=require(_0xf854('0x9'));var controller=require(_0xf854('0xa'));router[_0xf854('0xb')]('/',auth[_0xf854('0xc')](),controller[_0xf854('0xd')]);router[_0xf854('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf854('0xe')]);router[_0xf854('0xb')](_0xf854('0xf'),auth['isAuthenticated'](),controller[_0xf854('0x10')]);router[_0xf854('0x11')]('/',auth['isAuthenticated'](),controller[_0xf854('0x12')]);router['put'](_0xf854('0xf'),auth[_0xf854('0xc')](),controller[_0xf854('0x13')]);router[_0xf854('0x14')](_0xf854('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf854('0x15')]=router;
\ No newline at end of file
+var _0x8274=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8274,0x1df));var _0x4827=function(_0x22dc35,_0x37b6ed){_0x22dc35=_0x22dc35-0x0;var _0x17dcf4=_0x8274[_0x22dc35];return _0x17dcf4;};'use strict';var multer=require(_0x4827('0x0'));var util=require(_0x4827('0x1'));var path=require('path');var timeout=require(_0x4827('0x2'));var express=require(_0x4827('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4827('0x4'));var interaction=require(_0x4827('0x5'));var config=require(_0x4827('0x6'));var controller=require(_0x4827('0x7'));router[_0x4827('0x8')]('/',auth[_0x4827('0x9')](),controller[_0x4827('0xa')]);router['get'](_0x4827('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4827('0x8')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0xd')]);router[_0x4827('0xe')]('/',auth['isAuthenticated'](),controller[_0x4827('0xf')]);router[_0x4827('0x10')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x11')]);router[_0x4827('0x12')](_0x4827('0xc'),auth[_0x4827('0x9')](),controller[_0x4827('0x13')]);module[_0x4827('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 9f2c95e..cf95d18 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 _0x7e34=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x160393,_0x4e2ea7){var _0x39865d=function(_0x14362b){while(--_0x14362b){_0x160393['push'](_0x160393['shift']());}};_0x39865d(++_0x4e2ea7);}(_0x7e34,0xb7));var _0x47e3=function(_0x5f1413,_0x4eace2){_0x5f1413=_0x5f1413-0x0;var _0x216666=_0x7e34[_0x5f1413];return _0x216666;};'use strict';var Sequelize=require(_0x47e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x47e3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x47e3('0x2')](_0x47e3('0x3'),_0x47e3('0x4')),'defaultValue':_0x47e3('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x47e3('0x5')]}};
\ No newline at end of file
+var _0x2e9c=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x1cf7af,_0x50f213){var _0x1b8088=function(_0x127b9e){while(--_0x127b9e){_0x1cf7af['push'](_0x1cf7af['shift']());}};_0x1b8088(++_0x50f213);}(_0x2e9c,0xfd));var _0xc2e9=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2e9c[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0xc2e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xc2e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc2e9('0x2')]('mouseOver','timeout'),'defaultValue':_0xc2e9('0x3')},'selector':{'type':Sequelize[_0xc2e9('0x1')]},'timeout':{'type':Sequelize[_0xc2e9('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 6569b43..c802241 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 _0x59c3=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','filters','intersection','query','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x59c3,0x133));var _0x359c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x59c3[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x359c('0x0'));var rimraf=require(_0x359c('0x1'));var zipdir=require(_0x359c('0x2'));var jsonpatch=require(_0x359c('0x3'));var rp=require(_0x359c('0x4'));var moment=require(_0x359c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require('squel');var crypto=require(_0x359c('0xd'));var jsforce=require(_0x359c('0xe'));var deskjs=require(_0x359c('0xf'));var toCsv=require(_0x359c('0xa'));var querystring=require('querystring');var Papa=require(_0x359c('0x10'));var Redis=require('ioredis');var authService=require(_0x359c('0x11'));var qs=require(_0x359c('0x12'));var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require('../../config/utils');var config=require(_0x359c('0x17'));var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x18fab2,_0x1d4d8a){_0x1d4d8a=_0x1d4d8a||0xcc;return function(_0x29d295){if(_0x29d295){return _0x18fab2[_0x359c('0x1a')](_0x1d4d8a);}return _0x18fab2[_0x359c('0x1b')](_0x1d4d8a)[_0x359c('0x1c')]();};}function respondWithResult(_0x4413ce,_0x2cf668){_0x2cf668=_0x2cf668||0xc8;return function(_0xd07946){if(_0xd07946){return _0x4413ce['status'](_0x2cf668)[_0x359c('0x1d')](_0xd07946);}};}function respondWithFilteredResult(_0x1901cc,_0x4d4860){return function(_0x80b8d8){if(_0x80b8d8){var _0x186e45=typeof _0x4d4860[_0x359c('0x1e')]===_0x359c('0x1f')&&typeof _0x4d4860[_0x359c('0x20')]===_0x359c('0x1f');var _0x42d3b5=_0x80b8d8[_0x359c('0x21')];var _0x2931eb=_0x186e45?0x0:_0x4d4860[_0x359c('0x1e')];var _0x2bdd3c=_0x186e45?_0x80b8d8[_0x359c('0x21')]:_0x4d4860[_0x359c('0x1e')]+_0x4d4860[_0x359c('0x20')];var _0x19d0da;if(_0x2bdd3c>=_0x42d3b5){_0x2bdd3c=_0x42d3b5;_0x19d0da=0xc8;}else{_0x19d0da=0xce;}_0x1901cc[_0x359c('0x1b')](_0x19d0da);return _0x1901cc[_0x359c('0x22')](_0x359c('0x23'),_0x2931eb+'-'+_0x2bdd3c+'/'+_0x42d3b5)['json'](_0x80b8d8);}return null;};}function patchUpdates(_0x395ef8){return function(_0x5b305b){try{jsonpatch[_0x359c('0x24')](_0x5b305b,_0x395ef8,!![]);}catch(_0x5df429){return BPromise[_0x359c('0x25')](_0x5df429);}return _0x5b305b[_0x359c('0x26')]();};}function saveUpdates(_0x34f747,_0x402114){return function(_0x6e731c){if(_0x6e731c){return _0x6e731c[_0x359c('0x27')](_0x34f747)[_0x359c('0x28')](function(_0x1fe73f){return _0x1fe73f;});}return null;};}function removeEntity(_0x15b7c7,_0x1d29df){return function(_0x3e9cdf){if(_0x3e9cdf){return _0x3e9cdf[_0x359c('0x29')]()[_0x359c('0x28')](function(){_0x15b7c7[_0x359c('0x1b')](0xcc)[_0x359c('0x1c')]();});}};}function handleEntityNotFound(_0xf6f24,_0x4fbc28){return function(_0xf0770b){if(!_0xf0770b){_0xf6f24[_0x359c('0x1a')](0x194);}return _0xf0770b;};}function handleError(_0x35569d,_0x540fc9){_0x540fc9=_0x540fc9||0x1f4;return function(_0x1436a8){logger[_0x359c('0x2a')](_0x1436a8[_0x359c('0x2b')]);if(_0x1436a8['name']){delete _0x1436a8[_0x359c('0x2c')];}_0x35569d['status'](_0x540fc9)[_0x359c('0x2d')](_0x1436a8);};}exports[_0x359c('0x2e')]=function(_0x1d52ac,_0x31d65c){var _0x512fc0={'raw':!![],'where':{'id':_0x1d52ac[_0x359c('0x2f')]['id']}},_0x2e42f6={};_0x2e42f6[_0x359c('0x30')]=_[_0x359c('0x31')](db[_0x359c('0x32')][_0x359c('0x33')]);_0x2e42f6['query']=_['keys'](_0x1d52ac['query']);_0x2e42f6[_0x359c('0x34')]=_[_0x359c('0x35')](_0x2e42f6['model'],_0x2e42f6[_0x359c('0x36')]);_0x512fc0[_0x359c('0x37')]=_[_0x359c('0x35')](_0x2e42f6[_0x359c('0x30')],qs[_0x359c('0x38')](_0x1d52ac['query'][_0x359c('0x38')]));_0x512fc0[_0x359c('0x37')]=_0x512fc0[_0x359c('0x37')]['length']?_0x512fc0['attributes']:_0x2e42f6['model'];if(_0x1d52ac[_0x359c('0x36')][_0x359c('0x39')]){_0x512fc0['include']=[{'all':!![]}];}_0x512fc0=_[_0x359c('0x3a')]({},_0x512fc0,_0x1d52ac[_0x359c('0x3b')]);return db[_0x359c('0x32')][_0x359c('0x3c')](_0x512fc0)[_0x359c('0x28')](handleEntityNotFound(_0x31d65c,null))[_0x359c('0x28')](respondWithResult(_0x31d65c,null))['catch'](handleError(_0x31d65c,null));};exports[_0x359c('0x3d')]=function(_0x326baa,_0xc2f4b6){return db[_0x359c('0x32')][_0x359c('0x3d')](_0x326baa[_0x359c('0x3e')],{})['then'](respondWithResult(_0xc2f4b6,0xc9))[_0x359c('0x3f')](handleError(_0xc2f4b6,null));};exports['update']=function(_0x5366e0,_0x1cf3f8){if(_0x5366e0[_0x359c('0x3e')]['id']){delete _0x5366e0['body']['id'];}return db[_0x359c('0x32')][_0x359c('0x3c')]({'where':{'id':_0x5366e0[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x1cf3f8,null))['then'](saveUpdates(_0x5366e0[_0x359c('0x3e')],null))[_0x359c('0x28')](respondWithResult(_0x1cf3f8,null))[_0x359c('0x3f')](handleError(_0x1cf3f8,null));};exports['destroy']=function(_0x16ff10,_0x56d973){return db[_0x359c('0x32')]['find']({'where':{'id':_0x16ff10[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x56d973,null))['then'](removeEntity(_0x56d973,null))['catch'](handleError(_0x56d973,null));};
\ No newline at end of file
+var _0x61b8=['query','filters','intersection','attributes','includeAll','include','options','ChatProactiveAction','then','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','params','model','rawAttributes','keys'];(function(_0x1d68e1,_0x241674){var _0x2696aa=function(_0x13fddd){while(--_0x13fddd){_0x1d68e1['push'](_0x1d68e1['shift']());}};_0x2696aa(++_0x241674);}(_0x61b8,0x169));var _0x861b=function(_0x1bbe1d,_0x517125){_0x1bbe1d=_0x1bbe1d-0x0;var _0x508012=_0x61b8[_0x1bbe1d];return _0x508012;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x861b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x861b('0x4'));var util=require(_0x861b('0x5'));var path=require(_0x861b('0x6'));var sox=require('sox');var csv=require(_0x861b('0x7'));var ejs=require(_0x861b('0x8'));var fs=require('fs');var fs_extra=require(_0x861b('0x9'));var _=require(_0x861b('0xa'));var squel=require(_0x861b('0xb'));var crypto=require(_0x861b('0xc'));var jsforce=require(_0x861b('0xd'));var deskjs=require(_0x861b('0xe'));var toCsv=require(_0x861b('0x7'));var querystring=require(_0x861b('0xf'));var Papa=require(_0x861b('0x10'));var Redis=require('ioredis');var authService=require(_0x861b('0x11'));var qs=require(_0x861b('0x12'));var as=require(_0x861b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x861b('0x14'))('api');var utils=require(_0x861b('0x15'));var config=require(_0x861b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x861b('0x17'))['db'];function respondWithStatusCode(_0x16eb59,_0x125345){_0x125345=_0x125345||0xcc;return function(_0x23c3db){if(_0x23c3db){return _0x16eb59[_0x861b('0x18')](_0x125345);}return _0x16eb59[_0x861b('0x19')](_0x125345)[_0x861b('0x1a')]();};}function respondWithResult(_0x21c585,_0x44b444){_0x44b444=_0x44b444||0xc8;return function(_0x226ee9){if(_0x226ee9){return _0x21c585[_0x861b('0x19')](_0x44b444)[_0x861b('0x1b')](_0x226ee9);}};}function respondWithFilteredResult(_0x264ba1,_0x3ee3ab){return function(_0x437bbd){if(_0x437bbd){var _0x3dbd5e=typeof _0x3ee3ab['offset']===_0x861b('0x1c')&&typeof _0x3ee3ab['limit']==='undefined';var _0x3d828f=_0x437bbd['count'];var _0x1b3d5c=_0x3dbd5e?0x0:_0x3ee3ab[_0x861b('0x1d')];var _0x4aafa8=_0x3dbd5e?_0x437bbd[_0x861b('0x1e')]:_0x3ee3ab[_0x861b('0x1d')]+_0x3ee3ab[_0x861b('0x1f')];var _0x11a914;if(_0x4aafa8>=_0x3d828f){_0x4aafa8=_0x3d828f;_0x11a914=0xc8;}else{_0x11a914=0xce;}_0x264ba1['status'](_0x11a914);return _0x264ba1['set'](_0x861b('0x20'),_0x1b3d5c+'-'+_0x4aafa8+'/'+_0x3d828f)[_0x861b('0x1b')](_0x437bbd);}return null;};}function patchUpdates(_0x20422f){return function(_0x4e76a3){try{jsonpatch[_0x861b('0x21')](_0x4e76a3,_0x20422f,!![]);}catch(_0x4dab89){return BPromise[_0x861b('0x22')](_0x4dab89);}return _0x4e76a3[_0x861b('0x23')]();};}function saveUpdates(_0x4af003,_0x4fd2b3){return function(_0x474f49){if(_0x474f49){return _0x474f49[_0x861b('0x24')](_0x4af003)['then'](function(_0x4e61cd){return _0x4e61cd;});}return null;};}function removeEntity(_0x24aed8,_0x47be04){return function(_0x5b91db){if(_0x5b91db){return _0x5b91db[_0x861b('0x25')]()['then'](function(){_0x24aed8['status'](0xcc)[_0x861b('0x1a')]();});}};}function handleEntityNotFound(_0x24d378,_0x22369c){return function(_0xb763e2){if(!_0xb763e2){_0x24d378[_0x861b('0x18')](0x194);}return _0xb763e2;};}function handleError(_0x58527c,_0x536c97){_0x536c97=_0x536c97||0x1f4;return function(_0x726496){logger[_0x861b('0x26')](_0x726496[_0x861b('0x27')]);if(_0x726496[_0x861b('0x28')]){delete _0x726496[_0x861b('0x28')];}_0x58527c[_0x861b('0x19')](_0x536c97)['send'](_0x726496);};}exports['show']=function(_0x3882a1,_0x3aeaf8){var _0x419259={'raw':!![],'where':{'id':_0x3882a1[_0x861b('0x29')]['id']}},_0x1fc11a={};_0x1fc11a[_0x861b('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x861b('0x2b')]);_0x1fc11a['query']=_[_0x861b('0x2c')](_0x3882a1[_0x861b('0x2d')]);_0x1fc11a[_0x861b('0x2e')]=_[_0x861b('0x2f')](_0x1fc11a[_0x861b('0x2a')],_0x1fc11a[_0x861b('0x2d')]);_0x419259[_0x861b('0x30')]=_[_0x861b('0x2f')](_0x1fc11a['model'],qs['fields'](_0x3882a1[_0x861b('0x2d')]['fields']));_0x419259[_0x861b('0x30')]=_0x419259[_0x861b('0x30')]['length']?_0x419259[_0x861b('0x30')]:_0x1fc11a['model'];if(_0x3882a1['query'][_0x861b('0x31')]){_0x419259[_0x861b('0x32')]=[{'all':!![]}];}_0x419259=_['merge']({},_0x419259,_0x3882a1[_0x861b('0x33')]);return db[_0x861b('0x34')]['find'](_0x419259)[_0x861b('0x35')](handleEntityNotFound(_0x3aeaf8,null))[_0x861b('0x35')](respondWithResult(_0x3aeaf8,null))['catch'](handleError(_0x3aeaf8,null));};exports[_0x861b('0x36')]=function(_0x1d0e67,_0x5a48f3){return db[_0x861b('0x34')][_0x861b('0x36')](_0x1d0e67[_0x861b('0x37')],{})['then'](respondWithResult(_0x5a48f3,0xc9))[_0x861b('0x38')](handleError(_0x5a48f3,null));};exports[_0x861b('0x24')]=function(_0x1a677e,_0x2936fc){if(_0x1a677e[_0x861b('0x37')]['id']){delete _0x1a677e['body']['id'];}return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x1a677e[_0x861b('0x29')]['id']}})['then'](handleEntityNotFound(_0x2936fc,null))['then'](saveUpdates(_0x1a677e[_0x861b('0x37')],null))[_0x861b('0x35')](respondWithResult(_0x2936fc,null))[_0x861b('0x38')](handleError(_0x2936fc,null));};exports[_0x861b('0x25')]=function(_0x339a95,_0x307e97){return db['ChatProactiveAction'][_0x861b('0x39')]({'where':{'id':_0x339a95[_0x861b('0x29')]['id']}})[_0x861b('0x35')](handleEntityNotFound(_0x307e97,null))[_0x861b('0x35')](removeEntity(_0x307e97,null))[_0x861b('0x38')](handleError(_0x307e97,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 49e2287..8740d00 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 _0xf68f=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x27a027,_0x7f9a8f){var _0x4fc60d=function(_0x568acc){while(--_0x568acc){_0x27a027['push'](_0x27a027['shift']());}};_0x4fc60d(++_0x7f9a8f);}(_0xf68f,0x168));var _0xff68=function(_0xa8ef70,_0x364d2f){_0xa8ef70=_0xa8ef70-0x0;var _0x447423=_0xf68f[_0xa8ef70];return _0x447423;};'use strict';var _=require(_0xff68('0x0'));var util=require(_0xff68('0x1'));var logger=require(_0xff68('0x2'))(_0xff68('0x3'));var moment=require(_0xff68('0x4'));var BPromise=require(_0xff68('0x5'));var rp=require(_0xff68('0x6'));var fs=require('fs');var path=require(_0xff68('0x7'));var rimraf=require(_0xff68('0x8'));var config=require('../../config/environment');var attributes=require(_0xff68('0x9'));module[_0xff68('0xa')]=function(_0x473cce,_0x28ea54){return _0x473cce[_0xff68('0xb')](_0xff68('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1c2=['exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf1c2,0x157));var _0x2f1c=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0xf1c2[_0x53ad58];return _0x554b03;};'use strict';var _=require(_0x2f1c('0x0'));var util=require(_0x2f1c('0x1'));var logger=require(_0x2f1c('0x2'))(_0x2f1c('0x3'));var moment=require(_0x2f1c('0x4'));var BPromise=require(_0x2f1c('0x5'));var rp=require(_0x2f1c('0x6'));var fs=require('fs');var path=require(_0x2f1c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2f1c('0x8'));module[_0x2f1c('0x9')]=function(_0x3fdfc6,_0x2c2803){return _0x3fdfc6['define'](_0x2f1c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index bbd2714..d4892be 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 _0xbd40=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xbd40,0x98));var _0x0bd4=function(_0x975e75,_0x42b16c){_0x975e75=_0x975e75-0x0;var _0x3c6f06=_0xbd40[_0x975e75];return _0x3c6f06;};'use strict';var _=require(_0x0bd4('0x0'));var util=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require(_0x0bd4('0x3'));var rs=require(_0x0bd4('0x4'));var fs=require('fs');var Redis=require(_0x0bd4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bd4('0x6'));var logger=require(_0x0bd4('0x7'))(_0x0bd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x0bd4('0x9'));var client=jayson[_0x0bd4('0xa')][_0x0bd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5fed53,_0x4f12ff,_0x536b98){return new BPromise(function(_0x4980d2,_0xa06455){return client[_0x0bd4('0xc')](_0x5fed53,_0x536b98)['then'](function(_0x324dbd){logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));logger[_0x0bd4('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f12ff,'request\x20sent',JSON[_0x0bd4('0x11')](_0x324dbd));if(_0x324dbd[_0x0bd4('0x12')]){if(_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x13')]===0x1f4){logger['error'](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd['error'][_0x0bd4('0x14')]);return _0xa06455(_0x324dbd['error'][_0x0bd4('0x14')]);}logger[_0x0bd4('0x12')](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x14')]);return _0x4980d2(_0x324dbd['error'][_0x0bd4('0x14')]);}else{logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));_0x4980d2(_0x324dbd[_0x0bd4('0x15')]['message']);}})[_0x0bd4('0x16')](function(_0x5e3018){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f12ff,_0x5e3018);_0xa06455(_0x5e3018);});});}
\ No newline at end of file
+var _0xa625=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x51e34d,_0x480ab7){var _0x8b5825=function(_0x30511b){while(--_0x30511b){_0x51e34d['push'](_0x51e34d['shift']());}};_0x8b5825(++_0x480ab7);}(_0xa625,0x1d4));var _0x5a62=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa625[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a62('0x0'));var BPromise=require('bluebird');var rs=require(_0x5a62('0x1'));var fs=require('fs');var Redis=require(_0x5a62('0x2'));var db=require(_0x5a62('0x3'))['db'];var utils=require(_0x5a62('0x4'));var logger=require(_0x5a62('0x5'))('rpc');var config=require(_0x5a62('0x6'));var jayson=require(_0x5a62('0x7'));var client=jayson[_0x5a62('0x8')][_0x5a62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f30e,_0x524b8c,_0x17ac0b){return new BPromise(function(_0x58b046,_0x2c6e75){return client[_0x5a62('0xa')](_0x44f30e,_0x17ac0b)[_0x5a62('0xb')](function(_0x2156b2){logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));logger[_0x5a62('0xf')](_0x5a62('0x10'),_0x524b8c,'request\x20sent',JSON[_0x5a62('0x11')](_0x2156b2));if(_0x2156b2[_0x5a62('0x12')]){if(_0x2156b2['error']['code']===0x1f4){logger[_0x5a62('0x12')](_0x5a62('0xd'),_0x524b8c,_0x2156b2[_0x5a62('0x12')]['message']);return _0x2c6e75(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}logger['error'](_0x5a62('0xd'),_0x524b8c,_0x2156b2['error'][_0x5a62('0x13')]);return _0x58b046(_0x2156b2[_0x5a62('0x12')][_0x5a62('0x13')]);}else{logger[_0x5a62('0xc')](_0x5a62('0xd'),_0x524b8c,_0x5a62('0xe'));_0x58b046(_0x2156b2[_0x5a62('0x14')][_0x5a62('0x13')]);}})[_0x5a62('0x15')](function(_0x3b619a){logger['error'](_0x5a62('0xd'),_0x524b8c,_0x3b619a);_0x2c6e75(_0x3b619a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index d839b29..c8c8a96 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x7da7,0x10d));var _0x77da=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7da7[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
+var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2a2e9c,_0x4108f6){var _0x6f6fc6=function(_0x524998){while(--_0x524998){_0x2a2e9c['push'](_0x2a2e9c['shift']());}};_0x6f6fc6(++_0x4108f6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0xf2ca[_0x18776a];return _0x484e4a;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9a3923a..77a3384 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 _0x26e5=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x32854c,_0x1ceeea){var _0x1b3012=function(_0x15ca7d){while(--_0x15ca7d){_0x32854c['push'](_0x32854c['shift']());}};_0x1b3012(++_0x1ceeea);}(_0x26e5,0xfb));var _0x526e=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x26e5[_0xf4f343];return _0x4cda68;};'use strict';var Sequelize=require(_0x526e('0x0'));module['exports']={'name':{'type':Sequelize[_0x526e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x526e('0x1')]},'timeout':{'type':Sequelize[_0x526e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x526e('0x3')](_0x526e('0x4'),_0x526e('0x5'),_0x526e('0x6'))}};
\ No newline at end of file
+var _0x2509=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x48d2ec,_0x21a83a){var _0x198198=function(_0x1d1f95){while(--_0x1d1f95){_0x48d2ec['push'](_0x48d2ec['shift']());}};_0x198198(++_0x21a83a);}(_0x2509,0xe3));var _0x9250=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x2509[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9250('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9250('0x0')]},'timeout':{'type':Sequelize[_0x9250('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9250('0x2')](_0x9250('0x3'),_0x9250('0x4'),_0x9250('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e8590f4..6e4ca04 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 _0xee40=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','pick','addTeams','ids','Agents','online','interface','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xee40,0x85));var _0x0ee4=function(_0x20fe76,_0x1caa47){_0x20fe76=_0x20fe76-0x0;var _0x446f73=_0xee40[_0x20fe76];return _0x446f73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ee4('0x0'));var jsonpatch=require(_0x0ee4('0x1'));var rp=require(_0x0ee4('0x2'));var moment=require('moment');var BPromise=require(_0x0ee4('0x3'));var Mustache=require(_0x0ee4('0x4'));var util=require(_0x0ee4('0x5'));var path=require(_0x0ee4('0x6'));var sox=require('sox');var csv=require(_0x0ee4('0x7'));var ejs=require(_0x0ee4('0x8'));var fs=require('fs');var fs_extra=require(_0x0ee4('0x9'));var _=require(_0x0ee4('0xa'));var squel=require(_0x0ee4('0xb'));var crypto=require(_0x0ee4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ee4('0x7'));var querystring=require(_0x0ee4('0xd'));var Papa=require(_0x0ee4('0xe'));var Redis=require(_0x0ee4('0xf'));var authService=require(_0x0ee4('0x10'));var qs=require(_0x0ee4('0x11'));var as=require(_0x0ee4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee4('0x13'))(_0x0ee4('0x14'));var utils=require(_0x0ee4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0ee4('0x16'));var db=require(_0x0ee4('0x17'))['db'];config[_0x0ee4('0x18')]=_['defaults'](config['redis'],{'host':_0x0ee4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ee4('0x18')]));require(_0x0ee4('0x1a'))[_0x0ee4('0x1b')](socket);var jayson=require(_0x0ee4('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f82e,_0x5754fb,_0x5db41f,_0x4bc02d){return new BPromise(function(_0x1c0ba5,_0x4de31e){var _0x41bfee=_0x4bc02d||client;return _0x41bfee[_0x0ee4('0x1d')](_0x34f82e,_0x5db41f)[_0x0ee4('0x1e')](function(_0x3e04ce){logger[_0x0ee4('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x0ee4('0x20'));logger[_0x0ee4('0x21')](_0x0ee4('0x22'),_0x5754fb,_0x0ee4('0x20'),JSON[_0x0ee4('0x23')](_0x3e04ce));if(_0x3e04ce[_0x0ee4('0x24')]){if(_0x3e04ce[_0x0ee4('0x24')]['code']===0x1f4){logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x4de31e(_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);}logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x1c0ba5(_0x3e04ce[_0x0ee4('0x24')]['message']);}else{logger[_0x0ee4('0x1f')](_0x0ee4('0x26'),_0x5754fb,'request\x20sent');_0x1c0ba5(_0x3e04ce['result'][_0x0ee4('0x25')]);}})['catch'](function(_0x176baf){logger[_0x0ee4('0x24')](_0x0ee4('0x26'),_0x5754fb,_0x176baf);_0x4de31e(_0x176baf);});});}function respondWithStatusCode(_0x3c00a7,_0x47383d){_0x47383d=_0x47383d||0xcc;return function(_0x318081){if(_0x318081){return _0x3c00a7[_0x0ee4('0x27')](_0x47383d);}return _0x3c00a7['status'](_0x47383d)[_0x0ee4('0x28')]();};}function respondWithResult(_0x2a8ff6,_0x146701){_0x146701=_0x146701||0xc8;return function(_0x35dbe8){if(_0x35dbe8){return _0x2a8ff6[_0x0ee4('0x29')](_0x146701)[_0x0ee4('0x2a')](_0x35dbe8);}};}function respondWithFilteredResult(_0x71541d,_0x1d4400){return function(_0x12409a){if(_0x12409a){var _0x16da09=typeof _0x1d4400['offset']===_0x0ee4('0x2b')&&typeof _0x1d4400[_0x0ee4('0x2c')]===_0x0ee4('0x2b');var _0x3c585c=_0x12409a['count'];var _0x3b515a=_0x16da09?0x0:_0x1d4400[_0x0ee4('0x2d')];var _0x2b205e=_0x16da09?_0x12409a['count']:_0x1d4400[_0x0ee4('0x2d')]+_0x1d4400[_0x0ee4('0x2c')];var _0x53efda;if(_0x2b205e>=_0x3c585c){_0x2b205e=_0x3c585c;_0x53efda=0xc8;}else{_0x53efda=0xce;}_0x71541d[_0x0ee4('0x29')](_0x53efda);return _0x71541d[_0x0ee4('0x2e')](_0x0ee4('0x2f'),_0x3b515a+'-'+_0x2b205e+'/'+_0x3c585c)[_0x0ee4('0x2a')](_0x12409a);}return null;};}function patchUpdates(_0x4798eb){return function(_0x1bf252){try{jsonpatch['apply'](_0x1bf252,_0x4798eb,!![]);}catch(_0x2cf156){return BPromise[_0x0ee4('0x30')](_0x2cf156);}return _0x1bf252['save']();};}function saveUpdates(_0x4bd549,_0x21ddc5){return function(_0x3d7759){if(_0x3d7759){return _0x3d7759[_0x0ee4('0x31')](_0x4bd549)['then'](function(_0x41bc7b){return _0x41bc7b;});}return null;};}function removeEntity(_0x57eac4,_0x2e33a7){return function(_0x4a047f){if(_0x4a047f){return _0x4a047f[_0x0ee4('0x32')]()[_0x0ee4('0x1e')](function(){var _0xb26e32=_0x4a047f[_0x0ee4('0x33')]({'plain':!![]});var _0x100784=_0x0ee4('0x34');return db[_0x0ee4('0x35')]['destroy']({'where':{'type':_0x100784,'resourceId':_0xb26e32['id']}})['then'](function(){return _0x4a047f;});})[_0x0ee4('0x1e')](function(){_0x57eac4[_0x0ee4('0x29')](0xcc)[_0x0ee4('0x28')]();});}};}function handleEntityNotFound(_0x44dd60,_0x1e27df){return function(_0x40d7c2){if(!_0x40d7c2){_0x44dd60['sendStatus'](0x194);}return _0x40d7c2;};}function handleError(_0x2998d7,_0x2e2a13){_0x2e2a13=_0x2e2a13||0x1f4;return function(_0x4f8f15){logger['error'](_0x4f8f15['stack']);if(_0x4f8f15[_0x0ee4('0x36')]){delete _0x4f8f15['name'];}_0x2998d7[_0x0ee4('0x29')](_0x2e2a13)[_0x0ee4('0x37')](_0x4f8f15);};}exports[_0x0ee4('0x38')]=function(_0xb48cf9,_0x38e8c2){var _0x355eec={},_0x454e11={},_0x4bf1ee={'count':0x0,'rows':[]};var _0x346c98=_[_0x0ee4('0x39')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')],function(_0x46c6e4){return{'name':_0x46c6e4['fieldName'],'type':_0x46c6e4['type'][_0x0ee4('0x3c')]};});_0x454e11[_0x0ee4('0x3d')]=_[_0x0ee4('0x39')](_0x346c98,_0x0ee4('0x36'));_0x454e11[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0xb48cf9['query']);_0x454e11['filters']=_[_0x0ee4('0x40')](_0x454e11['model'],_0x454e11[_0x0ee4('0x3e')]);_0x355eec[_0x0ee4('0x41')]=_['intersection'](_0x454e11[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0xb48cf9['query'][_0x0ee4('0x42')]));_0x355eec['attributes']=_0x355eec['attributes']['length']?_0x355eec['attributes']:_0x454e11[_0x0ee4('0x3d')];if(!_0xb48cf9['query'][_0x0ee4('0x43')]('nolimit')){_0x355eec[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0xb48cf9[_0x0ee4('0x3e')]['limit']);_0x355eec[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x355eec[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0xb48cf9['query'][_0x0ee4('0x45')]);_0x355eec[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_['pick'](_0xb48cf9[_0x0ee4('0x3e')],_0x454e11[_0x0ee4('0x47')]),_0x346c98);if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x355eec[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x355eec[_0x0ee4('0x46')],{'$or':_['map'](_0x346c98,function(_0x5ea9cb){if(_0x5ea9cb[_0x0ee4('0x4a')]!==_0x0ee4('0x4b')){var _0x9f3566={};_0x9f3566[_0x5ea9cb[_0x0ee4('0x36')]]={'$like':'%'+_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x9f3566;}})});}_0x355eec=_[_0x0ee4('0x49')]({},_0x355eec,_0xb48cf9[_0x0ee4('0x4c')]);var _0x52dd8e={'where':_0x355eec[_0x0ee4('0x46')]};return db['ChatQueue'][_0x0ee4('0x4d')](_0x52dd8e)['then'](function(_0x52e070){_0x4bf1ee[_0x0ee4('0x4d')]=_0x52e070;if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x355eec[_0x0ee4('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x355eec);})[_0x0ee4('0x1e')](function(_0x2bf9f0){_0x4bf1ee[_0x0ee4('0x50')]=_0x2bf9f0;return _0x4bf1ee;})['then'](respondWithFilteredResult(_0x38e8c2,_0x355eec))[_0x0ee4('0x51')](handleError(_0x38e8c2,null));};exports[_0x0ee4('0x52')]=function(_0x1f4b32,_0x3d81a5){var _0x5520d3={'raw':!![],'where':{'id':_0x1f4b32[_0x0ee4('0x53')]['id']}},_0x333bea={};_0x333bea[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')]);_0x333bea[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0x1f4b32[_0x0ee4('0x3e')]);_0x333bea['filters']=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],_0x333bea[_0x0ee4('0x3e')]);_0x5520d3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],qs['fields'](_0x1f4b32['query'][_0x0ee4('0x42')]));_0x5520d3[_0x0ee4('0x41')]=_0x5520d3['attributes'][_0x0ee4('0x54')]?_0x5520d3[_0x0ee4('0x41')]:_0x333bea[_0x0ee4('0x3d')];if(_0x1f4b32[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x5520d3[_0x0ee4('0x4f')]=[{'all':!![]}];}_0x5520d3=_[_0x0ee4('0x49')]({},_0x5520d3,_0x1f4b32[_0x0ee4('0x4c')]);return db[_0x0ee4('0x3a')][_0x0ee4('0x55')](_0x5520d3)['then'](handleEntityNotFound(_0x3d81a5,null))['then'](respondWithResult(_0x3d81a5,null))[_0x0ee4('0x51')](handleError(_0x3d81a5,null));};exports[_0x0ee4('0x56')]=function(_0x1a4d39,_0x459850){return db[_0x0ee4('0x3a')][_0x0ee4('0x56')](_0x1a4d39['body'],{})['then'](function(_0x3529ed){var _0x53968c=_0x1a4d39[_0x0ee4('0x57')][_0x0ee4('0x33')]({'plain':!![]});if(!_0x53968c)throw new Error(_0x0ee4('0x58'));if(_0x53968c[_0x0ee4('0x59')]===_0x0ee4('0x57')){var _0x1b53ba=_0x3529ed[_0x0ee4('0x33')]({'plain':!![]});var _0x338a17=_0x0ee4('0x34');return db[_0x0ee4('0x5a')]['find']({'where':{'name':_0x338a17,'userProfileId':_0x53968c[_0x0ee4('0x5b')]},'raw':!![]})[_0x0ee4('0x1e')](function(_0x4df7b1){if(_0x4df7b1&&_0x4df7b1['autoAssociation']===0x0){return db[_0x0ee4('0x35')][_0x0ee4('0x56')]({'name':_0x1b53ba[_0x0ee4('0x36')],'resourceId':_0x1b53ba['id'],'type':_0x4df7b1[_0x0ee4('0x36')],'sectionId':_0x4df7b1['id']},{})['then'](function(){return _0x3529ed;});}else{return _0x3529ed;}})[_0x0ee4('0x51')](function(_0x4c90c3){logger[_0x0ee4('0x24')](_0x0ee4('0x5c'),_0x4c90c3);throw _0x4c90c3;});}return _0x3529ed;})['then'](respondWithResult(_0x459850,0xc9))['catch'](handleError(_0x459850,null));};exports[_0x0ee4('0x31')]=function(_0x34c341,_0x53612f){if(_0x34c341[_0x0ee4('0x5d')]['id']){delete _0x34c341[_0x0ee4('0x5d')]['id'];}return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x34c341[_0x0ee4('0x53')]['id']}})['then'](handleEntityNotFound(_0x53612f,null))[_0x0ee4('0x1e')](saveUpdates(_0x34c341[_0x0ee4('0x5d')],null))[_0x0ee4('0x1e')](respondWithResult(_0x53612f,null))['catch'](handleError(_0x53612f,null));};exports['destroy']=function(_0x2a8503,_0x264da4){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x2a8503[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x264da4,null))[_0x0ee4('0x1e')](removeEntity(_0x264da4,null))['catch'](handleError(_0x264da4,null));};exports[_0x0ee4('0x5e')]=function(_0x21b026,_0x151142){return db[_0x0ee4('0x3a')][_0x0ee4('0x5e')]()[_0x0ee4('0x1e')](respondWithResult(_0x151142,null))[_0x0ee4('0x51')](handleError(_0x151142,null));};exports['getMembers']=function(_0x59d16f,_0x1d39cd,_0xe9e1c5){var _0x2fd9e3={'raw':!![],'where':{}},_0x378740={},_0x272901;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x59d16f['params']['id']}})['then'](handleEntityNotFound(_0x1d39cd,null))[_0x0ee4('0x1e')](function(_0x4ab152){if(_0x4ab152){_0x272901=_0x4ab152[_0x0ee4('0x33')]({'plain':!![]});_0x378740[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db['UserChatQueue'][_0x0ee4('0x3b')]);_0x378740['query']=_[_0x0ee4('0x3f')](_0x59d16f[_0x0ee4('0x3e')]);_0x378740['filters']=_[_0x0ee4('0x40')](_0x378740[_0x0ee4('0x3d')],_0x378740[_0x0ee4('0x3e')]);_0x2fd9e3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x378740['model'],qs[_0x0ee4('0x42')](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x2fd9e3[_0x0ee4('0x41')]=_0x2fd9e3['attributes'][_0x0ee4('0x54')]?_0x2fd9e3[_0x0ee4('0x41')]:_0x378740[_0x0ee4('0x3d')];if(!_0x59d16f['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x2fd9e3[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x59d16f['query'][_0x0ee4('0x2c')]);_0x2fd9e3[_0x0ee4('0x2d')]=qs['offset'](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x2fd9e3[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x59d16f['query']['sort']);_0x2fd9e3[_0x0ee4('0x46')]=qs['filters'](_['pick'](_0x59d16f[_0x0ee4('0x3e')],_0x378740['filters']));_0x2fd9e3[_0x0ee4('0x46')][_0x0ee4('0x61')]=_0x4ab152['id'];if(_0x59d16f[_0x0ee4('0x3e')]['filter']){_0x2fd9e3[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x2fd9e3['where'],{'$or':_['map'](_0x2fd9e3[_0x0ee4('0x41')],function(_0x4fed59){var _0x1fa481={};_0x1fa481[_0x4fed59]={'$like':'%'+_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x1fa481;})});}_0x2fd9e3=_[_0x0ee4('0x49')]({},_0x2fd9e3,_0x59d16f['options']);return db['UserChatQueue'][_0x0ee4('0x62')](_0x2fd9e3);}})['then'](function(_0x6e6259){if(_0x6e6259){return db[_0x0ee4('0x63')][_0x0ee4('0x64')]({'where':{'id':_['map'](_0x6e6259,_0x0ee4('0x65')),'role':_0x0ee4('0x66')},'attributes':['id',_0x0ee4('0x36'),_0x0ee4('0x67'),_0x0ee4('0x68'),_0x0ee4('0x69')]});}})[_0x0ee4('0x1e')](function(_0x205462){if(_0x205462){return{'count':_0x205462[_0x0ee4('0x4d')],'rows':_['map'](_0x205462['rows'],function(_0x3ed2fe){return{'membername':_0x3ed2fe[_0x0ee4('0x36')],'UserId':_0x3ed2fe['id'],'queue_name':_0x272901[_0x0ee4('0x36')],'ChatQueueId':_0x272901['id'],'interface':util['format']('%s/%s',_0x0ee4('0x6a'),_0x3ed2fe[_0x0ee4('0x36')]),'penalty':0x0,'paused':_0x3ed2fe[_0x0ee4('0x67')],'createdAt':_0x3ed2fe['createdAt'],'updatedAt':_0x3ed2fe[_0x0ee4('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ee4('0x1e')](respondWithFilteredResult(_0x1d39cd,_0x2fd9e3))[_0x0ee4('0x51')](handleError(_0x1d39cd,null));};exports[_0x0ee4('0x6b')]=function(_0x237456,_0x28aefb,_0x1f60f7){var _0x791468={};var _0x454d28={};var _0x568b6a;var _0x3ae5be;return db['ChatQueue']['findOne']({'where':{'id':_0x237456[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x28aefb,null))[_0x0ee4('0x1e')](function(_0x1b748f){if(_0x1b748f){_0x568b6a=_0x1b748f;_0x454d28['model']=_[_0x0ee4('0x3f')](db['Team'][_0x0ee4('0x3b')]);_0x454d28[_0x0ee4('0x3e')]=_['keys'](_0x237456[_0x0ee4('0x3e')]);_0x454d28[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x454d28[_0x0ee4('0x3d')],_0x454d28[_0x0ee4('0x3e')]);_0x791468['attributes']=_['intersection'](_0x454d28[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x791468['attributes']=_0x791468[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x791468[_0x0ee4('0x41')]:_0x454d28[_0x0ee4('0x3d')];_0x791468[_0x0ee4('0x44')]=qs['sort'](_0x237456['query'][_0x0ee4('0x45')]);_0x791468[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x237456[_0x0ee4('0x3e')],_0x454d28['filters']));if(_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x791468['where']=_[_0x0ee4('0x49')](_0x791468[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x791468['attributes'],function(_0x441e20){var _0x166885={};_0x166885[_0x441e20]={'$like':'%'+_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x166885;})});}_0x791468=_[_0x0ee4('0x49')]({},_0x791468,_0x237456[_0x0ee4('0x4c')]);return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x42a6bf){if(_0x42a6bf){_0x3ae5be=_0x42a6bf[_0x0ee4('0x54')];if(!_0x237456['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x791468['limit']=qs[_0x0ee4('0x2c')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x791468[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x20ba78){if(_0x20ba78){return _0x20ba78?{'count':_0x3ae5be,'rows':_0x20ba78}:null;}})['then'](respondWithResult(_0x28aefb,null))['catch'](handleError(_0x28aefb,null));};exports[_0x0ee4('0x6d')]=function(_0x1bc030,_0x3f4371,_0x409a53){var _0x4d57af=_0x1bc030[_0x0ee4('0x5d')][_0x0ee4('0x6e')];return db['Team'][_0x0ee4('0x62')]({'where':{'id':_0x4d57af},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ee4('0x6f'),'attributes':['id','name',_0x0ee4('0x70'),'voicePause',_0x0ee4('0x71')],'raw':!![]}]})[_0x0ee4('0x1e')](function(_0x555c47){if(_0x555c47){var _0x4b11e6=_['flatMap'](_0x555c47,function(_0x356888){var _0x283a3d=_0x356888[_0x0ee4('0x33')]({'plain':!![]});return _0x283a3d[_0x0ee4('0x6f')];});return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x1bc030[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x59dc8a){return db['sequelize'][_0x0ee4('0x72')](function(_0x3ce6a4){return _0x59dc8a[_0x0ee4('0x6d')](_0x4d57af,{'transaction':_0x3ce6a4})['then'](function(){return BPromise[_0x0ee4('0x73')](_0x4b11e6,function(_0x511cbe){return db[_0x0ee4('0x74')][_0x0ee4('0x75')]({'where':{'UserId':_0x511cbe['id'],'ChatQueueId':_0x1bc030[_0x0ee4('0x53')]['id']},'transaction':_0x3ce6a4});});})[_0x0ee4('0x1e')](function(){_0x4b11e6[_0x0ee4('0x76')](function(_0x5cdaf8){socket['emit'](_0x0ee4('0x77'),{'UserId':_0x5cdaf8['id'],'ChatQueueId':_0x59dc8a['id']});});});});});}})[_0x0ee4('0x1e')](respondWithStatusCode(_0x3f4371,null))[_0x0ee4('0x51')](handleError(_0x3f4371,null));};exports[_0x0ee4('0x78')]=function(_0x406935,_0x48a6ff,_0x900f02){return db[_0x0ee4('0x79')][_0x0ee4('0x62')]({'where':{'id':_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0ee4('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48a6ff,null))[_0x0ee4('0x1e')](function(_0x162bf4){var _0x4035b2=_[_0x0ee4('0x39')](_0x162bf4,'id');var _0x36bd3d=[];var _0x130b49=[];var _0xc2c7b6=squel[_0x0ee4('0x7a')]();_0xc2c7b6[_0x0ee4('0x7b')](_0x0ee4('0x7c'))[_0x0ee4('0x7d')](_0x0ee4('0x7e'),'tq')['join']('user_has_teams','ut',_0x0ee4('0x7f'))[_0x0ee4('0x46')](_0x0ee4('0x80'),_0x406935[_0x0ee4('0x53')]['id']);for(var _0x32956b=0x0;_0x32956b<_0x162bf4['length'];_0x32956b+=0x1){let _0x1e1fdb=_0x162bf4[_0x32956b];for(var _0x1f9b4d=0x0;_0x1f9b4d<_0x1e1fdb[_0x0ee4('0x6f')]['length'];_0x1f9b4d+=0x1){let _0x5663af=_0x1e1fdb[_0x0ee4('0x6f')][_0x1f9b4d];var _0x4d029a=_0xc2c7b6[_0x0ee4('0x81')]();_0x4d029a[_0x0ee4('0x46')]('ut.UserId\x20=\x20?',_0x5663af['id']);_0x130b49[_0x0ee4('0x82')](db[_0x0ee4('0x83')][_0x0ee4('0x3e')](_0x4d029a[_0x0ee4('0x84')](),{'type':db[_0x0ee4('0x83')]['QueryTypes'][_0x0ee4('0x85')]})[_0x0ee4('0x1e')](function(_0xc3e6a3){if(_0xc3e6a3[_0x0ee4('0x54')]===0x1){return _0x5663af['id'];}else{var _0x5dcddd=_[_0x0ee4('0x86')](_[_0x0ee4('0x39')](_0xc3e6a3,_0x0ee4('0x87')),function(_0x1ae871){return _[_0x0ee4('0x88')](_0x4035b2,_0x1ae871);});if(_0x5dcddd){return _0x5663af['id'];}}}));}}return BPromise[_0x0ee4('0x89')](_0x130b49)[_0x0ee4('0x1e')](function(_0x536496){_0x36bd3d=_(_0x36bd3d)[_0x0ee4('0x8a')](_0x536496)[_0x0ee4('0x8b')]()[_0x0ee4('0x8c')]();return db[_0x0ee4('0x3a')][_0x0ee4('0x55')]({'where':{'id':_0x406935[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x264fb0){return db[_0x0ee4('0x83')][_0x0ee4('0x72')](function(_0x1bddd1){return _0x264fb0[_0x0ee4('0x78')](_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')],{'transaction':_0x1bddd1})[_0x0ee4('0x1e')](function(){if(!_[_0x0ee4('0x8d')](_0x36bd3d)){return _0x264fb0[_0x0ee4('0x8e')](_0x36bd3d,{'transaction':_0x1bddd1});}})['then'](function(){_0x36bd3d[_0x0ee4('0x76')](function(_0x123cb3){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':_0x123cb3,'ChatQueueId':_0x264fb0['id']});});});});});});})['then'](respondWithStatusCode(_0x48a6ff,null))[_0x0ee4('0x51')](handleError(_0x48a6ff,null));};exports['addAgents']=function(_0x4430c0,_0x17f36c,_0xf0b41c){return db['ChatQueue']['find']({'where':{'id':_0x4430c0['params']['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x17f36c,null))[_0x0ee4('0x1e')](function(_0x3a2da2){if(_0x3a2da2){return _0x3a2da2[_0x0ee4('0x91')](_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')],_[_0x0ee4('0x92')](_0x4430c0[_0x0ee4('0x5d')],[_0x0ee4('0x6e'),'id'])||{})[_0x0ee4('0x93')](function(_0x38b2f5){for(var _0x23087a=0x0;_0x23087a<_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x23087a+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x23087a]),'ChatQueueId':Number(_0x4430c0[_0x0ee4('0x53')]['id'])});}return _0x38b2f5;});}})[_0x0ee4('0x1e')](respondWithResult(_0x17f36c,null))['catch'](handleError(_0x17f36c,null));};exports[_0x0ee4('0x8e')]=function(_0x588ac7,_0xe2d58e,_0x4de398){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x588ac7[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0xe2d58e,null))[_0x0ee4('0x1e')](function(_0x5d0071){if(_0x5d0071){return _0x5d0071[_0x0ee4('0x8e')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])[_0x0ee4('0x1e')](function(){if(_[_0x0ee4('0x94')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])){for(var _0x87c05d=0x0;_0x87c05d<_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x87c05d+=0x1){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x87c05d]),'ChatQueueId':Number(_0x588ac7['params']['id'])});}}else{socket['emit'](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')]['ids']),'ChatQueueId':Number(_0x588ac7[_0x0ee4('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0xe2d58e,null))[_0x0ee4('0x51')](handleError(_0xe2d58e,null));};exports[_0x0ee4('0x95')]=function(_0x217a7c,_0x2b5d15,_0x6657f6){var _0x4c7639={};var _0x4f65b9={};var _0x484df7;var _0x4ea576;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x217a7c[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x2b5d15,null))[_0x0ee4('0x1e')](function(_0x2a41e6){if(_0x2a41e6){_0x484df7=_0x2a41e6;_0x4f65b9['model']=_[_0x0ee4('0x3f')](db['User'][_0x0ee4('0x3b')]);_0x4f65b9['query']=_[_0x0ee4('0x3f')](_0x217a7c[_0x0ee4('0x3e')]);_0x4f65b9[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x4f65b9[_0x0ee4('0x3d')],_0x4f65b9['query']);_0x4c7639['attributes']=_[_0x0ee4('0x40')](_0x4f65b9['model'],qs[_0x0ee4('0x42')](_0x217a7c[_0x0ee4('0x3e')]['fields']));_0x4c7639['attributes']=_0x4c7639[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x4c7639[_0x0ee4('0x41')]:_0x4f65b9[_0x0ee4('0x3d')];_0x4c7639[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x45')]);_0x4c7639['where']=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x217a7c['query'],_0x4f65b9[_0x0ee4('0x47')]));if(_0x217a7c['query']['filter']){_0x4c7639[_0x0ee4('0x46')]=_['merge'](_0x4c7639[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x4c7639[_0x0ee4('0x41')],function(_0x173e1d){var _0x587245={};_0x587245[_0x173e1d]={'$like':'%'+_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x587245;})});}_0x4c7639=_['merge']({},_0x4c7639,_0x217a7c[_0x0ee4('0x4c')]);return _0x484df7[_0x0ee4('0x95')](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x735d87){if(_0x735d87){_0x4ea576=_0x735d87[_0x0ee4('0x54')];if(!_0x217a7c[_0x0ee4('0x3e')]['hasOwnProperty'](_0x0ee4('0x60'))){_0x4c7639[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x4c7639['offset']=qs[_0x0ee4('0x2d')](_0x217a7c[_0x0ee4('0x3e')]['offset']);}return _0x484df7['getAgents'](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x43084c){if(_0x43084c){return _0x43084c?{'count':_0x4ea576,'rows':_0x43084c}:null;}})['then'](respondWithResult(_0x2b5d15,null))[_0x0ee4('0x51')](handleError(_0x2b5d15,null));};
\ No newline at end of file
+var _0x8760=['to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','rows','format','%s/%s','SIP','createdAt','updatedAt','Team','rawAttributes','addTeams','ids','online','voicePause','interface','flatMap','Agents','each','forEach','emit','userChatQueue:save','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x445770,_0x3bff55){var _0x310ece=function(_0x57df88){while(--_0x57df88){_0x445770['push'](_0x445770['shift']());}};_0x310ece(++_0x3bff55);}(_0x8760,0x132));var _0x0876=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x8760[_0x251d9c];return _0x16ae64;};'use strict';var emlformat=require(_0x0876('0x0'));var rimraf=require(_0x0876('0x1'));var zipdir=require(_0x0876('0x2'));var jsonpatch=require(_0x0876('0x3'));var rp=require(_0x0876('0x4'));var moment=require(_0x0876('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0876('0x6'));var util=require(_0x0876('0x7'));var path=require(_0x0876('0x8'));var sox=require(_0x0876('0x9'));var csv=require(_0x0876('0xa'));var ejs=require(_0x0876('0xb'));var fs=require('fs');var fs_extra=require(_0x0876('0xc'));var _=require('lodash');var squel=require(_0x0876('0xd'));var crypto=require(_0x0876('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0876('0xf'));var Redis=require(_0x0876('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0876('0x11'));var as=require(_0x0876('0x12'));var hardwareService=require(_0x0876('0x13'));var logger=require(_0x0876('0x14'))(_0x0876('0x15'));var utils=require(_0x0876('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0876('0x17'));var db=require(_0x0876('0x18'))['db'];config[_0x0876('0x19')]=_[_0x0876('0x1a')](config[_0x0876('0x19')],{'host':_0x0876('0x1b'),'port':0x18eb});var socket=require(_0x0876('0x1c'))(new Redis(config[_0x0876('0x19')]));require(_0x0876('0x1d'))[_0x0876('0x1e')](socket);var jayson=require(_0x0876('0x1f'));var client=jayson[_0x0876('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1524f7,_0x370588,_0xd0a2d7,_0x2bfb9e){return new BPromise(function(_0x1c6328,_0x48480c){var _0x1092cc=_0x2bfb9e||client;return _0x1092cc[_0x0876('0x21')](_0x1524f7,_0xd0a2d7)['then'](function(_0x27961f){logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));logger[_0x0876('0x25')](_0x0876('0x26'),_0x370588,_0x0876('0x24'),JSON['stringify'](_0x27961f));if(_0x27961f[_0x0876('0x27')]){if(_0x27961f[_0x0876('0x27')]['code']===0x1f4){logger['error'](_0x0876('0x23'),_0x370588,_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);return _0x48480c(_0x27961f[_0x0876('0x27')]['message']);}logger[_0x0876('0x27')]('ChatQueue,\x20%s,\x20%s',_0x370588,_0x27961f['error'][_0x0876('0x28')]);return _0x1c6328(_0x27961f[_0x0876('0x27')][_0x0876('0x28')]);}else{logger[_0x0876('0x22')](_0x0876('0x23'),_0x370588,_0x0876('0x24'));_0x1c6328(_0x27961f[_0x0876('0x29')]['message']);}})[_0x0876('0x2a')](function(_0x140a16){logger[_0x0876('0x27')](_0x0876('0x23'),_0x370588,_0x140a16);_0x48480c(_0x140a16);});});}function respondWithStatusCode(_0x26d07d,_0x1448d4){_0x1448d4=_0x1448d4||0xcc;return function(_0x383707){if(_0x383707){return _0x26d07d[_0x0876('0x2b')](_0x1448d4);}return _0x26d07d[_0x0876('0x2c')](_0x1448d4)[_0x0876('0x2d')]();};}function respondWithResult(_0x41b198,_0x3f7f7b){_0x3f7f7b=_0x3f7f7b||0xc8;return function(_0x3dd9a4){if(_0x3dd9a4){return _0x41b198[_0x0876('0x2c')](_0x3f7f7b)[_0x0876('0x2e')](_0x3dd9a4);}};}function respondWithFilteredResult(_0x437b04,_0x1902de){return function(_0x5b0868){if(_0x5b0868){var _0x1af134=typeof _0x1902de[_0x0876('0x2f')]===_0x0876('0x30')&&typeof _0x1902de['limit']===_0x0876('0x30');var _0x4f1912=_0x5b0868[_0x0876('0x31')];var _0x24ff6f=_0x1af134?0x0:_0x1902de[_0x0876('0x2f')];var _0xa4634b=_0x1af134?_0x5b0868['count']:_0x1902de['offset']+_0x1902de['limit'];var _0x11adc2;if(_0xa4634b>=_0x4f1912){_0xa4634b=_0x4f1912;_0x11adc2=0xc8;}else{_0x11adc2=0xce;}_0x437b04['status'](_0x11adc2);return _0x437b04['set']('Content-Range',_0x24ff6f+'-'+_0xa4634b+'/'+_0x4f1912)[_0x0876('0x2e')](_0x5b0868);}return null;};}function patchUpdates(_0x1f03cf){return function(_0x16aba8){try{jsonpatch[_0x0876('0x32')](_0x16aba8,_0x1f03cf,!![]);}catch(_0x1265b7){return BPromise[_0x0876('0x33')](_0x1265b7);}return _0x16aba8[_0x0876('0x34')]();};}function saveUpdates(_0x314138,_0x43970f){return function(_0x13c155){if(_0x13c155){return _0x13c155[_0x0876('0x35')](_0x314138)[_0x0876('0x36')](function(_0x58bf63){return _0x58bf63;});}return null;};}function removeEntity(_0x3ec54c,_0x1e12a3){return function(_0xb1576){if(_0xb1576){return _0xb1576['destroy']()['then'](function(){var _0x11b5e5=_0xb1576[_0x0876('0x37')]({'plain':!![]});var _0x5524b3=_0x0876('0x38');return db[_0x0876('0x39')][_0x0876('0x3a')]({'where':{'type':_0x5524b3,'resourceId':_0x11b5e5['id']}})[_0x0876('0x36')](function(){return _0xb1576;});})[_0x0876('0x36')](function(){_0x3ec54c['status'](0xcc)[_0x0876('0x2d')]();});}};}function handleEntityNotFound(_0x5246df,_0x3d6dbb){return function(_0xffefb5){if(!_0xffefb5){_0x5246df['sendStatus'](0x194);}return _0xffefb5;};}function handleError(_0x1aedd2,_0x209d6e){_0x209d6e=_0x209d6e||0x1f4;return function(_0x3a5fbb){logger['error'](_0x3a5fbb[_0x0876('0x3b')]);if(_0x3a5fbb[_0x0876('0x3c')]){delete _0x3a5fbb[_0x0876('0x3c')];}_0x1aedd2['status'](_0x209d6e)[_0x0876('0x3d')](_0x3a5fbb);};}exports[_0x0876('0x3e')]=function(_0x2be5c1,_0x314578){var _0x12a9e9={},_0x3cffce={},_0xec9498={'count':0x0,'rows':[]};var _0x4b12f1=_['map'](db[_0x0876('0x3f')]['rawAttributes'],function(_0xa74acd){return{'name':_0xa74acd[_0x0876('0x40')],'type':_0xa74acd[_0x0876('0x41')][_0x0876('0x42')]};});_0x3cffce[_0x0876('0x43')]=_[_0x0876('0x44')](_0x4b12f1,_0x0876('0x3c'));_0x3cffce[_0x0876('0x45')]=_[_0x0876('0x46')](_0x2be5c1[_0x0876('0x45')]);_0x3cffce[_0x0876('0x47')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],_0x3cffce[_0x0876('0x45')]);_0x12a9e9[_0x0876('0x49')]=_[_0x0876('0x48')](_0x3cffce[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4a')]));_0x12a9e9[_0x0876('0x49')]=_0x12a9e9[_0x0876('0x49')][_0x0876('0x4b')]?_0x12a9e9[_0x0876('0x49')]:_0x3cffce[_0x0876('0x43')];if(!_0x2be5c1[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x12a9e9[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x4e')]);_0x12a9e9[_0x0876('0x2f')]=qs['offset'](_0x2be5c1['query'][_0x0876('0x2f')]);}_0x12a9e9[_0x0876('0x4f')]=qs[_0x0876('0x50')](_0x2be5c1[_0x0876('0x45')][_0x0876('0x50')]);_0x12a9e9['where']=qs['filters'](_[_0x0876('0x51')](_0x2be5c1[_0x0876('0x45')],_0x3cffce[_0x0876('0x47')]),_0x4b12f1);if(_0x2be5c1[_0x0876('0x45')]['filter']){_0x12a9e9[_0x0876('0x52')]=_['merge'](_0x12a9e9[_0x0876('0x52')],{'$or':_[_0x0876('0x44')](_0x4b12f1,function(_0x5e79cf){if(_0x5e79cf[_0x0876('0x41')]!==_0x0876('0x53')){var _0x4d328b={};_0x4d328b[_0x5e79cf['name']]={'$like':'%'+_0x2be5c1[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x4d328b;}})});}_0x12a9e9=_['merge']({},_0x12a9e9,_0x2be5c1[_0x0876('0x55')]);var _0x1b1200={'where':_0x12a9e9[_0x0876('0x52')]};return db[_0x0876('0x3f')]['count'](_0x1b1200)[_0x0876('0x36')](function(_0x16fa85){_0xec9498[_0x0876('0x31')]=_0x16fa85;if(_0x2be5c1['query'][_0x0876('0x56')]){_0x12a9e9[_0x0876('0x57')]=[{'all':!![]}];}return db[_0x0876('0x3f')][_0x0876('0x58')](_0x12a9e9);})[_0x0876('0x36')](function(_0x49dbb1){_0xec9498['rows']=_0x49dbb1;return _0xec9498;})['then'](respondWithFilteredResult(_0x314578,_0x12a9e9))[_0x0876('0x2a')](handleError(_0x314578,null));};exports[_0x0876('0x59')]=function(_0x1a0a9c,_0x58fa25){var _0x4be2c5={'raw':!![],'where':{'id':_0x1a0a9c[_0x0876('0x5a')]['id']}},_0x40b328={};_0x40b328[_0x0876('0x43')]=_[_0x0876('0x46')](db['ChatQueue']['rawAttributes']);_0x40b328[_0x0876('0x45')]=_['keys'](_0x1a0a9c[_0x0876('0x45')]);_0x40b328[_0x0876('0x47')]=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],_0x40b328[_0x0876('0x45')]);_0x4be2c5['attributes']=_[_0x0876('0x48')](_0x40b328[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1a0a9c[_0x0876('0x45')][_0x0876('0x4a')]));_0x4be2c5[_0x0876('0x49')]=_0x4be2c5['attributes'][_0x0876('0x4b')]?_0x4be2c5['attributes']:_0x40b328[_0x0876('0x43')];if(_0x1a0a9c[_0x0876('0x45')][_0x0876('0x56')]){_0x4be2c5[_0x0876('0x57')]=[{'all':!![]}];}_0x4be2c5=_[_0x0876('0x5b')]({},_0x4be2c5,_0x1a0a9c[_0x0876('0x55')]);return db[_0x0876('0x3f')]['find'](_0x4be2c5)[_0x0876('0x36')](handleEntityNotFound(_0x58fa25,null))[_0x0876('0x36')](respondWithResult(_0x58fa25,null))[_0x0876('0x2a')](handleError(_0x58fa25,null));};exports[_0x0876('0x5c')]=function(_0x3a922d,_0xf18768){return db[_0x0876('0x3f')]['create'](_0x3a922d['body'],{})['then'](function(_0xd04599){var _0x30a1a5=_0x3a922d[_0x0876('0x5d')][_0x0876('0x37')]({'plain':!![]});if(!_0x30a1a5)throw new Error(_0x0876('0x5e'));if(_0x30a1a5[_0x0876('0x5f')]===_0x0876('0x5d')){var _0x1a4faf=_0xd04599['get']({'plain':!![]});var _0x22de74=_0x0876('0x38');return db[_0x0876('0x60')]['find']({'where':{'name':_0x22de74,'userProfileId':_0x30a1a5[_0x0876('0x61')]},'raw':!![]})[_0x0876('0x36')](function(_0x551a84){if(_0x551a84&&_0x551a84[_0x0876('0x62')]===0x0){return db['UserProfileResource'][_0x0876('0x5c')]({'name':_0x1a4faf['name'],'resourceId':_0x1a4faf['id'],'type':_0x551a84[_0x0876('0x3c')],'sectionId':_0x551a84['id']},{})[_0x0876('0x36')](function(){return _0xd04599;});}else{return _0xd04599;}})['catch'](function(_0x50578c){logger['error'](_0x0876('0x63'),_0x50578c);throw _0x50578c;});}return _0xd04599;})[_0x0876('0x36')](respondWithResult(_0xf18768,0xc9))[_0x0876('0x2a')](handleError(_0xf18768,null));};exports[_0x0876('0x35')]=function(_0x501a46,_0x5d7c7e){if(_0x501a46[_0x0876('0x64')]['id']){delete _0x501a46[_0x0876('0x64')]['id'];}return db[_0x0876('0x3f')]['find']({'where':{'id':_0x501a46['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x5d7c7e,null))[_0x0876('0x36')](saveUpdates(_0x501a46[_0x0876('0x64')],null))[_0x0876('0x36')](respondWithResult(_0x5d7c7e,null))[_0x0876('0x2a')](handleError(_0x5d7c7e,null));};exports[_0x0876('0x3a')]=function(_0x983c3e,_0x151003){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x983c3e[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x151003,null))['then'](removeEntity(_0x151003,null))[_0x0876('0x2a')](handleError(_0x151003,null));};exports[_0x0876('0x66')]=function(_0xa6eff8,_0x2ff4e4){return db[_0x0876('0x3f')][_0x0876('0x66')]()[_0x0876('0x36')](respondWithResult(_0x2ff4e4,null))['catch'](handleError(_0x2ff4e4,null));};exports[_0x0876('0x67')]=function(_0xcd6094,_0x3f92f3,_0x3a509f){var _0x490127={'raw':!![],'where':{}},_0x277c77={},_0x6fe262;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0xcd6094[_0x0876('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3f92f3,null))[_0x0876('0x36')](function(_0x20b154){if(_0x20b154){_0x6fe262=_0x20b154[_0x0876('0x37')]({'plain':!![]});_0x277c77[_0x0876('0x43')]=_[_0x0876('0x46')](db['UserChatQueue']['rawAttributes']);_0x277c77['query']=_[_0x0876('0x46')](_0xcd6094['query']);_0x277c77[_0x0876('0x47')]=_['intersection'](_0x277c77[_0x0876('0x43')],_0x277c77[_0x0876('0x45')]);_0x490127[_0x0876('0x49')]=_[_0x0876('0x48')](_0x277c77[_0x0876('0x43')],qs[_0x0876('0x4a')](_0xcd6094[_0x0876('0x45')]['fields']));_0x490127[_0x0876('0x49')]=_0x490127[_0x0876('0x49')][_0x0876('0x4b')]?_0x490127[_0x0876('0x49')]:_0x277c77[_0x0876('0x43')];if(!_0xcd6094['query']['hasOwnProperty'](_0x0876('0x4d'))){_0x490127[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0xcd6094[_0x0876('0x45')][_0x0876('0x4e')]);_0x490127[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0xcd6094[_0x0876('0x45')]['offset']);}_0x490127['order']=qs[_0x0876('0x50')](_0xcd6094[_0x0876('0x45')][_0x0876('0x50')]);_0x490127['where']=qs[_0x0876('0x47')](_['pick'](_0xcd6094[_0x0876('0x45')],_0x277c77[_0x0876('0x47')]));_0x490127[_0x0876('0x52')][_0x0876('0x69')]=_0x20b154['id'];if(_0xcd6094['query'][_0x0876('0x54')]){_0x490127['where']=_[_0x0876('0x5b')](_0x490127['where'],{'$or':_[_0x0876('0x44')](_0x490127[_0x0876('0x49')],function(_0x475a00){var _0x56431a={};_0x56431a[_0x475a00]={'$like':'%'+_0xcd6094[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x56431a;})});}_0x490127=_[_0x0876('0x5b')]({},_0x490127,_0xcd6094[_0x0876('0x55')]);return db['UserChatQueue'][_0x0876('0x58')](_0x490127);}})[_0x0876('0x36')](function(_0xed3537){if(_0xed3537){return db[_0x0876('0x6a')][_0x0876('0x6b')]({'where':{'id':_[_0x0876('0x44')](_0xed3537,_0x0876('0x6c')),'role':_0x0876('0x6d')},'attributes':['id',_0x0876('0x3c'),_0x0876('0x6e'),'updatedAt','createdAt']});}})['then'](function(_0x15d962){if(_0x15d962){return{'count':_0x15d962['count'],'rows':_[_0x0876('0x44')](_0x15d962[_0x0876('0x6f')],function(_0x1adc3b){return{'membername':_0x1adc3b[_0x0876('0x3c')],'UserId':_0x1adc3b['id'],'queue_name':_0x6fe262['name'],'ChatQueueId':_0x6fe262['id'],'interface':util[_0x0876('0x70')](_0x0876('0x71'),_0x0876('0x72'),_0x1adc3b[_0x0876('0x3c')]),'penalty':0x0,'paused':_0x1adc3b['chatPause'],'createdAt':_0x1adc3b[_0x0876('0x73')],'updatedAt':_0x1adc3b[_0x0876('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0876('0x36')](respondWithFilteredResult(_0x3f92f3,_0x490127))[_0x0876('0x2a')](handleError(_0x3f92f3,null));};exports['getTeams']=function(_0x1d65c8,_0x11e4c2,_0x40d8be){var _0x24767b={};var _0x172977={};var _0x1d6862;var _0x5cb767;return db[_0x0876('0x3f')][_0x0876('0x68')]({'where':{'id':_0x1d65c8[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x11e4c2,null))[_0x0876('0x36')](function(_0x7f5ef5){if(_0x7f5ef5){_0x1d6862=_0x7f5ef5;_0x172977['model']=_['keys'](db[_0x0876('0x75')][_0x0876('0x76')]);_0x172977['query']=_['keys'](_0x1d65c8[_0x0876('0x45')]);_0x172977[_0x0876('0x47')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],_0x172977[_0x0876('0x45')]);_0x24767b[_0x0876('0x49')]=_[_0x0876('0x48')](_0x172977[_0x0876('0x43')],qs[_0x0876('0x4a')](_0x1d65c8[_0x0876('0x45')]['fields']));_0x24767b[_0x0876('0x49')]=_0x24767b[_0x0876('0x49')][_0x0876('0x4b')]?_0x24767b[_0x0876('0x49')]:_0x172977[_0x0876('0x43')];_0x24767b[_0x0876('0x4f')]=qs['sort'](_0x1d65c8[_0x0876('0x45')][_0x0876('0x50')]);_0x24767b[_0x0876('0x52')]=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x1d65c8['query'],_0x172977['filters']));if(_0x1d65c8['query'][_0x0876('0x54')]){_0x24767b[_0x0876('0x52')]=_[_0x0876('0x5b')](_0x24767b['where'],{'$or':_[_0x0876('0x44')](_0x24767b[_0x0876('0x49')],function(_0x8e4610){var _0xd399e9={};_0xd399e9[_0x8e4610]={'$like':'%'+_0x1d65c8['query']['filter']+'%'};return _0xd399e9;})});}_0x24767b=_[_0x0876('0x5b')]({},_0x24767b,_0x1d65c8[_0x0876('0x55')]);return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x5099cd){if(_0x5099cd){_0x5cb767=_0x5099cd[_0x0876('0x4b')];if(!_0x1d65c8[_0x0876('0x45')]['hasOwnProperty']('nolimit')){_0x24767b[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x1d65c8[_0x0876('0x45')][_0x0876('0x4e')]);_0x24767b[_0x0876('0x2f')]=qs[_0x0876('0x2f')](_0x1d65c8['query']['offset']);}return _0x1d6862['getTeams'](_0x24767b);}})[_0x0876('0x36')](function(_0x527d5f){if(_0x527d5f){return _0x527d5f?{'count':_0x5cb767,'rows':_0x527d5f}:null;}})[_0x0876('0x36')](respondWithResult(_0x11e4c2,null))[_0x0876('0x2a')](handleError(_0x11e4c2,null));};exports[_0x0876('0x77')]=function(_0x2d358c,_0xca6bc3,_0xb643c9){var _0x1209d1=_0x2d358c[_0x0876('0x64')][_0x0876('0x78')];return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x1209d1},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id',_0x0876('0x3c'),_0x0876('0x79'),_0x0876('0x7a'),_0x0876('0x7b')],'raw':!![]}]})[_0x0876('0x36')](function(_0x360301){if(_0x360301){var _0x2b285f=_[_0x0876('0x7c')](_0x360301,function(_0x44dd1b){var _0x5c38df=_0x44dd1b[_0x0876('0x37')]({'plain':!![]});return _0x5c38df[_0x0876('0x7d')];});return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x2d358c[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x184552){return db['sequelize']['transaction'](function(_0xcc2d0e){return _0x184552[_0x0876('0x77')](_0x1209d1,{'transaction':_0xcc2d0e})[_0x0876('0x36')](function(){return BPromise[_0x0876('0x7e')](_0x2b285f,function(_0x29179f){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x29179f['id'],'ChatQueueId':_0x2d358c['params']['id']},'transaction':_0xcc2d0e});});})['then'](function(){_0x2b285f[_0x0876('0x7f')](function(_0x254b07){socket[_0x0876('0x80')](_0x0876('0x81'),{'UserId':_0x254b07['id'],'ChatQueueId':_0x184552['id']});});});});});}})[_0x0876('0x36')](respondWithStatusCode(_0xca6bc3,null))[_0x0876('0x2a')](handleError(_0xca6bc3,null));};exports['removeTeams']=function(_0x40b5f5,_0x1a793b,_0x2d76b9){return db[_0x0876('0x75')][_0x0876('0x58')]({'where':{'id':_0x40b5f5[_0x0876('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0876('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0876('0x36')](handleEntityNotFound(_0x1a793b,null))[_0x0876('0x36')](function(_0xddac92){var _0x24026e=_[_0x0876('0x44')](_0xddac92,'id');var _0x4f35da=[];var _0x3b39ce=[];var _0x1ac41d=squel['select']();_0x1ac41d[_0x0876('0x82')]('tq.TeamId')[_0x0876('0x83')](_0x0876('0x84'),'tq')[_0x0876('0x85')](_0x0876('0x86'),'ut',_0x0876('0x87'))['where'](_0x0876('0x88'),_0x40b5f5[_0x0876('0x5a')]['id']);for(var _0x20ebd7=0x0;_0x20ebd7<_0xddac92['length'];_0x20ebd7+=0x1){let _0x56b2d5=_0xddac92[_0x20ebd7];for(var _0x22f735=0x0;_0x22f735<_0x56b2d5['Agents'][_0x0876('0x4b')];_0x22f735+=0x1){let _0x47af80=_0x56b2d5[_0x0876('0x7d')][_0x22f735];var _0x533146=_0x1ac41d[_0x0876('0x89')]();_0x533146[_0x0876('0x52')](_0x0876('0x8a'),_0x47af80['id']);_0x3b39ce['push'](db['sequelize']['query'](_0x533146[_0x0876('0x8b')](),{'type':db[_0x0876('0x8c')][_0x0876('0x8d')][_0x0876('0x8e')]})['then'](function(_0x206faf){if(_0x206faf[_0x0876('0x4b')]===0x1){return _0x47af80['id'];}else{var _0x58fb8d=_[_0x0876('0x8f')](_[_0x0876('0x44')](_0x206faf,_0x0876('0x90')),function(_0x5daaa8){return _[_0x0876('0x91')](_0x24026e,_0x5daaa8);});if(_0x58fb8d){return _0x47af80['id'];}}}));}}return BPromise[_0x0876('0x92')](_0x3b39ce)[_0x0876('0x36')](function(_0x394e3a){_0x4f35da=_(_0x4f35da)[_0x0876('0x93')](_0x394e3a)['compact']()[_0x0876('0x94')]();return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x40b5f5[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](function(_0x1c2635){return db['sequelize'][_0x0876('0x95')](function(_0x53e0aa){return _0x1c2635[_0x0876('0x96')](_0x40b5f5[_0x0876('0x45')][_0x0876('0x78')],{'transaction':_0x53e0aa})[_0x0876('0x36')](function(){if(!_[_0x0876('0x97')](_0x4f35da)){return _0x1c2635[_0x0876('0x98')](_0x4f35da,{'transaction':_0x53e0aa});}})['then'](function(){_0x4f35da['forEach'](function(_0x315ce1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':_0x315ce1,'ChatQueueId':_0x1c2635['id']});});});});});});})[_0x0876('0x36')](respondWithStatusCode(_0x1a793b,null))[_0x0876('0x2a')](handleError(_0x1a793b,null));};exports['addAgents']=function(_0x496d3f,_0x122dd9,_0xc8b26a){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x496d3f[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x122dd9,null))[_0x0876('0x36')](function(_0x45a245){if(_0x45a245){return _0x45a245[_0x0876('0x9a')](_0x496d3f[_0x0876('0x64')][_0x0876('0x78')],_[_0x0876('0x9b')](_0x496d3f[_0x0876('0x64')],[_0x0876('0x78'),'id'])||{})[_0x0876('0x9c')](function(_0x58d861){for(var _0x501a1b=0x0;_0x501a1b<_0x496d3f['body'][_0x0876('0x78')]['length'];_0x501a1b+=0x1){socket['emit'](_0x0876('0x81'),{'UserId':Number(_0x496d3f[_0x0876('0x64')][_0x0876('0x78')][_0x501a1b]),'ChatQueueId':Number(_0x496d3f[_0x0876('0x5a')]['id'])});}return _0x58d861;});}})[_0x0876('0x36')](respondWithResult(_0x122dd9,null))['catch'](handleError(_0x122dd9,null));};exports[_0x0876('0x98')]=function(_0x44c3f2,_0x367e9f,_0x5b12f8){return db[_0x0876('0x3f')][_0x0876('0x65')]({'where':{'id':_0x44c3f2['params']['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x367e9f,null))[_0x0876('0x36')](function(_0x2bb535){if(_0x2bb535){return _0x2bb535[_0x0876('0x98')](_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')])[_0x0876('0x36')](function(){if(_['isArray'](_0x44c3f2[_0x0876('0x45')]['ids'])){for(var _0x29948e=0x0;_0x29948e<_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x0876('0x4b')];_0x29948e+=0x1){socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')][_0x29948e]),'ChatQueueId':Number(_0x44c3f2[_0x0876('0x5a')]['id'])});}}else{socket[_0x0876('0x80')](_0x0876('0x99'),{'UserId':Number(_0x44c3f2[_0x0876('0x45')][_0x0876('0x78')]),'ChatQueueId':Number(_0x44c3f2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x367e9f,null))['catch'](handleError(_0x367e9f,null));};exports[_0x0876('0x9d')]=function(_0x3b93e7,_0x14fea0,_0xc305bc){var _0x5ef0be={};var _0x11345a={};var _0x4ed2dc;var _0x1fd5e2;return db['ChatQueue'][_0x0876('0x68')]({'where':{'id':_0x3b93e7[_0x0876('0x5a')]['id']}})[_0x0876('0x36')](handleEntityNotFound(_0x14fea0,null))[_0x0876('0x36')](function(_0x3b6d1d){if(_0x3b6d1d){_0x4ed2dc=_0x3b6d1d;_0x11345a['model']=_[_0x0876('0x46')](db['User'][_0x0876('0x76')]);_0x11345a[_0x0876('0x45')]=_[_0x0876('0x46')](_0x3b93e7['query']);_0x11345a[_0x0876('0x47')]=_['intersection'](_0x11345a['model'],_0x11345a[_0x0876('0x45')]);_0x5ef0be[_0x0876('0x49')]=_[_0x0876('0x48')](_0x11345a['model'],qs[_0x0876('0x4a')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4a')]));_0x5ef0be[_0x0876('0x49')]=_0x5ef0be[_0x0876('0x49')]['length']?_0x5ef0be[_0x0876('0x49')]:_0x11345a[_0x0876('0x43')];_0x5ef0be['order']=qs[_0x0876('0x50')](_0x3b93e7[_0x0876('0x45')]['sort']);_0x5ef0be['where']=qs[_0x0876('0x47')](_[_0x0876('0x51')](_0x3b93e7[_0x0876('0x45')],_0x11345a[_0x0876('0x47')]));if(_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]){_0x5ef0be[_0x0876('0x52')]=_['merge'](_0x5ef0be[_0x0876('0x52')],{'$or':_['map'](_0x5ef0be[_0x0876('0x49')],function(_0x2ed4cd){var _0x2b7fc5={};_0x2b7fc5[_0x2ed4cd]={'$like':'%'+_0x3b93e7[_0x0876('0x45')][_0x0876('0x54')]+'%'};return _0x2b7fc5;})});}_0x5ef0be=_['merge']({},_0x5ef0be,_0x3b93e7['options']);return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x36793c){if(_0x36793c){_0x1fd5e2=_0x36793c[_0x0876('0x4b')];if(!_0x3b93e7[_0x0876('0x45')][_0x0876('0x4c')](_0x0876('0x4d'))){_0x5ef0be[_0x0876('0x4e')]=qs[_0x0876('0x4e')](_0x3b93e7[_0x0876('0x45')][_0x0876('0x4e')]);_0x5ef0be['offset']=qs[_0x0876('0x2f')](_0x3b93e7['query'][_0x0876('0x2f')]);}return _0x4ed2dc[_0x0876('0x9d')](_0x5ef0be);}})[_0x0876('0x36')](function(_0x226f25){if(_0x226f25){return _0x226f25?{'count':_0x1fd5e2,'rows':_0x226f25}:null;}})[_0x0876('0x36')](respondWithResult(_0x14fea0,null))[_0x0876('0x2a')](handleError(_0x14fea0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index ae4a98c..19e0ece 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 _0xf6d1=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ab59f,_0x2d3051){var _0x234db7=function(_0x2db228){while(--_0x2db228){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0x234db7(++_0x2d3051);}(_0xf6d1,0x99));var _0x1f6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf6d1[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x1f6d('0x0'));var ChatQueue=require(_0x1f6d('0x1'))['db'][_0x1f6d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1f6d('0x3')](0x0);var events={'afterCreate':_0x1f6d('0x4'),'afterUpdate':_0x1f6d('0x5'),'afterDestroy':_0x1f6d('0x6')};function emitEvent(_0x4fa5a2){return function(_0x1b8190,_0x59e1ab,_0x1532aa){ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2+':'+_0x1b8190['id'],_0x1b8190);ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2,_0x1b8190);_0x1532aa(null);};}for(var e in events){if(events[_0x1f6d('0x8')](e)){var event=events[e];ChatQueue[_0x1f6d('0x9')](e,emitEvent(event));}}module[_0x1f6d('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe528=['update','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0xe528,0x9d));var _0x8e52=function(_0x33f43e,_0x349e92){_0x33f43e=_0x33f43e-0x0;var _0xa9ae29=_0xe528[_0x33f43e];return _0xa9ae29;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x8e52('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e52('0x1')](0x0);var events={'afterCreate':_0x8e52('0x2'),'afterUpdate':_0x8e52('0x3'),'afterDestroy':'remove'};function emitEvent(_0x59aed4){return function(_0x450338,_0x454f2d,_0x1bd4fb){ChatQueueEvents[_0x8e52('0x4')](_0x59aed4+':'+_0x450338['id'],_0x450338);ChatQueueEvents['emit'](_0x59aed4,_0x450338);_0x1bd4fb(null);};}for(var e in events){if(events[_0x8e52('0x5')](e)){var event=events[e];ChatQueue[_0x8e52('0x6')](e,emitEvent(event));}}module[_0x8e52('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6f01525..ca5bb1b 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 _0x0244=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0xf93365,_0x26c5eb){var _0x42fa5d=function(_0x5b9aee){while(--_0x5b9aee){_0xf93365['push'](_0xf93365['shift']());}};_0x42fa5d(++_0x26c5eb);}(_0x0244,0x14b));var _0x4024=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x0244[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4024('0x0'));var util=require(_0x4024('0x1'));var logger=require(_0x4024('0x2'))(_0x4024('0x3'));var moment=require(_0x4024('0x4'));var BPromise=require(_0x4024('0x5'));var rp=require(_0x4024('0x6'));var fs=require('fs');var path=require(_0x4024('0x7'));var rimraf=require(_0x4024('0x8'));var config=require(_0x4024('0x9'));var attributes=require('./chatQueue.attributes');module[_0x4024('0xa')]=function(_0x4aca82,_0x41efe7){return _0x4aca82[_0x4024('0xb')](_0x4024('0xc'),attributes,{'tableName':_0x4024('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7de=['bluebird','request-promise','./chatQueue.attributes','chat_queues','lodash','../../config/logger'];(function(_0x16ba5b,_0x34ba4c){var _0xc98ed9=function(_0x197167){while(--_0x197167){_0x16ba5b['push'](_0x16ba5b['shift']());}};_0xc98ed9(++_0x34ba4c);}(_0xb7de,0x70));var _0xeb7d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb7de[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeb7d('0x0'));var util=require('util');var logger=require(_0xeb7d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xeb7d('0x2'));var rp=require(_0xeb7d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb7d('0x4'));module['exports']=function(_0x3c65ba,_0x3b4c1f){return _0x3c65ba['define']('ChatQueue',attributes,{'tableName':_0xeb7d('0x5'),'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 36c48fd..5715f59 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 _0xc584=['request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','ShowChatQueue','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','debug'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0xc584,0xa8));var _0x4c58=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xc584[_0x312abc];return _0x314298;};'use strict';var _=require('lodash');var util=require(_0x4c58('0x0'));var moment=require(_0x4c58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c58('0x3'));var logger=require(_0x4c58('0x4'))(_0x4c58('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c58('0x6'));var client=jayson[_0x4c58('0x7')][_0x4c58('0x8')]({'port':0x232a});config[_0x4c58('0x9')]=_[_0x4c58('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c58('0x9')]));require(_0x4c58('0xb'))[_0x4c58('0xc')](socket);function respondWithRpcPromise(_0x39405a,_0xb89ef4,_0x23a115){return new BPromise(function(_0x85e280,_0xd08c65){return client[_0x4c58('0xd')](_0x39405a,_0x23a115)[_0x4c58('0xe')](function(_0x2b21da){logger[_0x4c58('0xf')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,'request\x20sent');logger[_0x4c58('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xb89ef4,_0x4c58('0x11'),JSON[_0x4c58('0x12')](_0x2b21da));if(_0x2b21da[_0x4c58('0x13')]){if(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x14')]===0x1f4){logger[_0x4c58('0x13')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,_0x2b21da[_0x4c58('0x13')]['message']);return _0xd08c65(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);}logger[_0x4c58('0x13')](_0x4c58('0x16'),_0xb89ef4,_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);return _0x85e280(_0x2b21da['error'][_0x4c58('0x15')]);}else{logger[_0x4c58('0xf')](_0x4c58('0x16'),_0xb89ef4,_0x4c58('0x11'));_0x85e280(_0x2b21da[_0x4c58('0x17')]['message']);}})[_0x4c58('0x18')](function(_0x45b1ab){logger['error'](_0x4c58('0x16'),_0xb89ef4,_0x45b1ab);_0xd08c65(_0x45b1ab);});});}exports[_0x4c58('0x19')]=function(_0x1a0062){var _0x2413f4=this;return new Promise(function(_0x227931,_0x46876f){return db['ChatQueue'][_0x4c58('0x1a')]({'raw':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x1d')]||null:null,'attributes':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'limit':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1f')]||null:null,'include':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x20')],function(_0x41bc70){return{'model':db[_0x41bc70['model']],'as':_0x41bc70['as'],'attributes':_0x41bc70[_0x4c58('0x1e')],'include':_0x41bc70[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x41bc70[_0x4c58('0x20')],function(_0x317409){return{'model':db[_0x317409[_0x4c58('0x22')]],'as':_0x317409['as'],'attributes':_0x317409[_0x4c58('0x1e')],'include':_0x317409[_0x4c58('0x20')]?_['map'](_0x317409[_0x4c58('0x20')],function(_0x10b72c){return{'model':db[_0x10b72c[_0x4c58('0x22')]],'as':_0x10b72c['as'],'attributes':_0x10b72c[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c58('0xe')](function(_0x19ed6e){logger[_0x4c58('0xf')](_0x4c58('0x19'),_0x1a0062);logger[_0x4c58('0x10')](_0x4c58('0x19'),_0x1a0062,JSON[_0x4c58('0x12')](_0x19ed6e));_0x227931(_0x19ed6e);})[_0x4c58('0x18')](function(_0x3ec02a){logger[_0x4c58('0x13')](_0x4c58('0x19'),_0x3ec02a[_0x4c58('0x15')],_0x1a0062);_0x46876f(_0x2413f4[_0x4c58('0x13')](0x1f4,_0x3ec02a[_0x4c58('0x15')]));});});};exports['ShowChatQueue']=function(_0x540fad){var _0x5238c9=this;return new Promise(function(_0x282071,_0x50fbeb){return db[_0x4c58('0x23')]['find']({'raw':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x540fad['options']?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1d')]||null:null,'attributes':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'include':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x20')]?_['map'](_0x540fad['options']['include'],function(_0x284335){return{'model':db[_0x284335[_0x4c58('0x22')]],'as':_0x284335['as'],'attributes':_0x284335[_0x4c58('0x1e')],'include':_0x284335['include']?_[_0x4c58('0x21')](_0x284335[_0x4c58('0x20')],function(_0x10d420){return{'model':db[_0x10d420[_0x4c58('0x22')]],'as':_0x10d420['as'],'attributes':_0x10d420['attributes'],'include':_0x10d420[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x10d420[_0x4c58('0x20')],function(_0x4419a6){return{'model':db[_0x4419a6[_0x4c58('0x22')]],'as':_0x4419a6['as'],'attributes':_0x4419a6[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf032cc){logger['info']('ShowChatQueue',_0x540fad);logger[_0x4c58('0x10')]('ShowChatQueue',_0x540fad,JSON[_0x4c58('0x12')](_0xf032cc));_0x282071(_0xf032cc);})[_0x4c58('0x18')](function(_0x3b6aeb){logger[_0x4c58('0x13')](_0x4c58('0x24'),_0x3b6aeb['message'],_0x540fad);_0x50fbeb(_0x5238c9[_0x4c58('0x13')](0x1f4,_0x3b6aeb[_0x4c58('0x15')]));});});};
\ No newline at end of file
+var _0xebc4=['./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetChatQueue','ChatQueue','then','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','socket.io-emitter'];(function(_0x7b7e25,_0x36e928){var _0x24e1e5=function(_0x7711e6){while(--_0x7711e6){_0x7b7e25['push'](_0x7b7e25['shift']());}};_0x24e1e5(++_0x36e928);}(_0xebc4,0xf9));var _0x4ebc=function(_0x8df750,_0x22c0f5){_0x8df750=_0x8df750-0x0;var _0x290bc8=_0xebc4[_0x8df750];return _0x290bc8;};'use strict';var _=require('lodash');var util=require(_0x4ebc('0x0'));var moment=require(_0x4ebc('0x1'));var BPromise=require(_0x4ebc('0x2'));var rs=require(_0x4ebc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ebc('0x4'))['db'];var utils=require(_0x4ebc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ebc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4ebc('0x7')]['http']({'port':0x232a});config[_0x4ebc('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ebc('0x9'))(new Redis(config[_0x4ebc('0x8')]));require(_0x4ebc('0xa'))[_0x4ebc('0xb')](socket);function respondWithRpcPromise(_0x46e0dc,_0x5d6a99,_0x27a221){return new BPromise(function(_0x1b5dbc,_0x12e3c6){return client[_0x4ebc('0xc')](_0x46e0dc,_0x27a221)['then'](function(_0x1522b9){logger['info'](_0x4ebc('0xd'),_0x5d6a99,_0x4ebc('0xe'));logger[_0x4ebc('0xf')](_0x4ebc('0x10'),_0x5d6a99,'request\x20sent',JSON[_0x4ebc('0x11')](_0x1522b9));if(_0x1522b9['error']){if(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x13')]===0x1f4){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);return _0x12e3c6(_0x1522b9['error'][_0x4ebc('0x14')]);}logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x1522b9[_0x4ebc('0x12')]['message']);return _0x1b5dbc(_0x1522b9[_0x4ebc('0x12')][_0x4ebc('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5d6a99,_0x4ebc('0xe'));_0x1b5dbc(_0x1522b9[_0x4ebc('0x15')]['message']);}})[_0x4ebc('0x16')](function(_0x28571e){logger[_0x4ebc('0x12')](_0x4ebc('0xd'),_0x5d6a99,_0x28571e);_0x12e3c6(_0x28571e);});});}exports['GetChatQueue']=function(_0x59251b){var _0x249dcf=this;return new Promise(function(_0x3e6195,_0x137ec9){return db['ChatQueue'][_0x4ebc('0x17')]({'raw':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x19')]===undefined?!![]:![]:!![],'where':_0x59251b['options']?_0x59251b['options'][_0x4ebc('0x1a')]||null:null,'attributes':_0x59251b['options']?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'limit':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1c')]||null:null,'include':_0x59251b[_0x4ebc('0x18')]?_0x59251b[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x59251b[_0x4ebc('0x18')]['include'],function(_0x376a83){return{'model':db[_0x376a83[_0x4ebc('0x1f')]],'as':_0x376a83['as'],'attributes':_0x376a83[_0x4ebc('0x1b')],'include':_0x376a83[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x376a83[_0x4ebc('0x1d')],function(_0x165924){return{'model':db[_0x165924[_0x4ebc('0x1f')]],'as':_0x165924['as'],'attributes':_0x165924[_0x4ebc('0x1b')],'include':_0x165924[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x165924['include'],function(_0x10b09a){return{'model':db[_0x10b09a[_0x4ebc('0x1f')]],'as':_0x10b09a['as'],'attributes':_0x10b09a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42590d){logger[_0x4ebc('0x20')](_0x4ebc('0x21'),_0x59251b);logger[_0x4ebc('0xf')](_0x4ebc('0x21'),_0x59251b,JSON[_0x4ebc('0x11')](_0x42590d));_0x3e6195(_0x42590d);})[_0x4ebc('0x16')](function(_0x1d3d15){logger[_0x4ebc('0x12')]('GetChatQueue',_0x1d3d15[_0x4ebc('0x14')],_0x59251b);_0x137ec9(_0x249dcf[_0x4ebc('0x12')](0x1f4,_0x1d3d15[_0x4ebc('0x14')]));});});};exports['ShowChatQueue']=function(_0x3f9c40){var _0xbf2673=this;return new Promise(function(_0x141869,_0x3da50a){return db[_0x4ebc('0x22')]['find']({'raw':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1a')]||null:null,'attributes':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1b')]||null:null,'include':_0x3f9c40[_0x4ebc('0x18')]?_0x3f9c40[_0x4ebc('0x18')][_0x4ebc('0x1d')]?_['map'](_0x3f9c40['options'][_0x4ebc('0x1d')],function(_0x136d78){return{'model':db[_0x136d78[_0x4ebc('0x1f')]],'as':_0x136d78['as'],'attributes':_0x136d78[_0x4ebc('0x1b')],'include':_0x136d78[_0x4ebc('0x1d')]?_[_0x4ebc('0x1e')](_0x136d78[_0x4ebc('0x1d')],function(_0x4af0ec){return{'model':db[_0x4af0ec[_0x4ebc('0x1f')]],'as':_0x4af0ec['as'],'attributes':_0x4af0ec['attributes'],'include':_0x4af0ec['include']?_[_0x4ebc('0x1e')](_0x4af0ec[_0x4ebc('0x1d')],function(_0x34b276){return{'model':db[_0x34b276[_0x4ebc('0x1f')]],'as':_0x34b276['as'],'attributes':_0x34b276[_0x4ebc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ebc('0x23')](function(_0x4fcfb6){logger[_0x4ebc('0x20')]('ShowChatQueue',_0x3f9c40);logger['debug'](_0x4ebc('0x24'),_0x3f9c40,JSON[_0x4ebc('0x11')](_0x4fcfb6));_0x141869(_0x4fcfb6);})[_0x4ebc('0x16')](function(_0x28ab22){logger[_0x4ebc('0x12')](_0x4ebc('0x24'),_0x28ab22[_0x4ebc('0x14')],_0x3f9c40);_0x3da50a(_0xbf2673['error'](0x1f4,_0x28ab22['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0967b79..0b6fa75 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 _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0xa9ac50,_0x14e3e4){var _0xfabbe7=function(_0x2b68b5){while(--_0x2b68b5){_0xa9ac50['push'](_0xa9ac50['shift']());}};_0xfabbe7(++_0x14e3e4);}(_0xec56,0x1bd));var _0x6ec5=function(_0x26e154,_0x5e8835){_0x26e154=_0x26e154-0x0;var _0x3e949d=_0xec56[_0x26e154];return _0x3e949d;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}};
\ No newline at end of file
+var _0x54ef=['remove','emit','removeListener','length','./chatQueue.events','save'];(function(_0x42ffa2,_0x4b3b89){var _0x281f01=function(_0x101e47){while(--_0x101e47){_0x42ffa2['push'](_0x42ffa2['shift']());}};_0x281f01(++_0x4b3b89);}(_0x54ef,0x112));var _0xf54e=function(_0x12baa8,_0x30d9b6){_0x12baa8=_0x12baa8-0x0;var _0x3a0200=_0x54ef[_0x12baa8];return _0x3a0200;};'use strict';var ChatQueueEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){ChatQueueEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('chatQueue:'+_0x561870,_0x55e611);ChatQueueEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e4b7ba2..56ff6f0 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3bec85,_0x37d590){var _0x26e51a=function(_0xd347f5){while(--_0xd347f5){_0x3bec85['push'](_0x3bec85['shift']());}};_0x26e51a(++_0x37d590);}(_0xe14b,0x93));var _0xbe14=function(_0x36cfae,_0x35dae4){_0x36cfae=_0x36cfae-0x0;var _0x297137=_0xe14b[_0x36cfae];return _0x297137;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x495acd,_0x2d5066){var _0x4a46d8=function(_0x5dec06){while(--_0x5dec06){_0x495acd['push'](_0x495acd['shift']());}};_0x4a46d8(++_0x2d5066);}(_0x55ca,0x126));var _0xa55c=function(_0x5530a9,_0x48e4c2){_0x5530a9=_0x5530a9-0x0;var _0x1c69f4=_0x55ca[_0x5530a9];return _0x1c69f4;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 228d3e0..0bdb05a 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 _0xdeeb=['exports','STRING','DATE','moment'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xdeeb,0x1b3));var _0xbdee=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xdeeb[_0x9fd887];return _0x1a54ab;};'use strict';var moment=require(_0xbdee('0x0'));var Sequelize=require('sequelize');module[_0xbdee('0x1')]={'uniqueid':{'type':Sequelize[_0xbdee('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbdee('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbdee('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbdee('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2707=['STRING','DATE','moment'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2707,0x143));var _0x7270=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2707[_0x2e4e19];return _0x9ba20b;};'use strict';var moment=require(_0x7270('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x7270('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7270('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7270('0x2')]},'reason':{'type':Sequelize[_0x7270('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 15e9eed..41a7625 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 _0x6ab9=['query','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','intersection'];(function(_0x2ad5cb,_0x34bf2a){var _0x3e3b42=function(_0x2a7be2){while(--_0x2a7be2){_0x2ad5cb['push'](_0x2ad5cb['shift']());}};_0x3e3b42(++_0x34bf2a);}(_0x6ab9,0x19a));var _0x96ab=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6ab9[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x96ab('0x0'));var rimraf=require(_0x96ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96ab('0x2'));var rp=require(_0x96ab('0x3'));var moment=require(_0x96ab('0x4'));var BPromise=require(_0x96ab('0x5'));var Mustache=require(_0x96ab('0x6'));var util=require('util');var path=require('path');var sox=require(_0x96ab('0x7'));var csv=require(_0x96ab('0x8'));var ejs=require(_0x96ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x8'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var Redis=require(_0x96ab('0x10'));var authService=require(_0x96ab('0x11'));var qs=require(_0x96ab('0x12'));var as=require(_0x96ab('0x13'));var hardwareService=require(_0x96ab('0x14'));var logger=require(_0x96ab('0x15'))(_0x96ab('0x16'));var utils=require(_0x96ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9204,_0x1131b5){_0x1131b5=_0x1131b5||0xcc;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2c9204[_0x96ab('0x19')](_0x1131b5);}return _0x2c9204[_0x96ab('0x1a')](_0x1131b5)[_0x96ab('0x1b')]();};}function respondWithResult(_0x3ff9a9,_0x24e2c4){_0x24e2c4=_0x24e2c4||0xc8;return function(_0x126761){if(_0x126761){return _0x3ff9a9[_0x96ab('0x1a')](_0x24e2c4)[_0x96ab('0x1c')](_0x126761);}};}function respondWithFilteredResult(_0x4df67b,_0x4ec844){return function(_0x3b54cc){if(_0x3b54cc){var _0x8d5c87=typeof _0x4ec844[_0x96ab('0x1d')]==='undefined'&&typeof _0x4ec844[_0x96ab('0x1e')]===_0x96ab('0x1f');var _0x56f92b=_0x3b54cc[_0x96ab('0x20')];var _0x4eca78=_0x8d5c87?0x0:_0x4ec844[_0x96ab('0x1d')];var _0x1a502a=_0x8d5c87?_0x3b54cc[_0x96ab('0x20')]:_0x4ec844[_0x96ab('0x1d')]+_0x4ec844[_0x96ab('0x1e')];var _0x1577bb;if(_0x1a502a>=_0x56f92b){_0x1a502a=_0x56f92b;_0x1577bb=0xc8;}else{_0x1577bb=0xce;}_0x4df67b[_0x96ab('0x1a')](_0x1577bb);return _0x4df67b[_0x96ab('0x21')](_0x96ab('0x22'),_0x4eca78+'-'+_0x1a502a+'/'+_0x56f92b)[_0x96ab('0x1c')](_0x3b54cc);}return null;};}function patchUpdates(_0x2aa3c4){return function(_0x4f3bb4){try{jsonpatch['apply'](_0x4f3bb4,_0x2aa3c4,!![]);}catch(_0x347b91){return BPromise[_0x96ab('0x23')](_0x347b91);}return _0x4f3bb4[_0x96ab('0x24')]();};}function saveUpdates(_0x583be2,_0x41936c){return function(_0x5ccaaa){if(_0x5ccaaa){return _0x5ccaaa[_0x96ab('0x25')](_0x583be2)['then'](function(_0x33c140){return _0x33c140;});}return null;};}function removeEntity(_0x90fa22,_0x5a02d0){return function(_0x1deef7){if(_0x1deef7){return _0x1deef7[_0x96ab('0x26')]()[_0x96ab('0x27')](function(){_0x90fa22[_0x96ab('0x1a')](0xcc)[_0x96ab('0x1b')]();});}};}function handleEntityNotFound(_0x27d6d5,_0x9cb9b6){return function(_0x2837a7){if(!_0x2837a7){_0x27d6d5[_0x96ab('0x19')](0x194);}return _0x2837a7;};}function handleError(_0x53869e,_0x215f09){_0x215f09=_0x215f09||0x1f4;return function(_0x524e1c){logger[_0x96ab('0x28')](_0x524e1c[_0x96ab('0x29')]);if(_0x524e1c[_0x96ab('0x2a')]){delete _0x524e1c[_0x96ab('0x2a')];}_0x53869e[_0x96ab('0x1a')](_0x215f09)[_0x96ab('0x2b')](_0x524e1c);};}exports[_0x96ab('0x2c')]=function(_0x435613,_0x4f954c){var _0xefb070={},_0x269c51={},_0xa5c503={'count':0x0,'rows':[]};var _0x5a998e=_[_0x96ab('0x2d')](db[_0x96ab('0x2e')][_0x96ab('0x2f')],function(_0x575664){return{'name':_0x575664[_0x96ab('0x30')],'type':_0x575664['type'][_0x96ab('0x31')]};});_0x269c51[_0x96ab('0x32')]=_['map'](_0x5a998e,_0x96ab('0x2a'));_0x269c51['query']=_['keys'](_0x435613['query']);_0x269c51['filters']=_[_0x96ab('0x33')](_0x269c51['model'],_0x269c51[_0x96ab('0x34')]);_0xefb070[_0x96ab('0x35')]=_[_0x96ab('0x33')](_0x269c51[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x435613['query']['fields']));_0xefb070[_0x96ab('0x35')]=_0xefb070[_0x96ab('0x35')]['length']?_0xefb070[_0x96ab('0x35')]:_0x269c51[_0x96ab('0x32')];if(!_0x435613['query']['hasOwnProperty'](_0x96ab('0x37'))){_0xefb070[_0x96ab('0x1e')]=qs[_0x96ab('0x1e')](_0x435613[_0x96ab('0x34')]['limit']);_0xefb070[_0x96ab('0x1d')]=qs['offset'](_0x435613['query'][_0x96ab('0x1d')]);}_0xefb070['order']=qs[_0x96ab('0x38')](_0x435613[_0x96ab('0x34')][_0x96ab('0x38')]);_0xefb070[_0x96ab('0x39')]=qs['filters'](_[_0x96ab('0x3a')](_0x435613[_0x96ab('0x34')],_0x269c51[_0x96ab('0x3b')]),_0x5a998e);if(_0x435613[_0x96ab('0x34')][_0x96ab('0x3c')]){_0xefb070['where']=_[_0x96ab('0x3d')](_0xefb070['where'],{'$or':_[_0x96ab('0x2d')](_0x5a998e,function(_0x4dae51){if(_0x4dae51[_0x96ab('0x3e')]!==_0x96ab('0x3f')){var _0x3f2305={};_0x3f2305[_0x4dae51[_0x96ab('0x2a')]]={'$like':'%'+_0x435613['query'][_0x96ab('0x3c')]+'%'};return _0x3f2305;}})});}_0xefb070=_[_0x96ab('0x3d')]({},_0xefb070,_0x435613[_0x96ab('0x40')]);var _0x3c7e5d={'where':_0xefb070[_0x96ab('0x39')]};return db[_0x96ab('0x2e')][_0x96ab('0x20')](_0x3c7e5d)[_0x96ab('0x27')](function(_0x14bcbf){_0xa5c503[_0x96ab('0x20')]=_0x14bcbf;if(_0x435613[_0x96ab('0x34')][_0x96ab('0x41')]){_0xefb070['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x96ab('0x42')](_0xefb070);})[_0x96ab('0x27')](function(_0xb541d8){_0xa5c503[_0x96ab('0x43')]=_0xb541d8;return _0xa5c503;})[_0x96ab('0x27')](respondWithFilteredResult(_0x4f954c,_0xefb070))[_0x96ab('0x44')](handleError(_0x4f954c,null));};exports[_0x96ab('0x45')]=function(_0x4b73d7,_0x347957){var _0x53f848={'raw':!![],'where':{'id':_0x4b73d7[_0x96ab('0x46')]['id']}},_0x5e8109={};_0x5e8109[_0x96ab('0x32')]=_['keys'](db[_0x96ab('0x2e')][_0x96ab('0x2f')]);_0x5e8109[_0x96ab('0x34')]=_[_0x96ab('0x47')](_0x4b73d7[_0x96ab('0x34')]);_0x5e8109['filters']=_[_0x96ab('0x33')](_0x5e8109['model'],_0x5e8109['query']);_0x53f848[_0x96ab('0x35')]=_['intersection'](_0x5e8109[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x4b73d7[_0x96ab('0x34')]['fields']));_0x53f848[_0x96ab('0x35')]=_0x53f848[_0x96ab('0x35')][_0x96ab('0x48')]?_0x53f848[_0x96ab('0x35')]:_0x5e8109[_0x96ab('0x32')];if(_0x4b73d7['query'][_0x96ab('0x41')]){_0x53f848['include']=[{'all':!![]}];}_0x53f848=_[_0x96ab('0x3d')]({},_0x53f848,_0x4b73d7['options']);return db[_0x96ab('0x2e')]['find'](_0x53f848)[_0x96ab('0x27')](handleEntityNotFound(_0x347957,null))[_0x96ab('0x27')](respondWithResult(_0x347957,null))[_0x96ab('0x44')](handleError(_0x347957,null));};exports[_0x96ab('0x49')]=function(_0x25d387,_0x42dbd7){return db['ChatQueueReport'][_0x96ab('0x49')](_0x25d387[_0x96ab('0x4a')],{})['then'](respondWithResult(_0x42dbd7,0xc9))[_0x96ab('0x44')](handleError(_0x42dbd7,null));};exports['update']=function(_0x14b467,_0x170992){if(_0x14b467[_0x96ab('0x4a')]['id']){delete _0x14b467['body']['id'];}return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x14b467['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x170992,null))[_0x96ab('0x27')](saveUpdates(_0x14b467[_0x96ab('0x4a')],null))[_0x96ab('0x27')](respondWithResult(_0x170992,null))[_0x96ab('0x44')](handleError(_0x170992,null));};exports[_0x96ab('0x26')]=function(_0x13b865,_0x5f2521){return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x13b865['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x5f2521,null))[_0x96ab('0x27')](removeEntity(_0x5f2521,null))['catch'](handleError(_0x5f2521,null));};exports[_0x96ab('0x4c')]=function(_0x2454b4,_0x391169){return db[_0x96ab('0x2e')][_0x96ab('0x4c')]()[_0x96ab('0x27')](respondWithResult(_0x391169,null))[_0x96ab('0x44')](handleError(_0x391169,null));};
\ No newline at end of file
+var _0xacc6=['index','map','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatQueueReport','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send'];(function(_0x283290,_0x1bef2f){var _0x4c7e20=function(_0x44d8ad){while(--_0x44d8ad){_0x283290['push'](_0x283290['shift']());}};_0x4c7e20(++_0x1bef2f);}(_0xacc6,0x150));var _0x6acc=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xacc6[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x6acc('0x0'));var rimraf=require(_0x6acc('0x1'));var zipdir=require(_0x6acc('0x2'));var jsonpatch=require(_0x6acc('0x3'));var rp=require(_0x6acc('0x4'));var moment=require('moment');var BPromise=require(_0x6acc('0x5'));var Mustache=require(_0x6acc('0x6'));var util=require(_0x6acc('0x7'));var path=require('path');var sox=require(_0x6acc('0x8'));var csv=require('to-csv');var ejs=require(_0x6acc('0x9'));var fs=require('fs');var fs_extra=require(_0x6acc('0xa'));var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0xe'));var querystring=require(_0x6acc('0xf'));var Papa=require('papaparse');var Redis=require(_0x6acc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x11'));var as=require(_0x6acc('0x12'));var hardwareService=require(_0x6acc('0x13'));var logger=require(_0x6acc('0x14'))(_0x6acc('0x15'));var utils=require(_0x6acc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6acc('0x17'));var db=require(_0x6acc('0x18'))['db'];function respondWithStatusCode(_0x1d951c,_0xcf8224){_0xcf8224=_0xcf8224||0xcc;return function(_0x1b95a6){if(_0x1b95a6){return _0x1d951c['sendStatus'](_0xcf8224);}return _0x1d951c['status'](_0xcf8224)[_0x6acc('0x19')]();};}function respondWithResult(_0x497356,_0x14a543){_0x14a543=_0x14a543||0xc8;return function(_0x230318){if(_0x230318){return _0x497356[_0x6acc('0x1a')](_0x14a543)[_0x6acc('0x1b')](_0x230318);}};}function respondWithFilteredResult(_0x3c4e61,_0x4034fb){return function(_0xf24527){if(_0xf24527){var _0xc07208=typeof _0x4034fb[_0x6acc('0x1c')]===_0x6acc('0x1d')&&typeof _0x4034fb[_0x6acc('0x1e')]===_0x6acc('0x1d');var _0x24f513=_0xf24527[_0x6acc('0x1f')];var _0x3818d8=_0xc07208?0x0:_0x4034fb[_0x6acc('0x1c')];var _0x4ee616=_0xc07208?_0xf24527[_0x6acc('0x1f')]:_0x4034fb[_0x6acc('0x1c')]+_0x4034fb[_0x6acc('0x1e')];var _0x151282;if(_0x4ee616>=_0x24f513){_0x4ee616=_0x24f513;_0x151282=0xc8;}else{_0x151282=0xce;}_0x3c4e61['status'](_0x151282);return _0x3c4e61[_0x6acc('0x20')]('Content-Range',_0x3818d8+'-'+_0x4ee616+'/'+_0x24f513)['json'](_0xf24527);}return null;};}function patchUpdates(_0x4af9e){return function(_0x5d5382){try{jsonpatch[_0x6acc('0x21')](_0x5d5382,_0x4af9e,!![]);}catch(_0x3edf4a){return BPromise[_0x6acc('0x22')](_0x3edf4a);}return _0x5d5382[_0x6acc('0x23')]();};}function saveUpdates(_0x245536,_0x5ecb25){return function(_0x3e4a71){if(_0x3e4a71){return _0x3e4a71[_0x6acc('0x24')](_0x245536)['then'](function(_0x334416){return _0x334416;});}return null;};}function removeEntity(_0x5ba0b6,_0x22abf1){return function(_0x1db7bd){if(_0x1db7bd){return _0x1db7bd[_0x6acc('0x25')]()[_0x6acc('0x26')](function(){_0x5ba0b6['status'](0xcc)[_0x6acc('0x19')]();});}};}function handleEntityNotFound(_0xa4d97c,_0x4a4ca1){return function(_0x10f286){if(!_0x10f286){_0xa4d97c[_0x6acc('0x27')](0x194);}return _0x10f286;};}function handleError(_0x441f90,_0x125084){_0x125084=_0x125084||0x1f4;return function(_0x212bde){logger[_0x6acc('0x28')](_0x212bde[_0x6acc('0x29')]);if(_0x212bde[_0x6acc('0x2a')]){delete _0x212bde['name'];}_0x441f90[_0x6acc('0x1a')](_0x125084)[_0x6acc('0x2b')](_0x212bde);};}exports[_0x6acc('0x2c')]=function(_0x490ce6,_0x1bcfad){var _0x8e75a9={},_0x3c8c95={},_0x259373={'count':0x0,'rows':[]};var _0x19fdd3=_[_0x6acc('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x47ff48){return{'name':_0x47ff48['fieldName'],'type':_0x47ff48[_0x6acc('0x2e')][_0x6acc('0x2f')]};});_0x3c8c95[_0x6acc('0x30')]=_[_0x6acc('0x2d')](_0x19fdd3,_0x6acc('0x2a'));_0x3c8c95[_0x6acc('0x31')]=_['keys'](_0x490ce6['query']);_0x3c8c95[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],_0x3c8c95[_0x6acc('0x31')]);_0x8e75a9['attributes']=_[_0x6acc('0x33')](_0x3c8c95[_0x6acc('0x30')],qs['fields'](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x34')]));_0x8e75a9[_0x6acc('0x35')]=_0x8e75a9['attributes']['length']?_0x8e75a9[_0x6acc('0x35')]:_0x3c8c95[_0x6acc('0x30')];if(!_0x490ce6['query']['hasOwnProperty'](_0x6acc('0x36'))){_0x8e75a9[_0x6acc('0x1e')]=qs[_0x6acc('0x1e')](_0x490ce6['query'][_0x6acc('0x1e')]);_0x8e75a9[_0x6acc('0x1c')]=qs[_0x6acc('0x1c')](_0x490ce6[_0x6acc('0x31')][_0x6acc('0x1c')]);}_0x8e75a9['order']=qs[_0x6acc('0x37')](_0x490ce6['query'][_0x6acc('0x37')]);_0x8e75a9[_0x6acc('0x38')]=qs['filters'](_[_0x6acc('0x39')](_0x490ce6['query'],_0x3c8c95['filters']),_0x19fdd3);if(_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]){_0x8e75a9[_0x6acc('0x38')]=_['merge'](_0x8e75a9[_0x6acc('0x38')],{'$or':_['map'](_0x19fdd3,function(_0x1841b1){if(_0x1841b1['type']!==_0x6acc('0x3b')){var _0x13f74a={};_0x13f74a[_0x1841b1['name']]={'$like':'%'+_0x490ce6[_0x6acc('0x31')][_0x6acc('0x3a')]+'%'};return _0x13f74a;}})});}_0x8e75a9=_[_0x6acc('0x3c')]({},_0x8e75a9,_0x490ce6[_0x6acc('0x3d')]);var _0x46f7db={'where':_0x8e75a9[_0x6acc('0x38')]};return db[_0x6acc('0x3e')]['count'](_0x46f7db)['then'](function(_0x3481ad){_0x259373[_0x6acc('0x1f')]=_0x3481ad;if(_0x490ce6[_0x6acc('0x31')]['includeAll']){_0x8e75a9[_0x6acc('0x3f')]=[{'all':!![]}];}return db[_0x6acc('0x3e')][_0x6acc('0x40')](_0x8e75a9);})[_0x6acc('0x26')](function(_0x3f848c){_0x259373[_0x6acc('0x41')]=_0x3f848c;return _0x259373;})[_0x6acc('0x26')](respondWithFilteredResult(_0x1bcfad,_0x8e75a9))[_0x6acc('0x42')](handleError(_0x1bcfad,null));};exports[_0x6acc('0x43')]=function(_0x1c2776,_0x114709){var _0x17f828={'raw':!![],'where':{'id':_0x1c2776['params']['id']}},_0x5c938d={};_0x5c938d['model']=_[_0x6acc('0x44')](db['ChatQueueReport']['rawAttributes']);_0x5c938d[_0x6acc('0x31')]=_[_0x6acc('0x44')](_0x1c2776[_0x6acc('0x31')]);_0x5c938d[_0x6acc('0x32')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],_0x5c938d[_0x6acc('0x31')]);_0x17f828[_0x6acc('0x35')]=_[_0x6acc('0x33')](_0x5c938d[_0x6acc('0x30')],qs[_0x6acc('0x34')](_0x1c2776[_0x6acc('0x31')][_0x6acc('0x34')]));_0x17f828['attributes']=_0x17f828[_0x6acc('0x35')][_0x6acc('0x45')]?_0x17f828['attributes']:_0x5c938d[_0x6acc('0x30')];if(_0x1c2776['query'][_0x6acc('0x46')]){_0x17f828[_0x6acc('0x3f')]=[{'all':!![]}];}_0x17f828=_['merge']({},_0x17f828,_0x1c2776[_0x6acc('0x3d')]);return db[_0x6acc('0x3e')][_0x6acc('0x47')](_0x17f828)[_0x6acc('0x26')](handleEntityNotFound(_0x114709,null))[_0x6acc('0x26')](respondWithResult(_0x114709,null))['catch'](handleError(_0x114709,null));};exports[_0x6acc('0x48')]=function(_0x391a4f,_0x45c5e0){return db[_0x6acc('0x3e')][_0x6acc('0x48')](_0x391a4f[_0x6acc('0x49')],{})[_0x6acc('0x26')](respondWithResult(_0x45c5e0,0xc9))[_0x6acc('0x42')](handleError(_0x45c5e0,null));};exports[_0x6acc('0x24')]=function(_0x28e601,_0x1989a6){if(_0x28e601[_0x6acc('0x49')]['id']){delete _0x28e601[_0x6acc('0x49')]['id'];}return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x28e601[_0x6acc('0x4a')]['id']}})[_0x6acc('0x26')](handleEntityNotFound(_0x1989a6,null))['then'](saveUpdates(_0x28e601['body'],null))['then'](respondWithResult(_0x1989a6,null))[_0x6acc('0x42')](handleError(_0x1989a6,null));};exports[_0x6acc('0x25')]=function(_0x5d63ee,_0x13e10e){return db[_0x6acc('0x3e')][_0x6acc('0x47')]({'where':{'id':_0x5d63ee[_0x6acc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13e10e,null))[_0x6acc('0x26')](removeEntity(_0x13e10e,null))[_0x6acc('0x42')](handleError(_0x13e10e,null));};exports[_0x6acc('0x4b')]=function(_0x1a1e1f,_0x459b99){return db['ChatQueueReport'][_0x6acc('0x4b')]()[_0x6acc('0x26')](respondWithResult(_0x459b99,null))[_0x6acc('0x42')](handleError(_0x459b99,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 915a2dd..e7ae753 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_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
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x11d3b5,_0x13fce1){var _0x332d27=function(_0x346fcb){while(--_0x346fcb){_0x11d3b5['push'](_0x11d3b5['shift']());}};_0x332d27(++_0x13fce1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 863fe7a..9cef27f 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 _0x8748=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c7bbd,_0x5617f9){var _0x38e260=function(_0x538771){while(--_0x538771){_0x4c7bbd['push'](_0x4c7bbd['shift']());}};_0x38e260(++_0x5617f9);}(_0x8748,0x9e));var _0x8874=function(_0x471cfd,_0xe74c8c){_0x471cfd=_0x471cfd-0x0;var _0x12cf40=_0x8748[_0x471cfd];return _0x12cf40;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}exports[_0x8874('0x17')]=function(_0x1a1725){var _0x1e7138=this;return new Promise(function(_0x2122db,_0x484390){return db['ChatQueueReport'][_0x8874('0x18')](_0x1a1725[_0x8874('0x19')],{'raw':_0x1a1725[_0x8874('0x1a')]?_0x1a1725[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![]})[_0x8874('0xc')](function(_0x5e4552){logger[_0x8874('0xd')](_0x8874('0x17'),_0x1a1725);logger[_0x8874('0x10')]('CreateChatQueueReport',_0x1a1725,JSON[_0x8874('0x12')](_0x5e4552));_0x2122db(_0x5e4552);})[_0x8874('0x1c')](function(_0x18c03b){logger['error'](_0x8874('0x17'),_0x18c03b[_0x8874('0x15')],_0x1a1725);_0x484390(_0x1e7138[_0x8874('0x13')](0x1f4,_0x18c03b[_0x8874('0x15')]));});});};exports[_0x8874('0x1d')]=function(_0x55f589){var _0x38e938=this;return new Promise(function(_0x971726,_0x17665a){return db['ChatQueueReport'][_0x8874('0x1e')](_0x55f589['body'],{'raw':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f589['options']?_0x55f589[_0x8874('0x1a')][_0x8874('0x1f')]||null:null,'attributes':_0x55f589['options']?_0x55f589[_0x8874('0x1a')]['attributes']||null:null,'limit':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x20')]||null:null})['then'](function(_0x4a80a6){logger[_0x8874('0xd')]('UpdateChatQueueReport',_0x55f589);logger[_0x8874('0x10')](_0x8874('0x1d'),_0x55f589,JSON[_0x8874('0x12')](_0x4a80a6));_0x971726(_0x4a80a6);})[_0x8874('0x1c')](function(_0x289b2d){logger[_0x8874('0x13')](_0x8874('0x1d'),_0x289b2d[_0x8874('0x15')],_0x55f589);_0x17665a(_0x38e938[_0x8874('0x13')](0x1f4,_0x289b2d[_0x8874('0x15')]));});});};
\ No newline at end of file
+var _0x0de2=['message','info','result','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','attributes','limit','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2ab5c1,_0x50cd7d){var _0x24a514=function(_0x48be12){while(--_0x48be12){_0x2ab5c1['push'](_0x2ab5c1['shift']());}};_0x24a514(++_0x50cd7d);}(_0x0de2,0xa4));var _0x20de=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0x0de2[_0x422994];return _0x43ad8f;};'use strict';var _=require('lodash');var util=require(_0x20de('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20de('0x1'));var fs=require('fs');var Redis=require(_0x20de('0x2'));var db=require(_0x20de('0x3'))['db'];var utils=require(_0x20de('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x20de('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x20de('0x6')][_0x20de('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e72e0,_0x92d904,_0x46a18e){return new BPromise(function(_0x3bc681,_0x157494){return client[_0x20de('0x8')](_0x5e72e0,_0x46a18e)[_0x20de('0x9')](function(_0x149e8c){logger['info'](_0x20de('0xa'),_0x92d904,_0x20de('0xb'));logger[_0x20de('0xc')](_0x20de('0xd'),_0x92d904,_0x20de('0xb'),JSON['stringify'](_0x149e8c));if(_0x149e8c[_0x20de('0xe')]){if(_0x149e8c[_0x20de('0xe')][_0x20de('0xf')]===0x1f4){logger[_0x20de('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x149e8c[_0x20de('0xe')][_0x20de('0x10')]);return _0x157494(_0x149e8c['error'][_0x20de('0x10')]);}logger['error'](_0x20de('0xa'),_0x92d904,_0x149e8c[_0x20de('0xe')]['message']);return _0x3bc681(_0x149e8c[_0x20de('0xe')]['message']);}else{logger[_0x20de('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x92d904,_0x20de('0xb'));_0x3bc681(_0x149e8c[_0x20de('0x12')][_0x20de('0x10')]);}})['catch'](function(_0x4d76da){logger[_0x20de('0xe')](_0x20de('0xa'),_0x92d904,_0x4d76da);_0x157494(_0x4d76da);});});}exports['CreateChatQueueReport']=function(_0x35bd02){var _0x3c2924=this;return new Promise(function(_0x1fb1ce,_0x55d422){return db[_0x20de('0x13')][_0x20de('0x14')](_0x35bd02[_0x20de('0x15')],{'raw':_0x35bd02[_0x20de('0x16')]?_0x35bd02[_0x20de('0x16')][_0x20de('0x17')]===undefined?!![]:![]:!![]})[_0x20de('0x9')](function(_0x3ba9bb){logger[_0x20de('0x11')](_0x20de('0x18'),_0x35bd02);logger[_0x20de('0xc')](_0x20de('0x18'),_0x35bd02,JSON[_0x20de('0x19')](_0x3ba9bb));_0x1fb1ce(_0x3ba9bb);})['catch'](function(_0x57b938){logger[_0x20de('0xe')]('CreateChatQueueReport',_0x57b938[_0x20de('0x10')],_0x35bd02);_0x55d422(_0x3c2924['error'](0x1f4,_0x57b938[_0x20de('0x10')]));});});};exports[_0x20de('0x1a')]=function(_0x3ed8de){var _0x21bd82=this;return new Promise(function(_0x49dcd5,_0x4693c2){return db[_0x20de('0x13')]['update'](_0x3ed8de[_0x20de('0x15')],{'raw':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options'][_0x20de('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de['options']['where']||null:null,'attributes':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1b')]||null:null,'limit':_0x3ed8de[_0x20de('0x16')]?_0x3ed8de[_0x20de('0x16')][_0x20de('0x1c')]||null:null})[_0x20de('0x9')](function(_0x366839){logger[_0x20de('0x11')](_0x20de('0x1a'),_0x3ed8de);logger[_0x20de('0xc')](_0x20de('0x1a'),_0x3ed8de,JSON['stringify'](_0x366839));_0x49dcd5(_0x366839);})[_0x20de('0x1d')](function(_0x22ba5e){logger[_0x20de('0xe')](_0x20de('0x1a'),_0x22ba5e['message'],_0x3ed8de);_0x4693c2(_0x21bd82[_0x20de('0xe')](0x1f4,_0x22ba5e[_0x20de('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f435140..10ddfc3 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 _0x9d47=['put','update','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create'];(function(_0x3423b0,_0x4eb7e8){var _0x4b13cf=function(_0x900ca7){while(--_0x900ca7){_0x3423b0['push'](_0x3423b0['shift']());}};_0x4b13cf(++_0x4eb7e8);}(_0x9d47,0xca));var _0x79d4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9d47[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x79d4('0x0'));var util=require(_0x79d4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x79d4('0x2'));var auth=require(_0x79d4('0x3'));var interaction=require(_0x79d4('0x4'));var config=require(_0x79d4('0x5'));var controller=require(_0x79d4('0x6'));router[_0x79d4('0x7')]('/',auth['isAuthenticated'](),controller[_0x79d4('0x8')]);router['get'](_0x79d4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0xb')]);router[_0x79d4('0xc')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xd')]);router[_0x79d4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x79d4('0xf')]);router['delete']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0x10')]);module[_0x79d4('0x11')]=router;
\ No newline at end of file
+var _0xcea1=['isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xcea1,0x7f));var _0x1cea=function(_0x3058bc,_0x391ddb){_0x3058bc=_0x3058bc-0x0;var _0x586a60=_0xcea1[_0x3058bc];return _0x586a60;};'use strict';var multer=require(_0x1cea('0x0'));var util=require(_0x1cea('0x1'));var path=require(_0x1cea('0x2'));var timeout=require(_0x1cea('0x3'));var express=require('express');var router=express[_0x1cea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1cea('0x5'));var interaction=require(_0x1cea('0x6'));var config=require(_0x1cea('0x7'));var controller=require('./chatQueueReport.controller');router[_0x1cea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cea('0x8')]('/describe',auth[_0x1cea('0x9')](),controller['describe']);router[_0x1cea('0x8')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xb')]);router[_0x1cea('0xc')]('/',auth[_0x1cea('0x9')](),controller['create']);router[_0x1cea('0xd')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0xe')]);router[_0x1cea('0xf')](_0x1cea('0xa'),auth[_0x1cea('0x9')](),controller[_0x1cea('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index cc31e85..c336152 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x80d246,_0x167b6a){_0x80d246=_0x80d246-0x0;var _0x45ee56=_0xb43b[_0x80d246];return _0x45ee56;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x214d3d,_0x1c7156){var _0x1d585e=function(_0x41ce57){while(--_0x41ce57){_0x214d3d['push'](_0x214d3d['shift']());}};_0x1d585e(++_0x1c7156);}(_0xe706,0xa3));var _0x6e70=function(_0x374870,_0x82a474){_0x374870=_0x374870-0x0;var _0x4de8f4=_0xe706[_0x374870];return _0x4de8f4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 67129a1..922497a 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 _0xeb5d=['merge','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','stack','name','send','map','ChatTransferReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include'];(function(_0x44d8d1,_0x2a600e){var _0x5babcf=function(_0x5ae877){while(--_0x5ae877){_0x44d8d1['push'](_0x44d8d1['shift']());}};_0x5babcf(++_0x2a600e);}(_0xeb5d,0x126));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb5('0x1'));var rp=require(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require(_0xdeb5('0x6'));var sox=require(_0xdeb5('0x7'));var csv=require(_0xdeb5('0x8'));var ejs=require(_0xdeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xdeb5('0xa'));var _=require(_0xdeb5('0xb'));var squel=require(_0xdeb5('0xc'));var crypto=require('crypto');var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x8'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdeb5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdeb5('0x14'));var db=require(_0xdeb5('0x15'))['db'];function respondWithStatusCode(_0x5d918f,_0x52af87){_0x52af87=_0x52af87||0xcc;return function(_0x5999b0){if(_0x5999b0){return _0x5d918f[_0xdeb5('0x16')](_0x52af87);}return _0x5d918f[_0xdeb5('0x17')](_0x52af87)[_0xdeb5('0x18')]();};}function respondWithResult(_0x1cd6d0,_0x177a38){_0x177a38=_0x177a38||0xc8;return function(_0x1a653d){if(_0x1a653d){return _0x1cd6d0[_0xdeb5('0x17')](_0x177a38)['json'](_0x1a653d);}};}function respondWithFilteredResult(_0x10a162,_0x5bc7b8){return function(_0x48f79c){if(_0x48f79c){var _0x27ceb4=typeof _0x5bc7b8[_0xdeb5('0x19')]===_0xdeb5('0x1a')&&typeof _0x5bc7b8[_0xdeb5('0x1b')]===_0xdeb5('0x1a');var _0x451bc0=_0x48f79c[_0xdeb5('0x1c')];var _0x4cb8d6=_0x27ceb4?0x0:_0x5bc7b8[_0xdeb5('0x19')];var _0x2256a8=_0x27ceb4?_0x48f79c[_0xdeb5('0x1c')]:_0x5bc7b8[_0xdeb5('0x19')]+_0x5bc7b8[_0xdeb5('0x1b')];var _0x2f3cba;if(_0x2256a8>=_0x451bc0){_0x2256a8=_0x451bc0;_0x2f3cba=0xc8;}else{_0x2f3cba=0xce;}_0x10a162[_0xdeb5('0x17')](_0x2f3cba);return _0x10a162[_0xdeb5('0x1d')](_0xdeb5('0x1e'),_0x4cb8d6+'-'+_0x2256a8+'/'+_0x451bc0)['json'](_0x48f79c);}return null;};}function patchUpdates(_0x396e62){return function(_0xc83d89){try{jsonpatch['apply'](_0xc83d89,_0x396e62,!![]);}catch(_0x3ae0d5){return BPromise[_0xdeb5('0x1f')](_0x3ae0d5);}return _0xc83d89[_0xdeb5('0x20')]();};}function saveUpdates(_0x367d18,_0x43f779){return function(_0x5ece08){if(_0x5ece08){return _0x5ece08['update'](_0x367d18)['then'](function(_0x2aeb30){return _0x2aeb30;});}return null;};}function removeEntity(_0x581e5b,_0x552295){return function(_0xd0405e){if(_0xd0405e){return _0xd0405e[_0xdeb5('0x21')]()[_0xdeb5('0x22')](function(){_0x581e5b['status'](0xcc)[_0xdeb5('0x18')]();});}};}function handleEntityNotFound(_0x38e285,_0x40aaf5){return function(_0x449638){if(!_0x449638){_0x38e285[_0xdeb5('0x16')](0x194);}return _0x449638;};}function handleError(_0xec0fc0,_0x4a0cda){_0x4a0cda=_0x4a0cda||0x1f4;return function(_0xe51ce4){logger['error'](_0xe51ce4[_0xdeb5('0x23')]);if(_0xe51ce4['name']){delete _0xe51ce4[_0xdeb5('0x24')];}_0xec0fc0[_0xdeb5('0x17')](_0x4a0cda)[_0xdeb5('0x25')](_0xe51ce4);};}exports['index']=function(_0x223d5d,_0x334711){var _0x3000f8={},_0x1ad5be={},_0xc09c1e={'count':0x0,'rows':[]};var _0x3474ba=_[_0xdeb5('0x26')](db[_0xdeb5('0x27')]['rawAttributes'],function(_0x307970){return{'name':_0x307970[_0xdeb5('0x28')],'type':_0x307970['type'][_0xdeb5('0x29')]};});_0x1ad5be['model']=_['map'](_0x3474ba,'name');_0x1ad5be[_0xdeb5('0x2a')]=_['keys'](_0x223d5d['query']);_0x1ad5be[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],_0x1ad5be['query']);_0x3000f8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x2f')]));_0x3000f8['attributes']=_0x3000f8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3000f8[_0xdeb5('0x2e')]:_0x1ad5be[_0xdeb5('0x2d')];if(!_0x223d5d[_0xdeb5('0x2a')]['hasOwnProperty'](_0xdeb5('0x31'))){_0x3000f8[_0xdeb5('0x1b')]=qs[_0xdeb5('0x1b')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x1b')]);_0x3000f8[_0xdeb5('0x19')]=qs[_0xdeb5('0x19')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x19')]);}_0x3000f8[_0xdeb5('0x32')]=qs[_0xdeb5('0x33')](_0x223d5d[_0xdeb5('0x2a')]['sort']);_0x3000f8[_0xdeb5('0x34')]=qs[_0xdeb5('0x2b')](_[_0xdeb5('0x35')](_0x223d5d[_0xdeb5('0x2a')],_0x1ad5be[_0xdeb5('0x2b')]),_0x3474ba);if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x36')]){_0x3000f8[_0xdeb5('0x34')]=_['merge'](_0x3000f8['where'],{'$or':_['map'](_0x3474ba,function(_0x2ce4ef){if(_0x2ce4ef[_0xdeb5('0x37')]!==_0xdeb5('0x38')){var _0x212d5d={};_0x212d5d[_0x2ce4ef['name']]={'$like':'%'+_0x223d5d['query'][_0xdeb5('0x36')]+'%'};return _0x212d5d;}})});}_0x3000f8=_['merge']({},_0x3000f8,_0x223d5d[_0xdeb5('0x39')]);var _0x16a4d2={'where':_0x3000f8[_0xdeb5('0x34')]};return db[_0xdeb5('0x27')][_0xdeb5('0x1c')](_0x16a4d2)[_0xdeb5('0x22')](function(_0xbb9e1a){_0xc09c1e[_0xdeb5('0x1c')]=_0xbb9e1a;if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3000f8['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xdeb5('0x3b')](_0x3000f8);})[_0xdeb5('0x22')](function(_0x19ac48){_0xc09c1e[_0xdeb5('0x3c')]=_0x19ac48;return _0xc09c1e;})['then'](respondWithFilteredResult(_0x334711,_0x3000f8))['catch'](handleError(_0x334711,null));};exports[_0xdeb5('0x3d')]=function(_0x11635d,_0x42aae6){var _0x3fc6e8={'raw':!![],'where':{'id':_0x11635d[_0xdeb5('0x3e')]['id']}},_0x73ab8a={};_0x73ab8a['model']=_[_0xdeb5('0x3f')](db[_0xdeb5('0x27')][_0xdeb5('0x40')]);_0x73ab8a['query']=_[_0xdeb5('0x3f')](_0x11635d[_0xdeb5('0x2a')]);_0x73ab8a['filters']=_['intersection'](_0x73ab8a[_0xdeb5('0x2d')],_0x73ab8a['query']);_0x3fc6e8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x73ab8a[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x11635d['query'][_0xdeb5('0x2f')]));_0x3fc6e8[_0xdeb5('0x2e')]=_0x3fc6e8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3fc6e8[_0xdeb5('0x2e')]:_0x73ab8a['model'];if(_0x11635d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3fc6e8[_0xdeb5('0x41')]=[{'all':!![]}];}_0x3fc6e8=_[_0xdeb5('0x42')]({},_0x3fc6e8,_0x11635d[_0xdeb5('0x39')]);return db[_0xdeb5('0x27')][_0xdeb5('0x43')](_0x3fc6e8)[_0xdeb5('0x22')](handleEntityNotFound(_0x42aae6,null))[_0xdeb5('0x22')](respondWithResult(_0x42aae6,null))['catch'](handleError(_0x42aae6,null));};exports['create']=function(_0x159b4f,_0x486ef1){return db['ChatTransferReport'][_0xdeb5('0x44')](_0x159b4f[_0xdeb5('0x45')],{})[_0xdeb5('0x22')](respondWithResult(_0x486ef1,0xc9))['catch'](handleError(_0x486ef1,null));};exports['update']=function(_0x792656,_0x33cb4f){if(_0x792656['body']['id']){delete _0x792656[_0xdeb5('0x45')]['id'];}return db['ChatTransferReport'][_0xdeb5('0x43')]({'where':{'id':_0x792656[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x33cb4f,null))['then'](saveUpdates(_0x792656[_0xdeb5('0x45')],null))[_0xdeb5('0x22')](respondWithResult(_0x33cb4f,null))[_0xdeb5('0x46')](handleError(_0x33cb4f,null));};exports[_0xdeb5('0x21')]=function(_0x5bbfcd,_0x5d0ea5){return db[_0xdeb5('0x27')][_0xdeb5('0x43')]({'where':{'id':_0x5bbfcd[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x5d0ea5,null))[_0xdeb5('0x22')](removeEntity(_0x5d0ea5,null))[_0xdeb5('0x46')](handleError(_0x5d0ea5,null));};exports[_0xdeb5('0x47')]=function(_0x20dc06,_0x369cd7){return db['ChatTransferReport'][_0xdeb5('0x47')]()[_0xdeb5('0x22')](respondWithResult(_0x369cd7,null))['catch'](handleError(_0x369cd7,null));};
\ No newline at end of file
+var _0x09d9=['destroy','sendStatus','error','stack','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','then'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0x09d9,0x71));var _0x909d=function(_0x38838d,_0x15d035){_0x38838d=_0x38838d-0x0;var _0x9f6165=_0x09d9[_0x38838d];return _0x9f6165;};'use strict';var emlformat=require(_0x909d('0x0'));var rimraf=require(_0x909d('0x1'));var zipdir=require(_0x909d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x909d('0x3'));var moment=require(_0x909d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x909d('0x5'));var util=require('util');var path=require(_0x909d('0x6'));var sox=require(_0x909d('0x7'));var csv=require(_0x909d('0x8'));var ejs=require(_0x909d('0x9'));var fs=require('fs');var fs_extra=require(_0x909d('0xa'));var _=require(_0x909d('0xb'));var squel=require('squel');var crypto=require(_0x909d('0xc'));var jsforce=require(_0x909d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x909d('0x8'));var querystring=require(_0x909d('0xe'));var Papa=require(_0x909d('0xf'));var Redis=require('ioredis');var authService=require(_0x909d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x909d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x909d('0x12'));var utils=require(_0x909d('0x13'));var config=require(_0x909d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x909d('0x15'))['db'];function respondWithStatusCode(_0x30b7e3,_0x286a0e){_0x286a0e=_0x286a0e||0xcc;return function(_0x1e9495){if(_0x1e9495){return _0x30b7e3['sendStatus'](_0x286a0e);}return _0x30b7e3['status'](_0x286a0e)[_0x909d('0x16')]();};}function respondWithResult(_0xe0742c,_0x3651e1){_0x3651e1=_0x3651e1||0xc8;return function(_0x290d2c){if(_0x290d2c){return _0xe0742c['status'](_0x3651e1)[_0x909d('0x17')](_0x290d2c);}};}function respondWithFilteredResult(_0xc9fec0,_0x333d4f){return function(_0x44cd6f){if(_0x44cd6f){var _0x4b0fd6=typeof _0x333d4f['offset']===_0x909d('0x18')&&typeof _0x333d4f['limit']===_0x909d('0x18');var _0x38ee20=_0x44cd6f[_0x909d('0x19')];var _0x2f91c2=_0x4b0fd6?0x0:_0x333d4f[_0x909d('0x1a')];var _0x51eb39=_0x4b0fd6?_0x44cd6f[_0x909d('0x19')]:_0x333d4f[_0x909d('0x1a')]+_0x333d4f[_0x909d('0x1b')];var _0x114f74;if(_0x51eb39>=_0x38ee20){_0x51eb39=_0x38ee20;_0x114f74=0xc8;}else{_0x114f74=0xce;}_0xc9fec0[_0x909d('0x1c')](_0x114f74);return _0xc9fec0[_0x909d('0x1d')](_0x909d('0x1e'),_0x2f91c2+'-'+_0x51eb39+'/'+_0x38ee20)[_0x909d('0x17')](_0x44cd6f);}return null;};}function patchUpdates(_0x184144){return function(_0x1a818f){try{jsonpatch['apply'](_0x1a818f,_0x184144,!![]);}catch(_0x5f14cb){return BPromise[_0x909d('0x1f')](_0x5f14cb);}return _0x1a818f[_0x909d('0x20')]();};}function saveUpdates(_0x1e2400,_0x1a87c5){return function(_0x2d3a68){if(_0x2d3a68){return _0x2d3a68[_0x909d('0x21')](_0x1e2400)[_0x909d('0x22')](function(_0x3b0a71){return _0x3b0a71;});}return null;};}function removeEntity(_0x24e19d,_0x554ba7){return function(_0x36b126){if(_0x36b126){return _0x36b126[_0x909d('0x23')]()['then'](function(){_0x24e19d[_0x909d('0x1c')](0xcc)[_0x909d('0x16')]();});}};}function handleEntityNotFound(_0x57c829,_0x4b2ee3){return function(_0x47dc3b){if(!_0x47dc3b){_0x57c829[_0x909d('0x24')](0x194);}return _0x47dc3b;};}function handleError(_0x39a211,_0x3e24db){_0x3e24db=_0x3e24db||0x1f4;return function(_0x4d5169){logger[_0x909d('0x25')](_0x4d5169[_0x909d('0x26')]);if(_0x4d5169['name']){delete _0x4d5169['name'];}_0x39a211[_0x909d('0x1c')](_0x3e24db)[_0x909d('0x27')](_0x4d5169);};}exports['index']=function(_0x16f7e6,_0x209d66){var _0x4766ea={},_0x1b8f03={},_0x5a9cfc={'count':0x0,'rows':[]};var _0x5a5b70=_[_0x909d('0x28')](db[_0x909d('0x29')][_0x909d('0x2a')],function(_0x250e97){return{'name':_0x250e97[_0x909d('0x2b')],'type':_0x250e97[_0x909d('0x2c')][_0x909d('0x2d')]};});_0x1b8f03['model']=_[_0x909d('0x28')](_0x5a5b70,'name');_0x1b8f03[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x16f7e6[_0x909d('0x2e')]);_0x1b8f03[_0x909d('0x30')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],_0x1b8f03[_0x909d('0x2e')]);_0x4766ea[_0x909d('0x33')]=_[_0x909d('0x31')](_0x1b8f03[_0x909d('0x32')],qs['fields'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x34')]));_0x4766ea[_0x909d('0x33')]=_0x4766ea[_0x909d('0x33')][_0x909d('0x35')]?_0x4766ea['attributes']:_0x1b8f03[_0x909d('0x32')];if(!_0x16f7e6['query'][_0x909d('0x36')](_0x909d('0x37'))){_0x4766ea['limit']=qs[_0x909d('0x1b')](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x1b')]);_0x4766ea['offset']=qs[_0x909d('0x1a')](_0x16f7e6['query'][_0x909d('0x1a')]);}_0x4766ea['order']=qs['sort'](_0x16f7e6[_0x909d('0x2e')][_0x909d('0x38')]);_0x4766ea[_0x909d('0x39')]=qs[_0x909d('0x30')](_[_0x909d('0x3a')](_0x16f7e6['query'],_0x1b8f03['filters']),_0x5a5b70);if(_0x16f7e6[_0x909d('0x2e')]['filter']){_0x4766ea[_0x909d('0x39')]=_[_0x909d('0x3b')](_0x4766ea[_0x909d('0x39')],{'$or':_[_0x909d('0x28')](_0x5a5b70,function(_0x369a28){if(_0x369a28[_0x909d('0x2c')]!==_0x909d('0x3c')){var _0x3e8507={};_0x3e8507[_0x369a28[_0x909d('0x3d')]]={'$like':'%'+_0x16f7e6[_0x909d('0x2e')]['filter']+'%'};return _0x3e8507;}})});}_0x4766ea=_[_0x909d('0x3b')]({},_0x4766ea,_0x16f7e6[_0x909d('0x3e')]);var _0x58dc9={'where':_0x4766ea[_0x909d('0x39')]};return db[_0x909d('0x29')]['count'](_0x58dc9)[_0x909d('0x22')](function(_0x4b23ea){_0x5a9cfc['count']=_0x4b23ea;if(_0x16f7e6[_0x909d('0x2e')][_0x909d('0x3f')]){_0x4766ea[_0x909d('0x40')]=[{'all':!![]}];}return db[_0x909d('0x29')][_0x909d('0x41')](_0x4766ea);})[_0x909d('0x22')](function(_0x16db09){_0x5a9cfc[_0x909d('0x42')]=_0x16db09;return _0x5a9cfc;})[_0x909d('0x22')](respondWithFilteredResult(_0x209d66,_0x4766ea))[_0x909d('0x43')](handleError(_0x209d66,null));};exports[_0x909d('0x44')]=function(_0x3c2ec2,_0x1fb43b){var _0x2119d2={'raw':!![],'where':{'id':_0x3c2ec2['params']['id']}},_0x3ad6cc={};_0x3ad6cc[_0x909d('0x32')]=_[_0x909d('0x2f')](db['ChatTransferReport'][_0x909d('0x2a')]);_0x3ad6cc[_0x909d('0x2e')]=_[_0x909d('0x2f')](_0x3c2ec2['query']);_0x3ad6cc[_0x909d('0x30')]=_[_0x909d('0x31')](_0x3ad6cc['model'],_0x3ad6cc['query']);_0x2119d2['attributes']=_[_0x909d('0x31')](_0x3ad6cc['model'],qs[_0x909d('0x34')](_0x3c2ec2[_0x909d('0x2e')]['fields']));_0x2119d2['attributes']=_0x2119d2['attributes'][_0x909d('0x35')]?_0x2119d2[_0x909d('0x33')]:_0x3ad6cc[_0x909d('0x32')];if(_0x3c2ec2[_0x909d('0x2e')][_0x909d('0x3f')]){_0x2119d2['include']=[{'all':!![]}];}_0x2119d2=_[_0x909d('0x3b')]({},_0x2119d2,_0x3c2ec2[_0x909d('0x3e')]);return db[_0x909d('0x29')][_0x909d('0x45')](_0x2119d2)[_0x909d('0x22')](handleEntityNotFound(_0x1fb43b,null))[_0x909d('0x22')](respondWithResult(_0x1fb43b,null))['catch'](handleError(_0x1fb43b,null));};exports[_0x909d('0x46')]=function(_0x376a32,_0x49a6e6){return db[_0x909d('0x29')][_0x909d('0x46')](_0x376a32[_0x909d('0x47')],{})[_0x909d('0x22')](respondWithResult(_0x49a6e6,0xc9))[_0x909d('0x43')](handleError(_0x49a6e6,null));};exports[_0x909d('0x21')]=function(_0x442a63,_0x1aa101){if(_0x442a63['body']['id']){delete _0x442a63[_0x909d('0x47')]['id'];}return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x442a63[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x1aa101,null))[_0x909d('0x22')](saveUpdates(_0x442a63[_0x909d('0x47')],null))['then'](respondWithResult(_0x1aa101,null))[_0x909d('0x43')](handleError(_0x1aa101,null));};exports[_0x909d('0x23')]=function(_0x5009cb,_0x2b8c7a){return db[_0x909d('0x29')][_0x909d('0x45')]({'where':{'id':_0x5009cb[_0x909d('0x48')]['id']}})[_0x909d('0x22')](handleEntityNotFound(_0x2b8c7a,null))[_0x909d('0x22')](removeEntity(_0x2b8c7a,null))[_0x909d('0x43')](handleError(_0x2b8c7a,null));};exports[_0x909d('0x49')]=function(_0x465959,_0x4fbd23){return db['ChatTransferReport'][_0x909d('0x49')]()[_0x909d('0x22')](respondWithResult(_0x4fbd23,null))['catch'](handleError(_0x4fbd23,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 10ae37a..5045642 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 _0x82c3=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x170685,_0x51edfa){var _0x5a41d8=function(_0xb1ab45){while(--_0xb1ab45){_0x170685['push'](_0x170685['shift']());}};_0x5a41d8(++_0x51edfa);}(_0x82c3,0x1ba));var _0x382c=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82c3[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x382c('0x0'));var util=require(_0x382c('0x1'));var logger=require(_0x382c('0x2'))(_0x382c('0x3'));var moment=require(_0x382c('0x4'));var BPromise=require(_0x382c('0x5'));var rp=require(_0x382c('0x6'));var fs=require('fs');var path=require(_0x382c('0x7'));var rimraf=require(_0x382c('0x8'));var config=require('../../config/environment');var attributes=require(_0x382c('0x9'));module[_0x382c('0xa')]=function(_0x3ac2ab,_0xc14b66){return _0x3ac2ab['define'](_0x382c('0xb'),attributes,{'tableName':_0x382c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x382c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbc4=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatTransferReport.attributes'];(function(_0x55c97d,_0x228ffc){var _0x1d5112=function(_0x2ab908){while(--_0x2ab908){_0x55c97d['push'](_0x55c97d['shift']());}};_0x1d5112(++_0x228ffc);}(_0xbbc4,0x1ba));var _0x4bbc=function(_0x56fad7,_0x69bcbd){_0x56fad7=_0x56fad7-0x0;var _0x21dad9=_0xbbc4[_0x56fad7];return _0x21dad9;};'use strict';var _=require(_0x4bbc('0x0'));var util=require(_0x4bbc('0x1'));var logger=require(_0x4bbc('0x2'))(_0x4bbc('0x3'));var moment=require(_0x4bbc('0x4'));var BPromise=require(_0x4bbc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bbc('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bbc('0x7'));module['exports']=function(_0xa2ea30,_0x41e035){return _0xa2ea30['define'](_0x4bbc('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4bbc('0x9'),'fields':[_0x4bbc('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b285360..be0c41a 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 _0x382c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14545a,_0x1ed81d){var _0x17cd82=function(_0x318cf7){while(--_0x318cf7){_0x14545a['push'](_0x14545a['shift']());}};_0x17cd82(++_0x1ed81d);}(_0x382c,0x12a));var _0xc382=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x382c[_0x320cf5];return _0xa77006;};'use strict';var _=require(_0xc382('0x0'));var util=require(_0xc382('0x1'));var moment=require(_0xc382('0x2'));var BPromise=require(_0xc382('0x3'));var rs=require(_0xc382('0x4'));var fs=require('fs');var Redis=require(_0xc382('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc382('0x6'));var logger=require(_0xc382('0x7'))(_0xc382('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc382('0x9')][_0xc382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad7a,_0x5a40dd,_0x481d88){return new BPromise(function(_0x2d3a86,_0x3fc1bc){return client[_0xc382('0xb')](_0x27ad7a,_0x481d88)[_0xc382('0xc')](function(_0x4ec866){logger['info'](_0xc382('0xd'),_0x5a40dd,_0xc382('0xe'));logger['debug'](_0xc382('0xf'),_0x5a40dd,_0xc382('0xe'),JSON['stringify'](_0x4ec866));if(_0x4ec866[_0xc382('0x10')]){if(_0x4ec866['error']['code']===0x1f4){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x3fc1bc(_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);}logger['error'](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x2d3a86(_0x4ec866[_0xc382('0x10')]['message']);}else{logger[_0xc382('0x12')](_0xc382('0xd'),_0x5a40dd,'request\x20sent');_0x2d3a86(_0x4ec866[_0xc382('0x13')][_0xc382('0x11')]);}})[_0xc382('0x14')](function(_0x6a6e4b){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x6a6e4b);_0x3fc1bc(_0x6a6e4b);});});}
\ No newline at end of file
+var _0x5d99=['../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5d99,0x9a));var _0x95d9=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x5d99[_0x4b03c9];return _0x161ba2;};'use strict';var _=require(_0x95d9('0x0'));var util=require('util');var moment=require(_0x95d9('0x1'));var BPromise=require(_0x95d9('0x2'));var rs=require(_0x95d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95d9('0x4'))(_0x95d9('0x5'));var config=require(_0x95d9('0x6'));var jayson=require(_0x95d9('0x7'));var client=jayson[_0x95d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c98a,_0x150407,_0x292a5b){return new BPromise(function(_0x51ee1a,_0x2ff389){return client['request'](_0x54c98a,_0x292a5b)[_0x95d9('0x9')](function(_0x472128){logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));logger['debug'](_0x95d9('0xd'),_0x150407,'request\x20sent',JSON[_0x95d9('0xe')](_0x472128));if(_0x472128[_0x95d9('0xf')]){if(_0x472128[_0x95d9('0xf')][_0x95d9('0x10')]===0x1f4){logger['error'](_0x95d9('0xb'),_0x150407,_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);return _0x2ff389(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}logger['error'](_0x95d9('0xb'),_0x150407,_0x472128['error']['message']);return _0x51ee1a(_0x472128[_0x95d9('0xf')][_0x95d9('0x11')]);}else{logger[_0x95d9('0xa')](_0x95d9('0xb'),_0x150407,_0x95d9('0xc'));_0x51ee1a(_0x472128[_0x95d9('0x12')]['message']);}})[_0x95d9('0x13')](function(_0x11f8d5){logger[_0x95d9('0xf')](_0x95d9('0xb'),_0x150407,_0x11f8d5);_0x2ff389(_0x11f8d5);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 867898a..c80a0e0 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 _0x2ce0=['describe','get','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated'];(function(_0x5eb9d2,_0x2761a2){var _0xd3174b=function(_0x26fff7){while(--_0x26fff7){_0x5eb9d2['push'](_0x5eb9d2['shift']());}};_0xd3174b(++_0x2761a2);}(_0x2ce0,0x71));var _0x02ce=function(_0x5a9aed,_0x7ff498){_0x5a9aed=_0x5a9aed-0x0;var _0x58fc5d=_0x2ce0[_0x5a9aed];return _0x58fc5d;};'use strict';var multer=require(_0x02ce('0x0'));var util=require(_0x02ce('0x1'));var path=require(_0x02ce('0x2'));var timeout=require(_0x02ce('0x3'));var express=require(_0x02ce('0x4'));var router=express[_0x02ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02ce('0x6'));var interaction=require(_0x02ce('0x7'));var config=require(_0x02ce('0x8'));var controller=require(_0x02ce('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x02ce('0xa')]);router['get'](_0x02ce('0xb'),auth[_0x02ce('0xc')](),controller[_0x02ce('0xd')]);router[_0x02ce('0xe')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller['show']);router[_0x02ce('0x10')]('/',auth[_0x02ce('0xc')](),controller['create']);router[_0x02ce('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x02ce('0x12')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller[_0x02ce('0x13')]);module[_0x02ce('0x14')]=router;
\ No newline at end of file
+var _0xeedd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41d0c6,_0x35a93e){var _0x50f407=function(_0x4cce17){while(--_0x4cce17){_0x41d0c6['push'](_0x41d0c6['shift']());}};_0x50f407(++_0x35a93e);}(_0xeedd,0x7d));var _0xdeed=function(_0x58b40b,_0x3c2dbf){_0x58b40b=_0x58b40b-0x0;var _0x5715e2=_0xeedd[_0x58b40b];return _0x5715e2;};'use strict';var multer=require(_0xdeed('0x0'));var util=require(_0xdeed('0x1'));var path=require(_0xdeed('0x2'));var timeout=require(_0xdeed('0x3'));var express=require(_0xdeed('0x4'));var router=express['Router']();var fs_extra=require(_0xdeed('0x5'));var auth=require(_0xdeed('0x6'));var interaction=require(_0xdeed('0x7'));var config=require(_0xdeed('0x8'));var controller=require(_0xdeed('0x9'));router[_0xdeed('0xa')]('/',auth[_0xdeed('0xb')](),controller['index']);router[_0xdeed('0xa')]('/describe',auth[_0xdeed('0xb')](),controller[_0xdeed('0xc')]);router['get'](_0xdeed('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdeed('0xe')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0xf')]);router[_0xdeed('0x10')](_0xdeed('0xd'),auth[_0xdeed('0xb')](),controller[_0xdeed('0x11')]);module[_0xdeed('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8dadf85..d44d12f 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 _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','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.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x0bb5,0x148));var _0x50bb=function(_0x424e05,_0x6c6e6a){_0x424e05=_0x424e05-0x0;var _0x2a3c50=_0x0bb5[_0x424e05];return _0x2a3c50;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}};
\ No newline at end of file
+var _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x12bcf7,_0x20878d){var _0x516440=function(_0x26eff1){while(--_0x26eff1){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x516440(++_0x20878d);}(_0x99e9,0xb4));var _0x999e=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x99e9[_0x169e53];return _0x252bb3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6ccbde3..c65a8f5 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 _0xcedc=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','showCustomerAvatar','customerAvatar','notify','setUA','headers','user-agent','getResult','chat','Sequelize','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','updatedAt','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','all','some','server/files/chat/iframe.ejs','address','3.1.0','connection','remoteAddress','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','user'];(function(_0x25ac0f,_0x3e73a3){var _0x2269ef=function(_0x500298){while(--_0x500298){_0x25ac0f['push'](_0x25ac0f['shift']());}};_0x2269ef(++_0x3e73a3);}(_0xcedc,0xd8));var _0xcced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcedc[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xcced('0x0'));var Mustache=require(_0xcced('0x1'));var util=require(_0xcced('0x2'));var path=require(_0xcced('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcced('0x4'));var _=require(_0xcced('0x5'));var querystring=require(_0xcced('0x6'));var Redis=require(_0xcced('0x7'));var qs=require(_0xcced('0x8'));var logger=require(_0xcced('0x9'))('api');var config=require(_0xcced('0xa'));var url=require(_0xcced('0xb'));var db=require('../../mysqldb')['db'];config[_0xcced('0xc')]=_[_0xcced('0xd')](config[_0xcced('0xc')],{'host':_0xcced('0xe'),'port':0x18eb});var socket=require(_0xcced('0xf'))(new Redis(config[_0xcced('0xc')]));require(_0xcced('0x10'))[_0xcced('0x11')](socket);var htmlToText=require(_0xcced('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232c});var client9002=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232a});var client9003=jayson[_0xcced('0x13')]['http']({'port':0x232b});var client9001=jayson['client'][_0xcced('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x338705,_0x2d2f4b,_0x5b15d7,_0x315c65){return new BPromise(function(_0x3afab5,_0x4e5aa0){var _0x3e7ed0=_0x315c65||client;return _0x3e7ed0['request'](_0x338705,_0x5b15d7)[_0xcced('0x15')](function(_0x542965){logger['info'](_0xcced('0x16'),_0x2d2f4b,_0xcced('0x17'));logger['debug'](_0xcced('0x18'),_0x2d2f4b,_0xcced('0x17'),JSON[_0xcced('0x19')](_0x542965));if(_0x542965[_0xcced('0x1a')]){if(_0x542965[_0xcced('0x1a')][_0xcced('0x1b')]===0x1f4){logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965['error'][_0xcced('0x1c')]);return _0x4e5aa0(_0x542965[_0xcced('0x1a')]['message']);}logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965[_0xcced('0x1a')]['message']);return _0x3afab5(_0x542965[_0xcced('0x1a')][_0xcced('0x1c')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0xcced('0x17'));_0x3afab5(_0x542965['result']['message']);}})[_0xcced('0x1d')](function(_0x3a88da){logger[_0xcced('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0x3a88da);_0x4e5aa0(_0x3a88da);});});}function respondWithStatusCode(_0x36dbdf,_0xdb5c06){_0xdb5c06=_0xdb5c06||0xcc;return function(_0x58acbf){if(_0x58acbf){return _0x36dbdf[_0xcced('0x1e')](_0xdb5c06);}return _0x36dbdf[_0xcced('0x1f')](_0xdb5c06)[_0xcced('0x20')]();};}function respondWithResult(_0x4bf976,_0x4b65e0){_0x4b65e0=_0x4b65e0||0xc8;return function(_0x77182c){if(_0x77182c){return _0x4bf976[_0xcced('0x1f')](_0x4b65e0)[_0xcced('0x21')](_0x77182c);}};}function respondWithFilteredResult(_0x11add6,_0x235945){return function(_0x1198d0){if(_0x1198d0){var _0x59185c=typeof _0x235945['offset']==='undefined'&&typeof _0x235945[_0xcced('0x22')]===_0xcced('0x23');var _0x24315a=_0x1198d0[_0xcced('0x24')];var _0x832dc4=_0x59185c?0x0:_0x235945[_0xcced('0x25')];var _0x10e14e=_0x59185c?_0x1198d0[_0xcced('0x24')]:_0x235945['offset']+_0x235945[_0xcced('0x22')];var _0x101e85;if(_0x10e14e>=_0x24315a){_0x10e14e=_0x24315a;_0x101e85=0xc8;}else{_0x101e85=0xce;}_0x11add6[_0xcced('0x1f')](_0x101e85);return _0x11add6['set']('Content-Range',_0x832dc4+'-'+_0x10e14e+'/'+_0x24315a)[_0xcced('0x21')](_0x1198d0);}return null;};}function saveUpdates(_0x26b3f3){return function(_0x39032a){if(_0x39032a){return _0x39032a[_0xcced('0x26')](_0x26b3f3)['then'](function(_0x42d18a){return _0x42d18a;});}return null;};}function removeEntity(_0x526935){return function(_0x2c2df4){if(_0x2c2df4){return _0x2c2df4[_0xcced('0x27')]()[_0xcced('0x15')](function(){var _0xc010a1=_0x2c2df4[_0xcced('0x28')]({'plain':!![]});var _0x3b1a2b=_0xcced('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b1a2b,'resourceId':_0xc010a1['id']}})[_0xcced('0x15')](function(){return _0x2c2df4;});})['then'](function(){_0x526935['status'](0xcc)[_0xcced('0x20')]();});}};}function handleEntityNotFound(_0x372c9d){return function(_0x19bb1d){if(!_0x19bb1d){_0x372c9d['sendStatus'](0x194);}return _0x19bb1d;};}function handleError(_0x22af8e,_0xab6363){_0xab6363=_0xab6363||0x1f4;return function(_0x515989){logger[_0xcced('0x1a')](_0x515989[_0xcced('0x2a')]);if(_0x515989[_0xcced('0x2b')]){delete _0x515989[_0xcced('0x2b')];}_0x22af8e['status'](_0xab6363)[_0xcced('0x2c')](_0x515989);};}exports[_0xcced('0x2d')]=function(_0x17c101,_0x25ef31){var _0x489f31={'include':[{'model':db[_0xcced('0x2e')],'as':_0xcced('0x2f')}]},_0xcde5f1={},_0x4a9143={'count':0x0,'rows':[]};var _0x30900=_[_0xcced('0x30')](db[_0xcced('0x31')][_0xcced('0x32')],function(_0x52de0b){return{'name':_0x52de0b[_0xcced('0x33')],'type':_0x52de0b['type'][_0xcced('0x34')]};});_0xcde5f1[_0xcced('0x35')]=_['map'](_0x30900,'name');_0xcde5f1[_0xcced('0x36')]=_[_0xcced('0x37')](_0x17c101[_0xcced('0x36')]);_0xcde5f1[_0xcced('0x38')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],_0xcde5f1[_0xcced('0x36')]);_0x489f31[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x17c101[_0xcced('0x36')][_0xcced('0x3b')]));_0x489f31[_0xcced('0x3a')]=_0x489f31[_0xcced('0x3a')][_0xcced('0x3c')]?_0x489f31[_0xcced('0x3a')]:_0xcde5f1[_0xcced('0x35')];if(!_0x17c101[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x489f31['limit']=qs[_0xcced('0x22')](_0x17c101[_0xcced('0x36')][_0xcced('0x22')]);_0x489f31[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x17c101[_0xcced('0x36')]['offset']);}_0x489f31[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x17c101['query'][_0xcced('0x40')]);_0x489f31[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x17c101[_0xcced('0x36')],_0xcde5f1['filters']),_0x30900);if(_0x17c101[_0xcced('0x36')][_0xcced('0x43')]){_0x489f31['where']=_['merge'](_0x489f31[_0xcced('0x41')],{'$or':_['map'](_0x30900,function(_0x84912d){if(_0x84912d[_0xcced('0x44')]!==_0xcced('0x45')){var _0x53ddad={};_0x53ddad[_0x84912d[_0xcced('0x2b')]]={'$like':'%'+_0x17c101[_0xcced('0x36')]['filter']+'%'};return _0x53ddad;}})});}_0x489f31=_[_0xcced('0x46')]({},_0x489f31,_0x17c101['options']);var _0x32d1a1={'where':_0x489f31[_0xcced('0x41')]};return db[_0xcced('0x31')]['count'](_0x32d1a1)[_0xcced('0x15')](function(_0x84dc5e){_0x4a9143['count']=_0x84dc5e;if(_0x17c101['query'][_0xcced('0x47')]){_0x489f31[_0xcced('0x48')]=[{'all':!![]}];}return db[_0xcced('0x31')][_0xcced('0x49')](_0x489f31);})['then'](function(_0x1cc32b){_0x4a9143['rows']=_0x1cc32b;return _0x4a9143;})[_0xcced('0x15')](respondWithFilteredResult(_0x25ef31,_0x489f31))['catch'](handleError(_0x25ef31,null));};exports[_0xcced('0x4a')]=function(_0x478657,_0x362227){var _0x22351d={'raw':![],'where':{'id':_0x478657[_0xcced('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]},_0x302eed={};_0x302eed[_0xcced('0x35')]=_[_0xcced('0x37')](db[_0xcced('0x31')][_0xcced('0x32')]);_0x302eed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x478657[_0xcced('0x36')]);_0x302eed[_0xcced('0x38')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],_0x302eed['query']);_0x22351d[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x478657[_0xcced('0x36')]['fields']));_0x22351d[_0xcced('0x3a')]=_0x22351d['attributes'][_0xcced('0x3c')]?_0x22351d['attributes']:_0x302eed['model'];if(_0x478657[_0xcced('0x36')]['includeAll']){_0x22351d[_0xcced('0x48')]=[{'all':!![]}];}_0x22351d=_['merge']({},_0x22351d,_0x478657[_0xcced('0x4c')]);return db[_0xcced('0x31')][_0xcced('0x4d')](_0x22351d)['then'](handleEntityNotFound(_0x362227,null))['then'](respondWithResult(_0x362227,null))['catch'](handleError(_0x362227,null));};exports[_0xcced('0x4e')]=function(_0x1b8876,_0x4eff77){return db['ChatWebsite'][_0xcced('0x4e')](_0x1b8876['body'],{})[_0xcced('0x15')](function(_0xbaf3a7){var _0x5a44c7=_0x1b8876[_0xcced('0x4f')][_0xcced('0x28')]({'plain':!![]});if(!_0x5a44c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a44c7['role']==='user'){var _0x2547cb=_0xbaf3a7[_0xcced('0x28')]({'plain':!![]});var _0x20f327=_0xcced('0x29');return db[_0xcced('0x50')]['find']({'where':{'name':_0x20f327,'userProfileId':_0x5a44c7['userProfileId']},'raw':!![]})[_0xcced('0x15')](function(_0x5b6915){if(_0x5b6915&&_0x5b6915['autoAssociation']===0x0){return db['UserProfileResource'][_0xcced('0x4e')]({'name':_0x2547cb[_0xcced('0x2b')],'resourceId':_0x2547cb['id'],'type':_0x5b6915[_0xcced('0x2b')],'sectionId':_0x5b6915['id']},{})['then'](function(){return _0xbaf3a7;});}else{return _0xbaf3a7;}})[_0xcced('0x1d')](function(_0x447918){logger['error'](_0xcced('0x51'),_0x447918);throw _0x447918;});}return _0xbaf3a7;})[_0xcced('0x15')](respondWithResult(_0x4eff77,0xc9))[_0xcced('0x1d')](handleError(_0x4eff77,null));};exports[_0xcced('0x26')]=function(_0x4fee8b,_0x5e596f){if(_0x4fee8b['body']['id']){delete _0x4fee8b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4fee8b['params']['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]})[_0xcced('0x15')](handleEntityNotFound(_0x5e596f,null))[_0xcced('0x15')](saveUpdates(_0x4fee8b['body'],null))['then'](respondWithResult(_0x5e596f,null))[_0xcced('0x1d')](handleError(_0x5e596f,null));};exports[_0xcced('0x27')]=function(_0x4a6b0e,_0x84156a){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4a6b0e[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x84156a,null))[_0xcced('0x15')](removeEntity(_0x84156a,null))[_0xcced('0x1d')](handleError(_0x84156a,null));};exports[_0xcced('0x53')]=function(_0x99d1a7,_0x484c22){return db[_0xcced('0x31')]['describe']()[_0xcced('0x15')](respondWithResult(_0x484c22,null))[_0xcced('0x1d')](handleError(_0x484c22,null));};exports['addDisposition']=function(_0x484b01,_0x16bd00){if(_0x484b01[_0xcced('0x52')]['id']){delete _0x484b01[_0xcced('0x52')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x484b01['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16bd00,null))[_0xcced('0x15')](function(_0x203810){if(_0x203810){_0x484b01[_0xcced('0x52')][_0xcced('0x54')]=_0x203810['id'];return db['Disposition']['create'](_0x484b01[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x16bd00,null))[_0xcced('0x1d')](handleError(_0x16bd00,null));};exports[_0xcced('0x55')]=function(_0x5baa67,_0x119b43){var _0x190901={'raw':![],'where':{}};var _0x13ff3b={};var _0x259849={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x5baa67[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119b43,null))[_0xcced('0x15')](function(_0x40bb9b){if(_0x40bb9b){_0x13ff3b['model']=_['keys'](db[_0xcced('0x56')][_0xcced('0x32')]);_0x13ff3b[_0xcced('0x36')]=_[_0xcced('0x37')](_0x5baa67[_0xcced('0x36')]);_0x13ff3b['filters']=_[_0xcced('0x39')](_0x13ff3b['model'],_0x13ff3b[_0xcced('0x36')]);_0x190901[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x13ff3b[_0xcced('0x35')],qs['fields'](_0x5baa67['query'][_0xcced('0x3b')]));_0x190901[_0xcced('0x3a')]=_0x190901[_0xcced('0x3a')][_0xcced('0x3c')]?_0x190901[_0xcced('0x3a')]:_0x13ff3b['model'];if(!_0x5baa67[_0xcced('0x36')]['hasOwnProperty']('nolimit')){_0x190901[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x5baa67[_0xcced('0x36')][_0xcced('0x22')]);_0x190901[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x5baa67[_0xcced('0x36')][_0xcced('0x25')]);}_0x190901[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x5baa67['query']['sort']);_0x190901[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x5baa67[_0xcced('0x36')],_0x13ff3b[_0xcced('0x38')]));_0x190901[_0xcced('0x41')][_0xcced('0x54')]=_0x40bb9b['id'];if(_0x5baa67['query'][_0xcced('0x43')]){_0x190901[_0xcced('0x41')]=_[_0xcced('0x46')](_0x190901[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x190901['attributes'],function(_0x121add){var _0x45eb39={};_0x45eb39[_0x121add]={'$like':'%'+_0x5baa67['query'][_0xcced('0x43')]+'%'};return _0x45eb39;})});}_0x190901=_[_0xcced('0x46')]({},_0x190901,_0x5baa67[_0xcced('0x4c')]);return db[_0xcced('0x56')][_0xcced('0x24')]({'where':_0x190901[_0xcced('0x41')]})['then'](function(_0x4fed9a){_0x259849['count']=_0x4fed9a;if(_0x5baa67[_0xcced('0x36')][_0xcced('0x47')]){_0x190901[_0xcced('0x48')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x190901);})['then'](function(_0x4106a6){_0x259849['rows']=_0x4106a6;return _0x259849;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x119b43,_0x190901))[_0xcced('0x1d')](handleError(_0x119b43,null));};exports[_0xcced('0x57')]=function(_0x905c67,_0x5d9b30){return db[_0xcced('0x31')]['find']({'where':{'id':_0x905c67[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5d9b30,null))[_0xcced('0x15')](function(_0x45c2e4){if(_0x45c2e4){return _0x45c2e4[_0xcced('0x57')](_0x905c67[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x5d9b30,null))['catch'](handleError(_0x5d9b30,null));};exports[_0xcced('0x59')]=function(_0x53628b,_0x1f838a){if(_0x53628b[_0xcced('0x52')]['id']){delete _0x53628b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')]['find']({'where':{'id':_0x53628b[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x1f838a,null))['then'](function(_0x42bc2b){if(_0x42bc2b){_0x53628b[_0xcced('0x52')]['ChatWebsiteId']=_0x42bc2b['id'];return db[_0xcced('0x5a')][_0xcced('0x4e')](_0x53628b[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x1f838a,null))[_0xcced('0x1d')](handleError(_0x1f838a,null));};exports[_0xcced('0x5b')]=function(_0x525be4,_0x16a041){var _0x562383={'raw':![],'where':{}};var _0x32c9cf={};var _0x27da9d={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x525be4['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16a041,null))[_0xcced('0x15')](function(_0x4f4470){if(_0x4f4470){_0x32c9cf[_0xcced('0x35')]=_[_0xcced('0x37')](db['CannedAnswer'][_0xcced('0x32')]);_0x32c9cf[_0xcced('0x36')]=_[_0xcced('0x37')](_0x525be4[_0xcced('0x36')]);_0x32c9cf[_0xcced('0x38')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],_0x32c9cf[_0xcced('0x36')]);_0x562383[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x525be4[_0xcced('0x36')][_0xcced('0x3b')]));_0x562383[_0xcced('0x3a')]=_0x562383[_0xcced('0x3a')]['length']?_0x562383[_0xcced('0x3a')]:_0x32c9cf['model'];if(!_0x525be4[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x562383[_0xcced('0x22')]=qs['limit'](_0x525be4[_0xcced('0x36')][_0xcced('0x22')]);_0x562383[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x525be4[_0xcced('0x36')]['offset']);}_0x562383[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x525be4[_0xcced('0x36')][_0xcced('0x40')]);_0x562383[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x525be4['query'],_0x32c9cf['filters']));_0x562383[_0xcced('0x41')][_0xcced('0x54')]=_0x4f4470['id'];if(_0x525be4[_0xcced('0x36')]['filter']){_0x562383[_0xcced('0x41')]=_[_0xcced('0x46')](_0x562383[_0xcced('0x41')],{'$or':_['map'](_0x562383[_0xcced('0x3a')],function(_0x3525a7){var _0xe5b610={};_0xe5b610[_0x3525a7]={'$like':'%'+_0x525be4[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0xe5b610;})});}_0x562383=_[_0xcced('0x46')]({},_0x562383,_0x525be4['options']);return db['CannedAnswer'][_0xcced('0x24')]({'where':_0x562383[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x2bfda4){_0x27da9d[_0xcced('0x24')]=_0x2bfda4;if(_0x525be4[_0xcced('0x36')]['includeAll']){_0x562383['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xcced('0x49')](_0x562383);})[_0xcced('0x15')](function(_0x59c572){_0x27da9d[_0xcced('0x5c')]=_0x59c572;return _0x27da9d;});}})['then'](respondWithFilteredResult(_0x16a041,_0x562383))[_0xcced('0x1d')](handleError(_0x16a041,null));};exports[_0xcced('0x5d')]=function(_0x38cfe7,_0x128214){return db['ChatWebsite'][_0xcced('0x4d')]({'where':{'id':_0x38cfe7[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x128214,null))['then'](function(_0x3c9f9e){if(_0x3c9f9e){return _0x3c9f9e['removeAnswers'](_0x38cfe7[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x128214,null))[_0xcced('0x1d')](handleError(_0x128214,null));};exports[_0xcced('0x5e')]=function(_0x5492d1,_0x272f80){_0x5492d1[_0xcced('0x52')][_0xcced('0x5f')]=_0x5492d1[_0xcced('0x60')][_0xcced('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x5492d1[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x272f80,null))[_0xcced('0x15')](saveUpdates(_0x5492d1[_0xcced('0x52')],null))['then'](respondWithResult(_0x272f80,null))[_0xcced('0x1d')](handleError(_0x272f80,null));};exports[_0xcced('0x62')]=function(_0x41ad57,_0x333040){_0x41ad57[_0xcced('0x52')][_0xcced('0x63')]=_0x41ad57[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x41ad57['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x333040,null))[_0xcced('0x15')](saveUpdates(_0x41ad57[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x333040,null))[_0xcced('0x1d')](handleError(_0x333040,null));};exports[_0xcced('0x64')]=function(_0x17d186,_0x19b5c0){_0x17d186[_0xcced('0x52')]['customerAvatar']=_0x17d186[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x17d186[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19b5c0,null))[_0xcced('0x15')](saveUpdates(_0x17d186[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x19b5c0,null))[_0xcced('0x1d')](handleError(_0x19b5c0,null));};exports[_0xcced('0x65')]=function(_0x2118b8,_0x5b2f65){_0x2118b8[_0xcced('0x52')][_0xcced('0x66')]=_0x2118b8[_0xcced('0x60')][_0xcced('0x61')];return db[_0xcced('0x31')]['find']({'where':{'id':_0x2118b8[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5b2f65,null))[_0xcced('0x15')](saveUpdates(_0x2118b8[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x5b2f65,null))['catch'](handleError(_0x5b2f65,null));};exports[_0xcced('0x67')]=function(_0xb0afae,_0x2ca256){var _0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6a'));var _0x1ac382={'where':{'id':_0xb0afae[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x5f')],'raw':!![]};var _0x720878=![];return require(_0xcced('0x6b'))['getLicense']()[_0xcced('0x15')](function(_0x1bfe9c){if(_0x1bfe9c){_0x720878=_0x1bfe9c[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db[_0xcced('0x31')][_0xcced('0x4d')](_0x1ac382);})[_0xcced('0x15')](handleEntityNotFound(_0x2ca256,null))[_0xcced('0x15')](function(_0x1b6826){if(_0x1b6826){if(!_[_0xcced('0x6d')](_0x1b6826[_0xcced('0x5f')])){if(fs['existsSync'](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]))&&_0x720878){_0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]);}}return _0x2ca256[_0xcced('0x6f')](_0x15a356);}})[_0xcced('0x1d')](handleError(_0x2ca256,null));};exports[_0xcced('0x70')]=function(_0x14ffee,_0x4fdb0a){var _0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x71'));var _0x50550f={'where':{'id':_0x14ffee[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x63')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x50550f)[_0xcced('0x15')](handleEntityNotFound(_0x4fdb0a,null))['then'](function(_0x373667){if(_0x373667){if(!_[_0xcced('0x6d')](_0x373667[_0xcced('0x63')])){if(fs[_0xcced('0x72')](path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]))){_0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]);}}return _0x4fdb0a[_0xcced('0x6f')](_0x148f9b);}})['catch'](handleError(_0x4fdb0a,null));};exports['getCustomerAvatar']=function(_0x25a117,_0x33ba63){var _0x13e220=path[_0xcced('0x68')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ba312={'where':{'id':_0x25a117[_0xcced('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcced('0x74')],'raw':!![]};return db['ChatWebsite'][_0xcced('0x4d')](_0x2ba312)['then'](handleEntityNotFound(_0x33ba63,null))[_0xcced('0x15')](function(_0x2c62b1){if(_0x2c62b1){if(!_[_0xcced('0x6d')](_0x2c62b1[_0xcced('0x75')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]))&&_0x2c62b1['showCustomerAvatar']){_0x13e220=path[_0xcced('0x68')](config['root'],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]);}}return _0x33ba63[_0xcced('0x6f')](_0x13e220);}})[_0xcced('0x1d')](handleError(_0x33ba63,null));};exports['getSystemAvatar']=function(_0x555258,_0x499f0b){var _0x1e4568=path['join'](config[_0xcced('0x69')],'server/files/images/avatars/system_avatar.png');var _0x5e19d0={'where':{'id':_0x555258[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x66')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x5e19d0)[_0xcced('0x15')](handleEntityNotFound(_0x499f0b,null))[_0xcced('0x15')](function(_0x5d1c05){if(_0x5d1c05){if(!_['isNil'](_0x5d1c05[_0xcced('0x66')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']))){_0x1e4568=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']);}}return _0x499f0b['download'](_0x1e4568);}})['catch'](handleError(_0x499f0b,null));};exports[_0xcced('0x76')]=function(_0x5eeb8c,_0x522b3b){var _0x3feaf0=require('user-agent-parser');var _0x4ff851=new _0x3feaf0();var _0x383a05=_0x4ff851[_0xcced('0x77')](_0x5eeb8c[_0xcced('0x78')][_0xcced('0x79')])[_0xcced('0x7a')]();var _0x4459c1={'body':_0x5eeb8c[_0xcced('0x52')],'channel':_0xcced('0x7b')};var _0x5c607d=[];var _0x1d89cb=[];var _0x204b71={};var _0x3dd0a=![];return db['CmContact'][_0xcced('0x53')]()[_0xcced('0x15')](function(_0x9b5bd4){if(!_0x9b5bd4){throw new db[(_0xcced('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x5c607d=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),[_0xcced('0x7e'),'updatedAt']);_0x1d89cb=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),['createdAt','updatedAt','CompanyId','ListId']);if(_0x5eeb8c['body']['id']){delete _0x5eeb8c[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x5eeb8c[_0xcced('0x52')]['from'])){throw new db['Sequelize']['ValidationError'](_0xcced('0x7f'));}if(_['isNil'](_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')])||_0x5eeb8c[_0xcced('0x52')]['body']===''){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80'));}if(_['isNil'](_0x5eeb8c['body'][_0xcced('0x81')])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x83')+_0x1d89cb);}if(!_['includes'](_0x1d89cb,_0x5eeb8c[_0xcced('0x52')]['mapKey'])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x84')+_0x1d89cb);}_0x204b71[_0x5eeb8c['body'][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];})[_0xcced('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5eeb8c[_0xcced('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcced('0x86'),'include':[{'model':db[_0xcced('0x87')],'as':_0xcced('0x88'),'where':_0x204b71,'limit':0x1,'order':[[_0xcced('0x89'),_0xcced('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0xcced('0x8b')}]});})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0xd33f51){if(_0xd33f51&&_0xd33f51[_0xcced('0x86')]){_0x4459c1[_0xcced('0x8c')]=_0xd33f51;_0x4459c1[_0xcced('0x8d')]=_0xd33f51['Applications'];_0x4459c1[_0xcced('0x8e')]=_0xd33f51['List'];_0x4459c1['applications']=_[_0xcced('0x8f')](_0x4459c1[_0xcced('0x8d')],[_0xcced('0x90')],[_0xcced('0x91')]);if(_0x4459c1[_0xcced('0x8c')]['Applications']){delete _0x4459c1['account']['Applications'];}if(_0x4459c1[_0xcced('0x8c')]['List']&&_0x4459c1[_0xcced('0x8c')][_0xcced('0x86')][_0xcced('0x88')][_0xcced('0x3c')]){return _0x4459c1[_0xcced('0x8c')][_0xcced('0x86')]['Contacts'][0x0];}var _0x4ae149=_[_0xcced('0xd')](_0x5eeb8c[_0xcced('0x52')],{'firstName':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0xd33f51[_0xcced('0x92')]});_0x4ae149[_0x5eeb8c[_0xcced('0x52')][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0x4e')](_0x4ae149,{'fields':_0x5c607d,'raw':!![]});}})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0x4a67e9){_0x4459c1[_0xcced('0x93')]=_0x4a67e9;var _0x3b8a26=_0x5eeb8c['body'][_0xcced('0x94')];if(_0x5eeb8c[_0xcced('0x78')][_0xcced('0x95')]){_0x3b8a26=_0x5eeb8c[_0xcced('0x78')]['cf-connecting-ip'];}else if(_0x5eeb8c['headers'][_0xcced('0x96')]){_0x3b8a26=_['first'](_0x5eeb8c[_0xcced('0x78')]['x-forwarded-for'][_0xcced('0x97')](','));}if(_0x4a67e9){var _0x4d89fe={'ContactId':_0x4a67e9['id'],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'from':(_0x4a67e9[_0xcced('0x98')]||'')+'\x20'+(_0x4a67e9[_0xcced('0x99')]||''),'customerIp':_0x3b8a26,'customerPort':_0x5eeb8c['headers']['x-real-port']?_0x5eeb8c[_0xcced('0x78')][_0xcced('0x9a')]:null,'referer':_0x5eeb8c[_0xcced('0x52')]['referer'],'browserName':_0x383a05['browser'][_0xcced('0x2b')]&&_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]?util[_0xcced('0x9d')](_0xcced('0x9e'),_0x383a05['browser']['name'],_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]):_0xcced('0x9f'),'browserVersion':_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]||'unknown','osName':util[_0xcced('0x9d')]('%s\x20%s',_0x383a05['os'][_0xcced('0x2b')],_0x383a05['os']['version']),'osVersion':_0x383a05['os'][_0xcced('0x9c')],'deviceModel':_0x383a05[_0xcced('0xa0')]['model']&&_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')]?util[_0xcced('0x9d')](_0xcced('0xa2'),_0x383a05['device'][_0xcced('0x35')],_0x383a05[_0xcced('0xa0')]['vendor'],_0x383a05[_0xcced('0xa0')][_0xcced('0x44')]):null,'deviceVendor':_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')],'deviceType':_0x383a05['device'][_0xcced('0x44')],'formData':JSON['stringify'](_0x5eeb8c[_0xcced('0x52')])};var _0x2a9a47={'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'closed':![]};if(_0x5eeb8c[_0xcced('0x52')]['threadId']){_0x2a9a47['threadId']=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];return db[_0xcced('0xa4')][_0xcced('0x4d')]({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x3210d6){if(_0x3210d6){return[_0x3210d6,![]];}_0x4d89fe[_0xcced('0xa3')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];_0x4d89fe[_0xcced('0xa5')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa5')];return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x107f3a){return[_0x107f3a,!![]];});});}_0x2a9a47[_0xcced('0xa6')]=_0x4a67e9['id'];if(_0x5eeb8c[_0xcced('0x52')]['interaction']&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa7')]['id']){_0x2a9a47['id']=_0x5eeb8c[_0xcced('0x52')]['interaction']['id'];return db[_0xcced('0xa4')]['find']({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x5d2836){if(_0x5d2836){return[_0x5d2836,![]];}return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)['then'](function(_0x295105){return[_0x295105,!![]];});});}return db['ChatInteraction'][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x3b04a8){return[_0x3b04a8,!![]];});}})[_0xcced('0xa8')](function(_0x36e66a,_0x4ee948){if(_0x36e66a){_0x3dd0a=_0x4ee948;if(!_0x4ee948){var _0x2481d3={'from':(_0x4459c1['contact'][_0xcced('0x98')]||'')+'\x20'+(_0x4459c1[_0xcced('0x93')][_0xcced('0x99')]||'')};if(_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')]&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]&&_0x5eeb8c['body']['threadId']!=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]){_0x2481d3[_0xcced('0xa3')]=_0x5eeb8c['body'][_0xcced('0xa9')];}return _0x36e66a[_0xcced('0x26')](_0x2481d3);}else{return _0x36e66a;}}})['then'](function(_0x4d7979){_0x4459c1[_0xcced('0xa7')]=_0x4d7979['get']({'plain':!![]});_0x4459c1['interaction'][_0xcced('0xaa')]=_0x3dd0a;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xaa')]){if(_0x4459c1['account'][_0xcced('0xab')]){_0x4459c1[_0xcced('0x8d')][_0xcced('0xac')]({'id':0x0,'priority':_0x4459c1[_0xcced('0x8d')][_0xcced('0x3c')]+0x1,'app':_0xcced('0xad'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xcced('0xae')][_0xcced('0x4e')]({'body':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'ChatInteractionId':_0x4d7979['id'],'direction':'in','ContactId':_0x4459c1['contact']['id'],'AttachmentId':_0x5eeb8c['body'][_0xcced('0xaf')]});})[_0xcced('0x15')](function(_0x2d4011){_0x4459c1[_0xcced('0x1c')]=_0x2d4011;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]){return db[_0xcced('0xb1')]['find']({'attributes':['id',_0xcced('0x2b')],'where':{'id':_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]}})['then'](function(_0x5a038d){if(_0x5a038d){_0x4459c1[_0xcced('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcced('0xb2'),'appdata':_0x5a038d[_0xcced('0x2b')]+','+(_0x4459c1[_0xcced('0x8c')][_0xcced('0xb3')]||0xa),'interval':_0xcced('0xb4')});_0x4459c1[_0xcced('0xb5')]=!![];}return respondWithRpcPromise(_0xcced('0xb6'),'startRouting',_0x4459c1);});}return respondWithRpcPromise(_0xcced('0xb6'),_0xcced('0xb7'),_0x4459c1);})[_0xcced('0x15')](function(_0x272749){respondWithRpcPromise(_0xcced('0xb8'),_0xcced('0xb8'),{'event':_0xcced('0x76'),'message':_0x272749},client9002);return _0x272749;})[_0xcced('0x15')](respondWithResult(_0x522b3b,null))[_0xcced('0x1d')](handleError(_0x522b3b,null));};exports[_0xcced('0xb9')]=function(_0x1e2f2a,_0x12b3e7){var _0x59d4cc,_0x4031c4,_0x4f095a;var _0x15de88=[];var _0x11b81a={};var _0x577af7=_0x1e2f2a[_0xcced('0xba')]||[];var _0x115654=[];var _0x1849be;return db['CmContact']['describe']()[_0xcced('0x15')](function(_0x5ee873){if(!_0x5ee873){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0xbb'));}_0x15de88=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x5ee873),[_0xcced('0x7e'),_0xcced('0x89'),_0xcced('0xbc'),_0xcced('0x92')]);if(_0x1e2f2a['body']['id']){delete _0x1e2f2a[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x1e2f2a[_0xcced('0x52')]['from'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))]('from\x20is\x20mandatory'));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['body'])||_0x1e2f2a[_0xcced('0x52')][_0xcced('0x52')]===''){throw _0x12b3e7['status'](0x1f4)['send'](new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80')));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['mapKeyOffline'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbd')+_0x15de88));}if(!_['includes'](_0x15de88,_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbf')+_0x15de88));}_0x11b81a[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];})['then'](function(){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x1e2f2a[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xc0')],'as':'List'},{'model':db[_0xcced('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x12b3e7,null))['then'](function(_0x4052d4){if(_0x4052d4&&_0x4052d4[_0xcced('0x86')]){_0x4031c4=_0x4052d4;var _0x3b0a30=_['defaults'](_0x1e2f2a['body'],{'firstName':_0x1e2f2a[_0xcced('0x52')]['from'],'phone':_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0x4052d4['ListId']});_0x3b0a30[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0xc2')]({'where':_0x11b81a,'defaults':_0x3b0a30});}})['spread'](function(_0xeb64f){if(_0xeb64f){_0x4f095a=_0xeb64f;var _0x5781de=fs[_0xcced('0xc3')](path['join'](config[_0xcced('0x69')],_0xcced('0xc4')),_0xcced('0xc5'));var _0x4c2a79=ejs['render'](_0x5781de,{'body':_['toPairs'](_0x1e2f2a['body']['body']),'bodyTitle':_0x4031c4['offlineMessageBody']});return db['ChatOfflineMessage'][_0xcced('0x4e')]({'body':_0x4c2a79,'plainBody':htmlToText[_0xcced('0xc6')](_0x4c2a79),'ContactId':_0xeb64f['id'],'ChatWebsiteId':_0x4031c4['id']});}})[_0xcced('0x15')](function(_0x41900b){_0x1849be=_0x41900b;if(_0x577af7[_0xcced('0x3c')]){var _0xf45315=_0x577af7['map'](function(_0x5a7a57){return{'name':_0x5a7a57[_0xcced('0xc7')],'basename':_0x5a7a57[_0xcced('0x61')],'type':_0x5a7a57[_0xcced('0xc8')],'ChatOfflineMessageId':_0x41900b['id']};});_0x115654=_0xf45315[_0xcced('0x30')](_0x4712d5=>{var _0x167f79={'filename':_0x4712d5['name'],'path':path[_0xcced('0x68')](config['root'],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x4712d5[_0xcced('0xcc')])};return _0x167f79;});if(!_0x4031c4['openNewInteraction']){return db[_0xcced('0xcd')][_0xcced('0xce')](function(_0x80f9f6){return db[_0xcced('0xcf')][_0xcced('0xd0')](_0xf45315,{'transaction':_0x80f9f6});});}}})[_0xcced('0x15')](function(){if(_0x1849be){_0x59d4cc=_0x1849be;return db[_0xcced('0xc1')][_0xcced('0xd1')]({'where':{'service':!![]},'include':[{'model':db[_0xcced('0xd2')],'as':_0xcced('0xd3'),'raw':!![],'include':[{'model':db[_0xcced('0xd4')],'as':_0xcced('0xd4'),'raw':!![]}]}]});}})[_0xcced('0x15')](function(_0x5db023){if(_0x5db023&&_0x5db023[_0xcced('0xd3')]&&_0x4031c4[_0xcced('0xd5')]&&_0x4031c4[_0xcced('0xd6')]){var _0x24ea2d=_0x5db023[_0xcced('0xd7')]();return respondWithRpcPromise(_0xcced('0xd8'),'sendMail',{'account':_0x24ea2d,'message':{'from':util[_0xcced('0x9d')]('\x22%s\x22\x20<%s>',_0x5db023[_0xcced('0x2b')],_0x5db023[_0xcced('0xd9')]||_0x5db023[_0xcced('0xd3')]['user']),'to':_0x4031c4['forwardOfflineAddress'],'subject':_0x4031c4[_0xcced('0xda')],'html':_0x59d4cc[_0xcced('0x52')],'attachments':_0x115654}},client9003)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x19a6a9){logger[_0xcced('0x1a')](_0x19a6a9);});}})[_0xcced('0x15')](function(){if(_0x4031c4&&_0x4031c4['openNewInteraction']&&_0x4031c4[_0xcced('0xdb')]){var _0x463694=[];if(_0x577af7[_0xcced('0x3c')]){_0x463694=_0x577af7[_0xcced('0x30')](function(_0x57659d){return{'name':_0x57659d[_0xcced('0xc7')],'basename':_0x57659d[_0xcced('0x61')],'type':_0x57659d['mimetype'],'ChatOfflineMessageId':_0x1849be['id']};});}var _0x30b372;if(!_[_0xcced('0x6d')](_0x4031c4['subjectOffline'])){var _0x3cb87b=_['map'](_0x1e2f2a[_0xcced('0x52')],function(_0x3eac32){return _0x3eac32;});var _0x5cf6e7=_['toPairsIn'](_0x3cb87b)[0x0];var _0x314276=_[_0xcced('0xdc')](_0x5cf6e7,function(_0x5038e4){return _0x5038e4;});_0x30b372=_0x314276[0x1][_0x4031c4[_0xcced('0xdd')]];}var _0x186eb6={'from':_0x4f095a[_0xcced('0xd9')],'firstName':_0x4f095a[_0xcced('0x98')],'lastName':_0x4f095a['lastName'],'mapKey':_0xcced('0xd9'),'message':{'from':_0x4f095a['email'],'to':_0x4031c4['MailAccount'][_0xcced('0xd9')],'cc':'','subject':_[_0xcced('0x6d')](_0x30b372)?_0x4031c4[_0xcced('0xda')]:_0x30b372,'messageId':'','sentAt':new Date(),'attach':_0x463694[_0xcced('0x3c')],'attachments':_0x463694,'originChannel':_0xcced('0xde'),'ChatWebsiteId':_0x4031c4['id'],'ChatOfflineMessageId':_0x59d4cc['id'],'originTo':_0x4031c4[_0xcced('0xc1')]['email']},'body':_0x59d4cc[_0xcced('0x52')]};var _0x487548={'account':{'id':_0x4031c4[_0xcced('0xdb')]},'body':_0x186eb6,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xcced('0xdf'),_0x487548,client9001)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x1b0f41){logger[_0xcced('0x1a')](_0x1b0f41);});}return;})[_0xcced('0x15')](function(){if(_0x59d4cc){return _0x59d4cc;}})[_0xcced('0x15')](respondWithResult(_0x12b3e7,null))[_0xcced('0x1d')](function(_0x412ceb){logger[_0xcced('0x1a')](_0xcced('0x1d'),_0x412ceb);for(var _0x25cc19 of _0x577af7){var _0x5c565f=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x25cc19[_0xcced('0x61')]);fs_extra[_0xcced('0xe0')](_0x5c565f)[_0xcced('0x1d')](function(_0x5af517){logger[_0xcced('0x1a')](_0xcced('0xe1'),_0x5c565f,_0x5af517);});}});};exports[_0xcced('0xe2')]=function(_0x444000,_0x20b258){return db[_0xcced('0xa4')]['find']({'where':{'id':_0x444000[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x20b258,null))[_0xcced('0x15')](function(_0x5c2028){if(_0x5c2028){return _0x5c2028[_0xcced('0xe2')](_0x444000['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x444000[_0xcced('0x52')],['ids','id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x20b258,null))[_0xcced('0x1d')](handleError(_0x20b258,null));};exports[_0xcced('0xe4')]=function(_0x4965ad,_0x523cec){var _0x1dabe1={'raw':![],'where':{}};var _0x6f026a={};var _0xcd7f43={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x4965ad[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x523cec,null))[_0xcced('0x15')](function(_0x16bcd9){if(_0x16bcd9){_0x6f026a[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatInteraction']['rawAttributes']);_0x6f026a[_0xcced('0x36')]=_[_0xcced('0x37')](_0x4965ad[_0xcced('0x36')]);_0x6f026a[_0xcced('0x38')]=_[_0xcced('0x39')](_0x6f026a[_0xcced('0x35')],_0x6f026a['query']);_0x1dabe1[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x6f026a['model'],qs['fields'](_0x4965ad[_0xcced('0x36')][_0xcced('0x3b')]));_0x1dabe1[_0xcced('0x3a')]=_0x1dabe1[_0xcced('0x3a')][_0xcced('0x3c')]?_0x1dabe1[_0xcced('0x3a')]:_0x6f026a[_0xcced('0x35')];if(!_0x4965ad[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x1dabe1[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x4965ad[_0xcced('0x36')][_0xcced('0x22')]);_0x1dabe1[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x4965ad[_0xcced('0x36')][_0xcced('0x25')]);}_0x1dabe1['order']=qs[_0xcced('0x40')](_0x4965ad['query'][_0xcced('0x40')]);_0x1dabe1[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x4965ad[_0xcced('0x36')],_0x6f026a[_0xcced('0x38')]));_0x1dabe1['where'][_0xcced('0x54')]=_0x16bcd9['id'];if(_0x4965ad['query'][_0xcced('0x43')]){_0x1dabe1[_0xcced('0x41')]=_[_0xcced('0x46')](_0x1dabe1[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x1dabe1[_0xcced('0x3a')],function(_0x20091f){var _0x5e623f={};_0x5e623f[_0x20091f]={'$like':'%'+_0x4965ad['query'][_0xcced('0x43')]+'%'};return _0x5e623f;})});}_0x1dabe1=_[_0xcced('0x46')]({},_0x1dabe1,_0x4965ad[_0xcced('0x4c')]);return db[_0xcced('0xa4')][_0xcced('0x24')]({'where':_0x1dabe1[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x320def){_0xcd7f43[_0xcced('0x24')]=_0x320def;if(_0x4965ad[_0xcced('0x36')][_0xcced('0x47')]){_0x1dabe1[_0xcced('0x48')]=[{'model':db[_0xcced('0x87')],'as':'Contact','required':![]},{'model':db[_0xcced('0xb1')],'as':_0xcced('0xe5'),'attributes':[_0xcced('0x2b'),_0xcced('0xe6'),_0xcced('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xcced('0xe8'),'attributes':['id','name',_0xcced('0xe9')],'where':_0x4965ad[_0xcced('0x36')]['tag']?{'id':_0x4965ad['query']['tag']}:undefined,'required':_0x4965ad[_0xcced('0x36')][_0xcced('0xea')]?!![]:![]}];}return db[_0xcced('0xa4')][_0xcced('0x49')](_0x1dabe1);})['then'](function(_0x397b0e){_0xcd7f43[_0xcced('0x5c')]=_0x397b0e;return _0xcd7f43;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x523cec,_0x1dabe1))[_0xcced('0x1d')](handleError(_0x523cec,null));};function iftimePromise(_0xbbf619,_0x6cf794){return respondWithRpcPromise(_0xcced('0xeb'),'getSnippet',{'command':_0x6cf794[_0xcced('0xec')]?util[_0xcced('0x9d')](_0xcced('0xed'),_0xbbf619[_0xcced('0xee')],_0x6cf794[_0xcced('0xec')]):util[_0xcced('0x9d')](_0xcced('0xef'),_0xbbf619[_0xcced('0xee')])},client9002)['then'](function(_0x2c2fe3){var _0x203b49=_0x2c2fe3&&_0x2c2fe3['indexOf'](_0xcced('0xf0'))>=0x0?!![]:![];logger[_0xcced('0xf1')](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],_0x203b49?_0xcced('0xf3'):_0xcced('0xf4'),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return _0x203b49;})[_0xcced('0x1d')](function(_0x3787f4){logger['error'](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],util[_0xcced('0xf6')](_0x3787f4,{'showHidden':![],'depth':null}),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return![];});}exports[_0xcced('0xf7')]=function(_0x5a9723,_0x20ae4c){var _0x413b6e=0x0;var _0xdc49da=0x0;var _0x7fc2ba=![];var _0x31a461;var _0x118083;return db[_0xcced('0x31')]['find']({'where':{'id':_0x5a9723[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf8'),'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf9'),'attributes':['id',_0xcced('0xee')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20ae4c,null))[_0xcced('0x15')](function(_0x291489){if(_0x291489){_0x31a461=_0x291489;return _0x291489[_0xcced('0xfa')]({'raw':!![]});}})['then'](function(_0x1f9241){if(_0x31a461){if(_0x1f9241){_0x118083=_0x1f9241;}}return require(_0xcced('0x6b'))[_0xcced('0xfb')]();})[_0xcced('0x15')](function(_0x42f5a6){if(_0x42f5a6){_0xdc49da=_0x42f5a6[_0xcced('0xfc')];_0x7fc2ba=_0x42f5a6[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db['ChatInteraction'][_0xcced('0x24')]({'where':{'closed':![]}});})[_0xcced('0x15')](function(_0x50a525){_0x413b6e=_0x50a525;if(_0xdc49da&&_0x50a525>_0xdc49da){return db[_0xcced('0xfd')][_0xcced('0xd1')]({'where':{'id':0x1}})[_0xcced('0x15')](function(_0x102e65){if(_0x102e65){_0x102e65['increment']('chatLicenseExceeded');}});}})[_0xcced('0x15')](function(){if(_0x31a461[_0xcced('0xf8')]&&_0x31a461[_0xcced('0xf8')]['Intervals']){var _0x3750a2=[];for(var _0x354e7c=0x0;_0x354e7c<_0x31a461[_0xcced('0xf8')]['Intervals'][_0xcced('0x3c')];_0x354e7c++){var _0x21be6c=_0x31a461[_0xcced('0xf8')]['Intervals'][_0x354e7c][_0xcced('0x28')]({'plain':!![]});_0x3750a2[_0xcced('0xac')](iftimePromise(_0x21be6c,_0x31a461));}return BPromise[_0xcced('0xfe')](_0x3750a2)['then'](function(_0x3c11e7){return _[_0xcced('0xff')](_0x3c11e7);});}else{return!![];}})[_0xcced('0x15')](function(_0x55e362){var _0x44abed=fs[_0xcced('0xc3')](path[_0xcced('0x68')](config['root'],_0xcced('0x100')),_0xcced('0xc5'));var _0x5887b3=new url['URL'](_0x31a461[_0xcced('0x101')])['origin'];var _0x4b88ad=_0xcced('0x102');var _0xaa4b44=![];var _0x1ea1ff={'chatVersion':_0x4b88ad,'chatWebsiteAddressOrigin':_0x5887b3,'remote':_0x31a461['remote'],'query':querystring[_0xcced('0x19')](_[_0xcced('0x46')](_0x31a461['get']({'plain':!![]}),{'customerIp':_0x5a9723['headers'][_0xcced('0x96')]||_0x5a9723[_0xcced('0x78')]['x-real-ip']||_0x5a9723[_0xcced('0x103')][_0xcced('0x104')]||_0x5a9723['ip'],'referer':_0x5a9723[_0xcced('0x78')][_0xcced('0x105')],'openedInteractions':_0x413b6e,'maxInteractions':_0xdc49da,'virtual':_0x7fc2ba[_0xcced('0xfc')],'online':_0x55e362,'custom':_0x7fc2ba}))[_0xcced('0x106')](/'/g,'\x5c\x27')};_0x20ae4c[_0xcced('0x2c')](ejs[_0xcced('0x107')](Mustache['render'](_0x44abed,_0x1ea1ff),{'proactiveActions':_0x118083,'alignment':_0x31a461[_0xcced('0x108')],'verticalAlignment':_0x31a461[_0xcced('0x109')],'div_color':_0x31a461[_0xcced('0xe9')],'labelText':_0x31a461['labelText'],'text_color':_0x31a461[_0xcced('0x10a')],'text_button_color':_0x31a461['textButtonColor'],'button_color':_0x31a461[_0xcced('0x10b')],'background_color':_0x31a461[_0xcced('0x10c')],'hideWhenOffline':_0x31a461[_0xcced('0x10d')],'intervalId':_0x31a461['IntervalId'],'isDevelopment':_0xaa4b44,'chatVersion':_0x4b88ad}));})[_0xcced('0x1d')](handleError(_0x20ae4c,null));};exports[_0xcced('0x10e')]=function(_0x537fb1,_0x19cabf){var _0x1df2c1=_0x537fb1[_0xcced('0x4b')]['id'];var _0x1fba43=_0x537fb1[_0xcced('0x52')];var _0x1625a2=0xc8;var _0xba9177=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xcced('0x10f')]['ISOLATION_LEVELS'][_0xcced('0x110')]},function(_0x483116){return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(_0xae1e6c){if(_0xae1e6c){return db['ChatApplication'][_0xcced('0x27')]({'where':{'ChatWebsiteId':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(){var _0xc4d6e1=_[_0xcced('0x30')](_0x1fba43,function(_0x424acb){_0x424acb[_0xcced('0x54')]=_0x1df2c1;return _0x424acb;});return db[_0xcced('0x111')][_0xcced('0xd0')](_0xc4d6e1,{'transaction':_0x483116});});}else{_0x1625a2=0x194;_0xba9177=[];}});})[_0xcced('0x15')](function(){if(_0x1625a2!==0x194){return db[_0xcced('0x111')][_0xcced('0x112')]({'where':{'ChatWebsiteId':_0x1df2c1},'order':_0xcced('0x90')})['then'](function(_0x6f4603){_0xba9177=_0x6f4603;});}})[_0xcced('0x1d')](function(_0x7e965b){_0x1625a2=0x1f4;logger[_0xcced('0x1a')](_0x7e965b[_0xcced('0x2a')]);if(_0x7e965b[_0xcced('0x2b')]){delete _0x7e965b[_0xcced('0x2b')];}_0xba9177=_0x7e965b;})[_0xcced('0x113')](function(){if(_0xba9177===null){_0x19cabf[_0xcced('0x1e')](_0x1625a2);}else{if(_0x1625a2===0x1f4){_0x19cabf[_0xcced('0x1f')](_0x1625a2)['send'](_0xba9177);}else{_0x19cabf[_0xcced('0x1f')](_0x1625a2)[_0xcced('0x21')](_0xba9177);}}});};exports['getApplications']=function(_0x1c0aef,_0x5752e7){var _0x508a2c={};var _0x5519d2={};var _0x5abb43;var _0x13a150;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1c0aef[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5752e7,null))[_0xcced('0x15')](function(_0x35b680){if(_0x35b680){_0x5abb43=_0x35b680;_0x5519d2[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatApplication']['rawAttributes']);_0x5519d2[_0xcced('0x36')]=_['keys'](_0x1c0aef[_0xcced('0x36')]);_0x5519d2['filters']=_['intersection'](_0x5519d2[_0xcced('0x35')],_0x5519d2['query']);_0x508a2c[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x5519d2[_0xcced('0x35')],qs['fields'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x3b')]));_0x508a2c['attributes']=_0x508a2c[_0xcced('0x3a')][_0xcced('0x3c')]?_0x508a2c[_0xcced('0x3a')]:_0x5519d2['model'];_0x508a2c[_0xcced('0x3f')]=qs['sort'](_0x1c0aef['query'][_0xcced('0x40')]);_0x508a2c[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x1c0aef[_0xcced('0x36')],_0x5519d2[_0xcced('0x38')]));if(_0x1c0aef[_0xcced('0x36')][_0xcced('0x43')]){_0x508a2c[_0xcced('0x41')]=_['merge'](_0x508a2c['where'],{'$or':_[_0xcced('0x30')](_0x508a2c[_0xcced('0x3a')],function(_0x5c0d5d){var _0x16ed51={};_0x16ed51[_0x5c0d5d]={'$like':'%'+_0x1c0aef['query']['filter']+'%'};return _0x16ed51;})});}_0x508a2c=_['merge']({},_0x508a2c,_0x1c0aef[_0xcced('0x4c')]);return _0x5abb43['getApplications'](_0x508a2c);}})[_0xcced('0x15')](function(_0x2360e3){if(_0x2360e3){_0x13a150=_0x2360e3[_0xcced('0x3c')];if(!_0x1c0aef[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x508a2c['limit']=qs[_0xcced('0x22')](_0x1c0aef['query'][_0xcced('0x22')]);_0x508a2c[_0xcced('0x25')]=qs['offset'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5abb43[_0xcced('0x114')](_0x508a2c);}})[_0xcced('0x15')](function(_0x21f992){if(_0x21f992){return _0x21f992?{'count':_0x13a150,'rows':_0x21f992}:null;}})[_0xcced('0x15')](respondWithResult(_0x5752e7,null))[_0xcced('0x1d')](handleError(_0x5752e7,null));};exports['addProactiveActions']=function(_0x475627,_0x110077){return db[_0xcced('0x115')][_0xcced('0x4d')]({'where':{'id':_0x475627['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x110077,null))['then'](function(_0x38fc70){if(_0x38fc70){return _0x38fc70['addProactiveActions'](_0x475627[_0xcced('0x52')][_0xcced('0x58')],_['omit'](_0x475627[_0xcced('0x52')],[_0xcced('0x58'),'id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x110077,null))[_0xcced('0x1d')](handleError(_0x110077,null));};exports[_0xcced('0xfa')]=function(_0x23c4a0,_0x2001f5){var _0x3fa897={};var _0x2ea578={};var _0x5bcf03;var _0x4522e1;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x23c4a0[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x2001f5,null))[_0xcced('0x15')](function(_0x250d2a){if(_0x250d2a){_0x5bcf03=_0x250d2a;_0x2ea578[_0xcced('0x35')]=_['keys'](db[_0xcced('0x116')]['rawAttributes']);_0x2ea578[_0xcced('0x36')]=_['keys'](_0x23c4a0[_0xcced('0x36')]);_0x2ea578['filters']=_['intersection'](_0x2ea578[_0xcced('0x35')],_0x2ea578[_0xcced('0x36')]);_0x3fa897[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x2ea578['model'],qs[_0xcced('0x3b')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x3b')]));_0x3fa897[_0xcced('0x3a')]=_0x3fa897[_0xcced('0x3a')][_0xcced('0x3c')]?_0x3fa897[_0xcced('0x3a')]:_0x2ea578[_0xcced('0x35')];_0x3fa897['order']=qs[_0xcced('0x40')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x40')]);_0x3fa897['where']=qs[_0xcced('0x38')](_['pick'](_0x23c4a0[_0xcced('0x36')],_0x2ea578[_0xcced('0x38')]));if(_0x23c4a0['query'][_0xcced('0x43')]){_0x3fa897[_0xcced('0x41')]=_[_0xcced('0x46')](_0x3fa897[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x3fa897['attributes'],function(_0x20ee43){var _0x5201ca={};_0x5201ca[_0x20ee43]={'$like':'%'+_0x23c4a0[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x5201ca;})});}_0x3fa897=_[_0xcced('0x46')]({},_0x3fa897,_0x23c4a0[_0xcced('0x4c')]);return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})[_0xcced('0x15')](function(_0x4f74ab){if(_0x4f74ab){_0x4522e1=_0x4f74ab[_0xcced('0x3c')];if(!_0x23c4a0[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x3fa897[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x22')]);_0x3fa897[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})['then'](function(_0x126d2c){if(_0x126d2c){return _0x126d2c?{'count':_0x4522e1,'rows':_0x126d2c}:null;}})[_0xcced('0x15')](respondWithResult(_0x2001f5,null))[_0xcced('0x1d')](handleError(_0x2001f5,null));};exports[_0xcced('0x117')]=function(_0x541e29,_0x3d97b5){var _0x4df014=_0x541e29[_0xcced('0x36')][_0xcced('0x118')]===_0xcced('0x119')?_0xcced('0x11a'):_0xcced('0x11b');return db['ChatWebsite']['find']({'attributes':['id',_0x4df014],'where':{'id':_0x541e29['params']['id']}})['then'](handleEntityNotFound(_0x3d97b5,null))[_0xcced('0x15')](function(_0x21c43d){if(_0x21c43d){var _0x11050f=_0x21c43d[_0x4df014];var _0x1bd368=_0x11050f&&_0x11050f[_0xcced('0x11c')]?_0x11050f[_0xcced('0x11c')]:[];_0x3d97b5[_0xcced('0x2c')]({'fromKey':_[_0xcced('0x6d')](_0x11050f['fromKey'])?undefined:_0x11050f[_0xcced('0x11d')],'count':_0x1bd368[_0xcced('0x3c')],'rows':_0x1bd368});}})[_0xcced('0x1d')](handleError(_0x3d97b5,null));};exports[_0xcced('0x11e')]=function(_0x54e75f,_0x559c0f){var _0x32f99f={'raw':![],'where':{}};var _0xc4c0ed={};var _0x3410d0={'count':0x0,'rows':[]};return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x54e75f['params']['id']}})['then'](handleEntityNotFound(_0x559c0f,null))['then'](function(_0x18dca6){if(_0x18dca6){_0xc4c0ed['model']=_[_0xcced('0x37')](db[_0xcced('0x11f')]['rawAttributes']);_0xc4c0ed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x54e75f[_0xcced('0x36')]);_0xc4c0ed[_0xcced('0x38')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],_0xc4c0ed[_0xcced('0x36')]);_0x32f99f[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x54e75f[_0xcced('0x36')][_0xcced('0x3b')]));_0x32f99f[_0xcced('0x3a')]=_0x32f99f[_0xcced('0x3a')]['length']?_0x32f99f['attributes']:_0xc4c0ed[_0xcced('0x35')];if(!_0x54e75f[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x32f99f[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x54e75f[_0xcced('0x36')][_0xcced('0x22')]);_0x32f99f[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x54e75f['query']['offset']);}_0x32f99f[_0xcced('0x3f')]=qs['sort'](_0x54e75f['query'][_0xcced('0x40')]);_0x32f99f[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x54e75f[_0xcced('0x36')],_0xc4c0ed[_0xcced('0x38')]));_0x32f99f['where'][_0xcced('0x54')]=_0x18dca6['id'];if(_0x54e75f[_0xcced('0x36')]['filter']){_0x32f99f['where']=_[_0xcced('0x46')](_0x32f99f[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x32f99f[_0xcced('0x3a')],function(_0x4f63c9){var _0x53b4b8={};_0x53b4b8[_0x4f63c9]={'$like':'%'+_0x54e75f[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x53b4b8;})});}_0x32f99f=_[_0xcced('0x46')]({},_0x32f99f,_0x54e75f[_0xcced('0x4c')]);return db[_0xcced('0x11f')]['count']({'where':_0x32f99f[_0xcced('0x41')]})[_0xcced('0x15')](function(_0xe329ab){_0x3410d0['count']=_0xe329ab;if(_0x54e75f[_0xcced('0x36')][_0xcced('0x47')]){_0x32f99f['include']=[{'all':!![]}];}else{_0x32f99f['include']=[{'model':db[_0xcced('0x87')],'as':_0xcced('0x120'),'required':![]},{'model':db[_0xcced('0xcf')],'as':_0xcced('0x121'),'required':![]}];}return db[_0xcced('0x11f')][_0xcced('0x49')](_0x32f99f);})[_0xcced('0x15')](function(_0x19f355){_0x3410d0[_0xcced('0x5c')]=_0x19f355;return _0x3410d0;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x559c0f,_0x32f99f))[_0xcced('0x1d')](handleError(_0x559c0f,null));};exports[_0xcced('0x122')]=function(_0x3675f4,_0x562457){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x3675f4[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x562457,null))[_0xcced('0x15')](function(_0x3472ec){if(_0x3472ec){return _0x3472ec[_0xcced('0x122')](_0x3675f4['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x3675f4[_0xcced('0x52')],['ids','id'])||{})[_0xcced('0xa8')](function(_0x27a447){for(var _0x14e490=0x0;_0x14e490<_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0xcced('0x3c')];_0x14e490+=0x1){socket[_0xcced('0x123')](_0xcced('0x124'),{'UserId':Number(_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0x14e490]),'ChatWebsiteId':Number(_0x3675f4[_0xcced('0x4b')]['id'])});}return _0x27a447;});}})[_0xcced('0x15')](respondWithResult(_0x562457,null))[_0xcced('0x1d')](handleError(_0x562457,null));};exports['removeAgents']=function(_0x160764,_0x4d0d2c){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x160764['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x4d0d2c,null))[_0xcced('0x15')](function(_0x4abe52){if(_0x4abe52){return _0x4abe52['removeAgents'](_0x160764[_0xcced('0x36')][_0xcced('0x58')])[_0xcced('0x15')](function(){if(_[_0xcced('0x125')](_0x160764['query'][_0xcced('0x58')])){for(var _0x523a90=0x0;_0x523a90<_0x160764['query'][_0xcced('0x58')][_0xcced('0x3c')];_0x523a90+=0x1){socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')][_0x523a90]),'ChatWebsiteId':Number(_0x160764[_0xcced('0x4b')]['id'])});}}else{socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')]),'ChatWebsiteId':Number(_0x160764['params']['id'])});}});}})[_0xcced('0x15')](respondWithStatusCode(_0x4d0d2c,null))[_0xcced('0x1d')](handleError(_0x4d0d2c,null));};exports[_0xcced('0x127')]=function(_0x55e328,_0x340e31){var _0x58e0ee={};var _0x223776={};var _0x1781f9;var _0x2c50ad;return db['ChatWebsite'][_0xcced('0xd1')]({'where':{'id':_0x55e328[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x340e31,null))['then'](function(_0x15c9ea){if(_0x15c9ea){_0x1781f9=_0x15c9ea;_0x223776[_0xcced('0x35')]=_['keys'](db['User'][_0xcced('0x32')]);_0x223776[_0xcced('0x36')]=_[_0xcced('0x37')](_0x55e328[_0xcced('0x36')]);_0x223776['filters']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],_0x223776[_0xcced('0x36')]);_0x58e0ee['attributes']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],qs['fields'](_0x55e328['query'][_0xcced('0x3b')]));_0x58e0ee[_0xcced('0x3a')]=_0x58e0ee[_0xcced('0x3a')]['length']?_0x58e0ee[_0xcced('0x3a')]:_0x223776[_0xcced('0x35')];_0x58e0ee['order']=qs['sort'](_0x55e328[_0xcced('0x36')][_0xcced('0x40')]);_0x58e0ee[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x55e328[_0xcced('0x36')],_0x223776[_0xcced('0x38')]));if(_0x55e328[_0xcced('0x36')][_0xcced('0x43')]){_0x58e0ee[_0xcced('0x41')]=_[_0xcced('0x46')](_0x58e0ee[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x58e0ee[_0xcced('0x3a')],function(_0x41f2e6){var _0x33f0a5={};_0x33f0a5[_0x41f2e6]={'$like':'%'+_0x55e328[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x33f0a5;})});}_0x58e0ee=_[_0xcced('0x46')]({},_0x58e0ee,_0x55e328[_0xcced('0x4c')]);return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x14b2d7){if(_0x14b2d7){_0x2c50ad=_0x14b2d7[_0xcced('0x3c')];if(!_0x55e328[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x58e0ee['limit']=qs[_0xcced('0x22')](_0x55e328[_0xcced('0x36')][_0xcced('0x22')]);_0x58e0ee[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x55e328[_0xcced('0x36')][_0xcced('0x25')]);}return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x473792){if(_0x473792){return _0x473792?{'count':_0x2c50ad,'rows':_0x473792}:null;}})[_0xcced('0x15')](respondWithResult(_0x340e31,null))['catch'](handleError(_0x340e31,null));};
\ No newline at end of file
+var _0x6691=['show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','List','applications','Applications','list','asc','account','ListId','contact','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','offline','send','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','openNewInteraction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','files','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','textButtonColor','IntervalId','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','url','defaults','redis','localhost','socket.io-emitter','register','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','json','undefined','count','offset','limit','status','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','name','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','ChatWebsite','includeAll','include','findAll','rows'];(function(_0x4e7f55,_0x3729f9){var _0xa2aee1=function(_0x1a66a2){while(--_0x1a66a2){_0x4e7f55['push'](_0x4e7f55['shift']());}};_0xa2aee1(++_0x3729f9);}(_0x6691,0xe7));var _0x1669=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6691[_0x1035c1];return _0x308d67;};'use strict';var BPromise=require(_0x1669('0x0'));var Mustache=require(_0x1669('0x1'));var util=require(_0x1669('0x2'));var path=require(_0x1669('0x3'));var ejs=require(_0x1669('0x4'));var fs=require('fs');var fs_extra=require(_0x1669('0x5'));var _=require(_0x1669('0x6'));var querystring=require(_0x1669('0x7'));var Redis=require(_0x1669('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x1669('0x9'))(_0x1669('0xa'));var config=require(_0x1669('0xb'));var url=require(_0x1669('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1669('0xd')](config[_0x1669('0xe')],{'host':_0x1669('0xf'),'port':0x18eb});var socket=require(_0x1669('0x10'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x1669('0x11')](socket);var htmlToText=require(_0x1669('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232c});var client9002=jayson[_0x1669('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x232b});var client9001=jayson[_0x1669('0x13')][_0x1669('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2552a3,_0x5ebf12,_0x4ae9a7,_0x2100b7){return new BPromise(function(_0x4647db,_0x2d926e){var _0x3c352b=_0x2100b7||client;return _0x3c352b[_0x1669('0x15')](_0x2552a3,_0x4ae9a7)[_0x1669('0x16')](function(_0x5868be){logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));logger[_0x1669('0x19')](_0x1669('0x1a'),_0x5ebf12,'request\x20sent',JSON['stringify'](_0x5868be));if(_0x5868be[_0x1669('0x1b')]){if(_0x5868be[_0x1669('0x1b')][_0x1669('0x1c')]===0x1f4){logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x2d926e(_0x5868be[_0x1669('0x1b')][_0x1669('0x1d')]);}logger[_0x1669('0x1b')](_0x1669('0x17'),_0x5ebf12,_0x5868be['error']['message']);return _0x4647db(_0x5868be[_0x1669('0x1b')]['message']);}else{logger['info'](_0x1669('0x17'),_0x5ebf12,_0x1669('0x18'));_0x4647db(_0x5868be['result'][_0x1669('0x1d')]);}})[_0x1669('0x1e')](function(_0x1345d8){logger['error'](_0x1669('0x17'),_0x5ebf12,_0x1345d8);_0x2d926e(_0x1345d8);});});}function respondWithStatusCode(_0x87b47b,_0x623948){_0x623948=_0x623948||0xcc;return function(_0x301dc7){if(_0x301dc7){return _0x87b47b['sendStatus'](_0x623948);}return _0x87b47b['status'](_0x623948)[_0x1669('0x1f')]();};}function respondWithResult(_0x43577b,_0x40612b){_0x40612b=_0x40612b||0xc8;return function(_0x321ccf){if(_0x321ccf){return _0x43577b['status'](_0x40612b)[_0x1669('0x20')](_0x321ccf);}};}function respondWithFilteredResult(_0x4401a2,_0x12470c){return function(_0x4a228e){if(_0x4a228e){var _0x3055aa=typeof _0x12470c['offset']===_0x1669('0x21')&&typeof _0x12470c['limit']==='undefined';var _0x1ab97b=_0x4a228e[_0x1669('0x22')];var _0x1f62ea=_0x3055aa?0x0:_0x12470c[_0x1669('0x23')];var _0x35c0ac=_0x3055aa?_0x4a228e[_0x1669('0x22')]:_0x12470c[_0x1669('0x23')]+_0x12470c[_0x1669('0x24')];var _0x57e754;if(_0x35c0ac>=_0x1ab97b){_0x35c0ac=_0x1ab97b;_0x57e754=0xc8;}else{_0x57e754=0xce;}_0x4401a2[_0x1669('0x25')](_0x57e754);return _0x4401a2[_0x1669('0x26')](_0x1669('0x27'),_0x1f62ea+'-'+_0x35c0ac+'/'+_0x1ab97b)[_0x1669('0x20')](_0x4a228e);}return null;};}function saveUpdates(_0x348c14){return function(_0x3b0437){if(_0x3b0437){return _0x3b0437[_0x1669('0x28')](_0x348c14)[_0x1669('0x16')](function(_0x15bebb){return _0x15bebb;});}return null;};}function removeEntity(_0x404d87){return function(_0x1af32e){if(_0x1af32e){return _0x1af32e['destroy']()[_0x1669('0x16')](function(){var _0x324fe9=_0x1af32e[_0x1669('0x29')]({'plain':!![]});var _0x1827e2=_0x1669('0x2a');return db[_0x1669('0x2b')][_0x1669('0x2c')]({'where':{'type':_0x1827e2,'resourceId':_0x324fe9['id']}})[_0x1669('0x16')](function(){return _0x1af32e;});})[_0x1669('0x16')](function(){_0x404d87[_0x1669('0x25')](0xcc)[_0x1669('0x1f')]();});}};}function handleEntityNotFound(_0x3938f1){return function(_0x182241){if(!_0x182241){_0x3938f1[_0x1669('0x2d')](0x194);}return _0x182241;};}function handleError(_0xa74528,_0x5c9be4){_0x5c9be4=_0x5c9be4||0x1f4;return function(_0x58c844){logger[_0x1669('0x1b')](_0x58c844['stack']);if(_0x58c844[_0x1669('0x2e')]){delete _0x58c844['name'];}_0xa74528[_0x1669('0x25')](_0x5c9be4)['send'](_0x58c844);};}exports['index']=function(_0x834182,_0x23bf51){var _0x6165df={'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x1fdd21={},_0x610175={'count':0x0,'rows':[]};var _0x22ab96=_[_0x1669('0x30')](db['ChatWebsite'][_0x1669('0x31')],function(_0x5925ff){return{'name':_0x5925ff['fieldName'],'type':_0x5925ff['type'][_0x1669('0x32')]};});_0x1fdd21[_0x1669('0x33')]=_[_0x1669('0x30')](_0x22ab96,_0x1669('0x2e'));_0x1fdd21[_0x1669('0x34')]=_[_0x1669('0x35')](_0x834182[_0x1669('0x34')]);_0x1fdd21['filters']=_[_0x1669('0x36')](_0x1fdd21[_0x1669('0x33')],_0x1fdd21[_0x1669('0x34')]);_0x6165df[_0x1669('0x37')]=_['intersection'](_0x1fdd21[_0x1669('0x33')],qs[_0x1669('0x38')](_0x834182[_0x1669('0x34')][_0x1669('0x38')]));_0x6165df[_0x1669('0x37')]=_0x6165df[_0x1669('0x37')]['length']?_0x6165df[_0x1669('0x37')]:_0x1fdd21[_0x1669('0x33')];if(!_0x834182[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x6165df[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x834182[_0x1669('0x34')][_0x1669('0x24')]);_0x6165df[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x834182[_0x1669('0x34')][_0x1669('0x23')]);}_0x6165df[_0x1669('0x3b')]=qs['sort'](_0x834182[_0x1669('0x34')][_0x1669('0x3c')]);_0x6165df[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x834182[_0x1669('0x34')],_0x1fdd21['filters']),_0x22ab96);if(_0x834182['query'][_0x1669('0x40')]){_0x6165df[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x6165df[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x22ab96,function(_0x5bb65a){if(_0x5bb65a[_0x1669('0x42')]!=='VIRTUAL'){var _0x5df323={};_0x5df323[_0x5bb65a[_0x1669('0x2e')]]={'$like':'%'+_0x834182[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x5df323;}})});}_0x6165df=_[_0x1669('0x41')]({},_0x6165df,_0x834182['options']);var _0x174e2f={'where':_0x6165df['where']};return db[_0x1669('0x43')][_0x1669('0x22')](_0x174e2f)[_0x1669('0x16')](function(_0x19bdec){_0x610175[_0x1669('0x22')]=_0x19bdec;if(_0x834182[_0x1669('0x34')][_0x1669('0x44')]){_0x6165df[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x43')][_0x1669('0x46')](_0x6165df);})['then'](function(_0x1466a2){_0x610175[_0x1669('0x47')]=_0x1466a2;return _0x610175;})[_0x1669('0x16')](respondWithFilteredResult(_0x23bf51,_0x6165df))['catch'](handleError(_0x23bf51,null));};exports[_0x1669('0x48')]=function(_0x28a30d,_0x490ea2){var _0x19bf78={'raw':![],'where':{'id':_0x28a30d[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]},_0x115645={};_0x115645[_0x1669('0x33')]=_[_0x1669('0x35')](db['ChatWebsite']['rawAttributes']);_0x115645[_0x1669('0x34')]=_[_0x1669('0x35')](_0x28a30d[_0x1669('0x34')]);_0x115645[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],_0x115645[_0x1669('0x34')]);_0x19bf78[_0x1669('0x37')]=_[_0x1669('0x36')](_0x115645[_0x1669('0x33')],qs[_0x1669('0x38')](_0x28a30d[_0x1669('0x34')][_0x1669('0x38')]));_0x19bf78[_0x1669('0x37')]=_0x19bf78[_0x1669('0x37')][_0x1669('0x4a')]?_0x19bf78[_0x1669('0x37')]:_0x115645[_0x1669('0x33')];if(_0x28a30d[_0x1669('0x34')][_0x1669('0x44')]){_0x19bf78[_0x1669('0x45')]=[{'all':!![]}];}_0x19bf78=_[_0x1669('0x41')]({},_0x19bf78,_0x28a30d[_0x1669('0x4b')]);return db[_0x1669('0x43')]['find'](_0x19bf78)[_0x1669('0x16')](handleEntityNotFound(_0x490ea2,null))['then'](respondWithResult(_0x490ea2,null))[_0x1669('0x1e')](handleError(_0x490ea2,null));};exports['create']=function(_0x5d527d,_0x575796){return db['ChatWebsite']['create'](_0x5d527d[_0x1669('0x4c')],{})[_0x1669('0x16')](function(_0x5b98c0){var _0x3d08f2=_0x5d527d['user'][_0x1669('0x29')]({'plain':!![]});if(!_0x3d08f2)throw new Error(_0x1669('0x4d'));if(_0x3d08f2[_0x1669('0x4e')]==='user'){var _0x2ecc38=_0x5b98c0[_0x1669('0x29')]({'plain':!![]});var _0x25695c=_0x1669('0x2a');return db[_0x1669('0x4f')][_0x1669('0x50')]({'where':{'name':_0x25695c,'userProfileId':_0x3d08f2['userProfileId']},'raw':!![]})[_0x1669('0x16')](function(_0x4964b0){if(_0x4964b0&&_0x4964b0[_0x1669('0x51')]===0x0){return db['UserProfileResource'][_0x1669('0x52')]({'name':_0x2ecc38[_0x1669('0x2e')],'resourceId':_0x2ecc38['id'],'type':_0x4964b0[_0x1669('0x2e')],'sectionId':_0x4964b0['id']},{})[_0x1669('0x16')](function(){return _0x5b98c0;});}else{return _0x5b98c0;}})['catch'](function(_0x3876cb){logger[_0x1669('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3876cb);throw _0x3876cb;});}return _0x5b98c0;})[_0x1669('0x16')](respondWithResult(_0x575796,0xc9))[_0x1669('0x1e')](handleError(_0x575796,null));};exports[_0x1669('0x28')]=function(_0x38cf1a,_0x2237ab){if(_0x38cf1a[_0x1669('0x4c')]['id']){delete _0x38cf1a[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x38cf1a[_0x1669('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x1669('0x2f')}]})[_0x1669('0x16')](handleEntityNotFound(_0x2237ab,null))[_0x1669('0x16')](saveUpdates(_0x38cf1a[_0x1669('0x4c')],null))['then'](respondWithResult(_0x2237ab,null))[_0x1669('0x1e')](handleError(_0x2237ab,null));};exports[_0x1669('0x2c')]=function(_0x3dfa73,_0x4a2eca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x3dfa73[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a2eca,null))[_0x1669('0x16')](removeEntity(_0x4a2eca,null))['catch'](handleError(_0x4a2eca,null));};exports[_0x1669('0x53')]=function(_0x2ab2f6,_0xa43a09){return db[_0x1669('0x43')]['describe']()['then'](respondWithResult(_0xa43a09,null))[_0x1669('0x1e')](handleError(_0xa43a09,null));};exports[_0x1669('0x54')]=function(_0x24fc6e,_0xea02bd){if(_0x24fc6e[_0x1669('0x4c')]['id']){delete _0x24fc6e[_0x1669('0x4c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x24fc6e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0xea02bd,null))[_0x1669('0x16')](function(_0x5037a8){if(_0x5037a8){_0x24fc6e[_0x1669('0x4c')][_0x1669('0x55')]=_0x5037a8['id'];return db[_0x1669('0x56')][_0x1669('0x52')](_0x24fc6e[_0x1669('0x4c')]);}})['then'](respondWithResult(_0xea02bd,null))[_0x1669('0x1e')](handleError(_0xea02bd,null));};exports[_0x1669('0x57')]=function(_0x3df7fd,_0x7d644){var _0x39f21b={'raw':![],'where':{}};var _0x6d0306={};var _0x272111={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1669('0x58')]({'where':{'id':_0x3df7fd['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x7d644,null))[_0x1669('0x16')](function(_0x4d566e){if(_0x4d566e){_0x6d0306[_0x1669('0x33')]=_['keys'](db[_0x1669('0x56')]['rawAttributes']);_0x6d0306[_0x1669('0x34')]=_['keys'](_0x3df7fd[_0x1669('0x34')]);_0x6d0306['filters']=_[_0x1669('0x36')](_0x6d0306['model'],_0x6d0306[_0x1669('0x34')]);_0x39f21b[_0x1669('0x37')]=_['intersection'](_0x6d0306[_0x1669('0x33')],qs[_0x1669('0x38')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x38')]));_0x39f21b[_0x1669('0x37')]=_0x39f21b[_0x1669('0x37')]['length']?_0x39f21b[_0x1669('0x37')]:_0x6d0306['model'];if(!_0x3df7fd[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x39f21b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x3df7fd[_0x1669('0x34')][_0x1669('0x24')]);_0x39f21b[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x3df7fd['query'][_0x1669('0x23')]);}_0x39f21b[_0x1669('0x3b')]=qs['sort'](_0x3df7fd[_0x1669('0x34')]['sort']);_0x39f21b['where']=qs[_0x1669('0x3e')](_['pick'](_0x3df7fd[_0x1669('0x34')],_0x6d0306[_0x1669('0x3e')]));_0x39f21b[_0x1669('0x3d')][_0x1669('0x55')]=_0x4d566e['id'];if(_0x3df7fd['query'][_0x1669('0x40')]){_0x39f21b[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x39f21b[_0x1669('0x3d')],{'$or':_['map'](_0x39f21b[_0x1669('0x37')],function(_0x3ca4ab){var _0x3d1dbf={};_0x3d1dbf[_0x3ca4ab]={'$like':'%'+_0x3df7fd[_0x1669('0x34')][_0x1669('0x40')]+'%'};return _0x3d1dbf;})});}_0x39f21b=_[_0x1669('0x41')]({},_0x39f21b,_0x3df7fd[_0x1669('0x4b')]);return db['Disposition'][_0x1669('0x22')]({'where':_0x39f21b[_0x1669('0x3d')]})['then'](function(_0x5db23d){_0x272111[_0x1669('0x22')]=_0x5db23d;if(_0x3df7fd[_0x1669('0x34')][_0x1669('0x44')]){_0x39f21b[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x56')][_0x1669('0x46')](_0x39f21b);})[_0x1669('0x16')](function(_0x533e59){_0x272111['rows']=_0x533e59;return _0x272111;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x7d644,_0x39f21b))[_0x1669('0x1e')](handleError(_0x7d644,null));};exports[_0x1669('0x59')]=function(_0x56f211,_0x70a9ca){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x56f211[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x70a9ca,null))[_0x1669('0x16')](function(_0x1bebe1){if(_0x1bebe1){return _0x1bebe1['removeDispositions'](_0x56f211[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x70a9ca,null))['catch'](handleError(_0x70a9ca,null));};exports['addAnswer']=function(_0x34d4ec,_0x1158d6){if(_0x34d4ec[_0x1669('0x4c')]['id']){delete _0x34d4ec[_0x1669('0x4c')]['id'];}return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x34d4ec[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x1158d6,null))[_0x1669('0x16')](function(_0x35597e){if(_0x35597e){_0x34d4ec[_0x1669('0x4c')][_0x1669('0x55')]=_0x35597e['id'];return db[_0x1669('0x5b')]['create'](_0x34d4ec[_0x1669('0x4c')]);}})[_0x1669('0x16')](respondWithResult(_0x1158d6,null))['catch'](handleError(_0x1158d6,null));};exports[_0x1669('0x5c')]=function(_0x418eed,_0x5b82bc){var _0x2b538c={'raw':![],'where':{}};var _0xe35d38={};var _0x4137fb={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x418eed[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b82bc,null))['then'](function(_0x3704f4){if(_0x3704f4){_0xe35d38[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x5b')][_0x1669('0x31')]);_0xe35d38['query']=_['keys'](_0x418eed['query']);_0xe35d38['filters']=_['intersection'](_0xe35d38['model'],_0xe35d38[_0x1669('0x34')]);_0x2b538c[_0x1669('0x37')]=_['intersection'](_0xe35d38[_0x1669('0x33')],qs[_0x1669('0x38')](_0x418eed[_0x1669('0x34')][_0x1669('0x38')]));_0x2b538c[_0x1669('0x37')]=_0x2b538c['attributes'][_0x1669('0x4a')]?_0x2b538c[_0x1669('0x37')]:_0xe35d38['model'];if(!_0x418eed[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x2b538c[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x418eed[_0x1669('0x34')]['limit']);_0x2b538c[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x418eed[_0x1669('0x34')][_0x1669('0x23')]);}_0x2b538c['order']=qs['sort'](_0x418eed[_0x1669('0x34')][_0x1669('0x3c')]);_0x2b538c['where']=qs['filters'](_[_0x1669('0x3f')](_0x418eed['query'],_0xe35d38[_0x1669('0x3e')]));_0x2b538c[_0x1669('0x3d')][_0x1669('0x55')]=_0x3704f4['id'];if(_0x418eed['query'][_0x1669('0x40')]){_0x2b538c[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x2b538c[_0x1669('0x3d')],{'$or':_['map'](_0x2b538c['attributes'],function(_0xe9b1b){var _0x32c53a={};_0x32c53a[_0xe9b1b]={'$like':'%'+_0x418eed['query'][_0x1669('0x40')]+'%'};return _0x32c53a;})});}_0x2b538c=_[_0x1669('0x41')]({},_0x2b538c,_0x418eed[_0x1669('0x4b')]);return db['CannedAnswer']['count']({'where':_0x2b538c[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x2e88e8){_0x4137fb[_0x1669('0x22')]=_0x2e88e8;if(_0x418eed[_0x1669('0x34')][_0x1669('0x44')]){_0x2b538c[_0x1669('0x45')]=[{'all':!![]}];}return db[_0x1669('0x5b')][_0x1669('0x46')](_0x2b538c);})[_0x1669('0x16')](function(_0xab854b){_0x4137fb[_0x1669('0x47')]=_0xab854b;return _0x4137fb;});}})['then'](respondWithFilteredResult(_0x5b82bc,_0x2b538c))['catch'](handleError(_0x5b82bc,null));};exports[_0x1669('0x5d')]=function(_0x52ec4b,_0x508b94){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x52ec4b[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x508b94,null))[_0x1669('0x16')](function(_0x1b4941){if(_0x1b4941){return _0x1b4941[_0x1669('0x5d')](_0x52ec4b[_0x1669('0x34')][_0x1669('0x5a')]);}})[_0x1669('0x16')](respondWithStatusCode(_0x508b94,null))[_0x1669('0x1e')](handleError(_0x508b94,null));};exports[_0x1669('0x5e')]=function(_0x247939,_0x4d461d){_0x247939['body'][_0x1669('0x5f')]=_0x247939[_0x1669('0x60')][_0x1669('0x61')];return db['ChatWebsite'][_0x1669('0x50')]({'where':{'id':_0x247939[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4d461d,null))['then'](saveUpdates(_0x247939['body'],null))['then'](respondWithResult(_0x4d461d,null))[_0x1669('0x1e')](handleError(_0x4d461d,null));};exports['addAvatar']=function(_0x1f2f4d,_0x4877aa){_0x1f2f4d['body'][_0x1669('0x62')]=_0x1f2f4d[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1f2f4d[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4877aa,null))['then'](saveUpdates(_0x1f2f4d[_0x1669('0x4c')],null))[_0x1669('0x16')](respondWithResult(_0x4877aa,null))[_0x1669('0x1e')](handleError(_0x4877aa,null));};exports[_0x1669('0x63')]=function(_0x563429,_0x25ef1a){_0x563429[_0x1669('0x4c')][_0x1669('0x64')]=_0x563429[_0x1669('0x60')]['filename'];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x563429['params']['id']}})['then'](handleEntityNotFound(_0x25ef1a,null))[_0x1669('0x16')](saveUpdates(_0x563429[_0x1669('0x4c')],null))['then'](respondWithResult(_0x25ef1a,null))['catch'](handleError(_0x25ef1a,null));};exports[_0x1669('0x65')]=function(_0x35b279,_0xd90e09){_0x35b279['body'][_0x1669('0x66')]=_0x35b279[_0x1669('0x60')][_0x1669('0x61')];return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x35b279['params']['id']}})['then'](handleEntityNotFound(_0xd90e09,null))[_0x1669('0x16')](saveUpdates(_0x35b279['body'],null))[_0x1669('0x16')](respondWithResult(_0xd90e09,null))[_0x1669('0x1e')](handleError(_0xd90e09,null));};exports[_0x1669('0x67')]=function(_0x5862eb,_0x276b78){var _0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x6a'));var _0x2cab47={'where':{'id':_0x5862eb[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x5f')],'raw':!![]};var _0x3679d0=![];return require(_0x1669('0x6b'))[_0x1669('0x6c')]()['then'](function(_0xcf579f){if(_0xcf579f){_0x3679d0=_0xcf579f[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db['ChatWebsite'][_0x1669('0x50')](_0x2cab47);})[_0x1669('0x16')](handleEntityNotFound(_0x276b78,null))['then'](function(_0x49c2fe){if(_0x49c2fe){if(!_[_0x1669('0x6e')](_0x49c2fe[_0x1669('0x5f')])){if(fs[_0x1669('0x6f')](path[_0x1669('0x68')](config['root'],_0x1669('0x70'),_0x49c2fe[_0x1669('0x5f')]))&&_0x3679d0){_0x4353c2=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x70'),_0x49c2fe['sitepic']);}}return _0x276b78[_0x1669('0x71')](_0x4353c2);}})['catch'](handleError(_0x276b78,null));};exports[_0x1669('0x72')]=function(_0x344b11,_0x460d0e){var _0x2808ac=path[_0x1669('0x68')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x438abe={'where':{'id':_0x344b11['params']['id']},'attributes':['id',_0x1669('0x62')],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x438abe)[_0x1669('0x16')](handleEntityNotFound(_0x460d0e,null))[_0x1669('0x16')](function(_0x8c0af8){if(_0x8c0af8){if(!_[_0x1669('0x6e')](_0x8c0af8[_0x1669('0x62')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],'server/files/images/avatars/',_0x8c0af8[_0x1669('0x62')]))){_0x2808ac=path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x8c0af8['agentAvatar']);}}return _0x460d0e[_0x1669('0x71')](_0x2808ac);}})[_0x1669('0x1e')](handleError(_0x460d0e,null));};exports[_0x1669('0x74')]=function(_0x461af2,_0x337325){var _0x3b7dce=path['join'](config[_0x1669('0x69')],_0x1669('0x75'));var _0x29b2b7={'where':{'id':_0x461af2[_0x1669('0x49')]['id']},'attributes':['id',_0x1669('0x64'),_0x1669('0x76')],'raw':!![]};return db['ChatWebsite'][_0x1669('0x50')](_0x29b2b7)[_0x1669('0x16')](handleEntityNotFound(_0x337325,null))[_0x1669('0x16')](function(_0x55778a){if(_0x55778a){if(!_[_0x1669('0x6e')](_0x55778a[_0x1669('0x64')])){if(fs['existsSync'](path[_0x1669('0x68')](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]))&&_0x55778a[_0x1669('0x76')]){_0x3b7dce=path['join'](config['root'],_0x1669('0x73'),_0x55778a[_0x1669('0x64')]);}}return _0x337325[_0x1669('0x71')](_0x3b7dce);}})[_0x1669('0x1e')](handleError(_0x337325,null));};exports['getSystemAvatar']=function(_0x54c7d0,_0x4c379a){var _0x1259d0=path['join'](config[_0x1669('0x69')],_0x1669('0x77'));var _0x5ba281={'where':{'id':_0x54c7d0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1669('0x43')][_0x1669('0x50')](_0x5ba281)[_0x1669('0x16')](handleEntityNotFound(_0x4c379a,null))[_0x1669('0x16')](function(_0x1ab6fd){if(_0x1ab6fd){if(!_[_0x1669('0x6e')](_0x1ab6fd[_0x1669('0x66')])){if(fs[_0x1669('0x6f')](path['join'](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]))){_0x1259d0=path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0x73'),_0x1ab6fd[_0x1669('0x66')]);}}return _0x4c379a[_0x1669('0x71')](_0x1259d0);}})['catch'](handleError(_0x4c379a,null));};exports[_0x1669('0x78')]=function(_0x288269,_0xe08359){var _0x71746a=require(_0x1669('0x79'));var _0x5f3181=new _0x71746a();var _0x2202a3=_0x5f3181[_0x1669('0x7a')](_0x288269['headers'][_0x1669('0x7b')])[_0x1669('0x7c')]();var _0x5a24d3={'body':_0x288269['body'],'channel':_0x1669('0x7d')};var _0x285875=[];var _0x18fd61=[];var _0x1c34af={};var _0x24eb12=![];return db[_0x1669('0x7e')][_0x1669('0x53')]()[_0x1669('0x16')](function(_0x774a7e){if(!_0x774a7e){throw new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x80'));}_0x285875=_[_0x1669('0x81')](_['keys'](_0x774a7e),[_0x1669('0x82'),_0x1669('0x83')]);_0x18fd61=_[_0x1669('0x81')](_[_0x1669('0x35')](_0x774a7e),['createdAt',_0x1669('0x83'),_0x1669('0x84'),'ListId']);if(_0x288269['body']['id']){delete _0x288269[_0x1669('0x4c')]['id'];}if(_['isNil'](_0x288269[_0x1669('0x4c')][_0x1669('0x85')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x288269['body'][_0x1669('0x4c')])||_0x288269['body']['body']===''){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x87'));}if(_[_0x1669('0x6e')](_0x288269[_0x1669('0x4c')][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0x89')+_0x18fd61);}if(!_[_0x1669('0x8a')](_0x18fd61,_0x288269['body'][_0x1669('0x88')])){throw new db[(_0x1669('0x86'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18fd61);}_0x1c34af[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x288269[_0x1669('0x49')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1669('0x7e')],'as':_0x1669('0x8b'),'where':_0x1c34af,'limit':0x1,'order':[['updatedAt',_0x1669('0x8c')]]}]},{'model':db[_0x1669('0x8d')],'as':'Applications'}]});})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))['then'](function(_0x81f3f2){if(_0x81f3f2&&_0x81f3f2[_0x1669('0x8e')]){_0x5a24d3['account']=_0x81f3f2;_0x5a24d3[_0x1669('0x8f')]=_0x81f3f2[_0x1669('0x90')];_0x5a24d3[_0x1669('0x91')]=_0x81f3f2['List'];_0x5a24d3[_0x1669('0x8f')]=_['orderBy'](_0x5a24d3[_0x1669('0x8f')],['priority'],[_0x1669('0x92')]);if(_0x5a24d3['account'][_0x1669('0x90')]){delete _0x5a24d3[_0x1669('0x93')][_0x1669('0x90')];}if(_0x5a24d3[_0x1669('0x93')]['List']&&_0x5a24d3[_0x1669('0x93')][_0x1669('0x8e')][_0x1669('0x8b')][_0x1669('0x4a')]){return _0x5a24d3['account'][_0x1669('0x8e')][_0x1669('0x8b')][0x0];}var _0x554124=_[_0x1669('0xd')](_0x288269[_0x1669('0x4c')],{'firstName':_0x288269[_0x1669('0x4c')]['from'],'ListId':_0x81f3f2[_0x1669('0x94')]});_0x554124[_0x288269[_0x1669('0x4c')][_0x1669('0x88')]]=_0x288269[_0x1669('0x4c')][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0x52')](_0x554124,{'fields':_0x285875,'raw':!![]});}})[_0x1669('0x16')](handleEntityNotFound(_0xe08359,null))[_0x1669('0x16')](function(_0x2ca56e){_0x5a24d3[_0x1669('0x95')]=_0x2ca56e;var _0x51cc77=_0x288269['body'][_0x1669('0x96')];if(_0x288269[_0x1669('0x97')][_0x1669('0x98')]){_0x51cc77=_0x288269['headers'][_0x1669('0x98')];}else if(_0x288269['headers']['x-forwarded-for']){_0x51cc77=_[_0x1669('0x99')](_0x288269['headers'][_0x1669('0x9a')][_0x1669('0x9b')](','));}if(_0x2ca56e){var _0xfc8aaa={'ContactId':_0x2ca56e['id'],'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'from':(_0x2ca56e[_0x1669('0x9c')]||'')+'\x20'+(_0x2ca56e['lastName']||''),'customerIp':_0x51cc77,'customerPort':_0x288269[_0x1669('0x97')][_0x1669('0x9d')]?_0x288269[_0x1669('0x97')][_0x1669('0x9d')]:null,'referer':_0x288269[_0x1669('0x4c')][_0x1669('0x9e')],'browserName':_0x2202a3[_0x1669('0x9f')][_0x1669('0x2e')]&&_0x2202a3[_0x1669('0x9f')]['version']?util[_0x1669('0xa0')]('%s\x20%s',_0x2202a3[_0x1669('0x9f')]['name'],_0x2202a3[_0x1669('0x9f')][_0x1669('0xa1')]):'unknown','browserVersion':_0x2202a3[_0x1669('0x9f')]['version']||_0x1669('0xa2'),'osName':util[_0x1669('0xa0')](_0x1669('0xa3'),_0x2202a3['os'][_0x1669('0x2e')],_0x2202a3['os']['version']),'osVersion':_0x2202a3['os'][_0x1669('0xa1')],'deviceModel':_0x2202a3[_0x1669('0xa4')][_0x1669('0x33')]&&_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')]?util[_0x1669('0xa0')](_0x1669('0xa6'),_0x2202a3['device'][_0x1669('0x33')],_0x2202a3['device'][_0x1669('0xa5')],_0x2202a3[_0x1669('0xa4')][_0x1669('0x42')]):null,'deviceVendor':_0x2202a3[_0x1669('0xa4')][_0x1669('0xa5')],'deviceType':_0x2202a3['device']['type'],'formData':JSON[_0x1669('0xa7')](_0x288269['body'])};var _0x3b7010={'ChatWebsiteId':_0x288269[_0x1669('0x49')]['id'],'closed':![]};if(_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]){_0x3b7010['threadId']=_0x288269[_0x1669('0x4c')]['threadId'];return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x4e68e2){if(_0x4e68e2){return[_0x4e68e2,![]];}_0xfc8aaa[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')]['threadId'];_0xfc8aaa['externalUrl']=_0x288269[_0x1669('0x4c')][_0x1669('0xaa')];return db[_0x1669('0xa9')][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x2c2237){return[_0x2c2237,!![]];});});}_0x3b7010[_0x1669('0xab')]=_0x2ca56e['id'];if(_0x288269['body'][_0x1669('0xac')]&&_0x288269[_0x1669('0x4c')]['interaction']['id']){_0x3b7010['id']=_0x288269[_0x1669('0x4c')]['interaction']['id'];return db['ChatInteraction'][_0x1669('0x50')]({'where':_0x3b7010})[_0x1669('0x16')](function(_0x212c10){if(_0x212c10){return[_0x212c10,![]];}return db['ChatInteraction'][_0x1669('0x52')](_0xfc8aaa)[_0x1669('0x16')](function(_0x9c0df9){return[_0x9c0df9,!![]];});});}return db[_0x1669('0xa9')]['create'](_0xfc8aaa)[_0x1669('0x16')](function(_0x1981ca){return[_0x1981ca,!![]];});}})[_0x1669('0xad')](function(_0x504c18,_0x4f87d4){if(_0x504c18){_0x24eb12=_0x4f87d4;if(!_0x4f87d4){var _0x481499={'from':(_0x5a24d3[_0x1669('0x95')][_0x1669('0x9c')]||'')+'\x20'+(_0x5a24d3['contact'][_0x1669('0xae')]||'')};if(_0x288269['body'][_0x1669('0xa8')]&&_0x288269[_0x1669('0x4c')]['messageId']&&_0x288269[_0x1669('0x4c')][_0x1669('0xa8')]!=_0x288269[_0x1669('0x4c')]['messageId']){_0x481499[_0x1669('0xa8')]=_0x288269[_0x1669('0x4c')][_0x1669('0xaf')];}return _0x504c18[_0x1669('0x28')](_0x481499);}else{return _0x504c18;}}})[_0x1669('0x16')](function(_0x2ae80f){_0x5a24d3[_0x1669('0xac')]=_0x2ae80f['get']({'plain':!![]});_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]=_0x24eb12;if(_0x5a24d3[_0x1669('0xac')][_0x1669('0xb0')]){if(_0x5a24d3[_0x1669('0x93')][_0x1669('0xb1')]){_0x5a24d3['applications'][_0x1669('0xb2')]({'id':0x0,'priority':_0x5a24d3['applications'][_0x1669('0x4a')]+0x1,'app':_0x1669('0xb3'),'appdata':_0x1669('0xb4'),'interval':_0x1669('0xb5')});}}return db[_0x1669('0xb6')]['create']({'body':_0x288269['body']['body'],'ChatWebsiteId':_0x288269['params']['id'],'ChatInteractionId':_0x2ae80f['id'],'direction':'in','ContactId':_0x5a24d3[_0x1669('0x95')]['id'],'AttachmentId':_0x288269['body'][_0x1669('0xb7')]});})['then'](function(_0x40eea8){_0x5a24d3['message']=_0x40eea8;if(_0x5a24d3[_0x1669('0xac')]['UserId']){return db[_0x1669('0xb8')]['find']({'attributes':['id',_0x1669('0x2e')],'where':{'id':_0x5a24d3[_0x1669('0xac')][_0x1669('0xb9')]}})[_0x1669('0x16')](function(_0x33a8af){if(_0x33a8af){_0x5a24d3['applications'][_0x1669('0xba')]({'id':0x0,'priority':0x0,'app':_0x1669('0xbb'),'appdata':_0x33a8af['name']+','+(_0x5a24d3[_0x1669('0x93')][_0x1669('0xbc')]||0xa),'interval':_0x1669('0xb5')});_0x5a24d3[_0x1669('0xbd')]=!![];}return respondWithRpcPromise(_0x1669('0xbe'),'startRouting',_0x5a24d3);});}return respondWithRpcPromise(_0x1669('0xbe'),_0x1669('0xbf'),_0x5a24d3);})['then'](function(_0x3798a2){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1669('0x78'),'message':_0x3798a2},client9002);return _0x3798a2;})[_0x1669('0x16')](respondWithResult(_0xe08359,null))[_0x1669('0x1e')](handleError(_0xe08359,null));};exports[_0x1669('0xc0')]=function(_0x21a63c,_0x4858d9){var _0x17a18f,_0x476300,_0x214bdd;var _0x1f54aa=[];var _0x5c6898={};var _0x1cd11a=_0x21a63c['files']||[];var _0x237dbb=[];var _0x18be40;return db[_0x1669('0x7e')]['describe']()[_0x1669('0x16')](function(_0x3efed6){if(!_0x3efed6){throw new db['Sequelize'][(_0x1669('0x7f'))]('no\x20available\x20attributes');}_0x1f54aa=_['difference'](_[_0x1669('0x35')](_0x3efed6),['createdAt',_0x1669('0x83'),'CompanyId',_0x1669('0x94')]);if(_0x21a63c[_0x1669('0x4c')]['id']){delete _0x21a63c[_0x1669('0x4c')]['id'];}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))][(_0x1669('0x7f'))](_0x1669('0xc2')));}if(_['isNil'](_0x21a63c['body'][_0x1669('0x4c')])||_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]===''){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))](_0x1669('0x87')));}if(_[_0x1669('0x6e')](_0x21a63c[_0x1669('0x4c')]['mapKeyOffline'])){throw _0x4858d9['status'](0x1f4)[_0x1669('0xc1')](new db[(_0x1669('0x86'))]['ValidationError'](_0x1669('0xc3')+_0x1f54aa));}if(!_['includes'](_0x1f54aa,_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')])){throw _0x4858d9[_0x1669('0x25')](0x1f4)[_0x1669('0xc1')](new db['Sequelize'][(_0x1669('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f54aa));}_0x5c6898[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')];})[_0x1669('0x16')](function(){return db[_0x1669('0x43')]['find']({'where':{'id':_0x21a63c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xc5')],'as':'List'},{'model':db['MailAccount'],'as':_0x1669('0xc6')}]});})[_0x1669('0x16')](handleEntityNotFound(_0x4858d9,null))[_0x1669('0x16')](function(_0x47ff50){if(_0x47ff50&&_0x47ff50['List']){_0x476300=_0x47ff50;var _0xdcc339=_[_0x1669('0xd')](_0x21a63c[_0x1669('0x4c')],{'firstName':_0x21a63c['body']['from'],'phone':_0x21a63c[_0x1669('0x4c')][_0x1669('0x85')],'ListId':_0x47ff50[_0x1669('0x94')]});_0xdcc339[_0x21a63c[_0x1669('0x4c')][_0x1669('0xc4')]]=_0x21a63c['body'][_0x1669('0x85')];return db[_0x1669('0x7e')][_0x1669('0xc7')]({'where':_0x5c6898,'defaults':_0xdcc339});}})['spread'](function(_0x38c602){if(_0x38c602){_0x214bdd=_0x38c602;var _0x164e85=fs[_0x1669('0xc8')](path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xc9')),_0x1669('0xca'));var _0x3c8975=ejs[_0x1669('0xcb')](_0x164e85,{'body':_[_0x1669('0xcc')](_0x21a63c[_0x1669('0x4c')][_0x1669('0x4c')]),'bodyTitle':_0x476300[_0x1669('0xcd')]});return db[_0x1669('0xce')][_0x1669('0x52')]({'body':_0x3c8975,'plainBody':htmlToText[_0x1669('0xcf')](_0x3c8975),'ContactId':_0x38c602['id'],'ChatWebsiteId':_0x476300['id']});}})['then'](function(_0x3cae4f){_0x18be40=_0x3cae4f;if(_0x1cd11a['length']){var _0xe147a4=_0x1cd11a[_0x1669('0x30')](function(_0x1cf9be){return{'name':_0x1cf9be[_0x1669('0xd0')],'basename':_0x1cf9be[_0x1669('0x61')],'type':_0x1cf9be['mimetype'],'ChatOfflineMessageId':_0x3cae4f['id']};});_0x237dbb=_0xe147a4[_0x1669('0x30')](_0x1f28cc=>{var _0x29e4c8={'filename':_0x1f28cc['name'],'path':path[_0x1669('0x68')](config[_0x1669('0x69')],_0x1669('0xd1'),'files','attachments','offline-chat',_0x1f28cc['basename'])};return _0x29e4c8;});if(!_0x476300[_0x1669('0xd2')]){return db['sequelize']['transaction'](function(_0x318c09){return db[_0x1669('0xd3')][_0x1669('0xd4')](_0xe147a4,{'transaction':_0x318c09});});}}})[_0x1669('0x16')](function(){if(_0x18be40){_0x17a18f=_0x18be40;return db[_0x1669('0xc6')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1669('0xd5'),'raw':!![],'include':[{'model':db[_0x1669('0xd6')],'as':_0x1669('0xd6'),'raw':!![]}]}]});}})[_0x1669('0x16')](function(_0x1c87f6){if(_0x1c87f6&&_0x1c87f6[_0x1669('0xd5')]&&_0x476300[_0x1669('0xd7')]&&_0x476300[_0x1669('0xd8')]){var _0xef67c=_0x1c87f6[_0x1669('0xd9')]();return respondWithRpcPromise('SendMail',_0x1669('0xda'),{'account':_0xef67c,'message':{'from':util[_0x1669('0xa0')](_0x1669('0xdb'),_0x1c87f6[_0x1669('0x2e')],_0x1c87f6['email']||_0x1c87f6[_0x1669('0xd5')]['user']),'to':_0x476300['forwardOfflineAddress'],'subject':_0x476300[_0x1669('0xdc')],'html':_0x17a18f[_0x1669('0x4c')],'attachments':_0x237dbb}},client9003)['then'](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x51c454){logger[_0x1669('0x1b')](_0x51c454);});}})['then'](function(){if(_0x476300&&_0x476300[_0x1669('0xd2')]&&_0x476300[_0x1669('0xdd')]){var _0x2764ee=[];if(_0x1cd11a[_0x1669('0x4a')]){_0x2764ee=_0x1cd11a[_0x1669('0x30')](function(_0x50647b){return{'name':_0x50647b[_0x1669('0xd0')],'basename':_0x50647b['filename'],'type':_0x50647b[_0x1669('0xde')],'ChatOfflineMessageId':_0x18be40['id']};});}var _0x6832f1;if(!_['isNil'](_0x476300['subjectOffline'])){var _0x4cc3b5=_[_0x1669('0x30')](_0x21a63c[_0x1669('0x4c')],function(_0x583bf0){return _0x583bf0;});var _0x3790cd=_[_0x1669('0xdf')](_0x4cc3b5)[0x0];var _0x53ec59=_[_0x1669('0xe0')](_0x3790cd,function(_0x3339c9){return _0x3339c9;});_0x6832f1=_0x53ec59[0x1][_0x476300[_0x1669('0xe1')]];}var _0x5583ca={'from':_0x214bdd[_0x1669('0xe2')],'firstName':_0x214bdd[_0x1669('0x9c')],'lastName':_0x214bdd[_0x1669('0xae')],'mapKey':_0x1669('0xe2'),'message':{'from':_0x214bdd['email'],'to':_0x476300[_0x1669('0xc6')][_0x1669('0xe2')],'cc':'','subject':_[_0x1669('0x6e')](_0x6832f1)?_0x476300['offlineMessageSubject']:_0x6832f1,'messageId':'','sentAt':new Date(),'attach':_0x2764ee[_0x1669('0x4a')],'attachments':_0x2764ee,'originChannel':'Chat','ChatWebsiteId':_0x476300['id'],'ChatOfflineMessageId':_0x17a18f['id'],'originTo':_0x476300[_0x1669('0xc6')]['email']},'body':_0x17a18f[_0x1669('0x4c')]};var _0x1983f7={'account':{'id':_0x476300[_0x1669('0xdd')]},'body':_0x5583ca,'log':_0x1669('0xe3')};return respondWithRpcPromise(_0x1669('0xe3'),_0x1669('0xe4'),_0x1983f7,client9001)[_0x1669('0x16')](function(){return _0x17a18f;})[_0x1669('0x1e')](function(_0x2d4f44){logger[_0x1669('0x1b')](_0x2d4f44);});}return;})[_0x1669('0x16')](function(){if(_0x17a18f){return _0x17a18f;}})[_0x1669('0x16')](respondWithResult(_0x4858d9,null))[_0x1669('0x1e')](function(_0x4dbfb1){logger[_0x1669('0x1b')](_0x1669('0x1e'),_0x4dbfb1);for(var _0x2d70fb of _0x1cd11a){var _0x1df1bd=path['join'](config[_0x1669('0x69')],'server',_0x1669('0xe5'),'attachments',_0x1669('0xe6'),_0x2d70fb[_0x1669('0x61')]);fs_extra['remove'](_0x1df1bd)['catch'](function(_0x5e918c){logger[_0x1669('0x1b')](_0x1669('0xe7'),_0x1df1bd,_0x5e918c);});}});};exports['addInteraction']=function(_0x1bbf61,_0x4a657d){return db[_0x1669('0xa9')][_0x1669('0x50')]({'where':{'id':_0x1bbf61[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4a657d,null))[_0x1669('0x16')](function(_0x8e39f2){if(_0x8e39f2){return _0x8e39f2[_0x1669('0xe8')](_0x1bbf61[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x1bbf61['body'],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x4a657d,null))[_0x1669('0x1e')](handleError(_0x4a657d,null));};exports[_0x1669('0xea')]=function(_0x36ac99,_0x3c9211){var _0x3e68d0={'raw':![],'where':{}};var _0x2fc665={};var _0x5679f6={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x36ac99[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x3c9211,null))[_0x1669('0x16')](function(_0x3a3660){if(_0x3a3660){_0x2fc665[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xa9')]['rawAttributes']);_0x2fc665['query']=_['keys'](_0x36ac99['query']);_0x2fc665[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x2fc665[_0x1669('0x33')],_0x2fc665[_0x1669('0x34')]);_0x3e68d0['attributes']=_['intersection'](_0x2fc665[_0x1669('0x33')],qs[_0x1669('0x38')](_0x36ac99[_0x1669('0x34')][_0x1669('0x38')]));_0x3e68d0[_0x1669('0x37')]=_0x3e68d0[_0x1669('0x37')][_0x1669('0x4a')]?_0x3e68d0[_0x1669('0x37')]:_0x2fc665[_0x1669('0x33')];if(!_0x36ac99[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x3e68d0[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x36ac99[_0x1669('0x34')][_0x1669('0x24')]);_0x3e68d0[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x36ac99['query'][_0x1669('0x23')]);}_0x3e68d0[_0x1669('0x3b')]=qs[_0x1669('0x3c')](_0x36ac99[_0x1669('0x34')][_0x1669('0x3c')]);_0x3e68d0[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x36ac99[_0x1669('0x34')],_0x2fc665[_0x1669('0x3e')]));_0x3e68d0[_0x1669('0x3d')][_0x1669('0x55')]=_0x3a3660['id'];if(_0x36ac99[_0x1669('0x34')][_0x1669('0x40')]){_0x3e68d0['where']=_[_0x1669('0x41')](_0x3e68d0['where'],{'$or':_[_0x1669('0x30')](_0x3e68d0[_0x1669('0x37')],function(_0x3fb779){var _0x5af99f={};_0x5af99f[_0x3fb779]={'$like':'%'+_0x36ac99['query'][_0x1669('0x40')]+'%'};return _0x5af99f;})});}_0x3e68d0=_[_0x1669('0x41')]({},_0x3e68d0,_0x36ac99[_0x1669('0x4b')]);return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':_0x3e68d0['where']})[_0x1669('0x16')](function(_0xe46fd5){_0x5679f6[_0x1669('0x22')]=_0xe46fd5;if(_0x36ac99['query'][_0x1669('0x44')]){_0x3e68d0[_0x1669('0x45')]=[{'model':db[_0x1669('0x7e')],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xb8')],'as':_0x1669('0xec'),'attributes':[_0x1669('0x2e'),'fullname',_0x1669('0xed')],'required':![]},{'model':db[_0x1669('0xee')],'as':_0x1669('0xef'),'attributes':['id',_0x1669('0x2e'),_0x1669('0xf0')],'where':_0x36ac99[_0x1669('0x34')]['tag']?{'id':_0x36ac99['query']['tag']}:undefined,'required':_0x36ac99[_0x1669('0x34')][_0x1669('0xf1')]?!![]:![]}];}return db[_0x1669('0xa9')][_0x1669('0x46')](_0x3e68d0);})[_0x1669('0x16')](function(_0x172854){_0x5679f6['rows']=_0x172854;return _0x5679f6;});}})['then'](respondWithFilteredResult(_0x3c9211,_0x3e68d0))[_0x1669('0x1e')](handleError(_0x3c9211,null));};function iftimePromise(_0x2d5324,_0x5bb7d1){return respondWithRpcPromise(_0x1669('0xf2'),_0x1669('0xf3'),{'command':_0x5bb7d1[_0x1669('0xf4')]?util[_0x1669('0xa0')]('iftime\x20%s,%s',_0x2d5324[_0x1669('0xf5')],_0x5bb7d1[_0x1669('0xf4')]):util['format'](_0x1669('0xf6'),_0x2d5324[_0x1669('0xf5')])},client9002)[_0x1669('0x16')](function(_0x427722){var _0x5d5768=_0x427722&&_0x427722[_0x1669('0xf7')](_0x1669('0xf8'))>=0x0?!![]:![];logger[_0x1669('0xf9')](_0x1669('0xfa'),_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],_0x5d5768?_0x1669('0xfb'):_0x1669('0xfc'),_0x5bb7d1['timezone']?_0x5bb7d1[_0x1669('0xf4')]:'No\x20timezone');return _0x5d5768;})[_0x1669('0x1e')](function(_0x88d776){logger[_0x1669('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5bb7d1['id'],_0x2d5324['id'],_0x2d5324[_0x1669('0xf5')],util[_0x1669('0xfd')](_0x88d776,{'showHidden':![],'depth':null}),_0x5bb7d1[_0x1669('0xf4')]?_0x5bb7d1[_0x1669('0xf4')]:_0x1669('0xfe'));return![];});}exports['getSnippet']=function(_0x22926c,_0x3ac347){var _0x4ec729=0x0;var _0x165aad=0x0;var _0x1af2e4=![];var _0x31e171;var _0x5cb4a6;return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x22926c[_0x1669('0x49')]['id']},'include':[{'model':db[_0x1669('0xff')],'as':_0x1669('0xff'),'include':[{'model':db['Interval'],'as':_0x1669('0x100'),'attributes':['id',_0x1669('0xf5')],'raw':!![]}]}]})[_0x1669('0x16')](handleEntityNotFound(_0x3ac347,null))[_0x1669('0x16')](function(_0x3f73cc){if(_0x3f73cc){_0x31e171=_0x3f73cc;return _0x3f73cc[_0x1669('0x101')]({'raw':!![]});}})[_0x1669('0x16')](function(_0x1d9e6c){if(_0x31e171){if(_0x1d9e6c){_0x5cb4a6=_0x1d9e6c;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x37475d){if(_0x37475d){_0x165aad=_0x37475d[_0x1669('0x102')];_0x1af2e4=_0x37475d[_0x1669('0x6d')];}})[_0x1669('0x16')](function(){return db[_0x1669('0xa9')][_0x1669('0x22')]({'where':{'closed':![]}});})[_0x1669('0x16')](function(_0x56ed3a){_0x4ec729=_0x56ed3a;if(_0x165aad&&_0x56ed3a>_0x165aad){return db['License'][_0x1669('0x58')]({'where':{'id':0x1}})[_0x1669('0x16')](function(_0x2a3db9){if(_0x2a3db9){_0x2a3db9[_0x1669('0x103')](_0x1669('0x104'));}});}})['then'](function(){if(_0x31e171[_0x1669('0xff')]&&_0x31e171['Interval'][_0x1669('0x100')]){var _0x83fec7=[];for(var _0x274b6a=0x0;_0x274b6a<_0x31e171[_0x1669('0xff')][_0x1669('0x100')][_0x1669('0x4a')];_0x274b6a++){var _0x272e35=_0x31e171[_0x1669('0xff')]['Intervals'][_0x274b6a][_0x1669('0x29')]({'plain':!![]});_0x83fec7[_0x1669('0xb2')](iftimePromise(_0x272e35,_0x31e171));}return BPromise[_0x1669('0x105')](_0x83fec7)[_0x1669('0x16')](function(_0x22afa0){return _['some'](_0x22afa0);});}else{return!![];}})[_0x1669('0x16')](function(_0x5f5e08){var _0x3cbb87=fs[_0x1669('0xc8')](path['join'](config[_0x1669('0x69')],_0x1669('0x106')),_0x1669('0xca'));var _0x5ca537=new url[(_0x1669('0x107'))](_0x31e171[_0x1669('0x108')])['origin'];var _0x247e03=_0x1669('0x109');var _0x39378d=![];var _0x2400a0={'chatVersion':_0x247e03,'chatWebsiteAddressOrigin':_0x5ca537,'remote':_0x31e171[_0x1669('0x10a')],'query':querystring['stringify'](_[_0x1669('0x41')](_0x31e171[_0x1669('0x29')]({'plain':!![]}),{'customerIp':_0x22926c['headers']['x-forwarded-for']||_0x22926c[_0x1669('0x97')][_0x1669('0x10b')]||_0x22926c[_0x1669('0x10c')][_0x1669('0x10d')]||_0x22926c['ip'],'referer':_0x22926c[_0x1669('0x97')]['referer'],'openedInteractions':_0x4ec729,'maxInteractions':_0x165aad,'virtual':_0x1af2e4['virtual'],'online':_0x5f5e08,'custom':_0x1af2e4}))[_0x1669('0x10e')](/'/g,'\x5c\x27')};_0x3ac347[_0x1669('0xc1')](ejs[_0x1669('0xcb')](Mustache[_0x1669('0xcb')](_0x3cbb87,_0x2400a0),{'proactiveActions':_0x5cb4a6,'alignment':_0x31e171[_0x1669('0x10f')],'verticalAlignment':_0x31e171['verticalAlignment'],'div_color':_0x31e171[_0x1669('0xf0')],'labelText':_0x31e171['labelText'],'text_color':_0x31e171[_0x1669('0x110')],'text_button_color':_0x31e171[_0x1669('0x111')],'button_color':_0x31e171['color_button'],'background_color':_0x31e171['backgroundColor'],'hideWhenOffline':_0x31e171['hideWhenOffline'],'intervalId':_0x31e171[_0x1669('0x112')],'isDevelopment':_0x39378d,'chatVersion':_0x247e03}));})[_0x1669('0x1e')](handleError(_0x3ac347,null));};exports[_0x1669('0x113')]=function(_0x1e33b0,_0x466e98){var _0x111746=_0x1e33b0[_0x1669('0x49')]['id'];var _0x2eff3a=_0x1e33b0[_0x1669('0x4c')];var _0x42bc59=0xc8;var _0x28fde8=null;return db[_0x1669('0x114')][_0x1669('0x115')]({'isolationLevel':db[_0x1669('0x114')]['Transaction'][_0x1669('0x116')][_0x1669('0x117')]},function(_0x3577bd){return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(_0xccac2){if(_0xccac2){return db['ChatApplication'][_0x1669('0x2c')]({'where':{'ChatWebsiteId':_0x111746},'transaction':_0x3577bd})[_0x1669('0x16')](function(){var _0x17d532=_[_0x1669('0x30')](_0x2eff3a,function(_0x1e81d2){_0x1e81d2[_0x1669('0x55')]=_0x111746;return _0x1e81d2;});return db[_0x1669('0x8d')][_0x1669('0xd4')](_0x17d532,{'transaction':_0x3577bd});});}else{_0x42bc59=0x194;_0x28fde8=[];}});})[_0x1669('0x16')](function(){if(_0x42bc59!==0x194){return db[_0x1669('0x8d')][_0x1669('0x118')]({'where':{'ChatWebsiteId':_0x111746},'order':_0x1669('0x119')})[_0x1669('0x16')](function(_0x520eba){_0x28fde8=_0x520eba;});}})[_0x1669('0x1e')](function(_0x320a7d){_0x42bc59=0x1f4;logger[_0x1669('0x1b')](_0x320a7d[_0x1669('0x11a')]);if(_0x320a7d['name']){delete _0x320a7d[_0x1669('0x2e')];}_0x28fde8=_0x320a7d;})[_0x1669('0x11b')](function(){if(_0x28fde8===null){_0x466e98[_0x1669('0x2d')](_0x42bc59);}else{if(_0x42bc59===0x1f4){_0x466e98['status'](_0x42bc59)[_0x1669('0xc1')](_0x28fde8);}else{_0x466e98[_0x1669('0x25')](_0x42bc59)[_0x1669('0x20')](_0x28fde8);}}});};exports[_0x1669('0x11c')]=function(_0xde3e5,_0x2a58cb){var _0x18c765={};var _0x3a583a={};var _0xaa7d34;var _0x7cce67;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0xde3e5['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x2a58cb,null))['then'](function(_0x4e2aee){if(_0x4e2aee){_0xaa7d34=_0x4e2aee;_0x3a583a[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0x8d')][_0x1669('0x31')]);_0x3a583a['query']=_[_0x1669('0x35')](_0xde3e5[_0x1669('0x34')]);_0x3a583a[_0x1669('0x3e')]=_[_0x1669('0x36')](_0x3a583a['model'],_0x3a583a[_0x1669('0x34')]);_0x18c765[_0x1669('0x37')]=_[_0x1669('0x36')](_0x3a583a['model'],qs[_0x1669('0x38')](_0xde3e5[_0x1669('0x34')]['fields']));_0x18c765[_0x1669('0x37')]=_0x18c765[_0x1669('0x37')][_0x1669('0x4a')]?_0x18c765[_0x1669('0x37')]:_0x3a583a[_0x1669('0x33')];_0x18c765['order']=qs['sort'](_0xde3e5['query'][_0x1669('0x3c')]);_0x18c765[_0x1669('0x3d')]=qs['filters'](_['pick'](_0xde3e5[_0x1669('0x34')],_0x3a583a[_0x1669('0x3e')]));if(_0xde3e5[_0x1669('0x34')]['filter']){_0x18c765[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x18c765['where'],{'$or':_[_0x1669('0x30')](_0x18c765[_0x1669('0x37')],function(_0x14ade0){var _0x47c6d3={};_0x47c6d3[_0x14ade0]={'$like':'%'+_0xde3e5[_0x1669('0x34')]['filter']+'%'};return _0x47c6d3;})});}_0x18c765=_['merge']({},_0x18c765,_0xde3e5[_0x1669('0x4b')]);return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})[_0x1669('0x16')](function(_0x1df05c){if(_0x1df05c){_0x7cce67=_0x1df05c[_0x1669('0x4a')];if(!_0xde3e5[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x18c765['limit']=qs['limit'](_0xde3e5['query'][_0x1669('0x24')]);_0x18c765[_0x1669('0x23')]=qs['offset'](_0xde3e5['query'][_0x1669('0x23')]);}return _0xaa7d34[_0x1669('0x11c')](_0x18c765);}})['then'](function(_0x2d2911){if(_0x2d2911){return _0x2d2911?{'count':_0x7cce67,'rows':_0x2d2911}:null;}})[_0x1669('0x16')](respondWithResult(_0x2a58cb,null))[_0x1669('0x1e')](handleError(_0x2a58cb,null));};exports['addProactiveActions']=function(_0x39094e,_0x3981bb){return db[_0x1669('0x11d')][_0x1669('0x50')]({'where':{'id':_0x39094e[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x3981bb,null))[_0x1669('0x16')](function(_0x2a20f7){if(_0x2a20f7){return _0x2a20f7[_0x1669('0x11e')](_0x39094e[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x39094e[_0x1669('0x4c')],['ids','id'])||{});}})[_0x1669('0x16')](respondWithResult(_0x3981bb,null))[_0x1669('0x1e')](handleError(_0x3981bb,null));};exports['getProactiveActions']=function(_0x372cef,_0xc4e95a){var _0x33a13d={};var _0x64a11b={};var _0x446a96;var _0x4d2a3c;return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x372cef[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0xc4e95a,null))[_0x1669('0x16')](function(_0x5cbf0a){if(_0x5cbf0a){_0x446a96=_0x5cbf0a;_0x64a11b[_0x1669('0x33')]=_['keys'](db[_0x1669('0x11f')][_0x1669('0x31')]);_0x64a11b[_0x1669('0x34')]=_[_0x1669('0x35')](_0x372cef[_0x1669('0x34')]);_0x64a11b[_0x1669('0x3e')]=_['intersection'](_0x64a11b[_0x1669('0x33')],_0x64a11b['query']);_0x33a13d[_0x1669('0x37')]=_[_0x1669('0x36')](_0x64a11b[_0x1669('0x33')],qs[_0x1669('0x38')](_0x372cef[_0x1669('0x34')][_0x1669('0x38')]));_0x33a13d[_0x1669('0x37')]=_0x33a13d[_0x1669('0x37')][_0x1669('0x4a')]?_0x33a13d[_0x1669('0x37')]:_0x64a11b['model'];_0x33a13d[_0x1669('0x3b')]=qs['sort'](_0x372cef['query'][_0x1669('0x3c')]);_0x33a13d['where']=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x372cef[_0x1669('0x34')],_0x64a11b['filters']));if(_0x372cef[_0x1669('0x34')][_0x1669('0x40')]){_0x33a13d[_0x1669('0x3d')]=_[_0x1669('0x41')](_0x33a13d[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x33a13d[_0x1669('0x37')],function(_0x1d7ba5){var _0x4dfdcf={};_0x4dfdcf[_0x1d7ba5]={'$like':'%'+_0x372cef['query'][_0x1669('0x40')]+'%'};return _0x4dfdcf;})});}_0x33a13d=_[_0x1669('0x41')]({},_0x33a13d,_0x372cef[_0x1669('0x4b')]);return _0x446a96['getProactiveActions'](_0x33a13d);}})[_0x1669('0x16')](function(_0x1de237){if(_0x1de237){_0x4d2a3c=_0x1de237[_0x1669('0x4a')];if(!_0x372cef[_0x1669('0x34')]['hasOwnProperty']('nolimit')){_0x33a13d['limit']=qs[_0x1669('0x24')](_0x372cef[_0x1669('0x34')]['limit']);_0x33a13d[_0x1669('0x23')]=qs[_0x1669('0x23')](_0x372cef['query'][_0x1669('0x23')]);}return _0x446a96[_0x1669('0x101')](_0x33a13d);}})[_0x1669('0x16')](function(_0x43d980){if(_0x43d980){return _0x43d980?{'count':_0x4d2a3c,'rows':_0x43d980}:null;}})[_0x1669('0x16')](respondWithResult(_0xc4e95a,null))[_0x1669('0x1e')](handleError(_0xc4e95a,null));};exports[_0x1669('0x120')]=function(_0x10146c,_0x4c397f){var _0x1462fa=_0x10146c[_0x1669('0x34')][_0x1669('0x121')]===_0x1669('0x122')?_0x1669('0x123'):_0x1669('0x124');return db[_0x1669('0x43')][_0x1669('0x50')]({'attributes':['id',_0x1462fa],'where':{'id':_0x10146c[_0x1669('0x49')]['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x4c397f,null))['then'](function(_0x3f97e2){if(_0x3f97e2){var _0x13120d=_0x3f97e2[_0x1462fa];var _0x43e785=_0x13120d&&_0x13120d[_0x1669('0x125')]?_0x13120d[_0x1669('0x125')]:[];_0x4c397f[_0x1669('0xc1')]({'fromKey':_[_0x1669('0x6e')](_0x13120d[_0x1669('0x126')])?undefined:_0x13120d['fromKey'],'count':_0x43e785[_0x1669('0x4a')],'rows':_0x43e785});}})[_0x1669('0x1e')](handleError(_0x4c397f,null));};exports[_0x1669('0x127')]=function(_0x2c7619,_0x48a989){var _0x439c90={'raw':![],'where':{}};var _0x2aba09={};var _0x25b0ab={'count':0x0,'rows':[]};return db[_0x1669('0x43')][_0x1669('0x58')]({'where':{'id':_0x2c7619[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x48a989,null))['then'](function(_0x2e59f6){if(_0x2e59f6){_0x2aba09[_0x1669('0x33')]=_[_0x1669('0x35')](db[_0x1669('0xce')][_0x1669('0x31')]);_0x2aba09[_0x1669('0x34')]=_['keys'](_0x2c7619[_0x1669('0x34')]);_0x2aba09['filters']=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],_0x2aba09[_0x1669('0x34')]);_0x439c90[_0x1669('0x37')]=_[_0x1669('0x36')](_0x2aba09[_0x1669('0x33')],qs['fields'](_0x2c7619['query']['fields']));_0x439c90[_0x1669('0x37')]=_0x439c90[_0x1669('0x37')][_0x1669('0x4a')]?_0x439c90[_0x1669('0x37')]:_0x2aba09[_0x1669('0x33')];if(!_0x2c7619[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x439c90[_0x1669('0x24')]=qs['limit'](_0x2c7619['query'][_0x1669('0x24')]);_0x439c90['offset']=qs[_0x1669('0x23')](_0x2c7619[_0x1669('0x34')][_0x1669('0x23')]);}_0x439c90[_0x1669('0x3b')]=qs['sort'](_0x2c7619['query'][_0x1669('0x3c')]);_0x439c90[_0x1669('0x3d')]=qs['filters'](_['pick'](_0x2c7619['query'],_0x2aba09[_0x1669('0x3e')]));_0x439c90['where'][_0x1669('0x55')]=_0x2e59f6['id'];if(_0x2c7619[_0x1669('0x34')]['filter']){_0x439c90[_0x1669('0x3d')]=_['merge'](_0x439c90['where'],{'$or':_[_0x1669('0x30')](_0x439c90[_0x1669('0x37')],function(_0xe2aa1d){var _0x3e557c={};_0x3e557c[_0xe2aa1d]={'$like':'%'+_0x2c7619['query'][_0x1669('0x40')]+'%'};return _0x3e557c;})});}_0x439c90=_[_0x1669('0x41')]({},_0x439c90,_0x2c7619[_0x1669('0x4b')]);return db['ChatOfflineMessage'][_0x1669('0x22')]({'where':_0x439c90[_0x1669('0x3d')]})[_0x1669('0x16')](function(_0x4adb36){_0x25b0ab['count']=_0x4adb36;if(_0x2c7619[_0x1669('0x34')][_0x1669('0x44')]){_0x439c90[_0x1669('0x45')]=[{'all':!![]}];}else{_0x439c90['include']=[{'model':db['CmContact'],'as':_0x1669('0xeb'),'required':![]},{'model':db[_0x1669('0xd3')],'as':_0x1669('0x128'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x439c90);})[_0x1669('0x16')](function(_0x3e86ac){_0x25b0ab[_0x1669('0x47')]=_0x3e86ac;return _0x25b0ab;});}})[_0x1669('0x16')](respondWithFilteredResult(_0x48a989,_0x439c90))[_0x1669('0x1e')](handleError(_0x48a989,null));};exports[_0x1669('0x129')]=function(_0x4f899d,_0x5a89b2){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x4f899d['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x5a89b2,null))[_0x1669('0x16')](function(_0x895cb7){if(_0x895cb7){return _0x895cb7[_0x1669('0x129')](_0x4f899d[_0x1669('0x4c')][_0x1669('0x5a')],_[_0x1669('0xe9')](_0x4f899d['body'],[_0x1669('0x5a'),'id'])||{})['spread'](function(_0x1a9e25){for(var _0x3e1768=0x0;_0x3e1768<_0x4f899d[_0x1669('0x4c')]['ids'][_0x1669('0x4a')];_0x3e1768+=0x1){socket['emit'](_0x1669('0x12a'),{'UserId':Number(_0x4f899d[_0x1669('0x4c')]['ids'][_0x3e1768]),'ChatWebsiteId':Number(_0x4f899d['params']['id'])});}return _0x1a9e25;});}})[_0x1669('0x16')](respondWithResult(_0x5a89b2,null))[_0x1669('0x1e')](handleError(_0x5a89b2,null));};exports[_0x1669('0x12b')]=function(_0x1d60d1,_0x498179){return db[_0x1669('0x43')][_0x1669('0x50')]({'where':{'id':_0x1d60d1[_0x1669('0x49')]['id']}})['then'](handleEntityNotFound(_0x498179,null))['then'](function(_0x489c63){if(_0x489c63){return _0x489c63[_0x1669('0x12b')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])[_0x1669('0x16')](function(){if(_[_0x1669('0x12c')](_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')])){for(var _0x724f92=0x0;_0x724f92<_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x1669('0x4a')];_0x724f92+=0x1){socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')][_0x724f92]),'ChatWebsiteId':Number(_0x1d60d1[_0x1669('0x49')]['id'])});}}else{socket[_0x1669('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x1d60d1[_0x1669('0x34')][_0x1669('0x5a')]),'ChatWebsiteId':Number(_0x1d60d1['params']['id'])});}});}})[_0x1669('0x16')](respondWithStatusCode(_0x498179,null))[_0x1669('0x1e')](handleError(_0x498179,null));};exports[_0x1669('0x12e')]=function(_0x2f74e9,_0x917dc4){var _0x1d5e1b={};var _0x1e089b={};var _0x5293be;var _0xc13303;return db['ChatWebsite']['findOne']({'where':{'id':_0x2f74e9['params']['id']}})[_0x1669('0x16')](handleEntityNotFound(_0x917dc4,null))[_0x1669('0x16')](function(_0x4abb31){if(_0x4abb31){_0x5293be=_0x4abb31;_0x1e089b['model']=_[_0x1669('0x35')](db[_0x1669('0xb8')][_0x1669('0x31')]);_0x1e089b[_0x1669('0x34')]=_['keys'](_0x2f74e9['query']);_0x1e089b[_0x1669('0x3e')]=_['intersection'](_0x1e089b[_0x1669('0x33')],_0x1e089b[_0x1669('0x34')]);_0x1d5e1b['attributes']=_[_0x1669('0x36')](_0x1e089b[_0x1669('0x33')],qs['fields'](_0x2f74e9['query'][_0x1669('0x38')]));_0x1d5e1b[_0x1669('0x37')]=_0x1d5e1b[_0x1669('0x37')][_0x1669('0x4a')]?_0x1d5e1b[_0x1669('0x37')]:_0x1e089b[_0x1669('0x33')];_0x1d5e1b[_0x1669('0x3b')]=qs['sort'](_0x2f74e9[_0x1669('0x34')]['sort']);_0x1d5e1b[_0x1669('0x3d')]=qs[_0x1669('0x3e')](_[_0x1669('0x3f')](_0x2f74e9[_0x1669('0x34')],_0x1e089b[_0x1669('0x3e')]));if(_0x2f74e9[_0x1669('0x34')][_0x1669('0x40')]){_0x1d5e1b['where']=_[_0x1669('0x41')](_0x1d5e1b[_0x1669('0x3d')],{'$or':_[_0x1669('0x30')](_0x1d5e1b[_0x1669('0x37')],function(_0xe931a9){var _0x43d45d={};_0x43d45d[_0xe931a9]={'$like':'%'+_0x2f74e9[_0x1669('0x34')]['filter']+'%'};return _0x43d45d;})});}_0x1d5e1b=_[_0x1669('0x41')]({},_0x1d5e1b,_0x2f74e9[_0x1669('0x4b')]);return _0x5293be[_0x1669('0x12e')](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x3f1589){if(_0x3f1589){_0xc13303=_0x3f1589[_0x1669('0x4a')];if(!_0x2f74e9[_0x1669('0x34')][_0x1669('0x39')](_0x1669('0x3a'))){_0x1d5e1b[_0x1669('0x24')]=qs[_0x1669('0x24')](_0x2f74e9[_0x1669('0x34')][_0x1669('0x24')]);_0x1d5e1b[_0x1669('0x23')]=qs['offset'](_0x2f74e9[_0x1669('0x34')][_0x1669('0x23')]);}return _0x5293be['getAgents'](_0x1d5e1b);}})[_0x1669('0x16')](function(_0x475b98){if(_0x475b98){return _0x475b98?{'count':_0xc13303,'rows':_0x475b98}:null;}})['then'](respondWithResult(_0x917dc4,null))[_0x1669('0x1e')](handleError(_0x917dc4,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 98795b6..d6d1dcb 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 _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 2377bc6..843a767 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 _0x3075=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x3075,0x1e3));var _0x5307=function(_0x32daf0,_0x4ea4c0){_0x32daf0=_0x32daf0-0x0;var _0x39361c=_0x3075[_0x32daf0];return _0x39361c;};'use strict';var _=require(_0x5307('0x0'));var util=require('util');var logger=require(_0x5307('0x1'))(_0x5307('0x2'));var moment=require(_0x5307('0x3'));var BPromise=require(_0x5307('0x4'));var rp=require(_0x5307('0x5'));var fs=require('fs');var path=require(_0x5307('0x6'));var rimraf=require('rimraf');var config=require(_0x5307('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x5307('0x8')]=function(_0x41967b,_0xfda21){return _0x41967b[_0x5307('0x9')](_0x5307('0xa'),attributes,{'tableName':_0x5307('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8704=['rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x58ce43,_0x4b7288){var _0x1351cd=function(_0x1664fd){while(--_0x1664fd){_0x58ce43['push'](_0x58ce43['shift']());}};_0x1351cd(++_0x4b7288);}(_0x8704,0x1ea));var _0x4870=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x8704[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0x4870('0x0'));var util=require('util');var logger=require(_0x4870('0x1'))(_0x4870('0x2'));var moment=require(_0x4870('0x3'));var BPromise=require(_0x4870('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4870('0x5'));var config=require(_0x4870('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x4870('0x7')]=function(_0x44e866,_0x1dd9e3){return _0x44e866[_0x4870('0x8')](_0x4870('0x9'),attributes,{'tableName':_0x4870('0xa'),'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 8a4a296..cffcbe4 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 _0x421c=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request'];(function(_0xe256e9,_0x5f605d){var _0xc17b10=function(_0x2f0cab){while(--_0x2f0cab){_0xe256e9['push'](_0xe256e9['shift']());}};_0xc17b10(++_0x5f605d);}(_0x421c,0x190));var _0xc421=function(_0x4e0101,_0x41208b){_0x4e0101=_0x4e0101-0x0;var _0x5ba014=_0x421c[_0x4e0101];return _0x5ba014;};'use strict';var _=require(_0xc421('0x0'));var util=require(_0xc421('0x1'));var moment=require(_0xc421('0x2'));var BPromise=require(_0xc421('0x3'));var rs=require(_0xc421('0x4'));var fs=require('fs');var Redis=require(_0xc421('0x5'));var db=require(_0xc421('0x6'))['db'];var utils=require(_0xc421('0x7'));var logger=require(_0xc421('0x8'))(_0xc421('0x9'));var config=require(_0xc421('0xa'));var jayson=require(_0xc421('0xb'));var client=jayson[_0xc421('0xc')][_0xc421('0xd')]({'port':0x232a});config[_0xc421('0xe')]=_[_0xc421('0xf')](config[_0xc421('0xe')],{'host':_0xc421('0x10'),'port':0x18eb});var socket=require(_0xc421('0x11'))(new Redis(config[_0xc421('0xe')]));require(_0xc421('0x12'))['register'](socket);function respondWithRpcPromise(_0x59a090,_0x5c4bfa,_0x3cd89d){return new BPromise(function(_0x2df8f6,_0x120316){return client[_0xc421('0x13')](_0x59a090,_0x3cd89d)['then'](function(_0x2a0c0e){logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,_0xc421('0x16'));logger['debug'](_0xc421('0x17'),_0x5c4bfa,_0xc421('0x16'),JSON[_0xc421('0x18')](_0x2a0c0e));if(_0x2a0c0e[_0xc421('0x19')]){if(_0x2a0c0e[_0xc421('0x19')]['code']===0x1f4){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e[_0xc421('0x19')][_0xc421('0x1a')]);return _0x120316(_0x2a0c0e['error'][_0xc421('0x1a')]);}logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e['error'][_0xc421('0x1a')]);return _0x2df8f6(_0x2a0c0e[_0xc421('0x19')]['message']);}else{logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,'request\x20sent');_0x2df8f6(_0x2a0c0e[_0xc421('0x1b')]['message']);}})['catch'](function(_0x57dbca){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x57dbca);_0x120316(_0x57dbca);});});}
\ No newline at end of file
+var _0xf2c3=['ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0xe3cdba,_0x3b92d0){var _0x3afefa=function(_0x1d9662){while(--_0x1d9662){_0xe3cdba['push'](_0xe3cdba['shift']());}};_0x3afefa(++_0x3b92d0);}(_0xf2c3,0x6c));var _0x3f2c=function(_0x15781b,_0x4db9bb){_0x15781b=_0x15781b-0x0;var _0x20f955=_0xf2c3[_0x15781b];return _0x20f955;};'use strict';var _=require('lodash');var util=require(_0x3f2c('0x0'));var moment=require(_0x3f2c('0x1'));var BPromise=require(_0x3f2c('0x2'));var rs=require(_0x3f2c('0x3'));var fs=require('fs');var Redis=require(_0x3f2c('0x4'));var db=require(_0x3f2c('0x5'))['db'];var utils=require(_0x3f2c('0x6'));var logger=require(_0x3f2c('0x7'))(_0x3f2c('0x8'));var config=require(_0x3f2c('0x9'));var jayson=require(_0x3f2c('0xa'));var client=jayson[_0x3f2c('0xb')][_0x3f2c('0xc')]({'port':0x232a});config[_0x3f2c('0xd')]=_['defaults'](config[_0x3f2c('0xd')],{'host':_0x3f2c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f2c('0xf'))['register'](socket);function respondWithRpcPromise(_0x5088f1,_0x14c818,_0x1874b2){return new BPromise(function(_0x50ff46,_0x1e433a){return client[_0x3f2c('0x10')](_0x5088f1,_0x1874b2)['then'](function(_0x23ef11){logger[_0x3f2c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,'request\x20sent');logger['debug'](_0x3f2c('0x12'),_0x14c818,_0x3f2c('0x13'),JSON['stringify'](_0x23ef11));if(_0x23ef11[_0x3f2c('0x14')]){if(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x15')]===0x1f4){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);return _0x1e433a(_0x23ef11[_0x3f2c('0x14')][_0x3f2c('0x17')]);}logger[_0x3f2c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x14c818,_0x23ef11['error'][_0x3f2c('0x17')]);return _0x50ff46(_0x23ef11['error']['message']);}else{logger[_0x3f2c('0x11')](_0x3f2c('0x16'),_0x14c818,'request\x20sent');_0x50ff46(_0x23ef11[_0x3f2c('0x18')]['message']);}})[_0x3f2c('0x19')](function(_0x3ab112){logger[_0x3f2c('0x14')](_0x3f2c('0x16'),_0x14c818,_0x3ab112);_0x1e433a(_0x3ab112);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 12b200d..49209bc 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 _0xe48f=['save','remove','register','length','chatWebsite:'];(function(_0xb2b806,_0x2f8113){var _0x569b6d=function(_0x5596be){while(--_0x5596be){_0xb2b806['push'](_0xb2b806['shift']());}};_0x569b6d(++_0x2f8113);}(_0xe48f,0x1e5));var _0xfe48=function(_0x5cc655,_0x4b6145){_0x5cc655=_0x5cc655-0x0;var _0x244379=_0xe48f[_0x5cc655];return _0x244379;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xfe48('0x0'),_0xfe48('0x1'),'update'];function createListener(_0x4c13ca,_0xaecdbb){return function(_0x49aa2c){_0xaecdbb['emit'](_0x4c13ca,_0x49aa2c);};}function removeListener(_0x209df9,_0x472ba1){return function(){ChatWebsiteEvents['removeListener'](_0x209df9,_0x472ba1);};}exports[_0xfe48('0x2')]=function(_0x4b7610){for(var _0x2faacb=0x0,_0x353965=events[_0xfe48('0x3')];_0x2faacb<_0x353965;_0x2faacb++){var _0x4e5dbd=events[_0x2faacb];var _0x5e011e=createListener(_0xfe48('0x4')+_0x4e5dbd,_0x4b7610);ChatWebsiteEvents['on'](_0x4e5dbd,_0x5e011e);}};
\ No newline at end of file
+var _0xa7e8=['save','remove','update','emit','removeListener','length','./chatWebsite.events'];(function(_0x44591b,_0x148970){var _0xbb9e05=function(_0x1d37eb){while(--_0x1d37eb){_0x44591b['push'](_0x44591b['shift']());}};_0xbb9e05(++_0x148970);}(_0xa7e8,0xb5));var _0x8a7e=function(_0x2259d8,_0x47c9a1){_0x2259d8=_0x2259d8-0x0;var _0x291060=_0xa7e8[_0x2259d8];return _0x291060;};'use strict';var ChatWebsiteEvents=require(_0x8a7e('0x0'));var events=[_0x8a7e('0x1'),_0x8a7e('0x2'),_0x8a7e('0x3')];function createListener(_0x439c55,_0x445f83){return function(_0x39e35a){_0x445f83[_0x8a7e('0x4')](_0x439c55,_0x39e35a);};}function removeListener(_0x23ecc4,_0x26f80d){return function(){ChatWebsiteEvents[_0x8a7e('0x5')](_0x23ecc4,_0x26f80d);};}exports['register']=function(_0x44872a){for(var _0x36e5be=0x0,_0x1860e6=events[_0x8a7e('0x6')];_0x36e5be<_0x1860e6;_0x36e5be++){var _0x1f7a52=events[_0x36e5be];var _0x4a5199=createListener('chatWebsite:'+_0x1f7a52,_0x44872a);ChatWebsiteEvents['on'](_0x1f7a52,_0x4a5199);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 21550b2..72c4455 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 _0x0bfb=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x49c24f,_0x39766f){var _0x5a3327=function(_0x29662d){while(--_0x29662d){_0x49c24f['push'](_0x49c24f['shift']());}};_0x5a3327(++_0x39766f);}(_0x0bfb,0x87));var _0xb0bf=function(_0x160efe,_0x109650){_0x160efe=_0x160efe-0x0;var _0x25592f=_0x0bfb[_0x160efe];return _0x25592f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0bf('0x0'));var express=require(_0xb0bf('0x1'));var router=express[_0xb0bf('0x2')]();var fs_extra=require(_0xb0bf('0x3'));var auth=require(_0xb0bf('0x4'));var interaction=require(_0xb0bf('0x5'));var config=require('../../config/environment');var controller=require(_0xb0bf('0x6'));router[_0xb0bf('0x7')]('/',auth[_0xb0bf('0x8')](),controller['index']);router[_0xb0bf('0x7')](_0xb0bf('0x9'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xa')]);router[_0xb0bf('0x7')](_0xb0bf('0xb'),auth['isAuthenticated'](),controller[_0xb0bf('0xc')]);router[_0xb0bf('0x7')](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xe')]);router['get'](_0xb0bf('0xf'),auth['isAuthenticated'](),controller[_0xb0bf('0x10')]);router[_0xb0bf('0x7')](_0xb0bf('0x11'),controller[_0xb0bf('0x12')]);router[_0xb0bf('0x7')](_0xb0bf('0x13'),controller[_0xb0bf('0x14')]);router[_0xb0bf('0x7')]('/:id/customer_avatar',controller[_0xb0bf('0x15')]);router[_0xb0bf('0x7')]('/:id/system_avatar',controller[_0xb0bf('0x16')]);router[_0xb0bf('0x7')](_0xb0bf('0x17'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x18')]);router['get'](_0xb0bf('0x19'),controller['getSnippet']);router[_0xb0bf('0x7')](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1b')]);router['get'](_0xb0bf('0x1c'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1d')]);router['get'](_0xb0bf('0x1e'),controller[_0xb0bf('0x1f')]);router['get'](_0xb0bf('0x20'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x21')]);router[_0xb0bf('0x7')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x23')]);router[_0xb0bf('0x24')]('/',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x25')]);router['post'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x26')]);router[_0xb0bf('0x24')](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x27')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x10daca,_0x1d250e,_0x4fc431){_0x4fc431(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x2b')));},'filename':function(_0x200de6,_0x5eefbf,_0x75390b){_0x75390b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date['now'](),_0x5eefbf[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x11'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x31')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x4d9e32,_0x5a526b,_0x368936){_0x368936(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x598110,_0x19fcc2,_0x35e542){_0x35e542(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x19fcc2[_0xb0bf('0x2e')]));}})});router['post']('/:id/avatar',upload['single'](_0xb0bf('0x30')),controller[_0xb0bf('0x34')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x5e2a4c,_0x376bdb,_0x5f2691){_0x5f2691(null,path[_0xb0bf('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4f01de,_0x43fe49,_0x1dde0b){_0x1dde0b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x43fe49['originalname']));}})});router['post'](_0xb0bf('0x35'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x36')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x497433,_0x398586,_0xe0f4e4){_0xe0f4e4(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x4b62a0,_0x559969,_0x629bd7){_0x629bd7(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x559969[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x37'),upload[_0xb0bf('0x2f')]('file'),controller[_0xb0bf('0x38')]);router[_0xb0bf('0x24')](_0xb0bf('0x39'),controller[_0xb0bf('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x983c1b,_0x6afb3b,_0xebfb8f){const _0x2bfa67=path['join'](config['root'],_0xb0bf('0x3b'),_0xb0bf('0x3c'),_0xb0bf('0x3d'));fs_extra['ensureDir'](_0x2bfa67,function(){_0xebfb8f(null,_0x2bfa67);});},'filename':function(_0x5e7377,_0x5b11ad,_0x4f771b){const _0x11dda6=_0x5b11ad[_0xb0bf('0x2e')][_0xb0bf('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa5d1a5=path[_0xb0bf('0x3f')](_0x11dda6);const _0x35b942=Date['now']()+'-'+_0x11dda6['replace'](_0xa5d1a5,'')+_0xa5d1a5;_0x4f771b(null,_0x35b942);}})});router['post'](_0xb0bf('0x40'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xb0bf('0x17'),auth['isAuthenticated'](),controller[_0xb0bf('0x41')]);router['post'](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x42')]);router['post'](_0xb0bf('0x1c'),auth['isAuthenticated'](),controller[_0xb0bf('0x43')]);router[_0xb0bf('0x24')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x44')]);router[_0xb0bf('0x45')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x46')]);router[_0xb0bf('0x47')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x48')]);router['delete'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x49')]);router['delete'](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4a')]);router[_0xb0bf('0x47')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4b')]);module['exports']=router;
\ No newline at end of file
+var _0x2b19=['root','%s-%s','now','file','addLogo','join','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','format','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','addApplications','addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage'];(function(_0x29bd19,_0x43928d){var _0x9551bf=function(_0x2c14a7){while(--_0x2c14a7){_0x29bd19['push'](_0x29bd19['shift']());}};_0x9551bf(++_0x43928d);}(_0x2b19,0x132));var _0x92b1=function(_0x145075,_0x202545){_0x145075=_0x145075-0x0;var _0x34bbd0=_0x2b19[_0x145075];return _0x34bbd0;};'use strict';var multer=require(_0x92b1('0x0'));var util=require(_0x92b1('0x1'));var path=require(_0x92b1('0x2'));var timeout=require(_0x92b1('0x3'));var express=require('express');var router=express[_0x92b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x92b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92b1('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x92b1('0x7')](),controller['index']);router[_0x92b1('0x8')](_0x92b1('0x9'),auth['isAuthenticated'](),controller[_0x92b1('0xa')]);router[_0x92b1('0x8')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xc')]);router['get'](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0xe')]);router[_0x92b1('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x92b1('0xf')]);router[_0x92b1('0x8')](_0x92b1('0x10'),controller[_0x92b1('0x11')]);router[_0x92b1('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x92b1('0x8')](_0x92b1('0x12'),controller[_0x92b1('0x13')]);router[_0x92b1('0x8')]('/:id/system_avatar',controller[_0x92b1('0x14')]);router[_0x92b1('0x8')](_0x92b1('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x92b1('0x16'),controller[_0x92b1('0x17')]);router[_0x92b1('0x8')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller['getApplications']);router[_0x92b1('0x8')](_0x92b1('0x19'),auth['isAuthenticated'](),controller[_0x92b1('0x1a')]);router[_0x92b1('0x8')](_0x92b1('0x1b'),controller[_0x92b1('0x1c')]);router['get'](_0x92b1('0x1d'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x1e')]);router['get'](_0x92b1('0x1f'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x20')]);router[_0x92b1('0x21')]('/',auth[_0x92b1('0x7')](),controller[_0x92b1('0x22')]);router[_0x92b1('0x21')](_0x92b1('0xd'),auth['isAuthenticated'](),controller[_0x92b1('0x23')]);router[_0x92b1('0x21')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x25')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1cc6e5,_0x1ee6f0,_0xa4dc80){_0xa4dc80(null,path['join'](config[_0x92b1('0x27')],'server/files/images/logos/'));},'filename':function(_0x300666,_0x5a5204,_0x548e8d){_0x548e8d(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x5a5204['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x10'),upload['single'](_0x92b1('0x2a')),controller[_0x92b1('0x2b')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x1f9a0d,_0x18406b,_0xe871ac){_0xe871ac(null,path[_0x92b1('0x2c')](config['root'],_0x92b1('0x2d')));},'filename':function(_0x5247a9,_0x22a01e,_0x94c551){_0x94c551(null,util['format'](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x22a01e[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x2f'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x31')]);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x4ba860,_0x6c50bb,_0x235694){_0x235694(null,path['join'](config['root'],_0x92b1('0x2d')));},'filename':function(_0x43207a,_0xf37e9,_0x223f26){_0x223f26(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date['now'](),_0xf37e9[_0x92b1('0x2e')]));}})});router[_0x92b1('0x21')](_0x92b1('0x12'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x92b1('0x26')]({'destination':function(_0x196837,_0x15e2d0,_0x33507b){_0x33507b(null,path[_0x92b1('0x2c')](config[_0x92b1('0x27')],_0x92b1('0x2d')));},'filename':function(_0x289ef1,_0x215e4f,_0x41a22e){_0x41a22e(null,util[_0x92b1('0x32')](_0x92b1('0x28'),Date[_0x92b1('0x29')](),_0x215e4f['originalname']));}})});router[_0x92b1('0x21')](_0x92b1('0x33'),upload[_0x92b1('0x30')](_0x92b1('0x2a')),controller[_0x92b1('0x34')]);router[_0x92b1('0x21')]('/:id/notify',controller[_0x92b1('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2c34c3,_0x530e98,_0x5418f1){const _0x5d4619=path[_0x92b1('0x2c')](config['root'],_0x92b1('0x36'),_0x92b1('0x37'),_0x92b1('0x38'));fs_extra['ensureDir'](_0x5d4619,function(){_0x5418f1(null,_0x5d4619);});},'filename':function(_0x2298f8,_0xbdd047,_0x282509){const _0x37fb5d=_0xbdd047[_0x92b1('0x2e')][_0x92b1('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c3523=path['extname'](_0x37fb5d);const _0x9975d5=Date['now']()+'-'+_0x37fb5d[_0x92b1('0x39')](_0x5c3523,'')+_0x5c3523;_0x282509(null,_0x9975d5);}})});router[_0x92b1('0x21')](_0x92b1('0x3a'),offlineUploadMulter['any'](),controller[_0x92b1('0x3b')]);router[_0x92b1('0x21')]('/:id/interactions',auth[_0x92b1('0x7')](),controller[_0x92b1('0x3c')]);router[_0x92b1('0x21')](_0x92b1('0x18'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x3d')]);router['post'](_0x92b1('0x19'),auth[_0x92b1('0x7')](),controller['addProactiveActions']);router[_0x92b1('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0x92b1('0x3e')]);router['put'](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller['update']);router[_0x92b1('0x3f')](_0x92b1('0xb'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x40')]);router[_0x92b1('0x3f')](_0x92b1('0xd'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x41')]);router[_0x92b1('0x3f')](_0x92b1('0x24'),auth[_0x92b1('0x7')](),controller[_0x92b1('0x42')]);router[_0x92b1('0x3f')](_0x92b1('0x1f'),auth['isAuthenticated'](),controller[_0x92b1('0x43')]);module[_0x92b1('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c05a4e4..39c8489 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 _0x38f8=['use','isAuthenticated','express','../components/auth/service','../config/environment','Router','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x101cad,_0x4e873c){var _0x25d010=function(_0x18a2ed){while(--_0x18a2ed){_0x101cad['push'](_0x101cad['shift']());}};_0x25d010(++_0x4e873c);}(_0x38f8,0x141));var _0x838f=function(_0x311e9b,_0x2937f4){_0x311e9b=_0x311e9b-0x0;var _0x26284c=_0x38f8[_0x311e9b];return _0x26284c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x838f('0x0'));var auth=require(_0x838f('0x1'));var config=require(_0x838f('0x2'));var router=express[_0x838f('0x3')]();var isProduction=config['env']===_0x838f('0x4')||![];function clientSideLogs(_0x4f5a79,_0x35c5dd,_0x348d0d){var _0x2adfab=_0x4f5a79['app']['get'](_0x838f('0x5'));if(!_0x2adfab){throw new Error(_0x838f('0x6'));}return beaverLogger[_0x838f('0x7')]({'uri':_0x838f('0x8'),'logger':_0x2adfab,'enableCors':!isProduction})(_0x4f5a79,_0x35c5dd,_0x348d0d);}router[_0x838f('0x9')](auth[_0x838f('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x010d=['isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3c61c5,_0x425714){var _0x36ee96=function(_0x549335){while(--_0x549335){_0x3c61c5['push'](_0x3c61c5['shift']());}};_0x36ee96(++_0x425714);}(_0x010d,0x1ef));var _0xd010=function(_0x3a924a,_0x5b8ed3){_0x3a924a=_0x3a924a-0x0;var _0x144b03=_0x010d[_0x3a924a];return _0x144b03;};var beaverLogger=require(_0xd010('0x0'));var express=require(_0xd010('0x1'));var auth=require(_0xd010('0x2'));var config=require(_0xd010('0x3'));var router=express[_0xd010('0x4')]();var isProduction=config[_0xd010('0x5')]==='production'||![];function clientSideLogs(_0x50f5a4,_0x4e7a33,_0x465082){var _0x51afb7=_0x50f5a4[_0xd010('0x6')][_0xd010('0x7')](_0xd010('0x8'));if(!_0x51afb7){throw new Error(_0xd010('0x9'));}return beaverLogger[_0xd010('0xa')]({'uri':_0xd010('0xb'),'logger':_0x51afb7,'enableCors':!isProduction})(_0x50f5a4,_0x4e7a33,_0x465082);}router['use'](auth[_0xd010('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e3929e7..f34f841 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 _0x7836=['sequelize','exports','ENUM','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3b4027,_0x375f0c){var _0x17080b=function(_0x12cbbd){while(--_0x12cbbd){_0x3b4027['push'](_0x3b4027['shift']());}};_0x17080b(++_0x375f0c);}(_0x7836,0x138));var _0x6783=function(_0x1d70e6,_0x31f6eb){_0x1d70e6=_0x1d70e6-0x0;var _0x2d61cb=_0x7836[_0x1d70e6];return _0x2d61cb;};'use strict';var Sequelize=require(_0x6783('0x0'));module[_0x6783('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6783('0x2')]('AmazonAWS','Google',_0x6783('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6783('0x2')](_0x6783('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x6')},'data3':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x7')},'data5':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0x9')},'data6':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xa')},'data7':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xb')}};
\ No newline at end of file
+var _0x7f2b=['Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f2b,0x1f4));var _0xb7f2=function(_0x4ad683,_0x5d2b9b){_0x4ad683=_0x4ad683-0x0;var _0x297ec9=_0x7f2b[_0x4ad683];return _0x297ec9;};'use strict';var Sequelize=require(_0xb7f2('0x0'));module[_0xb7f2('0x1')]={'name':{'type':Sequelize[_0xb7f2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x4'),_0xb7f2('0x5'),_0xb7f2('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb7f2('0x3')](_0xb7f2('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xb7f2('0x9')},'data4':{'type':Sequelize[_0xb7f2('0x2')],'comment':_0xb7f2('0xa')},'data5':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb7f2('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xb7f2('0xb')],'comment':_0xb7f2('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a731719..5097bc9 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 _0xe13a=['hasOwnProperty','nolimit','offset','sort','filters','filter','merge','where','options','CloudProvider','includeAll','findAll','MicrosoftAzure','decryptString','data3','catch','show','include','find','service','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','padEnd','slice','index','fieldName','type','map','query','intersection','model','attributes','fields','length'];(function(_0x4637c9,_0x51126e){var _0x434a20=function(_0x325f90){while(--_0x325f90){_0x4637c9['push'](_0x4637c9['shift']());}};_0x434a20(++_0x51126e);}(_0xe13a,0xe9));var _0xae13=function(_0x2a5763,_0x76820e){_0x2a5763=_0x2a5763-0x0;var _0x114144=_0xe13a[_0x2a5763];return _0x114144;};'use strict';var _=require(_0xae13('0x0'));var Redis=require(_0xae13('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));var logger=require(_0xae13('0x4'))(_0xae13('0x5'));var db=require(_0xae13('0x6'))['db'];var oauth=require(_0xae13('0x7'));config[_0xae13('0x8')]=_['defaults'](config[_0xae13('0x8')],{'host':_0xae13('0x9'),'port':0x18eb});var socket=require(_0xae13('0xa'))(new Redis(config[_0xae13('0x8')]));var redis=new Redis(config[_0xae13('0x8')]);function respondWithStatusCode(_0x10a913,_0x13ae1e){_0x13ae1e=_0x13ae1e||0xcc;return function(_0x18f7b7){if(_0x18f7b7){return _0x10a913[_0xae13('0xb')](_0x13ae1e);}return _0x10a913[_0xae13('0xc')](_0x13ae1e)[_0xae13('0xd')]();};}function respondWithResult(_0x107895,_0x37f7e1){_0x37f7e1=_0x37f7e1||0xc8;return function(_0x156b99){if(_0x156b99){return _0x107895[_0xae13('0xc')](_0x37f7e1)['json'](_0x156b99);}};}function respondWithFilteredResult(_0x5af625,_0x3506f5){return function(_0x166f8c){if(_0x166f8c){var _0x7cd23e=typeof _0x3506f5['offset']===_0xae13('0xe')&&typeof _0x3506f5[_0xae13('0xf')]===_0xae13('0xe');var _0x5d1bbd=_0x166f8c[_0xae13('0x10')];var _0x56e461=_0x7cd23e?0x0:_0x3506f5['offset'];var _0x37b51c=_0x7cd23e?_0x166f8c[_0xae13('0x10')]:_0x3506f5['offset']+_0x3506f5['limit'];var _0x18bf31;if(_0x37b51c>=_0x5d1bbd){_0x37b51c=_0x5d1bbd;_0x18bf31=0xc8;}else{_0x18bf31=0xce;}_0x5af625[_0xae13('0xc')](_0x18bf31);return _0x5af625[_0xae13('0x11')](_0xae13('0x12'),_0x56e461+'-'+_0x37b51c+'/'+_0x5d1bbd)[_0xae13('0x13')](_0x166f8c);}return null;};}function saveUpdates(_0x365dbb){return function(_0x565173){if(_0x565173){return _0x565173[_0xae13('0x14')](_0x365dbb)[_0xae13('0x15')](function(_0x401037){return _0x401037;});}return null;};}function removeEntity(_0x324f49){return function(_0x37a11a){if(_0x37a11a){return _0x37a11a[_0xae13('0x16')]()[_0xae13('0x15')](function(){_0x324f49[_0xae13('0xc')](0xcc)[_0xae13('0xd')]();});}};}function handleEntityNotFound(_0x23cbc7){return function(_0x25324a){if(!_0x25324a){_0x23cbc7[_0xae13('0xb')](0x194);}return _0x25324a;};}function handleError(_0x25e8df,_0x4531c8){_0x4531c8=_0x4531c8||0x1f4;return function(_0x1f2d45){logger['error'](_0x1f2d45[_0xae13('0x17')]);if(_0x1f2d45[_0xae13('0x18')]){delete _0x1f2d45['name'];}_0x25e8df[_0xae13('0xc')](_0x4531c8)['send'](_0x1f2d45);};}function maskClientSecret(_0x4b83b9){return _[_0xae13('0x19')](_0x4b83b9[_0xae13('0x1a')](0x0,0x3),0x14,'*');}exports[_0xae13('0x1b')]=function(_0x463a9f,_0x56b368){var _0x5e9092={},_0x1068b6={},_0x15a331={'count':0x0,'rows':[]};var _0x313aa6=_['map'](db['CloudProvider']['rawAttributes'],function(_0x2111d5){return{'name':_0x2111d5[_0xae13('0x1c')],'type':_0x2111d5[_0xae13('0x1d')]['key']};});_0x1068b6['model']=_[_0xae13('0x1e')](_0x313aa6,_0xae13('0x18'));_0x1068b6['query']=_['keys'](_0x463a9f[_0xae13('0x1f')]);_0x1068b6['filters']=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],_0x1068b6[_0xae13('0x1f')]);_0x5e9092[_0xae13('0x22')]=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],qs[_0xae13('0x23')](_0x463a9f[_0xae13('0x1f')][_0xae13('0x23')]));_0x5e9092[_0xae13('0x22')]=_0x5e9092['attributes'][_0xae13('0x24')]?_0x5e9092[_0xae13('0x22')]:_0x1068b6[_0xae13('0x21')];if(!_0x463a9f[_0xae13('0x1f')][_0xae13('0x25')](_0xae13('0x26'))){_0x5e9092['limit']=qs[_0xae13('0xf')](_0x463a9f[_0xae13('0x1f')]['limit']);_0x5e9092[_0xae13('0x27')]=qs['offset'](_0x463a9f[_0xae13('0x1f')]['offset']);}_0x5e9092['order']=qs['sort'](_0x463a9f[_0xae13('0x1f')][_0xae13('0x28')]);_0x5e9092['where']=qs[_0xae13('0x29')](_['pick'](_0x463a9f['query'],_0x1068b6['filters']),_0x313aa6);if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]){_0x5e9092['where']=_[_0xae13('0x2b')](_0x5e9092[_0xae13('0x2c')],{'$or':_['map'](_0x313aa6,function(_0x37de1f){if(_0x37de1f['type']!=='VIRTUAL'){var _0x254bd7={};_0x254bd7[_0x37de1f[_0xae13('0x18')]]={'$like':'%'+_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]+'%'};return _0x254bd7;}})});}_0x5e9092=_['merge']({},_0x5e9092,_0x463a9f[_0xae13('0x2d')]);var _0x168315={'where':_0x5e9092['where']};return db[_0xae13('0x2e')]['count'](_0x168315)[_0xae13('0x15')](function(_0x942c32){_0x15a331[_0xae13('0x10')]=_0x942c32;if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2f')]){_0x5e9092['include']=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x30')](_0x5e9092);})[_0xae13('0x15')](function(_0x22ae48){_0x15a331['rows']=_[_0xae13('0x1e')](_0x22ae48,function(_0x5b7e91){if(_0x5b7e91['service']===_0xae13('0x31')){var _0x5c9796=encryptor[_0xae13('0x32')](_0x5b7e91[_0xae13('0x33')]);_0x5b7e91['data3']=maskClientSecret(_0x5c9796);}return _0x5b7e91;});return _0x15a331;})[_0xae13('0x15')](respondWithFilteredResult(_0x56b368,_0x5e9092))[_0xae13('0x34')](handleError(_0x56b368,null));};exports[_0xae13('0x35')]=function(_0x5c1dcc,_0x56076e){var _0x305eef={'raw':!![],'where':{'id':_0x5c1dcc['params']['id']}},_0x56ebd5={};_0x56ebd5[_0xae13('0x21')]=_['keys'](db[_0xae13('0x2e')]['rawAttributes']);_0x56ebd5[_0xae13('0x1f')]=_['keys'](_0x5c1dcc['query']);_0x56ebd5[_0xae13('0x29')]=_['intersection'](_0x56ebd5[_0xae13('0x21')],_0x56ebd5[_0xae13('0x1f')]);_0x305eef[_0xae13('0x22')]=_[_0xae13('0x20')](_0x56ebd5[_0xae13('0x21')],qs[_0xae13('0x23')](_0x5c1dcc[_0xae13('0x1f')][_0xae13('0x23')]));_0x305eef[_0xae13('0x22')]=_0x305eef[_0xae13('0x22')]['length']?_0x305eef[_0xae13('0x22')]:_0x56ebd5[_0xae13('0x21')];if(_0x5c1dcc['query']['includeAll']){_0x305eef[_0xae13('0x36')]=[{'all':!![]}];}_0x305eef=_[_0xae13('0x2b')]({},_0x305eef,_0x5c1dcc[_0xae13('0x2d')]);return db[_0xae13('0x2e')][_0xae13('0x37')](_0x305eef)[_0xae13('0x15')](handleEntityNotFound(_0x56076e,null))[_0xae13('0x15')](function(_0x57c512){if(_0x57c512[_0xae13('0x38')]===_0xae13('0x31')){var _0x126bd8=encryptor[_0xae13('0x32')](_0x57c512[_0xae13('0x33')]);_0x57c512[_0xae13('0x33')]=maskClientSecret(_0x126bd8);}return _0x57c512;})[_0xae13('0x15')](respondWithResult(_0x56076e,null))[_0xae13('0x34')](handleError(_0x56076e,null));};exports['create']=function(_0x37338f,_0x2076f8){if(!_0x37338f[_0xae13('0x39')][_0xae13('0x18')])throw new Error(_0xae13('0x3a'));if(!_0x37338f[_0xae13('0x39')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x419c53=db['CloudProvider'][_0xae13('0x3b')][_0xae13('0x38')][_0xae13('0x3c')];if(!_0x419c53['includes'](_0x37338f[_0xae13('0x39')][_0xae13('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x419c53[_0xae13('0x3d')](',\x20'));if(_0x37338f[_0xae13('0x39')]['service']===_0xae13('0x31')&&_0x37338f['body']['data3']){_0x37338f['body'][_0xae13('0x33')]=encryptor[_0xae13('0x3e')](_0x37338f[_0xae13('0x39')]['data3']);}return db[_0xae13('0x2e')]['create'](_0x37338f[_0xae13('0x39')],{})[_0xae13('0x15')](respondWithResult(_0x2076f8,0xc9))[_0xae13('0x34')](handleError(_0x2076f8,null));};exports[_0xae13('0x14')]=function(_0x23242a,_0x2827e5){if(_0x23242a[_0xae13('0x39')]['id']){delete _0x23242a[_0xae13('0x39')]['id'];}return db['CloudProvider'][_0xae13('0x37')]({'where':{'id':_0x23242a['params']['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x2827e5,null))[_0xae13('0x15')](function(_0x3804d4){if(_0x3804d4['service']===_0xae13('0x31')&&_0x23242a[_0xae13('0x39')][_0xae13('0x33')]){_0x23242a[_0xae13('0x39')]['data3']=encryptor[_0xae13('0x3e')](_0x23242a['body'][_0xae13('0x33')]);}return _0x3804d4;})['then'](saveUpdates(_0x23242a[_0xae13('0x39')],null))[_0xae13('0x15')](respondWithResult(_0x2827e5,null))['catch'](handleError(_0x2827e5,null));};exports[_0xae13('0x16')]=function(_0x1aa1c4,_0x1742db){return db[_0xae13('0x2e')][_0xae13('0x37')]({'where':{'id':_0x1aa1c4[_0xae13('0x3f')]['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x1742db,null))[_0xae13('0x15')](removeEntity(_0x1742db,null))[_0xae13('0x34')](handleError(_0x1742db,null));};exports[_0xae13('0x40')]=function(_0x180558,_0x1842a5){return db[_0xae13('0x2e')][_0xae13('0x41')]({'where':{'id':_0x180558[_0xae13('0x3f')]['id']},'raw':!![]})[_0xae13('0x15')](function(_0xd847d7){if(!_0xd847d7)return _0x1842a5['sendStatus'](0x194);return{'url':oauth[_0xae13('0x42')](_0xd847d7,_0x180558[_0xae13('0x43')]['id'])};})[_0xae13('0x15')](respondWithResult(_0x1842a5,null))['catch'](handleError(_0x1842a5,null));};exports['oauth2MicrosoftCallback']=function(_0x37c6ad,_0x220ee9){var _0x2b6634=_0x37c6ad[_0xae13('0x39')];var _0x5b04fb;var _0x61b922;if(_0x2b6634[_0xae13('0x44')])throw _0x2b6634;redis['get'](_0x2b6634[_0xae13('0x45')])[_0xae13('0x15')](function(_0x4c2614){if(!_0x4c2614)throw new Error('Invalid\x20state\x20parameter');_0x5b04fb=JSON[_0xae13('0x46')](_0x4c2614);var _0x10903c=Buffer[_0xae13('0x47')](_0x2b6634[_0xae13('0x45')],_0xae13('0x48'))[_0xae13('0x49')](_0xae13('0x4a'));_0x61b922=JSON[_0xae13('0x46')](_0x10903c);if(!oauth[_0xae13('0x4b')](_0x2b6634[_0xae13('0x4c')],_0x5b04fb[_0xae13('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xae13('0x4e')](_0x2b6634['state']);return oauth[_0xae13('0x4f')](_0x2b6634[_0xae13('0x50')],_0x5b04fb);})[_0xae13('0x15')](function(_0x3e7771){_0x5b04fb[_0xae13('0x51')]=_0x3e7771[_0xae13('0x52')];_0x5b04fb['data6']=_0x3e7771[_0xae13('0x53')];return db['CloudProvider'][_0xae13('0x14')]({'data5':_0x5b04fb[_0xae13('0x51')],'data6':_0x5b04fb['data6']},{'where':{'id':_0x5b04fb['id']}});})[_0xae13('0x15')](function(){oauth[_0xae13('0x54')](_0x5b04fb);socket['emit'](_0xae13('0x55'),{'id':_0x61b922['id']});return;})[_0xae13('0x15')](respondWithStatusCode(_0x220ee9,null))[_0xae13('0x34')](function(_0x3b3091){if(_0x61b922){socket['emit']('microsoftAuthorization:error',{'id':_0x61b922['id']});}if(!_0x5b04fb){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x3b3091);return _0x220ee9[_0xae13('0xc')](0x1f4)[_0xae13('0x56')](_0x3b3091[_0xae13('0x57')]);}logger[_0xae13('0x44')](_0xae13('0x58'),_0x5b04fb['id'],JSON[_0xae13('0x59')](_0x3b3091));});};
\ No newline at end of file
+var _0x6245=['lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','service','MicrosoftAzure','decryptString','data3','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','find','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','parse','state','base64','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:error','stringify'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6245,0x164));var _0x5624=function(_0x3b2e0a,_0x49a3f9){_0x3b2e0a=_0x3b2e0a-0x0;var _0x4a84bd=_0x6245[_0x3b2e0a];return _0x4a84bd;};'use strict';var _=require(_0x5624('0x0'));var Redis=require(_0x5624('0x1'));var qs=require(_0x5624('0x2'));var encryptor=require(_0x5624('0x3'));var config=require(_0x5624('0x4'));var logger=require(_0x5624('0x5'))(_0x5624('0x6'));var db=require(_0x5624('0x7'))['db'];var oauth=require(_0x5624('0x8'));config[_0x5624('0x9')]=_['defaults'](config[_0x5624('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5624('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x5624('0x9')]);function respondWithStatusCode(_0x4b32e3,_0x1d5a46){_0x1d5a46=_0x1d5a46||0xcc;return function(_0x507e20){if(_0x507e20){return _0x4b32e3[_0x5624('0xb')](_0x1d5a46);}return _0x4b32e3[_0x5624('0xc')](_0x1d5a46)[_0x5624('0xd')]();};}function respondWithResult(_0x25722e,_0x20eae9){_0x20eae9=_0x20eae9||0xc8;return function(_0x110704){if(_0x110704){return _0x25722e[_0x5624('0xc')](_0x20eae9)[_0x5624('0xe')](_0x110704);}};}function respondWithFilteredResult(_0x2241a1,_0x12e597){return function(_0x4f373f){if(_0x4f373f){var _0x1c6454=typeof _0x12e597['offset']===_0x5624('0xf')&&typeof _0x12e597['limit']===_0x5624('0xf');var _0xa7dcdb=_0x4f373f[_0x5624('0x10')];var _0x900856=_0x1c6454?0x0:_0x12e597['offset'];var _0xcc6644=_0x1c6454?_0x4f373f[_0x5624('0x10')]:_0x12e597['offset']+_0x12e597[_0x5624('0x11')];var _0x519de3;if(_0xcc6644>=_0xa7dcdb){_0xcc6644=_0xa7dcdb;_0x519de3=0xc8;}else{_0x519de3=0xce;}_0x2241a1[_0x5624('0xc')](_0x519de3);return _0x2241a1['set'](_0x5624('0x12'),_0x900856+'-'+_0xcc6644+'/'+_0xa7dcdb)[_0x5624('0xe')](_0x4f373f);}return null;};}function saveUpdates(_0x2dcf32){return function(_0x15add5){if(_0x15add5){return _0x15add5[_0x5624('0x13')](_0x2dcf32)[_0x5624('0x14')](function(_0xcd02e3){return _0xcd02e3;});}return null;};}function removeEntity(_0x55f2bf){return function(_0x438fde){if(_0x438fde){return _0x438fde[_0x5624('0x15')]()[_0x5624('0x14')](function(){_0x55f2bf[_0x5624('0xc')](0xcc)[_0x5624('0xd')]();});}};}function handleEntityNotFound(_0x31a15f){return function(_0x4ed883){if(!_0x4ed883){_0x31a15f['sendStatus'](0x194);}return _0x4ed883;};}function handleError(_0x4d503f,_0x2749d1){_0x2749d1=_0x2749d1||0x1f4;return function(_0x23d787){logger[_0x5624('0x16')](_0x23d787[_0x5624('0x17')]);if(_0x23d787[_0x5624('0x18')]){delete _0x23d787[_0x5624('0x18')];}_0x4d503f[_0x5624('0xc')](_0x2749d1)[_0x5624('0x19')](_0x23d787);};}function maskClientSecret(_0x5d5b35){return _['padEnd'](_0x5d5b35[_0x5624('0x1a')](0x0,0x3),0x14,'*');}exports[_0x5624('0x1b')]=function(_0x42740a,_0x21f423){var _0x46353e={},_0x3076f0={},_0x1eed80={'count':0x0,'rows':[]};var _0x4d79d7=_[_0x5624('0x1c')](db[_0x5624('0x1d')][_0x5624('0x1e')],function(_0x572a2e){return{'name':_0x572a2e[_0x5624('0x1f')],'type':_0x572a2e[_0x5624('0x20')]['key']};});_0x3076f0[_0x5624('0x21')]=_[_0x5624('0x1c')](_0x4d79d7,_0x5624('0x18'));_0x3076f0[_0x5624('0x22')]=_[_0x5624('0x23')](_0x42740a['query']);_0x3076f0[_0x5624('0x24')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],_0x3076f0[_0x5624('0x22')]);_0x46353e[_0x5624('0x26')]=_[_0x5624('0x25')](_0x3076f0[_0x5624('0x21')],qs[_0x5624('0x27')](_0x42740a[_0x5624('0x22')][_0x5624('0x27')]));_0x46353e[_0x5624('0x26')]=_0x46353e['attributes'][_0x5624('0x28')]?_0x46353e['attributes']:_0x3076f0['model'];if(!_0x42740a[_0x5624('0x22')][_0x5624('0x29')](_0x5624('0x2a'))){_0x46353e['limit']=qs[_0x5624('0x11')](_0x42740a[_0x5624('0x22')]['limit']);_0x46353e[_0x5624('0x2b')]=qs[_0x5624('0x2b')](_0x42740a[_0x5624('0x22')][_0x5624('0x2b')]);}_0x46353e[_0x5624('0x2c')]=qs[_0x5624('0x2d')](_0x42740a[_0x5624('0x22')]['sort']);_0x46353e[_0x5624('0x2e')]=qs['filters'](_[_0x5624('0x2f')](_0x42740a[_0x5624('0x22')],_0x3076f0['filters']),_0x4d79d7);if(_0x42740a[_0x5624('0x22')][_0x5624('0x30')]){_0x46353e['where']=_[_0x5624('0x31')](_0x46353e['where'],{'$or':_[_0x5624('0x1c')](_0x4d79d7,function(_0x5c1404){if(_0x5c1404[_0x5624('0x20')]!==_0x5624('0x32')){var _0x244da0={};_0x244da0[_0x5c1404[_0x5624('0x18')]]={'$like':'%'+_0x42740a[_0x5624('0x22')][_0x5624('0x30')]+'%'};return _0x244da0;}})});}_0x46353e=_[_0x5624('0x31')]({},_0x46353e,_0x42740a[_0x5624('0x33')]);var _0x4962aa={'where':_0x46353e[_0x5624('0x2e')]};return db[_0x5624('0x1d')][_0x5624('0x10')](_0x4962aa)[_0x5624('0x14')](function(_0x30f404){_0x1eed80[_0x5624('0x10')]=_0x30f404;if(_0x42740a[_0x5624('0x22')]['includeAll']){_0x46353e[_0x5624('0x34')]=[{'all':!![]}];}return db[_0x5624('0x1d')][_0x5624('0x35')](_0x46353e);})[_0x5624('0x14')](function(_0x192380){_0x1eed80['rows']=_[_0x5624('0x1c')](_0x192380,function(_0x4bdf37){if(_0x4bdf37[_0x5624('0x36')]===_0x5624('0x37')){var _0x3dad41=encryptor[_0x5624('0x38')](_0x4bdf37[_0x5624('0x39')]);_0x4bdf37[_0x5624('0x39')]=maskClientSecret(_0x3dad41);}return _0x4bdf37;});return _0x1eed80;})[_0x5624('0x14')](respondWithFilteredResult(_0x21f423,_0x46353e))['catch'](handleError(_0x21f423,null));};exports['show']=function(_0x199030,_0x3054a9){var _0x4f68bb={'raw':!![],'where':{'id':_0x199030['params']['id']}},_0x42129b={};_0x42129b['model']=_['keys'](db[_0x5624('0x1d')][_0x5624('0x1e')]);_0x42129b['query']=_[_0x5624('0x23')](_0x199030[_0x5624('0x22')]);_0x42129b[_0x5624('0x24')]=_[_0x5624('0x25')](_0x42129b[_0x5624('0x21')],_0x42129b[_0x5624('0x22')]);_0x4f68bb['attributes']=_['intersection'](_0x42129b['model'],qs[_0x5624('0x27')](_0x199030[_0x5624('0x22')]['fields']));_0x4f68bb['attributes']=_0x4f68bb[_0x5624('0x26')][_0x5624('0x28')]?_0x4f68bb[_0x5624('0x26')]:_0x42129b['model'];if(_0x199030[_0x5624('0x22')]['includeAll']){_0x4f68bb['include']=[{'all':!![]}];}_0x4f68bb=_[_0x5624('0x31')]({},_0x4f68bb,_0x199030[_0x5624('0x33')]);return db[_0x5624('0x1d')]['find'](_0x4f68bb)[_0x5624('0x14')](handleEntityNotFound(_0x3054a9,null))[_0x5624('0x14')](function(_0x5b280d){if(_0x5b280d[_0x5624('0x36')]===_0x5624('0x37')){var _0x4247ea=encryptor[_0x5624('0x38')](_0x5b280d[_0x5624('0x39')]);_0x5b280d[_0x5624('0x39')]=maskClientSecret(_0x4247ea);}return _0x5b280d;})[_0x5624('0x14')](respondWithResult(_0x3054a9,null))['catch'](handleError(_0x3054a9,null));};exports[_0x5624('0x3a')]=function(_0x28c674,_0x5bcf11){if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x28c674[_0x5624('0x3b')][_0x5624('0x36')])throw new Error(_0x5624('0x3c'));var _0x3698bf=db[_0x5624('0x1d')][_0x5624('0x1e')]['service'][_0x5624('0x3d')];if(!_0x3698bf[_0x5624('0x3e')](_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]))throw new Error(_0x5624('0x3f')+_0x3698bf[_0x5624('0x40')](',\x20'));if(_0x28c674[_0x5624('0x3b')][_0x5624('0x36')]==='MicrosoftAzure'&&_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]){_0x28c674[_0x5624('0x3b')][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x28c674[_0x5624('0x3b')]['data3']);}return db[_0x5624('0x1d')][_0x5624('0x3a')](_0x28c674['body'],{})[_0x5624('0x14')](respondWithResult(_0x5bcf11,0xc9))[_0x5624('0x42')](handleError(_0x5bcf11,null));};exports[_0x5624('0x13')]=function(_0x51fe24,_0x2cee62){if(_0x51fe24[_0x5624('0x3b')]['id']){delete _0x51fe24[_0x5624('0x3b')]['id'];}return db[_0x5624('0x1d')][_0x5624('0x43')]({'where':{'id':_0x51fe24[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cee62,null))[_0x5624('0x14')](function(_0x5c7a30){if(_0x5c7a30[_0x5624('0x36')]===_0x5624('0x37')&&_0x51fe24[_0x5624('0x3b')]['data3']){_0x51fe24['body'][_0x5624('0x39')]=encryptor[_0x5624('0x41')](_0x51fe24[_0x5624('0x3b')][_0x5624('0x39')]);}return _0x5c7a30;})['then'](saveUpdates(_0x51fe24[_0x5624('0x3b')],null))[_0x5624('0x14')](respondWithResult(_0x2cee62,null))[_0x5624('0x42')](handleError(_0x2cee62,null));};exports[_0x5624('0x15')]=function(_0x3b9acf,_0x3015ec){return db['CloudProvider']['find']({'where':{'id':_0x3b9acf[_0x5624('0x44')]['id']}})['then'](handleEntityNotFound(_0x3015ec,null))[_0x5624('0x14')](removeEntity(_0x3015ec,null))[_0x5624('0x42')](handleError(_0x3015ec,null));};exports[_0x5624('0x45')]=function(_0x30f427,_0x146ac5){return db['CloudProvider']['findOne']({'where':{'id':_0x30f427['params']['id']},'raw':!![]})[_0x5624('0x14')](function(_0x41b2b1){if(!_0x41b2b1)return _0x146ac5[_0x5624('0xb')](0x194);return{'url':oauth[_0x5624('0x46')](_0x41b2b1,_0x30f427[_0x5624('0x47')]['id'])};})[_0x5624('0x14')](respondWithResult(_0x146ac5,null))[_0x5624('0x42')](handleError(_0x146ac5,null));};exports[_0x5624('0x48')]=function(_0x11dbc2,_0x1907d8){var _0x4cce28=_0x11dbc2[_0x5624('0x3b')];var _0x1d2aec;var _0x30d666;if(_0x4cce28[_0x5624('0x16')])throw _0x4cce28;redis['get'](_0x4cce28['state'])['then'](function(_0x245527){if(!_0x245527)throw new Error('Invalid\x20state\x20parameter');_0x1d2aec=JSON[_0x5624('0x49')](_0x245527);var _0x566850=Buffer['from'](_0x4cce28[_0x5624('0x4a')],_0x5624('0x4b'))[_0x5624('0x4c')](_0x5624('0x4d'));_0x30d666=JSON['parse'](_0x566850);if(!oauth[_0x5624('0x4e')](_0x4cce28['id_token'],_0x1d2aec['oauth2Claims']))throw new Error(_0x5624('0x4f'));redis[_0x5624('0x50')](_0x4cce28[_0x5624('0x4a')]);return oauth[_0x5624('0x51')](_0x4cce28[_0x5624('0x52')],_0x1d2aec);})[_0x5624('0x14')](function(_0x2acb8a){_0x1d2aec[_0x5624('0x53')]=_0x2acb8a[_0x5624('0x54')];_0x1d2aec[_0x5624('0x55')]=_0x2acb8a['refresh_token'];return db[_0x5624('0x1d')]['update']({'data5':_0x1d2aec[_0x5624('0x53')],'data6':_0x1d2aec[_0x5624('0x55')]},{'where':{'id':_0x1d2aec['id']}});})[_0x5624('0x14')](function(){oauth[_0x5624('0x56')](_0x1d2aec);socket['emit']('microsoftAuthorization:success',{'id':_0x30d666['id']});return;})[_0x5624('0x14')](respondWithStatusCode(_0x1907d8,null))[_0x5624('0x42')](function(_0x43515b){if(_0x30d666){socket['emit'](_0x5624('0x57'),{'id':_0x30d666['id']});}if(!_0x1d2aec){logger[_0x5624('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x43515b);return _0x1907d8['status'](0x1f4)[_0x5624('0x19')](_0x43515b['message']);}logger[_0x5624('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1d2aec['id'],JSON[_0x5624('0x58')](_0x43515b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4a0dc2c..3f682ef 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 _0xa64a=['lodash','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xa64a,0xc6));var _0xaa64=function(_0x18bcbf,_0x518845){_0x18bcbf=_0x18bcbf-0x0;var _0x1286e9=_0xa64a[_0x18bcbf];return _0x1286e9;};'use strict';var _=require(_0xaa64('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa64('0x1'));var BPromise=require(_0xaa64('0x2'));var rp=require(_0xaa64('0x3'));var fs=require('fs');var path=require(_0xaa64('0x4'));var rimraf=require('rimraf');var config=require(_0xaa64('0x5'));var attributes=require(_0xaa64('0x6'));module[_0xaa64('0x7')]=function(_0x4455fa,_0x5bb598){return _0x4455fa[_0xaa64('0x8')](_0xaa64('0x9'),attributes,{'tableName':_0xaa64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x160d=['path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x160d,0x7e));var _0xd160=function(_0x5cae78,_0x398e85){_0x5cae78=_0x5cae78-0x0;var _0x5394b6=_0x160d[_0x5cae78];return _0x5394b6;};'use strict';var _=require('lodash');var util=require(_0xd160('0x0'));var logger=require(_0xd160('0x1'))(_0xd160('0x2'));var moment=require(_0xd160('0x3'));var BPromise=require(_0xd160('0x4'));var rp=require(_0xd160('0x5'));var fs=require('fs');var path=require(_0xd160('0x6'));var rimraf=require(_0xd160('0x7'));var config=require('../../config/environment');var attributes=require(_0xd160('0x8'));module[_0xd160('0x9')]=function(_0x14c4a9,_0x367006){return _0x14c4a9[_0xd160('0xa')](_0xd160('0xb'),attributes,{'tableName':'cloud_providers','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 390b66e..8c92372 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 _0x35ae=['exp','resolve','then','data3','CloudProvider','decryptString','POST','data5','data6','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','findAll','map','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','isAfter','unix'];(function(_0x2612d6,_0x7357a2){var _0x1277b6=function(_0x1d704a){while(--_0x1d704a){_0x2612d6['push'](_0x2612d6['shift']());}};_0x1277b6(++_0x7357a2);}(_0x35ae,0x10f));var _0xe35a=function(_0xd94ba3,_0x5e2e97){_0xd94ba3=_0xd94ba3-0x0;var _0x3c5402=_0x35ae[_0xd94ba3];return _0x3c5402;};'use strict';var _=require(_0xe35a('0x0'));var crypto=require(_0xe35a('0x1'));var jwt=require(_0xe35a('0x2'));var moment=require('moment');var Redis=require(_0xe35a('0x3'));var rp=require(_0xe35a('0x4'));var util=require(_0xe35a('0x5'));var encryptor=require(_0xe35a('0x6'));var config=require(_0xe35a('0x7'));var logger=require(_0xe35a('0x8'))(_0xe35a('0x9'));var schedule=require(_0xe35a('0xa'));var db=require(_0xe35a('0xb'))['db'];config[_0xe35a('0xc')]=_[_0xe35a('0xd')](config[_0xe35a('0xc')],{'host':_0xe35a('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xe35a('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe35a('0x10'),_0xe35a('0x11'),_0xe35a('0x12'),'offline_access',_0xe35a('0x13'),_0xe35a('0x14'),_0xe35a('0x15')],'Dynamics365':[_0xe35a('0x10'),_0xe35a('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe35a('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe35a('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56e7fe){var _0x70b379=_['map'](AZURE_AUTH_SCOPES[_0x56e7fe[_0xe35a('0x19')]]);if(_0x56e7fe['type']==='Dynamics365')_0x70b379[_0xe35a('0x1a')](_0x56e7fe[_0xe35a('0x1b')]+'/.default');return _0x70b379[_0xe35a('0x1c')]('\x20');}function getAccessTokenScope(_0x58d268){if(_0x58d268[_0xe35a('0x19')]===_0xe35a('0x1d'))return _0xe35a('0x13');if(_0x58d268[_0xe35a('0x19')]==='Dynamics365')return _0x58d268['data7']+_0xe35a('0x1e');}function generateMicrosoftAuthorizationUrl(_0x539298,_0x5138a9){var _0x246154=MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x539298[_0xe35a('0x20')]);var _0x55173e=[_0xe35a('0x21'),_0xe35a('0x22')];var _0x2e59f6=Buffer[_0xe35a('0x23')](JSON[_0xe35a('0x24')]({'id':_0x5138a9}))[_0xe35a('0x25')]('base64');var _0x1e535e=crypto[_0xe35a('0x26')](0x10)[_0xe35a('0x25')](_0xe35a('0x27'));var _0x3519e3=getAuthorizationScopes(_0x539298);var _0x45352a=[{'key':_0xe35a('0x28'),'value':_0x539298['data1']},{'key':_0xe35a('0x29'),'value':encodeURIComponent(_0x55173e['join']('\x20'))},{'key':_0xe35a('0x2a'),'value':_0x539298[_0xe35a('0x2b')]},{'key':_0xe35a('0x2c'),'value':_0xe35a('0x2d')},{'key':'scope','value':encodeURIComponent(_0x3519e3)},{'key':_0xe35a('0x2e'),'value':_0x2e59f6},{'key':_0xe35a('0x2f'),'value':_0x1e535e},{'key':_0xe35a('0x30'),'value':'login'}];var _0x1d25fa=_0x246154+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x45352a,function(_0x17645c){return _0x17645c['key']+'='+_0x17645c[_0xe35a('0x31')];})[_0xe35a('0x1c')]('&');_0x539298[_0xe35a('0x32')]={'issuer':_0x246154[_0xe35a('0x1f')](_0xe35a('0x33'),''),'audience':_0x539298[_0xe35a('0x34')],'state':_0x2e59f6,'nonce':_0x1e535e};redis[_0xe35a('0x35')](_0x2e59f6,JSON[_0xe35a('0x24')](_0x539298));return _0x1d25fa;}function isValidIdToken(_0x5a33cf,_0x13f5a7){try{var _0x45173f=jwt[_0xe35a('0x36')](_0x5a33cf,{'complete':!![]});var _0x184f15=_0x45173f[_0xe35a('0x37')];if(_0x184f15[_0xe35a('0x38')]!==_0x13f5a7[_0xe35a('0x39')])return![];if(_0x184f15[_0xe35a('0x3a')]!==_0x13f5a7['audience'])return![];if(_0x184f15['nonce']!==_0x13f5a7[_0xe35a('0x2f')])return![];if(moment()[_0xe35a('0x3b')](moment[_0xe35a('0x3c')](_0x184f15[_0xe35a('0x3d')])))return![];return!![];}catch(_0x3efbcb){throw _0x3efbcb;}}function refreshOauth2MicrosoftAccessToken(_0x368b3d){return Promise[_0xe35a('0x3e')]()[_0xe35a('0x3f')](function(){if(_0x368b3d[_0xe35a('0x40')])return _0x368b3d;return db[_0xe35a('0x41')]['findOne']({'where':{'id':_0x368b3d['id']},'raw':!![]});})[_0xe35a('0x3f')](function(_0x4149fd){var _0x310fd9={'grant_type':'refresh_token','refresh_token':_0x4149fd['data6'],'scope':getAccessTokenScope(_0x4149fd),'redirect_uri':_0x4149fd[_0xe35a('0x2b')],'client_id':_0x4149fd[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x4149fd[_0xe35a('0x40')])};var _0x41a4c4={'method':_0xe35a('0x43'),'uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x4149fd[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x310fd9,'json':!![]};return rp(_0x41a4c4);})['then'](function(_0x92a9d6){_0x368b3d[_0xe35a('0x44')]=_0x92a9d6['access_token'];_0x368b3d[_0xe35a('0x45')]=_0x92a9d6[_0xe35a('0x46')];return db[_0xe35a('0x41')][_0xe35a('0x47')]({'data5':_0x368b3d[_0xe35a('0x44')],'data6':_0x368b3d[_0xe35a('0x45')]},{'where':{'id':_0x368b3d['id']}});})[_0xe35a('0x3f')](function(){return _0x368b3d;})[_0xe35a('0x48')](function(_0x54fd1a){logger[_0xe35a('0x49')](_0xe35a('0x4a'),_0x368b3d['id'],_0x54fd1a);});}function getOauth2MicrosoftAccessToken(_0x1542d6,_0x3c8587){var _0x974ae={'grant_type':_0xe35a('0x4b'),'code':_0x1542d6,'scope':getAccessTokenScope(_0x3c8587),'redirect_uri':_0x3c8587[_0xe35a('0x2b')],'client_id':_0x3c8587[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x3c8587['data3'])};var _0x1a285c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')](_0xe35a('0x4c'),_0x3c8587[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x974ae,'json':!![]};return rp(_0x1a285c);}function startRefreshInterval(_0x597c7e){var _0xcb86c8=schedule[_0xe35a('0x4d')];if(_0xcb86c8[_0x597c7e['id']])clearInterval(_0xcb86c8[_0x597c7e['id']]);_0xcb86c8[_0x597c7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x597c7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xcb86c8;}function startAllRefreshIntervals(){return db[_0xe35a('0x41')][_0xe35a('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe35a('0x3f')](function(_0x1a238b){var _0x1bf494=_0x1a238b[_0xe35a('0x4f')](function(_0x5ccbc4){return refreshOauth2MicrosoftAccessToken(_0x5ccbc4)[_0xe35a('0x3f')](function(_0x1ca80e){startRefreshInterval(_0x1ca80e);});});return Promise['all'](_0x1bf494);})[_0xe35a('0x48')](function(_0x2a0cd1){var _0x315250=_0x2a0cd1?util[_0xe35a('0x50')](_0x2a0cd1,{'showHidden':![],'depth':null}):'';logger[_0xe35a('0x49')](_0xe35a('0x51'),_0x315250);});}module[_0xe35a('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xab4e=['join','Dynamics365','/.default','replace','data2','code','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','set','decode','iss','aud','audience','unix','exp','data3','refresh_token','data6','decryptString','{TENANT_ID}','then','data5','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','push','data7'];(function(_0x177777,_0x126b6b){var _0x5dd5c0=function(_0xe7de6e){while(--_0xe7de6e){_0x177777['push'](_0x177777['shift']());}};_0x5dd5c0(++_0x126b6b);}(_0xab4e,0x11a));var _0xeab4=function(_0x21e26a,_0x74beb4){_0x21e26a=_0x21e26a-0x0;var _0x33f236=_0xab4e[_0x21e26a];return _0x33f236;};'use strict';var _=require(_0xeab4('0x0'));var crypto=require(_0xeab4('0x1'));var jwt=require(_0xeab4('0x2'));var moment=require(_0xeab4('0x3'));var Redis=require(_0xeab4('0x4'));var rp=require('request-promise');var util=require(_0xeab4('0x5'));var encryptor=require(_0xeab4('0x6'));var config=require(_0xeab4('0x7'));var logger=require(_0xeab4('0x8'))('api');var schedule=require(_0xeab4('0x9'));var db=require(_0xeab4('0xa'))['db'];config[_0xeab4('0xb')]=_[_0xeab4('0xc')](config[_0xeab4('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xeab4('0xb')]);var MICROSOFT_AUTH_URL=_0xeab4('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xeab4('0xe'),_0xeab4('0xf'),_0xeab4('0x10'),_0xeab4('0x11'),_0xeab4('0x12'),_0xeab4('0x13'),_0xeab4('0x14')],'Dynamics365':[_0xeab4('0xe'),_0xeab4('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xeab4('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4cd173){var _0x48515c=_[_0xeab4('0x16')](AZURE_AUTH_SCOPES[_0x4cd173[_0xeab4('0x17')]]);if(_0x4cd173[_0xeab4('0x17')]==='Dynamics365')_0x48515c[_0xeab4('0x18')](_0x4cd173[_0xeab4('0x19')]+'/.default');return _0x48515c[_0xeab4('0x1a')]('\x20');}function getAccessTokenScope(_0x29f893){if(_0x29f893[_0xeab4('0x17')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x29f893[_0xeab4('0x17')]===_0xeab4('0x1b'))return _0x29f893['data7']+_0xeab4('0x1c');}function generateMicrosoftAuthorizationUrl(_0x4cec5a,_0x10941e){var _0x23c4dd=MICROSOFT_AUTH_URL[_0xeab4('0x1d')]('{TENANT_ID}',_0x4cec5a[_0xeab4('0x1e')]);var _0x55f6da=[_0xeab4('0x1f'),'id_token'];var _0x19979f=Buffer['from'](JSON[_0xeab4('0x20')]({'id':_0x10941e}))[_0xeab4('0x21')](_0xeab4('0x22'));var _0x2315dc=crypto['randomBytes'](0x10)['toString'](_0xeab4('0x23'));var _0x259bd5=getAuthorizationScopes(_0x4cec5a);var _0x77b6f0=[{'key':_0xeab4('0x24'),'value':_0x4cec5a[_0xeab4('0x25')]},{'key':_0xeab4('0x26'),'value':encodeURIComponent(_0x55f6da[_0xeab4('0x1a')]('\x20'))},{'key':_0xeab4('0x27'),'value':_0x4cec5a[_0xeab4('0x28')]},{'key':_0xeab4('0x29'),'value':_0xeab4('0x2a')},{'key':_0xeab4('0x2b'),'value':encodeURIComponent(_0x259bd5)},{'key':_0xeab4('0x2c'),'value':_0x19979f},{'key':_0xeab4('0x2d'),'value':_0x2315dc},{'key':_0xeab4('0x2e'),'value':_0xeab4('0x2f')}];var _0x256f58=_0x23c4dd+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x77b6f0,function(_0x56d471){return _0x56d471['key']+'='+_0x56d471[_0xeab4('0x30')];})[_0xeab4('0x1a')]('&');_0x4cec5a[_0xeab4('0x31')]={'issuer':_0x23c4dd[_0xeab4('0x1d')](_0xeab4('0x32'),''),'audience':_0x4cec5a[_0xeab4('0x25')],'state':_0x19979f,'nonce':_0x2315dc};redis[_0xeab4('0x33')](_0x19979f,JSON['stringify'](_0x4cec5a));return _0x256f58;}function isValidIdToken(_0x12057e,_0x5d4e7c){try{var _0x54712c=jwt[_0xeab4('0x34')](_0x12057e,{'complete':!![]});var _0x15486d=_0x54712c['payload'];if(_0x15486d[_0xeab4('0x35')]!==_0x5d4e7c['issuer'])return![];if(_0x15486d[_0xeab4('0x36')]!==_0x5d4e7c[_0xeab4('0x37')])return![];if(_0x15486d[_0xeab4('0x2d')]!==_0x5d4e7c[_0xeab4('0x2d')])return![];if(moment()['isAfter'](moment[_0xeab4('0x38')](_0x15486d[_0xeab4('0x39')])))return![];return!![];}catch(_0x3cb93b){throw _0x3cb93b;}}function refreshOauth2MicrosoftAccessToken(_0x2b06b5){return Promise['resolve']()['then'](function(){if(_0x2b06b5[_0xeab4('0x3a')])return _0x2b06b5;return db['CloudProvider']['findOne']({'where':{'id':_0x2b06b5['id']},'raw':!![]});})['then'](function(_0x5efec7){var _0x1f2b0e={'grant_type':_0xeab4('0x3b'),'refresh_token':_0x5efec7[_0xeab4('0x3c')],'scope':getAccessTokenScope(_0x5efec7),'redirect_uri':_0x5efec7[_0xeab4('0x28')],'client_id':_0x5efec7[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x5efec7[_0xeab4('0x3a')])};var _0x15ed44={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x5efec7[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f2b0e,'json':!![]};return rp(_0x15ed44);})[_0xeab4('0x3f')](function(_0x52894c){_0x2b06b5[_0xeab4('0x40')]=_0x52894c['access_token'];_0x2b06b5[_0xeab4('0x3c')]=_0x52894c[_0xeab4('0x3b')];return db[_0xeab4('0x41')][_0xeab4('0x42')]({'data5':_0x2b06b5['data5'],'data6':_0x2b06b5[_0xeab4('0x3c')]},{'where':{'id':_0x2b06b5['id']}});})[_0xeab4('0x3f')](function(){return _0x2b06b5;})[_0xeab4('0x43')](function(_0x14fc30){logger[_0xeab4('0x44')](_0xeab4('0x45'),_0x2b06b5['id'],_0x14fc30);});}function getOauth2MicrosoftAccessToken(_0x50d4f9,_0x4b0982){var _0x382fda={'grant_type':_0xeab4('0x46'),'code':_0x50d4f9,'scope':getAccessTokenScope(_0x4b0982),'redirect_uri':_0x4b0982[_0xeab4('0x28')],'client_id':_0x4b0982[_0xeab4('0x25')],'client_secret':encryptor[_0xeab4('0x3d')](_0x4b0982[_0xeab4('0x3a')])};var _0x324c6b={'method':_0xeab4('0x47'),'uri':MICROSOFT_AUTH_URL[_0xeab4('0x1d')](_0xeab4('0x3e'),_0x4b0982[_0xeab4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x382fda,'json':!![]};return rp(_0x324c6b);}function startRefreshInterval(_0x31a0c9){var _0x2021cb=schedule[_0xeab4('0x48')];if(_0x2021cb[_0x31a0c9['id']])clearInterval(_0x2021cb[_0x31a0c9['id']]);_0x2021cb[_0x31a0c9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xeab4('0x49')](this,{'id':_0x31a0c9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xeab4('0x48')]=_0x2021cb;}function startAllRefreshIntervals(){return db[_0xeab4('0x41')][_0xeab4('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xeab4('0x3f')](function(_0x5c1048){var _0x91562=_0x5c1048[_0xeab4('0x16')](function(_0x208527){return refreshOauth2MicrosoftAccessToken(_0x208527)[_0xeab4('0x3f')](function(_0x5b8632){startRefreshInterval(_0x5b8632);});});return Promise[_0xeab4('0x4b')](_0x91562);})[_0xeab4('0x43')](function(_0x16eafa){var _0x2d5760=_0x16eafa?util['inspect'](_0x16eafa,{'showHidden':![],'depth':null}):'';logger[_0xeab4('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2d5760);});}module[_0xeab4('0x4c')]={'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 2f666f8..c093302 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 _0xb515=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4ca0a1,_0x6158d8){var _0x1c26c3=function(_0x3029e5){while(--_0x3029e5){_0x4ca0a1['push'](_0x4ca0a1['shift']());}};_0x1c26c3(++_0x6158d8);}(_0xb515,0x1b8));var _0x5b51=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb515[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var moment=require(_0x5b51('0x1'));var BPromise=require(_0x5b51('0x2'));var rs=require(_0x5b51('0x3'));var fs=require('fs');var Redis=require(_0x5b51('0x4'));var db=require(_0x5b51('0x5'))['db'];var utils=require(_0x5b51('0x6'));var logger=require(_0x5b51('0x7'))(_0x5b51('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b51('0x9'));var client=jayson[_0x5b51('0xa')][_0x5b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293d82,_0x396b3f,_0x2c6d86){return new BPromise(function(_0x1d5082,_0x226e9c){return client[_0x5b51('0xc')](_0x293d82,_0x2c6d86)[_0x5b51('0xd')](function(_0x1085e6){logger[_0x5b51('0xe')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x5b51('0xf'));logger[_0x5b51('0x10')](_0x5b51('0x11'),_0x396b3f,_0x5b51('0xf'),JSON[_0x5b51('0x12')](_0x1085e6));if(_0x1085e6[_0x5b51('0x13')]){if(_0x1085e6['error']['code']===0x1f4){logger['error'](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x226e9c(_0x1085e6[_0x5b51('0x13')]['message']);}logger[_0x5b51('0x13')](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x1d5082(_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);}else{logger[_0x5b51('0xe')](_0x5b51('0x14'),_0x396b3f,_0x5b51('0xf'));_0x1d5082(_0x1085e6[_0x5b51('0x16')][_0x5b51('0x15')]);}})[_0x5b51('0x17')](function(_0x520686){logger[_0x5b51('0x13')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x520686);_0x226e9c(_0x520686);});});}
\ No newline at end of file
+var _0x30d6=['client','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x30d6,0x1b0));var _0x630d=function(_0x3e3f8b,_0x98ea26){_0x3e3f8b=_0x3e3f8b-0x0;var _0x354e47=_0x30d6[_0x3e3f8b];return _0x354e47;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8374d87..0b5c476 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x16e773,_0x8abfd7){var _0x54a3e8=function(_0x5a5f25){while(--_0x5a5f25){_0x16e773['push'](_0x16e773['shift']());}};_0x54a3e8(++_0x8abfd7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5ee49f,_0x317771){var _0x44cca1=function(_0x1f7b6f){while(--_0x1f7b6f){_0x5ee49f['push'](_0x5ee49f['shift']());}};_0x44cca1(++_0x317771);}(_0xdb28,0x106));var _0x8db2=function(_0x4c88c7,_0x3f0882){_0x4c88c7=_0x4c88c7-0x0;var _0x2c03e7=_0xdb28[_0x4c88c7];return _0x2c03e7;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 907de49..ea86756 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 _0xbd94=['STRING','sequelize','name'];(function(_0xb119da,_0x42d325){var _0x3ecb48=function(_0x361539){while(--_0x361539){_0xb119da['push'](_0xb119da['shift']());}};_0x3ecb48(++_0x42d325);}(_0xbd94,0xfd));var _0x4bd9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbd94[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4bd9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bd9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4bd9('0x2')]},'website':{'type':Sequelize[_0x4bd9('0x2')]},'phone':{'type':Sequelize[_0x4bd9('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4bd9('0x2')]},'street':{'type':Sequelize[_0x4bd9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4bd9('0x2')]},'country':{'type':Sequelize[_0x4bd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4bd9('0x2')]},'sStreet':{'type':Sequelize[_0x4bd9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4bd9('0x2')]},'sCountry':{'type':Sequelize[_0x4bd9('0x2')]},'description':{'type':Sequelize[_0x4bd9('0x2')]}};
\ No newline at end of file
+var _0x5915=['sequelize','exports','STRING'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5915,0x14a));var _0x5591=function(_0x2d4924,_0x34b36f){_0x2d4924=_0x2d4924-0x0;var _0x2db190=_0x5915[_0x2d4924];return _0x2db190;};'use strict';var Sequelize=require(_0x5591('0x0'));module[_0x5591('0x1')]={'name':{'type':Sequelize[_0x5591('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5591('0x2')]},'website':{'type':Sequelize[_0x5591('0x2')]},'phone':{'type':Sequelize[_0x5591('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5591('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5591('0x2')]},'country':{'type':Sequelize[_0x5591('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5591('0x2')]},'sStreet':{'type':Sequelize[_0x5591('0x2')]},'sPostalCode':{'type':Sequelize[_0x5591('0x2')]},'sCity':{'type':Sequelize[_0x5591('0x2')]},'sCountry':{'type':Sequelize[_0x5591('0x2')]},'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 4805c4d..7275b2b 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 _0xa6b9=['filter','map','options','include','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact','omit','ids','getContacts','pick','merge','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xa6b9,0x75));var _0x9a6b=function(_0x23a2ac,_0x39d9d0){_0x23a2ac=_0x23a2ac-0x0;var _0x28bfb0=_0xa6b9[_0x23a2ac];return _0x28bfb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a6b('0x1'));var rp=require(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a6b('0x4'));var util=require(_0x9a6b('0x5'));var path=require(_0x9a6b('0x6'));var sox=require(_0x9a6b('0x7'));var csv=require('to-csv');var ejs=require(_0x9a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x9a6b('0x9'));var _=require('lodash');var squel=require(_0x9a6b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a6b('0xb'));var toCsv=require(_0x9a6b('0xc'));var querystring=require(_0x9a6b('0xd'));var Papa=require(_0x9a6b('0xe'));var Redis=require(_0x9a6b('0xf'));var authService=require(_0x9a6b('0x10'));var qs=require(_0x9a6b('0x11'));var as=require(_0x9a6b('0x12'));var hardwareService=require(_0x9a6b('0x13'));var logger=require(_0x9a6b('0x14'))(_0x9a6b('0x15'));var utils=require(_0x9a6b('0x16'));var config=require(_0x9a6b('0x17'));var licenseUtil=require(_0x9a6b('0x18'));var db=require(_0x9a6b('0x19'))['db'];function respondWithStatusCode(_0xdb1b86,_0xa01b90){_0xa01b90=_0xa01b90||0xcc;return function(_0x33dea4){if(_0x33dea4){return _0xdb1b86[_0x9a6b('0x1a')](_0xa01b90);}return _0xdb1b86[_0x9a6b('0x1b')](_0xa01b90)[_0x9a6b('0x1c')]();};}function respondWithResult(_0x4fe70e,_0x566dff){_0x566dff=_0x566dff||0xc8;return function(_0x57001c){if(_0x57001c){return _0x4fe70e['status'](_0x566dff)[_0x9a6b('0x1d')](_0x57001c);}};}function respondWithFilteredResult(_0x1318de,_0x2badbc){return function(_0x3a65ab){if(_0x3a65ab){var _0xb54fbd=typeof _0x2badbc[_0x9a6b('0x1e')]===_0x9a6b('0x1f')&&typeof _0x2badbc[_0x9a6b('0x20')]===_0x9a6b('0x1f');var _0x1258b8=_0x3a65ab[_0x9a6b('0x21')];var _0x167cf2=_0xb54fbd?0x0:_0x2badbc[_0x9a6b('0x1e')];var _0x14d340=_0xb54fbd?_0x3a65ab[_0x9a6b('0x21')]:_0x2badbc[_0x9a6b('0x1e')]+_0x2badbc['limit'];var _0x3e25db;if(_0x14d340>=_0x1258b8){_0x14d340=_0x1258b8;_0x3e25db=0xc8;}else{_0x3e25db=0xce;}_0x1318de[_0x9a6b('0x1b')](_0x3e25db);return _0x1318de['set']('Content-Range',_0x167cf2+'-'+_0x14d340+'/'+_0x1258b8)[_0x9a6b('0x1d')](_0x3a65ab);}return null;};}function patchUpdates(_0x4ebe79){return function(_0x4aca36){try{jsonpatch[_0x9a6b('0x22')](_0x4aca36,_0x4ebe79,!![]);}catch(_0x35933a){return BPromise[_0x9a6b('0x23')](_0x35933a);}return _0x4aca36[_0x9a6b('0x24')]();};}function saveUpdates(_0x132acb,_0x1c7f84){return function(_0x498bc8){if(_0x498bc8){return _0x498bc8['update'](_0x132acb)[_0x9a6b('0x25')](function(_0x49c3ae){return _0x49c3ae;});}return null;};}function removeEntity(_0x93d18,_0xd45f86){return function(_0x5652c5){if(_0x5652c5){return _0x5652c5[_0x9a6b('0x26')]()[_0x9a6b('0x25')](function(){var _0x1ef65d=_0x5652c5[_0x9a6b('0x27')]({'plain':!![]});var _0x24a1d3=_0x9a6b('0x28');return db[_0x9a6b('0x29')]['destroy']({'where':{'type':_0x24a1d3,'resourceId':_0x1ef65d['id']}})[_0x9a6b('0x25')](function(){return _0x5652c5;});})[_0x9a6b('0x25')](function(){_0x93d18['status'](0xcc)[_0x9a6b('0x1c')]();});}};}function handleEntityNotFound(_0x4eac23,_0x327ffc){return function(_0x33fcee){if(!_0x33fcee){_0x4eac23[_0x9a6b('0x1a')](0x194);}return _0x33fcee;};}function handleError(_0x182daf,_0x3e4e4c){_0x3e4e4c=_0x3e4e4c||0x1f4;return function(_0x114042){logger['error'](_0x114042[_0x9a6b('0x2a')]);if(_0x114042[_0x9a6b('0x2b')]){delete _0x114042[_0x9a6b('0x2b')];}_0x182daf['status'](_0x3e4e4c)[_0x9a6b('0x2c')](_0x114042);};}exports[_0x9a6b('0x2d')]=function(_0x519e87,_0x86fc7d){var _0x3e6fe7={},_0x391940={},_0x290ea0={'count':0x0,'rows':[]};return db[_0x9a6b('0x2e')]['describe']()['then'](function(_0x2e9942){_0x391940[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](_0x2e9942);_0x391940[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x519e87[_0x9a6b('0x31')]);_0x391940[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x391940['model'],_0x391940[_0x9a6b('0x31')]);_0x3e6fe7[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x391940['model'],qs[_0x9a6b('0x35')](_0x519e87[_0x9a6b('0x31')]['fields']));_0x3e6fe7[_0x9a6b('0x34')]=_0x3e6fe7[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0x3e6fe7[_0x9a6b('0x34')]:_0x391940['model'];if(!_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x3e6fe7[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x3e6fe7[_0x9a6b('0x1e')]=qs['offset'](_0x519e87['query'][_0x9a6b('0x1e')]);}_0x3e6fe7['order']=qs[_0x9a6b('0x39')](_0x519e87[_0x9a6b('0x31')]['sort']);_0x3e6fe7[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_['pick'](_0x519e87[_0x9a6b('0x31')],_0x391940[_0x9a6b('0x32')]),_0x2e9942);if(_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x3e6fe7[_0x9a6b('0x3a')]=_['merge'](_0x3e6fe7[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x3e6fe7[_0x9a6b('0x34')],function(_0x554329){var _0x53034a={};_0x53034a[_0x554329]={'$like':'%'+_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x53034a;})});}_0x3e6fe7=_['merge']({},_0x3e6fe7,_0x519e87[_0x9a6b('0x3d')]);var _0x301b19={'where':_0x3e6fe7[_0x9a6b('0x3a')]};return db['CmCompany']['count'](_0x301b19)[_0x9a6b('0x25')](function(_0x1ed70d){_0x290ea0[_0x9a6b('0x21')]=_0x1ed70d;if(_0x519e87[_0x9a6b('0x31')]['includeAll']){_0x3e6fe7[_0x9a6b('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3e6fe7);})[_0x9a6b('0x25')](function(_0x1b3dc8){_0x290ea0[_0x9a6b('0x3f')]=_0x1b3dc8;return _0x290ea0;})[_0x9a6b('0x25')](respondWithFilteredResult(_0x86fc7d,_0x3e6fe7))[_0x9a6b('0x40')](handleError(_0x86fc7d,null));})[_0x9a6b('0x40')](handleError(_0x86fc7d,null));};exports[_0x9a6b('0x41')]=function(_0x4f810e,_0x5d2974){var _0xe79f8a={'raw':![],'where':{'id':_0x4f810e['params']['id']}},_0x466eb0={};_0x466eb0['model']=_[_0x9a6b('0x30')](db['CmCompany'][_0x9a6b('0x42')]);_0x466eb0[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x4f810e[_0x9a6b('0x31')]);_0x466eb0[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x466eb0['model'],_0x466eb0[_0x9a6b('0x31')]);_0xe79f8a['attributes']=_[_0x9a6b('0x33')](_0x466eb0['model'],qs[_0x9a6b('0x35')](_0x4f810e[_0x9a6b('0x31')]['fields']));_0xe79f8a[_0x9a6b('0x34')]=_0xe79f8a[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0xe79f8a[_0x9a6b('0x34')]:_0x466eb0[_0x9a6b('0x2f')];if(_0x4f810e[_0x9a6b('0x31')][_0x9a6b('0x43')]){_0xe79f8a[_0x9a6b('0x3e')]=[{'all':!![]}];}_0xe79f8a=_['merge']({},_0xe79f8a,_0x4f810e[_0x9a6b('0x3d')]);return db[_0x9a6b('0x2e')][_0x9a6b('0x44')](_0xe79f8a)[_0x9a6b('0x25')](handleEntityNotFound(_0x5d2974,null))[_0x9a6b('0x25')](respondWithResult(_0x5d2974,null))[_0x9a6b('0x40')](handleError(_0x5d2974,null));};exports['create']=function(_0x5f5bba,_0x48b54e){return db[_0x9a6b('0x2e')][_0x9a6b('0x45')](_0x5f5bba['body'],{})[_0x9a6b('0x25')](function(_0x25f162){var _0x3f918d=_0x5f5bba[_0x9a6b('0x46')]['get']({'plain':!![]});if(!_0x3f918d)throw new Error(_0x9a6b('0x47'));if(_0x3f918d[_0x9a6b('0x48')]===_0x9a6b('0x46')){var _0x1390c2=_0x25f162[_0x9a6b('0x27')]({'plain':!![]});var _0x2d6d21=_0x9a6b('0x28');return db[_0x9a6b('0x49')][_0x9a6b('0x44')]({'where':{'name':_0x2d6d21,'userProfileId':_0x3f918d['userProfileId']},'raw':!![]})[_0x9a6b('0x25')](function(_0x5e1381){if(_0x5e1381&&_0x5e1381[_0x9a6b('0x4a')]===0x0){return db[_0x9a6b('0x29')][_0x9a6b('0x45')]({'name':_0x1390c2[_0x9a6b('0x2b')],'resourceId':_0x1390c2['id'],'type':_0x5e1381[_0x9a6b('0x2b')],'sectionId':_0x5e1381['id']},{})['then'](function(){return _0x25f162;});}else{return _0x25f162;}})[_0x9a6b('0x40')](function(_0x2882af){logger[_0x9a6b('0x4b')](_0x9a6b('0x4c'),_0x2882af);throw _0x2882af;});}return _0x25f162;})['then'](respondWithResult(_0x48b54e,0xc9))[_0x9a6b('0x40')](handleError(_0x48b54e,null));};exports[_0x9a6b('0x4d')]=function(_0x812e4d,_0x59f3e5){if(_0x812e4d[_0x9a6b('0x4e')]['id']){delete _0x812e4d[_0x9a6b('0x4e')]['id'];}return db[_0x9a6b('0x2e')][_0x9a6b('0x44')]({'where':{'id':_0x812e4d['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x59f3e5,null))['then'](saveUpdates(_0x812e4d[_0x9a6b('0x4e')],null))['then'](respondWithResult(_0x59f3e5,null))['catch'](handleError(_0x59f3e5,null));};exports[_0x9a6b('0x26')]=function(_0x8166be,_0x56c4f4){return db['CmCompany']['find']({'where':{'id':_0x8166be[_0x9a6b('0x4f')]['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x56c4f4,null))[_0x9a6b('0x25')](removeEntity(_0x56c4f4,null))[_0x9a6b('0x40')](handleError(_0x56c4f4,null));};exports['describe']=function(_0x5ae31d,_0x4ca200){return db[_0x9a6b('0x2e')][_0x9a6b('0x50')]()[_0x9a6b('0x25')](respondWithResult(_0x4ca200,null))[_0x9a6b('0x40')](handleError(_0x4ca200,null));};exports[_0x9a6b('0x51')]=function(_0x276373,_0x3f7d3b,_0x133daf){return db[_0x9a6b('0x52')][_0x9a6b('0x44')]({'where':{'id':_0x276373[_0x9a6b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f7d3b,null))[_0x9a6b('0x25')](function(_0x1dc44c){if(_0x1dc44c){return _0x1dc44c[_0x9a6b('0x51')](_0x276373['body']['ids'],_[_0x9a6b('0x53')](_0x276373[_0x9a6b('0x4e')],[_0x9a6b('0x54'),'id'])||{});}})[_0x9a6b('0x25')](respondWithResult(_0x3f7d3b,null))['catch'](handleError(_0x3f7d3b,null));};exports[_0x9a6b('0x55')]=function(_0x409253,_0x54b6ba,_0x5dfdc9){var _0x42ba25={};var _0x420732={};var _0x3572d0;var _0xd447bb;return db[_0x9a6b('0x2e')]['findOne']({'where':{'id':_0x409253['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x54b6ba,null))['then'](function(_0x57c5e4){if(_0x57c5e4){_0x3572d0=_0x57c5e4;_0x420732[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](db[_0x9a6b('0x52')][_0x9a6b('0x42')]);_0x420732[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x409253[_0x9a6b('0x31')]);_0x420732['filters']=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],_0x420732[_0x9a6b('0x31')]);_0x42ba25[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],qs[_0x9a6b('0x35')](_0x409253[_0x9a6b('0x31')]['fields']));_0x42ba25[_0x9a6b('0x34')]=_0x42ba25['attributes']['length']?_0x42ba25[_0x9a6b('0x34')]:_0x420732[_0x9a6b('0x2f')];_0x42ba25['order']=qs[_0x9a6b('0x39')](_0x409253[_0x9a6b('0x31')]['sort']);_0x42ba25[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_[_0x9a6b('0x56')](_0x409253[_0x9a6b('0x31')],_0x420732[_0x9a6b('0x32')]));if(_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x42ba25[_0x9a6b('0x3a')]=_[_0x9a6b('0x57')](_0x42ba25[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x42ba25['attributes'],function(_0xe2efb){var _0x29ee00={};_0x29ee00[_0xe2efb]={'$like':'%'+_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x29ee00;})});}_0x42ba25=_[_0x9a6b('0x57')]({},_0x42ba25,_0x409253[_0x9a6b('0x3d')]);return _0x3572d0['getContacts'](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x47471e){if(_0x47471e){_0xd447bb=_0x47471e['length'];if(!_0x409253[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x42ba25[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x409253[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x42ba25['offset']=qs[_0x9a6b('0x1e')](_0x409253[_0x9a6b('0x31')]['offset']);}return _0x3572d0[_0x9a6b('0x55')](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x13758a){if(_0x13758a){return _0x13758a?{'count':_0xd447bb,'rows':_0x13758a}:null;}})['then'](respondWithResult(_0x54b6ba,null))[_0x9a6b('0x40')](handleError(_0x54b6ba,null));};
\ No newline at end of file
+var _0xbfb8=['../../mysqldb','status','end','offset','undefined','Content-Range','json','apply','reject','save','then','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','count','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','update','destroy','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x44ab0b,_0x4a2fc4){var _0x54f695=function(_0x27da24){while(--_0x27da24){_0x44ab0b['push'](_0x44ab0b['shift']());}};_0x54f695(++_0x4a2fc4);}(_0xbfb8,0x195));var _0x8bfb=function(_0xf7d2be,_0x559b6c){_0xf7d2be=_0xf7d2be-0x0;var _0x1e62c3=_0xbfb8[_0xf7d2be];return _0x1e62c3;};'use strict';var emlformat=require(_0x8bfb('0x0'));var rimraf=require(_0x8bfb('0x1'));var zipdir=require(_0x8bfb('0x2'));var jsonpatch=require(_0x8bfb('0x3'));var rp=require(_0x8bfb('0x4'));var moment=require(_0x8bfb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bfb('0x6'));var util=require('util');var path=require(_0x8bfb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bfb('0x8'));var fs=require('fs');var fs_extra=require(_0x8bfb('0x9'));var _=require(_0x8bfb('0xa'));var squel=require(_0x8bfb('0xb'));var crypto=require(_0x8bfb('0xc'));var jsforce=require(_0x8bfb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8bfb('0xe'));var querystring=require(_0x8bfb('0xf'));var Papa=require(_0x8bfb('0x10'));var Redis=require(_0x8bfb('0x11'));var authService=require(_0x8bfb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8bfb('0x13'));var hardwareService=require(_0x8bfb('0x14'));var logger=require(_0x8bfb('0x15'))(_0x8bfb('0x16'));var utils=require('../../config/utils');var config=require(_0x8bfb('0x17'));var licenseUtil=require(_0x8bfb('0x18'));var db=require(_0x8bfb('0x19'))['db'];function respondWithStatusCode(_0x12dec1,_0x4ac179){_0x4ac179=_0x4ac179||0xcc;return function(_0x4985c5){if(_0x4985c5){return _0x12dec1['sendStatus'](_0x4ac179);}return _0x12dec1[_0x8bfb('0x1a')](_0x4ac179)[_0x8bfb('0x1b')]();};}function respondWithResult(_0x48e8a0,_0x36657f){_0x36657f=_0x36657f||0xc8;return function(_0x52e22b){if(_0x52e22b){return _0x48e8a0[_0x8bfb('0x1a')](_0x36657f)['json'](_0x52e22b);}};}function respondWithFilteredResult(_0x5c615d,_0x31a02c){return function(_0x87c62a){if(_0x87c62a){var _0x1a10ad=typeof _0x31a02c[_0x8bfb('0x1c')]===_0x8bfb('0x1d')&&typeof _0x31a02c['limit']===_0x8bfb('0x1d');var _0xbe5c42=_0x87c62a['count'];var _0x2a7ea2=_0x1a10ad?0x0:_0x31a02c[_0x8bfb('0x1c')];var _0x301c8a=_0x1a10ad?_0x87c62a['count']:_0x31a02c[_0x8bfb('0x1c')]+_0x31a02c['limit'];var _0x4ca033;if(_0x301c8a>=_0xbe5c42){_0x301c8a=_0xbe5c42;_0x4ca033=0xc8;}else{_0x4ca033=0xce;}_0x5c615d[_0x8bfb('0x1a')](_0x4ca033);return _0x5c615d['set'](_0x8bfb('0x1e'),_0x2a7ea2+'-'+_0x301c8a+'/'+_0xbe5c42)[_0x8bfb('0x1f')](_0x87c62a);}return null;};}function patchUpdates(_0xc949c7){return function(_0x2da1c0){try{jsonpatch[_0x8bfb('0x20')](_0x2da1c0,_0xc949c7,!![]);}catch(_0x1e36f0){return BPromise[_0x8bfb('0x21')](_0x1e36f0);}return _0x2da1c0[_0x8bfb('0x22')]();};}function saveUpdates(_0x11d2fa,_0x1220ac){return function(_0x56a39c){if(_0x56a39c){return _0x56a39c['update'](_0x11d2fa)['then'](function(_0x31b718){return _0x31b718;});}return null;};}function removeEntity(_0x1a412b,_0x5a8673){return function(_0x259b18){if(_0x259b18){return _0x259b18['destroy']()[_0x8bfb('0x23')](function(){var _0x4622d7=_0x259b18['get']({'plain':!![]});var _0x2a290c='Companies';return db[_0x8bfb('0x24')]['destroy']({'where':{'type':_0x2a290c,'resourceId':_0x4622d7['id']}})[_0x8bfb('0x23')](function(){return _0x259b18;});})['then'](function(){_0x1a412b[_0x8bfb('0x1a')](0xcc)[_0x8bfb('0x1b')]();});}};}function handleEntityNotFound(_0x2be4de,_0x59e449){return function(_0x539c6b){if(!_0x539c6b){_0x2be4de[_0x8bfb('0x25')](0x194);}return _0x539c6b;};}function handleError(_0x187849,_0x487462){_0x487462=_0x487462||0x1f4;return function(_0x58bd61){logger[_0x8bfb('0x26')](_0x58bd61[_0x8bfb('0x27')]);if(_0x58bd61[_0x8bfb('0x28')]){delete _0x58bd61['name'];}_0x187849[_0x8bfb('0x1a')](_0x487462)[_0x8bfb('0x29')](_0x58bd61);};}exports[_0x8bfb('0x2a')]=function(_0x5bef19,_0xd6e3fe){var _0x5dfd1b={},_0x1b27da={},_0x6bd547={'count':0x0,'rows':[]};return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](function(_0x48a054){_0x1b27da[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](_0x48a054);_0x1b27da[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x5bef19[_0x8bfb('0x2f')]);_0x1b27da[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x1b27da[_0x8bfb('0x2d')],_0x1b27da[_0x8bfb('0x2f')]);_0x5dfd1b[_0x8bfb('0x32')]=_['intersection'](_0x1b27da[_0x8bfb('0x2d')],qs['fields'](_0x5bef19['query'][_0x8bfb('0x33')]));_0x5dfd1b[_0x8bfb('0x32')]=_0x5dfd1b[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x5dfd1b[_0x8bfb('0x32')]:_0x1b27da[_0x8bfb('0x2d')];if(!_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x35')](_0x8bfb('0x36'))){_0x5dfd1b[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x5bef19['query']['limit']);_0x5dfd1b[_0x8bfb('0x1c')]=qs['offset'](_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x1c')]);}_0x5dfd1b['order']=qs[_0x8bfb('0x38')](_0x5bef19['query'][_0x8bfb('0x38')]);_0x5dfd1b[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x5bef19['query'],_0x1b27da[_0x8bfb('0x30')]),_0x48a054);if(_0x5bef19['query'][_0x8bfb('0x3a')]){_0x5dfd1b['where']=_[_0x8bfb('0x3b')](_0x5dfd1b[_0x8bfb('0x39')],{'$or':_[_0x8bfb('0x3c')](_0x5dfd1b[_0x8bfb('0x32')],function(_0x485f38){var _0x4e7a15={};_0x4e7a15[_0x485f38]={'$like':'%'+_0x5bef19[_0x8bfb('0x2f')]['filter']+'%'};return _0x4e7a15;})});}_0x5dfd1b=_['merge']({},_0x5dfd1b,_0x5bef19['options']);var _0xbffa9d={'where':_0x5dfd1b['where']};return db[_0x8bfb('0x2b')][_0x8bfb('0x3d')](_0xbffa9d)[_0x8bfb('0x23')](function(_0x4b2163){_0x6bd547[_0x8bfb('0x3d')]=_0x4b2163;if(_0x5bef19[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x5dfd1b['include']=[{'all':!![]}];}return db[_0x8bfb('0x2b')]['findAll'](_0x5dfd1b);})[_0x8bfb('0x23')](function(_0x2855f6){_0x6bd547[_0x8bfb('0x3f')]=_0x2855f6;return _0x6bd547;})[_0x8bfb('0x23')](respondWithFilteredResult(_0xd6e3fe,_0x5dfd1b))[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));})[_0x8bfb('0x40')](handleError(_0xd6e3fe,null));};exports[_0x8bfb('0x41')]=function(_0x4d5806,_0x527421){var _0x19f42e={'raw':![],'where':{'id':_0x4d5806[_0x8bfb('0x42')]['id']}},_0x5dbe5d={};_0x5dbe5d[_0x8bfb('0x2d')]=_['keys'](db[_0x8bfb('0x2b')][_0x8bfb('0x43')]);_0x5dbe5d[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x4d5806[_0x8bfb('0x2f')]);_0x5dbe5d[_0x8bfb('0x30')]=_['intersection'](_0x5dbe5d['model'],_0x5dbe5d[_0x8bfb('0x2f')]);_0x19f42e[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x5dbe5d['model'],qs[_0x8bfb('0x33')](_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x33')]));_0x19f42e['attributes']=_0x19f42e[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x19f42e[_0x8bfb('0x32')]:_0x5dbe5d[_0x8bfb('0x2d')];if(_0x4d5806[_0x8bfb('0x2f')][_0x8bfb('0x3e')]){_0x19f42e[_0x8bfb('0x44')]=[{'all':!![]}];}_0x19f42e=_['merge']({},_0x19f42e,_0x4d5806[_0x8bfb('0x45')]);return db['CmCompany'][_0x8bfb('0x46')](_0x19f42e)['then'](handleEntityNotFound(_0x527421,null))[_0x8bfb('0x23')](respondWithResult(_0x527421,null))[_0x8bfb('0x40')](handleError(_0x527421,null));};exports['create']=function(_0x36742e,_0x97f27a){return db[_0x8bfb('0x2b')][_0x8bfb('0x47')](_0x36742e[_0x8bfb('0x48')],{})['then'](function(_0x567824){var _0x1f2bf2=_0x36742e['user'][_0x8bfb('0x49')]({'plain':!![]});if(!_0x1f2bf2)throw new Error(_0x8bfb('0x4a'));if(_0x1f2bf2[_0x8bfb('0x4b')]==='user'){var _0x1b2ef5=_0x567824[_0x8bfb('0x49')]({'plain':!![]});var _0x38e2aa=_0x8bfb('0x4c');return db[_0x8bfb('0x4d')][_0x8bfb('0x46')]({'where':{'name':_0x38e2aa,'userProfileId':_0x1f2bf2['userProfileId']},'raw':!![]})[_0x8bfb('0x23')](function(_0x173ca1){if(_0x173ca1&&_0x173ca1[_0x8bfb('0x4e')]===0x0){return db[_0x8bfb('0x24')][_0x8bfb('0x47')]({'name':_0x1b2ef5[_0x8bfb('0x28')],'resourceId':_0x1b2ef5['id'],'type':_0x173ca1[_0x8bfb('0x28')],'sectionId':_0x173ca1['id']},{})[_0x8bfb('0x23')](function(){return _0x567824;});}else{return _0x567824;}})['catch'](function(_0x24a89d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24a89d);throw _0x24a89d;});}return _0x567824;})[_0x8bfb('0x23')](respondWithResult(_0x97f27a,0xc9))[_0x8bfb('0x40')](handleError(_0x97f27a,null));};exports[_0x8bfb('0x4f')]=function(_0x429620,_0x2a731d){if(_0x429620['body']['id']){delete _0x429620[_0x8bfb('0x48')]['id'];}return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x429620[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x2a731d,null))['then'](saveUpdates(_0x429620['body'],null))[_0x8bfb('0x23')](respondWithResult(_0x2a731d,null))[_0x8bfb('0x40')](handleError(_0x2a731d,null));};exports[_0x8bfb('0x50')]=function(_0x13754b,_0x24ae60){return db[_0x8bfb('0x2b')][_0x8bfb('0x46')]({'where':{'id':_0x13754b[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x24ae60,null))['then'](removeEntity(_0x24ae60,null))[_0x8bfb('0x40')](handleError(_0x24ae60,null));};exports['describe']=function(_0x1121e7,_0x353e64){return db[_0x8bfb('0x2b')][_0x8bfb('0x2c')]()[_0x8bfb('0x23')](respondWithResult(_0x353e64,null))[_0x8bfb('0x40')](handleError(_0x353e64,null));};exports[_0x8bfb('0x51')]=function(_0x44360d,_0x5a63c9,_0xd1099b){return db[_0x8bfb('0x52')][_0x8bfb('0x46')]({'where':{'id':_0x44360d[_0x8bfb('0x42')]['id']}})[_0x8bfb('0x23')](handleEntityNotFound(_0x5a63c9,null))['then'](function(_0x90d476){if(_0x90d476){return _0x90d476['addContacts'](_0x44360d[_0x8bfb('0x48')][_0x8bfb('0x53')],_[_0x8bfb('0x54')](_0x44360d[_0x8bfb('0x48')],[_0x8bfb('0x53'),'id'])||{});}})[_0x8bfb('0x23')](respondWithResult(_0x5a63c9,null))[_0x8bfb('0x40')](handleError(_0x5a63c9,null));};exports['getContacts']=function(_0x405c91,_0x1a6631,_0x50715f){var _0x378879={};var _0x566903={};var _0x8ac9ce;var _0xbfb29b;return db[_0x8bfb('0x2b')]['findOne']({'where':{'id':_0x405c91[_0x8bfb('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a6631,null))['then'](function(_0x23d001){if(_0x23d001){_0x8ac9ce=_0x23d001;_0x566903[_0x8bfb('0x2d')]=_[_0x8bfb('0x2e')](db[_0x8bfb('0x52')][_0x8bfb('0x43')]);_0x566903[_0x8bfb('0x2f')]=_[_0x8bfb('0x2e')](_0x405c91[_0x8bfb('0x2f')]);_0x566903[_0x8bfb('0x30')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],_0x566903[_0x8bfb('0x2f')]);_0x378879[_0x8bfb('0x32')]=_[_0x8bfb('0x31')](_0x566903[_0x8bfb('0x2d')],qs[_0x8bfb('0x33')](_0x405c91['query'][_0x8bfb('0x33')]));_0x378879[_0x8bfb('0x32')]=_0x378879[_0x8bfb('0x32')][_0x8bfb('0x34')]?_0x378879[_0x8bfb('0x32')]:_0x566903[_0x8bfb('0x2d')];_0x378879['order']=qs[_0x8bfb('0x38')](_0x405c91['query'][_0x8bfb('0x38')]);_0x378879[_0x8bfb('0x39')]=qs[_0x8bfb('0x30')](_['pick'](_0x405c91[_0x8bfb('0x2f')],_0x566903['filters']));if(_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x3a')]){_0x378879[_0x8bfb('0x39')]=_[_0x8bfb('0x3b')](_0x378879[_0x8bfb('0x39')],{'$or':_['map'](_0x378879[_0x8bfb('0x32')],function(_0x1d1312){var _0x360210={};_0x360210[_0x1d1312]={'$like':'%'+_0x405c91[_0x8bfb('0x2f')]['filter']+'%'};return _0x360210;})});}_0x378879=_[_0x8bfb('0x3b')]({},_0x378879,_0x405c91[_0x8bfb('0x45')]);return _0x8ac9ce[_0x8bfb('0x55')](_0x378879);}})[_0x8bfb('0x23')](function(_0x5580c0){if(_0x5580c0){_0xbfb29b=_0x5580c0[_0x8bfb('0x34')];if(!_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x35')]('nolimit')){_0x378879[_0x8bfb('0x37')]=qs[_0x8bfb('0x37')](_0x405c91[_0x8bfb('0x2f')][_0x8bfb('0x37')]);_0x378879['offset']=qs[_0x8bfb('0x1c')](_0x405c91['query'][_0x8bfb('0x1c')]);}return _0x8ac9ce['getContacts'](_0x378879);}})['then'](function(_0x32daf5){if(_0x32daf5){return _0x32daf5?{'count':_0xbfb29b,'rows':_0x32daf5}:null;}})['then'](respondWithResult(_0x1a6631,null))['catch'](handleError(_0x1a6631,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 207ec88..6b916d1 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 _0x4edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x3a450c,_0x9dced0){var _0x23a746=function(_0x34ac8a){while(--_0x34ac8a){_0x3a450c['push'](_0x3a450c['shift']());}};_0x23a746(++_0x9dced0);}(_0x4edd,0x193));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var logger=require('../../config/logger')(_0xd4ed('0x2'));var moment=require(_0xd4ed('0x3'));var BPromise=require(_0xd4ed('0x4'));var rp=require(_0xd4ed('0x5'));var fs=require('fs');var path=require(_0xd4ed('0x6'));var rimraf=require(_0xd4ed('0x7'));var config=require(_0xd4ed('0x8'));var attributes=require(_0xd4ed('0x9'));module[_0xd4ed('0xa')]=function(_0x56bc60,_0x27495c){return _0x56bc60[_0xd4ed('0xb')](_0xd4ed('0xc'),attributes,{'tableName':_0xd4ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x42cd=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','define','CmCompany','cm_companies'];(function(_0x4d168e,_0x2c6b65){var _0x2009e1=function(_0x51b144){while(--_0x51b144){_0x4d168e['push'](_0x4d168e['shift']());}};_0x2009e1(++_0x2c6b65);}(_0x42cd,0xf0));var _0xd42c=function(_0x3282a2,_0xb4b2c9){_0x3282a2=_0x3282a2-0x0;var _0xdec417=_0x42cd[_0x3282a2];return _0xdec417;};'use strict';var _=require(_0xd42c('0x0'));var util=require(_0xd42c('0x1'));var logger=require(_0xd42c('0x2'))(_0xd42c('0x3'));var moment=require('moment');var BPromise=require(_0xd42c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd42c('0x5'));var rimraf=require('rimraf');var config=require(_0xd42c('0x6'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x29bc09,_0xa3d6f){return _0x29bc09[_0xd42c('0x7')](_0xd42c('0x8'),attributes,{'tableName':_0xd42c('0x9'),'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 ceba313..18ea631 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 _0xafe5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xafe5,0x15f));var _0x5afe=function(_0x1c63b2,_0x44eb5b){_0x1c63b2=_0x1c63b2-0x0;var _0x3fa7b8=_0xafe5[_0x1c63b2];return _0x3fa7b8;};'use strict';var _=require(_0x5afe('0x0'));var util=require(_0x5afe('0x1'));var moment=require(_0x5afe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5afe('0x3'));var fs=require('fs');var Redis=require(_0x5afe('0x4'));var db=require(_0x5afe('0x5'))['db'];var utils=require(_0x5afe('0x6'));var logger=require(_0x5afe('0x7'))('rpc');var config=require(_0x5afe('0x8'));var jayson=require(_0x5afe('0x9'));var client=jayson[_0x5afe('0xa')][_0x5afe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaf35a,_0x18b10c,_0x597ad4){return new BPromise(function(_0x358b1f,_0xa7246){return client[_0x5afe('0xc')](_0xbaf35a,_0x597ad4)['then'](function(_0x723804){logger[_0x5afe('0xd')]('CmCompany,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'));logger[_0x5afe('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'),JSON[_0x5afe('0x10')](_0x723804));if(_0x723804[_0x5afe('0x11')]){if(_0x723804[_0x5afe('0x11')][_0x5afe('0x12')]===0x1f4){logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804['error']['message']);return _0xa7246(_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);}logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);return _0x358b1f(_0x723804[_0x5afe('0x11')]['message']);}else{logger[_0x5afe('0xd')](_0x5afe('0x13'),_0x18b10c,_0x5afe('0xe'));_0x358b1f(_0x723804[_0x5afe('0x15')][_0x5afe('0x14')]);}})['catch'](function(_0x516978){logger[_0x5afe('0x11')](_0x5afe('0x13'),_0x18b10c,_0x516978);_0xa7246(_0x516978);});});}
\ No newline at end of file
+var _0xa59f=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa59f,0x16b));var _0xfa59=function(_0x51fe46,_0xb550d1){_0x51fe46=_0x51fe46-0x0;var _0x4d62c2=_0xa59f[_0x51fe46];return _0x4d62c2;};'use strict';var _=require(_0xfa59('0x0'));var util=require(_0xfa59('0x1'));var moment=require(_0xfa59('0x2'));var BPromise=require(_0xfa59('0x3'));var rs=require(_0xfa59('0x4'));var fs=require('fs');var Redis=require(_0xfa59('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfa59('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa59('0x7')][_0xfa59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345d54,_0x2af8f9,_0xfcb4e7){return new BPromise(function(_0x262e83,_0x137313){return client[_0xfa59('0x9')](_0x345d54,_0xfcb4e7)['then'](function(_0x235563){logger[_0xfa59('0xa')](_0xfa59('0xb'),_0x2af8f9,'request\x20sent');logger[_0xfa59('0xc')](_0xfa59('0xd'),_0x2af8f9,'request\x20sent',JSON[_0xfa59('0xe')](_0x235563));if(_0x235563[_0xfa59('0xf')]){if(_0x235563[_0xfa59('0xf')][_0xfa59('0x10')]===0x1f4){logger['error'](_0xfa59('0xb'),_0x2af8f9,_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);return _0x137313(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x235563['error'][_0xfa59('0x11')]);return _0x262e83(_0x235563[_0xfa59('0xf')][_0xfa59('0x11')]);}else{logger[_0xfa59('0xa')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0xfa59('0x12'));_0x262e83(_0x235563[_0xfa59('0x13')]['message']);}})[_0xfa59('0x14')](function(_0x3e7983){logger[_0xfa59('0xf')]('CmCompany,\x20%s,\x20%s',_0x2af8f9,_0x3e7983);_0x137313(_0x3e7983);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 6cb6424..30bf0e2 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 _0x63a9=['get','index','/describe','isAuthenticated','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x1823a0,_0x38947d){var _0x2b780c=function(_0x39d289){while(--_0x39d289){_0x1823a0['push'](_0x1823a0['shift']());}};_0x2b780c(++_0x38947d);}(_0x63a9,0x14f));var _0x963a=function(_0x5649c3,_0x111ee5){_0x5649c3=_0x5649c3-0x0;var _0x4006aa=_0x63a9[_0x5649c3];return _0x4006aa;};'use strict';var multer=require(_0x963a('0x0'));var util=require('util');var path=require(_0x963a('0x1'));var timeout=require(_0x963a('0x2'));var express=require(_0x963a('0x3'));var router=express[_0x963a('0x4')]();var fs_extra=require(_0x963a('0x5'));var auth=require(_0x963a('0x6'));var interaction=require(_0x963a('0x7'));var config=require(_0x963a('0x8'));var controller=require(_0x963a('0x9'));router[_0x963a('0xa')]('/',auth['isAuthenticated'](),controller[_0x963a('0xb')]);router['get'](_0x963a('0xc'),auth[_0x963a('0xd')](),controller['describe']);router['get'](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['show']);router[_0x963a('0xa')](_0x963a('0xf'),auth['isAuthenticated'](),controller[_0x963a('0x10')]);router[_0x963a('0x11')]('/',auth[_0x963a('0xd')](),controller[_0x963a('0x12')]);router[_0x963a('0x11')]('/:id/contacts',auth[_0x963a('0xd')](),controller['addContacts']);router[_0x963a('0x13')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['update']);router[_0x963a('0x14')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller[_0x963a('0x15')]);module[_0x963a('0x16')]=router;
\ No newline at end of file
+var _0x2477=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','addContacts'];(function(_0x371a41,_0x2a19cc){var _0x360d99=function(_0x17a760){while(--_0x17a760){_0x371a41['push'](_0x371a41['shift']());}};_0x360d99(++_0x2a19cc);}(_0x2477,0x138));var _0x7247=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x2477[_0x3bef2c];return _0x331503;};'use strict';var multer=require(_0x7247('0x0'));var util=require(_0x7247('0x1'));var path=require(_0x7247('0x2'));var timeout=require(_0x7247('0x3'));var express=require(_0x7247('0x4'));var router=express[_0x7247('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7247('0x6'));var interaction=require(_0x7247('0x7'));var config=require('../../config/environment');var controller=require(_0x7247('0x8'));router[_0x7247('0x9')]('/',auth[_0x7247('0xa')](),controller[_0x7247('0xb')]);router[_0x7247('0x9')](_0x7247('0xc'),auth[_0x7247('0xa')](),controller[_0x7247('0xd')]);router[_0x7247('0x9')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0xe')]);router[_0x7247('0x9')](_0x7247('0xf'),auth[_0x7247('0xa')](),controller['getContacts']);router['post']('/',auth[_0x7247('0xa')](),controller['create']);router[_0x7247('0x10')]('/:id/contacts',auth[_0x7247('0xa')](),controller[_0x7247('0x11')]);router[_0x7247('0x12')]('/:id',auth[_0x7247('0xa')](),controller[_0x7247('0x13')]);router[_0x7247('0x14')]('/:id',auth[_0x7247('0xa')](),controller['destroy']);module[_0x7247('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index b90de5b..6121b3a 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 _0xc43e=['INTEGER','sequelize','STRING','TEXT','UNSIGNED','DATE','NOW'];(function(_0x143bb3,_0x3b1ff9){var _0x358977=function(_0x12743d){while(--_0x12743d){_0x143bb3['push'](_0x143bb3['shift']());}};_0x358977(++_0x3b1ff9);}(_0xc43e,0x13c));var _0xec43=function(_0xdfdcec,_0x5e4bc5){_0xdfdcec=_0xdfdcec-0x0;var _0x4dfb91=_0xc43e[_0xdfdcec];return _0x4dfb91;};'use strict';var _=require('lodash');var Sequelize=require(_0xec43('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xec43('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xec43('0x1')]},'street':{'type':Sequelize[_0xec43('0x1')]},'postalCode':{'type':Sequelize[_0xec43('0x1')]},'city':{'type':Sequelize[_0xec43('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xec43('0x1')]},'description':{'type':Sequelize[_0xec43('0x2')]},'phone':{'type':Sequelize[_0xec43('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xec43('0x1')]},'email':{'type':Sequelize[_0xec43('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xec43('0x1')]},'fb_data':{'type':Sequelize[_0xec43('0x1')]},'twitter':{'type':Sequelize[_0xec43('0x1')]},'skype':{'type':Sequelize[_0xec43('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xec43('0x1')]},'telegram':{'type':Sequelize[_0xec43('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xec43('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xec43('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xec43('0x4')],'defaultValue':Sequelize[_0xec43('0x5')]},'dialTimezone':{'type':Sequelize[_0xec43('0x1')]},'utcOffset':{'type':Sequelize[_0xec43('0x6')]}};
\ No newline at end of file
+var _0x80c1=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80c1,0x68));var _0x180c=function(_0x437c62,_0x593e7a){_0x437c62=_0x437c62-0x0;var _0x6fb267=_0x80c1[_0x437c62];return _0x6fb267;};'use strict';var _=require('lodash');var Sequelize=require(_0x180c('0x0'));module[_0x180c('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x180c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x180c('0x2')]},'country':{'type':Sequelize[_0x180c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x180c('0x2')]},'description':{'type':Sequelize[_0x180c('0x3')]},'phone':{'type':Sequelize[_0x180c('0x2')]},'mobile':{'type':Sequelize[_0x180c('0x2')]},'fax':{'type':Sequelize[_0x180c('0x2')]},'email':{'type':Sequelize[_0x180c('0x2')]},'url':{'type':Sequelize[_0x180c('0x2')]},'facebook':{'type':Sequelize[_0x180c('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x180c('0x2')]},'skype':{'type':Sequelize[_0x180c('0x2')]},'teams':{'type':Sequelize[_0x180c('0x2')]},'viber':{'type':Sequelize[_0x180c('0x2')]},'line':{'type':Sequelize[_0x180c('0x2')]},'wechat':{'type':Sequelize[_0x180c('0x2')]},'telegram':{'type':Sequelize[_0x180c('0x2')]},'UserId':{'type':Sequelize[_0x180c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x180c('0x2')]},'priority':{'type':Sequelize[_0x180c('0x4')](0x2)[_0x180c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x180c('0x6')],'defaultValue':Sequelize[_0x180c('0x7')]},'dialTimezone':{'type':Sequelize[_0x180c('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e6c4b68..8ffb047 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body'];(function(_0x45057d,_0x486d28){var _0x2f5bc9=function(_0x7627d1){while(--_0x7627d1){_0x45057d['push'](_0x45057d['shift']());}};_0x2f5bc9(++_0x486d28);}(_0x42aa,0xbb));var _0xa42a=function(_0x284c91,_0x199b02){_0x284c91=_0x284c91-0x0;var _0x4050e1=_0x42aa[_0x284c91];return _0x4050e1;};'use strict';var _=require(_0xa42a('0x0'));var moment=require(_0xa42a('0x1'));var random=require(_0xa42a('0x2'));var fs=require('fs');var path=require(_0xa42a('0x3'));var util=require(_0xa42a('0x4'));var tnef=require('node-tnef');var logger=require(_0xa42a('0x5'))(_0xa42a('0x6'));var config=require('../../../config/environment');function getAddress(_0x1a0927){var _0x579138=_[_0xa42a('0x7')](_0x1a0927[_0xa42a('0x8')]);return _0x579138&&_0x579138[_0xa42a('0x9')]?_0x579138['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');}function getFirstName(_0x5041f6){var _0x32238f=_[_0xa42a('0x7')](_0x5041f6[_0xa42a('0x8')]);if(_0x32238f&&_0x32238f[_0xa42a('0xd')]){if(_0x32238f[_0xa42a('0xd')]==_0x32238f['address']){return _0x32238f[_0xa42a('0xd')]['substring'](0x0,_0x32238f['name']['indexOf']('@'));}var _0x4b1c3c=_0x32238f['name'][_0xa42a('0xe')](/\s+/);return _0x4b1c3c[_0xa42a('0xf')]>0x1?_0x4b1c3c['slice'](0x0,-0x1)[_0xa42a('0x10')]('\x20'):_0x32238f[_0xa42a('0xd')];}return _0xa42a('0x11');}function getLastName(_0x2ff9d6){var _0x5d6373=_[_0xa42a('0x7')](_0x2ff9d6[_0xa42a('0x8')]);if(_0x5d6373&&_0x5d6373[_0xa42a('0xd')]){var _0x13fc18=_0x5d6373[_0xa42a('0xd')][_0xa42a('0xe')](/\s+/);return _0x13fc18[_0xa42a('0xf')]>0x1?_0x13fc18['pop']():'';}return'';}function getMails(_0x54c562,_0x4f2e05){var _0xa20056='';for(var _0x13db22=0x0;_0x13db22<_0x4f2e05[_0xa42a('0x8')][_0xa42a('0xf')];_0x13db22+=0x1){if(_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]!==_0x54c562){if(!_[_0xa42a('0x12')](_0xa20056)){_0xa20056+=',';}_0xa20056+=_0x4f2e05['value'][_0x13db22][_0xa42a('0xd')]||_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']||'';_0xa20056+='\x20<';_0xa20056+=_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]?_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');_0xa20056+='>';}}return _0xa20056;}function parseEmail(_0xe1a333,_0x222ae5,_0x4e3454){if(_0x222ae5[_0xa42a('0x13')]){var _0x21dd00=/